code: def _generate_rpc_method(self, method):
          '''
          Generate a function that performs rpc call
  
          :param method: method name
          :return: rpc function
          '''
          def _(**kwargs):
              '''
              always use named arguments
              '''
              msg_id = self.get_unique_msg_id()
              params = encode_data(kwargs)
              payload = {
                  'method': method,
                  'params': params,
                  'jsonrpc': '2.0',
                  'id': msg_id
              }
              response = requests.post(self.url, data=json.dumps(payload), headers=self.headers).json()
              if ('error' in response):
                  if response['error']['code'] == JSONRPC_NO_RESULT:
                      return None
                  raise Exception('Got error from RPC server when called "%s" error: %s' % (method, response['error']))
              if 'result' in response:
                  result = decode_data(response['result'])
                  return result
          return f _generate_rpc_method(self, method):
          '''
          Generate a function that performs rpc call
  
          :param method: method name
          :return: rpc function
          '''
          def _(**kwargs):
              '''
              always use named arguments
              '''
              msg_id = self.get_unique_msg_id()
              params = encode_data(kwargs)
              payload = {
                  'method': method,
                  'params': params,
                  'jsonrpc': '2.0',
                  'id': msg_id
              }
              response = requests.post(self.url, data=json.dumps(payload), headers=self.headers).json()
              if ('error' in response):
                  if response['error']['code'] == JSONRPC_NO_RESULT:
                      return None
                  raise Exception('Got error from RPC server when called "%s" error: %s' % (method, response['error']))
              if 'result' in response:
                  result = decode_data(response['result'])
                  return result
          return _
docs: Generate a function that performs rpc call
  
          :param method: method name
          :return: rpc function