Returns a list of tasks that were changed recently.
543732
def get_tasks_changed_since(self, since):
        
        changed_tasks = []

        for task in self.client.filter_tasks({'status': 'pending'}):
            if task.get(
                'modified',
                task.get(
                    'entry',
                    datetime.datetime(2000, 1, 1).replace(tzinfo=pytz.utc)
                )
            ) >= since:
                changed_tasks.append(task)

        return changed_tasks
279748
def seen_tasks(self, request, context):
        """"""
        _log_request(request, context)
        result = clearly_pb2.SeenTasksMessage()
        result.task_types.extend(self.listener.memory.task_types())
        return result
606191
def changes(self):
        """"""
        deleted = []
        for path in list(self.files):
            isdir = path.endswith(os.sep)
            abspath = os.path.join(self.path, path)
            try:
                is_deleted = (
                    not os.path.exists(abspath) or  # actually deleted
                    os.path.isdir(abspath) != isdir  # changed from / to folder
                )
            except EnvironmentError:
                # file is basically inaccessible at this point so we're gonna
                # assume that it was deleted
                is_deleted = True

            if is_deleted:
                deleted.append(path)
                del self.files[path]

        changed = []
        for folder, subfolders, subfiles in os.walk(self.path):
            for path in subfolders:
                path = os.path.join(folder, path)
                path = os.path.normcase(os.path.relpath(path, self.path))
                path += os.sep
                if path not in self.files:
                    # don't really care about folder mtime
                    self.files[path] = 0
                    changed.append(path)

            for path in subfiles:
                actual_path = path = os.path.join(folder, path)
                path = os.path.normcase(os.path.relpath(path, self.path))
                try:
                    mtime = os.path.getmtime(actual_path)
                    if path not in self.files:
                        # new file; set its mtime to 0 because it will be
                        # compared in the next few lines
                        self.files[path] = 0

                    if mtime > self.files[path]:
                        # file has been changed since last check
                        self.files[path] = mtime
                        changed.append(path)
                except EnvironmentError:
                    # in 99% of the cases the file has been deleted while
                    # iterating the parent folder; if the file was previously
                    # being handled, then stop handling it; otherwise ignore
                    if path in self.files:
                        deleted.append(path)
                        del self.files[path]

        self.updated = False
        return changed, deleted
557470
def changes(self):
        
        try:
            return self.added, self.removed
        finally:
            self.added = list()
            self.removed = list()
912708
function filterFilesForUnchangedTasks(before, after, paths) {
  var pathsRes = [];
  var tasksRes = [];

  for (var i = 0; i < before.length; i++) {
    var unchangedTasks = filterUnchangedTasks(before[i], after[i]);
    if (unchangedTasks.length > 0) {
      tasksRes.push(unchangedTasks);
      pathsRes.push(paths[i]);
    }
  }

  return [tasksRes, pathsRes];
}
53571
def get_expired_tasks(self, key_prefix, time, batch_size, client=None):
        
        result = self._get_expired_tasks(args=[key_prefix, time, batch_size],
                                         client=client)

        # [queue1, task1, queue2, task2] -> [(queue1, task1), (queue2, task2)]
        return list(zip(result[::2], result[1::2]))
684964
synchronized List<TaskStatus> getRunningTaskStatuses() {
    List<TaskStatus> result = new ArrayList<TaskStatus>(runningTasks.size());
    for(TaskInProgress tip: runningTasks.values()) {
      result.add(tip.getStatus());
    }
    return result;
  }
1120983
def query_recent_edited(timstamp, kind='1'):
        '''
        
        '''
        return TabPost.select().where(
            (TabPost.kind == kind) &
            (TabPost.time_update > timstamp)
        ).order_by(
            TabPost.time_update.desc()
        )
1285774
def _tasks_to_reinsert(tasks, transactional):
    
    if transactional:
        return tasks

    return [task for task in tasks if not task.was_enqueued]
961411
public List<BuildChangeSet> getChangeSets() {
        List<BuildChangeSet> result;
        if (changeSets != null) {
            result = changeSets;
        } else if (changeSet != null) {
            result = Collections.singletonList(changeSet);
        } else {
            result = null;
	}
        return result;
    }
553129
def examine(self):
        """"""
        if self._changes:
            return self._changes.pop()

        # clean filepath
        self.filepath = None
        delays = set([0])
        for path in self._tasks:
            item = self._tasks[path]
            if self.is_changed(path, item['ignore']):
                func = item['func']
                func and func()
                delay = item['delay']
                if delay:
                    delays.add(delay)

        if 'forever' in delays:
            delay = 'forever'
        else:
            delay = max(delays)
        return self.filepath, delay
448862
def task_list(self, status='', upstream_status='', limit=True, search=None, max_shown_tasks=None,
                  **kwargs):
        
        if not search:
            count_limit = max_shown_tasks or self._config.max_shown_tasks
            pre_count = self._state.get_active_task_count_for_status(status)
            if limit and pre_count > count_limit:
                return {'num_tasks': -1 if upstream_status else pre_count}
        self.prune()

        result = {}
        upstream_status_table = {}  # used to memoize upstream status
        if search is None:
            def filter_func(_):
                return True
        else:
            terms = search.split()

            def filter_func(t):
                return all(term in t.pretty_id for term in terms)

        tasks = self._state.get_active_tasks_by_status(status) if status else self._state.get_active_tasks()
        for task in filter(filter_func, tasks):
            if task.status != PENDING or not upstream_status or upstream_status == self._upstream_status(task.id, upstream_status_table):
                serialized = self._serialize_task(task.id, include_deps=False)
                result[task.id] = serialized
        if limit and len(result) > (max_shown_tasks or self._config.max_shown_tasks):
            return {'num_tasks': len(result)}
        return result
1051924
def recentProgress(self):
        
        return [json.loads(p.json()) for p in self._jsq.recentProgress()]
888560
def compare_changes(obj, **kwargs):
    '''
    
    '''
    changes = {}
    for key, value in obj.items():
        if key in kwargs:
            if value != kwargs[key]:
                changes[key] = kwargs[key]
    return changes
761614
def tasks(self):
        ''''''
        tasks_response = self.get_request('tasks/')
        return [Task(self, tjson['task']) for tjson in tasks_response]
765997
private List<Task> receiveTasks() {
		synchronized (mutex) {
			if (tasks.isEmpty()) {
				return Collections.emptyList();
			} else {
				List<Task> currentTasks = tasks;
				tasks = new ArrayList<Task>();
				return currentTasks;
			}
		}
	}
1183249
def filter_tasks(self, task_names, keep_dependencies=False):
        """"""
        new_tasks = {}
        for task_name in task_names:
            task = self.get_task(task_name)
            if task not in new_tasks:
                new_tasks[task.name] = task
            if keep_dependencies:
                for dependency in task.ordered_dependencies():
                    if dependency not in new_tasks:
                        new_tasks[dependency.name] = dependency
            else:
                #strip dependencies
                task.dependencies = set()

        self.tasks = new_tasks