Set the initial value of Dataset variables and dimensions
8235
def _set_init_vars_and_dims(self, data_vars, coords, compat):
        
        both_data_and_coords = [k for k in data_vars if k in coords]
        if both_data_and_coords:
            raise ValueError('variables %r are found in both data_vars and '
                             'coords' % both_data_and_coords)

        if isinstance(coords, Dataset):
            coords = coords.variables

        variables, coord_names, dims = merge_data_and_coords(
            data_vars, coords, compat=compat)

        self._variables = variables
        self._coord_names = coord_names
        self._dims = dims
37600
private void initializeVars() {
        mNodeKey = mWtx.getNode().getDataKey();
        mFound = false;
        mIsRightSibling = false;
        mKeyMatches = -1;
    }
716512
def set_initial_representations(self):
        """"""
        self.update_model_dict()
        self.rc("background solid white")
        self.rc("setattr g display 0")  # Hide all pseudobonds
        self.rc("~display #%i & :/isHet & ~:%s" % (self.model_dict[self.plipname], self.hetid))
105678
def dataset_prepare(self):
        ''''''

        # Initialize the prepare subcommand's argparser
        parser = argparse.ArgumentParser(description='Preprocess a raw dialogue corpus into a dsrt dataset')
        self.init_dataset_prepare_args(parser)

        # Parse the args we got
        args = parser.parse_args(sys.argv[3:])
        args.config = ConfigurationLoader(args.config).load().data_config

        print(CLI_DIVIDER  + '\n')
        Preprocessor(**vars(args)).run()
653347
def populateFromRow(self, dataset):
        
        self._description = dataset.description
        self.setAttributesJson(dataset.attributes)
388938
def init_vars(self, S, dimK):
        """"""

        Nv = S.shape[0:self.dimN]
        if self.cri is None or Nv != self.cri.Nv:
            self.cri = cr.CDU_ConvRepIndexing(self.dsz, S, dimK, self.dimN)
            if self.opt['CUDA_CBPDN']:
                if self.cri.Cd > 1 or self.cri.Cx > 1:
                    raise ValueError('CUDA CBPDN solver can only be used for '
                                     'single channel problems')
                if self.cri.K > 1:
                    raise ValueError('CUDA CBPDN solver can not be used with '
                                     'mini-batches')
            self.Df = sl.pyfftw_byte_aligned(sl.rfftn(self.D, self.cri.Nv,
                                                      self.cri.axisN))
            self.Gf = sl.pyfftw_empty_aligned(self.Df.shape, self.Df.dtype)
            self.Z = sl.pyfftw_empty_aligned(self.cri.shpX, self.dtype)
        else:
            self.Df[:] = sl.rfftn(self.D, self.cri.Nv, self.cri.axisN)
1356182
def redim(cls, dataset, dimensions):
        
        new_dataset = dataset.data.copy()
        for name, new_dim in dimensions.items():
            if name == new_dataset.name():
                new_dataset.rename(new_dim.name)
            for coord in new_dataset.dim_coords:
                if name == coord.name():
                    coord.rename(new_dim.name)
        return new_dataset
1249012
def _load_init(self, data, ctx):
        """"""
        if self.shape:
            for self_dim, data_dim in zip(self.shape, data.shape):
                assert self_dim in (0, data_dim), \
                    "Failed loading Parameter '%s' from saved params: " \
                    "shape incompatible expected %s vs saved %s"%(
                        self.name, str(self.shape), str(data.shape))
            self.shape = tuple(i if i != 0 else j for i, j in zip(self.shape, data.shape))
        if self.dtype:
            assert np.dtype(self.dtype).type == data.dtype, \
                "Failed loading Parameter '%s' from saved params: " \
                "dtype incompatible expected %s vs saved %s"%(
                    self.name, str(self.dtype), str(data.dtype))
        if self._stype != data.stype:
            data = data.tostype(self._stype)
        if isinstance(ctx, Context):
            ctx = [ctx]
        if self._data is None:
            if self._deferred_init:
                assert ctx is None or set(ctx) == set(self._deferred_init[1]), \
                    "Failed to load Parameter '%s' on %s because it was " \
                    "previous initialized on %s."%(
                        self.name, str(ctx), str(self.list_ctx()))
                ctx = self._deferred_init[1]
            elif ctx is None:
                ctx = [cpu()]
            self._init_impl(data, ctx)
        else:
            assert ctx is None or set(ctx) == set(self.list_ctx()), \
                "Failed to load Parameter '%s' on %s because it was " \
                "previous initialized on %s."%(
                    self.name, str(ctx), str(self.list_ctx()))
            self.set_data(data)
        self._deferred_init = ()
