# Path: natsort/ns_enum.py
# class ns(enum.IntEnum):  # noqa: N801
#     FLOAT = F = 1 << next(_counter)
#     SIGNED = S = 1 << next(_counter)
#     NOEXP = N = 1 << next(_counter)
#     PATH = P = 1 << next(_counter)
#     LOCALEALPHA = LA = 1 << next(_counter)
#     LOCALENUM = LN = 1 << next(_counter)
#     IGNORECASE = IC = 1 << next(_counter)
#     LOWERCASEFIRST = LF = 1 << next(_counter)
#     GROUPLETTERS = G = 1 << next(_counter)
#     UNGROUPLETTERS = CAPITALFIRST = C = UG = 1 << next(_counter)
#     NANLAST = NL = 1 << next(_counter)
#     COMPATIBILITYNORMALIZE = CN = 1 << next(_counter)
#     NUMAFTER = NA = 1 << next(_counter)
#     DEFAULT = 0
#     INT = I = 0  # noqa: E741
#     UNSIGNED = U = 0
#     REAL = R = FLOAT | SIGNED
#     LOCALE = L = LOCALEALPHA | LOCALENUM
# NS_DUMB = 1 << 31
# 
# Path: natsort/utils.py
# def input_string_transform_factory(alg: NSType) -> StrToStr:
#     """
#     Create a function to transform a string.
# 
#     Parameters
#     ----------
#     alg : ns enum
#         Indicate how to format the *str*.
# 
#     Returns
#     -------
#     func : callable
#         A function to be used as the *input_transform* argument to
#         *parse_string_factory*.
# 
#     See Also
#     --------
#     parse_string_factory
# 
#     """
#     # Shortcuts.
#     lowfirst = alg & ns.LOWERCASEFIRST
#     dumb = alg & NS_DUMB
# 
#     # Build the chain of functions to execute in order.
#     function_chain: List[StrToStr] = []
#     if (dumb and not lowfirst) or (lowfirst and not dumb):
#         function_chain.append(methodcaller("swapcase"))
# 
#     if alg & ns.IGNORECASE:
#         function_chain.append(methodcaller("casefold"))
# 
#     if alg & ns.LOCALENUM:
#         # Create a regular expression that will remove thousands separators.
#         strip_thousands = r"""
#             (?<=[0-9]{{1}})  # At least 1 number
#             (?<![0-9]{{4}})  # No more than 3 numbers
#             {nodecimal}      # Cannot follow decimal
#             {thou}           # The thousands separator
#             (?=[0-9]{{3}}    # Three numbers must follow
#              ([^0-9]|$)      # But a non-number after that
#             )
#         """
#         nodecimal = r""
#         if alg & ns.FLOAT:
#             # Make a regular expression component that will ensure no
#             # separators are removed after a decimal point.
#             d = re.escape(get_decimal_point())
#             nodecimal += r"(?<!" + d + r"[0-9])"
#             nodecimal += r"(?<!" + d + r"[0-9]{2})"
#             nodecimal += r"(?<!" + d + r"[0-9]{3})"
#         strip_thousands = strip_thousands.format(
#             thou=re.escape(get_thousands_sep()), nodecimal=nodecimal
#         )
#         strip_thousands_re = re.compile(strip_thousands, flags=re.VERBOSE)
#         function_chain.append(partial(strip_thousands_re.sub, ""))
# 
#         # Create a regular expression that will change the decimal point to
#         # a period if not already a period.
#         decimal = get_decimal_point()
#         if alg & ns.FLOAT and decimal != ".":
#             switch_decimal = r"(?<=[0-9]){decimal}|{decimal}(?=[0-9])"
#             switch_decimal = switch_decimal.format(decimal=re.escape(decimal))
#             switch_decimal_re = re.compile(switch_decimal)
#             function_chain.append(partial(switch_decimal_re.sub, "."))
# 
#     # Return the chained functions.
#     return chain_functions(function_chain)


from typing import Callable
from hypothesis import example, given
from hypothesis.strategies import integers, text
from natsort.ns_enum import NSType, NS_DUMB, ns
from natsort.utils import input_string_transform_factory
import pytest
        ("12.59443.642.642,53.4534980", "12.59443.642642,53.4534980"),  # No change
        ("12543.642.642,5.34534980", "12543.642642,5.34534980"),
    ],
)
@pytest.mark.usefixtures("with_locale_de_de")
def test_input_string_transform_factory_handles_de_locale(
    x: str, expected: str
) -> None:
    input_string_transform_func = input_string_transform_factory(ns.LOCALE)
    assert input_string_transform_func(x) == expected


@pytest.mark.parametrize(
    "alg, expected",
    [
        (ns.LOCALE, "1543,753"),  # Does nothing without FLOAT
        (ns.LOCALE | ns.FLOAT, "1543.753"),
        (ns.LOCALEALPHA, "1543,753"),  # LOCALEALPHA won't do anything, need LOCALENUM
    ],
)
@pytest.mark.usefixtures("with_locale_de_de")
def test_input_string_transform_factory_handles_german_locale(
    alg: NSType, expected: str
) -> None:
    input_string_transform_func = input_string_transform_factory(alg)
    assert input_string_transform_func("1543,753") == expected


@pytest.mark.usefixtures("with_locale_de_de")
def test_input_string_transform_factory_does_nothing_with_non_num_input() -> None:

