def WriteHeaders(headers, outfile, content_len=None):
  wrote_content_length = False
  for header, value in headers.iteritems():
    if header.lower() == 'content-length' and content_len is not None:
      value = content_len
      wrote_content_length = True
    outfile.write('%s: %s\r\n' % (header, value))
  if not wrote_content_length and content_len:
    outfile.write('Content-Length: %s\r\n' % content_len)
compile self.script into self.bytecode
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/dev_appserver_apiserver.py/WriteHeaders--crossover with--dataset/ETHPy150Open rst2pdf/rst2pdf/rst2pdf/tenjin.py/Template.compile