List tasks running in the background.

        Usage:
            running_tasks
        Arguments:
2897
def do_running_tasks(self, arg):
        
        for task in asyncio.Task.all_tasks(loop=self.loop):
            _LOGGING.info(task)
781592
def tasks():
    ''''''
    tasks = get_tasks()
    longest = max(tasks.keys(), key=len)
    size = len(longest)
    for name, queue in sorted(tasks.items()):
        print('* {0}: {1}'.format(name.ljust(size), queue))
1201982
async def run_task(self) -> None:
        ''''''

        self.last_run = 0.0
        self.target = self.time() + self.DELAY

        while self.running:
            try:
                now = self.time()

                if now < self.target:
                    sleep = self.target - now
                    await self.sleep(sleep)

                elif self.last_run < self.target:
                    Log.debug('executing timer task %s', self.name)
                    self.last_run = self.time()
                    await self.run()
                    total = self.time() - self.last_run
                    Log.debug('finished timer task %s in %.1f seconds',
                              self.name, total)

                else:
                    sleep = min(5.0, self.DELAY)
                    await self.sleep(sleep)

            except CancelledError:
                Log.debug('cancelled timer task %s', self.name)
                raise

            except Exception:
                Log.exception('exception in timer task %s', self.name)
887596
def tasks(self):
        
        if self._tasks is None:
            self._tasks = TaskList(self._version, assistant_sid=self._solution['sid'], )
        return self._tasks
1181616
def get_tasks():
    """"""
    from paver.tasks import environment
    for tsk in environment.get_tasks():
        print(tsk.shortname)
1364535
def running(self, offset=0, count=25):
        ''''''
        return self.client('jobs', 'running', self.name, offset, count)
199045
def tasks(self):
        
        if not self.__tasks:
            self.__tasks = Tasks(self.__connection)
        return self.__tasks
1158245
def chain_tasks(tasks):
    
    # If given tasks list is not empty
    if tasks:
        # Previous task
        previous_task = None

        # For given tasks list's each task
        for task in tasks:
            # If the task is not None.
            # Task can be None to allow code like ``task if _PY2 else None``.
            if task is not None:
                # If previous task is not None
                if previous_task is not None:
                    # Set the task to run after the previous task
                    task.set_run_after(previous_task)

                # Set the task as previous task for the next task
                previous_task = task

    # Return given tasks list.
    return tasks
1019221
def tasks(self, task_cls=None):
		
		result = []
		for tasks in self.__registry.values():
			result.extend(tasks)

		if task_cls is not None:
			result = filter(lambda x: issubclass(x, task_cls), result)
		return tuple(result)
375525
def list_tasks
      load_tasks

      # set '$thor_runner' to true to display full namespace
      $thor_runner = true

      list = [] #Thor.printable_tasks(all = true, subcommand = true)
      Thor::Base.subclasses.each do |klass|
        list += klass.printable_tasks(false) unless klass == Thor
      end
      list.sort!{ |a,b| a[0] <=> b[0] }

      title = "repo_manager tasks"
      shell.say shell.set_color(title, :blue, bold=true)
      shell.say "-" * title.size
      shell.print_table(list, :ident => 2, :truncate => true)
    end
1193707
public synchronized List<TaskStatus> getNonRunningTasks() {
    List<TaskStatus> result = new ArrayList<TaskStatus>(tasks.size());
    for(Map.Entry<TaskAttemptID, TaskInProgress> task: tasks.entrySet()) {
      if (!runningTasks.containsKey(task.getKey())) {
        result.add(task.getValue().getStatus());
      }
    }
    return result;
  }
334298
def run_task_json(task_cls, task_data):
    
    # TODO what does set_skipping_json do?
    task = instantiate(task_cls)
    task_callable = get_callable(task)
    td = TaskData(task_data)
    td.set_skipping_json(True)
    return task_callable(td)
418699
async def run_task(self) -> None:
        ''''''

        while self.running:
            try:
                item = self.QUEUE.get_nowait()

                Log.debug('%s processing work item', self.name)
                await self.run(item)

                Log.debug('%s completed work item', self.name)
                self.QUEUE.task_done()

            except asyncio.QueueEmpty:
                if self.OPEN:
                    await self.sleep(0.05)

                else:
                    Log.debug('%s queue closed and empty, stopping', self.name)
                    return

            except CancelledError:
                Log.debug('%s cancelled, dropping work item')
                self.QUEUE.task_done()
                raise

            except Exception:
                Log.exception('%s failed work item', self.name)
                self.QUEUE.task_done()
