Convert given query condition value which is supposed to contain types
identifiers to integer identifiers

This function will take care of awaited query format
4258
public function convertQueryCondition($value)
    {
        // First fetch the type
        if (null === $value) {
            return 0;
        }

        if (!is_array($value)) {
            $value = [$value];
        }

        $hasOperator = false;

        // FIXME Sorry for this
        if (!Misc::isIndexed($value)) {
            // We have an operator.
            $operator = array_keys($value)[0];
            $values = $value[$operator][0];
            $hasOperator = true;
        } else {
            $values = $value;
        }

        foreach ($values as $key => $type) {
            if (null === $type) {
                $values[$key] = 0;
            } else if ($typeId = $this->getTypeId($type, false)) {
                $values[$key] = $typeId;
            } else {
                unset($values[$key]);
            }
        }

        if (empty($values)) {
            // It should not have been empty, this is an impossible
            // condition
            $values = [-1];
        }

        if ($hasOperator) {
            return [$operator => $values];
        } else {
            return $values;
        }
    }
433341
public static <T> QueryParameterValue of(T value, StandardSQLTypeName type) {
    return QueryParameterValue.newBuilder()
        .setValue(valueToStringOrNull(value, type))
        .setType(type)
        .build();
  }
1155614
def encode_query_kwargs(dynamizer, kwargs):
    
    ret = {}
    for k, v in six.iteritems(kwargs):
        if '__' not in k:
            raise TypeError("Invalid query argument '%s'" % k)
        name, condition_key = k.split('__')
        # Convert ==None to IS_NULL
        if condition_key == 'eq' and is_null(v):
            condition_key = 'null'
            v = True
        # null is a special case
        if condition_key == 'null':
            ret[name] = {
                'ComparisonOperator': 'NULL' if v else 'NOT_NULL'
            }
            continue
        elif condition_key not in ('in', 'between'):
            v = (v,)
        ret[name] = {
            'AttributeValueList': [dynamizer.encode(value) for value in v],
            'ComparisonOperator': CONDITIONS[condition_key],
        }
    return ret
782411
function(identifier, typemap, args, error) {
		var bufArray = [ new Buffer([ module.exports.EnumExecutionCode.ExecFunction ]) ];
		bufArray.push(new Buffer(4)); // [1] = reserverd for total payload size, minus the execution code
		
		var buf = new Buffer(4);
		buf.writeUInt32LE(identifier.length);
		bufArray.push(buf);
		
		var tempBuf = new Buffer(identifier);
		bufArray.push(tempBuf);
		
		var payloadLength = 4 + identifier.length;
		for(var i = 0; i < args.length; i++) {
			var iStr = i.toString();
			var argtype = typemap[iStr];
			
			if(!argtype) {
				if(args[i] === null) {
					argtype = 'null';
				}
				else {
					switch(typeof args[i]) {
						case 'number':
							if(args[i] === (args[i]|0)) {
								argtype = 'int'; // Default to int for normal numbers
							}
							else {
								argtype = 'float'; // float for anything else
							}
							break;
						case 'string':
							argtype = 'string';
							break;
						case 'boolean':
							argtype = 'boolean';
							break;
						case 'undefined':
							argtype = 'undefined';
							break;
					}
				}
				typemap[iStr] = argtype;
			}
			
			var dataType = module.exports.EnumDataType[argtype];
			if(dataType !== undefined) {
				switch(dataType) {
					case module.exports.EnumDataType.byte:
						tempBuf = new Buffer(1);
						tempBuf.writeInt8(args[i], 0);
						break;
					case module.exports.EnumDataType.ubyte:
						tempBuf = new Buffer(1);
						tempBuf.writeUInt8(args[i], 0);
						break;
					case module.exports.EnumDataType.short:
						tempBuf = new Buffer(2);
						tempBuf.writeInt16LE(args[i], 0);
						break;
					case module.exports.EnumDataType.ushort:
						tempBuf = new Buffer(2);
						tempBuf.writeUInt16LE(args[i], 0);
						break;
					case module.exports.EnumDataType.int:
						tempBuf = new Buffer(4);
						tempBuf.writeInt32LE(args[i], 0);
						break;
					case module.exports.EnumDataType.uint:
						tempBuf = new Buffer(4);
						tempBuf.writeUInt32LE(args[i], 0);
						break;
					case module.exports.EnumDataType.float:
						tempBuf = new Buffer(4);
						tempBuf.writeFloatLE(args[i], 0);
						break;
					case module.exports.EnumDataType.double:
						tempBuf = new Buffer(8);
						tempBuf.writeDoubleLE(args[i], 0);
						break;
					case module.exports.EnumDataType.string:
						tempBuf = new Buffer(args[i]);
						break;
					case module.exports.EnumDataType.boolean:
						tempBuf = new Buffer(1);
						tempBuf.writeUInt8(args[i] ? 0x1 : 0x0, 0);
						break;
					case module.exports.EnumDataType.undefined:
					case module.exports.EnumDataType.null:
						tempBuf = new Buffer(0);
						break;
					default:
						error(new Error('Data type ' + dataType + ' has gone unhandled by client'));
						return;
				}
				var argHeader = new Buffer(5);
				argHeader.writeUInt8(dataType, 0);
				argHeader.writeUInt32LE(tempBuf.length, 1);
				bufArray.push(argHeader);
				bufArray.push(tempBuf);
				
				payloadLength += argHeader.length + tempBuf.length;
			}
			else {
				error(new Error('Unsupported data type argument passed to remote function'));
				return;
			}
		}
		
		bufArray[1].writeUInt32LE(payloadLength);
		
		return Buffer.concat(bufArray);
	}
