code: def _resolve_samefiles(filename, file_same):
      assert "*" not in filename, (filename,)
      assert os.path.normpath(filename) == filename, (filename,)
      _, suffix = os.path.splitext(filename)
      samefiles = []
      for (patterns,) in _resolve_file_values(
          filename, file_same.items()
      ):
          for pattern in patterns:
              same = _resolve_samefile(filename, pattern, suffix)
              if not same:
                  continue
              samefiles.append(same)
      return samefiles
  
imports: import contextlib
  import logging
  import os
  import os.path
  import platform
  import re
  import sys
  from c_common.fsutil import match_glob
  from c_common.tables import parse_table
  from ..source import resolve, good_file
  from .None import errors
  from .None import pure, gcc
  from .errors import PreprocessorError, PreprocessorFailure, ErrorDirectiveError, MissingDependenciesError, OSMismatchError
  from .common import FileInfo, SourceLine
label_desc: Use image node_id 7 for calling a global function with example usage: _resolve_samefiles(filename, file_same) and returns: samefiles