original_docstring:  Perform one JSON RPC operation. 
docstring: Perform one JSON RPC operation.
docstring_tokens: Perform one JSON RPC operation .
code: def _req_json_rpc(self, url, method, *args, **kwargs):
          """ Perform one JSON RPC operation. """
          data = json.dumps({'method': method, 'params': args})
          try:
              res = requests.post(url, data=data, timeout=5, **kwargs)
          except requests.exceptions.Timeout:
              self.logger.exception("Connection to the router timed out")
              return
          if res.status_code == 200:
              try:
                  result = res.json()
              except ValueError:
                  # If json decoder could not parse the response
                  self.logger.exception("Failed to parse response from luci")
                  return
              try:
                  return result['result']
              except KeyError:
                  self.logger.exception("No result in response from luci")
                  return
          elif res.status_code == 401:
              # Authentication error
              self.logger.exception(
                  "Failed to authenticate, "
                  "please check your username and password")
              return
          else:
              self.logger.error("Invalid response from luci: {}".format(res))
code_tokens: def _req_json_rpc ( self , url , method , * args , ** kwargs ) : data = json . dumps ( { 'method' : method , 'params' : args } ) try : res = requests . post ( url , data = data , timeout = 5 , ** kwargs ) except requests . exceptions . Timeout : self . logger . exception ( "Connection to the router timed out" ) return if res . status_code == 200 : try : result = res . json ( ) except ValueError : self . logger . exception ( "Failed to parse response from luci" ) return try : return result [ 'result' ] except KeyError : self . logger . exception ( "No result in response from luci" ) return elif res . status_code == 401 : self . logger . exception ( "Failed to authenticate, " "please check your username and password" ) return else : self . logger . error ( "Invalid response from luci: {}" . format ( res ) )
short_docstring: Perform one JSON RPC operation.
short_docstring_tokens: Perform one JSON RPC operation .
comment: """ Perform one JSON RPC operation. """$SEP$# If json decoder could not parse the response$SEP$# Authentication error