def get_by_name_and_source(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()
    )

    Retrieves an endpoint by it's name and source.
    :param name:
    :param source:
    :return:
    
lemur/endpoints/service.py