code: def to_numpy(tensor: TensorLike) -> np.ndarray:
      """Copy `input` DTensor to an equivalent local numpy array."""
      layout = api.fetch_layout(tensor)
      if layout.mesh.is_remote():
          return np.array([None])
  
      unpacked = [tensor.numpy() for tensor in api.unpack(tensor)]
      return unpacked_to_numpy(unpacked, layout)
  
file_path: tensorflow/tensorflow/dtensor/python/numpy_util.py
imports: from typing import List
  import numpy
  from tensorflow.dtensor.python import api
  from tensorflow.dtensor.python import layout
  from tensorflow.python.eager.polymorphic_function import polymorphic_function
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.ops import stateless_random_ops
  from tensorflow.python.types.core import Tensor, TensorLike
label_desc: Use image node_id 2 for calling a global function with example usage: to_numpy(tensor) and returns: unpacked_to_numpy, np