code: def _build_nightly_dict(
      registered_ds: FullNamesDict,
      stable_version_ds: FullNamesDict,
  ) -> NightlyDict:
      """Computes the nightly dict from the registered and stable dict."""
      nightly_ds = collections.defaultdict(
          lambda: collections.defaultdict(  # pylint: disable=g-long-lambda
              lambda: collections.defaultdict(bool)
          )
      )
      for dataset in registered_ds:
          if dataset in stable_version_ds:
              for config in registered_ds[dataset]:
                  if config in stable_version_ds[dataset]:
                      for version in registered_ds[dataset][config]:
                          if (
                              version
                              in stable_version_ds[dataset][config]
                          ):
                              # (dataset, config, version) already exists
                              # We add it to the nightly dict to make sure the
                              # key exists
                              nightly_ds[dataset][config][
                                  version
                              ] = False
                          else:
                              # New version only present in tfds-nightly
                              nightly_ds[dataset][config][
                                  version
                              ] = True
                  else:
                      # New config only present in tfds-nightly
                      nightly_ds[dataset][config] = True
          else:
              # New dataset only present in tfds-nightly
              nightly_ds[dataset] = True
      return nightly_ds
  
imports: import collections
  import dataclasses
  import json
  import os
  import textwrap
  from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
  import tensorflow_datasets
  from tensorflow_datasets.core import constants
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: _build_nightly_dict(registered_ds, stable_version_ds) and returns: nightly_ds