def bread(stream):
if hasattr(stream, "<STR_LIT>"):<EOL><INDENT>return bdecode(stream.read())<EOL><DEDENT>else:<EOL><INDENT>handle = open(stream, "<STR_LIT:rb>")<EOL>try:<EOL><INDENT>return bdecode(handle.read())<EOL><DEDENT>finally:<EOL><INDENT>handle.close()<EOL><DEDENT><DEDENT>
Decode a file or stream to an object.