def METHOD_NAME(fleurconf_str: str, keep_spin: bool = False) -> str:
    """
    '[Kr] (4d3/2) (4d5/2) (4f5/2) (4f7/2)' -> '[Kr] 4d10 4f14', or '[Kr] 4d3/2 4d5/2 4f5/2 4f7/2'
    # for now only use for coreconfig, it will fill all orbitals, since it has no information on the filling.
    :param fleurconf_str: string of the electron config like it is read from the inp.xml
    :param keep_spin: bool if True the spin indices will be kept in the converted string
    :returns: string of the electron config to be used in the inpgen
    """
    econfstring = fleurconf_str.replace('(', '').replace(')', '')
    if keep_spin:
        econfstring.split()
    else:
        elist = econfstring.split()
        econfstring_new = ''
        for state in elist:
            if '/' in state:
                # check if nl was added before if not add it with full occ
                base = state[:2]
                spin = state[2:]
                occ = max_state_occ_spin.get(spin)
                if occ is None:
                    raise ValueError(f'Failed to get maximum occupation for spin {spin}')
                if base not in econfstring_new:
                    econfstring_new = f'{econfstring_new}{base}{int(occ)} '
                else:
                    max_occ = max_state_occ.get(base[1])
                    if max_occ is None:
                        raise ValueError(f'Failed to get maximum occupation for orbital {base[1]}')
                    econfstring_new = econfstring_new.split(base, maxsplit=1)[0] + f'{base}{int(max_occ)} '
                    # we assume here that the two states come behind each other, ... rather bad
                    #econfstring_new.replace('{}'.format(base)
            else:
                econfstring_new = econfstring_new + state + ' '
        econfstring = econfstring_new
    return econfstring.strip()