def get_policy_level(row):
    """Assign row to a policy level by choosing the highest level of specificity of the policy within the row"""
    for level in ["adm3", "adm2", "adm1"]:
        level_name = level + "_name"
        if level_name in row and row[level_name] not in ["All", "all"]:
            return level

    return "adm0"