def transform(matches, framework, namespace, static_endpoint):
transformed = []<EOL>namespace = namespace + '<STR_LIT:/>' if namespace else '<STR_LIT>'<EOL>for attribute, elements in matches:<EOL><INDENT>for element in elements:<EOL><INDENT>asset_location = get_asset_location(element, attribute)<EOL>sub_dict = {<EOL>'<STR_LIT>': static_endpoint, '<STR_LIT>': namespace,<EOL>'<STR_LIT>': asset_location<EOL>}<EOL>transformed_string = frameworks[framework] % sub_dict<EOL>res = (attribute, element[attribute], transformed_string)<EOL>transformed.append(res)<EOL><DEDENT><DEDENT>return transformed<EOL>
The actual transformation occurs here.

flask example: images/staticfy.jpg', ==>
    "{{ url_for('static', filename='images/staticfy.jpg') }}"