coolblaze03's picture
Upload folder using huggingface_hub
907001b verified
Raw
History Blame Contribute Delete
406 Bytes
def patch(fn, attr_or_replacement, replacement=None):
"""pass"""
if replacement is None:
replacement = attr_or_replacement
return when2(fn, Ellipsis).thenAnswer(replacement)
else:
obj, name = (fn, attr_or_replacement)
theMock = _get_mock(obj, strict=True)
return invocation.StubbedInvocation(theMock, name, strict=False)(Ellipsis).thenAnswer(replacement)