Skip to content

Commit f8df2bc

Browse files
Updates after review
1 parent 5b780b8 commit f8df2bc

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/judge0/api.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def resolve_client(
2929
return client
3030

3131
if isinstance(client, Flavor):
32-
return get_client(flavor=client)
32+
return get_client(client)
3333

3434
if client is None and isinstance(submissions, list) and len(submissions) == 0:
3535
raise ValueError("Client cannot be determined from empty submissions.")
@@ -66,10 +66,11 @@ def create_submissions(
6666
return client.create_submission(submissions)
6767

6868
# TODO: Use result from get_config.
69-
batch_size = client.EFFECTIVE_SUBMISSION_BATCH_SIZE
7069
result_submissions = []
71-
for submission_batch in batched(submissions, batch_size):
72-
if batch_size > 1:
70+
for submission_batch in batched(
71+
submissions, client.EFFECTIVE_SUBMISSION_BATCH_SIZE
72+
):
73+
if len(submission_batch) > 1:
7374
result_submissions.extend(client.create_submissions(submission_batch))
7475
else:
7576
result_submissions.append(client.create_submission(submission_batch[0]))
@@ -89,11 +90,11 @@ def get_submissions(
8990
return client.get_submission(submissions, fields=fields)
9091

9192
# TODO: Use result from get_config.
92-
batch_size = client.EFFECTIVE_SUBMISSION_BATCH_SIZE
9393
result_submissions = []
94-
for submission_batch in batched(submissions, batch_size):
95-
96-
if batch_size > 1:
94+
for submission_batch in batched(
95+
submissions, client.EFFECTIVE_SUBMISSION_BATCH_SIZE
96+
):
97+
if len(submission_batch) > 1:
9798
result_submissions.extend(
9899
client.get_submissions(submission_batch, fields=fields)
99100
)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy