Python zmq.pyzmq_version() Examples
The following are 4
code examples of zmq.pyzmq_version().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
zmq
, or try the search function
.
Example #1
Source File: __init__.py From emnlp19-moverscore with MIT License | 6 votes |
def __init__(self, args): super().__init__() self.logger = set_logger(colored('VENTILATOR', 'magenta'), args.verbose) self.data_dir = args.data_dir self.num_worker = args.num_worker self.num_concurrent_socket = max(8, args.num_worker * 2) # optimize concurrency for multi-clients self.port = args.port self.args = args self.status_args = {k: (v if k != 'pooling_strategy' else v.value) for k, v in sorted(vars(args).items())} self.status_static = { 'python_version': sys.version, 'server_version': __version__, 'pyzmq_version': zmq.pyzmq_version(), 'zmq_version': zmq.zmq_version(), 'server_start_time': str(datetime.now()), } self.processes = []
Example #2
Source File: test_version.py From vnpy_crypto with MIT License | 5 votes |
def test_pyzmq_version(self): vs = zmq.pyzmq_version() vs2 = zmq.__version__ self.assertTrue(isinstance(vs, str)) if zmq.__revision__: self.assertEqual(vs, '@'.join(vs2, zmq.__revision__)) else: self.assertEqual(vs, vs2) if version.VERSION_EXTRA: self.assertTrue(version.VERSION_EXTRA in vs) self.assertTrue(version.VERSION_EXTRA in vs2)
Example #3
Source File: __init__.py From bert-as-service with MIT License | 5 votes |
def __init__(self, args): super().__init__() self.logger = set_logger(colored('VENTILATOR', 'magenta'), args.verbose) self.model_dir = args.model_dir self.max_seq_len = args.max_seq_len self.num_worker = args.num_worker self.max_batch_size = args.max_batch_size self.num_concurrent_socket = max(8, args.num_worker * 2) # optimize concurrency for multi-clients self.port = args.port self.args = args self.status_args = {k: (v if k != 'pooling_strategy' else v.value) for k, v in sorted(vars(args).items())} self.status_static = { 'tensorflow_version': _tf_ver_, 'python_version': sys.version, 'server_version': __version__, 'pyzmq_version': zmq.pyzmq_version(), 'zmq_version': zmq.zmq_version(), 'server_start_time': str(datetime.now()), } self.processes = [] self.logger.info('freeze, optimize and export graph, could take a while...') with Pool(processes=1) as pool: # optimize the graph, must be done in another process from .graph import optimize_graph self.graph_path, self.bert_config = pool.apply(optimize_graph, (self.args,)) # from .graph import optimize_graph # self.graph_path = optimize_graph(self.args, self.logger) if self.graph_path: self.logger.info('optimized graph is stored at: %s' % self.graph_path) else: raise FileNotFoundError('graph optimization fails and returns empty result') self.is_ready = threading.Event()
Example #4
Source File: test_version.py From pySINDy with MIT License | 5 votes |
def test_pyzmq_version(self): vs = zmq.pyzmq_version() vs2 = zmq.__version__ self.assertTrue(isinstance(vs, str)) if zmq.__revision__: self.assertEqual(vs, '@'.join(vs2, zmq.__revision__)) else: self.assertEqual(vs, vs2) if version.VERSION_EXTRA: self.assertTrue(version.VERSION_EXTRA in vs) self.assertTrue(version.VERSION_EXTRA in vs2)