code: def get_paths(self):
          
          paths = []
          for key, child in six.iteritems(self):
              if isinstance(child, TreeMap) and child:
                  # current child is an intermediate node
                  for path in child.get_paths():
                      path.insert(0, key)
                      paths.append(path)
              else:
                  # current child is an endpoint
                  paths.append([key])
          return paths
docs: Get all paths from the root to the leaves.
  
          For example, given a chain like `{'a':{'b':{'c':None}}}`,
          this method would return `[['a', 'b', 'c']]`.
  
          Returns:
              A list of lists of paths.