<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def append(self, data):
 """Append the given `data` to the output. :arg data: If a list, it is formatted as a bullet list with each entry in the list being a separate bullet. Otherwise if it is a string, the string is added as a paragraph. :raises: ValueError if `data` is not a list or a string. """

        if not data:
            return

        if isinstance(data, list):
            # First we need to clean up the data.
            #
            # Gerrit creates new bullet items when it gets newline characters
            # within a bullet list paragraph, so unless we remove the newlines
            # from the texts the resulting bullet list will contain multiple
            # bullets and look crappy.
            #
            # We add the '*' character on the beginning of each bullet text in
            # the next step, so we strip off any existing leading '*' that the
            # caller has added, and then strip off any leading or trailing
            # whitespace.
            _items = [x.replace("\n", " ").strip().lstrip('*').strip()
                      for x in data]

            # Create the bullet list only with the items that still have any
            # text in them after cleaning up.
            _paragraph = "\n".join(["* %s" % x for x in _items if x])
            if _paragraph:
                self.paragraphs.append(_paragraph)
        elif isinstance(data, str):
            _paragraph = data.strip()
            if _paragraph:
                self.paragraphs.append(_paragraph)
        else:
            raise ValueError('Data must be a list or a string')