code: def __init__(self, key, override=False, dump=False):
      self.key = key
      self.lock_path = None
      if dump:
          self.cache_dir = default_dump_dir()
          self.cache_dir = os.path.join(self.cache_dir, self.key)
          self.lock_path = os.path.join(self.cache_dir, "lock")
          os.makedirs(self.cache_dir, exist_ok=True)
      elif override:
          self.cache_dir = default_override_dir()
          self.cache_dir = os.path.join(self.cache_dir, self.key)
      else:
          # create cache directory if it doesn't exist
          self.cache_dir = (
              os.getenv("TRITON_CACHE_DIR", "").strip()
              or default_cache_dir()
          )
          if self.cache_dir:
              self.cache_dir = os.path.join(self.cache_dir, self.key)
              self.lock_path = os.path.join(self.cache_dir, "lock")
              os.makedirs(self.cache_dir, exist_ok=True)
          else:
              raise RuntimeError("Could not create or locate cache dir")
  
imports: import json
  import os
  import random
  from abc import ABC, abstractmethod
  from pathlib import Path
  from typing import Dict, Optional
  import hashlib
label_desc: Use image node_id 1 to create a new FileCacheManager object from inherited base classes: CacheManager with example: obj = FileCacheManager(key, override, dump)