This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import turtle | |
| #get the instance of turtle | |
| t=turtle.Turtle() | |
| #select color | |
| t.color('#4285F4','#4285F4') ## RBG value of color | |
| #change the pen size | |
| t.pensize(5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #![cfg_attr(not(feature = "std"), no_std)] | |
| pub use pallet::*; | |
| #[frame_support::pallet] | |
| pub mod pallet { | |
| use frame_support::pallet_prelude::*; | |
| use frame_system::pallet_prelude::*; | |
| use frame_support::{ | |
| sp_runtime::traits::Hash, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <!--Adding Meta Data For Browser--> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <link rel="stylesheet" href="main.css"> | |
| <title>Mood Dairy</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def main(): | |
| data_root = args.data_root | |
| os.makedirs(data_root, exist_ok=True) | |
| target_unpacked_dir = os.path.join(data_root, "CV_unpacked") | |
| if os.path.exists(target_unpacked_dir): | |
| logging.info('Find existing folder {}'.format(target_unpacked_dir)) | |
| else: | |
| logging.info("Could not find Common Voice, Downloading corpus...") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create_manifest( | |
| data: List[tuple], | |
| output_name: str, | |
| manifest_path: str): | |
| output_file = Path(manifest_path) / output_name | |
| output_file.parent.mkdir(exist_ok=True, parents=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def process_files(csv_file, data_root, num_workers): | |
| """ Read *.csv file description, convert mp3 to wav, process text. | |
| Save results to data_root. | |
| Args: | |
| csv_file: str, path to *.csv file with data description, usually start from 'cv-' | |
| data_root: str, path to dir to save results; wav/ dir will be created | |
| """ | |
| wav_dir = os.path.join(data_root, 'wav/') | |
| os.makedirs(wav_dir, exist_ok=True) | |
| audio_clips_path = os.path.dirname(csv_file) + '/clips/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://mozilla-common-voice-datasets.s3.dualstack.us-west-2.amazonaws.com/cv-corpus-7.0-2021-07-21/cv-corpus-7.0-2021-07-21-en.tar.gz | |
| COMMON_VOICE_URL = f"https://voice-prod-bundler-ee1969a6ce8178826482b88e843c335139bd3fb4.s3.amazonaws.com/" \ | |
| "{}/{}-{}.tar.gz".format(args.version, args.version, args.language) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://mozilla-common-voice-datasets.s3.dualstack.us-west-2.amazonaws.com/cv-corpus-7.0-2021-07-21/cv-corpus-7.0-2021-07-21-en.tar.gz | |
| COMMON_VOICE_URL = f"https://voice-prod-bundler-ee1969a6ce8178826482b88e843c335139bd3fb4.s3.amazonaws.com/" \ | |
| "{}/{}-{}.tar.gz".format(args.version, args.version, args.language) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| parser = argparse.ArgumentParser(description='Downloads and processes Mozilla Common Voice dataset.') | |
| parser.add_argument("--data_root", default='./', type=str, help="Directory to store the dataset.") | |
| parser.add_argument('--manifest_dir', default='manifest_dir/', type=str, help='Output directory for manifests') | |
| parser.add_argument("--num_workers", default=multiprocessing.cpu_count(), type=int, help="Workers to process dataset.") | |
| parser.add_argument('--sample_rate', default=16000, type=int, help='Sample rate') | |
| parser.add_argument('--files_to_process', nargs='+', default=['test.tsv', 'dev.tsv', 'train.tsv'], | |
| type=str, help='list of *.csv file names to process') | |
| parser.add_argument('--version', default='cv-corpus-7.0-2021-07-21', | |
| type=str, help='Version of the dataset (obtainable via https://commonvoice.mozilla.org/en/datasets') | |
| parser.add_argument('--language', default='hi', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import csv | |
| import json | |
| import logging | |
| import multiprocessing | |
| import os | |
| import tarfile | |
| from multiprocessing.pool import ThreadPool | |
| from pathlib import Path | |
| from typing import List |