def METHOD_NAME(
    automagics: List[Type[interfaces.automagic.AutomagicInterface]],
    plugin: Type[interfaces.plugins.PluginInterface],
) -> List[Type[interfaces.automagic.AutomagicInterface]]:
    """Chooses which automagics to run, maintaining the order they were handed
    in."""
    plugin_category = "None"
    plugin_categories = plugin.__module__.split(".")
    lowest_index = len(plugin_categories)
    for os in constants.OS_CATEGORIES:
        try:
            if plugin_categories.index(os) < lowest_index:
                lowest_index = plugin_categories.index(os)
                plugin_category = os
        except ValueError:
            # The value wasn't found, try the next one
            pass
    if plugin_category not in constants.OS_CATEGORIES:
        vollog.info("No plugin category detected")
        return automagics
    vollog.info(f"Detected a {plugin_category} category plugin")
    output = []
    for amagic in automagics:
        if plugin_category not in amagic.exclusion_list:
            # Only include uncategorized automagic, or platform specific automagic
            # (This allows user defined/uncategorized automagic to be included)
            output += [amagic]
    return output