Dumps a dict of properties to the specified open stream or file path.

    :API: public
506522
def dump(props, output):
    
    def escape(token):
      return re.sub(r'([=:\s])', r'\\\1', token)

    def write(out):
      for k, v in props.items():
        out.write('%s=%s\n' % (escape(str(k)), escape(str(v))))

    if hasattr(output, 'write') and callable(output.write):
      write(output)
    elif isinstance(output, six.string_types):
      with open(output, 'w+') as out:
        write(out)
    else:
      raise TypeError('Can only dump data to a path or a writable object, given: %s' % output)
145561
def _dumps(self, obj):
        
        if not self.serialized:
            return obj
        return self.serializer.dumps(obj)
959103
def json_dump(obj,       # type: Any
              fp,        # type: IO[str]
              **kwargs   # type: Any
             ):  # type: (...) -> None
    
    if six.PY2:
        kwargs['encoding'] = 'utf-8'
    json.dump(convert_to_dict(obj), fp, **kwargs)
162269
def dump(self, stream=None):
        
        if stream is None:
            stream = BytesIO()

        if isinstance(stream, bytes):
            stream = BytesIO(stream)

        stream = self.codec.compress(stream)
        self.fs.dump(stream)

        return self
1101511
def dump_declarations(declarations, file_path):
    

    with open(file_path, "w+") as f:
        print_declarations(declarations, writer=f.write)
34773
def yml_dump(data, stream, yml_fnc=yml_fnc, **options):
    
    _is_dict = anyconfig.utils.is_dict_like(data)

    if options.get("ac_safe", False):
        options = {}
    elif not options.get("Dumper", False) and _is_dict:
        # TODO: Any other way to get its constructor?
        maybe_container = options.get("ac_dict", type(data))
        options["Dumper"] = _customized_dumper(maybe_container)

    if _is_dict:
        # Type information and the order of items are lost on dump currently.
        data = anyconfig.dicts.convert_to(data, ac_dict=dict)
        options = common.filter_from_options("ac_dict", options)

    return yml_fnc("dump", data, stream, **options)
166751
def json_pretty_dump(obj, filename):
    
    with open(filename, "wt") as fh:
        json.dump(obj, fh, indent=4, sort_keys=4)
1077079
def dump(cls, filename, objects, properties, bools, encoding):
        """"""
        if encoding is None:
            encoding = cls.encoding

        source = cls.dumps(objects, properties, bools)
        if PY2:
            source = unicode(source)

        with io.open(filename, 'w', encoding=encoding) as fd:
            fd.write(source)
255493
def dumps(self) -> str:
        
        return json.dumps(self.data, sort_keys=True, indent=4)
1357519
def dump(self, path):
        
        try:
            with open(path, "wb") as f:
                f.write(self.__str__().encode("utf-8"))
        except:
            pass

        with open(path, "wb") as f:
            pickle.dump(self.__data__, f)
320632
def save(self, path):
    
    json.dump(dict(loss=self.__class__.__name__,
                   params=self.hparams),
              open(os.path.join(path, 'loss.json'), 'wb'))
839820
def dumps(dict_data, ensure_ascii=True, indent=None,
          sort_keys=False, encoding='utf-8', **kwargs):
    

    return json.dumps(dict_data, default=json_default,
                      ensure_ascii=ensure_ascii, indent=indent,
                      sort_keys=sort_keys, encoding=encoding, **kwargs)
258265
def write_dict_to_json(dictionary, path, **kwargs):
    
    result_string = json.dumps(dictionary, cls=JSONObjectEncoder,
                               indent=4, check_circular=False, sort_keys=True, **kwargs)
    with open(path, 'w') as f:
        # We cannot write directly to the file, as otherwise the 'encode' method wouldn't be called
        f.write(result_string)
851282
def export(self, file_path=None, export_format=None):
        
        with io.open(file_path, mode='w', encoding="utf-8") as export_file:
            if export_format == 'yaml':
                import yaml
                yaml.safe_dump(self.to_dict(), export_file, default_flow_style=False)
            elif export_format == 'json':
                export_file.write(text_type(json.dumps(self.to_dict(), ensure_ascii=False)))
            return True
456363
def file_set_properties(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/setProperties' % object_id, input_params, always_retry=always_retry, **kwargs)
567160
def dump(data, stream=None, **kwargs):
    
    return yaml.dump_all(
        [data],
        stream=stream,
        Dumper=YAMLDictDumper,
        **kwargs
    )
372354
def dump
      stream << keyspace_structure
      stream << schema_meta_structure
      stream << "\n\n"
      stream << versions_insert_cql
      stream << "\n"

      close_stream
    end