code: def to_numpy(
      x: Union[paddle.Tensor, List[paddle.Tensor]],
      /,
      *,
      copy: bool = True,
  ) -> Union[np.ndarray, List[np.ndarray]]:
      if isinstance(x, (float, int, bool)):
          return x
      elif isinstance(x, np.ndarray):
          if copy:
              return x.copy()
          else:
              return x
      elif paddle.is_tensor(x):
          dtype = ivy.as_ivy_dtype(x.dtype)
          if dtype == "bfloat16":
              x = x.astype("float32")
          if copy:
              return np.array(x).astype(dtype)
          else:
              return np.asarray(x).astype(dtype)
      elif isinstance(x, list):
          return [ivy.to_numpy(u) for u in x]
      raise ivy.utils.exceptions.IvyException(
          "Expected a Paddle Tensor."
      )
  
imports: from numbers import Number
  from typing import Optional, Union, Sequence, Callable, List, Tuple
  import paddle
  import numpy
  import multiprocessing
  import ivy
  import ivy.functional.backends.paddle
  from ivy.func_wrapper import with_unsupported_device_and_dtypes
  from ivy.functional.ivy.general import _broadcast_to
  from ivy.utils.exceptions import _check_inplace_update_support
  from .None import backend_version
label_desc: Use image node_id 8 for calling a global function with example usage: to_numpy() and returns: x, x, x, np, np, unknown