def METHOD_NAME(
    proj_name,
    user_name,
    repo_name,
    known_link_fname,
    out_link_fname,
    url=None,
    ml_url=None,
):
    """Check and make link targets
    If url is None or ml_url is None, check if there are links present for
    these in `known_link_fname`.  If not, raise error.  The check is:
    Look for a target `proj_name`.
    Look for a target `proj_name` + ' mailing list'
    Also, look for a target `proj_name` + 'github'.  If this exists, don't
    write this target into the new file below.
    If we are writing any of the url, ml_url, or github address, then write new
    file with these links, of form:
    .. _`proj_name`
    .. _`proj_name`: url
    .. _`proj_name` mailing list: url
    """
    link_contents = open(known_link_fname).readlines()
    have_url = url is not None
    have_ml_url = ml_url is not None
    have_gh_url = None
    for line in link_contents:
        if not have_url:
            match = re.match(r"..\s+_%s:\s+" % proj_name, line)
            if match:
                have_url = True
        if not have_ml_url:
            match = re.match(r"..\s+_`%s mailing list`:\s+" % proj_name, line)
            if match:
                have_ml_url = True
        if not have_gh_url:
            match = re.match(r"..\s+_`%s github`:\s+" % proj_name, line)
            if match:
                have_gh_url = True
    if not have_url or not have_ml_url:
        raise RuntimeError(
            "Need command line or known project " "and / or mailing list URLs"
        )
    lines = []
    if url is not None:
        lines.append(f".. _{proj_name}: {url}\n")
    if not have_gh_url:
        gh_url = f"http://github.com/{user_name}/{repo_name}\n"
        lines.append(f".. _`{proj_name} github`: {gh_url}\n")
    if ml_url is not None:
        lines.append(f".. _`{proj_name} mailing list`: {ml_url}\n")
    if len(lines) == 0:
        # Nothing to do
        return
    # A neat little header line
    lines = [".. %s\n" % proj_name] + lines
    out_links = open(out_link_fname, "w")
    out_links.writelines(lines)
    out_links.close()