INNER CODE UNIT · Python

normalize_choice

cubist38/mlx-openai-server · app/cli.py:52

    def normalize_choice(self, choice, ctx):
        """Return the canonical uppercase choice or raise BadParameter.

        Parameters
        ----------
        choice:
            Raw value supplied by the user (may be ``None``).
        ctx:
            Click context object (unused here but part of the API).

        Returns
        -------
        str | None
            Uppercased canonical choice, or ``None`` if ``choice`` is
            ``None``.
        """
        if choice is None:
            return None

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…