Writes given data to given path file

        :param data: data to write to file
519107
def write_data(self, data):
        
        with open(self.path, "w") as writer:
            writer.write(data)
1040764
def write(self, path):
        """"""
        with open(path, 'w') as fd:
            fd.write(json.dumps(
                {
                    "created_at": self._created_at,
                    "version": self._version,
                    "mtllibs": self._mtllibs,
                    "vertex_buffers": self._vertex_buffers,
                },
                indent=2,
            ))
635353
def write(fname, data):
		
		try:
			with open(fname, 'w') as f:
				json.dump(data, f)

		except IOError:
			raise Exception('Could not open {0!s} for writing'.format((fname)))
438849
def write(self, data):
        
        data_sent = None

        try:
            if isinstance(data, str):
                data = data.encode('utf-8')

            data_sent = self._device.send(data)

            if data_sent == 0:
                raise CommError('Error writing to device.')

            self.on_write(data=data)

        except (SSL.Error, socket.error) as err:
            raise CommError('Error writing to device.', err)

        return data_sent
1127262
def write_json_to_file(path, data):
    
    with open(path, 'w', encoding='utf-8') as f:
        json.dump(data, f)
1011958
def save(path,data)
     
      File.open(path,'w') do |file|
        file.puts data
      end

      if File.exists?(path)
        `pl -input #{path} -output #{path}`
      end

    end
456930
def write_file(file_path, gd_data)
      if gd_data && !File.exists?(file_path)
        FileUtils.mkdir_p(File.dirname(file_path))
        File.open(file_path, "wb") do |data|
          data << gd_data
        end
      end
    end
915654
def write(self, data):
        """"""
        cnpj, data = data

        path = os.path.join(self.output, '%s.json' % cnpj)
        with open(path, 'w') as f:
            json.dump(data, f, encoding='utf-8')
462927
def save(self, writer=None):
        

        if self.path is None:
            raise ValueError('No path given to save the data set.')

        self.save_at(self.path, writer)
1284573
def writeFile(filename, data):
		
		with open(filename, 'wb') as f:
			f.write(data.encode('utf-8'))
782171
def write(self, data, method='w'):
        
        # Create list of lists from flat list
        data = data if isinstance(data[0], (list, set, tuple)) else [[d] for d in data]

        # Open file and write rows
        with open(self.file_path, method) as write:
            wr = csv_builtin.writer(write)
            wr.writerows(data)
        return self.file_path
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)
573718
def write_file(self, filename="paths.dat"):
        
        with zopen(filename, "wt") as f:
            f.write(str(self) + "\n")
484695
def write_data(self, data, file_datetime):
        
        with self.__lock:
            assert data is not None
            absolute_file_path = self.__file_path
            #logging.debug("WRITE data file %s for %s", absolute_file_path, key)
            make_directory_if_needed(os.path.dirname(absolute_file_path))
            properties = self.read_properties() if os.path.exists(absolute_file_path) else dict()
            write_zip(absolute_file_path, data, properties)
            # convert to utc time.
            tz_minutes = Utility.local_utcoffset_minutes(file_datetime)
            timestamp = calendar.timegm(file_datetime.timetuple()) - tz_minutes * 60
            os.utime(absolute_file_path, (time.time(), timestamp))
724187
def binwrite(path, data)
      File.open(path, 'wb') do |file|
        file.write(data)
      end
    end
919018
def write(path, data, binary=False):
    
    mode = "w"
    if binary:
        mode = "wb"
    with open(path, mode) as f:
        f.write(data)
    f.close()
1075777
def _write_file(folder, filename, data):
    '''
    
    '''
    path = os.path.join(folder, filename)
    if not os.path.exists(folder):
        msg = '{0} cannot be written. {1} does not exist'.format(filename, folder)
        log.error(msg)
        raise AttributeError(six.text_type(msg))
    with salt.utils.files.fopen(path, 'w') as fp_:
        fp_.write(salt.utils.stringutils.to_str(data))

    return 0