code: def write_bytes(self, bytes, append=False):
          
          if append:
              mode = 'ab'
          else:
              mode = 'wb'
          with self.open(mode) as f:
              f.write(bytes)
docs: 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.