code: def _prepare_func(func_or_y):
      """Creates a function out of the input callable or `Tensor`."""
      if callable(func_or_y):
          return func_or_y
      else:
          return lambda *args: func_or_y
  
file_path: tf-quant-finance/tf_quant_finance/math/gradient.py
imports: import functools
  import tensorflow.compat.v2
label_desc: Use image node_id 5 for calling a global function with example usage: _prepare_func(func_or_y) and returns: func_or_y, function