code: def clone(self, object=None):
      c = copy.copy(self)
  
      # If the object parameter has been supplied, it means we are attaching the
      # lexer to a new object.  In this case, we have to rebind all methods in
      # the lexstatere and lexstateerrorf tables.
  
      if object:
          newtab = {}
          for key, ritem in self.lexstatere.items():
              newre = []
              for cre, findex in ritem:
                  newfindex = []
                  for f in findex:
                      if not f or not f[0]:
                          newfindex.append(f)
                          continue
                      newfindex.append(
                          (getattr(object, f[0].__name__), f[1])
                      )
              newre.append((cre, newfindex))
              newtab[key] = newre
          c.lexstatere = newtab
          c.lexstateerrorf = {}
          for key, ef in self.lexstateerrorf.items():
              c.lexstateerrorf[key] = getattr(object, ef.__name__)
          c.lexmodule = object
      return c
  
imports: import re
  import sys
  import types
  import copy
  import os
  import inspect
label_desc: Use image node_id 2 for calling the Lexer obj's underlying member method code with example usage: obj.clone(object) and returns: c