Set tabular attributes to the writer from :py:class:`tablib.Dataset`.
180704
def from_tablib(self, tablib_dataset):
        

        self.headers = tablib_dataset.headers
        self.value_matrix = [row for row in tablib_dataset]
949175
def _setsizes(self, cursor=None):
        """"""
        if cursor is None:
            cursor = self._cursor
        if self._inputsizes:
            cursor.setinputsizes(self._inputsizes)
        for column, size in self._outputsizes.items():
            if column is None:
                cursor.setoutputsize(size)
            else:
                cursor.setoutputsize(size, column)
884451
def set_data(self, *args):
        """"""
        db = self.begining.get_data() or formats.DATE_DEFAULT
        df = self.end.get_data() or formats.DATE_DEFAULT
        jours = max((df - db).days + 1, 0)
        self.setText(str(jours) + (jours >= 2 and " jours" or " jour"))
498075
def set_attributes(self, doc, fields,  # pylint: disable=arguments-differ
            parent_type=None, catch_all_field=None):
        
        if parent_type:
            assert isinstance(parent_type, Union)

        super(Union, self).set_attributes(doc, fields, parent_type)

        self.catch_all_field = catch_all_field
        self.parent_type = parent_type
185609
def set_sid_attrs(self, sid, **kwargs):
        
        table = self._ensure_ctable(sid)
        for k, v in kwargs.items():
            table.attrs[k] = v
103980
def write_table(self, d):
        """"""
        self._flushbits()
        table_data = AMQPWriter()
        for k, v in items(d):
            table_data.write_shortstr(k)
            table_data.write_item(v, k)
        table_data = table_data.getvalue()
        self.write_long(len(table_data))
        self.out.write(table_data)
268164
def _set_fields(self, fields):
        """"""
        for f in fields:
            if hasattr(self, f):
                setattr(self, f, fields[f])
            else:
                raise TypeError("'{arg}' is an invalid argument for {instance_type}".format(arg=f, instance_type=self.__class__.__name__))
1328733
def write_attributes(self, attrs):
        
        if attrs:
            self.write(
                ' [' + ','.join('%s="%s"' % kv for kv in attrs.items()) + ']'
            )
        else:  # pragma: nocover
            pass
381886
def SetAttributes(self,
                    urn,
                    attributes,
                    to_delete,
                    add_child_index=True,
                    mutation_pool=None):
    """"""

    attributes[AFF4Object.SchemaCls.LAST] = [
        rdfvalue.RDFDatetime.Now().SerializeToDataStore()
    ]
    to_delete.add(AFF4Object.SchemaCls.LAST)
    if mutation_pool:
      pool = mutation_pool
    else:
      pool = data_store.DB.GetMutationPool()

    pool.MultiSet(urn, attributes, replace=False, to_delete=to_delete)

    if add_child_index:
      self._UpdateChildIndex(urn, pool)
    if mutation_pool is None:
      pool.Flush()
1053987
def _set_properties(self, data):
        
        for property in data.keys():
            if property in vars(self):
                setattr(self, property, data[property])
1197194
def set_attributes(obj, additional_data):
    
    for key, value in additional_data.items():
        if hasattr(obj, key):
            raise ValueError("Key %s in additional_data already exists in this object" % key)
        setattr(obj, _strip_column_name(key), value)
836479
def tab(self, output):
        """"""
        import csv
        csvwriter = csv.writer(self.outfile, dialect=csv.excel_tab)
        csvwriter.writerows(output)
952156
def _set_attributes(self, kwds):
    
    cls = self.__class__
    for name, value in kwds.iteritems():
      prop = getattr(cls, name)  # Raises AttributeError for unknown properties.
      if not isinstance(prop, Property):
        raise TypeError('Cannot set non-property %s' % name)
      prop._set_value(self, value)
514913
def set_attributes(self, **kwargs):
        
        for field, value in kwargs.items():
            if field in self.Meta.attributes:
                setattr(self, field, value)
805874
def set_attrs(self):
        
        self.attrs.encoding = self.encoding
        self.attrs.errors = self.errors
585442
def Write(self, output_writer):
    
    if self._title:
      output_writer.Write('### {0:s}\n\n'.format(self._title))

    if not self._columns:
      self._columns = ['' for _ in range(0, self._number_of_columns)]

    output_writer.Write(' | '.join(self._columns))
    output_writer.Write('\n')

    output_writer.Write(' | '.join(['---' for _ in self._columns]))
    output_writer.Write('\n')

    for values in self._rows:
      values = ['{0!s}'.format(value) for value in values]
      output_writer.Write(' | '.join(values))
      output_writer.Write('\n')

    output_writer.Write('\n')
787023
def _initialize_attributes(self, data):
    """"""
    attrs = dict(self.attrs)

    if self.primary_key_name is None:
      pass
    elif isinstance(self.primary_key_name, str):
      if self.primary_key_name not in attrs:
        attrs[self.primary_key_name] = None
    else:
      for pkey in self.primary_key_name:
        if pkey not in attrs:
          attrs[pkey] = None

    if self.timestamps:
      for ts_name in self.timestamps:
        if ts_name is not None and ts_name not in attrs:
          attrs[ts_name] = None

    for attr_name in attrs:
      setattr(self, attr_name, get_value(data, attr_name, attrs[attr_name]))