code: def _validate_geometry(self, geometry):
          
  
          if geometry is not None and geometry not in self.valid_geometries:
              raise InvalidParameterError("{} is not a valid geometry".format(geometry))
  
          return geometry
docs: Validates geometry, raising error if invalid.