code
stringlengths
3
6.57k
set_test_params(self)
run_test(self)
self.log.info("Sleeping 30 seconds...")
time.sleep(30)
self.log.info("Compare responses from gewalletinfo RPC and `ysw-cli getwalletinfo`")
cli.getwalletinfo()
getwalletinfo()
assert_equal(cli_response, rpc_response)
self.log.info("Compare responses from getblockchaininfo RPC and `ysw-cli getblockchaininfo`")
cli.getblockchaininfo()
getblockchaininfo()
assert_equal(cli_response, rpc_response)
get_auth_cookie(self.nodes[0].datadir)
self.log.info("Compare responses from `ysw-cli -getinfo` and the RPCs data is retrieved from.")
cli('getinfo')
send_cli()
getwalletinfo()
getnetworkinfo()
getblockchaininfo()
assert_equal(cli_get_info['version'], network_info['version'])
assert_equal(cli_get_info['protocolversion'], network_info['protocolversion'])
assert_equal(cli_get_info['walletversion'], wallet_info['walletversion'])
assert_equal(cli_get_info['balance'], wallet_info['balance'])
assert_equal(cli_get_info['blocks'], blockchain_info['blocks'])
assert_equal(cli_get_info['timeoffset'], network_info['timeoffset'])
assert_equal(cli_get_info['connections'], network_info['connections'])
assert_equal(cli_get_info['proxy'], network_info['networks'][0]['proxy'])
assert_equal(cli_get_info['difficulty'], blockchain_info['difficulty'])
assert_equal(cli_get_info['testnet'], blockchain_info['chain'] == "test")
assert_equal(cli_get_info['balance'], wallet_info['balance'])
assert_equal(cli_get_info['keypoololdest'], wallet_info['keypoololdest'])
assert_equal(cli_get_info['keypoolsize'], wallet_info['keypoolsize'])
assert_equal(cli_get_info['paytxfee'], wallet_info['paytxfee'])
assert_equal(cli_get_info['relayfee'], network_info['relayfee'])
TestBitcoinCli()
main()
get_meta_version(max_version)
int(max_version)
registry.add_to_head(META_TAG % {'meta_version': get_meta_version(settings.GOOGLE_CHROME_FRAME_MAX_VERSION)
window.attachEvent("onload",function()
CFInstall.check({mode:"overlay"})
getattr(settings, 'GOOGLE_CHROME_FRAME_PROMPT', False)
registry.add_to_tail(PROMPT_SCRIPT % {'max_version': settings.GOOGLE_CHROME_FRAME_MAX_VERSION})
Test(unittest.TestCase)
setUp(self)
app.test_client()
self.app.get('/')
test_requisicao(self)
requisicao (precisa ser igual a 200)
self.assertEqual(self.result.status_code, 200)
test_conteudo(self)
self.assertEqual(self.result.data.decode('utf-8')
print ('INICIANDO OS TESTES')
print('----------------------------------------------------------------------')
unittest.main(verbosity=2)
calc_iou(a, b)
torch.min(torch.unsqueeze(a[:, 2], dim=1)
torch.max(torch.unsqueeze(a[:, 0], 1)
torch.min(torch.unsqueeze(a[:, 3], dim=1)
torch.max(torch.unsqueeze(a[:, 1], 1)
torch.clamp(iw, min=0)
torch.clamp(ih, min=0)
torch.unsqueeze((a[:, 2] - a[:, 0])
torch.clamp(ua, min=1e-8)
cal_ioa(a, b)
Area (for ignore regions)
torch.unsqueeze((a[:, 2] - a[:, 0])
torch.clamp(area, min=1e-8)
torch.min(torch.unsqueeze(a[:, 2], dim=1)
torch.max(torch.unsqueeze(a[:, 0], 1)
torch.min(torch.unsqueeze(a[:, 3], dim=1)
torch.max(torch.unsqueeze(a[:, 1], 1)
torch.clamp(iw, min=0)
torch.clamp(ih, min=0)
FocalLoss(nn.Module)
__init__(self)
forward(self, classifications, regressions, anchors, annotations, dataset, ignore_index=None, merge_index=None)
range(classifications.shape[-1]+1)
torch.cat((classifications,torch.zeros((classifications.shape[0],classifications.shape[1],1)
cuda()
print(classifications.shape)
range(batch_size)
print(torch.max(classification[:,VEHICLE_INDEXES], dim=1)
torch.max(classification[:,VEHICLE_INDEXES], dim=1)
torch.clamp(classification, 1e-4, 1.0 - 1e-4)
torch.cuda.is_available()
torch.ones(classification.shape)
cuda()
torch.pow(focal_weight, gamma)
torch.log(1.0 - classification)
classification_losses.append(cls_loss.sum()
regression_losses.append(torch.tensor(0)
float()
cuda()
torch.ones(classification.shape)
torch.pow(focal_weight, gamma)
torch.log(1.0 - classification)
classification_losses.append(cls_loss.sum()
regression_losses.append(torch.tensor(0)
float()