def sort_basis(basis, use_copy=True):
    """
    Sorts all the information in a basis set into a standard order

    If use_copy is True, the input basis set is not modified.
    """

    if use_copy:
        basis = copy.deepcopy(basis)

    for k, el in basis['elements'].items():
        if 'electron_shells' in el:
            el['electron_shells'] = sort_shells(el['electron_shells'], False)
        if 'ecp_potentials' in el:
            el['ecp_potentials'] = sort_potentials(el['ecp_potentials'], False)

    return sort_basis_dict(basis)
Sorts all the information in a basis set into a standard order

    If use_copy is True, the input basis set is not modified.