code: def sampled_logs(self, logs_limit=-1):
          
          logs_count = len(self.logs)
          if logs_limit == -1 or logs_count <= logs_limit:
              return self.logs
          elif logs_limit == 0:
              return []
          elif logs_limit == 1:
              return [self.logs[-1]]
          else:
              def get_sampled_log(idx):
                  # always include the first and last element of `self.logs`
                  return self.logs[idx * (logs_count - 1) // (logs_limit - 1)]
              return [get_sampled_log(i) for i in range(logs_limit)]
docs: Return up to `logs_limit` logs.
  
          If `logs_limit` is -1, this function will return all logs that belong
          to the result.