code: def remove_imports(source):
      tree = ast.parse(source)
      import_parser = ImportParser()
      import_parser.visit(tree)
      lines = source.split(
          "\n"
      )  # the source including all comments, since we parse the line numbers with comments!
      lines_to_remove = set(import_parser.line_numbers)
      non_import_lines = [
          line
          for i, line in enumerate(lines, start=1)
          if i not in lines_to_remove
      ]
      return "\n".join(non_import_lines)
  
imports: import ast
  import re
  import warnings
  from operator import attrgetter
  from hyperopt import space_eval
label_desc: Use image node_id 2 for calling a global function with example usage: remove_imports(source) and returns: str