Register token of `token_address` with the token network.
        The limits apply for version 0.13.0 and above of raiden-contracts,
        since instantiation also takes the limits as constructor arguments.
976105
def add_token_with_limits(
            self,
            token_address: TokenAddress,
            channel_participant_deposit_limit: TokenAmount,
            token_network_deposit_limit: TokenAmount,
    ) -> Address:
        
        return self._add_token(
            token_address=token_address,
            additional_arguments={
                '_channel_participant_deposit_limit': channel_participant_deposit_limit,
                '_token_network_deposit_limit': token_network_deposit_limit,
            },
        )
201020
def generate_token(self, *args, **kwargs):
        
        # determine the length based on min_length and max_length
        length = random.randint(self.min_length, self.max_length)

        # generate the token using os.urandom and hexlify
        return binascii.hexlify(
            os.urandom(self.max_length)
        ).decode()[0:length]
391796
def rpc_get_account_tokens(self, address, **con_info):
        
        if not check_account_address(address):
            return {'error': 'Invalid address', 'http_status': 400}

        # must be b58
        if is_c32_address(address):
            address = c32ToB58(address)

        db = get_db_state(self.working_dir)
        token_list = db.get_account_tokens(address)
        db.close()
        return self.success_response({'token_types': token_list})
637648
def register(token, email, granted_to_email, access_count, expire)
      save_config(token, {email: email, granted_to_email: granted_to_email, access_count: access_count})
      @redis.expire(token, expire)

      token
    end
1096053
def mint_token_if_balance_low(
        token_contract: ContractProxy,
        target_address: str,
        min_balance: int,
        fund_amount: int,
        gas_limit: int,
        mint_msg: str,
        no_action_msg: str = None,
) -> Optional[TransactionHash]:
    
    balance = token_contract.contract.functions.balanceOf(target_address).call()
    if balance < min_balance:
        mint_amount = fund_amount - balance
        log.debug(mint_msg, address=target_address, amount=mint_amount)
        return token_contract.transact('mintFor', gas_limit, mint_amount, target_address)
    else:
        if no_action_msg:
            log.debug(no_action_msg, balance=balance)

    return None
315329
def register(value, name):
        
        if value in TokenKind._value_map:
            raise ValueError('TokenKind already registered: %d' % value)

        kind = TokenKind(value, name)
        TokenKind._value_map[value] = kind
        setattr(TokenKind, name, kind)
68999
private static boolean isTokenNtlm(final byte[] token) {
        if (token == null || token.length < NTLM_TOKEN_MAX_LENGTH) {
            return false;
        }
        return IntStream.range(0, NTLM_TOKEN_MAX_LENGTH).noneMatch(i -> NTLMSSP_SIGNATURE[i] != token[i]);
    }
1014715
def _new_token(self, chars=None, line_no=None):
        

        if not line_no:
            line_no = self._line_no

        if not chars:
            chars = self._token_chars

        if chars:
            # add new token
            self._tokens.append((line_no, ''.join(chars)))
            self._token_chars = []
98166
public void setMaxTokenLength(int maxTokenLength)
    {
        if(maxTokenLength < 1)
            throw new IllegalArgumentException("Max token length must be positive, not " + maxTokenLength);
        if(maxTokenLength <= minTokenLength)
            throw new IllegalArgumentException("Max token length must be larger than the min token length");
        this.maxTokenLength = maxTokenLength;
    }
572668
def register(origin, target, &block)
      raise(ArgumentError, 'block is required') unless block_given?

      @mutex.synchronize do
        @coercions[origin][target] = Coercion.new(origin, target, &block)
      end
    end
1047865
def _add_token(self, token, parent_node='root'):
        """"""
        if parent_node == 'root':
            parent_node = self.root

        token_node_id = 'token:{}'.format(self.token_count)
        self.add_node(token_node_id, layers={self.ns, self.ns+':token'},
                      attr_dict={self.ns+':token': token})
        self.add_edge(parent_node, token_node_id,
                      layers={self.ns},
                      edge_type=EdgeTypes.spanning_relation)
        self.tokens.append(token_node_id)
        self.token_count += 1
233583
protected function registerTokenRepository()
    {
        $this->app->singleton('auth.password.tokens', function($app)
        {
            $connection = $app['db']->connection();

            // The database token repository is an implementation of the token repository
            // interface, and is responsible for the actual storing of auth tokens and
            // their e-mail addresses. We will inject this table and hash key to it.
            $table = $app['config']['auth.password.table'];

            $key = $app['config']['app.key'];

            $expire = $app['config']->get('auth.password.expire', 60);

            return new DbRepository($connection, $table, $key, $expire);
        });
    }
89036
def add_token(self, token_identifier, delegation_token):
    
    self.send_add_token(token_identifier, delegation_token)
    return self.recv_add_token()
1210113
private function registerFunction(int $tokenID)
    {
        foreach ($this->declarations as $declarations) {
            foreach ($declarations as $location) {
                if ($tokenID >= $location[self::O_TOKEN] && $tokenID <= $location[self::C_TOKEN]) {
                    //We are inside class, function is method
                    return;
                }
            }
        }

        $localID = $tokenID + 1;
        while ($this->tokens[$localID][self::TOKEN_TYPE] != T_STRING) {
            //Fetching function name
            ++$localID;
        }

        $name = $this->tokens[$localID][self::TOKEN_CODE];
        if (!empty($namespace = $this->activeNamespace($tokenID))) {
            $name = $namespace . self::NS_SEPARATOR . $name;
        }

        $this->functions[$name] = [
            self::O_TOKEN => $tokenID,
            self::C_TOKEN => $this->endingToken($tokenID),
        ];
    }
265911
def register_token(self, token_class, regexp=None):
        
        if regexp is None:
            regexp = token_class.regexp

        self.tokens.register(token_class, regexp)
950781
def _createtoken(self, type_, value, flags=None):
        ''''''
        pos = None
        assert len(self._positions) >= 2, (type_, value)
        p2 = self._positions.pop()
        p1 = self._positions.pop()
        pos = [p1, p2]
        return token(type_, value, pos, flags)
224612
def register(action, max, period)
      @limits ||= {}
      @limits[action.to_sym] = { max: max, period: period }
    end