code: 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)
docs: An wrapper of yaml.safe_dump and yaml.dump.
  
      :param data: Some data to dump
      :param stream: a file or file-like object to dump YAML data