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 |
|---|---|---|---|---|---|
14,101 | [
0.023471638560295105,
0.04769286885857582,
0.060623351484537125,
-0.024221230298280716,
-0.012649385258555412,
0.02157423086464405,
0.043851204216480255,
-0.01772085204720497,
-0.025415895506739616,
-0.04073570668697357,
0.008760870434343815,
-0.04966055229306221,
0.03574622794985771,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def setup_mappers(cls):
p, c, C, P = cls.tables.p, cls.tables.c, cls.classes.C, cls.classes.P
mapper(
P, p, version_id_col=p.c.version_id, properties={
'c': relationship(
C, uselist=False, cascade='all, delete-orphan')})
mapper(C, c, version_id_co... | |
14,102 | [
-0.004197240807116032,
0.003855524817481637,
0.09394088387489319,
-0.034958600997924805,
-0.006313120014965534,
0.04556215554475784,
0.024189362302422523,
-0.004804736468940973,
-0.007559175603091717,
-0.01810060255229473,
0.030291929841041565,
-0.0439329631626606,
-0.009084817953407764,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "__backend__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}... | class AlternateGeneratorTest(fixtures.MappedTest):
__backend__ = True
@classmethod
def define_tables(cls, metadata):
Table(
'p', metadata,
Column('id', String(10), primary_key=True),
Column('version_id', String(32), nullable=False),
Column('data', Str... | |
14,103 | [
0.02349860407412052,
0.0032735157292336226,
0.033991530537605286,
-0.02229905128479004,
-0.007702390197664499,
0.02279149927198887,
-0.012607929296791553,
-0.0005808359710499644,
-0.0063386885449290276,
-0.07323583960533142,
0.03121362067759037,
-0.03282985836267471,
0.025102216750383377,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_child_row_switch(self):
P, C = self.classes.P, self.classes.C
assert P.c.property.strategy.use_get
session = sessionmaker()()
session.add(P(id='P1', data='P version 1'))
session.commit()
session.close()
p = session.query(P).first()
p.c = C(data... | |
14,104 | [
0.02629229985177517,
-0.0005979103152640164,
0.03730834275484085,
-0.02079688012599945,
-0.005243334919214249,
0.01784750446677208,
-0.011948753148317337,
0.0033211989793926477,
-0.006465939339250326,
-0.07517126947641373,
0.03324980288743973,
-0.03080459125339985,
0.023040423169732094,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_child_row_switch_one(self):
P, C = self.classes.P, self.classes.C
assert P.c.property.strategy.use_get
session = sessionmaker()()
session.add(P(id='P1', data='P version 1'))
session.commit()
session.close()
p = session.query(P).first()
p.c = C(... | |
14,105 | [
-0.004413651302456856,
-0.00892509426921606,
0.03854284808039665,
-0.027459822595119476,
0.004781999159604311,
-0.00023490306921303272,
-0.026964345946907997,
0.02361336164176464,
0.004602714907377958,
-0.07849389314651489,
0.030041515827178955,
-0.017263440415263176,
0.007112693972885609,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_row_switch(self):
P = self.classes.P
session = sessionmaker()()
session.add(P(id='P1', data='P version 1'))
session.commit()
session.close()
p = session.query(P).first()
session.delete(p)
session.add(P(id='P1', data="really a row-switch"))
... | |
14,106 | [
0.01559325773268938,
-0.016307948157191277,
0.04415490850806236,
-0.032148100435733795,
-0.0069909775629639626,
0.019738465547561646,
0.023298926651477814,
0.02325994335114956,
0.013299749232828617,
-0.07287248969078064,
0.03425319120287895,
-0.00477868365123868,
0.0025517717003822327,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_child_row_switch_two(self):
P = self.classes.P
Session = sessionmaker()
# TODO: not sure this test is
# testing exactly what its looking for
sess1 = Session()
sess1.add(P(id='P1', data='P version 1'))
sess1.commit()
sess1.close()
p1 = ... | |
14,107 | [
0.013220845721662045,
0.03161810711026192,
0.08967790752649307,
-0.04267045482993126,
0.026301788166165352,
0.01867706887423992,
0.02830706723034382,
-0.02847028709948063,
-0.03677120804786682,
0.00015821076522115618,
0.02381850779056549,
-0.026161886751651764,
0.012871088460087776,
0.0121... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "__backend__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}... | class PlainInheritanceTest(fixtures.MappedTest):
__backend__ = True
@classmethod
def define_tables(cls, metadata):
Table(
'base', metadata,
Column(
'id', Integer, primary_key=True,
test_needs_autoincrement=True),
Column('version_id... | |
14,108 | [
0.004630676005035639,
0.04995383322238922,
0.09619428217411041,
-0.04148820415139198,
0.017273858189582825,
0.035962339490652084,
0.04358803480863571,
-0.036404408514499664,
-0.05459555983543396,
-0.0012716400669887662,
0.008846912533044815,
-0.03023754060268402,
0.03748747706413269,
-0.02... | 8 | {"_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": "metadata", "annotation": null, "type_comment": null}}], "kwarg": n... | def define_tables(cls, metadata):
Table(
'base', metadata,
Column(
'id', Integer, primary_key=True,
test_needs_autoincrement=True),
Column('version_id', Integer, nullable=True),
Column('data', String(50))
)
Table(
... | |
14,109 | [
0.03152679651975632,
0.020780615508556366,
0.060066595673561096,
-0.027933066710829735,
-0.008570107631385326,
0.030593357980251312,
0.06011326611042023,
0.009328524582087994,
-0.01854036934673786,
-0.025179430842399597,
0.0076891775242984295,
-0.03647400438785553,
0.011685449630022049,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_update_child_table_only(self):
Base, sub, base, Sub = (
self.classes.Base, self.tables.sub, self.tables.base,
self.classes.Sub)
mapper(Base, base, version_id_col=base.c.version_id)
mapper(Sub, sub, inherits=Base)
s = Session()
s1 = Sub(data='b',... | |
14,110 | [
0.0017866621492430568,
0.026234863325953484,
0.10378971695899963,
-0.04598940163850784,
0.006290879566222429,
0.01269934605807066,
0.03788899630308151,
0.013692298904061317,
-0.00921094510704279,
-0.0323493629693985,
0.009406923316419125,
-0.0564415380358696,
0.020982664078474045,
-0.00036... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_base_both(self):
Base, sub, base, Sub = (
self.classes.Base, self.tables.sub, self.tables.base,
self.classes.Sub)
mapper(Base, base, version_id_col=base.c.version_id)
mapper(Sub, sub, inherits=Base)
session = Session()
b1 = Base(data='b1')
... | |
14,111 | [
0.0035928688012063503,
0.050088491290807724,
0.09616633504629135,
-0.04384971037507057,
0.01712322235107422,
0.035449638962745667,
0.04387199133634567,
-0.037789180874824524,
-0.05534689128398895,
-0.0004271754005458206,
0.00942501425743103,
-0.030079832300543785,
0.03729899227619171,
-0.0... | 8 | {"_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": "metadata", "annotation": null, "type_comment": null}}], "kwarg": n... | def define_tables(cls, metadata):
Table(
'base', metadata,
Column(
'id', Integer, primary_key=True,
test_needs_autoincrement=True),
Column('version_id', Integer, nullable=True),
Column('data', String(50))
)
Table(
... | |
14,112 | [
0.008135034702718258,
0.02833973988890648,
0.08675642311573029,
-0.04368935152888298,
0.014130976982414722,
0.02888423576951027,
0.03406991437077522,
0.01144090574234724,
0.00018828474276233464,
-0.023944877088069916,
0.018240628764033318,
-0.05387921258807182,
0.031684502959251404,
0.0247... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_sub_only(self):
Base, sub, base, Sub = (
self.classes.Base, self.tables.sub, self.tables.base,
self.classes.Sub)
mapper(Base, base)
mapper(Sub, sub, inherits=Base, version_id_col=sub.c.version_id)
session = Session()
s1 = Sub(data='s1', sub_data... | |
14,113 | [
-0.002771718893200159,
0.025960132479667664,
0.09811663627624512,
-0.04710813984274864,
0.010181437246501446,
0.017336303368210793,
0.04612039029598236,
0.017197003588080406,
-0.0007245884044095874,
-0.024351870641112328,
0.020806096494197845,
-0.05343988165259361,
0.020476846024394035,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_sub_both(self):
Base, sub, base, Sub = (
self.classes.Base, self.tables.sub, self.tables.base,
self.classes.Sub)
mapper(Base, base, version_id_col=base.c.version_id)
mapper(Sub, sub, inherits=Base)
session = Session()
s1 = Sub(data='s1', sub_dat... | |
14,114 | [
0.04635795205831528,
-0.01939326710999012,
0.04184683784842491,
-0.05685366690158844,
0.02060605399310589,
-0.004785976838320494,
0.02545720338821411,
-0.021184111014008522,
-0.012751271016895771,
-0.03502349182963371,
0.05005298927426338,
-0.02280494011938572,
0.01054105069488287,
0.01591... | 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_insert_col(self):
sess = self._fixture()
f1 = self.classes.Foo(value='f1')
sess.add(f1)
statements = [
# note that the assertsql tests the rule against
# "default" - on a "returning" backend, the statement
# includes "RETURNING"
... | |
14,115 | [
0.02796260640025139,
-0.03811128810048103,
0.0424811914563179,
-0.049382295459508896,
0.0045101940631866455,
0.01948547177016735,
0.04147826507687569,
-0.019963055849075317,
0.001970038516446948,
0.009509912692010403,
0.04458256810903549,
-0.03273845836520195,
-0.03737103193998337,
0.02815... | 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_update_col(self):
sess = self._fixture()
f1 = self.classes.Foo(value='f1')
sess.add(f1)
sess.flush()
f1.value = 'f2'
statements = [
# note that the assertsql tests the rule against
# "default" - on a "returning" backend, the statement
... | |
14,116 | [
0.041695185005664825,
-0.0012571453116834164,
0.04571552202105522,
-0.039571236819028854,
-0.012377073056995869,
0.0568915531039238,
0.04485582932829857,
0.021934853866696358,
0.044552408158779144,
-0.02852163091301918,
0.044527120888233185,
-0.007497042417526245,
-0.030822578817605972,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_concurrent_mod_err_expire_on_commit(self):
sess = self._fixture()
f1 = self.classes.Foo(value='f1')
sess.add(f1)
sess.commit()
f1.value
s2 = Session()
f2 = s2.query(self.classes.Foo).first()
f2.value = 'f2'
s2.commit()
f1.value... | |
14,117 | [
0.053926486521959305,
0.004167893435806036,
0.05155148729681969,
-0.06854903697967529,
0.0014894688501954079,
0.02301655150949955,
0.0011402040254324675,
0.005559131503105164,
0.026287999004125595,
-0.012585175223648548,
0.07157599925994873,
-0.05201717093586922,
-0.009639708325266838,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_delete_col(self):
sess = self._fixture()
f1 = self.classes.Foo(value='f1')
sess.add(f1)
sess.flush()
sess.delete(f1)
statements = [
# note that the assertsql tests the rule against
# "default" - on a "returning" backend, the statement
... | |
14,118 | [
0.02797921933233738,
-0.03401888906955719,
-0.0031971349380910397,
0.005390517879277468,
-0.01797029934823513,
0.015911322087049484,
0.014675935730338097,
-0.054951827973127365,
-0.015796935185790062,
-0.018233392387628555,
0.015305067412555218,
-0.03795382380485535,
0.02797921933233738,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "element", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "compiler", "annotation": null, "type_comment": null}}], "kwarg... | def compile(element, compiler, **kw):
# cache the counter value on the statement
# itself so the assertsql system gets the same
# value when it compiles the statement a second time
stmt = compiler.statement
if hasattr(stmt, "_counter"):
return ... | |
14,119 | [
0.04081365093588829,
0.003741462482139468,
0.012473655864596367,
-0.05443510785698891,
0.006300242617726326,
0.055551208555698395,
0.03614633157849312,
0.01883414201438427,
0.04502438008785248,
-0.01738828793168068,
0.047941453754901886,
0.016031214967370033,
-0.017781458795070648,
0.00854... | 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_concurrent_mod_err_noexpire_on_commit(self):
sess = self._fixture(expire_on_commit=False)
f1 = self.classes.Foo(value='f1')
sess.add(f1)
sess.commit()
# here, we're not expired overall, so no load occurs and we
# stay without a version id, unless we've emitted
... | |
14,120 | [
0.006848876364529133,
0.0420788899064064,
0.06323205679655075,
-0.11028965562582016,
0.019080817699432373,
0.03927363082766533,
0.026738416403532028,
-0.03118639625608921,
-0.03022603690624237,
0.003604505443945527,
0.019687360152602196,
-0.02313707023859024,
0.002751555060967803,
0.027142... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "each"}}, "targets": [{"_type": "Name", "_fields": {"id": "run_define_tables", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment"... | class ManualVersionTest(fixtures.MappedTest):
run_define_tables = 'each'
__backend__ = True
@classmethod
def define_tables(cls, metadata):
Table(
"a", metadata,
Column(
'id', Integer, primary_key=True,
test_needs_autoincrement=True),
... | |
14,121 | [
0.01413219328969717,
0.05170208588242531,
0.07244379818439484,
-0.03893962875008583,
0.028960123658180237,
0.036069706082344055,
0.045223016291856766,
-0.04487514868378639,
-0.04583178833127022,
0.002274739556014538,
0.015838926658034325,
-0.030286377295851707,
0.04135297238826752,
-0.0220... | 8 | {"_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": "metadata", "annotation": null, "type_comment": null}}], "kwarg": n... | def define_tables(cls, metadata):
Table(
"a", metadata,
Column(
'id', Integer, primary_key=True,
test_needs_autoincrement=True),
Column('data', String(30)),
Column('vid', Integer)
) | |
14,122 | [
0.017532363533973694,
-0.02720220759510994,
0.04875817522406578,
-0.05582916736602783,
0.021278932690620422,
0.05340181291103363,
0.05419334024190903,
0.01202464196830988,
0.01800728030502796,
-0.021529583260416985,
0.04129141941666603,
-0.04633082076907158,
-0.02873249724507332,
0.0154611... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_update(self):
sess = Session()
a1 = self.classes.A()
a1.vid = 1
a1.data = 'd1'
sess.add(a1)
sess.commit()
a1.vid = 2
a1.data = 'd2'
sess.commit()
eq_(a1.vid, 2) | |
14,123 | [
0.04105837270617485,
-0.004575857426971197,
0.03168283775448799,
-0.050036005675792694,
0.04093402996659279,
0.023973513394594193,
0.03578618913888931,
0.029867418110370636,
0.004945780616253614,
-0.06764311343431473,
0.06147564947605133,
-0.048742830753326416,
0.008063705638051033,
-0.005... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_insert(self):
sess = Session()
a1 = self.classes.A()
a1.vid = 1
sess.add(a1)
sess.commit()
eq_(a1.vid, 1) | |
14,124 | [
0.039775360375642776,
-0.011955252848565578,
0.007526148110628128,
-0.042679253965616226,
0.02284485660493374,
0.06004934012889862,
0.0642586499452591,
0.019234970211982727,
0.02813314087688923,
-0.0033368144650012255,
0.05695895478129387,
-0.027946652844548225,
-0.047288186848163605,
0.03... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_update_version_conditional(self):
sess = Session()
a1 = self.classes.A()
a1.vid = 1
a1.data = 'd1'
sess.add(a1)
sess.commit()
# change the data and UPDATE without
# incrementing version id
a1.data = 'd2'
sess.commit()
eq... | |
14,125 | [
0.02877279929816723,
-0.01742682419717312,
0.05794110149145126,
-0.04061315208673477,
0.027981795370578766,
0.06560395658016205,
0.04938836023211479,
0.023309921845793724,
0.011778555810451508,
-0.030676154419779778,
0.024397553876042366,
-0.032505352050065994,
-0.011284178122878075,
0.028... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_update_concurrent_check(self):
sess = Session()
a1 = self.classes.A()
a1.vid = 1
a1.data = 'd1'
sess.add(a1)
sess.commit()
a1.vid = 2
sess.execute(self.tables.a.update().values(vid=3))
a1.data = 'd2'
assert_raises(
or... | |
14,126 | [
0.005729478783905506,
-0.019510891288518906,
0.03570561110973358,
-0.012038151733577251,
0.031912460923194885,
-0.01426407415419817,
-0.005479630548506975,
0.025302832946181297,
0.007353493943810463,
-0.0024956450797617435,
0.019726669415831566,
-0.028028452768921852,
-0.032003313302993774,
... | 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": "verb", "annotation": null, "type_comment": null}}, {"_type": "arg... | def sendRequest(self, verb, path='', headers='', body=''):
self.closeConnection()
self.lastrequestbody = body
if(self.secure):
c = http.client.HTTPSConnection(self.host)
else:
c = http.client.HTTPConnection(self.host)
ts = datetime.datetime.now()
... | |
14,127 | [
-0.030952662229537964,
0.0002633285184856504,
-0.007290740497410297,
-0.022933421656489372,
0.048689067363739014,
-0.005027799867093563,
-0.012011652812361717,
0.050295207649469376,
0.02627190388739109,
-0.012034596875309944,
0.03418789431452751,
-0.05387461185455322,
-0.006114814430475235,
... | 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": "response", "annotation": null, "type_comment": null}}, {"_type": ... | def processResponse(self, response, path=''):
status = response.status
if status == 200:
return self.readAndClose(response)
elif status == 201:
return self.readAndClose(response)
elif status == 400:
msg = 'Bad Request: {}'.format(response.read())
... | |
14,128 | [
0.05198192223906517,
0.03639199957251549,
-0.004647891037166119,
-0.009144536219537258,
-0.0010158172808587551,
0.015333968214690685,
0.016799885779619217,
-0.03571721166372299,
0.035182032734155655,
-0.005535004194825888,
0.006701339967548847,
-0.05379686877131462,
0.042651236057281494,
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": "raw_string", "annotation": null, "type_comment": null}}], "kwarg"... | def raw_to_json(self, raw_string):
def controls_repl(matchobj):
if matchobj.group(1) == '\r':
return '\n'
else:
return matchobj.group(1)
def non_controls_repl(matchobj):
return matchobj.group(1)
try:
return json.lo... | |
14,129 | [
-0.009283545427024364,
0.01388838142156601,
-0.038907166570425034,
-0.00027364297420717776,
0.05740530788898468,
-0.06193627044558525,
-0.034041307866573334,
-0.009012673050165176,
0.04073925316333771,
0.0019712143111974,
0.011278153397142887,
-0.029234550893306732,
0.004794446285814047,
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": "_format", "annotation": null, "type_comment": null}}, {"_type": "... | def transformResponse(self, _format, responseString):
try:
if _format == self.FORMAT_JSON:
return self.raw_to_json(responseString)
if _format == self.FORMAT_XML:
return xml.parseString(responseString)
return responseString
except Except... | |
14,130 | [
0.031107796356081963,
0.005118948873132467,
0.037063118070364,
-0.005000718403607607,
0.042422905564308167,
-0.0019453320419415832,
0.043789129704236984,
-0.030477233231067657,
-0.03608224168419838,
-0.03035462275147438,
-0.012733878567814827,
-0.044384658336639404,
0.020633436739444733,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "datetime"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}},... | class DateTimeField(CustomMappingMixin, BaseFieldMixin, field.Field):
name = 'datetime'
_coerce = True
_custom_mapping = {'type': 'date', 'format': 'dateOptionalTime'}
def _to_python(self, data):
if not data:
return None
if isinstance(data, datetime.datetime):
re... | |
14,131 | [
0.037267692387104034,
0.049717288464307785,
0.038828957825899124,
-0.03325299918651581,
0.02423008158802986,
-0.007233540993183851,
-0.006534011568874121,
0.01873522624373436,
-0.04517541453242302,
0.015693793073296547,
-0.00965654943138361,
-0.01437583938241005,
-0.014244044199585915,
0.0... | 10 | {"_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": "primary_key"}}, {"_type": "Constant", "_fields": {"kind"... | class BaseFieldMixin(object):
_valid_kwargs = ('primary_key', 'required', 'multi')
def __init__(self, *args, **kwargs):
self._init_kwargs = kwargs.copy()
kwargs = self.drop_invalid_kwargs(kwargs)
self._primary_key = kwargs.pop('primary_key', False)
if self._primary_key:
... | |
14,132 | [
0.03245697170495987,
0.02172018215060234,
0.014084921218454838,
-0.009181282483041286,
0.022327208891510963,
-0.03317781537771225,
0.010803181678056717,
-0.009461083449423313,
-0.03418320417404175,
-0.049093302339315414,
-0.001975208753719926,
-0.02784735895693302,
0.010480699129402637,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "time"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_... | class TimeField(CustomMappingMixin, BaseFieldMixin, field.Field):
name = 'time'
_coerce = True
_custom_mapping = {'type': 'date', 'format': 'HH:mm:ss'}
def _to_python(self, data):
if not data:
return None
if isinstance(data, datetime.time):
return data
if... | |
14,133 | [
-0.02878907136619091,
-0.012951474636793137,
0.04109117016196251,
-0.02245764061808586,
0.04192093014717102,
-0.0038511697202920914,
-0.024117160588502884,
0.0011657228460535407,
0.02579472027719021,
-0.002570452867075801,
0.02543395385146141,
-0.01746104098856449,
0.007751944474875927,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null... | def _to_python(self, data):
if not data:
return None
if isinstance(data, datetime.datetime):
return data
try:
return parser.parse(data)
except Exception as e:
raise ValidationException(
'Could not parse datetime from the val... | |
14,134 | [
-0.02406262420117855,
-0.007474271580576897,
0.026073884218931198,
-0.023011697456240654,
0.02668994478881359,
-0.009802620857954025,
-0.0316365547478199,
-0.0015061789890751243,
0.038485705852508545,
-0.021761454641819,
0.023029815405607224,
-0.0022366191260516644,
0.006033775862306356,
-... | 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": "data", "annotation": null, "type_comment": null}}], "kwarg": null... | def _to_python(self, data):
if not data:
return None
if isinstance(data, datetime.time):
return data
if isinstance(data, datetime.datetime):
return data.time()
try:
return parser.parse(data).time()
except Exception as e:
... | |
14,135 | [
0.032799169421195984,
0.022465184330940247,
-0.00038516303175128996,
0.0015010826755315065,
0.0029894011095166206,
0.035944294184446335,
0.0053507983684539795,
0.010272716172039509,
-0.06996883451938629,
0.026896951720118523,
-0.0005089768092148006,
0.009644711390137672,
-0.00915966834872961... | 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": "doc_class", "annotation": null, "type_comment": null}}], "kwarg":... | def __init__(self, doc_class, *args, **kwargs):
prefix_len = len(self._backref_prefix)
self._backref_kwargs = {
key[prefix_len:]: val for key, val in kwargs.items()
if key.startswith(self._backref_prefix)}
for key in self._backref_kwargs:
del kwargs[self._back... | |
14,136 | [
-0.009394603781402111,
0.06289180368185043,
0.006104534026235342,
0.010239502415060997,
-0.028379647061228752,
0.028066307306289673,
0.026051979511976242,
-0.0005343565135262907,
-0.06374230235815048,
0.01912492886185646,
0.000593457487411797,
-0.038697484880685806,
0.003715316765010357,
0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "document", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}... | def Relationship(document, **kwargs):
# XXX deal with updating, deleting rules
_init_kwargs = kwargs.copy()
_init_kwargs['document'] = document
kwargs['multi'] = kwargs.pop('uselist', True)
kwargs['doc_class'] = document
field = ReferenceField(**kwargs)
field._init_kwargs = _init_kwargs
... | |
14,137 | [
0.016989652067422867,
-0.015167845413088799,
0.02450590766966343,
-0.00014078339154366404,
0.021861685439944267,
-0.02227809838950634,
-0.007271612994372845,
0.01683349721133709,
0.02084147371351719,
0.05446682870388031,
0.011586693115532398,
0.0085885189473629,
0.04747108742594719,
-0.052... | 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": "_all", "annotation": null, "type_comment": null}}], "kwarg": null... | def list_containers(self, _all=True):
containers = []
for container_id in self._containers.iterkeys():
containers.append({
'Status': 'Exit 0',
'Created': int(time.time()),
'Image': 'ubuntu:12.04',
'Ports': '',
'C... | |
14,138 | [
0.033433638513088226,
-0.0011415553744882345,
-0.03368779644370079,
-0.002417411422356963,
0.00012545556819532067,
-0.008000274188816547,
0.01401347666978836,
0.012950624339282513,
-0.004528675228357315,
-0.014591114595532417,
0.000037749490729765967,
-0.012245907448232174,
0.043877318501472... | 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": "image_name", "annotation": null, "type_comment": null}}], "kwarg"... | def inspect_image(self, image_name):
if not self._is_image_exists(image_name):
return None
image_name = self._image_name(image_name)
if image_name in self._pulled_images:
return self._pulled_images[image_name]
return {'container_config': {'Cmd': None}} | |
14,139 | [
0.03424029052257538,
0.01075771264731884,
0.005949706304818392,
0.027336489409208298,
-0.017945600673556328,
-0.04095113277435303,
0.0022713406942784786,
0.003599304473027587,
-0.02043268457055092,
0.012574784457683563,
0.02703632414340973,
0.03672737628221512,
0.06693688035011292,
-0.0418... | 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": "args", "annotation": null, "type_comment": null}}, {"_type": "arg... | def create_container(self, args, name):
self.name = name
data = {
'Hostname': '',
'User': '',
'Memory': 0,
'MemorySwap': 0,
'AttachStdin': False,
'AttachStdout': False,
'AttachStderr': False,
'PortSpecs': Non... | |
14,140 | [
0.009390640072524548,
0.0364997573196888,
0.06109609827399254,
-0.043028414249420166,
-0.031094634905457497,
0.025112561881542206,
0.005055914632976055,
-0.08314170688390732,
0.0013683612924069166,
0.031975243240594864,
0.009322317317128181,
-0.08636049181222916,
0.033615000545978546,
-0.0... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "highways"}}]}}, "targets": [{"_type": "Name", "_fields": ... | class Analyser_Osmosis_Relation_AssociatedStreet(Analyser_Osmosis):
requires_tables_common = ['highways']
def __init__(self, config, logger = None):
Analyser_Osmosis.__init__(self, config, logger)
self.classs[1] = self.def_class(item = 2060, level = 3, tags = ['addr', 'relation', 'fix:chair'],... | |
14,141 | [
0.010029339231550694,
-0.004537210799753666,
-0.017123788595199585,
0.021612444892525673,
0.003814278170466423,
-0.027903037145733833,
-0.016562707722187042,
0.016595076769590378,
-0.002704253187403083,
0.05731667950749397,
0.010358436033129692,
0.023910721763968468,
0.08347173035144806,
-... | 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": "container_id", "annotation": null, "type_comment": null}}], "kwar... | def inspect_container(self, container_id):
if container_id not in self._containers:
return
container = self._containers[container_id]
info = {
'Args': [],
'Config': container['config'],
'Created': str(timeutils.utcnow()),
'ID': containe... | |
14,142 | [
0.00985247828066349,
0.025742603465914726,
0.05424870550632477,
-0.027755150571465492,
-0.035775307565927505,
0.019239366054534912,
-0.011549627408385277,
-0.06770575046539307,
-0.002921199658885598,
0.046108394861221313,
0.019014080986380577,
-0.07347305119037628,
0.04544755816459656,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, config, logger = None):
Analyser_Osmosis.__init__(self, config, logger)
self.classs[1] = self.def_class(item = 2060, level = 3, tags = ['addr', 'relation', 'fix:chair'],
title = T_('addr:housenumber or addr:housename without addr:street, addr:district, addr:neighbourhood, ... | |
14,143 | [
-0.01631956174969673,
0.05184031277894974,
0.10147958248853683,
-0.05687953904271126,
-0.04378913342952728,
-0.004615670070052147,
0.02308197133243084,
-0.0457005649805069,
-0.0007240267004817724,
0.022401386871933937,
0.0006896354607306421,
-0.06429357081651688,
0.027397170662879944,
0.00... | 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 analyser_osmosis_common(self):
self.run(sql00.format(self.config.options.get("proj", 4326)))
self.run(sql01.format(self.config.options.get("proj", 4326)))
self.run(sql10, lambda res: {"class":1, "subclass":1, "data":[self.way_full, self.positionAsText]} )
self.run(sql11, lambda res: ... | |
14,144 | [
0.044125430285930634,
0.06082075461745262,
0.06099436432123184,
-0.04288123548030853,
-0.011827061884105206,
0.022120583802461624,
0.03998776525259018,
-0.058071959763765335,
0.027357766404747963,
0.008217456750571728,
0.015277525410056114,
-0.060589276254177094,
0.006387336645275354,
0.01... | 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 analyser_osmosis_diff(self):
self.run(sql20.format("touched_"), self.callback20)
self.run(sql30.format("touched_", ""), self.callback30)
self.run(sql30.format("not_touched_", "touched_"), self.callback30)
self.run(sql40.format("touched_"), self.callback40)
self.run(sql41.form... | |
14,145 | [
0.014240428805351257,
-0.02332671731710434,
0.05928470566868782,
0.03070705756545067,
0.0001727876951918006,
0.007725160103291273,
0.040845952928066254,
0.0023487028665840626,
-0.0043314131908118725,
0.02528674155473709,
0.0007750870427116752,
0.0044856746681034565,
0.021463483572006226,
-... | 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 drow_border():
mypen = turtle.Turtle()
mypen.color('white')
mypen.penup()
mypen.setposition(-PLAYGROUND_SIDE, -PLAYGROUND_SIDE)
mypen.pendown()
mypen.pensize(3)
for side in range(4):
mypen.forward(2 * PLAYGROUND_SIDE)
mypen.left(90)
mypen.hideturtle() | |
14,146 | [
0.015147540718317032,
-0.04593697562813759,
0.06931108981370926,
-0.0007621304248459637,
-0.00598929962143302,
0.030320432037115097,
0.03531468287110329,
-0.0014474140480160713,
-0.03128379210829735,
0.0494861900806427,
-0.010641305707395077,
-0.025021962821483612,
0.018468590453267097,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"... | def place_enemies():
square_side = PLAYGROUND_SIDE // 5
squares_per_side = (2 * PLAYGROUND_SIDE // square_side)
density = 0.6
enemy_position_range = (-squares_per_side // 2 + 1, squares_per_side // 2 - 2)
for _ in range(int((squares_per_side ** 2) * density)):
while True:
x = ran... | |
14,147 | [
0.010176868177950382,
0.008127235807478428,
0.053706295788288116,
0.0323188342154026,
-0.003947769291698933,
0.0391152948141098,
0.017822885885834694,
-0.015909897163510323,
-0.026710566133260727,
0.05622526630759239,
-0.0064340620301663876,
-0.027970049530267715,
0.006261773873120546,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "y", "annotation": null, "type_comment": null}}], "kwarg": null, "var... | def can_move(x, y):
region = (PLAYGROUND_SIDE // 5) // 3
def in_range(i, j):
return (j - region) <= i and i <= (j + region)
for e in enemies:
if in_range(x, e.xcor()) and in_range(y, e.ycor()):
return False
return True | |
14,148 | [
0.027233967557549477,
0.014613348059356213,
0.0060048759914934635,
-0.021789545193314552,
0.0031521893106400967,
0.0048513468354940414,
0.05835850164294243,
-0.00889018177986145,
-0.005227949004620314,
0.04832368344068527,
0.036557093262672424,
-0.008433515205979347,
0.01787525601685047,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "move_player", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def play(move_player):
window = turtle.Screen()
window.bgcolor('black')
window.tracer(0)
player = turtle.Turtle()
player.penup()
player.setposition(-PLAYGROUND_SIDE, 0)
player.speed(0)
player.color('white')
play_game = True
def quit_game():
play_game = False
windo... | |
14,149 | [
0.0031604422256350517,
0.019041243940591812,
0.05173470079898834,
-0.005074671003967524,
-0.01846865937113762,
-0.03372635319828987,
0.00826318096369505,
0.0015409261686727405,
-0.008010569959878922,
0.02907831408083439,
0.0027534582186490297,
-0.021354036405682564,
-0.015661871060729027,
... | 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": "is_reftest", "annotati... | class FailureCrash(TestFailure):
def __init__(self, is_reftest=False, process_name='DumpRenderTree', pid=None):
super(FailureCrash, self).__init__()
self.process_name = process_name
self.pid = pid
self.is_reftest = is_reftest
def message(self):
if self.pid:
r... | |
14,150 | [
0.0023941604886204004,
0.03196663036942482,
0.012980186380445957,
-0.015571774914860725,
0.015115744434297085,
0.023691343143582344,
0.020499128848314285,
0.03501424938440323,
0.016939867287874222,
-0.000435175490565598,
-0.01926450990140438,
-0.020265553146600723,
0.014715326949954033,
-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 TestErrorTrigger(ManageTestCase):
def test_trigger_error(self):
url = reverse('manage:error_trigger')
response = self.client.get(url)
assert self.user.is_superuser
eq_(response.status_code, 200)
# sans a message
response = self.client.post(url, {'message': ''}... | |
14,151 | [
0.030766960233449936,
0.04625869169831276,
0.01338687539100647,
-0.06201503053307533,
-0.051238175481557846,
0.004988505505025387,
0.0111617436632514,
0.0034880449529737234,
-0.045079972594976425,
0.000662277452647686,
0.054702166467905045,
0.007541393395513296,
0.021806294098496437,
0.023... | 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 rebuild():
f = open(script, 'rb')
content = f.read()
f.close()
parts = []
last_pos = 0
match = None
for match in file_regex.finditer(content):
parts.append(content[last_pos:match.start()])
last_pos = match.end()
filename = match.group(1)
varname = match.gr... | |
14,152 | [
0.0214717835187912,
-0.00019660517864394933,
0.032601263374090195,
-0.001283705118112266,
0.012497958727180958,
0.024281403049826622,
0.046479810029268265,
0.03514445200562477,
0.022077305242419243,
-0.004565630108118057,
-0.002832325641065836,
-0.032431717962026596,
0.03102690912783146,
-... | 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": "mocked_client", "annotation": null, "type_comment": null}}], "kwa... | def test_trigger_error_with_raven(self, mocked_client):
url = reverse('manage:error_trigger')
assert self.user.is_superuser
raven_config = {
'dsn': 'fake123'
}
with self.settings(RAVEN_CONFIG=raven_config):
response = self.client.post(url, {
... | |
14,153 | [
0.03568042814731598,
0.027748750522732735,
-0.006615797057747841,
0.008143918588757515,
0.03286674618721008,
0.012770731933414936,
0.017233816906809807,
0.060785286128520966,
0.03298802301287651,
0.006876547820866108,
0.006021527107805014,
0.003068371443077922,
0.004284198395907879,
-0.011... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_trigger_error(self):
url = reverse('manage:error_trigger')
response = self.client.get(url)
assert self.user.is_superuser
eq_(response.status_code, 200)
# sans a message
response = self.client.post(url, {'message': ''})
eq_(response.status_code, 200)
... | |
14,154 | [
-0.0400574617087841,
-0.04018287733197212,
0.06541632115840912,
-0.0075311544351279736,
-0.023452553898096085,
-0.04101061448454857,
-0.03632010519504547,
-0.016968611627817154,
0.0593964159488678,
-0.0036119441501796246,
0.024192500859498978,
0.011839150451123714,
-0.013557331636548042,
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 get_fc_wwpns():
hbas = get_fc_hbas()
wwpns = []
for hba in hbas:
wwpn = hba['port_name'].replace('0x', '')
wwpns.append(wwpn)
return wwpns | |
14,155 | [
-0.0367591567337513,
-0.030502814799547195,
0.06090512499213219,
-0.003015105379745364,
-0.03304052725434303,
-0.06366897374391556,
0.003448526607826352,
-0.009371952153742313,
0.028442492708563805,
0.013429781422019005,
0.0023775361478328705,
0.00011444051779108122,
-0.02711082063615322,
... | 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 get_fc_wwnns():
hbas = get_fc_hbas()
wwnns = []
for hba in hbas:
wwnn = hba['node_name'].replace('0x', '')
wwnns.append(wwnn)
return wwnns | |
14,156 | [
0.033699408173561096,
0.051394023001194,
-0.005030632019042969,
-0.03280593454837799,
0.03305843845009804,
-0.009090099483728409,
0.019840890541672707,
0.014654872007668018,
0.015179300680756569,
0.02701779454946518,
-0.008157781325280666,
-0.0031271495390683413,
0.023424487560987473,
0.01... | 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": "path", "annotation": n... | class File(object):
def __init__(self, path, mode=None):
if path in files:
self.fp = StringIO.StringIO(files[path])
else:
self.fp = StringIO.StringIO(files[os.path.split(path)[-1]])
def __enter__(self):
return self.fp
def __exit__(self, *args):
retur... | |
14,157 | [
-0.05801554024219513,
0.021946515887975693,
0.023714719340205193,
-0.04437842220067978,
-0.05912500247359276,
0.0008884352282620966,
-0.051405005156993866,
0.005342168267816305,
0.01982005126774311,
0.05403997376561165,
-0.02387651614844799,
-0.06721481680870056,
0.01665346510708332,
-0.03... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": ... | def list_virtual_gateways(client, module):
params = dict()
params['Filters'] = ansible_dict_to_boto3_filter_list(module.params.get('filters'))
params['DryRun'] = module.check_mode
if module.params.get("vpn_gateway_ids"):
params['VpnGatewayIds'] = module.params.get("vpn_gateway_ids")
try:
... | |
14,158 | [
0.02602938935160637,
0.022720148786902428,
-0.01416304986923933,
-0.01005737017840147,
-0.03509275242686272,
0.06756775081157684,
-0.00790266040712595,
0.02602938935160637,
0.017929160967469215,
0.0343024879693985,
0.04892240837216377,
-0.04094566032290459,
0.007365526631474495,
-0.0091991... | 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 main():
# This was tested with the Grove Electromagnetic Module
# Instantiate a Grove Electromagnet on digital pin D2
myElectromagnet = upmGroveelectromagnet.GroveElectromagnet(2)
## Exit handlers ##
# This stops python from printing a stacktrace when you hit control-C
def SIGINTHandler(sig... | |
14,159 | [
0.028236567974090576,
0.007643992081284523,
0.029453055933117867,
-0.030692938715219498,
-0.015381560660898685,
0.02828335575759411,
-0.006316382437944412,
0.03682217001914978,
0.0489402636885643,
0.07153888046741486,
0.026926502585411072,
-0.07397185266017914,
-0.0001229099289048463,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
argument_spec = ec2_argument_spec()
argument_spec.update(
dict(
filters = dict(type='dict', default=dict()),
vpn_gateway_ids = dict(type='list', default=None)
)
)
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
# Val... | |
14,160 | [
0.012085502035915852,
0.018785202875733376,
-0.060936495661735535,
-0.035652823746204376,
0.002749126171693206,
-0.006729292683303356,
0.011339775286614895,
-0.005353250075131655,
0.013695323839783669,
0.04024554789066315,
0.05648581311106682,
-0.05459190532565117,
-0.005518966820091009,
-... | 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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
webpage = self._download_webpage(url, video_id)
video_title = self._html_search_regex(r'<h1><strong>([^<]+)</strong>',
webpage, 'title').strip()... | |
14,161 | [
0.015779603272676468,
0.025447892025113106,
-0.09367498010396957,
-0.06512368470430374,
0.006737962365150452,
-0.027978358790278435,
0.01721194200217724,
0.0015382725978270173,
0.0013256598031148314,
0.024469127878546715,
0.06784513592720032,
-0.03731243684887886,
0.0010578421643003821,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "^https?://(?:\\w+\\.)?slutload\\.com/video/[^/]+/(?P<id>[^/]+)/?$"}}, "targets": [{"_type": "Name", "_fields": {"id": "_VALID_URL", "ctx"... | class SlutloadIE(InfoExtractor):
_VALID_URL = r'^https?://(?:\w+\.)?slutload\.com/video/[^/]+/(?P<id>[^/]+)/?$'
_TEST = {
'url': 'http://www.slutload.com/video/virginie-baisee-en-cam/TD73btpBqSxc/',
'md5': '0cf531ae8006b530bd9df947a6a0df77',
'info_dict': {
'id': 'TD73btpBqSxc... | |
14,162 | [
0.04324863478541374,
0.03393682837486267,
0.012878482230007648,
-0.016092762351036072,
-0.009455966763198376,
0.026077324524521828,
0.030113862827420235,
-0.01414924394339323,
0.008265294134616852,
-0.010368993505835533,
0.0018794467905536294,
0.0038283048197627068,
0.029174139723181725,
0... | 14 | {"_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": "AvailabilityZone"}}, {"_type": "Constant", "_fields": {"... | class Volume(vb.BaseVolume):
PROPERTIES = (
AVAILABILITY_ZONE, SIZE, BACKUP_ID, TAGS,
) = (
'AvailabilityZone', 'Size', 'SnapshotId', 'Tags',
)
_TAG_KEYS = (
TAG_KEY, TAG_VALUE,
) = (
'Key', 'Value',
)
properties_schema = {
AVAILABILITY_ZONE: proper... | |
14,163 | [
0.02433411031961441,
0.025379542261362076,
0.047155678272247314,
-0.007935278117656708,
-0.010037264786660671,
-0.001615415676496923,
0.004673861898481846,
-0.039326056838035583,
-0.008063176646828651,
-0.03594508394598961,
0.0014694443671032786,
-0.012055838480591774,
0.03478843718767166,
... | 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": "InstanceId"}}, {"_type": "Constant", "_fields": {"kind":... | class VolumeAttachment(vb.BaseVolumeAttachment):
PROPERTIES = (
INSTANCE_ID, VOLUME_ID, DEVICE,
) = (
'InstanceId', 'VolumeId', 'Device',
)
properties_schema = {
INSTANCE_ID: properties.Schema(
properties.Schema.STRING,
_('The ID of the instance to which ... | |
14,164 | [
0.03685373440384865,
-0.0007540354272350669,
0.016003133729100227,
-0.03921254724264145,
0.03488445281982422,
0.024951471015810966,
0.015018492005765438,
0.007785161957144737,
0.015591965056955814,
0.0013532061129808426,
0.0034732967615127563,
-0.04254518076777458,
-0.004049474373459816,
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 TestSpecification(object):
def test_from_dict_recursive(self):
spec = Specification.from_dict({'a': 'b', 'c': {'d': 'e', 'f': {'g': 'h'}}})
assert type(spec) is Specification
assert 'a' in spec
assert spec['a'] == 'b'
assert type(spec['c']) is Specification
asse... | |
14,165 | [
0.046089883893728256,
-0.01811729185283184,
0.005172977689653635,
-0.04129940643906593,
0.010535886511206627,
0.02473321743309498,
0.010762748308479786,
0.039801064878702164,
0.014550813473761082,
-0.0018069809302687645,
0.016239088028669357,
-0.032752517610788345,
0.0006406868924386799,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_from_dict_recursive(self):
spec = Specification.from_dict({'a': 'b', 'c': {'d': 'e', 'f': {'g': 'h'}}})
assert type(spec) is Specification
assert 'a' in spec
assert spec['a'] == 'b'
assert type(spec['c']) is Specification
assert spec['c']['d'] == 'e'
asse... | |
14,166 | [
0.020813869312405586,
0.008338010869920254,
0.045541245490312576,
-0.040979642421007156,
-0.006278435233980417,
-0.015155487693846226,
-0.029637953266501427,
-0.01805945858359337,
0.0031049433164298534,
-0.0010219983523711562,
0.04693714529275894,
-0.02547517977654934,
0.005415345076471567,
... | 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 testFindFileContainingSymbol(self):
file_desc1 = self.pool.FindFileContainingSymbol(
'google.protobuf.python.internal.Factory1Message')
self.assertIsInstance(file_desc1, descriptor.FileDescriptor)
self.assertEqual('google/protobuf/internal/factory_test1.proto',
file_desc1.na... | |
14,167 | [
0.012618746608495712,
-0.015133515000343323,
0.056178122758865356,
-0.042953137308359146,
0.0005181797314435244,
-0.03466787561774254,
-0.042930684983730316,
-0.023328963667154312,
-0.0008812915184535086,
-0.011119989678263664,
0.05254068970680237,
0.00585469463840127,
0.011832881718873978,
... | 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 testFindFileByName(self):
name1 = 'google/protobuf/internal/factory_test1.proto'
file_desc1 = self.pool.FindFileByName(name1)
self.assertIsInstance(file_desc1, descriptor.FileDescriptor)
self.assertEqual(name1, file_desc1.name)
self.assertEqual('google.protobuf.python.internal', file_desc1.packa... | |
14,168 | [
-0.011927932500839233,
-0.037225380539894104,
0.08161216974258423,
-0.0177640151232481,
-0.0021492948289960623,
-0.03129629045724869,
0.004769429098814726,
0.02534394897520542,
-0.015729524195194244,
-0.0020577427931129932,
0.014718092046678066,
-0.005385589320212603,
-0.008353040553629398,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class DefaultDescriptorPoolTest(DescriptorPoolTestBase, unittest.TestCase):
def setUp(self):
self.pool = descriptor_pool.Default()
self.factory_test1_fd = descriptor_pb2.FileDescriptorProto.FromString(
factory_test1_pb2.DESCRIPTOR.serialized_pb)
self.factory_test2_fd = descriptor_pb2.FileDescript... | |
14,169 | [
-0.008997578173875809,
-0.009278370998799801,
0.05884440615773201,
-0.041264332830905914,
-0.03215688094496727,
-0.019313661381602287,
-0.0341346375644207,
-0.017750989645719528,
-0.004776529967784882,
-0.006140816491097212,
0.04023883119225502,
-0.0013459742767736316,
0.029886120930314064,
... | 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 testFindMethods(self):
self.assertIs(
self.pool.FindFileByName('google/protobuf/unittest.proto'),
unittest_pb2.DESCRIPTOR)
self.assertIs(
self.pool.FindMessageTypeByName('protobuf_unittest.TestAllTypes'),
unittest_pb2.TestAllTypes.DESCRIPTOR)
self.assertIs(
self.p... | |
14,170 | [
0.011517205275595188,
-0.025168629363179207,
0.059505563229322433,
-0.03495572879910469,
0.00854319054633379,
-0.02384263649582863,
0.015709873288869858,
0.03710257634520531,
0.016846438869833946,
-0.010753180831670761,
0.04139627143740654,
-0.02861621417105198,
-0.026494624093174934,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
self.pool = descriptor_pool.DescriptorPool()
self.factory_test1_fd = descriptor_pb2.FileDescriptorProto.FromString(
factory_test1_pb2.DESCRIPTOR.serialized_pb)
self.factory_test2_fd = descriptor_pb2.FileDescriptorProto.FromString(
factory_test2_pb2.DESCRIPTOR.serialized_pb)
... | |
14,171 | [
0.00456464197486639,
-0.03328028693795204,
0.05789857730269432,
-0.03305233642458916,
0.014930538833141327,
-0.04036944359540939,
0.021085111424326897,
0.04292244836688042,
-0.005841145757585764,
0.016275426372885704,
0.00809212401509285,
-0.02621392346918583,
-0.017415162175893784,
-0.056... | 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 CreateDescriptorPoolTest(DescriptorPoolTestBase, unittest.TestCase):
def setUp(self):
self.pool = descriptor_pool.DescriptorPool()
self.factory_test1_fd = descriptor_pb2.FileDescriptorProto.FromString(
factory_test1_pb2.DESCRIPTOR.serialized_pb)
self.factory_test2_fd = descriptor_pb2.FileDe... | |
14,172 | [
0.005226972047239542,
-0.019945256412029266,
0.08264543861150742,
-0.027658047154545784,
0.026930203661322594,
-0.01919393427670002,
0.04275492578744888,
0.03484256565570831,
0.01093525905162096,
-0.005520456936210394,
-0.0012407087488099933,
-0.02955983206629753,
0.02014482580125332,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class SecondaryDescriptorFromDescriptorDB(DescriptorPoolTestBase,
unittest.TestCase):
def setUp(self):
self.factory_test1_fd = descriptor_pb2.FileDescriptorProto.FromString(
factory_test1_pb2.DESCRIPTOR.serialized_pb)
self.factory_test2_fd = descriptor_pb2.Fi... | |
14,173 | [
0.0034923909697681665,
-0.02877386473119259,
0.06987237185239792,
-0.03731764107942581,
-0.0022249415051192045,
-0.019935477524995804,
0.020242365077137947,
0.02512802928686142,
0.023961853235960007,
-0.023667240515351295,
0.047015316784381866,
-0.028675660490989685,
0.0016679390100762248,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
self.factory_test1_fd = descriptor_pb2.FileDescriptorProto.FromString(
factory_test1_pb2.DESCRIPTOR.serialized_pb)
self.factory_test2_fd = descriptor_pb2.FileDescriptorProto.FromString(
factory_test2_pb2.DESCRIPTOR.serialized_pb)
db = descriptor_database.DescriptorDatabase()... | |
14,174 | [
-0.015575517900288105,
0.0058626336976885796,
0.05034775286912918,
-0.0320018008351326,
0.007133325561881065,
-0.04659566655755043,
-0.031521882861852646,
0.02497754618525505,
-0.0009018912096507847,
0.043345313519239426,
0.0062280260026454926,
-0.01949121244251728,
0.03411780297756195,
-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": "name", "annotation": n... | class ProtoFile(object):
def __init__(self, name, package, messages, dependencies=None,
public_dependencies=None):
self.name = name
self.package = package
self.messages = messages
self.dependencies = dependencies or []
self.public_dependencies = public_dependencies or []
def Che... | |
14,175 | [
-0.004154895432293415,
0.02718537487089634,
0.04557348042726517,
-0.021040890365839005,
0.020213311538100243,
-0.0404946431517601,
-0.027253394946455956,
0.012062234804034233,
0.00523754907771945,
0.05849730223417282,
0.025054076686501503,
-0.004517669789493084,
0.0254621971398592,
0.00727... | 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": "test", "annotation": null, "type_comment": null}}, {"_type": "arg... | def CheckFile(self, test, pool):
file_desc = pool.FindFileByName(self.name)
test.assertEqual(self.name, file_desc.name)
test.assertEqual(self.package, file_desc.package)
dependencies_names = [f.name for f in file_desc.dependencies]
test.assertEqual(self.dependencies, dependencies_names)
public_d... | |
14,176 | [
0.01351925265043974,
0.054482925683259964,
0.0011028789449483156,
-0.031210416927933693,
-0.015142915770411491,
0.00929659977555275,
0.02949655055999756,
-0.007819517515599728,
-0.006263507064431906,
0.04880010336637497,
0.03283407911658287,
0.0019266908057034016,
0.04884520545601845,
0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "test", "annotation": null, "type_comment": null}}, {"_type": "arg... | def CheckType(self, test, containing_type_desc, name, file_desc):
if containing_type_desc is None:
desc = file_desc.message_types_by_name[name]
expected_full_name = '.'.join([file_desc.package, name])
else:
desc = containing_type_desc.nested_types_by_name[name]
expected_full_name = '.'.j... | |
14,177 | [
-0.002538656583055854,
0.025717929005622864,
0.008679533377289772,
-0.028368819504976273,
-0.026273760944604874,
0.011405249126255512,
0.03255894035100937,
-0.00200019427575171,
-0.027342667803168297,
0.0366421677172184,
0.035380858927965164,
-0.01587328501045704,
0.037176623940467834,
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": "type_dict", "annotatio... | class MessageType(object):
def __init__(self, type_dict, field_list, is_extendable=False,
extensions=None):
self.type_dict = type_dict
self.field_list = field_list
self.is_extendable = is_extendable
self.extensions = extensions or []
def CheckType(self, test, containing_type_desc, n... | |
14,178 | [
0.03034883365035057,
0.028264984488487244,
0.0071881734766066074,
-0.02691269852221012,
0.016892485320568085,
0.014010565355420113,
0.017424531280994415,
-0.012613941915333271,
0.001351592713035643,
0.05812611058354378,
0.02607029117643833,
-0.016548871994018555,
0.05236227065324783,
0.000... | 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": "test", "annotation": null, "type_comment": null}}, {"_type": "arg... | def CheckField(self, test, msg_desc, name, index, file_desc):
field_desc = msg_desc.fields_by_name[name]
enum_desc = msg_desc.enum_types_by_name[self.type_name]
test.assertEqual(name, field_desc.name)
expected_field_full_name = '.'.join([msg_desc.full_name, name])
test.assertEqual(expected_field_ful... | |
14,179 | [
-0.0072493660263717175,
0.01460364367812872,
-0.017677541822195053,
-0.011792022734880447,
0.042237263172864914,
0.0301514882594347,
0.016649411991238594,
-0.017593612894415855,
0.013281761668622494,
0.04418861120939255,
0.011781531386077404,
-0.033047039061784744,
0.050735071301460266,
-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": "number", "annotation":... | class EnumField(object):
def __init__(self, number, type_name, default_value):
self.number = number
self.type_name = type_name
self.default_value = default_value
def CheckField(self, test, msg_desc, name, index, file_desc):
field_desc = msg_desc.fields_by_name[name]
enum_desc = msg_desc.enum_t... | |
14,180 | [
0.019204910844564438,
0.024071021005511284,
0.01113798376172781,
-0.017874842509627342,
0.005785263143479824,
-0.01683673821389675,
0.008964454755187035,
-0.020881015807390213,
-0.0022532788570970297,
0.021875865757465363,
0.0159175843000412,
0.0017423374811187387,
0.027769263833761215,
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": "test", "annotation": null, "type_comment": null}}, {"_type": "arg... | def CheckField(self, test, msg_desc, name, index, file_desc):
field_desc = msg_desc.fields_by_name[name]
field_type_desc = msg_desc.nested_types_by_name[self.type_name]
test.assertEqual(name, field_desc.name)
expected_field_full_name = '.'.join([msg_desc.full_name, name])
test.assertEqual(expected_f... | |
14,181 | [
-0.010476402938365936,
-0.013290724717080593,
-0.011603179387748241,
0.009360107593238354,
0.01521934662014246,
-0.023646589368581772,
0.009931357577443123,
-0.029327640309929848,
-0.0010278562549501657,
0.0239400751888752,
0.007646359037607908,
-0.011896666139364243,
0.02500920183956623,
... | 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": "number", "annotation":... | class MessageField(object):
def __init__(self, number, type_name):
self.number = number
self.type_name = type_name
def CheckField(self, test, msg_desc, name, index, file_desc):
field_desc = msg_desc.fields_by_name[name]
field_type_desc = msg_desc.nested_types_by_name[self.type_name]
test.asser... | |
14,182 | [
0.03629430755972862,
0.025089647620916367,
0.011116779409348965,
-0.019915731623768806,
0.006926016882061958,
-0.00475923391059041,
0.009073576889932156,
-0.012511868961155415,
0.0042566717602312565,
0.05830816552042961,
0.032691240310668945,
-0.002932984149083495,
0.03886478766798973,
-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": "test", "annotation": null, "type_comment": null}}, {"_type": "arg... | def CheckField(self, test, msg_desc, name, index, file_desc):
field_desc = msg_desc.fields_by_name[name]
test.assertEqual(name, field_desc.name)
expected_field_full_name = '.'.join([msg_desc.full_name, name])
test.assertEqual(expected_field_full_name, field_desc.full_name)
test.assertEqual(index, fi... | |
14,183 | [
-0.011155921034514904,
-0.015678884461522102,
-0.010517512448132038,
-0.01487816870212555,
0.03276443108916283,
0.010322744026780128,
0.0018070212099701166,
-0.0019585080444812775,
0.024627426639199257,
0.0464848093688488,
-0.004414758179336786,
-0.0120540214702487,
0.016739292070269585,
-... | 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": "number", "annotation":... | class StringField(object):
def __init__(self, number, default_value):
self.number = number
self.default_value = default_value
def CheckField(self, test, msg_desc, name, index, file_desc):
field_desc = msg_desc.fields_by_name[name]
test.assertEqual(name, field_desc.name)
expected_field_full_nam... | |
14,184 | [
0.02492458187043667,
0.01620766706764698,
0.01837017387151718,
-0.019975336268544197,
-0.0037035744171589613,
0.004765321500599384,
0.009552937000989914,
-0.014713974669575691,
0.004573036450892687,
0.0529257208108902,
0.030966229736804962,
0.0036617734003812075,
0.037877339869737625,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "test", "annotation": null, "type_comment": null}}, {"_type": "arg... | def CheckField(self, test, msg_desc, name, index, file_desc):
field_desc = msg_desc.extensions_by_name[name]
test.assertEqual(name, field_desc.name)
expected_field_full_name = '.'.join([msg_desc.full_name, name])
test.assertEqual(expected_field_full_name, field_desc.full_name)
test.assertEqual(self.... | |
14,185 | [
-0.006111219525337219,
0.0034811822697520256,
0.012937400490045547,
-0.016466815024614334,
-0.010338571853935719,
0.016307935118675232,
0.010826561599969864,
-0.019587678834795952,
-0.007456028368324041,
0.04146777465939522,
0.027055056765675545,
-0.02360508218407631,
0.03629281371831894,
... | 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": "number", "annotation":... | class ExtensionField(object):
def __init__(self, number, extended_type):
self.number = number
self.extended_type = extended_type
def CheckField(self, test, msg_desc, name, index, file_desc):
field_desc = msg_desc.extensions_by_name[name]
test.assertEqual(name, field_desc.name)
expected_field_f... | |
14,186 | [
0.004193737171590328,
-0.03418062627315521,
0.054242637008428574,
-0.018157698214054108,
0.03505394235253334,
-0.027776306495070457,
-0.007271570153534412,
0.026951508596539497,
0.021990586072206497,
0.008854455314576626,
0.01077089924365282,
-0.025350427255034447,
0.0030975432600826025,
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": "prefix", "annotation":... | class AddDescriptorTest(unittest.TestCase):
def _TestMessage(self, prefix):
pool = descriptor_pool.DescriptorPool()
pool.AddDescriptor(unittest_pb2.TestAllTypes.DESCRIPTOR)
self.assertEqual(
'protobuf_unittest.TestAllTypes',
pool.FindMessageTypeByName(
prefix + 'protobuf_unitt... | |
14,187 | [
0.0035241192672401667,
-0.044558506458997726,
0.04904962703585625,
-0.016894610598683357,
0.01209781039506197,
-0.009146838448941708,
-0.019939636811614037,
0.040302522480487823,
-0.0027584536001086235,
-0.01543675921857357,
-0.0031508388929069042,
0.000015499768778681755,
0.0129443053156137... | 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": "prefix", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _TestMessage(self, prefix):
pool = descriptor_pool.DescriptorPool()
pool.AddDescriptor(unittest_pb2.TestAllTypes.DESCRIPTOR)
self.assertEqual(
'protobuf_unittest.TestAllTypes',
pool.FindMessageTypeByName(
prefix + 'protobuf_unittest.TestAllTypes').full_name)
# AddDescrip... | |
14,188 | [
0.005009796470403671,
-0.02669619396328926,
0.037783633917570114,
-0.02671891450881958,
0.0390559621155262,
0.016165396198630333,
-0.015154349617660046,
0.01044559571892023,
0.007270452566444874,
0.03642042353749275,
0.0050211562775075436,
-0.016426678746938705,
0.03966940566897392,
-0.016... | 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": "prefix", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _TestEnum(self, prefix):
pool = descriptor_pool.DescriptorPool()
pool.AddEnumDescriptor(unittest_pb2.ForeignEnum.DESCRIPTOR)
self.assertEqual(
'protobuf_unittest.ForeignEnum',
pool.FindEnumTypeByName(
prefix + 'protobuf_unittest.ForeignEnum').full_name)
# AddEnumDescript... | |
14,189 | [
-0.016960108652710915,
-0.03359174728393555,
0.0539570152759552,
-0.031182950362563133,
0.02327772229909897,
-0.009553063660860062,
-0.03092017211019993,
0.04716859012842178,
0.0004297509731259197,
-0.012919901870191097,
0.024591609835624695,
-0.014704600907862186,
0.01685061864554882,
-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 testService(self):
pool = descriptor_pool.DescriptorPool()
with self.assertRaises(KeyError):
pool.FindServiceByName('protobuf_unittest.TestService')
pool.AddServiceDescriptor(unittest_pb2._TESTSERVICE)
self.assertEqual(
'protobuf_unittest.TestService',
pool.FindServiceByName('p... | |
14,190 | [
0.021207045763731003,
-0.004202788695693016,
0.034076664596796036,
-0.00495531503111124,
0.06033841520547867,
-0.04711667075753212,
0.0234901811927557,
0.05297785624861717,
0.017322305589914322,
0.0021297915372997522,
0.020116591826081276,
-0.034735482186079025,
-0.025966418907046318,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testEmptyDescriptorPool(self):
# Check that an empty DescriptorPool() contains no messages.
pool = descriptor_pool.DescriptorPool()
proto_file_name = descriptor_pb2.DESCRIPTOR.name
self.assertRaises(KeyError, pool.FindFileByName, proto_file_name)
# Add the above file to the pool
file_descrip... | |
14,191 | [
0.007113500963896513,
-0.00951814278960228,
0.05347121134400368,
-0.017429472878575325,
0.022205282002687454,
-0.04360715672373772,
-0.01691618375480175,
0.02878875657916069,
-0.005682432092726231,
-0.025954514741897583,
0.032716523855924606,
-0.003216418204829097,
0.013100000098347664,
-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 testFile(self):
pool = descriptor_pool.DescriptorPool()
pool.AddFileDescriptor(unittest_pb2.DESCRIPTOR)
self.assertEqual(
'google/protobuf/unittest.proto',
pool.FindFileByName(
'google/protobuf/unittest.proto').name)
# AddFileDescriptor is not recursive; messages and enu... | |
14,192 | [
0.012784561142325401,
-0.023825278505682945,
0.07101807743310928,
-0.01727496087551117,
0.023040547966957092,
-0.056326184421777725,
0.007754659280180931,
0.036206576973199844,
0.018844421952962875,
-0.0025939689949154854,
0.03910571709275246,
-0.017133275046944618,
-0.0019972471054643393,
... | 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 testFileDescriptorOptionsWithCustomDescriptorPool(self):
# Create a descriptor pool, and add a new FileDescriptorProto to it.
pool = descriptor_pool.DescriptorPool()
file_name = 'file_descriptor_options_with_custom_descriptor_pool.proto'
file_descriptor_proto = descriptor_pb2.FileDescriptorProto(nam... | |
14,193 | [
0.013554448261857033,
-0.02353370003402233,
0.05469930171966553,
-0.012314565479755402,
0.03185174986720085,
-0.04754890874028206,
0.016371268779039383,
0.04439502954483032,
0.010966342873871326,
0.015745310112833977,
0.027518177404999733,
-0.032886993139982224,
0.002234497806057334,
-0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testCustomDescriptorPool(self):
# Create a new pool, and add a file descriptor.
pool = descriptor_pool.DescriptorPool()
file_desc = descriptor_pb2.FileDescriptorProto(
name='some/file.proto', package='package')
file_desc.message_type.add(name='Message')
pool.Add(file_desc)
self.asser... | |
14,194 | [
-0.0029999546241015196,
0.017306780442595482,
-0.02114897593855858,
-0.017250442877411842,
-0.030354470014572144,
0.03382483869791031,
-0.006833699531853199,
-0.003932334948331118,
0.022377125918865204,
-0.02173488214612007,
0.036731839179992676,
-0.004290075972676277,
-0.028146052733063698,... | 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": "event", "annotation": {"_type": "Attribute", "_fields": {"ctx": {... | def description_changed(self, event: monitoring.TopologyDescriptionChangedEvent) -> None:
logging.info(f"Topology description updated for topology id {event.topology_id}")
previous_topology_type = event.previous_description.topology_type
new_topology_type = event.new_description.topology_type
... | |
14,195 | [
-0.0123982485383749,
-0.019068721681833267,
0.02565566450357437,
-0.022278662770986557,
0.0297605711966753,
-0.05694364383816719,
-0.005146048963069916,
0.05417521670460701,
0.020775122568011284,
-0.0047999960370361805,
0.006127527449280024,
-0.036347512155771255,
-0.010053440928459167,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testAddTypeError(self):
pool = descriptor_pool.DescriptorPool()
with self.assertRaises(TypeError):
pool.AddDescriptor(0)
with self.assertRaises(TypeError):
pool.AddEnumDescriptor(0)
with self.assertRaises(TypeError):
pool.AddServiceDescriptor(0)
with self.assertRaises(TypeError... | |
14,196 | [
-0.034508660435676575,
0.043237801641225815,
0.0209866501390934,
0.01892673596739769,
-0.014001297764480114,
-0.010809450410306454,
0.014602956362068653,
-0.06032897159457207,
-0.022842613980174065,
0.006541757378727198,
0.013287466019392014,
-0.016775043681263924,
0.012573635205626488,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "an... | class AppWindow(Gtk.ApplicationWindow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# This will be in the windows group and have the "win" prefix
max_action = Gio.SimpleAction.new_stateful("maximize", None,
GLib.Variant.... | |
14,197 | [
-0.020024975761771202,
0.0525655597448349,
0.019410783424973488,
0.04454629868268967,
-0.029852045699954033,
-0.014532012864947319,
0.014149591326713562,
-0.03685151785612106,
-0.028276005759835243,
0.019491903483867645,
0.026792675256729126,
0.018495289608836174,
-0.00877830944955349,
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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# This will be in the windows group and have the "win" prefix
max_action = Gio.SimpleAction.new_stateful("maximize", None,
GLib.Variant.new_boolean(False))
max_action.connec... | |
14,198 | [
-0.009131698869168758,
0.02394605427980423,
0.031856995075941086,
-0.01922294683754444,
0.012644710950553417,
-0.013582935556769371,
-0.0018937747227028012,
-0.007644399534910917,
-0.004048759583383799,
0.04279584437608719,
-0.011983688920736313,
-0.04639947786927223,
0.02356223575770855,
... | 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": {"_type": "arg", "_fields": {"arg": "kwargs", "an... | class Application(Gtk.Application):
def __init__(self, *args, **kwargs):
super().__init__(*args, application_id="org.example.myapp",
flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE,
**kwargs)
self.window = None
self.add_main_option("test", ... | |
14,199 | [
-0.005520456004887819,
0.010155707597732544,
0.05502215400338173,
0.005045664496719837,
0.007167472504079342,
-0.04137391597032547,
0.03811207041144371,
-0.014313485473394394,
-0.0007021279889158905,
0.06596650183200836,
-0.015622515231370926,
-0.01825130358338356,
0.02824070118367672,
-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": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
super().__init__(*args, application_id="org.example.myapp",
flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE,
**kwargs)
self.window = None
self.add_main_option("test", ord("t"), GLib.OptionFlags.NONE,
... | |
14,200 | [
-0.018360944464802742,
0.0526927150785923,
0.015221850015223026,
0.011895512230694294,
-0.01421954296529293,
-0.01739167980849743,
0.029650665819644928,
0.030597900971770287,
0.014461859129369259,
0.01599285565316677,
-0.01586068421602249,
-0.02035454288125038,
0.015926769003272057,
-0.060... | 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 do_startup(self):
Gtk.Application.do_startup(self)
action = Gio.SimpleAction.new("about", None)
action.connect("activate", self.on_about)
self.add_action(action)
action = Gio.SimpleAction.new("quit", None)
action.connect("activate", self.on_quit)
self.add_ac... |