code: def is_callable(var_or_fn):
      """Returns whether an object is callable or not."""
      # Python 2.7 as well as Python 3.x with x > 2 support 'callable'.
      # In between, callable was removed hence we need to do a more expansive check
      if hasattr(var_or_fn, "__call__"):
          return True
      try:
          return callable(var_or_fn)
      except NameError:
          return False
  
file_path: tf-quant-finance/tf_quant_finance/models/legacy/brownian_motion_utils.py
imports: import tensorflow.compat.v2
  from tf_quant_finance.math import gradient
label_desc: Use image node_id 1 for calling a global function with example usage: is_callable(var_or_fn) and returns: True, callable, False