parse convert and assign node text to symbol
428234
def parse_symbol attr_name, xpath
      v = parse_value xpath
      v = v.to_sym unless v.nil?
      send("#{attr_name}=", v)
    end
819047
def parse(node)
      @margins = ParagraphMargins.new(OoxmlSize.new(0.127, :centimeter),
                                      OoxmlSize.new(0.127, :centimeter),
                                      OoxmlSize.new(0.254, :centimeter),
                                      OoxmlSize.new(0.254, :centimeter)).parse(node)
      node.attributes.each do |key, value|
        case key
        when 'wrap'
          @wrap = value.value.to_sym
        when 'anchor'
          @anchor = value_to_symbol(value)
        when 'vert'
          @vertical = value_to_symbol(value)
        when 'numCol'
          @number_columns = value.value.to_i
        when 'spcCol'
          @space_columns = OoxmlSize.new(value.value.to_f, :emu)
        end
      end
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'prstTxWarp'
          @preset_text_warp = PresetTextWarp.new(parent: self).parse(node_child)
        end
      end
      self
    end
776513
def Assign(target, source):
    """"""
    if not isinstance(target, list):
        target = [target]
    if not isinstance(source, list):
        source.prefix = u" "
        source = [source]

    return Node(syms.atom,
                target + [Leaf(token.EQUAL, u"=", prefix=u" ")] + source)
1195208
def _parse_xml(child, parser):
    """"""
    name, modifiers, dtype, kind = _parse_common(child)

    #Handle the symbol modification according to the isense settings.
    name = _isense_builtin_symbol(name)

    if child.tag == "subroutine":
        parent = Subroutine(name, modifiers, None)
    elif child.tag == "function":
        parent = Function(name, modifiers, dtype, kind, None)

    if parent is not None:
        for kid in child:
            if kid.tag == "parameter":
                _parse_parameter(kid, parser, parent)
            elif kid.tag == "summary":
                _parse_summary(kid, parser, parent)
            elif kid.tag == "usage":
                _parse_usage(kid, parser, parent)

    return parent
144684
def parse_for(self):
        """"""
        lineno = self.stream.expect('name:for').lineno
        target = self.parse_assign_target(extra_end_rules=('name:in',))
        self.stream.expect('name:in')
        iter = self.parse_tuple(with_condexpr=False,
                                extra_end_rules=('name:recursive',))
        test = None
        if self.stream.skip_if('name:if'):
            test = self.parse_expression()
        recursive = self.stream.skip_if('name:recursive')
        body = self.parse_statements(('name:endfor', 'name:else'))
        if next(self.stream).value == 'endfor':
            else_ = []
        else:
            else_ = self.parse_statements(('name:endfor',), drop_needle=True)
        return nodes.For(target, iter, body, else_, test,
                         recursive, lineno=lineno)
496109
def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'idx'
          @index = ValuedChild.new(:integer, parent: self).parse(node_child)
        when 'order'
          @order = ValuedChild.new(:integer, parent: self).parse(node_child)
        when 'tx'
          @text = SeriesText.new(parent: self).parse(node_child)
        when 'cat'
          @categories = Categories.new(parent: self).parse(node_child)
        when 'dLbls'
          @display_labels = DisplayLabelsProperties.new(parent: self).parse(node_child)
        when 'val'
          @values = XYValues.new(parent: self).parse(node_child)
        when 'xVal'
          @x_values = XYValues.new(parent: self).parse(node_child)
        when 'yVal'
          @y_values = XYValues.new(parent: self).parse(node_child)
        end
      end
      self
    end
52764
def _extract_node_text(node):
    """"""

    texts = map(
        six.text_type.strip, map(six.text_type, map(unescape, node.xpath(".//text()")))
    )
    return " ".join(text for text in texts if text)
1153425
def convert_dot(node, **kwargs):
    """"""
    name, input_nodes, attrs = get_inputs(node, kwargs)
    input_node_a = input_nodes[0]
    input_node_b = input_nodes[1]

    trans_a_node = None
    trans_b_node = None

    trans_a = get_boolean_attribute_value(attrs, "transpose_a")
    trans_b = get_boolean_attribute_value(attrs, "transpose_b")

    op_name = "transpose" + str(kwargs["idx"])

    if trans_a:
        trans_a_node = create_helper_trans_node(op_name, input_nodes[0], 'a')
        input_node_a = op_name+"_a"
    if trans_b:
        trans_b_node = create_helper_trans_node(op_name, input_nodes[1], 'b')
        input_node_b = op_name+"_b"

    matmul_node = onnx.helper.make_node(
        'MatMul',
        inputs=[input_node_a, input_node_b],
        outputs=[name],
        name=name
    )

    if not trans_a and not trans_b:
        return [matmul_node]
    elif trans_a and not trans_b:
        return [trans_a_node, matmul_node]
    elif trans_b and not trans_a:
        return [trans_b_node, matmul_node]
    else:
        return [trans_a_node, trans_b_node, matmul_node]
807035
def __convert_string_list(node):
    """"""
    converted = __convert_node(node)

    # Determine flags for the string list
    flags = vsflags(VSFlags.UserValue)

    # Check for a separator to determine if it is semicolon appendable
    # If not present assume the value should be ;
    separator = __get_attribute(node, 'Separator', default_value=';')

    if separator == ';':
        flags = vsflags(flags, VSFlags.SemicolonAppendable)

    converted['flags'] = flags

    return __check_for_flag(converted)
