Process a script-type node

    This handles nodes that follow the *Common script schema*,
    as outlined in doc/yaml-reference.md.
322724
def _process_script_node(node, name):
    '''
    '''
    if isinstance(node, basestring):
        # The script is just the text itself
        return [node]


    if isinstance(node, dict):
        # There must be a "script" key, which must be a list of strings
        script = node.get('script')
        if not script:
            raise ConfigError("{}: must have a 'script' subkey".format(name))

        if isinstance(script, list):
            return script

        if isinstance(script, basestring):
            return [script]

        raise ConfigError("{}.script: must be a string or list".format(name))

    raise ConfigError("{}: must be string or dict".format(name))
1137114
def handle_node(pos, node):
    ''
    props = node.properties
    black_stones_added = [coords.from_sgf(
        c) for c in props.get('AB', [])]
    white_stones_added = [coords.from_sgf(
        c) for c in props.get('AW', [])]
    if black_stones_added or white_stones_added:
        return add_stones(pos, black_stones_added, white_stones_added)
    # If B/W props are not present, then there is no move. But if it is present and equal to the empty string, then the move was a pass.
    elif 'B' in props:
        black_move = coords.from_sgf(props.get('B', [''])[0])
        return pos.play_move(black_move, color=go.BLACK)
    elif 'W' in props:
        white_move = coords.from_sgf(props.get('W', [''])[0])
        return pos.play_move(white_move, color=go.WHITE)
    else:
        return pos
884581
private void processNode(Node node) throws IOException {
		for (Node cursor = node.getFirstChild(); cursor != null; cursor = cursor.getNext()) {
			int lineno = cursor.getLineno()-1;	// adjust for rhino line numbers being 1 based
			int charno = cursor.getCharno();
			if (lineno > currentLine || lineno == currentLine && charno > currentChar) {
				currentLine = lineno;
				currentChar = charno;
			}
			FilePosition endPosition = getEndPosition(cursor);
			sgen.addMapping(name, null,
					new FilePosition(currentLine, currentChar),
					new FilePosition(currentLine, currentChar),
					endPosition);
			if (cursor.hasChildren()) {
				processNode(cursor);
			}
		}
	}
45906
def parse_component(self, node):
        

        if 'id' in node.lattrib:
            id_ = node.lattrib['id']
        else:
            #self.raise_error('Component must have an id')
            id_ = make_id()

        if 'type' in node.lattrib:
            type_ = node.lattrib['type']
        else:
                self.raise_error("Component {0} must have a type.",
                                 id_)

        component = Component(id_, type_)

        if self.current_component:
            component.set_parent_id(self.current_component.id)
            self.current_component.add_child(component)
        else:
            self.model.add_component(component)
                
        for key in node.attrib:
            if key.lower() not in ['id', 'type']:
                component.set_parameter(key, node.attrib[key])

        old_component = self.current_component
        self.current_component = component
        self.process_nested_tags(node)
        self.current_component = old_component
1360416
private void handleDocument(EntityDocument document) {
		if (document instanceof ItemDocument) {
			this.entityDocumentProcessor
					.processItemDocument((ItemDocument) document);
		} else if (document instanceof PropertyDocument) {
			this.entityDocumentProcessor
					.processPropertyDocument((PropertyDocument) document);
		} else if(document instanceof LexemeDocument) {
			this.entityDocumentProcessor
					.processLexemeDocument((LexemeDocument) document);
		}
	}
