Create a VALID token and send it to all children.
342064
def add(self, fact):
        """"""
        token = Token.valid(fact)
        MATCHER.debug("<BusNode> added %r", token)
        for child in self.children:
            child.callback(token)
595001
@Override
  public MtasTokenCollection createTokenCollection(Reader reader)
      throws MtasParserException, MtasConfigException {
    tokenCollection = new MtasTokenCollection();
    MtasTokenIdFactory mtasTokenIdFactory = new MtasTokenIdFactory();
    List<Level> levels = new ArrayList<>();
//    Map<String,MtasToken> referencesNode = new HashMap<>();
//    Map<String,List<MtasToken>> referencesNullElement = new HashMap<>();
    try {
      MtasPennTreebankReader treebankReader = new MtasPennTreebankReader(
          reader);
      // variables main administration
      int event = treebankReader.getEventType();
      int position = 0;
      boolean ignore = false;
      Level level = null;
      // variables for code
      List<Integer> codePositions = new ArrayList<>();
      Integer codeOffsetStart = null;
      Integer codeOffsetEnd = null;
      // variables for string
      String stringValue = null;
      int stringOffsetStart;
      int stringOffsetEnd;
      // loop
      while (true) {
        switch (event) {
        case MtasPennTreebankReader.EVENT_STARTBRACKET:
          if (level != null && level.code) {
            throw new MtasParserException(
                "unexpected start bracket for " + NODE_CODE);
          } else {
            level = new Level();
            level.ignore = ignore;
            level.realOffsetStart = treebankReader.getPosition() + 1;
            levels.add(level);
          }
          break;
        case MtasPennTreebankReader.EVENT_ENDBRACKET:
          Objects.requireNonNull(level, "no level while ending bracket");
          level.realOffsetEnd = treebankReader.getPosition() - 1;
          Level parentLevel = levels.size() > 1 ? levels.get(levels.size() - 2)
              : null;
          createNodeMappings(mtasTokenIdFactory, level, parentLevel);
          // remove level
          if (parentLevel != null) {
            if (level.positionStart != null && level.positionEnd != null) {
              parentLevel.addPositionRange(level.positionStart,
                  level.positionEnd);
            }
            parentLevel.offsetStart = parentLevel.offsetStart == null
                ? level.offsetStart : parentLevel.offsetStart;
            parentLevel.offsetEnd = level.offsetEnd == null
                ? parentLevel.offsetEnd : level.offsetEnd;
            levels.remove(levels.size() - 1);
            level = parentLevel;
            ignore = level.ignore;
          } else {
            levels.clear();
            level = null;
            ignore = false;
//            referencesNode.clear();
//            referencesNullElement.clear();
          }
          break;
        case MtasPennTreebankReader.EVENT_NODE:
          Objects.requireNonNull(level, "no level while handling node");
          // register node with level
          level.node = treebankReader.getString();
          if (ignoreNodes.contains(level.node)) {
            ignore = true;
            level.ignore = true;
          }
          if (level.node.equals(NODE_CODE)) {
            level.code = true;
            if (!treebankReader.next() || (event = treebankReader
                .getEventType()) != MtasPennTreebankReader.EVENT_STRING) {
              throw new MtasParserException("expected string for " + NODE_CODE);
            } else if (!level.ignore) {
              stringValue = treebankReader.getString();
              stringOffsetStart = treebankReader.getPosition();
              stringOffsetEnd = stringOffsetStart + stringValue.length();              
              if (!codePositions.isEmpty()) {
                createCodeMappings(mtasTokenIdFactory, level, stringValue,
                    codeOffsetStart, codeOffsetEnd, stringOffsetStart,
                    stringOffsetEnd, codePositions);
              } else {
                log.error("CODE without codePositions for "+stringValue);                
              }
              codePositions.clear();
              codeOffsetStart = null;
              codeOffsetEnd = null;
            }
          }
          break;
        case MtasPennTreebankReader.EVENT_STRING:
          Objects.requireNonNull(level, "no level while handling string");
          if (level.code) {
            throw new MtasParserException("unexpected string for " + NODE_CODE);
          } else if (!level.ignore) {
            stringValue = treebankReader.getString();
            stringOffsetStart = treebankReader.getPosition();
            stringOffsetEnd = stringOffsetStart + stringValue.length();
            if(level.offsetStart == null) {
              level.offsetStart = stringOffsetStart;
            }
            level.offsetEnd = stringOffsetEnd;
            if (stringValue.startsWith(NODE_CODE_PREFIX)) {
              codePositions.add(position);
              stringValue = stringValue.substring(NODE_CODE_PREFIX.length(),
                  stringValue.length());
              if(codeOffsetStart == null) {
                codeOffsetStart = stringOffsetStart;
              }
              codeOffsetEnd = stringOffsetEnd;
            }
            // register position
            level.addPosition(position);
            // create mappings
            createStringMappings(mtasTokenIdFactory, level, stringValue,
                stringOffsetStart, stringOffsetEnd, position);
            // increase position
            position++;
          }
          break;
        default:
          break;
        }
        if (!treebankReader.next()) {
          break;
        } else {
          event = treebankReader.getEventType();
        }
      }
    } catch (IOException e) {
      log.debug(e);
      throw new MtasParserException(
          "No valid Penn Treebank syntax: " + e.getMessage());
    }
    // final check
    tokenCollection.check(autorepair, makeunique);
    return tokenCollection;

  }
