original_docstring:  Check redis for src_ip, redirect if found and send 404 if not 
docstring: Check redis for src_ip, redirect if found and send 404 if not
docstring_tokens: Check redis for src_ip redirect if found and send 404 if not
code: def flask_redirect(**kwargs):
      """ Check redis for src_ip, redirect if found and send 404 if not """
      response = kwargs['get_redirect_response'](request.remote_addr)
      redirect_info = RedirectInfo(request.remote_addr, response)
  
      scribe_client = kwargs['scribe_client']
      if scribe_client is not None:
          scribe_client.log_to_scribe(redirect_info)
  
      logging.info(
          "Request from {}: sent http code {} - redirected to {}".format(
              redirect_info.subscriber_ip, response.http_code,
              response.redirect_address
          )
      )
  
      if response.http_code is HTTP_NOT_FOUND:
          return render_template(
              response.redirect_address,
              subscriber={'ip': redirect_info.subscriber_ip}
          ), HTTP_NOT_FOUND
  
      return redirect(response.redirect_address, code=response.http_code)
code_tokens: def flask_redirect ( ** kwargs ) : response = kwargs [ 'get_redirect_response' ] ( request . remote_addr ) redirect_info = RedirectInfo ( request . remote_addr , response ) scribe_client = kwargs [ 'scribe_client' ] if scribe_client is not None : scribe_client . log_to_scribe ( redirect_info ) logging . info ( "Request from {}: sent http code {} - redirected to {}" . format ( redirect_info . subscriber_ip , response . http_code , response . redirect_address ) ) if response . http_code is HTTP_NOT_FOUND : return render_template ( response . redirect_address , subscriber = { 'ip' : redirect_info . subscriber_ip } ) , HTTP_NOT_FOUND return redirect ( response . redirect_address , code = response . http_code )
short_docstring: Check redis for src_ip, redirect if found and send 404 if not
short_docstring_tokens: Check redis for src_ip redirect if found and send 404 if not
comment: """ Check redis for src_ip, redirect if found and send 404 if not """