Basic construction. Only the data is required
334178
public static <T> Decoration<T> of(Decorator<T> decorator, T data) {
        Validate.notNull(decorator, "The decorator is required");
        Validate.notNull(data, "The decoration data is required");
        return new Decoration<>(decorator, data, null);
    }
384669
def buildData(self, key, default=None):
        
        return self._buildData.get(nativestring(key), default)
1081323
public static <T> BaseDTO<T> buildSuccess(T data) {
        BaseDTO<T> dto = new BaseDTO<>();
        dto.setData(data);
        return dto;
    }
108930
def build(ctx, inputs, output, cs):
    """"""
    click.echo('chemdataextractor.dict.build')
    dt = DictionaryTagger(lexicon=ChemLexicon(), case_sensitive=cs)
    names = []
    for input in inputs:
        for line in input:
            tokens = line.split()
            names.append(tokens)
    dt.build(words=names)
    dt.save(output)
816466
function build() {
    // Start creating the body of the new Type constructor, first calling super()
    var _ret = buildIdentity.call(this);
    var typeId = _ret.typeId;
    var typeName = _ret.typeName;
    var body =
        '\tvar opts = options ? options : {};\n' +
        '\tthis.constructor.util._extend(this, opts.props);\n' +
        '\tthis.constructor.super_.call(this, opts.buffer, opts.offset' +
        (typeId ? '' : ', true') +
        ');\n';
    // Init fields
    body += _ret.body;
    body += buildSerialize.call(this);
    body += buildDeserialize.call(this);
    // Add to body all the read/write methods
    for (var i = 0; i < this._methods.length; i++) {
        body += this._methods[i];
    }
    if (logger.isDebugEnabled()) {
        logger.debug('Body for %s type constructor:', typeName);
        logger.debug('\n' + body);
    }
    return createConstructor(body, typeId, typeName);
}
857850
def _fromdata(self, data, maxval=None):
        """"""
        data = numpy.array(data, ndmin=2, copy=True)
        if data.dtype.kind not in "uib":
            raise ValueError("not an integer type: %s" % data.dtype)
        if data.dtype.kind == 'i' and numpy.min(data) < 0:
            raise ValueError("data out of range: %i" % numpy.min(data))
        if maxval is None:
            maxval = numpy.max(data)
            maxval = 255 if maxval < 256 else 65535
        if maxval < 0 or maxval > 65535:
            raise ValueError("data out of range: %i" % maxval)
        data = data.astype('u1' if maxval < 256 else '>u2')
        self._data = data
        if data.ndim > 2 and data.shape[-1] in (3, 4):
            self.depth = data.shape[-1]
            self.width = data.shape[-2]
            self.height = data.shape[-3]
            self.magicnum = b'P7' if self.depth == 4 else b'P6'
        else:
            self.depth = 1
            self.width = data.shape[-1]
            self.height = data.shape[-2]
            self.magicnum = b'P5' if maxval > 1 else b'P4'
        self.maxval = maxval
        self.tupltypes = [self._types[self.magicnum]]
        self.header = self._header()
312153
def build_row(data = self.data)
      values = data.to_a
      keys = self.data.column_names.to_a
      hash = {}
      values.each_with_index do |val, i|
        key = (keys[i] || i).to_s
        hash[key] = val
      end
      line = hash.to_json.to_s
      output << "  #{line}"
    end
1308280
def create(self, data, inlineparent = None):
        '''
        
        '''
        try:
            return self.struct.unpack(data)[0]
        except struct.error as exc:
            raise BadFormatError(exc)
274753
protected function buildData()
  {
    $handle = opendir($this->folderPath);
    while (false !== ($file = readdir($handle))) {
      $vext = str_replace(',', '|', strtolower($this->extensions));
      if (!is_dir($file) && $file != '.' && $file != '..' && ($this->extensions == '' || preg_match("/\.(" . $vext . ")$/", strtolower($file)))) {
        $this->files[] = $file;
      }
    }
  }
443502
def from_data(data):
    
    if len(data) == 0:  # pragma: no cover
        return None
    else:
        ptable = PrettyTable()
        ptable.field_names = data[0].keys()
        for row in data:
            ptable.add_row(row)
        return ptable
1341497
def create(self, data, inlineparent = None):
        '''
        
        '''
        if self.size > 0:
            r = self.parse(data)
            if r is None:
                raise ParseError('data is not enough to create an array of size ' + self.size)
            else:
                return r[0]
        else:
            v = []
            start = 0
            while start < len(data):
                r = self.innerparser.parse(data[start:], None)
                if r is None:
                    break
                v.append(r[0])
                start += r[1]
            return v
394740
def build_result(data):
    """"""
    more = {}
    for key, value  in data.items():
        if key != 'elements':
            newnode = value
        else:
            newnode = {}
            for el in value:
                nkey, nvalue = process_node(el)
                newnode[nkey] = nvalue

        more[key] = newnode

    return more
1125769
def construction(self, column=None, value=None, **kwargs):
        
        return self._resolve_call('GIC_CONSTRUCTION', column, value, **kwargs)
804272
public function buildData()
    {
        $runtime = (microtime(true) - $this->kernel->getStartTime()) * 1000;

        $this->data = [
            'runtime' => $runtime
        ];
    }
944131
def builddata(self, mopt=None, data=None, pdata=None, prior=None):
        
        if pdata is None:
            if data is None:
                raise ValueError('no data or pdata')
            pdata = gvar.BufferDict()
            for m in self.flatmodels:
                pdata[m.datatag] = (
                    m.builddata(data) if m.ncg <= 1 else
                    MultiFitter.coarse_grain(m.builddata(data), m.ncg)
                    )
        else:
            npdata = gvar.BufferDict()
            for m in self.flatmodels:
                npdata[m.datatag] = pdata[m.datatag]
            pdata = npdata
        if mopt is not None:
            fitfcn = self.buildfitfcn()
            p_all = self.buildprior(prior=prior, mopt=None)
            f_all = fitfcn(p_all)

            # fcn with part we want to keep
            p_trunc = self.buildprior(prior=prior, mopt=mopt)
            f_trunc = fitfcn(p_trunc)

            # correct pdata
            pdata = gvar.BufferDict(pdata)
            if not self.ratio:
                for m in self.flatmodels:
                    pdata[m.datatag] += f_trunc[m.datatag] - f_all[m.datatag]
            else:
                for m in self.flatmodels:
                    ii = (gvar.mean(f_all[m.datatag]) != 0)
                    ratio = f_trunc[m.datatag][ii] / f_all[m.datatag][ii]
                    pdata[m.datatag][ii] *= ratio
        return pdata
1021013
def create(self, no_data=False):
        """"""

        if self.query:
            ddl_statement = self.compile_create_as()
        else:
            ddl_statement = self.compile_create()

        if no_data:
            ddl_statement += '\nWITH NO DATA'

        return ddl_statement, self.query_values
657929
def load_data_and_build(self, filename, delimiter=","):
        
        data = np.genfromtxt(
            filename, dtype=float, delimiter=delimiter, names=True
        )
        data = data.view(np.float64).reshape(data.shape + (-1,))

        X = data[:, 0:-1]
        Y = data[:, -1]

        self.build(X=X, Y=Y)