:reference: https://dev.twitter.com/rest/reference/post/account/update_profile_banner
            :allowed_param:'width', 'height', 'offset_left', 'offset_right'
341184
def update_profile_banner(self, filename, **kargs):
        
        f = kargs.pop('file', None)
        headers, post_data = API._pack_image(filename, 700, form_field='banner', f=f)
        bind_api(
            api=self,
            path='/account/update_profile_banner.json',
            method='POST',
            allowed_param=['width', 'height', 'offset_left', 'offset_right'],
            require_auth=True
        )(post_data=post_data, headers=headers)
1241499
def update(self, pbar, width):
        ''

        left, marker, right = (format_updatable(i, pbar) for i in
                               (self.left, self.marker, self.right))

        width -= len(left) + len(right)
        # Marker must *always* have length of 1
        marker *= int(pbar.currval / pbar.maxval * width)

        if self.fill_left:
            return '%s%s%s' % (left, marker.ljust(width, self.fill), right)
        else:
            return '%s%s%s' % (left, marker.rjust(width, self.fill), right)
25288
def update_account_info(self):
        ''' 

        '''
        request = self._get_request()
        return request.post(self.ACCOUNT_UPDATE_URL, {
            'callback_url': self.account.callback_url
        })
950995
@POST
  @Path("{id}")
  @RolesAllowed({"ROLE_ADMIN"})
  public Response update(@PathParam("id") Long id,
                         @Context UriInfo uriInfo,
                         @Context SecurityContext securityContext,
                         DUser user) {
    checkNotNull(id);
    // Username and email will never be updated, no need to check format

    user = userService.update(id, user, securityContext.isUserInRole(OAuth2UserResource.ROLE_ADMIN));

    UriBuilder uriBuilder = uriInfo.getBaseUriBuilder()
        .path("api/users")
        .path(user.getId().toString());

    return Response.ok()
        .location(uriBuilder.build())
        .entity(user.getId())
        .build();
  }
1373243
def edit_announcement_view(request, announcement_pk):
    '''  '''
    announce = get_object_or_404(Announcement, pk=announcement_pk)
    profile = UserProfile.objects.get(user=request.user)
    if not (announce.incumbent == profile or request.user.is_superuser):
        return HttpResponseRedirect(
            reverse('managers:view_announcement', kwargs={"announcement_pk": announcement_pk}),
            )
    page_name = "Edit Announcement"

    announcement_form = AnnouncementForm(
        request.POST or None,
        instance=announce,
        profile=profile,
        editing=True,
        )
    if announcement_form.is_valid():
        announcement_form.save(request)
        return HttpResponseRedirect(
            reverse('managers:view_announcement', kwargs={"announcement_pk": announcement_pk}),
            )

    return render_to_response('edit_announcement.html', {
        'page_name': page_name,
        'announcement_form': announcement_form,
        }, context_instance=RequestContext(request))
199068
def profile(request, username, template="accounts/account_profile.html",
            extra_context=None):
    
    lookup = {"username__iexact": username, "is_active": True}
    context = {"profile_user": get_object_or_404(User, **lookup)}
    context.update(extra_context or {})
    return TemplateResponse(request, template, context)
1167901
def profile_settings_args_layout_json(self, required):
        

        profile_args = {}
        self.db_create_table(self.input_table, self.install_json_params().keys())
        self.db_insert_record(self.input_table, self.install_json_params().keys())
        self.gen_permutations()
        try:
            for pn in self._input_permutations[self.args.permutation_id]:
                p = self.install_json_params().get(pn.get('name'))
                if p.get('required', False) != required:
                    continue
                if p.get('type').lower() == 'boolean':
                    # use the value generated in the permutation
                    profile_args[p.get('name')] = pn.get('value')
                elif p.get('type').lower() == 'choice':
                    # use the value generated in the permutation
                    profile_args[p.get('name')] = pn.get('value')
                elif p.get('name') in ['api_access_id', 'api_secret_key']:
                    # leave these parameters set to the value defined in defaults
                    pass
                else:
                    # add type stub for values
                    types = '|'.join(p.get('playbookDataType', []))
                    if types:
                        profile_args[p.get('name')] = p.get('default', '<{}>'.format(types))
                    else:
                        profile_args[p.get('name')] = p.get('default', '')
        except IndexError:
            self.handle_error('Invalid permutation index provided.')
        return profile_args
