set the default org for tasks by name key
179741
def set_default_org(self, name):
        
        org = self.get_org(name)
        self.unset_default_org()
        org.config["default"] = True
        self.set_org(org)
690846
def unset_default_org(self):
        
        for org in self.list_orgs():
            org_config = self.get_org(org)
            if org_config.default:
                del org_config.config["default"]
                self.set_org(org_config)
487267
def put_info(self, key, value):
        
        return self.instance.put_task_info(self.name, key, value)
57929
function moduleTask(taskname, depsOrFn, fn, noAutoRegister) {

    var module = this;

    if (typeof(depsOrFn) == 'string') {
      depsOrFn = [depsOrFn];
    }

    if (Array.isArray(depsOrFn)) {

      var map = [];

      depsOrFn.forEach(function (dep) {
        map.push(module.name + '-' + dep);
      });

      depsOrFn = map;

    }

    var fulltaskname = module.name + '-' + taskname;
    gulp.task(fulltaskname, depsOrFn, fn);

    if(!noAutoRegister) {
      module.tasks.push(fulltaskname);
    }

  }
1309800
function(tasksConfig) {
  _setupVersioningTasks();
  _setupLazyPluginLoadingTasks();
  _setupCssTasks();
  _setupTemplatesTasks();
  _setupTestsTasks(tasksConfig);
  _setupScriptsTasks(tasksConfig);
  _setupUtilsTasks();
}
181533
def _managePsets(configobj, section_name, task_name, iparsobj=None, input_dict=None):
    
    # Merge all configobj instances into a single object
    configobj[section_name] = {}

    # Load the default full set of configuration parameters for the PSET:
    iparsobj_cfg = teal.load(task_name)

    # Identify optional parameters in input_dicts that are from this
    # PSET and add it to iparsobj:
    if input_dict is not None:
        for key in list(input_dict.keys()):
            if key in iparsobj_cfg:
                if iparsobj is not None and key in iparsobj:
                    raise DuplicateKeyError("Duplicate parameter '{:s}' "
                        "provided for task {:s}".format(key, task_name))
                iparsobj_cfg[key] = input_dict[key]
                del input_dict[key]

    if iparsobj is not None:
        iparsobj_cfg.update(iparsobj)

    del iparsobj_cfg['_task_name_']

    # merge these parameters into full set
    configobj[section_name].merge(iparsobj_cfg)
1236819
def get_task(self, name):
        """"""
        if name in self.tasks.keys():
            task = self.tasks[name]
        else:
            task = Task(name)
            self.tasks[name] = task
        return task
333299
function inject (taskKey) {
    var taskName = task[taskKey]

    if (regexQuoted.test(taskName)) {
      funcs[taskName] = function () {
        return taskName.substr(1, taskName.length - 2)
      }
    }
  }
489534
def set_backend(backend_name: str):
  """"""
  global _backend, _backend_name
  _backend_name = backend_name

  assert not ncluster_globals.task_launched, "Not allowed to change backend after launching a task (this pattern is error-prone)"
  if backend_name == 'aws':
    _backend = aws_backend
  elif backend_name == 'local':
    _backend = local_backend
  else:
    assert False, f"Unknown backend {backend_name}"
  ncluster_globals.LOGDIR_ROOT = _backend.LOGDIR_ROOT
252053
def setdefault (self, key, def_val=None):
        """"""
        if key in self:
            return self[key]
        self[key] = def_val
        return def_val
552906
public function setUpDispatcherDefaults()
    {
        // Set the defaults for the dispatcher
        $this->dispatcher->setDefaultTask('Danzabar\CLI\Tasks\Utility\Help');
        $this->dispatcher->setDefaultAction('main');

        // Set no suffixes
        $this->dispatcher->setTaskSuffix('');
        $this->dispatcher->setActionSuffix('');
    }
393375
def _set_default_namespace(self, default_namespace):
        """"""
        if default_namespace is not None:
            default_namespace = default_namespace.strip('/')
        else:
            default_namespace = DEFAULT_NAMESPACE
        self._default_namespace = _ensure_unicode(default_namespace)
1085509
def execute(self, env, args):
        

        task_name = args.task_name

        if not env.task.exists(task_name):
            raise errors.TaskNotFound(task_name)

        if env.task.active and task_name == env.task.name:
            raise errors.ActiveTask

        # open in task config in editor
        task_config = env.task.get_config_path(task_name)

        if not _edit_task_config(env, task_config, confirm=True):
            raise errors.FocusError(u'Could not open task config: {0}'
                                    .format(task_config))
859861
function setupByCopy() {
    let task_dir;
    let required_tasks;

    try {
        const config = require(path.join(process.cwd(), 'project.config'));
        required_tasks = config.required_tasks;
        if (!required_tasks) {
            throw Error('no task required.');
        }
        task_dir = config.dir.task;
        if (!task_dir) {
            throw Error('task directory not defined.');
        }
    } catch (error) {
        console.warn(error);
        process.exit(0);
    }

    const dstTaskDir = path.join(process.cwd(), task_dir);
    if (!fs.existsSync(dstTaskDir)) {
        // create tasks dir
        fs.mkdirSync(dstTaskDir);
    }

    required_tasks.forEach((task) => {
        const src = path.join(__dirname, 'tasks', task);
        const dst = path.join(dstTaskDir, task);
        if (fs.existsSync(src)) {
            if (fs.existsSync(dst)) {
                fs.unlinkSync(dst);
            }
            fs.writeFileSync(dst, fs.readFileSync(src).toString());
        } else {
            console.error('task not found: ' + task);
            process.exit(1);
        }
    });
}
837780
def set_task(self, command):
        
        self.tasks[command.task_id] = command.task

        self.longest_bar_prefix_size = self.longest_bar_prefix_value()

        # Redraw
        self.changes_made = True
        self.redraw()
920914
def get_task(self, name):
        
        config = getattr(self, "tasks__{}".format(name))
        if not config:
            raise TaskNotFoundError("Task not found: {}".format(name))
        return TaskConfig(config)
379940
def task(name, options = {}, &block)
      AvoDeploy::Deployment.instance.log.debug "registering task #{name}..."
      AvoDeploy::Deployment.instance.task_manager.add_task(name, options, &block)
    end