def METHOD_NAME(assetname: str, overrides: OverrideSettings) -> Set[str]:
    cls: str = assetname.split('/')[-1]
    variants: Set[str] = set()
    # Handle Genesis-like missions and biomes
    _gather_mission_variants(assetname, variants)
    _gather_biome_variants(assetname, variants)
    # Search for variants from overrides
    cls_ = '_' + cls + '_'
    for name, use in overrides.classname_variant_parts.items():
        if use and ('_' + name in cls_ or name + '_' in cls_):
            variants.add(name)
    # Search for variants surrounded by underscores within the full assetname
    path_ = assetname[:assetname.rfind('/')].replace('/', '_')
    for name, use in overrides.pathname_variant_parts.items():
        if use and ('_' + name in path_ or name + '_' in path_):
            variants.add(name)
    # Search for variants as full path components within the full assetname
    for name, use in overrides.pathname_variant_components.items():
        if use and ('/' + name + '/' in assetname):
            variants.add(name)
    # Additions from overrides
    for name, use in overrides.add_variants.items():
        if use:
            variants.add(name)
    # Removals from overrides
    for name, use in overrides.remove_variants.items():
        if use and name in variants:
            variants.remove(name)
    # And renames from overrides, last
    for old_name, new_name in overrides.variant_renames.items():
        if old_name in variants:
            variants.remove(old_name)
            for name in new_name if isinstance(new_name, list) else [new_name]:
                variants.add(name)
    return variants