Do not initialize again since everything is ready to launch app.
        :return: Initialized monitor instance
769614
def clone(self):
        
        return Monitor(org=self.org, app=self.app, env=self.env)
773183
def load(self, callback=None, errback=None, reload=False):
        
        if not reload and self.data:
            raise MonitorException('monitor already loaded')

        def success(result, *args):
            self.data = result
            if callback:
                return callback(self)
            else:
                return self

        return self._rest.retrieve(self.data['id'], callback=success,
                                   errback=errback)
1369140
def _initialize_progressbar(self):
        

        self._progressbar = progressbar.ProgressBar(widgets=Analysis._PROGRESS_WIDGETS, maxval=10000 * 100).start()
584926
def reset():
    
    if hasattr(ray.worker.global_worker, "signal_counters"):
        ray.worker.global_worker.signal_counters = defaultdict(lambda: b"0")
59003
def restart_stopped_apps():
    '''
        
    '''
    cozy_apps = monitor.status(only_cozy=True)
    for app in cozy_apps.keys():
        state = cozy_apps[app]
        if state == 'up':
            next
        elif state == 'down':
            print 'Start {}'.format(app)
            rebuild_app(app, force=False)
            monitor.start(app)
1135467
def threaded_start(self, no_init=False):
        '''
        
        '''
        thread = Thread(target=self.init_connections, kwargs={
                        'no_init': no_init})
        thread.setDaemon(True)
        thread.start()
        thread.join()
882220
def start(self):
        """"""
        self.log.info("Starting Insecure Session for Monitor %s" % self.monitor_id)
        if self.socket is not None:
            raise Exception("Socket already established for %s." % self)

        try:
            self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            self.socket.connect((self.client.hostname, PUSH_OPEN_PORT))
            self.socket.setblocking(0)
        except socket.error as exception:
            self.socket.close()
            self.socket = None
            raise

        self.send_connection_request()
51479
def unmonitor(self, target):
        
        if 'monitor-notify' in self._capabilities and self.is_monitoring(target):
            yield from self.rawmsg('MONITOR', '-', target)
            self._monitoring.remove(target)
            return True
        else:
            return False
1036108
function(options) {
      self.consoleLog('sync - init called');

      self.config = JSON.parse(JSON.stringify(self.defaults));
      for (var i in options) {
        self.config[i] = options[i];
      }

      //prevent multiple monitors from created if init is called multiple times
      if(!self.init_is_called){
        self.init_is_called = true;
        self.datasetMonitor();
      }
      defaultCloudHandler.init(self.config.cloudUrl, self.config.cloudPath);
    }
1009618
def ready(self):
        
        # Stop the startup code from running automatically from pytest unit tests.
        # When running tests in parallel with xdist, an instance of GMN is launched
        # before thread specific settings have been applied.
        # if hasattr(sys, '_launched_by_pytest'):
        #   return
        self._assert_readable_file_if_set('CLIENT_CERT_PATH')
        self._assert_readable_file_if_set('CLIENT_CERT_PRIVATE_KEY_PATH')
        self._assert_dirs_exist('OBJECT_FORMAT_CACHE_PATH')

        self._assert_is_type('SCIMETA_VALIDATION_ENABLED', bool)
        self._assert_is_type('SCIMETA_VALIDATION_MAX_SIZE', int)
        self._assert_is_in('SCIMETA_VALIDATION_OVER_SIZE_ACTION', ('reject', 'accept'))

        self._warn_unsafe_for_prod()
        self._check_resource_map_create()
        if not d1_gmn.app.sciobj_store.is_existing_store():
            self._create_sciobj_store_root()

        self._add_xslt_mimetype()
105998
def loadMonitors(self, callback=None, errback=None, **kwargs):
        
        import ns1.monitoring
        monitors_list = self.monitors().list(callback, errback)

        return [ns1.monitoring.Monitor(self.config, m) for m in monitors_list]
60569
def createMonitor(self, callback=None, errback=None, **kwargs):
        
        import ns1.monitoring
        monitor = ns1.monitoring.Monitor(self.config)
        return monitor.create(callback=callback, errback=errback, **kwargs)
1359256
def with_condition(self, condition: Callable[[MonitorContext], bool]) -> 'MonitorTask':
        
        self._condition = condition
        return self
717921
def run_once(self):
        
        self._capture_signals()
        self._start_monitor()
        try:
            self._run_worker()
        except KeyboardInterrupt:
            return
        finally:
            self._stop_monitor()
            self._restore_signals()
234319
def initialize(self, runtime):
        """"""
        if self.is_alive():
            raise IllegalState('notification thread is already initialized')
        if not JSON_CLIENT.is_json_client_set() and runtime is not None:
            JSON_CLIENT.set_json_client(runtime)
        try:
            cursor = JSON_CLIENT.json_client['local']['oplog.rs'].find().sort('ts', DESCENDING).limit(-1)
        except TypeError:
            # filesystem, so .json_client is a bool and not iterable
            pass
        else:
            try:
                self.last_timestamp = cursor.next()['ts']
            except StopIteration:
                self.last_timestamp = Timestamp(0, 0)
988781
def initialize():
    """"""
    # This doesn't create our QApplication, just holds a reference to
    # MAIN_APP, created above to show our splash screen as early as
    # possible
    app = qapplication()

    # --- Set application icon
    app.setWindowIcon(APP_ICON)

    #----Monkey patching QApplication
    class FakeQApplication(QApplication):
        """Spyder's fake QApplication"""
        def __init__(self, args):
            self = app  # analysis:ignore
        @staticmethod
        def exec_():
            """Do nothing because the Qt mainloop is already running"""
            pass
    from qtpy import QtWidgets
    QtWidgets.QApplication = FakeQApplication

    # ----Monkey patching sys.exit
    def fake_sys_exit(arg=[]):
        pass
    sys.exit = fake_sys_exit

    # ----Monkey patching sys.excepthook to avoid crashes in PyQt 5.5+
    if PYQT5:
        def spy_excepthook(type_, value, tback):
            sys.__excepthook__(type_, value, tback)
        sys.excepthook = spy_excepthook

    # Removing arguments from sys.argv as in standard Python interpreter
    sys.argv = ['']

    # Selecting Qt4 backend for Enthought Tool Suite (if installed)
    try:
        from enthought.etsconfig.api import ETSConfig
        ETSConfig.toolkit = 'qt4'
    except ImportError:
        pass

    return app
1220003
def init(self):
        
        if not self.call_delegate('will_start_debug_core', core=self):
            if self.halt_on_connect:
                self.halt()
            self._read_core_type()
            self._check_for_fpu()
            self.build_target_xml()
            self.sw_bp.init()

        self.call_delegate('did_start_debug_core', core=self)