def to_python(self, value):
        """Convert value if needed."""
        if isinstance(value, GroupDescriptor):
            value = value._value  # pylint: disable=protected-access

        result = {}
        for name, field in self.fields.items():
            result[name] = field.to_python(value.get(name, None))

        return GroupDescriptor(result)
def to_python ( self , value ) : if isinstance ( value , GroupDescriptor ) : value = value . _value result = { } for name , field in self . fields . items ( ) : result [ name ] = field . to_python ( value . get ( name , None ) ) return GroupDescriptor ( result )
Convert value if needed.