def get()

in iopath/common/file_io.py [0:0]


    def get(key=GLOBAL_PATH_MANAGER, defaults_setup=False) -> PathManager:
        """
        Get the path manager instance associated with a key.
        A new instance will be created if there is no existing
        instance associated with the key passed in.
        Args:
            key (str):
            defaults_setup (bool): If True, setup_defaults is called.
        """
        if key not in PathManagerFactory.pm_list:
            PathManagerFactory.pm_list[key] = PathManager()
            if defaults_setup:
                try:
                    from iopath.common.setup_defaults import setup_defaults

                    setup_defaults(PathManagerFactory.pm_list[key])
                except ImportError:
                    pass

        return PathManagerFactory.pm_list[key]