1026804
private void listTrackers() throws IOException {
    ClusterStatus fullStatus = jobSubmitClient.getClusterStatus(true);
    Collection<TaskTrackerStatus> trackers =
            fullStatus.getTaskTrackersDetails();
    Set<String> activeTrackers =
            new HashSet<String>(fullStatus.getActiveTrackerNames());
    List<Float> mapsProgress = new ArrayList<Float>();
    List<Float> reducesProgress = new ArrayList<Float>();
    int finishedMapsFromRunningJobs = 0;
    int finishedReducesFromRunningJobs = 0;

    System.out.println("Total Map Tasks in Running Jobs: " +
            fullStatus.getTotalMapTasks());
    System.out.println("Total Reduce Tasks in Running Jobs: " +
            fullStatus.getTotalReduceTasks());

    for (TaskTrackerStatus tracker : trackers) {
      System.out.println(tracker.getTrackerName());


      //List<TaskStatus> tasks = tracker.getTaskReports();
      Collection<TaskStatus> tasks =
              fullStatus.getTaskTrackerTasksStatuses(tracker.getTrackerName());
      for (TaskStatus task : tasks) {
        TaskStatus.State state = task.getRunState();
        if (task.getIsMap() &&
                (state == TaskStatus.State.RUNNING ||
                state == TaskStatus.State.UNASSIGNED)) {
          mapsProgress.add(task.getProgress());
        } else if (!task.getIsMap() &&
                (state == TaskStatus.State.RUNNING ||
                state == TaskStatus.State.UNASSIGNED)) {
          reducesProgress.add(task.getProgress());
        } else if (task.getIsMap() && state == TaskStatus.State.SUCCEEDED) {
          finishedMapsFromRunningJobs++;
        } else if (!task.getIsMap() && state == TaskStatus.State.SUCCEEDED) {
          finishedReducesFromRunningJobs++;
        }
      }

      if (activeTrackers.contains(tracker.getTrackerName())) {
        System.out.println("\tActive");
      } else {
        System.out.println("\tBlacklisted");
      }
      System.out.println("\tLast Seen: " + tracker.getLastSeen());

      System.out.println("\tMap Tasks Running: " + tracker.countMapTasks() +
              "/" + tracker.getMaxMapSlots());
      System.out.println("\tMap Tasks Progress: " + mapsProgress.toString());
      System.out.println("\tFinished Map Tasks From Running Jobs: " +
              finishedMapsFromRunningJobs);
      System.out.println("\tReduce Tasks Running: " +
              tracker.countReduceTasks() + "/" + tracker.getMaxReduceSlots());
      System.out.println("\tReduce Tasks Progress: " +
              reducesProgress.toString());

      System.out.println("\tTask Tracker Failures: " + tracker.getFailures());
      mapsProgress.clear();
      reducesProgress.clear();
    }
  }
421959
def run(self):
        '''
        '''
        if self.verbose:
            pbar = tqdm(total=100)
        while True:
            task_remain = self._task_queue.qsize()
            task_finished = int((float(self.total_task - task_remain) /
                                 float(self.total_task)) * 100)
            if task_finished % 20 == 0 and task_finished != self.current_state:
                self.current_state = task_finished
                logger.info('{0}% done'.format(task_finished))
                if self.verbose and task_finished > 0:
                    pbar.update(20)
            if task_remain == 0:
                break
        logger.debug('All task data cleared')
1327510
def execute_tasks(self):
        
        for t in self.tasks:
            print('RUNNING ' + str(t.task_id) + ' = ' + t.name)
            t.execute()
            if t.success != '__IGNORE__RESULT__':
                print(t)
                print('TASK RESULT :', t.result, ' but success = ' , t.success )
                if t.result != t.success:
                    #raise Exception('Project execution failed at task ' + str(t.task_id) + ' = ' + t.name)
                    print('ABORTING TASK EXECUTION SEQUENCE'  + str(t.task_id) + ' = ' + t.name)
                    break
1301892
def resource_list(self):
        
        self.prune()
        resources = [
            dict(
                name=resource,
                num_total=r_dict['total'],
                num_used=r_dict['used']
            ) for resource, r_dict in six.iteritems(self.resources())]
        if self._resources is not None:
            consumers = collections.defaultdict(dict)
            for task in self._state.get_active_tasks_by_status(RUNNING):
                if task.status == RUNNING and task.resources:
                    for resource, amount in six.iteritems(task.resources):
                        consumers[resource][task.id] = self._serialize_task(task.id, include_deps=False)
            for resource in resources:
                tasks = consumers[resource['name']]
                resource['num_consumer'] = len(tasks)
                resource['running'] = tasks
        return resources