code: def to_str(value):
      '''
      Encode zfs safe string (used for name, path, ...)
      '''
      value = from_str(value)
  
      if value:
          value = value.replace('"', '\\"')
          if ' ' in value:
              value = '"' + value + '"'
      elif value is None:
          value = 'none'
  
      return valuf to_str(value):
      '''
      Encode zfs safe string (used for name, path, ...)
      '''
      value = from_str(value)
  
      if value:
          value = value.replace('"', '\\"')
          if ' ' in value:
              value = '"' + value + '"'
      elif value is None:
          value = 'none'
  
      return value
docs: Encode zfs safe string (used for name, path, ...)