Spaces:
Sleeping
Sleeping
Update chunk_python_code.py
Browse files- chunk_python_code.py +1 -2
chunk_python_code.py
CHANGED
@@ -31,7 +31,6 @@ def _iterate_ast(python_code, documents, file_path):
|
|
31 |
Parses the AST of the given Python file and delegates
|
32 |
handling to specific methods based on node types.
|
33 |
"""
|
34 |
-
documents = []
|
35 |
tree = ast.parse(python_code, filename=file_path)
|
36 |
|
37 |
first_level_nodes = list(ast.iter_child_nodes(tree))
|
@@ -52,7 +51,7 @@ def _iterate_ast(python_code, documents, file_path):
|
|
52 |
|
53 |
if isinstance(first_level_node, ast.ClassDef):
|
54 |
documents.extend(
|
55 |
-
|
56 |
elif isinstance(first_level_node, ast.FunctionDef):
|
57 |
documents.extend(
|
58 |
_chunk_first_level_func_node(first_level_node, documents, python_code))
|
|
|
31 |
Parses the AST of the given Python file and delegates
|
32 |
handling to specific methods based on node types.
|
33 |
"""
|
|
|
34 |
tree = ast.parse(python_code, filename=file_path)
|
35 |
|
36 |
first_level_nodes = list(ast.iter_child_nodes(tree))
|
|
|
51 |
|
52 |
if isinstance(first_level_node, ast.ClassDef):
|
53 |
documents.extend(
|
54 |
+
handle_first_level_class(first_level_node, documents, python_code))
|
55 |
elif isinstance(first_level_node, ast.FunctionDef):
|
56 |
documents.extend(
|
57 |
_chunk_first_level_func_node(first_level_node, documents, python_code))
|