Generates the actual list of data.
333959
def items_for_result(view, result):
    
    model_admin = view.model_admin
    for field_name in view.list_display:
        empty_value_display = model_admin.get_empty_value_display()
        row_classes = ['field-%s' % field_name]
        try:
            f, attr, value = lookup_field(field_name, result, model_admin)
        except ObjectDoesNotExist:
            result_repr = empty_value_display
        else:
            empty_value_display = getattr(attr, 'empty_value_display', empty_value_display)
            if f is None or f.auto_created:
                allow_tags = getattr(attr, 'allow_tags', False)
                boolean = getattr(attr, 'boolean', False)
                if boolean or not value:
                    allow_tags = True

                if django.VERSION >= (1, 9):
                    result_repr = display_for_value(value, empty_value_display, boolean)
                else:
                    result_repr = display_for_value(value, boolean)
                # Strip HTML tags in the resulting text, except if the
                # function has an "allow_tags" attribute set to True.
                if allow_tags:
                    result_repr = mark_safe(result_repr)
                if isinstance(value, (datetime.date, datetime.time)):
                    row_classes.append('nowrap')
            else:
                if isinstance(f, models.ManyToOneRel):
                    field_val = getattr(result, f.name)
                    if field_val is None:
                        result_repr = empty_value_display
                    else:
                        result_repr = field_val
                else:
                    if django.VERSION >= (1, 9):
                        result_repr = display_for_field(value, f, empty_value_display)
                    else:
                        result_repr = display_for_field(value, f)

                if isinstance(f, (models.DateField, models.TimeField, models.ForeignKey)):
                    row_classes.append('nowrap')
        if force_text(result_repr) == '':
            result_repr = mark_safe('&nbsp;')
        row_classes.extend(model_admin.get_extra_class_names_for_field_col(field_name, result))
        row_attributes_dict = model_admin.get_extra_attrs_for_field_col(field_name, result)
        row_attributes_dict['class'] = ' ' . join(row_classes)
        row_attributes = ''.join(' %s="%s"' % (key, val) for key, val in row_attributes_dict.items())
        row_attributes_safe = mark_safe(row_attributes)
        yield format_html('<td{}>{}</td>', row_attributes_safe, result_repr)
82650
def process(self, data):
        
        fields = []
        for res in data:
            for epname, out in six.iteritems(res.status):
                fields.append(
                    [out.get('state'),
                     epname,
                     out.get('formatted_filename'),
                     out.get('messages')])

        if fields:
            table.write_output(fields)
1367634
def get_data():
    

    output = []
    tables = get_tables()
    for table in tables:
        columns = get_columns(table)

        for column in columns:
            if column['name'] == 'tenant_id':
                output.append((table, column))

    return output
75010
def generate_data(self, data_dir, tmp_dir=None, task_id=-1):
    """"""
    if not self._rollouts_by_epoch_and_split[self.current_epoch]:
      # Data not loaded from disk.
      self._split_current_epoch()

    rollouts_by_split = self._rollouts_by_epoch_and_split[self.current_epoch]
    splits_and_paths = self.splits_and_paths(data_dir)

    for (split, paths) in splits_and_paths:
      rollouts = rollouts_by_split[split]
      num_frames = self._calc_num_frames(rollouts)
      shard_size = num_frames // len(paths)

      frame_gen = self._generate_frames(rollouts)
      for (path_index, path) in enumerate(paths):
        limit = shard_size
        # Put the remainder in the last shard to preserve the ordering.
        if path_index == len(paths) - 1:
          limit = None
        generator_utils.generate_files(
            itertools.islice(frame_gen, limit), [path],
            cycle_every_n=float("inf")
        )
201058
def generate_models(args):
  """"""
  data_table = get_data_table(args.filename)
  tables = to_tables(data_table.rows_to_dicts())
  attr_indent = "\n" + args.indent * 2
  attr_sep = "," + attr_indent

  for tname, cols in tables.items():
    model_name = table_to_model_name(tname, list(cols.values())[0]["table_schema"])
    pk_cols, oth_cols = split_pks(cols)
    timestamps = get_timestamps(cols, args.created_at_col_name, args.updated_at_col_name)
    is_auto = len(pk_cols) == 1 and cols[pk_cols[0]]["is_auto"] == "t"

    attrs = OrderedDict()
    for cname in oth_cols:
      if cname not in timestamps:
        attrs[cname] = None

    print(_MODEL_SOURCE.format(
      class_name=model_name,
      base_class_name="ModelBase",
      indent=args.indent,
      table_name=repr(tname),
      pk_name=repr(pk_cols[0] if len(pk_cols) == 1 else pk_cols),
      pk_is_auto=is_auto,
      timestamps=timestamps,
      attrs="dict(" + attr_indent + attr_sep.join("{0}={1}".format(k, v) for k, v in attrs.items()) + ")"))
    print()
