Search is not available for this dataset
id int64 0 10.8M | vector listlengths 1.54k 1.54k | ast_depth int64 3 164 | ast_data stringlengths 297 510k | full_path stringlengths 0 319 | code stringlengths 60 56.5k |
|---|---|---|---|---|---|
19,501 | [
-0.02702213078737259,
-0.00043580622877925634,
0.0010403577471151948,
-0.033588897436857224,
-0.0024482370354235172,
0.009466897696256638,
0.02702213078737259,
0.026701800525188446,
-0.037226930260658264,
0.058025505393743515,
0.021073143929243088,
-0.0012212584260851145,
0.01459789928048849... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def update_subnet(self, context, id, subnet):
subn = copy.deepcopy(subnet['subnet'])
subnet_l2dom = nuagedb.get_subnet_l2dom_by_id(context.session,
id)
params = {
'parent_id': subnet_l2dom['nuage_subnet_id'],
'type': s... | |
19,502 | [
-0.02752346359193325,
0.023287378251552582,
0.014138765633106232,
-0.022411329671740532,
-0.02787831984460354,
0.004036479163914919,
0.005871746223419905,
0.05775269865989685,
0.005552931223064661,
0.03712673485279083,
0.03998775780200958,
-0.004444008227437735,
0.031582120805978775,
0.028... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def delete_subnet(self, context, id):
subnet = self.get_subnet(context, id)
if self._network_is_external(context, subnet['network_id']):
super(NuagePlugin, self).delete_subnet(context, id)
return self._delete_nuage_sharedresource(id)
subnet_l2dom = nuagedb.get_subnet_l2d... | |
19,503 | [
-0.054220959544181824,
-0.011485166847705841,
0.005483824294060469,
-0.03758554905653,
-0.0064409212209284306,
-0.006690328009426594,
0.01840619556605816,
0.02980406954884529,
0.014478043653070927,
0.057712651789188385,
0.004863425623625517,
0.012738433666527271,
0.006646681576967239,
-0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def add_router_interface(self, context, router_id, interface_info):
session = context.session
with session.begin(subtransactions=True):
rtr_if_info = super(NuagePlugin,
self).add_router_interface(context,
... | |
19,504 | [
-0.032754600048065186,
0.007937857881188393,
-0.010451610200107098,
-0.0639694556593895,
-0.007377950474619865,
0.0004931999719701707,
0.005269547924399376,
0.05771715193986893,
0.010690737515687943,
0.0662090852856636,
0.018815232440829277,
-0.01951511576771736,
0.009716731496155262,
0.02... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def remove_router_interface(self, context, router_id, interface_info):
if 'subnet_id' in interface_info:
subnet_id = interface_info['subnet_id']
subnet = self.get_subnet(context, subnet_id)
found = False
try:
filters = {'device_id': [router_id],
... | |
19,505 | [
-0.02363419160246849,
0.002680989680811763,
0.0316617451608181,
0.006850327830761671,
0.027760084718465805,
-0.0588836669921875,
0.020999450236558914,
0.07390730082988739,
0.022983914241194725,
0.03906144201755524,
-0.014283661730587482,
0.03302956745028496,
0.03002484142780304,
-0.0030383... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def _get_net_partition_for_router(self, context, rtr):
ent = rtr.get('net_partition', None)
if not ent:
def_net_part = cfg.CONF.RESTPROXY.default_net_partition_name
net_partition = nuagedb.get_net_partition_by_name(context.session,
... | |
19,506 | [
-0.03300505131483078,
-0.010724362917244434,
0.01244527567178011,
-0.03195654973387718,
-0.00923138577491045,
-0.004350717645138502,
0.01823483593761921,
-0.006923539098352194,
0.00012589871766977012,
0.07562898099422455,
-0.0185653418302536,
-0.06031171977519989,
0.014622058719396591,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "old_routes", "annotation": null, "type_comment": null}}, {"_type"... | def _validate_nuage_staticroutes(self, old_routes, added, removed):
cidrs = []
for old in old_routes:
if old not in removed:
ip = netaddr.IPNetwork(old['destination'])
cidrs.append(ip)
for route in added:
ip = netaddr.IPNetwork(route['desti... | |
19,507 | [
-0.044141657650470734,
-0.0053704045712947845,
0.020119069144129753,
-0.04151476174592972,
-0.0034953660797327757,
-0.04718590900301933,
0.011563248001039028,
0.056416865438222885,
-0.0039342050440609455,
0.047333210706710815,
0.0014300619950518012,
0.0012750874739140272,
0.03316761925816536... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def create_router(self, context, router):
net_partition = self._get_net_partition_for_router(context, router)
neutron_router = super(NuagePlugin, self).create_router(context,
router)
params = {
'net_partition': net_parti... | |
19,508 | [
-0.04121701419353485,
0.004710252862423658,
-0.0058578974567353725,
-0.042984507977962494,
-0.00016157931531779468,
-0.005109166726469994,
0.024229418486356735,
0.04362276941537857,
-0.0026220919098705053,
0.07634598761796951,
0.014360900968313217,
-0.028108088299632072,
-0.01293708477169275... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def update_router(self, context, id, router):
r = router['router']
with context.session.begin(subtransactions=True):
if 'routes' in r:
old_routes = self._get_extra_routes_by_router_id(context,
id)
... | |
19,509 | [
-0.010078748688101768,
0.011505775153636932,
0.004087028093636036,
-0.05130130797624588,
-0.011475920677185059,
-0.01406725775450468,
-0.013649300672113895,
0.07848048955202103,
0.0006776883965358138,
0.0472889170050621,
0.038595397025346756,
-0.02701200172305107,
-0.00180915929377079,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def delete_router(self, context, id):
neutron_router = self.get_router(context, id)
session = context.session
ent_rtr_mapping = nuagedb.get_ent_rtr_mapping_by_rtrid(session,
id)
if ent_rtr_mapping:
filters = {
... | |
19,510 | [
-0.005526411347091198,
-0.006470968946814537,
0.04658617824316025,
-0.028258763253688812,
-0.0006338281091302633,
-0.058532584458589554,
-0.019083062186837196,
0.04744977504014969,
0.00983539316803217,
-0.0027617064770311117,
0.03672679513692856,
0.036414943635463715,
0.0028741536661982536,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "session", "annotation": null, "type_comment": null}}, {"_type": "... | def _create_net_partition(self, session, net_part_name):
fip_quota = cfg.CONF.RESTPROXY.default_floatingip_quota
params = {
"name": net_part_name,
"fp_quota": str(fip_quota)
}
nuage_net_partition = self.nuageclient.create_net_partition(params)
net_partitio... | |
19,511 | [
-0.03682556003332138,
-0.015738626942038536,
0.06611165404319763,
0.010896878316998482,
0.024880224838852882,
-0.036872681230306625,
-0.007162488531321287,
0.035223424434661865,
0.00690920976921916,
0.02046257071197033,
0.024149838835000992,
0.031712859869003296,
0.04167908802628517,
-0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "default_net_part", "annotation": null, "type_comment": null}}], "... | def _create_default_net_partition(self, default_net_part):
def_netpart = self.nuageclient.get_def_netpartition_data(
default_net_part)
session = db.get_session()
if def_netpart:
net_partition = nuagedb.get_net_partition_by_name(
session, default_net_part)
... | |
19,512 | [
-0.0061424048617482185,
0.0014702400658279657,
0.04778587818145752,
-0.009602697566151619,
-0.00563489506021142,
-0.010586959309875965,
0.018294954672455788,
0.07337667047977448,
0.0045768143609166145,
0.020780213177204132,
0.0525103323161602,
0.007381958421319723,
0.021875204518437386,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def delete_net_partition(self, context, id):
ent_rtr_mapping = nuagedb.get_ent_rtr_mapping_by_entid(context.session,
id)
if ent_rtr_mapping:
msg = (_("One or more router still attached to "
"net_partition %s.... | |
19,513 | [
-0.0315934419631958,
0.021508121863007545,
0.02911127172410488,
-0.0011228504590690136,
-0.012724132277071476,
-0.010073271580040455,
-0.001368356286548078,
-0.010254012420773506,
-0.0026538732927292585,
0.07354933768510818,
0.03166573867201805,
0.016326893121004105,
-0.05388477444648743,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def _check_floatingip_update(self, context, port):
filter = {'fixed_port_id': [port['id']]}
local_fip = self.get_floatingips(context,
filters=filter)
if local_fip:
fip = local_fip[0]
self._create_update_floatingip(context,
... | |
19,514 | [
-0.02767912670969963,
0.022434158250689507,
0.05502448230981827,
-0.04017168655991554,
0.013672677800059319,
-0.056121159344911575,
-0.009774712845683098,
0.014960079453885555,
0.00946478359401226,
0.04703782871365547,
0.012742888182401657,
0.02334010787308216,
-0.024913597851991653,
-0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def _create_update_floatingip(self, context,
neutron_fip, port_id):
rtr_id = neutron_fip['router_id']
net_id = neutron_fip['floating_network_id']
subn = nuagedb.get_ipalloc_for_fip(context.session,
net_id,
... | |
19,515 | [
-0.030270546674728394,
0.002022385597229004,
0.03859731927514076,
-0.03821774944663048,
0.007502398453652859,
-0.04905916005373001,
-0.012134313583374023,
0.03145669773221016,
0.014554059132933617,
0.051526352763175964,
0.03276146203279495,
0.009506992064416409,
-0.03779073804616928,
-0.05... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def create_floatingip(self, context, floatingip):
fip = floatingip['floatingip']
with context.session.begin(subtransactions=True):
neutron_fip = super(NuagePlugin, self).create_floatingip(
context, floatingip)
if not neutron_fip['router_id']:
retur... | |
19,516 | [
-0.0337204709649086,
0.0035962783731520176,
0.04087626561522484,
-0.03533787652850151,
-0.010948125272989273,
-0.018061036244034767,
-0.007217062637209892,
0.03283824771642685,
0.002580804517492652,
0.06954847276210785,
0.028892757371068,
-0.006739192642271519,
-0.05376650393009186,
-0.027... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def update_floatingip(self, context, id, floatingip):
fip = floatingip['floatingip']
orig_fip = self._get_floatingip(context, id)
port_id = orig_fip['fixed_port_id']
router_ids = []
with context.session.begin(subtransactions=True):
neutron_fip = super(NuagePlugin, sel... | |
19,517 | [
-0.031435295939445496,
-9.61670821197913e-7,
0.01603737287223339,
-0.02644759602844715,
-0.01793014071881771,
0.016446620225906372,
-0.03655088692903519,
-0.007494338322430849,
-0.009150510653853416,
0.04765171557664871,
0.002343579428270459,
-0.013415632769465446,
0.0036576464772224426,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def disassociate_floatingips(self, context, port_id, do_notify=True):
router_ids = super(NuagePlugin, self).disassociate_floatingips(
context, port_id, do_notify=do_notify)
params = {
'neutron_port_id': port_id,
}
nuage_port = self.nuageclient.get_nuage_port_by_i... | |
19,518 | [
-0.0243950504809618,
0.038496363908052444,
0.034733060747385025,
-0.021738601848483086,
-0.021650053560733795,
0.01692378893494606,
-0.046089377254247665,
0.038452088832855225,
-0.01049850508570671,
0.007565343286842108,
0.03825285658240318,
-0.04670921713113785,
0.018240945413708687,
0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def delete_security_group(self, context, id):
filters = {'security_group_id': [id]}
ports = self._get_port_security_group_bindings(context,
filters)
if ports:
raise ext_sg.SecurityGroupInUse(id=id)
sg_rules = self.get_sec... | |
19,519 | [
-0.019912630319595337,
0.009528480470180511,
0.031928662210702896,
-0.030315116047859192,
-0.022846350446343422,
-0.02032824046909809,
-0.03762497007846832,
0.03417784720659256,
0.017626773566007614,
0.06287941336631775,
0.05574069544672966,
0.0026495165657252073,
-0.03007063828408718,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def delete_floatingip(self, context, id):
fip = self._get_floatingip(context, id)
port_id = fip['fixed_port_id']
with context.session.begin(subtransactions=True):
if port_id:
params = {
'neutron_port_id': id,
}
nuage... | |
19,520 | [
0.017740778625011444,
0.02542695961892605,
0.026231328025460243,
-0.017830153927206993,
-0.016433680430054665,
0.011730363592505455,
-0.0002775487955659628,
0.0030750310979783535,
-0.008434690535068512,
0.008283871226012707,
0.01692523993551731,
-0.013841829262673855,
0.02355010248720646,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def create_security_group_rule(self, context, security_group_rule):
sg_rule = security_group_rule['security_group_rule']
self.nuageclient.validate_nuage_sg_rule_definition(sg_rule)
sg_id = sg_rule['security_group_id']
local_sg_rule = super(NuagePlugin,
self... | |
19,521 | [
-0.022649256512522697,
-0.022956926375627518,
0.02989133819937706,
-0.027074972167611122,
0.01734786294400692,
0.010555452667176723,
0.035547737032175064,
0.02480294741690159,
-0.0012314202031120658,
0.00031931872945278883,
0.028092650696635246,
-0.029299665242433548,
-0.007881089113652706,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def setUpClass(cls):
# Bring up a simple HTTP server
os.chdir(unitTestDataPath() + '')
handler = http.server.SimpleHTTPRequestHandler
cls.httpd = socketserver.TCPServer(('localhost', 0), handler)
cls.port = cls.httpd.server_address[1]
cls.httpd_thread = threading.Thread... | |
19,522 | [
-0.034178998321294785,
-0.003074884880334139,
0.0016859802417457104,
-0.0032555803190916777,
0.010020939633250237,
-0.0015137071022763848,
-0.02501559816300869,
-0.012262788601219654,
-0.012066779658198357,
0.06433982402086258,
0.029131779447197914,
-0.03844218701124191,
0.012728308327496052... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testFetchBadUrl(self):
registry = QgsApplication.networkContentFetcherRegistry()
content = registry.fetch('http://x')
self.loaded = False
def check_reply():
self.assertEqual(content.status(), QgsFetchedContent.Failed)
self.assertNotEqual(content.error(), QNet... | |
19,523 | [
-0.01593841426074505,
0.003767419373616576,
0.005817636847496033,
-0.03013935498893261,
0.007303175982087851,
0.0017809092532843351,
-0.008177703246474266,
-0.008003956638276577,
-0.0075753796845674515,
0.048741891980171204,
0.03771473467350006,
-0.014478936791419983,
-0.0007529047434218228,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testFetchGoodUrl(self):
url = 'http://localhost:' + str(self.port) + '/qgis_local_server/index.html'
registry = QgsApplication.networkContentFetcherRegistry()
content = registry.fetch(url)
self.loaded = False
def check_reply():
self.loaded = True
self... | |
19,524 | [
-0.012800261378288269,
0.019265638664364815,
0.04372730478644371,
-0.030179670080542564,
0.040808986872434616,
-0.033548783510923386,
0.031128715723752975,
-0.05257716029882431,
-0.008772745728492737,
0.04745231196284294,
0.027640972286462784,
-0.004831238649785519,
-0.0016133786411955953,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testLocalPath(self):
registry = QgsApplication.networkContentFetcherRegistry()
filePath = 'qgis_local_server/index.html'
self.assertEqual(registry.localPath(filePath), filePath)
# a non existent download shall return untouched the path
self.assertEqual(registry.localPath('xx... | |
19,525 | [
0.028930578380823135,
0.003294195979833603,
0.008746029809117317,
-0.06252894550561905,
0.0282741691917181,
-0.018124155700206757,
0.023642847314476967,
-0.013590077869594097,
-0.026475125923752785,
0.02376440353691578,
0.02990303374826908,
0.02093212492763996,
-0.0037530739791691303,
-0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testFetchReloadUrl(self):
def writeSimpleFile(content):
with open('qgis_local_server/simple_content.txt', 'w') as f:
f.write(content)
self.file_content = content
registry = QgsApplication.networkContentFetcherRegistry()
content = registry.fetch('http:... | |
19,526 | [
0.011325319297611713,
0.031076349318027496,
0.007896926254034042,
-0.02689254842698574,
0.04134990647435188,
-0.015201146714389324,
0.010110854171216488,
-0.04941534996032715,
0.02654389850795269,
0.039908818900585175,
0.0013401240576058626,
-0.016746828332543373,
0.019373327493667603,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "definition", "annotation": null, "type_comment": null}}], "kwarg"... | def parseDefinition(self, definition):
string = definition
matcher = self.PATTERN_NOT_NULL.match(string)
if matcher:
string = matcher.group(1).strip()
self.nullValue = False
else:
matcher = self.PATTERN_NULL.match(string)
if matcher:
... | |
19,527 | [
0.033421725034713745,
0.035704076290130615,
0.04548879712820053,
0.003482842119410634,
0.018450871109962463,
-0.02316245436668396,
-0.017377490177750587,
-0.04994050785899162,
0.0012061423622071743,
0.04026877135038376,
-0.028879625722765923,
-0.020100489258766174,
0.016213716939091682,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "^(.+)[\\s]+NULL$"}}, {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "... | class PgColumn(object):
PATTERN_NULL = re.compile(r"^(.+)[\s]+NULL$", re.I)
PATTERN_NOT_NULL = re.compile(r"^(.+)[\s]+NOT[\s]+NULL$", re.I)
PATTERN_DEFAULT = re.compile(r"^(.+)[\s]+DEFAULT[\s]+(.+)$", re.I)
def __init__(self, name):
self.name = name
self.defaultValue = None
sel... | |
19,528 | [
0.03661634400486946,
0.01345470268279314,
0.0743500366806984,
0.011429513804614544,
-0.008874749764800072,
-0.03352036699652672,
0.00850812066346407,
-0.025629114359617233,
-0.008409189060330391,
0.015025969594717026,
-0.02000746876001358,
-0.02291722223162651,
0.006907755974680185,
-0.010... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "addDefaults", "annotation": null, "type_comment": null}}], "kwarg... | def getFullDefinition(self, addDefaults):
sbSQL = []
sbSQL.append(PgDiffUtils.getQuotedName(self.name))
sbSQL.append(' ')
sbSQL.append(self.type)
if (self.defaultValue is not None and len(self.defaultValue)):
sbSQL.append(" DEFAULT ")
sbSQL.append(self.de... | |
19,529 | [
-0.002585819223895669,
0.01629548892378807,
0.03424590080976486,
-0.00041683405288495123,
0.006476270500570536,
-0.04280737414956093,
-0.011082476936280727,
-0.024845929816365242,
0.02187809906899929,
0.03894588723778725,
-0.016758866608142853,
-0.04276324436068535,
0.008269105106592178,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "smallint"}}, {"_type": "Constant", "_fields": {"kind": nu... | class PgColumnUtils(object):
ZeroDefaultValueTypes = ["smallint",
"integer",
"bigint",
"real",
"double precision",
"int2",
"int4",
"int8",
"double",
"money"]
@staticmethod
def getDefaultValue(adjType)... | |
19,530 | [
-0.028390156105160713,
0.0398649238049984,
0.029750311747193336,
-0.026213906705379486,
0.02268986776471138,
-0.01728634163737297,
-0.005063488148152828,
0.012105384841561317,
0.03880152851343155,
0.056780312210321426,
0.02846434712409973,
-0.013082223944365978,
0.014986441470682621,
0.013... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c... | def list_running_boxes():
boxes = []
for line in subprocess.check_output(["fleetctl", "list-machines"]).split('\n'):
matcher = re.search(r"[^\s]+[\s]+([^\s]+).+", line)
if matcher and matcher.group(1) != "IP":
boxes.append(matcher.group(1))
return boxes | |
19,531 | [
-0.010389221832156181,
0.03239457309246063,
0.04355785250663757,
0.015396899543702602,
0.0004992539761587977,
-0.03921891748905182,
0.015428493730723858,
-0.03224713355302811,
0.025464912876486778,
0.034184910356998444,
-0.016260474920272827,
-0.022558249533176422,
0.022579312324523926,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "adjType", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def getDefaultValue(adjType):
if (adjType in PgColumnUtils.ZeroDefaultValueTypes
or adjType.startswith("decimal")
or adjType.startswith("numeric")
or adjType.startswith("float")):
defaultValue = "0";
elif (adjType.startswith("character varying"... | |
19,532 | [
0.002762292744591832,
0.008069421164691448,
0.06065289303660393,
-0.05872516706585884,
-0.011936631053686142,
0.014540238305926323,
0.010279254987835884,
-0.022709572687745094,
-0.024425720795989037,
0.02557765506207943,
0.015186732634902,
-0.031854525208473206,
-0.013541111722588539,
-0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testSaveLoadProject(self):
schema_uri = encode_uri(self.ds_uri, 'qgis_test')
project_uri = encode_uri(self.ds_uri, 'qgis_test', 'abc')
self.dropProjectsTable() # make sure we have a clean start
prj = QgsProject()
uri = self.vl.source()
vl1 = QgsVectorLayer(uri, 'te... | |
19,533 | [
0.012584342621266842,
0.017159469425678253,
0.0037166050169616938,
-0.009051510132849216,
-0.008864994160830975,
-0.00028165968251414597,
-0.007444181479513645,
-0.03548192232847214,
-0.01685226708650589,
-0.0037001478485763073,
0.0012418398400768638,
-0.043118104338645935,
0.022491632029414... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ds_uri", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "schema_name", "annotation": null, "type_comment": null}}, {"_ty... | def encode_uri(ds_uri, schema_name, project_name=None):
u = QUrl()
urlQuery = QUrlQuery()
u.setScheme("postgresql")
u.setHost(ds_uri.host())
if ds_uri.port() != '':
u.setPort(int(ds_uri.port()))
if ds_uri.username() != '':
u.setUserName(ds_uri.username())
if ds_uri.password(... | |
19,534 | [
0.02685471810400486,
0.010209957137703896,
-0.044413574039936066,
-0.022020868957042694,
-0.012508101761341095,
0.023136373609304428,
-0.017269650474190712,
-0.06003062427043915,
0.048297178000211716,
-0.052387360483407974,
0.012652703560888767,
-0.02625565230846405,
0.03336182236671448,
-... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "item_list", "annotatio... | class GroupTagValueSerializer(Serializer):
def get_attrs(self, item_list, user):
project = item_list[0].project
user_lookups = [
Q(**parse_user_tag(i.value))
for i in item_list
if i.key == 'sentry:user'
and ':' in i.value
]
tag_labels... | |
19,535 | [
-0.03208332508802414,
-0.014767942950129509,
-0.02665199153125286,
-0.022266069427132607,
-0.04712764173746109,
-0.003271417925134301,
-0.026916349306702614,
-0.031146060675382614,
0.0069694118574261665,
-0.03186703473329544,
0.012154413387179375,
-0.012749217450618744,
0.03864418715238571,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "item_list", "annotation": null, "type_comment": null}}, {"_type":... | def get_attrs(self, item_list, user):
project = item_list[0].project
user_lookups = [
Q(**parse_user_tag(i.value))
for i in item_list
if i.key == 'sentry:user'
and ':' in i.value
]
tag_labels = {}
if user_lookups:
tag_... | |
19,536 | [
-0.001846797182224691,
0.006343347020447254,
0.030619362369179726,
-0.024878231808543205,
-0.00947487261146307,
-0.0037571615539491177,
0.0025008711963891983,
0.010732836090028286,
0.05759865790605545,
0.04980999231338501,
0.02099728025496006,
-0.0389433316886425,
0.010164075531065464,
0.0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_survfunc2():
# Test where some times have no events.
sr = SurvfuncRight(ti2, st2)
assert_allclose(sr.surv_prob, surv_prob2, atol=1e-5, rtol=1e-5)
assert_allclose(sr.surv_prob_se, surv_prob_se2, atol=1e-5, rtol=1e-5)
assert_allclose(sr.surv_times, times2)
assert_allclose(sr.n_risk, n_ri... | |
19,537 | [
0.0031144246459007263,
0.00595690356567502,
0.052368950098752975,
-0.01294331531971693,
-0.008249016478657722,
-0.020771464332938194,
0.010508755221962929,
0.023659266531467438,
0.038849372416734695,
0.04247531294822693,
0.0337989516556263,
-0.017741212621331215,
0.0018340140813961625,
0.0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_survfunc1():
# Test where all times have at least 1 event.
sr = SurvfuncRight(ti1, st1)
assert_allclose(sr.surv_prob, surv_prob1, atol=1e-5, rtol=1e-5)
assert_allclose(sr.surv_prob_se, surv_prob_se1, atol=1e-5, rtol=1e-5)
assert_allclose(sr.surv_times, times1)
assert_allclose(sr.n_risk... | |
19,538 | [
-0.0022104510571807623,
-0.02747410349547863,
0.05793342366814613,
-0.04842120781540871,
-0.007368169724941254,
-0.014660444110631943,
-0.007210054900497198,
0.033065058290958405,
0.02058027870953083,
0.018771439790725708,
0.0016538853524252772,
-0.003431100631132722,
-0.02496955730021,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_survdiff_basic():
# Constants taken from R, code above
ti = np.concatenate((ti1, ti2))
st = np.concatenate((st1, st2))
groups = np.ones(len(ti))
groups[0:len(ti1)] = 0
z, p = survdiff(ti, st, groups)
assert_allclose(z, 2.14673, atol=1e-4, rtol=1e-4)
assert_allclose(p, 0.14287, ... | |
19,539 | [
-0.008533671498298645,
-0.0020347125828266144,
0.060289833694696426,
0.0049595036543905735,
-0.0373486652970314,
0.04923485219478607,
0.02165280655026436,
0.028621047735214233,
0.012038571760058403,
0.03272164240479469,
0.019907282665371895,
-0.023495303466916084,
0.01860506646335125,
0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Subscript", "_fields"... | def test_simultaneous_cb():
# The exact numbers here are regression tests, but they are close
# to page 103 of Klein and Moeschberger.
df = bmt.loc[bmt["Group"] == "ALL", :]
sf = SurvfuncRight(df["T"], df["Status"])
lcb1, ucb1 = sf.simultaneous_cb(transform="log")
lcb2, ucb2 = sf.simultaneous_... | |
19,540 | [
0.012370259501039982,
0.013713971711695194,
0.10663271695375443,
-0.0005211950629018247,
-0.008426900953054428,
0.023606127128005028,
0.002685737097635865,
0.04842767491936684,
0.036300498992204666,
0.03049349971115589,
0.0031465834472328424,
-0.03700273856520653,
0.0013892907882109284,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"k... | def test_bmt():
# All tests against SAS
# Results taken from here:
# http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_lifetest_details03.htm
# Confidence intervals for 25% percentile of the survival
# distribution (for "ALL" subjects), taken from the SAS web s... | |
19,541 | [
0.002087976783514023,
0.03479383885860443,
0.06775788217782974,
-0.00387791870161891,
0.027807345613837242,
0.016814710572361946,
-0.005364627577364445,
-0.0038709877990186214,
0.013688811101019382,
0.04269522801041603,
-0.00502154091373086,
0.003978419117629528,
-0.0047027128748595715,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_survdiff():
# Results come from R survival and survMisc packages (survMisc is
# used for non G-rho family tests but does not seem to support
# stratification)
full_df = bmt.copy()
df = bmt[bmt.Group != "ALL"].copy()
# Not stratified
stat, p = survdiff(df["T"], df.Status, df.Group)... | |
19,542 | [
0.016278188675642014,
-0.0009686353150755167,
0.07073915004730225,
-0.0481824167072773,
-0.02201967127621174,
0.0008743292419239879,
0.01739068143069744,
0.050739869475364685,
0.04143073782324791,
0.06490815430879593,
0.016380487009882927,
-0.0152679942548275,
-0.0270322784781456,
0.049282... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Subscript", "_fields"... | def test_weights2():
# tm = c(1, 3, 5, 6, 7, 2, 4, 6, 8, 10)
# st = c(1, 1, 0, 1, 1, 1, 1, 0, 1, 1)
# wt = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2)
# library(survival)
# sf =s urvfit(Surv(tm, st) ~ 1, weights=wt, err='tsiatis')
tm = np.r_[1, 3, 5, 6, 7, 2, 4, 6, 8, 10]
st = np.r_[1, 1, 0, 1, 1, 1, 1... | |
19,543 | [
0.016060056164860725,
0.009085296653211117,
0.08057502657175064,
-0.037664953619241714,
-0.02202950231730938,
-0.016447195783257484,
0.008467121981084347,
0.05804599076509476,
0.025376388803124428,
0.0565473847091198,
0.017558662220835686,
-0.00818613264709711,
-0.021355129778385162,
0.039... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Subscript", "_fields"... | def test_weights1():
# tm = c(1, 3, 5, 6, 7, 8, 8, 9, 3, 4, 1, 3, 2)
# st = c(1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0)
# wt = c(1, 2, 3, 2, 3, 1, 2, 1, 1, 2, 2, 3, 1)
# library(survival)
# sf = survfit(Surv(tm, st) ~ 1, weights=wt, err='tsiatis')
tm = np.r_[1, 3, 5, 6, 7, 8, 8, 9, 3, 4, 1, 3, 2]
... | |
19,544 | [
0.00620987918227911,
0.009262635372579098,
0.04114697128534317,
-0.008897348307073116,
0.012798091396689415,
0.01092599518597126,
0.0029744799248874187,
0.018734006211161613,
0.03621559962630272,
0.06162913888692856,
0.031127672642469406,
-0.03517192229628563,
0.0009874164825305343,
0.0643... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Subscript", "_fields"... | def test_survfunc_entry_1():
# times = c(1, 3, 3, 5, 5, 7, 7, 8, 8, 9, 10, 10)
# status = c(1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1)
# entry = c(0, 1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 0)
# sv = Surv(entry, times, event=status)
# sdf = survfit(coxph(sv ~ 1), type='kaplan-meier')
times = np.r_[1, 3, 3, 5, 5... | |
19,545 | [
-0.004492808133363724,
-0.007087881676852703,
0.06133810803294182,
-0.008971738629043102,
-0.012524353340268135,
0.012454966083168983,
0.0038405703380703926,
0.015043101273477077,
0.029392331838607788,
0.04637826979160309,
0.02872621640563011,
-0.03069680742919445,
0.00523871835321188,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Subscript", "_fields"... | def test_incidence():
# Check estimates in R:
# ftime = c(1, 1, 2, 4, 4, 4, 6, 6, 7, 8, 9, 9, 9, 1, 2, 2, 4, 4)
# fstat = c(1, 1, 1, 2, 2, 2, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0)
# cuminc(ftime, fstat)
#
# The standard errors agree with Stata, not with R (cmprisk
# package), which uses a diff... | |
19,546 | [
0.005965753924101591,
0.00761047238484025,
0.052527181804180145,
-0.01105562224984169,
0.010413306765258312,
0.009420636110007763,
0.006948692258447409,
0.01928245835006237,
0.03960300609469414,
0.05885951220989227,
0.026120854541659355,
-0.043937016278505325,
0.006682682782411575,
0.05605... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Subscript", "_fields"... | def test_survfunc_entry_3():
# times = c(1, 2, 5, 6, 6, 6, 6, 6, 9)
# status = c(0, 0, 1, 1, 1, 0, 1, 1, 0)
# entry = c(0, 1, 1, 2, 2, 2, 3, 4, 4)
# sv = Surv(entry, times, event=status)
# sdf = survfit(coxph(sv ~ 1), type='kaplan-meier')
times = np.r_[1, 2, 5, 6, 6, 6, 6, 6, 9]
status = np... | |
19,547 | [
0.005525787360966206,
-0.0029087217990309,
0.054894085973501205,
-0.02739686518907547,
0.019506467506289482,
0.015479730442166328,
0.02155119739472866,
0.027095800265669823,
0.05258592590689659,
0.07345972955226898,
0.030282067134976387,
-0.03271567076444626,
0.008034657686948776,
0.056800... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Subscript", "_fields"... | def test_survfunc_entry_2():
# entry = 0 is equivalent to no entry time
times = np.r_[1, 3, 3, 5, 5, 7, 7, 8, 8, 9, 10, 10]
status = np.r_[1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1]
entry = np.r_[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
sf = SurvfuncRight(times, status, entry=entry)
sf0 = SurvfuncRight(ti... | |
19,548 | [
0.013959820382297039,
0.008544052951037884,
0.0757712796330452,
-0.06142815202474594,
-0.0035888731945306063,
0.017669249325990677,
0.015493051148951054,
0.029403410851955414,
0.0044760447926819324,
0.05569090321660042,
0.033112842589616776,
-0.007245752494782209,
-0.00581453088670969,
0.0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Subscript", "_fields"... | def test_survdiff_entry_1():
# entry times = 0 is equivalent to no entry times
ti = np.r_[1, 3, 4, 2, 5, 4, 6, 7, 5, 9]
st = np.r_[1, 1, 0, 1, 1, 0, 1, 1, 0, 0]
gr = np.r_[0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
entry = np.r_[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
z1, p1 = survdiff(ti, st, gr, entry=entry)
z2,... | |
19,549 | [
0.005047417711466551,
0.008889292366802692,
0.07542891800403595,
-0.06527697294950485,
0.0008724323706701398,
0.034237418323755264,
-0.0035214542876929045,
0.020430779084563255,
0.020849546417593956,
0.032790765166282654,
0.04081079736351967,
-0.0260397270321846,
0.005875435192137957,
0.04... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Subscript", "_fields"... | def test_survdiff_entry_2():
# Tests against Stata:
#
# stset time, failure(status) entry(entry)
# sts test group, logrank
ti = np.r_[5, 3, 4, 2, 5, 4, 6, 7, 5, 9]
st = np.r_[1, 1, 0, 1, 1, 0, 1, 1, 0, 0]
gr = np.r_[0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
entry = np.r_[1, 2, 2, 1, 3, 3, 5, 4, 2, ... | |
19,550 | [
0.022514458745718002,
-0.0019307816401124,
0.07908481359481812,
0.018140079453587532,
-0.0017701406031847,
0.004080899991095066,
0.054865092039108276,
0.04003668949007988,
0.06405869871377945,
0.05540880188345909,
0.032152920961380005,
-0.04151953011751175,
0.008050587028265,
0.02371308766... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def test_incidence2():
# Check that the cumulative incidence functions for all competing
# risks sum to the complementary survival function.
np.random.seed(2423)
n = 200
time = -np.log(np.random.uniform(size=n))
status = np.random.randint(0, 3, size=n)
ii = np.argsort(time)
time = time[... | |
19,551 | [
0.0019420768367126584,
0.009837317280471325,
0.08027251064777374,
-0.06666527688503265,
0.005350231193006039,
0.025005826726555824,
-0.004141193348914385,
0.017135972157120705,
0.02164209820330143,
0.021908657625317574,
0.03554127737879753,
-0.02065202035009861,
0.005061458330601454,
0.046... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Subscript", "_fields"... | def test_survdiff_entry_3():
# Tests against Stata:
#
# stset time, failure(status) entry(entry)
# sts test group, logrank
ti = np.r_[2, 1, 5, 8, 7, 8, 8, 9, 4, 9]
st = np.r_[1, 1, 1, 1, 1, 0, 1, 0, 0, 0]
gr = np.r_[0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
entry = np.r_[1, 1, 2, 2, 3, 3, 2, 1, 2, ... | |
19,552 | [
0.018191788345575333,
0.033553458750247955,
0.03656205162405968,
0.002745659789070487,
-0.024463940411806107,
0.005255476571619511,
0.007049796171486378,
0.01768185757100582,
0.04472094774246216,
0.061242714524269104,
0.01956860162317753,
-0.018510496243834496,
-0.03383392095565796,
0.0372... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":... | def test_kernel_survfunc2():
# Check that when bandwidth is very large, the kernel procedure
# agrees with standard KM. (Note: the results do not agree
# perfectly when there are tied times).
n = 100
np.random.seed(3434)
x = np.random.normal(size=(n, 3))
time = np.random.uniform(0, 10, size... | |
19,553 | [
0.008443651720881462,
0.017667317762970924,
0.04053472727537155,
-0.003149306634441018,
0.0004351015668362379,
-0.0014641513116657734,
0.01836933009326458,
0.029276525601744652,
0.05496498569846153,
0.04326477646827698,
0.02958853170275688,
-0.022685406729578972,
-0.014300256967544556,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":... | def test_kernel_survfunc1():
# Regression test
n = 100
np.random.seed(3434)
x = np.random.normal(size=(n, 3))
time = np.random.uniform(size=n)
status = np.random.randint(0, 2, size=n)
result = SurvfuncRight(time, status, exog=x)
timex = np.r_[0.30721103, 0.0515439, 0.69246897, 0.164460... | |
19,554 | [
0.0030281790532171726,
-0.012556672096252441,
0.058416686952114105,
0.03138174116611481,
-0.014511404559016228,
0.020673781633377075,
0.01857989840209484,
0.014988492242991924,
0.019428053870797157,
0.03559601306915283,
0.025749461725354195,
-0.013497594743967056,
-0.012675943784415722,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":... | def test_kernel_cumincidence1():
# Check that when the bandwidth is very large, the kernel
# procedure agrees with standard cumulative incidence
# calculations. (Note: the results do not agree perfectly when
# there are tied times).
n = 100
np.random.seed(3434)
x = np.random.normal(size=(n,... | |
19,555 | [
-0.0022042104974389076,
0.00787945743650198,
0.07444728910923004,
-0.02513275295495987,
-0.001963071757927537,
-0.015079651959240437,
0.009278740733861923,
0.0240323469042778,
0.05651473253965378,
0.0346967838704586,
0.021573413163423538,
-0.02744225040078163,
-0.01263430342078209,
0.00813... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":... | def test_kernel_survfunc3():
# cases with tied times
n = 100
np.random.seed(3434)
x = np.random.normal(size=(n, 3))
time = np.random.randint(0, 10, size=n)
status = np.random.randint(0, 2, size=n)
SurvfuncRight(time, status, exog=x, bw_factor=10000)
SurvfuncRight(time, status, exog=x, b... | |
19,556 | [
0.03985264152288437,
0.023851025849580765,
0.04863373190164566,
0.004614730831235647,
-0.00009735335333971307,
0.03484485670924187,
0.024712830781936646,
0.028066881000995636,
0.012950361706316471,
-0.008484117686748505,
0.07788850367069244,
-0.0198331531137228,
0.035753246396780014,
0.016... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "explicit_db", "annotation": null, "type_comment": null}}], "kwarg... | def cursor(self, explicit_db=True):
with self.connect(explicit_db=explicit_db) as conn:
with closing(conn.cursor()) as cur:
try:
yield cur
except:
conn.rollback()
raise
else:
... | |
19,557 | [
-0.012006753124296665,
-0.013351242057979107,
0.07352547347545624,
0.004428117070347071,
-0.01637466996908188,
-0.0071505396626889706,
0.01420743390917778,
0.018796086311340332,
0.039010241627693176,
0.028388110920786858,
0.01446161512285471,
-0.017578689381480217,
0.013953251764178276,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields":... | def test_kernel_cumincidence2():
# cases with tied times
n = 100
np.random.seed(3434)
x = np.random.normal(size=(n, 3))
time = np.random.randint(0, 10, size=n)
status = np.random.randint(0, 3, size=n)
CumIncidenceRight(time, status, exog=x, bw_factor=10000) | |
19,558 | [
-0.03754021227359772,
0.051034048199653625,
0.034650519490242004,
-0.01235214900225401,
0.014745176769793034,
0.06372805684804916,
-0.005053738132119179,
-0.01079119835048914,
-0.02623944729566574,
0.06496649980545044,
0.040765319019556046,
-0.04915058985352516,
-0.0015923952450975776,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "nacl", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "a... | def nacls_changed(nacl, client, module):
changed = False
params = dict()
params['egress'] = module.params.get('egress')
params['ingress'] = module.params.get('ingress')
nacl_id = nacl['NetworkAcls'][0]['NetworkAclId']
nacl = describe_network_acl(client, module)
entries = nacl['NetworkAcls']... | |
19,559 | [
-0.02755899541079998,
0.029520658776164055,
-0.028372367843985558,
-0.008492572233080864,
0.0031936855521053076,
0.049711450934410095,
-0.014257952570915222,
-0.03047756850719452,
-0.007176821585744619,
0.03660178929567337,
0.048706695437431335,
-0.02688915841281414,
0.016363153234124184,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "nacl_id", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type":... | def tags_changed(nacl_id, client, module):
changed = False
tags = dict()
if module.params.get('tags'):
tags = module.params.get('tags')
if module.params.get('name') and not tags.get('Name'):
tags['Name'] = module.params['name']
nacl = find_acl_by_id(nacl_id, client, module)
if na... | |
19,560 | [
-0.004243708681315184,
0.03256262093782425,
0.01272562239319086,
0.0002464832505211234,
0.033113036304712296,
0.020288340747356415,
-0.0004152202163822949,
0.02558334358036518,
0.011756889522075653,
0.03412580490112305,
0.019209524616599083,
-0.021950596943497658,
0.030757255852222443,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "vpc_id", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": ... | def create_network_acl(vpc_id, client, module):
try:
if module.check_mode:
nacl = dict(NetworkAcl=dict(NetworkAclId="nacl-00000000"))
else:
nacl = client.create_network_acl(VpcId=vpc_id)
except botocore.exceptions.ClientError as e:
module.fail_json(msg=str(e))
... | |
19,561 | [
-0.0157003216445446,
0.03238118067383766,
-0.017392920330166817,
-0.004389085806906223,
-0.0007813681731931865,
0.06457559764385223,
-0.021700294688344002,
0.017661402001976967,
0.009367663413286209,
0.047906406223773956,
0.046575672924518585,
-0.056497808545827866,
0.007254832424223423,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": ... | def remove_network_acl(client, module):
changed = False
result = dict()
nacl = describe_network_acl(client, module)
if nacl['NetworkAcls']:
nacl_id = nacl['NetworkAcls'][0]['NetworkAclId']
vpc_id = nacl['NetworkAcls'][0]['VpcId']
associations = nacl['NetworkAcls'][0]['Association... | |
19,562 | [
-0.02793220989406109,
0.05015101283788681,
-0.011426812969148159,
-0.01341063529253006,
0.018058445304632187,
0.03452983498573303,
-0.03505129739642143,
0.025574296712875366,
-0.014850323088467121,
0.04105944186449051,
0.022978324443101883,
-0.051602039486169815,
0.0023975903168320656,
-0.... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": ... | def describe_network_acl(client, module):
try:
if module.params.get('nacl_id'):
nacl = client.describe_network_acls(Filters=[
{'Name': 'network-acl-id', 'Values': [module.params.get('nacl_id')]}
])
else:
nacl = client.describe_network_acls(Filters=... | |
19,563 | [
-0.053552642464637756,
0.028677860274910927,
0.03287893533706665,
-0.0034465391654521227,
0.033475928008556366,
0.018805334344506264,
-0.048688240349292755,
0.02163553237915039,
0.011287623085081577,
0.049395788460969925,
0.007423740345984697,
-0.038030777126550674,
0.00852928590029478,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "vpc_id", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": ... | def find_default_vpc_nacl(vpc_id, client, module):
try:
response = client.describe_network_acls(Filters=[
{'Name': 'vpc-id', 'Values': [vpc_id]}])
except botocore.exceptions.ClientError as e:
module.fail_json(msg=str(e))
nacls = response['NetworkAcls']
return [n['NetworkAclId... | |
19,564 | [
0.02659684047102928,
0.039259761571884155,
0.03777692839503288,
-0.01864132471382618,
0.002737650414928794,
0.03295183554291725,
0.004307276103645563,
0.03507016971707344,
-0.027185264974832535,
0.03909500315785408,
0.05319368094205856,
-0.038483038544654846,
0.006943422835320234,
0.038082... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "entries", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "Egress", "annotation": null, "type_comment": null}}, {"_type":... | def replace_network_acl_entry(entries, Egress, nacl_id, client, module):
for entry in entries:
params = entry
params['NetworkAclId'] = nacl_id
try:
if not module.check_mode:
client.replace_network_acl_entry(**params)
except botocore.exceptions.ClientError ... | |
19,565 | [
-0.03875276446342468,
0.03554408252239227,
0.011190849356353283,
-0.013094593770802021,
-0.0220879465341568,
0.02747717872262001,
0.01633717119693756,
0.021974964067339897,
-0.009614753536880016,
0.028787769377231598,
0.010315240360796452,
-0.07578820735216141,
0.023590603843331337,
0.0400... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "nacl_id", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "subnets", "annotation": null, "type_comment": null}}, {"_type"... | def replace_network_acl_association(nacl_id, subnets, client, module):
params = dict()
params['NetworkAclId'] = nacl_id
for association in describe_acl_associations(subnets, client, module):
params['AssociationId'] = association
try:
if not module.check_mode:
clie... | |
19,566 | [
-0.05114216357469559,
0.029987063258886337,
0.023698335513472557,
-0.021686866879463196,
-0.02388329803943634,
0.020750492811203003,
-0.01795293390750885,
0.013143905438482761,
0.004661635961383581,
0.04170906916260719,
-0.0023770586121827364,
-0.07749933749437332,
0.005988164339214563,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "nacl", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "a... | def subnets_to_associate(nacl, client, module):
params = list(module.params.get('subnets'))
if not params:
return []
all_found = []
if any(x.startswith("subnet-") for x in params):
try:
subnets = client.describe_subnets(Filters=[
{'Name': 'subnet-id', 'Values'... | |
19,567 | [
0.015108070336282253,
0.005948495119810104,
0.03681054338812828,
-0.01834375597536564,
-0.0001383125054417178,
0.04874444007873535,
-0.007824701257050037,
0.03904968500137329,
0.032455284148454666,
0.07928045839071274,
0.031446438282728195,
-0.06948728114366531,
0.02706657536327839,
0.0084... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
argument_spec = ec2_argument_spec()
argument_spec.update(dict(
vpc_id=dict(),
name=dict(),
nacl_id=dict(),
subnets=dict(required=False, type='list', default=list()),
tags=dict(required=False, type='dict'),
ingress=dict(required=False, type='list', defa... | |
19,568 | [
-0.025818318128585815,
0.01198626309633255,
0.0843140184879303,
-0.03402184322476387,
-0.025180267170071602,
0.05532822385430336,
-0.004135944414883852,
-0.010134772397577763,
-0.04913000389933586,
0.06644856184720993,
0.009462539106607437,
0.011148819699883461,
0.003708677366375923,
-0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
option_parser = optparse.OptionParser()
option_parser.add_option(
'', '--root',
default='', dest='base_directory',
help='Specifies the repository root. This defaults '
'to "../../.." relative to the script file, which '
'will normally be the repository root.')
o... | |
19,569 | [
0.02726515382528305,
0.011884519830346107,
0.015403336845338345,
-0.02133992128074169,
-0.006453055888414383,
-0.00739519065245986,
-0.009086492471396923,
-0.0012415179517120123,
0.026243561878800392,
0.0034932768903672695,
0.001465700683183968,
0.002739852759987116,
0.0140979690477252,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_init__no_test_name(self):
class Test(unittest.TestCase):
def runTest(self): raise MyException()
def test(self): pass
self.assertEqual(Test().id()[-13:], '.Test.runTest')
# test that TestCase can be instantiated with no args
# primarily for use at the in... | |
19,570 | [
0.018993446603417397,
0.004630655515938997,
0.03062492609024048,
-0.008704883977770805,
-0.014295912347733974,
-0.003611429827287793,
-0.017527472227811813,
0.009962196461856365,
0.04198889061808586,
-0.004274862818419933,
-0.0184263177216053,
-0.005275362636893988,
-0.015205456875264645,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_init__test_name__invalid(self):
class Test(unittest.TestCase):
def runTest(self): raise MyException()
def test(self): pass
try:
Test('testfoo')
except ValueError:
pass
else:
self.fail("Failed to raise ValueError") | |
19,571 | [
0.033704474568367004,
-0.004688633140176535,
0.004989149048924446,
-0.025301696732640266,
-0.0016805555205792189,
-0.009032986126840115,
0.005167124792933464,
0.005377193912863731,
0.024834875017404556,
-0.019431423395872116,
0.0013289808994159102,
-0.003221064805984497,
0.02323601394891739,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run_call_order__error_in_setUp(self):
events = []
result = LoggingResult(events)
class Foo(Test.LoggingTestCase):
def setUp(self):
super(Foo, self).setUp()
raise RuntimeError('raised by Foo.setUp')
Foo(events).run(result)
exp... | |
19,572 | [
0.020924003794789314,
-0.008642523549497128,
-0.00032302853651344776,
-0.02142436057329178,
0.0024477671831846237,
-0.009256597608327866,
0.006066823843866587,
-0.006112311035394669,
0.030453523620963097,
-0.018752001225948334,
-0.01720544509589672,
-0.0010241674026474357,
0.0236759651452302... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run_call_order__error_in_setUp_default_result(self):
events = []
class Foo(Test.LoggingTestCase):
def defaultTestResult(self):
return LoggingResult(self.events)
def setUp(self):
super(Foo, self).setUp()
raise RuntimeError... | |
19,573 | [
0.03070380911231041,
-0.004079220350831747,
-0.005005817394703627,
-0.018937669694423676,
0.010033565573394299,
-0.017172200605273247,
-0.030023938044905663,
-0.013246499933302402,
0.029848488047719002,
-0.008904104121029377,
0.0018504527397453785,
-0.005685687530785799,
0.024036696180701256... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run_call_order__error_in_test(self):
events = []
result = LoggingResult(events)
class Foo(Test.LoggingTestCase):
def test(self):
super(Foo, self).test()
raise RuntimeError('raised by Foo.test')
expected = ['startTest', 'setUp', 'test... | |
19,574 | [
0.026674462482333183,
0.009383849799633026,
0.008748484775424004,
-0.02098333090543747,
-0.0016820876626297832,
-0.012490077875554562,
-0.026696182787418365,
-0.022145450115203857,
0.04127155989408493,
0.00615815119817853,
0.0023242405150085688,
-0.019039222970604897,
0.0013508290285244584,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run_call_order__failure_in_test(self):
events = []
result = LoggingResult(events)
class Foo(Test.LoggingTestCase):
def test(self):
super(Foo, self).test()
self.fail('raised by Foo.test')
expected = ['startTest', 'setUp', 'test', 'tea... | |
19,575 | [
0.02146967686712742,
-0.006427884567528963,
-0.0062434556894004345,
-0.016045302152633667,
0.013365660794079304,
-0.010610077530145645,
-0.018974464386701584,
-0.027751103043556213,
0.0316566526889801,
-0.011662406846880913,
-0.02781619504094124,
-0.0006316006765700877,
0.020710263401269913,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run_call_order__error_in_test_default_result(self):
events = []
class Foo(Test.LoggingTestCase):
def defaultTestResult(self):
return LoggingResult(self.events)
def test(self):
super(Foo, self).test()
raise RuntimeError('r... | |
19,576 | [
0.022572427988052368,
0.01222230028361082,
0.006089875474572182,
-0.012764804065227509,
0.006829170044511557,
0.0021048630587756634,
-0.014413591474294662,
-0.02897610515356064,
0.03716685622930527,
-0.008541781455278397,
-0.02774217538535595,
-0.015796445310115814,
0.0021274674218147993,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run_call_order__failure_in_test_default_result(self):
class Foo(Test.LoggingTestCase):
def defaultTestResult(self):
return LoggingResult(self.events)
def test(self):
super(Foo, self).test()
self.fail('raised by Foo.test')
... | |
19,577 | [
0.04224609211087227,
0.008915725164115429,
0.017724888399243355,
-0.021951865404844284,
-0.003288635751232505,
0.012917737476527691,
-0.0005690730758942664,
-0.004771629814058542,
0.011390342377126217,
-0.0002926767338067293,
0.007856020703911781,
-0.016505340114235878,
0.031187277287244797,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run_call_order__error_in_tearDown(self):
events = []
result = LoggingResult(events)
class Foo(Test.LoggingTestCase):
def tearDown(self):
super(Foo, self).tearDown()
raise RuntimeError('raised by Foo.tearDown')
Foo(events).run(result)... | |
19,578 | [
0.03074810281395912,
0.006893006619066,
0.011484508402645588,
-0.013348727487027645,
0.011150790378451347,
0.015834352001547813,
0.005471827462315559,
-0.014453449286520481,
0.012692797929048538,
-0.010868855752050877,
-0.019884999841451645,
-0.01093214750289917,
0.018895354121923447,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run_call_order__error_in_tearDown_default_result(self):
class Foo(Test.LoggingTestCase):
def defaultTestResult(self):
return LoggingResult(self.events)
def tearDown(self):
super(Foo, self).tearDown()
raise RuntimeError('raised by ... | |
19,579 | [
0.043815236538648605,
-0.006090340204536915,
-0.00012748382869176567,
-0.030105095356702805,
0.022886915132403374,
-0.01010105200111866,
-0.00960590224713087,
-0.0016711298376321793,
0.040976379066705704,
-0.02027912624180317,
-0.04179062694311142,
-0.01218068040907383,
0.01487649418413639,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run_call_order_default_result(self):
class Foo(unittest.TestCase):
def defaultTestResult(self):
return ResultWithNoStartTestRunStopTestRun()
def test(self):
pass
Foo('test').run() | |
19,580 | [
0.029684748500585556,
0.0012408895418047905,
-0.009677091613411903,
-0.04020851477980614,
0.019001875072717667,
0.02445695921778679,
0.001392182894051075,
-0.03213953599333763,
0.044413477182388306,
0.009074759669601917,
0.004224848933517933,
-0.0317985936999321,
-0.01392182894051075,
-0.0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "result", "annotation": null, "type_comment": null}}, {"_type": "a... | def _check_call_order__subtests_success(self, result, events, expected_events):
class Foo(Test.LoggingTestCase):
def test(self):
super(Foo, self).test()
for i in [1, 2]:
with self.subTest(i=i):
for j in [2, 3]:
... | |
19,581 | [
0.02536316215991974,
0.0024181741755455732,
0.010791308246552944,
-0.02620062604546547,
0.009905990213155746,
0.0213672686368227,
0.0012195553863421082,
-0.032015010714530945,
0.03864293172955513,
0.013566899113357067,
0.004306952003389597,
-0.040461424738168716,
-0.009565022774040699,
0.0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "result", "annotation": null, "type_comment": null}}, {"_type": "a... | def _check_call_order__subtests(self, result, events, expected_events):
class Foo(Test.LoggingTestCase):
def test(self):
super(Foo, self).test()
for i in [1, 2, 3]:
with self.subTest(i=i):
if i == 1:
... | |
19,582 | [
0.020601054653525352,
0.02111608162522316,
0.006788984406739473,
-0.049863919615745544,
-0.013929123058915138,
0.011266202665865421,
-0.00988499540835619,
-0.020261606201529503,
0.06114767864346504,
0.004427471198141575,
-0.0006832878571003675,
-0.03162730112671852,
-0.004644016269594431,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run_call_order__subtests_failfast(self):
events = []
result = LoggingResult(events)
result.failfast = True
class Foo(Test.LoggingTestCase):
def test(self):
super(Foo, self).test()
with self.subTest(i=1):
self.fail(... | |
19,583 | [
0.03613637760281563,
0.015845779329538345,
0.025891071185469627,
-0.04267026484012604,
-0.02309083566069603,
0.0013744214083999395,
0.024513177573680878,
-0.014334541745483875,
0.047381769865751266,
-0.01783483661711216,
0.014367877505719662,
-0.0037947644013911486,
0.006689452566206455,
-... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run_call_order__subtests_success(self):
events = []
result = LoggingResult(events)
# The 6 subtest successes are individually recorded, in addition
# to the whole test success.
expected = (['startTest', 'setUp', 'test', 'tearDown']
+ 6 * ['addSubTestS... | |
19,584 | [
0.018065206706523895,
-0.012820816598832607,
-0.0010135483462363482,
-0.0333147794008255,
0.006517875008285046,
0.028392788022756577,
-0.00475810281932354,
-0.0159910935908556,
0.03978429362177849,
-0.01515285111963749,
-0.0033610311802476645,
-0.011133584193885326,
-0.0016966357361525297,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_failureException__subclassing__explicit_raise(self):
events = []
result = LoggingResult(events)
class Foo(unittest.TestCase):
def test(self):
raise RuntimeError()
failureException = RuntimeError
self.assertIs(Foo('test').failureExceptio... | |
19,585 | [
0.01274673268198967,
-0.01952083595097065,
0.01100105606019497,
-0.02913852594792843,
0.007795159704983234,
0.02843586355447769,
-0.002794180531054735,
0.0031784488819539547,
0.03583577647805214,
-0.023473311215639114,
-0.0189718808978796,
-0.016852915287017822,
-0.005742068402469158,
0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_failureException__subclassing__implicit_raise(self):
events = []
result = LoggingResult(events)
class Foo(unittest.TestCase):
def test(self):
self.fail("foo")
failureException = RuntimeError
self.assertIs(Foo('test').failureException, R... | |
19,586 | [
0.027624551206827164,
0.0007831919938325882,
0.01802676171064377,
-0.02580389380455017,
0.0251520536839962,
-0.01264345832169056,
-0.021634362637996674,
-0.006546501535922289,
0.05367569625377655,
-0.007782750762999058,
-0.05241696909070015,
0.012868231162428856,
0.016172388568520546,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run__uses_defaultTestResult(self):
events = []
defaultResult = LoggingResult(events)
class Foo(unittest.TestCase):
def test(self):
events.append('test')
def defaultTestResult(self):
return defaultResult
# Make run() find... | |
19,587 | [
0.023391587659716606,
0.0016186605207622051,
0.009768940508365631,
-0.026934511959552765,
0.0425565280020237,
0.019392848014831543,
0.010949915274977684,
0.0015487343771383166,
0.06095487251877785,
0.0046280743554234505,
-0.034289706498384476,
-0.01905098743736744,
0.005739123094826937,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_run__returns_given_result(self):
class Foo(unittest.TestCase):
def test(self):
pass
result = unittest.TestResult()
retval = Foo('test').run(result)
self.assertIs(retval, result) | |
19,588 | [
0.030627278611063957,
-0.016975583508610725,
0.057455822825431824,
0.0017583974404260516,
-0.0176878459751606,
0.012868205085396767,
0.0028935654554516077,
0.018257657065987587,
0.030745988711714745,
0.027113450691103935,
0.02538027986884117,
-0.05831053853034973,
-0.007395656779408455,
0.... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testAssertIn(self):
animals = {'monkey': 'banana', 'cow': 'grass', 'seal': 'fish'}
self.assertIn('a', 'abc')
self.assertIn(2, [1, 2, 3])
self.assertIn('monkey', animals)
self.assertNotIn('d', 'abc')
self.assertNotIn(0, [1, 2, 3])
self.assertNotIn('otter', an... | |
19,589 | [
0.006157470867037773,
-0.025282617658376694,
0.00825166329741478,
-0.039990924298763275,
0.023172106593847275,
0.01912514679133892,
-0.018178680911660194,
0.020550286397337914,
0.034007515758275986,
-0.010237067006528378,
-0.004465797916054726,
-0.02325913868844509,
0.005651600658893585,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_call__invoking_an_instance_delegates_to_run(self):
resultIn = unittest.TestResult()
resultOut = unittest.TestResult()
class Foo(unittest.TestCase):
def test(self):
pass
def run(self, result):
self.assertIs(result, resultIn)
... | |
19,590 | [
-0.010748609900474548,
-0.06392258405685425,
0.019406728446483612,
-0.03672296553850174,
-0.010272442363202572,
0.006834745407104492,
0.020405519753694534,
0.01833825558423996,
0.024156790226697922,
0.0370946079492569,
0.0077986945398151875,
-0.06076361611485481,
0.000562908360734582,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testAssertEqual(self):
equal_pairs = [
((), ()),
({}, {}),
([], []),
(set(), set()),
(frozenset(), frozenset())]
for a, b in equal_pairs:
# This mess of try excepts is to test the assertEqual behavior
... | |
19,591 | [
0.029528163373470306,
-0.03483632206916809,
0.027503658086061478,
-0.03162673860788345,
-0.003792863106355071,
0.034120336174964905,
0.04962509125471115,
0.043625641614198685,
0.0041539412923157215,
0.03355248644948006,
-0.011492776684463024,
-0.055352963507175446,
0.0044563827104866505,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testAssertDictContainsSubset(self):
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
self.assertDictContainsSubset({}, {})
self.assertDictContainsSubset({}, {'a': 1})
self.assertDictContainsSubset({'a': 1}, {'a': 1})
... | |
19,592 | [
0.03499751165509224,
-0.04618121683597565,
0.04845411702990532,
-0.02644830383360386,
0.03564321994781494,
0.0073159001767635345,
0.005591853056102991,
0.02742978371679783,
0.043520890176296234,
0.028049666434526443,
-0.008135952986776829,
-0.06937514245510101,
0.01886766217648983,
-0.0071... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testEquality(self):
self.assertListEqual([], [])
self.assertTupleEqual((), ())
self.assertSequenceEqual([], ())
a = [0, 'a', []]
b = []
self.assertRaises(unittest.TestCase.failureException,
self.assertListEqual, a, b)
self.assertRais... | |
19,593 | [
0.05282941460609436,
-0.01747261919081211,
0.034695807844400406,
-0.030280882492661476,
0.03836243599653244,
0.03990890830755234,
-0.0004318268329370767,
-0.016761740669608116,
0.018158553168177605,
0.012384233064949512,
0.000504317635204643,
-0.028983844444155693,
-0.04524672403931618,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testAssertSequenceEqualMaxDiff(self):
self.assertEqual(self.maxDiff, 80*8)
seq1 = 'a' + 'x' * 80**2
seq2 = 'b' + 'x' * 80**2
diff = '\n'.join(difflib.ndiff(pprint.pformat(seq1).splitlines(),
pprint.pformat(seq2).splitlines()))
# the +1 i... | |
19,594 | [
0.02182210609316826,
0.01386516634374857,
0.030928969383239746,
-0.023038117215037346,
0.008069288916885853,
0.03222428634762764,
0.0048309992998838425,
0.02187497541308403,
0.02928999811410904,
0.02451847679913044,
0.0008273333660326898,
0.0007657893584109843,
-0.04266611486673355,
0.0090... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testTruncateMessage(self):
self.maxDiff = 1
message = self._truncateMessage('foo', 'bar')
omitted = unittest.case.DIFF_OMITTED % len('bar')
self.assertEqual(message, 'foo' + omitted)
self.maxDiff = None
message = self._truncateMessage('foo', 'bar')
self.asser... | |
19,595 | [
0.022526152431964874,
-0.005269409157335758,
0.014222841709852219,
-0.01215841993689537,
0.0006658046622760594,
0.004274266306310892,
0.015888066962361336,
0.05552269145846367,
0.02311924658715725,
0.031958624720573425,
-0.005557401571422815,
-0.014485171996057034,
-0.01700581982731819,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testAssertDictEqualTruncates(self):
test = unittest.TestCase('assertEqual')
def truncate(msg, diff):
return 'foo'
test._truncateMessage = truncate
try:
test.assertDictEqual({}, {1: 0})
except self.failureException as e:
self.assertEqual(str... | |
19,596 | [
0.046403661370277405,
-0.014022250659763813,
0.01661428064107895,
-0.011613559909164906,
0.01058939192444086,
0.045872610062360764,
0.024365084245800972,
0.01570390909910202,
0.043470241129398346,
0.0470864400267601,
-0.0015125444624572992,
-0.0013726695906370878,
-0.0511072501540184,
0.04... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testAssertEqual_diffThreshold(self):
# check threshold value
self.assertEqual(self._diffThreshold, 2**16)
# disable madDiff to get diff markers
self.maxDiff = None
# set a lower threshold value and add a cleanup to restore it
old_threshold = self._diffThreshold
... | |
19,597 | [
0.0046268063597381115,
0.0031221299432218075,
0.041739195585250854,
-0.00490578031167388,
-0.02128509059548378,
-0.009039930999279022,
0.022567182779312134,
0.04264140874147415,
0.022317886352539062,
0.0448257140815258,
0.000060469006712082773,
0.006861562840640545,
-0.028918283060193062,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testAssertMultiLineEqualTruncates(self):
test = unittest.TestCase('assertEqual')
def truncate(msg, diff):
return 'foo'
test._truncateMessage = truncate
try:
test.assertMultiLineEqual('foo', 'bar')
except self.failureException as e:
self.ass... | |
19,598 | [
0.043948784470558167,
-0.026255307719111443,
0.026006925851106644,
-0.039507150650024414,
-0.007992016151547432,
0.03304925188422203,
0.015852537006139755,
0.01703599840402603,
0.0584133118391037,
0.0693712830543518,
0.002931258175522089,
-0.05461454764008522,
-0.0475430004298687,
0.035825... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testAssertEqual_shorten(self):
# set a lower threshold value and add a cleanup to restore it
old_threshold = self._diffThreshold
self._diffThreshold = 0
self.addCleanup(lambda: setattr(self, '_diffThreshold', old_threshold))
s = 'x' * 100
s1, s2 = s + 'a', s + 'b'
... | |
19,599 | [
-0.027764692902565002,
-0.0399249903857708,
0.014849341474473476,
-0.020068468526005745,
0.00868971273303032,
-0.016054773703217506,
0.0074379174038767815,
0.06580867618322372,
0.022002458572387695,
0.0026807631365954876,
0.045859429985284805,
0.023287370800971985,
-0.019300170242786407,
0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class PrioritiseTransactionTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 1
self.txouts = gen_return_txouts()
def setup_network(self):
self.nodes = []
self.is_network_split = False
self... | |
19,600 | [
-0.004050144925713539,
-0.045564133673906326,
0.0140911303460598,
-0.008254983462393284,
0.006940092425793409,
-0.013669240288436413,
0.0010538463247939944,
0.06035841256380081,
0.046998560428619385,
0.004345468245446682,
0.05962713807821274,
0.010737103410065174,
-0.032429289072752,
0.013... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def run_test(self):
utxo_count = 90
utxos = create_confirmed_utxos(self.relayfee, self.nodes[0], utxo_count)
base_fee = self.relayfee*100 # our transactions are smaller than 100kb
txids = []
# Create 3 batches of transactions at 3 different fee rate levels
range_size = u... |