Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions codeflash/languages/python/normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import ast
from functools import lru_cache


class VariableNormalizer(ast.NodeTransformer):
Expand Down Expand Up @@ -162,6 +163,7 @@ def _remove_docstrings_from_ast(node: ast.AST) -> None:
stack.extend([child for child in body if isinstance(child, node_types)])


@lru_cache(maxsize=512)
def normalize_python_code(code: str, remove_docstrings: bool = True) -> str:
"""Normalize Python code to a canonical form for comparison.

Expand Down
Loading