def GetLastRequestTimedelta(api_query, from_time=None):
  """Returns how long since the API Query response was last requested.

  Args:
    api_query: The API Query from which to retrieve the last request timedelta.
    from_time: A DateTime object representing the start time to calculate the
               timedelta from.

  Returns:
    A string that describes how long since the API Query response was last
    requested in the form of "HH hours, MM minutes, ss seconds ago" or None
    if the API Query response has never been requested.
  """
  if not from_time:
    from_time = datetime.utcnow()

  if api_query.last_request:
    time_delta = from_time - api_query.last_request
    return FormatTimedelta(time_delta)
  return None
dataset/ETHPy150Open googleanalytics/google-analytics-super-proxy/src/controllers/util/models_helper.py/GetLastRequestTimedelta/original