-
Notifications
You must be signed in to change notification settings - Fork 33
Example Scripts Folder #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a25a970
to
2e63db2
Compare
examples/cancel_batch.py
Outdated
# Script that takes in an array of batch names (split by comma) and | ||
# applies a bulk action to cancel all tasks in each batch. | ||
# By default, this script makes 50 concurrent API calls. | ||
|
||
# Example: python cancel_batch.py --api_key "SCALE_API_KEY" --batches "batch1,batch2" --clear "True" | ||
|
||
import argparse | ||
from collections import defaultdict | ||
from concurrent.futures import ThreadPoolExecutor, as_completed | ||
import sys | ||
|
||
import scaleapi | ||
from scaleapi.exceptions import ScaleException, ScaleUnauthorized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think our code linter wants your imports at the very top of the file and then your script explanation below
00d84ef
to
3378bb9
Compare
daecff3
to
0a87e9a
Compare
0a87e9a
to
2d66f64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Do you think we should have an Examples section in README to list and link to example scripts? I think we may have more examples going forward and having a list would be helpful.
Yeah, let me update README in this PR too. |
e0ff19c
to
00b515d
Compare
00b515d
to
f599c4b
Compare
Ref:
See https://scaleapi.slack.com/archives/C02150T5FB9/p1652137855727189?thread_ts=1652135470.004439&cid=C02150T5FB9
Related: scaleapi/sail#9