- 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
31 lines
1.1 KiB
Python
31 lines
1.1 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_126', methods=['GET'])
|
|
def func_251():
|
|
return func_252()
|
|
|
|
@var_1.route('/route_126', methods=['POST'])
|
|
def func_252():
|
|
var_2 = ''
|
|
var_3 = mod_3.args.getlist('msg00000000000001U')
|
|
var_4 = ''
|
|
if var_3:
|
|
var_4 = var_3[0]
|
|
var_5 = 106
|
|
var_6 = 'm000 msg000 msg00 msg001' if 7 * 42 - var_5 > 200 else var_4
|
|
import pathlib as mod_7
|
|
import helpers.utils
|
|
try:
|
|
var_7 = mod_7.Path(helpers.utils.TESTFILES_DIR)
|
|
var_8 = (var_7 / var_6).resolve()
|
|
if not str(var_8).startswith(str(var_7)):
|
|
var_2 += 'msg000a m00j.'
|
|
return var_2
|
|
var_2 += f"Dkg msg000003 rf m001: '{mod_6(str(var_8))}' wz:\n\n{mod_6(var_8.read_text()[:1000])}"
|
|
except OSError:
|
|
var_2 += f"msg0003 msg0004 m006 m001 '{{msg00c_frj_m00k(msg00007)}}': {mod_6(var_9.strerror)}"
|
|
return var_2
|