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,701 | [
0.009983398020267487,
-0.002995334565639496,
0.028008978813886642,
-0.06751399487257004,
-0.021353380754590034,
0.030933408066630363,
0.05430363863706589,
0.004238532390445471,
0.056017957627773285,
0.003721715183928609,
-0.0033277994953095913,
0.009189264848828316,
-0.004351980052888393,
... | 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": "graph", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _SetupAndRunBenchmark(self, graph, inputs, repeats, format_args):
with graph.as_default():
add_n = math_ops.add_n(inputs)
acc_n_first = self._AccumulateNInitializedWithFirst(inputs)
acc_n_merge = self._AccumulateNInitializedWithMerge(inputs)
acc_n_shape = self._AccumulateNInitializedWith... | |
17,702 | [
0.0498158223927021,
-0.023367736488580704,
0.0752413347363472,
-0.05251744017004967,
-0.03512103855609894,
0.012037350796163082,
0.053729381412267685,
-0.0213730838149786,
0.009039059281349182,
-0.0028341743163764477,
-0.014518042095005512,
-0.0028720474801957607,
0.00972708873450756,
-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 benchmarkAccumulateN(self):
self._template = "{:<15}" * 6
args = {
"sizes": (128, 128**2),
"ninputs": (1, 10, 100, 300),
"repeats": 100
}
benchmarks = (("Replicated", self._GenerateReplicatedInputs),
("Unordered", self._GenerateUnorderedInputs),
... | |
17,703 | [
0.003714001039043069,
-0.012546457350254059,
0.02969120256602764,
-0.08589017391204834,
-0.0243854857981205,
0.03012814372777939,
0.03505933657288551,
-0.026965521275997162,
0.014960038475692272,
-0.0007477418403141201,
-0.021014796569943428,
0.0003077120054513216,
0.012577667832374573,
-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": "tag", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def _RunBenchmark(self, tag, input_fn, sizes, ninputs, repeats):
for size in sizes:
for ninput in ninputs:
graph = ops.Graph()
with graph.as_default():
inputs = input_fn(size, ninput)
format_args = (tag, size, ninput, repeats)
self._SetupAndRunBenchmark(graph, inputs... | |
17,704 | [
-0.009046620689332485,
0.030127789825201035,
-0.02726411260664463,
0.0062835258431732655,
-0.02299226075410843,
0.038363825529813766,
-0.007851448841392994,
0.038718827068805695,
0.06186491996049881,
-0.006271692458540201,
0.040020499378442764,
-0.03102712705731392,
-0.03479014337062836,
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 ShutdownTest(unittest.TestCase):
def setUp(self):
self.mox = mox.Mox()
self.mox.StubOutWithMock(os, 'abort')
shutdown._shutting_down = False
shutdown._num_terminate_requests = 0
self._sigint_handler = signal.getsignal(signal.SIGINT)
self._sigterm_handler = signal.getsignal(signal.SIGTER... | |
17,705 | [
0.0033551023807376623,
0.07047895342111588,
-0.004890910349786282,
0.011208595708012581,
-0.0334700271487236,
0.044311024248600006,
0.019625946879386902,
0.03820517659187317,
0.06305224448442459,
-0.020037157461047173,
0.06360052525997162,
-0.019301962107419968,
-0.017906339839100838,
0.03... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_async_terminate_abort(self):
os.abort()
self.mox.ReplayAll()
shutdown._async_terminate()
self.assertTrue(shutdown._shutting_down)
shutdown._async_terminate()
shutdown._async_terminate()
self.mox.VerifyAll() | |
17,706 | [
0.026645541191101074,
0.0312458835542202,
-0.013630219735205173,
0.0066329180262982845,
-0.026326706632971764,
0.008471915498375893,
0.015372428111732006,
0.04046934098005295,
0.04639057070016861,
-0.024094857275485992,
0.05064930394291878,
-0.01000915840268135,
-0.0512869730591774,
0.0167... | 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_wait_until_shutdown_raise_interrupted_io(self):
def quit_and_raise(*_):
shutdown.async_quit()
raise IOError
self.mox.StubOutWithMock(time, 'sleep')
time.sleep(1).WithSideEffects(quit_and_raise)
self.mox.ReplayAll()
shutdown.wait_until_shutdown()
self.mox.VerifyAll() | |
17,707 | [
0.0613061860203743,
-0.01036346610635519,
-0.028903868049383163,
-0.01334825623780489,
-0.00492143165320158,
-0.0002176770503865555,
-0.02364230901002884,
-0.031569354236125946,
-0.012924832291901112,
-0.0016641935799270868,
0.011946098878979683,
0.02273993007838726,
0.015395959839224815,
... | 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": "msg", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _pyro_sample(self, msg):
name = msg["name"]
msg[
"replay_active"
] = True # indicate replaying so importance weights can be scaled
if self.trace is None:
return
if name in self.trace:
guide_msg = self.trace.nodes[name]
msg["fu... | |
17,708 | [
0.04507811740040779,
0.013890063390135765,
-0.0026128452736884356,
-0.01887276954948902,
-0.014296062290668488,
-0.03966480493545532,
-0.006969637703150511,
-0.023387962952256203,
-0.010199169628322124,
-0.0014802021905779839,
0.01596926711499691,
0.033980827778577805,
-0.02551637962460518,
... | 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": "origpo", "annotation": null, "type_comment": null}}, {"_type": "a... | def split_comments(self, origpo, translatedpo):
autocomments = translatedpo.getnotes("developer")
if autocomments:
devcomment, transcomment = autocomments.partition('[Translator Comment: ')[::2]
if transcomment:
origpo.addnote(transcomment.replace("]", ""), or... | |
17,709 | [
0.033508025109767914,
0.01965327002108097,
-0.0244648065418005,
0.0005694421124644578,
-0.044586893171072006,
0.04108310863375664,
0.004040455911308527,
0.01286777202039957,
0.058231912553310394,
0.038220860064029694,
0.04253890737891197,
0.007334507070481777,
-0.06069936603307724,
-0.0334... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "status", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def _wait(status):
status['power'] = _power_status(node)
if status['power'] == target_state:
raise loopingcall.LoopingCallDone()
if status['iter'] >= CONF.amt.max_attempts:
status['power'] = states.ERROR
LOG.warning(_LW("AMT failed to set power state %(state)... | |
17,710 | [
-0.003478235099464655,
-0.008023865520954132,
-0.02196134440600872,
-0.02441512607038021,
-0.05805647000670433,
-0.03155563026666641,
-0.01840336062014103,
-0.01612134464085102,
0.01904134452342987,
-0.019298991188406944,
0.022047225385904312,
-0.019654789939522743,
-0.019323529675602913,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def getSubjectIndicoTitle():
minfo=HelperMaKaCInfo.getMaKaCInfoInstance()
systitle="Indico"
if minfo.getTitle().strip() != "":
systitle=minfo.getTitle().strip()
if minfo.getOrganisation().strip() != "":
systitle="%s @ %s"%(systitle, minfo.getOrganisation().strip())
return systitle | |
17,711 | [
0.04290822148323059,
-0.03267006576061249,
0.007160956505686045,
0.01881979964673519,
-0.0015903650783002377,
-0.04336836189031601,
0.015794366598129272,
-0.0050500561483204365,
0.014275899156928062,
0.03349832072854042,
-0.04490983858704567,
-0.03214090317487717,
0.003402173286303878,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "addto", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "addcc", "annotation":... | class personMail:
@staticmethod
def send(addto, addcc, addfrom, subject, body):
addto = addto.replace("\r\n","")
tolist = addto.split(",")
cclist = addcc.split(",")
maildata = {
"fromAddr": addfrom,
"toList": tolist,
"ccList": cclist,
... | |
17,712 | [
0.02963508851826191,
-0.01006805058568716,
0.007551038172096014,
0.024491628631949425,
-0.02026742324233055,
-0.053798411041498184,
0.0388057716190815,
-0.0164481308311224,
0.013701303862035275,
0.04440885782241821,
-0.04386168345808983,
-0.026198819279670715,
-0.0028316392563283443,
-0.00... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "addto", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "addcc", "annotation": null, "type_comment": null}}, {"_type": "a... | def send(addto, addcc, addfrom, subject, body):
addto = addto.replace("\r\n","")
tolist = addto.split(",")
cclist = addcc.split(",")
maildata = {
"fromAddr": addfrom,
"toList": tolist,
"ccList": cclist,
"subject": subject,
"body... | |
17,713 | [
0.03307226300239563,
-0.021327851340174675,
0.057782504707574844,
0.028304031118750572,
0.02150401659309864,
-0.04345432296395302,
0.0026190036442130804,
-0.0035791092086583376,
0.0057371449656784534,
0.03962564468383789,
0.003790508722886443,
0.01835651509463787,
0.03189782053232193,
-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": "data", "annotation": null, "type_comment": null}}], "kwarg": null... | def __init__(self, data=None):
if data is None:
self._fromAddr = ""
self._replyAddr = ""
self._toList = []
self._ccList = []
self._bccList = []
self._subject = ""
self._body = ""
self._contenttype = "text/plain"
... | |
17,714 | [
0.011959774419665337,
-0.011096448637545109,
0.01174847036600113,
0.013064589351415634,
-0.03305993229150772,
-0.021359758451581,
0.03412248566746712,
-0.01024519745260477,
-0.017302732914686203,
0.02314678207039833,
-0.023871250450611115,
-0.021673694252967834,
-0.0023439587093889713,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "notification", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fromAddress", "annotation": null, "type_comment": null}}]... | def send(notification, fromAddress=""):
info = HelperMaKaCInfo.getMaKaCInfoInstance()
if fromAddress.strip() == "":
fromAddr = "%s <%s>"%(info.getTitle(), Config.getInstance().getSupportEmail())
else:
fromAddr = notification.getFromAddr()
toAddr = str(notification... | |
17,715 | [
0.014488758519291878,
-0.011353897862136364,
-0.0024751154705882072,
-0.005676948931068182,
-0.002180153504014015,
-0.02909151278436184,
0.027199195697903633,
-0.02448611706495285,
-0.01220885943621397,
0.011547689326107502,
-0.04956500604748726,
-0.013075221329927444,
-0.014591353945434093,... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "notification", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fromAddress", ... | class Mailer:
@staticmethod
def send(notification, fromAddress=""):
info = HelperMaKaCInfo.getMaKaCInfoInstance()
if fromAddress.strip() == "":
fromAddr = "%s <%s>"%(info.getTitle(), Config.getInstance().getSupportEmail())
else:
fromAddr = notification.getFromAddr... | |
17,716 | [
0.025024261325597763,
0.015888836234807968,
0.060257166624069214,
-0.035468488931655884,
-0.02307414822280407,
0.0016629943856969476,
0.021333444863557816,
-0.004989800974726677,
0.014279010705649853,
0.02401648461818695,
0.07999387383460999,
-0.02934330143034458,
0.03078298270702362,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "test", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def cleanup(test):
# seem to need to cleanup this class file, otherwise it doesn't recompile
subprocess.call(["rm"] + ["-f"] +
glob.glob(os.path.join(test.testcase_path, "data/", "*.zip")))
subprocess.call(["rm"] + ["-f"] +
glob.glob(os.path.join(test.testcase_path, "... | |
17,717 | [
0.0300722885876894,
-0.008132037706673145,
0.03031305968761444,
-0.01280901301652193,
-0.023366818204522133,
-0.02399282343685627,
0.045144546777009964,
-0.05494392663240433,
0.015397300943732262,
0.014374024234712124,
0.07049772888422012,
0.04078659415245056,
0.022524120286107063,
-0.0678... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "test", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def initialize(test):
try:
os.mkdir(os.path.join(test.testcase_path, "assignment_config"))
except OSError:
pass
try:
data_path = os.path.join(test.testcase_path, "data")
if os.path.isdir(data_path):
shutil.rmtree(data_path)
os.mkdir(data_path)
except O... | |
17,718 | [
0.06982282549142838,
0.01729450561106205,
0.03714518994092941,
-0.03933291137218475,
-0.025400586426258087,
-0.007633992936462164,
0.027795564383268356,
-0.014680755324661732,
0.011617947369813919,
0.03138802945613861,
0.05282768979668617,
-0.01977008394896984,
-0.010426214896142483,
-0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "test", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def schema_validation(test):
cleanup(test)
config_path = os.path.join(test.testcase_path, 'assignment_config', 'complete_config.json')
try:
test.validate_complete_config(config_path)
except Exception:
traceback.print_exc()
raise | |
17,719 | [
0.0238497331738472,
-0.006575505714863539,
0.03096618503332138,
-0.018019530922174454,
-0.03678436577320099,
-0.01893312856554985,
0.020724263042211533,
0.002344101667404175,
0.036688197404146194,
0.04416527971625328,
0.052507877349853516,
0.028658146038651466,
0.023224638774991035,
-0.026... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "test", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def correct(test):
return # TODO: REMOVE THIS!
cleanup(test)
subprocess.call(["cp",
os.path.join(SAMPLE_SUBMISSIONS, "correct.zip"),
os.path.join(test.testcase_path, "data/")])
subprocess.call(["unzip",
"-q", # quiet
"... | |
17,720 | [
0.03549319505691528,
-0.0017116006929427385,
0.0406666025519371,
-0.026742152869701385,
-0.07072900235652924,
-0.032945096492767334,
0.039559852331876755,
-0.0021298490464687347,
0.02790037915110588,
0.0006687950808554888,
0.041953522711992264,
0.027797425165772438,
0.026664936915040016,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "test", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def buggy(test):
return # TODO: REMOVE THIS!
cleanup(test)
subprocess.call(["cp",
os.path.join(SAMPLE_SUBMISSIONS, "buggy.zip"),
os.path.join(test.testcase_path, "data/")])
subprocess.call(["unzip",
"-q", # quiet
"-o",... | |
17,721 | [
0.026614073663949966,
-0.005751192104071379,
0.05736001208424568,
-0.051429569721221924,
-0.05483228340744972,
0.01319766417145729,
0.027829328551888466,
-0.03645763546228409,
0.06081133708357811,
-0.009169095195829868,
0.02098744548857212,
0.019687123596668243,
0.046762995421886444,
0.015... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "test", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def does_not_compile(test):
return # TODO: REMOVE THIS!
cleanup(test)
subprocess.call(["cp",
os.path.join(SAMPLE_SUBMISSIONS, "does_not_compile.zip"),
os.path.join(test.testcase_path, "data/")])
subprocess.call(["unzip",
"-q", # quiet
... | |
17,722 | [
-0.017828360199928284,
0.016422662883996964,
-0.009422745555639267,
-0.003702813060954213,
-0.006857061292976141,
-0.02889108471572399,
0.01491410844027996,
0.018136927857995033,
-0.004257092252373695,
0.030651064589619637,
0.03759955242276192,
-0.029485363513231277,
0.00913703441619873,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data_dict", "annotation": null, "type_comment": null}}], "kwar... | def wfsstore_feature_show(context, data_dict):
if not 'id' in data_dict:
raise p.toolkit.ValidationError({'id': ['id required']})
resource_show_response = toolkit.get_action('resource_show')(context,data_dict)
if resource_show_response['resource_type'] != 'wfs':
raise p.toolkit... | |
17,723 | [
0.04176412522792816,
-0.0008561388240195811,
0.027988657355308533,
-0.042948558926582336,
-0.06756415963172913,
-0.01605421118438244,
0.027679676190018654,
-0.0054136295802891254,
0.03391082212328911,
-0.0006738874362781644,
0.05049287900328636,
0.02986830100417137,
0.019440144300460815,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "test", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def still_buggy(test):
return # TODO: REMOVE THIS!
cleanup(test)
subprocess.call(["cp",
os.path.join(SAMPLE_SUBMISSIONS, "still_buggy.zip"),
os.path.join(test.testcase_path, "data/")])
subprocess.call(["unzip",
"-q", # quiet
... | |
17,724 | [
0.01570044830441475,
0.02791721187531948,
0.008989580906927586,
0.0017746518133208156,
-0.027416134253144264,
0.056073032319545746,
0.03765244409441948,
-0.030255576595664024,
-0.008828519843518734,
0.04137473925948143,
-0.006203825119882822,
-0.04125543683767319,
0.02209516055881977,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "reminders"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}... | class ReminderCloner(EventCloner):
name = 'reminders'
friendly_name = _('Reminders')
is_default = True
@property
def is_available(self):
return self._find_reminders(self.old_event).has_rows()
def get_conflicts(self, target_event):
if self._find_reminders(target_event).has_rows(... | |
17,725 | [
-0.010620738379657269,
0.03110811486840248,
-0.01205410622060299,
-0.01855894923210144,
-0.011449674144387245,
-0.02974957972764969,
0.010212027467787266,
-0.00007582386751892045,
-0.007690681144595146,
0.015715239569544792,
0.044555291533470154,
-0.0330422967672348,
0.017614882439374924,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data_dict", "annotation": null, "type_comment": null}}], "kwar... | def wfsstore_feature_show_props(context, data_dict):
if not 'id' in data_dict:
raise p.toolkit.ValidationError({'id': ['id required']})
resource_show_response = toolkit.get_action('resource_show')(context,data_dict)
if resource_show_response['resource_type'] != 'wfs':
raise p.t... | |
17,726 | [
0.04996449127793312,
0.03458007797598839,
0.006687107961624861,
-0.0004473564913496375,
-0.023204440250992775,
0.031233618035912514,
0.05047575756907463,
-0.0438757948577404,
-0.017522431910037994,
0.04922083392739296,
-0.00822090171277523,
-0.029699822887778282,
0.059724997729063034,
-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": "new_event", "annotation": null, "type_comment": null}}, {"_type":... | def run(self, new_event, cloners, shared_data, event_exists=False):
attrs = get_simple_column_attrs(db.m.EventReminder) - {'created_dt', 'scheduled_dt', 'is_sent'}
attrs |= {'creator_id'}
for old_reminder in self._find_reminders(self.old_event):
scheduled_dt = new_event.start_dt - ol... | |
17,727 | [
-0.0197835061699152,
0.0012725446140393615,
0.010406713001430035,
-0.02322411723434925,
0.003698089625686407,
0.035017259418964386,
-0.01653529889881611,
-0.020156994462013245,
-0.007288660388439894,
-0.007764007896184921,
-0.028362395241856575,
-0.0786360427737236,
-0.01891203597187996,
-... | 11 | {"_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 Semester(models.Model):
id = models.CharField(primary_key=True, max_length=20)
start = models.DateTimeField()
end = models.DateTimeField()
proposals = models.ManyToManyField("Proposal", through="TimeAllocation")
@classmethod
def current_semesters(cls, future=False):
semesters = cl... | |
17,728 | [
0.009321769699454308,
0.01681574061512947,
0.02940143644809723,
-0.00954371690750122,
0.010908037424087524,
-0.031803686171770096,
-0.02472749538719654,
-0.04360603913664818,
0.026163622736930847,
-0.012788058258593082,
-0.008512316271662712,
-0.04794052988290787,
-0.026476958766579628,
-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": "semester", "annotation": null, "type_comment": null}}], "kwarg": ... | def time_requested_for_semester(self, semester):
allocs = {
'1m0': 0,
'2m0': 0,
'0m4': 0
}
for sciapp in self.admin.scienceapplication_set.filter(call__semester=semester, call__proposal_type='COLAB'):
for k, v in sciapp.time_requested_by_class.item... | |
17,729 | [
-0.00989073421806097,
0.009594187140464783,
0.04430769756436348,
-0.009663962759077549,
0.0049889772199094296,
-0.016897398978471756,
-0.03844652324914932,
-0.015001819469034672,
0.004991884343326092,
-0.02197941020131111,
-0.005207026842981577,
-0.08140522241592407,
0.009751182980835438,
... | 10 | {"_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 TimeAllocationGroup(models.Model):
id = models.CharField(max_length=20, primary_key=True)
name = models.CharField(max_length=255, blank=True, default='')
admin = models.OneToOneField(User, null=True, blank=True, on_delete=models.SET_NULL)
one_meter_alloc = models.PositiveIntegerField(default=0, bl... | |
17,730 | [
-0.004744184669107199,
-0.0209334846585989,
0.030421854928135872,
-0.026336070150136948,
0.0033535417169332504,
-0.01700768619775772,
-0.022804083302617073,
-0.011881998740136623,
0.024760829284787178,
-0.038790326565504074,
-0.005242601037025452,
-0.04425444453954697,
0.008928420022130013,
... | 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 current_allocation(self):
allocs = {}
for ta in self.timeallocation_set.filter(semester=self.current_semester):
allocs[ta.instrument_name.replace('-', '')] = {
'std': ta.std_allocation,
'std_used': ta.std_time_used,
'too': ta.too_allocation... | |
17,731 | [
0.013962171971797943,
0.0047846450470387936,
0.031623613089323044,
-0.005234208889305592,
0.01067393273115158,
-0.0005161957233212888,
-0.053382508456707,
-0.006136547774076462,
0.0026909613516181707,
0.004964470397680998,
0.03301083669066429,
-0.06838509440422058,
0.005629182793200016,
-0... | 13 | {"_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 Proposal(models.Model):
id = models.CharField(max_length=255, primary_key=True)
active = models.BooleanField(default=True)
title = models.CharField(max_length=255, default='', blank=True)
abstract = models.TextField(default='', blank=True)
tac_priority = models.PositiveIntegerField(default=0)
... | |
17,732 | [
-0.0050199576653540134,
0.009160284884274006,
0.037975750863552094,
-0.01864815689623356,
-0.02232440374791622,
-0.001534044393338263,
-0.04993871971964836,
-0.03542785719037056,
-0.015081104822456837,
-0.012945727445185184,
0.0004925169632770121,
-0.07046746462583542,
0.014923377893865108,
... | 8 | {"_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 TimeAllocation(models.Model):
TELESCOPE_CLASSES = (
('0m4', '0m4'),
('0m8', '0m8'),
('1m0', '1m0'),
('2m0', '2m0'),
)
INSTRUMENT_NAMES = (
('0M4-SCICAM-SBIG', '0M4-SCICAM-SBIG'),
('0M8-NRES-SCICAM', '0M8-NRES-SCICAM'),
('0M8-SCICAM-SBIG', '0M8-S... | |
17,733 | [
0.024297591298818588,
0.012286719866096973,
0.028872067108750343,
0.029147915542125702,
0.004037146922200918,
-0.03238912671804428,
-0.03790608048439026,
0.03806699439883232,
0.036273982375860214,
0.027171006426215172,
0.027102043852210045,
-0.020975925028324127,
-0.001949611585587263,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "emails", "annotation": null, "type_comment": null}}, {"_type": "a... | def add_users(self, emails, role):
for email in emails:
if User.objects.filter(email=email).exists():
membership, created = Membership.objects.get_or_create(
proposal=self,
user=User.objects.get(email=email),
role=role
... | |
17,734 | [
0.018655896186828613,
-0.009151282720267773,
-0.005988966673612595,
-0.0032948150765150785,
0.007944067008793354,
0.014521919190883636,
-0.01840856485068798,
-0.007149071432650089,
0.0028281230479478836,
0.005411858670413494,
0.014521919190883636,
-0.06468319892883301,
0.007490625139325857,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "PI"}}, "targets": [{"_type": "Name", "_fields": {"id": "PI", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"_type... | class Membership(models.Model):
PI = 'PI'
CI = 'CI'
ROLE_CHOICES = (
(PI, 'Pricipal Investigator'),
(CI, 'Co-Investigator')
)
proposal = models.ForeignKey(Proposal, on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete=models.CASCADE)
role = models.CharField(max... | |
17,735 | [
0.041896846145391464,
-0.034910280257463455,
-0.037637293338775635,
0.01836790144443512,
0.0035975167993456125,
0.009150144644081593,
-0.023393720388412476,
-0.004020091146230698,
-0.0077528320252895355,
0.0065076458267867565,
-0.030605657026171684,
-0.017962230369448662,
0.00197342247702181... | 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 send_notification(self):
subject = _('You have been added to a proposal at LCO.global')
message = render_to_string(
'proposals/added.txt',
{
'proposal': self.proposal,
'user': self.user,
}
)
send_mail.delay(subject, ... | |
17,736 | [
0.03566136956214905,
0.0058403462171554565,
0.013293302617967129,
0.04306833818554878,
0.02639039419591427,
-0.0010883585782721639,
0.009743108414113522,
0.05238836631178856,
0.030780619010329247,
0.02050406113266945,
0.0579313300549984,
-0.014188515953719616,
0.014127200469374657,
-0.0436... | 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": "user", "annotation": null, "type_comment": null}}], "kwarg": null... | def accept(self, user):
Membership.objects.create(
proposal=self.proposal,
role=self.role,
user=user,
)
self.used = timezone.now()
self.save() | |
17,737 | [
0.03158344328403473,
-0.02307002991437912,
-0.010487379506230354,
-0.0014501475961878896,
-0.00018540385644882917,
-0.012483400292694569,
-0.06947475671768188,
0.022198837250471115,
-0.015835832804441452,
0.020412344485521317,
0.0064401994459331036,
-0.04481672868132591,
0.000486943579744547... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "Proposal", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Loa... | class ProposalInvite(models.Model):
proposal = models.ForeignKey(Proposal, on_delete=models.CASCADE)
role = models.CharField(max_length=5, choices=Membership.ROLE_CHOICES)
email = models.EmailField()
sent = models.DateTimeField(null=True)
used = models.DateTimeField(null=True)
def __str__(self)... | |
17,738 | [
0.04059779644012451,
-0.038867708295583725,
-0.02813168801367283,
0.01637657731771469,
-0.0071751209907233715,
0.009497703984379768,
-0.07147866487503052,
0.007998690009117126,
-0.023498373106122017,
-0.009000007063150406,
-0.009835425764322281,
-0.014314692467451096,
-0.0060464171692729,
... | 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 send_invitation(self):
subject = _('You have been added to a proposal at LCO.global')
message = render_to_string(
'proposals/invitation.txt',
{
'proposal': self.proposal,
'url': reverse('registration_register')
}
)
... | |
17,739 | [
0.05346158519387245,
0.000039568203646922484,
-0.010639365762472153,
0.0053589059971272945,
-0.012943744659423828,
0.002246769145131111,
0.004736233502626419,
-0.03575219213962555,
-0.01862134039402008,
0.045695338398218155,
-0.032241690903902054,
-0.05428528040647507,
-0.012227916158735752,... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "Proposal", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Loa... | class ProposalNotification(models.Model):
proposal = models.ForeignKey(Proposal, on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete=models.CASCADE)
def __str__(self):
return '{} - {}'.format(self.proposal, self.user)
class Meta:
unique_together = ('proposal', 'user') | |
17,740 | [
0.04554788023233414,
-0.03263445943593979,
0.0018495784606784582,
0.023265210911631584,
-0.009995033964514732,
-0.017334863543510437,
0.02163933776319027,
-0.04529054835438728,
-0.007749222218990326,
-0.014071417041122913,
-0.00810597836971283,
0.029265740886330605,
-0.009919004514813423,
... | 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": "commit_id", "annotation": null, "type_comment": null}}], "kwarg":... | def commit_message_for_local_commit(self, commit_id):
if commit_id == "Commitish1":
return CommitMessage("CommitMessage1\n" \
"https://bugs.example.org/show_bug.cgi?id=50000\n")
if commit_id == "Commitish2":
return CommitMessage("CommitMessage2\n" \
... | |
17,741 | [
0.016833938658237457,
0.04527050256729126,
0.05867178738117218,
-0.018189266324043274,
0.014642613008618355,
-0.01745460368692875,
0.005430813413113356,
-0.05094514787197113,
0.0075936391949653625,
0.023939913138747215,
0.046081166714429855,
-0.031717218458652496,
-0.01521261129528284,
0.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}}, {"_type": "arg", "_fields": {"arg": "filesystem", "annotati... | class MockSCM(object):
def __init__(self, filesystem=None, executive=None):
self.checkout_root = "/mock-checkout"
self.added_paths = set()
self._filesystem = filesystem or MockFileSystem()
self._executive = executive or MockExecutive()
def add(self, destination_path, return_exit... | |
17,742 | [
0.02468804642558098,
0.013883046805858612,
-0.0048558819107711315,
-0.02199210412800312,
0.008586685173213482,
-0.04597963020205498,
-0.003916547633707523,
0.01775713823735714,
0.02925204485654831,
0.05523499473929405,
0.00024246241082437336,
-0.028721347451210022,
0.0013877738965675235,
-... | 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": "kwargs", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _NodeMatcher(self, kwargs):
# Auto-complete resource-id's using the package name if available.
resource_id = kwargs.get('resource_id')
if (resource_id is not None
and self._package is not None
and ':id/' not in resource_id):
kwargs['resource_id'] = '%s:id/%s' % (self._package, reso... | |
17,743 | [
0.01176580972969532,
0.023694951087236404,
-0.022423287853598595,
-0.0335765965282917,
-0.014874969609081745,
0.021174956113100052,
0.03187326714396477,
-0.021338289603590965,
-0.017033299431204796,
0.006614986341446638,
0.03803325444459915,
0.008108316920697689,
0.036773256957530975,
0.00... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "builder", "annotation"... | class LogWindow(metaclass=Singleton):
def __init__(self, builder, parent_window):
self.builder = builder
self.visible = False
self.window = self.builder.get_object("log_window")
self.window.connect("delete-event", self._on_hide)
self.log_view = self.... | |
17,744 | [
0.045914988964796066,
0.023880785331130028,
-0.02253328077495098,
0.01630730740725994,
-0.022396033629775047,
0.05629577115178108,
-0.0018699753563851118,
0.006057534832507372,
0.010524264536798,
0.007954023778438568,
0.010979671962559223,
0.019176995381712914,
0.005995150189846754,
-0.008... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "message", "annotation": null, "type_comment": null}}], "kwarg": n... | def _on_log_msg(self, message):
def add_message():
end_iter = self.log_buffer.get_end_iter()
self.log_buffer.insert(end_iter, message)
return False
if self.visible:
GObject.idle_add(add_message) | |
17,745 | [
0.004630910232663155,
0.014273474924266338,
-0.009173274971544743,
-0.0027271900326013565,
-0.022608522325754166,
0.024107886478304863,
0.027933036908507347,
-0.02736634761095047,
-0.007242991589009762,
0.01337621733546257,
0.039455708116292953,
0.026988554745912552,
0.03194708377122879,
-... | 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": "builder", "annotation": null, "type_comment": null}}, {"_type": "... | def __init__(self, builder, parent_window):
self.builder = builder
self.visible = False
self.window = self.builder.get_object("log_window")
self.window.connect("delete-event", self._on_hide)
self.log_view = self.builder.get_object("log_view")
sel... | |
17,746 | [
0.04822046682238579,
-0.06649795919656754,
-0.0311000756919384,
-0.030344417318701744,
0.0124801741912961,
-0.016116781160235405,
-0.003524439176544547,
-0.0038638950791209936,
0.0041944957338273525,
-0.0001445455418433994,
-0.002334867138415575,
-0.04829131066799164,
-0.0069662281312048435,... | 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": "fire_id", "annotation": null, "type_comment": null}}, {"_type": "arg... | def fire_module(x, fire_id, squeeze=16, expand=64):
s_id = 'fire' + str(fire_id) + '/'
x = Convolution2D(squeeze, 1, 1, border_mode='valid', name=s_id + sq1x1)(x)
x = Activation('relu', name=s_id + relu + sq1x1)(x)
x = BatchNormalization()(x)
left = Convolution2D(expand, 1, 1, border_mode='val... | |
17,747 | [
0.004740556236356497,
-0.016564061865210533,
0.013845212757587433,
-0.021541645750403404,
-0.06330037117004395,
0.007368776481598616,
0.006173180416226387,
-0.016815032809972763,
-0.010380424559116364,
-0.03566571697592735,
0.02778802625834942,
-0.07757781445980072,
0.006295179948210716,
-... | 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 setUp(self):
PrebuildFunctionTestCase.setUp(self)
sm_sm = self.metamodel.new('SM_SM')
o_obj = self.metamodel.new('O_OBJ', Key_Lett='A')
pe_pe = self.metamodel.new('PE_PE')
relate(pe_pe, o_obj, 8001)
self.metamodel.new('SM_EVT',
SM_I... | |
17,748 | [
0.06256142258644104,
0.0069082654081285,
0.026445455849170685,
-0.04903118684887886,
0.014007396064698696,
0.011536750011146069,
-0.007555087096989155,
0.00824432261288166,
0.01663709618151188,
0.008541224524378777,
0.03802461922168732,
0.015343453735113144,
0.014431541785597801,
-0.044365... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "format", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": nu... | def natural_key_serializer_test(format, self):
# Create all the objects defined in the test data
with connection.constraint_checks_disabled():
objects = [
NaturalKeyAnchor.objects.create(id=1100, data="Natural Key Anghor"),
FKDataNaturalKey.objects.create(id=1101, data_id=1100),
... | |
17,749 | [
0.024452559649944305,
0.027942391112446785,
0.0238946620374918,
-0.0516589991748333,
0.031693365424871445,
-0.02931933104991913,
-0.0017790424171835184,
0.015644891187548637,
0.007964887656271458,
-0.011045197956264019,
0.05127915367484093,
-0.0012968166265636683,
-0.01666572503745556,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "format", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": nu... | def natural_key_test(format, self):
book1 = {
'data': '978-1590597255',
'title': 'The Definitive Guide to Django: Web Development Done Right',
}
book2 = {'data': '978-1590599969', 'title': 'Practical Django Projects'}
# Create the books.
adrian = NaturalKeyAnchor.objects.create(**bo... | |
17,750 | [
-0.0177351925522089,
0.023354515433311462,
0.03974208980798721,
-0.06911004334688187,
-0.006763529032468796,
-0.006359878461807966,
0.0449800081551075,
0.019820190966129303,
0.0027143110055476427,
0.01759534515440464,
0.01023428700864315,
0.0046022506430745125,
-0.04607336223125458,
0.0350... | 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": "context", "annotation": null, "type_comment": null}}], "kwarg": n... | def execute(self, context):
if not hasattr(self, "settings"):
self.settings = settings.settings
i18n_sett = context.window_manager.i18n_update_svn_settings
# 'DEFAULT' and en_US are always valid, fully-translated "languages"!
stats = {"DEFAULT": 1.0, "en_US": 1.0}
co... | |
17,751 | [
-0.002955381292849779,
0.0266969446092844,
0.04034095257520676,
-0.04135071113705635,
-0.04034095257520676,
-0.03273084759712219,
0.06738269329071045,
-0.004236046224832535,
-0.009063169360160828,
-0.04238509386777878,
-0.010510074906051159,
0.010103709995746613,
-0.06487061828374863,
0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}], "kwarg": n... | def execute(self, context):
if not hasattr(self, "settings"):
self.settings = settings.settings
i18n_sett = context.window_manager.i18n_update_svn_settings
self.settings.FILE_NAME_POT = i18n_sett.pot_path
context.window_manager.progress_begin(0, len(i18n_sett.langs) + 1)
... | |
17,752 | [
0.0065160891972482204,
-0.03291970491409302,
0.010113392025232315,
-0.0034042764455080032,
0.017208559438586235,
-0.0679919421672821,
-0.02447335608303547,
0.015266600996255875,
0.03420654311776161,
0.009616203606128693,
0.013465024530887604,
-0.028825214132666588,
-0.013032178394496441,
-... | 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_generate_request_id(self):
@webob.dec.wsgify
def application(req):
return req.environ[compute_req_id.ENV_REQUEST_ID]
app = compute_req_id.ComputeReqIdMiddleware(application)
req = webob.Request.blank('/test')
req_id = context.generate_request_id()
re... | |
17,753 | [
0.012135989964008331,
-0.030933087691664696,
0.016105281189084053,
0.005708706099539995,
0.005126999691128731,
-0.061592429876327515,
-0.023359499871730804,
0.0044397879391908646,
0.013333620503544807,
0.007476636674255133,
0.020085975527763367,
-0.02846939116716385,
0.008759812451899052,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class RequestIdTest(test.NoDBTestCase):
def test_generate_request_id(self):
@webob.dec.wsgify
def application(req):
return req.environ[compute_req_id.ENV_REQUEST_ID]
app = compute_req_id.ComputeReqIdMiddleware(application)
req = webob.Request.blank('/test')
req_i... | |
17,754 | [
0.04670055955648422,
0.015428234823048115,
0.011425627395510674,
-0.052605707198381424,
-0.04075383022427559,
0.012278130277991295,
0.00026250872178934515,
-0.0070643434301018715,
-0.0264899879693985,
0.027820726856589317,
0.0009246284607797861,
-0.004826521500945091,
0.0071839019656181335,
... | 18 | {"_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": "target", "annotation":... | class MySprite(pygame.sprite.Sprite):
def __init__(self, target):
pygame.sprite.Sprite.__init__(self)
self.target_surface = target
self.image = None
self.master_image = None
self.rect = None
self.topleft = 0,0
self.frame = 0
self.old_frame = -1
self.frame_width = 1
self.frame_height = 1
self.firs... | |
17,755 | [
0.052030518651008606,
0.03421732410788536,
0.010652165859937668,
-0.044164951890707016,
-0.014101237989962101,
-0.025552580133080482,
-0.003612062195315957,
-0.03417526185512543,
-0.03358639404177666,
0.023954229429364204,
0.04811876639723778,
-0.001321005285717547,
0.0002080090343952179,
... | 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": "filename", "annotation": null, "type_comment": null}}, {"_type": ... | def load(self, filename, width, height, columns):
self.master_image = pygame.image.load(filename).convert_alpha()
self.frame_width = width
self.frame_height = height
self.rect = 0,0,width,height
self.columns = columns
rect = self.master_image.get_rect()
self.last_frame = (rect.width // width) * (rect.h... | |
17,756 | [
0.04130588844418526,
-0.0010318002896383405,
0.016779810190200806,
-0.040854208171367645,
0.014995685778558254,
0.01768316514790058,
0.054607782512903214,
0.00039027738966979086,
-0.03326603025197983,
0.03480173274874687,
0.03864099085330963,
-0.03211425617337227,
-0.0010325059993192554,
-... | 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": "timeout", "annotation": null, "type_comment": null}}, {"_type": "... | def __init__(self, timeout=60, close_callback=None, *args, **kwargs):
self.timeout = timeout
self.close_callback = close_callback
self._store = {}
self._time_to_keys = collections.defaultdict(list)
self._keys_to_last_time = {}
self._last_visits = collections.deque()
... | |
17,757 | [
0.03876550868153572,
0.03190918639302254,
0.00679108127951622,
-0.041066765785217285,
-0.016393491998314857,
0.033142849802970886,
0.05969034507870674,
0.0007206256850622594,
-0.002372430171817541,
0.028872475028038025,
0.007716329302638769,
-0.018220264464616776,
-0.027496466413140297,
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": "current_time", "annotation": null, "type_comment": null}}, {"_typ... | def update(self, current_time, rate=30):
if current_time > self.last_time + rate:
self.frame += 1
if self.frame > self.last_frame:
self.frame = self.first_frame
self.last_time = current_time
if self.frame != self.old_frame:
frame_x = (self.frame % self.columns) * self.frame_width
frame_y = (self... | |
17,758 | [
0.04992324113845825,
0.02603813260793686,
0.02290279045701027,
-0.036682143807411194,
0.0031622538808733225,
0.030196160078048706,
-0.010381611995398998,
0.012312605045735836,
-0.02458484098315239,
0.051968611776828766,
0.06028466671705246,
-0.029065821319818497,
-0.02949642762541771,
-0.0... | 14 | {"_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 sweep(self):
# O(m)
now = time.time()
c = 0
while len(self._last_visits) > 0:
least = self._last_visits[0]
if now - least <= self.timeout:
break
if self.close_callback is not None:
for key in self._time_to_keys[least... | |
17,759 | [
0.024925803765654564,
-0.015797274187207222,
0.03941119462251663,
-0.04118770360946655,
0.009258350357413292,
0.030009355396032333,
0.033808354288339615,
0.01884467341005802,
0.041297025978565216,
0.00029572914354503155,
0.04099638760089874,
-0.03954784944653511,
-0.007632160559296608,
0.0... | 7 | {"_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():
c = LRUCache(timeout=0.3)
c['a'] = 1
assert c['a'] == 1
time.sleep(0.5)
c.sweep()
assert 'a' not in c
c['a'] = 2
c['b'] = 3
time.sleep(0.2)
c.sweep()
assert c['a'] == 2
assert c['b'] == 3
time.sleep(0.2)
c.sweep()
c['b']
time.sleep(0.2)
... | |
17,760 | [
0.011321774683892727,
0.010580328293144703,
0.05098329484462738,
-0.011109933257102966,
-0.00043618844938464463,
-0.038108013570308685,
0.017747648060321808,
0.014640632085502148,
0.005669714417308569,
0.03248243033885956,
-0.0013644681312143803,
0.015123161487281322,
0.038366928696632385,
... | 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": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def create_console(self, context, instance_uuid):
# NOTE(mdragon): If we wanted to return this the console info
# here, as we would need to do a call.
# They can just do an index later to fetch
# console info. I am not sure which is better
... | |
17,761 | [
0.019624942913651466,
0.008014815859496593,
0.05695386603474617,
-0.0192874763160944,
-0.008553463965654373,
-0.0027711144648492336,
0.06557222455739975,
-0.005526004824787378,
-0.004731012973934412,
0.0019809899386018515,
0.022571278735995293,
-0.025491658598184586,
0.012752318754792213,
... | 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 setUp(self):
self.path_to_db = "../fixtures/fruit.db"
self.path_to_none = "../fixtures/flowers.db"
self.db_is_present = False
self.db_deleted = False
if not os.path.isfile(self.path_to_db):
try:
open(self.path_to_db, "w").close()
self.db_is_present = True
except:
pass
else:
self.db_... | |
17,762 | [
0.041387274861335754,
0.027647117152810097,
-0.0175661351531744,
-0.02508256584405899,
-0.006400953978300095,
-0.010268631391227245,
-0.058338336646556854,
-0.04461902752518654,
0.019911762326955795,
0.011686432175338268,
0.032734520733356476,
-0.00009431372745893896,
0.010065343230962753,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": []}}, "targets": [{"_type": "Name", "_fields": {"id": "__slots__", "ctx": {"_type": "Store", "_fields": {}}}}], "ty... | class NodeList(list):
__slots__ = ()
def item(self, index):
if 0 <= index < len(self):
return self[index]
def _get_length(self):
return len(self)
def _set_length(self, value):
raise xml.dom.NoModificationAllowedErr(
"attempt to modify read-only attribut... | |
17,763 | [
0.014908910728991032,
0.027991728857159615,
-0.0198118407279253,
-0.01814834587275982,
-0.010593831539154053,
0.04460165649652481,
0.001727594994008541,
0.009605741128325462,
0.026390772312879562,
0.0396236814558506,
0.042550429701805115,
-0.06533905118703842,
0.01613464206457138,
-0.00631... | 14 | {"_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 = purefa_argument_spec()
argument_spec.update(dict(
name=dict(type='str', required=True),
target=dict(type='str'),
overwrite=dict(type='bool', default=False),
eradicate=dict(type='bool', default=False),
state=dict(type='str', default='present', c... | |
17,764 | [
0.05472968891263008,
0.07968372106552124,
-0.026117142289876938,
0.011958901770412922,
0.03461842983961105,
0.004829556681215763,
-0.03838268294930458,
-0.0420200489461422,
0.024742556735873222,
-0.03954579681158066,
0.03804432228207588,
-0.015099303796887398,
-0.005471911281347275,
-0.005... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "klass", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "ar... | def defproperty(klass, name, doc):
get = getattr(klass, ("_get_" + name)).im_func
def set(self, value, name=name):
raise xml.dom.NoModificationAllowedErr(
"attempt to modify read-only attribute " + repr(name))
assert not hasattr(klass, "_set_" + name), \
"expected not to find ... | |
17,765 | [
-0.0053947377018630505,
0.04968349635601044,
0.030774105340242386,
-0.033443666994571686,
-0.0017101875273510814,
0.009714235551655293,
-0.022666551172733307,
0.012779287062585354,
-0.03243022412061691,
0.005728432908654213,
-0.0240384079515934,
-0.02046663500368595,
0.010573191568255424,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 0}}, "targets": [{"_type": "Name", "_fields": {"id": "LEXER_PYTHON", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, ... | class ScriptEdit(QsciScintilla):
LEXER_PYTHON = 0
LEXER_R = 1
def __init__(self, parent=None):
QsciScintilla.__init__(self, parent)
self.lexer = None
self.api = None
self.lexerType = -1
self.setCommonOptions()
self.initShortcuts()
def setCommonOptions... | |
17,766 | [
0.04023369401693344,
0.02708607353270054,
0.008155478164553642,
-0.006190749350935221,
-0.00693833502009511,
-0.007815666496753693,
-0.011090215295553207,
-0.01748485118150711,
-0.03721863776445389,
-0.0016867012018337846,
-0.01006460189819336,
0.0061722141690552235,
0.010552695021033287,
... | 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": "parent", "annotation": null, "type_comment": null}}], "kwarg": nu... | def __init__(self, parent=None):
QsciScintilla.__init__(self, parent)
self.lexer = None
self.api = None
self.lexerType = -1
self.setCommonOptions()
self.initShortcuts() | |
17,767 | [
0.024805953726172447,
0.0042518991976976395,
0.06177118420600891,
0.014955398626625538,
-0.012216996401548386,
-0.005752569530159235,
-0.0044635324738919735,
-0.0008116606622934341,
-0.041608329862356186,
0.02983384020626545,
-0.02192004770040512,
-0.008978369645774364,
0.0027319896034896374... | 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 setCommonOptions(self):
# Enable non-ASCII characters
self.setUtf8(True)
# Default font
font = QFont()
font.setFamily('Courier')
font.setFixedPitch(True)
font.setPointSize(20)
self.setFont(font)
self.setMarginsFont(font)
self.initLexe... | |
17,768 | [
0.05438778176903725,
0.025078527629375458,
0.04839849844574928,
0.027066459879279137,
-0.0211026631295681,
0.0198665764182806,
0.000046865934564266354,
0.044601038098335266,
-0.03203628957271576,
0.00909224059432745,
-0.041975948959589005,
-0.011239461600780487,
0.019751889631152153,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def initShortcuts(self):
(ctrl, shift) = (self.SCMOD_CTRL << 16, self.SCMOD_SHIFT << 16)
# Disable some shortcuts
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('D') + ctrl)
self.SendScintilla(QsciScintilla.SCI_CLEARCMDKEY, ord('L') + ctrl)
self.SendScintilla(QsciScintill... | |
17,769 | [
-0.0320952869951725,
-0.022608676925301552,
0.057565003633499146,
-0.01947874017059803,
-0.02919122204184532,
-0.032181333750486374,
-0.024845881387591362,
-0.017919151112437248,
-0.01007817778736353,
0.021608388051390648,
-0.02669587731361389,
-0.005200425628572702,
-0.0326760970056057,
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": "size", "annotation": null, "type_comment": null}}], "kwarg": null... | def setFonts(self, size):
# Load font from Python console settings
settings = QSettings()
fontName = settings.value('pythonConsole/fontfamilytext', 'Monospace')
fontSize = int(settings.value('pythonConsole/fontsize', size))
self.defaultFont = QFont(fontName)
self.defaul... | |
17,770 | [
-0.03086642362177372,
0.032396797090768814,
0.0022455265279859304,
-0.0378355011343956,
-0.002663435647264123,
-0.010494819842278957,
-0.000056745160691207275,
0.022990895435214043,
-0.006727750413119793,
0.020130276679992676,
-0.02888871356844902,
-0.020495211705565453,
-0.02441531792283058... | 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 initLexer(self):
if self.lexerType == self.LEXER_PYTHON:
self.lexer = QsciLexerPython()
colorDefault = QColor('#2e3436')
colorComment = QColor('#c00')
colorCommentBlock = QColor('#3465a4')
colorNumber = QColor('#4e9a06')
colorType = QC... | |
17,771 | [
-0.0020489816088229418,
0.02899474836885929,
0.019649429246783257,
-0.03257577493786812,
0.05133572220802307,
0.03414680436253548,
0.00634187925606966,
-0.020850805565714836,
-0.030080609023571014,
-0.00008785603858996183,
0.0015926896594464779,
-0.04172471538186073,
0.029433714225888252,
... | 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 base(object):
#created = Column(DateTime, nullable=False, default=datetime.now)
#updated = Column(DateTime, nullable=False, default=datetime.now)
#update_uid = Column(Integer)
#create_uid = Column(Integer)
#disabled = Column(SmallInteger)
#def __init__(self, data, **kwargs):
# ... | |
17,772 | [
0.009484038688242435,
-0.01836532913148403,
0.05555112287402153,
-0.018303824588656425,
-0.00655641034245491,
-0.007700399495661259,
0.05264809727668762,
0.021403666585683823,
0.015806730836629868,
0.03596799820661545,
0.02703750506043434,
-0.019718434661626816,
-0.013137422502040863,
-0.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 DracDeployTestCase(db_base.DbTestCase):
def setUp(self):
super(DracDeployTestCase, self).setUp()
mgr_utils.mock_the_extension_manager(driver='fake_drac')
self.node = obj_utils.create_test_node(self.context,
driver='fake_drac',
... | |
17,773 | [
-0.003457438200712204,
0.009575345553457737,
0.0017799946945160627,
-0.0162558201700449,
0.03783257678151131,
0.036004237830638885,
-0.006446071434766054,
0.0004189946339465678,
-0.02479979395866394,
-0.0167363453656435,
0.030284814536571503,
-0.03227723762392998,
0.03279292210936546,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": {"_ty... | def tambah(cls, data, **kwargs):
if kwargs:
kode, nama = "", ""
for name, value in kwargs.items():
kode = name == 'kode' and value or kode or None
nama = name == 'nama' and value or nama or None
row = cls(data, kode=kode, nama=... | |
17,774 | [
0.02393563650548458,
0.005205514375120401,
0.02524917759001255,
-0.01731928251683712,
-0.024604570120573044,
-0.03534398227930069,
0.05473087728023529,
0.053076788783073425,
0.026051897555589676,
0.0504983551800251,
0.06504460424184799,
-0.01477733626961708,
-0.03495478630065918,
-0.023838... | 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": "mock_prepare_inband_cleaning", "annotation": null, "type_comment"... | def test_prepare_cleaning_with_inband_clean_step(
self, mock_prepare_inband_cleaning):
self.node.driver_internal_info['clean_steps'] = [
{'step': 'erase_disks', 'priority': 20, 'interface': 'deploy'}]
mock_prepare_inband_cleaning.return_value = states.CLEANWAIT
with task... | |
17,775 | [
0.022875692695379257,
0.024791857227683067,
0.01070449873805046,
-0.004243358038365841,
-0.03479849174618721,
-0.03472752496600151,
0.054314982146024704,
0.028955373913049698,
0.04355134442448616,
0.057484935969114304,
0.06477109342813492,
-0.00712056178599596,
-0.015388457104563713,
-0.00... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mock_prepare_inband_cleaning", "annotation": null, "type_comment"... | def test_prepare_cleaning_with_no_clean_step(
self, mock_prepare_inband_cleaning):
mock_prepare_inband_cleaning.return_value = states.CLEANWAIT
with task_manager.acquire(self.context, self.node.uuid,
shared=False) as task:
res = task.driver.depl... | |
17,776 | [
0.01775396429002285,
0.0017949558096006513,
0.023459305986762047,
-0.026336049661040306,
-0.056234925985336304,
-0.014215207658708096,
0.06615307182073593,
0.02775636687874794,
0.01966778002679348,
0.030548853799700737,
0.06668268144130707,
-0.020052950829267502,
-0.00838348176330328,
-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": "mock_prepare_inband_cleaning", "annotation": null, "type_comment"... | def test_prepare_cleaning_with_oob_clean_step_with_no_agent_cached_steps(
self, mock_prepare_inband_cleaning):
self.node.driver_internal_info['clean_steps'] = [
{'interface': 'raid', 'step': 'create_configuration'}]
mock_prepare_inband_cleaning.return_value = states.CLEANWAIT
... | |
17,777 | [
0.01682463474571705,
-0.0017585069872438908,
0.029086656868457794,
-0.030678818002343178,
-0.05983676388859749,
-0.010384696535766125,
0.06972242891788483,
0.02168429270386696,
0.022622954100370407,
0.025141896679997444,
0.06073978170752525,
-0.02457156963646412,
-0.00949950236827135,
-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": "mock_prepare_inband_cleaning", "annotation": null, "type_comment"... | def test_prepare_cleaning_with_oob_clean_step_with_agent_cached_steps(
self, mock_prepare_inband_cleaning):
self.node.driver_internal_info['agent_cached_clean_steps'] = []
self.node.driver_internal_info['clean_steps'] = [
{'interface': 'raid', 'step': 'create_configuration'}]
... | |
17,778 | [
-0.007218644022941589,
0.012684714049100876,
0.0029689583461731672,
-0.047478821128606796,
-0.04309125989675522,
0.04309125989675522,
-0.021239235997200012,
-0.007145109120756388,
0.0172561127692461,
0.09495764225721359,
0.02158239670097828,
-0.0612788088619709,
0.013665175065398216,
0.012... | 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='list'),
state=dict(
default='present',
choices=[
'present',
'installed',
'latest',
'a... | |
17,779 | [
-0.0026928894221782684,
0.03937458619475365,
0.010550934821367264,
-0.019907914102077484,
-0.019466670230031013,
0.008987112902104855,
-0.025228803977370262,
0.01716960221529007,
0.016481781378388405,
0.09930597245693207,
0.016027558594942093,
-0.05481814220547676,
-0.005778356455266476,
-... | 14 | {"_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": "state", "annotation": null, "type_comment": null}}, {"_type": "... | def ensure(module, state, packages, params):
response = {
'results': [],
'msg': '',
}
behaviour = {
'present': {
'filter': lambda p: not is_installed(module, p),
'subcommand': 'install',
},
'latest': {
'filter': lambda p: (
... | |
17,780 | [
-0.012593470513820648,
0.020043298602104187,
0.0024857916869223118,
-0.02163710445165634,
-0.004841784946620464,
-0.004156569950282574,
-0.004594262223690748,
-0.032286617904901505,
0.03506369888782501,
0.01380089856684208,
0.045737359672784805,
-0.04204263165593147,
-0.023218834772706032,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_system_ips_urlfilter_dns_creation(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
set_method_mock = mocker.patch('ansible.module_utils.network.forti... | |
17,781 | [
-0.014378165826201439,
0.026042571291327477,
0.012937968596816063,
-0.025018960237503052,
-0.011801283806562424,
0.0008949158363975585,
0.000531890953425318,
-0.034897997975349426,
0.033303067088127136,
0.010069476440548897,
0.039468541741371155,
-0.04749079421162605,
-0.0289467703551054,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_system_ips_urlfilter_dns_creation_fails(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'error', 'http_method': 'POST', 'http_status': 500}
set_method_mock = mocker.patch('ansible.module_utils.network.f... | |
17,782 | [
-0.0015942706959322095,
0.040186721831560135,
-0.0051960269920527935,
-0.025051943957805634,
-0.012988526374101639,
0.031922418624162674,
-0.003934795502573252,
-0.008745361119508743,
0.04383781552314758,
0.012081919237971306,
0.048451025038957596,
-0.05659198388457298,
-0.03754707798361778,... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_system_ips_urlfilter_dns_deletion_fails(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
delete_method_result = {'status': 'error', 'http_method': 'POST', 'http_status': 500}
delete_method_mock = mocker.patch('ansible.module_utils.net... | |
17,783 | [
-0.006007931660860777,
0.029556546360254288,
-0.02004295587539673,
-0.014208449050784111,
-0.010826664045453072,
0.024477675557136536,
-0.02243374101817608,
-0.01747874543070793,
0.04095303639769554,
0.01759023219347,
0.04868282750248909,
-0.05400944873690605,
-0.02886284701526165,
-0.0338... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_system_ips_urlfilter_dns_removal(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
delete_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
delete_method_mock = mocker.patch('ansible.module_utils.network.... | |
17,784 | [
-0.008609297685325146,
0.013601451180875301,
-0.008095216937363148,
-0.006707819644361734,
-0.006868856959044933,
0.01620282232761383,
-0.00829341635107994,
-0.02792137674987316,
0.042736802250146866,
0.008807497099041939,
0.047914765775203705,
-0.06282929331064224,
-0.025134192779660225,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_system_ips_urlfilter_dns_idempotent(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'error', 'http_method': 'DELETE', 'http_status': 404}
set_method_mock = mocker.patch('ansible.module_utils.network.for... | |
17,785 | [
-0.0156839769333601,
0.024991758167743683,
-0.004461504984647036,
-0.02215789258480072,
-0.002514749765396118,
0.007890848442912102,
-0.0057532344944775105,
-0.04189722612500191,
0.035203441977500916,
0.006779288873076439,
0.041530780494213104,
-0.05115614831447601,
-0.023147301748394966,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_system_ips_urlfilter_dns_filter_foreign_attributes(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
set_method_mock = mocker.patch('ansible.module_ut... | |
17,786 | [
0.040060728788375854,
0.016406342387199402,
0.04794188588857651,
-0.01744333654642105,
-0.0444488525390625,
-0.03508315607905388,
0.027136504650115967,
-0.03772476315498352,
0.009764120914041996,
-0.005659806076437235,
0.024604056030511856,
0.021089190617203712,
-0.003831421257928014,
0.00... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "output_path", "annotation": null, "type_comment": null}}, ... | def WriteAppleRuntime(player_path, output_path, copy_python, overwrite_lib):
# Enforce the extension
if not output_path.endswith('.app'):
output_path += '.app'
# Use the system's cp command to preserve some meta-data
os.system('cp -R "%s" "%s"' % (player_path, output_path))
bpy.ops.wm.... | |
17,787 | [
0.06376667320728302,
0.02496584877371788,
-0.02201019413769245,
-0.006005638744682074,
0.012116087600588799,
0.012409556657075882,
-0.04175648093223572,
-0.06917489320039749,
0.020354188978672028,
-0.031464096158742905,
0.024420835077762604,
0.0006298453081399202,
0.03613864257931709,
-0.0... | 9 | {"_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 __getattr__(name):
if name not in __all__:
raise AttributeError(
"scipy.constants.codata is deprecated and has no attribute "
f"{name}. Try looking in scipy.constants instead.")
warnings.warn(f"Please use `{name}` from the `scipy.constants` namespace, "
"th... | |
17,788 | [
-0.00169478845782578,
0.08313322812318802,
0.012346519157290459,
0.012072152458131313,
-0.023938529193401337,
-0.020177412778139114,
0.025767643004655838,
0.021320609375834465,
-0.012049288488924503,
0.013466851785779,
-0.03953172639012337,
-0.005990348290652037,
0.04629944637417793,
-0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def invoke(self, context, event):
if not self.filepath:
ext = '.app' if sys.platform == 'darwin' else os.path.splitext(bpy.app.binary_path)[-1]
self.filepath = bpy.path.ensure_ext(bpy.data.filepath, ext)
wm = context.window_manager
wm.fileselect_add(self)
return ... | |
17,789 | [
0.021212609484791756,
0.0055381422862410545,
0.0355660542845726,
-0.008154788054525852,
-0.017681408673524857,
0.004163133446127176,
-0.003270806511864066,
-0.003969425335526466,
0.03216187283396721,
-0.02286389097571373,
0.01867217756807804,
-0.010053761303424835,
0.0006998096941970289,
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": "client_info", "annotation": null, "type_comment": null}}], "kwarg... | def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.get_metrics_scope: gapic_v1.method.wrap_method(
self.get_metrics_scope,
default_timeout=None,
client_info=client_info,
)... | |
17,790 | [
0.0019266579765826464,
-0.0253627747297287,
0.021581178531050682,
0.01317690685391426,
0.017043262720108032,
-0.014422224834561348,
-0.016860703006386757,
0.02008157968521118,
0.03207836672663689,
0.04498795419931412,
0.04410123452544212,
-0.030722208321094513,
0.005564814433455467,
0.0236... | 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": "environ", "annotation": null, "type_comment": null}}, {"_type": "... | def __call__(self, environ, start_response):
if not (environ.get('HTTP_CONNECTION').find('Upgrade') != -1 and
environ['HTTP_UPGRADE'].lower() == 'websocket'):
# need to check a few more things here for true compliance
start_response('400 Bad Request', [('Connection','close')]... | |
17,791 | [
-0.0140962740406394,
-0.00462150014936924,
0.001429034979082644,
0.0363241545855999,
0.007137495558708906,
-0.026427721604704857,
-0.007550777401775122,
-0.01275589969009161,
0.05013001337647438,
0.021445995196700096,
0.05200653895735741,
-0.041462257504463196,
-0.003655313514173031,
0.011... | 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": "handler", "annotation"... | class WebSocketWSGI(object):
def __init__(self, handler):
self.handler = handler
def verify_client(self, ws):
pass
def __call__(self, environ, start_response):
if not (environ.get('HTTP_CONNECTION').find('Upgrade') != -1 and
environ['HTTP_UPGRADE'].lower() == 'websocke... | |
17,792 | [
0.018132194876670837,
0.01479630172252655,
0.0031717889942228794,
-0.03101304918527603,
-0.01068561989814043,
-0.009910832159221172,
-0.016356639564037323,
0.0050415038131177425,
-0.10218594968318939,
0.025180615484714508,
0.00442005880177021,
-0.011180623434484005,
0.0022275159135460854,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "printer", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "painter", "annotation": null, "type_comment": null}}, {"_type"... | def draw_image_page(printer, painter, p, preserve_aspect_ratio=True):
page_rect = printer.pageRect()
if preserve_aspect_ratio:
aspect_ratio = float(p.width())/p.height()
nw, nh = page_rect.width(), page_rect.height()
if aspect_ratio > 1:
nh = int(page_rect.width()/aspect_rati... | |
17,793 | [
0.0249293502420187,
0.024682117626070976,
0.0656404197216034,
-0.01106368750333786,
-0.03261418268084526,
-0.016379201784729958,
0.005106911528855562,
-0.024743925780057907,
-0.019016355276107788,
-0.020757289603352547,
-0.04672707989811897,
-0.014020184986293316,
-0.009384561330080032,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "opts", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_custom_size(opts):
custom_size = None
if opts.custom_size != None:
width, sep, height = opts.custom_size.partition('x')
if height:
try:
width = float(width)
height = float(height)
custom_size = (width, height)
except... | |
17,794 | [
0.011712580919265747,
0.03291802108287811,
0.03336668759584427,
0.00756831094622612,
0.006871696095913649,
-0.005130157805979252,
-0.028100749477744102,
-0.038609012961387634,
-0.01946980506181717,
0.001909788348712027,
-0.00239387690089643,
-0.029777348041534424,
-0.0017282550688832998,
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": "opts", "annotation": n... | class Page(QWebPage): # {{{
def __init__(self, opts, log):
self.log = log
QWebPage.__init__(self)
settings = self.settings()
settings.setFontSize(QWebSettings.DefaultFontSize,
opts.pdf_default_font_size)
settings.setFontSize(QWebSettings.DefaultFixedFontSize,... | |
17,795 | [
0.00962531752884388,
0.011139670386910439,
0.0421035960316658,
-0.020397871732711792,
-0.020661737769842148,
0.002836543368175626,
0.01642843335866928,
-0.04031390696763992,
-0.02512448839843273,
0.03081478364765644,
0.002957003191113472,
-0.04006151482462883,
-0.027556631714105606,
0.0345... | 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": "opts", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, opts, log):
self.log = log
QWebPage.__init__(self)
settings = self.settings()
settings.setFontSize(QWebSettings.DefaultFontSize,
opts.pdf_default_font_size)
settings.setFontSize(QWebSettings.DefaultFixedFontSize,
opts.pdf_mono_fo... | |
17,796 | [
0.040343090891838074,
0.03965853527188301,
0.02423323690891266,
-0.03965853527188301,
0.019589673727750778,
-0.03833506256341934,
0.0091102821752429,
0.02498624660074711,
-0.01973799429833889,
-0.006531792692840099,
0.022111115977168083,
-0.040708184242248535,
-0.054308004677295685,
0.0285... | 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 _render_book(self):
try:
if len(self.render_queue) == 0:
self._write()
else:
self._render_next()
except:
self.logger.exception('Rendering failed')
self.loop.exit(1) | |
17,797 | [
0.026638174429535866,
0.020887745544314384,
0.05134858563542366,
-0.04238887131214142,
-0.01704317517578602,
-0.025520948693156242,
0.010980580002069473,
0.020405806601047516,
-0.011873265728354454,
-0.010197426192462444,
0.04898269474506378,
-0.019409064203500748,
-0.04512717202305794,
-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": "items", "annotation": null, "type_comment": null}}, {"_type": "ar... | def dump(self, items, out_stream, pdf_metadata):
self.metadata = pdf_metadata
self._delete_tmpdir()
self.outline = Outline(self.toc, items)
self.render_queue = items
self.combine_queue = []
self.out_stream = out_stream
self.insert_cover()
self.render_suc... | |
17,798 | [
0.004868962801992893,
0.04650949314236641,
0.032742682844400406,
0.017359668388962746,
0.05655554682016373,
-0.017150375992059708,
-0.019313067197799683,
-0.006900846026837826,
-0.00415387935936451,
-0.006150880828499794,
0.02139436826109886,
-0.04541652277112007,
-0.028649847954511642,
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": "ok", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def _render_html(self, ok):
if ok:
self.do_paged_render()
else:
# The document is so corrupt that we can't render the page.
self.logger.error('Document cannot be rendered.')
self.loop.exit(0)
return
self._render_book() | |
17,799 | [
0.014297000132501125,
0.00793656799942255,
0.02456982433795929,
-0.04151607304811478,
-0.02731967717409134,
-0.012240199372172356,
0.02725260891020298,
-0.013559234328567982,
-0.04095716029405594,
-0.007075841072946787,
0.0006584696238860488,
-0.0021643913350999355,
-0.024882815778255463,
... | 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": "outpath", "annotation": null, "type_comment": null}}], "kwarg": n... | def setup_printer(self, outpath):
self.printer = self.painter = None
printer = get_pdf_printer(self.opts, output_file_name=outpath)
painter = QPainter(printer)
zoomx = printer.logicalDpiX()/self.view.logicalDpiX()
zoomy = printer.logicalDpiY()/self.view.logicalDpiY()
pain... | |
17,800 | [
0.07403933256864548,
0.05157523602247238,
0.0282620657235384,
-0.052400052547454834,
-0.023337431252002716,
-0.009079037234187126,
-0.01295445766299963,
0.029523547738790512,
-0.04068281874060631,
0.017005758360028267,
0.03983374312520027,
-0.017782054841518402,
-0.06904192268848419,
0.007... | 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 _write(self):
self.painter.end()
self.printer.abort()
self.painter = self.printer = None
self.append_doc(self.combine_queue[-1])
try:
self.doc.creator = u'%s %s [http://calibre-ebook.com]'%(
__appname__, __version__)
self.doc.title... |