Add command with the specified priority

		:param command_obj: command to add
		:param priority: command priority
		:return: None
494734
def add_prioritized(self, command_obj, priority):
		
		if priority not in self.__priorities.keys():
			self.__priorities[priority] = []

		self.__priorities[priority].append(command_obj)
1310089
def _queue_command(command, callback=nil)

      # If the current thread is the EM thread, execute the command.  Else put it in the queue
      if self.thread == Thread.current
        self._execute_command(command)
      else
        self.cmd_queue.push(command)
      end

      # If the callback is defined, block until it finishes
      if callback
        callback_args = command.queue.pop
        callback.call(callback_args.result, callback_args.error, callback_args.details)
      end
    end
1223392
def _add(self, name, *args, **kwargs):
        ''''''

        self.commands.append(Command(name, args, kwargs))
645675
def _add_cli_param(params, key, value):
    '''
    
    '''
    if value is not None:
        params.append('--{0}={1}'.format(key, value))
664125
def expand_and_merge_variables(objs, priority_arg=None):
    
    expanded = expand_variable_dicts(objs)
    priority_vars = _get_priority_vars(objs, priority_arg)
    variables = merge_variables(expanded, priority_vars)
    return variables
1002074
def command(self, name=None):
        
        def decorator(f):
            self.add_command(f, name)
            return f
        return decorator
424027
def add_task(self, command, name=None, **kwargs):
        

        logger.debug('Adding task with command {0} to job {1}'.format(command, self.name))
        if not self.state.allow_change_graph:
            raise DagobahError("job's graph is immutable in its current state: %s"
                               % self.state.status)

        if name is None:
            name = command
        new_task = Task(self, command, name, **kwargs)
        self.tasks[name] = new_task
        self.add_node(name)
        self.commit()
289266
def add_subcommands(parser, commands):
    ""
    subps = parser.add_subparsers()
    for cmd, cls in commands:
        subp = subps.add_parser(cmd, help=cls.__doc__)
        add_args = getattr(cls, 'add_arguments', None)
        if add_args:
            add_args(subp)
        handler = getattr(cls, 'handle', None)
        if handler:
            subp.set_defaults(handler=handler)
645575
def add_command(self, command, function, description=None):
        

        self.registered[command] = {
            'function': function, 'description': description
        }
1333636
def execute_add(args, root_dir=None):
    

    # We accept a list of strings.
    # This is done to create a better commandline experience with argparse.
    command = ' '.join(args['command'])

    # Send new instruction to daemon
    instruction = {
        'command': command,
        'path': os.getcwd()
    }
    print_command_factory('add')(instruction, root_dir)
117173
def command(state, args):
    """"""
    args = parser.parse_args(args[1:])
    row_id = query.files.add_priority_rule(state.db, args.regexp, args.priority)
    del state.file_picker
    print('Added rule {}'.format(row_id))
154628
def __priority(self, pr, repo, pkg):
        
        if (pr[0] == repo and pr[1].startswith("*") and
                pr[1].endswith("*")):
            if pr[1][1:-1] in pkg:
                self.black.append(self.__add(repo, pkg))
        elif pr[0] == repo and pr[1].endswith("*"):
            if pkg.startswith(pr[1][:-1]):
                self.black.append(self.__add(repo, pkg))
        elif pr[0] == repo and pr[1].startswith("*"):
            if pkg.endswith(pr[1][1:]):
                self.black.append(self.__add(repo, pkg))
        elif pr[0] == repo and "*" not in pr[1]:
            self.black.append(self.__add(repo, pkg))
186482
function add(err, req, res) {
  if(err) {
    // TODO: send args length errors

    // transaction errors are not queued
    // but the transaction is left open for more
    // command to be queued
    if(err instanceof TransactionError) {
      return res.send(err);
    }
    // last error
    this.error = err;
  }

  this.queue.push({err: err, req: req, res: res});
  res.send(null, QUEUED);
}
152876
public boolean add(E key, double priority) {
//    System.err.println("Adding " + key + " with priority " + priority);
    if (add(key)) {
      relaxPriority(key, priority);
      return true;
    }
    return false;
  }
1137686
def add(self, *args, **kwargs):
        
        return self._apply(operator.add, *args, **kwargs)
1228418
def add_command(subparsers):
  """"""

  parser = subparsers.add_parser('create', help=create.__doc__)

  parser.add_argument('-R', '--recreate', action='store_true', help="If set, I'll first erase the current database")
  parser.add_argument('-v', '--verbose', action='count', help="Do SQL operations in a verbose way?")
  parser.add_argument('-D', '--imagedir', metavar='DIR', default='/home/bob/BTAS_Keystroke_files_SingleFile', help="Change the relative path to the directory containing the images of the ATVS Keystroke database.")

  parser.set_defaults(func=create)
714676
def add_item(self, item, priority):
        
        conn = self._conn()
        self._run_expiration(conn)
        script = conn.register_script("""
        if (redis.call("hexists", KEYS[2], ARGV[1]) ~= 0) and
           not(redis.call("zscore", KEYS[1], ARGV[1]))
        then
            return -1
        end
        redis.call("zadd", KEYS[1], ARGV[2], ARGV[1])
        redis.call("hset", KEYS[2], ARGV[1], ARGV[2])
        return 0
        """)
        result = script(keys=[self._key_available(), self._key_priorities()],
                        args=[item, priority])
        if result == -1:
            raise ItemInUseError(item)
        return