code: def test_list_dataset_references():
      ref1 = naming.DatasetReference(
          dataset_name="ds1", namespace="kaggle"
      )
      ref2 = naming.DatasetReference(
          dataset_name="ds2", namespace="kaggle"
      )
      ref3 = naming.DatasetReference(
          dataset_name="ds3", namespace="kaggle"
      )
      register1 = mock.create_autospec(register_path.DataDirRegister)
      register1.list_dataset_references.return_value = [ref1, ref2]
      register2 = mock.create_autospec(register_package.PackageRegister)
      register2.list_dataset_references.return_value = [ref3]
      namespace_config = mock.create_autospec(
          registry_lib.NamespaceConfig
      )
      namespace_config.registers_per_namespace.return_value = {
          "ns1": [register1],
          "ns2": [register2],
      }
      registry = registry_lib.DatasetRegistry(
          namespace_config=namespace_config
      )
      assert sorted(registry.list_dataset_references()) == [
          ref1,
          ref2,
          ref3,
      ]
  
imports: import os
  import pathlib
  import tempfile
  import textwrap
  from unittest import mock
  import pytest
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import registered
  from tensorflow_datasets.core.community import register_package
  from tensorflow_datasets.core.community import register_path
  from tensorflow_datasets.core.community import registry
  from tensorflow_datasets.core.utils import gcs_utils
label_desc: Use image node_id 9 for calling a global function with example usage: test_list_dataset_references() without return types