def Handle(self, args, token=None):
    # TODO(user): handle cases when hunt doesn't exists.
    # TODO(user): Use hunt's logs_collection_urn to open logs collection.
    try:
      logs_collection = aff4.FACTORY.Open(
          HUNTS_ROOT_PATH.Add(args.hunt_id).Add("Logs"),
          aff4_type=flow_runner.FlowLogCollection.__name__, mode="r",
          token=token)
    except __HOLE__:
      logs_collection = aff4.FACTORY.Create(
          HUNTS_ROOT_PATH.Add(args.hunt_id).Add("Logs"),
          aff4_type="RDFValueCollection", mode="r", token=token)

    result = api_call_handler_utils.FilterAff4Collection(
        logs_collection, args.offset, args.count, args.filter)

    return ApiListHuntLogsResult(
        items=result, total_count=len(logs_collection))
dataset/ETHPy150Open google/grr/grr/gui/api_plugins/hunt.py/ApiListHuntLogsHandler.Handle