def get(self, file_handle_id, path=None):
        cache_dir = self.get_cache_dir(file_handle_id)
        if not os.path.exists(cache_dir):
            return None

        with Lock(self.cache_map_file_name, dir=cache_dir):
            cache_map = self._read_cache_map(cache_dir)

            path = utils.normalize_path(path)

            ## If the caller specifies a path and that path exists in the cache
            ## but has been modified, we need to indicate no match by returning
            ## None. The logic for updating a synapse entity depends on this to
            ## determine the need to upload a new file.

            if path is not None:
                ## If we're given a path to a directory, look for a cached file in that directory
                if os.path.isdir(path):
                    for cached_file_path, cached_time in six.iteritems(cache_map):
                        if path == os.path.dirname(cached_file_path):
                            return cached_file_path if compare_timestamps(_get_modified_time(cached_file_path), cached_time) else None

                ## if we're given a full file path, look up a matching file in the cache
                else:
                    cached_time = cache_map.get(path, None)
                    if cached_time:
                        return path if compare_timestamps(_get_modified_time(path), cached_time) else None

            ## return most recently cached and unmodified file OR
            ## None if there are no unmodified files
            for cached_file_path, cached_time in sorted(cache_map.items(), key=operator.itemgetter(1), reverse=True):
                if compare_timestamps(_get_modified_time(cached_file_path), cached_time):
                    return cached_file_path

            return None
Retrieve a file with the given file handle from the cache.
dataset/ETHPy150Open Sage-Bionetworks/synapsePythonClient/synapseclient/cache.py/Cache.get