Skip to content

Commit

Permalink
🤖🧹 reformat Python files [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
M1Al3x authored and actions-user committed Nov 1, 2023
1 parent 211c6c7 commit 7127631
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/API/search/presentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,7 @@ def serialize_wordform(
return result


def serialize_definitions(
definitions, include_auto_definitions=True, dict_source=None
):
def serialize_definitions(definitions, include_auto_definitions=True, dict_source=None):
ret = []
for definition in definitions:
serialized = definition.serialize()
Expand Down
18 changes: 16 additions & 2 deletions src/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,29 @@ 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)
index = 0
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
Expand Down
6 changes: 2 additions & 4 deletions src/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -152,7 +152,6 @@ def word_details_api(request, slug: str):
}
}


return Response(content)


Expand Down Expand Up @@ -192,7 +191,6 @@ def search_api(request):
:param request:
:return:
"""


query_string = request.GET.get("name")
rw_index = request.GET.get("rw_index")
Expand Down Expand Up @@ -249,7 +247,6 @@ def search_api(request):
return Response(context)



def make_wordnet_format(wn_class):
"""
Accepts: wn_class of format (n) bear 1
Expand Down Expand Up @@ -299,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)
Expand Down

0 comments on commit 7127631

Please sign in to comment.