Write a dictionary object to a file

    :param f: The file to write to
    :type f: file/string
    :param data: The data to write to the file
    :type data: dict
330756
def writeData(f, data):
    
    if not isinstance(data, dict):
      raise Exception(PyVDF.__ERR_NotDict.format(repr(data)))
    data = PyVDF.formatData(data)
    try:
      f.write(data)
    except AttributeError:
      pass

    try:
      filec = open(f, 'w')
      filec.write(data)
      filec.close()
    except IOError as e:
      print("Could not open '" + f + "' for writing.")
      print(e)
430547
def write(self, data, *, mode=None, buffering=-1, encoding=None, newline=None):
        '''  '''
        if mode is None:
            mode = 'w' if isinstance(data, str) else 'wb'
        with self.open(mode=mode, buffering=buffering, encoding=encoding, newline=newline) as fp:
            return fp.write(data)
678793
def write(self,f):
        
        if isinstance(f,str):
            f = open(f,'w')
            f.write("pcf\n")
            f.write("* control data\n")
        for line in CONTROL_VARIABLE_LINES:
            [f.write(self.formatted_values[name.replace('[','').replace(']','')]) for name in line.split()]
            f.write('\n')
398224
def load(f, dict_=dict):
    
    if not f.read:
        raise ValueError('The first parameter needs to be a file object, ',
                         '%r is passed' % type(f))
    return loads(f.read(), dict_)
205055
def writeElement(self, data):
        
        key = type(data)
        func = None

        try:
            func = self._func_cache[key]
        except KeyError:
            func = self.getTypeFunc(data)

            if func is None:
                raise pyamf.EncodeError('Unable to encode %r (type %r)' % (
                    data, key))

            self._func_cache[key] = func

        func(data)
371830
def write(self, f):
        
        rdf = ET.Element(NS('rdf', 'RDF'), nsmap=XML_NS)

        # TODO: TopLevel Annotations
        sequence_values = sorted(self._sequences.values(), key=lambda x: x.identity)
        self._add_to_root(rdf, sequence_values)
        component_values = sorted(self._components.values(), key=lambda x: x.identity)
        self._add_to_root(rdf, component_values)
        model_values = sorted(self._models.values(), key=lambda x: x.identity)
        self._add_to_root(rdf, model_values)
        module_values = sorted(self._modules.values(), key=lambda x: x.identity)
        self._add_to_root(rdf, module_values)
        collection_values = sorted(self._collections.values(), key=lambda x: x.identity)
        self._add_to_root(rdf, collection_values)
        annotation_values = sorted(self._annotations.values(), key=lambda x: x.identity)
        self._add_to_root(rdf, annotation_values)

        f.write(ET.tostring(rdf,
                            pretty_print=True,
                            xml_declaration=True,
                            encoding='utf-8'))
519107
def write_data(self, data):
        
        with open(self.path, "w") as writer:
            writer.write(data)
938043
def write(self, data):
        
        self._check_can_write()
        compressed = self._compressor.compress(data)
        self._fp.write(compressed)
        self._pos += len(data)
        return len(data)
28519
def write(self, data):
        
        m = self._convert_structure(data)
        self._file.write(self._format_mol(*m))
        self._file.write('M  END\n')

        for k, v in data.meta.items():
            self._file.write(f'>  <{k}>\n{v}\n')
        self._file.write('$$$$\n')
689057
public void writeToFile(File f) {
		try (FileOutputStream fos = new FileOutputStream(f)) {
			fos.write(write());
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
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))
812431
def write_dicts_to_json(self, data):
        
        with open(self.path, "w") as out:
            json.dump(
                data,  # data
                out,  # file handler
                indent=4, sort_keys=True  # pretty print
            )
1014867
def write(self, data):
        
        _complain_ifclosed(self.closed)
        if self.__encoding:
            self.f.write(data.encode(self.__encoding, self.__errors))
            return len(data)
        else:
            return self.f.write(data)
872788
public static void writeToFile(final File fileNode, final byte[] data) throws FrameworkException, IOException {

		setFileProperties(fileNode);

		FileUtils.writeByteArrayToFile(fileNode.getFileOnDisk(), data);

	}
114581
def save_yamlf(data: Union[list, dict], fpath: str, encoding: str) -> str:
    
    with codecs.open(fpath, mode='w', encoding=encoding) as f:
        f.write(dump_yaml(data))
        return fpath
1098921
def write(file_name, data):
    """"""
    with open(file_name, 'w') as f:
        f.write(encode(data))
489024
def write_json(data, filename):
    

    def custom_default(obj):
        if obj is None or (hasattr(obj, 'isNull') and obj.isNull()):
            return ''
        raise TypeError

    with open(filename, 'w') as json_file:
        json.dump(data, json_file, indent=2, default=custom_default)