code: def update_policy(self, path: GlobStr, policy: "PolicyName") -> None:
      # When we're dealing with one of our own media files, there's no need
      # to store the policy in memory.  _get_file_event_handler will always
      # return PolicyNow.  Using the path makes syncing historic runs much
      # faster if the name happens to include glob escapable characters.  In
      # the future we may add a flag to "files" records that indicates it's
      # policy is not dynamic and doesn't need to be stored / checked.
      save_name = LogicalPath(
          os.path.relpath(os.path.join(self._dir, path), self._dir)
      )
      if save_name.startswith("media/"):
          pass
      elif path == glob.escape(path):
          self._savename_file_policies[save_name] = policy
      else:
          self._user_file_policies[policy].add(path)
      for src_path in glob.glob(os.path.join(self._dir, path)):
          save_name = LogicalPath(os.path.relpath(src_path, self._dir))
          feh = self._get_file_event_handler(src_path, save_name)
          # handle the case where the policy changed
          if feh.policy != policy:
              try:
                  del self._file_event_handlers[save_name]
              except KeyError:
                  # TODO: probably should do locking, but this handles moved files for now
                  pass
              feh = self._get_file_event_handler(src_path, save_name)
          feh.on_modified(force=True)
  
imports: import abc
  import fnmatch
  import glob
  import logging
  import os
  import queue
  import time
  from typing import TYPE_CHECKING, Any, Mapping, MutableMapping, MutableSet, Optional
  from wandb import util
  from wandb.sdk.interface.interface import GlobStr
  from wandb.sdk.lib.paths import LogicalPath
label_desc: Use image node_id 3 for calling the DirWatcher obj's underlying member method code with example usage: obj.update_policy(path, policy) without return types