def group_reference(string):
    string = ''.join(string.split())
    return ''.join(e if (len(string) - i - 1) % 5 else e + " " for (i, e) in enumerate(string)).strip()
Group reference number to have space after every fifth number
dataset/ETHPy150Open kapsiry/sikteeri/membership/utils.py/group_reference