Get the schedulers satellites live synthesis

        :return: compiled livesynthesis dictionary
        :rtype: dict
338481
def get_livesynthesis(self):
        
        res = self.get_id()
        res['livesynthesis'] = {
            '_overall': {
                '_freshness': int(time.time()),
                'livesynthesis': {
                    'hosts_total': 0,
                    'hosts_not_monitored': 0,
                    'hosts_up_hard': 0,
                    'hosts_up_soft': 0,
                    'hosts_down_hard': 0,
                    'hosts_down_soft': 0,
                    'hosts_unreachable_hard': 0,
                    'hosts_unreachable_soft': 0,
                    'hosts_problems': 0,
                    'hosts_acknowledged': 0,
                    'hosts_in_downtime': 0,
                    'hosts_flapping': 0,
                    'services_total': 0,
                    'services_not_monitored': 0,
                    'services_ok_hard': 0,
                    'services_ok_soft': 0,
                    'services_warning_hard': 0,
                    'services_warning_soft': 0,
                    'services_critical_hard': 0,
                    'services_critical_soft': 0,
                    'services_unknown_hard': 0,
                    'services_unknown_soft': 0,
                    'services_unreachable_hard': 0,
                    'services_unreachable_soft': 0,
                    'services_problems': 0,
                    'services_acknowledged': 0,
                    'services_in_downtime': 0,
                    'services_flapping': 0,
                }
            }
        }

        # Report our schedulers information, but only if a dispatcher exists
        if getattr(self, 'dispatcher', None) is None:
            return res

        for satellite in self.dispatcher.all_daemons_links:
            if satellite.type not in ['scheduler']:
                continue
            if not satellite.active:
                continue

            if 'livesynthesis' in satellite.statistics:
                # Scheduler detailed live synthesis
                res['livesynthesis'][satellite.name] = {
                    '_freshness': satellite.statistics['_freshness'],
                    'livesynthesis': satellite.statistics['livesynthesis']
                }
                # Cumulated live synthesis
                for prop in res['livesynthesis']['_overall']['livesynthesis']:
                    if prop in satellite.statistics['livesynthesis']:
                        res['livesynthesis']['_overall']['livesynthesis'][prop] += \
                            satellite.statistics['livesynthesis'][prop]

        return res
1340617
def get_tasks():
    ''''''
    return {
        name: get_task_queue(name, cls)
        for name, cls in celery.tasks.items()
        # Exclude celery internal tasks
        if not name.startswith('celery.')
        # Exclude udata test tasks
        and not name.startswith('test-')
    }
614237
def backend(self):
        """"""
        from indico_livesync.plugin import LiveSyncPlugin
        return LiveSyncPlugin.instance.backend_classes.get(self.backend_name)
1272298
def get_workflows(self):
        
        for pth in settings.WORKFLOW_PACKAGES_PATHS:
            for f in glob.glob("%s/*.bpmn" % pth):
                with open(f) as fp:
                    yield os.path.basename(os.path.splitext(f)[0]), fp.read()
87205
def get_queues(self):
        """"""
        res = self.celery.control.inspect().active_queues() or dict()
        return [result.get('name') for host in res.values() for result in host]
86638
def get_global_sources(self):
        
        sources = []
        if self.sources:
            for source in self.sources:
                if None in source.streams:
                    sources.append(source.streams[None])
        return sources
738138
def get_monitoring_problems(self):
        
        res = self.get_id()
        res['problems'] = {}

        # Report our schedulers information, but only if a dispatcher exists
        if getattr(self, 'dispatcher', None) is None:
            return res

        for satellite in self.dispatcher.all_daemons_links:
            if satellite.type not in ['scheduler']:
                continue
            if not satellite.active:
                continue

            if satellite.statistics and 'problems' in satellite.statistics:
                res['problems'][satellite.name] = {
                    '_freshness': satellite.statistics['_freshness'],
                    'problems': satellite.statistics['problems']
                }

        return res
433936
def get_daemon_stats(self, details=False):
        
        # call the daemon one
        res = super(BaseSatellite, self).get_daemon_stats(details=details)

        counters = res['counters']
        counters['external-commands'] = len(self.external_commands)
        counters['satellites.arbiters'] = len(self.arbiters)
        counters['satellites.schedulers'] = len(self.schedulers)

        return res
359869
def get_scheduled_analyses(self):
        
        url = '{}scheduled_analyses/'.format(self.url)
        return ScheduledAnalysis._get_list_from_url(url, append_base_url=False)
220760
def get_psms(self):
        """"""
        self.header = actions.create_header(self.oldheader, self.spectracol)
        self.psms = actions.generate_psms_spectradata(self.lookup, self.fn,
                                                      self.oldheader)
1069803
def get():
    
    livestatus = mk_livestatus()
    hosts = livestatus.get_hosts()
    services = livestatus.get_services()
    result = {}
    result['hosts'] = hosts
    result['services'] = services
    return result
1302702
def _get_scheduler(get=None, collection=None):
    
    try:
        # dask 0.18.1 and later
        from dask.base import get_scheduler
        actual_get = get_scheduler(get, collection)
    except ImportError:
        try:
            from dask.utils import effective_get
            actual_get = effective_get(get, collection)
        except ImportError:
            return None

    try:
        from dask.distributed import Client
        if isinstance(actual_get.__self__, Client):
            return 'distributed'
    except (ImportError, AttributeError):
        try:
            import dask.multiprocessing
            if actual_get == dask.multiprocessing.get:
                return 'multiprocessing'
            else:
                return 'threaded'
        except ImportError:
            return 'threaded'
62812
def get_consumers(self, _Consumer, channel):
        
        return [_Consumer(queues=[self.queue(channel)], callbacks=[self.main_callback], prefetch_count=self.prefetch_count)]
342198
def inspect_periodic_tasks(self) -> List[Tuple[int, str]]:
        
        rv = self._r.zrangebyscore(
            self._to_namespaced(PERIODIC_TASKS_QUEUE_KEY),
            '-inf', '+inf', withscores=True
        )
        return [(int(r[1]), r[0].decode()) for r in rv]
1189746
def get_cameras_schedule(self):
        """"""
        resource = "schedule"
        schedule_event = self.publish_and_get_event(resource)
        if schedule_event:
            return schedule_event.get('properties')

        return None
72225
def get_smart_tasks(self):
        
        def process_result(result):
            return [self.get_smart_task(task) for task in result]

        return Command('get', [ROOT_SMART_TASKS],
                       process_result=process_result)
377011
async def consume_events(self):
        ''' '''
        # begin by making sure the channel is created
        await self.create_channel()
        # get cursor method
        def create_cursor():
            now = datetime.datetime.utcnow()
            dummy_id = ObjectId.from_datetime(now)
            return self._collection.find({'_id': {'$gte': dummy_id}}, cursor_type=CursorType.TAILABLE_AWAIT)
        # get cursor and start the loop
        cursor = create_cursor()
        while self.active:
            if cursor.alive:
                if (await cursor.fetch_next):
                    message = cursor.next_object()
                    event = message['key']
                    data = message['data']
                    logger.debug('event: %s - %s', event, data)
                    for sub in self._subscribers[event]:
                        await sub.deliver({'type': 'event', 'payload': {'name': event, 'data': data}})
            else:
                await asyncio.sleep(0.1)
                cursor = create_cursor()