code: def convert_to_ndarray(test_obj, a):
      """Converts the input `a` into an ndarray.
  
      Args:
        test_obj: An object which has the `evaluate` method. Used to evaluate `a` if
          `a` is a Tensor.
        a: Object to be converted to an ndarray.
  
      Returns:
        An ndarray containing the values of `a`.
      """
      # TODO(b/177990397): This function should be independent of the test framework
      # If a is tensor-like then convert it to ndarray
      if tf.is_tensor(a):
          a = test_obj.evaluate(a)
      if not isinstance(a, np.ndarray):
          return np.array(a)
      return a
  
file_path: tf-quant-finance/tf_quant_finance/models/geometric_brownian_motion/geometric_brownian_motion_test_utils.py
imports: import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
label_desc: Use image node_id 1 for calling a global function with example usage: convert_to_ndarray(test_obj, a) and returns: a, np