code: def declarative_fields(cls_filter, meta_base=type, extra_attr_name='base_fields'):
      
      def __new__(cls, name, bases, attrs):
          attrs[extra_attr_name] = fields = get_declared_fields(bases, attrs, cls_filter,
                  extra_attr_name=extra_attr_name)
          attrs[extra_attr_name + '_names'] = set(fields.keys())
          new_class = meta_base.__new__(cls, name, bases, attrs)
          return new_class
  
      return type('', (meta_base,), {'__new__': __new__})
docs: Metaclass that converts Field attributes to a dictionary called
      'base_fields', taking into account parent class 'cls_filter'.