- Rename functions, variables, parameters and imports with scope-aware AST passes - Generalise Flask route and template paths to unique /route_N and tpl_N names - Replace descriptive strings with length-preserving, word-consistent msg tokens - Strip docstrings and comments - Add verification for parse validity and leaked benchmark identifiers - Include SAST prompt and expected labels
24 lines
774 B
Python
24 lines
774 B
Python
from flask import redirect as mod_1, url_for as mod_2, request as mod_3, make_response as mod_4, render_template as mod_5
|
|
from helpers.utils import escape_for_html as mod_6
|
|
|
|
def init(var_1):
|
|
|
|
@var_1.route('/route_190', methods=['GET'])
|
|
def func_379():
|
|
return func_380()
|
|
|
|
@var_1.route('/route_190', methods=['POST'])
|
|
def func_380():
|
|
var_2 = ''
|
|
var_3 = mod_3.form.get('msg00000000000002K')
|
|
if not var_3:
|
|
var_3 = ''
|
|
import os as mod_7
|
|
import helpers.utils
|
|
var_4 = f'{helpers.utils.TESTFILES_DIR}/{var_3}'
|
|
if mod_7.path.exists(var_4):
|
|
var_2 += f"m003 '{mod_6(var_4)}' msg003."
|
|
else:
|
|
var_2 += f"m003 '{mod_6(var_4)}' m00i drp msg02."
|
|
return var_2
|