code: def write_cache(code: str) -> bool:
      if os.access(nn_cache_file_path.as_posix(), os.W_OK) or (
          not nn_cache_file_path.exists()
          and os.access(nn_cache_file_path.parent.as_posix(), os.W_OK)
      ):
          with nn_cache_file_path.open("w") as fp:
              fp.write(code)
          return True
      else:
          # no permission
          return False
  
file_path: nni/nni/nas/nn/pytorch/layers.py
imports: import hashlib
  import os
  import warnings
  from pathlib import Path
label_desc: Use image node_id 3 for calling a global function with example usage: write_cache(code) and returns: True, False