code: def test_github_api_listdir():
      """Test query github API."""
      # PurePath ops do not trigger API calls
      p = github_path.GithubPath.from_repo(
          "tensorflow/datasets", "v3.1.0"
      )
      p = p / "tensorflow_datasets" / "testing"
  
      with enable_api_call():
          sub_dirs = sorted(p.iterdir())
  
      # `listdir` call cache the filetype of all childs
      all_dir_names = [d.name for d in sub_dirs if d.is_dir()]
      all_file_names = [d.name for d in sub_dirs if d.is_file()]
      all_names = [d.name for d in sub_dirs]
  
      with pytest.raises(NotADirectoryError):
          list((p / "__init__.py").iterdir())
  
      assert all_names == [
          "__init__.py",
          "dataset_builder_testing.py",
          "dataset_builder_testing_test.py",
          "fake_data_generation",
          "fake_data_utils.py",
          "generate_archives.sh",
          "metadata",
          "mocking.py",
          "mocking_test.py",
          "test_case.py",
          "test_data",
          "test_utils.py",
          "test_utils_test.py",
      ]
      assert all_dir_names == [
          "fake_data_generation",
          "metadata",
          "test_data",
      ]
      assert all_file_names == [
          "__init__.py",
          "dataset_builder_testing.py",
          "dataset_builder_testing_test.py",
          "fake_data_utils.py",
          "generate_archives.sh",
          "mocking.py",
          "mocking_test.py",
          "test_case.py",
          "test_utils.py",
          "test_utils_test.py",
      ]
  
file_path: datasets/tensorflow_datasets/core/github_api/github_path_test.py
imports: import contextlib
  import os
  import textwrap
  from unittest import mock
  from etils import epath
  import pytest
  from tensorflow_datasets.core.github_api import github_path
label_desc: Use image node_id 7 for calling a global function with example usage: test_github_api_listdir() without return types