code: def test_github_api_read_bytes_text():
      """Test query github API file content."""
      p = github_path.GithubPath.from_repo(
          "tensorflow/datasets", "v3.1.0"
      )
  
      # Note: This is not wrapped inside `enable_api_call` contextmanager as
      # users need to download files without setting up an API token.
  
      content = (p / "AUTHORS").read_bytes()
      assert isinstance(content, bytes)
      assert content == _AUTHOR_EXPECTED_CONTENT.encode()
  
      content = (p / "AUTHORS").read_text()
      assert isinstance(content, str)
      assert content == _AUTHOR_EXPECTED_CONTENT
  
      # Cannot read the content of a directory.
      with pytest.raises(FileNotFoundError, match="Request failed"):
          (p / "tensorflow_datasets" / "core").read_bytes()
  
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 9 for calling a global function with example usage: test_github_api_read_bytes_text() without return types