<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _has_old_request_ended(self, shard_state):
 """Whether previous slice retry has ended according to Logs API. Args: shard_state: shard state. Returns: True if the request of previous slice retry has ended. False if it has not or unknown. """

    assert shard_state.slice_start_time is not None
    assert shard_state.slice_request_id is not None
    request_ids = [shard_state.slice_request_id]
    logs = None
    try:
      logs = list(logservice.fetch(request_ids=request_ids))
    except (apiproxy_errors.FeatureNotEnabledError,
        apiproxy_errors.CapabilityDisabledError) as e:
      # Managed VMs do not have access to the logservice API
      # See https://groups.google.com/forum/#!topic/app-engine-managed-vms/r8i65uiFW0w
      logging.warning("Ignoring exception: %s", e)

    if not logs or not logs[0].finished:
      return False
    return True