Set float type property into the DMatrix
           for numpy 2d array input

        Parameters
        ----------
        field: str
            The field name of the information

        data: numpy array
            The array of data to be set
977388
def set_float_info_npy2d(self, field, data):
        
        if getattr(data, 'base', None) is not None and \
           data.base is not None and isinstance(data, np.ndarray) \
           and isinstance(data.base, np.ndarray) and (not data.flags.c_contiguous):
            warnings.warn("Use subset (sliced data) of np.ndarray is not recommended " +
                          "because it will generate extra copies and increase memory consumption")
            data = np.array(data, copy=True, dtype=np.float32)
        else:
            data = np.array(data, copy=False, dtype=np.float32)
        c_data = data.ctypes.data_as(ctypes.POINTER(ctypes.c_float))
        _check_call(_LIB.XGDMatrixSetFloatInfo(self.handle,
                                               c_str(field),
                                               c_data,
                                               c_bst_ulong(len(data))))
450468
def set_data(self, data=None, **kwargs):
        
        if data is None:
            pos = None
        else:
            if isinstance(data, tuple):
                pos = np.array(data).T.astype(np.float32)
            else:
                pos = np.atleast_1d(data).astype(np.float32)

            if pos.ndim == 1:
                pos = pos[:, np.newaxis]
            elif pos.ndim > 2:
                raise ValueError('data must have at most two dimensions')

            if pos.size == 0:
                pos = self._line.pos

                # if both args and keywords are zero, then there is no
                # point in calling this function.
                if len(kwargs) == 0:
                    raise TypeError("neither line points nor line properties"
                                    "are provided")
            elif pos.shape[1] == 1:
                x = np.arange(pos.shape[0], dtype=np.float32)[:, np.newaxis]
                pos = np.concatenate((x, pos), axis=1)
            # if args are empty, don't modify position
            elif pos.shape[1] > 3:
                raise TypeError("Too many coordinates given (%s; max is 3)."
                                % pos.shape[1])

        # todo: have both sub-visuals share the same buffers.
        line_kwargs = {}
        for k in self._line_kwargs:
            if k in kwargs:
                k_ = self._kw_trans[k] if k in self._kw_trans else k
                line_kwargs[k] = kwargs.pop(k_)
        if pos is not None or len(line_kwargs) > 0:
            self._line.set_data(pos=pos, **line_kwargs)

        marker_kwargs = {}
        for k in self._marker_kwargs:
            if k in kwargs:
                k_ = self._kw_trans[k] if k in self._kw_trans else k
                marker_kwargs[k_] = kwargs.pop(k)
        if pos is not None or len(marker_kwargs) > 0:
            self._markers.set_data(pos=pos, **marker_kwargs)
        if len(kwargs) > 0:
            raise TypeError("Invalid keyword arguments: %s" % kwargs.keys())
1170104
def set_field(self, name, value):
        """"""
        f = getattr(self, name, None)
        if isinstance(f, DataField):
            f.set(self, value)
        else:
            raise FieldError("No field named '%s'" % name)
941251
def django_field_to_index(field, **attr):
    '''
    
    '''

    dj_type = field.get_internal_type()

    if dj_type in ('DateField', 'DateTimeField'):
        return DateField(**attr)
    elif dj_type in ('BooleanField', 'NullBooleanField'):
        return BooleanField(**attr)
    elif dj_type in ('DecimalField', 'FloatField'):
        return NumberField(coretype='float', **attr)
    elif dj_type in ('PositiveSmallIntegerField', 'SmallIntegerField'):
        return NumberField(coretype='short', **attr)
    elif dj_type in ('IntegerField', 'PositiveIntegerField', 'AutoField'):
        return NumberField(coretype='integer', **attr)
    elif dj_type in ('BigIntegerField'):
        return NumberField(coretype='long', **attr)

    return StringField(**attr)
1092660
def set_python(self, value):
        """"""
        if not isinstance(value, (list, type(None))):
            raise ValidationError(
                self.record,
                "Field '{}' must be set to a list, not '{}'".format(
                    self.name,
                    value.__class__
                )
            )
        value = value or []
        self.cursor._validate_list(value)
        return super(ListField, self).set_python(value)
