def activate_wps(wps, endpoint, name):
    """
    Activate a WebProcessingService object by calling getcapabilities() on it and handle errors appropriately.

    Args:
      wps (owslib.wps.WebProcessingService): A owslib.wps.WebProcessingService object.

    Returns:
      (owslib.wps.WebProcessingService): Returns an activated WebProcessingService object or None if it is invalid.
    """
    # Initialize the object with get capabilities call
    try:
        wps.getcapabilities()
    except __HOLE__ as e:
        if e.code == 404:
            e.msg = 'The WPS service could not be found at given endpoint "{0}" for site WPS service ' \
                    'named "{1}". Check the configuration of the WPS service in your ' \
                    'settings.py.'.format(endpoint, name)
            raise e
        else:
            raise e
    except URLError as e:
        return None
    except:
        raise

    return wps
dataset/ETHPy150Open tethysplatform/tethys/tethys_services/utilities.py/activate_wps