344630
@Override protected void init() {
    super.init();

    assert 0 <= ntrees && ntrees < 1000000; // Sanity check
    // Not enough rows to run
    if (source.numRows() - response.naCnt() <=0)
      throw new IllegalArgumentException("Dataset contains too many NAs!");

    if( !classification && (!(response.isEnum() || response.isInt())))
      throw new IllegalArgumentException("Classification cannot be performed on a float column!");

    if(classification) {
      if (0.0f > sample_rate || sample_rate > 1.0f)
        throw new IllegalArgumentException("Sampling rate must be in [0,1] but found " + sample_rate);
    }

    if(regression) throw new IllegalArgumentException("SpeeDRF does not currently support regression.");
  }
81106
def _initialise_data(self, memmap_dir=None):
        """"""

        if self.number_values == 0:
            pass
        elif self.data_type.nptype is None:
            self._data = []
        else:
            if memmap_dir:
                memmap_file = tempfile.NamedTemporaryFile(
                    mode='w+b', prefix="nptdms_", dir=memmap_dir)
                self._data = np.memmap(
                    memmap_file.file,
                    mode='w+',
                    shape=(self.number_values,),
                    dtype=self.data_type.nptype)
            else:
                self._data = np.zeros(
                    self.number_values, dtype=self.data_type.nptype)
            self._data_insert_position = 0
        if self._data is not None:
            log.debug("Allocated %d sample slots for %s", len(self._data),
                      self.path)
        else:
            log.debug("Allocated no space for %s", self.path)
1184470
def apply_dataset_vfunc(
    func,
    *args,
    signature,
    join='inner',
    dataset_join='exact',
    fill_value=_NO_FILL_VALUE,
    exclude_dims=frozenset(),
    keep_attrs=False
):
    
    from .dataset import Dataset
    first_obj = args[0]  # we'll copy attrs from this in case keep_attrs=True

    if (dataset_join not in _JOINS_WITHOUT_FILL_VALUES and
            fill_value is _NO_FILL_VALUE):
        raise TypeError('to apply an operation to datasets with different '
                        'data variables with apply_ufunc, you must supply the '
                        'dataset_fill_value argument.')

    if len(args) > 1:
        args = deep_align(args, join=join, copy=False, exclude=exclude_dims,
                          raise_on_invalid=False)

    list_of_coords = build_output_coords(args, signature, exclude_dims)
    args = [getattr(arg, 'data_vars', arg) for arg in args]

    result_vars = apply_dict_of_variables_vfunc(
        func, *args, signature=signature, join=dataset_join,
        fill_value=fill_value)

    if signature.num_outputs > 1:
        out = tuple(_fast_dataset(*args)
                    for args in zip(result_vars, list_of_coords))
    else:
        coord_vars, = list_of_coords
        out = _fast_dataset(result_vars, coord_vars)

    if keep_attrs and isinstance(first_obj, Dataset):
        if isinstance(out, tuple):
            out = tuple(ds._copy_attrs_from(first_obj) for ds in out)
        else:
            out._copy_attrs_from(first_obj)
    return out
207576
def _initialize_variables(self):
    """"""
    # Initialize global variables.
    self._global_vars = {}  # Indexed by (MTF dimension, mesh dimension)
    for mtf_dimension_name in (
        self._layout_validator.splittable_mtf_dimension_names):
      for mesh_dimension_name in (
          self._layout_validator.mesh_dimension_name_to_size):
        name = _global_var_name(mtf_dimension_name, mesh_dimension_name)
        self._global_vars[(mtf_dimension_name, mesh_dimension_name)] = (
            self._model.NewBoolVar(name))

    # Initialize local variables.
    self._local_vars = {}  # Indexed by (tensorflow dimension set), then name of
    # assignment.
    for mtf_dimension_set in self._mtf_dimension_sets:
      self._local_vars[mtf_dimension_set] = {}
      for assignment in self._assignments[mtf_dimension_set]:
        # TODO(joshuawang): Avoid hash collision no matter what dimension names
        # are; don't hash by this local var name, swap to using a tuple encoding
        # of the full assignment instead.
        name = _local_var_name(mtf_dimension_set, assignment)
        self._local_vars[mtf_dimension_set][name] = (
            self._model.NewBoolVar(name))

    # Initialize memory variable. We need a crude upper bound on memory, so we
    # use the total size of all tensors under the empty assignment.
    # NOTE(joshuawang): This bound could be improved by factoring in the
    # schedule.
    memory_upper_bound = 0
    for tensor_name in self._graph.get_all_tensor_names():
      if self._graph.is_tensor_on_canonical_device(tensor_name):
        memory_upper_bound += int(self._graph.get_tensor_size(tensor_name))
    self._memory_var = self._model.NewIntVar(0, memory_upper_bound, "z")
