def fix_flags()

in tensorboard/plugins/core/core_plugin.py [0:0]


    def fix_flags(self, flags):
        """Fixes standard TensorBoard CLI flags to parser."""
        FlagsError = base_plugin.FlagsError
        if flags.version_tb:
            pass
        elif flags.inspect:
            if flags.logdir_spec:
                raise FlagsError(
                    "--logdir_spec is not supported with --inspect."
                )
            if flags.logdir and flags.event_file:
                raise FlagsError(
                    "Must specify either --logdir or --event_file, but not both."
                )
            if not (flags.logdir or flags.event_file):
                raise FlagsError(
                    "Must specify either --logdir or --event_file."
                )
        elif flags.logdir and flags.logdir_spec:
            raise FlagsError("May not specify both --logdir and --logdir_spec")
        elif (
            not flags.db
            and not flags.logdir
            and not flags.logdir_spec
            and not flags.grpc_data_provider
        ):
            raise FlagsError(
                "A logdir or db must be specified. "
                "For example `tensorboard --logdir mylogdir` "
                "or `tensorboard --db sqlite:~/.tensorboard.db`. "
                "Run `tensorboard --helpfull` for details and examples."
            )
        elif flags.host is not None and flags.bind_all:
            raise FlagsError("Must not specify both --host and --bind_all.")
        elif (
            flags.load_fast == "true" and flags.detect_file_replacement is True
        ):
            raise FlagsError(
                "Must not specify both --load_fast=true and"
                "--detect_file_replacement=true"
            )

        flags.path_prefix = flags.path_prefix.rstrip("/")
        if flags.path_prefix and not flags.path_prefix.startswith("/"):
            raise FlagsError(
                "Path prefix must start with slash, but got: %r."
                % flags.path_prefix
            )