Adds a new user to the oauth server.

@method
@memberOf corbel.Oauth.UserBuilder

@param {Object} user    The user to be created

@return {Promise} A promise with the id of the created user or fails
with a {@link corbelError}.
491600
function(user) {
                console.log('oauthInterface.user.create', user);

                return this.request({
                        url: this._buildUri(this.uri),
                        method: corbel.request.method.POST,
                        headers: {
                            Authorization: 'Basic ' + this.getSerializer()(this.clientId + ':' + this.clientSecret)
                        },
                        dataType: 'text',
                        data: user
                    })
                    .then(function(res) {
                        return corbel.Services.getLocationId(res);
                    });
            }
889752
def create_user(cls, username, password, name, email):
        """"""
        config = Config()
        payload = {"username": username,
                   "email": email,
                   "name": name,
                   "password": password, }
        user_creation_resp = requests.post("https://users.{}/users/".format(config.host),
                                           json=payload)
        if user_creation_resp.status_code != 201:
            raise errors.ResourceError("couldnt create user")
837446
public void addUserToCache(User user) {
        users.compute(user.getId(), (key, value) -> {
            Optional.ofNullable(value)
                    .map(Reference::get)
                    .filter(oldUser -> oldUser != user)
                    .map(Cleanupable.class::cast)
                    .ifPresent(Cleanupable::cleanup);

            WeakReference<User> result = new WeakReference<>(user, usersCleanupQueue);
            userIdByRef.put(result, key);
            return result;
        });
    }
813742
def create_user(user, opts = {})
      data, _status_code, _headers = create_user_with_http_info(user, opts)
      return data
    end
1202575
public com.authy.api.User createUser(String email, String phone, String countryCode) throws AuthyException {
        User user = new User(email, phone, countryCode);
        final Response response = this.post(NEW_USER_PATH, user);
        return userFromJson(response.getStatus(), response.getBody());
    }
180957
def create_user(self, user):
        
        self.run("useradd -m %s" % user)
        usr =  getpwnam(user)
        return usr
614570
protected function createUser( UserResponseInterface $response )
    {
        $user = $this->userManager->createUser();
        $user->setUsername( $this->createUniqueUsername( $this->getRealName( $response )));
        $user->setEmail( $this->getEmail( $response ) );
        $user->setPassword( '' );
        $user->setEnabled( true );
        $this->userManager->updateUser( $user );
        $this->createIdentity( $user, $response );
        return $user;
    }
502541
function(properties) {
  if (this instanceof User) {
    for (var property in (properties || {})) {
      if (Array.prototype.hasOwnProperty.call(properties, property)) {
        this[property] = properties[property];
      }
    }
  }
  else {
   return(new User(properties));
  }
}
804671
def add_user(self, user, **kwargs):
        """"""
        if isinstance(user, User):
            user = user['id']

        assert isinstance(user, six.string_types)

        endpoint = '{0}/{1}/users/{2}'.format(
            self.endpoint,
            self['id'],
            user,
        )
        result = self.request('PUT', endpoint=endpoint, query_params=kwargs)
        return result
1292025
function(provider, options) {
      var authType;
      if (_.isString(provider)) {
        authType = provider;
        provider = Parse.User._authProviders[provider];
      } else {
        authType = provider.getAuthType();
      }
      if (_.has(options, 'authData')) {
        var authData = this.get('authData') || {};
        authData[authType] = options.authData;
        this.set('authData', authData);

        // Overridden so that the user can be made the current user.
        var newOptions = _.clone(options) || {};
        newOptions.success = function(model) {
          model._handleSaveResult(true);
          if (options.success) {
            options.success.apply(this, arguments);
          }
        };
        return this.save({'authData': authData}, newOptions);
      } else {
        var self = this;
        var promise = new Parse.Promise();
        provider.authenticate({
          success: function(provider, result) {
            self._linkWith(provider, {
              authData: result,
              success: options.success,
              error: options.error
            }).then(function() {
              promise.resolve(self);
            });
          },
          error: function(provider, error) {
            if (options.error) {
              options.error(self, error);
            }
            promise.reject(error);
          }
        });
        return promise;
      }
    }
