278c7a91b77448236af73d6942da425a5d5a2e34,datasets/preprocess.py,,mozilla,#Any#Any#,44

Before Change


    meta_files = glob.glob(root_path + "/**/batch*.txt", recursive=True)
    folders = [os.path.dirname(f.strip()) for f in meta_files]
    items = []
    for idx, meta_file in enumerate(meta_files):
        folder = folders[idx]
        // txt_file = os.path.join(root_path, meta_file)
        txt_file = meta_file
        with open(txt_file, "r") as ttf:
            for line in ttf:
                cols = line.split("|")
                // wav_file = os.path.join(root_path, folder,
                // "wavs_no_processing", cols[1].strip())
                wav_file = os.path.join(folder, "wavs_no_processing",
                                        cols[1].strip())
                if os.path.isfile(wav_file):
                    text = cols[0].strip()
                    items.append([text, wav_file])
                else:
                    print(" > Error: {}".format(wav_file))
                    continue
    return items


def mailabs(root_path, meta_files):

After Change


    with open(txt_file, "r") as ttf:
        for line in ttf:
            cols = line.split("|")
            batch_no = int(cols[1].strip().split("_")[0])
            wav_folder = "batch{}".format(batch_no)
            wav_file = os.path.join(root_path, wav_folder, "wavs_no_processing", cols[1].strip())
            text = cols[0].strip()
            items.append([text, wav_file])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: mozilla/TTS
Commit Name: 278c7a91b77448236af73d6942da425a5d5a2e34
Time: 2019-04-28
Author: egolge@mozilla.com
File Name: datasets/preprocess.py
Class Name:
Method Name: mozilla


Project Name: databricks/spark-deep-learning
Commit Name: aeff9c9e2c24ed09c093414a7b51ec9bd42f1e86
Time: 2017-12-19
Author: 33237569+tomasatdatabricks@users.noreply.github.com
File Name: python/tests/transformers/named_image_test.py
Class Name: NamedImageTransformerBaseTestCase
Method Name: setUpClass


Project Name: tyarkoni/pliers
Commit Name: 4d8446e7469a7950fcab5ef7f2ce5cf2573674ca
Time: 2020-04-02
Author: rbrrcc@gmail.com
File Name: pliers/tests/extractors/test_extractors.py
Class Name:
Method Name: test_merge_extractor_results