code: def __init__(self, lexicon, flags=0):
      from ._constants import BRANCH, SUBPATTERN
  
      if isinstance(flags, RegexFlag):
          flags = flags.value
      self.lexicon = lexicon
      # combine phrases into a compound pattern
      p = []
      s = _parser.State()
      s.flags = flags
      for phrase, action in lexicon:
          gid = s.opengroup()
          p.append(
              _parser.SubPattern(
                  s,
                  [
                      (
                          SUBPATTERN,
                          (gid, 0, 0, _parser.parse(phrase, flags)),
                      ),
                  ],
              )
          )
          s.closegroup(gid, p[-1])
      p = _parser.SubPattern(s, [(BRANCH, (None, p))])
      self.scanner = _compiler.compile(p)
  
imports: import enum
  from .None import _compiler, _parser
  import functools
  import _sre
  import copyreg
label_desc: Use image node_id 1 to create a new Scanner object  with example: obj = Scanner(lexicon, flags)