def get(cls, resource_id, include_deactivated=False):
        """
        Get a resource

        :param resource_id: a resource's ID
        :param include_deactivated: Include deactivated resources in response

        :returns: Document instance
        :raises: SocketError, CouchException
        """
        resource = yield cls.db_client().get_doc(resource_id)

        if resource.get('type') != cls.resource_type:
            raise exceptions.NotFound()

        if not include_deactivated and resource.get('state') == State.deactivated.name:
            raise exceptions.NotFound()

        raise Return(cls(**resource))
def get ( cls , resource_id , include_deactivated = False ) : resource = yield cls . db_client ( ) . get_doc ( resource_id ) if resource . get ( 'type' ) != cls . resource_type : raise exceptions . NotFound ( ) if not include_deactivated and resource . get ( 'state' ) == State . deactivated . name : raise exceptions . NotFound ( ) raise Return ( cls ( ** resource ) )
Get a resource

        :param resource_id: a resource's ID
        :param include_deactivated: Include deactivated resources in response

        :returns: Document instance
        :raises: SocketError, CouchException