Same as get(), but returns a promise and uses fetchIfRefAsync().
181413
function Dict_getAsync(key1, key2, key3) {
      var value;
      var xref = this.xref;
      if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map ||
          typeof key2 === 'undefined') {
        if (xref) {
          return xref.fetchIfRefAsync(value);
        }
        return Promise.resolve(value);
      }
      if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map ||
          typeof key3 === 'undefined') {
        if (xref) {
          return xref.fetchIfRefAsync(value);
        }
        return Promise.resolve(value);
      }
      value = this.map[key3] || null;
      if (xref) {
        return xref.fetchIfRefAsync(value);
      }
      return Promise.resolve(value);
    }
240479
function get(key, store = getDefaultStore()) {
  let req
  return store[IDBStore]('readonly', store => {
    req = store.get(key)
  }).then(() => req.result)
}
912983
function(options) {
    var self = this;

    options = options || {};

    var error = options.error;

    var fns = [
      _.bind(self.preFetch, self, options),
      _.bind(PromisedModel.prototype.fetch, self, options),
      _.bind(self.afterFetch, self, options)
    ];
    return sequence(fns).then(function () {
      self.fetchStatus = 'fetched';
      return self;
    }, function (err) {
      if (error) error.call(options, self, err);
      return failWithError(options, err);
    });
  }
1292566
function fsRead(filePath) {
    return new Promise((resolve, reject) => {
        fs.readFile(filePath, (err, data) => {
            if (err) {
                if (err.syscall === 'open') {
                    console.log('Open "' + err.path +'" fail!')
                }
                reject(err);
            }
            resolve(data.toString())
        })
    })
}
1320136
def get(self, transaction=None):
        """"""
        warnings.warn(
            "'Query.get' is deprecated:  please use 'Query.stream' instead.",
            DeprecationWarning,
            stacklevel=2,
        )
        return self.stream(transaction=transaction)
797152
function tryRead(fd, buff, offset, length) {
  return new Promise((resolve, reject) => {
    fs.read(fd, buff, offset, length, null, (err, bytesRead, buffer) => {
      if (err) return reject(err);
      const buffLen = buffer.length;
      offset += bytesRead;
      if (offset >= buffLen) return resolve(buff);
      if ((offset + length) >= buffLen) length = buffLen - offset;
      return resolve();
    });
  })
  .then(
    (fullBuffer) => {
      return fullBuffer ? { data: fullBuffer, fd: fd }
                        : tryRead(fd, buff, offset, length);
    },
    (err) => { throw err; }
  );
}
1009280
def _get_async(self, **q_options):
    """"""
    res = yield self.fetch_async(1, **q_options)
    if not res:
      raise tasklets.Return(None)
    raise tasklets.Return(res[0])
1307342
async function readFileAsync(...args) {
  return new Promise((resolve, reject) => {
    fs.readFile(...args, (err, result) => {
      if (err) {
        reject(err);
      } else {
        resolve(result);
      }
    });
  });
}
1219390
function makeTask(fetch, deferred) {
  return function start(props, promises, match) {
    var promise = fetch(props, promises, match);

    if (promise.isFulfilled()) {
      deferred.resolve(promise.value());
      return promise;
    } else {
      return promise.then(
        (result) => {
          deferred.resolve(result);
          return result;
        },
        (err) => {
          deferred.reject(err);
          throw err;
        }
      );
    }
  };
}
926986
def fetch(context, data):
    """"""
    url = data.get('url')
    attempt = data.pop('retry_attempt', 1)
    try:
        result = context.http.get(url, lazy=True)
        rules = context.get('rules', {'match_all': {}})
        if not Rule.get_rule(rules).apply(result):
            context.log.info('Fetch skip: %r', result.url)
            return

        if not result.ok:
            err = (result.url, result.status_code)
            context.emit_warning("Fetch fail [%s]: HTTP %s" % err)
            if not context.params.get('emit_errors', False):
                return
        else:
            context.log.info("Fetched [%s]: %r",
                             result.status_code,
                             result.url)

        data.update(result.serialize())
        if url != result.url:
            tag = make_key(context.run_id, url)
            context.set_tag(tag, None)
        context.emit(data=data)
    except RequestException as ce:
        retries = int(context.get('retry', 3))
        if retries >= attempt:
            context.log.warn("Retry: %s (error: %s)", url, ce)
            data['retry_attempt'] = attempt + 1
            context.recurse(data=data, delay=2 ** attempt)
        else:
            context.emit_warning("Fetch fail [%s]: %s" % (url, ce))
