code: def clean_tensor_type(dtype: np.dtype):
      """
      This method strips away the size information stored in flexible datatypes such as np.str_ and
      np.bytes_. Other numpy dtypes are returned unchanged.
  
      Args:
          dtype: Numpy dtype of a tensor
  
      Returns:
          dtype: Cleaned numpy dtype
      """
      if not isinstance(dtype, np.dtype):
          raise TypeError(
              f"Expected `type` to be instance of `{np.dtype}`, received `{dtype.__class__}`"
          )
  
      # Special casing for np.str_ and np.bytes_
      if dtype.char == "U":
          return np.dtype("str")
      elif dtype.char == "S":
          return np.dtype("bytes")
      return dtype
  
imports: import logging
  import warnings
  from collections import defaultdict
  from typing import Any, Dict, List, Optional, Union
  import numpy
  import pandas
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
  from mlflow.types import DataType
  from mlflow.types.schema import Array, ColSpec, Object, ParamSchema, ParamSpec, Property, Schema, TensorSpec
label_desc: Use image node_id 2 for calling a global function with example usage: clean_tensor_type(dtype) and returns: dtype, np, np