Flexible and powerful tensor operations for readable and reliable code (for pytorch, jax, TF and others)
This report presents the forensic synthetic code analysis of arogozhnikov/einops, a Python project with 9,549 GitHub stars. SynthScan v2.0 examined 10,082 lines of code across 55 source files, recording 88 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 9.9 places this repository in the Low AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 88 distinct pattern matches across 8 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/utils/__init__.py | 7 | def display_np_arrays_as_images(): | CODE |
| LOW | einops/einops.py | 167 | def _reconstruct_from_shape_uncached( | CODE |
| LOW | einops/einops.py | 307 | def _prepare_transformation_recipe( | CODE |
| LOW | einops/einops.py | 469 | def _prepare_recipes_for_all_dims( | CODE |
| LOW | einops/einops.py | 780 | def _validate_einsum_axis_name(axis_name): | CODE |
| LOW | einops/einops.py | 797 | def _compactify_pattern_for_einsum(pattern: str) -> str: | CODE |
| LOW | einops/parsing.py | 127 | def check_axis_name_return_reason(name: str, allow_underscore: bool = False) -> tuple[bool, str]: | CODE |
| LOW | einops/_torch_specific.py | 48 | def stack_on_zeroth_dimension(tensors: list[torch.Tensor]): | CODE |
| LOW | einops/_torch_specific.py | 77 | def apply_for_scriptable_torch( | CODE |
| LOW | einops/_torch_specific.py | 102 | def allow_ops_in_compiled_graph(): | CODE |
| LOW | einops/_backends.py | 104 | def stack_on_zeroth_dimension(self, tensors: list): | CODE |
| LOW | einops/_backends.py | 180 | def stack_on_zeroth_dimension(self, tensors: list): | CODE |
| LOW | einops/_backends.py | 263 | def stack_on_zeroth_dimension(self, tensors: list): | CODE |
| LOW | einops/_backends.py | 314 | def stack_on_zeroth_dimension(self, tensors: list): | CODE |
| LOW | einops/_backends.py | 397 | def stack_on_zeroth_dimension(self, tensors: list): | CODE |
| LOW | einops/_backends.py | 457 | def stack_on_zeroth_dimension(self, tensors: list): | CODE |
| LOW | einops/_backends.py | 517 | def stack_on_zeroth_dimension(self, tensors: list): | CODE |
| LOW | einops/_backends.py | 587 | def stack_on_zeroth_dimension(self, tensors: list): | CODE |
| LOW | einops/_backends.py | 651 | def stack_on_zeroth_dimension(self, tensors: list): | CODE |
| LOW | einops/_backends.py | 708 | def stack_on_zeroth_dimension(self, tensors: list): | CODE |
| LOW | einops/_backends.py | 750 | def stack_on_zeroth_dimension(self, tensors: list): | CODE |
| LOW | einops/tests/test_parsing.py | 31 | def test_elementary_axis_name(): | CODE |
| LOW | einops/tests/test_layers.py | 37 | def test_rearrange_imperative(): | CODE |
| LOW | einops/tests/test_layers.py | 230 | def test_torch_layers_scripting(): | CODE |
| LOW | einops/tests/test_layers.py | 355 | def test_einmix_decomposition(): | CODE |
| LOW | einops/tests/__init__.py | 23 | def find_names_of_all_frameworks() -> list[str]: | CODE |
| LOW | einops/tests/test_packing.py | 20 | def unpack_and_pack_against_numpy(x, ps, pattern: str): | CODE |
| LOW | einops/tests/test_packing.py | 138 | def test_pack_unpack_with_numpy(): | CODE |
| LOW | einops/tests/test_packing.py | 201 | def test_pack_unpack_against_numpy(): | CODE |
| LOW | einops/tests/test_packing.py | 265 | def test_pack_unpack_array_api(): | CODE |
| LOW | einops/tests/test_ops.py | 44 | def test_collapsed_ellipsis_errors_out(): | CODE |
| LOW | einops/tests/test_ops.py | 100 | def test_ellipsis_ops_imperative(): | CODE |
| LOW | einops/tests/test_ops.py | 117 | def test_rearrange_consistency_numpy(): | CODE |
| LOW | einops/tests/test_ops.py | 155 | def test_rearrange_permutations_numpy(): | CODE |
| LOW | einops/tests/test_ops.py | 183 | def test_reduction_imperatives(): | CODE |
| LOW | einops/tests/test_ops.py | 272 | def test_reduction_stress_imperatives(): | CODE |
| LOW | einops/tests/test_ops.py | 304 | def test_reduction_with_callable_imperatives(): | CODE |
| LOW | einops/tests/test_ops.py | 355 | def test_enumerating_directions(): | CODE |
| LOW | einops/tests/test_ops.py | 370 | def test_concatenations_and_stacking(): | CODE |
| LOW | einops/tests/test_ops.py | 389 | def test_gradients_imperatives(): | CODE |
| LOW | einops/tests/test_ops.py | 549 | def test_torch_compile_with_dynamic_shape(): | CODE |
| LOW | einops/tests/test_ops.py | 582 | def test_reduction_imperatives_booleans(): | CODE |
| LOW | einops/tests/test_other.py | 56 | def test_optimize_transformations_numpy(): | CODE |
| LOW | einops/tests/test_other.py | 93 | def test_parse_shape_imperative(): | CODE |
| LOW | einops/tests/test_other.py | 154 | def test_parse_with_anonymous_axes(): | CODE |
| LOW | einops/tests/test_other.py | 194 | def test_parse_shape_symbolic(backend): | CODE |
| LOW | einops/tests/test_other.py | 222 | def test_parse_shape_symbolic_ellipsis(backend): | CODE |
| LOW | einops/tests/test_other.py | 258 | def test_torch_compile_for_functions(): | CODE |
| LOW | einops/tests/test_other.py | 309 | def test_torch_compile_for_layers(): | CODE |
| LOW | einops/tests/test_examples.py | 153 | def tensor_train_example_numpy(): | CODE |
| LOW | einops/tests/test_examples.py | 194 | def test_pytorch_yolo_fragment(): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | einops/einops.py | 61 | CODE | |
| LOW | einops/einops.py | 307 | CODE | |
| LOW | einops/einops.py | 677 | CODE | |
| LOW | einops/einops.py | 797 | CODE | |
| LOW | einops/parsing.py | 35 | CODE | |
| LOW | einops/parsing.py | 55 | CODE | |
| LOW | einops/_torch_specific.py | 27 | CODE | |
| LOW | einops/_backends.py | 22 | CODE | |
| LOW | einops/_backends.py | 243 | CODE | |
| LOW | einops/_backends.py | 502 | CODE | |
| LOW | einops/layers/_einmix.py | 95 | CODE | |
| LOW | einops/tests/test_layers.py | 37 | CODE | |
| LOW | einops/tests/test_layers.py | 110 | CODE | |
| LOW | einops/tests/test_layers.py | 151 | CODE | |
| LOW | einops/tests/test_einsum.py | 199 | CODE | |
| LOW | einops/tests/test_einsum.py | 234 | CODE | |
| LOW | einops/tests/test_ops.py | 100 | CODE | |
| LOW | einops/tests/test_ops.py | 219 | CODE | |
| LOW | einops/tests/test_ops.py | 272 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | einops/einops.py | 485 | einops.reduce combines rearrangement and reduction using reader-friendly notation. Some examples: ```pyth | STRING |
| HIGH | einops/einops.py | 570 | einops.rearrange is a reader-friendly smart element reordering for multidimensional tensors. This operation inc | STRING |
| HIGH | einops/einops.py | 867 | einops.einsum calls einsum operations with einops-style named axes indexing, computing tensor products with an | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | einops/__init__.py | 19 | CODE | |
| LOW | einops/__init__.py | 19 | CODE | |
| LOW | einops/__init__.py | 19 | CODE | |
| LOW | einops/__init__.py | 19 | CODE | |
| LOW | einops/__init__.py | 19 | CODE | |
| LOW | einops/__init__.py | 19 | CODE | |
| LOW | einops/__init__.py | 20 | CODE | |
| LOW | einops/__init__.py | 20 | CODE | |
| LOW | einops/_backends.py | 225 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | einops/array_api.py | 149 | except Exception as e: | CODE |
| LOW | einops/packing.py | 184 | except Exception as e: | CODE |
| LOW | einops/tests/test_other.py | 50 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .github/workflows/deploy_docs.yml | 21 | with: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | einops/__init__.py | 17 | __all__ = ["EinopsError", "asnumpy", "einsum", "pack", "parse_shape", "rearrange", "reduce", "repeat", "unpack"] | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | einops/tests/test_examples.py | 250 | CODE |