code: def file_import_modules(fpath, fdata):
      """Get single file all imported modules."""
      modules = ImportedModules()
      str_codes = collections.deque([(fdata, 1)])
      try_imports = set()
  
      while str_codes:
          str_code, lineno = str_codes.popleft()
          ic = ImportChecker(fpath, lineno)
          try:
              parsed = ast.parse(str_code)
              ic.visit(parsed)
          # Ignore SyntaxError in Python code.
          except SyntaxError:
              pass
          modules |= ic.modules
          str_codes.extend(ic.str_codes)
          try_imports |= ic.try_imports
          del ic
  
      return modules, try_imports
  
imports: from __future__ import print_function, division, absolute_import
  import json
  import os
  import sys
  import six
  import fnmatch
  import importlib
  import ast
  import doctest
  import collections
  import functools
  from pathlib2 import Path
  from .utils import parse_git_config
  from .modules import ImportedModules
label_desc: Use image node_id 2 for calling a global function with example usage: file_import_modules(fpath, fdata) and returns: modules,  try_imports