code: def _get_fields(mcs, bases, namespace):
          
          fields = [
              (name, namespace.pop(name))
              for name, attribute
              in list(namespace.items())
              if isinstance(attribute, BaseField)
          ]
  
          for base in reversed(bases):
              if hasattr(base, mcs._fields_storage_key):
                  fields = list(
                      getattr(base, mcs._fields_storage_key).items()
                  ) + fields
  
          return OrderedDict(fields)
docs: Create fields dictionary to be used in resource class namespace.
  
          Pop all field objects from attributes dict (namespace) and store them
          under _field_storage_key atrribute. Also collect all fields from base
          classes in order that ensures fields can be overriden.
  
          Args:
              bases: all base classes of created serializer class
              namespace (dict): namespace as dictionary of attributes