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 |
|---|---|---|---|---|---|
201 | [
0.0005492476630024612,
-0.020442551001906395,
0.034918367862701416,
-0.01160919014364481,
0.02796582505106926,
-0.05136580392718315,
-0.03774608299136162,
-0.013334354385733604,
-0.030949193984270096,
0.002138620475307107,
-0.008690678514540195,
-0.0524294376373291,
-0.023010842502117157,
... | 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": "request", "annotation": null, "type_comment": null}}, {"_type": "... | def get(self, request, app_label=None, actor=None, pk=None):
# print(request, app_label, actor, pk)
ar = action_request(app_label, actor, request, request.GET, False)
ar.renderer = settings.SITE.plugins.bootstrap3.renderer
navigator = None
if pk and pk != '-99999' and pk != '-99... | |
202 | [
0.0009832631330937147,
-0.009878506883978844,
0.013016385026276112,
-0.005281789693981409,
0.022485071793198586,
-0.025445565581321716,
-0.026962511241436005,
-0.03660246729850769,
-0.04149584472179413,
-0.001607168815098703,
-0.0017050363821908832,
-0.05700785294175148,
-0.00062008271925151... | 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": "request", "annotation"... | class Element(View):
def get(self, request, app_label=None, actor=None, pk=None):
# print(request, app_label, actor, pk)
ar = action_request(app_label, actor, request, request.GET, False)
ar.renderer = settings.SITE.plugins.bootstrap3.renderer
navigator = None
if pk and pk !... | |
203 | [
-0.031237779185175896,
-0.011128727346658707,
-0.03899351507425308,
0.00019671313930302858,
0.036393944174051285,
0.017831744626164436,
-0.039616551250219345,
0.03007764182984829,
0.03439592942595482,
0.008625837974250317,
0.014383558183908463,
-0.04281767085194588,
-0.012278122827410698,
... | 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": "request", "annotation": null, "type_comment": null}}], "kwarg": {... | def get(self, request, *args, **kw):
action_name = request.GET.get(constants.URL_PARAM_ACTION_NAME)
if action_name == 'logout':
username = request.session.pop('username', None)
auth.logout(request)
# request.user = settings.SITE.user_model.get_anonymous_user()
... | |
204 | [
-0.030138526111841202,
0.0023160160053521395,
-0.053781136870384216,
-0.005225206259638071,
0.016946330666542053,
0.005636474117636681,
-0.024886956438422203,
-0.01155767124146223,
0.01948775351047516,
0.02604694291949272,
0.0062691932544112206,
-0.01700960285961628,
0.006559189409017563,
... | 10 | {"_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": "request", "annotation"... | class Authenticate(View):
def get(self, request, *args, **kw):
action_name = request.GET.get(constants.URL_PARAM_ACTION_NAME)
if action_name == 'logout':
username = request.session.pop('username', None)
auth.logout(request)
# request.user = settings.SITE.user_mode... | |
205 | [
-0.04014614596962929,
-0.01833142153918743,
-0.025264954194426537,
0.01965419575572014,
0.014230827800929546,
-0.031702447682619095,
-0.008879110217094421,
0.0679905042052269,
0.03639829158782959,
0.03745650872588158,
-0.00426042964681983,
-0.01927940919995308,
0.009038945659995079,
-0.004... | 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": "request", "annotation": null, "type_comment": null}}], "kwarg": {... | def post(self, request, *args, **kw):
username = request.POST.get('username')
password = request.POST.get('password')
user = auth.authenticate(
request, username=username, password=password)
auth.login(request, user)
target = '/'
return http.HttpResponseRedire... | |
206 | [
-0.045029498636722565,
-0.03608275204896927,
0.051018644124269485,
-0.00025763490702956915,
0.011306668631732464,
-0.05984215810894966,
-0.010733632370829582,
0.005329846404492855,
0.026519836857914925,
0.029822492972016335,
-0.03741367161273956,
-0.06984871625900269,
0.013321534730494022,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ar", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}... | def index_response(ar):
ui = settings.SITE.plugins.bootstrap3
main = settings.SITE.get_main_html(ar.request, extjs=ui)
main = ui.renderer.html_text(main)
context = dict(
title=settings.SITE.title,
main=main,
)
# if settings.SITE.user_model is None:
# user = auth.Anonymou... | |
207 | [
-0.00494719622656703,
0.025038450956344604,
0.0023467140272259712,
-0.018476366996765137,
0.014918487519025803,
-0.01346252579241991,
0.04978981241583824,
-0.018240543082356453,
0.0046575418673455715,
-0.01127858180552721,
0.015338871628046036,
-0.01868143305182457,
0.034450940787792206,
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": "mock_popen", "annotation": null, "type_comment": null}}, {"_type"... | def _setup_mock_popen(self, mock_popen, retval=None, p1hook=None,
p2hook=None):
class MockPopen(object):
hooks = [p2hook, p1hook]
def __init__(mock_inst, cmd, *args, **kwargs):
self.callstack.append('popen_init')
mock_inst.stdou... | |
208 | [
-0.00559372128918767,
0.021180542185902596,
0.020024316385388374,
-0.015564585104584694,
-0.0014079597312957048,
-0.0046598464250564575,
0.058700721710920334,
-0.006842064671218395,
0.03857475891709328,
-0.028918365016579628,
0.01611093431711197,
-0.021549010649323463,
0.002914389129728079,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "inst", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def _common_inner_inner1(inst, *args, **kwargs):
# NOTE(dosaboy): mock Popen to, by default, raise Exception in order to
# ensure that any test ending up in a subprocess fails
# if not properly mocked.
@mock.patch('subprocess.Popen', spec=True)
# NOT... | |
209 | [
0.025940198451280594,
-0.009211172349750996,
0.04818151518702507,
-0.003653845051303506,
-0.030623845756053925,
0.03499525040388107,
0.028462162241339684,
0.0010628275340422988,
0.011108649894595146,
-0.015203838236629963,
0.04938245192170143,
-0.024667207151651382,
-0.010982551611959934,
... | 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 setUp(self):
global RAISED_EXCEPTIONS
RAISED_EXCEPTIONS = []
super(BackupCephTestCase, self).setUp()
self.ctxt = context.get_admin_context()
# Create volume.
self.volume_size = 1
self.volume_id = fake.VOLUME_ID
self._create_volume_db_entry(self.volume... | |
210 | [
0.026666628196835518,
0.02670973166823387,
0.07005736976861954,
-0.03448271006345749,
0.010143663734197617,
0.04669533297419548,
0.016925262287259102,
0.00683188671246171,
0.026293065398931503,
-0.005391515325754881,
0.05790221318602562,
-0.016695378348231316,
0.0005293634603731334,
0.0178... | 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_get_rbd_support(self):
del self.service.rbd.RBD_FEATURE_LAYERING
del self.service.rbd.RBD_FEATURE_STRIPINGV2
del self.service.rbd.RBD_FEATURE_EXCLUSIVE_LOCK
del self.service.rbd.RBD_FEATURE_JOURNALING
del self.service.rbd.RBD_FEATURE_OBJECT_MAP
del self.service.r... | |
211 | [
0.007367719430476427,
0.004089450463652611,
-0.022432509809732437,
-0.05211075767874718,
-0.029690446332097054,
0.0019806844647973776,
0.006355267949402332,
-0.05084214359521866,
0.028446227312088013,
-0.05616056174039841,
0.025982189923524857,
-0.0006358317332342267,
0.007440908811986446,
... | 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 test_get_backup_snap_name(self):
snap_name = 'backup.%s.snap.3824923.1412' % (fake.VOLUME3_ID)
def get_backup_snaps(inst, *args):
return [{'name': 'backup.%s.snap.6423868.2342' % (fake.UUID1),
'backup_id': fake.BACKUP2_ID},
{'name': snap_name,
... | |
212 | [
0.0027325646951794624,
0.00879549328237772,
0.01316759642213583,
-0.052926816046237946,
-0.012282918207347393,
-0.001088217832148075,
-0.0010257133981212974,
-0.016731951385736465,
0.018385913223028183,
-0.033386971801519394,
0.008410850539803505,
-0.008224939927458763,
0.009026278741657734,... | 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_get_backup_snaps(self):
image = self.mock_rbd.Image.return_value
image.list_snaps.return_value = [
{'name': 'backup.%s.snap.6423868.2342' % (fake.UUID1)},
{'name': 'backup.%s.wambam.6423868.2342' % (fake.UUID2)},
{'name': 'backup.%s.snap.1321319.3235' % (fake... | |
213 | [
0.06474506109952927,
0.0016440077451989055,
0.02406596578657627,
-0.018239833414554596,
0.0310573261231184,
-0.01703999564051628,
0.014986428432166576,
0.01721305027604103,
-0.009696762077510357,
-0.02097407728433609,
0.07263629883527756,
0.020535675808787346,
0.000012235419490025379,
-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 test_transfer_data_from_rbd_to_file(self):
def fake_read(offset, length):
self.volume_file.seek(offset)
return self.volume_file.read(length)
self.mock_rbd.Image.return_value.read.side_effect = fake_read
self.mock_rbd.Image.return_value.size.return_value = self.data_l... | |
214 | [
0.058316245675086975,
-0.00037632943713106215,
0.027072014287114143,
-0.024677729234099388,
0.022710148245096207,
-0.013381918892264366,
0.00552641274407506,
0.015065030194818974,
0.0032713990658521652,
-0.030035236850380898,
0.0751473605632782,
0.023397615179419518,
-0.016736287623643875,
... | 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_transfer_data_from_rbd_to_rbd(self):
def fake_read(offset, length):
self.volume_file.seek(offset)
return self.volume_file.read(length)
def mock_write_data(data, offset):
checksum.update(data)
test_file.write(data)
rbd1 = mock.Mock()
... | |
215 | [
0.05637006461620331,
-0.0013668026076629758,
0.05344979465007782,
-0.015309295617043972,
0.046016380190849304,
-0.013373509980738163,
0.00790906511247158,
0.015287172049283981,
-0.01368323527276516,
-0.02836201898753643,
0.0637592300772667,
0.03245482221245766,
0.004900301806628704,
-0.032... | 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 test_transfer_data_from_file_to_rbd(self):
def mock_write_data(data, offset):
checksum.update(data)
test_file.write(data)
self.mock_rbd.Image.return_value.write.side_effect = mock_write_data
with tempfile.NamedTemporaryFile() as test_file:
self.volume_f... | |
216 | [
0.033618081361055374,
-0.017700430005788803,
0.023239772766828537,
-0.0218814667314291,
0.012723510153591633,
0.01740330085158348,
0.021276595070958138,
0.018464477732777596,
-0.019981959834694862,
0.0037804425228387117,
0.05836472660303116,
0.039730459451675415,
0.006186660844832659,
-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_transfer_data_from_file_to_file(self):
with tempfile.NamedTemporaryFile() as test_file:
self.volume_file.seek(0)
checksum = hashlib.sha256()
self.service._transfer_data(self.volume_file, 'src_foo', test_file,
'dest_foo', self.... | |
217 | [
0.04395618662238121,
-0.004234140273183584,
0.00620332220569253,
-0.02223389968276024,
0.015018008649349213,
0.006064760033041239,
0.035237427800893784,
0.04355115815997124,
-0.006443141493946314,
-0.021061452105641365,
0.04035357013344765,
0.046897970139980316,
-0.014495735988020897,
-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 test_backup_volume_from_file(self):
checksum = hashlib.sha256()
thread_dict = {}
def mock_write_data(data, offset):
checksum.update(data)
thread_dict['thread'] = threading.current_thread()
test_file.write(data)
self.service.rbd.Image.return_value... | |
218 | [
0.060425180941820145,
-0.007027855608612299,
0.006596563383936882,
-0.03941349685192108,
0.017848873510956764,
0.004285277798771858,
0.033065758645534515,
0.012861362658441067,
-0.007774323225021362,
-0.03401681035757065,
0.03987796604633331,
0.011899248696863651,
0.004252101294696331,
-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_backup_volume_from_rbd_set_parent_id(self):
with mock.patch.object(self.service, '_backup_rbd') as \
mock_backup_rbd, mock.patch.object(self.service,
'_backup_metadata'):
mock_backup_rbd.return_value = {'service_metadata': '... | |
219 | [
0.04283947870135307,
-0.0009691799059510231,
0.02613622322678566,
-0.049051433801651,
-0.003163495333865285,
0.0011992523213848472,
0.02917317859828472,
-0.00319513026624918,
-0.00011791209544753656,
-0.03692661598324776,
0.025422997772693634,
0.016139578074216843,
0.008915305137634277,
-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_backup_rbd_set_parent_id(self):
base_name = self.service._get_backup_base_name(self.volume_id,
self.alt_backup)
vol_name = self.volume.name
vol_length = self.volume.size
self.mock_rbd.RBD().list.return_value = [base_name]
... | |
220 | [
0.02140268124639988,
-0.000520434114150703,
0.020585447549819946,
-0.022661661729216576,
-0.0006898858118802309,
-0.01857549510896206,
-0.004759832285344601,
0.01612379401922226,
0.010132590308785439,
-0.03768108785152435,
0.024472827091813087,
0.009541751816868782,
-0.0036306146066635847,
... | 13 | {"_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_backup_volume_from_rbd_got_exception(self):
base_name = self.service._get_backup_base_name(self.volume_id,
self.alt_backup)
self.mock_rbd.RBD().list.return_value = [base_name]
with mock.patch.object(self.service, 'get_backup_snaps... | |
221 | [
0.032667968422174454,
0.002782256342470646,
0.012053590267896652,
-0.05067986994981766,
-0.009816370904445648,
0.014450611546635628,
0.026321571320295334,
-0.0007861657650209963,
0.02634439989924431,
-0.036000970751047134,
0.031206928193569183,
0.012590066529810429,
0.013389073312282562,
-... | 13 | {"_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_backup_rbd_from_snap(self):
backup_name = self.service._get_backup_base_name(self.volume_id)
vol_name = self.volume['name']
vol_length = self.service._get_volume_size_bytes(self.volume)
self.mock_rbd.RBD().list = mock.Mock()
self.mock_rbd.RBD().list.return_value = ['moc... | |
222 | [
0.05516147240996361,
0.013334864750504494,
0.030154330655932426,
-0.05602692812681198,
-0.007111548446118832,
0.00005738276377087459,
0.023094026371836662,
0.0018362484406679869,
0.01022036001086235,
-0.019871339201927185,
0.03484601527452469,
0.03224964812397957,
0.013038787059485912,
-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_backup_rbd_without_parent_id(self):
full_backup_name = self.service._get_backup_base_name(self.volume_id,
self.alt_backup)
vol_name = self.volume.name
vol_length = self.volume.size
with mock.patch.object(self.service... | |
223 | [
0.041354160755872726,
-0.0022696461528539658,
-0.006788802333176136,
-0.019238775596022606,
-0.0185483880341053,
-0.008468743413686752,
0.016891460865736008,
0.014728249050676823,
0.01546466164290905,
-0.0002267129166284576,
0.04588770121335983,
-0.005290087778121233,
0.02167814038693905,
... | 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_backup_vol_length_0(self):
volume_id = fake.VOLUME4_ID
self._create_volume_db_entry(volume_id, 0)
backup_id = fake.BACKUP4_ID
self._create_backup_db_entry(backup_id, volume_id, 1)
backup = objects.Backup.get_by_id(self.ctxt, backup_id)
self.assertRaises(exceptio... | |
224 | [
0.03231748566031456,
-0.004255836363881826,
0.03953809291124344,
-0.05201642960309982,
-0.010667340829968452,
0.012174555100500584,
0.026171788573265076,
0.008511672727763653,
0.021860454231500626,
-0.038486547768116,
0.02850855514407158,
0.009014077484607697,
0.011105484329164028,
-0.0573... | 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 test_backup_rbd_from_snap2(self):
base_name = self.service._get_backup_base_name(self.volume_id,
self.alt_backup)
vol_name = self.volume['name']
vol_length = self.service._get_volume_size_bytes(self.volume)
self.mock_rbd.RBD().l... | |
225 | [
0.02234901860356331,
-0.017974501475691795,
0.006106999237090349,
0.0024498379789292812,
-0.00021571431716438383,
-0.0035028622951358557,
-0.0017717336304485798,
0.03049168549478054,
0.00007351205567829311,
-0.01838596537709236,
0.019891060888767242,
0.027048377320170403,
0.01114202570170164... | 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_backup_with_container_name(self):
volume_size = self.volume_size * units.Gi
backup_id = fake.BACKUP4_ID
self._create_backup_db_entry(backup_id, self.volume_id, 1)
backup = objects.Backup.get_by_id(self.ctxt, backup_id)
backup.container = "test"
with mock.patch.ob... | |
226 | [
0.04431850463151932,
0.014670874923467636,
0.01479549240320921,
-0.032831039279699326,
0.03319356217980385,
0.0206751711666584,
0.012439089827239513,
0.048351578414440155,
-0.02999882400035858,
-0.02524070255458355,
0.018692621961236,
0.028072917833924294,
0.0025943091604858637,
-0.0477624... | 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 test_restore(self):
backup_name = self.service._get_backup_base_name(self.volume_id,
self.alt_backup)
self.mock_rbd.RBD.return_value.list.return_value = [backup_name]
thread_dict = {}
def mock_read_data(offset, length):
... | |
227 | [
0.04044143483042717,
0.032727304846048355,
0.005730742588639259,
-0.05427605286240578,
-0.045337826013565063,
0.005574843380600214,
0.025197945535182953,
0.016571518033742905,
0.002999617950990796,
-0.038178008049726486,
0.04827104136347771,
-0.015416708774864674,
-0.03219609335064888,
-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": "mock_meta_backup", "annotation": null, "type_comment": null}}], "... | def test_try_delete_base_image(self, mock_meta_backup):
backup_name = self.service._get_backup_base_name(self.volume_id,
self.alt_backup)
thread_dict = {}
def mock_side_effect(ioctx, base_name):
thread_dict['thread'] = threadi... | |
228 | [
0.040593888610601425,
0.031837012618780136,
0.02464144118130207,
-0.07430899143218994,
-0.0107650738209486,
0.01562434807419777,
0.0272662416100502,
0.0012819941621273756,
0.01152309775352478,
-0.018192579969763756,
0.03525377810001373,
-0.013576551340520382,
-0.03095453791320324,
-0.03647... | 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": "mock_meta_backup", "annotation": null, "type_comment": null}}], "... | def test_try_delete_base_image_diff_format(self, mock_meta_backup):
backup_name = self.service._get_backup_base_name(self.volume_id,
self.alt_backup)
self.mock_rbd.RBD.return_value.list.return_value = [backup_name]
with mock.patch.object... | |
229 | [
0.03464997187256813,
-0.0051878103986382484,
0.014758321456611156,
-0.09661313146352768,
0.018124042078852654,
0.021187089383602142,
-0.022664133459329605,
0.0010707047767937183,
-0.030703119933605194,
-0.020569637417793274,
0.01809982769191265,
0.004409941378980875,
-0.006840403191745281,
... | 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 test_restore_metdata(self):
version = 2
def mock_read(*args):
base_tag = driver.BackupMetadataAPI.TYPE_TAG_VOL_BASE_META
glance_tag = driver.BackupMetadataAPI.TYPE_TAG_VOL_GLANCE_META
return jsonutils.dumps({base_tag: {'image_name': 'image.base'},
... | |
230 | [
0.014105560258030891,
0.02632446028292179,
0.006908506155014038,
-0.04124017432332039,
-0.002907676389440894,
-0.00238190870732069,
-0.008467774838209152,
0.028876999393105507,
0.014183245599269867,
-0.031163187697529793,
0.021674396470189095,
-0.035047490149736404,
-0.025680774822831154,
... | 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": "mock_meta_backup", "annotation": null, "type_comment": null}}], "... | def test_delete_pool_not_found(self, mock_meta_backup):
with mock.patch.object(
self.service, '_try_delete_base_image') as mock_del_base:
mock_del_base.side_effect = self.mock_rados.ObjectNotFound
# ObjectNotFound exception is caught so that db entry can be
# ... | |
231 | [
0.028614357113838196,
0.03809286281466484,
-0.02288030833005905,
-0.05231062322854996,
-0.02613295614719391,
0.05445669963955879,
0.02611060068011284,
-0.0276754479855299,
0.010428591631352901,
-0.059195950627326965,
0.02776486799120903,
-0.02138252556324005,
-0.000004117876414966304,
-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}}, {"_type": "arg", "_fields": {"arg": "mock_meta_backup", "annotation": null, "type_comment": null}}], "... | def test_backup_metadata_already_exists(self, mock_meta_backup):
def mock_set(json_meta):
msg = (_("Metadata backup object '%s' already exists") %
("backup.%s.meta" % (self.backup_id)))
raise exception.VolumeMetadataBackupExists(msg)
mock_meta_backup.return_v... | |
232 | [
0.04097173362970352,
0.03555634245276451,
-0.011121748015284538,
-0.05961684510111809,
0.013894762843847275,
0.02553310990333557,
-0.004076390992850065,
-0.013502858579158783,
-0.03762274235486984,
-0.02757575921714306,
0.0048839496448636055,
0.001879355637356639,
-0.008431863971054554,
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 test_restore_invalid_metadata_version(self):
def mock_read(*args):
base_tag = driver.BackupMetadataAPI.TYPE_TAG_VOL_BASE_META
glance_tag = driver.BackupMetadataAPI.TYPE_TAG_VOL_GLANCE_META
return jsonutils.dumps({base_tag: {'image_name': 'image.base'},
... | |
233 | [
-0.01567229814827442,
0.017688186839222908,
-0.012525546364486217,
-0.022334562614560127,
-0.019126350060105324,
0.008678151294589043,
0.010220796801149845,
-0.04434953257441521,
0.020957857370376587,
-0.015979599207639694,
0.02441190928220749,
-0.008088135160505772,
0.03449134901165962,
-... | 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": "snapshots", "annotation": null, "type_comment": null}}, {"_type":... | def test__snap_exists(self, snapshots, snap_exist):
client = mock.Mock()
thread_dict = {}
with mock.patch.object(self.service.rbd.Image(),
'list_snaps') as snaps:
snaps.return_value = snapshots
def mock_side_effect():
threa... | |
234 | [
0.001845118822529912,
0.020843351259827614,
-0.0032213416416198015,
-0.02143675647675991,
0.003973694518208504,
-0.016477586701512337,
0.020970510318875313,
-0.019688332453370094,
0.016170287504792213,
-0.019158504903316498,
0.021076476201415062,
-0.028398670256137848,
0.026893964037299156,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Name", "_fields": {"id": "p2hook", "ctx": {"_type": "Load", "_fields": {}}}}, {"_type": "Name", "_fields... | class MockPopen(object):
hooks = [p2hook, p1hook]
def __init__(mock_inst, cmd, *args, **kwargs):
self.callstack.append('popen_init')
mock_inst.stdout = mock.Mock()
mock_inst.stdout.close = mock.Mock()
mock_inst.stdout.close.side_ef... | |
235 | [
0.027116475626826286,
-0.009569771587848663,
0.030964773148298264,
-0.01724088005721569,
0.026810651645064354,
-0.009805511683225632,
0.03295263648033142,
0.0011277294252067804,
0.0192287415266037,
-0.05418198183178902,
0.009920195676386356,
-0.026810651645064354,
-0.027447786182165146,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "inst", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def _common_inner_inner1(inst, *args, **kwargs):
@mock.patch('cinder.backup.drivers.ceph.rbd')
@mock.patch('cinder.backup.drivers.ceph.rados')
def _common_inner_inner2(mock_rados, mock_rbd):
inst.mock_rados = mock_rados
inst.mock_rbd = mock_rbd
inst.mock_rados... | |
236 | [
0.014180541038513184,
0.02516854554414749,
-0.021330945193767548,
0.01451947446912527,
0.0030695348978042603,
-0.01744960993528366,
0.041415486484766006,
-0.031225616112351418,
0.009151204489171505,
0.012398406863212585,
0.03973175212740898,
0.0060406699776649475,
-0.0031706683803349733,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mock_inst", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cmd", "annotation": null, "type_comment": null}}], "kwarg": ... | def __init__(mock_inst, cmd, *args, **kwargs):
self.callstack.append('popen_init')
mock_inst.stdout = mock.Mock()
mock_inst.stdout.close = mock.Mock()
mock_inst.stdout.close.side_effect = \
lambda *args: self.callstack.append('stdout_cl... | |
237 | [
0.00590869365260005,
-0.018266623839735985,
-0.015470712445676327,
-0.01622871495783329,
-0.014774840325117111,
0.017297374084591866,
0.033749762922525406,
-0.005616676062345505,
0.02771059237420559,
-0.02795911766588688,
0.030369816347956657,
-0.014389626681804657,
0.027163837105035782,
-... | 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 test_exists(self):
thread_dict = {}
def mock_side_effect():
thread_dict['thread'] = threading.current_thread()
# True
self.mock_rados.Object.return_value.stat.side_effect = mock_side_effect
self.assertTrue(self.mb.exists)
self.assertTrue(self.mock_rados.... | |
238 | [
0.034579724073410034,
0.014241479337215424,
0.013594139367341995,
-0.039852600544691086,
-0.037357401102781296,
0.04477238655090332,
0.021126821637153625,
-0.006944192107766867,
0.02282167598605156,
-0.03771049529314041,
0.025446344166994095,
-0.019726213067770004,
-0.03199036419391632,
0.... | 12 | {"_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 VolumeMetadataBackupTestCase(test.TestCase):
def setUp(self):
global RAISED_EXCEPTIONS
RAISED_EXCEPTIONS = []
super(VolumeMetadataBackupTestCase, self).setUp()
self.backup_id = fake.BACKUP_ID
self.mb = ceph.VolumeMetadataBackup(mock.Mock(), self.backup_id)
@common... | |
239 | [
0.05856313183903694,
0.014791718684136868,
-0.012112606316804886,
-0.05136851966381073,
-0.0033771907910704613,
0.06178309768438339,
0.03219965845346451,
0.00035513174952939153,
0.025483012199401855,
-0.033004652708768845,
0.055041294544935226,
-0.010672426782548428,
-0.03154560551047325,
... | 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_set(self):
obj_data = []
called = []
thread_dict = {}
def mock_read(*args):
called.append('read')
self.assertEqual(1, len(obj_data))
return obj_data[0]
def _mock_write(data):
obj_data.append(data)
called.appen... | |
240 | [
0.010644316673278809,
0.01720152236521244,
-0.020524688065052032,
-0.021861594170331955,
-0.0010671373456716537,
0.017048733308911324,
0.007951406762003899,
-0.02133956365287304,
0.021275902166962624,
-0.04828140139579773,
0.028647981584072113,
-0.03957241401076317,
0.005930132232606411,
-... | 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_get(self):
self.mock_rados.Object.return_value.stat.side_effect = (
self.mock_rados.ObjectNotFound)
self.mock_rados.Object.return_value.read.return_value = (
'meta'.encode('utf-8'))
self.assertIsNone(self.mb.get())
self.mock_rados.Object.return_value.stat... | |
241 | [
0.04426256939768791,
-0.011836355552077293,
0.07934408634901047,
-0.041337233036756516,
0.001953504979610443,
0.01578555814921856,
0.019543487578630447,
-0.016719413921236992,
-0.017709527164697647,
-0.03865942731499672,
0.0069757988676428795,
0.01477294135838747,
-0.05085582286119461,
-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 setUp(self):
self.maxDiff = None
filename = 'chart_data_labels06.xlsx'
test_dir = 'xlsxwriter/test/comparison/'
self.got_filename = test_dir + '_test_' + filename
self.exp_filename = test_dir + 'xlsx_files/' + filename
self.ignore_files = []
self.ignore_ele... | |
242 | [
0.014108319766819477,
0.004598403815180063,
-0.030132129788398743,
-0.009074019268155098,
-0.04223901033401489,
0.025343405082821846,
0.02519606053829193,
0.0014995462261140347,
0.014464404433965683,
0.0018556308932602406,
0.03627151995897293,
-0.010424685664474964,
0.002420454751700163,
-... | 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 remove_if_exists(self):
thread_dict = {}
def mock_side_effect():
thread_dict['thread'] = threading.current_thread()
with mock.patch.object(self.mock_rados.Object, 'remove') as \
mock_remove:
mock_remove.side_effect = self.mock_rados.ObjectNotFound
... | |
243 | [
-0.02143273502588272,
-0.009557998739182949,
-0.09015486389398575,
-0.05839576572179794,
0.0039262305945158005,
-0.04058365896344185,
0.016135672107338905,
0.03108387067914009,
-0.002539389068260789,
0.0387442409992218,
0.0630059540271759,
-0.027009205892682076,
0.0025524862576276064,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "https?://www\\.muzu\\.tv/(.+?)/(.+?)/(?P<id>\\d+)"}}, "targets": [{"_type": "Name", "_fields": {"id": "_VALID_URL", "ctx": {"_type": "Sto... | class MuzuTVIE(InfoExtractor):
_VALID_URL = r'https?://www\.muzu\.tv/(.+?)/(.+?)/(?P<id>\d+)'
IE_NAME = 'muzu.tv'
_TEST = {
'url': 'http://www.muzu.tv/defected/marcashken-featuring-sos-cat-walk-original-mix-music-video/1981454/',
'md5': '98f8b2c7bc50578d6a0364fff2bfb000',
'info_dict... | |
244 | [
-0.007308837957680225,
-0.019252272322773933,
-0.07220452278852463,
-0.04129210114479065,
0.022425102069973946,
-0.0290767103433609,
0.02377355471253395,
-0.0013874045107513666,
-0.005640270188450813,
0.014062431640923023,
0.05257830768823624,
-0.04444226995110512,
0.016204090788960457,
-0... | 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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _real_extract(self, url):
video_id = self._match_id(url)
info_data = compat_urllib_parse.urlencode({
'format': 'json',
'url': url,
})
info = self._download_json(
'http://www.muzu.tv/api/oembed/?%s' % info_data,
video_id, 'Downloading v... | |
245 | [
-0.03106028400361538,
0.009979025460779667,
0.11239875108003616,
-0.007187235169112682,
-0.02408730238676071,
0.0080052949488163,
0.027969837188720703,
-0.025541629642248154,
-0.018581632524728775,
0.02020476572215557,
-0.0028729464393109083,
-0.03144983574748039,
-0.009031115099787712,
-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 setUp(self):
self.geometries = {
'point': GEOSGeometry("SRID=4326;POINT(9.052734375 42.451171875)"),
'multipoint': GEOSGeometry("SRID=4326;MULTIPOINT("
"(13.18634033203125 14.504356384277344),"
"(13.2079696... | |
246 | [
0.036601245403289795,
0.050942081958055496,
0.08276304602622986,
0.023723028600215912,
-0.016873672604560852,
-0.026398558169603348,
0.003677366767078638,
0.013032802380621433,
0.005324304103851318,
0.010874541476368904,
0.009316788986325264,
-0.013805733062326908,
0.003650611499324441,
0.... | 13 | {"_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_pointfield(self):
class PointForm(forms.Form):
p = forms.PointField()
geom = self.geometries['point']
form = PointForm(data={'p': geom})
self.assertTextarea(geom, form.as_p())
self.assertMapWidget(form)
self.assertFalse(PointForm().is_valid())
... | |
247 | [
0.008068813942372799,
0.044706687331199646,
0.10753770917654037,
0.01955336704850197,
-0.02846449799835682,
-0.019506894052028656,
0.02112181857228279,
0.01814756914973259,
-0.0008372337906621397,
0.010979163460433483,
0.011519407853484154,
-0.011548453010618687,
-0.0019445898942649364,
0.... | 13 | {"_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_multipointfield(self):
class PointForm(forms.Form):
p = forms.MultiPointField()
geom = self.geometries['multipoint']
form = PointForm(data={'p': geom})
self.assertTextarea(geom, form.as_p())
self.assertMapWidget(form)
self.assertFalse(PointForm().is_... | |
248 | [
0.020968295633792877,
0.04349064826965332,
0.06010530889034271,
-0.0010984073160216212,
0.002002557972446084,
-0.00020836172916460782,
0.025024833157658577,
-0.002218240173533559,
-0.024956272915005684,
0.057957056909799576,
-0.009192912839353085,
-0.003445199690759182,
0.02639605663716793,
... | 13 | {"_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_linestringfield(self):
class LineStringForm(forms.Form):
l = forms.LineStringField()
geom = self.geometries['linestring']
form = LineStringForm(data={'l': geom})
self.assertTextarea(geom, form.as_p())
self.assertMapWidget(form)
self.assertFalse(LineS... | |
249 | [
0.02417476661503315,
0.04576187580823898,
0.08411046862602234,
-0.0025570583529770374,
-0.0123438173905015,
0.002079158090054989,
0.0403534434735775,
0.00010271944483974949,
-0.03168129920959473,
0.05790754035115242,
-0.010088360868394375,
-0.013497771695256233,
0.03032919019460678,
0.0122... | 13 | {"_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_multilinestringfield(self):
class LineStringForm(forms.Form):
l = forms.MultiLineStringField()
geom = self.geometries['multilinestring']
form = LineStringForm(data={'l': geom})
self.assertTextarea(geom, form.as_p())
self.assertMapWidget(form)
self.as... | |
250 | [
0.021528633311390877,
0.04332595691084862,
0.0633208304643631,
0.04818473383784294,
0.0030199422035366297,
-0.007215395104140043,
0.015270440839231014,
0.01765504665672779,
-0.00292758084833622,
0.05691709741950035,
0.02034192904829979,
-0.004159067757427692,
0.029152659699320793,
-0.01658... | 13 | {"_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_polygonfield(self):
class PolygonForm(forms.Form):
p = forms.PolygonField()
geom = self.geometries['polygon']
form = PolygonForm(data={'p': geom})
self.assertTextarea(geom, form.as_p())
self.assertMapWidget(form)
self.assertFalse(PolygonForm().is_val... | |
251 | [
0.0356716513633728,
0.037679046392440796,
0.07092797756195068,
0.014040232636034489,
-0.008491052314639091,
-0.0025856755673885345,
0.015528474003076553,
-0.02043159492313862,
-0.020893065258860588,
0.03239521011710167,
0.008456442505121231,
-0.052515313029289246,
0.01281733624637127,
0.00... | 13 | {"_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_geometrycollectionfield(self):
class GeometryForm(forms.Form):
g = forms.GeometryCollectionField()
geom = self.geometries['geometrycollection']
form = GeometryForm(data={'g': geom})
self.assertTextarea(geom, form.as_p())
self.assertMapWidget(form)
se... | |
252 | [
0.013345804996788502,
0.04547137767076492,
0.07933581620454788,
0.03995047137141228,
0.00013415089051704854,
-0.005580676719546318,
0.0231051966547966,
0.02264874428510666,
-0.007058714050799608,
0.05068797618150711,
0.013291466049849987,
-0.008824750781059265,
0.020301273092627525,
-0.023... | 13 | {"_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_multipolygonfield(self):
class PolygonForm(forms.Form):
p = forms.MultiPolygonField()
geom = self.geometries['multipolygon']
form = PolygonForm(data={'p': geom})
self.assertTextarea(geom, form.as_p())
self.assertMapWidget(form)
self.assertFalse(Polyg... | |
253 | [
0.014321215450763702,
0.06251253932714462,
0.05065141245722771,
0.01834082044661045,
-0.03303544223308563,
-0.04414975643157959,
0.013343770056962967,
0.001511470298282802,
0.023304922506213188,
-0.0035144085995852947,
-0.01282759103924036,
-0.034199588000774384,
0.010729928500950336,
-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_osm_widget(self):
class PointForm(forms.Form):
p = forms.PointField(widget=forms.OSMWidget)
geom = self.geometries['point']
form = PointForm(data={'p': geom})
rendered = form.as_p()
self.assertIn("OpenStreetMap (Mapnik)", rendered)
self.assertIn("id... | |
254 | [
-0.0013176386710256338,
0.030282573774456978,
0.0692107081413269,
-0.012263286858797073,
-0.04993157088756561,
-0.024434106424450874,
0.03395809233188629,
-0.036269739270210266,
0.022457649931311607,
0.012217053212225437,
-0.015430242754518986,
-0.04886821284890175,
-0.005992944352328777,
... | 11 | {"_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 OSMWidgetTest(SimpleTestCase):
def setUp(self):
self.geometries = {
'point': GEOSGeometry("SRID=4326;POINT(9.052734375 42.451171875)"),
}
def test_osm_widget(self):
class PointForm(forms.Form):
p = forms.PointField(widget=forms.OSMWidget)
geom = se... | |
255 | [
-0.009454110637307167,
0.023056048899888992,
0.04692584276199341,
-0.012590411119163036,
0.04412294924259186,
0.030944835394620895,
-0.003322783624753356,
0.040822770446538925,
0.0011641044402495027,
0.03458407521247864,
0.033589500933885574,
0.027735071256756783,
0.0006117199664004147,
-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 recoverTree(self):
# TODO: Should probably have 2 classes of hash store,
# persistent and non persistent
start = time.perf_counter()
if not self.tree.hashStore \
or not self.tree.hashStore.is_persistent \
or self.tree.leafCount == 0:
loggi... | |
256 | [
-0.019945066422224045,
0.026036491617560387,
0.09569919109344482,
0.018216261640191078,
-0.010297409258782864,
-0.03023667447268963,
0.01380723062902689,
-0.03492417186498642,
0.009757882915437222,
-0.0014061039546504617,
-0.047060612589120865,
-0.022555677220225334,
0.018773192539811134,
... | 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_default_lat_lon(self):
class PointForm(forms.Form):
p = forms.PointField(
widget=forms.OSMWidget(attrs={
'default_lon': 20, 'default_lat': 30
}),
)
form = PointForm()
rendered = form.as_p()
self.assert... | |
257 | [
0.014527029357850552,
0.005131830926984549,
-0.015045851469039917,
-0.01595943048596382,
0.04664890840649605,
-0.004159038886427879,
0.003479494247585535,
0.0440547950565815,
-0.013376596383750439,
0.011887801811099052,
0.03056541085243225,
0.042904362082481384,
0.0016777139389887452,
-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 recoverTreeFromTxnLog(self):
# TODO: in this and some other lines specific fields of
if not self._read_only:
self.tree.reset()
self.seqNo = 0
for key, entry in self._transactionLog.iterator():
if self.txn_serializer != self.hash_serializer:
ent... | |
258 | [
0.03023771196603775,
0.0030210420954972506,
-0.049864932894706726,
-0.03122016414999962,
0.0668504536151886,
-0.04466884955763817,
-0.012826466001570225,
0.02855662629008293,
0.019856460392475128,
-0.04541114717721939,
0.01624321937561035,
-0.013350441120564938,
0.0031001842580735683,
-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": "seqNo", "annotation": null, "type_comment": null}}], "kwarg": nul... | def getBySeqNo(self, seqNo):
key = str(seqNo)
value = self._transactionLog.get(key)
if value:
data = self.txn_serializer.deserialize(value)
return data
else:
return value | |
259 | [
0.03453546017408371,
0.03414877876639366,
0.030402803793549538,
-0.0006200492498464882,
0.04425082355737686,
0.0034529417753219604,
-0.017400650307536125,
0.05089690536260605,
-0.038982290774583817,
0.006008662283420563,
0.028058549389243126,
-0.025859301909804344,
0.026946842670440674,
-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": "seqNo", "annotation": null, "type_comment": null}}], "kwarg": nul... | def merkleInfo(self, seqNo):
seqNo = int(seqNo)
if seqNo <= 0:
raise PlenumValueError('seqNo', seqNo, '> 0')
rootHash = self.tree.merkle_tree_hash(0, seqNo)
auditPath = self.tree.inclusion_proof(seqNo - 1, seqNo)
return {
F.rootHash.name: self.hashToStr(ro... | |
260 | [
0.04429717734456062,
0.0007709666970185935,
0.03166143223643303,
-0.0023586926981806755,
0.02324160560965538,
0.0011966123711317778,
-0.03759494796395302,
0.03706645593047142,
-0.020707249641418457,
-0.012065215967595577,
0.03718656674027443,
-0.01896562986075878,
0.011020244099199772,
-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": "seqNo", "annotation": null, "type_comment": null}}], "kwarg": nul... | def auditProof(self, seqNo):
seqNo = int(seqNo)
if seqNo <= 0:
raise PlenumValueError('seqNo', seqNo, '> 0')
rootHash = self.tree.merkle_tree_hash(0, self.size)
auditPath = self.tree.inclusion_proof(seqNo - 1, self.size)
return {
F.rootHash.name: self.hash... | |
261 | [
0.04544433578848839,
0.02339375764131546,
0.021065576002001762,
-0.029079897329211235,
0.007779263891279697,
0.048667971044778824,
0.04291467368602753,
-0.008333326317369938,
-0.004267401993274689,
0.006911792326718569,
0.008333326317369938,
0.022072961553931236,
-0.02728898636996746,
-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}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}, {"_type": "arg... | def start(self, loop=None, ensureDurability=True):
if self._transactionLog and not self._transactionLog.closed:
logging.debug("Ledger already started.")
else:
logging.info("Starting ledger...")
ensureDurability = ensureDurability or self.ensureDurability
s... | |
262 | [
0.026598570868372917,
-0.003492433810606599,
0.02630601078271866,
-0.029572928324341774,
-0.005558637902140617,
0.004961328115314245,
-0.03123076818883419,
-0.00261475401930511,
0.03795964643359184,
0.034448929131031036,
0.01741950400173664,
0.0012548076920211315,
0.008350146934390068,
0.0... | 11 | {"_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 HelperFunctionTest(unittest.TestCase):
def test_listmailcapfiles(self):
# The return value for listmailcapfiles() will vary by system.
# So verify that listmailcapfiles() returns a list of strings that is of
# non-zero length.
mcfiles = mailcap.listmailcapfiles()
self.... | |
263 | [
0.0410643145442009,
-0.002980623859912157,
-0.014462747611105442,
-0.025711551308631897,
0.014722335152328014,
0.012596188113093376,
0.002609784249216318,
0.00643406854942441,
0.014944839291274548,
0.00044809794053435326,
0.05102754011750221,
-0.0333755724132061,
0.03144720569252968,
0.039... | 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 test_lookup(self):
# Test without key
expected = [{'view': 'mpeg_play %s'}, {'view': 'animate %s'}]
actual = mailcap.lookup(MAILCAPDICT, 'video/mpeg')
self.assertListEqual(expected, actual)
# Test with key
key = 'compose'
expected = [{'edit': 'audiocompose %s... | |
264 | [
0.02904067002236843,
0.0259048230946064,
0.020110322162508965,
-0.009560924954712391,
-0.009259837679564953,
0.002993824891746044,
-0.03694845736026764,
-0.017872055992484093,
0.038675446063280106,
0.0434701107442379,
0.022132717072963715,
0.001397497020661831,
0.01305466704070568,
0.03369... | 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_listmailcapfiles(self):
# The return value for listmailcapfiles() will vary by system.
# So verify that listmailcapfiles() returns a list of strings that is of
# non-zero length.
mcfiles = mailcap.listmailcapfiles()
self.assertIsInstance(mcfiles, list)
for m in m... | |
265 | [
0.03316560760140419,
0.01168196089565754,
0.03333543986082077,
-0.020513184368610382,
-0.005519514437764883,
0.00029436146724037826,
0.02164134941995144,
0.01596413366496563,
0.006738659925758839,
0.007333069108426571,
0.005643854849040508,
0.01147573720663786,
0.011123944073915482,
0.0385... | 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_subst(self):
plist = ['id=1', 'number=2', 'total=3']
# test case: ([field, MIMEtype, filename, plist=[]], <expected string>)
test_cases = [
(["", "audio/*", "foo.txt"], ""),
(["echo foo", "audio/*", "foo.txt"], "echo foo"),
(["echo %s", "audio/*", "fo... | |
266 | [
0.02631605602800846,
0.02825004607439041,
0.01894848234951496,
-0.009267027489840984,
-0.003272239351645112,
-0.009514532051980495,
-0.0217113234102726,
-0.031335216015577316,
0.012352200224995613,
-0.017106588929891586,
0.029562395066022873,
-0.03419015184044838,
-0.003951437771320343,
0.... | 11 | {"_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 GetcapsTest(unittest.TestCase):
def test_mock_getcaps(self):
# Test mailcap.getcaps() using mock mailcap file in this dir.
# Temporarily override any existing system mailcap file by pointing the
# MAILCAPS environment variable to our mock file.
with test.support.EnvironmentVar... | |
267 | [
0.03729840740561485,
0.029796790331602097,
0.011485393159091473,
0.007594803348183632,
0.0015725436387583613,
-0.012929803691804409,
-0.009423613548278809,
-0.012673537246882915,
0.010145818814635277,
-0.030705371871590614,
0.04573189839720726,
-0.03308165818452835,
0.008678111247718334,
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_mock_getcaps(self):
# Test mailcap.getcaps() using mock mailcap file in this dir.
# Temporarily override any existing system mailcap file by pointing the
# MAILCAPS environment variable to our mock file.
with test.support.EnvironmentVarGuard() as env:
env["MAILCAPS"]... | |
268 | [
0.03446771577000618,
0.010729205794632435,
0.014629682525992393,
-0.0015711862361058593,
-0.004774322733283043,
-0.0035764018539339304,
-0.021574152633547783,
-0.025648240000009537,
0.02435193955898285,
0.013310233131051064,
0.031180668622255325,
-0.02921306900680065,
0.013888939283788204,
... | 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_system_mailcap(self):
# Test mailcap.getcaps() with mailcap file(s) on system, if any.
caps = mailcap.getcaps()
self.assertIsInstance(caps, dict)
mailcapfiles = mailcap.listmailcapfiles()
existingmcfiles = [mcf for mcf in mailcapfiles if os.path.exists(mcf)]
if e... | |
269 | [
0.008782810531556606,
0.024278447031974792,
0.044931501150131226,
-0.034265823662281036,
0.01581139676272869,
0.008993317373096943,
-0.02087525464594364,
-0.04439353942871094,
0.01706274412572384,
0.0350610725581646,
0.010250510647892952,
-0.021448301151394844,
0.0260794498026371,
0.069139... | 11 | {"_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 FindmatchTest(unittest.TestCase):
def test_findmatch(self):
# default findmatch arguments
c = MAILCAPDICT
fname = "foo.txt"
plist = ["access-type=default", "name=john", "site=python.org",
"directory=/tmp", "mode=foo", "server=bar"]
audio_basic_entry =... | |
270 | [
0.014791685156524181,
0.04224773868918419,
0.029906820505857468,
-0.03786870464682579,
0.004189318511635065,
-0.0019655898213386536,
-0.009417413733899593,
-0.04821915179491043,
0.0032034136820584536,
0.023599516600370407,
0.029857059940695763,
-0.02343779243528843,
0.02535361982882023,
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_findmatch(self):
# default findmatch arguments
c = MAILCAPDICT
fname = "foo.txt"
plist = ["access-type=default", "name=john", "site=python.org",
"directory=/tmp", "mode=foo", "server=bar"]
audio_basic_entry = {
'edit': 'audiocompose %s',
... | |
271 | [
0.013241561129689217,
-0.03301451355218887,
0.041119158267974854,
0.01431423518806696,
0.029724981635808945,
0.023980217054486275,
0.00836089625954628,
0.0075385128147900105,
-0.00920115690678358,
0.030511608347296715,
-0.0017430948792025447,
-0.04505229741334915,
0.030869167298078537,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "myip", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "proxy", "annotation": null, "type_comment": null}}, {"_type": "ar... | def detect_from_db(myip, proxy, proxies_set):
proxy_dict = {'ip': proxy[0], 'port': proxy[1]}
result = detect_proxy(myip, proxy_dict)
if result:
proxy_str = '%s:%s' % (proxy[0], proxy[1])
proxies_set.add(proxy_str)
else:
if proxy[2] < 1:
sqlhelper.delete({'ip': proxy... | |
272 | [
0.005090070888400078,
-0.030415307730436325,
0.04972914233803749,
-0.03298593685030937,
-0.010839860886335373,
0.01409295666962862,
-0.002569206291809678,
0.045975569635629654,
-0.011061662808060646,
0.013512859120965004,
0.049410656094551086,
0.0153213981539011,
-0.04927416145801544,
0.02... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "queue1", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "queue2", "annotation": null, "type_comment": null}}, {"_type": ... | def validator(queue1, queue2, myip):
tasklist = []
proc_pool = {} # 所有进程列表
cntl_q = Queue() # 控制信息队列
while True:
if not cntl_q.empty():
# 处理已结束的进程
try:
pid = cntl_q.get()
proc = proc_pool.pop(pid)
proc_ps = psutil.Proc... | |
273 | [
-0.007881969213485718,
-0.016647005453705788,
0.028162676841020584,
-0.01889047399163246,
0.03799574822187424,
0.0029221761506050825,
0.002884884364902973,
0.0006410439964383841,
0.04133708029985428,
0.01708853989839554,
0.006121802143752575,
-0.032100677490234375,
0.01325793843716383,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "selfip", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "proxies", "annotation": null, "type_comment": null}}, {"_type":... | def _checkHttpProxy(selfip, proxies, isHttp=True):
types = -1
speed = -1
if isHttp:
test_url = config.TEST_HTTP_HEADER
else:
test_url = config.TEST_HTTPS_HEADER
try:
start = time.time()
r = requests.get(url=test_url, headers=config.get_header(), timeout=config.TIMEOUT... | |
274 | [
-0.03158210217952728,
0.036958809942007065,
-0.001273789326660335,
-0.05696403980255127,
0.04185112938284874,
-0.016105903312563896,
0.03555408492684364,
0.01960560865700245,
-0.004314081277698278,
0.03521501272916794,
0.02035640925168991,
-0.0326235368847847,
0.03194539248943329,
-0.02969... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def treenav_active(request):
menus = cache.get('menus')
if not menus:
menus = MenuItem.objects.filter(parent__isnull=True).all()
cache.set('menus', menus)
treenav_active = {}
for menu in menus:
root = menu.to_tree()
active_leaf = root.set_active(request.META['PATH_INFO'])... | |
275 | [
-0.030934885144233704,
0.006488191895186901,
0.10543788224458694,
-0.018759198486804962,
0.012086719274520874,
0.001324169454164803,
0.04916028678417206,
0.008153134025633335,
0.020030146464705467,
0.0032663375604897738,
0.006996571086347103,
-0.003226620377972722,
-0.04651671275496483,
0.... | 12 | {"_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 StorageInitializationHandlerTests(NeoUnitTestBase):
def setUp(self):
NeoUnitTestBase.setUp(self)
self.prepareDatabase(number=1)
# create an application object
config = self.getStorageConfiguration(master_number=1)
self.app = Application(config)
self.verificatio... | |
276 | [
-0.02459096722304821,
0.001298901392146945,
0.07612384855747223,
-0.014011678285896778,
-0.025108175352215767,
-0.039354950189590454,
0.055999696254730225,
0.036792412400245667,
-0.00537486607208848,
-0.02251037396490574,
0.01256584282964468,
-0.016421405598521233,
-0.031479258090257645,
-... | 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 setUp(self):
NeoUnitTestBase.setUp(self)
self.prepareDatabase(number=1)
# create an application object
config = self.getStorageConfiguration(master_number=1)
self.app = Application(config)
self.verification = InitializationHandler(self.app)
# define some varia... | |
277 | [
0.012765244580805302,
-0.04028624668717384,
0.06586001068353653,
-0.05469582974910736,
-0.010677370242774487,
0.012786881066858768,
0.04009152203798294,
-0.010823412798345089,
-0.014301401562988758,
0.0055063641630113125,
-0.04030788317322731,
0.014333855360746384,
0.024513596668839455,
-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 sql_table_creation_suffix(self):
suffix = []
test_settings = self.connection.settings_dict['TEST']
if test_settings['CHARSET']:
suffix.append('CHARACTER SET %s' % test_settings['CHARSET'])
if test_settings['COLLATION']:
suffix.append('COLLATE %s' % test_settin... | |
278 | [
-0.019764216616749763,
-0.022005928680300713,
0.08319541066884995,
0.022735480219125748,
0.021939605474472046,
-0.01188505906611681,
0.014750206843018532,
0.03639799356460571,
0.0035748027730733156,
0.006688661873340607,
0.03512459248304367,
0.008250565268099308,
0.022642629221081734,
0.00... | 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 test_09_answerPartitionTable(self):
# send a table
conn = self.getClientConnection()
self.app.pt = PartitionTable(3, 2)
node_1 = self.getStorageUUID()
node_2 = self.getStorageUUID()
node_3 = self.getStorageUUID()
self.app.uuid = node_1
# SN already kno... | |
279 | [
0.02450810745358467,
-0.00024654544540680945,
0.005515361204743385,
0.003343428485095501,
0.008309327065944672,
-0.032262787222862244,
0.045159608125686646,
0.023098165169358253,
-0.05291429162025452,
0.007137830834835768,
0.002962433034554124,
0.003042778931558132,
0.025461891666054726,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(
self,
*,
src,
dst,
bucket,
gcp_conn_id='google_cloud_default',
google_cloud_storage_conn_id=None,
mime_type='application/octet-stream',
delegate_to=None,
gzip=False,
impersonation_chain: Optional[Union[str, Sequence[st... | |
280 | [
0.025470279157161713,
-0.015529794618487358,
0.0023893124889582396,
0.013772817328572273,
0.004439610987901688,
-0.04516257718205452,
0.019987093284726143,
-0.026154203340411186,
0.00899714045226574,
0.05056321993470192,
0.01411477942019701,
-0.02249874547123909,
0.010288341902196407,
-0.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": {"_type": "arg", "_fields": {"arg": "kw", "annotation": null, "type_comment": null}}, "varar... | def __init__(self, *args, **kw):
TestCase.__init__(self, *args, **kw)
self.X = X.copy()
self.Xall = X.copy()
self.Xall[:] = np.nan
self.Xsome = X.copy()
self.Xsomet = X.copy()
self.Xsome[0] = np.nan
self.Xsomet = self.Xsomet[1:] | |
281 | [
0.00020465158740989864,
-0.02064088173210621,
0.0063659860752522945,
-0.010057572275400162,
0.006926009897142649,
-0.0036601561587303877,
-0.05056215822696686,
-0.022778114303946495,
0.012011941522359848,
0.07415173947811127,
0.02916695922613144,
-0.026743998751044273,
0.005937396083027124,
... | 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_relfreq():
a = np.array([1, 4, 2, 1, 3, 1])
relfreqs, lowlim, binsize, extrapoints = stats.relfreq(a, numbins=4)
assert_array_almost_equal(relfreqs, array([0.5, 0.16666667, 0.16666667, 0.16666667]))
# check array_like input is accepted
relfreqs2, lowlim, binsize, extrapoints = stats.relfre... | |
282 | [
0.011694928631186485,
0.0026126967277377844,
0.03412137180566788,
-0.03634168580174446,
0.018898187205195427,
0.00443424703553319,
-0.004233270417898893,
-0.0012393561191856861,
-0.016129175201058388,
0.00912370253354311,
-0.0013430345570668578,
-0.022152096033096313,
0.018030477687716484,
... | 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 test_tie1(self):
# Data
x = [1.0, 2.0, 3.0, 4.0]
y = [1.0, 2.0, 2.0, 3.0]
# Ranks of the data, with tie-handling.
xr = [1.0, 2.0, 3.0, 4.0]
yr = [1.0, 2.5, 2.5, 4.0]
# Result of spearmanr should be the same as applying
# pearsonr to the ranks.
... | |
283 | [
-0.010314016602933407,
-0.03959053382277489,
0.05509909987449646,
-0.0016493210569024086,
-0.0074744196608662605,
-0.009897633455693722,
-0.034866973757743835,
-0.02061438001692295,
0.0538158193230629,
0.058484774082899094,
0.02825944870710373,
0.014921534806489944,
-0.0029727029614150524,
... | 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_1D_list(self):
a = (1,2,3,4)
actual= stats.gmean(a)
desired = power(1*2*3*4,1./4.)
assert_almost_equal(actual, desired,decimal=14)
desired1 = stats.gmean(a,axis=-1)
assert_almost_equal(actual, desired1, decimal=14) | |
284 | [
-0.004318464547395706,
-0.028936542570590973,
0.04617265611886978,
0.015474759042263031,
0.0014963651774451137,
0.00026793821598403156,
-0.041266024112701416,
-0.06763602048158646,
0.041945405304431915,
0.05110444873571396,
0.007938677445054054,
-0.012933376245200634,
0.005211722571402788,
... | 9 | {"_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 TestGMean(TestCase):
def test_1D_list(self):
a = (1,2,3,4)
actual= stats.gmean(a)
desired = power(1*2*3*4,1./4.)
assert_almost_equal(actual, desired,decimal=14)
desired1 = stats.gmean(a,axis=-1)
assert_almost_equal(actual, desired1, decimal=14)
def test_1... | |
285 | [
-0.008918413892388344,
-0.04906046763062477,
0.029593195766210556,
0.009402643889188766,
0.010407880879938602,
-0.0037236674688756466,
-0.013546180911362171,
-0.07875173538923264,
0.045824095606803894,
0.06065747141838074,
0.011376340873539448,
-0.013705547899007797,
0.0201782938092947,
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 test_2D_array_default(self):
a = array(((1,2,3,4),
(1,2,3,4),
(1,2,3,4)))
actual= stats.gmean(a)
desired = array((1,2,3,4))
assert_array_almost_equal(actual, desired, decimal=14)
desired1 = stats.gmean(a,axis=0)
assert_array_almo... | |
286 | [
0.006603552028536797,
-0.04110225662589073,
0.032872091978788376,
0.01864532381296158,
0.010524410754442215,
-0.011319507844746113,
-0.02723965235054493,
-0.05491630360484123,
0.05870363488793373,
0.06001463532447815,
0.022056348621845245,
0.0046947128139436245,
0.0022335543762892485,
0.00... | 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_1D_array(self):
a = array((1,2,3,4), float32)
actual= stats.gmean(a)
desired = power(1*2*3*4,1./4.)
assert_almost_equal(actual, desired, decimal=7)
desired1 = stats.gmean(a,axis=-1)
assert_almost_equal(actual, desired1, decimal=7) | |
287 | [
-0.011601867154240608,
-0.06640653312206268,
0.033251456916332245,
0.017541348934173584,
0.02949259616434574,
0.006638243794441223,
-0.02120382711291313,
-0.046142417937517166,
0.03390202671289444,
0.05821414291858673,
-0.007017743773758411,
-0.00566238583996892,
0.03211897984147072,
0.041... | 10 | {"_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 TestHMean(TestCase):
def test_1D_list(self):
a = (1,2,3,4)
actual= stats.hmean(a)
desired = 4. / (1./1 + 1./2 + 1./3 + 1./4)
assert_almost_equal(actual, desired, decimal=14)
desired1 = stats.hmean(array(a),axis=-1)
assert_almost_equal(actual, desired1, decimal... | |
288 | [
0.00777164613828063,
-0.056261301040649414,
0.016959678381681442,
0.004082885570824146,
0.0074144708923995495,
-0.005077434703707695,
-0.022526688873767853,
-0.06936594843864441,
0.037983767688274384,
0.060251813381910324,
0.02707144059240818,
-0.013449504971504211,
0.01591278426349163,
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_2D_array_dim1(self):
a = array(((1,2,3,4),
(1,2,3,4),
(1,2,3,4)))
actual= stats.gmean(a, axis=1)
v = power(1*2*3*4,1./4.)
desired = array((v,v,v))
assert_array_almost_equal(actual, desired, decimal=14) | |
289 | [
0.010065984912216663,
-0.061255425214767456,
0.034114185720682144,
0.01906665787100792,
0.024732179939746857,
-0.018764013424515724,
-0.019938277080655098,
-0.0540887825191021,
0.05045703798532486,
0.0710369199514389,
0.022879989817738533,
0.0014262163313105702,
0.0012347931042313576,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_1D_array(self):
a = array((1,2,3,4), float64)
actual= stats.hmean(a)
desired = 4. / (1./1 + 1./2 + 1./3 + 1./4)
assert_almost_equal(actual, desired, decimal=14)
desired1 = stats.hmean(a,axis=-1)
assert_almost_equal(actual, desired1, decimal=14) | |
290 | [
-0.006536515895277262,
-0.0683978945016861,
0.031617894768714905,
-0.000054544900194741786,
0.011175957508385181,
-0.016789747402071953,
-0.03608311712741852,
-0.029217515140771866,
0.05760909616947174,
0.07417945563793182,
0.03156627342104912,
0.01217611599713564,
-0.0013090776046738029,
... | 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_1D_list(self):
a = (1,2,3,4)
actual= stats.hmean(a)
desired = 4. / (1./1 + 1./2 + 1./3 + 1./4)
assert_almost_equal(actual, desired, decimal=14)
desired1 = stats.hmean(array(a),axis=-1)
assert_almost_equal(actual, desired1, decimal=14) | |
291 | [
0.006149081513285637,
-0.06642451882362366,
0.024632425978779793,
-0.00047231203643605113,
0.020216157659888268,
-0.013321003876626492,
-0.011816825717687607,
-0.06820546835660934,
0.032754987478256226,
0.06748346239328384,
0.020685462281107903,
-0.008976937271654606,
0.013561672531068325,
... | 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_2D_array_dim1(self):
a = array(((1,2,3,4),
(1,2,3,4),
(1,2,3,4)))
v = 4. / (1./1 + 1./2 + 1./3 + 1./4)
desired1 = array((v,v,v))
actual1 = stats.hmean(a, axis=1)
assert_array_almost_equal(actual1, desired1, decimal=14) | |
292 | [
-0.00964361522346735,
-0.06176750734448433,
0.02483760006725788,
0.015490246005356312,
0.017050152644515038,
-0.00013159830996301025,
-0.014426122419536114,
-0.06945821642875671,
0.047232553362846375,
0.058478400111198425,
0.012455076910555363,
-0.009165968745946884,
0.02237076871097088,
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 test_2D_array_default(self):
a = array(((1,2,3,4),
(1,2,3,4),
(1,2,3,4)))
actual = stats.hmean(a)
desired = array((1.,2.,3.,4.))
assert_array_almost_equal(actual, desired, decimal=14)
actual1 = stats.hmean(a,axis=0)
assert_array_... | |
293 | [
0.017333487048745155,
-0.0542450025677681,
0.025665313005447388,
-0.006116664502769709,
0.012198074720799923,
-0.0029834164306521416,
-0.016792917624115944,
-0.0481342114508152,
0.025312766432762146,
0.04127132520079613,
0.025336269289255142,
-0.014360353350639343,
0.026887470856308937,
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_2D(self):
x = array([[1, 1, 1],
[1, 1, 1],
[4, 4, 3],
[1, 1, 1],
[1, 1, 1]])
assert_array_equal(stats.scoreatpercentile(x,50),
[1,1,1]) | |
294 | [
0.002464419463649392,
-0.04440353438258171,
0.04986894503235817,
-0.01434377208352089,
0.022999294102191925,
0.016185123473405838,
-0.01488327607512474,
0.01223266962915659,
0.020020293071866035,
0.026811009272933006,
-0.026107307523489,
-0.01726413145661354,
0.009265396744012833,
0.015985... | 9 | {"_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 TestPercentile(TestCase):
def setUp(self):
self.a1 = [3,4,5,10,-3,-5,6]
self.a2 = [3,-6,-2,8,7,4,2,1]
self.a3 = [3.,4,5,10,-3,-5,-6,7.0]
def test_percentile(self):
x = arange(8) * 0.5
assert_equal(stats.scoreatpercentile(x, 0), 0.)
assert_equal(stats.scorea... | |
295 | [
0.013501512818038464,
-0.046053942292928696,
0.01112319715321064,
-0.020307153463363647,
-0.0031116290483623743,
0.011293948628008366,
-0.03695536032319069,
-0.0058970022946596146,
0.028125101700425148,
0.055128127336502075,
-0.004393784794956446,
-0.020465707406401634,
0.007714278995990753,... | 9 | {"_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 TestThreshold(TestCase):
def test_basic(self):
a = [-1,2,3,4,5,-1,-2]
assert_array_equal(stats.threshold(a),a)
assert_array_equal(stats.threshold(a,3,None,0),
[0,0,3,4,5,0,0])
assert_array_equal(stats.threshold(a,None,3,0),
... | |
296 | [
0.014898602850735188,
-0.06562742590904236,
0.01557302474975586,
-0.021520202979445457,
-0.017142590135335922,
-0.0033169316593557596,
-0.03737526014447212,
-0.02031850628554821,
0.04421757906675339,
0.06273353844881058,
0.03227417543530464,
-0.022893572226166725,
0.011152492836117744,
0.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_basic(self):
a = [-1,2,3,4,5,-1,-2]
assert_array_equal(stats.threshold(a),a)
assert_array_equal(stats.threshold(a,3,None,0),
[0,0,3,4,5,0,0])
assert_array_equal(stats.threshold(a,None,3,0),
[-1,2,3,0,0,-1,-2])
assert_... | |
297 | [
0.029872016981244087,
-0.05158175155520439,
0.02061096765100956,
-0.014948083087801933,
-0.0023922366090118885,
-0.021770108491182327,
-0.005979836918413639,
-0.048804644495248795,
0.03127264603972435,
0.03530548885464668,
0.015201644971966743,
-0.0034019567538052797,
0.010951463133096695,
... | 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 test_onesample(self):
t, p = stats.ttest_1samp(self.X1, 0)
assert_array_almost_equal(t, self.T1_0)
assert_array_almost_equal(p, self.P1_0)
t, p = stats.ttest_1samp(self.X2, 0)
assert_array_almost_equal(t, self.T2_0)
assert_array_almost_equal(p, self.P2_0)
... | |
298 | [
0.008552363142371178,
-0.04486791044473648,
0.01945517212152481,
-0.022957568988204002,
-0.009954485110938549,
-0.016988368704915047,
0.0010246837045997381,
-0.0373045951128006,
0.0211540088057518,
0.038537997752428055,
0.008622178807854652,
-0.0021540902089327574,
-0.00777276000007987,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "UnaryOp", "_fields": {"op": {"_type": "USub", "_fields": {}}, "op... | class TestStudentTest(TestCase):
X1 = np.array([-1, 0, 1])
X2 = np.array([0, 1, 2])
T1_0 = 0
P1_0 = 1
T1_1 = -1.732051
P1_1 = 0.2254033
T1_2 = -3.464102
P1_2 = 0.0741799
T2_0 = 1.732051
P2_0 = 0.2254033
def test_onesample(self):
t, p = stats.ttest_1samp(self.X1, 0)
... | |
299 | [
0.023017313331365585,
-0.004877384286373854,
0.05144737288355827,
0.0017358233453705907,
0.03024306707084179,
0.008940229192376137,
-0.008585509844124317,
-0.0018836228409782052,
0.02701118402183056,
0.03975478932261467,
-0.0068381913006305695,
-0.012336334213614464,
-0.01576528325676918,
... | 12 | {"_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": "Attribute", "_fields"... | def test_percentileofscore():
pcos = stats.percentileofscore
assert_equal(pcos([1,2,3,4,5,6,7,8,9,10],4), 40.0)
for (kind, result) in [('mean', 35.0),
('strict', 30.0),
('weak', 40.0)]:
yield assert_equal, pcos(np.arange(10) + 1,
... | |
300 | [
0.021917831152677536,
-0.03412415087223053,
0.054569438099861145,
-0.011628255248069763,
0.00811726413667202,
-0.006778585258871317,
-0.028063585981726646,
-0.02340254746377468,
0.025994718074798584,
0.019130943343043327,
0.033637359738349915,
-0.016307547688484192,
-0.014530755579471588,
... | 9 | {"_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_scoreatpercentile():
assert_equal(stats.scoreatpercentile(range(10), 50), 4.5)
assert_equal(stats.scoreatpercentile(range(10), 50, (2,7)), 4.5)
assert_equal(stats.scoreatpercentile(range(100), 50, (1,8)), 4.5)
assert_equal(stats.scoreatpercentile(np.array([1, 10 ,100]),
... |