def write_bytes(self, bytes, append=False):
if append:<EOL><INDENT>mode = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>mode = '<STR_LIT:wb>'<EOL><DEDENT>f = self.open(mode)<EOL>try:<EOL><INDENT>f.write(bytes)<EOL><DEDENT>finally:<EOL><INDENT>f.close()<EOL><DEDENT>
Open this file and write the given bytes to it.

        Default behavior is to overwrite any existing file.
        Call p.write_bytes(bytes, append=True) to append instead.