def get_stream_type(env, args):
 if ((not env.stdout_isatty) and (not args.prettify)):
  Stream = partial(RawStream, chunk_size=(RawStream.CHUNK_SIZE_BY_LINE if args.stream else RawStream.CHUNK_SIZE))
 elif args.prettify:
  Stream = partial((PrettyStream if args.stream else BufferedPrettyStream), env=env, conversion=Conversion(), formatting=Formatting(env=env, groups=args.prettify, color_scheme=args.style, explicit_json=args.json))
 else:
  Stream = partial(EncodedStream, env=env)
 return Stream

def get_stream_type ( env , args ) : if ( ( not env . stdout_isatty ) and ( not args . prettify ) ) : Stream = partial ( RawStream , chunk_size = ( RawStream . CHUNK_SIZE_BY_LINE if args . stream else RawStream . CHUNK_SIZE ) ) elif args . prettify : Stream = partial ( ( PrettyStream if args . stream else BufferedPrettyStream ) , env = env , conversion = Conversion ( ) , formatting = Formatting ( env = env , groups = args . prettify , color_scheme = args . style , explicit_json = args . json ) ) else : Stream = partial ( EncodedStream , env = env ) return Stream
pick the right stream type based on env and args .