# Path: meta_dataset/data/imagenet_stats.py
# def log_graph_stats(nodes,
#                     num_images,
#                     get_leaves_fn,
#                     get_spanning_leaves_fn,
#                     graph_name=None,
#                     min_way=5,
#                     max_way=50):
# def log_stats_finegrainedness(nodes,
#                               get_leaves_fn,
#                               get_lowest_common_ancestor_fn,
#                               graph_name=None,
#                               num_per_height_to_print=2,
#                               num_leaf_pairs=10000,
#                               path='longest'):


import json
import os
import numpy as np
import six
import tensorflow.compat.v1 as tf
from absl import logging
from meta_dataset.data import imagenet_stats
    splits = {
        split_enum.TRAIN: spanning_leaves,
        split_enum.VALID: set(),
        split_enum.TEST: set()
    }
  else:
    # Create class splits, each with its own sampling graph.
    # Choose roots for the validation and test subtrees (see the docstring of
    # create_splits for more information on how these are used).
    valid_test_roots = {
        'valid': get_synset_by_wnid('n02075296', sampling_graph),  # 'carnivore'
        'test':
            get_synset_by_wnid('n03183080', sampling_graph)  # 'device'
    }
    # The valid_test_roots returned here correspond to the same Synsets as in
    # the above dict, but are the copied versions of them for each subgraph.
    splits, valid_test_roots = create_splits(
        spanning_leaves, split_enum, valid_test_roots=valid_test_roots)

  # Compute num_images for each split.
  split_num_images = {}
  split_num_images[split_enum.TRAIN] = get_num_spanning_images(
      get_spanning_leaves(splits[split_enum.TRAIN]), num_synset_2012_images)
  split_num_images[split_enum.VALID] = get_num_spanning_images(
      get_spanning_leaves(splits[split_enum.VALID]), num_synset_2012_images)
  split_num_images[split_enum.TEST] = get_num_spanning_images(
      get_spanning_leaves(splits[split_enum.TEST]), num_synset_2012_images)

  # Compute statistics.
  if log_stats:

# Path: meta_dataset/data/imagenet_stats.py
# def log_graph_stats(nodes,
#                     num_images,
#                     get_leaves_fn,
#                     get_spanning_leaves_fn,
#                     graph_name=None,
#                     min_way=5,
#                     max_way=50):
# def log_stats_finegrainedness(nodes,
#                               get_leaves_fn,
#                               get_lowest_common_ancestor_fn,
#                               graph_name=None,
#                               num_per_height_to_print=2,
#                               num_leaf_pairs=10000,
#                               path='longest'):


# Path: meta_dataset/data/imagenet_specification.py
import json
import os
import numpy as np
import six
import tensorflow.compat.v1 as tf
from absl import logging
from meta_dataset.data import imagenet_stats

    splits = {
        split_enum.TRAIN: spanning_leaves,
        split_enum.VALID: set(),
        split_enum.TEST: set()
    }
  else:
    # Create class splits, each with its own sampling graph.
    # Choose roots for the validation and test subtrees (see the docstring of
    # create_splits for more information on how these are used).
    valid_test_roots = {
        'valid': get_synset_by_wnid('n02075296', sampling_graph),  # 'carnivore'
        'test':
            get_synset_by_wnid('n03183080', sampling_graph)  # 'device'
    }
    # The valid_test_roots returned here correspond to the same Synsets as in
    # the above dict, but are the copied versions of them for each subgraph.
    splits, valid_test_roots = create_splits(
        spanning_leaves, split_enum, valid_test_roots=valid_test_roots)

  # Compute num_images for each split.
  split_num_images = {}
  split_num_images[split_enum.TRAIN] = get_num_spanning_images(
      get_spanning_leaves(splits[split_enum.TRAIN]), num_synset_2012_images)
  split_num_images[split_enum.VALID] = get_num_spanning_images(
      get_spanning_leaves(splits[split_enum.VALID]), num_synset_2012_images)
  split_num_images[split_enum.TEST] = get_num_spanning_images(
      get_spanning_leaves(splits[split_enum.TEST]), num_synset_2012_images)

  # Compute statistics.
  if log_stats:

    imagenet_stats.log_graph_stats(