<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _validate_geometry(self, geometry):
 """Validates geometry, raising error if invalid."""


        if geometry is not None and geometry not in self.valid_geometries:
            raise InvalidParameterError("{} is not a valid geometry".format(geometry))

        return geometry