Get the correct set of batch jobs arguments.
164901
def get_native_default_args():
    
    native_default_args = dict(max_jobs=500,
                               time_per_cycle=15,
                               jobs_per_cycle=20,
                               max_job_age=90,
                               no_batch=False)
    return native_default_args.copy()
299871
def get_args(self, kwargs):
        """"""
        args = dict(self.LoggerArgs)
        args.update(kwargs)
        return args
1125480
def get_plugins(self, shell_params, job_params):
        
        shell = self.get_shell_plugin(shell_params)
        job_interface = self.get_job_interface(job_params)
        return shell, job_interface
364153
def get_batch(self):
    
    params = [self._batch_size, self._num_objects, self._num_features]
    inputs, labels = tf.py_func(self._get_batch_data, params,
                                [tf.float32, tf.float32])
    inputs = tf.reshape(inputs, [self._batch_size, self._num_objects,
                                 self._num_features + self._num_objects * 3])
    labels = tf.reshape(labels, [-1])
    return inputs, labels
690252
def _dispatch(self, input_batch: List[SingleQuery]):
        """"""
        method = getattr(self, self.serve_method)
        if hasattr(method, "ray_serve_batched_input"):
            batch = [inp.data for inp in input_batch]
            result = _execute_and_seal_error(method, batch, self.serve_method)
            for res, inp in zip(result, input_batch):
                ray.worker.global_worker.put_object(inp.result_object_id, res)
        else:
            for inp in input_batch:
                result = _execute_and_seal_error(method, inp.data,
                                                 self.serve_method)
                ray.worker.global_worker.put_object(inp.result_object_id,
                                                    result)
399946
def compile_jobgroups_from_joblist(joblist, jgprefix, sgegroupsize):
    """"""
    jobcmds = defaultdict(list)
    for job in joblist:
        jobcmds[job.command.split(' ', 1)[0]].append(job.command)
    jobgroups = []
    for cmds in list(jobcmds.items()):
        # Break arglist up into batches of sgegroupsize (default: 10,000)
        sublists = split_seq(cmds[1], sgegroupsize)
        count = 0
        for sublist in sublists:
            count += 1
            sge_jobcmdlist = ['\"%s\"' % jc for jc in sublist]
            jobgroups.append(JobGroup("%s_%d" % (jgprefix, count),
                                      "$cmds",
                                      arguments={'cmds': sge_jobcmdlist}))
    return jobgroups
1140233
def make_batches(paths: Sequence[Path], batch_size: int) -> List[Sequence[Path]]:
    

    return [paths[i:i+batch_size]
            for i in range(0, len(paths), batch_size)]
827640
def get_args(self):
        
        return [
            self.task_cls.__module__,
            self.task_cls.__name__,
            self.encode_list(self.task_params),
            self.encode_list(self.branches),
            self.encode_bool(self.auto_retry),
            self.encode_list(self.dashboard_data),
        ]
1077451
def queue_jobs(main_task_path, params_list, queue=None, batch_size=1000):
    
    if len(params_list) == 0:
        return []
    if queue is None:
        task_def = context.get_current_config().get("tasks", {}).get(main_task_path) or {}
        queue = task_def.get("queue", "default")

    from .queue import Queue
    queue_obj = Queue(queue)

    if queue_obj.is_raw:
        raise Exception("Can't queue regular jobs on a raw queue")

    all_ids = []

    for params_group in group_iter(params_list, n=batch_size):

        context.metric("jobs.status.queued", len(params_group))

        # Insert the job in MongoDB
        job_ids = Job.insert([{
            "path": main_task_path,
            "params": params,
            "queue": queue,
            "datequeued": datetime.datetime.utcnow(),
            "status": "queued"
        } for params in params_group], w=1, return_jobs=False)

        all_ids += job_ids

    queue_obj.notify(len(all_ids))
    set_queues_size({queue: len(all_ids)})

    return all_ids
593029
def build_batch(cls, size, **kwargs):
        
        return [cls.build(**kwargs) for _ in range(size)]
718250
def _get_batch_representative(items, key):
    
    if isinstance(items, dict):
        return items, items
    else:
        vals = set([])
        out = []
        for data in items:
            if key in data:
                vals.add(data[key])
                out.append(data)
        if len(vals) != 1:
            raise ValueError("Incorrect values for %s: %s" % (key, list(vals)))
        return out[0], items
1054250
def get_arguments(self):
        """"""
        num_args = conf.lib.clang_Cursor_getNumArguments(self)
        for i in xrange(0, num_args):
            yield conf.lib.clang_Cursor_getArgument(self, i)
1262873
def stub_batch(cls, size, **kwargs):
        
        return [cls.stub(**kwargs) for _ in range(size)]
946863
def batch_arguments(arguments)
      batch = Batch.new do |x|
        arguments.each do |argument|
          # step: is the argument a subcommand?
          if subcommand?(argument)
            parser = subcommand(argument)
            # step: get the command and set the cursor to the parser
            x.cursor = parser.name
            # step: call the on_command block
            parser.on_command.call
          else
            # step: is this argument a parser argument
            parser = subcommand(x.cursor)
            if !is_switch?(argument)
              if x.previous
                x.global(argument)
              else
                x.add argument
              end
            elsif !parser.switch?(argument) and global_parser.switch?(argument)
              x.global(argument)
              x.previous = x.cursor
            else
              x.add argument
            end
          end
        end
      end
      yield batch if block_given?
      batch
    end
478303
def getTaskHelp(_Task):
  
  """
  Ret = []

  for k in ['name', 'desc']:
    v = _Task.Config.get(k)

    if v is not None:
      Ret.append('%s: %s' % (k, v))

  Args = _Task.Args

  if Args:
    Ret.append('\nArgs:')

    for argName, Arg in Args.items():
      Ret.append('  %s: %s' % (argName, Arg.get('desc', Arg['type_str'])))

    Ret.append('')

  return '\n'.join(Ret).rstrip()
1220026
def get_batch(self):
        
        context = self.context
        parent = api.get_parent(context)
        if context.portal_type == "Batch":
            return context
        elif parent.portal_type == "Batch":
            return parent
        return None
1181845
def job_to_dict(job):
    """"""

    data = OrderedDict()
    data['id'] = job.id
    data['name'] = job.name
    data['func'] = job.func_ref
    data['args'] = job.args
    data['kwargs'] = job.kwargs

    data.update(trigger_to_dict(job.trigger))

    if not job.pending:
        data['misfire_grace_time'] = job.misfire_grace_time
        data['max_instances'] = job.max_instances
        data['next_run_time'] = None if job.next_run_time is None else job.next_run_time

    return data