code: def mapping(entities: List[int], maps: List[int]) -> List[int]:
      """
      Map a list of entities to its corresponding entities
  
      Parameters
      ----------
      entities:
          a list of given entities
  
      maps:
          a list of mapped entities, such that the i'th indexed token should be mapped to `maps[i]`
  
      Returns
      ---------
      mapped_entities:
          a list of mapped entities
  
      Examples
      --------
      >>> unique_identities = [0, 1, 2, 3, 4]  # ["O", "B-PER", "I-PER", "B-LOC", "I-LOC"]
      >>> maps = [0, 1, 1, 2, 2]  # ["O", "PER", "PER", "LOC", "LOC"]
      >>> mapping(unique_identities, maps)
      [0, 1, 1, 2, 2]  # ["O", "PER", "PER", "LOC", "LOC"]
      >>> mapping([0, 0, 4, 4, 3, 4, 0, 2], maps)
      [0, 0, 2, 2, 2, 2, 0, 1]  # ["O", "O", "LOC", "LOC", "LOC", "LOC", "O", "PER"]
      """
      f = lambda x: maps[x]
      return list(map(f, entities))
  
file_path: cleanlab/cleanlab/internal/token_classification_utils.py
imports: from __future__ import annotations
  import re
  import string
  import numpy
  from termcolor import colored
  from typing import List, Optional, Callable, Tuple, TypeVar, TYPE_CHECKING
label_desc: Use image node_id 4 for calling a global function with example usage: mapping(entities, maps) and returns: list