Write to a file GOEA results in an ASCII text format.
775916
def wr_txt(self, fout_txt):
        """"""
        with open(fout_txt, 'w') as prt:
            for line in self.ver_list:
                prt.write("{LINE}\n".format(LINE=line))
            self.prt_txt(prt)
            print("  WROTE: {TXT}".format(TXT=fout_txt))
989045
def _write(self, to_write):
        
        self._file.write(to_write.encode(self._encoding or
                                         self._default_encoding))
305096
def write_c_string( self, value ):
        
        self.file.write( value )
        self.file.write( b'\0' )
43244
def write_file(path, content, mode=None, encoding='utf-8'):
    '''  '''
    if not mode:
        if isinstance(content, bytes):
            mode = 'wb'
        else:
            mode = 'wt'
    if not path:
        raise ValueError("Output path is invalid")
    else:
        getLogger().debug("Writing content to {}".format(path))
        # convert content to string when writing text data
        if mode in ('w', 'wt') and not isinstance(content, str):
            content = to_string(content)
        elif mode == 'wb':
            # content needs to be encoded as bytes
            if not isinstance(content, str):
                content = to_string(content).encode(encoding)
            else:
                content = content.encode(encoding)
        if str(path).endswith('.gz'):
            with gzip.open(path, mode) as outfile:
                outfile.write(content)
        else:
            with open(path, mode=mode) as outfile:
                outfile.write(content)
538599
def write(self, location, text, encoding):
        
        location = os.path.expanduser(location)

        with gzip.open(location, 'wb') as f:
            f.write(text.encode(encoding))
857403
def pack_and_write( self, format, value ):
        
        pattern = "%s%s" % ( self.endian_code, format )
        return self.file.write( struct.pack( pattern, value ) )
458925
def write_file(filename, contents):
    
    contents = "\n".join(contents)

    # assuming the contents has been vetted for utf-8 encoding
    contents = contents.encode("utf-8")

    with open(filename, "wb") as f:  # always write POSIX-style manifest
        f.write(contents)
725134
def write_moc_ascii(moc, filename=None, file=None):
    

    orders = []

    for (order, cells) in moc:
        ranges = []
        rmin = rmax = None

        for cell in sorted(cells):
            if rmin is None:
                rmin = rmax = cell
            elif rmax == cell - 1:
                rmax = cell
            else:
                ranges.append(_format_range(rmin, rmax))
                rmin = rmax = cell

        ranges.append(_format_range(rmin, rmax))

        orders.append('{0}'.format(order) + '/' + ','.join(ranges))

    if file is not None:
        _write_ascii(orders, file)
    else:
        with open(filename, 'w') as f:
            _write_ascii(orders, f)
120935
def _write(self, content, mode, encoding=None, linesep=False):
        """"""
        makedirs(self.path)
        try:
            encoding = encoding or ENCODING
            if "b" not in mode:
                try:
                    content = str(content)
                except:
                    pass
                if linesep:
                    content += os.linesep
            with codecs.open(self.path, mode, encoding=encoding) as fo:
                fo.write(content)
                return True
        except:
            return False
578868
def _write(self, text):
        """"""
        spaces = ' ' * (self.indent * self.indentlevel)
        t = spaces + text.strip() + '\n'
        if hasattr(t, 'encode'):
            t = t.encode(self.encoding, 'xmlcharrefreplace')
        self.stream.write(t)
905035
def write_file(self, fp, data):
        """"""
        with open(fp, 'w') as f:
            f.write(data)
1098921
def write(file_name, data):
    """"""
    with open(file_name, 'w') as f:
        f.write(encode(data))
147235
def write(self, txt):
        
        self.fp.write(to_unicode(txt))
        if self.out:
            self.out.write(txt)
905039
def write(self, chars, output):
        
        data = self.generate(chars)
        with open(output, 'wb') as f:
            return f.write(data)
1139931
def write_file(file_path, txt, **kws):
    
    if not os.path.exists(file_path):
        upDir = os.path.dirname(file_path)
        if not os.path.isdir(upDir):
            os.makedirs(upDir)

    kw = {"mode":"w", "encoding":"utf-8"}
    if kws:
        for k,v in kws.items():
            kw[k] = v
    with open(file_path, **kw) as afile:
        afile.write(txt)
419257
def _write_to_file(self, filename, bytesvalue):
        """"""
        fh, tmp = tempfile.mkstemp()
        with os.fdopen(fh, self._flag) as f:
            f.write(self._dumps(bytesvalue))
        rename(tmp, filename)
        os.chmod(filename, self._mode)
595590
def to_blob
      str = StringIO.new
      str.set_encoding("ASCII-8BIT")
      write(str)
      str.string
    end