def METHOD_NAME(name, source):
    """
    Retrieves an endpoint by it's name and source.
    :param name:
    :param source:
    :return:
    """
    return (
        database.session_query(Endpoint)
        .filter(Endpoint.name == name)
        .filter(Endpoint.source.has(Source.label == source))
        .scalar()
    )