The function generating the data.
326999
def generate_data(self, data_dir, tmp_dir, task_id=-1):
    """"""
    filepath_fns = {
        problem.DatasetSplit.TRAIN: self.training_filepaths,
        problem.DatasetSplit.EVAL: self.dev_filepaths,
        problem.DatasetSplit.TEST: self.test_filepaths,
    }

    # We set shuffled=True as we don't want to shuffle on disk later.
    split_paths = [(split["split"], filepath_fns[split["split"]](
        data_dir, split["shards"], shuffled=True))
                   for split in self.dataset_splits]
    all_paths = []
    for _, paths in split_paths:
      all_paths.extend(paths)

    if self.is_generate_per_split:
      for split, paths in split_paths:
        generator_utils.generate_files(
            self.generate_encoded_samples(data_dir, tmp_dir, split),
            paths,
            cycle_every_n=self.total_number_of_frames // len(paths))
    else:
      generator_utils.generate_files(
          self.generate_encoded_samples(data_dir, tmp_dir,
                                        problem.DatasetSplit.TRAIN),
          all_paths,
          cycle_every_n=self.total_number_of_frames // len(all_paths))
843891
def gen(name, data):
        """"""
        return '---- dataentry %s ----\n%s\n----' % (name, '\n'.join(
            '%s:%s' % (attr, value) for attr, value in data.items()))
806654
function generateData(numDimensions, numPoints) {
  const data = tf.tidy(() => {
    return tf.linspace(0, 1, numPoints * numDimensions)
        .reshape([numPoints, numDimensions])
        .add(tf.randomUniform([numPoints, numDimensions]));
  });
  return data;
}
352798
def make_data(n,m):
    """"""
    p = {}
    for i in range(1,m+1):
        for j in range(1,n+1):
            p[i,j] = random.randint(1,10)
    return p
819821
def _gen_doc(cls, summary, full_name, identifier, example_call, doc_str,
                 show_examples):
        """"""
        ret = docstrings.dedents("""
            %s

            This plotting method adds data arrays and plots them via
            :class:`%s` plotters

            To plot data from a netCDF file type::

                >>> psy.plot.%s(%s)

            %s""" % (summary, full_name, identifier, example_call, doc_str))

        if show_examples:
            ret += '\n\n' + cls._gen_examples(identifier)
        return ret
32707
def generate_function(info, method=False):
    """"""

    assert isinstance(info, GIFunctionInfo)

    arg_infos = list(info.get_args())
    arg_types = [a.get_type() for a in arg_infos]
    return_type = info.get_return_type()

    func = None
    messages = []
    for backend in list_backends():
        instance = backend()
        try:
            func = _generate_function(instance, info, arg_infos, arg_types,
                                      return_type, method)
        except NotImplementedError:
            messages.append("%s: %s" % (backend.NAME, traceback.format_exc()))
        else:
            break

    if func:
        return func

    raise NotImplementedError("\n".join(messages))
717681
function generateDay(name, day, month, year, zeroes, dateObject) {
  var returnObject = {};

  returnObject.day = day;
  returnObject[name] = name;
  if (zeroes) returnObject.dayFormat = ('0' + day).slice(-2);
  if (dateObject) returnObject.date = new Date(year, month, day);
  return returnObject;
}
326011
def generate_func(self, table):
        

        # Ensure that `self` isn't suddenly in the closure...
        n = self.n

        def func(word):
            return sum(x * ord(c) for x, c in zip(table, word)) % n

        return func
222760
def generate_values(self, *args, **kwargs):
        
        values = super().generate_values(*args, **kwargs, size=(len(self.times) * self.size,))
        alpha = self.cagr

        # @todo - fill to cover the entire time: define rules for filling first
        ref_date = self.ref_date if self.ref_date else self.times[0].to_pydatetime()
        # assert ref_date >= self.times[0].to_pydatetime(), 'Ref date must be within variable time span.'
        # assert ref_date <= self.times[-1].to_pydatetime(), 'Ref date must be within variable time span.'

        start_date = self.times[0].to_pydatetime()
        end_date = self.times[-1].to_pydatetime()

        a = growth_coefficients(start_date, end_date, ref_date, alpha, self.size)

        values *= a.ravel()

        df = pd.DataFrame(values)
        df.columns = [kwargs['name']]
        df.set_index(self._multi_index, inplace=True)
        # @todo this is a hack to return a series with index as I don't know how to set an index and rename a series
        data_series = df.iloc[:, 0]
        data_series._metadata = kwargs
        data_series.index.rename(['time', 'samples'], inplace=True)

        return data_series
529330
def _generate_serializable_funcs(self, data_type_name):
        """"""
        with self.block_func(
                func='serialize',
                args=fmt_func_args_declaration([('instance', 'id')]),
                return_type='nullable NSDictionary<NSString *, id>  *',
                class_func=True):
            func_call = fmt_func_call(
                caller=fmt_serial_class(data_type_name),
                callee='serialize',
                args=fmt_func_args([('instance', 'instance')]))
            self.emit('return {};'.format(func_call))
        self.emit()

        with self.block_func(
                func='deserialize',
                args=fmt_func_args_declaration([('dict', 'NSDictionary<NSString *, id>  *')]),
                return_type='id',
                class_func=True):
            self.emit('return {};'.format(
                fmt_func_call(
                    caller=fmt_serial_class(data_type_name),
                    callee='deserialize',
                    args=fmt_func_args([('dict', 'dict')]))))
        self.emit()
46481
def _generate(self):
        """

        self._data['key'] = self.key
        self._data['value'] = self.value
        self._data['host'] = self.host
        self._data['clock'] = self.clock
383734
function generateDataGetter(nameMap){
    return new Function('data', 'return {' +
      basis.object.iterate(nameMap, function(ownName, sourceName){
        ownName = ownName.replace(/"/g, '\\"');
        sourceName = sourceName.replace(/"/g, '\\"');
        return '"' + ownName + '": data["' + sourceName + '"]';
      }) +
    '}');
  }
1236540
def data(self, data):
        """"""
        self._data = {det: d.copy() for (det, d) in data.items()}
1338029
def generate(data, dimOrder, maxWindowSize, overlapPercent, transforms = []):
	
	
	# Determine the dimensions of the input data
	width = data.shape[dimOrder.index('w')]
	height = data.shape[dimOrder.index('h')]
	
	# Generate the windows
	return generateForSize(width, height, dimOrder, maxWindowSize, overlapPercent, transforms)
1076647
def generate(self, ra, dec, period, cadence, mags,
                 n=2e4, Teff=None, logg=None, feh=None,
                 MAfn=None,
                 rprs=None, trilegal_filename=None,
                 starmodel=None,
                 binary_starmodel=None, triple_starmodel=None,
                 heb_kws=None, eb_kws=None,
                 beb_kws=None, pl_kws=None, savefile=None,
                 hide_exceptions=False, fit_trap=True,
                 do_only=None):
        
        do_all = False
        if do_only is None:
            do_all = True
            do_only = DEFAULT_MODELS

        if MAfn is None:
            MAfn = MAInterpolationFunction(pmin=0.007, pmax=1/0.007, nzs=200, nps=400)

        if beb_kws is None:
            beb_kws = {}
        if heb_kws is None:
            heb_kws = {}
        if eb_kws is None:
            eb_kws = {}
        if pl_kws is None:
            pl_kws = {}

        if 'heb' in do_only:
            try:
                hebpop = HEBPopulation(mags=mags,
                                       Teff=Teff, logg=logg, feh=feh,
                                       period=period, cadence=cadence,
                                       starmodel=triple_starmodel,
                                       starfield=trilegal_filename,
                                       MAfn=MAfn, n=n, **heb_kws)
                if fit_trap:
                    hebpop.fit_trapezoids(MAfn=MAfn)
                if savefile is not None:
                    if do_all:
                        hebpop.save_hdf(savefile, 'heb', overwrite=True)
                    else:
                        hebpop.save_hdf(savefile, 'heb', append=True)
            except:
                logging.error('Error generating HEB population.')
                if not hide_exceptions:
                    raise

        if 'heb_Px2' in do_only:
            try:
                hebpop_Px2 = HEBPopulation_Px2(mags=mags,
                                       Teff=Teff, logg=logg, feh=feh,
                                       period=period, cadence=cadence,
                                       starmodel=triple_starmodel,
                                       starfield=trilegal_filename,
                                       MAfn=MAfn, n=n, **heb_kws)
                if fit_trap:
                    hebpop_Px2.fit_trapezoids(MAfn=MAfn)
                if savefile is not None:
                    if do_all:
                        hebpop_Px2.save_hdf(savefile, 'heb_Px2', overwrite=True)
                    else:
                        hebpop_Px2.save_hdf(savefile, 'heb_Px2', append=True)
            except:
                logging.error('Error generating HEB_Px2 population.')
                if not hide_exceptions:
                    raise

        if 'eb' in do_only:
            try:
                ebpop = EBPopulation(mags=mags,
                                     Teff=Teff, logg=logg, feh=feh,
                                     period=period, cadence=cadence,
                                     starmodel=binary_starmodel,
                                     starfield=trilegal_filename,
                                     MAfn=MAfn, n=n, **eb_kws)
                if fit_trap:
                    ebpop.fit_trapezoids(MAfn=MAfn)
                if savefile is not None:
                    ebpop.save_hdf(savefile, 'eb', append=True)
            except:
                logging.error('Error generating EB population.')
                if not hide_exceptions:
                    raise

        if 'eb_Px2' in do_only:
            try:
                ebpop_Px2 = EBPopulation_Px2(mags=mags,
                                     Teff=Teff, logg=logg, feh=feh,
                                     period=period, cadence=cadence,
                                     starmodel=binary_starmodel,
                                     starfield=trilegal_filename,
                                     MAfn=MAfn, n=n, **eb_kws)
                if fit_trap:
                    ebpop_Px2.fit_trapezoids(MAfn=MAfn)
                if savefile is not None:
                    ebpop_Px2.save_hdf(savefile, 'eb_Px2', append=True)
            except:
                logging.error('Error generating EB_Px2 population.')
                if not hide_exceptions:
                    raise

        if 'beb' in do_only:
            try:
                bebpop = BEBPopulation(trilegal_filename=trilegal_filename,
                                       ra=ra, dec=dec, period=period, cadence=cadence,
                                       mags=mags, MAfn=MAfn, n=n, **beb_kws)
                if fit_trap:
                    bebpop.fit_trapezoids(MAfn=MAfn)
                if savefile is not None:
                    bebpop.save_hdf(savefile, 'beb', append=True)
            except:
                logging.error('Error generating BEB population.')
                if not hide_exceptions:
                    raise

        if 'beb_Px2' in do_only:
            try:
                bebpop_Px2 = BEBPopulation_Px2(trilegal_filename=trilegal_filename,
                                       ra=ra, dec=dec, period=period, cadence=cadence,
                                       mags=mags, MAfn=MAfn, n=n, **beb_kws)
                if fit_trap:
                    bebpop_Px2.fit_trapezoids(MAfn=MAfn)
                if savefile is not None:
                    bebpop_Px2.save_hdf(savefile, 'beb_Px2', append=True)
            except:
                logging.error('Error generating BEB_Px2 population.')
                if not hide_exceptions:
                    raise

        if 'pl' in do_only:
            try:
                plpop = PlanetPopulation(period=period, cadence=cadence,
                                         rprs=rprs,
                                         starmodel=starmodel,
                                         MAfn=MAfn, n=n, **pl_kws)

                if fit_trap:
                    plpop.fit_trapezoids(MAfn=MAfn)
                if savefile is not None:
                    plpop.save_hdf(savefile, 'pl', append=True)
            except:
                logging.error('Error generating Planet population.')
                if not hide_exceptions:
                    raise

        if not do_all and savefile is not None:
            hebpop = HEBPopulation.load_hdf(savefile, 'heb')
            hebpop_Px2 = HEBPopulation.load_hdf(savefile, 'heb_Px2')
            ebpop = EBPopulation.load_hdf(savefile, 'eb')
            ebpop_Px2 = EBPopulation.load_hdf(savefile, 'eb_Px2')
            bebpop = BEBPopulation.load_hdf(savefile, 'beb')
            bebpop_Px2 = BEBPopulation.load_hdf(savefile, 'beb_Px2')
            plpop = PlanetPopulation.load_hdf(savefile, 'pl')


        self.poplist = [hebpop, hebpop_Px2,
                        ebpop, ebpop_Px2,
                        bebpop, bebpop_Px2, plpop]
885780
def generate_func_code(self):
        
        self.l('NoneType = type(None)')
        # Generate parts that are referenced and not yet generated
        while self._needed_validation_functions:
            # During generation of validation function, could be needed to generate
            # new one that is added again to `_needed_validation_functions`.
            # Therefore usage of while instead of for loop.
            uri, name = self._needed_validation_functions.popitem()
            self.generate_validation_function(uri, name)
237583
def generate_from_args(self, *args):
        
        return self.generate(**dict(zip(self.variable_args, args)))