def get_input_stream(environ, safe_fallback=True):
 stream = environ['wsgi.input']
 content_length = get_content_length(environ)
 if environ.get('wsgi.input_terminated'):
  return stream
 if (content_length is None):
  return ((safe_fallback and _empty_stream) or stream)
 return LimitedStream(stream, content_length)

def get_input_stream ( environ , safe_fallback = True ) : stream = environ [ 'wsgi.input' ] content_length = get_content_length ( environ ) if environ . get ( 'wsgi.input_terminated' ) : return stream if ( content_length is None ) : return ( ( safe_fallback and _empty_stream ) or stream ) return LimitedStream ( stream , content_length )
returns the input stream from the wsgi environment and wraps it in the most sensible way possible .