1148673
def _create_token(token_type, value, lineno, lexpos):
    
    token = lex.LexToken()
    token.type = token_type
    token.value = value
    token.lineno = lineno
    token.lexpos = lexpos
    return token
32691
def add_child(self, node, callback):
        """"""
        if node not in self.children:
            self.children.append(ChildNode(node, callback))
149714
def save_token(self):
        
        if self.token is None:
            raise ValueError('You have to set the "token" first.')

        try:
            if not self.token_path.parent.exists():
                self.token_path.parent.mkdir(parents=True)
        except Exception as e:
            log.error('Token could not be saved: {}'.format(str(e)))
            return False

        with self.token_path.open('w') as token_file:
            # 'indent = True' will make the file human readable
            self.serializer.dump(self.token, token_file, indent=True)

        return True
1079589
public function setupRules()
    {
        parent::setupRules();
        $this->rules->add('symbol', new Rule(new SubStringMatcher('`'), [
            'factory' => new TokenFactory(ContextualToken::class)
        ]));
    }
1185828
def join(tokens, start, result):
    """"""
    texts = []
    if len(result) > 0:
        for e in result:
            for child in e.iter():
                if child.text is not None:
                    texts.append(child.text)
        return [E(result[0].tag, ' '.join(texts))]
488024
function sendTextMessage(recipientId, textToSend, token) {
      textMessageData = {
        text:textToSend
      }
      request({
        url: FB_MSG_URL,
        qs: {access_token:token},
        method: 'POST',
        json: {
          recipient: {id:recipientId},
          message: textMessageData,
        }
      }, function(error, response, body) {
        if (error) {
          node.log('Error sending text message: ', error);
        } else if (response.body.error) {
          node.log('Error: ', response.body.error);
        }
      });
    }
1139619
def tokens_create(name, user, scopes, internal):
    """"""
    token = Token.create_personal(
        name, user.id, scopes=scopes, is_internal=internal)
    db.session.commit()
    click.secho(token.access_token, fg='blue')
1336933
function createToken(options) {
    const newToken = chevrotain.createToken(options)
    allTokens.push(newToken)
    return newToken
}
991549
def sendall(self, *args, **kwargs):
        """"""
        return self._safe_call(
            False,
            super(SSLFileobjectMixin, self).sendall,
            *args, **kwargs
        )
235393
function addValidChildren(validChildren) {
                var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
                // Invalidate the schema cache if the schema is mutated
                mapCache[settings.schema] = null;
                validChildren && each(split(validChildren, ','), function(rule) {
                    var parent, prefix, matches = childRuleRegExp.exec(rule);
                    if (matches) {
                        prefix = matches[1];
                        // Add/remove items from default
                        parent = prefix ? children[matches[2]] : children[matches[2]] = {
                            '#comment': {}
                        };
                        parent = children[matches[2]];
                        each(split(matches[3], '|'), function(child) {
                            '-' === prefix ? delete parent[child] : parent[child] = {};
                        });
                    }
                });
            }
648258
def create_token(self, request, refresh_token=False):
        """"""

        if callable(self.expires_in):
            expires_in = self.expires_in(request)
        else:
            expires_in = self.expires_in

        request.expires_in = expires_in

        return self.request_validator.get_jwt_bearer_token(None, None, request)
743945
def oauth_token_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/oauth/tokens.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
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);

  }
858217
def post(self, request):
        """"""
        serializer = AuthTokenSerializer(data=request.data)

        if serializer.is_valid():
            token, _ = ExpiringToken.objects.get_or_create(
                user=serializer.validated_data['user']
            )

            if token.expired():
                # If the token is expired, generate a new one.
                token.delete()
                token = ExpiringToken.objects.create(
                    user=serializer.validated_data['user']
                )

            data = {'token': token.key}
            return Response(data)

        return Response(serializer.errors, status=HTTP_400_BAD_REQUEST)
868585
function (nodes, children) {
	transcluder.find(nodes);

	for (var i = 0; i < children.length; ++i) {
		transcluder.add_node(children[i]);
	}

	transcluder.transclude();
}