def __init__(self, *args, **kwargs):
        """Initialization."""
        # Don't pass the `fields` argument to the superclass
        fields = kwargs.pop('fields', None)

        # Instantiate the superclass
        super(FieldSelectorSerializer, self).__init__(*args, **kwargs)

        if fields:
            # Drop any fields that are not specified in the `fields` argument
            allowed = set(fields)
            existing = set(self.fields.keys())
            for field in existing - allowed:
                self.fields.pop(field)
dataset/ETHPy150Open ExCiteS/geokey/geokey/core/serializers.py/FieldSelectorSerializer.__init__/original