From 8a63c3b503cb20b809050fb2a8398ecc856ca5b5 Mon Sep 17 00:00:00 2001 From: M1Al3x Date: Mon, 6 Nov 2023 16:18:34 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=F0=9F=A7=B9=20reformat=20Python=20?= =?UTF-8?q?files=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/helpers.py | 18 ++++++++++++++++-- src/views.py | 5 ++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/helpers.py b/src/helpers.py index 5103e34..f484f95 100644 --- a/src/helpers.py +++ b/src/helpers.py @@ -389,7 +389,13 @@ def get_recordings_from_paradigm(paradigm, request): if request.COOKIES.get("synthesized_audio_in_paradigm") == "yes": speech_db_eq.insert(0, "synth") - query_terms = [query_terms[0], query_terms[1], query_terms[2], query_terms[3],query_terms[4] ] + query_terms = [ + query_terms[0], + query_terms[1], + query_terms[2], + query_terms[3], + query_terms[4], + ] for search_terms in divide_chunks(query_terms, 30): for source in speech_db_eq: temp.append(None) @@ -397,7 +403,15 @@ def get_recordings_from_paradigm(paradigm, request): for search_terms in divide_chunks(query_terms, 30): for source in speech_db_eq: url = f"https://speech-db.altlab.app/{source}/api/bulk_search" - x = threading.Thread(target=get_recordings_from_url, args=(search_terms, url, temp, index,)) + x = threading.Thread( + target=get_recordings_from_url, + args=( + search_terms, + url, + temp, + index, + ), + ) threads.append(x) x.start() index += 1 diff --git a/src/views.py b/src/views.py index bf84f97..0fb1f6d 100644 --- a/src/views.py +++ b/src/views.py @@ -130,7 +130,7 @@ def word_details_api(request, slug: str): if matched_recs: recordings.extend(matched_recs) print("here we go") - if paradigm is not None: + if paradigm is not None: FST_DIR = settings.BASE_DIR / "res" / "fst" paradigm_manager = ParadigmManager( layout_directory=settings.LAYOUTS_DIR, @@ -152,7 +152,6 @@ def word_details_api(request, slug: str): } } - return Response(content) @@ -248,7 +247,6 @@ def search_api(request): return Response(context) - def make_wordnet_format(wn_class): """ Accepts: wn_class of format (n) bear 1 @@ -298,6 +296,7 @@ def wordnet_api(request, classification): return Response(context) + def relabelInflectionalCategory(ic): with open(Path(settings.RESOURCES_DIR / "altlabel.tsv")) as f: labels = Relabelling.from_tsv(f)