Write file to the desired path.
175472
def write_local_file(self, outputfile, path):
        """"""
        self.logger.info("Writing file to %s", path)
        outputfile.seek(0)
        with open(path, 'wb') as fd:
            copyfileobj(outputfile, fd)
1071330
def generate_output_file(path):
        

        def write_file(content):
            """
            Function to do write_file operation
            :param content:
            :return:
            """
            with open(path, 'w+') as output:
                output.write(content)

        return write_file
301967
def append_to_path (path, directory):
    """"""
    if not os.path.isdir(directory) or directory in path:
        return path
    if not path.endswith(os.pathsep):
        path += os.pathsep
    return path + directory
353261
def write(u, path):
    
    print("writing to: %s" % path)
    # This function implementation was chosen to be compatible across Python 2/3.
    f = open(path, "wb")
    try:
        b = u.encode(FILE_ENCODING)
        f.write(b)
    finally:
        f.close()
349559
def __write(self, thePath, theData):
            
        fd = open(thePath, "wb")
        fd.write(theData)
        fd.close()
44350
def write_file(self, target_path, html):
        
        logger.debug("Building to {}{}".format(self.fs_name, target_path))
        with self.fs.open(smart_text(target_path), 'wb') as outfile:
            outfile.write(six.binary_type(html))
            outfile.close()
521040
def write_directory (zfile, directory):
    """"""
    for dirpath, dirnames, filenames in os.walk(directory):
        zfile.write(dirpath)
        for filename in filenames:
            zfile.write(os.path.join(dirpath, filename))
729844
def write(settings_path, settings_data, **kwargs):
    """"""
    for key, value in settings_data.items():
        dotenv_cli.set_key(str(settings_path), key.upper(), str(value))
265983
def atomic_write(path, mode):
  """"""
  tmp_path = "%s%s_%s" % (path, constants.INCOMPLETE_SUFFIX, uuid.uuid4().hex)
  with tf.io.gfile.GFile(tmp_path, mode) as file_:
    yield file_
  tf.io.gfile.rename(tmp_path, path, overwrite=True)
962796
def write_file(self, path, contents):
		
		path = self._get_dist_path(path)
		if not os.path.isdir(os.path.dirname(path)):
			os.makedirs(os.path.dirname(path))
		if isinstance(contents, bytes):
			mode = 'wb+'
		else:
			mode = 'w'
		with open(path, mode) as file:
			file.write(contents)
1089793
def write_file(path, data, format=True):
    
    if format:
        fs.write_file(path, format_json(data))
    else:
        fs.write_file(path, json.dumps(data))
427495
public Path write(Path path) throws IOException {
        write(Files.newOutputStream(path));
        return path;
    }
298949
def write(grp, out_path):
    
    with open(out_path, "w") as f:
        for x in grp:
            f.write(str(x) + "\n")
754352
def write_file(path, content)
      dir = File.dirname(path)
      if !File.exist?(dir)
        FileUtils.mkdir_p(dir)
      end
      File.open(path, 'wb') do |f|
        f.write(content)
      end
    end
120579
def write(self):
        """"""
        with open(self.path, 'w') as file_:
            file_.write(self.content)
573718
def write_file(self, filename="paths.dat"):
        
        with zopen(filename, "wt") as f:
            f.write(str(self) + "\n")
133408
def write_file(filename, content):
    '''
    
    '''

    if filename and _path.exists(_path.dirname(filename)) and content:
        with open(filename, 'w') as f:
            return f.write(content)