207538
function _setUserInfoFromSocialAccount(){
    return db.users.socialAuthentication('twitter', this.socialUserInfo.id_str)
            .then(function(user){
                this.userInfo = user;
            }.bind(this))
            .catch(function(err){ // If user isn't found surpress error. If found and still error then throw.
                if(err.code !== 404){
                    throw(err);
                }
            });
}
1210074
function updateMetrics() {
		var dprM;

		isVwDirty = false;
		DPR = window.devicePixelRatio;
		cssCache = {};
		sizeLengthCache = {};

		dprM = (DPR || 1) * cfg.xQuant;

		if(!cfg.uT){
			cfg.maxX = Math.max(1.3, cfg.maxX);
			dprM = Math.min( dprM, cfg.maxX );

			ri.DPR = dprM;
		}

		units.width = Math.max(window.innerWidth || 0, docElem.clientWidth);
		units.height = Math.max(window.innerHeight || 0, docElem.clientHeight);

		units.vw = units.width / 100;
		units.vh = units.height / 100;

		units.em = ri.getEmValue();
		units.rem = units.em;

		lazyFactor = cfg.lazyFactor / 2;

		lazyFactor = (lazyFactor * dprM) + lazyFactor;

		substractCurRes = 0.4 + (0.1 * dprM);

		lowTreshHold = 0.5 + (0.2 * dprM);

		partialLowTreshHold = 0.5 + (0.25 * dprM);

		tMemory = dprM + 1.3;

		if(!(isLandscape = units.width > units.height)){
			lazyFactor *= 0.9;
		}
		if(supportAbort){
			lazyFactor *= 0.9;
		}

		evalID = [units.width, units.height, dprM].join('-');
	}
1033318
def format_list(self, at_char, user, list_name):
        ''''''
        return '<a href="https://twitter.com/%s/lists/%s">%s%s/%s</a>' \
               % (user, list_name, at_char, user, list_name)
916310
def update_payload(self, fields=None):
        """"""
        payload = super(JobTemplate, self).update_payload(fields)
        effective_user = payload.pop(u'effective_user', None)
        if effective_user:
            payload[u'ssh'] = {u'effective_user': effective_user}
        return {u'job_template': payload}
739222
def _update(dashboard, profile):
    ''''''
    payload = {
        'dashboard': dashboard,
        'overwrite': True
    }
    request_url = "{0}/api/dashboards/db".format(profile.get('grafana_url'))
    response = requests.post(
        request_url,
        headers={
            "Authorization": "Bearer {0}".format(profile.get('grafana_token'))
        },
        json=payload
    )
    return response.json()
862860
function adjustPositionToBoilerplateOption(data, wrapBoilerplate) {
        if (!wrapBoilerplate) {
            return data;
        }

        data.errors.forEach(function (error) {
            error.line -= 4;
            error.character -= 12;
        });
        return data;
    }
1052272
def update_branding(self, branding_id, params):
        
        connection = Connection(self.token)

        connection.add_header('Content-Type', 'application/json')
        connection.set_url(self.production, self.BRANDINGS_ID_URL % branding_id)
        connection.add_params(params)

        return connection.patch_request()
1365073
def _update_limits_from_api(self):
        
        logger.debug('Setting CloudFormation limits from API')
        self.connect()
        resp = self.conn.describe_account_limits()
        for lim in resp['AccountLimits']:
            if lim['Name'] == 'StackLimit':
                self.limits['Stacks']._set_api_limit(lim['Value'])
                continue
            logger.debug('API response contained unknown CloudFormation '
                         'limit: %s', lim['Name'])
1296493
def update
      @banner = Banner.find(params[:id])
  
      respond_to do |format|
        if @banner.update(banner_params)
          format.html { redirect_to @banner, :notice => 'Banner was successfully updated.' }
          format.json { head :no_content }
        else
          format.html { render :action => "edit" }
          format.json { render :json => @banner.errors, :status => :unprocessable_entity }
        end
      end
    end
211840
def tweet(args = {})
      options = {
        num_hashtags: [0, rand(1..10) - 6].max,
        num_mentions: [0, rand(1..10) - 8].max,
        reply: (rand(1..10) == 1),
        body_length: rand(20..140)
      }.merge(args)

      my_reply = options[:reply] ? "#{mention} " : ''
      my_mentions = options[:num_mentions] > 0 ? "#{mentions(options[:num_mentions])} " : ''
      my_tags = tags(options[:num_hashtags])

      remaining = [
        options[:body_length],
        140 - (my_reply.size + my_mentions.size + my_tags.size)
      ].min

      "#{my_reply}#{body(remaining)}#{my_mentions}#{my_tags}"
    end