Skip to content

Commit

Permalink
Apply isort
Browse files Browse the repository at this point in the history
  • Loading branch information
kamo-naoyuki committed May 18, 2022
1 parent 3c96908 commit 24c3676
Show file tree
Hide file tree
Showing 608 changed files with 2,047 additions and 3,066 deletions.
1 change: 0 additions & 1 deletion egs/arctic/tts1/local/clean_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from tacotron_cleaner.cleaners import custom_english_cleaners


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("text", type=str, help="text to be cleaned")
Expand Down
5 changes: 3 additions & 2 deletions egs/chime6/asr1/local/extract_noises.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
import argparse
import json
import math
import numpy as np
import os
import scipy.io.wavfile as siw
import sys

import numpy as np
import scipy.io.wavfile as siw


def get_args():
parser = argparse.ArgumentParser(
Expand Down
1 change: 0 additions & 1 deletion egs/chime6/asr1/local/make_noise_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import os
import sys


if len(sys.argv) != 2:
print("Usage: {} <noises-dir>".format(sys.argv[0]))
raise SystemExit(1)
Expand Down
1 change: 0 additions & 1 deletion egs/cmu_indic/tts1/local/clean_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from tacotron_cleaner.cleaners import custom_english_cleaners


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("text", type=str, help="text to be cleaned")
Expand Down
2 changes: 1 addition & 1 deletion egs/covost2/st1/local/process_tsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import argparse
import codecs
import pandas as pd

import pandas as pd

parser = argparse.ArgumentParser(description="extract translation from tsv file")
parser.add_argument("tsv_path", type=str, default=None, help="input tsv path")
Expand Down
3 changes: 1 addition & 2 deletions egs/csj/asr1/local/csj_rm_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

import argparse
import codecs
from io import open
import sys

from io import open

PY2 = sys.version_info[0] == 2
sys.stdin = codecs.getreader("utf-8")(sys.stdin if PY2 else sys.stdin.buffer)
Expand Down
2 changes: 1 addition & 1 deletion egs/iwslt16/mt1/local/extract_recog_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"""
import argparse
import glob
from itertools import takewhile
import json
import os
from itertools import takewhile


def get_args():
Expand Down
6 changes: 2 additions & 4 deletions egs/iwslt16/mt1/local/generate_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
"""
import argparse
import json
from logging import getLogger
import os
from typing import Dict
from typing import List

from logging import getLogger
from typing import Dict, List

logger = getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion egs/iwslt16/mt1/local/generate_vocab.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
format: token + whitespace + index
"""
import argparse
from collections import defaultdict
import fileinput
from collections import defaultdict


def get_args():
Expand Down
2 changes: 1 addition & 1 deletion egs/iwslt18/st1/local/parse_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import argparse
import codecs
from collections import OrderedDict
import os
import re
import xml.etree.ElementTree as etree
from collections import OrderedDict


def main():
Expand Down
1 change: 1 addition & 0 deletions egs/iwslt21/asr1/local/filter_parentheses.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import argparse
import codecs
import re

import regex

parser = argparse.ArgumentParser()
Expand Down
1 change: 0 additions & 1 deletion egs/iwslt21_low_resource/st1/local/data_prep.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import argparse
import os


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Convert data into kaldi format")
parser.add_argument("data_dir", type=str)
Expand Down
3 changes: 1 addition & 2 deletions egs/jnas/asr1/local/filter_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

import argparse
import codecs
from io import open
import sys

from io import open

PY2 = sys.version_info[0] == 2
sys.stdin = codecs.getreader("utf-8")(sys.stdin if PY2 else sys.stdin.buffer)
Expand Down
2 changes: 1 addition & 1 deletion egs/ksponspeech/asr1/local/get_space_normalized_hyps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# Copyright 2020 Electronics and Telecommunications Research Institute (Jeong-Uk, Bang)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)

import configargparse
import logging
import os
import sys

import configargparse
from numpy import zeros

space_sym = "▁"
Expand Down
3 changes: 2 additions & 1 deletion egs/ksponspeech/asr1/local/get_transcriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)

import codecs
import configargparse
import logging
import os
import re
import shutil
import sys

import configargparse


def get_parser():
"""Get default arguments."""
Expand Down
3 changes: 2 additions & 1 deletion egs/libri_css/asr1/local/best_wer_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import io
import itertools
import math
import sys

import numpy as np
from scipy.optimize import linear_sum_assignment
import sys


# Helper function to group the list by ref/hyp ids
Expand Down
2 changes: 1 addition & 1 deletion egs/libri_css/asr1/local/get_perspeaker_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
into per_speaker output (text) file"""

import argparse
from collections import defaultdict
import itertools
import os
from collections import defaultdict


def get_args():
Expand Down
1 change: 1 addition & 0 deletions egs/libri_css/asr1/local/prepare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import argparse
import glob
import os

import soundfile as sf
import tqdm

Expand Down
1 change: 1 addition & 0 deletions egs/libri_css/asr1/local/segmentation/apply_webrtcvad.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import os
import sys
import wave

import webrtcvad


Expand Down
2 changes: 1 addition & 1 deletion egs/ljspeech/tts1/local/clean_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import argparse
import codecs
import nltk

import nltk
from tacotron_cleaner.cleaners import custom_english_cleaners

try:
Expand Down
5 changes: 3 additions & 2 deletions egs/lrs/avsr1/local/se_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/."""

from deepxi.utils import read_wav
import glob
import numpy as np
import os

import numpy as np
from deepxi.utils import read_wav


def Batch(fdir, snr_l=[]):
"""REQUIRES REWRITING. WILL BE MOVED TO deepxi/utils.py
Expand Down
3 changes: 2 additions & 1 deletion egs/mgb2/asr1/local/process_xml.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env python3

import argparse
from bs4 import BeautifulSoup
import sys

from bs4 import BeautifulSoup


def get_args():
parser = argparse.ArgumentParser(description="""This script process xml file.""")
Expand Down
1 change: 1 addition & 0 deletions egs/mgb2/asr1/local/text_segmenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)

