def clear_caches(self, hard=False):
from rez.package_repository import package_repository_manager<EOL>from rez.utils.memcached import memcached_client<EOL>package_repository_manager.clear_caches()<EOL>if hard:<EOL><INDENT>with memcached_client() as client:<EOL><INDENT>client.flush()<EOL><DEDENT><DEDENT>
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.