408111
function setFieldValuesNestedArray (field, items) {
    // do not process unless value
    if (!defined(items)) {
        return
    }
    // property value must be array of items
    assert.ok(Array.isArray(items), 'expected array for '+field.property)
    // index of item in values array
    var idx = 0
    // create entry in field values for each item in array
    _.each(items, item => {
        // index string for field name
        var nameIdx = '['+idx+']'
        // each entry in values is an array of fields with values
        var values = []
        // add each sub field to values with value from record item
        _.each(field.fields, field => {
            // clone field to change properties for local version
            field = _.cloneDeep(field)
            // set value from item
            setFieldValue(item, field)
            // replace index in field name
            field.name = field.name.replace('[0]', nameIdx)
            // add field to list of values for item
            values.push(field)
        })
        // add row to values
        field.values.push(values)
        // increment row count
        idx++
    })
    // get index string for new row
    var nameIdx = '['+idx+']'
    // update row index for field names that will be used for a new row
    _.each(field.fields, field => {
        field.name = field.name.replace('[0]', nameIdx)
    })
}
389352
def set_value_field(self, model, field_name):
        
        fields = fields_for_model(model, fields=[field_name])
        self.fields['value'] = fields[field_name]
182974
def _set_types(self):
        """"""
        # If we given something that is not an int or a float we raise
        # a RuntimeError as we do not want to have to guess if the given
        # input should be interpreted as an int or a float, for example the
        # interpretation of the string "1" vs the interpretation of the string
        # "1.0".
        for c in (self.x, self.y):
            if not ( isinstance(c, int) or isinstance(c, float) ):
                raise(RuntimeError('x, y coords should be int or float'))

        if isinstance(self.x, int) and isinstance(self.y, int):
            self._dtype = "int"
        else:
            # At least one value is a float so promote both to float.
            self.x = float(self.x)
            self.y = float(self.y)
            self._dtype = "float"
534555
def set_float(val):
    
    out = None
    if not val in (None, ''):
        try:
            out = float(val)
        except ValueError:
            return None
        if numpy.isnan(out):
            out = default
    return out
778849
async def load_field(obj, elem_type, params=None, elem=None):
    
    if issubclass(elem_type, x.UVarintType) or issubclass(elem_type, x.IntType) or isinstance(obj, (int, bool)):
        return set_elem(elem, obj)

    elif issubclass(elem_type, x.BlobType):
        fvalue = await load_blob(obj, elem_type)
        return set_elem(elem, fvalue)

    elif issubclass(elem_type, x.UnicodeType) or isinstance(elem, str):
        return set_elem(elem, obj)

    elif issubclass(elem_type, x.VariantType):
        fvalue = await load_variant(obj, elem=get_elem(elem), elem_type=elem_type, params=params)
        return set_elem(elem, fvalue)

    elif issubclass(elem_type, x.ContainerType):  # container ~ simple list
        fvalue = await load_container(obj, elem_type, params=params, container=get_elem(elem))
        return set_elem(elem, fvalue)

    elif issubclass(elem_type, x.MessageType):
        fvalue = await load_message(obj, msg_type=elem_type, msg=get_elem(elem))
        return set_elem(elem, fvalue)

    else:
        raise TypeError
1298405
public void set( int index , double value ) {
        if( mat.getType() == MatrixType.DDRM ) {
            ((DMatrixRMaj) mat).set(index, value);
        } else if( mat.getType() == MatrixType.FDRM ) {
            ((FMatrixRMaj) mat).set(index, (float)value);
        } else {
            throw new RuntimeException("Not supported yet for this matrix type");
        }
    }
1224566
def setdict(self, D=None):
        """"""

        if D is not None:
            self.D = np.asarray(D, dtype=self.dtype)
        self.Df = sl.rfftn(self.D, self.cri.Nv, self.cri.axisN)
268164
def _set_fields(self, fields):
        """"""
        for f in fields:
            if hasattr(self, f):
                setattr(self, f, fields[f])
            else:
                raise TypeError("'{arg}' is an invalid argument for {instance_type}".format(arg=f, instance_type=self.__class__.__name__))
784898
def fields(self, value):
        """"""
        if type(value) is list:
            self._fields = value
        else:
            raise TypeError("Input must be a list")
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
883681
def p_set_type(self, p):
        ''''''
        p[0] = ast.SetType(value_type=p[3], annotations=p[5])
244867
def set_attrs(self):
        
        self.attrs.table_type = str(self.table_type)
        self.attrs.index_cols = self.index_cols()
        self.attrs.values_cols = self.values_cols()
        self.attrs.non_index_axes = self.non_index_axes
        self.attrs.data_columns = self.data_columns
        self.attrs.nan_rep = self.nan_rep
        self.attrs.encoding = self.encoding
        self.attrs.errors = self.errors
        self.attrs.levels = self.levels
        self.attrs.metadata = self.metadata
        self.set_info()