Create a profile form.
348305
def profile_form_factory():
    """"""
    if current_app.config['USERPROFILES_EMAIL_ENABLED']:
        return EmailProfileForm(
            formdata=None,
            username=current_userprofile.username,
            full_name=current_userprofile.full_name,
            email=current_user.email,
            email_repeat=current_user.email,
            prefix='profile', )
    else:
        return ProfileForm(
            formdata=None,
            obj=current_userprofile,
            prefix='profile', )
958248
def profile
      unless @profile
        if associated_profile
          @profile = Profile.new(associated_profile)
        else
          options = {:fields => 'user_id', :includes => 'Profile'}
          options = options.merge(:access_token => token, :access_secret => secret) if (token && secret)
          tmp = User.find(username, options)
          @profile = Profile.new(tmp.associated_profile)
        end
      end
      @profile
    end
1098684
public function my()
    {
        $profile = $this->Profiles->find()
            ->where([
                'Profiles.user_id' => $this->Auth->user('id')
            ])->contain('Users')->first();

        $this->set('profile', $profile);
        $this->set('_serialize', ['profile']);
    }
863609
def create_user_profile(sender, instance, created, **kwargs):
    """"""
    if created:
        profile = UserProfile.objects.get_or_create(user=instance)[0]
        profile.hash_pass = create_htpasswd(instance.hash_pass)
        profile.save()
    else:
        # update password
        try:
            up = UserProfile.objects.get(user=instance.id)
            up.hash_pass = create_htpasswd(instance.hash_pass)
            up.save()
        except AttributeError:
            pass
67981
def _options_form_default(self):
        '''
        
        '''
        if not self.profile_list:
            return ''
        if callable(self.profile_list):
            return self._render_options_form_dynamically
        else:
            return self._render_options_form(self.profile_list)
199120
def createKmerProfile(self, k, profileCsvFN):
        '''
        
        '''
        searches = [('', 0, self.bwt.shape[0])]
        normTotal = 0
        lines = []
        while len(searches) > 0:
            (seq, start, end) = searches.pop(0)
            
            if len(seq) == k:
                lines.append(seq+','+str(end-start))
                normTotal += (end-start)**2
            else:
                nls = self.getFullFMAtIndex(start)
                nhs = self.getFullFMAtIndex(end)
                for c in xrange(self.vcLen-1, -1, -1):
                    if nls[c] == nhs[c]:
                        #do nothing
                        pass
                    else:
                        newSeq = self.numToChar[c]+seq
                        searches.insert(0, (newSeq, int(nls[c]), int(nhs[c])))
        
        fp = open(profileCsvFN, 'w+')
        fp.write('total,'+str(math.sqrt(normTotal))+'\n')
        for l in sorted(lines):
            fp.write(l+'\n')
        fp.close()
64183
public void addProfile(Profile profile) {
        if (PROFILE_KIND.equals(profile.getKind())) {
            this.profileList.add(profile.getSettings());
        }
    }
1259154
def saveProfileAs( self ):
        
        name, ok = QInputDialog.getText(self, 'Create Profile', 'Name:')
        if ( not name ):
            return
        
        manager = self.parent()
        prof    = manager.viewWidget().saveProfile()
        prof.setName(nativestring(name))
        self.parent().addProfile(prof)
1039872
def run(self, *args):
        """"""

        uuid, kwargs = self.__parse_arguments(*args)
        code = self.edit_profile(uuid, **kwargs)

        return code
564154
def profile(request):
    '''
    
    '''
    serializer_class = registration_settings.PROFILE_SERIALIZER_CLASS
    if request.method in ['POST', 'PUT', 'PATCH']:
        partial = request.method == 'PATCH'
        serializer = serializer_class(
            instance=request.user,
            data=request.data,
            partial=partial,
        )
        serializer.is_valid(raise_exception=True)
        serializer.save()
    else:  # request.method == 'GET':
        serializer = serializer_class(instance=request.user)

    return Response(serializer.data)
716343
function(profiles) {
			profiles = utils.parseJSON(profiles);
			Object.keys(profiles).forEach(function(name) {
				profile.create(name, normalizeProfile(profiles[name]));
			});
		}
56655
def create(self, request):
        """"""
        form = (self.form or generate_form(self.model))(request.POST)

        if form.is_valid():
            object = form.save()

            return self._render(
                request = request,
                template = 'show',
                context = {
                    cc2us(self.model.__name__): object
                },
                status = 201
            )
        else:
            return self._render(
                request = request,
                template = 'new',
                context = {
                    'form': form
                },
                status = 400
            )
688787
function createProfile(done) {
            if (self.closed) return done(null);

            temp.mkdir('browser-controller', function(err, dirpath) {
                if (err) return done(err);

                self.userDir = dirpath;

                done(null);
            });
        }
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)
980936
def create_profile(ctx, package):
    """"""
    from canari.commands.create_profile import create_profile
    create_profile(ctx.config_dir, ctx.project, package)
790746
def register():
    "  "
    form = RegisterForm(request.form)
    if form.validate_on_submit():
        # create an user instance not yet stored in the database
        user = User(
            username=form.username.data,
            email=form.email.data,
            pw_hash=form.password.data)

        # Insert the record in our database and commit it
        db.session.add(user)
        db.session.commit()

        users.login(user)

        # flash will display a message to the user
        flash(_('Thanks for registering'))
        # redirect user to the 'home' method of the user module.
        return redirect(url_for('users.profile'))
    return render_template("users/register.html", form=form)
624475
def profile_update(request, template="accounts/account_profile_update.html",
                   extra_context=None):
    
    profile_form = get_profile_form()
    form = profile_form(request.POST or None, request.FILES or None,
                        instance=request.user)
    if request.method == "POST" and form.is_valid():
        user = form.save()
        info(request, _("Profile updated"))
        try:
            return redirect("profile", username=user.username)
        except NoReverseMatch:
            return redirect("profile_update")
    context = {"form": form, "title": _("Update Profile")}
    context.update(extra_context or {})
    return TemplateResponse(request, template, context)