10 examples of 'def multiply(a, b): a * b' in Python

Every line of 'def multiply(a, b): a * b' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
8def multiply(a, b):
9 """
10 >>> multiply(4, 3)
11 12
12 >>> multiply('a', 3)
13 'aaa'
14 """
15 return a * b
1304def multiply(a: T.FloatTensor, b: T.FloatTensor) -> T.FloatTensor:
1305 """
1306 Multiply tensor b with tensor a using broadcasting.
1307
1308 Args:
1309 a: A tensor
1310 b: A tensor
1311
1312 Returns:
1313 tensor: a * b
1314
1315 """
1316 return a * b
45def multiply(a, b):
46 print("MULTIPLYING %d * %d" % (a, b))
47 return a * b
111def MUL(a, b):
112 print "Multiplying %d * %d" % (a, b)
113 return a * b
534@export
535def mul(a, b):
536 return a * b
1210@mul.extend(Constant, Diagonal)
1211def mul(a, b): return Diagonal(a.constant * B.diag(b), *B.shape(a))
31def __mul__(a,b):
32 ibi = b.i
33 if (a.j & 1):
34 ibi = -ibi
35 ci = (a.i + ibi) % 3
36 cj = (a.j + b.j) % 4
37 c = T_t(ci, cj)
38 return c
315@_scal_inplace
316def mul_inplace(a, b):
317 """elementwise multiplication (inplace on `a`)"""
394def ParMult(A, B):
395 return _hypre.ParMult(A, B)
46def multiply(a: Image, b: Image)->Image:
47 return modules.images_internal.multiply(a, b)

Related snippets