docs: def open_editor(rules=None, content=None):
      """Helper to open an editor for editing the firewall rules.
  
      This method takes two parameters, if content is provided,
      that means that submitting the rules failed and we are allowing
      the user to re-edit what they provided. If content is not provided, the
      rules retrieved from the firewall will be displayed to the user.
  
      :param list rules: A list containing the rules of the firewall
      :param string content: the content that the user provided in the editor
      :returns: a formatted string that get be pushed into the editor
      """
  
      # Let's get the default EDITOR of the environment,
      # use nano if none is specified
      editor = os.environ.get('EDITOR', 'nano')
  
      with tempfile.NamedTemporaryFile(suffix=".tmp") as tfile:
  
          if content:
              # if content is provided, just display it as is
              tfile.write(content)
              tfile.flush()
              subprocess.call([editor, tfile.name])
              tfile.seek(0)
              data = tfile.read()
              return data
  
          if not rules:
              # if the firewall has no rules, provide a template
              tfile.write(DELIMITER)
              tfile.write(get_formatted_rule())
          else:
              # if the firewall has rules, display those to the user
              for rule in rules:
                  tfile.write(DELIMITER)
                  tfile.write(get_formatted_rule(rule))
          tfile.write(DELIMITER)
          tfile.flush()
          subprocess.call([editor, tfile.name])
          tfile.seek(0)
          data = tfile.read()
          return data