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 |
|---|---|---|---|---|---|
9,301 | [
-0.04914987087249756,
0.009098635986447334,
0.05318823456764221,
-0.02048731967806816,
-0.012706078588962555,
-0.025535278022289276,
0.00039552594535052776,
-0.019022181630134583,
-0.01921917498111725,
0.03316877409815788,
0.004429274704307318,
0.014146593399345875,
0.01571022905409336,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_bad_destination():
src = Rectilinear([0, 1, 2], [0, 2])
dst = Rectilinear([0.5, 1.5, 2.5], [0.25, 1.25])
mapper = NearestVal()
mapper.initialize(dst, src)
src_vals = np.arange(src.get_point_count())
dst_vals = [0.0] * src.get_point_count()
with pytest.raises(TypeError):
ma... | |
9,302 | [
0.027879683300852776,
-0.003479731734842062,
-0.005309793632477522,
-0.030514972284436226,
0.05651230737566948,
0.04442344233393669,
0.002088884823024273,
-0.016815653070807457,
0.05057245120406151,
-0.006264039780944586,
-0.012590824626386166,
-0.02656203880906105,
-0.00038300579763017595,
... | 8 | {"_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 TestJsonDiff(unittest.TestCase):
def test_no_diff(self):
json_object = {'a': 1, 'b': 2}
json_diff = json_util.json_diff('', json_object, '', json_object)
self.assertEqual(json_diff, '')
def test_diff(self):
json_diff = json_util.json_diff(
'a', {'a': 1, 'b': 2}... | |
9,303 | [
-0.023790515959262848,
-0.004683312494307756,
0.08262573927640915,
-0.006051504518836737,
-0.02102445252239704,
-0.0302248764783144,
0.006855799816548824,
-0.06211176514625549,
0.004267809446901083,
0.009746513329446316,
-0.016703221946954727,
-0.030082417652010918,
0.0201578326523304,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_incompatible_grids():
grid = Rectilinear([0, 1, 2], [0, 2])
mapper = NearestVal()
assert not mapper.test(grid, None)
assert not mapper.test(None, grid)
assert mapper.test(grid, grid) | |
9,304 | [
0.005586759652942419,
0.0028899889439344406,
-0.035375453531742096,
-0.029059983789920807,
0.017687726765871048,
-0.031687747687101364,
-0.011493709869682789,
0.0021916439291089773,
0.0455331988632679,
0.08740077167749405,
0.03148901090025902,
-0.009075724519789219,
-0.0030638850294053555,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _convert(node):
# Okay to use long here because this is only for python 2.4 and 2.5
if isinstance(node, ast.Const) and isinstance(node.value, (text_type, binary_type, int, float, long, complex)):
return node.value
elif isinstance(node, ast.Tuple):
... | |
9,305 | [
0.017078425735235214,
0.019601235166192055,
0.0417252779006958,
-0.028492899611592293,
-0.03690226376056671,
-0.0029154520016163588,
0.0007713735685683787,
-0.002638746751472354,
0.04481695592403412,
0.06940197944641113,
-0.0048786671832203865,
-0.0360860601067543,
0.04390181973576546,
-0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "archetype", "annotation": null, "type_comment": null}}, {"_type":... | def setup_personality(self, archetype, name, maps=None, required=None):
if archetype in default_parameters:
for path, value in default_parameters[archetype].items():
command = ["add_parameter", "--archetype", archetype,
"--personality", name,
... | |
9,306 | [
-0.013427987694740295,
0.03990105912089348,
-0.02556202933192253,
-0.04660845175385475,
-0.024320898577570915,
0.023317430168390274,
0.011935988441109657,
-0.006479631178081036,
-0.004235031548887491,
0.01902628317475319,
0.007743868976831436,
-0.06422195583581924,
-0.04285864904522896,
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": {"_type": "arg", "_fields": {"arg": "kwargs", "an... | class Module(TermineterModuleOptical):
def __init__(self, *args, **kwargs):
TermineterModuleOptical.__init__(self, *args, **kwargs)
self.author = ['Spencer McIntyre']
self.description = 'Get Basic Meter Information By Reading Tables'
self.detailed_description = 'This module retreives some basic meter informati... | |
9,307 | [
0.046727705746889114,
0.011229087598621845,
0.031081801280379295,
-0.01876983791589737,
-0.025030825287103653,
0.005827837623655796,
-0.01065155491232872,
-0.003671931568533182,
0.005936125293374062,
0.055075690150260925,
0.013808299787342548,
-0.023928260430693626,
0.018113549798727036,
-... | 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": "archetype", "annotation": null, "type_comment": null}}, {"_type":... | def verifycatpersonality(self, archetype, personality,
config_override=False, host_env='dev', grn=None,
stage=None):
if stage and stage != "current":
staged_name = "%s+%s" % (personality, stage)
else:
staged_name = persona... | |
9,308 | [
0.021268384531140327,
0.010108625516295433,
0.008217950351536274,
-0.050754718482494354,
-0.015876207500696182,
0.016859084367752075,
-0.01836070418357849,
-0.0006991912960074842,
-0.0015980296302586794,
0.012463436461985111,
-0.01067514531314373,
-0.030305398628115654,
-0.007405711337924004... | 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 run(self):
conn = self.frmwk.serial_connection
try:
general_ctl = C1219GeneralAccess(conn)
except C1218ReadTableError:
self.frmwk.print_error('Could not read the necessary tables')
return
meter_info = {}
meter_info['Character Encoding'] = general_ctl.char_format
meter_info['Device Type'] = ge... | |
9,309 | [
0.013511290773749352,
0.016143962740898132,
-0.03365645185112953,
-0.0667562186717987,
0.02999158762395382,
-0.007898016832768917,
-0.023520084097981453,
-0.01949569210410118,
-0.016828225925564766,
0.03189360722899437,
0.04764324799180031,
0.013998393900692463,
0.017326926812529564,
0.000... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "file_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs... | def readTraceFile(file_name):
data = []
with open(file_name, 'r') as f:
data = f.readlines()
events = 0
LPs = 0
for d in data:
if "LP count" in d:
LPs = int(d.split(":")[-1])
if "Events processed" in d:
events = int(d.split(":")[-1])
return events,... | |
9,310 | [
0.01768316701054573,
0.022923875600099564,
0.023509932681918144,
-0.07199494540691376,
0.008390769362449646,
0.0075736697763204575,
0.01699567586183548,
-0.009281126782298088,
0.017728248611092567,
0.027386929839849472,
0.01046451274305582,
-0.023645177483558655,
-0.005367500241845846,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c... | def openConfig():
# Removes the first line, which is a comment on the format for adding more
models = []
with open("local.config") as f:
data = f.readlines()
data = data[1:]
models = [d.split(',') for d in data]
for m in models:
m[-1] = m[-1].replace("\n", "")
return models | |
9,311 | [
0.008022940717637539,
0.0076145874336361885,
-0.03708808496594429,
-0.0618775300681591,
-0.05419088155031204,
-0.014880873262882233,
-0.023095980286598206,
-0.07254275679588318,
0.04873816296458244,
-0.005617859773337841,
0.026903273537755013,
-0.03161134570837021,
0.038961704820394516,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "model_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "capt_hist", "annotation": null, "type_comment": null}}, {"_... | def defineModelSummaryJSON(model_name, capt_hist, file_name, format, events, LPs):
m = {}
m["simulator_name"] = str("warped2-models")
m["model_name"] = str(model_name)
m["original_capture_date"] = str(datetime.datetime.today().strftime("%d-%m-%y"))
m["capture_history"] = [str(capt_hist)]
m["tota... | |
9,312 | [
0.03585381805896759,
0.03563766926527023,
0.0362861193716526,
-0.06797906011343002,
-0.03434077277779579,
-0.008355533704161644,
-0.005471287295222282,
-0.031233621761202812,
0.014103762805461884,
0.015468208119273186,
-0.0027542191091924906,
-0.006683751940727234,
0.029477406293153763,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "flags", "annotation": null, "type_comment": null}}, {"_type": "ar... | def newConfig(name, flags, size, runtime):
s = [name.strip(), flags, size.strip(), int(runtime)]
s = str(s).replace("[", "")
s = s.replace("]", "")
s = s.replace("'", "")
with open("/home/kanesp/warped2-gprof/warped2-models/scripts/mass-models/new-local.config") as f:
f.write(s)
f.wr... | |
9,313 | [
0.01144320797175169,
0.0210178941488266,
0.01092549692839384,
-0.07312227785587311,
-0.04241663217544556,
-0.04791508615016937,
-0.02288641594350338,
-0.04182156175374985,
0.041488323360681534,
0.035585224628448486,
-0.0012846087338402867,
-0.006646938621997833,
-0.008188171312212944,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "model", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "LPs", "annotation": null, "type_comment": null}}, {"_type": "arg... | def writeSummary(model, LPs, events, runtime, outputFileSize):
s = [model, LPs, events, float(events)/float(LPs), int(runtime), outputFileSize, 5.0 * float(runtime)/float(outputFileSize)]
s = str(s).replace("[", "")
s = str(s).replace("]", "")
with open("../../../summary-file.csv", "a") as f:
f.... | |
9,314 | [
0.008174439892172813,
-0.0007850645342841744,
0.008640831336379051,
0.011004297062754631,
-0.026521237567067146,
0.005937025882303715,
0.03506752848625183,
-0.024340545758605003,
0.020281687378883362,
-0.010058910585939884,
0.0207480788230896,
-0.06151313707232475,
-0.004830923862755299,
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 post_config_hook(self):
if self.expected is None:
self.expected = {}
# Backwards compatibility
self.substitutions = {}
if self.url_geo == URL_GEO_NEW_DEFAULT:
self.substitutions["country_code"] = "country_iso"
elif self.url_geo == URL_GEO_OLD_DEFAULT:... | |
9,315 | [
-0.007097658235579729,
-0.014465703628957272,
-0.019005950540304184,
0.02080853097140789,
0.012787050567567348,
-0.05412245914340019,
0.012392736040055752,
0.033437855541706085,
-0.011716769076883793,
-0.002705278107896447,
-0.02110145054757595,
-0.008765044622123241,
-0.011953357607126236,
... | 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_my_ip_info(self):
try:
info = self.py3.request(self.url_geo).json()
for old, new in self.substitutions.items():
info[old] = info.get(new)
return info
except self.py3.RequestException:
return None | |
9,316 | [
0.039377156645059586,
-0.011679311282932758,
0.00483326893299818,
-0.0028963019140064716,
-0.036846816539764404,
0.05131786689162254,
0.019071677699685097,
-0.004856795072555542,
0.0028570920694619417,
0.013362721540033817,
-0.025491638109087944,
-0.07072413712739944,
-0.01087420154362917,
... | 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 __init__(self):
super(CallbackModule, self).__init__()
# plugin disable itself if say is not present
# ansible will not call any callback if disabled is set to True
if not os.path.exists(SAY_CMD):
self.disabled = True
self._display.warning("%s does not exist... | |
9,317 | [
0.005390068981796503,
-0.01591833308339119,
-0.003283336292952299,
0.024870596826076508,
0.030771607533097267,
-0.008945067413151264,
0.036154478788375854,
-0.004886324051767588,
0.0010785534977912903,
0.04248727113008499,
0.021661024540662766,
-0.0031574000604450703,
-0.033592578023672104,
... | 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 whatismyip(self):
# refresh
current_time = time.monotonic()
refresh = current_time >= self.idle_time
# time
if refresh:
self.idle_time = current_time + self.cache_timeout
cached_until = self.cache_timeout
else:
cached_until = self.... | |
9,318 | [
0.006199724972248077,
-0.00013240058615338057,
0.04099160060286522,
-0.051759544759988785,
-0.060569681227207184,
-0.008417554199695587,
0.0015257135964930058,
0.0408080592751503,
0.02337133139371872,
0.02044481597840786,
0.005192779470235109,
-0.009998075664043427,
-0.007341779302805662,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
parser = argparse.ArgumentParser(
description='Caffe prototxt to mxnet model parameter converter.')
parser.add_argument('prototxt', help='The prototxt filename')
parser.add_argument('caffemodel', help='The binary caffemodel filename')
parser.add_argument('save_model_name', help='The ... | |
9,319 | [
-0.00872122123837471,
0.03403903543949127,
0.0677192285656929,
-0.009893876500427723,
-0.013789910823106766,
0.017096413299441338,
0.005200052168220282,
0.014648576267063618,
-0.0026689115911722183,
0.027938665822148323,
0.0020681661553680897,
0.002406185492873192,
0.051724981516599655,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestRpModel(unittest.TestCase):
def setUp(self):
self.corpus = mmcorpus.MmCorpus(datapath('testcorpus.mm'))
def testTransform(self):
# create the transformation model
numpy.random.seed(13) # HACK; set fixed seed so that we always get the same random matrix (and can compare against... | |
9,320 | [
-0.015211524441838264,
0.0003611427382566035,
0.08471117913722992,
-0.047582242637872696,
-0.017060576006770134,
0.021375026553869247,
0.0038460257928818464,
0.027760416269302368,
0.011605875566601753,
0.02458004839718342,
0.01750434748828411,
0.006520986091345549,
0.048617709428071976,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testPersistence(self):
fname = testfile()
model = rpmodel.RpModel(self.corpus, num_topics=2)
model.save(fname)
model2 = rpmodel.RpModel.load(fname)
self.assertEqual(model.num_topics, model2.num_topics)
self.assertTrue(numpy.allclose(model.projection, model2.projection... | |
9,321 | [
-0.024026259779930115,
0.009311335161328316,
0.039471711963415146,
0.00026796903694048524,
0.0032989722676575184,
-0.02544093318283558,
0.009270749986171722,
0.02673964947462082,
-0.007061772048473358,
0.04712486267089844,
-0.004186042118817568,
0.010198405012488365,
0.04063127934932709,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testTransform(self):
# create the transformation model
numpy.random.seed(13) # HACK; set fixed seed so that we always get the same random matrix (and can compare against expected results)
model = rpmodel.RpModel(self.corpus, num_topics=2)
# transform one document
doc = list(... | |
9,322 | [
-0.004959546960890293,
0.014239603653550148,
0.059352464973926544,
-0.03381594270467758,
-0.025960469618439674,
0.02586071752011776,
0.006932767108082771,
0.019588807597756386,
0.023167410865426064,
0.00470393244177103,
0.02865377441048622,
0.03266879543662071,
0.049452073872089386,
-0.007... | 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 testPersistenceCompressed(self):
fname = testfile() + '.gz'
model = rpmodel.RpModel(self.corpus, num_topics=2)
model.save(fname)
model2 = rpmodel.RpModel.load(fname, mmap=None)
self.assertEqual(model.num_topics, model2.num_topics)
self.assertTrue(numpy.allclose(model.... | |
9,323 | [
0.008847467601299286,
-0.028624868020415306,
0.055371906608343124,
-0.027637803927063942,
0.04254006966948509,
0.0001406867813784629,
0.022895079106092453,
0.00554922828450799,
0.0001326932106167078,
0.002077951095998287,
0.024327527731657028,
0.024303453043103218,
0.003903117496520281,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_initialize_from_FITS(tmpdir):
ccd_data = create_ccd_data()
hdu = fits.PrimaryHDU(ccd_data)
hdulist = fits.HDUList([hdu])
filename = tmpdir.join('afile.fits').strpath
hdulist.writeto(filename)
cd = CCDData.read(filename, unit=u.electron)
assert cd.shape == (DEFAULT_DATA_SIZE, DEFAULT... | |
9,324 | [
-0.02398809604346752,
-0.0082431361079216,
0.03271910548210144,
-0.023950079455971718,
0.024913152679800987,
-0.010143935680389404,
0.011214720085263252,
-0.006427871994674206,
0.00875635165721178,
-0.015117696486413479,
0.027548927813768387,
-0.008509248495101929,
-0.02765030413866043,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_initialize_from_fits_with_unit_in_header(tmpdir):
fake_img = np.zeros([2, 2])
hdu = fits.PrimaryHDU(fake_img)
hdu.header['bunit'] = u.adu.to_string()
filename = tmpdir.join('afile.fits').strpath
hdu.writeto(filename)
ccd = CCDData.read(filename)
# ccd should pick up the unit adu fro... | |
9,325 | [
-0.01504591479897499,
-0.020052790641784668,
0.023984959349036217,
-0.0214056596159935,
0.007112039718776941,
-0.005136473104357719,
0.025666560977697372,
0.0004994232440367341,
0.015779245644807816,
-0.0038152141496539116,
0.02971252240240574,
-0.018244752660393715,
-0.013591897673904896,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_initialize_from_fits_with_ADU_in_header(tmpdir):
fake_img = np.zeros([2, 2])
hdu = fits.PrimaryHDU(fake_img)
hdu.header['bunit'] = 'ADU'
filename = tmpdir.join('afile.fits').strpath
hdu.writeto(filename)
ccd = CCDData.read(filename)
# ccd should pick up the unit adu from the fits he... | |
9,326 | [
-0.0073099262081086636,
-0.03239325433969498,
0.05661251023411751,
-0.038321927189826965,
0.019715987145900726,
-0.0124439038336277,
0.02293260768055916,
-0.0038063335232436657,
0.005256965756416321,
-0.0009066453203558922,
0.04568861424922943,
-0.014657694846391678,
-0.01337104756385088,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_initialize_from_fits_with_data_in_different_extension(tmpdir):
fake_img = np.arange(4).reshape(2, 2)
hdu1 = fits.PrimaryHDU()
hdu2 = fits.ImageHDU(fake_img)
hdus = fits.HDUList([hdu1, hdu2])
filename = tmpdir.join('afile.fits').strpath
hdus.writeto(filename)
ccd = CCDData.read(filen... | |
9,327 | [
-0.024195609614253044,
-0.043297406286001205,
0.042294081300497055,
-0.051452651619911194,
0.0007151114987209439,
-0.01713373325765133,
0.02380971610546112,
0.001026641228236258,
0.011461078189313412,
0.004270570352673531,
0.028144601732492447,
0.0008771069697104394,
-0.016078954562544823,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_initialize_from_fits_with_extension(tmpdir):
fake_img1 = np.zeros([2, 2])
fake_img2 = np.arange(4).reshape(2, 2)
hdu0 = fits.PrimaryHDU()
hdu1 = fits.ImageHDU(fake_img1, name='first', ver=1)
hdu2 = fits.ImageHDU(fake_img2, name='second', ver=1)
hdus = fits.HDUList([hdu0, hdu1, hdu2])
... | |
9,328 | [
-0.0011198594002053142,
0.0157797671854496,
0.05723962187767029,
-0.02772088535130024,
0.011977560818195343,
0.028595514595508575,
0.00803565513342619,
0.004543212708085775,
-0.0009968646336346865,
-0.003957089502364397,
0.02350565977394581,
-0.015184534713625908,
-0.00317964144051075,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_initialize_from_FITS_bad_keyword_raises_error(tmpdir):
# There are two fits.open keywords that are not permitted in ccdproc:
# do_not_scale_image_data and scale_back
ccd_data = create_ccd_data()
filename = tmpdir.join('test.fits').strpath
ccd_data.write(filename)
with pytest.raises... | |
9,329 | [
0.02513808384537697,
-0.040235843509435654,
0.058651383966207504,
-0.06913904845714569,
0.031139908358454704,
0.015880608931183815,
0.027412066236138344,
-0.003730948781594634,
-0.005697385407984257,
-0.02082621306180954,
0.043416935950517654,
0.008629954420030117,
0.022491315379738808,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_ccddata_writer_as_imagehdu(tmpdir):
ccd_data = create_ccd_data()
filename = tmpdir.join('test.fits').strpath
ccd_data.write(filename, as_image_hdu=False)
with fits.open(filename) as hdus:
assert len(hdus) == 1
filename = tmpdir.join('test2.fits').strpath
ccd_data.write(filename... | |
9,330 | [
0.01964714005589485,
-0.04167652502655983,
0.08663184940814972,
-0.05087251588702202,
0.031199760735034943,
0.042496226727962494,
0.02830520085990429,
0.004937400575727224,
-0.000839710293803364,
0.014716142788529396,
0.04982227832078934,
0.0021917319390922785,
0.0030690650455653667,
0.008... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_fromMEF(tmpdir):
ccd_data = create_ccd_data()
hdu = fits.PrimaryHDU(ccd_data)
hdu2 = fits.PrimaryHDU(2 * ccd_data.data)
hdulist = fits.HDUList(hdu)
hdulist.append(hdu2)
filename = tmpdir.join('afile.fits').strpath
hdulist.writeto(filename)
# by default, we reading from the first... | |
9,331 | [
0.030326321721076965,
-0.012513348832726479,
0.042247358709573746,
-0.05581440031528473,
-0.008803611621260643,
-0.004850715398788452,
0.007332186680287123,
-0.018018724396824837,
0.000052216888434486464,
-0.024540379643440247,
0.031448595225811005,
-0.01151577290147543,
-0.02611156180500984... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_metafromheader():
hdr = fits.header.Header()
hdr['observer'] = 'Edwin Hubble'
hdr['exptime'] = '3600'
d1 = CCDData(np.ones((5, 5)), meta=hdr, unit=u.electron)
assert d1.meta['OBSERVER'] == 'Edwin Hubble'
assert d1.header['OBSERVER'] == 'Edwin Hubble' | |
9,332 | [
0.03458147868514061,
-0.018940476700663567,
0.04118042439222336,
-0.07153052091598511,
-0.01662329025566578,
0.0032302073668688536,
-0.0016339938156306744,
-0.013726807199418545,
-0.0006560375331901014,
-0.015137268230319023,
0.015754345804452896,
-0.021773990243673325,
-0.04067668691277504,... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_header2meta():
hdr = fits.header.Header()
hdr['observer'] = 'Edwin Hubble'
hdr['exptime'] = '3600'
d1 = CCDData(np.ones((5, 5)), unit=u.electron)
d1.header = hdr
assert d1.meta['OBSERVER'] == 'Edwin Hubble'
assert d1.header['OBSERVER'] == 'Edwin Hubble' | |
9,333 | [
-0.022752223536372185,
-0.05674980208277702,
0.042810793966054916,
-0.006371276453137398,
0.01758720725774765,
0.01119304820895195,
-0.0015969054074957967,
0.012912540696561337,
0.030963946133852005,
0.022307639941573143,
0.036194343119859695,
-0.006812591105699539,
-0.011768392287194729,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_to_hdu():
ccd_data = create_ccd_data()
ccd_data.meta = {'observer': 'Edwin Hubble'}
fits_hdulist = ccd_data.to_hdu()
assert isinstance(fits_hdulist, fits.HDUList)
for k, v in ccd_data.meta.items():
assert fits_hdulist[0].header[k] == v
np.testing.assert_array_equal(fits_hdulist[... | |
9,334 | [
0.03156190738081932,
0.005593171808868647,
0.011290487833321095,
-0.013281485997140408,
-0.004456771537661552,
0.029405502602458,
0.04013851284980774,
0.01148039847612381,
0.029822081327438354,
0.0036664986982941628,
0.013685811311006546,
0.0012328870361670852,
-0.02528873272240162,
0.0252... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "operand", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "expect_failure", "annotation": null, "type_comment": null}}, {... | def test_add_sub_overload(operand, expect_failure, with_uncertainty,
operation, affects_uncertainty):
ccd_data = create_ccd_data()
if with_uncertainty:
ccd_data.uncertainty = StdDevUncertainty(np.ones_like(ccd_data))
method = getattr(ccd_data, operation)
np_method = get... | |
9,335 | [
0.02938258647918701,
-0.001771844457834959,
0.03123251162469387,
0.007141434121876955,
0.010841285809874535,
0.016108768060803413,
0.0342356376349926,
0.029190385714173317,
0.00601225858554244,
0.022571496665477753,
0.019159944728016853,
-0.0031773075461387634,
-0.011838323436677456,
0.030... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "operand", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "with_uncertainty", "annotation": null, "type_comment": null}},... | def test_mult_div_overload(operand, with_uncertainty,
operation, affects_uncertainty):
ccd_data = create_ccd_data()
if with_uncertainty:
ccd_data.uncertainty = StdDevUncertainty(np.ones_like(ccd_data))
method = getattr(ccd_data, operation)
np_method = getattr(np, opera... | |
9,336 | [
0.019872957840561867,
0.021825648844242096,
0.04273674637079239,
-0.017524784430861473,
0.0068529569543898106,
0.04397262632846832,
0.01703043282032013,
-0.001944966847077012,
0.011122924275696278,
-0.019366245716810226,
0.016486644744873047,
-0.038485314697027206,
-0.02575574815273285,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_arithmetic_overload_fails():
ccd_data = create_ccd_data()
with pytest.raises(TypeError):
ccd_data.multiply("five")
with pytest.raises(TypeError):
ccd_data.divide("five")
with pytest.raises(TypeError):
ccd_data.add("five")
with pytest.raises(TypeError):
ccd... | |
9,337 | [
-0.007025941740721464,
-0.011721882969141006,
0.04949904978275299,
-0.020520782098174095,
0.0005956027889624238,
0.04705524444580078,
0.02074839174747467,
-0.03279970958828926,
-0.008199927397072315,
0.053859565407037735,
0.0205327607691288,
-0.030403820797801018,
-0.016747258603572845,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fie... | def test_arithmetic_with_wcs_compare():
def return_true(_, __):
return True
wcs1, wcs2 = nd_testing.create_two_equal_wcs(naxis=2)
ccd1 = CCDData(np.ones((10, 10)), unit='', wcs=wcs1)
ccd2 = CCDData(np.ones((10, 10)), unit='', wcs=wcs2)
nd_testing.assert_wcs_seem_equal(
ccd1.add(ccd2... | |
9,338 | [
0.03552081063389778,
-0.01010548509657383,
0.00934432540088892,
0.0013111449079588056,
0.011578299105167389,
0.049877654761075974,
0.025235865265130997,
-0.007122727110981941,
0.012624121271073818,
0.008719307370483875,
0.027921585366129875,
-0.00226646289229393,
-0.01975303702056408,
0.02... | 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 test_arithmetic_overload_ccddata_operand():
ccd_data = create_ccd_data()
ccd_data.uncertainty = StdDevUncertainty(np.ones_like(ccd_data))
operand = ccd_data.copy()
result = ccd_data.add(operand)
assert len(result.meta) == 0
np.testing.assert_array_equal(result.data,
... | |
9,339 | [
0.00019918809994123876,
-0.013143791817128658,
0.044180408120155334,
-0.016681581735610962,
0.01094916183501482,
0.05142388492822647,
0.027486834675073624,
-0.029741426929831505,
0.02566397376358509,
0.03816016763448715,
0.021442608907818794,
-0.054398030042648315,
-0.024776527658104897,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fie... | def test_arithmetic_with_wcs_compare_fail():
def return_false(_, __):
return False
ccd1 = CCDData(np.ones((10, 10)), unit='', wcs=WCS())
ccd2 = CCDData(np.ones((10, 10)), unit='', wcs=WCS())
with pytest.raises(ValueError):
ccd1.add(ccd2, compare_wcs=return_false)
with pytest.raises(... | |
9,340 | [
-0.0040704235434532166,
-0.023874130100011826,
0.030881596729159355,
0.004865618422627449,
0.022265460342168808,
0.01466083712875843,
0.015696723014116287,
0.003911993931978941,
0.04616396501660347,
0.01668386161327362,
-0.020571481436491013,
0.0042379931546747684,
-0.03049161471426487,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"... | def test_arithmetic_overload_differing_units():
a = np.array([1, 2, 3]) * u.m
b = np.array([1, 2, 3]) * u.cm
ccddata = CCDData(a)
# TODO: Could also be parametrized.
res = ccddata.add(b)
np.testing.assert_array_almost_equal(res.data, np.add(a, b).value)
assert res.unit == np.add(a, b).unit
... | |
9,341 | [
-0.0021750619634985924,
-0.048326075077056885,
0.043484583497047424,
0.009077794849872589,
0.043928757309913635,
0.036244556307792664,
-0.008389326743781567,
-0.01480208057910204,
0.008244969882071018,
0.019332651048898697,
-0.012037101201713085,
-0.015923619270324707,
-0.008755769580602646,... | 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 test_arithmetic_add_with_array():
ccd = CCDData(np.ones((3, 3)), unit='')
res = ccd.add(np.arange(3))
np.testing.assert_array_equal(res.data, [[1, 2, 3]] * 3)
ccd = CCDData(np.ones((3, 3)), unit='adu')
with pytest.raises(ValueError):
ccd.add(np.arange(3)) | |
9,342 | [
-0.014256970025599003,
-0.02860318496823311,
0.04053977131843567,
0.004755112342536449,
0.04524747282266617,
0.043841853737831116,
-0.012516682036221027,
0.012092766351997852,
0.021619724109768867,
0.01801643706858158,
0.004520842805504799,
-0.04326175898313522,
-0.0004260078421793878,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_arithmetic_subtract_with_array():
ccd = CCDData(np.ones((3, 3)), unit='')
res = ccd.subtract(np.arange(3))
np.testing.assert_array_equal(res.data, [[1, 0, -1]] * 3)
ccd = CCDData(np.ones((3, 3)), unit='adu')
with pytest.raises(ValueError):
ccd.subtract(np.arange(3)) | |
9,343 | [
0.02551417611539364,
-0.023438861593604088,
0.048152752220630646,
-0.04432766139507294,
0.02632802538573742,
0.009664461016654968,
0.019857924431562424,
-0.003791181603446603,
-0.015029084868729115,
-0.003672495251521468,
0.034859880805015564,
-0.02091592736542225,
-0.005666425917297602,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_history_preserved_if_metadata_is_fits_header(tmpdir):
fake_img = np.zeros([2, 2])
hdu = fits.PrimaryHDU(fake_img)
hdu.header['history'] = 'one'
hdu.header['history'] = 'two'
hdu.header['history'] = 'three'
assert len(hdu.header['history']) == 3
tmp_file = tmpdir.join('temp.fits').st... | |
9,344 | [
-0.0049432567320764065,
-0.005816351622343063,
0.018733017146587372,
-0.02775927633047104,
-0.008936380967497826,
0.015304836444556713,
-0.010945782996714115,
0.0074662440456449986,
0.03872431814670563,
-0.01865598000586033,
0.06234923377633095,
-0.03438452258706093,
-0.014341864734888077,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_wcs_SIP_coefficient_keywords_removed():
# If SIP polynomials are present, check that no more polynomial
# coefficients remain in the header. See #8598
# The SIP paper is ambiguous as to whether keywords like
# A_0_0 can appear in the header for a 2nd order or higher
# polynomial. The paper... | |
9,345 | [
0.016437752172350883,
0.014668548479676247,
0.008885628543794155,
-0.05265362188220024,
0.0233165230602026,
0.03741734102368355,
0.006898574996739626,
-0.025085726752877235,
-0.012113765813410282,
-0.007222048472613096,
0.05503016337752342,
0.039080921560525894,
-0.0017725046491250396,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_infol_logged_if_unit_in_fits_header(tmpdir):
ccd_data = create_ccd_data()
tmpfile = tmpdir.join('temp.fits')
ccd_data.write(tmpfile.strpath)
log.setLevel('INFO')
explicit_unit_name = "photon"
with log.log_to_list() as log_list:
_ = CCDData.read(tmpfile.strpath, unit=explicit_uni... | |
9,346 | [
0.018857678398489952,
0.039016783237457275,
0.05669016391038895,
-0.037481099367141724,
0.01937824860215187,
-0.009461374953389168,
0.0031771089415997267,
-0.039693526923656464,
0.008277076296508312,
-0.002664671977981925,
0.03737698495388031,
-0.008068847469985485,
-0.01835012249648571,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_read_wcs_not_creatable(tmpdir):
# The following Header can't be converted to a WCS object. See also #6499.
hdr_txt_example_WCS = textwrap.dedent('''
SIMPLE = T / Fits standard
BITPIX = 16 / Bits per pixel
NAXIS = 2 / Number of axes... | |
9,347 | [
0.046186663210392,
-0.0252815131098032,
0.06265364587306976,
0.006663440261036158,
0.020991690456867218,
0.04947511479258537,
-0.017517801374197006,
-0.012943639419972897,
-0.010180599056184292,
-0.002449339721351862,
0.05330752208828926,
-0.017221098765730858,
-0.011756830848753452,
0.019... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "operation", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs... | def test_wcs_arithmetic_ccd(operation):
ccd_data = create_ccd_data()
ccd_data2 = ccd_data.copy()
ccd_data.wcs = WCS(naxis=2)
method = getattr(ccd_data, operation)
result = method(ccd_data2)
nd_testing.assert_wcs_seem_equal(result.wcs, ccd_data.wcs)
assert ccd_data2.wcs is None | |
9,348 | [
0.03285699710249901,
0.016452018171548843,
0.04929725453257561,
-0.04431108012795448,
0.0064208731055259705,
0.03368018567562103,
0.031657490879297256,
0.017345765605568886,
-0.018263032659888268,
0.01223023422062397,
0.01333565916866064,
0.00869052205234766,
0.044593315571546555,
0.035773... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_write_read_multiextensionfits_mask_default(tmpdir):
# Test that if a mask is present the mask is saved and loaded by default.
ccd_data = create_ccd_data()
ccd_data.mask = ccd_data.data > 10
filename = tmpdir.join('afile.fits').strpath
ccd_data.write(filename)
ccd_after = CCDData.read(fi... | |
9,349 | [
0.012654955498874187,
-0.014635222032666206,
0.035715095698833466,
-0.034660518169403076,
-0.025942659005522728,
0.018267663195729256,
0.008963926695287228,
-0.0018645554082468152,
0.003034845693036914,
-0.0023757335729897022,
0.0310983806848526,
-0.00995405949652195,
-0.0026218020357191563,... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "uncertainty_type", "annotation": null, "type_comment": null}}],... | def test_write_read_multiextensionfits_uncertainty_default(
tmpdir, uncertainty_type):
# Test that if a uncertainty is present it is saved and loaded by default.
ccd_data = create_ccd_data()
ccd_data.uncertainty = uncertainty_type(ccd_data.data * 10)
filename = tmpdir.join('afile.fits').strpath
... | |
9,350 | [
0.0226540956646204,
-0.014251871965825558,
0.028929173946380615,
-0.03710686415433884,
-0.015799961984157562,
0.015327262692153454,
0.018352534621953964,
0.010842530988156796,
0.008898557163774967,
-0.0009114225977100432,
0.04084118455648422,
-0.015339079312980175,
-0.0011817472986876965,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "uncertainty_type", "annotation": null, "type_comment": null}}],... | def test_write_read_multiextensionfits_uncertainty_different_uncertainty_key(
tmpdir, uncertainty_type):
# Test that if a uncertainty is present it is saved and loaded by default.
ccd_data = create_ccd_data()
ccd_data.uncertainty = uncertainty_type(ccd_data.data * 10)
filename = tmpdir.join('afi... | |
9,351 | [
0.05051437392830849,
0.008901404216885567,
0.060236383229494095,
-0.04901096969842911,
-0.0032291864044964314,
0.03668305650353432,
0.03375141695141792,
0.03605663776397705,
-0.006289239972829819,
0.010555148124694824,
0.03773543983697891,
0.006990828551352024,
-0.0056408969685435295,
0.03... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_write_read_multiextensionfits_not(tmpdir):
# Test that writing mask and uncertainty can be disabled
ccd_data = create_ccd_data()
ccd_data.mask = ccd_data.data > 10
ccd_data.uncertainty = StdDevUncertainty(ccd_data.data * 10)
filename = tmpdir.join('afile.fits').strpath
ccd_data.write(fi... | |
9,352 | [
-0.0021387652959674597,
-0.002909188624471426,
0.06979713588953018,
-0.071013443171978,
-0.012864754535257816,
0.04528393596410751,
0.00044441877980716527,
0.016116028651595116,
-0.020045626908540726,
0.023413851857185364,
0.03461788222193718,
-0.013683420605957508,
-0.006268643774092197,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_read_old_style_multiextensionfits(tmpdir):
# Regression test for https://github.com/astropy/ccdproc/issues/664
#
# Prior to astropy 3.1 there was no uncertainty type saved
# in the multiextension fits files generated by CCDData
# because the uncertainty had to be StandardDevUncertainty.
... | |
9,353 | [
0.04889604076743126,
-0.009011052548885345,
0.07011879235506058,
-0.04961002990603447,
-0.0033545244950801134,
0.03446850925683975,
0.002212755149230361,
0.013319616205990314,
-0.0006535936845466495,
0.02981526032090187,
0.043159496039152145,
-0.018145207315683365,
0.004425510298460722,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_write_read_multiextensionfits_custom_ext_names(tmpdir):
# Test writing mask, uncertainty in another extension than default
ccd_data = create_ccd_data()
ccd_data.mask = ccd_data.data > 10
ccd_data.uncertainty = StdDevUncertainty(ccd_data.data * 10)
filename = tmpdir.join('afile.fits').strpat... | |
9,354 | [
0.013286932371556759,
-0.022485578432679176,
0.023470256477594376,
-0.01594182662665844,
-0.040658511221408844,
0.03322979435324669,
0.010632039047777653,
0.011080753058195114,
0.018559327349066734,
0.027920007705688477,
0.0242056492716074,
-0.0028029070235788822,
-0.025090614333748817,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_stddevuncertainty_compat_descriptor_no_weakref():
# TODO: Remove this test if astropy 1.0 isn't supported anymore
# This test might create a Memoryleak on purpose, so the last lines after
# the assert are IMPORTANT cleanup.
ccd = CCDData(np.ones((10, 10)), unit='')
uncert = StdDevUncertaint... | |
9,355 | [
0.038251589983701706,
-0.0105686504393816,
0.0767669826745987,
-0.051177989691495895,
0.015718325972557068,
0.04739679768681526,
0.01531162764877081,
0.005372260231524706,
-0.029568038880825043,
0.0223573949187994,
0.030425403267145157,
0.013091277331113815,
0.005372260231524706,
-0.007870... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_recognized_fits_formats_for_read_write(tmpdir):
# These are the extensions that are supposed to be supported.
ccd_data = create_ccd_data()
supported_extensions = ['fit', 'fits', 'fts']
for ext in supported_extensions:
path = tmpdir.join(f"test.{ext}")
ccd_data.write(path.strpat... | |
9,356 | [
-0.009513589553534985,
-0.05453019589185715,
0.040669169276952744,
-0.014114892110228539,
0.009919773787260056,
-0.00873295497149229,
-0.00530577776953578,
-0.001028946484439075,
0.00974841509014368,
0.00016094642342068255,
0.030463796108961105,
-0.003217738587409258,
-0.02067730203270912,
... | 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 test_sliced_ccdata_to_hdu():
wcs = WCS(naxis=2)
wcs.wcs.crpix = 10, 10
ccd = CCDData(np.ones((10, 10)), wcs=wcs, unit='pixel')
trimmed = ccd[2:-2, 2:-2]
hdul = trimmed.to_hdu()
assert isinstance(hdul, fits.HDUList)
assert hdul[0].header['CRPIX1'] == 8
assert hdul[0].header['CRPIX2'] ... | |
9,357 | [
0.008243280462920666,
-0.006762583740055561,
0.04015560448169708,
-0.028442632406949997,
0.04676348716020584,
0.032376423478126526,
0.031846024096012115,
0.0019889953546226025,
-0.025392839685082436,
-0.02333754487335682,
0.020917600020766258,
-0.02914983034133911,
0.0285752322524786,
0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def test_read_returns_image(tmpdir):
# Test if CCData.read returns a image when reading a fits file containing
# a table and image, in that order.
tbl = Table(np.ones(10).reshape(5, 2))
img = np.ones((5, 5))
hdul = fits.HDUList(hdus=[fits.PrimaryHDU(), fits.TableHDU(tbl.as_array()),
... | |
9,358 | [
0.00011432625615270808,
0.026964856311678886,
-0.0014418557984754443,
-0.08745823800563812,
-0.024683712050318718,
0.0327322781085968,
0.0046107107773423195,
-0.020035339519381523,
0.022596247494220734,
0.016731983050704002,
0.0022165842819958925,
0.00892551802098751,
0.04682803526520729,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def parse_args_and_config(args):
parser = argparse.ArgumentParser(description='ambient7 - serial2influxdb')
parser.add_argument('-v', '--verbose', action='store_true')
parser.add_argument('config', metavar='config.cfg', type=argparse.FileType('r', encoding='UTF-8'),
default='./confi... | |
9,359 | [
0.0433456152677536,
0.012522825971245766,
0.08035574853420258,
-0.014710617251694202,
-0.02841849811375141,
-0.011069996282458305,
0.011263706721365452,
0.015177802182734013,
-0.031016498804092407,
0.013719274662435055,
-0.01874435693025589,
-0.0028743247967213392,
0.0015482611488550901,
-... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {... | class Migration(migrations.Migration):
dependencies = [
('cms', '0003_auto_20140926_2347'),
('placeholderapp', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='CharPksExample',
fields=[
('char_1', models.CharField(max_length=25... | |
9,360 | [
0.07654578238725662,
0.0008628196083009243,
-0.04002832993865013,
-0.028737176209688187,
0.02208384871482849,
0.011832955293357372,
0.01557138841599226,
0.0009664392564445734,
0.0474185086786747,
-0.0031559965573251247,
0.005558888427913189,
-0.023665910586714745,
0.02908392995595932,
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 open_serial(config):
while True:
try:
return serial.Serial(
port=config['serial']['tty'],
baudrate=int(config['serial']['baud']),
timeout=1,
exclusive=True
)
except serial.SerialException as e:
lo... | |
9,361 | [
0.04314819723367691,
-0.021476134657859802,
-0.026777135208249092,
-0.029585469514131546,
0.007369155064225197,
0.009742087684571743,
-0.00023334749857895076,
-0.004057389218360186,
0.029585469514131546,
-0.019277360290288925,
0.0066888416185975075,
-0.034440185874700546,
0.01922293566167354... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}, {"_type": "arg... | def collect_data(key, value, tags=None):
data = {
'time': datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ'),
'measurement': key,
}
if tags:
data['tags'] = tags
if key == 'uptime':
data['fields'] = {'value': int(value.rstrip('s'))}
elif key == 'humidity':
... | |
9,362 | [
-0.0045378985814750195,
0.013153773732483387,
0.04131123051047325,
-0.03196970000863075,
0.004599221516400576,
-0.01923496648669243,
0.01979709416627884,
0.015330739319324493,
-0.03589437156915665,
-0.0224237609654665,
-0.011968197301030159,
-0.006888612173497677,
0.05371890962123871,
-0.0... | 9 | {"_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 build_influxdb_client(config):
opts = {
'host': config['influxdb']['server'],
'port': int(config['influxdb']['port']),
'database': config['influxdb']['database']
}
if 'username' in config['influxdb']:
opts['username'] = config['influxdb']['username']
opts['passwor... | |
9,363 | [
0.020634157583117485,
-0.0013801867607980967,
0.05781302973628044,
-0.04916677996516228,
-0.010001607239246368,
0.018273964524269104,
0.010106764733791351,
-0.009008456952869892,
-0.0002170690568163991,
0.004810936748981476,
0.037155505269765854,
-0.01129270251840353,
0.02484044060111046,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def main(args):
cli_args, config = parse_args_and_config(args)
influxdb_client = build_influxdb_client(config)
logging.basicConfig(
level=logging.DEBUG if cli_args.verbose else logging.INFO,
stream=sys.stderr,
format='%(asctime)s %(levelname).1s %(message)s'
)
tags = {}
... | |
9,364 | [
0.02845272794365883,
0.01828658953309059,
0.0017471428727731109,
0.004013496451079845,
-0.002192365936934948,
-0.0382346510887146,
-0.016344742849469185,
-0.016739342361688614,
-0.028203507885336876,
0.0510072261095047,
-0.030550338327884674,
-0.010820344090461731,
0.0057632350362837315,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation":... | class IntroPage(QtGui.QWizardPage):
def __init__(self, parent=None):
super(IntroPage, self).__init__(parent)
self.setTitle("Introduction")
#self.setPixmap(QtGui.QWizard.WatermarkPixmap,
# QtGui.QPixmap(':/images/watermark1.png'))
label = QtGui.QLabel("Welcome to the ... | |
9,365 | [
0.045538246631622314,
0.009523729793727398,
-0.0021105902269482613,
0.008052628487348557,
0.015731994062662125,
-0.026128502562642097,
0.007218273356556892,
-0.013174034655094147,
-0.024591531604528427,
0.05085177347064018,
-0.029136573895812035,
-0.01579786278307438,
-0.002186066471040249,
... | 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": "parent", "annotation": null, "type_comment": null}}], "kwarg": nu... | def __init__(self, parent=None):
super(IntroPage, self).__init__(parent)
self.setTitle("Introduction")
#self.setPixmap(QtGui.QWizard.WatermarkPixmap,
# QtGui.QPixmap(':/images/watermark1.png'))
label = QtGui.QLabel("Welcome to the SoCRocket - Configuration Wizard.\n\n"
... | |
9,366 | [
-0.022399568930268288,
0.010293997824192047,
0.03363132104277611,
0.0004342447209637612,
-0.004110672511160374,
0.04369087889790535,
-0.021056873723864555,
0.060570478439331055,
0.02412589080631733,
0.03714790567755699,
-0.010075543075799942,
-0.07787632942199707,
0.022740570828318596,
0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "connection", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwar... | def list_ec2_vpc_subnets(connection, module):
filters = module.params.get("filters")
subnet_dict_array = []
try:
all_subnets = connection.get_all_subnets(filters=filters)
except BotoServerError as e:
module.fail_json(msg=e.message)
for subnet in all_subnets:
subnet_dict_ar... | |
9,367 | [
0.03380025178194046,
0.007049342151731253,
0.04217027500271797,
-0.0006503346958197653,
-0.01511635072529316,
0.05932195857167244,
-0.007403810508549213,
0.037093374878168106,
0.036315832287073135,
0.05767539516091347,
0.023131905123591423,
-0.09353385120630264,
0.010456809774041176,
0.010... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
argument_spec = ec2_argument_spec()
argument_spec.update(
dict(
filters = dict(default=None, type='dict')
)
)
module = AnsibleModule(argument_spec=argument_spec)
if not HAS_BOTO:
module.fail_json(msg='boto required for this module')
region, ec2_... | |
9,368 | [
0.051610976457595825,
0.011142670176923275,
-0.010051826946437359,
-0.028723329305648804,
-0.034559011459350586,
0.011129286140203476,
-0.02344980090856552,
-0.013391281478106976,
-0.004376760683953762,
0.04267007112503052,
-0.03405039384961128,
-0.0293122511357069,
0.04366052895784378,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "botMode", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [{"_type": "Constant", "_fields": {"kind": null, "value... | def printCurrentArchive(botMode = False):
assembly = ""
for character in sorted(characterLookup):
assembly += character+"\n\n* Call names\n"
for name in TRZRCNameCatcher[character]:
assembly += " * "+name+"\n"
assembly += "* Chapters\n"
for chapter in characterLookup[... | |
9,369 | [
-0.0038240470457822084,
-0.016666550189256668,
-0.020901087671518326,
0.006222178228199482,
0.03207384794950485,
0.0001791075337678194,
-0.012567812576889992,
0.04883916303515434,
-0.00251541449688375,
0.01222830917686224,
0.03353062644600868,
-0.04014786705374718,
0.0053734187968075275,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "username", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "password", "annotation": null, "type_comment": null}}], "kwar... | def getCookies(username,password):
# Code mostly borrowed from cum
# Great project name, btw. Go googling for that one. "Python cum"...
url = "https://bato.to/forums/index.php"
params = {'app': 'core', 'module': 'global','section': 'login', 'do': 'process'}
firstGet = get(url,params=params)
auth... | |
9,370 | [
0.007869875058531761,
0.0389944352209568,
0.0316508486866951,
-0.03632626309990883,
0.02006022445857525,
0.04036523774266243,
-0.03992462158203125,
-0.008084062486886978,
0.02039068564772606,
0.03664448857307434,
0.03833351284265518,
-0.07118381559848785,
-0.008671549148857594,
-0.00200112... | 16 | {"_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": "module", "annotation":... | class RundeckACLManager:
def __init__(self, module):
self.module = module
def handle_http_code_if_needed(self, infos):
if infos["status"] == 403:
self.module.fail_json(msg="Token not allowed. Please ensure token is allowed or has the correct "
"... | |
9,371 | [
-0.005575248505920172,
0.020164236426353455,
-0.026428308337926865,
-0.02602344937622547,
0.016070660203695297,
0.01280929520726204,
-0.06545223295688629,
0.024426504969596863,
0.025776034221053123,
0.0042594559490680695,
0.03659477084875107,
-0.060099098831415176,
-0.008524535223841667,
-... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "query", "annotation": null, "type_comment": null}}, {"_type": "ar... | def request_rundeck_api(self, query, data=None, method="GET"):
resp, info = fetch_url(self.module,
"%s/api/%d/%s" % (self.module.params["url"], self.module.params["api_version"], query),
data=json.dumps(data),
method=me... | |
9,372 | [
0.02134455367922783,
0.020186321809887886,
0.05261680483818054,
-0.019122639670968056,
0.029192162677645683,
0.029546724632382393,
-0.005297727417200804,
-0.015104285441339016,
0.005359775852411985,
0.051718585193157196,
0.013957872055470943,
-0.030728593468666077,
-0.011109568178653717,
-... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def create_or_update_acl(self):
facts = self.get_acl()
if facts is None:
# If in check mode don't create project, simulate a fake project creation
if self.module.check_mode:
self.module.exit_json(changed=True, before={}, after=self.module.params["policy"])
... | |
9,373 | [
0.0324525348842144,
0.03851127251982689,
0.038325563073158264,
-0.018466375768184662,
-0.0011708332458510995,
0.06397653371095657,
-0.04944485053420067,
-0.006731928326189518,
0.03359000012278557,
0.04245757311582565,
0.038209494203329086,
-0.07753324508666992,
-0.011403653770685196,
0.001... | 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 remove_acl(self):
facts = self.get_acl()
if facts is None:
self.module.exit_json(changed=False, before={}, after={})
else:
# If not in check mode, remove the project
if not self.module.check_mode:
self.request_rundeck_api("system/acl/%s.acl... | |
9,374 | [
-0.009436558000743389,
0.0262717604637146,
0.008916621096432209,
-0.01520367618650198,
-0.016888989135622978,
0.056081485003232956,
-0.015239533968269825,
0.0011511824559420347,
0.02643909677863121,
0.05469498410820961,
0.01906435750424862,
-0.07267165929079056,
0.020187899470329285,
0.021... | 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(
state=dict(type='str', choices=['present', 'absent'], default='present'),
name=dict(required=True, type='str'),
url=dict(required=True, type='str'),
api_version=dict(type='int', default=14),
t... | |
9,375 | [
-0.02549760788679123,
-0.008622784167528152,
0.031596940010786057,
-0.04118844494223595,
-0.04410655423998833,
-0.017209690064191818,
0.018991651013493538,
-0.003671559737995267,
0.001822325517423451,
0.013143466785550117,
-0.0028209418524056673,
0.0319318063557148,
0.019194962456822395,
0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "projectName", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "kitCount", "annotation": null, "type_comment": null}}, {"_... | def modifyRunSettingsForHookInto(projectName, kitCount, port):
prepareBuildSettings(kitCount, 0)
# this uses the default Qt version which Creator activates when opening the project
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.BUILD)
qtVersion, mkspe... | |
9,376 | [
0.004168060142546892,
0.0437646321952343,
0.023408988490700722,
-0.029200654476881027,
-0.054863303899765015,
-0.004352835938334465,
0.02448735386133194,
0.04640601947903633,
-0.03511348366737366,
0.014588210731744766,
0.002806473523378372,
-0.011474281549453735,
0.02849789895117283,
0.027... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "kitCount", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "currentTarget", "annotation": null, "type_comment": null}}, {... | def batchEditRunEnvironment(kitCount, currentTarget, modifications, alreadyOnRunSettings=False):
if not alreadyOnRunSettings:
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(kitCount, currentTarget, ProjectSettings.RUN)
ensureChecked(":RunSettingsEnvironmentDetails_Utils::Deta... | |
9,377 | [
-0.03425808250904083,
0.008515439927577972,
0.0037669166922569275,
-0.03050343506038189,
-0.03521515056490898,
-0.018000217154622078,
0.01311672292649746,
-0.0059356545098125935,
-0.009122809395194054,
0.01732536219060421,
-0.007349782157689333,
0.033399175852537155,
0.037890028208494186,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "kitCount", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "workingDir", "annotation": null, "type_comment": null}}, {"_t... | def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, port):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN, True)
qtVersion, mkspec, qtLibPath, qmake = getQtInformationForQmlProject()
if None in (qtVersion, mkspec, qtLibPath, ... | |
9,378 | [
0.009166453033685684,
0.01376478560268879,
-0.02663528360426426,
-0.037560101598501205,
-0.03794682025909424,
-0.03192850202322006,
0.010785839520394802,
0.0048279473558068275,
-0.017329853028059006,
0.0007545555708929896,
0.021897973492741585,
0.01623012125492096,
0.009553172625601292,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": nul... | def __addVariableToRunEnvironment__(name, value):
clickButton(waitForObject("{text='Add' type='QPushButton' unnamed='1' visible='1' "
"container={window=':Qt Creator_Core::Internal::MainWindow' "
"type='Utils::DetailsWidget' unnamed='1' visible='1' occurre... | |
9,379 | [
0.03935253620147705,
0.008899727836251259,
0.0005874501075595617,
-0.04879714548587799,
-0.017537105828523636,
-0.029847385361790657,
-0.021835612133145332,
-0.015952913090586662,
-0.004699600860476494,
0.012935885228216648,
0.0010348960058763623,
0.02869708091020584,
-0.0021719573996961117,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "qmakeConf", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs... | def __getMkspecFromQMakeConf__(qmakeConf):
if qmakeConf==None or not os.path.exists(qmakeConf):
return None
if not platform.system() in ('Microsoft', 'Windows'):
return os.path.basename(os.path.realpath(os.path.dirname(qmakeConf)))
mkspec = None
file = codecs.open(qmakeConf, "r", "utf-8"... | |
9,380 | [
-0.01430937647819519,
-0.004659879487007856,
0.01621314510703087,
-0.018502647057175636,
-0.017743626609444618,
-0.014371591620147228,
-0.010588938370347023,
-0.0028167697601020336,
0.0017824505921453238,
0.02971373125910759,
-0.0042710378766059875,
0.0015320365782827139,
0.02406463958323002... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "projectName", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "port", "annotation": null, "type_comment": null}}, {"_type... | def __configureCustomExecutable__(projectName, port, mkspec, qmakeVersion):
startAUT = getSquishPath(mkspec, qmakeVersion)
if startAUT == None:
test.warning("Something went wrong determining the right Squish for %s / %s combination - "
"using fallback without hooking into subprocess... | |
9,381 | [
0.032836321741342545,
0.009864920750260353,
-0.0054017044603824615,
-0.04129350930452347,
-0.0032793174032121897,
-0.017410585656762123,
-0.019298352301120758,
-0.028391985222697258,
-0.004174657166004181,
0.001115803956054151,
-0.0011002973187714815,
0.02340828627347946,
0.0177557785063982,... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "qmakeCall", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs... | def __getMkspecFromQmake__(qmakeCall):
if getOutputFromCmdline("%s -query QT_VERSION" % qmakeCall).strip().startswith("5."):
return getOutputFromCmdline("%s -query QMAKE_XSPEC" % qmakeCall).strip()
else:
QmakeConfPath = getOutputFromCmdline("%s -query QMAKE_MKSPECS" % qmakeCall).strip()
... | |
9,382 | [
0.008164833299815655,
0.026942163705825806,
0.031087111681699753,
-0.05202624574303627,
0.01705622300505638,
-0.0072179269045591354,
-0.010648229159414768,
-0.016055718064308167,
-0.0244885440915823,
-0.014900374226272106,
0.01011819951236248,
0.01587705686688423,
0.005407489836215973,
0.0... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mkspec", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "qmakev", "annotation": null, "type_comment": null}}], "kwarg": ... | def getSquishPath(mkspec, qmakev):
# assuming major and minor version will be enough
squishVersion = "%d.%d" % (squishinfo.major, squishinfo.minor)
qmakev = ".".join(qmakev.split(".")[0:2])
path = None
mapfile = os.environ.get("QT_SQUISH_MAPFILE")
if mapfile and os.path.isfile(mapfile):
... | |
9,383 | [
-0.0033160371240228415,
-0.03358671814203262,
0.011937732808291912,
0.02260826714336872,
-0.004837861284613609,
-0.054998841136693954,
0.007851902395486832,
-0.010830413550138474,
-0.020938405767083168,
0.07546352595090866,
0.013962884433567524,
0.05106696859002113,
0.007467004936188459,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "workingDir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "projectName", "annotation": null, "type_comment": null}}, {... | def allowAppThroughWinFW(workingDir, projectName, isReleaseBuild=True):
if not __isWinFirewallRunning__():
return
# WinFirewall seems to run - hopefully no other
result = __configureFW__(workingDir, projectName, isReleaseBuild)
if result == 0:
test.log("Added %s to firewall" % projectNam... | |
9,384 | [
-0.0006446242914535105,
-0.023738263174891472,
0.029386823996901512,
-0.024238767102360725,
-0.02519211173057556,
-0.027194133028388023,
0.012441137805581093,
0.005043785087764263,
-0.008705221116542816,
0.0831315889954567,
0.014633828774094582,
0.03365303948521614,
0.04123212397098541,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "workingDir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "projectName", "annotation": null, "type_comment": null}}, {... | def __configureFW__(workingDir, projectName, isReleaseBuild, addToFW=True):
if isReleaseBuild == None:
if projectName[-4:] == ".exe":
projectName = projectName[:-4]
path = "%s%s%s" % (workingDir, os.sep, projectName)
elif isReleaseBuild:
path = "%s%s%s%srelease%s%s" % (workin... | |
9,385 | [
-0.008119085803627968,
-0.0154474638402462,
0.015103677287697792,
0.0015284165274351835,
-0.03016151674091816,
-0.032109640538692474,
0.002803290728479624,
0.0011731707490980625,
-0.009591637179255486,
0.06871142238378525,
0.03442446514964104,
0.014610917307436466,
0.0044233836233615875,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "workingDir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "projectName", "annotation": null, "type_comment": null}}, {... | def deleteAppFromWinFW(workingDir, projectName, isReleaseBuild=True):
if not __isWinFirewallRunning__():
return
# WinFirewall seems to run - hopefully no other
result = __configureFW__(workingDir, projectName, isReleaseBuild, False)
if result == 0:
test.log("Deleted %s from firewall" % p... | |
9,386 | [
-0.05777807906270027,
0.022811418399214745,
0.026774073019623756,
-0.01292220875620842,
-0.03014407306909561,
-0.0006198912742547691,
-0.036465730518102646,
-0.0058858804404735565,
0.03314221277832985,
0.03541986644268036,
0.013270829804241657,
-0.012910588644444942,
0.04964359477162361,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "executable", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "port", "annotation": null, "type_comment": null}}, {"_type"... | def addExecutableAsAttachableAUT(executable, port, host=None):
if not __checkParamsForAttachableAUT__(executable, port):
return False
if host == None:
host = "localhost"
squishSrv = __getSquishServer__()
if (squishSrv == None):
return False
result = subprocess.call('%s --conf... | |
9,387 | [
-0.011658845469355583,
0.0007960461662150919,
-0.0412239171564579,
0.030950935557484627,
0.045799463987350464,
-0.005216233432292938,
0.005414213985204697,
-0.008331675082445145,
0.000351105845766142,
0.08262381702661514,
0.013055707328021526,
0.026749350130558014,
0.02152486890554428,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Return", "_fields": {"val... | def __isWinFirewallRunning__():
if hasattr(__isWinFirewallRunning__, "fireWallState"):
return __isWinFirewallRunning__.fireWallState
if not platform.system() in ('Microsoft' 'Windows'):
__isWinFirewallRunning__.fireWallState = False
return False
result = getOutputFromCmdline("netsh f... | |
9,388 | [
-0.003016867209225893,
0.035930030047893524,
0.05471217632293701,
-0.04841198772192001,
0.038440633565187454,
-0.02792452648282051,
0.04476450756192207,
-0.0075081209652125835,
-0.021719075739383698,
-0.041424933820962906,
0.01993086375296116,
-0.036640577018260956,
-0.006175843998789787,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class I3DM(object):
def __init__(self):
self.batch_table = BatchTable()
self.feature_table = InstanceFeatureTable(I3DM_SEMANTICS)
self.gltf_bin = bytearray()
def loadJSONBatch(self, data_in, object_wise = True):
self.batch_table.loadJSONBatch(data_in, object_wise)
def loadJSONInstances(self, i3dm_json, obj... | |
9,389 | [
-0.03704332187771797,
0.03592923656105995,
0.017477206885814667,
-0.02224688231945038,
-0.037414684891700745,
0.019159939140081406,
-0.04349573329091072,
0.0034350950736552477,
0.044981177896261215,
0.052083469927310944,
0.05524004250764847,
-0.024045666679739952,
0.04563106223940849,
0.03... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "executable", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "port", "annotation": null, "type_comment": null}}, {"_type"... | def removeExecutableAsAttachableAUT(executable, port, host=None):
if not __checkParamsForAttachableAUT__(executable, port):
return False
if host == None:
host = "localhost"
squishSrv = __getSquishServer__()
if (squishSrv == None):
return False
result = subprocess.call('%s --c... | |
9,390 | [
-0.01402923185378313,
0.02566378004848957,
0.06867772340774536,
-0.057291679084300995,
-0.007590695284307003,
-0.04811958596110344,
0.045069754123687744,
-0.02274949476122856,
-0.026251155883073807,
-0.018863782286643982,
0.0321023166179657,
-0.006472423207014799,
0.009725578129291534,
-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": "gltf_bin", "annotation": null, "type_comment": null}}, {"_type": ... | def writeBinary(self, gltf_bin, embed_gltf = True, num_batches = 0, num_feature_features = 0):
self.embed_gltf = embed_gltf
# Make sure that it's a byte array, not a string
gltf_bin = gltf_bin if embed_gltf else gltf_bin.encode('utf-8')
# Add the required field BATCH_LENGTH to the feature table,
# as well a... | |
9,391 | [
0.02122960425913334,
0.018050462007522583,
0.06141631677746773,
-0.05830782279372215,
-0.0030260724015533924,
-0.03991589695215225,
0.031014299020171165,
-0.03953910991549492,
-0.004000420682132244,
-0.028353238478302956,
0.03784356638789177,
-0.014553406275808811,
-0.02953069843351841,
-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": "gltf_bin", "annotation": null, "type_comment": null}}, {"_type": ... | def writeHeader(self, gltf_bin, num_batch_features, num_feature_features):
len_feature_json = len(self.feature_table.getFeatureJSON())
len_feature_bin = len(self.feature_table.getFeatureBin())
len_batch_json = len(self.batch_table.getBatchJSON())
len_batch_bin = len(self.batch_table.getBatchBin())
leng... | |
9,392 | [
0.02070658653974533,
0.028257256373763084,
0.02976495958864689,
-0.03830049932003021,
0.056903596967458725,
-0.020353980362415314,
-0.02059715799987316,
-0.00793367438018322,
-0.022238606587052345,
-0.05442318692803383,
0.04233724996447563,
-0.009538647718727589,
-0.042142707854509354,
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": "data", "annotation": null, "type_comment": null}}], "kwarg": null... | def readHeader(self, data):
self.magic = self.unpack('4s', data).decode('utf-8')
self.version = self.unpack('<I', data)
if self.magic != I3DM_MAGIC or self.version > I3DM_VERSION:
raise IOError("Unrecognized magic %s or bad version %d" % (self.magic, self.version))
self.length = self.unpack('<I',... | |
9,393 | [
-0.00017102481797337532,
0.047684479504823685,
0.04223622754216194,
-0.015264922752976418,
0.031266096979379654,
-0.021289905533194542,
0.01198247354477644,
0.007522024214267731,
-0.02675042860209942,
-0.02537609450519085,
0.03742605820298195,
-0.03411293029785156,
0.006828721612691879,
-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 readBinary(self, data):
self.offset = 0
self.readHeader(data) # What it says on the tin
# Now grab the feature table, batch table, and GLB
self.feature_json = self.unpackString(data, self.len_feature_json)
self.feature_bin = self.unpackString(data, self.len_feature_bin)
self.batch_json = self.unpac... | |
9,394 | [
0.002192246960476041,
0.02006608247756958,
0.0180631373077631,
0.0031448667868971825,
-0.010112426243722439,
0.009208658710122108,
0.003483779728412628,
-0.05134376883506775,
-0.0010800937889143825,
0.03038613125681877,
-0.0024517748970538378,
-0.06306832283735275,
0.020615670830011368,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "events/blocks/inline_event.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "ajax_template", "ctx": {"_type": "Store", "_fields":... | class EventPage(Page, RenderInlineMixin, RelatedHowToMixin):
ajax_template = 'events/blocks/inline_event.html'
format = models.CharField(
verbose_name=_('page_format'),
max_length=32,
null=False,
default='event',
choices=(PageFormat.EVENT, ))
event_type = models.CharF... | |
9,395 | [
0.002282514236867428,
-0.009710190817713737,
-0.012413723394274712,
-0.0022219663951545954,
0.00048719922779127955,
0.014722991734743118,
-0.015624169260263443,
0.006437788717448711,
-0.008003585040569305,
-0.000972286332398653,
-0.01111264806240797,
-0.028387099504470825,
0.0239713285118341... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": n... | def get_context(self, request):
context = super(EventPage, self).get_context(request)
context['event_report'] = self.event_report
context['related_events'] = self.related_how_to_events(self_idx=self.id)
context['parent'] = self.get_parent().specific
return context | |
9,396 | [
0.03897072374820709,
0.04870263859629631,
0.06838177889585495,
-0.028851253911852837,
0.012670868076384068,
0.014651700854301453,
0.021423133090138435,
0.01502848882228136,
-0.06562583893537521,
-0.0016565249534323812,
-0.015050020068883896,
0.006297755055129528,
0.01767677627503872,
0.028... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {... | class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0023_alter_page_revision_on_delete_behaviour'),
]
operations = [
migrations.AlterField(
model_name='page',
name='content_type',
field=models.ForeignKey(on_delete=models.SET(wagtail.... | |
9,397 | [
-0.017977623268961906,
-0.01508366409689188,
0.014570018276572227,
-0.05737805739045143,
-0.010504694655537605,
0.006533331237733364,
-0.0032165537122637033,
0.000880089239217341,
0.042144060134887695,
-0.009640265256166458,
0.032146744430065155,
0.00036135336267761886,
-0.00642684381455183,... | 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 testAudioSummary(self):
np.random.seed(7)
for channels in (1, 2, 5, 8):
with self.test_session(graph=ops.Graph()) as sess:
num_frames = 7
shape = (4, num_frames, channels)
# Generate random audio in the range [-1.0, 1.0).
const = 2.0 * np.random.random(shape) - 1.0
... | |
9,398 | [
0.016807662323117256,
0.008896606974303722,
0.0468270517885685,
-0.051834721118211746,
0.01752684824168682,
0.021149419248104095,
0.009069744497537613,
0.0019145018886774778,
0.01586206443607807,
0.011240622960031033,
0.02356002666056156,
0.008643560111522675,
-0.003108152188360691,
-0.056... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class UniqueNameTrackerTests(test.TestCase):
@test_util.run_in_graph_and_eager_modes
def testNames(self):
checkpoint_directory = self.get_temp_dir()
checkpoint_prefix = os.path.join(checkpoint_directory, "ckpt")
x1 = resource_variable_ops.ResourceVariable(2.)
x2 = resource_variable_ops.ResourceVar... | |
9,399 | [
0.028848716989159584,
0.04364566132426262,
0.08107447624206543,
0.015659211203455925,
0.007116371765732765,
0.025974489748477936,
-0.006855562329292297,
0.05548321455717087,
0.034937817603349686,
0.04905346408486366,
0.007616700138896704,
-0.018246015533804893,
0.01976829022169113,
-0.0095... | 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": "req", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _send_and_handle_reply(self, req):
# sends and waits for reply
reply = self.transport.send_message(req.serialize())
response = self.protocol.parse_reply(reply)
if hasattr(response, 'error'):
raise RPCError('Error calling remote procedure: %s' %\
... | |
9,400 | [
0.008085347712039948,
0.042824823409318924,
0.035093292593955994,
-0.03462153673171997,
-0.008458820171654224,
0.03855282440781593,
0.03037574701011181,
-0.0011761101195588708,
0.01606586016714573,
0.0021507416386157274,
0.07715806365013123,
-0.003472637152299285,
0.005900206975638866,
-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 testExample(self):
class SlotManager(tracking.Checkpointable):
def __init__(self):
self.slotdeps = containers.UniqueNameTracker()
slotdeps = self.slotdeps
slots = []
slots.append(slotdeps.track(
resource_variable_ops.ResourceVariable(3.), "x"))
slots.ap... |