code: def are_symlinks_supported(
      cache_dir: Union[str, Path, None] = None
  ) -> bool:
      """Return whether the symlinks are supported on the machine.
  
      Since symlinks support can change depending on the mounted disk, we need to check
      on the precise cache folder. By default, the default HF cache directory is checked.
  
      Args:
          cache_dir (`str`, `Path`, *optional*):
              Path to the folder where cached files are stored.
  
      Returns: [bool] Whether symlinks are supported in the directory.
      """
      # Defaults to HF cache
      if cache_dir is None:
          cache_dir = HF_HUB_CACHE
      cache_dir = str(
          Path(cache_dir).expanduser().resolve()
      )  # make it unique
  
      # Check symlink compatibility only once (per cache directory) at first time use
      if cache_dir not in _are_symlinks_supported_in_dir:
          _are_symlinks_supported_in_dir[cache_dir] = True
  
          os.makedirs(cache_dir, exist_ok=True)
          with SoftTemporaryDirectory(dir=cache_dir) as tmpdir:
              src_path = Path(tmpdir) / "dummy_file_src"
              src_path.touch()
              dst_path = Path(tmpdir) / "dummy_file_dst"
  
              # Relative source path as in `_create_symlink``
              relative_src = os.path.relpath(
                  src_path, start=os.path.dirname(dst_path)
              )
              try:
                  os.symlink(relative_src, dst_path)
              except OSError:
                  # Likely running on Windows
                  _are_symlinks_supported_in_dir[cache_dir] = False
  
                  if not HF_HUB_DISABLE_SYMLINKS_WARNING:
                      message = (
                          "`huggingface_hub` cache-system uses symlinks by default to"
                          " efficiently store duplicated files but your machine does not"
                          f" support them in {cache_dir}. Caching files will still work"
                          " but in a degraded version that might require more space on"
                          " your disk. This warning can be disabled by setting the"
                          " `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable. For"
                          " more details, see"
                          " https://huggingface.co/docs/huggingface_hub/how-to-cache#limitations."
                      )
                      if os.name == "nt":
                          message += (
                              "\nTo support symlinks on Windows, you either need to"
                              " activate Developer Mode or to run Python as an"
                              " administrator. In order to see activate developer mode,"
                              " see this article:"
                              " https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development"
                          )
                      warnings.warn(message)
  
      return _are_symlinks_supported_in_dir[cache_dir]
  
imports: import copy
  import fnmatch
  import inspect
  import io
  import json
  import os
  import re
  import shutil
  import stat
  import tempfile
  import time
  import uuid
  import warnings
  from contextlib import contextmanager
  from dataclasses import dataclass
  from functools import partial
  from pathlib import Path
  from typing import Any, BinaryIO, Dict, Generator, Literal, Optional, Tuple, Union
  from urllib.parse import quote, urlparse
  import requests
  from filelock import FileLock
  from huggingface_hub import constants
  from .None import __version__
  from .constants import DEFAULT_ETAG_TIMEOUT, DEFAULT_REQUEST_TIMEOUT, DEFAULT_REVISION, DOWNLOAD_CHUNK_SIZE, ENDPOINT, HF_HUB_CACHE, HF_HUB_DISABLE_SYMLINKS_WARNING, HF_HUB_DOWNLOAD_TIMEOUT, HF_HUB_ENABLE_HF_TRANSFER, HF_HUB_ETAG_TIMEOUT, HF_TRANSFER_CONCURRENCY, HUGGINGFACE_CO_URL_TEMPLATE, HUGGINGFACE_HEADER_X_LINKED_ETAG, HUGGINGFACE_HEADER_X_LINKED_SIZE, HUGGINGFACE_HEADER_X_REPO_COMMIT, HUGGINGFACE_HUB_CACHE, REPO_ID_SEPARATOR, REPO_TYPES, REPO_TYPES_URL_PREFIXES
  from .utils import EntryNotFoundError, FileMetadataError, GatedRepoError, LocalEntryNotFoundError, OfflineModeIsEnabled, RepositoryNotFoundError, RevisionNotFoundError, SoftTemporaryDirectory, build_hf_headers, get_fastai_version, get_fastcore_version, get_graphviz_version, get_jinja_version, get_pydot_version, get_session, get_tf_version, get_torch_version, hf_raise_for_status, is_fastai_available, is_fastcore_available, is_graphviz_available, is_jinja_available, is_pydot_available, is_tf_available, is_torch_available, logging, reset_sessions, tqdm, validate_hf_hub_args
  from .utils._deprecation import _deprecate_method
  from .utils._headers import _http_user_agent
  from .utils._runtime import _PY_VERSION
  from .utils._typing import HTTP_METHOD_T
  from .utils.insecure_hashlib import sha256
label_desc: Use image node_id 1 for calling a global function with example usage: are_symlinks_supported(cache_dir) and returns: _are_symlinks_supported_in_dir