Skip to content

Instantly share code, notes, and snippets.

View NMZivkovic's full-sized avatar

Nikola Živković NMZivkovic

View GitHub Profile
def function (a, b = 11, /):
print(a + b)
function(9)
def function (a, b = 10/):
print(a + b)
# a is not a keyword argument
function(b = 11, 9)
function(11, a = 9)
# Option 1
function(11, 9)
# Option 2
function(a = 11, 9)
def function(a /, b):
print(a + b)
if (length := len(message)) < 11:
print(f"Message is too short! ({length} characters)")
chat = list()
while (message := input("Insert something: ")) != "exit chat":
inputs.append(message)
chat = list()
while True:
message = input("Message: ")
if single_command == "exit chat":
break
chat.append(message)
print(x := 11)
const pred = await tf.tidy(() => {
// Convert the canvas pixels to
let image = this.getImage(canvasHtmlElement)
// Make and format the predications
const output = this.model.predict(image) as any;
let predictions = Array.from(output.dataSync());
console.log(predictions);
// Write out the prediction.