def METHOD_NAME(problem_instances, problem):
    problem_id = None
    for pi in problem_instances:
        if pi.short_name == problem:
            return pi
        elif pi.short_name.find(problem) != -1:
            if problem_id is None:
                problem_id = pi
            else:
                # matched more than one available problem
                return None
    return problem_id