def get_profile_from_id(instance_session, instance_url, instance_key, instance_profile, instance_name=''):
    instance_profiles = get_quality_profiles(instance_session=instance_session, instance_url=instance_url, instance_key=instance_key)
    profile = next((item for item in instance_profiles if (item['name'].lower() == instance_profile.lower())), False)
    if (not profile):
        logger.error('Could not find profile_id for instance {} profile {}'.format(instance_name, instance_profile))
        exit_system()
    instance_profile_id = profile.get('id')
    logger.debug(f'found profile_id (instance{instance_name}) "{instance_profile_id}" from profile "{instance_profile}"')
    return instance_profile_id
def get_profile_from_id(instance_session, instance_url, instance_key, instance_profile, instance_name=):
    instance_profiles = get_quality_profiles(instance_session=instance_session, instance_url=instance_url, instance_key=instance_key)
    profile = next((item for item in instance_profiles if (item['name'].lower() == instance_profile.lower())), False)
    if (not profile):
        logger.error('Could not find profile_id for instance {} profile {}'.format(instance_name, instance_profile))
        exit_system()
    instance_profile_id = profile.get('id')
    logger.debug(f'found profile_id (instance{instance_name}) "{instance_profile_id}" from profile "{instance_profile}"')
    return instance_profile_id