code: def private_import_across_module(
      file_obj: IO[str],
  ) -> Iterable[tuple[int, str]]:
      """
      Checking that a private function is not imported across modules.
      Parameters
      ----------
      file_obj : IO
          File-like object containing the Python code to validate.
      Yields
      ------
      line_number : int
          Line number of import statement, that imports the private function.
      msg : str
          Explanation of the error.
      """
      contents = file_obj.read()
      tree = ast.parse(contents)
  
      for node in ast.walk(tree):
          if not isinstance(node, (ast.Import, ast.ImportFrom)):
              continue
  
          for module in node.names:
              module_name = module.name.split(".")[-1]
              if module_name in PRIVATE_IMPORTS_TO_IGNORE:
                  continue
  
              if module_name.startswith("_"):
                  yield (
                      node.lineno,
                      f"Import of internal function {module_name!r}",
                  )
  
file_path: pandas/scripts/validate_unwanted_patterns.py
imports: import argparse
  import ast
  from collections.abc import Iterable
  import sys
  import token
  import tokenize
  from typing import IO, Callable
label_desc: Use image node_id 3 for calling a global function with example usage: private_import_across_module(file_obj) without return types