Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_aliases(self):
self.assertIs(astor.parse_file, astor.code_to_ast.parse_file)
# Load user function code
import astor
func_ast = astor.code_to_ast(func)
# Initialize output content
output_imports = []
task2headers = {}
task2func_code = {}
output_loops_code = []
task_counter_id = 0
# Process each par_py file
for par_py in par_py_files:
# Retrieve file AST
par_py_ast = astor.code_to_ast.parse_file(par_py)
# Process ast
output_code = []
task2new_name = {}
task2original_args = {}
task2new_args = {}
task2ret_args = {}
task2vars2subscripts = {}
for statement in par_py_ast.body:
if isinstance(statement, ast.Import):
from pycompss.util.translators.py2pycompss.components.code_cleaner import CodeCleaner
if not CodeCleaner.contains_import_statement(statement, output_imports):
output_imports.append(statement)
elif isinstance(statement, ast.FunctionDef):
task_func_name = statement.name