Call the 'v2/receive/callback_log' endpoint and returns the callback log
    for a given callback URI with parameters.

    :param callback: callback URI
    :param api_key: Blockchain.info API V2 key
    :return: a list of :class:`LogEntry` objects
161139
def callback_log(callback, api_key):
    
    params = {'key': api_key, 'callback': callback}
    resource = 'v2/receive/callback_log?' + util.urlencode(params)
    resp = util.call_api(resource, base_url='https://api.blockchain.info/')
    json_resp = json.loads(resp)
    return [LogEntry(e['callback'], e['called_at'], e['raw_response'], e['response_code']) for e in json_resp]
1095976
def add_log_callback(callback):
    """"""
    global _log_callbacks

    if not callable(callback):
        raise ValueError("Callback must be callable")

    _log_callbacks.add(callback)
    return callback
142189
def get_log(self, offset, count=10, callback=None):
        '''
        
        '''
        params = {'offset': offset, 'count': count}
        return self.execute_command('getLog', params, callback=callback)
1149780
function list(callback, limit, offset) {
  if(!util.isFunction(callback)) {
    throw new Error('callback must be a function');
  }

  var resource = this.coinjar.merchant.api_endpoint + '/v1/orders.json',
    order_url = this.coinjar.merchant.orders_endpoint + '/',
    query = {};

  if(limit) { query.limit = limit; }
  if(offset) { query.offset = offset; }

  request.get(resource)
    .auth(this.coinjar.merchant.uuid, this.coinjar.merchant.secret)
    .query(query)
    .end(function (response) {
      if(isResponseError(response, callback)) { return; }
      // build the payment page url for each order object
      var i = response.body.orders.length;
      while (i--) {
        response.body.orders[i].payment_page_url = order_url + response.body.orders[i].uuid;
      }
      return callback(null, response.body.orders);
    });
}
763324
def _request_callback(self, request_id):
        """"""
        def callback(future):
            # Remove the future from the client requests map
            self._client_request_futures.pop(request_id, None)

            if future.cancelled():
                future.set_exception(JsonRpcRequestCancelled())

            message = {
                'jsonrpc': JSONRPC_VERSION,
                'id': request_id,
            }

            try:
                message['result'] = future.result()
            except JsonRpcException as e:
                log.exception("Failed to handle request %s", request_id)
                message['error'] = e.to_dict()
            except Exception:  # pylint: disable=broad-except
                log.exception("Failed to handle request %s", request_id)
                message['error'] = JsonRpcInternalError.of(sys.exc_info()).to_dict()

            self._consumer(message)

        return callback
527881
def get_api_v1_info(api_prefix):
    
    websocket_root = base_ws_uri() + EVENTS_ENDPOINT
    docs_url = [
        'https://docs.bigchaindb.com/projects/server/en/v',
        version.__version__,
        '/http-client-server-api.html',
    ]

    return {
        'docs': ''.join(docs_url),
        'transactions': '{}transactions/'.format(api_prefix),
        'blocks': '{}blocks/'.format(api_prefix),
        'assets': '{}assets/'.format(api_prefix),
        'outputs': '{}outputs/'.format(api_prefix),
        'streams': websocket_root,
        'metadata': '{}metadata/'.format(api_prefix),
        'validators': '{}validators'.format(api_prefix),
    }
461204
function(callback) {
            var that = this;
            var url = this.paths.login;
            var params = {
                username: this.username,
                password: this.password,
                cookie  : '1'
            };

            callback = callback || function() {};
            var wrappedCallback = function(err, response) {
                // Let's make sure that not only did the request succeed, but
                // we actually got a non-empty session key back.
                var hasSessionKey = !!(!err && response.data && response.data.sessionKey);

                if (err || !hasSessionKey) {
                    callback(err || "No session key available", false);
                }
                else {
                    that.sessionKey = response.data.sessionKey;
                    callback(null, true);
                }
            };

            return this.http.post(
                this.urlify(url),
                this._headers(),
                params,
                this.timeout,
                wrappedCallback
            );
        }
