def get_username(uid=None):
    if uid:
        if sys.platform == 'win32':
            return 'unknown-%s' % uid
        else:
            return pwd.getpwuid(uid).pw_name
    else:
        if sys.platform == 'win32':
            return os.environ['USERNAME']
        else:
            return pwd.getpwuid(os.getuid()).pw_name
:API: public
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/scripts/repo.py/get_username--crossover with--dataset/ETHPy150Open pantsbuild/pants/src/python/pants/build_graph/prep_command.py/PrepCommand.__init__