code: def transform(self, node, results):
      # First, find the sys import. We'll just hope it's global scope.
      if "sys_import" in results:
          if self.sys_import is None:
              self.sys_import = results["sys_import"]
          return
  
      func = results["func"].clone()
      func.prefix = ""
      register = pytree.Node(
          syms.power, Attr(Name("atexit"), Name("register"))
      )
      call = Call(register, [func], node.prefix)
      node.replace(call)
  
      if self.sys_import is None:
          # That's interesting.
          self.warning(
              node,
              "Can't find sys import; Please add an atexit "
              "import at the top of your file.",
          )
          return
  
      # Now add an atexit import after the sys import.
      names = self.sys_import.children[1]
      if names.type == syms.dotted_as_names:
          names.append_child(Comma())
          names.append_child(Name("atexit", " "))
      else:
          containing_stmt = self.sys_import.parent
          position = containing_stmt.children.index(self.sys_import)
          stmt_container = containing_stmt.parent
          new_import = pytree.Node(
              syms.import_name, [Name("import"), Name("atexit", " ")]
          )
          new = pytree.Node(syms.simple_stmt, [new_import])
          containing_stmt.insert_child(position + 1, Newline())
          containing_stmt.insert_child(position + 2, new)
  
imports: from lib2to3 import pytree, fixer_base
  from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms
label_desc: Use image node_id 3 for calling the FixExitfunc obj's underlying member method code with example usage: obj.transform(node, results) without return types