def METHOD_NAME(pep_number, content):
    """
    Handle different formats that pep2html.py outputs
    """
    data = {
        'title': None,
    }
    # Remove leading zeros from PEP number for display purposes
    pep_number_humanize = re.sub(r'^0+', '', str(pep_number))
    if '<html>' in content:
        soup = BeautifulSoup(content, 'lxml')
        data['title'] = soup.title.text
        if not re.search(r'PEP \d+', data['title']):
            data['title'] = 'PEP {} -- {}'.format(
                pep_number_humanize,
                soup.title.text,
            )
        header = soup.body.find('div', class_="header")
        header, data = fix_headers(header, data)
        data['header'] = str(header)
        main_content = soup.body.find('div', class_="content")
        data['main_content'] = str(main_content)
        data['content'] = ''.join([
            data['header'],
            data['main_content']
        ])
    else:
        soup = BeautifulSoup(content, 'lxml')
        soup, data = fix_headers(soup, data)
        if not data['title']:
            data['title'] = f"PEP {pep_number_humanize} -- "
        else:
            if not re.search(r'PEP \d+', data['title']):
                data['title'] = "PEP {} -- {}".format(
                    pep_number_humanize,
                    data['title'],
                )
        data['content'] = str(soup)
    # Fix PEP links
    pep_content = BeautifulSoup(data['content'], 'lxml')
    body_links = pep_content.find_all("a")
    pep_href_re = re.compile(r'pep-(\d+)\.html')
    for b in body_links:
        m = pep_href_re.search(b.attrs['href'])
        # Skip anything not matching 'pep-XXXX.html'
        if not m:
            continue
        b.attrs['href'] = f'/dev/peps/pep-{m.group(1)}/'
    # Return early if 'html' or 'body' return None.
    if pep_content.html is None or pep_content.body is None:
        return
    # Strip <html> and <body> tags.
    pep_content.html.unwrap()
    pep_content.body.unwrap()
    data['content'] = str(pep_content)
    return data