- 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
34 lines
1.0 KiB
Python
34 lines
1.0 KiB
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_124', methods=['GET'])
|
|
def func_247():
|
|
return func_248()
|
|
|
|
@var_1.route('/route_124', methods=['POST'])
|
|
def func_248():
|
|
var_2 = ''
|
|
var_3 = mod_3.args.getlist('msg00000000000001S')
|
|
var_4 = ''
|
|
if var_3:
|
|
var_4 = var_3[0]
|
|
var_5 = ''
|
|
if var_4:
|
|
var_6 = []
|
|
var_6.append('m008')
|
|
var_6.append(var_4)
|
|
var_6.append('msg00005')
|
|
var_6.pop(0)
|
|
var_5 = var_6[0]
|
|
import pathlib as mod_7
|
|
import helpers.utils
|
|
var_7 = mod_7.Path(helpers.utils.TESTFILES_DIR)
|
|
var_8 = var_7 / var_5
|
|
if var_8.exists():
|
|
var_2 += f"m003 '{mod_6(str(var_8))}' msg003."
|
|
else:
|
|
var_2 += f"m003 '{mod_6(str(var_8))}' m00i drp msg02."
|
|
return var_2
|