generate a new user in the database, still session based so we
       create a new identifier. This function is called from the users new 
       entrypoint, and it assumes we want a user generated with a token.
766735
def generate_user(self):
    '''
    '''
    token = str(uuid.uuid4())
    return self.generate_subid(token=token, return_user=True)
107223
def user_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/users.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
512812
function generateForUser(user, existingToken) {
        existingToken = existingToken || {};

        var privateKey = config.security.token.privateKey;
        var decryptedToken = _.extend(existingToken, { _id: user._id, authToken: user.authToken });

        return jsonwebtoken.sign(decryptedToken, privateKey);
    }
1213858
function createUser(ctx, next) {
            client.post({
                path: '/v1/users/'
            }, {
                username: opts.username,
                email: opts.email,
                password: opts.password
            }, function _afterCreateUser(err, req, res, body) {
                if (err && !res) {  // e.g. connect error
                    return next(err);
                }
                ctx.createStatusCode = res.statusCode;
                ctx.createErr = err;
                ctx.createBody = body;
                next();
            });
        }
407373
def create
      user = Lines::User.find_by(email: params[:email])
      if user && user.authenticate(params[:password])
        session[:user_id] = user.id
        redirect_to admin_root_url
      else
        flash.now[:error] = t('lines.login_error')
        render "new"
      end
    end
1111885
function create(req, res, next) {
  var body = req.body;
  body.user_id = req.session.user.id;

  db.posts.create(req.body, function(err, post) {
    if(err) { return next(err); }

    res.json(201, post);
    signals.emit('post:create', post);
  });
}
1098763
def __generate_new_sandbox_user():
    

    url = ApiEnvironmentType.SANDBOX.uri_base + __ENDPOINT_SANDBOX_USER

    headers = {
        ApiClient.HEADER_REQUEST_ID: __UNIQUE_REQUEST_ID,
        ApiClient.HEADER_CACHE_CONTROL: ApiClient._CACHE_CONTROL_NONE,
        ApiClient.HEADER_GEOLOCATION: ApiClient._GEOLOCATION_ZERO,
        ApiClient.HEADER_LANGUAGE: ApiClient._LANGUAGE_EN_US,
        ApiClient.HEADER_REGION: ApiClient._REGION_NL_NL,
    }

    response = requests.request(ApiClient._METHOD_POST, url, headers=headers)

    if response.status_code is ApiClient._STATUS_CODE_OK:
        response_json = json.loads(response.text)
        return endpoint.SandboxUser.from_json(
            json.dumps(response_json[__FIELD_RESPONSE][__INDEX_FIRST][
                           __FIELD_API_KEY]))

    raise BunqException(_ERROR_COULD_NOT_CREATE_NEW_SANDBOX_USER)
1151655
def create(self, validated_data):
        ''''''
        validated_data['username'] = validated_data['email']
        admin = validated_data.pop('is_superuser', None)

        if admin is True:
            user = User.objects.create_superuser(**validated_data)
        else:
            user = User.objects.create_user(**validated_data)

        return user
721471
def token_new():
    """"""
    form = TokenForm(request.form)
    form.scopes.choices = current_oauth2server.scope_choices()

    if form.validate_on_submit():
        t = Token.create_personal(
            form.data['name'], current_user.get_id(), scopes=form.scopes.data
        )
        db.session.commit()
        session['show_personal_access_token'] = True
        return redirect(url_for(".token_view", token_id=t.id))

    if len(current_oauth2server.scope_choices()) == 0:
        del(form.scopes)

    return render_template(
        "invenio_oauth2server/settings/token_new.html",
        form=form,
    )
438011
def create_user(self, instance, name, password, database_names, host=None):
        
        return instance.create_user(name=name, password=password,
                database_names=database_names, host=host)
