Server returns anything that is simlar in any catagory
970599
def search_by_label(self, label):
        '''  '''
        url_base = self.base_path + 'term/search/{term}?key={api_key}'
        url = url_base.format(term=label, api_key=self.APIKEY)
        return self.get(url)
1082237
function (items, query, fields, exact) {
        var self = this;
        var isTarget = function (fieldName) {
          return fields.indexOf(fieldName) !== -1;
        };
        if (query === '') {
          return items;
        }
        fields = fields || ['name', 'owner', 'description', 'keyword'];
        return _.filter(items, function (item) {
          if ((isTarget('name') && self.matchedInString(query, item.name, exact)) ||
              (isTarget('owner') && self.matchedInString(query, item.owner, exact)) ||
              (isTarget('description') && self.matchedInString(query, item.description, exact)) ||
              (isTarget('keyword') && self.matchedInArray(query, item.keywords, exact))) {
            return true;
          }
          return false;
        });
      }
310827
def query_all(**kwargs):
        '''
        
        '''
        kind = kwargs.get('kind', '1')
        limit = kwargs.get('limit', 10)

        return TabPost.select().where(
            (TabPost.kind == kind) &
            (TabPost.valid == 1)
        ).order_by(
            TabPost.time_update.desc()
        ).limit(limit)
21086
function all(datastore, kind, namespace) {
    return function(cb) {
        var query = null;
        if (namespace) {
            query = datastore.createQuery(namespace, kind);
        } else {
            query = datastore.createQuery(kind);
        }

        datastore.runQuery(query, function(err, entities) {
            if (err)
                return cb(err);

            var list = (entities || []).map(function(entity) {
                return entity;
            });

            cb(null, list);
        });

    };
}
376178
def stats(type=nil)
      type = nil if ![nil, :items,:slabs,:settings].include? type
      values = {}
      ring.servers.each do |server|
        values["#{server.name}"] = server.alive? ? server.request(:stats,type.to_s) : nil
      end
      values
    end
631188
def _spec_to_matches(server_list, server_spec, mode):
    
    assert mode in ("uri", "hostname", "hostname_port")

    def match(server_doc):
        if mode == "hostname":
            return server_spec == server_doc["hostname"]
        elif mode == "hostname_port":
            return server_spec == "{}:{}".format(
                server_doc["hostname"], server_doc["port"]
            )
        elif mode == "uri":
            return server_spec == "{}://{}:{}".format(
                server_doc["scheme"], server_doc["hostname"], server_doc["port"]
            )
        else:
            raise NotImplementedError("Unreachable error! Something is very wrong.")

    return [server_doc for server_doc in server_list if match(server_doc)]
938876
def fetchAll(self, rawResults = False, **queryArgs) :
        """"""
        return self.simpleQuery('all', rawResults = rawResults, **queryArgs)
383392
function listAllServers(next) {
        var limit = 1000;
        var offset = 0;
        var allServers = [];
        var firstReq;
        var firstRes;

        var listPageOfServers = function () {
            if (limit !== null) {
                reqOpts.query.limit = limit;
            }
            reqOpts.query.offset = offset;

            self.get(reqOpts, function (err, servers, req, res) {
                if (err) {
                    next(err, null, req, res);
                    return;
                }

                if (!firstReq) {
                    firstReq = req;
                    firstRes = res;
                }

                allServers = allServers.concat(servers);

                if (servers.length < limit) { // Done paging.
                    // For backwards compat, we return the *first* req/res.
                    next(null, allServers, firstReq, firstRes);
                } else {
                    // Need to fetch another page of servers.
                    offset += servers.length;
                    listPageOfServers();
                }
            });
        };

        listPageOfServers();
    }
543199
function(client, sinfo) {
  let proxy = client.proxies;
  return !!proxy.sys && !! proxy.sys[sinfo.serverType];
}
758727
def basic_query(returns):
    """"""
    return compose(
        reusable,
        map_send(parse_request),
        map_yield(prepare_params, snug.prefix_adder(API_PREFIX)),
        map_return(loads(returns)),
        oneyield,
    )
691908
def query?(name_sym, rpc_desc)
      name_sym.to_s.start_with?('get') ||
        rpc_desc.rpc_desc.input == Google::Protobuf::Empty
    end
553443
def all(cls, sort=None, limit=None):
        
        return cls.where(sort=sort, limit=limit)
1018166
def _any(self, memory, addr, **kwargs):
        
        return memory.state.solver.eval(addr, exact=kwargs.pop('exact', self._exact), **kwargs)
524202
function (s) {
      if(!net) return null
      var ary = s.split(':')
      if(ary.length < 3) return null
      if('net' !== ary.shift()) return null
      var port = +ary.pop()
      if(isNaN(port)) return null
      return {
        name: 'net',
        host: ary.join(':') || 'localhost',
        port: port
      }
    }
445717
def clean_locals(data):
    
    if data.get('params') is not None:
        return data.get('params')
    else:
        return {
            to_camel_case(k): v for k, v in data.items() if v is not None and k not in
            ['self', 'session', 'params', 'lightweight']
        }
586299
function parseServerType(ismaster) {
  if (!ismaster || !ismaster.ok) {
    return ServerType.Unknown;
  }

  if (ismaster.isreplicaset) {
    return ServerType.RSGhost;
  }

  if (ismaster.msg && ismaster.msg === 'isdbgrid') {
    return ServerType.Mongos;
  }

  if (ismaster.setName) {
    if (ismaster.hidden) {
      return ServerType.RSOther;
    } else if (ismaster.ismaster) {
      return ServerType.RSPrimary;
    } else if (ismaster.secondary) {
      return ServerType.RSSecondary;
    } else if (ismaster.arbiterOnly) {
      return ServerType.RSArbiter;
    } else {
      return ServerType.RSOther;
    }
  }

  return ServerType.Standalone;
}
473561
function any(arr, contition) {
  let result = false;

  util.forEach(arr, item => {
    result = contition(item);

    return !result;
  });

  return result;
}