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 |
|---|---|---|---|---|---|
20,801 | [
0.03610820695757866,
-0.026903223246335983,
0.030793990939855576,
0.024957841262221336,
0.035847242921590805,
-0.006286908406764269,
0.012633128091692924,
0.011120710521936417,
-0.002105521271005273,
0.009649811312556267,
0.01771010272204876,
0.03193275257945061,
0.022537974640727043,
0.00... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "message", "annotation": null, "type_comment": null}}], "kwarg": n... | def on_addr(self, message):
for addr in message.addrs:
self.num_ipv4_received += 1
if self.test_addr_contents:
# relay_tests checks the content of the addr messages match
# expectations based on the message creation in setup_addr_msg
assert... | |
20,802 | [
-0.016170356422662735,
-0.0558963343501091,
0.030892619863152504,
0.024508949369192123,
-0.022155800834298134,
-0.02703104354441166,
0.02426760084927082,
-0.004808870609849691,
0.0019232466584071517,
-0.0046610445715487,
-0.0027242223732173443,
0.011530429124832153,
0.0012964945053681731,
... | 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": "num", "annotation": null, "type_comment": null}}], "kwarg": null,... | def setup_rand_addr_msg(self, num):
addrs = []
for i in range(num):
addr = CAddress()
addr.time = self.mocktime + i
addr.nServices = NODE_NETWORK
addr.ip = (
f"{random.randrange(128,169)}.{random.randrange(1,255)}"
f".{rando... | |
20,803 | [
0.00324375182390213,
-0.04664089158177376,
0.03182642161846161,
0.017962545156478882,
-0.030937552452087402,
-0.015777410939335823,
0.01727120392024517,
-0.014653980731964111,
0.01509841438382864,
0.007061564363539219,
0.0006882555899210274,
0.006617130246013403,
0.007833151146769524,
-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": "num", "annotation": null, "type_comment": null}}], "kwarg": null,... | def setup_addr_msg(self, num):
addrs = []
for i in range(num):
addr = CAddress()
addr.time = self.mocktime + i
addr.nServices = NODE_NETWORK
addr.ip = f"123.123.123.{self.counter % 256}"
addr.port = 8333 + i
addrs.append(addr)
... | |
20,804 | [
0.0400744192302227,
-0.028892038390040398,
0.06562691926956177,
0.022516561672091484,
-0.013522586785256863,
0.002150458050891757,
-0.021340135484933853,
-0.024325476959347725,
-0.0174566600471735,
0.00503143947571516,
0.022010572254657745,
0.01954386942088604,
-0.04361635074019432,
-0.011... | 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 oversized_addr_test(self):
self.log.info('Send an addr message that is too large')
addr_source = self.nodes[0].add_p2p_connection(P2PInterface())
msg = self.setup_addr_msg(1010)
with self.nodes[0].assert_debug_log(['addr message size = 1010']):
addr_source.send_and_ping(... | |
20,805 | [
0.006523702759295702,
-0.03675564378499985,
0.04390324652194977,
0.0030104736797511578,
-0.01580953039228916,
0.02495604008436203,
-0.03883935138583183,
-0.004997265059500933,
0.019504478201270103,
0.015082655474543571,
0.024798549711704254,
0.015845874324440956,
0.019298529252409935,
0.00... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def relay_tests(self):
self.log.info('Test address relay')
self.log.info(
'Check that addr message content is relayed and added to addrman')
addr_source = self.nodes[0].add_p2p_connection(P2PInterface())
num_receivers = 7
receivers = []
for _ in range(num_rece... | |
20,806 | [
-0.015477069653570652,
-0.025840407237410545,
0.0791022777557373,
0.00231137010268867,
-0.00700359046459198,
-0.004264531657099724,
-0.021937170997262,
-0.0035326750949025154,
0.02796495333313942,
0.01829332858324051,
0.023332949727773666,
0.01926913671195507,
-0.019652049988508224,
-0.008... | 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 getaddr_tests(self):
# In the previous tests, the node answered GETADDR requests with an
# empty addrman. Due to GETADDR response caching (see
# CConnman::GetAddresses), the node would continue to provide 0 addrs
# in response until enough time has passed or the node is restarted.
... | |
20,807 | [
-0.0033949343487620354,
-0.025122513994574547,
0.05849346145987511,
0.012372649274766445,
0.02519795671105385,
0.007449994795024395,
0.0021296925842761993,
0.019539732486009598,
0.009424085728824139,
0.014824546873569489,
0.035080987960100174,
0.021274922415614128,
-0.0402614064514637,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def inbound_blackhole_tests(self):
self.log.info(
'Check that we only relay addresses to inbound peers who have previously sent us addr related messages')
addr_source = self.nodes[0].add_p2p_connection(P2PInterface())
receiver_peer = self.nodes[0].add_p2p_connection(AddrReceiver())
... | |
20,808 | [
-0.012609685771167278,
-0.016896845772862434,
0.07834836095571518,
-0.03901515156030655,
-0.021124370396137238,
0.022303838282823563,
-0.005728362128138542,
0.006977403536438942,
0.023602575063705444,
-0.008011093363165855,
0.044051073491573334,
0.01659204065799713,
-0.029897479340434074,
... | 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 rate_limit_tests(self):
self.mocktime = int(time.time())
self.restart_node(0, [])
self.nodes[0].setmocktime(self.mocktime)
for conn_type, no_relay in [
("outbound-full-relay", False),
("block-relay-only", True),
("inbound", False)
]:
... | |
20,809 | [
0.022189341485500336,
-0.03152285888791084,
0.03674108907580376,
0.01337764598429203,
0.003756533144041896,
0.01916513778269291,
-0.013721575029194355,
0.006493139546364546,
0.03168889135122299,
0.022331656888127327,
0.022640006616711617,
0.0375712625682354,
-0.014622906222939491,
0.027419... | 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 blocksonly_mode_tests(self):
self.log.info('Test addr relay in -blocksonly mode')
self.restart_node(0, ["-blocksonly", "-whitelist=addr@127.0.0.1"])
self.mocktime = int(time.time())
self.log.info('Check that we send getaddr messages')
full_outbound_peer = self.nodes[0].add_o... | |
20,810 | [
0.0033208366949111223,
0.001302095246501267,
0.030042709782719612,
-0.02505440078675747,
-0.035617876797914505,
0.011122122406959534,
-0.0019764197058975697,
-0.005958884488791227,
-0.009666258469223976,
0.0021696884650737047,
-0.005163237918168306,
-0.07150661200284958,
0.051237378269433975... | 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": "objs", "annotation": null, "type_comment": null}}, {"_type": "arg... | def collect(self, objs, source=None, source_attr=None, **kwargs):
for obj in objs:
if source_attr and not source_attr.endswith('+'):
related_name = source_attr % {
'class': source._meta.model_name,
'app_label': source._meta.app_label,
... | |
20,811 | [
0.010368016548454762,
0.047956157475709915,
-0.002366257831454277,
0.01592736318707466,
-0.00344875268638134,
0.014382495544850826,
0.0008315900340676308,
-0.026893744245171547,
0.03492270037531853,
0.033203765749931335,
0.05844384804368019,
-0.05652908235788345,
0.03753374516963959,
0.021... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def format_callback(obj):
has_admin = obj.__class__ in admin_site._registry
opts = obj._meta
no_edit_link = '%s: %s' % (capfirst(opts.verbose_name), obj)
if has_admin:
try:
admin_url = reverse('%s:%s_%s_change'
% (admin_si... | |
20,812 | [
-0.006762527395039797,
0.06517890840768814,
-0.013988463208079338,
-0.045521777123212814,
-0.004423932172358036,
-0.022071165964007378,
-0.032223038375377655,
-0.05871275067329407,
0.0017647233325988054,
-0.0031441710889339447,
0.029377928003668785,
-0.025024045258760452,
0.04547867178916931... | 11 | {"_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": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def lookup_field(name, obj, model_admin=None):
opts = obj._meta
try:
f = _get_non_gfk_field(opts, name)
except (FieldDoesNotExist, FieldIsAForeignKeyColumnName):
# For non-field values, the value is either a method, property or
# returned via a callable.
if callable(name):
... | |
20,813 | [
0.03073001094162464,
0.009366638958454132,
0.0016526950057595968,
-0.01933475397527218,
-0.016502344980835915,
0.00576324388384819,
0.0071028973907232285,
0.05262377858161926,
-0.008863585069775581,
0.054723478853702545,
0.005107087083160877,
-0.05008663609623909,
0.04628092795610428,
-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": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def _nested(self, obj, seen, format_callback):
if obj in seen:
return []
seen.add(obj)
children = []
for child in self.edges.get(obj, ()):
children.extend(self._nested(child, seen, format_callback))
if format_callback:
ret = [format_callback(ob... | |
20,814 | [
0.03762461990118027,
0.01392891351133585,
0.05528998374938965,
-0.0014817207120358944,
0.023908542469143867,
0.01609274372458458,
0.009163758717477322,
0.007212765049189329,
-0.0015755753265693784,
0.01258095446974039,
-0.008673054166138172,
-0.04029688984155655,
0.058789946138858795,
-0.0... | 6 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "using_options", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": [{"_type": "keyword", "_fields": {"arg"... | class Servers(Entity):
using_options(tablename='servers')
addr=Field(Unicode,required=True)
host=Field(Unicode)
user=Field(Unicode)
passwd1=Field(Unicode)
passwd2=Field(Unicode)
passwd3=Field(Unicode)
port=Field(Integer)
system=Field(Unicode)
cmds=Field(Unicode)
comment=Field... | |
20,815 | [
0.006748103071004152,
0.04257206246256828,
-0.02067023515701294,
-0.0007376728462986648,
-0.03072824515402317,
-0.04392681643366814,
-0.010530119761824608,
-0.02237393893301487,
0.0006465862970799208,
0.003681949805468321,
-0.025227129459381104,
0.0393083430826664,
0.0013188307639211416,
-... | 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": "model", "annotation": null, "type_comment": null}}], "kwarg": nul... | def help_text_for_field(name, model):
help_text = ""
try:
field = _get_non_gfk_field(model._meta, name)
except (FieldDoesNotExist, FieldIsAForeignKeyColumnName):
pass
else:
if hasattr(field, 'help_text'):
help_text = field.help_text
return help_text | |
20,816 | [
0.011371259577572346,
-0.0033563373144716024,
0.04142225161194801,
0.012733086943626404,
0.013118937611579895,
0.03901635482907295,
-0.04550773277878761,
-0.015922032296657562,
-0.04144494980573654,
-0.06495916843414307,
0.019054235890507698,
-0.020790565758943558,
0.040582459419965744,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "PING", "value": {"_type": "Name", "_fields": {"id": "OperationType", "ctx": {"_type": "Load", "_fields": {}}}}... | class Operation(OperationBase):
TYPE = OperationType.PING
def __init__(self, board, data):
OperationBase.__init__(self, board, data)
self._start = time()
def on_result(self, result):
return time() - self._start | |
20,817 | [
0.0371432863175869,
-0.0062460945919156075,
0.04403870180249214,
0.00741256820037961,
0.03470690920948982,
0.008941051550209522,
0.030753539875149727,
0.01559512410312891,
-0.005177305545657873,
0.008400910533964634,
-0.033488720655441284,
-0.041395459324121475,
0.06187483295798302,
-0.016... | 6 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "using_options", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": [{"_type": "keyword", "_fields": {"arg"... | class Profiles(Entity):
using_options(tablename='profiles')
profile=Field(Integer,required=True)
name=Field(Unicode)
email=Field(Unicode)
passwd=Field(Unicode,required=True)
passphrase=Field(Unicode)
status=Field(Unicode)
last_access=Field(DateTime)
servers=OneToMany('Servers') | |
20,818 | [
0.029549110680818558,
0.023952852934598923,
-0.007790121249854565,
-0.025956183671951294,
0.028939401730895042,
0.037061598151922226,
-0.033033162355422974,
0.009771675802767277,
0.00400938093662262,
0.05600612610578537,
0.004518378991633654,
0.018389258533716202,
0.01574355736374855,
0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "required_auth_mode", "annotation": {"_type": "Name", "_fields": {"id": "AuthMode", "ctx": {"_type": "Load", "_fields": {}}}},... | def requires_auth_mode(*required_auth_mode: AuthMode):
def decorator(function):
@wraps(function)
def wrapper(*args, **kwargs):
instance = args[0]
if instance._auth_mode not in required_auth_mode:
raise NuInvalidAuthenticationMethod(
'The au... | |
20,819 | [
-0.008275744505226612,
0.02872755005955696,
0.013059986755251884,
-0.004217978101223707,
-0.03263891860842705,
-0.019148018211126328,
0.007811684161424637,
0.005604634527117014,
0.0023341134656220675,
0.061918921768665314,
0.01238599419593811,
-0.004753857385367155,
-0.0003273283364251256,
... | 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 startup(self, *args, **kwargs):
super(WorldMenuState, self).startup(*args, **kwargs)
def change_state(state, **kwargs):
return partial(self.game.replace_state, state, **kwargs)
def exit_game():
# TODO: API
self.game.done = True
self.game.exit... | |
20,820 | [
0.029067719355225563,
0.023843269795179367,
-0.018199574202299118,
-0.026616742834448814,
0.021456792950630188,
0.005745819304138422,
-0.030895201489329338,
0.017361082136631012,
0.012018383480608463,
0.04134409874677658,
-0.0041709598153829575,
0.008089296519756317,
0.006922932807356119,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "function", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def decorator(function):
@wraps(function)
def wrapper(*args, **kwargs):
instance = args[0]
if instance._auth_mode not in required_auth_mode:
raise NuInvalidAuthenticationMethod(
'The authentication method used doest not allow access to this res... | |
20,821 | [
0.004014562349766493,
0.02721908688545227,
0.0029596961103379726,
-0.025539396330714226,
0.02659173123538494,
-0.000058854002418229356,
-0.04411718249320984,
0.024628719314932823,
0.0018441183492541313,
0.026065563783049583,
-0.008206200785934925,
-0.00011525739682838321,
0.01093822810798883... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment"... | def wrapper(*args, **kwargs):
instance = args[0]
if instance._auth_mode not in required_auth_mode:
raise NuInvalidAuthenticationMethod(
'The authentication method used doest not allow access to this resource'
)
return function(*arg... | |
20,822 | [
-0.05309613049030304,
0.006561989430338144,
-0.0011982700088992715,
0.006348450668156147,
-0.014151273295283318,
-0.008079846389591694,
0.025093693286180496,
-0.009897811338305473,
-0.0021108598448336124,
0.018722157925367355,
0.011923544108867645,
-0.028325632214546204,
0.028510315343737602... | 14 | {"_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": "parent", "annotation":... | class newProjectWindow(QWidget):
def __init__(self,parent):
super().__init__()
self.initialize()
self.parent = parent
def initialize(self):
self.setWindowTitle("Einstellungen des neuen Projektes")
# OK button
self.button_ok = QPushButton()
self.button_ok.... | |
20,823 | [
-0.017102254554629326,
0.0012941857567057014,
0.029137175530195236,
0.002932432107627392,
-0.038649942725896835,
-0.01204643677920103,
0.024530507624149323,
0.0017203025054186583,
-0.016261538490653038,
0.009247886016964912,
-0.002402665326371789,
-0.052608147263526917,
0.0012675534235313535... | 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 initialize(self):
self.setWindowTitle("Einstellungen des neuen Projektes")
# OK button
self.button_ok = QPushButton()
self.button_ok.setText("OK")
self.button_ok.clicked.connect(self.finished)
# Cancel button
self.button_cancel = QPushButton()
self.b... | |
20,824 | [
-0.0354023352265358,
-0.03300866857171059,
0.06438963860273361,
-0.03305654227733612,
0.025684045627713203,
0.01934082992374897,
-0.032194819301366806,
-0.04825632646679878,
-0.0008864047704264522,
0.041793424636125565,
0.00810256227850914,
-0.011136535555124283,
0.027048436924815178,
0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": "192.0.2.3"}}, {"_type": "Constant", "_fields": {"kind": null, "value": "192.0.2.3:23"}}, {"_type":... | class TestParseAddress(unittest.TestCase):
tests = {
# IPv4 addresses
'192.0.2.3': ['192.0.2.3', None],
'192.0.2.3:23': ['192.0.2.3', 23],
# IPv6 addresses
'::': ['::', None],
'::1': ['::1', None],
'[::1]:442': ['::1', 442],
'abcd:ef98:7654:3210:abcd... | |
20,825 | [
0.018873190507292747,
0.02159155160188675,
0.03929973021149635,
-0.04688525199890137,
-0.007546687498688698,
0.002804118674248457,
0.022148167714476585,
0.027105940505862236,
0.016905615106225014,
-0.0076437718234956264,
0.051079295575618744,
-0.024102799594402313,
-0.022691840305924416,
-... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def finished(self):
self.close()
globals.current_session = Session(name=self.text_user.text(),settings=Settings(num_rows = int(self.num_menus.text()),\
min_num=int(self.min_people.text()), \
... | |
20,826 | [
0.02137359045445919,
-0.035273753106594086,
0.03039613552391529,
-0.029391303658485413,
0.019353462383151054,
0.014580515213310719,
-0.0013724839081987739,
0.06845410913228989,
-0.0035509259905666113,
0.03676006570458412,
0.03504347801208496,
0.041721418499946594,
-0.012424315325915813,
-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 testEncrypt1(self):
# Verify encryption using all test vectors
for test in self._testData:
# Build the key
comps = [ int(rws(test[0][x]),16) for x in ('n','e') ]
key = RSA.construct(comps)
... | |
20,827 | [
0.025767330080270767,
-0.025485126301646233,
0.03186726197600365,
-0.01829979568719864,
0.010088766925036907,
0.036469344049692154,
-0.01006163191050291,
0.0813179537653923,
0.005725470371544361,
0.024182649329304695,
0.024160942062735558,
0.03464587777853012,
-0.016411205753684044,
-0.032... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testDecrypt1(self):
# Verify decryption using all test vectors
for test in self._testData:
# Build the key
comps = [ int(rws(test[0][x]),16) for x in ('n','e','d') ]
key = RSA.construct(comps)
... | |
20,828 | [
0.03356882929801941,
-0.020051566883921623,
0.0332927331328392,
-0.03179720789194107,
0.018843641504645348,
0.04601621627807617,
-0.002624362474307418,
0.04219687357544899,
0.027586722746491432,
0.017796771600842476,
0.058026451617479324,
-0.0030169382225722075,
-0.03073883429169655,
0.008... | 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 testEncryptDecrypt2(self):
# Helper function to monitor what's requested from RNG
global asked
def localRng(N):
global asked
asked += N
return self.rng(N)
# Verify that OAEP is friendly to all... | |
20,829 | [
0.03192030265927315,
-0.022823423147201538,
0.051819730550050735,
-0.026762697845697403,
0.02061012014746666,
0.02926027774810791,
-0.0018744547851383686,
0.07289687544107437,
0.0036524583119899035,
0.0009879912249743938,
-0.0022196490317583084,
0.02331075631082058,
-0.04710884392261505,
-... | 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 testEncryptDecrypt1(self):
# Encrypt/Decrypt messages of length [0..128-2*20-2]
for pt_len in range(0,128-2*20-2):
pt = self.rng(pt_len)
cipher = PKCS.new(self.key1024)
ct = cipher.encrypt(pt)
pt2 = ciphe... | |
20,830 | [
0.021541645750403404,
-0.018211957067251205,
0.009127693250775337,
-0.059355344623327255,
0.011697345413267612,
0.04395190626382828,
-0.02445150539278984,
-0.0325440987944603,
0.05304341018199921,
0.03179129958152771,
0.038132186979055405,
-0.0650302916765213,
-0.03210979327559471,
0.03393... | 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 CycleTagTests(SimpleTestCase):
@setup({'cycle01': '{% cycle a %}'})
def test_cycle01(self):
with self.assertRaises(TemplateSyntaxError):
self.engine.get_template('cycle01')
@setup({'cycle02': '{% cycle a,b,c as abc %}{% cycle abc %}'})
def test_cycle02(self):
output =... | |
20,831 | [
0.029718443751335144,
0.019120991230010986,
-0.0001820546603994444,
0.02338276244699955,
0.004828677047044039,
0.01887029968202114,
0.009412359446287155,
0.06764136254787445,
0.02741663157939911,
0.002736250404268503,
0.027598952874541283,
0.015326420776546001,
-0.015542928129434586,
0.009... | 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 testEncryptDecrypt4(self):
# Verify that encrypt() uses the custom MGF
global mgfcalls
# Helper function to monitor what's requested from MGF
def newMGF(seed,maskLen):
global mgfcalls
mgfcalls += 1
... | |
20,832 | [
0.0115189915522933,
-0.016861220821738243,
0.03652452304959297,
0.0008566146134398878,
-0.026071541011333466,
-0.01547236368060112,
-0.053215183317661285,
0.020881598815321922,
0.0037736729718744755,
0.05574924126267433,
0.03745042905211449,
-0.033819906413555145,
0.027801522985100746,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "visitor", "annotation": null, "type_comment": null}}], "kwarg": n... | def accept(self, visitor):
visitor.visit_definitions(self)
# FIXME: Visit typedefs as well. (We need to add IdlTypedef to do that).
for interface in self.interfaces.itervalues():
interface.accept(visitor)
for callback_function in self.callback_functions.itervalues():
... | |
20,833 | [
0.02897493913769722,
0.007488743402063847,
-0.015329021029174328,
-0.012165213003754616,
-0.002197088673710823,
-0.046445123851299286,
-0.023861713707447052,
0.009081299416720867,
0.017704540863633156,
0.05070614442229271,
0.04145972803235054,
-0.061443913727998734,
0.04194974526762962,
-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}}, {"_type": "arg", "_fields": {"arg": "idl_name", "annotation... | class IdlCallbackFunction(TypedObject):
def __init__(self, idl_name, node):
children = node.GetChildren()
num_children = len(children)
if num_children != 2:
raise ValueError('Expected 2 children, got %s' % num_children)
type_node, arguments_node = children
argumen... | |
20,834 | [
0.015954308211803436,
0.008456102572381496,
0.009946164675056934,
-0.03150417283177376,
0.0034617336932569742,
-0.050960127264261246,
-0.019775252789258957,
0.022925671190023422,
-0.013612781651318073,
0.09187297523021698,
0.034846168011426926,
-0.029460657387971878,
0.023266255855560303,
... | 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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node):
children = node.GetChildren()
num_children = len(children)
if num_children != 2:
raise ValueError('Expected 2 children, got %s' % num_children)
type_node, arguments_node = children
arguments_node_class = arguments_node.GetClass()
... | |
20,835 | [
0.006460331846028566,
0.013845198787748814,
-0.028808970004320145,
-0.0006966115324757993,
0.03392244875431061,
-0.014427312649786472,
-0.0319364108145237,
0.005344611592590809,
-0.059535495936870575,
0.039903391152620316,
0.034287694841623306,
-0.030566727742552757,
0.027918677777051926,
... | 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": "idl_name", "annotation... | class IdlDictionary(object):
def __init__(self, idl_name, node):
self.extended_attributes = {}
self.is_partial = bool(node.GetProperty('Partial'))
self.idl_name = idl_name
self.name = node.GetName()
self.members = []
self.parent = None
for child in node.GetChi... | |
20,836 | [
0.005992129910737276,
0.023576663807034492,
-0.03798825293779373,
-0.019124744459986687,
0.01111891120672226,
-0.0047866287641227245,
-0.013682302087545395,
0.0007503768429160118,
-0.030347062274813652,
0.0342220813035965,
0.03572419658303261,
-0.03770524635910988,
0.03879373520612717,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "idl_name", "annotation... | class IdlDictionaryMember(TypedObject):
def __init__(self, idl_name, node):
self.default_value = None
self.extended_attributes = {}
self.idl_type = None
self.idl_name = idl_name
self.name = node.GetName()
for child in node.GetChildren():
child_class = chil... | |
20,837 | [
-0.0039003659039735794,
0.010629870928823948,
-0.015777254477143288,
-0.009234528057277203,
0.010992439463734627,
-0.02065545879304409,
-0.013579865917563438,
-0.007542538456618786,
-0.04175039380788803,
0.05840660631656647,
0.039684850722551346,
0.00281265820376575,
0.02139158360660076,
-... | 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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node):
self.extended_attributes = {}
self.is_partial = bool(node.GetProperty('Partial'))
self.idl_name = idl_name
self.name = node.GetName()
self.members = []
self.parent = None
for child in node.GetChildren():
child_class ... | |
20,838 | [
0.015070123597979546,
0.01917913928627968,
-0.01887684129178524,
-0.022504419088363647,
0.05983264744281769,
-0.013849735260009766,
-0.0026213170494884253,
-0.00016881813644431531,
-0.017354154959321022,
0.05235356464982033,
0.012920447625219822,
-0.04523276537656784,
0.04270241782069206,
... | 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": "idl_name", "annotation... | class IdlEnum(object):
# FIXME: remove, just treat enums as a dictionary
def __init__(self, idl_name, node):
self.idl_name = idl_name
self.name = node.GetName()
self.values = []
for child in node.GetChildren():
self.values.append(child.GetName()) | |
20,839 | [
-0.02280435338616371,
0.02163216657936573,
-0.033311404287815094,
-0.02681109867990017,
0.016304045915603638,
-0.0335458405315876,
0.013171112164855003,
-0.025553662329912186,
-0.02529791183769703,
0.05366482213139534,
0.04015270993113518,
0.0017649396322667599,
0.013682611286640167,
-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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node):
self.default_value = None
self.extended_attributes = {}
self.idl_type = None
self.idl_name = idl_name
self.name = node.GetName()
for child in node.GetChildren():
child_class = child.GetClass()
if child_class == '... | |
20,840 | [
0.029682988300919533,
-0.016844017431139946,
0.0029388312250375748,
0.028745096176862717,
-0.014245806261897087,
-0.0026203917805105448,
-0.05890970304608345,
0.005972718819975853,
0.0023637390695512295,
0.028035340830683708,
0.025285039097070694,
-0.03528498485684395,
0.02600746788084507,
... | 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": "visitor", "annotation": null, "type_comment": null}}], "kwarg": n... | def accept(self, visitor):
visitor.visit_interface(self)
for attribute in self.attributes:
attribute.accept(visitor)
for constant in self.constants:
constant.accept(visitor)
for constructor in self.constructors:
constructor.accept(visitor)
for ... | |
20,841 | [
-0.0003301893302705139,
0.008609381504356861,
-0.0081113176420331,
-0.01143174059689045,
0.009392051957547665,
-0.032492704689502716,
-0.018985701724886894,
-0.012202552519738674,
-0.020906804129481316,
0.06749944388866425,
0.039228420704603195,
-0.014467555098235607,
0.03296705335378647,
... | 17 | {"_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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node=None):
self.attributes = []
self.constants = []
self.constructors = []
self.custom_constructors = []
self.extended_attributes = {}
self.operations = []
self.parent = None
self.stringifier = None
self.iterable = Non... | |
20,842 | [
-0.02389298379421234,
-0.007474659010767937,
-0.02603168785572052,
-0.007280231453478336,
0.026593366637825966,
-0.024065809324383736,
-0.012400156818330288,
-0.003618512535467744,
-0.01105536613613367,
0.04817482456564903,
0.0317348949611187,
-0.01244336273521185,
0.030481917783617973,
-0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node):
# Exceptions are similar to Interfaces, but simpler
IdlInterface.__init__(self, idl_name)
self.is_callback = False
self.is_exception = True
self.is_partial = False
self.idl_name = idl_name
self.name = node.GetName()
self... | |
20,843 | [
-0.01253272220492363,
-0.0069779460318386555,
-0.01956031285226345,
0.016405068337917328,
0.03506072983145714,
-0.013735245913267136,
-0.007501981686800718,
-0.009642252698540688,
-0.013183629140257835,
0.03508279472589493,
0.020851096138358116,
-0.03980462998151779,
0.028419271111488342,
... | 14 | {"_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": "idl_name", "annotation... | class IdlException(IdlInterface):
# Properly exceptions and interfaces are distinct, and thus should inherit a
# common base class (say, "IdlExceptionOrInterface").
# However, there is only one exception (DOMException), and new exceptions
# are not expected. Thus it is easier to implement exceptions as ... | |
20,844 | [
0.006731226574629545,
0.029044805094599724,
-0.03247598186135292,
-0.029831573367118835,
0.03547006845474243,
-0.022400997579097748,
-0.010572178289294243,
-0.02458646148443222,
-0.04377482831478119,
0.03636610880494118,
0.02886996790766716,
0.002276979386806488,
0.024214932695031166,
-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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node):
self.is_read_only = bool(node.GetProperty('READONLY'))
self.is_static = bool(node.GetProperty('STATIC'))
self.idl_name = idl_name
self.name = node.GetName()
# Defaults, overridden below
self.idl_type = None
self.extended_attribu... | |
20,845 | [
0.00036453487700782716,
0.034632936120033264,
-0.038800667971372604,
-0.017746830359101295,
0.034293174743652344,
-0.017123937606811523,
-0.0377134308218956,
-0.032299913465976715,
-0.027407359331846237,
0.014700310304760933,
0.02946857362985611,
-0.02493843249976635,
0.03991055116057396,
... | 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": "idl_name", "annotation... | class IdlAttribute(TypedObject):
def __init__(self, idl_name, node):
self.is_read_only = bool(node.GetProperty('READONLY'))
self.is_static = bool(node.GetProperty('STATIC'))
self.idl_name = idl_name
self.name = node.GetName()
# Defaults, overridden below
self.idl_type... | |
20,846 | [
0.0035637631081044674,
0.022184710949659348,
-0.03036647103726864,
-0.01298309862613678,
0.029220566153526306,
-0.0390753448009491,
-0.02205866202712059,
-0.008508341386914253,
-0.007746314629912376,
0.04672998562455177,
0.028830958530306816,
-0.02392648719251156,
0.03717314451932907,
-0.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}}, {"_type": "arg", "_fields": {"arg": "idl_name", "annotation... | class IdlConstant(TypedObject):
def __init__(self, idl_name, node):
children = node.GetChildren()
num_children = len(children)
if num_children < 2 or num_children > 3:
raise ValueError('Expected 2 or 3 children, got %s' % num_children)
type_node = children[0]
valu... | |
20,847 | [
-0.0016718031838536263,
0.01742793805897236,
-0.006248262710869312,
-0.03101912885904312,
0.026076877489686012,
-0.037955619394779205,
-0.0008311598212458193,
0.005465197376906872,
-0.020776962861418724,
0.0582231841981411,
0.037868913263082504,
-0.003102454822510481,
0.018110748380422592,
... | 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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node):
children = node.GetChildren()
num_children = len(children)
if num_children < 2 or num_children > 3:
raise ValueError('Expected 2 or 3 children, got %s' % num_children)
type_node = children[0]
value_node = children[1]
value_n... | |
20,848 | [
0.023733705282211304,
0.01751326210796833,
-0.03786538541316986,
-0.022606512531638145,
0.041643574833869934,
-0.015300621278584003,
-0.02189679630100727,
-0.030726486817002296,
0.012012970633804798,
0.03538138419389725,
-0.012388702481985092,
-0.020780039951205254,
0.019986828789114952,
-... | 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 __str__(self):
if self.idl_type == 'DOMString':
return 'String("%s")' % self.value
if self.idl_type == 'integer':
return '%d' % self.value
if self.idl_type == 'float':
return '%g' % self.value
if self.idl_type == 'boolean':
return 'true... | |
20,849 | [
0.029604149982333183,
0.025532202795147896,
-0.05542248860001564,
-0.004990885499864817,
0.04824706166982651,
-0.04131374508142471,
-0.014758053235709667,
-0.022274646908044815,
0.006471092812716961,
0.021152108907699585,
0.014548953622579575,
-0.0494796484708786,
0.043382734060287476,
-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}}, {"_type": "arg", "_fields": {"arg": "idl_type", "annotation... | class IdlLiteral(object):
def __init__(self, idl_type, value):
self.idl_type = idl_type
self.value = value
self.is_null = False
def __str__(self):
if self.idl_type == 'DOMString':
return 'String("%s")' % self.value
if self.idl_type == 'integer':
r... | |
20,850 | [
-0.005056954920291901,
0.00747712654992938,
-0.02428194135427475,
-0.014066411182284355,
0.04548317939043045,
-0.033459875732660294,
0.012451181188225746,
-0.02856069803237915,
0.00017532872152514756,
0.015467704273760319,
-0.008065455593168736,
0.0054554142989218235,
0.008129636757075787,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def default_node_to_idl_literal(node):
# FIXME: This code is unnecessarily complicated due to the rather
# inconsistent way the upstream IDL parser outputs default values.
# http://crbug.com/374178
idl_type = node.GetProperty('TYPE')
if idl_type == 'DOMString':
value = node.GetProperty('NAME... | |
20,851 | [
-0.017264004796743393,
0.03100242279469967,
-0.01826481707394123,
-0.03732573613524437,
0.030661238357424736,
-0.0017969122854992747,
-0.05131435766816139,
0.008251012302935123,
-0.015956126153469086,
0.03539234772324562,
0.03409584239125252,
-0.021608438342809677,
0.05304303020238876,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "idl_name", "annotation... | class IdlOperation(TypedObject):
def __init__(self, idl_name, node=None):
self.arguments = []
self.extended_attributes = {}
self.specials = []
self.is_constructor = False
self.idl_name = idl_name
self.idl_type = None
self.is_static = False
if not node... | |
20,852 | [
-0.009074846282601357,
0.004848870914429426,
-0.012457912787795067,
-0.029716121032834053,
-0.00703472038730979,
-0.011120687238872051,
-0.03911098837852478,
0.00046395722893066704,
-0.011440706439316273,
0.09125135093927383,
0.012103605084121227,
-0.018652580678462982,
0.033624935895204544,... | 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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node=None):
self.arguments = []
self.extended_attributes = {}
self.specials = []
self.is_constructor = False
self.idl_name = idl_name
self.idl_type = None
self.is_static = False
if not node:
return
self.na... | |
20,853 | [
0.019312264397740364,
0.04079573228955269,
-0.019140854477882385,
0.0007613489287905395,
0.03581339493393898,
-0.008753369562327862,
-0.0197007954120636,
0.007050690706819296,
-0.025163080543279648,
0.013450020924210548,
0.03702469542622566,
-0.02824847213923931,
0.03787032142281532,
-0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "idl_name", "annotation": null, "type_comment": null}}, {"_type": "... | def from_exception_operation_node(cls, idl_name, node):
# Needed to handle one case in DOMException.idl:
# // Override in a Mozilla compatible format
# [NotEnumerable] DOMString toString();
# FIXME: can we remove this? replace with a stringifier?
operation = cls(idl_name)
... | |
20,854 | [
-0.008984250947833061,
0.015358551405370235,
-0.04956674203276634,
0.002424520906060934,
0.01171131432056427,
-0.01615045964717865,
-0.046131424605846405,
-0.021872272714972496,
0.011393435299396515,
0.0665648803114891,
0.05376050993800163,
-0.02520720846951008,
0.06134497746825218,
-0.015... | 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": "idl_name", "annotation... | class IdlArgument(TypedObject):
def __init__(self, idl_name, node=None):
self.extended_attributes = {}
self.idl_type = None
self.is_optional = False # syntax: (optional T)
self.is_variadic = False # syntax: (T...)
self.idl_name = idl_name
self.default_value = None
... | |
20,855 | [
-0.020712999626994133,
0.020814092829823494,
-0.022734874859452248,
-0.01898317225277424,
-0.005694951396435499,
-0.017657719552516937,
-0.0010046197567135096,
-0.013355616480112076,
-0.018578795716166496,
0.06896844506263733,
0.03394505754113197,
0.003086169483140111,
0.03832578659057617,
... | 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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node=None):
self.extended_attributes = {}
self.idl_type = None
self.is_optional = False # syntax: (optional T)
self.is_variadic = False # syntax: (T...)
self.idl_name = idl_name
self.default_value = None
if not node:
ret... | |
20,856 | [
0.023885279893875122,
-0.004590485244989395,
-0.02649937942624092,
-0.006656466983258724,
0.0018498969729989767,
-0.04178342968225479,
-0.044228874146938324,
-0.0037050643004477024,
0.021039284765720367,
0.08390416204929352,
0.009718546643853188,
-0.007041203323751688,
0.05122791603207588,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "idl_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": ... | def arguments_node_to_arguments(idl_name, node):
# [Constructor] and [CustomConstructor] without arguments (the bare form)
# have None instead of an arguments node, but have the same meaning as using
# an empty argument list, [Constructor()], so special-case this.
# http://www.w3.org/TR/WebIDL/#Construc... | |
20,857 | [
0.0041047679260373116,
0.026357503607869148,
-0.051714640110731125,
-0.02017045021057129,
0.028488721698522568,
-0.026531480252742767,
0.004004187881946564,
0.0003758173552341759,
-0.028053779155015945,
0.01806098036468029,
0.023769596591591835,
0.012602453120052814,
0.010329879820346832,
... | 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": "idl_name", "annotation... | class IdlStringifier(object):
def __init__(self, idl_name, node):
self.attribute = None
self.operation = None
self.extended_attributes = {}
self.idl_name = idl_name
for child in node.GetChildren():
child_class = child.GetClass()
if child_class == 'Att... | |
20,858 | [
0.004754850175231695,
0.02423512190580368,
-0.02720268815755844,
-0.019727569073438644,
0.028663989156484604,
-0.019750051200389862,
-0.009683932177722454,
-0.013230398297309875,
-0.026955390349030495,
0.033115338534116745,
0.050133880227804184,
0.013095509260892868,
0.012488506734371185,
... | 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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node):
self.attribute = None
self.operation = None
self.extended_attributes = {}
self.idl_name = idl_name
for child in node.GetChildren():
child_class = child.GetClass()
if child_class == 'Attribute':
self.attr... | |
20,859 | [
-0.0022351855877786875,
0.005698435939848423,
-0.018824899569153786,
-0.03984025493264198,
-0.0002688932581804693,
-0.03964506462216377,
0.023682937026023865,
-0.019659874960780144,
-0.04066438600420952,
0.02684933878481388,
0.0008464969578199089,
-0.0470188744366169,
0.056431323289871216,
... | 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": "idl_name", "annotation... | class IdlIterableOrMaplikeOrSetlike(TypedObject):
def __init__(self, idl_name, node):
self.extended_attributes = {}
self.type_children = []
for child in node.GetChildren():
child_class = child.GetClass()
if child_class == 'ExtAttributes':
self.extende... | |
20,860 | [
0.03240063786506653,
-0.02234603278338909,
0.00043808965710923076,
-0.02292184717953205,
0.019245492294430733,
-0.055056724697351456,
0.01737409643828869,
0.003709574230015278,
-0.03027455508708954,
-0.003441045293584466,
-0.005741535220295191,
-0.06528850644826889,
0.06289666146039963,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "key_type"}}, {"_type": "Constant", "_fields": {"kind": n... | class IdlIterable(IdlIterableOrMaplikeOrSetlike):
idl_type_attributes = ('key_type', 'value_type')
def __init__(self, idl_name, node):
super(IdlIterable, self).__init__(idl_name, node)
if len(self.type_children) == 1:
self.key_type = None
self.value_type = type_node_to_... | |
20,861 | [
-0.01431015320122242,
0.016362300142645836,
-0.012927424162626266,
-0.03307576850056648,
-0.006661244668066502,
-0.018524186685681343,
-0.013739502988755703,
-0.014595478773117065,
-0.0331416130065918,
0.053860608488321304,
0.034326810389757156,
-0.0068039074540138245,
0.019566720351576805,
... | 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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node):
self.extended_attributes = {}
self.type_children = []
for child in node.GetChildren():
child_class = child.GetClass()
if child_class == 'ExtAttributes':
self.extended_attributes = ext_attributes_node_to_extended_attribu... | |
20,862 | [
0.0275084488093853,
-0.0004753498069476336,
-0.008040512911975384,
-0.02972652204334736,
0.029313351958990097,
-0.06789042055606842,
0.03261871263384819,
0.010242275893688202,
-0.04771030694246292,
0.04944997280836105,
0.0017641287995502353,
-0.04022974893450737,
0.03364076837897301,
-0.02... | 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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node):
super(IdlIterable, self).__init__(idl_name, node)
if len(self.type_children) == 1:
self.key_type = None
self.value_type = type_node_to_type(self.type_children[0])
elif len(self.type_children) == 2:
self.key_type = type_node... | |
20,863 | [
0.0484115406870842,
-0.0008765440434217453,
0.004464225843548775,
-0.013155310414731503,
0.025784406810998917,
-0.05184336006641388,
0.02147175371646881,
-0.02072819322347641,
-0.03514183685183525,
-0.018840691074728966,
0.014047583565115929,
-0.05097396671772003,
0.0738527700304985,
-0.00... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "key_type"}}, {"_type": "Constant", "_fields": {"kind": n... | class IdlMaplike(IdlIterableOrMaplikeOrSetlike):
idl_type_attributes = ('key_type', 'value_type')
def __init__(self, idl_name, node):
super(IdlMaplike, self).__init__(idl_name, node)
self.is_read_only = bool(node.GetProperty('READONLY'))
if len(self.type_children) == 2:
se... | |
20,864 | [
0.038701217621564865,
-0.022154876962304115,
-0.01751212775707245,
-0.011985043995082378,
0.023923544213175774,
-0.03879430517554283,
0.015778368338942528,
-0.005803437437862158,
-0.029136456549167633,
-0.00999529380351305,
0.018652452155947685,
-0.06171715632081032,
0.057202402502298355,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "value_type"}}]}}, "targets": [{"_type": "Name", "_fields... | class IdlSetlike(IdlIterableOrMaplikeOrSetlike):
idl_type_attributes = ('value_type',)
def __init__(self, idl_name, node):
super(IdlSetlike, self).__init__(idl_name, node)
self.is_read_only = bool(node.GetProperty('READONLY'))
if len(self.type_children) == 1:
self.value_ty... | |
20,865 | [
0.04766343906521797,
0.03210940212011337,
0.006280581466853619,
-0.007092773914337158,
0.03529141843318939,
-0.056742191314697266,
0.037182822823524475,
-0.010497305542230606,
-0.062349654734134674,
0.02957269363105297,
0.036938052624464035,
-0.008884047158062458,
0.03680454194545746,
0.00... | 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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node):
super(IdlMaplike, self).__init__(idl_name, node)
self.is_read_only = bool(node.GetProperty('READONLY'))
if len(self.type_children) == 2:
self.key_type = type_node_to_type(self.type_children[0])
self.value_type = type_node_to_type(self... | |
20,866 | [
-0.00521071907132864,
-0.00876407790929079,
-0.005863697733730078,
-0.0258674044162035,
0.004363682121038437,
-0.03052479401230812,
0.00037402051384560764,
-0.000866049260366708,
-0.008386451750993729,
0.03904236480593681,
-0.01401413232088089,
-0.012042083777487278,
0.057231366634368896,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def type_node_to_type(node):
children = node.GetChildren()
if len(children) < 1 or len(children) > 2:
raise ValueError('Type node expects 1 or 2 children (type + optional array []), got %s (multi-dimensional arrays are not supported).' % len(children))
base_type = type_node_inner_to_type(children[0... | |
20,867 | [
0.04240625724196434,
0.010000530630350113,
-0.01892142742872238,
-0.008625944145023823,
0.03657400608062744,
-0.04532238095998764,
0.0379318967461586,
-0.003099774941802025,
-0.05556221306324005,
0.02341804839670658,
0.04080349951982498,
-0.027981450781226158,
0.019656023010611534,
-0.0115... | 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": "idl_name", "annotation": null, "type_comment": null}}, {"_type": ... | def __init__(self, idl_name, node):
super(IdlSetlike, self).__init__(idl_name, node)
self.is_read_only = bool(node.GetProperty('READONLY'))
if len(self.type_children) == 1:
self.value_type = type_node_to_type(self.type_children[0])
else:
raise ValueError('Unexpe... | |
20,868 | [
-0.04130261763930321,
-0.008824114687740803,
-0.024353735148906708,
-0.028940629214048386,
0.055783215910196304,
-0.00011353141599101946,
-0.025772998109459877,
-0.002506850752979517,
-0.0292491652071476,
0.021741466596722603,
0.025217633694410324,
0.011775771155953407,
0.012968774884939194,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def type_node_inner_to_type(node):
node_class = node.GetClass()
# Note Type*r*ef, not Typedef, meaning the type is an identifier, thus
# either a typedef shorthand (but not a Typedef declaration itself) or an
# interface type. We do not distinguish these, and just use the type name.
if node_class in... | |
20,869 | [
0.003494707867503166,
-0.016374051570892334,
-0.021657627075910568,
-0.042107582092285156,
0.037558674812316895,
-0.042268604040145874,
-0.0058471569791436195,
0.0029034505132585764,
-0.010587278753519058,
0.00877576693892479,
0.03135927766561508,
-0.013978831470012665,
0.02330811507999897,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def sequence_node_to_type(node):
children = node.GetChildren()
if len(children) != 1:
raise ValueError('Sequence node expects exactly 1 child, got %s' % len(children))
sequence_child = children[0]
sequence_child_class = sequence_child.GetClass()
if sequence_child_class != 'Type':
rai... | |
20,870 | [
0.021096201613545418,
0.018039163202047348,
0.026920387521386147,
-0.034866053611040115,
-0.006578562781214714,
-0.01736714132130146,
0.007886368781328201,
-0.031150169670581818,
-0.020476888865232468,
0.011510013602674007,
0.010864346288144588,
-0.07342163473367691,
-0.0044801426120102406,
... | 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": "orm", "annotation": nu... | class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'FolderPermission.can_edit_new'
db.add_column('filer_folderpermission', 'can_edit_new',
self.gf('django.db.models.fields.SmallIntegerField')(default=None, null=True, blank=True),
ke... | |
20,871 | [
-0.0009696008637547493,
0.0031548207625746727,
-0.03297607600688934,
-0.027862759307026863,
0.0016654462087899446,
-0.021302275359630585,
-0.026299819350242615,
0.02469829097390175,
-0.005272506270557642,
0.03691236674785614,
0.015330306254327297,
0.015475022606551647,
0.032127074897289276,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def typedef_node_to_type(node):
children = node.GetChildren()
if len(children) != 1:
raise ValueError('Typedef node with %s children, expected 1' % len(children))
child = children[0]
child_class = child.GetClass()
if child_class != 'Type':
raise ValueError('Unrecognized node class: %... | |
20,872 | [
0.08646682649850845,
0.050500817596912384,
0.033630840480327606,
-0.024137383326888084,
0.004512119572609663,
0.01745922863483429,
0.01401103101670742,
0.050413522869348526,
0.019314272329211235,
0.01213416364043951,
0.03083736263215542,
-0.06433726102113724,
-0.0008327233954332769,
0.0214... | 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": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,... | def backwards(self, orm):
# Deleting field 'FolderPermission.can_edit_new'
db.delete_column('filer_folderpermission', 'can_edit_new')
# Deleting field 'FolderPermission.can_read_new'
db.delete_column('filer_folderpermission', 'can_read_new')
# Deleting field 'FolderPermission.c... | |
20,873 | [
0.067633718252182,
0.04180993512272835,
0.03192838653922081,
0.005434852559119463,
0.014141595922410488,
-0.007564875762909651,
0.009025149047374725,
0.03952620178461075,
0.026109250262379646,
0.013735354878008366,
0.0021094365511089563,
-0.05125230550765991,
0.00990350916981697,
-0.007789... | 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": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,... | def forwards(self, orm):
# Adding field 'FolderPermission.can_edit_new'
db.add_column('filer_folderpermission', 'can_edit_new',
self.gf('django.db.models.fields.SmallIntegerField')(default=None, null=True, blank=True),
keep_default=False)
# Adding fie... | |
20,874 | [
-0.03395802900195122,
0.021266300231218338,
0.01483537070453167,
-0.0022301259450614452,
-0.00010004021896747872,
0.0006656352197751403,
-0.016525333747267723,
-0.07022982835769653,
-0.038131892681121826,
-0.037224531173706055,
0.0004554532642941922,
-0.02236647717654705,
0.0510844886302948,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "r", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "library_type", "annotation": null, "type_comment": null}}], "kwarg":... | def get_genome_orientation(r, library_type):
if library_type == LibraryTypes.FR_FIRSTSTRAND:
if r.is_read2:
return OrientationTags.FIVEPRIME
else:
return OrientationTags.THREEPRIME
elif library_type == LibraryTypes.FR_SECONDSTRAND:
if r.is_read1:
retur... | |
20,875 | [
-0.013723161071538925,
0.0504487119615078,
0.03789965808391571,
0.0007113287574611604,
-0.05037296563386917,
-0.027673568576574326,
0.0025296949315816164,
-0.0280523132532835,
-0.015957750380039215,
-0.027067577466368675,
-0.00587368942797184,
-0.011179262772202492,
0.04151035100221634,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "bamfh", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "reads", "annotation": null, "type_comment": null}}, {"_type": "a... | def annotate_multihits(bamfh, reads, tid_tx_genome_map):
hits = set()
any_unmapped = False
for r in reads:
if r.is_unmapped:
any_unmapped = True
continue
assert r.rname in tid_tx_genome_map
# use the position that is most 5' relative to genome
left_tid... | |
20,876 | [
-0.06747490912675858,
0.02966897562146187,
-0.0020163957960903645,
-0.02030671201646328,
-0.008731767535209656,
0.004000077489763498,
-0.016940103843808174,
-0.0609082393348217,
-0.026004964485764503,
-0.04044687747955322,
0.006774852052330971,
-0.027575254440307617,
0.050487220287323,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "r", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "library_type", "annotation": null, "type_comment": null}}], "kwarg":... | def get_gene_orientation(r, library_type):
if library_type == LibraryTypes.FR_UNSTRANDED:
if r.is_reverse:
return OrientationTags.THREEPRIME
else:
return OrientationTags.FIVEPRIME
elif library_type == LibraryTypes.FR_FIRSTSTRAND:
if r.is_read2:
return ... | |
20,877 | [
-0.03960966318845749,
0.03977096080780029,
0.021728862076997757,
-0.03357258811593056,
-0.030715348199009895,
-0.003289284184575081,
-0.017788633704185486,
-0.06037075072526932,
-0.011745797470211983,
-0.052121616899967194,
-0.007367765996605158,
-0.04117653891444206,
0.05857345461845398,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "reads", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "library_type", "annotation": null, "type_comment": null}}], "kwa... | def classify_unpaired_reads(reads, library_type):
gene_hits_5p = []
gene_hits_3p = []
for r in reads:
# this alignment is to a transcript (gene), so need
# to determine whether it is 5' or 3'
orientation = get_gene_orientation(r, library_type)
if orientation == OrientationTag... | |
20,878 | [
0.011728168465197086,
0.045902762562036514,
0.052611444145441055,
-0.048211127519607544,
-0.07550270855426788,
0.028036994859576225,
0.00333029474131763,
-0.03051367588341236,
-0.04633558169007301,
0.03313462808728218,
0.05891135334968567,
-0.03238921985030174,
-0.0009941291064023972,
0.02... | 8 | {"_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 main():
logging.basicConfig(level=logging.DEBUG,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
parser = argparse.ArgumentParser()
parser.add_argument('--max-fragment-length', dest="max_fragment_length",
type=int, default=1000)
parser.... | |
20,879 | [
0.03495562821626663,
0.009238590486347675,
0.013946717604994774,
-0.04543787240982056,
-0.04721452668309212,
0.0027912866789847612,
-0.03393405303359032,
-0.08781102299690247,
-0.03351209685206413,
0.05245564877986908,
0.010826473124325275,
-0.028337597846984863,
-0.00568528613075614,
-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": "plotly_name", "annotat... | class AutorangeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="autorange", parent_name="layout.scene.xaxis", **kwargs
):
super(AutorangeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | |
20,880 | [
0.022015005350112915,
0.02951960451900959,
0.008377491496503353,
-0.039178092032670975,
-0.043689921498298645,
-0.004528833553195,
-0.014895837754011154,
-0.0718265026807785,
-0.023738116025924683,
0.03781774267554283,
0.038157831877470016,
-0.01664162054657936,
-0.00964715238660574,
-0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "plotly_name", "annotation": null, "type_comment": null}}, {"_type... | def __init__(
self, plotly_name="autorange", parent_name="layout.scene.xaxis", **kwargs
):
super(AutorangeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "plot"),
implied_edits=kwargs.pop("... | |
20,881 | [
0.01321951299905777,
0.0011468182783573866,
0.06385178118944168,
-0.027510877698659897,
-0.027357757091522217,
0.018655335530638695,
0.027638480067253113,
-0.02557133510708809,
-0.016409549862146378,
-0.007203103043138981,
0.03246181458234787,
0.0003580816264729947,
-0.009653051383793354,
... | 17 | {"_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 ConfigTest(testing.AppengineTestCase):
def test_get_bucket_async(self):
config.Bucket(
id='master.tryserver.chromium.linux',
project_id='chromium',
revision='deadbeef',
config_content=MASTER_TRYSERVER_CHROMIUM_LINUX_CONFIG_TEXT).put()
cfg = config.get_bucket_async(
... | |
20,882 | [
-0.008212260901927948,
-0.03360730782151222,
0.046226974576711655,
-0.013696129433810711,
-0.011096369475126266,
-0.003188767470419407,
0.028407789766788483,
0.015219425782561302,
-0.038427695631980896,
-0.025049766525626183,
0.04378969967365265,
0.0048542385920882225,
0.023140568286180496,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_get_buckets_async(self):
config.Bucket(
id='master.tryserver.chromium.linux',
project_id='chromium',
revision='deadbeef',
config_content=MASTER_TRYSERVER_CHROMIUM_LINUX_CONFIG_TEXT).put()
config.Bucket(
id='master.tryserver.chromium.win',
project_id='chro... | |
20,883 | [
0.02625935897231102,
-0.036034371703863144,
0.04108521714806557,
-0.011766454204916954,
-0.010277586057782173,
0.011804146692156792,
0.033772800117731094,
0.009090261533856392,
-0.020957229658961296,
-0.022062886506319046,
0.03967801481485367,
0.02404804341495037,
0.029903002083301544,
-0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_get_bucket_async(self):
config.Bucket(
id='master.tryserver.chromium.linux',
project_id='chromium',
revision='deadbeef',
config_content=MASTER_TRYSERVER_CHROMIUM_LINUX_CONFIG_TEXT).put()
cfg = config.get_bucket_async(
'master.tryserver.chromium.linux').get_result... | |
20,884 | [
-0.024230750277638435,
-0.011371448636054993,
0.04618595913052559,
-0.03163250535726547,
-0.022917939350008965,
0.02116752229630947,
0.05486302077770233,
-0.029456989839673042,
-0.038834214210510254,
0.0017394752940163016,
0.0046948641538619995,
0.002963203238323331,
-0.004626097623258829,
... | 15 | {"_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_cron_update_buckets_with_existing(self):
config.Bucket(
id='master.tryserver.chromium.linux',
project_id='chromium',
revision='deadbeef',
config_content=MASTER_TRYSERVER_CHROMIUM_LINUX_CONFIG_TEXT,
).put()
# Will not be updated.
config.Bucket(
id='master... | |
20,885 | [
-0.028788471594452858,
-0.010789462365210056,
0.05747750401496887,
-0.022983543574810028,
-0.015115191228687763,
0.01263535488396883,
0.05767638608813286,
-0.024375731125473976,
-0.057576943188905716,
0.0043505895882844925,
0.010988346301019192,
0.0036700330674648285,
-0.004027402959764004,
... | 15 | {"_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_cron_update_buckets(self):
chromium_buildbucket_cfg = project_config_pb2.BuildbucketCfg(
buckets=[
project_config_pb2.Bucket(
name='master.tryserver.chromium.linux',
acls=[
project_config_pb2.Acl(
role=project_config_pb2.Acl.READER, grou... | |
20,886 | [
-0.022634947672486305,
-0.029658781364560127,
0.04291306063532829,
0.0008823546231724322,
-0.028072001412510872,
0.012682571075856686,
0.04281971976161003,
-0.0006584844668395817,
-0.02907540649175644,
-0.019414717331528664,
0.02333499863743782,
0.0064054569229483604,
0.017349570989608765,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_cron_update_buckets_change_reservation(self):
config.Bucket(
id='bucket',
project_id='foo',
revision='deadbeef',
config_content='name: "bucket"',
).put()
buildbucket_cfg = project_config_pb2.BuildbucketCfg(
buckets=[project_config_pb2.Bucket(name='bucket')]
... | |
20,887 | [
0.04887901991605759,
-0.0063941930420696735,
0.0813722014427185,
-0.007206522393971682,
-0.023116573691368103,
-0.004636080004274845,
0.048786185681819916,
0.022919293493032455,
-0.012277779169380665,
0.0036351741291582584,
0.05124638229608536,
0.015178955160081387,
-0.0026444224640727043,
... | 16 | {"_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_validate_buildbucket_cfg_success(self):
self.cfg_validation_test(
project_config_pb2.BuildbucketCfg(
buckets=[
project_config_pb2.Bucket(
name='good.name',
acls=[
project_config_pb2.Acl(
group='writers', role=projec... | |
20,888 | [
0.0380573607981205,
-0.011692593805491924,
0.06871091574430466,
-0.024762114509940147,
-0.04607062786817551,
-0.007099074777215719,
0.023204607889056206,
-0.0073868753388524055,
-0.017369596287608147,
-0.00386555353179574,
0.03898283839225769,
0.024604106321930885,
0.01975100301206112,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_validate_buildbucket_cfg_unsorted(self):
self.cfg_validation_test(
project_config_pb2.BuildbucketCfg(
buckets=[
project_config_pb2.Bucket(name='b'),
project_config_pb2.Bucket(name='a')
]),
[
validation_context.Message(
seve... | |
20,889 | [
0.03560150787234306,
0.006517373025417328,
0.0914614275097847,
-0.0203617662191391,
-0.02213035710155964,
0.001002010190859437,
0.04529430717229843,
0.01039334386587143,
-0.018271613866090775,
0.016985364258289337,
0.0422394685447216,
-0.005377550609409809,
0.007665808778256178,
0.02252082... | 16 | {"_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_validate_buildbucket_cfg_fail(self):
self.cfg_validation_test(
project_config_pb2.BuildbucketCfg(
buckets=[
project_config_pb2.Bucket(
name='a',
acls=[
project_config_pb2.Acl(
group='writers', identity='a@a.com',
... | |
20,890 | [
0.05977640673518181,
-0.03337673097848892,
0.07189197093248367,
-0.03865666687488556,
-0.051479365676641464,
0.002804965479299426,
0.03241031616926193,
-0.00211845594458282,
-0.02849750593304634,
-0.010577548295259476,
0.04417231306433678,
0.02367720752954483,
0.020129751414060593,
-0.0221... | 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_validate_buildbucket_cfg_duplicate_names(self):
config.Bucket(
id='master.tryserver.v8',
project_id='v8',
revision='deadbeef',
config_content=MASTER_TRYSERVER_V8_CONFIG_TEXT).put()
self.cfg_validation_test(
project_config_pb2.BuildbucketCfg(
buckets=[
... | |
20,891 | [
-0.012642882764339447,
-0.0021508049685508013,
0.024755559861660004,
-0.020842134952545166,
0.02691425383090973,
0.005279965698719025,
0.01552745420485735,
-0.01319202408194542,
0.018405713140964508,
0.02070327289402485,
0.032140567898750305,
0.024856550619006157,
-0.041002579033374786,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class ClusteringTest(XLATestCase):
def testAdd(self):
val1 = np.array([4, 3, 2, 1], dtype=np.float32)
val2 = np.array([5, 6, 7, 8], dtype=np.float32)
expected = val1 + val2
with self.test_session():
with self.test_scope():
input1 = constant_op.constant(val1, name="const1")
input... | |
20,892 | [
-0.009883319027721882,
-0.04360191896557808,
0.011879564262926579,
-0.021278779953718185,
0.00029151575290597975,
-0.03326713293790817,
0.0011517846724018455,
0.006532672327011824,
0.06753510236740112,
0.02393318898975849,
0.014468700625002384,
0.018667886033654213,
-0.022518955171108246,
... | 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 testAddFromCpuMultiple(self):
val1 = np.array([4, 3, 2, 1]).astype(np.float32)
val2 = np.array([5, 6, 7, 8]).astype(np.float32)
expected = val1 + val2
with self.test_session():
with ops.device(CPU_DEVICE):
input1 = constant_op.constant(val1, name="const1")
input2 = constant_op.... | |
20,893 | [
-0.009005401283502579,
-0.039081692695617676,
-0.002307360991835594,
-0.04220735654234886,
-0.005374279338866472,
-0.009327803738415241,
-0.013628319837152958,
0.002887957962229848,
0.06819624453783035,
0.021311325952410698,
0.006825088988989592,
0.010284081101417542,
-0.036502476781606674,
... | 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 testAdd(self):
val1 = np.array([4, 3, 2, 1], dtype=np.float32)
val2 = np.array([5, 6, 7, 8], dtype=np.float32)
expected = val1 + val2
with self.test_session():
with self.test_scope():
input1 = constant_op.constant(val1, name="const1")
input2 = constant_op.constant(val2, name="c... | |
20,894 | [
0.03572285920381546,
-0.011155667714774609,
0.008053094148635864,
0.0030392243061214685,
0.025562239810824394,
-0.011106224730610847,
0.0014330862322822213,
-0.01624215766787529,
-0.016155632212758064,
-0.009536396712064743,
0.034190114587545395,
0.024882392957806587,
0.0003067036159336567,
... | 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 testHostMemory(self):
with self.test_session() as sess:
x = array_ops.placeholder(dtypes.int32)
with self.test_scope():
y = x + 1
with ops.device(CPU_DEVICE):
# Place a computation on the CPU, so y and w cannot be merged into the
# same JIT compilation.
z = y * ... | |
20,895 | [
0.0294075608253479,
0.021214725449681282,
0.020195400342345238,
-0.032057806849479675,
-0.013799128122627735,
0.002812703140079975,
0.023699333891272545,
-0.021176502108573914,
-0.010734778828918934,
-0.018067557364702225,
0.05173080414533615,
0.019545579329133034,
-0.016016162931919098,
-... | 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 testDeadlock(self):
# Builds a graph of the form:
# x -> y
# | \
# z -> w
# where x and z are placed on the CPU and y and w are placed on the XLA
# device. If y and w are clustered for compilation, then the graph will
# deadlock since the clustered graph will contain a self-... | |
20,896 | [
0.04783650487661362,
0.0045219119638204575,
-0.020556079223752022,
-0.04932607710361481,
0.00552205229178071,
0.030302127823233604,
-0.04668740928173065,
-0.022109488025307655,
-0.0004415513831190765,
0.0029206229373812675,
-0.015949048101902008,
-0.013672132976353168,
0.005607170518487692,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def guess_format(config):
try:
json.loads(config)
return 'json'
except ValueError:
pass
try:
ElementTree.fromstring(config)
return 'xml'
except ElementTree.ParseError:
pass
if config.startswith('set') or config.startswith('delete'):
return 's... | |
20,897 | [
0.03577219322323799,
-0.001645532320253551,
0.023393012583255768,
-0.0060416776686906815,
-0.019422117620706558,
0.05470506101846695,
-0.028922684490680695,
-0.0149619709700346,
-0.019410738721489906,
0.08237617462873459,
-0.0017308667302131653,
-0.03315526992082596,
0.030333546921610832,
... | 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": "position", "annotation... | class Missle:
def __init__(self, position, direction):
self.pos = position
self.dir = direction
# Move missle on missle update tick
def update(self):
self.pos[0] = self.pos[0] + self.dir[0]
self.pos[1] = self.pos[1] + self.dir[1]
if self.pos[1] > 15 or self.pos[1]... | |
20,898 | [
0.03387700766324997,
-0.004438888281583786,
0.04755951836705208,
-0.08550956845283508,
-0.006914421916007996,
0.013621533289551735,
-0.005039479583501816,
0.00007231104245875031,
-0.009816772304475307,
0.04143775254487991,
0.020145723596215248,
-0.0020441445522010326,
0.034876979887485504,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def config_to_commands(config):
set_format = config.startswith('set') or config.startswith('delete')
candidate = NetworkConfig(indent=4, contents=config, device_os='junos')
if not set_format:
candidate = [c.line for c in candidate.items]
commands = list()
# this filters out less spec... | |
20,899 | [
0.0554065965116024,
0.005141544155776501,
0.038972437381744385,
-0.054514456540346146,
-0.006567794363945723,
0.0456400103867054,
-0.006403452716767788,
-0.004815795924514532,
0.012583870440721512,
0.07169988751411438,
0.020930076017975807,
-0.027374614030122757,
0.013346885330975056,
-0.0... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "commands", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg"... | def diff_commands(commands, config):
config = [unicode(c).replace("'", '') for c in config]
updates = list()
visited = set()
for item in commands:
if len(item) > 0:
if not item.startswith('set') and not item.startswith('delete'):
raise ValueError('line must start wi... | |
20,900 | [
0.03191191703081131,
0.025730149820446968,
0.007663059514015913,
-0.07991976290941238,
-0.00797214824706316,
0.03328823670744896,
-0.014497995376586914,
-0.012608474120497704,
0.007593077141791582,
0.06321732699871063,
0.02983577735722065,
-0.01976999267935753,
0.02689652144908905,
0.04903... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "result", "annotation": null, "type_comment": null}}], "kwarg": ... | def load_config(module, result):
candidate = module.params['lines'] or module.params['src']
if isinstance(candidate, basestring):
candidate = candidate.split('\n')
kwargs = dict()
kwargs['comment'] = module.params['comment']
kwargs['confirm'] = module.params['confirm']
kwargs['replace'... |