Add a new field to the Datamat with the dtype of the
        like_array and the shape of the like_array except for the first
        dimension which will be instead the field-length of this Datamat.
427882
def add_field_like(self, name, like_array):
        
        new_shape = list(like_array.shape)
        new_shape[0] = len(self)
        new_data = ma.empty(new_shape, like_array.dtype)
        new_data.mask = True
        self.add_field(name, new_data)
1242059
def addfield(self, pkt, s, val):
        """"""
        if self.length_of(pkt) == 8:
            return s + struct.pack(self.fmt[0] + "B", val)
        if self.length_of(pkt) == 16:
            return s + struct.pack(self.fmt[0] + "H", val)
        if self.length_of(pkt) == 32:
            return s + struct.pack(self.fmt[0] + "2H", val)  # TODO: fix!
        if self.length_of(pkt) == 48:
            return s + struct.pack(self.fmt[0] + "3H", val)  # TODO: fix!
        elif self.length_of(pkt) == 64:
            return s + struct.pack(self.fmt[0] + "Q", val)
        elif self.length_of(pkt) == 128:
            # TODO: FIX THE PACKING!!
            return s + struct.pack(self.fmt[0] + "16s", raw(val))
        else:
            return s
979671
def _add_item(self, dim_vals, data, sort=True, update=True):
        
        sort = sort and self.sort
        if not isinstance(dim_vals, tuple):
            dim_vals = (dim_vals,)

        self._item_check(dim_vals, data)

        # Apply dimension types
        dim_types = zip([kd.type for kd in self.kdims], dim_vals)
        dim_vals = tuple(v if None in [t, v] else t(v) for t, v in dim_types)
        valid_vals = zip(self.kdims, dim_vals)

        for dim, val in valid_vals:
            if dim.values and val is not None and val not in dim.values:
                raise KeyError('%s dimension value %s not in'
                               ' specified dimension values.' % (dim, repr(val)))

        # Updates nested data structures rather than simply overriding them.
        if (update and (dim_vals in self.data)
            and isinstance(self.data[dim_vals], (MultiDimensionalMapping, OrderedDict))):
            self.data[dim_vals].update(data)
        else:
            self.data[dim_vals] = data

        if sort:
            self._resort()
592747
def add_field(self, name, default_value=None):
        """"""
        self._fields[name] = default_value

        def func(cluster):
            return self.get(name, cluster)

        setattr(self, name, func)
575610
def field(self, name, fieldType="C", size="50", decimal=0):
        """"""
        self.fields.append((name, fieldType, size, decimal))
1168646
def add_fields(self, fields):
        
        for k, v in fields.items():
            if k not in self._fields:
                self._fields[k] = v
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))))
160422
public void addField(JMFType field) {
    if (field == null)
      throw new NullPointerException("Tuple field cannot be null");
    JSType newField = (JSType)field;
    if (fields == null)
      fields = new JSType[1];
    else {
      JSType[] oldFields = fields;
      fields = new JSType[oldFields.length + 1];
      System.arraycopy(oldFields, 0, fields, 0, oldFields.length);
    }
    newField.parent = this;
    newField.siblingPosition = fields.length - 1;
    fields[newField.siblingPosition] = newField;
  }
573542
def add_attr2fields(self, attr_name, attr_val, fields=[], exclude=[], include_all_if_empty=True):
        
        for f in self.filter_fields(fields, exclude, include_all_if_empty):
            f = self.fields[f.name]
            org_val = f.widget.attrs.get(attr_name, '')
            f.widget.attrs[attr_name] = '%s %s' % (org_val, attr_val) if org_val else attr_val
1086947
def addfield(self, pkt, s, val):
        
        res = b""
        for p in val:
            res += self.i2m(pkt, p)
        if (isinstance(pkt, _GenericTLSSessionInheritance) and
            _tls_version_check(pkt.tls_session.tls_version, 0x0304) and
                not isinstance(pkt, TLS13ServerHello)):
            return s + res
        if not pkt.type:
            pkt.type = 0
        hdr = struct.pack("!B", pkt.type) + s[1:5]
        return hdr + res
1226851
def setField(self, new_value):
        
        self.B = self.B._replace(val=new_value)
823947
def add_field(self, descriptor):
        
        self.__current_descriptor.setdefault('fields', [])
        self.__current_descriptor['fields'].append(descriptor)
        self.__build()
        return self.__fields[-1]
56497
def add(*args)
      args.flatten! # allow [] as a param
      args = args.collect(&:to_sym)

      # make the columns inheritable
      @_inheritable.concat(args)
      # then add columns to @set (unless they already exist)
      args.each { |a| @set << ActiveScaffold::DataStructures::Column.new(a.to_sym, @active_record_class) unless find_by_name(a) }
    end
612886
def ExpandDims(a, dim):
    
    shape = list(a.shape)
    if dim >= 0:
        shape.insert(dim, 1)
    else:
        shape.insert(len(shape) + dim + 1, 1)
    return np.copy(a).reshape(*shape),
330513
def add_name(self, name_attr, space_attr, new_schema):
        # type: (Text, Optional[Text], NamedSchema) -> Name
        
        to_add = Name(name_attr, space_attr, self.default_namespace)

        if to_add.fullname in VALID_TYPES:
            fail_msg = '%s is a reserved type name.' % to_add.fullname
            raise SchemaParseException(fail_msg)
        elif to_add.fullname in self.names:
            fail_msg = 'The name "%s" is already in use.' % to_add.fullname
            raise SchemaParseException(fail_msg)

        self.names[to_add.fullname] = new_schema
        return to_add
1020879
def add_type_pattern(self, m, type_bits):
        
        field = iter(type_bits)
        for i in range(7):
            bit = int(next(field))

            #Skip the timing bits
            if i < 6:
                m[8][i] = bit
            else:
                m[8][i+1] = bit

            if -8 < -(i+1):
                m[-(i+1)][8] = bit

        for i in range(-8,0):
            bit = int(next(field))

            m[8][i] = bit

            i = -i
            #Skip timing column
            if i > 6:
                m[i][8] = bit
            else:
                m[i-1][8] = bit
1045337
def add_row(self, row):

        """"""

        if self._field_names and len(row) != len(self._field_names):
            raise Exception("Row has incorrect number of values, (actual) %d!=%d (expected)" %(len(row),len(self._field_names)))
        if not self._field_names:
            self.field_names = [("Field %d" % (n+1)) for n in range(0,len(row))]
        self._rows.append(list(row))