Do everything needed when a task is starting

        Params:
            task_name (str): name of the task that is starting
            record (logging.LogRecord): log record with all the info

        Returns:
            None
351578
def handle_new_task(self, task_name, record):
        
        record.msg = ColorFormatter.colored('default', START_TASK_MSG)
        record.task = task_name

        self.tasks[task_name] = Task(name=task_name, maxlen=self.buffer_size)
        if self.should_show_by_depth():
            self.pretty_emit(record, is_header=True)
145522
def task_start(self, **kw):
        

        id, task = self.get_task(**kw)

        self._execute(id, 'start')
        return self.get_task(uuid=task['uuid'])[1]
477731
def current_task(self, args):
        
        ctask = self.nice_name if self.nice_name is not None else self.name
        if args is not None:
            if args.update:
                ctask = ctask.replace('%pre', 'Updating')
            else:
                ctask = ctask.replace('%pre', 'Loading')
        return ctask
403761
public void logTaskStarted(TaskID taskId, String taskType,
                             long startTime, String splitLocations) {
    if (disableHistory) {
      return;
    }

    JobID id = taskId.getJobID();
    if (!this.jobId.equals(id)) {
      throw new RuntimeException("JobId from task: " + id +
                                 " does not match expected: " + jobId);
    }

    if (null != writers) {
      log(writers, RecordTypes.Task,
          new Keys[]{Keys.TASKID, Keys.TASK_TYPE ,
                     Keys.START_TIME, Keys.SPLITS},
          new String[]{taskId.toString(), taskType,
                       String.valueOf(startTime),
                       splitLocations});
    }
  }
1062923
def _startRecording(self, filename):
        
        self.setOption('_log_file_name', filename)
        self.setOption('_log_input_only', True)
        self.setOption('_log', True)
795528
def get_tasks(self, thread_name):
        
        if thread_name not in self.tasks_by_thread:
            with self._tasks_lock:
                self.tasks_by_thread[thread_name] = OrderedDict()

        return self.tasks_by_thread[thread_name]
1196337
def load_task(module, task_name, params_str):
    
    if module is not None:
        __import__(module)
    task_cls = Register.get_task_cls(task_name)
    return task_cls.from_str_params(params_str)
252449
def start_logging(Name,
           region=None, key=None, keyid=None, profile=None):
    '''
    

    '''

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        conn.start_logging(Name=Name)
        return {'started': True}
    except ClientError as e:
        return {'started': False, 'error': __utils__['boto3.get_error'](e)}
171239
def start(self):
        
        logger.info('Starting task {0}'.format(self.name))
        self.reset()
        if self.hostname:
            host = self.parent_job.parent.get_host(self.hostname)
            if host:
                self.remote_ssh(host)
            else:
                self.remote_failure = True
        else:
            self.process = subprocess.Popen(self.command,
                                            shell=True,
                                            env=os.environ.copy(),
                                            stdout=self.stdout_file,
                                            stderr=self.stderr_file)

        self.started_at = datetime.utcnow()
        self._start_check_timer()
1315903
def task_list(self, pending=True):
        
        log = self._params.get('log', self._discard)
        tasks = [t for t in self._tasks if t.participant()]
        requires = {}
        for t in tasks:
            requires[t] = t.get_requires(pending=pending)
        done = set()
        start_order = []
        cycle = 0
        while len(tasks) > len(start_order):
            cycle += 1
            changed = False
            for t in tasks:
                if t._name in done:
                    continue
                needs = 0
                for req in requires[t]:
                    if req._name in done:
                        needs += 1
                if needs == len(requires[t]):
                    changed = True
                    start_order.append(t)
                    done.add(t._name)
                    log.debug("Found '%s' in scope", t._name)
            if not changed:
                log.error("Cycle %d failed after %s", cycle, [t._name for t in set(tasks).difference(done)])
                raise TaskError(None, "At cycle %d, startup order conflict, processed %s, remaining %s" %
                            (cycle, done, [t._name for t in set(tasks).difference(done)]))
        log.debug("Cycle %d gave %s", cycle, [t._name for t in start_order])
        return start_order
294902
def __thread_started(self):
		
		if self.__task is None:
			raise RuntimeError('Unable to start thread without "start" method call')
		self.__task.start()
		self.__task.start_event().wait(self.__scheduled_task_startup_timeout__)
12724
def delete_task(self, task=None):
        
        # Iterate over the list of tasks
        for t in self.grindstone['tasks']:
            # If they key of the task matches the task given
            if key_of(t) == task:
                # Remove that task
                self.grindstone['tasks'].remove(t)
                # Return True because something did happen
                return True
        # Return false because nothing happened
        return False
819862
def add_task_status(self, name, **attrs):
        
        return TaskStatuses(self.requester).create(self.id, name, **attrs)
1329889
def start_log_task(task, logger=logging, level='info'):
    
    getattr(logger, level)(START_TASK_TRIGGER_MSG % task)
727787
def get_task_detail(self, task_name):
        
        def _get_detail():
            from ..compat import json  # fix object_pairs_hook parameter for Py2.6

            params = {'instancedetail': '',
                      'taskname': task_name}

            resp = self._client.get(self.resource(), params=params)
            return json.loads(resp.text if six.PY3 else resp.content,
                              object_pairs_hook=OrderedDict)

        result = _get_detail()
        if not result:
            # todo: this is a workaround for the bug that get_task_detail returns nothing.
            self.get_task_detail2(task_name)
            return _get_detail()
        else:
            return result
669183
def WriteTaskStart(self):
    
    self._RaiseIfNotWritable()

    if self._storage_type != definitions.STORAGE_TYPE_TASK:
      raise IOError('Unsupported storage type.')

    task_start = self._task.CreateTaskStart()
    self._storage_file.WriteTaskStart(task_start)
910102
def task(self, name_or_class: Any) -> Task:
        ''''''

        if name_or_class in self.all_tasks:
            return self.all_tasks[name_or_class]

        try:
            return self.all_tasks.get(name_or_class.__class__.__name__, None)

        except AttributeError:
            return None