When we receive this, we have 'token):data'
962213
def get_token_and_data(self, data):
        '''
        
        '''
        token = ''
        for c in data:
            if c != ')':
                token = token + c
            else:
                break;

        return token, data.lstrip(token + '):')
492448
protected void tokenValueIsFinished()
    {
        _scanner.tokenIsFinished();
        if (IonType.BLOB.equals(_value_type) || IonType.CLOB.equals(_value_type))
        {
            int state_after_scalar = get_state_after_value();
            set_state(state_after_scalar);
        }
    }
1322830
function ondata(chunk) {
    packet.push(chunk);
    if (packet.isReady()) {
      if (self._state.sessionId !== packet.header.sessionId) {
        self._state.sessionId = packet.header.sessionId;
        self._state.packetCount = -1;
      }
      var buffer = packet.getData();
      packet.clear();
      var cb = self._state.receive;
      self._state.receive = undefined;
      self._state.messageType = undefined;
      self.receive(buffer, cb);
    }
  }
136730
function()
			{
				var func = todo.shift();
				if (!func)
				{
					// all done!
					if (callback) callback(false);
					return;
				}

				if (token_fetch.indexOf(func.func) >= 0)
				{
					// if we're actually calling a token fetch function, skip!
					process.nextTick(step);
				}
				else
				{
					func.func(function(error) {
						if (error)
						{
							// token fetching error!
							if (callback) callback(func.name + " :: " + error);
							return;
						}

						// do next step
						process.nextTick(step);
					});
				}
			}
547799
def get_token(self):
        
        self.token = self._session.fetch_token(
            token_url=CLOUD_URLS["get_token"][1],
            client_id=self._client_id,
            client_secret=self._client_secret
        )
537280
def token(self):
        " "

        if hasattr(self, '_token'):
            return getattr(self, '_token')

        # Json formatted auth.
        data = json.dumps({'customer_name': self.customer,
                           'user_name': self.username,
                           'password': self.password})

        # Start session.
        response = requests.post(
            'https://api2.dynect.net/REST/Session/', data=data,
            headers={'Content-Type': 'application/json'})

        # convert to data.
        content = json.loads(response.content)

        if response.status_code != 200:
            # Check for errors.
            if self.check_error(content, 'failure', 'INVALID_DATA'):
                raise self.CredentialsError(
                    self.response_message(content, 'ERROR'))

            raise self.Failure(self.response_message(content, 'ERROR'),
                               'Unhandled failure')

        # Extract token from content
        if 'data' in content and 'token' in content['data']:
            token = content['data']['token']
        else:
            raise self.AuthenticationError(response)

        setattr(self, '_token', token)
        return token
421222
async function () {
    const oThis = this;

    // Validate new branded token
    logger.step("** Validating branded token");
    await oThis._validateBrandedTokenDetails();

    // Generate reserve address
    logger.step("** Generating reserve address");
    var addressRes = await oThis._generateAddress();
    oThis.reserveAddress = addressRes.data.address;
    logger.info("* address:", oThis.reserveAddress);

    // Start the BT proposal
    var proposeRes = await oThis._propose();

    // Monitor the BT proposal response
    var statusRes = await oThis._checkProposeStatus(proposeRes.data.transaction_hash);
    var registrationStatus = statusRes.data.registration_status;
    oThis.uuid = registrationStatus['uuid'];
    oThis.erc20 = registrationStatus['erc20_address'];

    // Add branded token to config file
    logger.step("** Updating branded token config file");
    await oThis._updateBrandedTokenConfig();

    // Allocating shard for storage of token balances
    logger.step("** Allocating shard for storage of token balances");
    await oThis._allocateShard();

    process.exit(0);

  }
444406
public String retrieveData(String token) {
        try {
            RetrievedContent data = this.s3StorageProvider.getContent(this.hiddenSpaceName, token);
            return IOUtil.readStringFromStream(data.getContentStream());
        } catch (NotFoundException ex) {
            return null;
        } catch (Exception ex) {
            throw new DuraCloudRuntimeException(ex);
        }
    }
405088
def create_data_request_token(data_request_id, opts = {})
      data, _status_code, _headers = create_data_request_token_with_http_info(data_request_id, opts)
      data
    end
536160
def token(self, token):
        
        self._token = token
        if token:
            self.current_user = self.query_login_user()
882946
async function() {
    const oThis = this
      , existingBrandedTokens = await oThis._loadBrandedTokenConfig()
    ;

    if (existingBrandedTokens[oThis.uuid]) {
      logger.error("* Branded token uuid already registered and present in BT config file");
      process.exit(1);
    }

    existingBrandedTokens[oThis.uuid] = {
      Name: oThis.btName,
      Symbol: oThis.btSymbol,
      ConversionFactor: oThis.btConversionFactor,
      Reserve: oThis.reserveAddress,
      ReservePassphrase: oThis.reservePassphrase,
      UUID: oThis.uuid,
      ERC20: oThis.erc20
    };

    logger.info("* Branded token config:", existingBrandedTokens[oThis.uuid]);

    return tokenHelper.addBrandedToken(existingBrandedTokens);
  }
286603
def on_message(self, data):
        
        # Trying to parse response
        data = json.loads(data)
        if not data["name"] is None:
            logging.debug("%s: receiving message %s" % (data["name"], data["data"]))
            fct = getattr(self, "on_" + data["name"])
            try:
                res = fct(Struct(data["data"]))
            except:
                # We try without Struct item (on transaction request this can happend)
                res = fct(data["data"])
            if res is not None:
                self.write_message(res)
        else:
            logging.error("SockJSDefaultHandler: data.name was null")
1033902
def get_token_data(self):
        

        token_data = self._keystone_auth.conn.auth_ref
        token = token_data['auth_token']
        self.set_token(token)

        if self.cache.is_redis_ok():
            try:
                self.cache.set_cache_token(token_data)
            except CacheException:
                self.logger.error('Token not setted in cache.')

        token_data = {
            'expires_at': token_data['expires_at'],
            'token': token
        }

        return token_data
664491
function readNotifyNewTables(message, tokens) {
	message.userName = protocol.decodeString(tokens[1]);
	message.sessionId = protocol.decodeString(tokens[3]);
	readTableInfos(message, tokens.slice(4));
}
204149
def get_token_info(self):
        
        response = requests.get(
            self._format_url(OAUTH2_ROOT + 'token_info', {
                'token': self.creds['access_token']
            }))
        data = response.json()
        if response.status_code != 200:
            raise _token_error_from_data(data)
        else:
            return data
351229
function _loadUserFromToken(){
    return BB
        .bind(this)
        .then(function() {
            return grasshopper.request(this.token).users.current();
        })
        .then(function(user){
            this.user = user;
        });
}
1340831
def received(self):
        
        if not hasattr(self, '_data'):
            # NB: units are reversed so that lowest numbered unit takes precedence
            self._data = JSONUnitDataView({key: value
                                           for unit in reversed(self)
                                           for key, value in unit.received_raw.items()})

        return self._data