This callback is called form the Crazyflie API when a Crazyflie
        has been connected and the TOCs have been downloaded.
191134
def _connected(self, link_uri):
        
        print('Connected to %s' % link_uri)

        self._cf.packet_received.add_callback(self._got_packet)
1174138
void callback(boolean ask) {
        if (viStatusCallback != null) {
            if (states.remove(callState.toString().toLowerCase())) {
                if (logger.isInfoEnabled()) {
                    logger.info("About to execute viStatusCallback: " + viStatusCallback.toString());
                }
                if (viStatusCallbackMethod == null) {
                    viStatusCallbackMethod = "POST";
                }
                final List<NameValuePair> parameters = parameters();
                requestCallback = new HttpRequestDescriptor(viStatusCallback, viStatusCallbackMethod, parameters);
                if (!ask) {
                    downloader.tell(requestCallback, null);
                } else if (ask) {
                    final Timeout timeout = new Timeout(Duration.create(5, TimeUnit.SECONDS));
                    Future<Object> future = (Future<Object>) ask(downloader, requestCallback, timeout);
                    DownloaderResponse downloaderResponse = null;
                    try {
                        downloaderResponse = (DownloaderResponse) Await.result(future, Duration.create(10, TimeUnit.SECONDS));
                    } catch (Exception e) {
                        logger.error("Exception during callback with ask pattern");
                    }
                }
            } else {
                if (logger.isInfoEnabled()) {
                    logger.info("Status Callback has been already executed for state: ",callState.toString());
                }
            }
        } else if(logger.isInfoEnabled()){
            logger.info("status callback is null");
        }

    }
754345
void onUploadFinished(List<String> uploadedFiles) {

        m_rpc.onUploadFinished(uploadedFiles);
        // create a new button handler instance, as the old one is in a messed up state
        getWidget().reinitButton(createButtonHandler());
    }
268108
function AddCallback(mesgId, callbackFunction, callbackTimeout) {
    var callbackElement, now;

    now = new Date().getTime();

    callbackElement = {
        id      :   mesgId,
        func    :   callbackFunction,
        timeout :   now + callbackTimeout
    };

    callbackList.push(callbackElement);
}
861106
private ExecutionCallback<Boolean> loadingFinishedCallback() {
        return new ExecutionCallback<Boolean>() {
            @Override
            public void onResponse(Boolean loadingFinished) {
                if (loadingFinished) {
                    updateLocalKeyLoadStatus(null);
                }
            }

            @Override
            public void onFailure(Throwable t) {
                updateLocalKeyLoadStatus(t);
            }
        };
    }
291535
void registerCallback(AsynchConsumerCallback callback)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "registerCallback", callback);

    asynchConsumerCallback = callback;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "registerCallback");
  }
1277577
def _on_client_connect(self, data):
        """"""
        client = None
        if data.get('id') in self._clients:
            client = self._clients[data.get('id')]
            client.update_connected(True)
        else:
            client = Snapclient(self, data.get('client'))
            self._clients[data.get('id')] = client
            if self._new_client_callback_func and callable(self._new_client_callback_func):
                self._new_client_callback_func(client)
        _LOGGER.info('client %s connected', client.friendly_name)
948317
function (_callback)
    {
        if (_callback) {
            _callback = _callback.bind(this._conn);
        } else {
            _callback = this._conn._connect_cb.bind(this._conn);
        }
        var body = this._buildBody();
        this._requests.push(
                new Strophe.Request(body.tree(),
                    this._onRequestStateChange.bind(
                        this, _callback.bind(this._conn)),
                    body.tree().getAttribute("rid")));
        this._throttledRequestHandler();
    }
48594
function onInit(unused, callback) {
    var filePath = path.resolve(options.file);

    stats.deserialise.fs.start = Date.now();
    if (fs.existsSync(filePath)) {
      fs.readFile(filePath, complete);
    } else {
      complete(true);
    }

    function complete(error, contents) {
      stats.deserialise.fs.stop = Date.now();

      stats.deserialise.decode.start = Date.now();
      pending = !error && contents && cycle.retrocycle(decode(JSON.parse(contents)));
      stats.deserialise.decode.stop = Date.now();

      stats.deserialise.success = !error;
      callback();
    }
  }
645020
function(pluginIdx) {
    if (pluginIdx >= plugins.length) return callback(hooks.collectionHook);

    var plugin = plugins[pluginIdx];
    var next = function() {iterPlugins(pluginIdx + 1);};
    var func = plugin[stage];

    // call the plugin's stage hook, if defined
    if (func) {
      // T is database operation object
      func.call(plugin, T, next);
    } else next();
  }
768099
def _start_callbacks(self, result, exception):
        
        if self._cancelled:
            raise CancelledError()
        if self.called:
            raise AlreadyCalledError()

        self._result = result
        self._exception = exception
        if self._exception:
            self._tb_info = ''.join(traceback.format_tb(sys.exc_info()[2])) 
        self.called = True
        self._do_callbacks()
977918
function addCallback (t, data) {
  var result = data.result || data.error;
  cbid = data.id;
  if (t.callbacks[cbid]) {
    if (data.result) {
      t.callbacks[cbid](result);
    } else {
      t.callbacks[cbid](result, 'error');
    }
  }
}
1264076
def add_callback(self, name, func):
        

        if name == 'on_scan':
            events = ['device_seen']
            def callback(_conn_string, _conn_id, _name, event):
                func(self.id, event, event.get('validity_period', 60))
        elif name == 'on_report':
            events = ['report', 'broadcast']
            def callback(_conn_string, conn_id, _name, event):
                func(conn_id, event)
        elif name == 'on_trace':
            events = ['trace']
            def callback(_conn_string, conn_id, _name, event):
                func(conn_id, event)
        elif name == 'on_disconnect':
            events = ['disconnection']
            def callback(_conn_string, conn_id, _name, _event):
                func(self.id, conn_id)
        else:
            raise ArgumentError("Unknown callback type {}".format(name))

        self._adapter.register_monitor([None], events, callback)
849548
def _toc_fetch_finished(self):
        """"""
        self.cf.remove_port_callback(self.port, self._new_packet_cb)
        logger.debug('[%d]: Done!', self.port)
        self.finished_callback()
1204299
def loadtoc(self):
        
        self.lib.seek(self.start + self.TOCPOS)
        (offset,) = struct.unpack('!i', self.lib.read(4))
        self.lib.seek(self.start + offset)
        self.toc = marshal.load(self.lib)
260601
function softwareUpdate_waitForDownloadFinished(timeout) {
    timeout = timeout ? timeout : gTimeoutUpdateDownload;

    var progress =  this.getElement({type: "download_progress"});
    this._controller.waitFor(function() {
      return progress.getNode().value == 100;
    }, "Update has been finished downloading.", timeout);

    this.waitForWizardPage(WIZARD_PAGES.finished);
  }
5399
def on_download_to_activated(self, menu_item):
        ''''''
        tree_paths = self.iconview.get_selected_items()
        if not tree_paths:
            return

        dialog = Gtk.FileChooserDialog(_('Save to...'), self.app.window,
                Gtk.FileChooserAction.SELECT_FOLDER,
                (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
                 Gtk.STOCK_OK, Gtk.ResponseType.OK))
        response = dialog.run()
        if response != Gtk.ResponseType.OK:
            dialog.destroy()
            return
        dirname = dialog.get_filename()
        dialog.destroy()

        pcs_files = [self.get_pcs_file(p) for p in tree_paths]
        self.app.blink_page(self.app.download_page)
        self.app.download_page.add_tasks(pcs_files, dirname)