code: def cos(x):
      """Cosine function which can operate on floats and `Tensor`s."""
      return math.cos(x) if isinstance(x, float) else tf.cos(x)
  
imports: import math
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
  from tf_quant_finance.math.root_search import utils
label_desc: Use image node_id 3 for calling a global function with example usage: cos(x) and returns: unknown