def _fill_orbitals(orb_coeffs, orb_energies, orb_occupations, oe, coeffs,
    shell_types, restricted):
    """Fill in orbital coefficients, energies and occupation numbers in ``orb``.

    Parameters
    ----------
    orb : Orbitals
        An object to represent the orbitals
    oe : list
        The orbital occupation numbers and energies read with
        ``_read_cp2k_occupations_energies``.
    coeffs : dict
        The orbital coefficients read with ``_read_cp2k_orbital_coeffs``.
    shell_types : np.ndarray
        The array with shell types of the GOBasis instance.
    restricted : bool
        Is wavefunction restricted or unrestricted?
    """
    offset = 0
    offsets = []
    ls = abs(shell_types)
    for l in sorted(set(ls)):
        offsets.append(offset)
        offset += (2 * l + 1) * (l == ls).sum()
    del offset
    iorb = 0
    for l, s, occ, ener in oe:
        cs = coeffs.get((l, s))
        stride = 2 * l + 1
        for m in range(-l, l + 1):
            im = m + l
            orb_energies[iorb] = ener
            orb_occupations[iorb] = occ / float((restricted + 1) * (2 * l + 1))
            for ic in range(len(cs)):
                orb_coeffs[offsets[l] + stride * ic + im, iorb] = cs[ic]
            iorb += 1
