def get_content_length(environ):
 content_length = environ.get('CONTENT_LENGTH')
 if (content_length is not None):
  try:
   return max(0, int(content_length))
  except (ValueError, TypeError):
   pass

def get_content_length ( environ ) : content_length = environ . get ( 'CONTENT_LENGTH' ) if ( content_length is not None ) : try : return max ( 0 , int ( content_length ) ) except ( ValueError , TypeError ) : pass
returns the content length from the wsgi environment as integer .