def _app_complete_on_provider(application, provider):
    """
    Determines if an Application is completely available on a Provider, i.e. all active ApplicationVersions have a
    ProviderMachine + InstanceSource on given Provider.

    Args:
        application: Application object
        provider: Provider object

    Returns: boolean
    """
    for av in application.active_versions():
        av_on_prov = False
        for prov_machine in av.machines.all():
            if prov_machine.instance_source.provider == provider:
                av_on_prov = True
        if not av_on_prov:
            return False
    return True