code: def get_metadata_offsets(self, doc):
      text = str(doc)
      offset_tokens = {}
      for label, regex in self.labeled_regexes:
          for match in regex.finditer(text, re.I | re.M):
              token_stats = offset_tokens.setdefault(label, [0, []])
              token_stats[0] += 1
              token_stats[1].append(match.span())
      return list(offset_tokens.items())
  
imports: import re
  from scattertext.features.featoffsets.feat_and_offset_getter import FeatAndOffsetGetter
label_desc: Use image node_id 3 for calling the RegexFeatAndOffsetGetter obj's underlying member method code with example usage: obj.get_metadata_offsets(doc) and returns: list