Dumps a data structure to TOML source code.

    The given value must be either a dict of dict values, a dict, or a TOML file constructed by this module.
977757
def dumps(value):
    

    from contoml.file.file import TOMLFile

    if not isinstance(value, TOMLFile):
        raise RuntimeError("Can only dump a TOMLFile instance loaded by load() or loads()")

    return value.dumps()
723057
def dump_dict(dict_input, indent=4):
    

    dict_work = dict(dict_input)
    """
    for key, value in six.iteritems(dict_input):
        if any([f(value) for f in (is_float, isDict, is_list_or_tuple)]):
            dict_work[key] = value
            continue

        try:
            dict_work[key] = str(value)
        except:
            dict_work[key] = str(type(value))

        dict_work[key] = _convert_dump_dict(value)
    """

    try:
        import json
        return json.dumps(dict_work, sort_keys=True, indent=indent)
    except ImportError:
        pass

    try:
        import simplejson as json
        return json.dumps(dict_work, sort_keys=True, indent=indent)
    except ImportError:
        pass

    try:
        import pprint
        return pprint.pformat(dict_work, indent=indent)
    except ImportError:
        pass

    return str(dict_work)
262511
def dump(self):
        
        schema = _dict2schema(self._fields)()
        dump_result = schema.dump(self._values)
        return dump_result.data if MARSHMALLOW_VERSION_INFO[0] < 3 else dump_result
655182
def yaml_dump(dict_to_dump):
    
    yaml.SafeDumper.add_representer(OrderedDict, _dict_representer)
    return yaml.safe_dump(dict_to_dump, default_flow_style=False)
1056110
def dump(self):
        
        report_as_json_string = utils.dict_to_json(self.report)
        if self.out_file:
            utils.string_to_file(self.out_file, report_as_json_string)
        else:
            print report_as_json_string
351240
def dumps(self):
        """"""

        error = {'code': self.code,
                 'message': str(self.message)}

        if self.data is not None:
            error['data'] = self.data

        return error
1168041
def dump_object(self, value):
        
        t = type(value)
        if t is int or t is long:
            return str(value)
        return '!' + pickle.dumps(value)
1062855
def json_dumps(self, data, **options):
        
        params = {'sort_keys': True, 'indent': 2}
        params.update(options)
        # This code is based off django's built in JSON serializer
        if json.__version__.split('.') >= ['2', '1', '3']:
            # Use JS strings to represent Python Decimal instances (ticket #16850)
            params.update({'use_decimal': False})
        return json.dumps(data, cls=DjangoJSONEncoder, **params)
72452
def safe_dump(data):
    
    # TODO(retr0h): Do we need to encode?
    # yaml.dump(data) produces the document as a str object in both python
    # 2 and 3.
    return yaml.dump(
        data, Dumper=SafeDumper, default_flow_style=False, explicit_start=True)
468051
def dumps(o, encoder=None):
    

    retval = ""
    if encoder is None:
        encoder = TomlEncoder(o.__class__)
    addtoretval, sections = encoder.dump_sections(o, "")
    retval += addtoretval
    outer_objs = [id(o)]
    while sections:
        section_ids = [id(section) for section in sections]
        for outer_obj in outer_objs:
            if outer_obj in section_ids:
                raise ValueError("Circular reference detected")
        outer_objs += section_ids
        newsections = encoder.get_empty_table()
        for section in sections:
            addtoretval, addtosections = encoder.dump_sections(
                sections[section], section)

            if addtoretval or (not addtoretval and not addtosections):
                if retval and retval[-2:] != "\n\n":
                    retval += "\n"
                retval += "[" + section + "]\n"
                if addtoretval:
                    retval += addtoretval
            for s in addtosections:
                newsections[section + "." + s] = addtosections[s]
        sections = newsections
    return retval
704512
def dump(obj, path, **kw):
    
    open_kw = {'mode': 'w'}
    if PY3:  # pragma: no cover
        open_kw['encoding'] = 'utf-8'

    # avoid indented lines ending with ", " on PY2
    if kw.get('indent') and kw.get('separators') is None:
        kw['separators'] = (',', ': ')

    with open(str(path), **open_kw) as fp:
        return json.dump(obj, fp, **kw)
667129
def dump(obj, root_file, proto=0, key=None):
    
    if isinstance(root_file, string_types):
        root_file = root_open(root_file, 'recreate')
        own_file = True
    else:
        own_file = False
    ret = Pickler(root_file, proto).dump(obj, key)
    if own_file:
        root_file.Close()
    return ret
1214732
def serialize_dict(self, value):
        

        # Check if this is a dict
        if not isinstance(value, dict):
            return value

        # Loop over all the values and serialize them
        return {
            dict_key: self.serialize_value(dict_value)
            for dict_key, dict_value in value.items()
        }
1186500
def dump(self, value):
        
        value = self.__convert__(value)
        self.__validate__(value)
        return self.__serialize__(value)
861292
private Map<String, Object> toMap(CompositeData value) {
        Map<String, Object> data = new HashMap<String, Object>();
        for(String key : value.getCompositeType().keySet()) {
            data.put(key, value.get(key));
        }
        return data;
    }
1303539
def dumps(obj, root_tag):
    
    xml = _get_xml_value(obj)
    if xml:
        # Remove invalid XML
        xml = RE_ILLEGAL_XML.sub('', xml)
    if root_tag is None:
        return xml
    else:
        root = root_tag
        return '<' + root + '>' + xml + '</' + root + '>'
1292293
def dumps(mesh):
    '''
    
    '''
    from lxml import etree

    dae = mesh_to_collada(mesh)

    # Update the xmlnode.
    dae.save()

    return etree.tostring(dae.xmlnode, encoding='UTF-8')