575573
function _createUser(){
    var excludedFields = ['name', 'screen_name', 'profile_image'],
        nameparts = this.socialUserInfo.name.split(' '),
        newUser = {
        role: 'external',
        identities: {
            twitter: {
                id: this.socialUserInfo.id_str,
                accessToken: this.options.oauth_token,
                accessSecret: this.options.oauth_token_secret,
                screen_name: this.socialUserInfo.screen_name
            }
        },
        linkedidentities: ['twitter'],
        profile: {
            picture: this.socialUserInfo.profile_image_url
        },
        enabled: true,
        email: '',
        displayname: this.socialUserInfo.screen_name,
        firstname: nameparts[0],
        lastname: (nameparts.length > 1) ? nameparts[1] : ' '
    };

    _.each(profileFieldsArr, function(field){
        if(excludedFields.indexOf(field) === -1){
            newUser.profile[field] = this.socialUserInfo[field];
        }
    }.bind(this));

    return db.users.insert(newUser);
}
396837
function createUser(user, callback) {
      /* jshint validthis:true */
      var cb = callback || angular.noop;

      return User.save(user,
        function (data) {
          return cb(user);
        },
        function (err) {
          return cb(err);
        }.bind(this)).$promise;
    }
175450
function patchUser(user, patchToUser) {
      return users.patch(user.id || user._id, patchToUser, {}) // needs users from closure
        .then(() => Object.assign(user, patchToUser));
    }
1250939
function User(options) {
  this.defaults = User.defaults;
  this.debug = debug;
  Entity.call(this, options);
}
504555
def _create_user(self, username, password, mail, method, uuid):
        """"""

        try:
            if method == 'Invited':
                config_role = self.config.group_accept_invited
            else:
                config_role = self.config.group_accept_enrolled

            roles = []
            if ',' in config_role:
                for item in config_role.split(','):
                    roles.append(item.lstrip().rstrip())
            else:
                roles = [config_role]

            newuser = objectmodels['user']({
                'name': username,
                'passhash': std_hash(password, self.salt),
                'mail': mail,
                'uuid': std_uuid(),
                'roles': roles,
                'created': std_now()
            })

            if method == 'Invited':
                newuser.needs_password_change = True

            newuser.save()
        except Exception as e:
            self.log("Problem creating new user: ", type(e), e,
                     lvl=error)
            return

        try:
            newprofile = objectmodels['profile']({
                'uuid': std_uuid(),
                'owner': newuser.uuid
            })
            self.log("New profile uuid: ", newprofile.uuid,
                     lvl=verbose)

            newprofile.save()

            packet = {
                'component': 'hfos.enrol.enrolmanager',
                'action': 'enrol',
                'data': [True, mail]
            }
            self.fireEvent(send(uuid, packet))

            # TODO: Notify crew-admins
        except Exception as e:
            self.log("Problem creating new profile: ", type(e),
                     e, lvl=error)
977054
public void addUserInUserManager(User user) {
        if (!userManager.getUserList().contains(user.getUsername())) {
            try {
                userManager.createUser(user.getUsername());
            } catch (UserExistsException e) {
                LOGGER.warn("User already exists!", e);
                return;
            }
        }
        for (Attribute attribute : user.getAttributes()) {
            userManager.setUserAttribute(user.getUsername(), attribute.getAttributeName(), attribute.getValues()
                    .toArray());
        }
    }
352730
function(userId) {
    return new Promise((resolve, reject) => {
      this._start()
          .uri('/api/user')
          .urlSegment(userId)
          .get()
          .go(this._responseHandler(resolve, reject));
    });
  }