prompt
stringlengths
33
579
score
float32
-0.04
0.02
prediction
stringclasses
1 value
target
stringlengths
276
5.45k
chosen
stringlengths
47
3.71k
rejected
stringclasses
2 values
Multiprocessing target for the zmq queue device
-0.026145
def foo(): print("Hello, World!")
def zmq_device(self): ''' Multiprocessing target for the zmq queue device ''' self.__setup_signals() salt.utils.process.appendproctitle('MWorkerQueue') self.context = zmq.Context(self.opts['worker_threads']) # Prepare the zeromq sockets self.uri = 'tcp://{...
def zmq_device(self): ''' Multiprocessing target for the zmq queue device ''' self.__setup_signals() salt.utils.process.appendproctitle('MWorkerQueue') self.context = zmq.Context(self.opts['worker_threads']) # Prepare the zeromq sockets self.uri = 'tcp://{...
def foo(): print("Hello, World!")
Cleanly shutdown the router socket
-0.009191
def foo(): print("Hello, World!")
def close(self): ''' Cleanly shutdown the router socket ''' if self._closing: return log.info('MWorkerQueue under PID %s is closing', os.getpid()) self._closing = True # pylint: disable=E0203 if getattr(self, '_monitor', None) is not None: ...
def close(self): ''' Cleanly shutdown the router socket ''' if self._closing: return log.info('MWorkerQueue under PID %s is closing', os.getpid()) self._closing = True # pylint: disable=E0203 if getattr(self, '_monitor', None) is not None: ...
def foo(): print("Hello, World!")
Pre-fork we need to create the zmq router device :param func process_manager: An instance of salt.utils.process.ProcessManager
-0.005527
def foo(): print("Hello, World!")
def pre_fork(self, process_manager): ''' Pre-fork we need to create the zmq router device :param func process_manager: An instance of salt.utils.process.ProcessManager ''' salt.transport.mixins.auth.AESReqServerMixin.pre_fork(self, process_manager) process_manager.add_pr...
def pre_fork(self, process_manager): ''' Pre-fork we need to create the zmq router device :param func process_manager: An instance of salt.utils.process.ProcessManager ''' salt.transport.mixins.auth.AESReqServerMixin.pre_fork(self, process_manager) process_manager.add_pr...
def foo(): print("Hello, World!")
Starts ZMQ monitor for debugging purposes. :return:
-0.005127
def foo(): print("Hello, World!")
def _start_zmq_monitor(self): ''' Starts ZMQ monitor for debugging purposes. :return: ''' # Socket monitor shall be used the only for debug # purposes so using threading doesn't look too bad here if HAS_ZMQ_MONITOR and self.opts['zmq_monitor']: log.de...
def _start_zmq_monitor(self): ''' Starts ZMQ monitor for debugging purposes. :return: ''' # Socket monitor shall be used the only for debug # purposes so using threading doesn't look too bad here if HAS_ZMQ_MONITOR and self.opts['zmq_monitor']: log.de...
def foo(): print("Hello, World!")
After forking we need to create all of the local sockets to listen to the router :param func payload_handler: A function to called to handle incoming payloads as they are picked up off the wire :param IOLoop io_loop: An instance of a Tornado IOLoop, to handl...
-0.018929
def foo(): print("Hello, World!")
def post_fork(self, payload_handler, io_loop): ''' After forking we need to create all of the local sockets to listen to the router :param func payload_handler: A function to called to handle incoming payloads as they are picked up off the wire ...
def post_fork(self, payload_handler, io_loop): ''' After forking we need to create all of the local sockets to listen to the router :param func payload_handler: A function to called to handle incoming payloads as they are picked up off the wire ...
def foo(): print("Hello, World!")
Handle incoming messages from underlying TCP streams :stream ZMQStream stream: A ZeroMQ stream. See http://zeromq.github.io/pyzmq/api/generated/zmq.eventloop.zmqstream.html :param dict payload: A payload to process
-0.03018
def foo(): print("Hello, World!")
def handle_message(self, stream, payload): ''' Handle incoming messages from underlying TCP streams :stream ZMQStream stream: A ZeroMQ stream. See http://zeromq.github.io/pyzmq/api/generated/zmq.eventloop.zmqstream.html :param dict payload: A payload to process ''' ...
def handle_message(self, stream, payload): ''' Handle incoming messages from underlying TCP streams :stream ZMQStream stream: A ZeroMQ stream. See http://zeromq.github.io/pyzmq/api/generated/zmq.eventloop.zmqstream.html :param dict payload: A payload to process ''' ...
def foo(): print("Hello, World!")
Bind to the interface specified in the configuration file
0.022082
def foo(): print("Hello, World!")
def _publish_daemon(self, log_queue=None): ''' Bind to the interface specified in the configuration file ''' salt.utils.process.appendproctitle(self.__class__.__name__) if log_queue: salt.log.setup.set_multiprocessing_logging_queue(log_queue) salt.log.setu...
def foo(): print("Hello, World!")
def _publish_daemon(self, log_queue=None): ''' Bind to the interface specified in the configuration file ''' salt.utils.process.appendproctitle(self.__class__.__name__) if log_queue: salt.log.setup.set_multiprocessing_logging_queue(log_queue) salt.log.setu...
Create and connect this thread's zmq socket. If a publisher socket already exists "pub_close" is called before creating and connecting a new socket.
-0.0148
def foo(): print("Hello, World!")
def pub_connect(self): ''' Create and connect this thread's zmq socket. If a publisher socket already exists "pub_close" is called before creating and connecting a new socket. ''' if self.pub_sock: self.pub_close() ctx = zmq.Context.instance() ...
def pub_connect(self): ''' Create and connect this thread's zmq socket. If a publisher socket already exists "pub_close" is called before creating and connecting a new socket. ''' if self.pub_sock: self.pub_close() ctx = zmq.Context.instance() ...
def foo(): print("Hello, World!")
Disconnect an existing publisher socket and remove it from the local thread's cache.
-0.000948
def foo(): print("Hello, World!")
def pub_close(self): ''' Disconnect an existing publisher socket and remove it from the local thread's cache. ''' if hasattr(self._sock_data, 'sock'): self._sock_data.sock.close() delattr(self._sock_data, 'sock')
def pub_close(self): ''' Disconnect an existing publisher socket and remove it from the local thread's cache. ''' if hasattr(self._sock_data, 'sock'): self._sock_data.sock.close() delattr(self._sock_data, 'sock')
def foo(): print("Hello, World!")
Publish "load" to minions. This send the load to the publisher daemon process with does the actual sending to minions. :param dict load: A load to be sent across the wire to minions
-0.020769
def foo(): print("Hello, World!")
def publish(self, load): ''' Publish "load" to minions. This send the load to the publisher daemon process with does the actual sending to minions. :param dict load: A load to be sent across the wire to minions ''' payload = {'enc': 'aes'} crypticle = salt.crypt....
def publish(self, load): ''' Publish "load" to minions. This send the load to the publisher daemon process with does the actual sending to minions. :param dict load: A load to be sent across the wire to minions ''' payload = {'enc': 'aes'} crypticle = salt.crypt....
def foo(): print("Hello, World!")
Handle a message timeout by removing it from the sending queue and informing the caller :raises: SaltReqTimeoutError
-0.006787
def foo(): print("Hello, World!")
def timeout_message(self, message): ''' Handle a message timeout by removing it from the sending queue and informing the caller :raises: SaltReqTimeoutError ''' future = self.send_future_map.pop(message, None) # In a race condition the message might have been sen...
def timeout_message(self, message): ''' Handle a message timeout by removing it from the sending queue and informing the caller :raises: SaltReqTimeoutError ''' future = self.send_future_map.pop(message, None) # In a race condition the message might have been sen...
def foo(): print("Hello, World!")
Return a future which will be completed when the message has a response
-0.019009
def foo(): print("Hello, World!")
def send(self, message, timeout=None, tries=3, future=None, callback=None, raw=False): ''' Return a future which will be completed when the message has a response ''' if future is None: future = tornado.concurrent.Future() future.tries = tries future.a...
def send(self, message, timeout=None, tries=3, future=None, callback=None, raw=False): ''' Return a future which will be completed when the message has a response ''' if future is None: future = tornado.concurrent.Future() future.tries = tries future.a...
def foo(): print("Hello, World!")
Return the elasticsearch instance
-0.041109
def foo(): print("Hello, World!")
def _get_instance(hosts=None, profile=None): ''' Return the elasticsearch instance ''' es = None proxies = None use_ssl = False ca_certs = None verify_certs = True http_auth = None timeout = 10 if profile is None: profile = 'elasticsearch' if isinstance(profile,...
def _get_instance(hosts=None, profile=None): ''' Return the elasticsearch instance ''' es = None proxies = None use_ssl = False ca_certs = None verify_certs = True http_auth = None timeout = 10 if profile is None: profile = 'elasticsearch' if isinstance(profile,...
def foo(): print("Hello, World!")
.. versionadded:: 2017.7.0 Test connection to Elasticsearch instance. This method does not fail if not explicitly specified. allow_failure Throw exception if ping fails CLI example:: salt myminion elasticsearch.ping allow_failure=True salt myminion elasticsearch.ping profile=elas...
-0.00203
def foo(): print("Hello, World!")
def ping(allow_failure=False, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Test connection to Elasticsearch instance. This method does not fail if not explicitly specified. allow_failure Throw exception if ping fails CLI example:: salt myminion elasticsearch.ping all...
def ping(allow_failure=False, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Test connection to Elasticsearch instance. This method does not fail if not explicitly specified. allow_failure Throw exception if ping fails CLI example:: salt myminion elasticsearch.ping all...
def foo(): print("Hello, World!")
.. versionadded:: 2017.7.0 Return Elasticsearch information. CLI example:: salt myminion elasticsearch.info salt myminion elasticsearch.info profile=elasticsearch-extra
-0.002592
def foo(): print("Hello, World!")
def info(hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Return Elasticsearch information. CLI example:: salt myminion elasticsearch.info salt myminion elasticsearch.info profile=elasticsearch-extra ''' es = _get_instance(hosts, profile) try: return es.i...
def info(hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Return Elasticsearch information. CLI example:: salt myminion elasticsearch.info salt myminion elasticsearch.info profile=elasticsearch-extra ''' es = _get_instance(hosts, profile) try: return es.i...
def foo(): print("Hello, World!")
.. versionadded:: 2017.7.0 Return Elasticsearch node information. nodes List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all flat_settings Flatten settings keys CLI example:: salt myminion elasticsearch.node_info flat_settings=...
-0.001713
def foo(): print("Hello, World!")
def node_info(nodes=None, flat_settings=False, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Return Elasticsearch node information. nodes List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all flat_settings Flatten settings...
def node_info(nodes=None, flat_settings=False, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Return Elasticsearch node information. nodes List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all flat_settings Flatten settings...
def foo(): print("Hello, World!")
.. versionadded:: 2017.7.0 Return Elasticsearch cluster health. index Limit the information returned to a specific index level Specify the level of detail for returned information, default 'cluster', valid choices are: 'cluster', 'indices', 'shards' local Return local informati...
-0.001745
def foo(): print("Hello, World!")
def cluster_health(index=None, level='cluster', local=False, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Return Elasticsearch cluster health. index Limit the information returned to a specific index level Specify the level of detail for returned information, default '...
def cluster_health(index=None, level='cluster', local=False, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Return Elasticsearch cluster health. index Limit the information returned to a specific index level Specify the level of detail for returned information, default '...
def foo(): print("Hello, World!")
.. versionadded:: 2017.7.0 Return Elasticsearch cluster stats. nodes List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all CLI example:: salt myminion elasticsearch.cluster_stats
-0.0011
def foo(): print("Hello, World!")
def cluster_stats(nodes=None, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Return Elasticsearch cluster stats. nodes List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all CLI example:: salt myminion elasticsearch.cluste...
def cluster_stats(nodes=None, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Return Elasticsearch cluster stats. nodes List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all CLI example:: salt myminion elasticsearch.cluste...
def foo(): print("Hello, World!")
Create an alias for a specific index/indices indices Single or multiple indices separated by comma, use _all to perform the operation on all indices. alias Alias name body Optional definition such as routing or filter as defined in https://www.elastic.co/guide/en/elasticsearch/refer...
-0.022787
def foo(): print("Hello, World!")
def alias_create(indices, alias, hosts=None, body=None, profile=None, source=None): ''' Create an alias for a specific index/indices indices Single or multiple indices separated by comma, use _all to perform the operation on all indices. alias Alias name body Optional defini...
def alias_create(indices, alias, hosts=None, body=None, profile=None, source=None): ''' Create an alias for a specific index/indices indices Single or multiple indices separated by comma, use _all to perform the operation on all indices. alias Alias name body Optional defini...
def foo(): print("Hello, World!")
Delete an alias of an index indices Single or multiple indices separated by comma, use _all to perform the operation on all indices. aliases Alias names separated by comma CLI example:: salt myminion elasticsearch.alias_delete testindex_v1 testindex
-0.019315
def foo(): print("Hello, World!")
def alias_delete(indices, aliases, hosts=None, body=None, profile=None, source=None): ''' Delete an alias of an index indices Single or multiple indices separated by comma, use _all to perform the operation on all indices. aliases Alias names separated by comma CLI example:: ...
def alias_delete(indices, aliases, hosts=None, body=None, profile=None, source=None): ''' Delete an alias of an index indices Single or multiple indices separated by comma, use _all to perform the operation on all indices. aliases Alias names separated by comma CLI example:: ...
def foo(): print("Hello, World!")