    def _summary(
        self, overview_only: bool = False, capabilities: Optional[List[str]] = None, **kwargs
    ):
        """
        Internal function for description and summary.
        """

        # The capabilities are sorted such that if the capability does not exist
        # in the list of pre-defined `_capabilities`, then it is put at the end.
        # `100` is selected as an arbitrary large number; we do not expect the
        # number of capabilities to be higher.
        def cap_order(x):
            return self._capabilities.index(x) if x in self._capabilities else 100

        capabilities = capabilities or sorted(
            set([x["capability"] for x in self.suite.info.values()]), key=cap_order
        )
        print(
            "\n\nThis suite contains {} tests across {} capabilities.".format(
                len(self.suite.tests), len(capabilities)
            )
        )
        print()
        for capability in capabilities:
            tests = [
                name for name, test in self.suite.info.items() if test["capability"] == capability
            ]
            num_tests = len(tests)
            if num_tests > 0:
                print(f'\nCapability: "{capability}" ({num_tests} tests)\n')
                for test in tests:
                    description = self.suite.info[test]["description"]
                    num_test_cases = len(self.suite.tests[test].data)
                    about_test = f"* Name: {test} ({num_test_cases} test cases)"
                    if description:
                        about_test += f"\n{description}"
                    print(about_test)

                    if not overview_only:
                        if "format_example_fn" not in kwargs:
                            kwargs["format_example_fn"] = self.suite.info[test].get(
                                "format_example_fn", self._format_failing_examples
                            )
                        if "print_fn" not in kwargs:
                            kwargs["print_fn"] = self.suite.info[test].get(
                                "print_fn", self.suite.print_fn
                            )
                        print()
                        self.suite.tests[test].summary(**kwargs)
                        print()
Internal function for description and summary.
allennlp/confidence_checks/task_checklists/task_suite.py