code: def get_canonical_name(
      tensor_type, rank, dtype, num_records, partitions
  ):
      """Get canonical name which is used as key in global data source registry.
  
      Args:
        tensor_type: A TensorType enum.
        rank: An int to represent the rank of tensor.
        dtype: tf.dtypes.DType.
        num_records: Number of records.
        partitions: Number of file partitions.
  
      Returns:
        The canonical name to represent such data source in registry.
  
      Raises:
        TypeError: If tensor_type is not TensorType.
        ValueError: if rank is unknown or negative.
      """
      if not isinstance(tensor_type, TensorType):
          raise TypeError(
              "Input tensor_type must be a TensorType enum"
              f" but found {tensor_type}"
          )
  
      if rank is None or rank < 0:
          raise ValueError(
              "Input rank must not be None or negative. Found {rank}."
          )
  
      return f"{tensor_type.name}_{rank}D_{dtype.name}_{num_records}_{partitions}"
  
file_path: io/tests/test_atds_avro/utils/data_source_registry.py
imports: from enum import Enum
  import numpy
  import tensorflow
  from tensorflow.python.framework import registry
  from tests.test_atds_avro.utils.data_source import DataSource
  from tests.test_atds_avro.utils.generator.tensor_generator import IntTensorGenerator, FloatTensorGenerator, WordTensorGenerator, BoolTensorGenerator
  from tests.test_atds_avro.utils.generator.sparse_tensor_generator import IntSparseTensorGenerator, FloatSparseTensorGenerator, WordSparseTensorGenerator, BoolSparseTensorGenerator, ValueDistribution
  from tests.test_atds_avro.utils.generator.varlen_tensor_generator import DimensionDistribution, IntVarLenTensorGenerator, FloatVarLenTensorGenerator, WordVarLenTensorGenerator, BoolVarLenTensorGenerator, DIM_DISTRIBUTION_TO_RANGE
label_desc: Use image node_id 1 for calling a global function with example usage: get_canonical_name(tensor_type, rank, dtype, num_records, partitions) and returns: tensor_type, str, rank, str, dtype, str, num_records, str, partitions