code: def _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(
      matched_rel_path: str, pattern: str
  ) -> bool:
      """
      When a path matches a pattern, we additionnally check if it's a hidden file or if it's inside
      a hidden directory we ignore by default, i.e. if the file name or a parent directory name starts with a dot.
  
      Users can still explicitly request a filepath that is hidden or is inside a hidden directory
      if the hidden part is mentioned explicitly in the requested pattern.
  
      Some examples:
  
      base directory:
  
          ./
          └── .hidden_file.txt
  
      >>> _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(".hidden_file.txt", "**")
      True
      >>> _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(".hidden_file.txt", ".*")
      False
  
      base directory:
  
          ./
          └── .hidden_dir
              └── a.txt
  
      >>> _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(".hidden_dir/a.txt", "**")
      True
      >>> _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(".hidden_dir/a.txt", ".*/*")
      False
      >>> _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(".hidden_dir/a.txt", ".hidden_dir/*")
      False
  
      base directory:
  
          ./
          └── .hidden_dir
              └── .hidden_file.txt
  
      >>> _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(".hidden_dir/.hidden_file.txt", "**")
      True
      >>> _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(".hidden_dir/.hidden_file.txt", ".*/*")
      True
      >>> _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(".hidden_dir/.hidden_file.txt", ".*/.*")
      False
      >>> _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(".hidden_dir/.hidden_file.txt", ".hidden_dir/*")
      True
      >>> _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(".hidden_dir/.hidden_file.txt", ".hidden_dir/.*")
      False
      """
      # We just need to check if every hidden part from the path is present explicly in the pattern.
      # Since we assume that the path matches the pattern, it's equivalent to counting that both
      # the path and the pattern have the same number of hidden parts.
      hidden_directories_in_path = [
          part
          for part in PurePath(matched_rel_path).parts
          if part.startswith(".") and not set(part) == {"."}
      ]
      hidden_directories_in_pattern = [
          part
          for part in PurePath(pattern).parts
          if part.startswith(".") and not set(part) == {"."}
      ]
      return len(hidden_directories_in_path) != len(
          hidden_directories_in_pattern
      )
  
imports: import os
  import re
  from functools import partial
  from glob import has_magic
  from pathlib import Path, PurePath
  from typing import Callable, Dict, List, Optional, Set, Tuple, Union
  import huggingface_hub
  from fsspec import get_fs_token_paths
  from fsspec.implementations.http import HTTPFileSystem
  from huggingface_hub import HfFileSystem
  from packaging import version
  from tqdm.contrib.concurrent import thread_map
  from .None import config
  from .download import DownloadConfig
  from .download.streaming_download_manager import _prepare_path_and_storage_options, xbasename, xjoin
  from .splits import Split
  from .utils import logging
  from .utils import tqdm
  from .utils.file_utils import is_local_path, is_relative_path
  from .utils.py_utils import glob_pattern_to_regex, string_to_dict
label_desc: Use image node_id 4 for calling a global function with example usage: _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir(matched_rel_path, pattern) and returns: unknown