def generate_tests(cls):
        cases_pat = join(dirname(__file__), cls.cases_dir, "*.text")
        for text_path in glob(cases_pat):
            # Load an options (`*.opts` file, if any).
            # It must be a Python dictionary. It will be passed as
            # kwargs to the markdown function.
            opts = {}
            opts_path = splitext(text_path)[0] + ".opts"
            if exists(opts_path):
                try:
                    opts = eval(open(opts_path, 'r').read())
                except Exception:
                    _, ex, _ = sys.exc_info()
                    print("WARNING: couldn't load `%s' opts file: %s" \
                          % (opts_path, ex))

            toc_html_path = splitext(text_path)[0] + ".toc_html"
            if not exists(toc_html_path):
                toc_html_path = None
            metadata_path = splitext(text_path)[0] + ".metadata"
            if not exists(metadata_path):
                metadata_path = None

            test_func = lambda self, t=text_path, o=opts, c=toc_html_path, m=metadata_path: \
                self._assertMarkdownPath(t, opts=o, toc_html_path=c,
                                         metadata_path=m)

            tags_path = splitext(text_path)[0] + ".tags"
            if exists(tags_path):
                tags = []
                for line in open(tags_path):
                    if '#' in line: # allow comments in .tags files
                        line = line[:line.index('#')]
                    tags += line.split()
                test_func.tags = tags

            name = splitext(basename(text_path))[0]
            name = name.replace(' - ', '_')
            name = name.replace(' ', '_')
            name = re.sub("[(),]", "", name)
            test_name = "test_%s" % name
            setattr(cls, test_name, test_func)
Fit the model using X, y as training data.
dataset/ETHPy150Open an0/Letterpress/code/markdown2/test/test_markdown2.py/_MarkdownTestCase.generate_tests--crossover with--dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/calibration.py/_SigmoidCalibration.fit