docstr: Register a regexp -> label mapping.
  
  Args:
      mapping: A list of tuples or a single tuple representing a mapping as regexp -> label
docstr_tok: ["Register","a","regexp","-",">","label","mapping",".","Args",":","mapping",":","A","list","of","tuples","or","a","single","tuple","representing","a","mapping","as","regexp","-",">","label"]
code: def register_labels(
      self, mapping: Union[List[Tuple[str, str]], Tuple[str, str]]
  ):
      """Register a regexp -> label mapping.
  
      Args:
          mapping: A list of tuples or a single tuple representing a mapping as regexp -> label
      """
      mapping = self._listify(mapping)
  
      for regexp, label in mapping:
          try:
              self._regexp_mapping[label] = re.compile(regexp)
          except re.error as err:
              raise re.error(
                  f"Couldn't compile regexp '{regexp}' for label '{label}'. Aborted with error: '{err.msg}'"
              )
  
file_path: flair/flair/models/regexp_tagger.py
imports: import re
  import typing
  from dataclasses import dataclass, field
  from typing import Dict, List, Tuple, Union
  from flair.data import Sentence, Span, Token
label_desc: Use image node_id 3 for calling the RegexpTagger obj's underlying member method code with example usage: obj.register_labels(mapping) without return types