1162804
def fetch_datatype(self, bucket, key, r=None, pr=None, basic_quorum=None,
                       notfound_ok=None, timeout=None, include_context=None):
        
        raise NotImplementedError
821604
function prepareQueryParams(endpointSchema) {
  const isSendInQuery = p => p.in === 'query';
  const parameters = endpointSchema.parameters || [];
  const queryParameters = parameters.filter(isSendInQuery);
  return convertParameters(queryParameters);
}
1141484
def eq_(self, value):
        ''' 
        '''
        if isinstance(value, QueryField):
            return self.__cached_id == value.__cached_id
        return QueryExpression({ self : self.get_type().wrap_value(value) })
146977
static public String safeSqlQueryIntegerValue(String in) throws Exception {
		int intValue = Integer.parseInt(in);
		
		return ""+intValue;
	}
810388
private void parseSetItem(UpdateQueryBuilder query)
  {
    Token token;

    if ((token = scanToken()) != Token.IDENTIFIER) {
      throw error(L.l("expected identifier at '{0}'", token));
    }

    String columnName = _lexeme;

    if ((token = scanToken()) != Token.EQ) {
      throw error("expected '=' at {0}", token);
    }

    ExprKraken expr = parseExpr();

    query.addItem(columnName, expr);
  }
260065
private int idToInt(String value) {
    try {
      return Integer.valueOf(value);
    } catch (NumberFormatException e) {
      throw new ConfigurationException("invalid type ID: " + value);
    }
  }
1251145
function encodeInteger(value) {
	if (value === null) {
		return values.NULL;
	} else if (!isNaN(value) && parseInt(value)==value) {
		return value + "";
	} else {
		throw new Error('Invalid integer value "' + value + '"');
	}
}
811000
def as_cql_query(self, formatted=False):
        
        sep = '\n    ' if formatted else ' '
        keyspace = protect_name(self.keyspace)
        name = protect_name(self.name)
        arg_list = ', '.join(["%s %s" % (protect_name(n), t)
                             for n, t in zip(self.argument_names, self.argument_types)])
        typ = self.return_type
        lang = self.language
        body = self.body
        on_null = "CALLED" if self.called_on_null_input else "RETURNS NULL"

        return "CREATE FUNCTION %(keyspace)s.%(name)s(%(arg_list)s)%(sep)s" \
               "%(on_null)s ON NULL INPUT%(sep)s" \
               "RETURNS %(typ)s%(sep)s" \
               "LANGUAGE %(lang)s%(sep)s" \
               "AS $$%(body)s$$" % locals()
1206239
function translate(cond, queryObj) {

    let result = '1 == 1';

    // If condition is not an array...
    if (!Array.isArray(cond)) {
        //...then it is a condition cluster
        if (cond.and) {
            result = translateAndList(cond.and, queryObj)
        }
        else if (cond.or) {
            result = translateOrList(cond.or, queryObj)
        }
        else {
            //This is an illegal subject.
            throw new Error('Invalid query Object keys. Objects must be either "and" or "or"');
        }
    }
    else {
        //...then it's a singular condition
        assert(cond.length === 3, 'Invalid condition item. Condition items must be an array of 3 items representing field, comparator, and value')

        //field
        let fieldName = cond[0];
        if (fieldName === 'id') {
            fieldName = '_key';
        }

        let isNestedQuery = false;
        if (fieldName.indexOf('*') > -1) {
            fieldName = fieldName.replace('.*', '[*]');
            isNestedQuery = true;
        }

        //comp/value
        let comp = cond[1];
        let value = cond[2];

        if (value) {

            // construct mini block
            if (comp === 'like' || comp === 'nlike') {

                value = '%' + value + '%';

            }
        }

        const paramIndex = Math.floor(Object.keys(queryObj.bindVars).length / 2);

        const paramName = 'p' + paramIndex;
        const valueName = 'v' + paramIndex;

        const aqlComp = convertComp(comp);

        //appendants

        //NOTE: unfortunatlely, dynamic queries cannot handle nested fields as at Arango 3.1
        if (isNestedQuery) {
            // FIXME: secure the fieldName variable before using point blank!!! VERY prone to AQL/SQL injection right now.
            const safeFieldName = fieldName
            result = ` c.${safeFieldName} ANY ${aqlComp} @${valueName} `;
        } else {
            result = ` c.@${paramName} ${aqlComp} @${valueName} `;
            queryObj.bindVars[paramName] = fieldName;
        }

        queryObj.bindVars[valueName] = value;

    }

    return result;

}
463729
public QueryParameters set(String key, Object value, Integer type) {
        return this.set(key, value, type, Direction.IN);
    }
648541
def query_int_attribute(self, target, display_mask, attr):
    """"""
    reply = NVCtrlQueryAttributeReplyRequest(display=self.display,
                                             opcode=self.display.get_extension_major(extname),
                                             target_id=target.id(),
                                             target_type=target.type(),
                                             display_mask=display_mask,
                                             attr=attr)
    if not reply._data.get('flags'):
        return None
    return int(reply._data.get('value'))
465892
def _query_param_from_api_repr(resource):
    """"""
    qp_type = resource["parameterType"]
    if "arrayType" in qp_type:
        klass = ArrayQueryParameter
    elif "structTypes" in qp_type:
        klass = StructQueryParameter
    else:
        klass = ScalarQueryParameter
    return klass.from_api_repr(resource)
539802
def property_value_post_conversion(val, type_info)
      case type_info.flattened_tag
      when :ghash
        GLib::HashTable.from type_info.element_type, val
      when :glist
        GLib::List.from type_info.element_type, val
      when :callback
        GirFFI::Builder.build_class(type_info.interface).wrap val
      else
        val
      end
    end