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 |
|---|---|---|---|---|---|
1,601 | [
0.0026565224397927523,
-0.013430423103272915,
0.03384726867079735,
-0.018138663843274117,
-0.023215755820274353,
-0.03005030006170273,
-0.026557087898254395,
-0.03241527080535889,
-0.02054702863097191,
0.013712483458220959,
0.00656333239749074,
-0.006899635773152113,
0.011868241243064404,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "label_options", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "service_labels", "annotation": null, "type_comment": nul... | def build_container_labels(label_options, service_labels, number, config_hash):
labels = dict(label_options or {})
labels.update(label.split('=', 1) for label in service_labels)
labels[LABEL_CONTAINER_NUMBER] = str(number)
labels[LABEL_VERSION] = __version__
if config_hash:
log.debug("Added... | |
1,602 | [
0.02226489968597889,
-0.003138916566967964,
0.07965189218521118,
-0.024182623252272606,
-0.0317208468914032,
0.028343722224235535,
-0.004052549134939909,
0.01652378775179386,
0.022047799080610275,
0.0030665495432913303,
0.009685110300779343,
-0.011542528867721558,
-0.0075623467564582825,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ulimit_config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonly... | def build_ulimits(ulimit_config):
if not ulimit_config:
return None
ulimits = []
for limit_name, soft_hard_values in six.iteritems(ulimit_config):
if isinstance(soft_hard_values, six.integer_types):
ulimits.append({'name': limit_name, 'soft': soft_hard_values, 'hard': soft_hard_v... | |
1,603 | [
-0.00911555252969265,
0.0026749984826892614,
-0.04340166226029396,
-0.00047790215467102826,
0.05575629696249962,
0.0009006496984511614,
-0.018872903659939766,
-0.010539544746279716,
-0.010890528559684753,
0.045447397977113724,
0.015252756886184216,
-0.054512809962034225,
0.013718456029891968... | 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": "ldapUrl", "annotation"... | class FakeLdapUrl(object):
def __init__(self, ldapUrl=None, urlscheme='ldap', hostport='', **kwargs):
url = ldapUrl if ldapUrl else "%s://%s" % (urlscheme, hostport)
self.urlscheme = url.split('://', 2)[0].lower()
self._url = url
def initializeUrl(self):
return self._url | |
1,604 | [
-0.008647294715046883,
-0.005659386981278658,
0.0610446073114872,
0.006084749009460211,
-0.03375920280814171,
-0.009866318665444851,
-0.03662261366844177,
-0.037929825484752655,
0.0032498680520802736,
0.03249349072575569,
0.017751075327396393,
0.0024938134010881186,
0.06365902721881866,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "container_options", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}... | def build_container_ports(container_options, options):
ports = []
all_ports = container_options.get('ports', []) + options.get('expose', [])
for port_range in all_ports:
internal_range, _ = split_port(port_range)
for port in internal_range:
port = str(port)
if '/' in ... | |
1,605 | [
-0.038617972284555435,
-0.020798876881599426,
0.007139557506889105,
-0.03280143812298775,
0.04717590659856796,
0.006388652604073286,
-0.02855823002755642,
-0.02106109820306301,
-0.0017357229953631759,
0.0008067759335972369,
0.013635481707751751,
-0.023218460381031036,
0.022098062559962273,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "laps_password", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonly... | def test_missing_ldap(laps_password):
laps_password.HAS_LDAP = False
laps_password.LDAP_IMP_ERR = "no import for you!"
with pytest.raises(AnsibleLookupError) as err:
lookup_loader.get('laps_password').run(["host"], domain="test")
assert str(err.value) == "Failed to import the required Python l... | |
1,606 | [
-0.006742675323039293,
0.0041147274896502495,
0.0073491246439516544,
-0.040873393416404724,
0.03276131674647331,
0.00009485962800681591,
0.01930204965174198,
0.027492377907037735,
0.025170914828777313,
0.0038017211481928825,
0.024023225530982018,
-0.00597646227106452,
-0.009233683347702026,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "laps_password", "annotation": null, "type_comment": null}}... | def test_normal_run(monkeypatch, laps_password):
def get_laps_password(conn, cn, search_base):
return "CN=%s,%s" % (cn, search_base)
mock_ldap = MagicMock()
mock_ldap.return_value.read_rootdse_s.return_value = {"defaultNamingContext": ["DC=domain,DC=com"]}
monkeypatch.setattr("ldap.initialize",... | |
1,607 | [
-0.03064720518887043,
0.013618292286992073,
-0.012771684676408768,
-0.02449115738272667,
0.024793516844511032,
-0.014501183293759823,
0.024442778900265694,
0.011755755171179771,
0.011471536941826344,
0.011997642926871777,
0.030066674575209618,
-0.03475930169224739,
-0.00649469206109643,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, {"_ty... | def test_uri_options(monkeypatch, kwargs, expected):
mock_ldap = MagicMock()
monkeypatch.setattr("ldap.initialize", mock_ldap)
lookup_loader.get('laps_password').run([], **kwargs)
assert mock_ldap.call_count == 1
assert mock_ldap.call_args[0] == (expected,)
assert mock_ldap.call_args[1] == {"b... | |
1,608 | [
-0.011852807365357876,
-0.002243567258119583,
0.005979710258543491,
-0.054886650294065475,
0.008786128833889961,
-0.007444065064191818,
0.008566632866859436,
0.0242324061691761,
0.022777458652853966,
0.00141496816650033,
0.01993027701973915,
-0.01513898279517889,
0.004041870124638081,
0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "laps_password", "annotation": null, "type_comment": null}}... | def test_run_with_simple_auth_and_search_base(monkeypatch, laps_password):
def get_laps_password(conn, cn, search_base):
return "CN=%s,%s" % (cn, search_base)
mock_ldap = MagicMock()
monkeypatch.setattr("ldap.initialize", mock_ldap)
mock_get_laps_password = MagicMock(side_effect=get_laps_passw... | |
1,609 | [
0.008337216451764107,
0.016860218718647957,
0.0112807871773839,
-0.02087787538766861,
0.016059011220932007,
0.01646542176604271,
0.021295897662639618,
0.0017838507192209363,
0.02854161150753498,
0.023293113335967064,
0.06669773161411285,
-0.030515603721141815,
-0.035067398101091385,
0.0354... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "validate", "annotation": null, "type_comment": null}}, {"_... | def test_certificate_validation(monkeypatch, validate, expected):
mock_ldap_option = MagicMock()
monkeypatch.setattr(FakeLdap, "set_option", mock_ldap_option)
mock_ldap = MagicMock()
monkeypatch.setattr("ldap.initialize", mock_ldap)
lookup_loader.get('laps_password').run([], domain="dc01", start_t... | |
1,610 | [
0.03384137153625488,
0.007429460994899273,
0.029551954939961433,
-0.0014737467281520367,
0.036329708993434906,
0.013591054826974869,
0.011274532414972782,
-0.015866104513406754,
0.02649485506117344,
0.022288382053375244,
0.04405539855360985,
-0.042657192796468735,
-0.01719321869313717,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def test_certificate_validate_with_custom_cacert(monkeypatch):
mock_ldap_option = MagicMock()
monkeypatch.setattr(FakeLdap, "set_option", mock_ldap_option)
mock_ldap = MagicMock()
monkeypatch.setattr("ldap.initialize", mock_ldap)
monkeypatch.setattr(os.path, 'exists', lambda x: True)
lookup_lo... | |
1,611 | [
0.0464089997112751,
-0.006113691721111536,
0.022091876715421677,
-0.005912960506975651,
0.022034524008631706,
0.027184708043932915,
0.029685242101550102,
-0.009365533478558064,
0.027758225798606873,
0.017159629613161087,
0.047441329807043076,
-0.04542255029082298,
-0.027895869687199593,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def test_certificate_validate_with_custom_cacert_fail(monkeypatch):
def set_option(self, key, value):
if key == FakeLdap.OPT_X_TLS_CACERTFILE:
raise ValueError("set_option() failed")
monkeypatch.setattr(FakeLdap, "set_option", set_option)
monkeypatch.setattr(os.path, 'exists', lambda x:... | |
1,612 | [
0.014469508081674576,
-0.0019735160749405622,
0.026348868384957314,
-0.01675354689359665,
0.006846231874078512,
0.019025813788175583,
0.021192118525505066,
-0.004412081558257341,
0.035131823271512985,
0.03192945942282677,
0.03376610949635506,
-0.039181873202323914,
0.014351774007081985,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwarg... | def test_certificate_invalid_path(monkeypatch, path):
monkeypatch.setattr(os.path, 'exists', lambda x: False)
expected_path = os.path.expanduser(os.path.expandvars(path))
with pytest.raises(AnsibleLookupError) as err:
lookup_loader.get('laps_password').run([], domain="dc01", scheme="ldaps", cacert_... | |
1,613 | [
0.002068455796688795,
-0.022010333836078644,
-0.005603858269751072,
-0.02399899810552597,
0.0400678925216198,
0.0021758682560175657,
0.011312060058116913,
-0.009624150581657887,
0.022022610530257225,
0.008279961533844471,
0.022525914013385773,
-0.038643911480903625,
0.0083106504753232,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def test_simple_auth_with_ldaps(monkeypatch):
mock_ldap_option = MagicMock()
monkeypatch.setattr(FakeLdap, "set_option", mock_ldap_option)
mock_ldap = MagicMock()
monkeypatch.setattr("ldap.initialize", mock_ldap)
lookup_loader.get('laps_password').run([], domain="dc01", scheme="ldaps", auth="simpl... | |
1,614 | [
-0.002906070789322257,
-0.006750382483005524,
0.0029401322826743126,
-0.035225849598646164,
0.026580406352877617,
0.015098562464118004,
0.01911163330078125,
0.014900386333465576,
0.005301218014210463,
0.017451906576752663,
0.036043327301740646,
-0.035126760601997375,
0.006193011533468962,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def test_simple_auth_with_start_tls(monkeypatch):
mock_ldap_option = MagicMock()
monkeypatch.setattr(FakeLdap, "set_option", mock_ldap_option)
mock_ldap = MagicMock()
monkeypatch.setattr("ldap.initialize", mock_ldap)
lookup_loader.get('laps_password').run([], domain="dc01", start_tls=True, auth="s... | |
1,615 | [
-0.016914131119847298,
-0.005170206073671579,
-0.002807026030495763,
-0.017693860456347466,
0.015990450978279114,
0.011803903616964817,
0.008756961673498154,
0.015270700678229332,
-0.01153399795293808,
0.013015483506023884,
0.040977779775857925,
-0.02718256786465645,
0.017405960708856583,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def test_start_tls_ldap_error(monkeypatch):
mock_ldap = MagicMock()
mock_ldap.return_value.start_tls_s.side_effect = FakeLDAPError("fake error")
monkeypatch.setattr("ldap.initialize", mock_ldap)
with pytest.raises(AnsibleLookupError) as err:
lookup_loader.get('laps_password').run([], domain="dc... | |
1,616 | [
-0.016679201275110245,
0.012177909724414349,
-0.011259041726589203,
-0.002503624651581049,
0.01555097009986639,
-0.016737356781959534,
0.01227096002548933,
-0.011259041726589203,
-0.00718810735270381,
-0.010008683428168297,
0.030055128037929535,
-0.040662821382284164,
0.018074950203299522,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def test_simple_bind_ldap_error(monkeypatch):
mock_ldap = MagicMock()
mock_ldap.return_value.bind_s.side_effect = FakeLDAPError("fake error")
monkeypatch.setattr("ldap.initialize", mock_ldap)
with pytest.raises(AnsibleLookupError) as err:
lookup_loader.get('laps_password').run([], domain="dc01"... | |
1,617 | [
-0.013357287272810936,
0.007508325390517712,
0.0031892729457467794,
0.0024228470865637064,
0.027091167867183685,
-0.011021233163774014,
-0.003842426696792245,
0.010256278328597546,
-0.008332123048603535,
-0.008643988519906998,
0.025820165872573853,
-0.05879560112953186,
0.01666424609720707,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def test_sasl_bind_ldap_error(monkeypatch):
mock_ldap = MagicMock()
mock_ldap.return_value.sasl_gssapi_bind_s.side_effect = FakeLDAPError("fake error")
monkeypatch.setattr("ldap.initialize", mock_ldap)
with pytest.raises(AnsibleLookupError) as err:
lookup_loader.get('laps_password').run([], dom... | |
1,618 | [
-0.011409011669456959,
0.025485683232545853,
0.015267591923475266,
0.0017655385890975595,
0.026533693075180054,
-0.01106959953904152,
-0.00816375482827425,
0.0036174189299345016,
-0.008294756524264812,
0.0020945302676409483,
0.02001936174929142,
-0.061356186866760254,
0.010366956703364849,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def test_sasl_bind_ldap_no_mechs_error(monkeypatch):
mock_ldap = MagicMock()
mock_ldap.return_value.sasl_gssapi_bind_s.side_effect = FakeLDAPAuthUnknownError("no mechs")
monkeypatch.setattr("ldap.initialize", mock_ldap)
with pytest.raises(AnsibleLookupError) as err:
lookup_loader.get('laps_pass... | |
1,619 | [
-0.005472858902066946,
-0.021544521674513817,
0.01790791191160679,
-0.03203566372394562,
0.002743906108662486,
0.011777114123106003,
0.004770060069859028,
-0.02497776970267296,
0.03469134494662285,
-0.012321408838033676,
-0.0014078406384214759,
-0.02576729655265808,
0.02424805425107479,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "laps_password", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonly... | def test_get_password_laps_not_configured(laps_password):
mock_conn = MagicMock()
mock_conn.search_s.return_value = [
("CN=server,DC=domain,DC=local", {"distinguishedName": ["CN=server,DC=domain,DC=local"]}),
(None, ["ldap://ForestDnsZones.domain.com/DC=ForestDnsZones,DC=domain,DC=com"]),
... | |
1,620 | [
0.002264907583594322,
-0.024205833673477173,
0.015579286031425,
0.0018230456626042724,
0.0284196138381958,
-0.02157221920788288,
0.0047200205735862255,
-0.017838340252637863,
0.04033525288105011,
-0.005987081211060286,
0.02270760014653206,
-0.009457598440349102,
0.013132952153682709,
0.023... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "laps_password", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonly... | def test_get_password_valid(laps_password):
mock_conn = MagicMock()
mock_conn.search_s.return_value = [
("CN=server,DC=domain,DC=local",
{"ms-Mcs-AdmPwd": ["pass"], "distinguishedName": ["CN=server,DC=domain,DC=local"]}),
# Replicates the 3 extra entries AD returns that aren't server ob... | |
1,621 | [
-0.007605580613017082,
-0.0372813455760479,
0.028065992519259453,
-0.01879231631755829,
-0.011040923185646534,
-0.0010243329452350736,
-0.007267295848578215,
-0.014604581519961357,
-0.0020574145019054413,
0.007943865843117237,
-0.00036781205562874675,
-0.029559113085269928,
0.006637385580688... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "laps_password", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonly... | def test_get_password_multiple_results(laps_password):
mock_conn = MagicMock()
mock_conn.search_s.return_value = [
("CN=server,OU=Workstations,DC=domain,DC=local",
{"ms-Mcs-AdmPwd": ["pass"], "distinguishedName": ["CN=server,OU=Workstations,DC=domain,DC=local"]}),
("CN=server,OU=Servers... | |
1,622 | [
-0.006177336908876896,
-0.029805224388837814,
0.017461875453591347,
-0.021527254953980446,
-0.0008195870905183256,
-0.002191227627918124,
-0.00834591593593359,
-0.01152234710752964,
0.008566737174987793,
-0.013509739190340042,
-0.000776413653511554,
-0.023554280400276184,
0.01579722203314304... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "laps_password", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonly... | def test_get_password_no_results(laps_password):
mock_conn = MagicMock()
mock_conn.search_s.return_value = [
(None, ["ldap://ForestDnsZones.domain.com/DC=ForestDnsZones,DC=domain,DC=com"]),
(None, ["ldap://DomainDnsZones.domain.com/DC=DomainDnsZones,DC=domain,DC=com"]),
(None, ["ldap://d... | |
1,623 | [
0.037185072898864746,
-0.013296278193593025,
-0.07668447494506836,
0.005980543792247772,
0.0030987560749053955,
0.006453423760831356,
-0.026815088465809822,
0.0017371393041685224,
0.053630176931619644,
0.017969448119401932,
0.03213360160589218,
-0.021173905581235886,
-0.002269824966788292,
... | 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": "value", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _convert(self, value):
if value == '*':
return '*'
elif value == 'wrong':
return '"wrong-etag"'
elif value == 'etag':
return self.etag
else:
return value | |
1,624 | [
0.023426640778779984,
-0.01397401001304388,
-0.019494449719786644,
-0.01294933445751667,
0.03225165605545044,
0.01014428585767746,
0.01127783302217722,
0.011886234395205975,
0.016407614573836327,
-0.013653798960149288,
0.027281980961561203,
-0.05702318251132965,
0.013231121003627777,
-0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "resource", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {... | class Precondition (common.ErmrestTest):
resource = None
@classmethod
def get_etag(cls):
r = cls.session.get(cls.resource)
r.raise_for_status()
return r.headers['etag']
def _convert(self, value):
if value == '*':
return '*'
elif value == 'wrong':
... | |
1,625 | [
-0.03794995695352554,
0.00422301609069109,
0.023201003670692444,
-0.050904951989650726,
-0.01946861669421196,
0.024705998599529266,
-0.044884972274303436,
-0.031448375433683395,
0.03313397243618965,
0.05133839324116707,
0.0023583273869007826,
-0.03506036475300789,
0.024212360382080078,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "klass", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def add_get_tests(klass):
for status, match, tags in [
(200, True, ['*']),
(304, False, ['*']),
(200, True, ['etag']),
(304, False, ['etag']),
(304, True, ['wrong']),
(200, False, ['wrong']),
(200, True, ['etag', 'wrong']),
... | |
1,626 | [
0.05242183431982994,
-0.011543176136910915,
0.050144825130701065,
-0.009955594316124916,
0.038380272686481476,
0.016002321615815163,
-0.0009677293128333986,
-0.003614753717556596,
0.011758227832615376,
-0.01519271731376648,
0.011593776755034924,
-0.08971419930458069,
0.010486897081136703,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "schema"}}, "targets": [{"_type": "Name", "_fields": {"id": "resource", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}... | class PreconditionSchema (Precondition):
resource = 'schema'
def test_1_post(self):
self.assertHttp(self.session.post('schema/DOES_NOT_EXIST', headers={'if-none-match': self.etag}), 412)
r = self.session.post('schema/DOES_NOT_EXIST', headers={'if-match': self.etag})
self.assertHttp(r, 2... | |
1,627 | [
0.024154026061296463,
0.026073386892676353,
0.02447807416319847,
0.014607079327106476,
0.023356370627880096,
-0.01794726401567459,
0.03028600849211216,
0.01713714376091957,
-0.00009162530477624387,
-0.02027791552245617,
0.009652886539697647,
-0.054838862270116806,
0.040132075548172,
-0.018... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"op": {"_type": "Mod", "_fields": {}}, "left": {"_type": "Constant", "_fields": {"kind": null, "value": "entity/%s:%s"}}, "right": {"_type": "Tuple", "_fields": {"c... | class PreconditionData1 (PreconditionTable):
resource = 'entity/%s:%s' % (_S, _T1)
data = [{"id": 47, "name": "foo 47"}]
def _mutate_check(self, mutator, status):
self.assertHttp(mutator({'if-match': '"broken"'}), 412)
self.assertHttp(mutator({'if-none-match': self.etag}), 412)
r = ... | |
1,628 | [
0.014230680651962757,
0.010673010721802711,
-0.02565602958202362,
-0.0023159922566264868,
0.004472590517252684,
0.015263552777469158,
0.004427960608154535,
0.009563629515469074,
0.05047046020627022,
0.0042271241545677185,
0.056157633662223816,
-0.03570421785116196,
-0.020351404324173927,
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": "mutator", "annotation": null, "type_comment": null}}, {"_type": "... | def _mutate_check(self, mutator, status):
self.assertHttp(mutator({'if-match': '"broken"'}), 412)
self.assertHttp(mutator({'if-none-match': self.etag}), 412)
r = mutator({'if-match': self.etag})
self.assertHttp(r, status)
self.etag = self.get_etag()
self.assertEqual(r.hea... | |
1,629 | [
-0.028795192018151283,
0.010175223462283611,
0.01579456590116024,
-0.03893895074725151,
0.0018594797002151608,
0.008362939581274986,
0.006569532211869955,
-0.04173289239406586,
0.01495134923607111,
0.03853622078895569,
0.0047478084452450275,
-0.008941863663494587,
-0.032595954835414886,
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 setup(self):
self.get_navicli_config()
CLARiiON_IP_address_list = []
CLARiiON_IP_loop = "stay_in"
while CLARiiON_IP_loop == "stay_in":
try:
ans = input("CLARiiON SP IP Address or [Enter] to exit: ")
except:
return
if... | |
1,630 | [
0.013751189224421978,
-0.012137324549257755,
0.01497825887054205,
-0.0370788611471653,
-0.013751189224421978,
-0.015164987184107304,
0.013577798381447792,
-0.06359424442052841,
-0.056285176426172256,
0.029849816113710403,
-0.001973982434719801,
-0.012277371250092983,
0.02706223353743553,
-... | 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": "schema_path", "annotation": null, "type_comment": null}}, {"_type... | def __init__(self,
schema_path,
netlist_path,
device_path,
verbose=False,
process="slow",
corner="typ"):
self.verbose = verbose
self.corner = corner
self.process = process
interchange = ... | |
1,631 | [
-0.03171363100409508,
0.04332781955599785,
-0.014888965524733067,
-0.03590322285890579,
-0.0613059476017952,
0.02112032286822796,
-0.004007292911410332,
0.017195893451571465,
-0.033941008150577545,
0.07154127955436707,
0.016824664548039436,
-0.009791185148060322,
0.022419625893235207,
-0.0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "vertex", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "start", "annotation": null, "type_comment": null}}], "kwarg": n... | def dfs_traverse(vertex, start):
global indent
which = vertex.routeSegment.which()
obj = None
if which == "belPin":
obj = vertex.routeSegment.belPin
siteType = self.site_map[obj.site]
bel = self.net_dev_string_map[obj.bel]
... | |
1,632 | [
-0.010464116930961609,
-0.032176703214645386,
-0.024053484201431274,
-0.03319818526506424,
-0.07130921632051468,
-0.022071322426199913,
-0.017766501754522324,
-0.04241585358977318,
-0.06683415174484253,
-0.02522089332342148,
-0.03473041206598282,
-0.011552482843399048,
0.02473447285592556,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "site", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "siteType", "annotation": null, "type_comment": null}}, {"_type": ... | def find_connected_bels(site, siteType, belpinIdx):
connected_bels = []
wireIdx = self.belpin_sitewire_map[(siteType, belpinIdx)]
for pin in self.device.siteTypeList[siteType].siteWires[
wireIdx].pins:
_belpin = self.device.siteTypeList[siteType].b... | |
1,633 | [
0.0281011201441288,
-0.02943456545472145,
0.00046338760876096785,
-0.028866617009043694,
-0.060647059231996536,
0.05541205033659935,
-0.01701377145946026,
-0.016359396278858185,
-0.05269577354192734,
-0.018952205777168274,
-0.04518897086381912,
0.00564862135797739,
0.001933804014697671,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "delays", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dType", "annotation": null, "type_comment": null}}, {"_type": "... | def get_largest_delay(delays, dType, BELPin, first_wire=True):
if len(delays) == 0:
return 0
temp_delay = 0
siteType = self.site_map[BELPin.site]
bel = self.net_dev_string_map[BELPin.bel]
belPinName = self.net_dev_string_map[BELPin.pin]
... | |
1,634 | [
-0.02324569970369339,
0.02256936952471733,
-0.004540175665169954,
0.013351247645914555,
-0.021329432725906372,
-0.025775672867894173,
-0.0053511448204517365,
0.008541792631149292,
-0.008692087605595589,
0.007070149295032024,
0.022619467228651047,
-0.004881471395492554,
-0.009982123970985413,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "model", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def get_value_from_model(model):
process = getattr(model, self.process)
if process.which() == self.process:
process = getattr(process, self.process)
corner = getattr(process, self.corner)
if corner.which() == self.corner:
return... | |
1,635 | [
-0.0017230336088687181,
-0.003658384084701538,
-0.021874088793992996,
-0.0316406674683094,
0.0034460672177374363,
0.026675717905163765,
0.0013242588611319661,
-0.04255049303174019,
0.013392298482358456,
0.02656683698296547,
-0.016930915415287018,
0.016190527006983757,
0.021351462230086327,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "resistance", "annotation": null, "type_comment": null}}, {"_type"... | def node_delay(node, resistance, temp_delay):
if len(self.device.nodeTimings) > 0:
node_model = self.device.nodeTimings[node.nodeTiming]
node_resistance = get_value_from_model(node_model.resistance)
node_capacitance = get_value_from_model(node_model.capacitanc... | |
1,636 | [
-0.019982725381851196,
-0.01916757971048355,
-0.004922900348901749,
-0.018422303721308708,
-0.032396238297224045,
0.02337140403687954,
-0.031557802110910416,
0.003138312604278326,
0.020867740735411644,
-0.0009861813159659505,
-0.016768720000982285,
0.009770108386874199,
0.034818384796381,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "pip_list", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "resistance", "annotation": null, "type_comment": null}}], "kw... | def get_pips_delay(pip_list, resistance):
delay = 0
for pip in pip_list:
pip_timing = self.device.pipTimings[pip[0].timing]
if pip[1]:
delay += get_value_from_model(pip_timing.inputCapacitance)\
* resistance * 0.5
... | |
1,637 | [
-0.0017060056561604142,
0.016394171863794327,
0.013455335050821304,
-0.03298105672001839,
-0.04641574248671532,
0.03655996918678284,
0.00041918872739188373,
-0.018169863149523735,
-0.019780375063419342,
0.04999465495347977,
0.0036959154531359673,
-0.02329046092927456,
0.01471483614295721,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "vertex", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "resistance", "annotation": null, "type_comment": null}}, {"_typ... | def dfs_traverse(vertex, resistance, delay, in_site):
which = vertex.routeSegment.which()
temp_delay = 0
return_value = delay
last = len(vertex.branches) == 0
obj = None
if which == "belPin":
obj = vertex.routeSegment.belPin
... | |
1,638 | [
-0.014070987701416016,
0.0369015596807003,
0.017894230782985687,
-0.07564214617013931,
-0.024258237332105637,
0.024802686646580696,
-0.01252233237028122,
-0.043192971497774124,
0.01972116157412529,
0.025189850479364395,
0.02787579968571663,
0.0242945346981287,
-0.0012953354744240642,
-0.01... | 18 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Global", "_fields": {"names": ["indent"]}}, {"_type": "Assign"... | def main():
global indent
parser = argparse.ArgumentParser(
description="Performs static timing analysis")
parser.add_argument(
"--schema_dir",
required=True,
help="Path to FPGA interchange capnp schema files")
parser.add_argument(
"--physical_netlist",
r... | |
1,639 | [
0.033157024532556534,
0.03696155175566673,
0.012577995657920837,
-0.004994882270693779,
-0.012693284079432487,
0.027138955891132355,
0.019702836871147156,
0.000021898094928474165,
-0.018054207786917686,
0.0001886050886241719,
0.026723917573690414,
-0.002013228600844741,
-0.026170531287789345... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Return", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def getregentry():
return codecs.CodecInfo(
name='cp1253',
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
incrementaldecoder=IncrementalDecoder,
streamreader=StreamReader,
streamwriter=StreamWriter,
) | |
1,640 | [
0.02835741825401783,
-0.002983011305332184,
-0.02904539182782173,
-0.043922822922468185,
0.009680005721747875,
0.0017857756465673447,
-0.04738419130444527,
0.007599960081279278,
0.052672989666461945,
0.021617425605654716,
0.015457910485565662,
-0.05942373350262642,
-0.01627487875521183,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "s", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def _parseparam(s):
while s[:1] == ';':
s = s[1:]
end = s.find(';')
while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2:
end = s.find(';', end + 1)
if end < 0:
end = len(s)
f = s[:end]
yield f.strip()
s = s[end:] | |
1,641 | [
0.012079084292054176,
0.008359532803297043,
0.04758503660559654,
-0.02592337876558304,
-0.0448615662753582,
0.019013840705156326,
0.03885985165834427,
-0.038910284638404846,
-0.003990636672824621,
0.03848159313201904,
0.022720782086253166,
0.02236774004995823,
-0.03179900720715523,
0.00888... | 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": "syncword_threshold", "annotation": null, "type_comment": null}}, ... | def __init__(self, syncword_threshold=None, options=None):
gr.hier_block2.__init__(
self,
'fossasat_deframer',
gr.io_signature(1, 1, gr.sizeof_float),
gr.io_signature(0, 0, 0))
options_block.__init__(self, options)
self.message_port_register_hier_... | |
1,642 | [
0.022653374820947647,
0.04047967493534088,
-0.054706837981939316,
-0.03277329355478287,
0.04805902764201164,
-0.04333781078457832,
-0.020377451553940773,
0.0032498063519597054,
0.012078271247446537,
-0.030656155198812485,
0.03848956525325775,
0.013253282755613327,
0.05013382062315941,
-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": "name", "annotation": null, "type_comment": null}}], "kwarg": null... | def __getattr__(self, name):
if name != 'value':
raise AttributeError(name)
if self.file:
self.file.seek(0)
value = self.file.read()
self.file.seek(0)
elif self.list is not None:
value = self.list
else:
value = None
... | |
1,643 | [
0.031665753573179245,
0.010418194346129894,
0.009804337285459042,
-0.02173980139195919,
-0.002338157966732979,
0.006955114658921957,
-0.007285207975655794,
-0.0019458106253296137,
0.004954288713634014,
0.0004198549722786993,
0.05253688618540764,
-0.011744357645511627,
0.00030475680250674486,... | 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": "fd", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _invoke_callback(self, fd, events):
if fd not in self._fds:
return
(reader, writer) = self._fds[fd]
if reader:
err = None
if reader.fileno() == -1:
err = error.ConnectionLost()
elif events & IOLoop.READ:
err = lo... | |
1,644 | [
0.025163425132632256,
0.024975111708045006,
-0.009639310650527477,
-0.007785596884787083,
-0.014347153715789318,
-0.002634921343997121,
-0.0017419022042304277,
-0.015794815495610237,
-0.017524948343634605,
-0.006579211913049221,
-0.03912218287587166,
-0.0026246230117976665,
-0.01579481549561... | 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": "io_loop", "annotation": null, "type_comment": null}}], "kwarg": n... | def __init__(self, io_loop=None):
if not io_loop:
io_loop = tornado.ioloop.IOLoop.current()
self._io_loop = io_loop
self._readers = {} # map of reader objects to fd
self._writers = {} # map of writer objects to fd
self._fds = {} # a map of fd to a (reader, writer) ... | |
1,645 | [
0.016273237764835358,
0.0068497913889586926,
-0.006434135138988495,
-0.02842407301068306,
0.030360007658600807,
0.01727536879479885,
-0.00015836227976251394,
-0.026146503165364265,
0.024666082113981247,
0.00834729429334402,
0.026078175753355026,
-0.03762545436620712,
0.018972158432006836,
... | 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": "fd", "annotation": nul... | class _FD(object):
def __init__(self, fd, fileobj, handler):
self.fd = fd
self.fileobj = fileobj
self.handler = handler
self.reading = False
self.writing = False
self.lost = False
def fileno(self):
return self.fd
def doRead(self):
if not self... | |
1,646 | [
0.047203827649354935,
0.042235005646944046,
0.030007800087332726,
-0.02109314501285553,
-0.024929368868470192,
0.026159396395087242,
-0.010570929385721684,
0.00580609543249011,
0.0017993719084188342,
-0.0009491610690020025,
0.03872760012745857,
-0.06371786445379257,
0.010936284437775612,
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": "all_fds", "annotation": null, "type_comment": null}}], "kwarg": n... | def close(self, all_fds=False):
fds = self.fds
self.reactor.removeAll()
for c in self.reactor.getDelayedCalls():
c.cancel()
if all_fds:
for fd in fds.values():
self.close_fd(fd.fileobj) | |
1,647 | [
0.03723902255296707,
-0.01731308549642563,
0.033590447157621384,
-0.02610497921705246,
0.01770148240029812,
0.004039916209876537,
-0.02709362655878067,
-0.03260179981589317,
0.01693645864725113,
0.021761996671557426,
0.024833861738443375,
-0.03297842666506767,
0.020349644124507904,
0.00378... | 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": "fd", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def add_handler(self, fd, handler, events):
if fd in self.fds:
raise ValueError('fd %s added twice' % fd)
fd, fileobj = self.split_fd(fd)
self.fds[fd] = _FD(fd, fileobj, wrap(handler))
if events & tornado.ioloop.IOLoop.READ:
self.fds[fd].reading = True
... | |
1,648 | [
0.05216642841696739,
0.005746054463088512,
0.017509326338768005,
-0.01982066035270691,
0.018955523148179054,
0.011272597126662731,
0.009109755977988243,
-0.03636154904961586,
0.013880917802453041,
0.013764705508947372,
0.019885221496224403,
-0.021408895030617714,
-0.02084074541926384,
0.02... | 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": "fd", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def update_handler(self, fd, events):
fd, fileobj = self.split_fd(fd)
if events & tornado.ioloop.IOLoop.READ:
if not self.fds[fd].reading:
self.fds[fd].reading = True
self.reactor.addReader(self.fds[fd])
else:
if self.fds[fd].reading:
... | |
1,649 | [
0.00401195976883173,
-0.0005519226542674005,
0.026954136788845062,
-0.02246920019388199,
-0.00867495872080326,
0.014890436083078384,
-0.003166165202856064,
0.011151133105158806,
0.03067118115723133,
0.019753754138946533,
-0.03187309950590134,
-0.011963541619479656,
0.004145506303757429,
-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": "deadline", "annotation": null, "type_comment": null}}, {"_type": ... | def add_timeout(self, deadline, callback, *args, **kwargs):
# This method could be simplified (since tornado 4.0) by
# overriding call_at instead of add_timeout, but we leave it
# for now as a test of backwards-compatibility.
if isinstance(deadline, numbers.Real):
delay = max... | |
1,650 | [
0.05962364748120308,
0.03434419259428978,
0.013003287836909294,
-0.03579842671751976,
0.0030069344211369753,
0.018117347732186317,
-0.04210011288523674,
0.0021404526196420193,
0.028963521122932434,
0.025909626856446266,
0.0782378613948822,
-0.045444853603839874,
0.004159718751907349,
0.026... | 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": "fd", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def remove_handler(self, fd):
fd, fileobj = self.split_fd(fd)
if fd not in self.fds:
return
self.fds[fd].lost = True
if self.fds[fd].reading:
self.reactor.removeReader(self.fds[fd])
if self.fds[fd].writing:
self.reactor.removeWriter(self.fds[fd... | |
1,651 | [
0.02565176412463188,
0.02020692452788353,
0.008671845309436321,
-0.0026050738524645567,
0.013107511214911938,
-0.02865581214427948,
-0.0012974030105397105,
-0.028022145852446556,
-0.04170465096831322,
0.0036289149429649115,
-0.005342161748558283,
0.01419882569462061,
0.010619782842695713,
... | 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": "io_loop", "annotation": null, "type_comment": null}}], "kwarg": n... | def initialize(self, io_loop=None):
self.io_loop = io_loop or IOLoop.current()
# partial copy of twisted.names.client.createResolver, which doesn't
# allow for a reactor to be passed in.
self.reactor = tornado.platform.twisted.TornadoReactor(io_loop)
host_resolver = twisted.name... | |
1,652 | [
-0.03816889598965645,
-0.015389589592814445,
0.018372593447566032,
0.007915130816400051,
0.004581849090754986,
-0.03369439020752907,
-0.06878988444805145,
-0.02867751754820347,
-0.018903659656643867,
0.021457292139530182,
0.0037315802183002234,
0.036067232489585876,
0.0003368591424077749,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "host", "annotation": null, "type_comment": null}}, {"_type": "arg... | def resolve(self, host, port, family=0):
# getHostByName doesn't accept IP addresses, so if the input
# looks like an IP address just return it immediately.
if twisted.internet.abstract.isIPAddress(host):
resolved = host
resolved_family = socket.AF_INET
elif twist... | |
1,653 | [
0.030058830976486206,
0.061188697814941406,
0.014587031677365303,
-0.039791278541088104,
0.001493046060204506,
0.004447123501449823,
-0.0002608465147204697,
0.012503169476985931,
0.044261686503887177,
0.057509925216436386,
-0.007695153821259737,
-0.005253310315310955,
0.014854789711534977,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def tool_decorator(f):
if not hasattr(f, "_cp_config"):
f._cp_config = {}
subspace = self.namespace + "." + self._name + "."
f._cp_config[subspace + "on"] = True
for k, v in kwargs.items():
f._cp_config[subspace + k] = v
return ... | |
1,654 | [
-0.00732922088354826,
-0.024485399946570396,
0.009227754548192024,
0.027020983397960663,
0.002932949922978878,
0.02639024145901203,
0.02326176129281521,
0.019136710092425346,
0.05757412314414978,
0.04702811688184738,
0.021634448319673538,
-0.06135857105255127,
-0.0024535860866308212,
-0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "d", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def _(d):
f = Future()
def errback(failure):
try:
failure.raiseException()
# Should never happen, but just in case
raise Exception("errback called without error")
except:
f.set_exc_info(sys.exc_info())
d.addC... | |
1,655 | [
0.016335727646946907,
-0.023950878530740738,
0.0011476462241262197,
-0.03832140564918518,
0.04257114976644516,
-0.004292734432965517,
-0.008554762229323387,
0.0431852750480175,
0.016470834612846375,
-0.03613511845469475,
0.023987725377082825,
-0.03200819715857506,
-0.03163972496986389,
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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def _wrapper(self, **kwargs):
request = cherrypy.serving.request
if _caching.get(**kwargs):
request.handler = None
else:
if request.cacheable:
# Note the devious technique here of adding hooks on the fly
request.hooks.attach('before_finaliz... | |
1,656 | [
-0.007446428295224905,
0.03535313904285431,
0.033450935035943985,
-0.0010750635992735624,
0.023661548271775246,
-0.009957568719983101,
-0.03843841701745987,
0.009609604254364967,
0.06472129374742508,
-0.0037957066670060158,
0.009395026601850986,
-0.061891186982393265,
0.026120493188500404,
... | 11 | {"_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": "params", "annotation": null, "type_comment": null}}, "v... | def default(self, *vpath, **params):
rpcparams, rpcmethod = _xmlrpc.process_body()
subhandler = self
for attr in str(rpcmethod).split('.'):
subhandler = getattr(subhandler, attr, None)
if subhandler and getattr(subhandler, "exposed", False):
bod... | |
1,657 | [
0.06514771282672882,
0.025868872180581093,
0.043986592441797256,
0.008945922367274761,
0.023384224623441696,
0.008410950191318989,
0.026320626959204674,
-0.009272849187254906,
-0.012708558700978756,
-0.024394726380705833,
0.05459092929959297,
-0.014242145232856274,
0.029364023357629776,
-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": "cr", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def init(self, cr):
return # Don't do the following index yet.
# CONSTRAINT/UNIQUE INDEX on (code, company_id)
# /!\ The unique constraint 'unique_name_company_id' is not sufficient, because SQL92
# only support field names in constraint definitions, and we need a function here:
... | |
1,658 | [
-0.02161233127117157,
0.06551948934793472,
-0.0020062499679625034,
-0.013024273328483105,
-0.04217817261815071,
-0.011073475703597069,
-0.016129624098539352,
0.0032759744208306074,
0.005488394759595394,
0.005263740196824074,
-0.022852197289466858,
-0.017164740711450577,
0.007200318854302168,... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_t... | class DeprecatedTool(Tool):
_name = None
warnmsg = "This Tool is deprecated."
def __init__(self, point, warnmsg=None):
self.point = point
if warnmsg is not None:
self.warnmsg = warnmsg
def __call__(self, *args, **kwargs):
warnings.warn(self.warnmsg)
... | |
1,659 | [
0.014841003343462944,
-0.013782557100057602,
0.03282320126891136,
-0.010755174793303013,
0.028612179681658745,
0.013782557100057602,
0.04484168067574501,
0.049257561564445496,
0.028179695829749107,
-0.0018039102433249354,
-0.016684748232364655,
-0.029522670432925224,
-0.019985277205705643,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "number_next", "annotation": null, "type_comment": null}}], "kwarg... | def get_next_char(self, number_next):
def _interpolate(s, d):
if s:
return s % d
return ''
def _interpolation_dict():
now = range_date = effective_date = datetime.now(pytz.timezone(self.env.context.get('tz') or 'UTC'))
if self.env.context.... | |
1,660 | [
0.054452311247587204,
0.02226523496210575,
0.05230563506484032,
-0.045734703540802,
0.020629048347473145,
-0.004041382577270269,
0.027540303766727448,
-0.008927037939429283,
0.026519322767853737,
0.03442537784576416,
0.06796067208051682,
-0.02560305781662464,
-0.03141479566693306,
-0.00236... | 14 | {"_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 write(self, values):
new_implementation = values.get('implementation')
for seq in self:
# 4 cases: we test the previous impl. against the new one.
i = values.get('number_increment', seq.number_increment)
n = values.get('number_next', seq.number_next)
i... | |
1,661 | [
0.010205267928540707,
0.008214529603719711,
0.06431615352630615,
-0.04830274358391762,
0.023670095950365067,
-0.05119040980935097,
0.022816922515630722,
0.008274689316749573,
-0.03163304924964905,
0.018430735915899277,
0.008395008742809296,
-0.027957839891314507,
0.023013807833194733,
-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": "date", "annotation": null, "type_comment": null}}], "kwarg": null... | def _create_date_range_seq(self, date):
year = fields.Date.from_string(date).strftime('%Y')
date_from = '{}-01-01'.format(year)
date_to = '{}-12-31'.format(year)
date_range = self.env['ir.sequence.date_range'].search([('sequence_id', '=', self.id), ('date_from', '>=', date), ('date_from'... | |
1,662 | [
-0.006154223810881376,
-0.014208108186721802,
0.05912551283836365,
-0.040218837559223175,
0.0314062125980854,
0.01365731842815876,
0.04039868712425232,
0.013331341557204723,
-0.030731776729226112,
0.006350934039801359,
0.01769269071519375,
-0.01709694042801857,
-0.02513396367430687,
-0.048... | 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 _interpolation_dict():
now = range_date = effective_date = datetime.now(pytz.timezone(self.env.context.get('tz') or 'UTC'))
if self.env.context.get('ir_sequence_date'):
effective_date = datetime.strptime(self.env.context.get('ir_sequence_date'), '%Y-%m-%d')
if sel... | |
1,663 | [
0.014440055936574936,
0.05525260418653488,
0.0074591017328202724,
-0.004359111655503511,
-0.0017598485574126244,
0.019901562482118607,
0.02826383151113987,
0.0456896536052227,
0.024247393012046814,
-0.0389743372797966,
0.02358861267566681,
-0.0015513231046497822,
-0.03276904299855232,
0.01... | 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": "session_context", "annotation": null, "type_comment": null}}], "k... | def on_session_destroyed(self, session_context):
# this should be no-op'd, because the session is already destroyed
@gen.coroutine
def shutdown_document(doc):
doc.roots[0].hooks.append("session_destroyed")
self.session_creation_async_value = yield async_value(4)
... | |
1,664 | [
0.0497831366956234,
-0.0021472747903317213,
0.005236972589045763,
-0.02811610698699951,
-0.0043177478946745396,
0.05358762666583061,
-0.005442855879664421,
-0.0004889725823886693,
0.0021777222864329815,
0.00602570828050375,
0.04774170368909836,
-0.008328120224177837,
-0.02421882376074791,
... | 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": "server_context", "annotation": null, "type_comment": null}}], "kw... | def on_server_loaded(self, server_context):
assert len(server_context.sessions) == 0
self.load_count += 1
self.hooks.append("server_loaded")
server_context.add_next_tick_callback(self.on_next_tick_server)
server_context.add_timeout_callback(self.on_timeout_server, 2)
per... | |
1,665 | [
-0.022268716245889664,
-0.023299675434827805,
0.04987264424562454,
-0.07763122022151947,
0.03244943544268608,
0.02336410991847515,
-0.00527722155675292,
-0.006414498668164015,
0.04448588564991951,
0.022938840091228485,
0.023119257763028145,
-0.08010552078485489,
0.005650944542139769,
0.003... | 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_get_sessions():
application = Application()
with ManagedServerLoop(application) as server:
server_sessions = server.get_sessions('/')
assert len(server_sessions) == 0
http_get(server.io_loop, url(server))
server_sessions = server.get_sessions('/')
assert len(ser... | |
1,666 | [
-0.020340530201792717,
-0.002920276951044798,
0.03310920670628548,
-0.03633077070116997,
-0.004376741126179695,
-0.01103444304317236,
0.006895792204886675,
-0.01590793952345848,
-0.009770508855581284,
-0.007195609156042337,
-0.013650493696331978,
-0.01078165601938963,
-0.021151799708604813,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_base_server():
app = BokehTornado(Application())
httpserver = HTTPServer(app)
httpserver.start()
loop = IOLoop()
loop.make_current()
server = BaseServer(loop, app, httpserver)
server.start()
assert server.io_loop == loop
assert server._tornado.io_loop == loop
httpser... | |
1,667 | [
0.00675035547465086,
0.009584341198205948,
0.0462515763938427,
-0.05116304010152817,
0.021938655525445938,
0.023928847163915634,
0.008816197514533997,
0.006855102721601725,
0.05344419553875923,
0.03230859711766243,
0.043504878878593445,
-0.04958019778132439,
-0.03992020711302757,
-0.009421... | 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__lifecycle_hooks():
application = Application()
handler = HookTestHandler()
application.add(handler)
with ManagedServerLoop(application, check_unused_sessions_milliseconds=30) as server:
# wait for server callbacks to run before we mix in the
# session, this keeps the test deter... | |
1,668 | [
0.02566436305642128,
0.018175311386585236,
0.021069053560495377,
-0.03552693501114845,
-0.020321233198046684,
0.023713523522019386,
-0.026206262409687042,
-0.0015227376716211438,
0.01725408062338829,
0.00698508508503437,
0.021556764841079712,
-0.03949363902211189,
-0.01597519777715206,
-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": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fie... | def test_server_applications_callable_arg():
def modify_doc(doc):
doc.title = "Hello, world!"
with ManagedServerLoop(modify_doc, port=0) as server:
http_get(server.io_loop, url(server))
session = server.get_sessions('/')[0]
assert session.document.title == "Hello, world!"
w... | |
1,669 | [
-0.031257908791303635,
-0.010123949497938156,
0.03185242414474487,
-0.031783826649188995,
0.06864392012357712,
-0.011158638633787632,
0.011227237060666084,
0.032835666090250015,
0.038094859570264816,
0.021013911813497543,
0.03962688520550728,
-0.08094586431980133,
-0.004790440201759338,
-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__request_in_session_context():
application = Application()
with ManagedServerLoop(application) as server:
response = http_get(server.io_loop,
url(server) + "?foo=10")
html = response.body
sessionid = extract_sessionid_from_json(html)
server_s... | |
1,670 | [
-0.008742710575461388,
-0.009333736263215542,
0.02952895127236843,
-0.04052424803376198,
0.0439588837325573,
-0.013069460168480873,
-0.00999724492430687,
0.02422087825834751,
0.028346901759505272,
0.05473115295171738,
0.026518069207668304,
-0.07444685697555542,
0.004887108225375414,
0.0106... | 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__no_request_arguments_in_session_context():
application = Application()
with ManagedServerLoop(application) as server:
response = http_get(server.io_loop,
url(server))
html = response.body
sessionid = extract_sessionid_from_json(html)
server_... | |
1,671 | [
-0.0005144349997863173,
0.01740439608693123,
0.009958833456039429,
-0.0652947649359703,
0.0067041483707726,
-0.015406346879899502,
-0.008626800030469894,
-0.022895891219377518,
0.040614448487758636,
0.019427578896284103,
0.029455527663230896,
-0.050215139985084534,
0.001712165423668921,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test__no_set_title_autoload():
application = Application()
with ManagedServerLoop(application) as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
response = http_get(server.io_loop,
autoload_url(server))
js = response.body
... | |
1,672 | [
0.011541023850440979,
-0.001593142980709672,
0.05656275153160095,
-0.05369756370782852,
0.032109860330820084,
-0.022760950028896332,
-0.0025101264473050833,
-0.0014472592156380415,
0.03764263540506363,
0.034209348261356354,
0.0285777747631073,
-0.06881389766931534,
0.008780810981988907,
-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__autocreate_session_autoload():
application = Application()
with ManagedServerLoop(application) as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
response = http_get(server.io_loop,
autoload_url(server))
js = response.b... | |
1,673 | [
0.01971922256052494,
0.012318658642470837,
0.06285794824361801,
-0.058455079793930054,
0.0093853659927845,
-0.03423931449651718,
0.019332800060510635,
-0.023899603635072708,
0.039953675121068954,
0.04955567046999931,
0.04721371829509735,
-0.05156974866986275,
0.006375960074365139,
-0.01968... | 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__no_autocreate_session_websocket():
application = Application()
with ManagedServerLoop(application) as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
websocket_open(server.io_loop,
ws_url(server) + "?bokeh-protocol-version=1.0")
... | |
1,674 | [
0.007905707694590092,
0.0019206218421459198,
0.06369210034608841,
-0.05208466202020645,
0.022098777815699577,
-0.024963432922959328,
0.011334613896906376,
0.004703120794147253,
0.04305665194988251,
0.03767457231879234,
0.042238179594278336,
-0.07415863871574402,
0.011043188162147999,
-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": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test__autocreate_session_doc():
application = Application()
with ManagedServerLoop(application) as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
response = http_get(server.io_loop,
url(server))
html = response.body
... | |
1,675 | [
-0.0007979855872690678,
-0.011715206317603588,
0.029795613139867783,
-0.0585947185754776,
0.048828933387994766,
-0.00446560513228178,
-0.022110039368271828,
-0.006763803772628307,
0.04020912945270538,
0.022546011954545975,
0.04225197434425354,
-0.05884384363889694,
-0.0004523215757217258,
... | 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__use_provided_session_autoload():
application = Application()
with ManagedServerLoop(application) as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
expected = 'foo'
response = http_get(server.io_loop,
autoload_url(serve... | |
1,676 | [
0.0019338761921972036,
-0.0009708370780572295,
0.031540896743535995,
-0.05953843519091606,
0.03673117235302925,
0.00013997209316585213,
-0.010343118570744991,
0.002796322572976351,
0.04875863343477249,
0.02749847248196602,
0.054248347878456116,
-0.06457898765802383,
-0.001311604748480022,
... | 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__use_provided_session_doc():
application = Application()
with ManagedServerLoop(application) as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
expected = 'foo'
response = http_get(server.io_loop,
url(server) + "?bokeh-s... | |
1,677 | [
0.0012377892853692174,
-0.010971550829708576,
0.02518645115196705,
-0.04611971601843834,
0.03602137789130211,
-0.018450262024998665,
0.004784831777215004,
-0.0058926790952682495,
0.04676125943660736,
0.040630970150232315,
0.060732610523700714,
-0.04918485879898071,
-0.004131409339606762,
-... | 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__use_provided_session_websocket():
application = Application()
with ManagedServerLoop(application) as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
expected = 'foo'
url = ws_url(server) + \
"?bokeh-protocol-version=1.0" + \
... | |
1,678 | [
0.02727656625211239,
0.00780104985460639,
0.04277023673057556,
-0.05778198316693306,
0.018589992076158524,
-0.0050179725512862206,
-0.008584166876971722,
-0.020951390266418457,
0.03479449078440666,
0.0221441388130188,
0.03611976280808449,
-0.06308308243751526,
-0.005554106552153826,
-0.017... | 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__autocreate_signed_session_autoload():
application = Application()
with ManagedServerLoop(application, sign_sessions=True, secret_key='foo') as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
response = http_get(server.io_loop,
... | |
1,679 | [
0.028194384649395943,
0.011021106503903866,
0.05118213966488838,
-0.053834572434425354,
0.00782836228609085,
-0.0017360544297844172,
0.00320502370595932,
-0.013249887153506279,
0.033744845539331436,
0.028341742232441902,
0.04732628911733627,
-0.06640907377004623,
-0.0045281704515218735,
-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__autocreate_signed_session_doc():
application = Application()
with ManagedServerLoop(application, sign_sessions=True, secret_key='foo') as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
response = http_get(server.io_loop,
url(s... | |
1,680 | [
0.03641413897275925,
0.0004992613103240728,
0.027516229078173637,
-0.058372288942337036,
0.008592590689659119,
0.029859095811843872,
-0.03975397348403931,
-0.021434742957353592,
0.03040742687880993,
0.04060139134526253,
0.03975397348403931,
-0.08190065622329712,
-0.013110087253153324,
0.00... | 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__reject_unsigned_session_autoload():
application = Application()
with ManagedServerLoop(application, sign_sessions=True, secret_key='bar') as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
expected = 'foo'
with (pytest.raises(HTTPError)) as info:
... | |
1,681 | [
0.02696460857987404,
0.001903438358567655,
0.02789865992963314,
-0.054617464542388916,
0.003302980214357376,
0.03637887164950371,
-0.02411329187452793,
-0.012658863328397274,
0.035592298954725266,
0.041196610778570175,
0.05016842857003212,
-0.09030808508396149,
-0.01959051378071308,
0.0079... | 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__reject_unsigned_session_doc():
application = Application()
with ManagedServerLoop(application, sign_sessions=True, secret_key='bar') as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
expected = 'foo'
with (pytest.raises(HTTPError)) as info:
... | |
1,682 | [
0.023527411743998528,
-0.003434069687500596,
0.02088535949587822,
-0.05250629782676697,
-0.003969055134803057,
0.0215070191770792,
-0.012253860011696815,
-0.024412080645561218,
0.04004920274019241,
0.04915890097618103,
0.065800242125988,
-0.07665536552667618,
-0.025822769850492477,
0.00750... | 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__reject_unsigned_session_websocket():
application = Application()
with ManagedServerLoop(application, sign_sessions=True, secret_key='bar') as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
expected = 'foo'
url = ws_url(server) + \
"... | |
1,683 | [
0.007934671826660633,
0.0032301219180226326,
0.04452890157699585,
-0.061914123594760895,
0.010350600816309452,
-0.0076622869819402695,
-0.002790458034723997,
-0.026646284386515617,
0.03583629056811333,
0.02823321893811226,
0.03676002845168114,
-0.07337794452905655,
0.006845134310424328,
-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__no_generate_session_doc():
application = Application()
with ManagedServerLoop(application, generate_session_ids=False) as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
with (pytest.raises(HTTPError)) as info:
http_get(server.io_loop, url(ser... | |
1,684 | [
0.02006988227367401,
-0.0008001232636161149,
0.045008789747953415,
-0.06275103986263275,
0.01631717011332512,
-0.008942379616200924,
-0.015545252710580826,
-0.03429693728685379,
0.030567975714802742,
0.03028295934200287,
0.027290290221571922,
-0.06617123633623123,
0.0054954662919044495,
-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__no_generate_session_autoload():
application = Application()
with ManagedServerLoop(application, generate_session_ids=False) as server:
sessions = server.get_sessions('/')
assert 0 == len(sessions)
with (pytest.raises(HTTPError)) as info:
http_get(server.io_loop, au... | |
1,685 | [
-0.016009241342544556,
-0.01083538681268692,
0.0700908824801445,
-0.04645819216966629,
0.02513495832681656,
0.023834487423300743,
-0.017085494473576546,
-0.011272613890469074,
0.018565339967608452,
0.010947496630251408,
0.020459990948438644,
-0.010039408691227436,
-0.024148395285010338,
-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": "With", "_fields": {"body": [{"_type": "With", "_fields": {"bod... | def test__server_multiple_processes():
# Can't use an ioloop in this test
with mock.patch('tornado.httpserver.HTTPServer.add_sockets'):
with mock.patch('tornado.process.fork_processes') as tornado_fp:
application = Application()
server.Server(application, num_procs=3, port=0)
... | |
1,686 | [
0.011587009765207767,
0.01961500756442547,
-0.008695312775671482,
-0.04378662630915642,
-0.0076370458118617535,
0.011721820570528507,
-0.002780477749183774,
-0.004145439714193344,
0.06012572720646858,
0.014532630331814289,
0.022055087611079216,
-0.008877307176589966,
-0.04219585657119751,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test__ioloop_not_forcibly_stopped():
# Issue #5494
application = Application()
loop = IOLoop()
loop.make_current()
server = Server(application, io_loop=loop)
server.start()
result = []
def f():
server.unlisten()
server.stop()
# If server.stop() were to stop t... | |
1,687 | [
0.06992517411708832,
-0.033499035984277725,
0.013590107671916485,
-0.03591505438089371,
-0.0291780773550272,
-0.03858661279082298,
-0.014891041442751884,
-0.002716569695621729,
-0.002731089014559984,
0.013566876761615276,
0.04971424117684364,
-0.06058632582426071,
-0.03387073054909706,
-0.... | 7 | {"_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 Payload:
def __init__(self):
self.received = ''
self.publication_date = ''
self.online_date = ''
self.authors = List(Author)
self.issues = Dict({'first': '', 'last': ''})
self.keywords = List(str)
self.references = ''
self.language = ''
s... | |
1,688 | [
0.045490529388189316,
-0.04394109174609184,
0.013085487298667431,
-0.02706674486398697,
-0.036968622356653214,
-0.033506594598293304,
0.0014715121360495687,
-0.023362619802355766,
-0.025517305359244347,
0.037138089537620544,
0.03512866422533989,
-0.06943418830633163,
-0.04546631872653961,
... | 6 | {"_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 __init__(self):
self.received = ''
self.publication_date = ''
self.online_date = ''
self.authors = List(Author)
self.issues = Dict({'first': '', 'last': ''})
self.keywords = List(str)
self.references = ''
self.language = ''
self.journal_title =... | |
1,689 | [
0.006925647612661123,
0.0076417336240410805,
-0.03610745444893837,
-0.015084845013916492,
0.02201571874320507,
-0.024712802842259407,
-0.028727063909173012,
-0.02047901041805744,
0.00030773397884331644,
0.03583565354347229,
-0.043153319507837296,
-0.03226045146584511,
0.029061585664749146,
... | 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}}, {"_type": "arg", "_fields": {"arg": "type", "annotation": n... | class List:
def __init__(self, type):
self.__type = type
self.__data = []
def append(self, item):
if type(item) is self.__type:
self.__data.append(item)
else:
raise ListException('Expect data-type: %s instead of %s' % (type(self.__type), type(item)))
... | |
1,690 | [
0.036828819662332535,
-0.016041532158851624,
0.032476723194122314,
-0.008201192133128643,
0.002864949870854616,
0.002588842995464802,
0.01443409826606512,
-0.013810807839035988,
-0.05996711924672127,
0.030049169436097145,
0.019179854542016983,
-0.051087960600852966,
0.011601953767240047,
-... | 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": "surname", "annotation"... | class Author:
def __init__(self, surname='', firstname='', affiliations=None):
self.firstname = firstname
self.surname = surname
self.affiliations = List(Affiliation)
if affiliations:
for institute in affiliations:
self.affiliations.append(Affiliation(inst... | |
1,691 | [
0.05105824023485184,
0.002867677016183734,
-0.05136267840862274,
-0.03485790640115738,
0.03570597618818283,
-0.009448383934795856,
-0.010394309647381306,
-0.017983460798859596,
-0.01836400479078293,
-0.004707883112132549,
0.027725407853722572,
-0.030356602743268013,
0.0202776025980711,
-0.... | 14 | {"_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": "attribute", "annotation": null, "type_comment": null}}], "kwarg":... | def __encode(self, attribute):
if type(attribute) is str or type(attribute) is int:
return attribute
elif type(attribute) is dict:
return self.__encode_dict(attribute)
elif type(attribute) is list:
return self.__encode_list(attribute)
elif isinstance(a... | |
1,692 | [
0.04238966107368469,
-0.005216594785451889,
-0.050272516906261444,
-0.0015710161533206701,
-0.009051757864654064,
0.017997251823544502,
0.014896276406943798,
0.01612314209342003,
0.030565381050109863,
-0.03406243026256561,
0.017108498141169548,
-0.022663205862045288,
0.015765707939863205,
... | 15 | {"_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": "obj", "annotation": nu... | class PayloadEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, Payload):
struct = obj.__dict__
jsonable = self.__encode(struct)
return jsonable
return super().default(obj)
def __encode(self, attribute):
if type(attribute) is str or... | |
1,693 | [
0.031888291239738464,
-0.010589470155537128,
-0.043876372277736664,
-0.038801416754722595,
0.0209191981703043,
0.013466608710587025,
0.002455058740451932,
-0.006428607739508152,
0.0035789411049336195,
0.00627875654026866,
0.028911251574754715,
-0.017033062875270844,
0.017152942717075348,
-... | 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": "attribute", "annotation": null, "type_comment": null}}], "kwarg":... | def __encode_list(self, attribute):
new_list = []
if type(attribute) is dict:
for item in attribute['_List__data']:
new_list.append(self.__encode(item))
elif type(attribute) is list:
for item in attribute:
new_list.append(self.__encode(item... | |
1,694 | [
-0.020669497549533844,
0.007120510563254356,
0.014229582622647285,
-0.015339124016463757,
0.010958150960505009,
0.025874048471450806,
0.013600461184978485,
0.027429692447185516,
-0.03568834066390991,
0.011724535375833511,
0.0481792613863945,
0.0018673466984182596,
-0.015362001024186611,
0.... | 16 | {"_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 upgrade():
ip_policy_cidrs = table('quark_ip_policy_cidrs',
column('id', sa.String(length=36)),
column('created_at', sa.DateTime()),
column('ip_policy_id', sa.String(length=36)),
column('cidr', sa.Str... | |
1,695 | [
0.007002988364547491,
0.015699133276939392,
0.015480290167033672,
-0.000741475960239768,
-0.009957374073565006,
0.01587190479040146,
-0.004241530317813158,
-0.034116532653570175,
0.009450579062104225,
-0.02068645879626274,
0.009341157041490078,
-0.025938700884580612,
0.05044915899634361,
-... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Fix inconsistent email_opt_out records between 54d4c141842886724df99e7c6975cedba442d2ff and dd295c2815037e2c63b82be6c43038eeb94d7cf2. Ta... | class Command(BaseCommand):
help = ("Fix inconsistent email_opt_out records between "
"54d4c141842886724df99e7c6975cedba442d2ff and "
"dd295c2815037e2c63b82be6c43038eeb94d7cf2. "
"Takes YYYY MM DD as arguments")
option_list = BaseCommand.option_list + (
make_option(... | |
1,696 | [
0.0006084101041778922,
0.030666891485452652,
0.00396033376455307,
0.0011903675040230155,
-0.01492229662835598,
-0.009226671420037746,
0.01321723684668541,
-0.005299591924995184,
0.032746821641922,
-0.02170625701546669,
0.03202126547694206,
-0.0037063888739794493,
0.0551423579454422,
0.0081... | 14 | {"_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": "options", "annotation": null, "type_comment": null}}, "... | def handle(self, *args, **options):
run_fix = options.get(RUN_FIX, False)
for user in CouchUser.all():
doc_json = CouchUser.get_db().get(user.get_id)
if (doc_json.get('doc_type', None) == 'WebUser'
and (user.created_on is not None
and ... | |
1,697 | [
-0.0036299871280789375,
-0.07136428356170654,
0.06806973367929459,
0.0016231987392529845,
-0.016472768038511276,
-0.0423775240778923,
0.0085751386359334,
0.027472326532006264,
0.026369713246822357,
-0.009478484280407429,
0.037037160247564316,
0.011165614239871502,
-0.058398619294166565,
-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 do_one_round(self):
a0 = self.nodes[0].getnewaddress()
a1 = self.nodes[1].getnewaddress()
a2 = self.nodes[2].getnewaddress()
self.one_send(0, a1)
self.one_send(0, a2)
self.one_send(1, a0)
self.one_send(1, a2)
self.one_send(2, a0)
self.one_send... | |
1,698 | [
-0.001640166505239904,
-0.03415670990943909,
0.04588599503040314,
-0.03549719974398613,
0.0036605680361390114,
-0.04080760106444359,
-0.005187952890992165,
0.03603855147957802,
0.0028485406655818224,
0.014642272144556046,
0.004627267364412546,
0.040988050401210785,
-0.009976336732506752,
-... | 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 WalletBackupTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.setup_clean_chain = True
# nodes 1, 2,3 are spenders, let's give them a keypool=100
# whitelist all peers to speed up tx relay / mempool sync
self.extra_args = [
["-wh... | |
1,699 | [
0.031072864308953285,
0.02318400889635086,
0.012242414988577366,
0.0026409837882965803,
0.0001799776655388996,
-0.05966997146606445,
-0.016763821244239807,
0.029037708416581154,
0.00531081622466445,
0.0231210645288229,
-0.005538984667509794,
0.03608732670545578,
0.007196484133601189,
-0.04... | 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 restore_invalid_wallet(self):
node = self.nodes[3]
invalid_wallet_file = os.path.join(self.nodes[0].datadir, 'invalid_wallet_file.bak')
open(invalid_wallet_file, 'a', encoding="utf8").write('invald wallet')
wallet_name = "res0"
not_created_wallet_file = os.path.join(node.data... | |
1,700 | [
-0.005402788985520601,
-0.030757984146475792,
0.04151616990566254,
-0.051373887807130814,
-0.017902662977576256,
-0.01640978641808033,
0.020141975954174995,
0.03305653855204582,
0.0019668047316372395,
0.03528400510549545,
-0.004893315490335226,
-0.0029901950620114803,
0.0250945333391428,
-... | 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": "args", "annotation": null, "type_comment": null}}], "kwarg": null... | def start_three(self, args=()):
self.start_node(0, self.extra_args[0] + list(args))
self.start_node(1, self.extra_args[1] + list(args))
self.start_node(2, self.extra_args[2] + list(args))
self.connect_nodes(0, 3)
self.connect_nodes(1, 3)
self.connect_nodes(2, 3)
s... |