def HandleVars(request, response):
  requested_vars = request.get('var', '')
  output = request.get('output', 'html')
  regexes = [re.compile(x) for x in request.get('varregexp', [])]

  if regexes and requested_vars:
    title = 'Request Error'
    error_msg = (
        'ERROR: Can only specify one of "var=" or "varregexp=" parameters')
    response.headers.add_header('Content-Type', 'text/html')
    response.start_response(200)
    response.out.write(_HTML_HEADER % title + error_msg + _HTML_FOOTER)
    response.end_response()
    return

  values = {}
  title = 'All Variables'
  # Filter by specific vars.
  if requested_vars:
    vars_list = requested_vars.split(':')
    if len(vars_list) == 1:
      title = 'Variable: %s' % requested_vars.strip()
    else:
      title = 'Variables: %s' % requested_vars.strip()
    for var in vars_list:
      name = vars_common.CanonicalName(var)
      value = vars_helper.FetchVar(var)
      if value is None:
        values[name] = '(Variable not found)'
      else:
        values[name] = value
  # Filter vars by regexes.
  elif regexes:
    title = 'Matching Variables'
    for k, v in vars_helper.FetchAllVars().iteritems():
      for regex in regexes:
        if regex.match(k):
          values[k] = v
          break
  # Just show all the vars.
  else:
    values = vars_helper.FetchAllVars()

  callback = _OUTPUT_FORMATS.get(output, _OUTPUT_FORMATS['html'])
  callback(response, values, title)
Copies contents of file to destination key.
dataset/ETHPy150Open google/mysql-tools/pylib/http_handlers.py/HandleVars--crossover with--dataset/ETHPy150Open BD2KGenomics/toil/src/toil/jobStores/aws/jobStore.py/AWSJobStore.FileInfo.copyTo