code: def try_to_save_module(
      hashed_grammar,
      file_io,
      module,
      lines,
      pickling=True,
      cache_path=None,
  ):
      path = file_io.path
      try:
          p_time = None if path is None else file_io.get_last_modified()
      except OSError:
          p_time = None
          pickling = False
  
      item = _NodeCacheItem(module, lines, p_time)
      _set_cache_item(hashed_grammar, path, item)
      if pickling and path is not None:
          try:
              _save_to_file_system(
                  hashed_grammar, path, item, cache_path=cache_path
              )
          except PermissionError:
              # It's not really a big issue if the cache cannot be saved to the
              # file system. It's still in RAM in that case. However we should
              # still warn the user that this is happening.
              warnings.warn(
                  "Tried to save a file to %s, but got permission denied.",
                  Warning,
              )
          else:
              _remove_cache_and_update_lock(cache_path=cache_path)
  
imports: import time
  import os
  import sys
  import hashlib
  import gc
  import shutil
  import platform
  import errno
  import logging
  import warnings
  from parso._compatibility import FileNotFoundError, PermissionError, scandir
  from parso.file_io import FileIO
label_desc: Use image node_id 6 for calling a global function with example usage: try_to_save_module(hashed_grammar, file_io, module, lines, pickling, cache_path) without return types