Get a dictionary mapping worker ID to worker information.
184810
def workers(self):
        """"""
        worker_keys = self.redis_client.keys("Worker*")
        workers_data = {}

        for worker_key in worker_keys:
            worker_info = self.redis_client.hgetall(worker_key)
            worker_id = binary_to_hex(worker_key[len("Workers:"):])

            workers_data[worker_id] = {
                "node_ip_address": decode(worker_info[b"node_ip_address"]),
                "plasma_store_socket": decode(
                    worker_info[b"plasma_store_socket"])
            }
            if b"stderr_file" in worker_info:
                workers_data[worker_id]["stderr_file"] = decode(
                    worker_info[b"stderr_file"])
            if b"stdout_file" in worker_info:
                workers_data[worker_id]["stdout_file"] = decode(
                    worker_info[b"stdout_file"])
        return workers_data
468645
def getWorkerQte(hosts):
    """"""
    if "SLURM_NTASKS" in os.environ:
        return int(os.environ["SLURM_NTASKS"])
    elif "PBS_NP" in os.environ:
        return int(os.environ["PBS_NP"])
    elif "NSLOTS" in os.environ:
        return int(os.environ["NSLOTS"])
    else:
        return sum(host[1] for host in hosts)
568478
def get_changeset_work_items(self, id=None):
        
        route_values = {}
        if id is not None:
            route_values['id'] = self._serialize.url('id', id, 'int')
        response = self._send(http_method='GET',
                              location_id='64ae0bea-1d71-47c9-a9e5-fe73f5ea0ff4',
                              version='5.0',
                              route_values=route_values)
        return self._deserialize('[AssociatedWorkItem]', self._unwrap_collection(response))
1130493
function getWorkerData(worker) {
  /* istanbul ignore if */
  if (!worker) {
    throw new TypeError("Trying to get private data for null worker?!");
  }

  var data = worker[clusterphone.workerDataAccessor];
  if (!data) {
    worker[clusterphone.workerDataAccessor] = data = {};
  }

  return data;
}
512161
def getWorkersName(data):
    """"""
    names = [fichier for fichier in data.keys()]
    names.sort()
    try:
        names.remove("broker")
    except ValueError:
        pass
    return names
76939
def individual_dict(self, ind_ids):
        """"""
        ind_dict = {ind.ind_id: ind for ind in self.individuals(ind_ids=ind_ids)}
        return ind_dict
1275637
function getByPID(pid) {
  var workers = get();
  var i;
  var worker;

  for (i = 0; i < workers.length; i++) {
    worker = workers[i];
    if (worker.pid === pid) {
      return worker;
    }
  }
  // else return undefined
}
642248
function _getWorkerData(code, lang) {
    let options = {};
    if (typeof lang === 'object') {
        options = lang;
        lang = options.language;
    }

    lang = aliases[lang] || lang;

    const workerData = {
        id: id++,
        code,
        lang,
        options: _getPrismOptions(options),
        isNode
    };

    return workerData;
}
11606
def get_ids(self):
        """"""
        response = api.request_networks(self)
        all_networks = []
        network_dict = {}
        for network, status in self.networks.items():
            if status['onboarded']:
                all_networks.append('{}'.format(network))
                network_dict[status['name']] = network

        # For the first onboarded network we find, grab the account id
        for resp in response['networks']:
            if str(resp['id']) in all_networks:
                self.account_id = resp['account_id']
                break

        self.network_ids = all_networks
        return network_dict
300276
def to_dict(self):
        """"""
        import copy

        options = copy.deepcopy(self._options)

        if self._insert_tasks:
            options['insert_tasks'] = reference_to_path(self._insert_tasks)

        if self._persistence_engine:
            options['persistence_engine'] = reference_to_path(
                self._persistence_engine)

        options.update({
            '_tasks_inserted': self._tasks_inserted,
        })

        callbacks = self._options.get('callbacks')
        if callbacks:
            options['callbacks'] = encode_callbacks(callbacks)

        return options
1037883
def get(self):
        
        return WorkerStatisticsContext(
            self._version,
            workspace_sid=self._solution['workspace_sid'],
            worker_sid=self._solution['worker_sid'],
        )
1322462
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'classifier_id') and self.classifier_id is not None:
            _dict['classifier_id'] = self.classifier_id
        if hasattr(self, 'url') and self.url is not None:
            _dict['url'] = self.url
        if hasattr(self, 'collection') and self.collection is not None:
            _dict['collection'] = [x._to_dict() for x in self.collection]
        return _dict
961951
def row_dict(self, row):
        """"""
        d = {}
        for field_name,index in self.field_map.items():
            d[field_name] = self.field_value(row, field_name)
        return d
616705
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'name') and self.name is not None:
            _dict['name'] = self.name
        if hasattr(self, 'description') and self.description is not None:
            _dict['description'] = self.description
        if hasattr(self, 'language') and self.language is not None:
            _dict['language'] = self.language
        if hasattr(self, 'metadata') and self.metadata is not None:
            _dict['metadata'] = self.metadata
        if hasattr(self,
                   'learning_opt_out') and self.learning_opt_out is not None:
            _dict['learning_opt_out'] = self.learning_opt_out
        if hasattr(self,
                   'system_settings') and self.system_settings is not None:
            _dict['system_settings'] = self.system_settings._to_dict()
        if hasattr(self, 'workspace_id') and self.workspace_id is not None:
            _dict['workspace_id'] = self.workspace_id
        if hasattr(self, 'status') and self.status is not None:
            _dict['status'] = self.status
        if hasattr(self, 'created') and self.created is not None:
            _dict['created'] = datetime_to_string(self.created)
        if hasattr(self, 'updated') and self.updated is not None:
            _dict['updated'] = datetime_to_string(self.updated)
        if hasattr(self, 'intents') and self.intents is not None:
            _dict['intents'] = [x._to_dict() for x in self.intents]
        if hasattr(self, 'entities') and self.entities is not None:
            _dict['entities'] = [x._to_dict() for x in self.entities]
        if hasattr(self, 'dialog_nodes') and self.dialog_nodes is not None:
            _dict['dialog_nodes'] = [x._to_dict() for x in self.dialog_nodes]
        if hasattr(self,
                   'counterexamples') and self.counterexamples is not None:
            _dict['counterexamples'] = [
                x._to_dict() for x in self.counterexamples
            ]
        return _dict
81059
def get_work_spec(self, work_spec_name):
        ''''''
        with self.registry.lock(identifier=self.worker_id) as session:
            return session.get(WORK_SPECS, work_spec_name)
508409
def _wf_to_dict(wf):
    
    inputs, outputs = _get_wf_inout(wf)
    out = {"name": _id_to_name(wf.tool["id"]).replace("-", "_"), "inputs": inputs,
           "outputs": outputs, "steps": [], "subworkflows": [],
           "requirements": []}
    for step in wf.steps:
        inputs, outputs = _get_step_inout(step)
        inputs, scatter = _organize_step_scatter(step, inputs)
        if isinstance(step.embedded_tool, cwltool.workflow.Workflow):
            wf_def = _wf_to_dict(step.embedded_tool)
            out["subworkflows"].append({"id": wf_def["name"], "definition": wf_def,
                                        "inputs": inputs, "outputs": outputs, "scatter": scatter})
        else:
            task_def = _tool_to_dict(step.embedded_tool)
            out["steps"].append({"task_id": task_def["name"], "task_definition": task_def,
                                 "inputs": inputs, "outputs": outputs, "scatter": scatter})
    return out
1115835
def workers_status(self):
    """"""
    return [self._workers_status[identifier]
            for identifier in sorted(self._workers_status.keys())]