code: def shape(
      x: np.ndarray,
      /,
      *,
      as_array: bool = False,
  ) -> Union[ivy.Shape, ivy.Array]:
      if as_array:
          return ivy.array(np.shape(x), dtype=ivy.default_int_dtype())
      else:
          return ivy.Shape(x.shape)
  
imports: from typing import Optional, Union, Sequence, Callable, Tuple
  import numpy
  from operator import mul
  from functools import reduce
  import multiprocessing
  from numbers import Number
  import ivy
  from ivy.functional.backends.numpy.helpers import _scalar_output_to_0d_array
  from ivy.func_wrapper import with_unsupported_dtypes
  from .None import backend_version
  from ...ivy.general import _broadcast_to
label_desc: Use image node_id 22 for calling a global function with example usage: shape() and returns: ivy, ivy