code: def create_populated_numpy_ndarray(
      input_shape: Union[list, tuple],
      dtype: str,
      input_tensor_populator,
  ) -> np.ndarray:
      """
      Create a numpy tensor with the specified shape, dtype, and content.
      """
      itp = input_tensor_populator  # just for brevity
  
      if isinstance(itp, TensorContentConstant):
          return np.full(
              tuple(input_shape), itp.elem_value, dtype=dtype
          )
  
      elif isinstance(itp, TensorContentDtypeMin):
          info = get_numpy_dtype_info(dtype)
          return np.full(tuple(input_shape), info.min, dtype=dtype)
  
      elif isinstance(itp, TensorContentDtypeMax):
          info = get_numpy_dtype_info(dtype)
          return np.full(tuple(input_shape), info.max, dtype=dtype)
  
      elif isinstance(itp, TensorContentRandom):
          return np.random.random(input_shape).astype(dtype)
  
      elif isinstance(itp, TensorContentSequentialCOrder):
          a = np.empty(tuple(input_shape), dtype)
  
          with np.nditer(
              a, op_flags=["writeonly"], order="C"
          ) as iterator:
              next_elem_val = itp.start_value
              for elem in iterator:
                  elem[...] = next_elem_val
                  next_elem_val += itp.increment
          return a
  
      else:
          raise ValueError(
              f"Unexpected input_tensor_populator type: {type(itp)}"
          )
  
imports: from typing import List, Optional, Union
  import collections
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: create_populated_numpy_ndarray(input_shape, dtype, input_tensor_populator) and returns: np, np, np, np, a