

def get_imei(n):
    'Random IMEI generator. This function return random but not unique\n    IMEI number. Based on code from http://stackoverflow.com/a/20733310\n    '

    def luhn_residue(digits):
        'Luhn algorithm'
        return (sum((sum(divmod((int(d) * (1 + (i % 2))), 10)) for (i, d) in enumerate(digits[::(- 1)]))) % 10)
    part = ''.join((str(random.randrange(0, 9)) for _ in range((n - 1))))
    res = luhn_residue('{}{}'.format(part, 0))
    return '{}{}'.format(n, ((- res) % 10))

dataset/ETHPy150Open allegro/ralph/src/ralph/data_importer/management/commands/demodata.py get_imei/VarMisuse@129/201 `part`->`n`