import argparse

import pandas as pd


Expand Down
5 changes: 3 additions & 2 deletions egs/polyphone_swiss_french/asr1/local/data_prep.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
from collections import defaultdict
import os
import pathlib
from random import shuffle
import re
import subprocess
import sys
from collections import defaultdict
from random import shuffle


class FrPolyphonePrepper:
Expand Down Expand Up @@ -570,6 +570,7 @@ def _generate_random(self, corpus, splits):

if __name__ == "__main__":
import argparse

import yaml

example = "{0} --config conf/dataprep.yml".format(sys.argv[0])
Expand Down
1 change: 0 additions & 1 deletion egs/puebla_nahuatl/asr1/local/construct_dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os

from argparse import ArgumentParser


Expand Down
2 changes: 0 additions & 2 deletions egs/puebla_nahuatl/asr1/local/data_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import shutil
import string
import sys

from argparse import ArgumentParser
from xml.dom.minidom import parse


s = "".join(chr(c) for c in range(sys.maxunicode + 1))
ws = "".join(re.findall(r"\s", s))
outtab = " " * len(ws)
Expand Down
2 changes: 1 addition & 1 deletion egs/puebla_nahuatl/st1/local/data_prep.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: UTF-8 -*-

from argparse import ArgumentParser
import os
import re
import string
import sys
from argparse import ArgumentParser
from xml.dom.minidom import parse

s = "".join(chr(c) for c in range(sys.maxunicode + 1))
Expand Down
3 changes: 1 addition & 2 deletions egs/reverb/asr1/local/filterjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

import argparse
import codecs
from io import open
import json
import logging
import re
import sys

from io import open

PY2 = sys.version_info[0] == 2
sys.stdin = codecs.getreader("utf-8")(sys.stdin if PY2 else sys.stdin.buffer)
Expand Down
7 changes: 3 additions & 4 deletions egs/reverb/asr1/local/run_wpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
import argparse
import errno
import os
import soundfile as sf

from nara_wpe.utils import istft
from nara_wpe.utils import stft
from nara_wpe.wpe import wpe
import numpy as np
import soundfile as sf
from nara_wpe.utils import istft, stft
from nara_wpe.wpe import wpe

parser = argparse.ArgumentParser()
parser.add_argument("--files", "-f", nargs="+")
Expand Down
2 changes: 1 addition & 1 deletion egs/reverb/asr1_multich/local/filterjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

import argparse
import codecs
from io import open
import json
import logging
import re
import sys
from io import open

PY2 = sys.version_info[0] == 2
sys.stdin = codecs.getreader("utf-8")(sys.stdin if PY2 else sys.stdin.buffer)
Expand Down
1 change: 0 additions & 1 deletion egs/tweb/tts1/local/clean_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from tacotron_cleaner.cleaners import custom_english_cleaners


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("text", type=str, help="text to be cleaned")
Expand Down
1 change: 0 additions & 1 deletion egs/vais1000/tts1/local/clean_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from vietnamese_cleaner.vietnamese_cleaners import vietnamese_cleaner


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("text", type=str, help="text to be cleaned")
Expand Down
11 changes: 4 additions & 7 deletions egs/vcc20/tts1_en_fi/local/clean_text_css10.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
import os

import nltk
from tacotron_cleaner.cleaners import collapse_whitespace
from tacotron_cleaner.cleaners import expand_abbreviations
from tacotron_cleaner.cleaners import expand_numbers
from tacotron_cleaner.cleaners import expand_symbols
from tacotron_cleaner.cleaners import lowercase
from tacotron_cleaner.cleaners import remove_unnecessary_symbols
from tacotron_cleaner.cleaners import uppercase
from tacotron_cleaner.cleaners import (collapse_whitespace,
expand_abbreviations, expand_numbers,
expand_symbols, lowercase,
remove_unnecessary_symbols, uppercase)

try:
# For phoneme conversion, use https://github.com/Kyubyong/g2p.
Expand Down
2 changes: 1 addition & 1 deletion egs/vcc20/vc1_task1/local/clean_text_asr_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import argparse
import codecs
import nltk

import nltk
from tacotron_cleaner.cleaners import custom_english_cleaners

try:
Expand Down
Loading

0 comments on commit 24c3676

Please sign in to comment.