cli/streamingphish/streamingphish/cli.py
def _manage_classifiers(self):
        """
        List active classifier, list available classifiers, and prompt user to change
                the active classifier.

        1. Summarize accuracy metrics across all trained classifiers.
        2. Show performance metrics from a single classifier.
        3. Change the active classifier.
        4. Delete a classifier.
        5. Return to the main menu.
        """
        while True:
            # List trained classifiers, if any. Return to main menu if no classifiers found.
            available_classifiers = self._phish_db.available_classifiers()
            active_classifier = self._phish_config.active_classifier
            if not available_classifiers:
                tqdm.tqdm.write("[-] There are no classifiers currently trained"
                                " - please train one.")
                return

            # List the active classifier and any other available classifiers.
            if len(available_classifiers) == 1 and active_classifier in available_classifiers:
                tqdm.tqdm.write("[+] The activated classifier, {}, is the only"
                                " one trained.".format(active_classifier))
            else:
                tqdm.tqdm.write("[+] Active classifier: {}".format(active_classifier))
                tqdm.tqdm.write("[+] Other available classifiers:")
                for clf in available_classifiers:
                    if clf != active_classifier:
                        tqdm.tqdm.write("\t- {}".format(clf))

            # If user is this far, they have more than one classifier trained. Let them decide what
            # to do next.
            tqdm.tqdm.write(CLASSIFIERS_MENU)
            try:
                selection = int(input("Please make a selection [1-5]: "))
            except ValueError:
                tqdm.tqdm.write("Invalid input - please select a number 1 through 5"
                                " and press enter.")
                continue
            else:
                if selection < 1 and selection > 5:
                    tqdm.tqdm.write("Invalid selection - please select a number 1 through 5"
                                    " and press enter.")
                    continue

            if selection == 1:
                self._metrics_summary(available_classifiers)
            elif selection == 2:
                self._single_classifier_metrics()
            elif selection == 3:
                self._change_classifier(available_classifiers)
            elif selection == 4:
                self._delete_classifier()
            elif selection == 5:
                tqdm.tqdm.write("[+] Returning to main menu.")
                return

        List active classifier, list available classifiers, and prompt user to change
                the active classifier.

        1. Summarize accuracy metrics across all trained classifiers.
        2. Show performance metrics from a single classifier.
        3. Change the active classifier.
        4. Delete a classifier.
        5. Return to the main menu.
        
List active classifier, list available classifiers, and prompt user to change
the active classifier.

1. Summarize accuracy metrics across all trained classifiers.
2. Show performance metrics from a single classifier.
3. Change the active classifier.
4. Delete a classifier.
5. Return to the main menu.
List active classifier list available classifiers and prompt user to change the active classifier . 1 . Summarize accuracy metrics across all trained classifiers . 2 . Show performance metrics from a single classifier . 3 . Change the active classifier . 4 . Delete a classifier . 5 . Return to the main menu .
def _manage_classifiers(self):
        while True:
            available_classifiers = self._phish_db.available_classifiers()
            active_classifier = self._phish_config.active_classifier
            if not available_classifiers:
                tqdm.tqdm.write("[-] There are no classifiers currently trained"
                                " - please train one.")
                return
            if len(available_classifiers) == 1 and active_classifier in available_classifiers:
                tqdm.tqdm.write("[+] The activated classifier, {}, is the only"
                                " one trained.".format(active_classifier))
            else:
                tqdm.tqdm.write("[+] Active classifier: {}".format(active_classifier))
                tqdm.tqdm.write("[+] Other available classifiers:")
                for clf in available_classifiers:
                    if clf != active_classifier:
                        tqdm.tqdm.write("\t- {}".format(clf))
            tqdm.tqdm.write(CLASSIFIERS_MENU)
            try:
                selection = int(input("Please make a selection [1-5]: "))
            except ValueError:
                tqdm.tqdm.write("Invalid input - please select a number 1 through 5"
                                " and press enter.")
                continue
            else:
                if selection < 1 and selection > 5:
                    tqdm.tqdm.write("Invalid selection - please select a number 1 through 5"
                                    " and press enter.")
                    continue
            if selection == 1:
                self._metrics_summary(available_classifiers)
            elif selection == 2:
                self._single_classifier_metrics()
            elif selection == 3:
                self._change_classifier(available_classifiers)
            elif selection == 4:
                self._delete_classifier()
            elif selection == 5:
                tqdm.tqdm.write("[+] Returning to main menu.")
                return
def _manage_classifiers ( self ) : while True : available_classifiers = self . _phish_db . available_classifiers ( ) active_classifier = self . _phish_config . active_classifier if not available_classifiers : tqdm . tqdm . write ( "[-] There are no classifiers currently trained" " - please train one." ) return if len ( available_classifiers ) == 1 and active_classifier in available_classifiers : tqdm . tqdm . write ( "[+] The activated classifier, {}, is the only" " one trained." . format ( active_classifier ) ) else : tqdm . tqdm . write ( "[+] Active classifier: {}" . format ( active_classifier ) ) tqdm . tqdm . write ( "[+] Other available classifiers:" ) for clf in available_classifiers : if clf != active_classifier : tqdm . tqdm . write ( "\t- {}" . format ( clf ) ) tqdm . tqdm . write ( CLASSIFIERS_MENU ) try : selection = int ( input ( "Please make a selection [1-5]: " ) ) except ValueError : tqdm . tqdm . write ( "Invalid input - please select a number 1 through 5" " and press enter." ) continue else : if selection < 1 and selection > 5 : tqdm . tqdm . write ( "Invalid selection - please select a number 1 through 5" " and press enter." ) continue if selection == 1 : self . _metrics_summary ( available_classifiers ) elif selection == 2 : self . _single_classifier_metrics ( ) elif selection == 3 : self . _change_classifier ( available_classifiers ) elif selection == 4 : self . _delete_classifier ( ) elif selection == 5 : tqdm . tqdm . write ( "[+] Returning to main menu." ) return
List active classifier, list available classifiers, and prompt user to change
the active classifier.
List active classifier list available classifiers and prompt user to change the active classifier .
"""
        List active classifier, list available classifiers, and prompt user to change
                the active classifier.

        1. Summarize accuracy metrics across all trained classifiers.
        2. Show performance metrics from a single classifier.
        3. Change the active classifier.
        4. Delete a classifier.
        5. Return to the main menu.
        """ # List trained classifiers, if any. Return to main menu if no classifiers found. # List the active classifier and any other available classifiers. # If user is this far, they have more than one classifier trained. Let them decide what # to do next.
self