'Writes the given `bytes` to the file.
:param append:
If ``True`` given `bytes` are added at the end of the file.'

def write_bytes(self, bytes, append=False):

    if append:
        mode = 'ab'
    else:
        mode = 'wb'
    with open(self, mode=mode) as f:
        f.write(bytes)