1317600
function getNextResponse(){
    if (_waitingForInput !== null){
        throw new Error('concurreny error - receive listener already in-queue');
    }

    return new Promise(function(resolve){
        // data received ?
        if (_inputbuffer.length > 0){
            resolve(_inputbuffer.shift());
        }else{
            // add as waiting instance (no concurrent!)
            _waitingForInput = resolve;
        }
    });
}
1168776
async function fetchRow(connection, query, params){

    // execute query
    const [result] = await _query(connection, query, params);

    // entry found ?
    if (result.length >= 1){
        // extract data
        return result[0];
    }else{
        return null;
    }
}
862127
function fetchSync (name, request, options) {
  if (!hasStartedInit) {
    throw new Error('initialise first with fetchSync.init()')
  }

  const isRequestOptionsCall = () => arguments.length === 2 &&
    (typeof arguments[0] === 'string' || arguments[0] instanceof Request) &&
    (typeof arguments[1] === 'object' && !(arguments[1] instanceof Request))

  if (arguments.length === 1) {
    request = name
    name = null
  } else if (isRequestOptionsCall()) {
    options = request
    request = name
    name = null
  }

  if (typeof request !== 'string' && !(request instanceof Request)) {
    throw new Error('expecting request to be a string or Request')
  } else if (options && typeof options !== 'object') {
    throw new Error('expecting options to be an object')
  }

  if (!hasBackgroundSyncSupport) {
    return fetch(request, options)
  }

  let sync = syncs.find((s) => s.id === name)

  if (sync) {
    const err = new Error(`sync operation already exists with name '${name}'`)
    return Promise.reject(err)
  }

  sync = syncUtil.createFromUserOptions({ name, request, options })

  syncs.push(sync)

  ready.promise
    .then(() => serialiseRequest(new Request(request, options)))
    .then((request) => { sync.request = request })
    .then(() => channel.send('REGISTER_SYNC', sync))

  return syncUtil.makePublicApi(sync)
}
367499
function fetch(request, maxCacheAge) {
    if (maxCacheAge === void 0) { maxCacheAge = 60 * 60 * 1000; }
    return tslib_1.__awaiter(this, void 0, void 0, function () {
        var promise;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(!cache.has(request) || cache.get(request)[1].getTime() + maxCacheAge - new Date().getTime() < 0)) return [3 /*break*/, 2];
                    promise = window.fetch(request).then(function(res){return res.json()}).catch(function(err){return window.fetch(`https://lergin.de/api/cors/${request}`).then(function(res){return res.json()})});
                    cache.set(request, [promise, new Date()]);
                    return [4 /*yield*/, promise];
                case 1: return [2 /*return*/, _a.sent()];
                case 2: return [4 /*yield*/, cache.get(request)[0]];
                case 3: return [2 /*return*/, _a.sent()];
            }
        });
    });
}
1362498
def sync_fetch(request, method, default_headers=None,
               httpclient=None, **kwargs):
    
    updated_request = make_request(request, method, default_headers, **kwargs)
    if not httpclient:
        httpclient = HTTPClient()
    rsp = httpclient.fetch(updated_request)
    return parse_response(rsp)
290663
function fetchResource(t, callback) {
  if (isContinuation(t)) {
    convertContinuation(t, callback);
  } else {
    fetchViaHttp(t, callback);
  }
}
998356
def request(self, path, api='public', method='GET', params={}, headers=None, body=None):
        """"""
        return self.fetch2(path, api, method, params, headers, body)