1242244
def schema_val(self, messages=None):
        ""
        self._ymlproc = YAMLProcessor(self._ymlfile)
        self._schemaproc = SchemaProcessor(self._schemafile)
        valid = True

        log.debug("BEGIN: Schema-based validation for YAML '%s' with schema '%s'", self._ymlfile, self._schemafile)

        # Make sure the yml and schema have been loaded
        if self._ymlproc.loaded and self._schemaproc.loaded:
            # Load all of the yaml documents. Could be more than one in the same YAML file.
            for docnum, data in enumerate(yaml.load_all(self._ymlproc.data)):

                # Since YAML allows integer keys but JSON does not, we need to first
                # dump the data as a JSON string to encode all of the potential integers
                # as strings, and then read it back out into the YAML format. Kind of
                # a clunky workaround but it works as expected.
                data = yaml.load(json.dumps(data))

                # Now we want to get a validator ready
                v = jsonschema.Draft4Validator(self._schemaproc.data)

                # Loop through the errors (if any) and set valid = False if any are found
                # Display the error message
                for error in sorted(v.iter_errors(data)):
                    msg = "Schema-based validation failed for YAML file '" + self._ymlfile + "'"
                    self.ehandler.process(docnum, self._ymlproc.doclines, error, messages)
                    valid = False

                if not valid:
                    log.error(msg)

        elif not self._ymlproc.loaded:
            raise util.YAMLError("YAML must be loaded in order to validate.")
        elif not self._schemaproc.loaded:
            raise jsonschema.SchemaError("Schema must be loaded in order to validate.")

        log.debug("END: Schema-based validation complete for '%s'", self._ymlfile)
        return valid
1336190
function processNode(node) {
            if (!node.code.trim()) {
                // empty
                return
            }
            const innerTokens = microTemplateService.getMicroTemplateTokensInfo(
                node
            ).innerTokens
            if (!innerTokens.length) {
                context.report({
                    node,
                    messageId: "missingStatement",
                })
                return
            }
            const statement = microTemplateService.getMicroTemplateExpressionStatement(
                node,
                sourceCode
            )
            if (statement) {
                return
            }
            context.report({
                node,
                messageId: "unexpected",
            })
        }
200581
def process(self, content):
        
        log.debug('processing:\n%s', content)
        self.reset()
        if content.tag is None:
            content.tag = content.value.__class__.__name__
        document = Document()
        if isinstance(content.value, Property):
            root = self.node(content)  # root is never used?
            self.append(document, content)
        else:
            self.append(document, content)
        return document.root()
768634
def run(self):
        '''
        
        '''
        # Loading yaml
        self.load_yaml()

        # Print paths from schema
        section_title = '**API Paths**'
        self.write(section_title)
        self.write('=' * len(section_title))
        self.print_paths()

        # Print models
        section_title = '**Schemas Description**'
        self.write(section_title)
        self.write('=' * len(section_title))
        self.print_schemas()

        # Render by sphinx
        node = nodes.section()
        node.document = self.state.document
        nested_parse_with_titles(self.state, self.__view_list, node)
        return node.children
1191775
private void process(Node node, List<String> sentence, List<Span> names) {
    if (node != null) {
      for (TreeElement element : node.getElements()) {
        if (element.isLeaf()) {
          processLeaf((Leaf) element, sentence, names);
        } else {
          process((Node) element, sentence, names);
        }
      }
    }
  }
1007546
function processGroup( $node, $prefix )
	{
		$ref = (string) $node->attributes()->ref;

		if ( empty( $ref ) )
		{
			//
			$content = array();
			foreach ( $node->children( SCHEMA_NAMESPACE ) as  $key => $groupChild )
			{
				$x = $this->getContent( $key, $groupChild, $prefix );
				$content = array_merge_recursive( $content, $x );
			}

			// Add the type
			// $this->types[ "$prefix:{$node->attributes()->name}" ] = $content;

			$group = array(
					'abstract' => true,
					'class' => 'group',
					'name' => (string) $node->attributes()->name,
					'prefix' => $prefix,
					'types' => array( $content ),
			);

			$this->groups[ "$prefix:{$group['name']}" ] = $group;

			return $group;
		}
		else
		{
			// BMS 2018-04-09 Test candidates changed.
			$ref = strpos( $ref, ":" ) ? $ref : "xs:$ref";
			if ( ! isset( $this->groups[ $ref ] ) )
			{
				// Try look ahead
				// The name in Ref may refer to the local XSD in which case the prefix needs to be removed
				$name = strpos( $ref, "$prefix:" ) === 0
					? str_replace( "$prefix:", "", $ref )
					: $ref;

				// For some reason the namespace registration applied to the XML root does not exist here so needs to be reapplied
				$node->registerXPathNamespace( SCHEMA_PREFIX, SCHEMA_NAMESPACE );
				// BMS 2018-04-09 Test candidates changed.
				$nodes = $node->xpath( "/xs:schema/xs:group[@name=\"$name\"]" );
				if ( $nodes )
				{
					// There is at least one node and only interested in one
					$el = $this->processGroup( $nodes[0], $prefix );
					// $this->elements[ "$prefix:{$el['name']}" ] = $el;
				}
			}

			if ( ! isset( $this->groups[ $ref ] ) ) return false;

			$result = $this->groups[ $ref ];

			if ( property_exists( $node->attributes(), 'minOccurs' ) )
			{
				$result['minOccurs'] = (string) $node->attributes()->minOccurs;
			}

			if ( property_exists( $node->attributes(), 'maxOccurs' ) )
			{
				$result['maxOccurs'] = (string) $node->attributes()->maxOccurs;
			}

			return $result;
		}
	}
