Set the tax and benefit system and eventually the baseline tax and benefit system
166296
def set_tax_benefit_systems(self, tax_benefit_system = None, baseline_tax_benefit_system = None):
        
        assert tax_benefit_system is not None
        self.tax_benefit_system = tax_benefit_system
        if self.cache_blacklist is not None:
            self.tax_benefit_system.cache_blacklist = self.cache_blacklist
        if baseline_tax_benefit_system is not None:
            self.baseline_tax_benefit_system = baseline_tax_benefit_system
            if self.cache_blacklist is not None:
                self.baseline_tax_benefit_system.cache_blacklist = self.cache_blacklist
398562
protected function setup()
    {
        // Check if a valid access token exists.
        if (!$this->accessToken || $this->accessToken->expired()) {
            // Refresh is successful unless explicitly set to false.
            $refreshSuccess = true;

            // Check if a valid refresh token exists.
            if ($this->refreshToken && $this->refreshToken->getToken()) {
                // Attempt to use the refresh token.
                try {
                    $this->refresh();
                } catch (RequestException $e) {
                    // Check if the exception is due to an HTTP 403.
                    if ($e->getCode() == 403) {
                        $response = $e->getResponse();
                        $json = json_decode($response->getBody());
                        $body = $json->{'nl.divide.iq'};

                        // Check if the error is indeed a "TokenExpired" error,
                        // as expected.
                        if ($body->answer == 'TokenExpired') {
                            // Token is expired; refreshing unsuccessful.
                            $refreshSuccess = false;
                        } else {
                            // Unexpected error. Pass it up the stack. This
                            // might be a "TokenEmpty" error, but that would
                            // still be unexpected, because the token value was
                            // checked beforehand.
                            throw $e;
                        }
                    } else {
                        // Unexpected error. Pass it up the stack.
                        throw $e;
                    }
                }
            } else {
                // There is no refresh token to use; refreshing unsuccessful.
                $refreshSuccess = false;
            }

            // If refreshing failed, login from scratch and then authenticate.
            if (!$refreshSuccess) {
                $this->login()->authenticate();
            }
        }

        // Request the settings if needed.
        if (!$this->settings) {
            $response = $this->client->get('settings', [
                'headers' => ['Authentication' => $this->accessToken->getToken()],
            ]);

            $json = json_decode($response->getBody());
            $body = $json->{'nl.divide.iq'};
            $services = [];
            foreach ($body->services as $service) {
                $services[] = $service->code;
            }

            // Create new settings object.
            $this->settings = new Settings($services, $body->settings_updated);
        }
    }
733144
def from_taxtable(cls, taxtable_fp):
        
        r = csv.reader(taxtable_fp)
        headers = next(r)
        rows = (collections.OrderedDict(list(zip(headers, i))) for i in r)

        row = next(rows)
        root = cls(rank=row['rank'], tax_id=row[
                   'tax_id'], name=row['tax_name'])
        path_root = headers.index('root')
        root.ranks = headers[path_root:]
        for row in rows:
            rank, tax_id, name = [
                row[i] for i in ('rank', 'tax_id', 'tax_name')]
            path = [_f for _f in list(row.values())[path_root:] if _f]
            parent = root.path(path[:-1])
            parent.add_child(cls(rank, tax_id, name=name))

        return root
956987
public function setTaxRate( $taxrate )
	{
		if ( $taxrate == $this->getTaxRate() ) { return; }

		$this->_checkPrice( $taxrate );

		$this->_values['taxrate'] = $this->_formatNumber( $taxrate );
		$this->setModified();
	}
1296504
function setup(settings) {
    if (!settings) {
        return _.cloneDeep(SETTINGS);
    }
    _.merge(SETTINGS, settings);
    return _.cloneDeep(SETTINGS);
}
1304105
def set_tier(self, tier):
        ''
        self.tier = tier
        if tier > self.ending_tier:
            self.ending_tier = tier
1195721
def _set(self, data, version):
        """"""

        self.zk.set(self.path, json.dumps(data), version)
379517
public function setUp()
    {
        if ($this->filesystem->exists($this->outputDir) === false) {
            return;
        }

        $finder = new Finder();
        $finder->in($this->outputDir)
            ->depth('== 0');

        $this->filesystem->remove($finder);
    }
1350647
def start(self):
        """"""
        self.clear()
        self.setDefaultPolicy()
        self.acceptIcmp()
        self.acceptInput('lo')
284080
public void setBaselineDate(int baselineNumber, Date value)
   {
      set(selectField(ProjectFieldLists.BASELINE_DATES, baselineNumber), value);
   }
