ml_switcheroo.core.import_fixer.injection_mixin¶

Import Injection Mixin.

Handles the post-processing of the Module AST to inject necessary top-level imports determined by the ResolutionPlan.

Classes¶

InjectionMixin

Mixin for injecting imports at the Module level.

Module Contents¶

class ml_switcheroo.core.import_fixer.injection_mixin.InjectionMixin[source]¶

Bases: libcst.CSTTransformer

Mixin for injecting imports at the Module level.

leave_Module(original_node: libcst.Module, updated_node: libcst.Module) → libcst.Module[source]¶

Post-process module to inject imports from the plan.