Sync payment profile on Authorize.NET if sync kwarg is not False
484018
def save(self, *args, **kwargs):
        """"""
        if kwargs.pop('sync', True):
            self.push_to_server()
        self.card_code = None
        self.card_number = "XXXX%s" % self.card_number[-4:]
        super(CustomerPaymentProfile, self).save(*args, **kwargs)
543928
def sync_client(self):
        """"""
        if not self._sync_client:
            self._sync_client = AlfSyncClient(
                token_endpoint=self.config.get('OAUTH_TOKEN_ENDPOINT'),
                client_id=self.config.get('OAUTH_CLIENT_ID'),
                client_secret=self.config.get('OAUTH_CLIENT_SECRET')
            )
        return self._sync_client
265663
def run(self):
        
        self.kwargs['cached'] = self.cached
        self.kwargs['sync'] = self.sync
        self.kwargs['broker'] = self.broker
        self.id = async_iter(self.func, self.args, **self.kwargs)
        self.started = True
        return self.id
607871
def createRecurringPaymentsProfile(self, params, direct=False):
        
        defaults = {"method": "CreateRecurringPaymentsProfile"}
        required = ["profilestartdate", "billingperiod", "billingfrequency", "amt"]

        # Direct payments require CC data
        if direct:
            required + ["creditcardtype", "acct", "expdate", "firstname", "lastname"]
        else:
            required + ["token", "payerid"]

        nvp_obj = self._fetch(params, required, defaults)

        # Flag if profile_type != ActiveProfile
        if nvp_obj.flag:
            raise PayPalFailure(nvp_obj.flag_info, nvp=nvp_obj)
        return nvp_obj
832128
def __auth_call(self, load):
        '''
        
        '''
        if 'eauth' not in load:
            return False
        fstr = '{0}.auth'.format(load['eauth'])
        if fstr not in self.auth:
            return False
        # When making auth calls, only username, password, auth, and token
        # are valid, so we strip anything else out.
        _valid = ['username', 'password', 'eauth', 'token']
        _load = {key: value for (key, value) in load.items() if key in _valid}

        fcall = salt.utils.args.format_call(
            self.auth[fstr],
            _load,
            expected_extra_kws=AUTH_INTERNAL_KEYWORDS)
        try:
            if 'kwargs' in fcall:
                return self.auth[fstr](*fcall['args'], **fcall['kwargs'])
            else:
                return self.auth[fstr](*fcall['args'])
        except Exception as e:
            log.debug('Authentication module threw %s', e)
            return False
362510
def sync_badges(**kwargs):
    
    update = kwargs.get('update', False)
    created_badges = []
    instances = registry.get_recipe_instances()

    for instance in instances:
        reset_queries()
        badge, created = instance.create_badge(update=update)
        if created:
            created_badges.append(badge)
        log_queries(instance)

    return created_badges
1264593
def sync(
    ctx,
    state,
    bare=False,
    user=False,
    unused=False,
    **kwargs
):
    """"""
    from ..core import do_sync

    retcode = do_sync(
        ctx=ctx,
        dev=state.installstate.dev,
        three=state.three,
        python=state.python,
        bare=bare,
        dont_upgrade=(not state.installstate.keep_outdated),
        user=user,
        clear=state.clear,
        unused=unused,
        sequential=state.installstate.sequential,
        pypi_mirror=state.pypi_mirror,
    )
    if retcode:
        ctx.abort()
458719
async function authorize (action, target) {
    let result = await check(this.auth.credentials && this.auth.credentials.user, action, target)
    if (result !== true) throw Boom.unauthorized(action)
    return true
  }
972095
def authorize(*args, **kwargs):
    """"""
    if request.method == 'GET':
        client = Client.query.filter_by(
            client_id=kwargs.get('client_id')
        ).first()

        if not client:
            abort(404)

        scopes = current_oauth2server.scopes
        ctx = dict(
            client=client,
            oauth_request=kwargs.get('request'),
            scopes=[scopes[x] for x in kwargs.get('scopes', [])],
        )
        return render_template('invenio_oauth2server/authorize.html', **ctx)

    confirm = request.form.get('confirm', 'no')
    return confirm == 'yes'
1023589
def sync(self, data):
        """"""
        for k, v in data.get('billing', {}).items():
            setattr(self, k, v)
        self.card_number = data.get('credit_card', {}).get('card_number',
                                                           self.card_number)
        self.save(sync=False)
90879
def sync=(sync)
      validator = EnumAttributeValidator.new('String', ["true", "false"])
      unless validator.valid?(sync)
        fail ArgumentError, "invalid value for 'sync', must be one of #{validator.allowable_values}."
      end
      @sync = sync
    end
862038
def sync_entitlements(owner, repo, source, show_tokens):
    """"""
    client = get_entitlements_api()

    with catch_raise_api_exception():
        data, _, headers = client.entitlements_sync_with_http_info(
            owner=owner, repo=repo, data={"source": source}, show_tokens=show_tokens
        )

    ratelimits.maybe_rate_limit(client, headers)
    page_info = PageInfo.from_headers(headers)
    entitlements = [ent.to_dict() for ent in data.tokens]
    return entitlements, page_info
1220435
async def azureAccounts(self, *args, **kwargs):
        

        return await self._makeApiCall(self.funcinfo["azureAccounts"], *args, **kwargs)
1046502
def mk_token(self, load):
        '''
        
        '''
        if not self.authenticate_eauth(load):
            return {}

        if self._allow_custom_expire(load):
            token_expire = load.pop('token_expire', self.opts['token_expire'])
        else:
            _ = load.pop('token_expire', None)
            token_expire = self.opts['token_expire']

        tdata = {'start': time.time(),
                 'expire': time.time() + token_expire,
                 'name': self.load_name(load),
                 'eauth': load['eauth']}

        if self.opts['keep_acl_in_token']:
            acl_ret = self.__get_acl(load)
            tdata['auth_list'] = acl_ret

        groups = self.get_groups(load)
        if groups:
            tdata['groups'] = groups

        return self.tokens["{0}.mk_token".format(self.opts['eauth_tokens'])](self.opts, tdata)
1249402
def auto_sync(instance):
    """"""
    # this allows us to turn off sync temporarily - e.g. when doing bulk updates
    if not get_setting("auto_sync"):
        return False
    model_name = "{}.{}".format(instance._meta.app_label, instance._meta.model_name)
    if model_name in get_setting("never_auto_sync", []):
        return False
    return True
809664
function(provider, options) {
      var authType;
      if (_.isString(provider)) {
        authType = provider;
        provider = Parse.User._authProviders[provider];
      } else {
        authType = provider.getAuthType();
      }
      var newOptions = _.clone(options);
      var self = this;
      newOptions.authData = null;
      newOptions.success = function(model) {
        self._synchronizeAuthData(provider);
        if (options.success) {
          options.success.apply(this, arguments);
        }
      };
      return this._linkWith(provider, newOptions);
    }
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)