code
stringlengths
3
6.57k
fake_remove.expects_call()
test()
Traceback (most recent call last)
os.remove()
fudge.clear_expectations()
test(fake_remove, fake_rmtree)
fake_remove.is_callable()
test()
setUp()
__init__(self, *obj_paths)
__call__(self, fn)
wraps(fn)
caller(*args, **kw)
self.__enter__()
isinstance(fakes, (tuple, list)
tuple(fakes)
fn(*args, **kw)
sys.exc_info()
self.__exit__(etype, val, tb)
self.__exit__(None, None, None)
__enter__(self)
fudge.clear_expectations()
fudge.clear_calls()
path.rsplit('.', 1)
except (TypeError, ValueError)
fudge.Fake(path)
all_fakes.append(fake)
self.patches.append(patch_object(target, attr, fake)
len(all_fakes)
__exit__(self, exc_type, exc_val, exc_tb)
fudge.verify()
p.restore()
fudge.clear_expectations()
with_patched_object(obj, attr_name, patched_value)
with_patched_object(Session, "state", "dirty")
test()
test()
patcher(method)
wraps(method)
method_call(*m_args, **m_kw)
patch_object(obj, attr_name, patched_value)
method(*m_args, **m_kw)
patched_obj.restore()
patched_context(object)
patched_context(Session, "state", "dirty")
__init__(self, obj, attr_name, patched_value)
patch_object(obj, attr_name, patched_value)
__enter__(self)
__exit__(self, exc_type, exc_val, exc_tb)
self.patched_object.restore()
patch_object(obj, attr_name, patched_value)
patch_object(Session, "state", "dirty")
patched_session.restore()
patch_object(config, "session_strategy", "filesystem")
patch_object(Session, "state", "dirty")
p.restore()
isinstance(obj, (str, unicode)
__import__(adjusted_path)
adjusted_path.rsplit('.', 1)
sys.exc_info()
adjusted_path.count('.')
obj_path.split('.')
getattr(obj, part)
PatchHandler(obj, attr_name)
handle.patch(patched_value)
NonExistant(object)
PatchHandler(object)
__init__(self, orig_object, attr_name)
patch(self, patched_value)
setattr(self.getter_class, self.attr_name, patched_value)
setattr(self.orig_object, self.attr_name, patched_value)
type(proxy_name, (self.orig_object,)
setattr(mod, self.orig_object.__name__, self.proxy_object)
restore(self)
setattr(self.getter_class, self.attr_name, self.getter)
setattr(self.orig_object, self.attr_name, self.orig_value)
delattr(self.orig_object, self.attr_name)
_find_class_for_attr(self, cls, attr)
self._find_class_for_attr(base, attr)
_get_original(self, orig_object, name)
except (AttributeError, KeyError)
getattr(orig_object, name, NonExistant)
_get_exact_original(self, orig_object, name)
hasattr(orig_object, '__dict__')
hasattr(orig_object, '__class__')
self._find_class_for_attr(cls, name)
_handle_getter(self, orig_object, name)
self._get_exact_original(orig_object, name)
except (AttributeError, KeyError)
hasattr(ob, '__get__')
Copyright (c)
VQAv2Detection(ModulatedDetection)
VQAv2QuestionAnswering(torchvision.datasets.CocoDetection)
__init__(self, img_folder, ann_file, transforms, return_masks, return_tokens, tokenizer, ann_folder)
super(VQAv2QuestionAnswering, self)
__init__(img_folder, ann_file)
ConvertCocoPolysToMask(return_masks, return_tokens, tokenizer=tokenizer)
open(ann_folder / "vqa2_answer2id.json", "r")
json.load(f)
open(ann_folder / "vqa2_answer2id_by_type.json", "r")