code: def get_imports(path: str) -> Tuple[_Import, ...]:
      """Parse Python file at path, retrieve import statements.
      Adapted from https://stackoverflow.com/a/9049549.
      path (str): Path to Python file.
      RETURNS (Tuple[_Import]): All imports found in file at path.
      """
      with open(path) as fh:
          root = ast.parse(fh.read(), path)
  
      imports: List[_Import] = []
      for node in ast.walk(root):
          if isinstance(node, ast.Import):
              module: List[str] = []
          elif isinstance(node, ast.ImportFrom) and node.module:
              module = node.module.split(".")
          else:
              continue
  
          assert isinstance(node, (ast.Import, ast.ImportFrom))
          imports.extend(
              [
                  _Import(module, n.name.split("."), n.asname)
                  for n in node.names
              ]
          )
  
      return tuple(imports)
  
imports: import ast
  import importlib
  from collections import namedtuple
  from typing import List, Tuple
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: get_imports(path) and returns: tuple