code: def clear_caches(self, hard=False):
          
          from rez.package_repository import package_repository_manager
          from rez.utils.memcached import memcached_client
  
          package_repository_manager.clear_caches()
          if hard:
              with memcached_client() as client:
                  client.flush()
docs: Clear all caches in Rez.
  
          Rez caches package contents and iteration during a python session. Thus
          newly released packages, and changes to existing packages, may not be
          picked up. You need to clear the cache for these changes to become
          visible.
  
          Args:
              hard (bool): Perform a 'hard' cache clear. This just means that the
                  memcached cache is also cleared. Generally this is not needed -
                  this option is for debugging purposes.