code: def _get_cached_filename(archive):
      """A helper to generate a filename which has original filename and additional suffix
      which wouldn't collide across files with the same name from different locations
      """
      # return "%s_%s" % (basename(archive), hashlib.md5(archive).hexdigest()[:5])
      # per se there is no reason to maintain any long original name here.
      archive_cached = hashlib.md5(
          ensure_bytes(str(Path(archive).resolve()))
      ).hexdigest()[:10]
      lgr.debug(
          "Cached directory for archive %s is %s",
          archive,
          archive_cached,
      )
      return archive_cached
  
imports: import hashlib
  import logging
  import os
  import random
  import string
  import tempfile
  from datalad import cfg
  from datalad.config import anything2bool
  from datalad.consts import ARCHIVES_TEMP_DIR
  from datalad.support.external_versions import external_versions
  from datalad.support.locking import lock_if_check_fails
  from datalad.support.path import abspath, exists, isabs, isdir
  from datalad.support.path import join
  from datalad.support.path import normpath, pardir, relpath
  from datalad.support.path import sep
  from datalad.utils import Path, any_re_search, ensure_bytes, ensure_unicode, get_tempfile_kwargs, on_windows, rmtemp, rmtree, unlink
label_desc: Use image node_id 2 for calling a global function with example usage: _get_cached_filename(archive) and returns: archive_cached