import operator


def sort_branches(branches, attr):
    """Sorts the given list of branches in place by the given attribute
    (`str`).
    """
    return branches.sort(key=operator.attrgetter(attr))