def METHOD_NAME(values):
    result = []
    final_problem_id = None
    final_problem_link = None
    print values.keys()
    if "practice" in values:
        if len(values["practice"]) > 1:
            for problem_record in values["practice"]:
                response = requests.get(problem_record.link)
                if response.status_code == 200 and response.url == problem_record.link:
                    final_problem_id = problem_record.id
                    final_problem_link = problem_record.link
                    break
        else:
            problem_record = values["practice"][0]
            response = requests.get(problem_record.link)
            if response.status_code == 200:
                final_problem_id = problem_record.id
                final_problem_link = problem_record.link
    if final_problem_id is None and "problem" in values:
        problem_record = values["problem"][0]
        response = requests.get(problem_record.link)
        if response.status_code == 200 and response.url == problem_record.link:
            final_problem_id = problem_record.id
            final_problem_link = problem_record.link
    if final_problem_id is None and "challenges" in values:
        final_problem_id = values["challenges"][0].id
        final_problem_link = values["challenges"][0].link
    if final_problem_id is None and "challenge" in values:
        final_problem_id = values["challenge"][0].id
        final_problem_link = values["challenge"][0].link
    if final_problem_id is None and "something_else" in values:
        final_problem_id = values["something_else"][0].id
        final_problem_link = values["something_else"][0].link
    if final_problem_id is None:
        if values.keys() == ["problem", "practice"]:
            values["problem"][0].delete_record()
            values["practice"][0].delete_record()
        else:
            print "Couldn't find problem record for", values
        return
    for key in values:
        for problem in values[key]:
            print problem.link, "-->", final_problem_link
            print problem.id, "-->", final_problem_id
            utilities.merge_duplicate_problems(final_problem_id, problem.id)