def add_system_user(self, user):
        name = user.name
        cmd = [ arg.replace('USERNAME', name) for arg in self.add_user_cmd ] + [name]
        self.log.info("Creating user: %s", ' '.join(map(pipes.quote, cmd)))
        p = Popen(cmd, stdout=PIPE, stderr=STDOUT)
        p.wait()
        if p.returncode:
            err = p.stdout.read().decode('utf8', 'replace')
            raise RuntimeError("Failed to create system user %s: %s" % (name, err))
Create a new Linux/UNIX user on the system. Works on FreeBSD and Linux, at least.
dataset/ETHPy150Open jupyterhub/jupyterhub/jupyterhub/auth.py/LocalAuthenticator.add_system_user