11810
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'styleId'
          @id = value.value.to_s
        when 'styleName'
          @name = value.value.to_s
        when 'val'
          @value = value.value.to_s
        end
      end

      node.xpath('*').each do |style_node_child|
        case style_node_child.name
        when 'wholeTbl'
          @whole_table = TableElement.new(parent: self).parse(style_node_child)
        when 'band1H'
          @banding_1_horizontal = TableElement.new(parent: self).parse(style_node_child)
        when 'band2H', 'band2Horz'
          @banding_2_horizontal = TableElement.new(parent: self).parse(style_node_child)
        when 'band1V'
          @banding_1_vertical = TableElement.new(parent: self).parse(style_node_child)
        when 'band2V'
          @banding_2_vertical = TableElement.new(parent: self).parse(style_node_child)
        when 'lastCol'
          @last_column = TableElement.new(parent: self).parse(style_node_child)
        when 'firstCol'
          @first_column = TableElement.new(parent: self).parse(style_node_child)
        when 'lastRow'
          @last_row = TableElement.new(parent: self).parse(style_node_child)
        when 'firstRow'
          @first_row = TableElement.new(parent: self).parse(style_node_child)
        when 'seCell'
          @southeast_cell = TableElement.new(parent: self).parse(style_node_child)
        when 'swCell'
          @southwest_cell = TableElement.new(parent: self).parse(style_node_child)
        when 'neCell'
          @northeast_cell = TableElement.new(parent: self).parse(style_node_child)
        when 'nwCell'
          @northwest_cell = TableElement.new(parent: self).parse(style_node_child)
        end
      end
      self
    end
25983
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'horizontal'
          @horizontal = value.value.to_sym
          @wrap_text = true if @horizontal == :justify
        when 'vertical'
          @vertical = value.value.to_sym
        when 'wrapText'
          @wrap_text = value.value.to_s == '1'
        when 'textRotation'
          @text_rotation = value.value.to_i
        end
      end
      self
    end
960276
function parse(node) {
  var link = {}
  var url = node.url || node.href || ''
  var start
  var end
  var page

  if (
    url.slice(0, GH_URL_PREFIX_LENGTH) !== GH_URL_PREFIX ||
    node.children.length !== 1 ||
    node.children[0].type !== 'text' ||
    toString(node).slice(0, GH_URL_PREFIX_LENGTH) !== GH_URL_PREFIX
  ) {
    return
  }

  start = GH_URL_PREFIX_LENGTH
  end = usernameEnd(url, GH_URL_PREFIX_LENGTH)

  if (end === -1 || url.charCodeAt(end) !== CC_SLASH) {
    return
  }

  link.user = url.slice(start, end)

  start = end + 1
  end = projectEnd(url, start)

  if (end === -1 || url.charCodeAt(end) !== CC_SLASH) {
    return
  }

  link.project = url.slice(start, end)

  start = end + 1
  end = url.indexOf('/', start)

  if (end === -1) {
    return
  }

  page = url.slice(start, end)

  if (page !== parse.COMMIT && page !== parse.ISSUE && page !== parse.PULL) {
    return
  }

  link.page = page
  start = end + 1

  if (page === parse.COMMIT) {
    end = shaEnd(url, start, true)
  } else {
    end = issueEnd(url, start)
  }

  if (end === -1) {
    return
  }

  link.reference = url.slice(start, end)
  link.comment = url.charCodeAt(end) === CC_HASH && url.length > end + 1

  return link
}
564862
function transform(node) {
  /**
   * Combine adjacent text and inline nodes before processing so they can
   * share marks.
   */
  const combinedChildren = node.nodes && combineTextAndInline(node.nodes);

  /**
   * Call `transform` recursively on child nodes, and flatten the resulting
   * array.
   */
  const children = !isEmpty(combinedChildren) && flatMap(combinedChildren, transform);

  /**
   * Run individual nodes through conversion factories.
   */
  return ['text'].includes(node.object) ? convertTextNode(node) : convertNode(node, children);
}
517628
def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'delete'
          @display = false if node_child.attribute('val').value == '1'
        when 'title'
          @title = ChartAxisTitle.new(parent: self).parse(node_child)
        when 'majorGridlines'
          @major_grid_lines = true
        when 'minorGridlines'
          @minor_grid_lines = true
        when 'scaling'
          @scaling = Scaling.new(parent: self).parse(node_child)
        when 'tickLblPos'
          @tick_label_position = ValuedChild.new(:symbol, parent: self).parse(node_child)
        when 'axPos'
          @position = value_to_symbol(node_child.attribute('val'))
        end
      end
      @display = false unless @title.visible?
      self
    end
285171
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'type'
          @unit = value.value.to_sym
        when 'w', 'val'
          @value = value.value.to_f
        end
      end
      self
    end
909324
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 's'
          @style_index = value.value.to_i
        when 't'
          @type = value.value.to_s
        end
      end
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'f'
          @formula = Formula.new(parent: self).parse(node_child)
        when 'v'
          @value = TextValue.new(parent: self).parse(node_child)
        end
      end
      parse_text_data
      self
    end
1198905
def pattern_convert(grammar, raw_node_info):
    """"""
    type, value, context, children = raw_node_info
    if children or type in grammar.number2symbol:
        return pytree.Node(type, children, context=context)
    else:
        return pytree.Leaf(type, value, context=context)