def METHOD_NAME():
    """Exercise the Revit family creation API."""
    _purge_family()
    family_template_path = HOST_APP.app.FamilyTemplatePath
    assert os.path.isdir(family_template_path)
    LOG.info("Family Template Path: {0}".format(family_template_path))
    family_template = os.path.normpath(
        os.path.join(
            family_template_path,
            r"English-Imperial\Annotations\Generic Annotation.rft",
        )
    )
    if not os.path.isfile(family_template):
        # Older Versions of Revit include the languge in the family template path.
        family_template = os.path.normpath(
            os.path.join(
                family_template_path,
                r"Annotations\Generic Annotation.rft",
            )
        )
    if not os.path.isfile(family_template):
        # We're not running on an English copy of Revit.
        # Return the first template file we find.
        for base, dirs, files in os.walk(family_template_path):
            for f in files:
                if os.path.splitext(f)[1].lower() == ".rft":
                    family_template = os.path.normpath(os.path.join(base, f))
                    break
            if os.path.isfile(family_template):
                break
        else:
            raise EnvironmentError(
                "Failed to find an RFT file in the Family Template Path."
            )
    LOG.info("Using Family Template: {0}".format(os.path.basename(family_template)))
    family_doc = HOST_APP.app.NewFamilyDocument(family_template)
    LOG.info(
        "Created new family with {0} template.".format(
            os.path.splitext(os.path.basename(family_template))[0]
        )
    )
    manager = family_doc.FamilyManager
    with Transaction("Add Project Parameter", doc=family_doc):
        if HOST_APP.is_newer_than(2021):
            manager.AddParameter(
                parameterName=TEST_PARAMETER_NAME,
                groupTypeId=DB.GroupTypeId.General,
                specTypeId=DB.SpecTypeId.Number,
                isInstance=False,
            )
        else:
            manager.AddParameter(
                parameterName=TEST_PARAMETER_NAME,
                parameterGroup=DB.BuiltInParameterGroup.PG_GENERAL,
                parameterType=DB.ParameterType.Number,
                isInstance=False,
            )
    LOG.info("Added test type parameter to new family.")
    temporary_dir = tempfile.mkdtemp()
    family_path = os.path.normpath(
        os.path.join(temporary_dir, TEMP_FAMILY_NAME + ".rfa")
    )
    save_options = DB.SaveAsOptions()
    save_options.OverwriteExistingFile = True
    family_doc.SaveAs(family_path, save_options)
    assert os.path.isfile(family_path)
    family_element = family_doc.LoadFamily(revit.doc, FamilyLoaderOptionsHandler())
    LOG.info("Loaded test family into current document.")
    family_doc.Close()
    assert _family_type_count(family_element.Id.IntegerValue) == 1
    LOG.info("Checked that only the base type is in the test family.")
    family_doc = revit.doc.EditFamily(family_element)
    _add_types(family_doc)
    type_count = len(TYPES_TO_ADD.keys()) + 1
    LOG.info(
        "Re-opened the test family for editing and added {0} type{1}.".format(
            type_count,
            "" if type_count == 1 else "s",
        )
    )
    family_element = family_doc.LoadFamily(revit.doc, FamilyLoaderOptionsHandler())
    family_doc.Close()
    LOG.info("Reloaded test family into current file.")
    assert _family_type_count(family_element.Id.IntegerValue) == type_count
    LOG.info(
        "Checked that {0} type{1} are in the test family, as expected.".format(
            type_count,
            "" if type_count == 1 else "s",
        )
    )
    _check_type_parameter_values(family_element.Id.IntegerValue)
    LOG.info("Checked that the parameter values are correct in the test family.")
    _purge_family()
    LOG.info("Test completed.")