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 |
|---|---|---|---|---|---|
17,401 | [
0.017189474776387215,
0.06870988756418228,
0.019962359219789505,
-0.020598560571670532,
0.07692050188779831,
-0.012580007314682007,
-0.04165326803922653,
0.002016642363741994,
-0.0004133816692046821,
-0.0031780123244971037,
0.04018880054354668,
0.009747104719281197,
0.019662262871861458,
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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def readTest(self, name, val, idx, acInfo):
(acFun, acCtx) = acInfo
if name == self.name:
if acFun:
if self.maxAccess not in ('readonly',
'readwrite', 'readcreate') or \
acFun(name, self.syntax, idx, 'read', ac... | |
17,402 | [
0.021429484710097313,
0.05501074716448784,
-0.002224884694442153,
-0.05130470544099808,
0.026749039068818092,
0.020786600187420845,
-0.024933835491538048,
0.017761260271072388,
0.0053983391262590885,
0.0034885939676314592,
0.04865753650665283,
-0.0077272201888263226,
-0.007645283825695515,
... | 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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def readTestNext(self, name, val, idx, acInfo, oName=None):
if oName is None:
oName = name
topOfTheMib = True
else:
topOfTheMib = False
nextName = name
direction = self.depthFirst
while 1: # XXX linear search here
if direction == s... | |
17,403 | [
0.04386800900101662,
0.07298041880130768,
-0.0023632021620869637,
-0.042372509837150574,
0.004115741699934006,
0.019005317240953445,
-0.024077555164694786,
0.02499978058040142,
-0.0060193887911736965,
-0.0014082628767937422,
0.04095178470015526,
-0.017983391880989075,
-0.0195661298930645,
... | 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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def readGetNext(self, name, val, idx, acInfo, oName=None):
if oName is None:
oName = name
topOfTheMib = True
else:
topOfTheMib = False
nextName = name
direction = self.depthFirst
while True: # XXX linear search ahead!
if direction ... | |
17,404 | [
0.02071952074766159,
0.06168351322412491,
0.019075114279985428,
-0.02596944011747837,
0.06343754380941391,
-0.01897766813635826,
-0.04087872430682182,
0.000999585958197713,
-0.0004544956609606743,
0.00039625627687200904,
0.03673725947737694,
-0.002227561781182885,
0.019172560423612595,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def readTest(self, name, val, idx, acInfo):
(acFun, acCtx) = acInfo
if name == self.name:
raise error.NoAccessError(idx=idx, name=name)
if acFun:
if self.maxAccess not in ('readonly', 'readwrite',
'readcreate') or \
... | |
17,405 | [
0.02855735272169113,
0.02793130651116371,
0.03987434506416321,
-0.05393631383776665,
0.046471912413835526,
-0.028003541752696037,
-0.011028050445020199,
-0.013568353839218616,
0.0027720616199076176,
0.011329034343361855,
0.05716286227107048,
0.03190429136157036,
0.015181628055870533,
0.034... | 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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def writeTest(self, name, val, idx, acInfo):
acFun, acCtx = acInfo
if name == self.name:
# Make sure variable is writable
if acFun:
if self.maxAccess not in ('readwrite', 'readcreate') or \
acFun(name, self.syntax, idx, 'write', acCtx):
... | |
17,406 | [
0.03868922218680382,
0.06352973729372025,
0.01445398386567831,
-0.029174288734793663,
0.05064947158098221,
0.0009192624711431563,
-0.020845694467425346,
0.005786435678601265,
0.007414627354592085,
-0.021729396656155586,
0.05389374867081642,
-0.001084200106561184,
-0.0033532273955643177,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def readTestNext(self, name, val, idx, acInfo, oName=None):
(acFun, acCtx) = acInfo
if acFun:
if self.maxAccess not in ('readonly', 'readwrite',
'readcreate') or \
acFun(name, self.syntax, idx, 'read', acCtx):
raise er... | |
17,407 | [
0.049036990851163864,
0.06524962931871414,
0.014940568245947361,
-0.016125338152050972,
0.032674700021743774,
0.013743326999247074,
-0.008885771967470646,
0.01677384227514267,
-0.00045091393985785544,
-0.034171249717473984,
0.05183055251836777,
-0.017434820532798767,
-0.02998090721666813,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def readGetNext(self, name, val, idx, acInfo, oName=None):
(acFun, acCtx) = acInfo
# have to duplicate AC here as *Next code above treats
# noAccess as a noSuchObject at the Test stage, goes on
# to Reading
if acFun:
if self.maxAccess not in ('readonly', 'readwrite',
... | |
17,408 | [
0.020551975816488266,
-0.0005058146780356765,
-0.059100814163684845,
0.007831969298422337,
0.008865121752023697,
-0.045147690922021866,
0.012320076115429401,
0.0023856954649090767,
0.018963363021612167,
-0.03299425169825554,
0.03214995563030243,
0.018474558368325233,
-0.0009560834150761366,
... | 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": "value", "annotation": null, "type_comment": null}}, {"_type": "ar... | def setValue(self, value, name, idx):
if value is None:
value = univ.noValue
try:
if hasattr(self.syntax, 'setValue'):
return self.syntax.setValue(value)
else:
return self.syntax.clone(value)
except PyAsn1Error:
exc_... | |
17,409 | [
0.0457136370241642,
0.033139389008283615,
0.04621756821870804,
-0.04451380670070648,
0.046697501093149185,
-0.0403863787651062,
-0.015705814585089684,
-0.0032965412829071283,
0.004496374167501926,
-0.006419106852263212,
0.05096890777349472,
0.020217185840010643,
0.013426131568849087,
0.049... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def writeTest(self, name, val, idx, acInfo):
acFun, acCtx = acInfo
if name == self.name:
raise error.NoAccessError(idx=idx, name=name)
if acFun:
if self.maxAccess not in ('readwrite', 'readcreate') or \
acFun(name, self.syntax, idx, 'write', acCtx):
... | |
17,410 | [
0.05226971581578255,
0.0004118474025744945,
-0.007942217402160168,
-0.05579407513141632,
0.04107615351676941,
-0.025663290172815323,
-0.03452382609248161,
-0.017646614462137222,
0.012955741956830025,
-0.004517136141657829,
0.0630909875035286,
0.01638082228600979,
0.01880071684718132,
0.041... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def writeTest(self, name, val, idx, acInfo):
# Make sure write's allowed
if name == self.name:
try:
self.__newSyntax = self.setValue(val, name, idx)
except error.MibOperationError:
# SMI exceptions may carry additional content
why =... | |
17,411 | [
0.00840606726706028,
0.0022884197533130646,
-0.014490285888314247,
-0.049743495881557465,
0.007597675081342459,
-0.027448879554867744,
-0.016532540321350098,
-0.014648317359387875,
0.01921907812356949,
0.0007711640209890902,
0.04050472378730774,
-0.01293428149074316,
0.0463397391140461,
0.... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def createTest(self, name, val, idx, acInfo):
if name == self.name:
try:
self.__newSyntax = self.setValue(val, name, idx)
except error.MibOperationError:
# SMI exceptions may carry additional content
why = sys.exc_info()[1]
... | |
17,412 | [
0.0290128942579031,
0.005013973452150822,
0.04909312725067139,
-0.048411618918180466,
0.028842516243457794,
-0.04502840340137482,
-0.0015866426983848214,
-0.01726900041103363,
0.00043278987868689,
0.006979402154684067,
0.046975575387477875,
0.017439378425478935,
0.06751826405525208,
0.0218... | 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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def createTest(self, name, val, idx, acInfo):
(acFun, acCtx) = acInfo
# Make sure creation allowed, create a new column instance but
# do not replace the old one
if name == self.name:
raise error.NoAccessError(idx=idx, name=name)
if acFun:
if val is not No... | |
17,413 | [
0.009013946168124676,
0.0156429260969162,
-0.020094862207770348,
-0.04439704492688179,
-0.005803415551781654,
-0.014468790031969547,
-0.02424103207886219,
-0.005855395458638668,
0.01413856353610754,
0.002770229009911418,
0.04725900664925575,
-0.008365724235773087,
0.03620254993438721,
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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def destroyTest(self, name, val, idx, acInfo):
if name == self.name:
try:
self.__newSyntax = self.setValue(val, name, idx)
except error.MibOperationError:
# SMI exceptions may carry additional content
why = sys.exc_info()[1]
... | |
17,414 | [
0.028122343122959137,
0.02176050655543804,
0.01730605773627758,
-0.019946161657571793,
0.005666919983923435,
-0.010961666703224182,
0.04391644895076752,
-0.0015628370456397533,
0.008048247545957565,
-0.02688951976597309,
0.07020118832588196,
0.019027359783649445,
0.005073768552392721,
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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def createCommit(self, name, val, idx, acInfo):
# Commit new instance value
if name in self._vars: # XXX
if name in self.__createdInstances:
self._vars[name].createCommit(name, val, idx, acInfo)
return
self.__createdInstances[name].createCommit(name, val,... | |
17,415 | [
0.04475177824497223,
0.05192727595567703,
0.020702451467514038,
-0.06343849748373032,
-0.008322816342115402,
0.005115394480526447,
0.028397729620337486,
-0.009406747296452522,
-0.007834730669856071,
0.01831907033920288,
0.05486847087740898,
-0.0027209208346903324,
-0.0011037398362532258,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def createCleanup(self, name, val, idx, acInfo):
# Drop previous column instance
self.branchVersionId += 1
if name in self.__createdInstances:
if self.__createdInstances[name] is not None:
self.__createdInstances[name].createCleanup(name, val, idx,
... | |
17,416 | [
0.03809593617916107,
0.049814172089099884,
0.03627517446875572,
-0.01993500627577305,
-0.003358488203957677,
-0.018265973776578903,
-0.03907634690403938,
0.00007454289880115539,
0.01041102223098278,
-0.0006441235891543329,
0.06764829903841019,
0.012126739136874676,
0.03475787490606308,
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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def destroyTest(self, name, val, idx, acInfo):
(acFun, acCtx) = acInfo
# Make sure destruction is allowed
if name == self.name:
raise error.NoAccessError(idx=idx, name=name)
if name not in self._vars:
return
if acFun:
if val is not None and sel... | |
17,417 | [
0.03218016028404236,
0.01888512820005417,
0.012713760137557983,
-0.03153705224394798,
-0.025922220200300217,
-0.022372756153345108,
0.02300349622964859,
0.017982302233576775,
-0.017623646184802055,
-0.022224346175789833,
0.022632472217082977,
-0.021210212260484695,
0.0106483930721879,
0.00... | 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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def createUndo(self, name, val, idx, acInfo):
# Set back previous column instance, drop the new one
if name in self.__createdInstances:
self._vars[name] = self.__createdInstances[name]
del self.__createdInstances[name]
# Remove new instance on rollback
if ... | |
17,418 | [
0.0452757254242897,
0.041479602456092834,
0.017962148413062096,
-0.06416375935077667,
-0.01822834089398384,
0.03226705640554428,
-0.0002674575080163777,
0.024235013872385025,
0.008223007433116436,
0.014061862602829933,
0.07203377038240433,
-0.019455136731266975,
-0.008454478345811367,
-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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def destroyCleanup(self, name, val, idx, acInfo):
# Drop instance copy
self.branchVersionId += 1
if name in self.__destroyedInstances:
self.__destroyedInstances[name].destroyCleanup(name, val,
idx, acInfo)
debug.l... | |
17,419 | [
0.024887938052415848,
0.024248475208878517,
0.021460412070155144,
-0.041718631982803345,
0.03031059354543686,
-0.04437880218029022,
-0.018774662166833878,
-0.0315127857029438,
0.006663214880973101,
0.018493298441171646,
0.02675517462193966,
0.022138243541121483,
0.04082338139414787,
0.0474... | 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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def writeTest(self, name, val, idx, acInfo):
# Besides common checks, request row creation on no-instance
try:
# First try the instance
MibScalar.writeTest(self, name, val, idx, acInfo)
# ...otherwise proceed with creating new column
except (error.NoSuchInstanceEr... | |
17,420 | [
0.06506052613258362,
0.0527668222784996,
-0.019907712936401367,
-0.024359755218029022,
0.007101766299456358,
-0.03232789784669876,
-0.0013082617660984397,
-0.014089702628552914,
-0.015645386651158333,
-0.02475183829665184,
0.017264312133193016,
0.007354723289608955,
-0.00015256466576829553,
... | 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": "subAction", "annotation": null, "type_comment": null}}, {"_type":... | def __delegateWrite(self, subAction, name, val, idx, acInfo):
if name not in self.__rowOpWanted:
getattr(MibScalar, 'write' + subAction)(self, name, val, idx, acInfo)
return
if isinstance(self.__rowOpWanted[name], error.RowCreationWanted):
getattr(self, 'create' + sub... | |
17,421 | [
0.038766369223594666,
0.0447724275290966,
0.02841957099735737,
-0.05913236364722252,
0.001979268854483962,
0.03439832851290703,
-0.012728746049106121,
0.007534871809184551,
-0.016311906278133392,
0.004893571604043245,
0.06109798327088356,
0.023450924083590508,
-0.019355883821845055,
0.0306... | 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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def writeCleanup(self, name, val, idx, acInfo):
self.branchVersionId += 1
self.__delegateWrite('Cleanup', name, val, idx, acInfo)
if name in self.__rowOpWanted:
e = self.__rowOpWanted[name]
del self.__rowOpWanted[name]
debug.logger & debug.flagIns and debug.lo... | |
17,422 | [
0.011810405179858208,
0.05923372134566307,
-0.0017796722240746021,
-0.013977808877825737,
-0.01004533376544714,
-0.016664352267980576,
-0.03044748306274414,
0.02896793745458126,
-0.01757284440100193,
-0.02930537797510624,
0.038831572979688644,
0.02071363292634487,
0.0004935873439535499,
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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def writeUndo(self, name, val, idx, acInfo):
if name in self.__rowOpWanted:
self.__rowOpWanted[name] = error.RowDestructionWanted()
self.__delegateWrite('Undo', name, val, idx, acInfo)
if name in self.__rowOpWanted:
e = self.__rowOpWanted[name]
del self.__rowO... | |
17,423 | [
0.035894498229026794,
0.0007041640346869826,
-0.07566317170858383,
-0.011826747097074986,
-0.021331319585442543,
0.007503303699195385,
-0.0033753197640180588,
-0.0570857860147953,
0.027772726491093636,
-0.016698643565177917,
0.028286170214414597,
0.004084224347025156,
0.05358502268791199,
... | 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": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def setFromName(self, obj, value, impliedFlag=None, parentIndices=None):
if not value:
raise error.SmiError('Short OID for index %r' % (obj,))
if hasattr(obj, 'cloneFromName'):
return obj.cloneFromName(value, impliedFlag, parentRow=self, parentIndices=parentIndices)
baseT... | |
17,424 | [
0.0065588634461164474,
0.007645119447261095,
-0.041017986834049225,
0.030037350952625275,
-0.04342664033174515,
0.011588702909648418,
-0.04132496938109398,
-0.05332101881504059,
0.016447339206933975,
-0.027699537575244904,
-0.027038337662816048,
-0.013401097618043423,
0.039931729435920715,
... | 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": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def getAsName(self, obj, impliedFlag=None, parentIndices=None):
if hasattr(obj, 'cloneAsName'):
return obj.cloneAsName(impliedFlag, parentRow=self, parentIndices=parentIndices)
baseTag = obj.getTagSet().getBaseTag()
if baseTag == self.__intBaseTag:
# noinspection PyRedund... | |
17,425 | [
0.030240938067436218,
0.02687343955039978,
0.002683683531358838,
-0.022733943536877632,
-0.042220182716846466,
0.03636366128921509,
-0.03133238106966019,
-0.05824574828147888,
0.03074672818183899,
-0.017503008246421814,
0.04344472661614418,
-0.05041930824518204,
0.012351932004094124,
-0.02... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "action", "annotation": null, "type_comment": null}}, {"_type": "a... | def announceManagementEvent(self, action, name, val, idx, acInfo):
# Convert OID suffix into index vals
instId = name[len(self.name) + 1:]
baseIndices = []
indices = []
for impliedFlag, modName, symName in self.indexNames:
mibObj, = mibBuilder.importSymbols(modName, s... | |
17,426 | [
0.0015429994091391563,
0.03682861477136612,
0.03488118574023247,
-0.018340354785323143,
-0.015123398043215275,
0.027337975800037384,
-0.023504743352532387,
-0.032021667808294296,
0.013718289323151112,
-0.01307736337184906,
0.01672571338713169,
-0.026869606226682663,
0.03140539303421974,
-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": "action", "annotation": null, "type_comment": null}}, {"_type": "a... | def receiveManagementEvent(self, action, baseIndices, val, idx, acInfo):
# The default implementation supports one-to-one rows dependency
newSuffix = ()
# Resolve indices intersection
for impliedFlag, modName, symName in self.indexNames:
mibObj, = mibBuilder.importSymbols(mod... | |
17,427 | [
0.043284088373184204,
0.037955209612846375,
0.020048605278134346,
-0.0050676604732871056,
-0.021485313773155212,
0.015842968598008156,
-0.012675682082772255,
-0.034350380301475525,
0.012042224407196045,
0.009802266024053097,
-0.048403993248939514,
-0.038869477808475494,
0.03160757198929787,
... | 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": {"_type": "arg", "_fields": {"arg": "names", "annotation": null, "type_comme... | def registerAugmentions(self, *names):
for modName, symName in names:
if (modName, symName) in self.augmentingRows:
raise error.SmiError(
'Row %s already augmented by %s::%s' % (self.name, modName, symName)
)
self.augmentingRows[(modNam... | |
17,428 | [
0.023736800998449326,
0.030381228774785995,
0.010236642323434353,
-0.049070145934820175,
-0.02203460782766342,
-0.007536610588431358,
-0.02364288829267025,
-0.05864938721060753,
-0.0033985183108597994,
0.00540299853309989,
0.03418475016951561,
-0.00597528787329793,
0.05508064851164818,
-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": "action", "annotation": null, "type_comment": null}}, {"_type": "a... | def __manageColumns(self, action, excludeName, nameSuffix,
val, idx, acInfo):
# Build a map of index names and values for automatic initialization
indexVals = {}
instId = nameSuffix
indices = []
for impliedFlag, modName, symName in self.indexNames:
... | |
17,429 | [
0.046079281717538834,
0.03251916542649269,
-0.03455318510532379,
-0.017703484743833542,
0.012743998318910599,
0.027948906645178795,
-0.006020440254360437,
-0.033046506345272064,
-0.0038388939574360847,
-0.028451131656765938,
-0.008092124946415424,
-0.004435287788510323,
0.021168848499655724,... | 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": "subAction", "annotation": null, "type_comment": null}}, {"_type":... | def __delegate(self, subAction, name, val, idx, acInfo):
# Relay operation request to column, expect row operation request.
rowIsActive = False
try:
getattr(self.getBranch(name, idx), 'write' + subAction)(
name, val, idx, acInfo
)
except error.Row... | |
17,430 | [
0.08287615329027176,
0.047012586146593094,
0.04874260351061821,
-0.02494797483086586,
0.018577110022306442,
0.06535627692937851,
0.013483165763318539,
0.0059349266812205315,
-0.017053045332431793,
-0.015913430601358414,
0.06607025861740112,
-0.0350397527217865,
-0.0188242569565773,
0.01087... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def upgrade():
c = op.get_bind()
a = sa.sql.table(
'attributes',
sa.sql.column('serial', sa.Integer),
sa.sql.column('domain', sa.String),
sa.sql.column('key', sa.String),
sa.sql.column('value', sa.String),
sa.sql.column('node', sa.Integer),
sa.sql.column('... | |
17,431 | [
0.052172910422086716,
0.02931317687034607,
0.020348798483610153,
-0.0667613297700882,
-0.04410610720515251,
-0.0025535414461046457,
0.0356530025601387,
0.015599609352648258,
-0.046628404408693314,
0.018144629895687103,
0.002231153193861246,
0.008884847164154053,
-0.03406236693263054,
-0.04... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def main():
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
create_dir_if_necessary(LOCALE_DIR)
source_msgs_dir = CONFIGURATION.source_messages_dir
remove_file(source_msgs_dir.joinpath('django.po'))
# Extract strings from mako templates.
babel_mako_cmd = 'pybabel extract -F %s -c "Tr... | |
17,432 | [
0.026408104225993156,
0.03729018568992615,
0.07240857183933258,
0.00953048374503851,
0.01713176630437374,
-0.002847593044862151,
-0.00869873259216547,
-0.0009609904373064637,
-0.02931923419237137,
0.030382027849555016,
-0.030058568343520164,
0.01710866205394268,
-0.003913274500519037,
0.02... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "initial", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"... | class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Choice',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('... | |
17,433 | [
0.06806068867444992,
0.039365727454423904,
0.032896921038627625,
-0.03729239106178284,
0.0339474119246006,
0.049290094524621964,
0.0117005230858922,
0.0034089088439941406,
-0.003011519555002451,
-0.0075123850256204605,
0.04857133701443672,
-0.05755579099059105,
-0.0004669323971029371,
0.03... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def downgrade():
c = op.get_bind()
a = sa.sql.table(
'attributes',
sa.sql.column('serial', sa.Integer),
sa.sql.column('domain', sa.String),
sa.sql.column('key', sa.String),
sa.sql.column('value', sa.String),
sa.sql.column('node', sa.Integer),
sa.sql.column... | |
17,434 | [
0.005610129330307245,
-0.019121235236525536,
-0.0003334585053380579,
0.007171823643147945,
-0.005762489512562752,
-0.02333291433751583,
-0.0030825783032923937,
0.005871318280696869,
-0.0021466498728841543,
0.03408520668745041,
-0.026924267411231995,
0.02905731275677681,
0.0036403262056410313... | 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 __init__(self):
GObject.GObject.__init__(self)
self._bus = dbus.SystemBus()
self._device = None
self._idle_source = 0
self._listening_called = 0
self._device_state = network.NM_DEVICE_STATE_UNKNOWN
self._current_channel = None
self._networks = {self.... | |
17,435 | [
0.04499328136444092,
-0.018662985414266586,
-0.01648801751434803,
-0.025089027360081673,
-0.030823035165667534,
-0.002172222128137946,
-0.0016477032331749797,
0.028999576345086098,
-0.007694773841649294,
0.006458996795117855,
-0.018619045615196228,
0.03130635991692543,
-0.011610815301537514,... | 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": "device", "annotation": null, "type_comment": null}}], "kwarg": nu... | def start_listening(self, device):
self._listening_called += 1
if self._listening_called > 1:
raise RuntimeError('The start listening method can' \
' only be called once.')
self._device = device
props = dbus.Interface(device, dbus.PROPERTIE... | |
17,436 | [
0.03170730918645859,
-0.008151384070515633,
0.025037996470928192,
-0.0034665835555642843,
-0.01837990991771221,
0.0056251282803714275,
-0.0022469637915492058,
-0.011845330707728863,
0.022287186235189438,
0.04850410297513008,
0.020995987579226494,
-0.005431449040770531,
0.003045541001483798,
... | 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": "properties", "annotation": null, "type_comment": null}}], "kwarg"... | def __get_all_ap_props_reply_cb(self, properties):
if properties['Mode'] == network.NM_802_11_MODE_ADHOC and \
'Frequency' in properties:
frequency = properties['Frequency']
self._current_channel = network.frequency_to_channel(frequency)
else:
self._cu... | |
17,437 | [
0.030426761135458946,
-0.005700801033526659,
-0.002704226179048419,
0.0011082548880949616,
-0.05109357088804245,
-0.01004105620086193,
-0.008298208005726337,
-0.011469068005681038,
0.0289425291121006,
0.011795149184763432,
0.008292585611343384,
0.0014996930258348584,
-0.010018567554652691,
... | 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": "properties", "annotation": null, "type_comment": null}}], "kwarg"... | def __wireless_properties_changed_cb(self, properties):
if 'ActiveAccessPoint' in properties and \
properties['ActiveAccessPoint'] != '/':
active_ap = self._bus.get_object(network.NM_SERVICE,
properties['ActiveAccessPoint'])
pr... | |
17,438 | [
0.027470100671052933,
-0.0008408496505580842,
0.015074781142175198,
-0.0002631613169796765,
-0.014590676873922348,
0.024970771744847298,
-0.01548007782548666,
0.039223700761795044,
0.020107213407754898,
-0.009580761194229126,
0.005240709986537695,
-0.015851600095629692,
0.015603918582201004,... | 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": "active_connections_o", "annotation": null, "type_comment": null}}... | def __get_active_connections_reply_cb(self, active_connections_o):
for connection_o in active_connections_o:
obj = self._bus.get_object(network.NM_IFACE, connection_o)
props = dbus.Interface(obj, dbus.PROPERTIES_IFACE)
state = props.Get(network.NM_ACTIVE_CONN_IFACE, 'State')
... | |
17,439 | [
0.01949731819331646,
-0.09063265472650528,
0.014457342214882374,
-0.0201273150742054,
-0.006191348657011986,
-0.016608022153377533,
0.027828482910990715,
0.00500738900154829,
-0.011611494235694408,
0.01467458251863718,
-0.017607327550649643,
0.025851596146821976,
0.014185791835188866,
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}}, {"_type": "arg", "_fields": {"arg": "channel", "annotation": null, "type_comment": null}}], "kwarg": n... | def _add_connection(self, channel):
ssid = 'Ad-hoc Network %d' % (channel,)
settings = Settings()
settings.connection.id = self._get_connection_id(channel)
settings.connection.uuid = str(uuid.uuid4())
settings.connection.type = '802-11-wireless'
settings.connection.autoco... | |
17,440 | [
0.0552237443625927,
-0.03448581323027611,
0.047188665717840195,
-0.039943162351846695,
0.001741707674227655,
0.007088750135153532,
-0.029678698629140854,
-0.053087249398231506,
0.0002969974302686751,
0.03773700073361397,
-0.00696683069691062,
-0.021655231714248657,
0.007170029915869236,
-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 __repr__(self):
r = "(%d, %d, '%s'" % (self.load_balancer_port, self.instance_port, self.protocol)
if self.instance_protocol:
r += ", '%s'" % self.instance_protocol
if self.ssl_certificate_id:
r += ', %s' % (self.ssl_certificate_id)
r += ')'
return r | |
17,441 | [
0.06827814131975174,
-0.022324319928884506,
-0.020576508715748787,
-0.03525131568312645,
0.03323111683130264,
-0.023652203381061554,
-0.042015571147203445,
-0.04144810140132904,
0.01655881106853485,
-0.020213326439261436,
0.0282827690243721,
0.0012477274285629392,
0.006520244758576155,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def endElement(self, name, value, connection):
if name == 'LoadBalancerPort':
self.load_balancer_port = int(value)
elif name == 'InstancePort':
self.instance_port = int(value)
elif name == 'InstanceProtocol':
self.instance_protocol = value
elif name ==... | |
17,442 | [
0.033583641052246094,
-0.041820310056209564,
0.001592422486282885,
-0.032507386058568954,
0.0295641478151083,
-0.02468804083764553,
-0.055745769292116165,
-0.019185945391654968,
0.0013302218867465854,
-0.01494680717587471,
0.021206675097346306,
-0.000519939698278904,
0.012948042713105679,
... | 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": "key", "annotation": null, "type_comment": null}}], "kwarg": null,... | def __getitem__(self, key):
if key == 0:
return self.load_balancer_port
if key == 1:
return self.instance_port
if key == 2:
return self.protocol
if key == 3:
return self.instance_protocol
if key == 4:
return self.ssl_cer... | |
17,443 | [
0.0014031758764758706,
0.007838970981538296,
0.0047432901337742805,
-0.051993757486343384,
0.025974074378609657,
-0.02123078517615795,
0.0007518286001868546,
0.01758209988474846,
0.007485504727810621,
-0.0011195476399734616,
0.018003979697823524,
-0.028072068467736244,
0.010279028676450253,
... | 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 FormRouterTestCase(TestCase):
def setUp(self):
self.form_classes = {}
self.forms = {}
for name in ('form1', 'form2', 'form3'):
FormClass = mock.Mock()
form = FormClass.return_value = mock.Mock()
self.form_classes[name] = FormClass
self.fo... | |
17,444 | [
0.018192261457443237,
-0.001771080307662487,
0.03842499107122421,
-0.025012927129864693,
-0.018077628687024117,
-0.028749965131282806,
0.04133667051792145,
0.005880674347281456,
-0.02771826647222042,
-0.02432512864470482,
0.021482231095433235,
-0.035559166222810745,
0.009978805668652058,
-... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
self.form_classes = {}
self.forms = {}
for name in ('form1', 'form2', 'form3'):
FormClass = mock.Mock()
form = FormClass.return_value = mock.Mock()
self.form_classes[name] = FormClass
self.forms[name] = form | |
17,445 | [
0.056739144027233124,
0.058719418942928314,
-0.022009018808603287,
-0.014690617099404335,
0.04130592569708824,
-0.038098741322755814,
0.033427879214286804,
0.02871396765112877,
-0.023225165903568268,
0.02578660659492016,
0.015583892352879047,
0.0047381273470819,
0.015820663422346115,
-0.02... | 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": "form_router", "annotation": null, "type_comment": null}}, {"_type... | def check_form_created_with_with_data(self, form_router, name, request,
*args, **kwargs):
form = form_router[name]
kwargs.update({
'auto_id': '{}_id-%s'.format(name),
'data': request.POST,
'files': request.FILES,
})
... | |
17,446 | [
0.013128325343132019,
0.012727022171020508,
0.03134745731949806,
-0.05352228879928589,
0.002561169909313321,
-0.06081452965736389,
0.01241744589060545,
0.01921665668487549,
0.017118418589234352,
-0.004314002115279436,
0.03141625225543976,
-0.021544212475419044,
-0.003482732456177473,
-0.02... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_build_without_data(self):
# test building the forms for a GET request when we aren't passing
# data to any form
request = mock.Mock(method='GET')
form_router = self.make_form_router(request, 'foo', bar='baz')
self.check_form_created_with_no_data(
form_router,... | |
17,447 | [
0.011720817536115646,
0.003252999857068062,
0.016818761825561523,
-0.026335664093494415,
0.01931207813322544,
-0.05761343985795975,
0.009394463151693344,
0.02064778469502926,
0.00904940627515316,
-0.0009683866519480944,
0.03410501778125763,
0.0004330608353484422,
-0.021126411855220795,
-0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_build_with_data(self):
# test building the forms for a POST request when we want to pass data
# to 1 form
request = mock.Mock(method='POST', POST={
'form': 'form1',
'name': 'value',
})
form_router = self.make_form_router(request, 'foo', bar='baz')... | |
17,448 | [
0.01129304338246584,
0.025781545788049698,
0.035222675651311874,
-0.028686508536338806,
0.008848032914102077,
-0.04737510159611702,
0.009973705746233463,
0.014306942000985146,
0.008539380505681038,
-0.013931717723608017,
0.026628825813531876,
-0.0410810150206089,
0.012255311943590641,
-0.0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_contains(self):
# forms shouldn't be built until they're accessed
request = mock.Mock(method='GET')
form_router = self.make_form_router(request)
assert_true('form1' in form_router)
assert_true('form2' in form_router)
assert_true('form3' in form_router)
as... | |
17,449 | [
0.03237079083919525,
0.01532746758311987,
0.027889076620340347,
-0.029758591204881668,
0.026787854731082916,
-0.005893455818295479,
-0.0014541567070409656,
-0.0043184529058635235,
0.0022168485447764397,
-0.024354923516511917,
0.020103694871068,
-0.03093664161860943,
0.01982198841869831,
-0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_lazy_building(self):
# forms shouldn't be built until they're accessed
request = mock.Mock(method='GET')
form_router = self.make_form_router(request)
FormClass = self.form_classes['form1']
assert_equal(FormClass.call_count, 0)
form_router['form1']
assert_... | |
17,450 | [
0.021744608879089355,
-0.07040137052536011,
0.05136844143271446,
-0.00038932444294914603,
-0.045663680881261826,
-0.0012726992135867476,
0.005356208886951208,
-0.0639035701751709,
-0.0424659438431263,
0.0019506193930283189,
0.037068162113428116,
0.011633366346359253,
0.0013982102973386645,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "bb1", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "bb2", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def plot_bbs(bb1, bb2):
plt.figure()
ax = plt.gca()
# ax.invert_yaxis()
ax.add_patch(Rectangle((bb1[0], bb1[1]), bb1[2]-bb1[0], bb1[3]-bb1[1], alpha=1, facecolor="blue"))
ax.annotate("o1", (bb1[0], bb1[1]), color='black', weight='bold', fontsize=14)
ax.add_patch(Rectangle((bb2[0], bb2[1]), bb2[2... | |
17,451 | [
-0.02597782574594021,
0.019014697521924973,
0.00816313549876213,
-0.07230941206216812,
0.0036695480812340975,
0.0287383571267128,
-0.03145768493413925,
-0.004751099273562431,
0.008209487423300743,
0.028964966535568237,
0.0030103169847279787,
-0.034980449825525284,
0.003203451167792082,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "following_args", "annotation": null, "type_comment": null}}], "kw... | def execCommand(args, following_args):
kubos_version = git_utils.get_active_kubos_version()
logging.info('Kubos-CLI version : %s' % 'v' + get_installed_version('kubos-cli'))
logging.info('Kubos Source version : %s' % kubos_version)
if not kubos_version:
if os.path.isdir(KUBOS_SRC_DIR):
... | |
17,452 | [
-0.003470485331490636,
0.008387534879148006,
0.021761909127235413,
-0.026697993278503418,
0.0315452516078949,
-0.008412913419306278,
-0.021000560373067856,
-0.008006860502064228,
0.040833719074726105,
0.018868781626224518,
0.008032238110899925,
-0.014630601741373539,
-0.015734558925032616,
... | 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 testInvalidDeviceNumber(self):
opts = tf_session.TF_NewSessionOptions()
with errors.raise_exception_on_not_ok_status() as status:
c_session = tf_session.TF_NewSession(
ops.get_default_graph()._c_graph, opts, status)
raw_device_list = tf_session.TF_SessionListDevices(
c_sessio... | |
17,453 | [
0.03307398408651352,
-0.00750172883272171,
0.06449998915195465,
-0.0426642931997776,
0.009458701126277447,
0.027603615075349808,
-0.004855237901210785,
-0.011570172384381294,
0.004786571953445673,
0.01010530348867178,
0.013469923287630081,
0.026115858927369118,
-0.01602199859917164,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testListDevicesClusterSpecPropagation(self):
server1 = server_lib.Server.create_local_server()
server2 = server_lib.Server.create_local_server()
cluster_def = cluster_pb2.ClusterDef()
job = cluster_def.job.add()
job.name = 'worker'
job.tasks[0] = server1.target[len('grpc://'):]
job.task... | |
17,454 | [
0.03093748725950718,
0.04778151959180832,
-0.009365073405206203,
-0.034762103110551834,
-0.03651723638176918,
-0.03321653977036476,
-0.007819509133696556,
-0.00821244902908802,
0.004446772392839193,
0.009234093129634857,
0.017747795209288597,
-0.010930284857749939,
0.014564980752766132,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def render_code(context):
__M_caller = context.caller_stack._push_frame()
try:
__M_writer = context.writer()
__M_writer(u'\n <script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>\n <script src="http://assets.annotateit.org/annotator/v1.2.7/annotator-full.js"></script>\n ... | |
17,455 | [
0.10109734535217285,
0.04632461443543434,
0.0046995566226542,
-0.008652318269014359,
-0.005309244152158499,
-0.024247493594884872,
0.01572936587035656,
-0.012952222488820553,
0.007176231127232313,
0.027444709092378616,
0.008839016780257225,
0.0011756183812394738,
-0.008494790643453598,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "pageargs", "annotation": null, "type_comment": null}... | def render_body(context,**pageargs):
__M_caller = context.caller_stack._push_frame()
try:
__M_locals = __M_dict_builtin(pageargs=pageargs)
__M_writer = context.writer()
__M_writer(u'\n\n')
__M_writer(u'\n')
return ''
finally:
context.caller_stack._pop_frame() | |
17,456 | [
0.041225969791412354,
0.013591204769909382,
-0.00789564661681652,
0.0072068339213728905,
-0.04075305163860321,
0.018690476194024086,
0.007664328906685114,
-0.010049472562968731,
-0.019255919381976128,
0.055927496403455734,
0.01712779700756073,
-0.03585939481854439,
0.030986301600933075,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "ExtendedURLField", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": [{"_type": "keyword", "_fields": {... | class PagePromotionForm(forms.ModelForm):
page_url = ExtendedURLField(label=_("URL"), verify_exists=True)
position = forms.CharField(
widget=forms.Select(choices=settings.OSCAR_PROMOTION_POSITIONS),
label=_("Position"),
help_text=_("Where in the page this content block will appear"))
... | |
17,457 | [
0.033075638115406036,
0.039093632251024246,
0.002313603414222598,
-0.03809063136577606,
-0.03494168072938919,
-0.04004997760057449,
0.02656780742108822,
-0.041939347982406616,
-0.0026649446226656437,
-0.006152115296572447,
0.013972007669508457,
-0.009242751635611057,
0.006356213707476854,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def render_css(context):
__M_caller = context.caller_stack._push_frame()
try:
__M_writer = context.writer()
__M_writer(u'\n <link rel="stylesheet" href="http://assets.annotateit.org/annotator/v1.2.5/annotator.min.css">\n')
return ''
finally:
context.caller_stack._pop_frame... | |
17,458 | [
-0.011787998490035534,
0.019479883834719658,
0.04146813601255417,
0.005980724934488535,
-0.013729316182434559,
0.010493787005543709,
-0.012261653319001198,
0.01211488712579012,
0.02372276410460472,
0.024950264021754265,
0.006114148534834385,
-0.07695888727903366,
0.0016102592926472425,
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 testScaBasicBehavior(self):
#######################################################################
# Launch the component with the default execparams
execparams = self.getPropertySet(kinds=("execparam",), modes=("readwrite", "writeonly"), includeNil=False)
execparams = dict([(x.id, ... | |
17,459 | [
0.02345103770494461,
-0.024328257888555527,
-0.029591582715511322,
0.00939601007848978,
0.0034284715075045824,
0.024464715272188187,
-0.004001101478934288,
-0.0353422537446022,
0.016881627961993217,
0.05044994503259659,
0.00002467183549015317,
-0.02103380672633648,
0.006067444104701281,
-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 clean_page_url(self):
page_url = self.cleaned_data.get('page_url')
if not page_url:
return page_url
if page_url.startswith('http'):
raise forms.ValidationError(
_("Content blocks can only be linked to internal URLs"))
if page_url.startswith('... | |
17,460 | [
0.03680448234081268,
-0.03166092932224274,
0.048150550574064255,
-0.013896231539547443,
0.018575133755803108,
-0.00035051244776695967,
0.012567120604217052,
0.03520522639155388,
0.00022894743597134948,
0.01604658178985119,
0.06984855234622955,
-0.004622171632945538,
-0.004122404381632805,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
certfn = os.path.join(TEST_DIR, 'testcert.pem')
self.httpd = compat_http_server.HTTPServer(
('localhost', 0), HTTPTestRequestHandler)
self.httpd.socket = ssl.wrap_socket(
self.httpd.socket, certfile=certfn, server_side=True)
self.port = self.httpd... | |
17,461 | [
0.015479464083909988,
-0.035948727279901505,
-0.0016189124435186386,
-0.02212144061923027,
0.03355362266302109,
0.022587155923247337,
-0.0022357068955898285,
0.001560698146931827,
0.005932316184043884,
0.024305863305926323,
0.055530913174152374,
-0.04526301845908165,
0.007639936171472073,
... | 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 TestHTTP(unittest.TestCase):
def setUp(self):
certfn = os.path.join(TEST_DIR, 'testcert.pem')
self.httpd = compat_http_server.HTTPServer(
('localhost', 0), HTTPTestRequestHandler)
self.httpd.socket = ssl.wrap_socket(
self.httpd.socket, certfile=certfn, server_si... | |
17,462 | [
-0.0006535800639539957,
-0.022246573120355606,
0.014363850466907024,
0.00044172568595968187,
0.01979129947721958,
-0.02216704934835434,
-0.021451342850923538,
0.0014562658034265041,
0.033757533878088,
-0.024731667712330818,
0.009145150892436504,
-0.002549707656726241,
-0.0061332150362432,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _build_proxy_handler(name):
class HTTPTestRequestHandler(compat_http_server.BaseHTTPRequestHandler):
proxy_name = name
def log_message(self, format, *args):
pass
def do_GET(self):
self.send_response(200)
self.send_header('Content-Type', 'text/plain; ... | |
17,463 | [
0.040421389043331146,
0.006023758091032505,
-0.01939741149544716,
-0.02064768224954605,
0.02318464033305645,
0.038454942405223846,
0.0002454264322295785,
-0.008442365564405918,
-0.008757967501878738,
0.06229506805539131,
0.05472060665488243,
-0.05093337967991829,
-0.003322929609566927,
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_nocheckcertificate(self):
if sys.version_info >= (2, 7, 9): # No certificate checking anyways
ydl = YoutubeDL({'logger': FakeLogger()})
self.assertRaises(
Exception,
ydl.extract_info, 'https://localhost:%d/video.html' % self.port)
ydl = ... | |
17,464 | [
0.027662547305226326,
-0.037154823541641235,
0.01425005029886961,
-0.011219733394682407,
0.054254885762929916,
0.03762013092637062,
0.018833331763744354,
0.022067220881581306,
0.008201049640774727,
-0.015483115799725056,
0.0021244208328425884,
-0.03943483158946037,
0.0013552088057622313,
-... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestProxy(unittest.TestCase):
def setUp(self):
self.proxy = compat_http_server.HTTPServer(
('localhost', 0), _build_proxy_handler('normal'))
self.port = self.proxy.socket.getsockname()[1]
self.proxy_thread = threading.Thread(target=self.proxy.serve_forever)
self.pro... | |
17,465 | [
0.03498591482639313,
-0.04441869258880615,
0.02900012396275997,
-0.014479421079158783,
0.03174532949924469,
-0.00607351353392005,
-0.021342439576983452,
0.005898067727684975,
0.035811539739370346,
-0.042168863117694855,
-0.021115392446517944,
-0.0010797643335536122,
-0.00329992501065135,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "proxy_name", "ctx": {"_type": "Store", "_fields": {}}}}], "... | class HTTPTestRequestHandler(compat_http_server.BaseHTTPRequestHandler):
proxy_name = name
def log_message(self, format, *args):
pass
def do_GET(self):
self.send_response(200)
self.send_header('Content-Type', 'text/plain; charset=utf-8')
self.end... | |
17,466 | [
0.041414305567741394,
-0.02853197604417801,
0.006309956312179565,
-0.001063090399838984,
0.06455478817224503,
0.03258752450346947,
0.04129502549767494,
0.0027121480088680983,
-0.0007947085541673005,
0.035975098609924316,
0.007466980256140232,
-0.04239240661263466,
-0.02507283166050911,
-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_proxy(self):
cn_proxy = 'localhost:{0}'.format(self.cn_port)
ydl = YoutubeDL({
'proxy': 'localhost:{0}'.format(self.port),
'cn_verification_proxy': cn_proxy,
})
url = 'http://foo.com/bar'
response = ydl.urlopen(url).read().decode('utf-8')
... | |
17,467 | [
0.05826669931411743,
-0.03250472620129585,
0.06333538889884949,
0.013508760370314121,
0.023739146068692207,
0.015345579013228416,
0.019844623282551765,
0.055011577904224396,
0.024297166615724564,
-0.028970593586564064,
0.015450208447873592,
0.0009481998858973384,
-0.025366706773638725,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
self.proxy = compat_http_server.HTTPServer(
('localhost', 0), _build_proxy_handler('normal'))
self.port = self.proxy.socket.getsockname()[1]
self.proxy_thread = threading.Thread(target=self.proxy.serve_forever)
self.proxy_thread.daemon = True
self.pro... | |
17,468 | [
-0.013292687013745308,
0.001033011474646628,
0.015204571187496185,
0.015442142263054848,
0.0041688126511871815,
-0.02841806784272194,
-0.02196970023214817,
-0.02279554307460785,
-0.030997414141893387,
0.01836087740957737,
-0.026698503643274307,
0.0033542823512107134,
0.0172861497849226,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class Parcala(QWidget):
def __init__(self):
QWidget.__init__(self)
self.resize(350, 225)
self.setMinimumSize(QSize(350, 225))
self.setMaximumSize(QSize(400, 250))
self.setWindowTitle(QApplication.applicationName()+" "+QApplication.applicationVersion())
icon = QIcon()... | |
17,469 | [
-0.003214231925085187,
0.006351673509925604,
0.02380506321787834,
0.028851298615336418,
-0.009604300372302532,
-0.026152659207582474,
-0.009006431326270103,
-0.030452929437160492,
-0.0416862852871418,
0.016104070469737053,
-0.02795175090432167,
0.0260868389159441,
0.006620440166443586,
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 __init__(self):
QWidget.__init__(self)
self.resize(350, 225)
self.setMinimumSize(QSize(350, 225))
self.setMaximumSize(QSize(400, 250))
self.setWindowTitle(QApplication.applicationName()+" "+QApplication.applicationVersion())
icon = QIcon()
icon.addPixmap(QPix... | |
17,470 | [
0.010440556332468987,
0.01422926876693964,
-0.027495933696627617,
-0.05059844255447388,
0.007108463905751705,
-0.03593723475933075,
0.014759935438632965,
-0.019054632633924484,
-0.008663440123200417,
-0.03275323659181595,
0.0662963017821312,
0.005004309117794037,
-0.012970478273928165,
-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": "sourcestore", "annotation": null, "type_comment": null}}], "kwarg... | def convertstore(self, sourcestore):
self.p = sourcestore
# translate the strings
for unit in self.p.units:
# there may be more than one element due to msguniq merge
if filter.validelement(unit, self.p.filename, self.filteraction):
self.handleunit(unit)
... | |
17,471 | [
-0.01754789613187313,
-0.002415228635072708,
0.045994631946086884,
-0.013936220668256283,
-0.0354020856320858,
-0.020534230396151543,
0.01942392624914646,
-0.029225224629044533,
-0.017662756145000458,
-0.016195112839341164,
0.01496995147317648,
0.005414323881268501,
0.0037584404926747084,
... | 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": "unit", "annotation": null, "type_comment": null}}], "kwarg": null... | def handleunit(self, unit):
# TODO: make this work for multiple columns in oo...
locations = unit.getlocations()
# technically our formats should just have one location for each entry...
# but we handle multiple ones just to be safe...
for location in locations:
subke... | |
17,472 | [
0.04970695450901985,
0.030668554827570915,
-0.005085702519863844,
-0.02298150025308132,
-0.011600281111896038,
0.02204551175236702,
0.00819985568523407,
-0.004864152055233717,
-0.026785198599100113,
-0.022762440145015717,
0.015374106355011463,
-0.022443804889917374,
-0.0011388687416911125,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "CharField", "value": {"_type": "Name", "_fields": {"id": "mo... | class Chapter(models.Model):
title = models.CharField(max_length=100, verbose_name=u'¿Title?')
content = models.TextField()
book = models.ForeignKey(Book)
def __unicode__(self):
return self.title
class Meta:
# Use a utf-8 bytestring to ensure it works (see #11710)
verbose_n... | |
17,473 | [
0.047013480216264725,
0.013699143193662167,
-0.031829699873924255,
-0.039500318467617035,
0.008131757378578186,
-0.002329585375264287,
-0.00023302882618736476,
0.013350478373467922,
-0.027758197858929634,
0.008666001260280609,
0.05457162857055664,
0.012473192997276783,
0.024159079417586327,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "inputfile", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "outputfile", "annotation": null, "type_comment": null}}, {"_... | def convertoo(inputfile, outputfile, templatefile, sourcelanguage=None,
targetlanguage=None, timestamp=None, includefuzzy=False,
multifilestyle="single", skip_source=False, filteraction=None):
inputstore = factory.getobject(inputfile)
inputstore.filename = getattr(inputfile, 'name', ... | |
17,474 | [
0.04522563889622688,
0.015611697919666767,
-0.00684017688035965,
0.010610896162688732,
0.02075045183300972,
-0.008185219950973988,
-0.019980214536190033,
0.03214308246970177,
0.04060421139001846,
0.005084148142486811,
0.006023954134434462,
-0.012990588322281837,
0.03297080099582672,
-0.032... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "... | def save_model(self, request, obj, form, change=True):
EmailMessage(
'Greetings from a created object',
'I hereby inform you that some user created me',
'from@example.com',
['to@example.com']
).send()
return super(ArticleAdmin, self).save_model(req... | |
17,475 | [
0.04060349985957146,
0.03031386248767376,
-0.019928162917494774,
-0.0052755726501345634,
0.0020600617863237858,
0.027880216017365456,
-0.05200321972370148,
0.04726400971412659,
0.05149087309837341,
0.02832851931452751,
0.012509805150330067,
-0.06323215365409851,
-0.005881316494196653,
-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": "request", "annotation": null, "type_comment": null}}, {"_type": "... | def delete_model(self, request, obj):
EmailMessage(
'Greetings from a deleted object',
'I hereby inform you that some user deleted me',
'from@example.com',
['to@example.com']
).send()
return super(ArticleAdmin, self).delete_model(request, obj) | |
17,476 | [
0.04286544770002365,
0.0028591188602149487,
0.006699726451188326,
-0.012236601673066616,
-0.0013095404719933867,
-0.010945730842649937,
-0.032538481056690216,
-0.013698166236281395,
0.011212440207600594,
0.0011835205368697643,
-0.011671178974211216,
-0.050824038684368134,
0.00583558948710560... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": ... | class Person(models.Model):
GENDER_CHOICES = (
(1, "Male"),
(2, "Female"),
)
name = models.CharField(max_length=100)
gender = models.IntegerField(choices=GENDER_CHOICES)
age = models.IntegerField(default=21)
alive = models.BooleanField()
def __unicode__(self):
return... | |
17,477 | [
0.025665629655122757,
-0.01599762961268425,
-0.04630839079618454,
-0.0388965979218483,
-0.023807577788829803,
0.023623812943696976,
-0.0164366215467453,
-0.012965532951056957,
-0.06488891690969467,
-0.0023991339839994907,
-0.003172471886500716,
-0.07918163388967514,
0.004708938766270876,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "Collector", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Lo... | class Category(models.Model):
collector = models.ForeignKey(Collector)
order = models.PositiveIntegerField()
class Meta:
ordering = ('order',)
def __unicode__(self):
return u'%s:o%s' % (self.id, self.order) | |
17,478 | [
-0.013709811493754387,
-0.02300175093114376,
-0.0015073890099301934,
0.023505965247750282,
0.013997933827340603,
-0.020564718171954155,
0.008481595665216446,
-0.006542773451656103,
-0.0033794324845075607,
0.00891978107392788,
-0.009033829905092716,
-0.04902878403663635,
-0.024058198556303978... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "CharField", "value": {"_type": "Name", "_fields": {"id": "mo... | class Post(models.Model):
title = models.CharField(max_length=100, help_text="Some help text for the title (with unicode ŠĐĆŽćžšđ)")
content = models.TextField(help_text="Some help text for the content (with unicode ŠĐĆŽćžšđ)")
posted = models.DateField(
default=datetime.date.today,
... | |
17,479 | [
0.009899258613586426,
-0.004228397272527218,
-0.013100961223244667,
-0.027333267033100128,
-0.028328849002718925,
-0.015680424869060516,
-0.025002697482705116,
-0.05588838458061218,
-0.0309761930257082,
-0.0292565505951643,
-0.018339082598686218,
-0.07009806483983994,
0.0007594145135954022,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "CharField", "value": {"_type": "Name", "_fields": {"id": "mo... | class Plot(models.Model):
name = models.CharField(max_length=100)
team_leader = models.ForeignKey(Villain, related_name='lead_plots')
contact = models.ForeignKey(Villain, related_name='contact_plots')
tags = generic.GenericRelation(FunkyTag)
def __unicode__(self):
return self.name | |
17,480 | [
0.02803790383040905,
-0.03900405392050743,
-0.061391279101371765,
-0.030408315360546112,
0.028780154883861542,
0.007410530466586351,
0.02374003641307354,
0.015611198730766773,
-0.031725212931632996,
0.012133397161960602,
-0.01447387970983982,
-0.03359280899167061,
0.0034059707541018724,
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 __init__(self):
if not CONF.discoverd.enabled:
raise exception.DriverLoadError(
_('ironic-discoverd support is disabled'))
if not ironic_discoverd:
raise exception.DriverLoadError(
_('ironic-discoverd Python module not found'))
# NOTE... | |
17,481 | [
0.05115572363138199,
0.01827280782163143,
-0.03180445358157158,
-0.016410933807492256,
-0.020317815244197845,
-0.023502331227064133,
0.012544750235974789,
-0.0007350837113335729,
-0.004067123867571354,
0.004067123867571354,
0.025008108466863632,
-0.01192412618547678,
0.012788930907845497,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "metric/form.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_... | class MetricCreateView(MetricViewMixin, MetricFormMixin, LoginRequiredMixin, CreateView):
template_name = "metric/form.html"
def form_valid(self, form):
self.object = form.save(commit=False)
self.object.creator = self.request.user
self.object.save()
return self.check_save_add_an... | |
17,482 | [
-0.011792800389230251,
-0.011603491380810738,
-0.013474304229021072,
0.013385217636823654,
-0.009576777927577496,
0.004682599101215601,
-0.03231605887413025,
-0.03612449765205383,
-0.004473803099244833,
0.0073607563972473145,
-0.018262693658471107,
-0.028151273727416992,
0.0728726014494896,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "Overview"}}], "func": {"_type": "Name", "_fields": {"id": "_", "ctx": {"_type": "Load", "_fields":... | class OverviewTab(tabs.Tab):
name = _("Overview")
slug = "overview"
template_name = "project/networks/ports/_detail_overview.html"
failure_url = 'horizon:project:routers:index'
def get_context_data(self, request):
port_id = self.tab_group.kwargs['port_id']
try:
port = ap... | |
17,483 | [
-0.019123991951346397,
-0.01260675210505724,
0.02683437243103981,
-0.01585974358022213,
0.030886542052030563,
0.0008041025139391422,
-0.07419974356889725,
0.02334500290453434,
0.014734141528606415,
-0.002362359082326293,
-0.03099910356104374,
-0.004370152950286865,
0.03858566656708717,
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": "request", "annotation": null, "type_comment": null}}], "kwarg": n... | def get_context_data(self, request):
port_id = self.tab_group.kwargs['port_id']
try:
port = api.neutron.port_get(self.request, port_id)
except Exception:
redirect = reverse(self.failure_url)
msg = _('Unable to retrieve port details.')
exceptions.ha... | |
17,484 | [
-0.0022666752338409424,
0.028110230341553688,
0.009752175770699978,
-0.012384629808366299,
-0.011831642128527164,
0.059446223080158234,
-0.027418995276093483,
-0.019170254468917847,
0.01317954994738102,
0.07414649426937103,
0.02532224729657173,
-0.04474595561623573,
0.016509000211954117,
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():
module = AnsibleModule(
argument_spec=dict(
name=dict(required=True, type='str', aliases=['host']),
key=dict(required=False, type='str'),
path=dict(default="~/.ssh/known_hosts", type='path'),
hash_host=dict(required=False, type='bool', default=Fal... | |
17,485 | [
0.022504189983010292,
0.03427368775010109,
-0.016568269580602646,
-0.03288636729121208,
0.031157897785305977,
-0.004122167360037565,
0.02488083206117153,
-0.02579055167734623,
0.03775336593389511,
0.07355083525180817,
0.03859485685825348,
0.008648022077977657,
-0.017250558361411095,
0.0065... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "found_line", "annotation": null, "type_comment": null}}, {"_type"... | def compute_diff(path, found_line, replace_or_add, state, key):
diff = {
'before_header': path,
'after_header': path,
'before': '',
'after': '',
}
try:
inf = open(path, "r")
except IOError as e:
if e.errno == errno.ENOENT:
diff['before_header']... | |
17,486 | [
-0.034974634647369385,
-0.01664888486266136,
0.0413554385304451,
0.0018020865973085165,
0.008357108570635319,
-0.03490930423140526,
0.002509854733943939,
0.03445197641849518,
0.04869444668292999,
0.029856927692890167,
-0.010148306377232075,
-0.006293692160397768,
0.01636577770113945,
0.041... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a_np_", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "b_np_", "annotation": null, "type_comment": null}}, {"_type": "a... | def _GetMatMulTest(a_np_, b_np_, use_static_shape_, **kwargs_):
def Test(self):
np_val = np.matrix(a_np_) * np.matrix(b_np_)
use_gpu = True
if a_np_.dtype is np.float16 and (
not test_util.CudaSupportsHalfMatMulAndConv()):
use_gpu = False
print("Built without fp16 matmul support for ... | |
17,487 | [
-0.0283812303096056,
-0.03127771615982056,
0.030629249289631844,
-0.008894803002476692,
0.0011888558510690928,
-0.040810178965330124,
0.013466494157910347,
0.030348246917128563,
0.042128726840019226,
0.0166331734508276,
-0.006155030801892281,
0.004077235236763954,
-0.010888838209211826,
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(self):
np_val = np.matrix(a_np_) * np.matrix(b_np_)
use_gpu = True
if a_np_.dtype is np.float16 and (
not test_util.CudaSupportsHalfMatMulAndConv()):
use_gpu = False
print("Built without fp16 matmul support for Cuda, running test on CPU.")
# Transpose and possibly conjugat... | |
17,488 | [
-0.030783040449023247,
-0.010299880988895893,
0.04006681218743324,
-0.019400421530008316,
0.04095521196722984,
-0.014403175562620163,
0.016735224053263664,
0.009650238789618015,
0.03533608838915825,
0.046063508838415146,
0.0003123279311694205,
-0.010438692755997181,
-0.006418685894459486,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a_np_", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "b_np_", "annotation": null, "type_comment": null}}, {"_type": "a... | def _GetMatMulGradientTest(a_np_, b_np_, use_static_shape_, **kwargs_):
def Test(self):
if not use_static_shape_ or a_np_.dtype in (np.int32, np.float16):
self.skipTest("Skipping infeasible gradient test.")
# Transpose and possibly conjugate a_np_ and b_np_ according to the
# attributes such that ... | |
17,489 | [
-0.016782790422439575,
-0.011249677278101444,
0.03884423151612282,
-0.028902379795908928,
0.04409920796751976,
0.0107466671615839,
0.007841043174266815,
0.016119999811053276,
0.02523336373269558,
0.044501617550849915,
-0.008947665803134441,
0.005385168828070164,
-0.0214933343231678,
0.0372... | 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(self):
if not use_static_shape_ or a_np_.dtype in (np.int32, np.float16):
self.skipTest("Skipping infeasible gradient test.")
# Transpose and possibly conjugate a_np_ and b_np_ according to the
# attributes such that tf.matmul(effective_a_np, effective_b_np, **kwargs)
# results in a vali... | |
17,490 | [
-0.025916486978530884,
0.0024102581664919853,
0.027208583429455757,
-0.024487726390361786,
0.03272484615445137,
0.00363712920807302,
0.0026727153453975916,
-0.007081686053425074,
0.05332385376095772,
0.010516924783587456,
0.020313257351517677,
-0.0044850679114460945,
-0.010051025077700615,
... | 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 testSimpleStatistics(self):
g = ops.Graph()
with g.as_default():
a = variables.Variable(random_ops.random_normal([25, 16]))
b = variables.Variable(random_ops.random_normal([16, 9]))
math_ops.matmul(a, b)
for op in g.get_operations():
flops = ops.get_stats_for_node_def(g, op.n... | |
17,491 | [
-0.011454503051936626,
-0.015467454679310322,
0.03496574983000755,
-0.018222259357571602,
0.033820897340774536,
0.004320035222917795,
0.006085018627345562,
-0.022622792050242424,
0.03704079985618591,
0.01456111203879118,
-0.004707615822553635,
-0.023696092888712883,
0.02196688763797283,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class MatMulStatsTest(test_lib.TestCase):
def testSimpleStatistics(self):
g = ops.Graph()
with g.as_default():
a = variables.Variable(random_ops.random_normal([25, 16]))
b = variables.Variable(random_ops.random_normal([16, 9]))
math_ops.matmul(a, b)
for op in g.get_operations():
... | |
17,492 | [
-0.015674203634262085,
0.016044460237026215,
0.026140127331018448,
-0.014514065347611904,
0.024227134883403778,
0.010169719345867634,
-0.0009318128577433527,
-0.01692073419690132,
0.03539654612541199,
-0.004989210050553083,
0.013576081953942776,
0.016784973442554474,
-0.003029934596270323,
... | 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 testTransposedStatistics(self):
g = ops.Graph()
with g.as_default():
a = variables.Variable(random_ops.random_normal([16, 25]))
b = variables.Variable(random_ops.random_normal([16, 9]))
math_ops.matmul(a, b, transpose_a=True)
for op in g.get_operations():
flops = ops.get_stat... | |
17,493 | [
-0.006731003522872925,
0.029176292940974236,
-0.010233398526906967,
-0.004362496081739664,
0.04087160527706146,
-0.0248783677816391,
0.05922043323516846,
-0.006865313742309809,
0.008972949348390102,
-0.024506432935595512,
-0.046822577714920044,
-0.03907391428947449,
0.03647036477923393,
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 infix_matmul(x, y): # pylint: disable=invalid-name
try:
r = type(x).__matmul__(x, y)
except AttributeError:
r = NotImplemented
if r is NotImplemented and type(x) is not type(y):
try:
r = type(y).__rmatmul__(y, x)
except AttributeError:
r = NotImplemented
if r... | |
17,494 | [
0.028103141114115715,
0.0036399667151272297,
-0.0017719775205478072,
-0.021517878398299217,
-0.011148633435368538,
0.03386383131146431,
-0.04059593379497528,
-0.01772259920835495,
-0.02647659182548523,
0.03164992108941078,
0.02271519973874092,
-0.11909948289394379,
0.029865235090255737,
-0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "name"}}], "func": {"_type": "Name", "_fields": {"id": "_", ... | class Party(models.Model):
name = models.CharField(_('name'), max_length=200)
official_site = models.URLField(_('official site'), null=True, blank=True)
facebook_page = models.URLField(_('facebook_page'), null=True, blank=True)
wikpedia_article = models.URLField(
_('wikipedia_article'), null=Tru... | |
17,495 | [
-0.01608138717710972,
0.011728220619261265,
0.06804842501878738,
0.016800042241811752,
0.04681863263249397,
0.03937289118766785,
0.014691201969981194,
0.01675291731953621,
0.009560473263263702,
0.009124567732214928,
0.0021500757429748774,
-0.02457566000521183,
0.046559445559978485,
0.02763... | 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 MatMulInfixOperatorTest(test_lib.TestCase):
def testMismatchedShape(self):
with self.assertRaisesWithPredicateMatch(ValueError,
lambda e: "Shape must" in str(e)):
infix_matmul(
ops.convert_to_tensor([10.0, 20.0, 30.0]),
ops.convert_to_t... | |
17,496 | [
0.027437901124358177,
-0.0040369899943470955,
-0.028999406844377518,
-0.0049354759976267815,
0.029792552813887596,
0.023125167936086655,
-0.01583813689649105,
0.036410365253686905,
0.006971011403948069,
0.034204427152872086,
0.02570289373397827,
-0.018366292119026184,
-0.014028772711753845,
... | 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": "user", "annotation": null, "type_comment": null}}, {"_type": "arg... | def vote(self, user, upvote):
if upvote and user not in self.voters.all():
self.voters.add(user)
self.number_of_votes = models.F('number_of_votes') + 1
elif not upvote and user in self.voters.all():
self.voters.remove(user)
self.number_of_votes = models.F(... | |
17,497 | [
0.02304476872086525,
0.005914386361837387,
0.01639176718890667,
-0.06609230488538742,
0.030179236084222794,
0.011795945465564728,
-0.006231716834008694,
-0.02119549736380577,
-0.010641518048942089,
0.03527840971946716,
-0.02510194666683674,
-0.06569837778806686,
0.0014539760304614902,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "Candidate", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Lo... | class Log(models.Model):
candidate = models.ForeignKey(Candidate)
number_of_votes = models.PositiveIntegerField(default=0)
timestamp = models.DateTimeField(auto_now_add=True)
def __unicode__(self):
return u'candidate: {}, votes: {}, timestamp: {}' \
.format(self.candidate.name,
... | |
17,498 | [
-0.017140978947281837,
-0.02291588857769966,
0.029189538210630417,
-0.02118341624736786,
-0.009180792607367039,
0.02484523318707943,
0.02082904614508152,
0.02081592194736004,
0.005633817054331303,
0.001468336209654808,
0.02279776521027088,
-0.008137371391057968,
0.013938529416918755,
-0.01... | 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 test_fancy():
# using subplot triggers some offsetbox functionality untested elsewhere
plt.subplot(121)
plt.scatter(list(xrange(10)), list(xrange(10, 0, -1)), label='XX\nXX')
plt.plot([5] * 10, 'o--', label='XX')
plt.errorbar(list(xrange(10)), list(xrange(10)), xerr=0.5, yerr=0.5, label='XX')
... | |
17,499 | [
-0.021294353529810905,
-0.013235337100923061,
0.04712582379579544,
-0.0670289620757103,
-0.03193526342511177,
0.013636408373713493,
-0.02332477457821369,
-0.04537113755941391,
-0.01936420053243637,
0.04136043041944504,
0.05314188450574875,
-0.007056339643895626,
-0.0009736934443935752,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_various_labels():
# tests all sorts of label types
fig = plt.figure()
ax = fig.add_subplot(121)
ax.plot(list(xrange(4)), 'o', label=1)
ax.plot(np.linspace(4, 4.1), 'o', label='D\xe9velopp\xe9s')
ax.plot(list(xrange(4, 1, -1)), 'o', label='__nolegend__')
ax.legend(numpoints=1, loc=0) | |
17,500 | [
-0.01588120497763157,
-0.021540174260735512,
0.040760040283203125,
-0.03622255474328995,
-0.02352532371878624,
0.01491441112011671,
0.012316957116127014,
0.012729456648230553,
0.005291586741805077,
-0.010538056492805481,
0.00917809922248125,
0.0007871315465308726,
0.026167895644903183,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_rc():
# using subplot triggers some offsetbox functionality untested elsewhere
fig = plt.figure()
ax = plt.subplot(121)
ax.scatter(list(xrange(10)), list(xrange(10, 0, -1)), label='three')
ax.legend(loc="center left", bbox_to_anchor=[1.0, 0.5],
title="My legend")
mpl.rcPa... |