code: def pattern_results(complex_data_dir):
      # We use fsspec glob as a reference for data files resolution from patterns.
      # This is the same as dask for example.
      #
      # /!\ Here are some behaviors specific to fsspec glob that are different from glob.glob, Path.glob, Path.match or fnmatch:
      # - '*' matches only first level items
      # - '**' matches all items
      # - '**/*' matches all at least second level items
      #
      # More generally:
      # - '*' matches any character except a forward-slash (to match just the file or directory name)
      # - '**' matches any character including a forward-slash /
  
      return {
          pattern: sorted(
              Path(os.path.abspath(path)).as_posix()
              for path in fsspec.filesystem("file").glob(
                  os.path.join(complex_data_dir, pattern)
              )
              if Path(path).name not in _FILES_TO_IGNORE
              and not any(
                  is_relative_to(
                      Path(path),
                      os.path.join(complex_data_dir, dir_path),
                  )
                  for dir_path in _DIRS_TO_IGNORE
              )
              and Path(path).is_file()
          )
          for pattern in _TEST_PATTERNS
      }
  
imports: import copy
  import os
  from pathlib import Path
  from typing import List
  from unittest.mock import patch
  import fsspec
  import pytest
  from fsspec.registry import _registry
  from fsspec.spec import AbstractFileSystem
  from datasets.data_files import DataFilesDict, DataFilesList, DataFilesPatternsDict, DataFilesPatternsList, _get_data_files_patterns, _get_metadata_files_patterns, _is_inside_unrequested_special_dir, _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir, get_data_patterns, resolve_pattern
  from datasets.fingerprint import Hasher
label_desc: Use image node_id 3 for calling a global function with example usage: pattern_results(complex_data_dir) and returns: unknown