1069746
def create_user(backend, details, response, uid, username, user=None, *args, **kwargs):
    
    if user:
        return {'user': user}
    if not username:
        return None
    email = details.get('email')
    original_email = None
    # email is required
    if not email:
        message = _("""your social account needs to have a verified email address in order to proceed.""")
        raise AuthFailed(backend, message)
    # Avoid hitting field max length
    if email and len(email) > 75:
        original_email = email
        email = ''
    return {
        'user': UserSocialAuth.create_user(username=username,
                                           email=email,
                                           sync_emailaddress=False),
        'original_email': original_email,
        'is_new': True
    }
1245399
def register_user(self, user, allow_login=None, send_email=None,
                      _force_login_without_confirmation=False):
        
        should_login_user = (not self.security.confirmable
                             or self.security.login_without_confirmation
                             or _force_login_without_confirmation)
        should_login_user = (should_login_user if allow_login is None
                             else allow_login and should_login_user)
        if should_login_user:
            user.active = True

        # confirmation token depends on having user.id set, which requires
        # the user be committed to the database
        self.user_manager.save(user, commit=True)

        confirmation_link, token = None, None
        if self.security.confirmable and not _force_login_without_confirmation:
            token = self.security_utils_service.generate_confirmation_token(user)
            confirmation_link = url_for('security_controller.confirm_email',
                                        token=token, _external=True)

        user_registered.send(app._get_current_object(),
                             user=user, confirm_token=token)

        if (send_email or (
                send_email is None
                and app.config.SECURITY_SEND_REGISTER_EMAIL)):
            self.send_mail(_('flask_unchained.bundles.security:email_subject.register'),
                           to=user.email,
                           template='security/email/welcome.html',
                           user=user,
                           confirmation_link=confirmation_link)

        if should_login_user:
            return self.login_user(user, force=_force_login_without_confirmation)
        return False
25069
def create_user(self, user_object, password):
        
        LOGGER.warning("Creating User %s", user_object['username'])

        try:
            return self.user_service.createObject(user_object, password, None)
        except exceptions.SoftLayerAPIError as ex:
            if ex.faultCode == "SoftLayer_Exception_User_Customer_DelegateIamIdInvitationToPaas":
                raise exceptions.SoftLayerError("Your request for a new user was received, but it needs to be "
                                                "processed by the Platform Services API first. Barring any errors on "
                                                "the Platform Services side, your new user should be created shortly.")
            raise
200284
def create_session(self):
        

        url = self.build_url(self._endpoints.get('create_session'))
        response = self.con.post(url, data={'persistChanges': self.persist})
        if not response:
            raise RuntimeError('Could not create session as requested by the user.')
        data = response.json()
        self.session_id = data.get('id')

        return True
612985
final public function create()
    {

        $self = $this;

        $splash = $self->getSplash();
        $sessId = $this->generateId($splash);

        session_id($sessId); //Must be called before the sesion start to generate the Id
        session_cache_limiter('none');

        session_name(md5($self->cookie . $splash['agent'] . $splash['ip'] . $splash['domain']));
        session_start();

        //Create the default namespace; affix to splash;
        //The default namespace will contain vars such as -request count, - last session start time, -last session response time, etc
        //The dfault namespace will also contain, instantiated objects?
        //
        $defaultReg = new Registry("default");
        $self->registry['default'] = $defaultReg;

        //update the cookie with the expiry time
        //Create the authenticated namespace and lock it!
        $self->set("handler", $this->authenticator, "auth");

        $this->write($sessId, $splash);
    }
492418
def create(self, name):
        """"""
        with contextlib.closing(self.database.cursor()) as cursor:
            cursor.execute('INSERT INTO users(name) VALUES (?)', (name,))
            return cursor.lastrowid
273086
def create_user(**data):
    """"""
    if 'username' not in data or 'password' not in data:
        raise ValueError('username and password are required.')

    # Hash the user password
    data['password'] = generate_password_hash(
        data.pop('password'),
        method='pbkdf2:sha256'
    )

    # Here you insert the `data` in your users database
    # for this simple example we are recording in a json file
    db_users = json.load(open('users.json'))
    # add the new created user to json
    db_users[data['username']] = data
    # commit changes to database
    json.dump(db_users, open('users.json', 'w'))
    return data