- 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
35 lines
1.3 KiB
Python
35 lines
1.3 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_112', methods=['GET'])
|
|
def func_223():
|
|
return func_224()
|
|
|
|
@var_1.route('/route_112', methods=['POST'])
|
|
def func_224():
|
|
var_2 = ''
|
|
var_3 = mod_3.args.get('msg00000000000001G')
|
|
if not var_3:
|
|
var_3 = ''
|
|
import configparser as mod_7
|
|
var_4 = 'm008!'
|
|
var_5 = mod_7.ConfigParser()
|
|
var_5.add_section('msg00000000a')
|
|
var_5.set('msg00000000a', 'm009-55264', 'o_msg0b')
|
|
var_5.set('msg00000000a', 'm00a-55264', var_3)
|
|
var_4 = var_5.get('msg00000000a', 'm009-55264')
|
|
import pathlib as mod_8
|
|
import helpers.utils
|
|
try:
|
|
var_6 = mod_8.Path(helpers.utils.TESTFILES_DIR)
|
|
var_7 = (var_6 / var_4).resolve()
|
|
if not str(var_7).startswith(str(var_6)):
|
|
var_2 += 'msg000a m00j.'
|
|
return var_2
|
|
var_2 += f"Dkg msg000003 rf m001: '{mod_6(str(var_7))}' wz:\n\n{mod_6(var_7.read_text()[:1000])}"
|
|
except OSError:
|
|
var_2 += f"msg0003 msg0004 m006 m001 '{{msg00c_frj_m00k(msg00007)}}': {mod_6(var_8.strerror)}"
|
|
return var_2
|