testing/merge_scripts/results_merger.py
def merge_tries(source, dest):
  """ Merges test tries.

  This is intended for use as a merge_func parameter to merge_value.

  Args:
      source: A result json test trie.
      dest: A json test trie merge destination.
  """
  # merge_tries merges source into dest by performing a lock-step depth-first
  # traversal of dest and source.
  # pending_nodes contains a list of all sub-tries which have been reached but
  # need further merging.
  # Each element consists of a trie prefix, and a sub-trie from each of dest
  # and source which is reached via that prefix.
  pending_nodes = [('', dest, source)]
  while pending_nodes:
    prefix, dest_node, curr_node = pending_nodes.pop()
    for k, v in curr_node.items():
      if k in dest_node:
        if not isinstance(v, dict):
          raise MergeException(
              "%s:%s: %r not mergable, curr_node: %r\ndest_node: %r" % (
                  prefix, k, v, curr_node, dest_node))
        pending_nodes.append(("%s:%s" % (prefix, k), dest_node[k], v))
      else:
        dest_node[k] = v
  return dest
 Merges test tries.

  This is intended for use as a merge_func parameter to merge_value.

  Args:
      source: A result json test trie.
      dest: A json test trie merge destination.
  
Merges test tries.
This is intended for use as a merge_func parameter to merge_value.
Merges test tries . This is intended for use as a merge_func parameter to merge_value .
def merge_tries(source, dest):
  pending_nodes = [('', dest, source)]
  while pending_nodes:
    prefix, dest_node, curr_node = pending_nodes.pop()
    for k, v in curr_node.items():
      if k in dest_node:
        if not isinstance(v, dict):
          raise MergeException(
              "%s:%s: %r not mergable, curr_node: %r\ndest_node: %r" % (
                  prefix, k, v, curr_node, dest_node))
        pending_nodes.append(("%s:%s" % (prefix, k), dest_node[k], v))
      else:
        dest_node[k] = v
  return dest
def merge_tries ( source , dest ) : pending_nodes = [ ( '' , dest , source ) ] while pending_nodes : prefix , dest_node , curr_node = pending_nodes . pop ( ) for k , v in curr_node . items ( ) : if k in dest_node : if not isinstance ( v , dict ) : raise MergeException ( "%s:%s: %r not mergable, curr_node: %r\ndest_node: %r" % ( prefix , k , v , curr_node , dest_node ) ) pending_nodes . append ( ( "%s:%s" % ( prefix , k ) , dest_node [ k ] , v ) ) else : dest_node [ k ] = v return dest
Merges test tries.
Merges test tries .
""" Merges test tries.

  This is intended for use as a merge_func parameter to merge_value.

  Args:
      source: A result json test trie.
      dest: A json test trie merge destination.
  """ # merge_tries merges source into dest by performing a lock-step depth-first # traversal of dest and source. # pending_nodes contains a list of all sub-tries which have been reached but # need further merging. # Each element consists of a trie prefix, and a sub-trie from each of dest # and source which is reached via that prefix.
source
A result json test trie.
A result json test trie .
dest
A json test trie merge destination.
A json test trie merge destination .