Public: The definition of simple is querying by only _id or _id and _type.
 If this is the case, you can use IdentityMap in library to not perform
 query and instead just return from map.

 Returns true or false
423036
def simple?
      return false if keys.size > SimpleQueryMaxSize
      key_set = keys.to_set
      key_set == SimpleIdQueryKeys || key_set == SimpleIdAndTypeQueryKeys
    end
495196
private boolean isUbique(String id, RelType context)
	{
		if (context == null) return this.context.containsKey(id);

		if (!isUbique(id)) return false;

		RelType ctx = this.context.get(id);
		return ctx == null || ctx.equals(context);
	}
1244978
@Override
    public Object map(Object input) {
        String orig = input.toString();
        if (map.containsKey(orig)) {
            return map.get(orig);
        }

        if (input instanceof String)
            return input;
        else
            return orig;
    }
1291912
public SimpleOrderedMap<Object> check(String id) throws IOException {
    if (idToVersion.containsKey(id)) {
      String version = idToVersion.get(id);
      MtasSolrCollectionCacheItem item = versionToItem.get(version);
      Date date = new Date();
      long now = date.getTime();
      if (verify(version, now)) {
        SimpleOrderedMap<Object> data = new SimpleOrderedMap<>();
        data.add("now", now);
        data.add("id", item.id);
        data.add("size", item.size);
        data.add("version", version);
        data.add("expiration", expirationVersion.get(version));
        return data;
      } else {
        idToVersion.remove(id);
        versionToItem.remove(version);
        expirationVersion.remove(version);
        return null;
      }
    } else {
      return null;
    }
  }
932987
function(Type) {
		if (Type) {
			if (this._map) {
				var classid = Type.$classid;
				var typeobj = this._map[classid];
				return typeobj ? true : false;
			}
			return false;
		} else {
			throw new Error("Something is undefined");
		}
	}
869338
function (param, idx, all) {
        // helps handle weird edge cases such as "/get?a=b&&"
        if (param === EMPTY && // if param is empty
            _.isNumber(idx) && // this and the next condition ensures that this is part of a map call
            _.isArray(all) &&
            idx !== (all && (all.length - 1))) { // not last parameter in the array
            return { key: null, value: null };
        }

        var index = (typeof param === STRING) ? param.indexOf(EQUALS) : -1,
            paramObj = {};

        // this means that there was no value for this key (not even blank, so we store this info) and the value is set
        // to null
        if (index < 0) {
            paramObj.key = param.substr(0, param.length);
            paramObj.value = null;
        }
        else {
            paramObj.key = param.substr(0, index);
            paramObj.value = param.substr(index + 1);
        }

        return paramObj;
    }
566346
public static boolean isJavaBasicType(@Nullable String name) {
        if (StringUtils.isEmpty(name)) {
            return false;
        }
        return isJavaLangType(name) || BASIC_TYPE_MAP.containsKey(name);
    }
1044109
function Id(s, r, m, isSimple) {
  this.s = s;
  this.r = r;
  this.m = m;
  Object.defineProperty(this, '_simple', {
    value: isSimple
  });
}
239459
@SuppressWarnings({ "unchecked" })
    public static <V> Optional<V> get(Map<?, ?> map, Class<V> type,
            Serializable id) {
        return Optional
            .ofNullable((V) map.get(new TypedIdKey<>(type, id)));
    }
1088304
def _is_valid_datatype(datatype_instance):
    

    # Remap so we can still use the python types for the simple cases
    global _simple_type_remap
    if datatype_instance in _simple_type_remap:
        return True

    # Now set the protobuf from this interface.
    if isinstance(datatype_instance, (Int64, Double, String, Array)):
        return True

    elif isinstance(datatype_instance, Dictionary):
        kt = datatype_instance.key_type

        if isinstance(kt, (Int64, String)):
            return True

    return False
1328629
def map_query_string(self):
        
        if (not self.query_key_mapper or
            self.request.method == 'POST'):
            # Nothing to map, don't do anything.
            # return self.request.POST
            return {}

        keys = list(self.query_key_mapper.keys())

        return {self.query_key_mapper.get(k) if k in keys else k: v.strip()
                for k, v in self.request.GET.items()}
239935
public T byId(Object id) {
        this.beforeCheck();
        this.where(primaryKeyColumn, id);

        String sql = this.buildSelectSQL(false);

        T model = this.queryOne(modelClass, sql, paramValues);

        ifNotNullThen(model, () -> this.setJoin(Collections.singletonList(model)));

        return model;
    }
736353
function idSearch( id, type, callback ) {
    if ( ! endpoints['id'].hasOwnProperty(type) ) {
        return callback(new Error('No valid type'));
    }

    var url = apiBaseUrl+endpoints['id'][type] + id;

    fetch(url, function(result) {
        callback(result);
    });
}
411028
public <S> S queryOne(Class<S> type, String sql, List<Object> params) {
        if (Anima.of().isUseSQLLimit()) {
            sql += " LIMIT 1";
        }
        List<S> list = queryList(type, sql, params);
        return AnimaUtils.isNotEmpty(list) ? list.get(0) : null;
    }
32872
public boolean isComplexQuery()
    {
        for (int i = 0; i < this.getRecordlistCount(); i++)
        {
            if (this.getRecordlistAt(i).getTable() instanceof org.jbundle.base.db.shared.MultiTable)
                return true;
        }
        return false;
    }
1309420
def select(*queries, **kwargs):
    
    def make_query(*args):
        def simple_query(nodes):
            if len(args) == 0:
                return nodes
            pred = args[0]
            results = []
            if isinstance(pred, list):
                funcs = [make_query(q) for q in pred]
                return __or(funcs, nodes)
            elif isinstance(pred, tuple):
                name, attrs = pred[0], pred[1:]
                name_pred = __make_name_pred(name)
                attrs_pred = __make_attrs_pred(attrs)
                for n in nodes:
                    if name_pred(n.name) and attrs_pred(n.attrs):
                        results.append(n)
            else:
                name_pred = __make_name_pred(pred)
                for n in nodes:
                    if name_pred(n.name):
                        results.append(n)
            return results
        if len(args) > 1:
            return __compose(make_query(*args[1:]), simple_query)
        return simple_query

    def deep_query(query, nodes):
        """ Slide the query down the branches. """
        def inner(children):
            results = []
            for c in children:
                if query([c]):
                    results.append(c)
                results.extend(inner(c.children))
            return results
        return inner(nodes)

    def unique(roots):
        seen = set()
        results = []
        for r in roots:
            if r not in seen:
                seen.add(r)
                results.append(r)
        return results

    def compiled_query(nodes):
        """
        This is the compiled query that can be run against a configuration.
        """
        query = make_query(*queries)

        roots = kwargs.get("roots", True)
        if kwargs.get("deep", False):
            results = deep_query(query, nodes)
            if roots:
                results = unique([r.root for r in results])
        elif roots:
            results = unique([n.root for n in query(nodes)])
        else:
            results = query(nodes)

        one = kwargs.get("one")
        if one is None:
            return SearchResult(children=results)
        return results[one] if results else None
    return compiled_query
1254603
private boolean hasComplexKeys(TabularType pType) {
        List<String> indexes = pType.getIndexNames();
        CompositeType rowType = pType.getRowType();
        for (String index : indexes) {
            if ( ! (rowType.getType(index) instanceof SimpleType)) {
                return true;
            }
        }
        return false;
    }