Infer the :class:`~ibis.expr.datatypes.Array` type of `values`.
196122
def infer_list(values: List[GenericAny]) -> Array:
    """"""
    if not values:
        return Array(null)
    return Array(highest_precedence(map(infer, values)))
658152
function inferTypeByKeyword(schema) {
  for (const keyword of objectKeywords) {
    if (keyword in schema) {
      return 'object'
    }
  }
  for (const keyword of arrayKeywords) {
    if (keyword in schema) {
      return 'array'
    }
  }
  return schema.type
}
1018218
def infer_type(expr, scope):
    """"""
    # Do we know what the member is?
    if isinstance(expr.member, ast.Literal):
        member = expr.member.value
    else:
        return protocol.AnyType

    container_type = infer_type(expr.obj, scope)

    try:
        # We are not using lexical scope here on purpose - we want to see what
        # the type of the member is only on the container_type.
        return structured.reflect(container_type, member) or protocol.AnyType
    except NotImplementedError:
        return protocol.AnyType
153765
def visitArrayExpr(self, ctx: jsgParser.ArrayExprContext):
        
        from pyjsg.parser_impl.jsg_ebnf_parser import JSGEbnf

        from pyjsg.parser_impl.jsg_valuetype_parser import JSGValueType
        self._types = [JSGValueType(self._context, vt) for vt in ctx.valueType()]
        if ctx.ebnfSuffix():
            self._ebnf = JSGEbnf(self._context, ctx.ebnfSuffix())
153685
def from_value(value):
        
        value = ArrayConverter.to_nullable_array(value)
        if value != None:
            return AnyValueArray(value)
        return AnyValueArray()
1152241
def get_kind(self, value):
        """"""
        if isinstance(value, float):
            return 'f'
        elif isinstance(value, int):
            return 'i'
        else:
            raise ValueError("Only integer or floating point values can be stored.")
80173
def get_values(self, idx):
        
        if isinstance(idx, list):
            idx = np.array(idx, dtype=int)

        return self._data[:, idx]
343442
function type(value) {
  let valueType = typeof value;
  if (Array.isArray(value)) {
    valueType = 'array';
  } else if (value instanceof Date) {
    valueType = 'date';
  } else if (value === null) {
    valueType = 'null';
  }

  return valueType;
}
135033
function dtype( value ) {
	var type,
		dt;
	if ( value === null ) {
		return 'null';
	}
	// Check for base types:
	type = typeof value;
	switch ( type ) {
		case 'undefined':
		case 'boolean':
		case 'number':
		case 'string':
		case 'function':
		case 'symbol':
			return type;
	}
	// Resort to slower look-up:
	type = typeName( value );

	// Is value a known array type?
	dt = getType( type );
	if ( dt ) {
		return dt;
	}
	// Is value a buffer object?
	if ( type === 'Buffer' || type === 'ArrayBuffer' ) {
		return 'binary';
	}
	// Assume the value is a generic object (Object|Class instance) which could contain any or multiple data types...
	return 'generic';
}
579325
def withValues(cls, *values):
        

        class X(cls):
            subtypeSpec = cls.subtypeSpec + constraint.SingleValueConstraint(
                *values)

        X.__name__ = cls.__name__
        return X
847529
def _infer_fill_value(val):
    

    if not is_list_like(val):
        val = [val]
    val = np.array(val, copy=False)
    if is_datetimelike(val):
        return np.array('NaT', dtype=val.dtype)
    elif is_object_dtype(val.dtype):
        dtype = lib.infer_dtype(ensure_object(val), skipna=False)
        if dtype in ['datetime', 'datetime64']:
            return np.array('NaT', dtype=_NS_DTYPE)
        elif dtype in ['timedelta', 'timedelta64']:
            return np.array('NaT', dtype=_TD_DTYPE)
    return np.nan
608123
def _infer_embedded_object(value):
    

    if value is None:
        # The default behavior is to assume that a value of None is not
        # an embedded object. If the user wants that, they must specify
        # the embedded_object parameter.
        return False

    if isinstance(value, list):
        if not value:
            # The default behavior is to assume that an empty array value
            # is not an embedded object. If the user wants that, they must
            # specify the embedded_object parameter.
            return False
        value = value[0]

    if isinstance(value, CIMInstance):
        # The default behavior is to produce 'instance', although 'object'
        # would also be valid.
        return 'instance'

    if isinstance(value, CIMClass):
        return 'object'

    return False
1322134
def field_value(self, value):
        
        if not self.is_array:
            return self.field_type(value)

        if isinstance(value, (list, tuple, set)):
            return [self.field_type(item) for item in value]
        return self.field_type(value)
1065233
def c_array(ctype, values):
    """"""
    if isinstance(values, np.ndarray) and values.dtype.itemsize == ctypes.sizeof(ctype):
        return (ctype * len(values)).from_buffer_copy(values)
    return (ctype * len(values))(*values)
474293
def is_array(self, data_type):
    '''
    '''

    # Split off any brackets
    data_type = data_type.split('[')[0].strip()

    return data_type.lower() in self.array_types
533913
def _get_values(value):
    
    if (isinstance(value, tuple) and (2 <= len(value) <= 3) and
            all(hasattr(i, "__int__") for i in value)):
        # We use values[1] + 1 as stop value for (x)range to maintain
        # the behavior of using tuples as field `values`
        return range(*((int(value[0]), int(value[1]) + 1) +
                       tuple(int(v) for v in value[2:])))
    return value
721554
def _as_array(arr, dtype=None):
    
    if arr is None:
        return None
    if isinstance(arr, np.ndarray) and dtype is None:
        return arr
    if isinstance(arr, integer_types + (float,)):
        arr = [arr]
    out = np.asarray(arr)
    if dtype is not None:
        if out.dtype != dtype:
            out = out.astype(dtype)
    if out.dtype not in _ACCEPTED_ARRAY_DTYPES:
        raise ValueError("'arr' seems to have an invalid dtype: "
                         "{0:s}".format(str(out.dtype)))
    return out