1164491
public void initialize( List<Point> dataSet ) {
		bestFitPoints.clear();

		if( dataSet.size() > matchToInput.length ) {
			matchToInput = new int[ dataSet.size() ];
			bestMatchToInput = new int[ dataSet.size() ];
		}
	}
746584
def prepare_data(problem, hparams, params, config):
  """"""
  input_fn = problem.make_estimator_input_fn(
      tf.estimator.ModeKeys.EVAL, hparams, force_repeat=True)
  dataset = input_fn(params, config)
  features, _ = dataset.make_one_shot_iterator().get_next()
  inputs, labels = features["targets"], features["inputs"]
  inputs = tf.to_float(inputs)
  input_shape = inputs.shape.as_list()
  inputs = tf.reshape(inputs, [hparams.batch_size] + input_shape[1:])
  labels = tf.reshape(labels, [hparams.batch_size])
  return inputs, labels, features
52353
private void initializeVariables() throws SAXException {
        prev = '\u0000';
        // First line
        line = 0;
        column = 1;
        linePrev = 0;
        columnPrev = 1;
        nextCharOnNewLine = true;

        // Set up the buffers for data and names
        dataBufferPos = 0;
        dataBuffer = new char[DATA_BUFFER_INITIAL];
        nameBufferPos = 0;
        nameBuffer = new char[NAME_BUFFER_INITIAL];

        // Set up the DTD hash tables
        elementInfo = new HashMap<>();
        entityInfo = new HashMap<>();
        notationInfo = new HashMap<>();
        skippedPE = false;

        // Set up the variables for the current
        // element context.
        currentElement = null;
        currentElementContent = CONTENT_UNDECLARED;

        // Set up the input variables
        sourceType = INPUT_NONE;
        inputStack = new LinkedList<>();
        entityStack = new LinkedList<>();
        tagAttributePos = 0;
        tagAttributes = new String[100];
        //rawReadBuffer = new byte[READ_BUFFER_MAX];
        readBufferOverflow = -1;

        inLiteral = false;
        expandPE = false;
        peIsError = false;

        doReport = false;

        inCDATA = false;

        symbolTable = new Object[SYMBOL_TABLE_LENGTH][];

        if (handler.checkNormalization) {
            normalizationChecker = new NormalizationChecker(handler);
            normalizationChecker.setErrorHandler(handler.getErrorHandler());
            normalizationChecker.start();
        } else {
            normalizationChecker = null;
        }
        if (handler.characterHandler != null) {
            characterHandler = handler.characterHandler;
            handler.characterHandler = null;
            characterHandler.start();
        } else {
            characterHandler = null;
        }
    }
795951
def dump_to_store(dataset, store, writer=None, encoder=None,
                  encoding=None, unlimited_dims=None):
    """"""
    if writer is None:
        writer = ArrayWriter()

    if encoding is None:
        encoding = {}

    variables, attrs = conventions.encode_dataset_coordinates(dataset)

    check_encoding = set()
    for k, enc in encoding.items():
        # no need to shallow copy the variable again; that already happened
        # in encode_dataset_coordinates
        variables[k].encoding = enc
        check_encoding.add(k)

    if encoder:
        variables, attrs = encoder(variables, attrs)

    store.store(variables, attrs, check_encoding, writer,
                unlimited_dims=unlimited_dims)
223139
def setDataset(self, dataset):
        
        self._dataset = dataset
        
        # setup the tooltip
        tip = []
        tip.append('<b>%s</b>' % dataset.name())
        for value in dataset.values():
            value_text = []
            for key, val in sorted(value.items()):
                if val == dataset.name():
                    continue
                
                axis = self.axis(key)
                if axis and axis.labelFormat():
                    val = axis.labelFormat().format(val)
                value_text.append('%s: %s' % (key, val))
            
            tip.append('<p>%s</p>' % ', '.join(value_text))
        self.setToolTip(''.join(tip))