def args(parsed_args, name=None):
    """Interpret parsed args to streams"""
    strings = parsed_args.arg_strings(name)
    files = [s for s in strings if os.path.isfile(s)]
    if files:
        streams = [open(f) for f in files]
    else:
        streams = []
    if getattr(parsed_args, 'paste', not files):
        streams.append(clipboard_stream())
    if getattr(parsed_args, 'stdin', False):
        streams.append(sys.stdin)
    elif not streams:
        streams = [sys.stdin]
    return streams
def args ( parsed_args , name = None ) : strings = parsed_args . arg_strings ( name ) files = [ s for s in strings if os . path . isfile ( s ) ] if files : streams = [ open ( f ) for f in files ] else : streams = [ ] if getattr ( parsed_args , 'paste' , not files ) : streams . append ( clipboard_stream ( ) ) if getattr ( parsed_args , 'stdin' , False ) : streams . append ( sys . stdin ) elif not streams : streams = [ sys . stdin ] return streams
Interpret parsed args to streams