def _process_result(self, result):
    self._api.limit_remaining = None
    self._api.limit = None
    self._api.limit_reset = None

    if not self._spec.streaming:
      try:
        self._api.limit_remaining = int(result.headers["X-Rate-Limit-Remaining"])
        self._api.limit = int(result.headers["X-Rate-Limit-Limit"])
        self._api.limit_reset = datetime.datetime.utcfromtimestamp(float(result.headers["X-Rate-Limit-Reset"]))
      except __HOLE__: # Ignore any errors from trying to get headers
        pass 

      result = result.json()
    elif result.strip():
      # Check that the result is not empty.
      result = json.loads(result)
    else:
      return None

    if isinstance(result, dict) and "previous_cursor" in result:
      return models.ResultsPage(result, self._api)

    if self._spec.model == None:
      return result
    else:     
      if isinstance(result, list):
        return [self._spec.model(r, self._api) for r in result]
      else:
        return self._spec.model(result, self._api)
dataset/ETHPy150Open domrout/python-twitter-wrapper/twitterwrapper/_api.py/ApiMethod._process_result