class_docstr: Extract the list of global variables a block of code will read and write
class_docstr_tok: ["Extract","the","list","of","global","variables","a","block","of","code","will","read","and","write"]
code: def visit_Call(self, node):
      # __import__ calls aren't routed to the visit_Import/From nodes
      if hasattr(node.func, "id") and node.func.id == "__import__":
          try:
              name = self._grab_node_str(node.args[0])
              fromlist = []
              level = 0
              if len(node.args) > 3:
                  for v in node.args[3].elts:
                      fromlist.append(self._grab_node_str(v))
              elif hasattr(node, "keywords"):
                  for keyword in node.keywords:
                      if keyword.arg == "fromlist":
                          for v in keyword.value.elts:
                              fromlist.append(self._grab_node_str(v))
              if len(node.args) > 4:
                  level = self._grab_node_int(node.args[4])
              elif hasattr(node, "keywords"):
                  for keyword in node.keywords:
                      if keyword.arg == "level":
                          level = self._grab_node_int(keyword.value)
              if fromlist == []:
                  # the top-level package (the name up till the first dot) is returned
                  # when the fromlist argument is empty in normal import system,
                  # we need to include top level package to match this behavior and last
                  # level package to capture the intended dependency of user
                  self.references[(name, None)] = True
                  top_name = name.rsplit(".", maxsplit=1)[0]
                  if top_name != name:
                      top_name = self._absmodule(top_name, level)
                      self.references[(top_name, None)] = True
              else:
                  name = self._absmodule(name, level)
                  for alias in fromlist:
                      # fromlist args may be submodules, so we have to add the fromlist args
                      # to the list of potential references. If import of an arg fails we
                      # will ignore it, similar to visit_ImportFrom
                      if alias != "*":
                          self.references[(name, alias)] = True
                      else:
                          self.references[(name, None)] = True
          except Exception as e:
              return
  
file_path: pytorch/torch/package/find_file_dependencies.py
imports: import ast
  from typing import List, Optional, Tuple
  from ._importlib import _resolve_name
label_desc: Use image node_id 8 for calling the _ExtractModuleReferences obj's underlying member method code with example usage: obj.visit_Call(node) without return types