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,801 | [
0.02676800824701786,
-0.03420911729335785,
-0.04801761358976364,
0.01659267023205757,
0.005006516817957163,
-0.02515743300318718,
0.014582572504878044,
-0.011323966085910797,
0.0013725783210247755,
-0.0037299173418432474,
0.026343517005443573,
0.008152756839990616,
-0.01140511967241764,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "question", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def slack_question_msg(question):
return {
"title": question.title,
"author_name": "@{}".format(question.user.username),
"author_link": "{}/@{}".format(settings.BASE_URL, question.user.username),
"color": "#f78250",
"title_link": "{}{}".format(settings.BASE_URL, question.get_... | |
19,802 | [
0.006349403411149979,
-0.00017868175928015262,
-0.018533997237682343,
-0.06738416105508804,
0.03125515952706337,
0.026984963566064835,
-0.04509417712688446,
0.0007643317803740501,
0.019025852903723717,
0.026984963566064835,
-0.012039273045957088,
0.0191488154232502,
0.020266668871045113,
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}}, {"_type": "arg", "_fields": {"arg": "device_type", "annotat... | class WrappedGraphTest(test.TestCase, parameterized.TestCase):
@parameterized.named_parameters(
('cpu_reduce', 'CPU', _dataset_reduce_sum),
('gpu_reduce', 'GPU', _dataset_reduce_sum),
('cpu_loop', 'CPU', _loop_dataset_sum),
('gpu_loop', 'GPU', _loop_dataset_sum),
('cpu_iter', 'CPU', _it... | |
19,803 | [
0.011839347891509533,
0.0084153413772583,
-0.02234043926000595,
0.028959382325410843,
-0.0048767984844744205,
-0.004717051982879639,
0.01199005264788866,
0.046561673283576965,
0.0051118978299200535,
0.01435912773013115,
0.01239394024014473,
0.006890211254358292,
0.0012169390683993697,
0.02... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "question", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "channel", "annotation": null, "type_comment": null}}], "kwarg... | def slack_question(question, channel):
if settings.SLACK_TOKEN:
sc = SlackClient(settings.SLACK_TOKEN)
sc.api_call(
"chat.postMessage",
channel=channel,
attachments=[slack_question_msg(question)]
) | |
19,804 | [
0.015322946943342686,
-0.04502376541495323,
-0.008118082769215107,
-0.011680694296956062,
-0.01065066922456026,
-0.03725079447031021,
-0.015535322949290276,
0.024699358269572258,
0.026504557579755783,
0.011415223591029644,
-0.021099582314491272,
-0.0032095361966639757,
-0.06039980798959732,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "inputString", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def convertToPigLatin(inputString):
# inputString = [[j for j in i] for i in inputString.split(" ") ]
# print(inputString)
# seperate into words
inputString = inputString.split(" ")
# Move initial consonants to end
for index, word in enumerate(inputString):
for i in word:
i... | |
19,805 | [
0.0030331930611282587,
0.005335119087249041,
-0.033666737377643585,
-0.06728794425725937,
0.032665155827999115,
0.03485042229294777,
-0.046937666833400726,
-0.006658229045569897,
0.027634495869278908,
0.021283568814396858,
-0.035055290907621384,
0.007352505810558796,
0.03699016198515892,
-... | 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": "device_type", "annotation": null, "type_comment": null}}, {"_type... | def testWrapFuncDatasetDevice(self, device_type, dataset_reduce_fn):
devices = config.list_logical_devices(device_type=device_type)
if not devices:
self.skipTest('Skip when {} is not detected by TF'.format(device_type))
@def_function.function
def comp():
return dataset_reduce_fn(dataset_op... | |
19,806 | [
0.0028889270033687353,
-0.010725674219429493,
0.043232355266809464,
-0.04959005489945412,
0.026137208566069603,
0.02893930673599243,
-0.018884722143411636,
-0.02208711951971054,
-0.003967675380408764,
0.01570587232708931,
0.025972379371523857,
-0.009565982967615128,
0.007888256572186947,
-... | 7 | {"_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": "fetch_toc", "annotation": null, "type_comment": null}}], "kwarg":... | def test_nav_sections(self, fetch_toc):
fetch_toc.return_value = [
{'index': ['204', '1'], 'title': '§ 204.1 First'},
{'index': ['204', '3'], 'title': '§ 204.3 Third'}]
nav = navigation.nav_sections('204-1', 'ver')
p, n = nav
self.assertEquals(None, p)
sel... | |
19,807 | [
-0.006278366316109896,
-0.0001464186207158491,
0.04251360148191452,
-0.042900554835796356,
0.012743760831654072,
0.05855938792228699,
-0.03394896537065506,
-0.050510697066783905,
0.02372042089700699,
0.020095931366086006,
0.027009550482034683,
-0.015774918720126152,
-0.02125680074095726,
0... | 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 NavigationTest(TestCase):
def test_get_labels(self):
label = '204-1-a'
self.assertEquals(
['204', '1', 'a'], navigation.get_labels(label))
def test_is_last(self):
l = [1, 2, 3]
self.assertFalse(navigation.is_last(1, l))
self.assertTrue(navigation.is_las... | |
19,808 | [
0.014476444572210312,
0.0005657639703713357,
0.040690548717975616,
-0.03872241452336311,
0.010048146359622478,
0.020333416759967804,
-0.017227087169885635,
-0.03300771489739418,
0.013041841797530651,
0.007700615096837282,
0.0024438633117824793,
-0.019645756110548973,
0.012449030764400959,
... | 7 | {"_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": "fetch_toc", "annotation": null, "type_comment": null}}], "kwarg":... | def test_nav_sections_appendix(self, fetch_toc):
fetch_toc.return_value = [
{'index': ['204', '1'], 'title': u'§ 204.1 First'},
{'index': ['204', 'A'],
'title': 'Appendix A to Part 204 - Model Forms'}]
nav = navigation.nav_sections('204-1', 'ver')
p, n = nav
... | |
19,809 | [
0.0008953397627919912,
-0.015627747401595116,
0.04300042614340782,
-0.031834300607442856,
0.001835898612625897,
0.048040855675935745,
-0.008682082407176495,
-0.0032557807862758636,
0.01969144493341446,
0.017062703147530556,
-0.006276422180235386,
0.0007777698920108378,
0.02004113979637623,
... | 7 | {"_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": "su", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def test_nav_sections_prefix(self, su, fetch_toc):
fetch_toc.return_value = [
{'index': ['204', '1'], 'title': '§ 204.1 First',
'is_section': True},
{'index': ['204', 'A'], 'title': 'Appendix A'},
{'index': ['204', 'Subpart', 'Interp'],
'title': 'Reg... | |
19,810 | [
-0.007797603029757738,
0.007038712035864592,
0.049024347215890884,
-0.044875744730234146,
0.012388892471790314,
0.038855209946632385,
-0.013900349847972393,
-0.04386388882994652,
0.024853674694895744,
0.0169106163084507,
0.006245038937777281,
-0.030102668330073357,
0.024271856993436813,
0.... | 7 | {"_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": "fetch_toc", "annotation": null, "type_comment": null}}], "kwarg":... | def test_nav_sections_subparts(self, fetch_toc):
fetch_toc.return_value = [
{'index': ['204', '1'], 'title': u'§ 204.1 First'},
{'index': ['204', '2'], 'title': u'§ 204.2 Second'},
{'index': ['204', '3'], 'title': u'§ 204.3 Third'},
{'index': ['204', 'A'], 'title'... | |
19,811 | [
0.029486749321222305,
0.027919206768274307,
0.03647714480757713,
0.015791933983564377,
0.0010147985303774476,
-0.0028226361609995365,
-0.012275554239749908,
0.013694816268980503,
-0.0473652109503746,
0.0044060661457479,
0.00553935719653964,
-0.01847158372402191,
0.03783285617828369,
-0.041... | 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": "alias", "annotation": null, "type_comment": null}}, {"_type": "ar... | def __init__(self, alias, target_type, *args, **kwargs):
super(TargetAddressable, self).__init__(alias, target_type)
if 'name' not in kwargs:
raise Addressable.AddressableInitError(
'name is a required parameter to all Targets specified within a BUILD file.'
' Target type was: {target_ty... | |
19,812 | [
0.008065558969974518,
0.011802577413618565,
-0.023159775882959366,
-0.03972235321998596,
-0.0057760258205235004,
0.03048071451485157,
-0.02104421891272068,
0.009095501154661179,
0.01997252181172371,
-0.06803184002637863,
0.04899183288216591,
-0.03757896274328232,
0.003688305616378784,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_cache_instruments(dummy_instruments, loop):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments,
loop=loop)
await hw_api.cache_instruments()
attached = hw_api.attached_instruments
typeguard.check_type(
'left mount dict', attached[... | |
19,813 | [
-0.00377393770031631,
0.007225743494927883,
-0.018361497670412064,
0.0056983958929777145,
-0.010935810394585133,
-0.019316785037517548,
-0.008058842271566391,
0.019072407856583595,
-0.024926315993070602,
-0.029880477115511894,
0.010924702510237694,
-0.014440379105508327,
0.04843081161379814,... | 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": "build_graph", "annotation": null, "type_comment": null}}, {"_type... | def instantiate(self, build_graph, address):
# TODO(John Sirois): BuildGraph assumes it creates TargetAddressables and not general
# Addressables today, so we expose exactly the instantiate it expects. This may need to be
# fixed up when BuildGraph learns how to deal with other Addressables.
type_alias... | |
19,814 | [
0.009627651423215866,
0.0035288208164274693,
0.008395364508032799,
-0.05514318123459816,
0.0016713299555703998,
0.02931128814816475,
-0.01339040882885456,
-0.011940659955143929,
0.03993399441242218,
-0.04755176603794098,
0.024672092869877815,
-0.046813711524009705,
-0.01738380827009678,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_mismatch_fails(dummy_instruments, loop):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments,
loop=loop)
requested_instr = {
types.Mount.LEFT: 'p20_single_gen2', types.Mount.RIGHT: 'p300_single'}
with pytest.raises(RuntimeError):
... | |
19,815 | [
0.06381439417600632,
-0.025866921991109848,
0.01986859180033207,
-0.04155486077070236,
-0.010032170452177525,
0.03587811812758446,
-0.02614656463265419,
-0.007934852503240108,
0.03280205279588699,
-0.046420637518167496,
0.03403247892856598,
-0.0470917783677578,
-0.021770160645246506,
-0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_backwards_compatibility", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_co... | async def test_backwards_compatibility(dummy_backwards_compatibility, loop):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_backwards_compatibility,
loop=loop)
requested_instr = {
types.Mount.LEFT: 'p10_single',
types.Mount.RIGHT: 'p300_single'}
vo... | |
19,816 | [
0.014868440106511116,
-0.0069334120489656925,
-0.024498797953128815,
-0.05638729780912399,
-0.0009431888465769589,
0.015187473967671394,
-0.010053262114524841,
-0.00375420693308115,
0.04101433977484703,
-0.04531758278608322,
0.05472535640001297,
-0.048018235713243484,
0.004625984467566013,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null... | async def test_cache_instruments_sim(loop, dummy_instruments):
def fake_func1(value):
return value
def fake_func2(mount, value):
return mount, value
sim = await hc.API.build_hardware_simulator(loop=loop)
# With nothing specified at init or expected, we should have nothing
# afterw... | |
19,817 | [
0.012930656783282757,
-0.002545404713600874,
-0.008363473229110241,
-0.04215190187096596,
0.001869054394774139,
0.007039862219244242,
0.0010617973748594522,
0.016712401062250137,
0.010756153613328934,
-0.05268260836601257,
0.060275185853242874,
-0.03403569757938385,
-0.00992707908153534,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment... | async def test_cache_instruments_hc(monkeypatch, dummy_instruments,
hardware_controller_lockfile,
running_on_pi, cntrlr_mock_connect, loop):
hw_api_cntrlr = await hc.API.build_hardware_controller(loop=loop)
def mock_driver_model(mount):
... | |
19,818 | [
0.004726640414446592,
-0.0028900951147079468,
-0.0009016988915391266,
-0.046126849949359894,
-0.0015274680918082595,
0.007037999574095011,
-0.02577255293726921,
0.03159216046333313,
0.015638407319784164,
-0.033598922193050385,
0.04515213519334793,
-0.05710670351982117,
0.0018956729909405112,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_prep_aspirate(dummy_instruments, loop):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments, loop=loop)
await hw_api.home()
await hw_api.cache_instruments()
mount = types.Mount.LEFT
await hw_api.pick_up_tip(mount, 20.0)
# If we're empty... | |
19,819 | [
-0.013906923122704029,
-0.004224842414259911,
-0.016422312706708908,
-0.027683740481734276,
-0.01880759559571743,
0.021641023457050323,
-0.0356491394340992,
0.029071541503071785,
0.03446372598409653,
-0.03796214237809181,
0.039725806564092636,
-0.05944414436817169,
-0.008688213303685188,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_aspirate_new(dummy_instruments, loop):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments, loop=loop)
await hw_api.home()
await hw_api.cache_instruments()
mount = types.Mount.LEFT
await hw_api.pick_up_tip(mount, 20.0)
aspirate_ul = 3.0... | |
19,820 | [
-0.0004896966856904328,
-0.005874557886272669,
-0.016809163615107536,
-0.029552990570664406,
0.00705307349562645,
0.02305133268237114,
-0.025992216542363167,
0.027275247499346733,
0.030763942748308182,
-0.05406034737825394,
0.04826508089900017,
-0.04379609227180481,
-0.02152322605252266,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_dispense(dummy_instruments, loop):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments, loop=loop)
await hw_api.home()
await hw_api.cache_instruments()
mount = types.Mount.LEFT
await hw_api.pick_up_tip(mount, 20.0)
aspirate_ul = 10.0
... | |
19,821 | [
-0.004690319765359163,
-0.009241395629942417,
-0.008486547507345676,
-0.031454458832740784,
-0.016592007130384445,
0.02639770694077015,
-0.036555178463459015,
0.024301718920469284,
0.026896052062511444,
-0.041831791400909424,
0.03802090510725975,
-0.06759923696517944,
0.0031219942029565573,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_aspirate_old(dummy_instruments, loop, old_aspiration):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments, loop=loop)
await hw_api.home()
await hw_api.cache_instruments()
mount = types.Mount.LEFT
await hw_api.pick_up_tip(mount, 20.0)
a... | |
19,822 | [
0.01329801231622696,
-0.016833817586302757,
-0.022243179380893707,
-0.03220260143280029,
-0.03200538456439972,
0.012854275293648243,
-0.038316305726766586,
0.02368004061281681,
0.009635424241423607,
-0.03147008270025253,
0.03935873508453369,
-0.043866533786058426,
0.0033861331176012754,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_pick_up_tip(dummy_instruments, loop, is_robot):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments, loop=loop)
mount = types.Mount.LEFT
await hw_api.home()
await hw_api.cache_instruments()
tip_position = types.Point(12.13, 9, 150)
target... | |
19,823 | [
0.0037143235094845295,
-0.017765937373042107,
-0.030643168836832047,
-0.03520413860678673,
-0.007121396251022816,
-0.0002579628489911556,
-0.02968727797269821,
0.03520413860678673,
0.01950019784271717,
-0.043015144765377045,
0.03542263060808182,
-0.042796652764081955,
-0.004912602715194225,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_no_pipette(dummy_instruments, loop):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments, loop=loop)
await hw_api.cache_instruments()
aspirate_ul = 3.0
aspirate_rate = 2
with pytest.raises(types.PipetteNotAttachedError):
await hw_api.... | |
19,824 | [
-0.00945251900702715,
-0.014806742779910564,
-0.0016451936680823565,
-0.03898521140217781,
-0.0016497840406373143,
0.013080758042633533,
-0.026837220415472984,
0.029540039598941803,
0.030112918466329575,
-0.02560332603752613,
0.03619426116347313,
-0.03261008858680725,
-0.024736661463975906,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_aspirate_flow_rate(dummy_instruments, loop, monkeypatch):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments, loop=loop)
mount = types.Mount.LEFT
await hw_api.home()
await hw_api.cache_instruments()
await hw_api.pick_up_tip(mount, 20.0)
... | |
19,825 | [
0.00036665721563622355,
-0.013723781332373619,
-0.008918270468711853,
-0.03307708352804184,
0.008451574482023716,
0.009137033484876156,
-0.014241522178053856,
0.033514611423015594,
0.03864826634526253,
-0.04319855570793152,
0.04512367397546768,
-0.026047473773360252,
-0.032931242138147354,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_dispense_flow_rate(dummy_instruments, loop, monkeypatch):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments, loop=loop)
mount = types.Mount.LEFT
await hw_api.home()
await hw_api.cache_instruments()
await hw_api.pick_up_tip(mount, 20.0)
... | |
19,826 | [
0.012137698009610176,
-0.012053797021508217,
-0.01306760311126709,
-0.04667700082063675,
-0.007418259046971798,
0.007760855369269848,
-0.03165869787335396,
0.02476482093334198,
0.0190036091953516,
-0.0352664478123188,
0.057891786098480225,
-0.04779568314552307,
-0.027813227847218513,
0.005... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_reset_instruments(dummy_instruments, loop, monkeypatch):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments, loop=loop)
hw_api.set_flow_rate(types.Mount.LEFT, 20)
# gut check
assert hw_api.attached_instruments[types.Mount.LEFT]['aspirate_flow_ra... | |
19,827 | [
0.01067653764039278,
-0.0041761454194784164,
-0.0056231762282550335,
-0.024951906874775887,
-0.0008636261336505413,
0.003040263894945383,
-0.019223764538764954,
0.020078487694263458,
0.03745784983038902,
-0.03511860966682434,
0.044775478541851044,
-0.020528342574834824,
-0.03682805597782135,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "AsyncFunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "dummy_instruments", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "loop", "annotation": null, "type_comment": null... | async def test_blowout_flow_rate(dummy_instruments, loop, monkeypatch):
hw_api = await hc.API.build_hardware_simulator(
attached_instruments=dummy_instruments, loop=loop)
mount = types.Mount.LEFT
await hw_api.home()
await hw_api.cache_instruments()
await hw_api.pick_up_tip(mount, 20.0)
... | |
19,828 | [
0.018653294071555138,
-0.0316421277821064,
0.014410136267542839,
-0.04967295378446579,
-0.03307380527257919,
0.002549525583162904,
0.0069612679071724415,
-0.061541344970464706,
-0.0003566223313100636,
0.06564963608980179,
-0.00519242137670517,
0.0027232978027313948,
0.04456871375441551,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "arg_namespace", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "conf", "annotation": {"_type": "Subscript", "_fields": {... | def load_config_from_args( # noqa: C901
arg_namespace, conf: Optional[Dict[str, Any]] = None
) -> Dict[str, Any]:
if not conf:
conf = {}
for name in str_settings:
arg = getattr(arg_namespace, name, None)
if arg is not None:
conf[name] = arg
if arg_namespace and arg... | |
19,829 | [
0.015384283848106861,
-0.004398977383971214,
0.008468907326459885,
-0.0184913482517004,
-0.000060684847994707525,
0.012061450630426407,
0.052474863827228546,
-0.021145299077033997,
0.027963578701019287,
0.029301341623067856,
-0.0076597766019403934,
-0.020551934838294983,
0.06589565426111221,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "conf", "annotation": {"_type": "Subscript", "_fields": {"ctx"... | def load_config_from_file( # noqa: C901
filename, conf: Optional[Dict[str, Any]] = None
) -> Dict[str, Any]:
if not conf:
conf = {}
filename = os.path.expanduser(filename)
if not os.path.exists(filename):
return conf
config = configparser.RawConfigParser()
config.read(filename... | |
19,830 | [
0.01673445664346218,
0.0035454356111586094,
0.015196282416582108,
-0.036021627485752106,
-0.01157448347657919,
0.023105330765247345,
0.017825359478592873,
-0.03488708660006523,
-0.001604991382919252,
0.008590863086283207,
0.015763552859425545,
-0.02733803540468216,
0.03713434562087059,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "arg_namespace", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Attribute", "_fields": {"ct... | def load_config( # noqa: C901
arg_namespace: Optional[argparse.Namespace] = None,
config_file_names: Optional[List[str]] = None,
) -> Dict[str, Any]:
conf: Dict[str, Any] = {}
if config_file_names:
for file_name in config_file_names:
conf = load_config_from_file(file_name, conf)
... | |
19,831 | [
0.039329107850790024,
-0.007764854934066534,
0.0061974599957466125,
0.01921260729432106,
-0.028040019795298576,
0.006240731570869684,
-0.0045050582848489285,
-0.01816447079181671,
0.033213384449481964,
0.09839008748531342,
0.01714518293738365,
0.013125729747116566,
0.06592673808336258,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cmd", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def find_command(cmd, path=None, pathext=None):
if path is None:
path = os.environ.get('PATH', '').split(os.pathsep)
if isinstance(path, six.string_types):
path = [path]
# check if there are funny path extensions for executables, e.g. Windows
if pathext is None:
pathext = os.envi... | |
19,832 | [
-0.0025351066142320633,
-0.005964634008705616,
0.049516886472702026,
-0.08380118757486343,
0.008000400848686695,
0.009701446630060673,
-0.007874194532632828,
-0.04383210092782974,
-0.0039947135373950005,
0.05065823346376419,
0.003810890717431903,
0.010892178863286972,
0.03972764313220978,
... | 14 | {"_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 which_cmdfile():
locations = [
# rhel
'/etc/nagios/nagios.cfg',
# debian
'/etc/nagios3/nagios.cfg',
# older debian
'/etc/nagios2/nagios.cfg',
# bsd, solaris
'/usr/local/etc/nagios/nagios.cfg',
# groundwork it monitoring
'/usr/local/... | |
19,833 | [
-0.014654792845249176,
0.03903258964419365,
0.008686274290084839,
-0.05112191662192345,
-0.03465138003230095,
0.05885346233844757,
0.027856992557644844,
-0.033597078174352646,
0.020605741068720818,
0.03631483390927315,
0.013436488807201385,
-0.05529226362705231,
-0.008908849209547043,
0.01... | 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": "List", "_fields": {"c... | def main():
ACTION_CHOICES = [
'downtime',
'delete_downtime',
'silence',
'unsilence',
'enable_alerts',
'disable_alerts',
'silence_nagios',
'unsilence_nagios',
'command',
'servicegroup_host_downtime',
'servicegroup_service_downti... | |
19,834 | [
0.020193060860037804,
0.028041020035743713,
0.02120712213218212,
-0.027269450947642326,
0.009617055766284466,
0.00841010082513094,
-0.0165666863322258,
0.030267545953392982,
0.011882161721587181,
0.06600221246480942,
0.012918268330395222,
-0.06582584977149963,
-0.00340317003428936,
-0.0420... | 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": "module", "annotation": null, "type_comment": null}}], "kwarg": {"... | def __init__(self, module, **kwargs):
self.module = module
self.action = kwargs['action']
self.author = kwargs['author']
self.comment = kwargs['comment']
self.host = kwargs['host']
self.servicegroup = kwargs['servicegroup']
self.minutes = int(kwargs['minutes'])
... | |
19,835 | [
-0.013025857508182526,
0.00004180608448223211,
-0.002250704215839505,
-0.0022967581171542406,
0.01676960289478302,
-0.06912261247634888,
-0.030853215605020523,
-0.008777002803981304,
0.0517706498503685,
0.021666184067726135,
0.02116701751947403,
-0.03408591076731682,
0.0026518197264522314,
... | 13 | {"_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 resource(request):
route_args = request.environ.get('wsgiorg.routing_args')
if route_args:
args = route_args[1].copy()
else:
args = {}
# NOTE(jkoelker) by now the controller is already found, remove
# it from the args if it is in the ma... | |
19,836 | [
0.010344156995415688,
0.02709350921213627,
0.053251951932907104,
0.011542209424078465,
0.02193896286189556,
0.007538961712270975,
0.025831172242760658,
-0.013792209327220917,
-0.01913376897573471,
0.08467014133930206,
0.0031938315369188786,
-0.06610909849405289,
0.03377922251820564,
-0.058... | 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": "missing_roles", "annotation": null, "type_comment": null}}], "kwa... | def __init__(self, missing_roles):
self.missing_roles = missing_roles
missing = ["'{}'".format(role) for role in missing_roles]
if len(missing) > 2:
fmt = '{}, or {}'.format(", ".join(missing[:-1]), missing[-1])
else:
fmt = ' or '.join(missing)
message ... | |
19,837 | [
-0.0028114530723541975,
0.02366293966770172,
0.044344350695610046,
0.007495236117392778,
0.016611384227871895,
-0.007832433097064495,
0.01664687879383564,
0.005729389376938343,
-0.022527119144797325,
0.09337396174669266,
-0.001194239011965692,
-0.06885915249586105,
0.023793086409568787,
-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": "missing_roles", "annotation": null, "type_comment": null}}], "kwa... | def __init__(self, missing_roles):
self.missing_roles = missing_roles
missing = ["'{}'".format(role) for role in missing_roles]
if len(missing) > 2:
fmt = '{}, or {}'.format(", ".join(missing[:-1]), missing[-1])
else:
fmt = ' or '.join(missing)
message ... | |
19,838 | [
0.025502488017082214,
0.05733337253332138,
0.05449976399540901,
0.026234503835439682,
0.03164197504520416,
0.02057909220457077,
-0.01264498382806778,
-0.0018536531133577228,
-0.01979984901845455,
0.06011975556612015,
0.013813847675919533,
-0.04526691511273384,
0.0541219487786293,
-0.047864... | 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": "missing_perms", "annotation": null, "type_comment": null}}], "kwa... | def __init__(self, missing_perms, *args):
self.missing_perms = missing_perms
missing = [perm.replace('_', ' ').replace('guild', 'server').title() for perm in missing_perms]
if len(missing) > 2:
fmt = '{}, and {}'.format(", ".join(missing[:-1]), missing[-1])
else:
... | |
19,839 | [
0.011805635876953602,
0.05611884966492653,
0.04611651599407196,
0.027169793844223022,
0.024645166471600533,
0.004114540759474039,
-0.0172155499458313,
0.015111695043742657,
-0.026688912883400917,
0.06693867594003677,
0.009130734018981457,
-0.046693574637174606,
0.038254108279943466,
-0.035... | 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": "missing_perms", "annotation": null, "type_comment": null}}], "kwa... | def __init__(self, missing_perms, *args):
self.missing_perms = missing_perms
missing = [perm.replace('_', ' ').replace('guild', 'server').title() for perm in missing_perms]
if len(missing) > 2:
fmt = '{}, and {}'.format(", ".join(missing[:-1]), missing[-1])
else:
... | |
19,840 | [
0.05148068815469742,
-0.002226293319836259,
-0.012420090846717358,
0.006874450482428074,
0.009065915830433369,
-0.039135608822107315,
-0.02490447834134102,
0.005317920818924904,
0.04757998511195183,
0.01145563181489706,
-0.01441330648958683,
-0.02068229205906391,
-0.01236650999635458,
-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": "param", "annotation": null, "type_comment": null}}, {"_type": "ar... | def __init__(self, param, converters, errors):
self.param = param
self.converters = converters
self.errors = errors
def _get_name(x):
try:
return x.__name__
except AttributeError:
return x.__class__.__name__
to_string = [_... | |
19,841 | [
-0.009210054762661457,
-0.006790040526539087,
-0.011200066655874252,
-0.009305055253207684,
-0.01217007264494896,
0.0016812599496915936,
-0.03752022236585617,
0.03158018738031387,
-0.019780118018388748,
0.04864028841257095,
0.015360090881586075,
-0.04988029599189758,
0.018920112401247025,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "array", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": null, "type_comment": null}}, {"_type": "a... | def _quicksort(array, start, stop):
if stop - start > 0:
pivot, left, right = array[start], start, stop
while left <= right:
while array[left] < pivot:
left += 1
while array[right] > pivot:
right -= 1
if left <= right:
... | |
19,842 | [
-0.012237857095897198,
-0.0153593048453331,
-0.0030880721751600504,
-0.007673295214772224,
0.007870372384786606,
-0.02396712824702263,
-0.006910415831953287,
0.03715222701430321,
0.016185758635401726,
0.015117727220058441,
0.059809744358062744,
-0.004262588452547789,
-0.0522826686501503,
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}}, {"_type": "arg", "_fields": {"arg": "values", "annotation":... | class AuthorizeForm(AuthorizeCommon):
def _authorize_generate_hashing(self, values):
data = '^'.join([
values['x_login'],
values['x_fp_sequence'],
values['x_fp_timestamp'],
values['x_amount'],
]) + '^'
return hmac.new(str(values['x_trans_key']... | |
19,843 | [
0.02519974112510681,
-0.05856245756149292,
0.04558424651622772,
-0.0009680633083917201,
-0.008873794227838516,
-0.04152568802237511,
0.025543687865138054,
0.03914099931716919,
-0.008604370057582855,
-0.015259715728461742,
0.03253724426031113,
-0.03957666456699371,
-0.06484519690275192,
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 AuthorizeCommon(PaymentAcquirerCommon):
def setUp(self):
super(AuthorizeCommon, self).setUp()
self.base_url = self.env['ir.config_parameter'].get_param('web.base.url')
# authorize only support USD in test environment
self.currency_usd = self.env['res.currency'].search([('name'... | |
19,844 | [
0.03419601544737816,
-0.0000638500350760296,
0.0684356540441513,
-0.012703558430075645,
0.001665638294070959,
0.006150049157440662,
-0.03764178976416588,
-0.004522575996816158,
0.028569376096129417,
-0.007289552595466375,
0.03585347905755043,
0.025276266038417816,
-0.04758654907345772,
-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": "values", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _authorize_generate_hashing(self, values):
data = '^'.join([
values['x_login'],
values['x_fp_sequence'],
values['x_fp_timestamp'],
values['x_amount'],
]) + '^'
return hmac.new(str(values['x_trans_key']), data, hashlib.md5).hexdigest() | |
19,845 | [
0.008615938015282154,
-0.013549447059631348,
-0.01157840434461832,
0.0009619163465686142,
-0.002741166390478611,
-0.0394916832447052,
-0.0016420442843809724,
0.032716959714889526,
0.009223774075508118,
0.015272635035216808,
0.0367770716547966,
-0.014493660070002079,
-0.0633094385266304,
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_10_Authorize_form_render(self):
authorize = self.env['payment.acquirer'].browse(self.authorize_id)
self.assertEqual(authorize.environment, 'test', 'test without test environment')
# ----------------------------------------
# Test: button direct rendering
# -------------... | |
19,846 | [
-0.012371131218969822,
-0.018529178574681282,
-0.017538508400321007,
-0.01323337946087122,
0.0006959907477721572,
-0.0115516884252429,
-0.008891559205949306,
0.03390289098024368,
0.017587430775165558,
0.031383413821458817,
0.07563328742980957,
0.005023669917136431,
-0.03683820739388466,
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_20_authorize_form_management(self):
cr, uid, context = self.env.cr, self.env.uid, {}
# be sure not to do stupid thing
authorize = self.env['payment.acquirer'].browse(self.authorize_id)
self.assertEqual(authorize.environment, 'test', 'test without test environment')
# ty... | |
19,847 | [
0.03414039686322212,
0.030976904556155205,
0.049198612570762634,
-0.055120669305324554,
-0.03641811013221741,
0.040897611528635025,
0.02920535020530224,
0.02263794280588627,
-0.03677241876721382,
-0.012407212518155575,
0.041429080069065094,
0.011685935780405998,
-0.050818320363759995,
0.03... | 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 upgrade():
load_stored_proc(op, ['001_update_reports_clean.sql', 'update_product_versions.sql'])
op.alter_column(u'update_channel_map', u'update_channel',
type_=citexttype.CitextType())
op.alter_column(u'raw_update_channels', u'update_channel',
type_=citexttype.Ci... | |
19,848 | [
0.026970546692609787,
0.004844568204134703,
0.027449829503893852,
0.024247348308563232,
0.0009388222824782133,
-0.005680589471012354,
-0.044050440192222595,
-0.0005027703009545803,
-0.011459214612841606,
-0.002341949613764882,
0.029998742043972015,
0.04792827367782593,
0.0040956889279186726,... | 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": "data", "annotation": null, "type_comment": null}}], "kwarg": null... | def global_cancel_tcpip_forward(self, data):
host, port = forwarding.unpackGlobal_tcpip_forward(data)
listener = self.listeners.get((host, port), None)
if not listener:
return 0
del self.listeners[(host, port)]
listener.stopListening()
return 1 | |
19,849 | [
0.03575677424669266,
-0.002639525569975376,
0.047300297766923904,
0.034565601497888565,
0.053234491497278214,
-0.0005894940695725381,
-0.017033739015460014,
-0.01978425867855549,
-0.039265312254428864,
0.017802584916353226,
0.006735527887940407,
0.07528197765350342,
0.015940027311444283,
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": "data", "annotation": null, "type_comment": null}}], "kwarg": null... | def global_tcpip_forward(self, data):
host, port = forwarding.unpackGlobal_tcpip_forward(data)
try:
listener = reactor.listenTCP(
port, forwarding.SSHListenForwardingFactory(
self.conn, (host, port),
forwarding.SSHListenServerForw... | |
19,850 | [
0.015657206997275352,
-0.003988859709352255,
0.00852447934448719,
-0.02472844533622265,
0.017111090943217278,
0.055371835827827454,
-0.020105840638279915,
0.033078957349061966,
0.0038211040664464235,
0.05069952458143234,
0.03755244240164757,
-0.022317731752991676,
0.040559619665145874,
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": "proto", "annotation": null, "type_comment": null}}, {"_type": "ar... | def execCommand(self, proto, cmd):
self.cmd = cmd
self.proto = proto
f = cmd.split()[0]
if f == 'false':
t = FalseTransport(proto)
# Avoid disconnecting this immediately. If the channel is closed
# before execCommand even returns the caller get... | |
19,851 | [
0.008879879489541054,
-0.04250398650765419,
0.047800756990909576,
-0.021498655900359154,
0.03175465762615204,
0.03211816027760506,
-0.020966382697224617,
0.008503393270075321,
-0.012768073007464409,
0.005030633416026831,
-0.008321641944348812,
-0.020667789503932,
0.015228214673697948,
0.04... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 0}}, "targets": [{"_type": "Name", "_fields": {"id": "done", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_type"... | class ConchTestBase:
done = 0
def connectionLost(self, reason):
if self.done:
return
if not hasattr(self,'expectedLoseConnection'):
unittest.fail('unexpectedly lost connection %s\n%s' % (self, reason))
self.done = 1
... | |
19,852 | [
0.022581124678254128,
-0.04866162687540054,
0.06537242233753204,
-0.025218337774276733,
0.06369880586862564,
0.010371342301368713,
-0.009287295863032341,
0.01300855353474617,
-0.02672712691128254,
-0.005039863754063845,
0.011182792484760284,
-0.018409766256809235,
0.0059432354755699635,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 0}}, "targets": [{"_type": "Name", "_fields": {"id": "noisy", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_type... | class ConchTestServerFactory(factory.SSHFactory):
noisy = 0
services = {
'ssh-userauth':userauth.SSHUserAuthServer,
'ssh-connection':connection.SSHConnection
}
def buildProtocol(self, addr):
proto = ConchTestServer()
proto.suppo... | |
19,853 | [
0.03371958062052727,
-0.03108084388077259,
0.013182863593101501,
-0.005299100186675787,
0.06038811057806015,
0.01674083061516285,
0.00023927059373818338,
0.008419080637395382,
-0.011993269436061382,
0.028117673471570015,
0.0269064512103796,
0.019336307421326637,
0.013669515028595924,
0.042... | 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": "name", "annotation": n... | class SSHTestChannel(channel.SSHChannel):
def __init__(self, name, opened, *args, **kwargs):
self.name = name
self._opened = opened
self.received = []
self.receivedExt = []
self.onClose = defer.Deferred()
channel.SSHChannel.__init_... | |
19,854 | [
0.03412877768278122,
-0.03493037819862366,
0.06543980538845062,
-0.006012008525431156,
0.03915700316429138,
0.01217583566904068,
-0.0011151061626151204,
0.04746450483798981,
0.021716104820370674,
-0.004202333278954029,
0.0017671661917120218,
-0.021849704906344414,
-0.004293424542993307,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 0}}, "targets": [{"_type": "Name", "_fields": {"id": "hasTriedNone", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, ... | class ConchTestClientAuth(userauth.SSHUserAuthClient):
hasTriedNone = 0 # have we tried the 'none' auth yet?
canSucceedPublicKey = 0 # can we succed with this yet?
canSucceedPassword = 0
def ssh_USERAUTH_SUCCESS(self, packet):
if not self.canSucceedPassword and self.... | |
19,855 | [
0.021955274045467377,
0.007654821965843439,
-0.021643927320837975,
0.022373981773853302,
0.0577600859105587,
0.03605174273252487,
0.006801303941756487,
0.0255948044359684,
-0.008486867882311344,
0.048355285078287125,
-0.0021646611858159304,
-0.013688496313989162,
0.023533476516604424,
0.06... | 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": "reasonCode", "annotation": null, "type_comment": null}}, {"_type"... | def receiveError(self, reasonCode, desc):
self.expectedLoseConnection = 1
# Some versions of OpenSSH (for example, OpenSSH_5.3p1) will
# send a DISCONNECT_BY_APPLICATION error before closing the
# connection. Other, older versions (for example,
# OpenSSH... | |
19,856 | [
0.030405931174755096,
-0.021725153550505638,
0.046560533344745636,
0.013241667300462723,
0.010427377186715603,
0.002090407768264413,
-0.016932157799601555,
0.027597444131970406,
-0.033005520701408386,
0.01260337419807911,
-0.006533793639391661,
0.012905112467706203,
0.011489263735711575,
-... | 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": "addr", "annotation": null, "type_comment": null}}], "kwarg": null... | def buildProtocol(self, addr):
proto = ConchTestServer()
proto.supportedPublicKeys = self.privateKeys.keys()
proto.factory = self
if hasattr(self, 'expectedLoseConnection'):
proto.expectedLoseConnection = self.expectedLoseConnection
s... | |
19,857 | [
0.024567333981394768,
0.0002810811856761575,
-0.029485683888196945,
0.002634611679241061,
-0.0008390482980757952,
0.0777660459280014,
0.0015560532920062542,
0.008506424725055695,
0.015609350055456161,
0.0285581536591053,
0.008585752919316292,
-0.012375200167298317,
0.018184464424848557,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ignored", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def disconnect(ignored):
self.assertEqual(
self.realm.avatar.globalRequests,
{"foo": "bar", "foo_2": "bar2"})
channel = self.channel
channel.conn.transport.expectedLoseConnection = True
channel.conn.serviceStopped()
chann... | |
19,858 | [
0.04644225165247917,
-0.03759487345814705,
0.07269898802042007,
0.002748589962720871,
0.0007041741628199816,
0.02179412916302681,
-0.023714089766144753,
-0.0054906937293708324,
0.003726406954228878,
0.008153339847922325,
-0.0016523972153663635,
0.019329316914081573,
-0.018356366083025932,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ignored", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def cbGlobalRequests(ignored):
channel = self.channel
d1 = channel.conn.sendGlobalRequest('foo', 'bar', 1)
d2 = channel.conn.sendGlobalRequest('foo-2', 'bar2', 1)
d2.addCallback(self.assertEqual, 'data')
d3 = self.assertFailure(
chann... | |
19,859 | [
0.060849398374557495,
-0.0032840308267623186,
0.03689294308423996,
0.0035202682483941317,
0.002532064449042082,
0.042056892067193985,
0.038356948643922806,
0.009675746783614159,
0.030983684584498405,
0.07378588616847992,
0.018273452296853065,
0.0019298256374895573,
0.011292807757854462,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ignored", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def cbClosed(ignored):
self.assertEqual(self.channel.received, [])
self.assertEqual("".join(self.channel.receivedExt), "hello\r\n")
self.assertEqual(self.channel.status, 0)
self.assertTrue(self.channel.eofCalled)
self.assertEqual(self.channel.localWindowL... | |
19,860 | [
0.05803453177213669,
-0.0009278212673962116,
0.033262431621551514,
0.006319215055555105,
0.004879353102296591,
0.04628266766667366,
0.042865827679634094,
0.010968836955726147,
0.038413580507040024,
0.07232314348220825,
0.024707386270165443,
0.009577509947121143,
0.003500967985019088,
0.053... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ignored", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def cbClosed(ignored):
self.assertEqual(self.channel.status, 0)
self.assertEqual("".join(self.channel.received), "hello\r\n")
self.assertEqual(self.channel.localWindowLeft, 4)
self.assertTrue(self.channel.eofCalled)
self.assertEqual(
self... | |
19,861 | [
0.010087070986628532,
-0.06276997923851013,
0.08473408222198486,
-0.03321532905101776,
0.04295921325683594,
0.02265048585832119,
-0.019568514078855515,
0.03265007957816124,
0.01822267286479473,
0.0006779668619856238,
0.04783115163445473,
-0.030200649052858353,
-0.025046082213521004,
-0.014... | 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_multipleFactories(self):
f1 = self.makeSSHFactory(primes=None)
f2 = self.makeSSHFactory(primes={1:(2,3)})
p1 = f1.buildProtocol(None)
p2 = f2.buildProtocol(None)
self.assertNotIn(
'diffie-hellman-group-exchange-sha1', p1.supportedKeyExchanges)
... | |
19,862 | [
-0.004731772933155298,
-0.0007624586578458548,
0.021644767373800278,
-0.04077719524502754,
-0.027901457622647285,
-0.051213063299655914,
-0.026524502784013748,
-0.024579854682087898,
0.005746371578425169,
-0.0019295488018542528,
0.03362669050693512,
-0.05135800689458847,
0.012899894267320633... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "stock.production.lot"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_c... | class StockProductioLot(models.Model):
_inherit = 'stock.production.lot'
@api.one
@api.constrains('removal_date', 'alert_date', 'life_date', 'use_date')
def _check_dates(self):
dates = filter(lambda x: x, [self.alert_date, self.removal_date,
self.use_date, s... | |
19,863 | [
0.015535101294517517,
0.0038869022391736507,
-0.025479067116975784,
0.009118428453803062,
0.012758295051753521,
-0.020876074209809303,
0.025891834869980812,
0.005588008090853691,
0.03439736366271973,
0.02789313532412052,
0.04550458863377571,
-0.030694957822561264,
-0.016873471438884735,
-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 _get_product_state(self):
now = fields.Datetime.now()
self.expiry_state = 'normal'
if self.life_date and self.life_date < now:
self.expiry_state = 'expired'
elif (self.alert_date and self.removal_date and
self.removal_date >= now > self.alert_date):
... | |
19,864 | [
-0.012917524203658104,
0.019027022644877434,
0.040618784725666046,
-0.054714422672986984,
-0.006182479206472635,
-0.017702952027320862,
-0.030193019658327103,
-0.03227817267179489,
-0.0012432726798579097,
0.049334727227687836,
0.007558680605143309,
-0.02566823735833168,
0.006276311352849007,... | 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 _check_dates(self):
dates = filter(lambda x: x, [self.alert_date, self.removal_date,
self.use_date, self.life_date])
sort_dates = list(dates)
sort_dates.sort()
if dates != sort_dates:
raise exceptions.Warning(
_('Dates ... | |
19,865 | [
-0.0011427162680774927,
-0.030455736443400383,
0.022077905014157295,
-0.07929511368274689,
0.0073697371408343315,
0.025972532108426094,
-0.015303005464375019,
-0.02105102501809597,
0.023643268272280693,
0.0279010608792305,
0.01750703901052475,
-0.028652437031269073,
-0.032208945602178574,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "nxos_l3_interfaces", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "module", "ctx": {"_type": "Store", "_fields":... | class TestNxosL3InterfacesModule(TestNxosModule):
module = nxos_l3_interfaces
def setUp(self):
super(TestNxosL3InterfacesModule, self).setUp()
self.mock_FACT_LEGACY_SUBSETS = patch('ansible.module_utils.network.nxos.facts.facts.FACT_LEGACY_SUBSETS')
self.FACT_LEGACY_SUBSETS = self.moc... | |
19,866 | [
0.01897546648979187,
-0.033248838037252426,
0.033917155116796494,
-0.05613873898983002,
-0.0036518822889775038,
0.008318176493048668,
0.004099417012184858,
0.003833879716694355,
-0.016719892621040344,
-0.021994832903146744,
0.012519034557044506,
-0.018677109852433205,
-0.06019638478755951,
... | 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 setUp(self):
super(TestNxosL3InterfacesModule, self).setUp()
self.mock_FACT_LEGACY_SUBSETS = patch('ansible.module_utils.network.nxos.facts.facts.FACT_LEGACY_SUBSETS')
self.FACT_LEGACY_SUBSETS = self.mock_FACT_LEGACY_SUBSETS.start()
self.mock_get_resource_connection_config = patch(... | |
19,867 | [
-0.0028776335529983044,
-0.012949350290000439,
0.003206690074875951,
-0.03473806753754616,
-0.013097748160362244,
0.04328063875436783,
-0.0029373152647167444,
-0.022788792848587036,
0.023601755499839783,
0.050068240612745285,
0.04722931981086731,
-0.022608133032917976,
0.04064818471670151,
... | 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_2(self):
# Change existing config states
existing = dedent('''\
interface mgmt0
ip address 10.0.0.254/24
interface Ethernet1/1
ip address 10.1.1.1/24
interface Ethernet1/2
ip address 10.1.2.1/24
interface Ethernet1/3
... | |
19,868 | [
0.02825944684445858,
-0.010270663537085056,
0.03138056769967079,
-0.05608338862657547,
-0.025380272418260574,
0.03861479088664055,
-0.03682438284158707,
-0.02571900002658367,
-0.07689085602760315,
-0.016597585752606392,
0.016537098214030266,
-0.04780878871679306,
-0.006166632287204266,
0.0... | 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": "width", "annotation": ... | class StackedColumn(_DrawingEditorMixin,Drawing):
def __init__(self,width=200,height=150,*args,**kw):
Drawing.__init__(self,width,height,*args,**kw)
self._add(self,VerticalBarChart(),name='chart',validate=None,desc="The main chart")
self.chart.width = 115
self.chart.height =... | |
19,869 | [
0.0029993345960974693,
-0.007317316718399525,
0.03390808030962944,
-0.0405484139919281,
-0.019697297364473343,
0.045163679867982864,
-0.02627876214683056,
-0.029975684359669685,
-0.04801290109753609,
0.010790539905428886,
0.027220653370022774,
-0.012845040298998356,
-0.013504363596439362,
... | 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": "width", "annotation": null, "type_comment": null}}, {"_type": "ar... | def __init__(self,width=200,height=150,*args,**kw):
Drawing.__init__(self,width,height,*args,**kw)
self._add(self,VerticalBarChart(),name='chart',validate=None,desc="The main chart")
self.chart.width = 115
self.chart.height = 80
self.chart.x = 30
self.ch... | |
19,870 | [
0.04844369739294052,
-0.010495000518858433,
0.022963128983974457,
-0.005998763255774975,
0.028848495334386826,
0.019878698512911797,
-0.006503385026007891,
0.034042131155729294,
-0.00047804415225982666,
-0.0010276709217578173,
-0.007064706180244684,
0.014866500161588192,
0.02428988739848137,... | 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_create_table():
conn = boto.connect_dynamodb()
create_table(conn)
expected = {
'Table': {
'CreationDateTime': 1326499200.0,
'ItemCount': 0,
'KeySchema': {
'HashKeyElement': {
'AttributeName': 'forum_name',
... | |
19,871 | [
0.032768961042165756,
0.006437573581933975,
0.04003829136490822,
-0.03894447162747383,
0.016942782327532768,
0.0562860444188118,
-0.02067999355494976,
0.05829137563705444,
0.01906205527484417,
-0.017216237261891365,
0.03222205117344856,
-0.017170662060379982,
0.006181210279464722,
-0.00937... | 13 | {"_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_delete_table():
conn = boto.connect_dynamodb()
create_table(conn)
conn.list_tables().should.have.length_of(1)
conn.layer1.delete_table('messages')
conn.list_tables().should.have.length_of(0)
conn.layer1.delete_table.when.called_with('messages').should.throw(DynamoDBResponseError) | |
19,872 | [
0.032745860517024994,
-0.006377763114869595,
0.05035427585244179,
-0.029317675158381462,
0.03860049322247505,
0.041984155774116516,
0.04185059294104576,
0.03410378098487854,
0.027158362790942192,
-0.014736751094460487,
0.007540897931903601,
0.0026490534655749798,
-0.028605325147509575,
-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": "Call", "_fields": {"a... | def test_update_table_throughput():
conn = boto.connect_dynamodb()
table = create_table(conn)
table.read_units.should.equal(10)
table.write_units.should.equal(10)
table.update_throughput(5, 6)
table.refresh()
table.read_units.should.equal(5)
table.write_units.should.equal(6) | |
19,873 | [
0.02435383014380932,
-0.01590855047106743,
0.011379032395780087,
-0.007628984749317169,
0.015503471717238426,
-0.005520733539015055,
-0.013723580166697502,
0.025286739692091942,
-0.008169089443981647,
-0.01669415831565857,
0.04171084612607956,
-0.003360313130542636,
0.03449307754635811,
-0... | 13 | {"_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_item_put_without_table():
conn = boto.connect_dynamodb()
conn.layer1.put_item.when.called_with(
table_name='undeclared-table',
item=dict(
hash_key='LOLCat Forum',
),
).should.throw(DynamoDBResponseError) | |
19,874 | [
0.03718438372015953,
-0.02951929159462452,
-0.0021240245550870895,
-0.017810799181461334,
0.006461996119469404,
0.01707901805639267,
0.012874379754066467,
0.028948750346899033,
0.0041891345754265785,
0.008750361390411854,
0.0038604536093771458,
-0.023330163210630417,
0.0013790656812489033,
... | 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": "Call", "_fields": {"a... | def test_item_add_and_describe_and_update():
conn = boto.connect_dynamodb()
table = create_table(conn)
item_data = {
'Body': 'http://url_to_lolcat.gif',
'SentBy': 'User A',
'ReceivedTime': '12/9/2011 11:36:03 PM',
}
item = table.new_item(
hash_key='LOLCat Forum',
... | |
19,875 | [
0.013028820045292377,
0.016958903521299362,
0.007967350073158741,
-0.013314644806087017,
0.025271624326705933,
0.015994247049093246,
-0.023937776684761047,
0.027986953034996986,
-0.005406841170042753,
-0.04106341302394867,
0.01273108646273613,
-0.008890323340892792,
0.03213140368461609,
-0... | 13 | {"_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_get_item_with_undeclared_table():
conn = boto.connect_dynamodb()
conn.layer1.get_item.when.called_with(
table_name='undeclared-table',
key={
'HashKeyElement': {'S': 'tester'},
},
).should.throw(DynamoDBKeyNotFoundError) | |
19,876 | [
0.06747300177812576,
-0.004923458676785231,
-0.0017690348904579878,
-0.016149675473570824,
0.012800383381545544,
0.014517656527459621,
-0.011966105550527573,
0.06786274164915085,
0.007989582605659962,
-0.00801394134759903,
0.04844902455806732,
-0.03692746162414551,
0.008970011956989765,
-0... | 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": "Call", "_fields": {"a... | def test_delete_item():
conn = boto.connect_dynamodb()
table = create_table(conn)
item_data = {
'Body': 'http://url_to_lolcat.gif',
'SentBy': 'User A',
'ReceivedTime': '12/9/2011 11:36:03 PM',
}
item = table.new_item(
hash_key='LOLCat Forum',
attrs=item_data,... | |
19,877 | [
0.025859540328383446,
0.03094121254980564,
0.008109305053949356,
-0.028210407122969627,
0.011172556318342686,
0.03003885969519615,
-0.015482479706406593,
0.047705985605716705,
0.0030024019069969654,
-0.03623660281300545,
0.024672234430909157,
-0.01926998794078827,
0.027260562404990196,
-0.... | 13 | {"_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_delete_item_with_undeclared_table():
conn = boto.connect_dynamodb()
conn.layer1.delete_item.when.called_with(
table_name='undeclared-table',
key={
'HashKeyElement': {'S': 'tester'},
},
).should.throw(DynamoDBResponseError) | |
19,878 | [
0.059208307415246964,
0.008194220252335072,
-0.006667494773864746,
-0.029699573293328285,
0.012100488878786564,
0.03568720072507858,
-0.022662324830889702,
0.05667966976761818,
0.019370324909687042,
-0.011265560984611511,
0.04484754800796509,
-0.05362622067332268,
0.014670873992145061,
-0.... | 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": "Call", "_fields": {"a... | def test_delete_item_with_attribute_response():
conn = boto.connect_dynamodb()
table = create_table(conn)
item_data = {
'Body': 'http://url_to_lolcat.gif',
'SentBy': 'User A',
'ReceivedTime': '12/9/2011 11:36:03 PM',
}
item = table.new_item(
hash_key='LOLCat Forum',
... | |
19,879 | [
0.04806854575872421,
-0.004889325238764286,
0.03381292521953583,
-0.0011538512771949172,
0.023539450019598007,
-0.00987879280000925,
0.004011603072285652,
0.05607996881008148,
-0.015127453953027725,
-0.025330238044261932,
0.026602640748023987,
-0.03725312277674675,
0.016305604949593544,
-0... | 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 test_query():
conn = boto.connect_dynamodb()
table = create_table(conn)
item_data = {
'Body': 'http://url_to_lolcat.gif',
'SentBy': 'User A',
'ReceivedTime': '12/9/2011 11:36:03 PM',
}
item = table.new_item(
hash_key='the-key',
attrs=item_data,
)
... | |
19,880 | [
0.038775719702243805,
0.013370482251048088,
0.05009632557630539,
-0.037955768406391144,
0.02443981170654297,
0.005078402813524008,
-0.013172106817364693,
0.023302461951971054,
-0.018805960193276405,
0.0067976536229252815,
0.010685805231332779,
-0.04308707267045975,
0.020035885274410248,
-0... | 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 test_scan():
conn = boto.connect_dynamodb()
table = create_table(conn)
item_data = {
'Body': 'http://url_to_lolcat.gif',
'SentBy': 'User A',
'ReceivedTime': '12/9/2011 11:36:03 PM',
}
item = table.new_item(
hash_key='the-key',
attrs=item_data,
)
i... | |
19,881 | [
0.03540859743952751,
-0.0485844686627388,
0.05039583891630173,
-0.050718411803245544,
0.02525995299220085,
-0.010651115328073502,
0.007046981249004602,
0.036971837282180786,
-0.016165873035788536,
-0.006805051118135452,
0.019292350858449936,
-0.0003871264634653926,
-0.016997119411826134,
-... | 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_write_batch():
conn = boto.connect_dynamodb()
table = create_table(conn)
batch_list = conn.new_batch_write_list()
items = []
items.append(table.new_item(
hash_key='the-key',
attrs={
'Body': 'http://url_to_lolcat.gif',
'SentBy': 'User A',
... | |
19,882 | [
0.006751128472387791,
0.02196444757282734,
0.03340644761919975,
-0.02677171677350998,
0.02272103913128376,
0.018798401579260826,
-0.04013429582118988,
0.012536147609353065,
-0.017389975488185883,
-0.03263821452856064,
0.00200205878354609,
-0.002442919183522463,
0.040646448731422424,
-0.008... | 13 | {"_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_scan_with_undeclared_table():
conn = boto.connect_dynamodb()
conn.layer1.scan.when.called_with(
table_name='undeclared-table',
scan_filter={
"SentBy": {
"AttributeValueList": [{
"S": "User B"}
],
"Compariso... | |
19,883 | [
0.04919198527932167,
-0.0453941710293293,
0.03153727203607559,
-0.030895749107003212,
0.018232084810733795,
-0.0031097829341888428,
0.004003103822469711,
0.04041595011949539,
-0.022029900923371315,
-0.023056337609887123,
0.019168708473443985,
-0.026379426941275597,
-0.011412695050239563,
-... | 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": "Call", "_fields": {"a... | def test_batch_read():
conn = boto.connect_dynamodb()
table = create_table(conn)
item_data = {
'Body': 'http://url_to_lolcat.gif',
'SentBy': 'User A',
'ReceivedTime': '12/9/2011 11:36:03 PM',
}
item = table.new_item(
hash_key='the-key1',
attrs=item_data,
... | |
19,884 | [
-0.0199540164321661,
-0.016272693872451782,
0.054758112877607346,
-0.039883073419332504,
-0.012360508553683758,
-0.05156347528100014,
0.014825123362243176,
0.015673698857426643,
-0.025544635951519012,
0.04285309091210365,
0.022349996492266655,
-0.008360969834029675,
0.022137852385640144,
-... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tconf", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def params(tconf):
steward_defs, node_defs = TestNetworkSetup.gen_defs(
ips=None, nodeCount=NODE_COUNT, starting_port=portsStart)
client_defs = TestNetworkSetup.gen_client_defs(clientCount=CLIENT_COUNT)
trustee_def = TestNetworkSetup.gen_trustee_def(1)
nodeParamsFile = randomString()
return... | |
19,885 | [
0.04428126662969589,
0.02103136107325554,
0.07829896360635757,
-0.036079373210668564,
0.015731502324342728,
-0.05633760243654251,
0.02886349894106388,
0.002885229419916868,
-0.030140841379761696,
-0.012045131996273994,
-0.010112308897078037,
0.04360898211598396,
-0.05019738897681236,
-0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "bootstrap", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "keys_dir", "annotation": null, "type_comment": null}}, {"_ty... | def test_bootstrap_test_node_creates_keys(bootstrap,
keys_dir,
params):
assert os.path.exists(keys_dir)
_, node_defs, _, _, _ = params
# only Node1 is local, that is has keys generated
node_name = node_defs[0].name
... | |
19,886 | [
0.011228006333112717,
0.007674924563616514,
0.022081300616264343,
-0.02226865664124489,
0.026136230677366257,
-0.015818240121006966,
0.0008690329850651324,
0.006420305464416742,
-0.0132287060841918,
-0.005443375091999769,
0.038782794028520584,
-0.010712776333093643,
-0.019886553287506104,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "bootstrap", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "domain_genesis_file", "annotation": null, "type_comment": nu... | def test_domain_genesis_txns(bootstrap, domain_genesis_file):
serializer = JsonSerializer()
with open(domain_genesis_file) as f:
i = 0
for line in store_utils.cleanLines(f.readlines()):
txn = serializer.deserialize(line)
assert get_seq_no(txn)
assert get_paylo... | |
19,887 | [
-0.015109168365597725,
-0.013581563718616962,
0.045391689985990524,
-0.01378695573657751,
0.014929450117051601,
-0.028318459168076515,
-0.04500658065080643,
0.011046253144741058,
-0.008356898091733456,
0.04451877251267433,
0.022426268085837364,
-0.013671423308551311,
0.006116838660091162,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "params", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tdir", "annotation": null, "type_comment": null}}, {"_type": "a... | def test_check_valid_ip_host(params, tdir, tconf):
_, _, client_defs, trustee_def, nodeParamsFile = params
valid = [
'34.200.79.65,52.38.24.189',
'ec2-54-173-9-185.compute-1.amazonaws.com,ec2-52-38-24-189.compute-1.amazonaws.com',
'ec2-54-173-9-185.compute-1.amazonaws.com,52.38.24.189,3... | |
19,888 | [
-0.0016782133607193828,
-0.0004936807090416551,
0.03804953768849373,
-0.04859744384884834,
0.02598446235060692,
-0.0592898465692997,
-0.0052438522689044476,
0.010373314842581749,
-0.013907345943152905,
-0.029693087562918663,
0.02413014881312847,
-0.0029620840214192867,
-0.026947740465402603,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "bootstrap", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pool_genesis_file", "annotation": null, "type_comment": null... | def test_pool_genesis_txns(bootstrap, pool_genesis_file):
serializer = JsonSerializer()
with open(pool_genesis_file) as f:
for line in store_utils.cleanLines(f.readlines()):
txn = serializer.deserialize(line)
assert get_seq_no(txn)
assert get_txn_id(txn)
a... | |
19,889 | [
0.021774519234895706,
0.016942832618951797,
0.017421744763851166,
-0.061215560883283615,
-0.006587696727365255,
-0.00792864989489317,
-0.015389029867947102,
-0.027947159484028816,
0.004092034418135881,
-0.02598894201219082,
-0.004126622807234526,
-0.013207321055233479,
0.033779241144657135,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "k", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def _at_k_name(name, k=None, class_id=None):
if k is not None:
name = '%s_at_%d' % (name, k)
else:
name = '%s_at_k' % (name)
if class_id is not None:
name = '%s_class%d' % (name, class_id)
return name | |
19,890 | [
0.05852380394935608,
0.015026085078716278,
-0.005600482225418091,
0.02498127892613411,
0.031215623021125793,
0.007683170028030872,
0.0037757293321192265,
-0.012666254304349422,
0.003204979468137026,
0.029678989201784134,
0.0468892902135849,
0.01974574662744999,
0.03117171861231327,
0.03595... | 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 reallocate():
next_size = _next_array_size(new_size)
next_shape = array_ops.stack([next_size] + fixed_shape)
new_value = array_ops.zeros(next_shape, dtype=values.dtype)
old_value = array.value()
assign_op = state_ops.assign(array, new_value, validate_shape=False)
with ops.control... | |
19,891 | [
-0.0029930556192994118,
-0.04630483686923981,
0.04288420081138611,
-0.004961642436683178,
0.016575157642364502,
-0.017114654183387756,
-0.010038071312010288,
0.029591936618089676,
0.01351036038249731,
-0.003925695084035397,
0.007472595199942589,
-0.03211723640561104,
0.016184883192181587,
... | 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 AsanaTest(AcceptanceTestCase):
def setUp(self):
super(AsanaTest, self).setUp()
self.user = self.create_user("foo@example.com")
self.org = self.create_organization(name="Rowdy Tiger", owner=None)
self.team = self.create_team(organization=self.org, name="Mariachi Band")
s... | |
19,892 | [
0.007310275454074144,
0.010364084504544735,
0.0045188115909695625,
-0.04853079840540886,
-0.004840109962970018,
0.015115763060748577,
0.020952193066477776,
0.037636127322912216,
0.005615352652966976,
0.04178647696971893,
0.000561166787520051,
0.015705302357673645,
0.03350935876369476,
-0.0... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "unused_argv", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def main(unused_argv):
trial_id = os.environ.get('CLOUD_ML_TRIAL_ID', 0)
if trial_id:
if FLAGS.export_dir:
FLAGS.export_dir = os.path.join(
FLAGS.export_dir, 'trial_{}'.format(trial_id))
FLAGS.model_dir = os.path.join(
FLAGS.model_dir, 'trial_{}'.format(tr... | |
19,893 | [
-0.0022943010553717613,
0.04619817063212395,
0.06008259579539299,
-0.028692809864878654,
-0.02839314565062523,
-0.01515799481421709,
0.004095405340194702,
-0.0030559466686099768,
-0.013160236179828644,
0.024197852239012718,
0.017205696552991867,
-0.02115127071738243,
-0.009420680813491344,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "INPUT"}}, "targets": [{"_type": "Name", "_fields": {"id": "INPUT", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {... | class Explode(GeoAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
def processAlgorithm(self, progress):
vlayer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT))
output = self.getOutputFromName(self.OUTPUT)
vprovider = vlayer.dataProvider()
fields ... | |
19,894 | [
-0.007093445863574743,
-0.035930853337049484,
0.038550328463315964,
0.0018834720831364393,
0.015473447740077972,
-0.025522496551275253,
0.009243501350283623,
0.02189463935792446,
0.0003759700048249215,
-0.0021167329978197813,
0.00988098420202732,
-0.0077193379402160645,
0.008866807445883751,... | 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):
super(AsanaTest, self).setUp()
self.user = self.create_user("foo@example.com")
self.org = self.create_organization(name="Rowdy Tiger", owner=None)
self.team = self.create_team(organization=self.org, name="Mariachi Band")
self.project = self.create_project(organiz... | |
19,895 | [
0.019167158752679825,
0.007372775115072727,
0.06757862865924835,
-0.014601590111851692,
-0.017696715891361237,
0.010061729699373245,
-0.017758414149284363,
0.01774813048541546,
0.011814949102699757,
0.057131294161081314,
0.013902359642088413,
-0.06589224934577942,
0.030766168609261513,
-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": "geom", "annotation": null, "type_comment": null}}], "kwarg": null... | def extractAsSingleSegments(self, geom):
segments = []
if geom.isMultipart():
multi = geom.asMultiPolyline()
for polyline in multi:
segments.extend(self.getPolylineAsSingleSegments(polyline))
else:
segments.extend(self.getPolylineAsSingleSegmen... | |
19,896 | [
0.006268753670156002,
0.030615447089076042,
0.0450257770717144,
-0.03743044286966324,
0.00882437638938427,
-0.01204979233443737,
0.034048955887556076,
0.001962236827239394,
0.011926238425076008,
0.01614009030163288,
0.039277251809835434,
-0.02303311787545681,
-0.014501369558274746,
-0.0495... | 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": "progress", "annotation": null, "type_comment": null}}], "kwarg": ... | def processAlgorithm(self, progress):
vlayer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT))
output = self.getOutputFromName(self.OUTPUT)
vprovider = vlayer.dataProvider()
fields = vprovider.fields()
writer = output.getVectorWriter(fields, QGis.WKB... | |
19,897 | [
0.007913648150861263,
-0.0048738201148808,
0.03134051337838173,
-0.03329228609800339,
-0.013494144193828106,
0.0057403394021093845,
0.026001185178756714,
-0.035333793610334396,
-0.04966921731829643,
0.02929900586605072,
-0.02490191161632538,
-0.03997766226530075,
0.01221539732068777,
-0.05... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "channel", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "builds", "annotation": null, "type_comment": null}}], "kwarg":... | def android_builds(channel, builds=None):
builds = builds or []
variations = OrderedDict([
('api-9', 'Gingerbread'),
('api-11', 'Honeycomb+ ARMv7'),
('x86', 'x86'),
])
if channel == 'alpha':
for type, arch_pretty in variations.iteritems():
link = firefox_andr... | |
19,898 | [
-0.013322601094841957,
-0.008003653958439827,
0.05195814371109009,
-0.029612509533762932,
-0.024545883759856224,
0.02085188962519169,
-0.023496223613619804,
0.008644551038742065,
0.007998607121407986,
0.05599529668688774,
-0.014987925998866558,
-0.041239507496356964,
0.04404532536864281,
-... | 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": "polyline", "annotation": null, "type_comment": null}}], "kwarg": ... | def getPolylineAsSingleSegments(self, polyline):
segments = []
for i in range(len(polyline) - 1):
ptA = polyline[i]
ptB = polyline[i + 1]
segment = QgsGeometry.fromPolyline([ptA, ptB])
segments.append(segment)
return segments | |
19,899 | [
-0.0439276359975338,
-0.0013678183313459158,
-0.017780233174562454,
-0.051012735813856125,
-0.0035453627351671457,
0.010920054279267788,
0.004790878854691982,
-0.03794465959072113,
-0.028092993423342705,
0.0546565055847168,
0.007518080994486809,
-0.011324917897582054,
0.022087525576353073,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "locale", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "force_cache_refresh", "annotation": null, "type_comment": null}... | def firefox_os_feed_links(locale, force_cache_refresh=False):
if locale in settings.FIREFOX_OS_FEED_LOCALES:
cache_key = 'firefox-os-feed-links-' + locale
if not force_cache_refresh:
links = cache.get(cache_key)
if links:
return links
links = list(
... | |
19,900 | [
-0.02387910522520542,
-0.011928940191864967,
-0.03977728262543678,
-0.02689317986369133,
0.017829732969403267,
-0.024303624406456947,
-0.027848344296216965,
-0.06342290341854095,
-0.007773975841701031,
0.03515004366636276,
-0.013818042352795601,
0.006595939863473177,
0.03534107655286789,
-... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "locale", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def firefox_os_blog_link(locale):
try:
return settings.FXOS_PRESS_BLOG_LINKS[locale]
except KeyError:
if '-' in locale:
return firefox_os_blog_link(locale.split('-')[0])
else:
return None |