1028682
def items(self):
        """"""
        l = []
        for e in self.data:
            l += e.items()
        return l
504302
def dump(self):
        
        results = []
        for data in self.data():
            results.append(data)
        return results
240906
protected function generateEntitiesListFromQuery(): void
    {
        $query = $this->getAttribute('tableModel')->query();
        $this->applyQueryClosure($query);
        $this->checkColumnsValidity();
        $this->applySearchClauses($query);
        $this->applySortClauses($query);
        $this->paginateList($query);
        $this->applyClosuresOnPaginatedList();
    }
670140
def to_table_data(self):
        

        self._validate_source_data()

        for table_key, json_records in six.iteritems(self._buffer):
            self._loader.inc_table_count()
            self._table_key = table_key

            yield TableData(
                self._make_table_name(),
                ["key", "value"],
                [record for record in json_records.items()],
                dp_extractor=self._loader.dp_extractor,
                type_hints=self._extract_type_hints(),
            )
1141125
def prepare_to_generate(self, data_dir, tmp_dir):
    """"""
    self.get_or_create_vocab(data_dir, tmp_dir)
    self.train_text_filepaths(tmp_dir)
    self.dev_text_filepaths(tmp_dir)
116576
def iterlists(self):
        """"""
        for key, values in dict.iteritems(self):
            yield key, list(values)
1270346
private function rows()
    {
        $collection = $this->collection();
        $properties = $this->properties();
        $metadata = $this->metadata();

        foreach ($collection as $c) {
            $row = [];
            foreach ($properties as $p) {
                // Use the property factory to get
                // the proper val to output in csv
                // as a string.
                $propertyMetadata = $metadata->get('properties.'.$p);
                $prop = $this->propertyFactory()->create($propertyMetadata['type']);
                $prop->setIdent($p);
                $prop->setData($propertyMetadata);
                $row[] = $this->stripContent($prop->displayVal($c->propertyValue($p)));
            }
            yield $row;
        }
    }
532744
def to_s
     data = [@name.concat(Array.new(32-@name.size, 0)), 
             @name_size, 
             @type, 
             @color, 
             @left, 
             @right, 
             @child, 
             @created,
             @modified, 
             @sector, 
             @size].flatten
      data.pack(PACKING)
    end
989082
def _make_data(data) -> Tuple[List[Dict], List[Dict]]:
        """"""
        jsdata = []
        for idx, row in data.iterrows():
            row.index = row.index.astype(str)
            rdict = row.to_dict()
            rdict.update(dict(key=str(idx)))
            jsdata.append(rdict)

        return jsdata, Table._make_columns(data.columns)
1325996
def gen_csv(sc, filename, field_list, source, filters):
    '''
    '''

    # First thing we need to do is initialize the csvfile and build the header
    # for the file.
    datafile = open(filename, 'wb')
    csvfile = csv.writer(datafile)
    header = []
    for field in field_list:
        header.append(fields.fields[field]['name'])
    csvfile.writerow(header)

    debug.write('Generating %s: ' % filename)
    # Next we will run the Security Center query.  because this could be a
    # potentially very large dataset that is returned, we don't want to run out
    # of memory.  To get around this, we will pass the query function the writer
    # function with the appropriate fields so that it is parsed inline.
    fparams = {'fobj': csvfile, 'flist': field_list}
    sc.query('vulndetails', source=source, 
             func=writer, func_params=fparams, **filters)
    debug.write('\n')

    # Lastly we need to close the datafile.
    datafile.close()
712818
def _to_dataframe_tabledata_list(self, dtypes, progress_bar=None):
        """"""
        column_names = [field.name for field in self.schema]
        frames = []

        for page in iter(self.pages):
            current_frame = self._to_dataframe_dtypes(page, column_names, dtypes)
            frames.append(current_frame)

            if progress_bar is not None:
                # In some cases, the number of total rows is not populated
                # until the first page of rows is fetched. Update the
                # progress bar's total to keep an accurate count.
                progress_bar.total = progress_bar.total or self.total_rows
                progress_bar.update(len(current_frame))

        if progress_bar is not None:
            # Indicate that the download has finished.
            progress_bar.close()

        return pandas.concat(frames)
132214
def list_datasets(self):
        
        def _row_gen(attributes):
            for attr in attributes.values():
                yield (attr.name, attr.display_name)

        return pd.DataFrame.from_records(
            _row_gen(self.datasets),
            columns=['name', 'display_name'])