code: def test_is_hidden():
      with tempfile.TemporaryDirectory() as root:
          subdir1 = os.path.join(root, "subdir")
          os.makedirs(subdir1)
          assert not is_hidden(subdir1, root)
          assert not is_file_hidden(subdir1)
  
          subdir2 = os.path.join(root, ".subdir2")
          os.makedirs(subdir2)
          assert is_hidden(subdir2, root)
          assert is_file_hidden(subdir2)
          # root dir is always visible
          assert not is_hidden(subdir2, subdir2)
  
          subdir34 = os.path.join(root, "subdir3", ".subdir4")
          os.makedirs(subdir34)
          assert is_hidden(subdir34, root)
          assert is_hidden(subdir34)
  
          subdir56 = os.path.join(root, ".subdir5", "subdir6")
          os.makedirs(subdir56)
          assert is_hidden(subdir56, root)
          assert is_hidden(subdir56)
          assert not is_file_hidden(subdir56)
          assert not is_file_hidden(subdir56, os.stat(subdir56))
  
          assert not is_file_hidden(
              os.path.join(root, "does_not_exist")
          )
          subdir78 = os.path.join(root, "subdir7", "subdir8")
          os.makedirs(subdir78)
          assert not is_hidden(subdir78, root)
          if hasattr(os, "chflags"):
              os.chflags(subdir78, UF_HIDDEN)
              assert is_hidden(subdir78, root)
  
imports: from __future__ import annotations
  import os
  import re
  import shutil
  import site
  import stat
  import subprocess
  import sys
  import tempfile
  import warnings
  from unittest.mock import patch
  import pytest
  from platformdirs import __version_info__
  from jupyter_core import paths
  from jupyter_core.paths import UF_HIDDEN, _win32_restrict_file_to_user_ctypes, exists, is_file_hidden, is_hidden, issue_insecure_write_warning, jupyter_config_dir, jupyter_config_path, jupyter_data_dir, jupyter_path, jupyter_runtime_dir, prefer_environment_over_user, secure_write
label_desc: Use image node_id 39 for calling a global function with example usage: test_is_hidden() without return types