def _generate_choice_re(
        choices: Iterable[str], flags: Union[int, re.RegexFlag] = 0
    ) -> Pattern[str]:
        """
        Generate a regular expression pattern that matches a choice from an iterable.

        Takes an iterable of strings (`choices`) and returns a compiled regular expression
        pattern that matches any of the choices. The pattern is created by joining the
        choices with the '|' (OR) operator, which matches any of the enclosed patterns.

        :param choices: An iterable of strings to match.
        :type choices: Iterable[str]
        :param flags: Optional regular expression flags. Default is 0.
        :type flags: Union[int, re.RegexFlag], optional
        :returns: A compiled regular expression pattern that matches any of the choices.
        :rtype: re.Pattern[str]
        """
        return re.compile(r"({})".format("|".join(choices)), flags=flags)

        Generate a regular expression pattern that matches a choice from an iterable.

        Takes an iterable of strings (`choices`) and returns a compiled regular expression
        pattern that matches any of the choices. The pattern is created by joining the
        choices with the '|' (OR) operator, which matches any of the enclosed patterns.

        :param choices: An iterable of strings to match.
        :type choices: Iterable[str]
        :param flags: Optional regular expression flags. Default is 0.
        :type flags: Union[int, re.RegexFlag], optional
        :returns: A compiled regular expression pattern that matches any of the choices.
        :rtype: re.Pattern[str]
        
arrow/parser.py