

def initialize(self):
    (self.handle, self.close_file) = base.open_resource(self.resource, 'w')
    if self.html_header:
        self.handle.write(self.html_header)
    attr_string = ''
    if self.table_attributes:
        for attr_value in self.table_attributes.items():
            attr_string += (' %s="%s"\n' % attr_value)
    string = ('<table%s>\n' % attr_string)
    if self.write_headers:
        string += '<tr>'
        for field in self.fields:
            if field.label:
                header = field.label
            else:
                header = field.name
            string += ('  <th>%s</th>\n' % header)
        string += '</tr>\n'
    attr_value.handle.write(string)

dataset/ETHPy150Open Stiivi/brewery/brewery/ds/html_target.py SimpleHTMLDataTarget.initialize/VarMisuse@151/208 `self`->`attr_value`