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 |
|---|---|---|---|---|---|
10,001 | [
0.030274322256445885,
0.036147210747003555,
0.0036877873353660107,
-0.0018559566233307123,
-0.04803084582090378,
-0.06771742552518845,
0.005514448508620262,
0.00759615283459425,
0.02511831372976303,
0.01924542523920536,
-0.005162902642041445,
-0.029447155073285103,
0.026965653523802757,
-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 getImpl(self):
replacements = {
"declRval": self.getRvalDecl(),
"returnResult": self.getResultConversion(),
"convertArgs": self.getArgConversions(),
"doCall": self.getCall(),
"setupCall": self.getCallSetup(),
}
if self.argCount > 0:... | |
10,002 | [
0.012967126443982124,
-0.025054723024368286,
-0.03458692505955696,
-0.03228113055229187,
-0.026148192584514618,
-0.02755068615078926,
-0.01899309642612934,
-0.023224348202347755,
0.041860878467559814,
0.000898101250641048,
0.005916028283536434,
0.0010117567144334316,
0.060758888721466064,
... | 15 | {"_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": "i", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def getArgConversion(self, i, arg):
argval = arg.identifier.name
if arg.variadic:
argval = argval + "[idx].get()"
jsvalIndex = "%d + idx" % i
else:
jsvalIndex = "%d" % i
if arg.optional and not arg.defaultValue:
argval += ".clone()... | |
10,003 | [
0.04537280276417732,
-0.018695276230573654,
0.017461176961660385,
-0.03444972261786461,
-0.058028873056173325,
-0.022043095901608467,
-0.022174382582306862,
-0.03245415911078453,
-0.000385245424695313,
0.04718456417322159,
-0.01136945839971304,
0.0016000608447939157,
0.033872056752443314,
... | 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 getArgConversions(self):
# Just reget the arglist from self.originalSig, because our superclasses
# just have way to many members they like to clobber, so I can't find a
# safe member name to store it in.
argConversions = [self.getArgConversion(i, arg) for (i, arg)
... | |
10,004 | [
0.02525181695818901,
0.03512536734342575,
-0.0013359052827581763,
0.009453048929572105,
-0.0344918854534626,
-0.04622218385338783,
-0.012068883515894413,
0.01150093600153923,
0.052207477390766144,
0.03835829719901085,
-0.01641586609184742,
-0.04713963717222214,
0.03759375214576721,
0.02654... | 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": "returnType", "annotation": null, "type_comment": null}}, {"_type"... | def getArgs(self, returnType, argList):
args = CGNativeMember.getArgs(self, returnType, argList)
if not self.needThisHandling:
# Since we don't need this handling, we're the actual method that
# will be called, so we need an aRethrowExceptions argument.
args.append(Ar... | |
10,005 | [
0.03339008614420891,
0.019876806065440178,
-0.04555203765630722,
-0.028377888724207878,
0.0036885112058371305,
0.0066399346105754375,
-0.0211421400308609,
-0.014901462011039257,
-0.02090873010456562,
-0.018672896549105644,
0.027640800923109055,
-0.041031233966350555,
0.05754200369119644,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "idlObject", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs... | def ensureASCIIName(idlObject):
type = "attribute" if idlObject.isAttr() else "operation"
if re.match("[^\x20-\x7E]", idlObject.identifier.name):
raise SyntaxError('Callback %s name "%s" contains non-ASCII '
"characters. We can't handle that. %s" %
... | |
10,006 | [
0.0215230043977499,
0.033645156770944595,
-0.006311559118330479,
-0.016946272924542427,
-0.04913182184100151,
-0.040201012045145035,
-0.018715117126703262,
0.0016327796038240194,
0.02607499621808529,
0.006716661620885134,
-0.00815771333873272,
-0.046088915318250656,
0.05685041844844818,
-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 getCall(self):
replacements = {
"thisObj": self.getThisObj(),
"getCallable": self.getCallableDecl()
}
if self.argCount > 0:
replacements["argv"] = "argv.as_ptr()"
replacements["argc"] = "argc"
else:
replacements["argv"] = "p... | |
10,007 | [
0.03058767504990101,
0.01628694497048855,
0.014971078373491764,
0.009664165787398815,
-0.058344997465610504,
-0.010998653247952461,
-0.016113150864839554,
0.006362087558954954,
0.04478909447789192,
0.017950396984815598,
0.030811123549938202,
-0.04451599344611168,
0.021364200860261917,
-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": "sig", "annotation": nu... | class CallbackMethod(CallbackMember):
def __init__(self, sig, name, descriptorProvider, needThisHandling):
CallbackMember.__init__(self, sig, name, descriptorProvider,
needThisHandling)
def getRvalDecl(self):
return "rooted!(in(cx) let mut rval = UndefinedValue()... | |
10,008 | [
0.02938007563352585,
0.04432079568505287,
0.0244040135294199,
0.014339081011712551,
-0.043669018894433975,
0.0016153401229530573,
-0.026547353714704514,
0.0017453819746151567,
0.03832946717739105,
0.00010507152910577133,
-0.010215342044830322,
-0.04291696846485138,
0.0381038524210453,
-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 getCallableDecl(self):
replacements = {
"methodName": self.methodName
}
getCallableFromProp = string.Template(
'try!(self.parent.get_callable_property(cx, "${methodName}"))'
).substitute(replacements)
if not self.singleOperation:
return 'ro... | |
10,009 | [
0.03761911764740944,
0.020757773891091347,
-0.013011298142373562,
-0.007932021282613277,
-0.01875157654285431,
-0.008975707925856113,
-0.0020004000980407,
0.012628613039851189,
0.04223453253507614,
-0.012825753539800644,
0.03476637229323387,
-0.06990383565425873,
0.04457703232765198,
-0.03... | 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": "attr", "annotation": n... | class CallbackGetter(CallbackMember):
def __init__(self, attr, descriptor):
self.ensureASCIIName(attr)
self.attrName = attr.identifier.name
CallbackMember.__init__(self,
(attr.type, []),
callbackGetterName(attr),
... | |
10,010 | [
0.06216145679354668,
0.013353032059967518,
-0.03137848153710365,
-0.014509684406220913,
-0.03279852867126465,
-0.004300225991755724,
0.023522408679127693,
0.01409741211682558,
0.053091470152139664,
-0.015425844117999077,
0.01603280007839203,
-0.06871200352907181,
0.05570252612233162,
-0.03... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "attr", "annotation": n... | class CallbackSetter(CallbackMember):
def __init__(self, attr, descriptor):
self.ensureASCIIName(attr)
self.attrName = attr.identifier.name
CallbackMember.__init__(self,
(BuiltinTypes[IDLBuiltinType.Types.void],
[FakeArgument(a... | |
10,011 | [
0.0752544030547142,
0.02307893894612789,
-0.01317643653601408,
-0.021580306813120842,
0.0059541817754507065,
0.0016528185224160552,
0.028543181717395782,
-0.009671942330896854,
0.01316490862518549,
0.0075162178836762905,
0.027667058631777763,
-0.05325908958911896,
0.03246268257498741,
-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": "attr", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, attr, descriptor):
self.ensureASCIIName(attr)
self.attrName = attr.identifier.name
CallbackMember.__init__(self,
(attr.type, []),
callbackGetterName(attr),
descriptor,
... | |
10,012 | [
0.0776783749461174,
0.023194968700408936,
-0.00956232100725174,
-0.018452152609825134,
0.007367883343249559,
-0.007562551181763411,
0.022404499351978302,
-0.018829690292477608,
0.012399752624332905,
0.008040372282266617,
0.026474827900528908,
-0.04237860068678856,
0.04351121559739113,
-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": "attr", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, attr, descriptor):
self.ensureASCIIName(attr)
self.attrName = attr.identifier.name
CallbackMember.__init__(self,
(BuiltinTypes[IDLBuiltinType.Types.void],
[FakeArgument(attr.type, attr)]),
... | |
10,013 | [
0.004388830624520779,
0.04317096248269081,
0.03547583520412445,
-0.020959436893463135,
-0.033258598297834396,
-0.024676574394106865,
-0.0286154355853796,
-0.023033209145069122,
0.017842259258031845,
-0.008347255177795887,
0.0007210104959085584,
-0.05900466442108154,
0.052066005766391754,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def InterfaceObjectMap(config):
mods = [
"dom::bindings::codegen",
"js::jsapi::{HandleObject, JSContext}",
"phf",
]
imports = CGList([CGGeneric("use %s;" % mod) for mod in mods], "\n")
global_descriptors = config.getDescriptors(isGlobal=True)
... | |
10,014 | [
0.00304103409871459,
0.0010709587950259447,
0.03304579481482506,
-0.021761231124401093,
-0.027703218162059784,
-0.0063166203908622265,
-0.055927664041519165,
-0.008372209966182709,
0.016783511266112328,
0.04010842368006706,
-0.00908889714628458,
-0.04487765207886696,
0.07135598361492157,
-... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def PrototypeList(config):
# Prototype ID enum.
interfaces = config.getDescriptors(isCallback=False)
protos = [d.name for d in interfaces]
constructors = [d.name for d in config.getDescriptors(hasInterfaceObject=True)
if d.shouldHaveGetConstructorObjectMethod()]
... | |
10,015 | [
0.0445198193192482,
0.062140192836523056,
0.04405093193054199,
-0.006570621859282255,
-0.05026988685131073,
0.018767917528748512,
0.015621422789990902,
-0.040151745080947876,
-0.01372118666768074,
-0.0019110330613330007,
-0.0015616795280948281,
-0.019755054265260696,
0.031859803944826126,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def RegisterBindings(config):
# TODO - Generate the methods we want
code = CGList([
CGRegisterProxyHandlers(config),
], "\n")
return CGImports(code, [], [], [
'dom::bindings::codegen',
'dom::bindings::codegen::PrototypeList::Proxies',
'lib... | |
10,016 | [
0.003508645575493574,
0.01736055128276348,
0.05051945522427559,
-0.03615731745958328,
0.026683343574404716,
-0.0001851369597716257,
-0.03288174048066139,
-0.022714857012033463,
-0.011067666113376617,
0.012875531800091267,
0.01448812335729599,
-0.0171967726200819,
0.04696671664714813,
-0.01... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def InheritTypes(config):
descriptors = config.getDescriptors(register=True, isCallback=False)
imports = [CGGeneric("use dom::types::*;\n"),
CGGeneric("use dom::bindings::conversions::{DerivedFrom, get_dom_class};\n"),
CGGeneric("use dom::bindings::inheritance::Cas... | |
10,017 | [
0.04480854421854019,
0.06772293895483017,
0.039293646812438965,
-0.02583729475736618,
-0.03256547078490257,
0.005800982937216759,
0.029339255765080452,
-0.04047934710979462,
-0.004360215738415718,
-0.031241893768310547,
-0.014559329487383366,
-0.045304883271455765,
0.03879730403423309,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def Bindings(config):
descriptors = (set(d.name + "Binding" for d in config.getDescriptors(register=True)) |
set(getModuleFromObject(d) for d in config.callbacks) |
set(getModuleFromObject(d) for d in config.getDictionaries()))
curr = CGList([CGGeneric("pub... | |
10,018 | [
-0.0141105055809021,
0.031247694045305252,
0.03242473676800728,
-0.028977682814002037,
0.007636768277734518,
0.03102349489927292,
0.012492071837186813,
-0.012499077245593071,
0.03197633847594261,
0.006806532386690378,
-0.015175449661910534,
-0.0218873992562294,
0.011910555884242058,
0.0307... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def UnionTypes(config):
curr = UnionTypes(config.getDescriptors(),
config.getDictionaries(),
config.getCallbacks(),
config)
# Add the auto-generated comment.
curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT)
... | |
10,019 | [
0.059625059366226196,
0.04922662675380707,
0.07533333450555801,
-0.008690712042152882,
-0.014615883119404316,
-0.013564977794885635,
-0.030033772811293602,
-0.01042608916759491,
0.021764805540442467,
0.0012090598465874791,
0.0033342051319777966,
-0.08169407397508621,
0.044525206089019775,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def SupportedDomApis(config):
descriptors = config.getDescriptors(isExposedConditionally=False)
base_path = os.path.join('dom', 'bindings', 'codegen')
with open(os.path.join(base_path, 'apis.html.template')) as f:
base_template = f.read()
with open(os.path.join(base_path, 'a... | |
10,020 | [
0.02461128681898117,
-0.0011869306908920407,
0.028354017063975334,
-0.012576581910252571,
-0.02744668908417225,
-0.009980614297091961,
-0.012967237271368504,
0.008493603207170963,
0.017995350062847137,
0.012765608727931976,
0.026211712509393692,
-0.07334239035844803,
-0.01291682943701744,
... | 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": "appname", "annotation"... | class AppDeletionHandler(WebBaseHandler):
@tornado.web.authenticated
def get(self, appname):
self.appname = appname
app = self.masterdb.applications.find_one({'shortname':appname})
if not app: raise tornado.web.HTTPError(500)
self.render("app_delete.html", app=app)
@tornado.w... | |
10,021 | [
-0.005481225438416004,
-0.0008638056460767984,
0.028082480654120445,
-0.038267582654953,
-0.026344159618020058,
-0.03283226490020752,
-0.00992190558463335,
-0.07198125123977661,
0.012694653123617172,
0.032048795372247696,
-0.013257771730422974,
-0.04957892373204231,
0.005863778758794069,
-... | 17 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "appname", "annotation"... | class AppLogViewHandler(WebBaseHandler):
@tornado.web.authenticated
def get(self, appname):
self.appname = appname
app = self.masterdb.applications.find_one({'shortname':appname})
if not app: raise tornado.web.HTTPError(500)
page = self.get_argument('page', None)
perpage ... | |
10,022 | [
0.028954191133379936,
0.0026420054491609335,
0.04034009203314781,
-0.013343657366931438,
-0.029469389468431473,
-0.04170536994934082,
-0.011959060095250607,
-0.0477847196161747,
-0.011585540138185024,
0.026506995782256126,
-0.011572660878300667,
-0.06053589656949043,
-0.01571357436478138,
... | 16 | {"_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": "appname", "annotation": null, "type_comment": null}}], "kwarg": n... | def get(self, appname):
self.appname = appname
app = self.masterdb.applications.find_one({'shortname':appname})
if not app: raise tornado.web.HTTPError(500)
page = self.get_argument('page', None)
perpage = 50
if page:
logs = self.db.logs.find().sort('created',... | |
10,023 | [
0.017681466415524483,
0.008418349549174309,
0.02494412660598755,
-0.013504557311534882,
-0.003326274687424302,
-0.04904348403215408,
-0.02001631259918213,
-0.022902604192495346,
0.014466654509305954,
0.005048076622188091,
-0.018256379291415215,
-0.06410852074623108,
0.026586731895804405,
-... | 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": "appname", "annotation"... | class AppObjectsHandler(WebBaseHandler):
@tornado.web.authenticated
def get(self, appname):
self.appname = appname
app = self.masterdb.applications.find_one({'shortname':appname})
if not app: raise tornado.web.HTTPError(500)
objects = self.db.objects.find()
self.render("a... | |
10,024 | [
0.017706248909235,
-0.018845247104763985,
0.00896961335092783,
-0.0005808245041407645,
0.001047587371431291,
-0.022326959297060966,
-0.024863818660378456,
-0.018845247104763985,
0.006546005140990019,
0.059952735900878906,
-0.01947946287691593,
-0.03479122743010521,
0.023194150999188423,
-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 InfoHandler(WebBaseHandler):
@tornado.web.authenticated
def get(self):
airnotifierinfo = {}
airnotifierinfo['version'] = VERSION
mongodbinfo = self.application.mongodb.server_info()
if mongodbinfo.has_key('versionArray'):
del mongodbinfo['versionArray']
... | |
10,025 | [
-0.008251912891864777,
0.0007763982284814119,
0.03852587938308716,
-0.015283203683793545,
-0.022301780059933662,
-0.046485353261232376,
-0.03176160156726837,
-0.0365169383585453,
0.009675972163677216,
0.05569087713956833,
-0.008277342654764652,
-0.07064349204301834,
-0.003760405583307147,
... | 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 AppsListHandler(WebBaseHandler):
@tornado.web.authenticated
def get(self):
version_object = self.masterdb['options'].find_one({'name': 'version'})
outdated = False
if int(version_object['value']) < int(VERSION):
outdated = True
apps = self.masterdb.applications.... | |
10,026 | [
0.01609227806329727,
-0.03213059902191162,
-0.00020338757894933224,
-0.01323262695223093,
-0.02628989890217781,
-0.01771094836294651,
0.01131720095872879,
-0.04073652997612953,
-0.02716667763888836,
0.05471104755997658,
-0.0313752219080925,
-0.036231230944395065,
-0.006572474725544453,
-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 get(self):
airnotifierinfo = {}
airnotifierinfo['version'] = VERSION
mongodbinfo = self.application.mongodb.server_info()
if mongodbinfo.has_key('versionArray'):
del mongodbinfo['versionArray']
pythoninfo = {}
pythoninfo['version'] = sys.version
py... | |
10,027 | [
0.02449842169880867,
0.01832152158021927,
0.0017441745148971677,
-0.00007704782910877839,
0.03167199343442917,
0.014371751807630062,
0.010994143784046173,
0.032287221401929855,
0.027783745899796486,
0.03548641502857208,
0.019859595224261284,
-0.021582236513495445,
0.011400194838643074,
-0.... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "action", "annotation":... | class AdminHandler(WebBaseHandler):
@tornado.web.authenticated
def get(self, action):
if self.get_argument('delete', None):
user_id = self.get_argument('delete', None)
if user_id:
self.masterdb.managers.remove({'_id':ObjectId(user_id)})
self.redire... | |
10,028 | [
0.035053908824920654,
0.03580489009618759,
-0.004996453877538443,
-0.004312091041356325,
-0.007418976631015539,
0.03260716050863266,
-0.012585007585585117,
0.05150283873081207,
0.008551506325602531,
0.017757093533873558,
0.045640334486961365,
-0.05222959816455841,
0.027398735284805298,
-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": "action", "annotation": null, "type_comment": null}}], "kwarg": nu... | def get(self, action):
if self.get_argument('delete', None):
user_id = self.get_argument('delete', None)
if user_id:
self.masterdb.managers.remove({'_id':ObjectId(user_id)})
self.redirect("/admin/managers")
return
managers = self.ma... | |
10,029 | [
0.025293618440628052,
0.010327168740332127,
-0.0012758024968206882,
0.02033657766878605,
0.018061423674225807,
-0.006008823402225971,
0.02900504507124424,
0.04046979174017906,
0.009691650979220867,
0.04626571387052536,
0.05051097646355629,
-0.023285381495952606,
0.021810980513691902,
-0.00... | 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}}], "kwarg": nu... | def post(self, action):
action = self.get_argument('action', "")
if action == 'createuser':
user = {}
user['created'] = int(time.time())
user['username'] = self.get_argument('newusername').strip()
password = self.get_argument('newpassword').strip()
... | |
10,030 | [
0.04715104028582573,
-0.01604839600622654,
-0.01851009763777256,
-0.036073386669158936,
-0.005887962877750397,
-0.0019794206600636244,
-0.056382421404123306,
0.04812151938676834,
-0.01578802429139614,
-0.022640548646450043,
0.023812223225831985,
-0.036333758383989334,
-0.008148467168211937,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def search(request):
key = request.REQUEST.get('key')
page_index = int(request.REQUEST.get('page_index'))
page_objs = page.Cpt(BanKeyBase().get_all_bankeys(), count=50, page=page_index).info
num = 50 * (page_index - 1)
data = []
for x in page_objs[0]:
num += 1
data.append({
... | |
10,031 | [
0.019423214718699455,
-0.016299031674861908,
0.08873648196458817,
-0.0353589691221714,
-0.008058696053922176,
0.01362289022654295,
0.04238232597708702,
0.0012676856713369489,
-0.05202127620577812,
-0.004725629463791847,
0.013417033478617668,
-0.023334497585892677,
0.00868232175707817,
-0.0... | 15 | {"_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 setUpClass(cls):
super(TestFormExportInstanceGeneration, cls).setUpClass()
cls.app_id = '1234'
cls.schema = FormExportDataSchema(
group_schemas=[
ExportGroupSchema(
path=MAIN_TABLE,
items=[
MultipleCh... | |
10,032 | [
-0.004359341226518154,
0.008913296274840832,
0.07851262390613556,
-0.016113992780447006,
-0.009613904170691967,
0.050799671560525894,
0.028202269226312637,
-0.005699393805116415,
-0.0015026938635855913,
-0.03345127031207085,
-0.00985300075262785,
-0.018493838608264923,
0.030048316344618797,
... | 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": "_", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def test_default_table_names(self, _, __):
self.assertEqual(
FormExportInstanceDefaults.get_default_table_name(MAIN_TABLE),
"Forms"
)
self.assertEqual(
FormExportInstanceDefaults.get_default_table_name([
PathNode(name="form"),
P... | |
10,033 | [
-0.02454433962702751,
-0.038553353399038315,
0.09406378120183945,
-0.04572925716638565,
0.0020410767756402493,
0.00038493363535963,
0.02977772243320942,
0.003216588171198964,
0.0053876424208283424,
0.01594010926783085,
0.018659640103578568,
-0.013917600736021996,
-0.03750210627913475,
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}}, {"_type": "arg", "_fields": {"arg": "_", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def test_export_instance_settings_default_values(self, _, __):
instance = self._generate_instance({self.app_id: 3})
self.assertEqual(instance.export_format, Format.XLS_2007)
self.assertEqual(instance.split_multiselects, False)
self.assertEqual(instance.transform_dates, True)
self... | |
10,034 | [
0.0038419049233198166,
-0.030153296887874603,
0.07121264934539795,
-0.027631541714072227,
-0.02327774092555046,
-0.010695906355977058,
0.07129886001348495,
0.00921949464827776,
-0.02948513999581337,
-0.0014184874016791582,
0.011207801289856434,
-0.002831586403772235,
-0.0018428212497383356,
... | 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": "_", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def test_form_export_instance_settings_override(self, _, __):
mock_settings = mock.MagicMock(
forms_filetype=ExportFileType.CSV,
forms_auto_convert=False,
forms_auto_format_cells=True,
forms_expand_checkbox=True
)
instance = self._generate_instance... | |
10,035 | [
0.0163792185485363,
-0.025164231657981873,
0.07374018430709839,
-0.059225816279649734,
0.008790629915893078,
0.018109260126948357,
0.007813269272446632,
-0.02001904509961605,
-0.02565852925181389,
-0.011840669438242912,
0.0012322328984737396,
-0.04547536373138428,
-0.008650205098092556,
-0... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_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"... | class TestCaseExportInstanceGeneration(SimpleTestCase):
@classmethod
def setUpClass(cls):
super(TestCaseExportInstanceGeneration, cls).setUpClass()
cls.app_id = '1234'
cls.schema = CaseExportDataSchema(
group_schemas=[
ExportGroupSchema(
p... | |
10,036 | [
0.017672736197710037,
-0.015818702057003975,
0.08081681281328201,
-0.053814489394426346,
-0.019336611032485962,
0.02669331803917885,
0.009002755396068096,
-0.018504673615098,
-0.03139970824122429,
-0.01045270450413227,
0.00891956128180027,
-0.02897520549595356,
0.0011758549371734262,
-0.03... | 15 | {"_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 setUpClass(cls):
super(TestCaseExportInstanceGeneration, cls).setUpClass()
cls.app_id = '1234'
cls.schema = CaseExportDataSchema(
group_schemas=[
ExportGroupSchema(
path=MAIN_TABLE,
items=[
ScalarItem... | |
10,037 | [
0.006818119902163744,
-0.03062366507947445,
0.08069302886724472,
-0.04230872169137001,
0.025222083553671837,
-0.010494503192603588,
0.019214199855923653,
-0.03966305032372475,
-0.007650404702872038,
-0.030028389766812325,
0.00260984618216753,
-0.046343374997377396,
0.015840968117117882,
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": "_", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def test_generate_instance_from_schema(self, _):
instance = self._generate_instance({self.app_id: 3}, self.schema)
self.assertEqual(len(instance.tables), 1)
self.assertEqual(len(instance.tables[0].columns), 21)
# adding in 'name' shouldn't create any new columns
instance = self... | |
10,038 | [
0.018613921478390694,
-0.008494224399328232,
0.07499750703573227,
-0.028310317546129227,
0.0007167883450165391,
0.004605506081134081,
0.013127950020134449,
-0.031132319942116737,
-0.03126777708530426,
-0.01289090234786272,
0.02152622677385807,
-0.053550299257040024,
0.008883660659193993,
0... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "1234"}}, "targets": [{"_type": "Name", "_fields": {"id": "app_id", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {... | class TestExportInstanceGenerationWithInferredSchema(SimpleTestCase):
app_id = '1234'
case_type = 'inferred'
@classmethod
def setUpClass(cls):
super(TestExportInstanceGenerationWithInferredSchema, cls).setUpClass()
cls.schema = CaseExportDataSchema(
app_id=cls.app_id,
... | |
10,039 | [
0.024313487112522125,
0.0004734552640002221,
0.0716249942779541,
-0.03690116107463837,
-0.010296943597495556,
0.0272165909409523,
0.009457765147089958,
-0.032047536224126816,
-0.0378083810210228,
-0.0028279738035053015,
0.0362887866795063,
-0.04023519158363342,
0.0035580021794885397,
-0.00... | 15 | {"_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 setUpClass(cls):
super(TestExportInstanceGenerationWithInferredSchema, cls).setUpClass()
cls.schema = CaseExportDataSchema(
app_id=cls.app_id,
case_type=cls.case_type,
group_schemas=[
ExportGroupSchema(
path=MAIN_TABLE,
... | |
10,040 | [
-0.025858355686068535,
0.0055279419757425785,
0.0235828198492527,
-0.029099270701408386,
-0.0013647465966641903,
0.01791696809232235,
-0.006705933716148138,
0.024847006425261497,
-0.0011693723499774933,
-0.010320357047021389,
0.009366471320390701,
-0.021192358806729317,
0.003186324145644903,... | 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 TestExportInstanceDefaultFilters(SimpleTestCase):
def test_default_form_values(self):
# Confirm that FormExportInstances set the default user_types filter correctly
form_export = FormExportInstance()
form_export_wrapped = FormExportInstance.wrap({})
for e in [form_export, form... | |
10,041 | [
0.004494903143495321,
-0.02203534170985222,
0.09771477431058884,
-0.03727969527244568,
-0.030347228050231934,
-0.00040306756272912025,
0.024617332965135574,
-0.017566965892910957,
-0.037586234509944916,
-0.0009527720976620913,
0.006525715347379446,
-0.03900102153420448,
-0.017602335661649704... | 15 | {"_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 setUpClass(cls):
super(TestExportInstanceGenerationMultipleApps, cls).setUpClass()
cls.app_id = '1234'
cls.second_app_id = '5678'
cls.schema = FormExportDataSchema(
group_schemas=[
ExportGroupSchema(
path=MAIN_TABLE,
... | |
10,042 | [
0.0012214247835800052,
-0.014325962401926517,
0.07412785291671753,
-0.03671536222100258,
-0.007575448136776686,
0.030348267406225204,
0.021366946399211884,
0.025863416492938995,
-0.02099514566361904,
-0.03065035678446293,
0.013826354406774044,
-0.02807098627090454,
0.024724775925278664,
-0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestExportInstance(SimpleTestCase):
def setUp(self):
self.instance = FormExportInstance(
tables=[
TableConfiguration(
path=MAIN_TABLE
),
TableConfiguration(
path=[PathNode(name='data', is_repeat=False)... | |
10,043 | [
0.012198053300380707,
-0.0084926076233387,
0.0848800390958786,
-0.03452279418706894,
-0.03385535255074501,
0.025730988010764122,
0.04197971522808075,
0.04538596421480179,
-0.06140454113483429,
-0.018320094794034958,
0.004948267247527838,
0.0010069147683680058,
0.013901177793741226,
-0.0210... | 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 setUp(self):
self.instance = FormExportInstance(
tables=[
TableConfiguration(
path=MAIN_TABLE
),
TableConfiguration(
path=[PathNode(name='data', is_repeat=False), PathNode(name='repeat', is_repeat=True)],
... | |
10,044 | [
0.013678896240890026,
0.0207071453332901,
0.08896764367818832,
-0.03590862452983856,
0.012387745082378387,
0.06041613966226578,
0.0005283367354422808,
-0.01076771505177021,
0.011729988269507885,
-0.014287929981946945,
0.013861606828868389,
-0.02789374254643917,
0.0461403913795948,
0.002303... | 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_get_table(self):
table = self.instance.get_table(MAIN_TABLE)
self.assertEqual(table.path, MAIN_TABLE)
table = self.instance.get_table([
PathNode(name='data', is_repeat=False), PathNode(name='repeat', is_repeat=True)
])
self.assertEqual(
table.pat... | |
10,045 | [
0.00908145122230053,
-0.019321974366903305,
0.0854753777384758,
-0.046979401260614395,
-0.007533967029303312,
0.04263904690742493,
0.022638892754912376,
-0.0009324979619123042,
-0.0417759083211422,
-0.017324425280094147,
0.011818833649158478,
-0.027225857600569725,
0.008569733239710331,
-0... | 15 | {"_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 setUpClass(cls):
super(TestExportInstanceFromSavedInstance, cls).setUpClass()
cls.app_id = '1234'
cls.schema = FormExportDataSchema(
group_schemas=[
ExportGroupSchema(
path=MAIN_TABLE,
items=[
ExportI... | |
10,046 | [
0.01787198707461357,
-0.0013372525572776794,
0.06549466401338577,
-0.023901235312223434,
0.004536919761449099,
0.008654309436678886,
0.03020617552101612,
0.013436953537166119,
-0.04643600061535835,
-0.0037817652337253094,
0.013760590925812721,
-0.0434393584728241,
-0.010458288714289665,
-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": "build_ids_and_versions", "annotation": null, "type_comment": null... | def _get_instance(self, build_ids_and_versions):
with mock.patch(
'corehq.apps.export.models.new.get_latest_app_ids_and_versions',
return_value=build_ids_and_versions):
instance = FormExportInstance.generate_instance_from_schema(self.schema)
instance.save()
... | |
10,047 | [
0.016165481880307198,
0.0009751390316523612,
0.05051290616393089,
-0.022564083337783813,
0.016109157353639603,
0.01826079934835434,
0.030438419431447983,
0.02159528248012066,
-0.06204841658473015,
0.009817573241889477,
0.014915050938725471,
-0.04208657890558243,
-0.0423569418489933,
-0.010... | 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": "build_ids_and_versions", "annotation": null, "type_comment": null... | def _update_instance(self, build_ids_and_versions, instance):
with mock.patch(
'corehq.apps.export.models.new.get_latest_app_ids_and_versions',
return_value=build_ids_and_versions):
instance = FormExportInstance.generate_instance_from_schema(
self.new_... | |
10,048 | [
0.043761707842350006,
-0.016169777140021324,
0.030157271772623062,
-0.05516064539551735,
0.02052273228764534,
0.02702314406633377,
0.026210593059659004,
0.004709897097200155,
-0.03763274848461151,
0.0012877491535618901,
0.04729050397872925,
-0.03675054758787155,
-0.010412268340587616,
-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": "_", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def test_copy_instance(self, _):
build_ids_and_versions = {
self.app_id: 3,
}
with mock.patch(
'corehq.apps.export.models.new.get_latest_app_ids_and_versions',
return_value=build_ids_and_versions):
instance = FormExportInstance.generate_ins... | |
10,049 | [
0.04631367698311806,
0.038516346365213394,
0.05232876166701317,
0.0026176758110523224,
-0.02315683849155903,
-0.0063616326078772545,
0.009474377147853374,
0.00575517350807786,
-0.04166002944111824,
0.021213693544268608,
-0.015074841678142548,
-0.005971766076982021,
0.008051054552197456,
0.... | 11 | {"_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
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name", models.CharField(max_length=255)),
("slug", models.SlugField(null=True))... | |
10,050 | [
-0.0006765531725250185,
0.0046278308145701885,
0.041640911251306534,
-0.015207096934318542,
0.00262169330380857,
-0.007093243300914764,
-0.017044195905327797,
-0.009038781747221947,
0.05217871442437172,
0.05276556685566902,
0.03482833504676819,
-0.03837495669722557,
-0.003664629766717553,
... | 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 CFuncPtrTestCase(unittest.TestCase):
def test_basic(self):
X = WINFUNCTYPE(c_int, c_int, c_int)
def func(*args):
return len(args)
x = X(func)
self.assertEqual(x.restype, c_int)
self.assertEqual(x.argtypes, (c_int, c_int))
self.assertEqual(sizeof(x)... | |
10,051 | [
0.03019898571074009,
0.00744407344609499,
0.022214805707335472,
-0.0010310453362762928,
0.0023189345374703407,
-0.023377209901809692,
-0.003381534945219755,
0.0035341738257557154,
0.03405017778277397,
0.06086762994527817,
0.0037044247146695852,
-0.02573723904788494,
0.000860060565173626,
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_basic(self):
X = WINFUNCTYPE(c_int, c_int, c_int)
def func(*args):
return len(args)
x = X(func)
self.assertEqual(x.restype, c_int)
self.assertEqual(x.argtypes, (c_int, c_int))
self.assertEqual(sizeof(x), sizeof(c_voidp))
self.assertEqual(siz... | |
10,052 | [
0.046030618250370026,
-0.019457021728157997,
0.030258066952228546,
-0.0028406367637217045,
0.005772754549980164,
-0.0023169880732893944,
0.016908178105950356,
0.0000823130103526637,
0.05155732110142708,
0.03495197743177414,
0.011116495355963707,
-0.03914116695523262,
-0.007312155794352293,
... | 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_first(self):
StdCallback = WINFUNCTYPE(c_int, c_int, c_int)
CdeclCallback = CFUNCTYPE(c_int, c_int, c_int)
def func(a, b):
return a + b
s = StdCallback(func)
c = CdeclCallback(func)
self.assertEqual(s(1, 2), 3)
self.assertEqual(c(1, 2), 3)
... | |
10,053 | [
-0.02175840735435486,
0.015449230559170246,
0.0516413077712059,
-0.02314211055636406,
0.016299763694405556,
0.012231170199811459,
0.00827047973871231,
-0.027369385585188866,
-0.01965111680328846,
0.022799357771873474,
0.024665452539920807,
0.00753419753164053,
0.016896406188607216,
0.02861... | 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_structures(self):
WNDPROC = WINFUNCTYPE(c_long, c_int, c_int, c_int, c_int)
def wndproc(hwnd, msg, wParam, lParam):
return hwnd + msg + wParam + lParam
HINSTANCE = c_int
HICON = c_int
HCURSOR = c_int
LPCTSTR = c_char_p
class WNDCLASS(Struct... | |
10,054 | [
0.04729222506284714,
0.0018788459710776806,
0.025686265900731087,
-0.003001851961016655,
0.035149626433849335,
-0.04269573837518692,
0.00686400942504406,
0.014870996586978436,
0.027406876906752586,
0.040631003677845,
0.03419100120663643,
-0.020733363926410675,
-0.021814892068505287,
0.0327... | 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_dllfunctions(self):
def NoNullHandle(value):
if not value:
raise WinError()
return value
strchr = lib.my_strchr
strchr.restype = c_char_p
strchr.argtypes = (c_char_p, c_char)
self.assertEqual(strchr("abcdefghi", "b"), "bcdefghi")... | |
10,055 | [
-0.00426114397123456,
0.028155697509646416,
0.02662157267332077,
-0.05504800006747246,
-0.054777272045612335,
0.029373973608016968,
-0.03133675083518028,
-0.0063169836066663265,
-0.017292741686105728,
0.047061529010534286,
0.005191770847886801,
-0.06709539145231247,
0.019142717123031616,
0... | 15 | {"_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": "options", "annotation": null, "type_comment": null}}], "kwarg": n... | def handle_inspection(self, options):
connection = connections[options['database']]
# 'table_name_filter' is a stealth option
table_name_filter = options.get('table_name_filter')
table2model = lambda table_name: re.sub(r'[^a-zA-Z0-9]', '', table_name.title())
strip_prefix = lamb... | |
10,056 | [
0.029538458213210106,
0.015555423684418201,
0.014668147079646587,
-0.006474874913692474,
-0.022608714178204536,
0.015139863826334476,
0.04148861765861511,
-0.05593213811516762,
-0.021137407049536705,
-0.0008964023436419666,
0.0200816597789526,
-0.047755710780620575,
0.02749435231089592,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mcs", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def __new__(mcs, name, bases, attrs):
meta_class = attrs.pop('Meta', None)
cls = super(BaseBlock, mcs).__new__(mcs, name, bases, attrs)
# Get all the Meta classes from all the bases
meta_class_bases = [meta_class] + [getattr(base, '_meta_class', None)
... | |
10,057 | [
0.013936681672930717,
0.011283623054623604,
-0.006074964068830013,
-0.012918774038553238,
-0.03465219959616661,
0.00669762073084712,
0.030688855797052383,
-0.05184835568070412,
-0.01660056971013546,
-0.02354183979332447,
0.006210324354469776,
-0.04253557696938515,
0.03198831155896187,
0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mcs", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": nu... | class BaseBlock(type):
def __new__(mcs, name, bases, attrs):
meta_class = attrs.pop('Meta', None)
cls = super(BaseBlock, mcs).__new__(mcs, name, bases, attrs)
# Get all the Meta classes from all the bases
meta_class_bases = [meta_class] + [getattr(base, '_meta_class', None)
... | |
10,058 | [
0.04629649966955185,
0.01626783050596714,
0.028493551537394524,
-0.01080656610429287,
-0.008967737667262554,
-0.013296990655362606,
0.009878869168460369,
-0.04441901668906212,
-0.0336400605738163,
0.0347665511071682,
-0.014025894924998283,
0.015561012551188469,
-0.004817950073629618,
-0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, **kwargs):
if 'classname' in self._constructor_args[1]:
# Adding this so that migrations are not triggered
# when form_classname is used instead of classname
# in the initialisation of the FieldBlock
classname = self._constructor_args[1].pop('cl... | |
10,059 | [
0.038434021174907684,
0.032212212681770325,
-0.0083619374781847,
-0.01771671697497368,
0.01000012643635273,
0.04383949562907219,
-0.044744085520505905,
0.007992379367351532,
0.01033107377588749,
0.011373558081686497,
-0.000015448520571226254,
-0.07126400619745255,
0.034264083951711655,
-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 deconstruct(self):
# adapted from django.utils.deconstruct.deconstructible
module_name = self.__module__
name = self.__class__.__name__
# Make sure it's actually there and not an inner class
module = import_module(module_name)
if not hasattr(module, name):
... | |
10,060 | [
0.04603533819317818,
0.04162546619772911,
-0.004920274950563908,
0.00929806474596262,
-0.02536260150372982,
0.027322545647621155,
0.016997843980789185,
-0.04521869495511055,
-0.022714344784617424,
0.028139188885688782,
0.025455933064222336,
-0.0427454337477684,
0.022317688912153244,
-0.008... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mcs", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def __new__(mcs, name, bases, attrs):
# Collect sub-blocks declared on the current class.
# These are available on the class as `declared_blocks`
current_blocks = []
for key, value in list(attrs.items()):
if isinstance(value, Block):
current_blocks.append((key... | |
10,061 | [
0.0415533073246479,
-0.00762418145313859,
-0.00495875533670187,
0.019916022196412086,
0.01002382393926382,
-0.049410365521907806,
-0.03551876172423363,
-0.044266827404499054,
0.08391661942005157,
0.02134365774691105,
0.020675402134656906,
0.028633711859583855,
-0.007958308793604374,
-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 render_with_errors(self, name, value, attrs=None, errors=None, renderer=None):
value_json = json.dumps(self.block_def.get_form_state(value))
if errors:
errors_json = json.dumps(self.js_context.pack(errors.as_data()))
else:
errors_json = '[]'
return format_ht... | |
10,062 | [
0.02158106490969658,
0.0039536901749670506,
0.008473061956465244,
0.017980165779590607,
0.01444009318947792,
-0.05479206144809723,
0.02385595813393593,
-0.016435185447335243,
0.02308955043554306,
-0.015218665823340416,
0.010973011143505573,
-0.010510733351111412,
-0.0009085884084925056,
-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 media(self):
return self.js_context.media + forms.Media(
js=[
# needed for initBlockWidget, although these will almost certainly be
# pulled in by the block adapters too
versioned_static('wagtailadmin/js/telepath/telepath.js'),
vers... | |
10,063 | [
0.017707528546452522,
0.000003038809381905594,
-0.010683305561542511,
0.007110378704965115,
0.011362414807081223,
-0.042854852974414825,
0.01837650127708912,
-0.03819230943918228,
0.01973472163081169,
0.06166720390319824,
-0.008154382929205894,
0.010100487619638443,
-0.009659573435783386,
... | 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": "block", "annotation": null, "type_comment": null}}], "kwarg": {"_... | def __init__(self, block=None, **kwargs):
if block is None:
raise ImproperlyConfigured("BlockField was not passed a 'block' object")
self.block = block
if 'widget' not in kwargs:
kwargs['widget'] = BlockWidget(block)
super().__init__(**kwargs) | |
10,064 | [
0.07209891825914383,
-0.005621944088488817,
0.02206217683851719,
-0.05778956040740013,
-0.0008174105314537883,
0.05544301122426987,
-0.004503306932747364,
-0.01735757291316986,
0.015597660094499588,
0.08065692335367203,
0.00939770508557558,
-0.031011275947093964,
0.02008371241390705,
-0.00... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "commands", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg"... | def diff_config(commands, config):
config = [str(c).replace("'", '') for c in config.splitlines()]
updates = list()
visited = set()
for line in commands:
item = str(line).replace("'", '')
if not item.startswith('set') and not item.startswith('delete'):
raise ValueError('li... | |
10,065 | [
0.03291803225874901,
-0.01564975269138813,
0.03339407220482826,
-0.07426194101572037,
-0.011799793690443039,
0.008056944236159325,
0.00786057859659195,
0.005007325671613216,
-0.011972357518970966,
0.04931754618883133,
0.031156692653894424,
-0.0016215047799050808,
0.04151052236557007,
0.015... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def config_to_commands(config):
set_format = config.startswith('set') or config.startswith('delete')
candidate = NetworkConfig(indent=4, contents=config)
if not set_format:
candidate = [c.line for c in candidate.items]
commands = list()
# this filters out less specific lines
... | |
10,066 | [
0.06851101666688919,
0.05154772475361824,
0.014637297950685024,
-0.07753303647041321,
-0.00148825254291296,
0.03225844353437424,
0.030073421075940132,
0.02002936787903309,
0.008980910293757915,
0.08138619363307953,
0.008616739884018898,
-0.013803230598568916,
-0.023189427331089973,
0.02880... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "result", "annotation": null, "type_comment": null}}], "kwarg": ... | def run(module, result):
# get the current active config from the node or passed in via
# the config param
config = module.params['config'] or get_config(module)
# create the candidate config object from the arguments
candidate = get_candidate(module)
# create loadable config that includes onl... | |
10,067 | [
-0.0005591692170128226,
0.03573958948254585,
-0.0034694329369813204,
-0.05475503206253052,
-0.03543250635266304,
0.0723768025636673,
0.01182855200022459,
-0.014149380847811699,
0.023905130103230476,
0.06136910244822502,
0.011108091101050377,
-0.05607784539461136,
0.06500683724880219,
0.009... | 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():
argument_spec = dict(
src=dict(type='path'),
lines=dict(type='list'),
match=dict(default='line', choices=['line', 'none']),
comment=dict(default=DEFAULT_COMMENT),
config=dict(),
backup=dict(type='bool', default=False),
save=dict(type='bool', de... | |
10,068 | [
0.004737567156553268,
0.02457575872540474,
0.050772421061992645,
-0.024206288158893585,
0.009081827476620674,
-0.032346561551094055,
-0.0013452903367578983,
0.03153610974550247,
-0.00224810978397727,
-0.008801744319498539,
0.005548018962144852,
-0.041190020740032196,
-0.009022234939038754,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _print_report(self, cr, uid, ids, data, context=None):
if context is None:
context = {}
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['sort_selection'], context=context)[0])
if context.get('sale_purchase_onl... | |
10,069 | [
0.016857177019119263,
0.0019258870743215084,
0.037365447729825974,
0.015018682926893234,
-0.027422042563557625,
0.005758240818977356,
0.003476307261735201,
-0.022282028570771217,
-0.009749196469783783,
-0.014410167001187801,
0.03519032895565033,
-0.04440869018435478,
0.01077849417924881,
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": "logger", "annotation":... | class ColorBar(Callback.Callbacks):
def __init__(self, logger, rgbmap=None, link=False, settings=None):
Callback.Callbacks.__init__(self)
self.logger = logger
self.link_rgbmap = link
if not rgbmap:
rgbmap = RGBMap.RGBMapper(logger)
# Create settings and set defa... | |
10,070 | [
0.04214281588792801,
0.029875781387090683,
0.02796127460896969,
0.029497608542442322,
-0.012314305640757084,
0.049257222563028336,
-0.008048024959862232,
-0.029001254588365555,
-0.01745511405169964,
0.022335929796099663,
-0.007486672606319189,
-0.00699622742831707,
0.03907014802098274,
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": "canvas", "annotation": null, "type_comment": null}}, {"_type": "a... | def cursor_drag_cb(self, canvas, event, data_x, data_y):
x, y = event.viewer.get_last_win_xy()
wd, ht = event.viewer.get_window_size()
dx = x - self._start_x
pct = float(dx) / float(wd)
self.shift_colormap(pct)
return True | |
10,071 | [
0.03811478987336159,
-0.004825281444936991,
0.044080380350351334,
0.008983205072581768,
-0.0706585943698883,
0.00012150249676778913,
0.044080380350351334,
-0.02748350240290165,
-0.013822994194924831,
0.011089731939136982,
0.029572619125247,
-0.038486186414957047,
0.0024721224326640368,
-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": "logger", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, logger, rgbmap=None, link=False, settings=None):
Callback.Callbacks.__init__(self)
self.logger = logger
self.link_rgbmap = link
if not rgbmap:
rgbmap = RGBMap.RGBMapper(logger)
# Create settings and set defaults
if settings is None:
... | |
10,072 | [
0.019955409690737724,
0.043529678136110306,
-0.008142427541315556,
0.021157387644052505,
-0.024685773998498917,
0.021428802981972694,
0.0014402726665139198,
-0.03362951800227165,
-0.012911563739180565,
0.03833403438329697,
0.039833273738622665,
-0.016052214428782463,
-0.0008186855702660978,
... | 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": "canvas", "annotation": null, "type_comment": null}}, {"_type": "a... | def none_move_cb(self, canvas, event, data_x, data_y):
x, y = event.viewer.get_last_win_xy()
wd, ht = event.viewer.get_window_size()
dist = self.rgbmap.get_dist()
pct = float(x) / float(wd)
rng_pct = dist.get_dist_pct(pct)
loval, hival = event.viewer.get_cut_levels()
... | |
10,073 | [
0.03583777695894241,
0.023620354011654854,
0.04850500077009201,
0.03389271721243858,
-0.04437174275517464,
0.035570330917835236,
-0.01456365641206503,
-0.06024831533432007,
-0.038755372166633606,
0.007056930102407932,
-0.0006678554927930236,
-0.037077754735946655,
0.0008775575552135706,
0.... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "viewer", "annotation": null, "type_comment": null}}, {"_type": "a... | def scroll_cb(self, viewer, event):
direction = event.direction
if (direction < 90.0) or (direction > 270.0):
# up
scale_factor = 1.1
else:
# not up!
scale_factor = 0.9
self.stretch_colormap(scale_factor)
self.make_callback('scrol... | |
10,074 | [
0.022777961567044258,
0.008042399771511555,
-0.010693741030991077,
-0.06113402545452118,
0.002831042744219303,
0.011606980115175247,
0.024651575833559036,
0.03603466600179672,
0.01932532712817192,
0.0320281945168972,
0.02013840526342392,
-0.043529123067855835,
-0.009857095777988434,
0.0217... | 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_convert_from_dict_to_list(self):
old_mixed_setting = self.OLD_MIXED_CONFIG_WITH_DICT
new_mixed_setting, new_default_store_setting = self.assertMigrated(old_mixed_setting)
self.assertEqual(new_default_store_setting["ENGINE"], "the_default_store")
self.assertTrue(self.is_split_con... | |
10,075 | [
0.012630198150873184,
0.03586074337363243,
0.025119435042142868,
-0.019692396745085716,
0.009056811220943928,
0.012200264260172844,
0.02724796161055565,
0.016168344765901566,
0.012305986136198044,
0.043444499373435974,
0.015900516882538795,
-0.021383941173553467,
-0.005113397724926472,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "term", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "nick", "annotation": null, "type_comment": null}}], "kwarg": null... | def do_term(term, nick):
w("// %s\n" % term)
w("var %s_keys = []string{\n\t" % nick)
for k, v in iter_pairs(keys):
w('"')
w(escaped(tput(term, v)))
w('",')
w("\n}\n")
w("var %s_funcs = []string{\n\t" % nick)
for k,v in iter_pairs(funcs):
w('"')
if v == "sgr":
w("\\033[3%d;4%dm")
elif v == "cup":
... | |
10,076 | [
-0.004647250287234783,
0.026190856471657753,
0.050695087760686874,
-0.01791435293853283,
0.014878429472446442,
0.028528034687042236,
-0.029395440593361855,
-0.006210389081388712,
0.01045706681907177,
0.039732035249471664,
0.018456481397151947,
-0.020902086049318314,
0.031033875420689583,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "d", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def do_terms(d):
w("var terms = []struct {\n")
w("\tname string\n")
w("\tkeys []string\n")
w("\tfuncs []string\n")
w("}{\n")
for k, v in d.items():
w('\t{"%s", %s_keys, %s_funcs},\n' % (k, v, v))
w("}\n\n") | |
10,077 | [
0.08974791318178177,
0.016711991280317307,
-0.04747109115123749,
-0.03274647146463394,
-0.004468764178454876,
0.00714211817830801,
0.014024523086845875,
0.012590453028678894,
0.013889020308852196,
-0.030126752331852913,
0.0529363639652729,
-0.008587479591369629,
-0.0017629456706345081,
-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 == 'Key':
self.key = value
elif name == 'VersionId':
self.version_id = value
elif name == 'DeleteMarker':
if value.lower() == 'true':
self.delete_marker = True
elif name == 'DeleteM... | |
10,078 | [
0.08744488656520844,
-0.004004656802862883,
-0.0440242774784565,
-0.02291763201355934,
0.020524539053440094,
-0.03210193291306496,
-0.011555833742022514,
-0.014121401123702526,
0.0030210097320377827,
-0.05954703688621521,
0.027876291424036026,
-0.019597485661506653,
0.013259025290608406,
-... | 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 endElement(self, name, value, connection):
if name == 'Key':
self.key = value
elif name == 'VersionId':
self.version_id = value
elif name == 'Code':
self.code = value
elif name == 'Message':
self.message = value
else:
... | |
10,079 | [
0.055413875728845596,
0.0026243366301059723,
-0.013260469771921635,
-0.006349506787955761,
-0.0014036415377631783,
0.029574254527688026,
-0.03694258630275726,
0.014004873111844063,
0.010844314470887184,
0.005636645946651697,
0.016629209741950035,
-0.04978669434785843,
0.037472497671842575,
... | 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 startElement(self, name, attrs, connection):
if name == 'Deleted':
d = Deleted()
self.deleted.append(d)
return d
elif name == 'Error':
e = Error()
self.errors.append(e)
return e
return None | |
10,080 | [
0.01565147377550602,
0.03439221531152725,
0.05676525458693504,
-0.015204979106783867,
-0.034537024796009064,
-0.026017408818006516,
-0.0007248008041642606,
-0.060433756560087204,
-0.018680403009057045,
-0.007168061565607786,
0.003846497507765889,
-0.029179077595472336,
0.018595930188894272,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "project", "annotation"... | class _Generate(object):
def __init__(self, project, resource, offset):
self.project = project
self.resource = resource
self.info = self._generate_info(project, resource, offset)
self.name = self.info.get_name()
self._check_exceptional_conditions()
def _generate_info(se... | |
10,081 | [
0.040432408452034,
0.03760743513703346,
0.04499776288866997,
-0.011886321008205414,
-0.03268896043300629,
-0.022170983254909515,
0.025903981178998947,
-0.0727430209517479,
0.011091797612607479,
0.00487749045714736,
0.03727953881025314,
-0.007459691260010004,
0.004149177111685276,
0.0425763... | 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 get_changes(self):
changes = change.ChangeSet('Generate %s <%s>' %
(self._get_element_kind(), self.name))
indents = self.info.get_scope_indents()
blanks = self.info.get_blank_lines()
base_definition = sourceutils.fix_indentation(self._get_element(),... | |
10,082 | [
0.03596138209104538,
0.0021251391153782606,
-0.007161800749599934,
-0.0004323066386859864,
0.004908772185444832,
0.008549535647034645,
-0.02087588608264923,
-0.031172335147857666,
-0.008369945921003819,
0.07544924318790436,
0.00007478633051505312,
-0.017860963940620422,
0.04841290041804314,
... | 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 _get_element(self):
decorator = ''
args = []
if self.info.is_static_method():
decorator = '@staticmethod\n'
if self.info.is_method() or self.info.is_constructor() or \
self.info.is_instance():
args.append('self')
args.extend(self.info.get_pa... | |
10,083 | [
0.026255790144205093,
0.022667350247502327,
0.032407402992248535,
-0.015847085043787956,
-0.0093611478805542,
-0.017897622659802437,
-0.03309834375977516,
-0.04263779893517494,
-0.009528310969471931,
0.010430993512272835,
-0.005995592102408409,
-0.039049360901117325,
0.04734066128730774,
-... | 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": "project", "annotation"... | class GenerateFunction(_Generate):
def _generate_info(self, project, resource, offset):
return _FunctionGenerationInfo(project.pycore, resource, offset)
def _get_element(self):
decorator = ''
args = []
if self.info.is_static_method():
decorator = '@staticmethod\n'
... | |
10,084 | [
0.008094921708106995,
0.0201279129832983,
0.07754968851804733,
-0.014776177704334259,
-0.04232022911310196,
0.0032396516762673855,
-0.009962980635464191,
-0.055110540241003036,
-0.013901051133871078,
0.00614271592348814,
-0.011724453419446945,
-0.024144520983099937,
-0.007242234423756599,
... | 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 GenerateModule(_Generate):
def get_changes(self):
package = self.info.get_package()
changes = change.ChangeSet('Generate Module <%s>' % self.name)
new_resource = self.project.get_file('%s/%s.py' % (package.path, self.name))
if new_resource.exists():
raise exception... | |
10,085 | [
0.018027491867542267,
0.03467583283782005,
0.06151457503437996,
-0.028064657002687454,
-0.008855034597218037,
0.002522973343729973,
-0.006540028378367424,
-0.021606720983982086,
0.0009344852296635509,
-0.004134720657020807,
0.016374697908759117,
-0.0065181371755898,
-0.00499942759051919,
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 get_changes(self):
package = self.info.get_package()
changes = change.ChangeSet('Generate Module <%s>' % self.name)
new_resource = self.project.get_file('%s/%s.py' % (package.path, self.name))
if new_resource.exists():
raise exceptions.RefactoringError(
'M... | |
10,086 | [
0.017224274575710297,
0.005871386732906103,
0.07934025675058365,
-0.013908804394304752,
-0.03888458013534546,
-0.021082697436213493,
-0.017455318942666054,
-0.06404519081115723,
-0.0150293642655015,
0.009397684596478939,
-0.0007368113729171455,
-0.005735648795962334,
0.013354300521314144,
... | 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 GeneratePackage(_Generate):
def get_changes(self):
package = self.info.get_package()
changes = change.ChangeSet('Generate Package <%s>' % self.name)
new_resource = self.project.get_folder('%s/%s' % (package.path, self.name))
if new_resource.exists():
raise exceptio... | |
10,087 | [
0.02591586485505104,
0.024601949378848076,
0.05962461233139038,
-0.020263759419322014,
-0.004745956044644117,
-0.01037540752440691,
-0.005080098751932383,
-0.024760525673627853,
-0.011587382294237614,
0.0009033174137584865,
0.016944989562034607,
0.006427995394915342,
0.009486248716711998,
... | 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 get_changes(self):
package = self.info.get_package()
changes = change.ChangeSet('Generate Package <%s>' % self.name)
new_resource = self.project.get_folder('%s/%s' % (package.path, self.name))
if new_resource.exists():
raise exceptions.RefactoringError(
'P... | |
10,088 | [
0.02108008600771427,
0.0684388130903244,
0.01695088855922222,
-0.022530600428581238,
0.031085452064871788,
-0.00867131631821394,
0.0004360803868621588,
-0.0010170798050239682,
0.01103237085044384,
0.003036019392311573,
0.015330972149968147,
-0.01734263263642788,
0.007003755308687687,
0.020... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "pycore", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "resource", "annotation": null, "type_comment": null}}, {"_type"... | def _add_import_to_module(pycore, resource, imported):
pymodule = pycore.resource_to_pyobject(resource)
import_tools = importutils.ImportTools(pycore)
module_imports = import_tools.module_imports(pymodule)
module_name = pycore.modname(imported)
new_import = importutils.NormalImport(((module_name, No... | |
10,089 | [
0.0324324369430542,
0.0490507110953331,
0.04753996059298515,
-0.015436476096510887,
0.013840438798069954,
-0.02492741122841835,
-0.009795522317290306,
-0.02101651206612587,
-0.016398971900343895,
-0.02136983349919319,
0.029605869203805923,
-0.04030296951532364,
0.030946051701903343,
-0.022... | 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": "pycore", "annotation":... | class _GenerationInfo(object):
def __init__(self, pycore, resource, offset):
self.pycore = pycore
self.resource = resource
self.offset = offset
self.source_pymodule = self.pycore.resource_to_pyobject(resource)
finder = rope.base.evaluate.ScopeNameFinder(self.source_pymodule)... | |
10,090 | [
0.03252613544464111,
0.05189864709973335,
0.023309649899601936,
0.007365357130765915,
0.04142943397164345,
-0.04328615590929985,
-0.0020594478119164705,
0.01436160784214735,
0.001585481222718954,
-0.008690785616636276,
0.02120685949921608,
-0.028812695294618607,
0.04377829656004906,
-0.053... | 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": "pycore", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, pycore, resource, offset):
self.pycore = pycore
self.resource = resource
self.offset = offset
self.source_pymodule = self.pycore.resource_to_pyobject(resource)
finder = rope.base.evaluate.ScopeNameFinder(self.source_pymodule)
self.primary, self.pyname =... | |
10,091 | [
0.007327644620090723,
0.010646020993590355,
0.00886121578514576,
-0.03868996351957321,
0.0011704603675752878,
-0.05007921904325485,
-0.01025870256125927,
0.0014432843308895826,
0.0279287938028574,
-0.01880064234137535,
-0.016926858574151993,
-0.04139072448015213,
0.014655289240181446,
-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 _get_goal_scope(self):
if self.primary is None:
return self._get_source_scope()
pyobject = self.primary.get_object()
if isinstance(pyobject, pyobjects.PyDefinedObject):
return pyobject.get_scope()
elif isinstance(pyobject.get_type(), pyobjects.PyClass):
... | |
10,092 | [
0.04385404288768768,
0.026873592287302017,
0.06584341824054718,
-0.06293366849422455,
-0.04235760122537613,
-0.007960236631333828,
0.023568950593471527,
0.0010294528910890222,
-0.01968236081302166,
-0.027559461072087288,
0.003325425088405609,
-0.023028569296002388,
0.02125154435634613,
-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 get_insertion_offsets(self):
if self.goal_scope.get_kind() == 'Class':
start, end = sourceutils.get_body_region(self.goal_scope.pyobject)
if self.goal_pymodule.source_code[start:end].strip() == 'pass':
return start, end
lines = self.goal_pymodule.lines
... | |
10,093 | [
0.0035287023056298494,
0.04515819996595383,
0.04233293980360031,
-0.06468234956264496,
-0.01936335861682892,
-0.01743391342461109,
-0.01493022870272398,
-0.013632447458803654,
-0.02871197834610939,
-0.009601285681128502,
0.0035832549910992384,
-0.024485575035214424,
0.012851481325924397,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_insertion_lineno(self):
lines = self.goal_pymodule.lines
if self.goal_scope == self.source_scope:
line_finder = self.goal_pymodule.logical_lines
lineno = lines.get_line_number(self.offset)
lineno = line_finder.logical_line_in(lineno)[0]
root = suit... | |
10,094 | [
0.006928866263478994,
-0.0005981639842502773,
0.02879873849451542,
-0.019049271941184998,
0.04627419635653496,
-0.06103125214576721,
-0.02350500226020813,
-0.003776129800826311,
-0.013724877499043941,
0.010010065510869026,
-0.011456133797764778,
-0.020970551297068596,
0.029289277270436287,
... | 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 get_package(self):
primary = self.primary
if self.primary is None:
return self.pycore.get_source_folders()[0]
if isinstance(primary.get_object(), pyobjects.PyPackage):
return primary.get_object().get_resource()
raise exceptions.RefactoringError(
'A... | |
10,095 | [
0.008469333872199059,
0.03935020789504051,
0.05279713124036789,
-0.034793607890605927,
-0.0032069552689790726,
-0.011552467942237854,
0.007299228571355343,
-0.03457073122262955,
0.010326643474400043,
0.04613558202981949,
-0.018597863614559174,
-0.04727473109960556,
-0.012202526442706585,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_blank_lines(self):
if self.goal_scope.get_kind() == 'Module':
base_blanks = 2
if self.goal_pymodule.source_code.strip() == '':
base_blanks = 0
if self.goal_scope.get_kind() == 'Class':
base_blanks = 1
if self.goal_scope.get_kind() == 'F... | |
10,096 | [
0.02097424864768982,
0.018241118639707565,
-0.00016038163448683918,
-0.02972026728093624,
-0.025934375822544098,
-0.042272426187992096,
-0.03324297070503235,
-0.008290496654808521,
0.013463200069963932,
-0.02362639829516411,
-0.017856454476714134,
-0.04389205574989319,
0.020954003557562828,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _get_goal_scope(self):
if self.is_constructor():
return self.pyname.get_object().get_scope()
if self.is_instance():
return self.pyname.get_object().get_type().get_scope()
if self.primary is None:
return self._get_source_scope()
pyobject = self.prim... | |
10,097 | [
0.0347554050385952,
0.021165922284126282,
-0.005995006766170263,
-0.030305752530694008,
-0.036198537796735764,
-0.011003874242305756,
-0.03542886674404144,
-0.03934937343001366,
0.010883613489568233,
-0.004170047584921122,
0.004242204129695892,
-0.06248757615685463,
0.02770811691880226,
0.... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class _FunctionGenerationInfo(_GenerationInfo):
def _get_goal_scope(self):
if self.is_constructor():
return self.pyname.get_object().get_scope()
if self.is_instance():
return self.pyname.get_object().get_type().get_scope()
if self.primary is None:
return ... | |
10,098 | [
0.029472865164279938,
0.005726476665586233,
0.005126933567225933,
-0.044735997915267944,
-0.05284944176673889,
-0.03456057608127594,
-0.02808326855301857,
-0.006320416461676359,
-0.01461316179484129,
0.026424720883369446,
0.003678504843264818,
-0.03796732425689697,
0.034538161009550095,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_passed_args(self):
result = []
source = self.source_pymodule.source_code
finder = worder.Worder(source)
if finder.is_a_function_being_called(self.offset):
start, end = finder.get_primary_range(self.offset)
parens_start, parens_end = finder.get_word_parens_... | |
10,099 | [
-0.006902249995619059,
-0.006416175980120897,
0.032508622854948044,
-0.017589395865797997,
-0.009300214238464832,
0.013454526662826538,
0.0443040169775486,
0.013376754708588123,
0.012929566204547882,
0.07424617558717728,
0.014335940591990948,
-0.06180268153548241,
0.009092822670936584,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_00_in_not_in_m2m(self):
registry, cr, uid = self.registry, self.cr, self.uid
# Create 4 partners with no category, or one or two categories (out of two categories).
categories = registry('res.partner.category')
cat_a = categories.create(cr, uid, {'name': 'test_expression_categ... | |
10,100 | [
0.019950775429606438,
0.003093359060585499,
0.013139823451638222,
-0.028578806668519974,
0.02032160758972168,
0.02801019698381424,
0.04163210093975067,
0.004774465225636959,
-0.0006211440195329487,
0.017688699066638947,
0.03770127892494202,
-0.06561259180307388,
0.05522928386926651,
-0.002... | 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_10_expression_parse(self):
# TDE note: those tests have been added when refactoring the expression.parse() method.
# They come in addition to the already existing test_osv_expression.yml; maybe some tests
# will be a bit redundant
registry, cr, uid = self.registry, self.cr, self... |