code: def _filter_records(self, records, rtype=None, name=None, content=None, identifier=None):  # pylint: disable=too-many-arguments,no-self-use
          
          if not records:
              return []
          if identifier is not None:
              LOGGER.debug('Filtering %d records by id: %s', len(records), identifier)
              records = [record for record in records if record['id'] == identifier]
          if rtype is not None:
              LOGGER.debug('Filtering %d records by type: %s', len(records), rtype)
              records = [record for record in records if record['type'] == rtype]
          if name is not None:
              LOGGER.debug('Filtering %d records by name: %s', len(records), name)
              if name.endswith('.'):
                  name = name[:-1]
              records = [record for record in records if name == record['name']]
          if content is not None:
              LOGGER.debug('Filtering %d records by content: %s', len(records), content.lower())
              records = [record for record in records if
                         record['content'].lower() == content.lower()]
          return records
docs: Filter dns entries based on type, name or content.