code: def test_process_label(self):
      # 1D number labels
      dataset_labels = np.array([1, 1, 10, 13, 13, 13, 15])
      batch_labels = np.array([1, 10, 1, 13, 10, 15, 15, 15])
      mapped_batch_labels = np.array([0, 1, 0, 2, 1, 3, 3, 3])
      process_label_helper(
          self,
          dataset_labels,
          batch_labels,
          mapped_batch_labels,
          batch_labels,
          0,
      )
  
      # 1D string labels
      # These work only with set_min_label_to_zero=True
      # The labels will be sorted alphabetically. So in the following, "bear" becomes 0
      dataset_labels = np.array(
          ["dog", "dog", "cat", "bear", "bear", "bear", "lion"]
      )
      batch_labels = np.array(
          ["dog", "cat", "dog", "bear", "cat", "lion", "lion", "lion"]
      )
      mapped_batch_labels = np.array([2, 1, 2, 0, 1, 3, 3, 3])
      process_label_helper(
          self,
          dataset_labels,
          batch_labels,
          mapped_batch_labels,
          batch_labels,
          0,
          input_is_string=True,
      )
  
      # 2D number labels
      dataset_labels = np.array(
          [[1, 1, 10, 13, 13, 13, 15], [10, 20, 30, 40, 50, 60, 70]]
      ).transpose()
      batch_labels = np.array(
          [
              [1, 10, 1, 13, 10, 15, 15, 15],
              [30, 70, 40, 10, 70, 60, 50, 40],
          ]
      ).transpose()
      mapped_batch_labels0 = np.array([0, 1, 0, 2, 1, 3, 3, 3])
      mapped_batch_labels1 = np.array([2, 6, 3, 0, 6, 5, 4, 3])
      process_label_helper2d(
          self,
          dataset_labels,
          batch_labels,
          [mapped_batch_labels0, mapped_batch_labels1],
      )
  
      # 2D string labels
      dataset_labels = np.array(
          [
              ["dog", "dog", "cat", "bear", "bear", "bear", "lion"],
              ["A.1", "A.2", "A.3", "A.4", "A.5", "A.6", "A.7"],
          ]
      ).transpose()
      batch_labels = np.array(
          [
              [
                  "dog",
                  "cat",
                  "dog",
                  "bear",
                  "cat",
                  "lion",
                  "lion",
                  "lion",
              ],
              ["A.3", "A.7", "A.4", "A.1", "A.7", "A.6", "A.5", "A.4"],
          ]
      ).transpose()
      mapped_batch_labels0 = np.array([2, 1, 2, 0, 1, 3, 3, 3])
      mapped_batch_labels1 = np.array([2, 6, 3, 0, 6, 5, 4, 3])
      process_label_helper2d(
          self,
          dataset_labels,
          batch_labels,
          [mapped_batch_labels0, mapped_batch_labels1],
          input_is_string=True,
      )
  
file_path: pytorch-metric-learning/tests/utils/test_common_functions.py
imports: import logging
  import unittest
  import numpy
  import torch
  from sklearn.preprocessing import StandardScaler
  from pytorch_metric_learning.losses import TripletMarginLoss
  from pytorch_metric_learning.utils import common_functions
  from ..None import WITH_COLLECT_STATS
label_desc: Use image node_id 5 for calling the TestCommonFunctions obj's underlying member method code with example usage: obj.test_process_label() without return types