602515
public void fetchReceiptTimestamps(final AVIMConversationCallback callback) {
    final AVIMCommonJsonCallback tmpCallback = new AVIMCommonJsonCallback() {
      @Override
      public void done(Map<String, Object> result, AVIMException e) {
        if (null == callback) {
          return;
        }
        if (null != e || null == result) {
          callback.internalDone(e);
        } else {
          long readAt = 0;
          if (result.containsKey(Conversation.callbackReadAt)) {
            readAt = (Long) result.get(Conversation.callbackReadAt);
          }

          long deliveredAt = 0;
          if (result.containsKey(Conversation.callbackDeliveredAt)) {
            readAt = (Long) result.get(Conversation.callbackDeliveredAt);
          }
          AVIMConversation.this.setLastReadAt(readAt, false);
          AVIMConversation.this.setLastDeliveredAt(deliveredAt, false);
          storage.updateConversationTimes(AVIMConversation.this);
          callback.internalDone(null, null);
        }
      }
    };
    boolean ret = InternalConfiguration.getOperationTube().fetchReceiptTimestamps(client.getClientId(), getConversationId(),
            getType(),
            Conversation.AVIMOperation.CONVERSATION_FETCH_RECEIPT_TIME, tmpCallback);
    if (!ret && null != callback) {
      callback.internalDone(new AVException(AVException.OPERATION_FORBIDDEN, "couldn't send request in background."));
    }
  }
927015
def get_redirect_args(self, request, callback):
        ""
        callback = request.build_absolute_uri(callback)
        args = {
            'client_id': self.provider.consumer_key,
            'redirect_uri': callback,
            'response_type': 'code',
        }
        state = self.get_application_state(request, callback)
        if state is not None:
            args['state'] = state
            request.session[self.session_key] = state
        return args
1144421
def callback_oauth2(self, request):
        
        callback_url = self.callback_url(request)

        oauth = OAuth2Session(client_id=self.consumer_key, redirect_uri=callback_url, scope=self.scope)
        request_token = oauth.fetch_token(self.REQ_TOKEN,
                                          code=request.GET.get('code', ''),
                                          authorization_response=callback_url,
                                          client_secret=self.consumer_secret,
                                          scope=self.scope,
                                          verify=False)
        return request_token.get('access_token')
1172939
def to_string(self):
        
        items = [
            ('oauth_token', self.key),
            ('oauth_token_secret', self.secret),
        ]

        if self.callback_confirmed is not None:
            items.append(('oauth_callback_confirmed', self.callback_confirmed))
        return urlencode(items)
281656
def log_to_api(self):
        
        if self.entries:
            try:
                headers = {'Content-Type': 'application/json'}
                self.session.post('/v2/logs/app', headers=headers, json=self.entries)
                # self.entries = []  # clear entries
            except Exception:
                # best effort on api logging
                pass
697012
def add_callback(self, callback: callable):
        
        def internal_callback(*args):
            try:
                callback()
            except TypeError:
                callback(self.get())

        self._var.trace('w', internal_callback)
1318826
def get_log_file(self, api=None):
        
        api = api or self._API
        log_file_data = self.execution_details.get('log_file')
        return File(api=api, **log_file_data) if log_file_data else None
1086549
def get(self, callback):
        '''
        
        '''
        derived_path = self.context.request.url
        logger.debug('[{log_prefix}]: get.derived_path: {path}'.format(
            log_prefix=LOG_PREFIX, path=derived_path))
        callback(self.storage.get(self.result_key_for(derived_path)))
870755
function fetchLogs(root, msg, callback) {
    const number = msg.number;
    const logfile = msg.logfile;
    const serverId = msg.serverId;
    const filePath = path.join(root, getLogFileName(logfile, serverId));

    const endLogs = [];
    exec(`tail -n ${number} ${filePath}`, (error, output) => {
        const endOut = [];
        output = output.replace(/^\s+|\s+$/g, '').split(/\s+/);

        for (let i = 5; i < output.length; i += 6) {
            endOut.push(output[i]);
        }

        const endLength = endOut.length;
        for (let j = 0; j < endLength; j++) {
            const map = {};
            let json;
            try {
                json = JSON.parse(endOut[j]);
            } catch (e) {
                logger.error(`the log cannot parsed to json, ${e}`);
                continue;   // eslint-disable-line
            }
            map.time = json.time;
            map.route = json.route || json.service;
            map.serverId = serverId;
            map.timeUsed = json.timeUsed;
            map.params = endOut[j];
            endLogs.push(map);
        }

        callback({ logfile: logfile, dataArray: endLogs });
    });
}
325959
public List<CallbackMetadata> getCallbacks(CallbackType callbackType) {
    return callbacks == null ? null : callbacks.get(callbackType);
  }