class_docstr: >>> from cStringIO import StringIO
  >>> f = StringIO()
  >>> w = DictWriter(f, ['a', u'ñ', 'b'], restval=u'î')
  >>> w.writerow({'a':'1', u'ñ':'2'})
  >>> w.writerow({'a':'1', u'ñ':'2', 'b':u'ø'})
  >>> w.writerow({'a':u'é', u'ñ':'2'})
  >>> f.seek(0)
  >>> r = DictReader(f, fieldnames=['a', u'ñ'], restkey='r')
  >>> r.next() == {'a': u'1', u'ñ':'2', 'r': [u'î']}
  True
  >>> r.next() == {'a': u'1', u'ñ':'2', 'r': [u'Ã¸']}
  True
  >>> r.next() == {'a': u'Ã©', u'ñ':'2', 'r': [u'Ã®']}
  True
class_docstr_tok: [">",">",">","from","cStringIO","import","StringIO",">",">",">","f","=","StringIO","(",")",">",">",">","w","=","DictWriter","(","f",",","[","'","a","'",",","u","'","\u00f1","'",",","'","b","'","]",",","restval=u","'","\u00ee","'",")",">",">",">","w.writerow","(","{","'","a","'",":","'","1","'",",","u","'","\u00f1","'",":","'","2","'","}",")",">",">",">","w.writerow","(","{","'","a","'",":","'","1","'",",","u","'","\u00f1","'",":","'","2","'",",","'","b","'",":","u","'","\u00f8","'","}",")",">",">",">","w.writerow","(","{","'","a","'",":","u","'","\u00e9","'",",","u","'","\u00f1","'",":","'","2","'","}",")",">",">",">","f.seek","(","0",")",">",">",">","r","=","DictReader","(","f",",","fieldnames=","[","'","a","'",",","u","'","\u00f1","'","]",",","restkey=","'","r","'",")",">",">",">","r.next","(",")","==","{","'","a","'",":","u","'","1","'",",","u","'","\u00f1","'",":","'","2","'",",","'","r","'",":","[","u","'","\u00ee","'","]","}","True",">",">",">","r.next","(",")","==","{","'","a","'",":","u","'","1","'",",","u","'","\u00f1","'",":","'","2","'",",","'","r","'",":","[","u","'","\u00c3\u00b8","'","]","}","True",">",">",">","r.next","(",")","==","{","'","a","'",":","u","'","\u00c3\u00a9","'",",","u","'","\u00f1","'",":","'","2","'",",","'","r","'",":","[","u","'","\u00c3\u00ae","'","]","}","True"]
code: def writeheader(self):
      fieldnames = _stringify_list(
          self.fieldnames, self.encoding, self.encoding_errors
      )
      header = dict(zip(self.fieldnames, self.fieldnames))
      self.writerow(header)
  
imports: import csv
  from textblob.compat import izip
label_desc: Use image node_id 2 for calling the DictWriter obj's underlying member method code with example usage: obj.writeheader() without return types