code: def tail(records, tail):
      
      logging.info('Applying _tail generator: '
                   'limiting results to top ' + tail + ' records.')
  
      if tail == '+0':
          for record in records:
              yield record
      elif '+' in tail:
          tail = int(tail) - 1
          for record in itertools.islice(records, tail, None):
              yield record
      else:
          with _record_buffer(records) as r:
              record_count = sum(1 for record in r())
              start_index = max(record_count - int(tail), 0)
              for record in itertools.islice(r(), start_index, None):
                  yield record
docs: Limit results to the bottom N records.
      Use +N to output records starting with the Nth.