Home / File/ check_imports.py — langchain Source File

check_imports.py — langchain Source File

Architecture documentation for check_imports.py, a python file in the langchain codebase. 5 imports, 0 dependents.

File python CoreAbstractions Serialization 5 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  a65e0b69_4f3e_ac29_def0_44ab70dfdd70["check_imports.py"]
  b46e3a6e_9a2b_2130_0375_b33ca2ac0f92["secrets"]
  a65e0b69_4f3e_ac29_def0_44ab70dfdd70 --> b46e3a6e_9a2b_2130_0375_b33ca2ac0f92
  06ab3965_70ce_6e2c_feb9_564d849aa5f4["string"]
  a65e0b69_4f3e_ac29_def0_44ab70dfdd70 --> 06ab3965_70ce_6e2c_feb9_564d849aa5f4
  d76a28c2_c3ab_00a8_5208_77807a49449d["sys"]
  a65e0b69_4f3e_ac29_def0_44ab70dfdd70 --> d76a28c2_c3ab_00a8_5208_77807a49449d
  bfa79181_b1e6_eba2_0d8e_9ddb8d3b949c["traceback"]
  a65e0b69_4f3e_ac29_def0_44ab70dfdd70 --> bfa79181_b1e6_eba2_0d8e_9ddb8d3b949c
  2acfe0b8_5002_f60d_8c72_d2f95e51daeb["importlib.machinery"]
  a65e0b69_4f3e_ac29_def0_44ab70dfdd70 --> 2acfe0b8_5002_f60d_8c72_d2f95e51daeb
  style a65e0b69_4f3e_ac29_def0_44ab70dfdd70 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Check imports script."""

import secrets
import string
import sys
import traceback
from importlib.machinery import SourceFileLoader

if __name__ == "__main__":
    files = sys.argv[1:]
    has_failure = False
    for file in files:
        try:
            module_name = "".join(
                secrets.choice(string.ascii_letters) for _ in range(20)
            )
            SourceFileLoader(module_name, file).load_module()
        except Exception:
            has_failure = True
            print(file)  # noqa: T201
            traceback.print_exc()
            print()  # noqa: T201

    sys.exit(1 if has_failure else 0)

Subdomains

Functions

Dependencies

  • importlib.machinery
  • secrets
  • string
  • sys
  • traceback

Frequently Asked Questions

What does check_imports.py do?
check_imports.py is a source file in the langchain codebase, written in python. It belongs to the CoreAbstractions domain, Serialization subdomain.
What functions are defined in check_imports.py?
check_imports.py defines 1 function(s): files.
What does check_imports.py depend on?
check_imports.py imports 5 module(s): importlib.machinery, secrets, string, sys, traceback.
Where is check_imports.py in the architecture?
check_imports.py is located at libs/standard-tests/scripts/check_imports.py (domain: CoreAbstractions, subdomain: Serialization, directory: libs/standard-tests/scripts).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free