ed9fb224f3aa4336d066cbbe4b9abf26b24f8535,python/edl/utils/watcher.py,Watcher,_watcher,#Watcher#,58

Before Change


        begin = time.time()
        while not self._stop.is_set():
            servers = self._etcd.get_service(ETCD_POD_RANK)
            ranks = {}
            for s in servers:
                ranks[int(s.server)] = s.info
            //logger.info("ranks:{}".format(ranks))

            new_cluster = Cluster()
            with self._lock:
                if self._ranks is None:
                    self._ranks = ranks
                    self._cluster.from_json(ranks)
                    //logger.info("clusters:{}".format(self._cluster))
                    continue

After Change


                // update the cluster info.
                self._cluster = copy.copy(self._new_cluster)

            time.sleep(3)

    @property
    def changed(self):
        with self._lock:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: PaddlePaddle/edl
Commit Name: ed9fb224f3aa4336d066cbbe4b9abf26b24f8535
Time: 2020-09-02
Author: weibao.gong@gmail.com
File Name: python/edl/utils/watcher.py
Class Name: Watcher
Method Name: _watcher


Project Name: HyperGAN/HyperGAN
Commit Name: cb29df4dea83d69ef9f5109398b23158a8c680dc
Time: 2018-09-25
Author: martyn@255bits.com
File Name: examples/next-frame.py
Class Name: VideoFrameSampler
Method Name: _sample


Project Name: sony/nnabla
Commit Name: ffdd950970c5953e351fa88795fe916b3465d813
Time: 2018-06-13
Author: Yukio.Oobuchi@sony.com
File Name: python/src/nnabla/utils/data_source_implements.py
Class Name: CacheDataSource
Method Name: _get_data