code: def quantize(f, q, op=np.floor):
      """Quantizes f to be divisible by q and have q's type."""
      quantized = Decimal(op(f / q)) * Decimal(str(q))
      return type(q)(quantized)
  
file_path: pycls/pycls/sweep/random.py
imports: from decimal import Decimal
  import matplotlib.pyplot
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: quantize(f, q, op) and returns: type