code: 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)
docs: Dumps a dict of properties to the specified open stream or file path.
  
      :API: public