0000008b
  Z   ˆl–ßi~”J_)íÀ¿q—”Å£�þDñF³r2¸Ô�¶W�üÿ¿„u¯Ä_ŠI|¥�+Wé3ž¯a–ß=¿J	Å4Ÿº‚ œPA¸nµ1hßÃ (ê    # -*- coding: utf-8 -*-

import argparse
import sys
from typing import Callable, Iterable, List, Optional, Pattern, Tuple, Union, cast

import natsort
from natsort.utils import regex_chooser

Num = Union[float, int]
NumIter = Iterable[Num]
NumPair = Tuple[Num, Num]
NumPairIter = Iterable[NumPair]
NumConverter = Callable[[str], Num]


class TypedArgs(argparse.Namespace):
    paths: bool
    filter: Optional[List[NumPair]]
    reverse_filter: Optional[List[NumPair]]
    exclude: List[Num]
    reverse: bool
    number_type: str
    nosign: bool
    sign: bool
    noexp: bool
    locale: bool
    entries: List[str]

    def __init__(
        self,
        filter: Optional[List[NumPair]] = None,
        reverse_filter: Optional[List[NumPair]] = None,
        exclude: Optional[List[Num]] = None,
        paths: bool = False,
        reverse: bool = False,
    ) -> None:
        """Used by testing only"""
        self.filter = filter
        self.reverse_filter = reverse_filter
        self.exclude = [] if exclude is None else exclude
        self.paths = paths
        self.reverse = reverse
        self.number_type = "int"
        self.signed = False
        self.exp = True
        self.locale = False


def main(*arguments: str) -> None:
    """
    Performs a natural sort on entries given on the command-line.

    Arguments are read from sys.argv.
    """

    from argparse import ArgumentParser, RawDescriptionHelpFormatter
    from textwrap import dedent

    parser = ArgumentParser(
        description=dedent(cast(str, main.__doc__)),
        formatter_class=RawDescriptionHelpFormatter,
    )
    parser.add_argument(
        "--version",
        action="version",
        version="%(prog)s {}".format(natsort.__version__),
    )
    parser.add_argument(
        "-p",
        "--paths",
        default=False,
        action="store_true",
        help="Interpret the input as file paths.  This is not "
        "strictly necessary to sort all file paths, but in cases "
        'where there are OS-generated file paths like "Folder/" '
        'and "Folder (1)/", this option is needed to make the '
        'paths sorted in the order you expect ("Folder/" before '
        '"Folder (1)/").',
    )
    parser.add_argument(
        "-f",
        "--filter",
        nargs=2,
        type=float,
        metavar=("LOW", "HIGH"),
        action="append",
        help="Used for keeping only the entries that have a number "
        "falling in the given range.",
    )
    parser.add_argument(
        "-F",
        "--reverse-filter",
        nargs=2,
        type=float,
        metavar=("LOW", "HIGH"),
        action="append",
        dest="reverse_filter",
        help="Used for excluding the entries that have a number "
        "falling in the given range.",
    )
    parser.add_argument(
        "-e",
        "--exclude",
        type=float,
        action="append",
        help="Used to exclude an entry that contains a specific number.",
    )
    parser.add_argument(
        "-r",
        "--reverse",
        action="store_true",
        default=False,
        help="Returns in reversed order.",
    )
    parser.add_argument(
        "-t",
        "--number-type",
        "--number_type",
        dest="number_type",
        choices=("int", "float", "real", "f", "i", "r"),
        default="int",
        help='Choose the type of number to search for. "float" will search '
        'for floating-point numbers.  "int" will only search for '
        'integers. "real" is a shortcut for "float" with --sign. '
        '"i" is a synonym for "int", "f" is a synonym for '
        '"float", and "r" is a synonym for "real".'
        "The default is %(default)s.",
    )
    parser.add_argument(
        "--nosign",
        default=False,
        action="store_false",
        dest="signed",
        help='Do not consider "+" or "-" as part of a number, i.e. do not '
        "take sign into consideration. This is the default.",
    )
    pars