class_docstr: Tests for ImageNet-Sketch dataset.
docstr: Check the label distribution.
  
  This checks that labels get correctly converted between the synset ids
  and integers.
  
  Args:
    builder: The ImagenetR dataset builder.
docstr_tok: ["Check","the","label","distribution",".","This","checks","that","labels","get","correctly","converted","between","the","synset","ids","and","integers",".","Args",":","builder",":","The","ImagenetR","dataset","builder","."]
code: def _assertAsDataset(self, builder):
      """Check the label distribution.
  
      This checks that labels get correctly converted between the synset ids
      and integers.
  
      Args:
        builder: The ImagenetR dataset builder.
      """
      super()._assertAsDataset(builder)
      label_frequncies = collections.Counter()
      label_feature = builder.info.features["label"]
      dataset = builder.as_dataset()
      filenames = []
      for features in dataset_utils.as_numpy(dataset["test"]):
          label_frequncies.update(
              [label_feature.int2str(features["label"])]
          )
          filenames.append(features["file_name"])
      self.assertEqual(
          dict(label_frequncies),
          {"n01443537": 2, "n01484850": 3, "n12267677": 5},
      )
      self.assertIn(b"n01443537/sketch_0.JPEG", filenames)
  
imports: import collections
  from tensorflow_datasets.core import dataset_utils
  from tensorflow_datasets.datasets.imagenet_sketch import imagenet_sketch_dataset_builder
  import tensorflow_datasets.public_api
label_desc: Use image node_id 1 for calling the ImagenetSketchTest obj's underlying member method code with example usage: obj._assertAsDataset(builder) without return types