# Path: natsort/ns_enum.py
# class ns(enum.IntEnum):  # noqa: N801
#     FLOAT = F = 1 << next(_counter)
#     SIGNED = S = 1 << next(_counter)
#     NOEXP = N = 1 << next(_counter)
#     PATH = P = 1 << next(_counter)
#     LOCALEALPHA = LA = 1 << next(_counter)
#     LOCALENUM = LN = 1 << next(_counter)
#     IGNORECASE = IC = 1 << next(_counter)
#     LOWERCASEFIRST = LF = 1 << next(_counter)
#     GROUPLETTERS = G = 1 << next(_counter)
#     UNGROUPLETTERS = CAPITALFIRST = C = UG = 1 << next(_counter)
#     NANLAST = NL = 1 << next(_counter)
#     COMPATIBILITYNORMALIZE = CN = 1 << next(_counter)
#     NUMAFTER = NA = 1 << next(_counter)
#     DEFAULT = 0
#     INT = I = 0  # noqa: E741
#     UNSIGNED = U = 0
#     REAL = R = FLOAT | SIGNED
#     LOCALE = L = LOCALEALPHA | LOCALENUM
# NS_DUMB = 1 << 31
# 
# Path: natsort/utils.py
# def input_string_transform_factory(alg: NSType) -> StrToStr:
#     """
#     Create a function to transform a string.
# 
#     Parameters
#     ----------
#     alg : ns enum
#         Indicate how to format the *str*.
# 
#     Returns
#     -------
#     func : callable
#         A function to be used as the *input_transform* argument to
#         *parse_string_factory*.
# 
#     See Also
#     --------
#     parse_string_factory
# 
#     """
#     # Shortcuts.
#     lowfirst = alg & ns.LOWERCASEFIRST
#     dumb = alg & NS_DUMB
# 
#     # Build the chain of functions to execute in order.
#     function_chain: List[StrToStr] = []
#     if (dumb and not lowfirst) or (lowfirst and not dumb):
#         function_chain.append(methodcaller("swapcase"))
# 
#     if alg & ns.IGNORECASE:
#         function_chain.append(methodcaller("casefold"))
# 
#     if alg & ns.LOCALENUM:
#         # Create a regular expression that will remove thousands separators.
#         strip_thousands = r"""
#             (?<=[0-9]{{1}})  # At least 1 number
#             (?<![0-9]{{4}})  # No more than 3 numbers
#             {nodecimal}      # Cannot follow decimal
#             {thou}           # The thousands separator
#             (?=[0-9]{{3}}    # Three numbers must follow
#              ([^0-9]|$)      # But a non-number after that
#             )
#         """
#         nodecimal = r""
#         if alg & ns.FLOAT:
#             # Make a regular expression component that will ensure no
#             # separators are removed after a decimal point.
#             d = re.escape(get_decimal_point())
#             nodecimal += r"(?<!" + d + r"[0-9])"
#             nodecimal += r"(?<!" + d + r"[0-9]{2})"
#             nodecimal += r"(?<!" + d + r"[0-9]{3})"
#         strip_thousands = strip_thousands.format(
#             thou=re.escape(get_thousands_sep()), nodecimal=nodecimal
#         )
#         strip_thousands_re = re.compile(strip_thousands, flags=re.VERBOSE)
#         function_chain.append(partial(strip_thousands_re.sub, ""))
# 
#         # Create a regular expression that will change the decimal point to
#         # a period if not already a period.
#         decimal = get_decimal_point()
#         if alg & ns.FLOAT and decimal != ".":
#             switch_decimal = r"(?<=[0-9]){decimal}|{decimal}(?=[0-9])"
#             switch_decimal = switch_decimal.format(decimal=re.escape(decimal))
#             switch_decimal_re = re.compile(switch_decimal)
#             function_chain.append(partial(switch_decimal_re.sub, "."))
# 
#     # Return the chained functions.
#     return chain_functions(function_chain)


# Path: tests/test_input_string_transform_factory.py
from typing import Callable
from hypothesis import example, given
from hypothesis.strategies import integers, text
from natsort.ns_enum import NSType, NS_DUMB, ns
from natsort.utils import input_string_transform_factory
import pytest

        ("12.59443.642.642,53.4534980", "12.59443.642642,53.4534980"),  # No change
        ("12543.642.642,5.34534980", "12543.642642,5.34534980"),
    ],
)
@pytest.mark.usefixtures("with_locale_de_de")
def test_input_string_transform_factory_handles_de_locale(
    x: str, expected: str
) -> None:
    input_string_transform_func = input_string_transform_factory(ns.LOCALE)
    assert input_string_transform_func(x) == expected


@pytest.mark.parametrize(
    "alg, expected",
    [
        (ns.LOCALE, "1543,753"),  # Does nothing without FLOAT
        (ns.LOCALE | ns.FLOAT, "1543.753"),
        (ns.LOCALEALPHA, "1543,753"),  # LOCALEALPHA won't do anything, need LOCALENUM
    ],
)
@pytest.mark.usefixtures("with_locale_de_de")
def test_input_string_transform_factory_handles_german_locale(
    alg: NSType, expected: str
) -> None:
    input_string_transform_func = input_string_transform_factory(alg)
    assert input_string_transform_func("1543,753") == expected


@pytest.mark.usefixtures("with_locale_de_de")
def test_input_string_transform_factory_does_nothing_with_non_num_input() -> None:

    input_string_transform_func = input_string_transform_factory(ns.LOCALE | ns.FLOAT)