code: def _paths_to_tree(paths: List[types.FeaturePath]):
      """Convert paths to recursively nested dict."""
      nested_dict = lambda: collections.defaultdict(nested_dict)
  
      result = nested_dict()
  
      def _add(tree, path):
          if not path:
              return
          children = tree[path[0]]
          _add(children, path[1:])
  
      for path in paths:
          _add(result, path.steps())
      return result
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import logging
  from typing import Any, Iterable, List, Mapping, Optional, Set, Text, Tuple, Union
  from tensorflow_data_validation import types
  from tensorflow_data_validation.utils import io_util
  from google.protobuf import descriptor
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 14 for calling a global function with example usage: _paths_to_tree(paths) and returns: result