code stringlengths 3 6.57k |
|---|
json.load(f) |
__getitem__(self, idx) |
super(VQAv2QuestionAnswering, self) |
__getitem__(idx) |
self.coco.loadImgs(image_id) |
self.prepare(img, target) |
self._transforms(img, target) |
torch.as_tensor(self.answer2id[answer], dtype=torch.long) |
torch.as_tensor(self.type2id[coco_img["answer_type"]], dtype=torch.long) |
build(image_set, args) |
Path(args.coco_img_path) |
img_dir.exists() |
RobertaTokenizerFast.from_pretrained(args.text_encoder_type) |
Path(args.vqa2_ann_path) |
make_coco_transforms(image_set, cautious=True) |
Path(args.vqa2_ann_path) |
torch.utils.data.ConcatDataset(datasets) |
Path(args.vqa2_ann_path) |
make_coco_transforms(image_set, cautious=True) |
Path(args.vqa2_ann_path) |
Path(args.vqa2_ann_path) |
make_coco_transforms("val", cautious=True) |
Path(args.vqa2_ann_path) |
test_require_admin(commander, hook) |
commander.executest(hook, command, 'goodlikebot') |
hook.assert_silent_failure() |
test_lock_unlock(commander, hook) |
commander.executest(hook, '!lock') |
hook.assert_success('Bot is now in ADMIN only mode') |
commander.executest(hook, '!time', 'goodlikebot') |
hook.assert_silent_failure() |
commander.executest(hook, '!lock') |
hook.assert_success('Bot no longer in ADMIN only mode') |
commander.executest(hook, '!time', 'goodlikebot') |
hook.assert_success() |
test_index(tl, hook) |
HTTMock(customsforge) |
Index(tl=tl) |
executest(hook) |
hook.assert_success('CDLCs indexed') |
tl.set_use_elastic(False) |
HTTMock(customsforge) |
Index(tl=tl) |
executest(hook) |
hook.assert_failure('CDLCs could not be indexed') |
test_rank(users, hook) |
Rank(us=users) |
executest(hook, args='') |
hook.assert_failure('Try !rank RANK NICK') |
Rank(us=users) |
executest(hook, args='just_rank') |
hook.assert_failure('Try !rank RANK NICK') |
Rank(us=users) |
executest(hook, args='BAD_RANK goodlikebot') |
hook.assert_failure('BAD_RANK is not a valid rank') |
Rank(us=users) |
executest(hook, args='BAN goodlikebot') |
users._manual('goodlikebot') |
hook.assert_success('goodlikebot is now BAN') |
assert_that(users.rank('goodlikebot') |
is_equal_to(UserRank.BAN) |
users.set_use_elastic(False) |
Rank(us=users) |
executest(hook, args='ADMIN goodlikebot') |
hook.assert_failure('Rank could not be set') |
test_rank_shorthand(commander, hook) |
commander.executest(hook, '!ban goodlikebot') |
commander._users._manual('goodlikebot') |
hook.assert_success('goodlikebot is now BAN') |
assert_that(commander._users.rank('goodlikebot') |
is_equal_to(UserRank.BAN) |
GogameMiddle(EntityMiddleware) |
__init__(self, entity, endpoint, objtype) |
super(GogameMiddle, self) |
__init__(entity, endpoint) |
GogameDatabase(Database) |
__init__(self, **kwargs) |
super(GogameDatabase, self) |
__init__(**kwargs) |
kwargs.get('database_id') |
kwargs.get('source') |
kwargs.get('rosource') |
kwargs.get('subtype') |
kwargs.get('ro_user') |
kwargs.get('ro_passwd') |
GogameAppFile(AppUpgradeFile) |
super(GogameAppFile, self) |
__init__(source, revertable, rollback) |
post_check(self) |
gfile.check(self.objtype, self.file) |
clean(self) |
os.remove(self.file) |
prepare(self, middleware=None, timeout=None) |
len(self.stream) |
ValueError("Strem over size") |
os.path.join('/tmp', '%s.zip' % self.source) |
base64.b64decode(self.stream) |
digestutils.strmd5(data) |
ValueError('Md5 not match') |
open(file_path, 'wb') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.