code
stringlengths
3
6.57k
torch.tensor([[0, 1]], device=device, dtype=torch.long)
res.keys()
expected.keys()
assert_allclose(res['mix_pairs'], expected['mix_pairs'], rtol=1e-4, atol=1e-4)
assert_allclose(res['crop_src'], expected['crop_src'], rtol=1e-4, atol=1e-4)
test_same_on_batch(self, device, dtype)
torch.manual_seed(42)
torch.tensor(1., device=device, dtype=dtype)
torch.tensor([0., 1.], device=device, dtype=dtype)
torch.tensor([[1, 0]], device=device, dtype=torch.long)
res.keys()
expected.keys()
assert_allclose(res['mix_pairs'], expected['mix_pairs'], rtol=1e-4, atol=1e-4)
assert_allclose(res['crop_src'], expected['crop_src'], rtol=1e-4, atol=1e-4)
ParallelCommand(Command)
__init__(self, delay=None, description=None, when=None, commands=None)
super(ParallelCommand, self)
__init__(object_type=self.__discriminator_value, delay=delay, description=description, when=when)
to_dict(self)
six.iteritems(self.deserialized_types)
getattr(self, attr)
isinstance(value, list)
x.to_dict()
hasattr(x, "to_dict")
isinstance(x, Enum)
isinstance(value, Enum)
hasattr(value, "to_dict")
value.to_dict()
isinstance(value, dict)
to_dict()
hasattr(item[1], "to_dict")
else (item[0], item[1].value)
isinstance(item[1], Enum)
value.items()
to_str(self)
pprint.pformat(self.to_dict()
__repr__(self)
self.to_str()
__eq__(self, other)
isinstance(other, ParallelCommand)
__ne__(self, other)
Copyright (c)
version (only a ping)
connected (timeout to receive version/verack is 60 seconds)
TestP2PConn(P2PInterface)
on_version(self, message)
TimeoutsTest(TestCoinSuperTestFramework)
set_test_params(self)
run_test(self)
add_p2p_connection(TestP2PConn()
add_p2p_connection(TestP2PConn()
add_p2p_connection(TestP2PConn()
sleep(1)
no_verack_node.send_message(msg_ping()
no_version_node.send_message(msg_ping()
sleep(30)
no_verack_node.send_message(msg_ping()
no_version_node.send_message(msg_ping()
sleep(31)
TimeoutsTest()
main()
version_string()
else ("-" + MRPYTHON_VERSION_TAG)
set_optimizer(model, cfg)
optim.SGD(model.parameters()
optim.Adam(model.parameters()
Copyright (c)
UserInfo(BaseModel)
SecretAddress(BaseModel)
TypeVar("T")
SecretData(Generic[T])
__init__(self, secret: Union[T, SecretAddress])
isinstance(secret, dict)
SecretAddress.parse_obj(secret)
__str__(self)
self.__repr__()
__repr__(self)
isinstance(self.secret, SecretAddress)
str(self.secret)
EnumModel(BaseModel)
root_validator(pre=True)
exactly_one(cls: Any, values: Any)
values.items()
some.append(field)
ValueError("no variant set for enum")
len(some)
ValueError("multiple values set for enum: %s" % some)
Error(BaseModel)
TypeVar("OkType")
FileEntry(BaseModel)
Authentication(BaseModel)
JobConfig(BaseModel)
validator("duration", allow_reuse=True)
check_duration(cls, value: int)
ValueError("invalid duration")
ReproConfig(BaseModel)
validator("duration", allow_reuse=True)
check_duration(cls, value: int)
ValueError("invalid duration")
TaskDetails(BaseModel)