code: def __init__(self, repo):
      self._repo = repo
      self.config = config = repo.config["cache"]
      self._odb = {}
  
      local = config.get("local")
      default = self.default_local_cache_dir
  
      if local:
          settings = {"name": local}
      elif "dir" not in config and not default:
          settings = None
      else:
          from dvc.config_schema import LOCAL_COMMON
  
          url = config.get("dir") or default
          settings = {"url": url}
          for opt in LOCAL_COMMON:
              if opt in config:
                  settings[str(opt)] = config.get(opt)
  
      kwargs = {}
      if not isinstance(repo.fs, GitFileSystem):
          kwargs["fs"] = repo.fs
  
      odb = _get_odb(
          repo,
          settings,
          prefix=(self.FILES_DIR, DEFAULT_ALGORITHM),
          **kwargs,
      )
      self._odb["repo"] = odb
      self._odb[Schemes.LOCAL] = odb
      legacy_odb = _get_odb(
          repo, settings, hash_name="md5-dos2unix", **kwargs
      )
      self._odb["legacy"] = legacy_odb
  
file_path: dvc/dvc/cachemgr.py
imports: import os
  from typing import TYPE_CHECKING, Optional, Tuple
  from dvc.fs import GitFileSystem, Schemes
  from dvc_data.hashfile.db import get_odb
  from dvc_data.hashfile.hash import DEFAULT_ALGORITHM
label_desc: Use image node_id 1 to create a new CacheManager object  with example: obj = CacheManager(repo)