code: def labels_to_bimap(labels):
      """Creates mappings from label to id, and from id to label. See details in docs for BiMap.
  
      Args:
          labels: sequence of label to map to ids.
  
      Returns:
          Tuple[Dict, Dict]: mappings from labels to ids, and ids to labels.
  
      """
      label2id, id2label = BiMap(
          a=labels, b=list(range(len(labels)))
      ).get_maps()
      return label2id, id2label
  
imports: import numpy
  from dataclasses import dataclass
  from typing import List, NamedTuple
  from jiant.tasks.core import FeaturizationSpec
  from jiant.tasks.utils import truncate_sequences, pad_to_max_seq_length
  from jiant.utils.python.datastructures import BiMap
label_desc: Use image node_id 10 for calling a global function with example usage: labels_to_bimap(labels) and returns: label2id,  id2label