Create a user
 @param [String, Symbol] username
 @param [String, Symbol] password
 @raise [RuntimeError] if the request failed
 @return true
493579
def create_user(username, password)
      new_action = { 'UserName' => username, 'Password' => password, 'Oem' => { 'Hp' => { 'LoginName' => username } } }
      response = rest_post('/redfish/v1/AccountService/Accounts/', body: new_action)
      response_handler(response)
      true
    end
771856
def create_superuser(
            self, username, email, short_name, full_name,
            institute, password, **extra_fields):
        
        return self._create_user(
            username=username, email=email,
            institute=institute, password=password,
            short_name=short_name, full_name=full_name,
            is_admin=True, **extra_fields)
1230820
def add_user(username, password):
    

    user_model = Query()
    if db.search(user_model.username == username):
        return {
            'error': 'User {0} already exists'.format(username)
        }

    salt = hashlib.sha512(str(os.urandom(64)).encode('utf-8')).hexdigest()
    password = hash_password(password, salt)
    api_key = gen_api_key(username)

    user = {
        'username': username,
        'password': password,
        'salt': salt,
        'api_key': api_key
    }
    user_id = db.insert(user)

    return {
       'result': 'success',
       'eid': user_id,
       'user_created': user
    }
317765
def create
      logger.debug("Create new user")
      @user = User.new(user_params)
      if @user.save

        # Save succeeded. Render the response based on the created user.
        render json: @user,
               except: [:verification_token, :reset_token, :password_digest],
               status: 201

        # Then, issue the verification token and send the email for
        # verification.
        @user.issue_token(:verification_token)
        @user.save
        user_mailer.email_verification(@user).deliver_later
      else
        render_errors 400, @user.errors.full_messages
      end
    end
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
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)
1112401
def create_user(name,
                username,
                email,
                password,
                token_manager=None,
                app_url=defaults.APP_URL):
    
    headers = token_manager.get_access_token_headers()
    auth_url = environment.get_auth_url(app_url=app_url)
    url = "%s/api/v1/accounts" % auth_url

    payload = {
        'name': name,
        'username': username,
        'email': email,
        'password': password
    }

    response = requests.post(url,
                             data=json.dumps(payload),
                             headers=headers)

    if response.status_code == 201:
        return response.json()

    else:
        raise JutException('Error %s: %s' % (response.status_code, response.text))
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
453847
def create(self, username, password, tags=''):
        
        user_payload = json.dumps({
            'password': password,
            'tags': tags
        })
        return self.http_client.put(API_USER % username,
                                    payload=user_payload)
568300
public login login(String username, String password) throws Exception
	{
		this.set_credential(username, password);
		return this.login();
	}
740535
def create_user(self, name, password, is_super=False):
        
        statement = ddl.CreateUser(
            name=name, password=password, is_super=is_super
        )
        self._execute(statement)
320993
def login_with_password(bot, name, password)
            send Common::Login.new(bot, name, password, nil)
        end
948979
def create_user(self, name, password, database_names, host=None):
        
        if not isinstance(database_names, (list, tuple)):
            database_names = [database_names]
        # The API only accepts names, not DB objects
        database_names = [db if isinstance(db, six.string_types) else db.name
                for db in database_names]
        self._user_manager.create(name=name, password=password,
                database_names=database_names, host=host, return_none=True)
        # Since the API doesn't return the info for creating the user object,
        # we have to do it manually.
        return self._user_manager.find(name=name)
824733
def assign_credential(username)
      raise ArgumentError, "The username cannot be nil"   unless username
      raise ArgumentError, "The username cannot be empty" if username.empty?

      self.service.assignCredential(username.to_s)
      
      @credentials = nil
    end
851594
def create(email, password):
    
    with get_app().app_context():
        user = User(email=email, password=password)
        result = user_service.save(user)
        if not isinstance(result, User):
            print_validation_errors(result)
            return

        click.echo(green('\nUser created:'))
        click.echo(green('-' * 40))
        click.echo(str(user) + '\n')
229146
def new(cls,
            username,
            password=None,
            email=None,
            first_name="",
            last_name="",
            login_method=None,
            role="MEMBER"
            ):
        
        data = {
            "first_name": first_name,
            "last_name": last_name,
            "email": email
        }

        if not password:
            password = utils.generate_random_string()

        username = username.strip().lower()
        if "@" in username and not email:
            if not utils.is_email_valid(username):
                exceptions.AuthError(_("Invalid username"))
            data["email"] = username
        elif email:
            if not utils.is_email_valid(email):
                exceptions.AuthError(_("Invalid username"))

        if not utils.is_username_valid(username):
            exceptions.AuthError(_("Invalid username"))
        if not utils.is_password_valid(password):
            raise exceptions.AuthError(_("Password is invalid"))

        if cls.get_by_username(username):
            raise exceptions.AuthError(_("Username exists already"))
        _email = data.get("email")
        if _email:
            if cls.get_by_email(_email):
                raise exceptions.AuthError(_("Email address exists already"))

        role = AuthUserRole.get_by_name(role or "MEMBER")
        if not role:
            raise exceptions.AuthError(_("Invalid user role"))

        data.update({
            "username": username,
            "password_hash": cls.encrypt_password(password),
            "email_verified": False,
            "login_method": login_method,
            "role": role,
            "status": cls.STATUS_ACTIVE
        })
        user = cls.create(**data)
        user.reset_secret_key()
        return user
1238310
public User createAccount(String userName, String password) throws IOException {
        User user = User.getById(userName, true);
        user.addProperty(Details.fromPlainPassword(password));
        SecurityListener.fireUserCreated(user.getId());
        return user;
    }