'Retrieve a client by its identifier.
:param client_id: Identifier of a client app.
:return: An instance of :class:`oauth2.datatype.Client`.
:raises: :class:`oauth2.error.ClientNotFoundError` if no data could be retrieved for
given client_id.'

def fetch_by_client_id(self, client_id):

    orm_client = self.db.query(orm.OAuthClient).filter((orm.OAuthClient.identifier == client_id)).first()
    if (orm_client is None):
        raise ClientNotFoundError()
    return Client(identifier=client_id, redirect_uris=[orm_client.redirect_uri], secret=HashComparable(orm_client.secret))