918851
def schema_handler(self, schema):
        '''
        
        '''
        dict_for_render = schema.get('properties', dict()).items()
        if schema.get('$ref', None):
            def_name = schema.get('$ref').split('/')[-1]
            dict_for_render = self.definitions[def_name].get('properties', dict()).items()
        elif schema.get('properties', None) is None:
            return ''

        answer_dict = dict()
        json_dict = dict()
        for opt_name, opt_value in dict_for_render:
            var_type = opt_value.get('format', None) or opt_value.get('type', None) or 'object'
            json_name = self.indent + ':jsonparameter {} {}:'.format(var_type, opt_name)
            json_dict[json_name] = self.get_json_props_for_response(var_type, opt_value)

            answer_dict[opt_name] = self.get_response_example(opt_name, var_type, opt_value)
            if var_type == 'string':
                answer_dict[opt_name] = answer_dict[opt_name].format(opt_name)

        self.write('')
        for line in json.dumps(answer_dict, indent=4).split('\n'):
            self.write(line, self.indent_depth)

        self.write('')
        for json_param_name, json_param_value in json_dict.items():
            desc = '{}{}'.format(
                json_param_value['title'], json_param_value['props_str']
            ) or 'None'
            self.write(json_param_name + ' ' + desc)
67172
function keepNoScriptContents() {
        if (getDocumentMode() < 9) {
          parser.addNodeFilter('noscript', function (nodes) {
            var i = nodes.length, node, textNode;

            while (i--) {
              node = nodes[i];
              textNode = node.firstChild;

              if (textNode) {
                node.attr('data-mce-innertext', textNode.value);
              }
            }
          });

          serializer.addNodeFilter('noscript', function (nodes) {
            var i = nodes.length, node, textNode, value;

            while (i--) {
              node = nodes[i];
              textNode = nodes[i].firstChild;

              if (textNode) {
                textNode.value = Entities.decode(textNode.value);
              } else {
                // Old IE can't retain noscript value so an attribute is used to store it
                value = node.attributes.map['data-mce-innertext'];
                if (value) {
                  node.attr('data-mce-innertext', null);
                  textNode = new Node('#text', 3);
                  textNode.value = value;
                  textNode.raw = true;
                  node.append(textNode);
                }
              }
            }
          });
        }
      }
1214378
private void processNode(final Node node) {
        processNode(node.getPath(), node);

        Set<Node> children = node.getChildren();
        for (Node child : children) {
            processNode(child);
        }
    }
196308
function(context, request, callback){
		if ((context.indexOf('node_modules') !== -1) || (request.indexOf('.') !== 0)) {
			callback(null, 'commonjs ' + request);
		}
		else {
			callback();
		}
	}
401974
def _handle_child(
            self, node: SchemaNode, stmt: Statement, sctx: SchemaContext) -> None:
        """"""
        if not sctx.schema_data.if_features(stmt, sctx.text_mid):
            return
        node.name = stmt.argument
        node.ns = sctx.default_ns
        node._get_description(stmt)
        self._add_child(node)
        node._handle_substatements(stmt, sctx)
107769
public void handle(ASTNode node, GroovyParser.GroovyParserRuleContext ctx) {
        if (!(groovydocEnabled || runtimeGroovydocEnabled)) {
            return;
        }

        if (!asBoolean(node) || !asBoolean(ctx)) {
            return;
        }

        String docCommentNodeText = this.findDocCommentByNode(ctx);
        if (null == docCommentNodeText) {
            return;
        }

        attachDocCommentAsMetaData(node, docCommentNodeText);
        attachGroovydocAnnotation(node, docCommentNodeText);
    }