code: def max_length_discard(records, max_length):
      
      logging.info('Applying _max_length_discard generator: '
                   'discarding records longer than '
                   '.')
      for record in records:
          if len(record) > max_length:
              # Discard
              logging.debug('Discarding long sequence: %s, length=%d',
                  record.id, len(record))
          else:
              yield record
docs: Discard any records that are longer than max_length.