<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def deflate(self, value):
 """ Handles the marshalling from NeomodelPoint to Neo4J POINT :param value: The point that was assigned as value to a property in the model :type value: NeomodelPoint :return: Neo4J POINT """

        if not isinstance(value, NeomodelPoint):
            raise TypeError('Invalid datatype to deflate. Expected NeomodelPoint, received {}'.format(type(value)))

        if not value.crs == self._crs:
            raise ValueError('Invalid CRS. '
                             'Expected NeomodelPoint defined over {}, '
                             'received NeomodelPoint defined over {}'.format(self._crs, value.crs))

        if value.crs == 'cartesian-3d':
            return neo4j.types.spatial.CartesianPoint((value.x, value.y,  value.z))
        elif value.crs == 'cartesian':
            return neo4j.types.spatial.CartesianPoint((value.x,value.y))
        elif value.crs == 'wgs-84':
            return neo4j.types.spatial.WGS84Point((value.longitude, value.latitude))
        elif value.crs == 'wgs-84-3d':
            return neo4j.types.spatial.WGS84Point((value.longitude, value.latitude, value.height))