code: def _normalize_branch_node(self, node):
          
          iter_node = iter(node)
          if any(iter_node) and any(iter_node):
              return node
  
          if node[16]:
              return [compute_leaf_key([]), node[16]]
  
          sub_node_idx, sub_node_hash = next(
              (idx, v)
              for idx, v
              in enumerate(node[:16])
              if v
          )
          sub_node = self.get_node(sub_node_hash)
          sub_node_type = get_node_type(sub_node)
  
          if sub_node_type in {NODE_TYPE_LEAF, NODE_TYPE_EXTENSION}:
              with self._prune_node(sub_node):
                  new_subnode_key = encode_nibbles(tuple(itertools.chain(
                      [sub_node_idx],
                      decode_nibbles(sub_node[0]),
                  )))
                  return [new_subnode_key, sub_node[1]]
          elif sub_node_type == NODE_TYPE_BRANCH:
              subnode_hash = self._persist_node(sub_node)
              return [encode_nibbles([sub_node_idx]), subnode_hash]
          else:
              raise Exception("Invariant: this code block should be unreachable")
docs: A branch node which is left with only a single non-blank item should be
          turned into either a leaf or extension node.