def decode_chunked_transfer(chunked_body):
 (body, h, t) = ('', '', chunked_body)
 while t:
  (h, t) = t.split('\r\n', 1)
  if (h == '0'):
   break
  size = int(h, 16)
  body += t[:size]
  t = t[(size + 2):]
 return body

def decode_chunked_transfer ( chunked_body ) : ( body , h , t ) = ( '' , '' , chunked_body ) while t : ( h , t ) = t . split ( '\r\n' , 1 ) if ( h == '0' ) : break size = int ( h , 16 ) body += t [ : size ] t = t [ ( size + 2 ) : ] return body
parsed body received with chunked transfer encoding .