parameters: (grammar, raw_node_info)
docstring: Converts raw node information to a Node or Leaf instance.
docstring_summary: Converts raw node information to a Node or Leaf instance.
docstring_tokens: Converts raw node information to a Node or Leaf instance .
function: def pattern_convert(grammar, raw_node_info):
      """Converts raw node information to a Node or Leaf instance."""
      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)
function_tokens: 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 )