docstr: Format the changelog correctly and convert it to a list of strings
docstr_tok: ["Format","the","changelog","correctly","and","convert","it","to","a","list","of","strings"]
code: def _format_changelog(self, changelog):
      """Format the changelog correctly and convert it to a list of strings"""
      if not changelog:
          return changelog
      new_changelog = []
      for line in changelog.strip().split("\n"):
          line = line.strip()
          if line[0] == "*":
              new_changelog.extend(["", line])
          elif line[0] == "-":
              new_changelog.append(line)
          else:
              new_changelog.append("  " + line)
  
      # strip trailing newline inserted by first changelog entry
      if not new_changelog[0]:
          del new_changelog[0]
  
      return new_changelog
  
file_path: catboost/contrib/python/setuptools/py3/setuptools/_distutils/command/bdist_rpm.py
imports: import subprocess
  import sys
  import os
  from ..core import Command
  from ..debug import DEBUG
  from ..file_util import write_file
  from ..errors import DistutilsOptionError, DistutilsPlatformError, DistutilsFileError, DistutilsExecError
  from ..sysconfig import get_python_version
  from distutils._log import log
label_desc: Use image node_id 7 for calling the bdist_rpm obj's underlying member method code with example usage: obj._format_changelog(changelog) and returns: new_changelog, changelog