<commit_before>__author__ = '<NAME>'

from flask import Flask, Response, request
import requests

app = Flask(__name__)

def _to_site_url(site):
  import caleydo_server.plugin

  proxy_defs = caleydo_server.plugin.list('targid_proxy')
  for p in proxy_defs:
    if p.id == site:
      return p.url.format(request.args)
  #none matching found
  return None

@app.route('/<site>')
def get_details(site):
  url = _to_site_url(site)
  if url:
    r = requests.get(url)
    return Response(r.text, status=r.status_code, content_type=r.headers['content-type'])
  return 404

def create():
  return app

if __name__ == '__main__':
  app.debug = True
  app.run(host='0.0.0.0')<commit_msg>fix argument lookup for proxy<commit_after>__author__ = '<NAME>'

from flask import Flask, Response, request, abort
import requests

app = Flask(__name__)

def _to_site_url(site):
  import caleydo_server.plugin

  proxy_defs = caleydo_server.plugin.list('targid_proxy')
  for p in proxy_defs:
    if p.id == site:
      return p.url.format(**request.args.to_dict())
  #none matching found
  return None

@app.route('/<site>')
def get_details(site):
  url = _to_site_url(site)
  if url:
    r = requests.get(url)
    return Response(r.text, status=r.status_code, content_type=r.headers['content-type'])
  abort(404)

def create():
  return app

if __name__ == '__main__':
  app.debug = True
  app.run(host='0.0.0.0')
{'fraction_non_alphanumeric': 0.13189964157706094, 'fraction_numerical': 0.01003584229390681, 'mean_word_length': 4.2481203007518795, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6728631', 'n_tokens_mistral': 525, 'n_tokens_neox': 511, 'n_words': 117}