124077
def updateIncomeProcess(self):
        '''
        
        '''
        if self.cycles == 0:
            tax_rate = (self.IncUnemp*self.UnempPrb)/((1.0-self.UnempPrb)*self.IndL)
            TranShkDstn     = deepcopy(approxMeanOneLognormal(self.TranShkCount,sigma=self.TranShkStd[0],tail_N=0))
            TranShkDstn[0]  = np.insert(TranShkDstn[0]*(1.0-self.UnempPrb),0,self.UnempPrb)
            TranShkDstn[1]  = np.insert(TranShkDstn[1]*(1.0-tax_rate)*self.IndL,0,self.IncUnemp)
            PermShkDstn     = approxMeanOneLognormal(self.PermShkCount,sigma=self.PermShkStd[0],tail_N=0)
            self.IncomeDstn = [combineIndepDstns(PermShkDstn,TranShkDstn)]
            self.TranShkDstn = TranShkDstn
            self.PermShkDstn = PermShkDstn
            self.addToTimeVary('IncomeDstn')
        else: # Do the usual method if this is the lifecycle model
            EstimationAgentClass.updateIncomeProcess(self)
922141
private function setDefaultManipulationInformation() {
		$this->add_base_dn = $this->basedn_array[0];
		$this->add_dn = $this->dn;
		$this->add_pw = $this->password;

		$this->modify_method = "self";
		$this->modify_base_dn = $this->add_base_dn;
		$this->modify_dn = $this->add_dn;
		$this->modify_pw = $this->add_pw;
	}
140809
private function setUserRoles()
    {
        $this->initRoleHierarchy();
        $this->user->setRoles($this->roleHierarchy->getAccessibleRoles($this->user->getRoles()));
    }
716110
public void setBaselineFixedCost(int baselineNumber, Number value)
   {
      set(selectField(TaskFieldLists.BASELINE_FIXED_COSTS, baselineNumber), value);
   }
452762
protected function _initTotals()
    {
        parent::_initTotals();

        $store = $this->getOrder()->getStore()->getId();
        $taxConfig = Mage::getModel('adyen_fee/tax_config');

        if ($taxConfig->displaySalesPaymentFeeBoth($store)) {
            $this->addPaymentFeeWithTax(true);
            $this->addPaymentFeeWithoutTax(true);
        } elseif ($taxConfig->displaySalesPaymentFeeInclTax($store)) {
            $this->addPaymentFeeWithTax();
        } else {
            $this->addPaymentFeeWithoutTax();
        }

        if ($this->getSource()->getPaymentPercentageFee() != 0) {
            $this->addTotal(
                new Varien_Object(
                    array(
                        'code' => 'payment_percentage_fee',
                        'strong' => false,
                        'value' => $this->getSource()->getPaymentPercentageFee(),
                        'base_value' => $this->getSource()->getBasePaymentPercentageFee(),
                        'label' => $this->helper('adyen')->__('Payment Percentage Fee'),
                        'area' => '',
                    )
                ),
                'subtotal'
            );
        }

        if ($this->getSource()->getPaymentInstallmentFeeAmount() != 0) {
            $this->addTotal(
                new Varien_Object(
                    array(
                        'code' => 'payment_installment_fee',
                        'strong' => false,
                        'value' => $this->getSource()->getPaymentInstallmentFeeAmount(),
                        'base_value' => $this->getSource()->getBasePaymentInstallmentFeeAmount(),
                        'label' => $this->helper('adyen')->__('Payment Fee Installments'),
                        'area' => '',
                    )
                ),
                'subtotal'
            );
        }

        return $this;
    }
391058
protected function wizardAddCurrency()
    {
        // Required
        $this->validatePrompt('code', $this->text('Code'), 'currency');
        $this->validatePrompt('name', $this->text('Name'), 'currency');
        $this->validatePrompt('symbol', $this->text('Symbol'), 'currency');
        $this->validatePrompt('major_unit', $this->text('Major unit'), 'currency');
        $this->validatePrompt('minor_unit', $this->text('Minor unit'), 'currency');
        $this->validatePrompt('numeric_code', $this->text('Numeric code'), 'currency');

        // Optional
        $this->validatePrompt('status', $this->text('Status'), 'currency', 0);
        $this->validatePrompt('default', $this->text('Default'), 'currency', 0);
        $this->validatePrompt('decimals', $this->text('Decimals'), 'currency', 2);
        $this->validatePrompt('rounding_step', $this->text('Rounding step'), 'currency', 0);
        $this->validatePrompt('conversion_rate', $this->text('Conversion rate'), 'currency', 1);
        $this->validatePrompt('decimal_separator', $this->text('Decimal separator'), 'currency', '.');
        $this->validatePrompt('thousands_separator', $this->text('Thousands separator'), 'currency', ',');
        $this->validatePrompt('template', $this->text('Template'), 'currency', '%symbol%price');

        $this->validateComponent('currency');
        $this->addCurrency();
    }
764401
def add_taxes(self, taxes):
        
        # fixme: how to resolve duplicate tax names
        _idx = len(self.taxes)  # current index to prevent overwriting
        for idx, tax in enumerate(taxes):
            tax_key = "tax_" + str(idx + _idx)
            self.taxes[tax_key] = {"name": tax[0], "amount": tax[1]}