code: def chunk_encoding(chunks, chunk):
      '''Write a chunk::
          chunk-size(hex) CRLF
          chunk-data CRLF
      If the size is 0, this is the last chunk, and an extra CRLF is appended.
      '''
      chunks.extend(("%X\r\n" % len(chunk)).encode('utf-8'))
      chunks.extend(chunk)
      chunks.extend(CRLFf chunk_encoding(chunks, chunk):
      '''Write a chunk::
          chunk-size(hex) CRLF
          chunk-data CRLF
      If the size is 0, this is the last chunk, and an extra CRLF is appended.
      '''
      chunks.extend(("%X\r\n" % len(chunk)).encode('utf-8'))
      chunks.extend(chunk)
      chunks.extend(CRLF)
docs: Write a chunk::
          chunk-size(hex) CRLF
          chunk-data CRLF
      If the size is 0, this is the last chunk, and an extra CRLF is appended.