code: def possibly_convert_to_numpy(
      x: Any,
  ) -> Any:  # possibly convert to native
      """Convert things without a 'shape' to ndarrays, but leave everything else.
  
      Examples
      --------
      >>> oe.parser.possibly_convert_to_numpy(5)
      array(5)
  
      >>> oe.parser.possibly_convert_to_numpy([5, 3])
      array([5, 3])
  
      >>> oe.parser.possibly_convert_to_numpy(np.array([5, 3]))
      array([5, 3])
  
      # Any class with a shape is passed through
      >>> class Shape:
      ...     def __init__(self, shape):
      ...         self.shape = shape
      ...
  
      >>> myshape = Shape((5, 5))
      >>> oe.parser.possibly_convert_to_numpy(myshape)
      <__main__.Shape object at 0x10f850710>
      """
      if not hasattr(x, "shape"):
          return np.asanyarray(x)
      else:
          return x
  
file_path: ivy/ivy/utils/einsum_parser.py
imports: import itertools
  from typing import Any, Dict, Iterator, List, Tuple, Union
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: possibly_convert_to_numpy(x) and returns: np, x