code: def search(pattern, code, flags=0):
      # return first match for pattern in code
      match = re.search(pattern, code, flags)
      if match is None:
          raise ValueError(f"{pattern!r} not found")
      return match.groups()[0]
  
imports: import re
  import sys
  from setuptools import setup
label_desc: Use image node_id 1 for calling a global function with example usage: search(pattern, code, flags) and returns: match