Search is not available for this dataset
id int64 0 10.8M | vector listlengths 1.54k 1.54k | ast_depth int64 3 164 | ast_data stringlengths 297 510k | full_path stringlengths 0 319 | code stringlengths 60 56.5k |
|---|---|---|---|---|---|
14,701 | [
0.01762206293642521,
0.0885973572731018,
-0.0038769645616412163,
-0.0070012276992201805,
-0.008777824230492115,
-0.021927956491708755,
0.03156917169690132,
-0.015109369531273842,
-0.01023341529071331,
0.014788364060223103,
0.051227957010269165,
0.01997978799045086,
-0.0008018204825930297,
... | 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": "view", "annotation": n... | class FileWatchHandler(pyinotify.ProcessEvent):
def __init__(self, view):
self.view = view
def process_IN_CLOSE_WRITE(self, event):
self.view.getUpdates()
def process_IN_CREATE(self, event):
self.view.getUpdates()
def process_IN_DELETE(self, event):
self.view.g... | |
14,702 | [
0.009869388304650784,
0.0334586538374424,
0.022267628461122513,
0.007826853543519974,
-0.018182558938860893,
0.006516656838357449,
0.0007874055299907923,
-0.026272596791386604,
0.014097491279244423,
-0.012003464624285698,
0.003847630927339196,
0.0016277338145300746,
0.02009350247681141,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": "close-clicked"}}], "values": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {... | class ClosableTabLabel(Gtk.Box):
__gsignals__ = {
"close-clicked": (GObject.SIGNAL_RUN_FIRST, GObject.TYPE_NONE, ()),
}
def __init__(self, label_text):
Gtk.Box.__init__(self)
self.set_orientation(Gtk.Orientation.HORIZONTAL)
self.set_spacing(5)
label = Gtk.Lab... | |
14,703 | [
-0.004572585225105286,
0.043439559638500214,
0.012509902939200401,
-0.018398184329271317,
-0.015982478857040405,
-0.007710845209658146,
0.05983184650540352,
-0.04650232940912247,
-0.010908419266343117,
0.030045336112380028,
0.019746234640479088,
0.009285368025302887,
0.034121837466955185,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}], "kwarg": ... | def __init__(self, filename):
Gtk.ScrolledWindow.__init__(self)
self.filename = filename
self.changed = 0
self.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
self.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
self.textview = Gtk.TextView()
self.textv... | |
14,704 | [
0.012272895313799381,
0.04563962295651436,
0.01857732981443405,
-0.02499375492334366,
-0.023228248581290245,
0.01843239925801754,
0.014901389367878437,
-0.016732772812247276,
-0.002478624228388071,
-0.008214868605136871,
0.044690992683172226,
-0.018168890848755836,
0.016429737210273743,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class CinnamonLog(dbus.service.Object):
def __init__ (self):
global lookingGlassProxy
lookingGlassProxy = LookingGlassProxy()
self.lookingGlassProxy = lookingGlassProxy
# The status label is shown iff we are not okay
lookingGlassProxy.addStatusChangeCallback(lambda x: self.st... | |
14,705 | [
-0.024427490308880806,
0.005474948789924383,
0.04228711500763893,
0.024862585589289665,
-0.015331927686929703,
-0.024241020902991295,
0.02068774402141571,
-0.02910994365811348,
0.001954043982550502,
0.026209309697151184,
0.01311501394957304,
0.02973150834441185,
-0.0006759515381418169,
-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": "label_text", "annotation": null, "type_comment": null}}], "kwarg"... | def __init__(self, label_text):
Gtk.Box.__init__(self)
self.set_orientation(Gtk.Orientation.HORIZONTAL)
self.set_spacing(5)
label = Gtk.Label(label_text)
self.pack_start(label, True, True, 0)
button = Gtk.Button()
button.set_relief(Gtk.ReliefStyl... | |
14,706 | [
0.009728845208883286,
0.02363220788538456,
0.02509387396275997,
0.06131979078054428,
-0.020276224240660667,
-0.004610092844814062,
0.06337781250476837,
0.02731560543179512,
-0.025047099217772484,
0.01226629689335823,
0.004852729383856058,
-0.013470709323883057,
0.018709318712353706,
-0.014... | 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 showAndFocus(self):
self.window.present()
self.window.show_all()
self.lookingGlassProxy.refreshStatus()
screen = self.window.get_screen()
geom = screen.get_monitor_geometry(screen.get_primary_monitor())
w, h = self.window.get_size()
self.window.resize(geom.wid... | |
14,707 | [
0.011014662683010101,
0.008651363663375378,
0.023500358685851097,
0.047651831060647964,
-0.009742580354213715,
0.009989762678742409,
0.03475014492869377,
-0.016012558713555336,
-0.012986088171601295,
0.004551762714982033,
0.014903253875672817,
-0.014119506813585758,
0.017363015562295914,
-... | 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 __init__ (self):
global lookingGlassProxy
lookingGlassProxy = LookingGlassProxy()
self.lookingGlassProxy = lookingGlassProxy
# The status label is shown iff we are not okay
lookingGlassProxy.addStatusChangeCallback(lambda x: self.statusLabel.set_visible(not x))
self.... | |
14,708 | [
0.00021120227756910026,
0.027086129412055016,
0.04168704152107239,
-0.017630798742175102,
-0.02060844376683235,
0.0006913558463566005,
0.020543145015835762,
-0.009337793104350567,
-0.01838826946914196,
0.0010113221360370517,
0.01863640733063221,
-0.016925565898418427,
0.0007203323766589165,
... | 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):
self.window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
self.window.set_type_hint(Gdk.WindowTypeHint.UTILITY)
screen = self.window.get_screen()
geom = screen.get_monitor_geometry(screen.get_primary_monitor())
self.window.set_border_width(0)
self.window.set_decor... | |
14,709 | [
-0.004992136266082525,
0.042394403368234634,
-0.014674985781311989,
-0.02353968657553196,
-0.053142279386520386,
-0.023930100724101067,
0.021690960973501205,
0.029418867081403732,
0.03734198212623596,
-0.0035567893646657467,
-0.0045931097120046616,
-0.03309335559606552,
0.014445330016314983,... | 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 createActionButton(self):
menu = Gtk.Menu()
menu.append(self.createMenuItem('Add File Watcher', self.onAddFileWatcher))
menu.append(Gtk.SeparatorMenuItem())
menu.append(self.createMenuItem('Restart Cinnamon', lambda x: os.system("nohup cinnamon --replace > /dev/null 2>&1 &")))
... | |
14,710 | [
-0.02721543423831463,
0.028980882838368416,
-0.014238234609365463,
0.0012209113920107484,
-0.009681311435997486,
-0.02256106771528721,
-0.0248080026358366,
0.04152245447039604,
0.032924484461545944,
0.01669152081012726,
0.06649094820022583,
0.0028717212844640017,
0.013596253469586372,
0.02... | 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": "menuItem", "annotation": null, "type_comment": null}}], "kwarg": ... | def onAboutClicked(self, menuItem):
dialog = Gtk.MessageDialog(self.window, 0,
Gtk.MessageType.QUESTION, Gtk.ButtonsType.CLOSE);
dialog.set_title("About Melange")
dialog.set_markup("""\
<b>Melange</b> is a GTK3 alternative to the built-in javascript debugger <... | |
14,711 | [
0.0012291788589209318,
0.04898754879832268,
-0.044766806066036224,
-0.03596610948443413,
-0.021687431260943413,
-0.023146729916334152,
0.02676130086183548,
0.0372682549059391,
0.0009281984530389309,
0.026873555034399033,
0.010316122323274612,
0.014536864124238491,
0.018836183473467827,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "menuItem", "annotation": null, "type_comment": null}}], "kwarg": ... | def onAddFileWatcher(self, menuItem):
dialog = NewLogDialog(self.window)
response = dialog.run()
if response == Gtk.ResponseType.OK and dialog.isValid():
label = ClosableTabLabel(dialog.getName())
content = FileWatcherView(dialog.getFile())
content.show()
... | |
14,712 | [
0.05730925127863884,
0.04227469861507416,
0.021285641938447952,
-0.015422394499182701,
0.006559080444276333,
-0.00018135500431526452,
0.030228806659579277,
-0.04165871813893318,
-0.024684956297278404,
0.007819565013051033,
-0.009696031920611858,
-0.00874924287199974,
0.006986846681684256,
... | 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": "text", "annotation": null, "type_comment": null}}, {"_type": "arg... | def createPage(self, text, moduleName):
module = __import__("page_%s" % moduleName)
module.lookingGlassProxy = self.lookingGlassProxy
module.cinnamonLog = self
label = Gtk.Label(text)
page = module.ModulePage(self)
self.pages[moduleName] = page
self.notebook.appen... | |
14,713 | [
-0.016764529049396515,
-0.003986401483416557,
-0.007364459801465273,
-0.009575553238391876,
-0.0510072223842144,
0.019724352285265923,
0.03680475056171417,
0.06649656593799591,
-0.01648375578224659,
-0.004161885008215904,
0.029738614335656166,
-0.004223304335027933,
0.018905429169535637,
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": "menuItem", "annotation": null, "type_comment": null}}], "kwarg": ... | def onResetClicked(self, menuItem):
dialog = Gtk.MessageDialog(self.window, 0,
Gtk.MessageType.WARNING, Gtk.ButtonsType.YES_NO,
"Reset all cinnamon settings to default?")
dialog.set_title("Warning: Trying to reset all cinnamon setting... | |
14,714 | [
0.01364086288958788,
0.022322416305541992,
0.011255091987550259,
-0.06437161564826965,
-0.022145692259073257,
-0.015606913715600967,
0.02719336375594139,
-0.027237543836236,
-0.005442538298666477,
-0.008521396666765213,
-0.0008615281549282372,
0.002996019320562482,
-0.023194989189505577,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "attr", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "target", "annotation": null, "type_comment": null}}, {"_type": "a... | def _render_revision(attr, target, value, *unused):
source = value if attr == 'source' else target.source
render_mode = value if attr == 'render_mode' else target.render_mode
if source is None or render_mode is None:
return
if render_mode == RenderMode.html:
target.html = source
elif... | |
14,715 | [
0.04856959357857704,
0.029178768396377563,
0.06604806333780289,
-0.026464464142918587,
-0.01824958249926567,
0.02327721379697323,
0.011001156643033028,
-0.03892558813095093,
-0.03168744221329689,
0.0030844365246593952,
-0.01742706634104252,
-0.04392237588763237,
0.0031152807641774416,
0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "note_revisions"}}, "targets": [{"_type": "Name", "_fields": {"id": "__tablename__", "ctx": {"_type": "Store", "_fields": {}}}}], "type_co... | class EventNoteRevision(db.Model):
__tablename__ = 'note_revisions'
__table_args__ = {'schema': 'events'}
#: The ID of the revision
id = db.Column(
db.Integer,
primary_key=True
)
#: The ID of the associated note
note_id = db.Column(
db.Integer,
db.ForeignKey(... | |
14,716 | [
0.05222703516483307,
-0.007271491922438145,
-0.008785239420831203,
-0.0001107787829823792,
0.023537395521998405,
-0.007392591796815395,
-0.02648782730102539,
-0.001893560285679996,
0.028821749612689018,
0.063059963285923,
0.018264049664139748,
-0.02646580897271633,
-0.00798708200454712,
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": "dividend", "annotation": null, "type_comment": null}}, {"_type": ... | def divide(self, dividend, divisor):
if divisor == 0:
return float('nan')
if divisor == 1:
return dividend
if divisor == -1:
return -dividend
sign = 1 if (dividend > 0 and divisor > 0) or (dividend < 0 and divisor <0) else -1
dividend = abs(div... | |
14,717 | [
0.042420290410518646,
-0.011989290826022625,
0.009744023904204369,
-0.02041449211537838,
0.03162992745637894,
0.014834022149443626,
-0.03734119236469269,
0.011825799942016602,
0.023695198819041252,
0.05881292000412941,
0.015008412301540375,
-0.05022422969341278,
-0.024283763021230698,
0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dividend", "annotation... | class Solution:
# @return an integer
def divide(self, dividend, divisor):
if divisor == 0:
return float('nan')
if divisor == 1:
return dividend
if divisor == -1:
return -dividend
sign = 1 if (dividend > 0 and divisor > 0) or (dividend < 0 and d... | |
14,718 | [
-0.01619448885321617,
-0.004776020999997854,
0.016374928876757622,
-0.024742834270000458,
0.013781104236841202,
0.0034960247576236725,
-0.03299796208739281,
-0.013104453682899475,
0.009213716723024845,
0.0687476322054863,
-0.018777037039399147,
-0.05674837529659271,
0.007877333089709282,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class AzureRMNetworkInterfaceFacts(AzureRMModuleBase):
def __init__(self):
self.module_arg_spec = dict(
name=dict(type='str'),
resource_group=dict(type='str'),
tags=dict(type='list')
)
self.results = dict(
changed=False,
ansible_... | |
14,719 | [
0.013718136586248875,
-0.012135274708271027,
0.024777065962553024,
-0.003550887107849121,
0.016081877052783966,
0.02218117192387581,
0.0225821640342474,
-0.008642426691949368,
0.008885132148861885,
0.08256208151578903,
-0.02942012809216976,
-0.04296942427754402,
0.010694870725274086,
-0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def __init__(self):
self.module_arg_spec = dict(
name=dict(type='str'),
resource_group=dict(type='str'),
tags=dict(type='list')
)
self.results = dict(
changed=False,
ansible_facts=dict(azure_networkinterfaces=[])
)
se... | |
14,720 | [
0.010380600579082966,
0.015229548327624798,
-0.018252117559313774,
-0.025324229151010513,
-0.001880353200249374,
-0.040402065962553024,
-0.04254937544465065,
-0.015089506283402443,
0.04633050411939621,
0.0009992567356675863,
0.0002806306874845177,
-0.01913904957473278,
0.029035337269306183,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_item(self):
self.log('Get properties for {0}'.format(self.name))
result = []
item = None
try:
item = self.network_client.network_interfaces.get(self.resource_group, self.name)
except:
pass
if item and self.has_tags(item.tags, self.tags):
... | |
14,721 | [
0.012472681701183319,
0.019172169268131256,
0.022166475653648376,
-0.05898135155439377,
0.009144478477537632,
0.025440823286771774,
-0.03205414488911629,
0.03308815136551857,
0.013797500170767307,
0.04497920349240303,
-0.011643324047327042,
-0.08017844706773758,
0.013140476308763027,
-0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def exec_module(self, **kwargs):
for key in self.module_arg_spec:
setattr(self, key, kwargs[key])
if self.name and not self.resource_group:
self.fail("Parameter error: resource group required when filtering by name.")
if self.name:
self.results['ansible_fac... | |
14,722 | [
-0.007331197150051594,
-0.007799261715263128,
-0.012626857496798038,
-0.009290536865592003,
0.01603393256664276,
-0.01900559663772583,
-0.06117494776844978,
0.008648308925330639,
0.01957162842154503,
0.05995580181479454,
0.009660634212195873,
-0.018461337313055992,
0.020877854898571968,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def list_all(self):
self.log('List all')
try:
response = self.network_client.network_interfaces.list_all()
except Exception as exc:
self.fail("Error listing all - {0}".format(str(exc)))
results = []
for item in response:
if self.has_tags(item.... | |
14,723 | [
-0.03912552073597908,
0.02307620272040367,
0.016070546582341194,
-0.020762212574481964,
0.03205617889761925,
-0.02392537333071232,
-0.034709833562374115,
-0.009998979978263378,
0.04298924654722214,
0.022927597165107727,
-0.01206883229315281,
-0.009107351303100586,
0.03564392402768135,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def list_resource_group(self):
self.log('List for resource group')
try:
response = self.network_client.network_interfaces.list(self.resource_group)
except Exception as exc:
self.fail("Error listing by resource group {0} - {1}".format(self.resource_group, str(exc)))
... | |
14,724 | [
0.03569816052913666,
-0.02469603344798088,
0.02924642711877823,
-0.020615633577108383,
0.02020972967147827,
0.020156322047114372,
0.020434044301509857,
-0.0010621590772643685,
0.022858785465359688,
0.016545915976166725,
0.005901625379920006,
-0.016214782372117043,
0.007573307957500219,
-0.... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class JSONDocumentTestCase(TestCase):
def test_document_creation(self):
class EmptyDocument(JSONDocument):
class Meta(object):
title = u'a title'
description = u'a description'
d1 = EmptyDocument({})
self.assertEqual(d1.schema.title, u'a title... | |
14,725 | [
0.03962360695004463,
0.009518434293568134,
0.02228955365717411,
-0.013418596237897873,
0.03360766917467117,
0.01052278932183981,
0.01813957653939724,
0.012144033797085285,
0.02728583849966526,
0.003930751234292984,
-0.009926293976604939,
-0.009227833710610867,
0.010573772713541985,
-0.0379... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_document_creation(self):
class EmptyDocument(JSONDocument):
class Meta(object):
title = u'a title'
description = u'a description'
d1 = EmptyDocument({})
self.assertEqual(d1.schema.title, u'a title')
self.assertEqual(d1.schema.descr... | |
14,726 | [
0.029745057225227356,
0.0004709910717792809,
-0.007342204451560974,
-0.007768240757286549,
0.03348532319068909,
0.017041439190506935,
0.04811440035700798,
0.00782356970012188,
0.005635294131934643,
0.004182898905128241,
0.0204386617988348,
-0.0009240001090802252,
0.032334472984075546,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_field_creation(self):
class SimpleDocument(JSONDocument):
answer = JSONIntegerField(title = u'the answer',
description = u'answer mutually exclusive with question in each given universe')
class Meta(object):
title = u'a title'
d... | |
14,727 | [
0.02073560655117035,
0.000214625833905302,
0.0036541789304465055,
-0.020632673054933548,
0.01132280845195055,
0.008189020678400993,
-0.002215953543782234,
-0.009750195778906345,
0.0008191880187951028,
0.031109130010008812,
-0.005727167706936598,
0.012111973948776722,
0.03142936900258064,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_list_field_creation(self):
class ListDocument(JSONDocument):
events = JSONListField(title = u'events',
description = u'important historical events', content = [
JSONStringField(title = u'event',
description = u'important historic... | |
14,728 | [
0.03537401556968689,
0.017538761720061302,
0.001900127506814897,
-0.021495815366506577,
0.016307171434164047,
0.027893245220184326,
0.0148247005417943,
-0.01586242951452732,
-0.003994116559624672,
-0.014300134032964706,
0.012167657725512981,
-0.0005320499767549336,
0.03560208901762962,
-0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_object_field_creation(self):
class ObjectDocument(JSONDocument):
events = JSONListField(title = u'events',
description = u'important historical events', content = [
JSONObjectField(title = u'event',
description = u'important hist... | |
14,729 | [
-0.0011988590704277158,
-0.003903780598193407,
-0.012237976305186749,
-0.005110302474349737,
0.015760015696287155,
0.012839843519032001,
-0.004243724513798952,
-0.01931549422442913,
0.00882181990891695,
-0.00870478991419077,
-0.011218144558370113,
-0.02828778140246868,
0.018802791833877563,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "JSONListField", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": [{"_type": "keyword", "_fields": {"ar... | class ObjectDocument(JSONDocument):
events = JSONListField(title = u'events',
description = u'important historical events', content = [
JSONObjectField(title = u'event',
description = u'important historical event', content = {
... | |
14,730 | [
-0.021919602528214455,
0.019358791410923004,
-0.028497831895947456,
0.022025324404239655,
-0.005938027519732714,
0.025608109310269356,
0.013191700913012028,
0.015963954851031303,
0.0032861782237887383,
0.06239921227097511,
0.005635546054691076,
-0.023387957364320755,
0.00006162501813378185,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "withTimer", "annotatio... | class ConditionalWidget(GUIComponent):
def __init__(self, withTimer = True):
GUIComponent.__init__(self)
self.setConnect(None)
if (withTimer):
self.conditionCheckTimer = eTimer()
self.conditionCheckTimer.callback.append(self.update)
self.conditionCheckTimer.start(1000)
def postWidgetCreate(self, ins... | |
14,731 | [
-0.02272854931652546,
0.008956688456237316,
-0.011375990696251392,
0.03378821536898613,
0.014949293807148933,
0.027860047295689583,
0.022845707833766937,
0.011399421840906143,
-0.02372438833117485,
0.06026580557227135,
-0.0021439818665385246,
-0.028516128659248352,
0.004774167202413082,
-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": "withTimer", "annotation": null, "type_comment": null}}], "kwarg":... | def __init__(self, withTimer = True):
GUIComponent.__init__(self)
self.setConnect(None)
if (withTimer):
self.conditionCheckTimer = eTimer()
self.conditionCheckTimer.callback.append(self.update)
self.conditionCheckTimer.start(1000) | |
14,732 | [
-0.0290665403008461,
-0.002274795901030302,
-0.029045354574918747,
0.019236456602811813,
-0.027265770360827446,
-0.007155411411076784,
-0.018198367208242416,
0.005953132640570402,
0.015338320285081863,
0.04376929625868797,
0.018113624304533005,
-0.02516840398311615,
-0.015698473900556564,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class BlinkingWidget(GUIComponent):
def __init__(self):
GUIComponent.__init__(self)
self.blinking = False
self.setBlinkTime(500)
self.timer = eTimer()
self.timer.callback.append(self.blink)
def setBlinkTime(self, time):
self.blinktime = time
def blink(self):
if self.blinking == True:
self.visible ... | |
14,733 | [
0.00928462017327547,
0.029339183121919632,
-0.049734022468328476,
0.010202820412814617,
0.013189669698476791,
0.02180994488298893,
0.0377650186419487,
0.00754544185474515,
0.027805250138044357,
0.04588838666677475,
-0.0022414876148104668,
-0.004320940002799034,
0.0030651669949293137,
-0.03... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class BlinkingWidgetConditional(BlinkingWidget, ConditionalWidget):
def __init__(self):
BlinkingWidget.__init__(self)
ConditionalWidget.__init__(self)
def activateCondition(self, condition):
if (condition):
if not self.blinking: # we are already blinking
self.startBlinking()
else:
if self.blinking:... | |
14,734 | [
0.022997288033366203,
0.04898183047771454,
0.05035003647208214,
-0.07169407606124878,
-0.03935876861214638,
-0.04188995435833931,
0.01890406757593155,
-0.011122386902570724,
-0.004671858623623848,
-0.011110985651612282,
0.014617017470300198,
0.04925547167658806,
-0.005239094607532024,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "nbfile", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def convert(nbfile):
basename, _ = os.path.splitext(nbfile)
meta = {"metadata": {"path": "."}}
with open(nbfile, "r", encoding="utf-8") as nbf:
nbdata = nbformat.read(nbf, as_version=4, encoding="utf-8")
runner = ExecutePreprocessor(timeout=600, kernel_name="probscale")
runner.preprocess(n... | |
14,735 | [
0.010065063834190369,
-0.03517355024814606,
0.04486794397234917,
-0.04183416813611984,
0.007293607108294964,
0.0023109728936105967,
0.0011861377861350775,
0.012750981375575066,
-0.02518261782824993,
-0.01248866319656372,
0.011216985993087292,
-0.04311154782772064,
0.009044300764799118,
0.0... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "localhost"}}, "targets": [{"_type": "Name", "_fields": {"id": "host", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}... | class WithServer(unittest.TestCase):
host = 'localhost'
targetServer = None
conn = None
_server = None
_server_log = None
def setUp(self):
# -- startup local httpbin server
if self.targetServer is None or self.targetServer.poll() is not None:... | |
14,736 | [
0.0344654880464077,
-0.029227571561932564,
0.06620725989341736,
-0.006380436476320028,
-0.018018430098891258,
-0.02959422580897808,
0.027918092906475067,
0.04520321637392044,
-0.01991717517375946,
-0.0025109259877353907,
0.02508961781859398,
-0.025011049583554268,
-0.0002711030829232186,
-... | 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 setUp(self):
# -- startup local httpbin server
if self.targetServer is None or self.targetServer.poll() is not None:
self.targetServer = http_support.HttpTargetServer()
# -- startup the RethinkDB server
if self.conn == None:
... | |
14,737 | [
0.009323657490313053,
0.018770216032862663,
0.004064086824655533,
0.0027694448363035917,
-0.022837094962596893,
0.012502304278314114,
-0.01979810930788517,
-0.013507851399481297,
0.035819828510284424,
0.06493600457906723,
-0.024892881512641907,
-0.056936319917440414,
0.06748339533805847,
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": "exception", "annotation": null, "type_comment": null}}, {"_type":... | def assertRaisesRegex_replacement(self, exception, regexp, function, *args, **kwds):
result = None
try:
result = function(*args, **kwds)
except Exception as e:
if not isinstance(e, exception):
raise Assertion... | |
14,738 | [
-0.03047158196568489,
-0.023952849209308624,
0.009218988008797169,
-0.0405610054731369,
0.014841871336102486,
-0.06384038180112839,
-0.00794827938079834,
0.04274662211537361,
0.04607588052749634,
0.010191080160439014,
0.016786055639386177,
-0.0426957942545414,
0.007719552144408226,
0.01875... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_params(self):
url = self.getHttpBinURL('get')
res = r.http(url, params={'fake':123,'things':'stuff','nil':None}).run(self.conn)
self.assertEqual(res['args']['fake'], '123')
self.assertEqual(res['args']['things'], 'stuff')
self.assertEqual(res['args']['nil'], '')... | |
14,739 | [
0.009429537691175938,
-0.03687730059027672,
0.048769328743219376,
-0.04165813326835632,
0.012540684081614017,
-0.030871223658323288,
-0.005114172585308552,
0.006486560683697462,
0.01557975821197033,
-0.010378497652709484,
0.015651831403374672,
-0.014390555210411549,
-0.0032492864411324263,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_headers(self):
url = self.getHttpBinURL('headers')
res = r.http(url, header={'Test':'entry','Accept-Encoding':'override'}).run(self.conn)
self.assertEqual(res['headers']['Test'], 'entry')
self.assertEqual(res['headers']['Accept-Encoding'], 'override')
r... | |
14,740 | [
-0.01896144635975361,
-0.031246328726410866,
0.020321037620306015,
-0.029498280957341194,
0.008515655994415283,
-0.03974377363920212,
0.015392518602311611,
0.010633948259055614,
0.04809555411338806,
-0.003141020657494664,
0.018937168642878532,
-0.023161614313721657,
-0.0019468258833512664,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_head(self):
url = self.getHttpBinURL('get')
res = r.http(url, method='HEAD', result_format='text').run(self.conn)
self.assertEqual(res, None)
res = r.http(url, method='HEAD').run(self.conn)
self.assertEqual(res, None) | |
14,741 | [
-0.017096061259508133,
-0.03173520416021347,
0.015918787568807602,
0.0024377242662012577,
0.016942502930760384,
-0.0522095263004303,
-0.009034295566380024,
0.014101690612733364,
0.034345678985118866,
0.016405053436756134,
0.019706537947058678,
-0.04123017191886902,
-0.013589832931756973,
0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_post(self):
url = self.getHttpBinURL('post')
post_data = {'str':'%in fo+','number':135.5,'nil':None}
res = r.http(url, method='POST', data=post_data).run(self.conn)
post_data['number'] = str(post_data['number'])
post_data['nil'] = ''
self.assertEqual(res... | |
14,742 | [
-0.01068070251494646,
-0.04796617105603218,
0.0045614889822900295,
-0.016952749341726303,
0.03327065333724022,
-0.031530704349279404,
0.028944293037056923,
0.02845052443444729,
0.022537047043442726,
-0.02297203429043293,
0.028991319239139557,
-0.0060957008972764015,
-0.002721610013395548,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_put(self):
url = self.getHttpBinURL('put')
put_data = {'nested':{'arr':[123.45, ['a', 555], 0.123], 'str':'info','number':135,'nil':None},'time':r.epoch_time(1000)}
res = r.http(url, method='PUT', data=put_data).run(self.conn)
self.assertEqual(res['json']['nested'], put... | |
14,743 | [
-0.013851099647581577,
-0.04263966158032417,
0.026196109130978584,
0.0008464046404697001,
0.03061562217772007,
-0.011789483018219471,
0.01196848601102829,
0.010079699568450451,
0.009030373767018318,
-0.008511883206665516,
0.034022845327854156,
0.01433255523443222,
-0.01499918568879366,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_patch(self):
url = self.getHttpBinURL('patch')
patch_data = {'nested':{'arr':[123.45, ['a', 555], 0.123], 'str':'info','number':135},'time':r.epoch_time(1000),'nil':None}
res = r.http(url, method='PATCH', data=patch_data).run(self.conn)
self.assertEqual(res['json']['nes... | |
14,744 | [
0.009238597936928272,
-0.01328959222882986,
-0.0035642918664962053,
-0.03832998126745224,
0.023513251915574074,
0.01595916785299778,
0.0029828723054379225,
0.07278966158628464,
0.03651140630245209,
0.0020560980774462223,
0.04180392622947693,
-0.04087132588028908,
-0.0011198521824553609,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_delete(self):
url = self.getHttpBinURL('delete')
delete_data = {'nested':{'arr':[123.45, ['a', 555], 0.123], 'str':'info','number':135},'time':r.epoch_time(1000),'nil':None}
res = r.http(url, method='DELETE', data=delete_data).run(self.conn)
self.assertEqual(res['json']... | |
14,745 | [
-0.03373674303293228,
-0.021139489486813545,
0.04197390004992485,
0.00030805912683717906,
0.031753722578287125,
-0.05288050323724747,
0.005504148546606302,
0.06167696788907051,
0.0035529087763279676,
0.04840599745512009,
0.006489302031695843,
-0.02201659418642521,
0.02378351427614689,
0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_basic_auth(self):
url = self.getHttpBinURL('basic-auth', 'azure', 'hunter2')
# Wrong password
self.assertRaisesRegex(
r.RqlRuntimeError, self.err_string('GET', url, 'status code 401'),
r.http(url, auth={'type':'basic','user':'azure','pass':'wrong'}).run... | |
14,746 | [
-0.0050276811234653,
0.005295614246279001,
0.03462322801351547,
0.004233339335769415,
0.0246750395745039,
-0.009380802512168884,
0.0034642142709344625,
0.06637169420719147,
0.0015319455415010452,
0.03722060099244118,
0.02236766554415226,
-0.013894682750105858,
0.027612844482064247,
0.00507... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_digest_auth(self):
url = self.getHttpBinURL('digest-auth', 'auth', 'azure', 'hunter2')
# Wrong password
self.assertRaisesRegex(
r.RqlRuntimeError, self.err_string('GET', url, 'status code 401'),
r.http(url, redirects=5, auth={'type':'digest','user':'azur... | |
14,747 | [
-0.007338899653404951,
0.005150550045073032,
0.021046213805675507,
-0.015172556973993778,
0.01234355941414833,
-0.005505760665982962,
0.026310937479138374,
0.03970744460821152,
0.022631973028182983,
0.024306537583470345,
-0.0035457604099065065,
-0.026310937479138374,
0.013269644230604172,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_binary(self):
res = r.http('http://%s:%d/quickstart.png' % (self.host, self.targetServer.httpPort)) \
.do(lambda row: [row.type_of(), row.count().gt(0)]) \
.run(self.conn)
self.assertEqual(res, ['PTYPE<BINARY>', True])
res = r.http(self.getHttpBinURL('get'), r... | |
14,748 | [
0.01917271502315998,
-0.0021229046396911144,
0.005766608286648989,
-0.025279579684138298,
-0.016711032018065453,
-0.022924412041902542,
0.018853168934583664,
-0.01310135517269373,
-0.05676070228219032,
0.0055802068673074245,
0.015125141479074955,
-0.07086803019046783,
-0.014059990644454956,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "stock.warehouse"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_commen... | class StockWarehouse(models.Model):
_inherit = 'stock.warehouse'
mto_mts_management = fields.Boolean(
'Use MTO+MTS rules',
help='If this new route is selected on product form view, a '
'purchase order will be created only if the virtual stock is '
'less than 0 else, th... | |
14,749 | [
-0.021485472097992897,
0.015548855997622013,
0.03806205466389656,
0.013674772344529629,
0.004174372181296349,
0.01690303348004818,
-0.01725366897881031,
-0.009648513048887253,
-0.00022689269098918885,
0.026479002088308334,
0.017169032245874405,
-0.04783147573471069,
0.005824775900691748,
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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,... | def bad_https_helper(self, url):
self.assertRaisesRegex(
r.RqlRuntimeError,
self.err_string('HEAD', url, 'Peer certificate cannot be authenticated with given CA certificates'),
r.http(url, method='HEAD', verify=True, redirects=5).run,
self.conn
)
... | |
14,750 | [
0.012411100789904594,
0.010568919591605663,
0.03504866361618042,
-0.028860827907919884,
-0.0354265458881855,
-0.035119518637657166,
-0.0008502371492795646,
0.0003232672461308539,
-0.04055158793926239,
0.017701465636491776,
0.04168523848056793,
-0.029285944998264313,
-0.027609089389443398,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _get_global_route_rules_values(self):
rule = self.get_rules_dict()[self.id][self.delivery_steps]
rule = [r for r in rule if r.from_loc == self.lot_stock_id][0]
location_id = rule.from_loc
location_dest_id = rule.dest_loc
picking_type_id = rule.picking_type
res = super... | |
14,751 | [
0.05599190667271614,
0.002512839389964938,
-0.02837749943137169,
-0.0009881450096145272,
-0.019482703879475594,
0.03224065527319908,
0.02525359019637108,
-0.024144720286130905,
-0.02670823410153389,
-0.009204802103340626,
0.050888724625110626,
-0.023071622475981712,
-0.02057964913547039,
-... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "new_name", "annotation": null, "type_comment": null}}, {"_type": ... | def _update_name_and_code(self, new_name=False, new_code=False):
res = super(StockWarehouse, self)._update_name_and_code(new_name,
new_code)
if not new_name:
return res
for warehouse in self.filtered('mts_mto_rule_id'):
... | |
14,752 | [
-0.0525285080075264,
0.00782775692641735,
-0.012701048515737057,
0.057322945445775986,
-0.013479093089699745,
-0.017579596489667892,
0.024371713399887085,
0.037493325769901276,
0.03721996024250984,
-0.006813145242631435,
-0.0199347585439682,
-0.016107620671391487,
-0.003043835749849677,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "country_code", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "user_ip", "annotation": null, "type_comment": null}}], "k... | def get_country(country_code, user_ip):
if country_code and 'media' not in country_code:
country_name = unicode(dict(countries).get(country_code, 'EU'))
country = {'country_name': country_name, 'country_code': country_code}
else:
country = get_country_from_user_ip(user_ip)
return co... | |
14,753 | [
0.04192720726132393,
0.01069024670869112,
0.021404316648840904,
-0.0017568928888067603,
-0.013316652737557888,
-0.030635448172688484,
0.04271334409713745,
0.011672915890812874,
-0.05507710576057434,
0.01945088990032673,
0.007444461341947317,
-0.05588706210255623,
-0.018938710913062096,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def _create_or_update_global_routes_rules(self):
res = super(StockWarehouse, self)\
._create_or_update_global_routes_rules()
if (self.mto_mts_management and self.mts_mto_rule_id
and self.mts_mto_rule_id.action != 'split_procurement'):
# Cannot create or update wi... | |
14,754 | [
0.029752202332019806,
0.011968898586928844,
-0.03631260618567467,
0.020339448004961014,
-0.029796084389090538,
0.05985546484589577,
-0.022094741463661194,
-0.009346931241452694,
0.04550595209002495,
0.029115909710526466,
0.03896748647093773,
-0.03817760571837425,
0.007635521236807108,
0.00... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "event_id", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def reject_event_status(event_id):
event = Event.objects.get(pk=event_id)
if event.status == 'REJECTED':
event.status = 'PENDING'
else:
event.status = 'REJECTED'
event.save()
return event | |
14,755 | [
0.025325966998934746,
0.004434203263372183,
-0.06140413507819176,
0.01686238870024681,
-0.045945148915052414,
0.03627248480916023,
0.007918412797152996,
-0.0001486051914980635,
0.05769052356481552,
0.012209577485918999,
0.07150861620903015,
-0.011669808998703957,
0.007324667181819677,
0.02... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "event_id", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def change_event_status(event_id):
event = Event.objects.get(pk=event_id)
if event.status == 'APPROVED':
event.status = 'PENDING'
else:
event.status = 'APPROVED'
event.save()
return event | |
14,756 | [
0.03309639170765877,
-0.016746867448091507,
0.000158042719704099,
-0.03174074739217758,
0.026715518906712532,
0.0025155360344797373,
-0.0018304104451090097,
0.022414857521653175,
0.08437709510326385,
0.0040055750869214535,
0.005518986843526363,
-0.03190435841679573,
-0.01955164596438408,
0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_literals(self):
self.assertEqual('\xff', '\u00ff')
self.assertEqual('\uffff', '\U0000ffff')
self.assertRaises(SyntaxError, eval, '\'\\Ufffffffe\'')
self.assertRaises(SyntaxError, eval, '\'\\Uffffffff\'')
self.assertRaises(SyntaxError, eval, '\'\\U%08x\'' % 0x110000)
... | |
14,757 | [
0.03326326236128807,
0.04035846143960953,
-0.029871996492147446,
-0.0005276303854770958,
0.022620460018515587,
0.035884879529476166,
0.010997560806572437,
-0.013035927899181843,
0.009584533050656319,
0.009145593270659447,
0.019830483943223953,
-0.06344792991876602,
0.0017196841072291136,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "result", "annotation": null, "type_comment": null}}, {"_type": "a... | def checkequalnofix(self, result, object, methodname, *args):
method = getattr(object, methodname)
realresult = method(*args)
self.assertEqual(realresult, result)
self.assertTrue(type(realresult) is type(result))
# if the original is returned make sure that
# this doesn'... | |
14,758 | [
-0.007233085576444864,
-0.006842107977718115,
0.010723956860601902,
-0.06130528822541237,
0.014812465757131577,
0.007132548373192549,
-0.0009334590286016464,
0.0008280347101390362,
0.009863805957138538,
0.038717951625585556,
0.00020753229910042137,
-0.00990290381014347,
-0.01986166276037693,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_formatter_parser(self):
def parse(format):
return list(_string.formatter_parser(format))
formatter = parse("prefix {2!s}xxx{0:^+10.3f}{obj.attr!s} {z[0]!s:10}")
self.assertEqual(formatter, [
('prefix ', '2', '', 's'),
('xxx', '0', '^+10.3f', None),
... | |
14,759 | [
-0.009386490099132061,
-0.011643731035292149,
0.006664995104074478,
-0.07662876695394516,
-0.01293510664254427,
0.020256463438272476,
0.007465435191988945,
-0.0006877111736685038,
0.028709106147289276,
0.013714201748371124,
0.005152164027094841,
-0.023693017661571503,
-0.019797543063759804,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class StringModuleTest(unittest.TestCase):
def test_formatter_parser(self):
def parse(format):
return list(_string.formatter_parser(format))
formatter = parse("prefix {2!s}xxx{0:^+10.3f}{obj.attr!s} {z[0]!s:10}")
self.assertEqual(formatter, [
('prefix ', '2', '', 's'... | |
14,760 | [
0.04615962132811546,
0.0061131250113248825,
0.04702046141028404,
-0.034340523183345795,
-0.0393892340362072,
0.02382432110607624,
0.01035334262996912,
0.03689977899193764,
-0.015902267768979073,
0.029966527596116066,
0.03454991802573204,
-0.029826931655406952,
-0.003975566942244768,
-0.008... | 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 command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('copies marked text to the currently selected clipboard')
def run(self):
if not self.env['... | |
14,761 | [
0.04853447899222374,
0.0017173453234136105,
-0.003693414619192481,
-0.06944358348846436,
-0.035461004823446274,
-0.03736183047294617,
-0.02204960584640503,
-0.01678008772432804,
-0.002178032184019685,
0.023781470954418182,
0.028237856924533844,
-0.009081734344363213,
-0.011257125996053219,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_formatter_field_name_split(self):
def split(name):
items = list(_string.formatter_field_name_split(name))
items[1] = list(items[1])
return items
self.assertEqual(split("obj"), ["obj", []])
self.assertEqual(split("obj.arg"), ["obj", [(True, 'arg')]])
... | |
14,762 | [
0.055776938796043396,
0.04516545683145523,
0.0826522558927536,
-0.06340228021144867,
-0.043219130486249924,
-0.001113972393795848,
0.04172605648636818,
0.03463396057486534,
-0.021142980083823204,
0.03551380708813667,
0.02587548829615116,
-0.0012314519844949245,
-0.024155788123607635,
-0.02... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def run(self):
if not self.env['commandBuffer']['Marks']['1']:
self.env['runtime']['outputManager'].presentText(_("One or two marks are needed"), interrupt=True)
return
if not self.env['commandBuffer']['Marks']['2']:
self.env['runtime']['cursorManager'].setMark()
... | |
14,763 | [
-0.04253006726503372,
-0.023936402052640915,
-0.0006770359468646348,
-0.011844635009765625,
-0.013756957836449146,
-0.013780494220554829,
-0.016698993742465973,
0.012344781309366226,
0.0042894878424704075,
0.005160330329090357,
-0.03899962455034256,
-0.02039419114589691,
0.020347118377685547... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Crossbar"}}, "targets": [{"_type": "Name", "_fields": {"id": "description", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ... | class Crossbar(SimpleTopology):
description='Crossbar'
def makeTopology(self, options, network, IntLink, ExtLink, Router):
# Create an individual router for each controller plus one more for
# the centralized crossbar. The large numbers of routers are needed
# because external links do... | |
14,764 | [
-0.0009223399101756513,
0.01733153685927391,
0.03673544153571129,
-0.021585343405604362,
-0.02480296790599823,
0.009494715370237827,
-0.006075309123843908,
0.027333436533808708,
-0.011867031455039978,
0.013121359050273895,
0.006157113239169121,
0.0025400137528777122,
0.006277092266827822,
... | 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": "dest", "annotation": null, "type_comment": null}}, {"_type": "arg... | def switch(self, dest, url, rev_options):
repo_config = os.path.join(dest, self.dirname, 'hgrc')
config = configparser.SafeConfigParser()
try:
config.read(repo_config)
config.set('paths', 'default', url)
with open(repo_config, 'w') as config_file:
... | |
14,765 | [
-0.018015382811427116,
-0.020322013646364212,
0.014573178254067898,
-0.039508454501628876,
-0.01806269772350788,
-0.04350661486387253,
-0.011515413410961628,
0.024722356349229813,
-0.01855950988829136,
0.04111718386411667,
0.0031819683499634266,
0.0017506739823147655,
0.003569364082068205,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, {"_type": "... | def makeTopology(self, options, network, IntLink, ExtLink, Router):
# Create an individual router for each controller plus one more for
# the centralized crossbar. The large numbers of routers are needed
# because external links do not model outgoing bandwidth in the
# simple network, b... | |
14,766 | [
0.013760336674749851,
0.027750778943300247,
0.018442993983626366,
-0.019685566425323486,
-0.01875363662838936,
-0.010774712078273296,
0.010636648163199425,
0.004320239648222923,
-0.023700915277004242,
0.02892431989312172,
0.018926216289401054,
-0.001269897329621017,
-0.06074797734618187,
-... | 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": "dest", "annotation": null, "type_comment": null}}], "kwarg": null... | def obtain(self, dest):
url, rev = self.get_url_rev()
if rev:
rev_options = [rev]
rev_display = ' (to revision %s)' % rev
else:
rev_options = []
rev_display = ''
if self.check_destination(dest, url, rev_options, rev_display):
lo... | |
14,767 | [
0.0012592311250045896,
0.02250867336988449,
0.052936673164367676,
-0.015203412622213364,
-0.02585427090525627,
-0.020560603588819504,
0.015542207285761833,
0.019639506936073303,
-0.022318102419376373,
-0.00395701639354229,
0.01213308610022068,
0.008279295638203621,
-0.0442127101123333,
-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": "dist", "annotation": null, "type_comment": null}}, {"_type": "arg... | def get_src_requirement(self, dist, location):
repo = self.get_url(location)
if not repo.lower().startswith('hg:'):
repo = 'hg+' + repo
egg_project_name = dist.egg_name().split('-', 1)[0]
if not repo:
return None
current_rev_hash = self.get_revision_hash(l... | |
14,768 | [
0.01894041709601879,
0.02444419078528881,
0.009710930287837982,
-0.04396452754735947,
-0.013414761982858181,
0.0001137785948230885,
-0.01781340315937996,
-0.06473224610090256,
-0.008879346773028374,
0.0035752637777477503,
-0.012517525814473629,
-0.04494930058717728,
0.03041846491396427,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "loader", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}], "kwarg":... | def load_extra_vars(loader, options):
extra_vars = {}
if hasattr(options, 'extra_vars'):
for extra_vars_opt in options.extra_vars:
data = None
extra_vars_opt = to_text(extra_vars_opt, errors='surrogate_or_strict')
if extra_vars_opt.startswith(u"@"):
# ... | |
14,769 | [
-0.0035482642706483603,
0.015680866315960884,
-0.016290975734591484,
-0.099415622651577,
-0.024960942566394806,
0.011474327184259892,
-0.009815258905291557,
-0.11020491272211075,
-0.024489980190992355,
0.032346468418836594,
0.010184535756707191,
-0.03187550976872444,
0.023312577977776527,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "version", "annotation": null, "type_comment": null}}], "kwarg"... | def load_options_vars(options, version):
options_vars = {'ansible_version': version}
attrs = {'check': 'check_mode',
'diff': 'diff_mode',
'forks': 'forks',
'inventory': 'inventory_sources',
'skip_tags': 'skip_tags',
'subset': 'limit',
... | |
14,770 | [
0.013214364647865295,
0.004531018901616335,
0.042200926691293716,
-0.03933084011077881,
0.007959180511534214,
-0.03643417730927467,
-0.0018087535863742232,
-0.0434233732521534,
0.0032188838813453913,
0.058730512857437134,
0.03390956297516823,
-0.016649169847369194,
-0.017805177718400955,
-... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "contests", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "choices", "annotation": null, "type_comment": null}}, {"_type... | def contest(contests, choices, parties):
text = list()
text.append('<html><head><link rel="stylesheet" href="../../css/progress.css" type="text/css" /></head><body>')
for contest in sort_by_s(contests):
if contest['bal'] == 0:
contest['bal'] = 1
text.append("<a name='c%s' />\n" %... | |
14,771 | [
0.01958688721060753,
-0.009830942377448082,
0.06289803236722946,
-0.024199243634939194,
-0.040148746222257614,
-0.0609980933368206,
0.003092090832069516,
-0.0694478303194046,
0.02052435837686062,
0.03724883496761322,
-0.011537139303982258,
-0.03412393480539322,
-0.005606074817478657,
-0.02... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "areatypes", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "areas", "annotation": null, "type_comment": null}}, {"_type"... | def area(areatypes, areas, contests):
list_text = ["<ul>\n"]
for areatype in sort_by_s(areatypes):
list_text.append("<li>%s races<ul>\n" % areatype['nm'])
for area in sort_by_s(areas):
if area['atid'] == areatype['id']:
if areatype['nm'] != area['nm']:
... | |
14,772 | [
-0.00986151397228241,
-0.015769990161061287,
-0.06404977291822433,
-0.02941060997545719,
-0.006598939653486013,
-0.017298497259616852,
0.019016752019524574,
0.0023533757776021957,
0.029705770313739777,
0.013967404142022133,
0.07117578387260437,
-0.027070410549640656,
-0.023106830194592476,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "page_url", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "premium", "annotation": null, "type_comment": null}}, {"_type... | def get_video_url( page_url , premium = False , user="" , password="", video_password="" ):
logger.info("youwatch get_video_url(page_url='%s')" % page_url)
if not "embed" in page_url:
page_url = page_url.replace("http://youwatch.org/","http://youwatch.org/embed-") + ".html"
data = scrapertools.cache_... | |
14,773 | [
0.019449684768915176,
-0.0026517286896705627,
-0.013429544866085052,
-0.03448900952935219,
-0.00867738202214241,
0.005477115046232939,
-0.004118173383176327,
-0.031093034893274307,
-0.010463577695190907,
0.019934825599193573,
0.014642393216490746,
-0.030475584790110588,
0.003927976358681917,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def find_videos(data):
encontrados = set()
devuelve = []
patronvideos = 'http://youwatch.org/([a-z0-9]+)'
logger.info("youwatch find_videos #"+patronvideos+"#")
matches = re.compile(patronvideos,re.DOTALL).findall(data)
for match in matches:
titulo = "[youwatch]"
url = "http:... | |
14,774 | [
0.02437356486916542,
-0.011067685671150684,
-0.037992414087057114,
-0.022287113592028618,
0.03438854217529297,
-0.00004438158430275507,
0.011655685491859913,
-0.009621393866837025,
0.05273035913705826,
0.011086652986705303,
0.0018197190947830677,
-0.025037437677383423,
0.020048918202519417,
... | 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": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def convert(self, context, option, value):
if value is None:
return value
elif isinstance(value, datetime):
return value
try:
result = parse(value)
except Exception:
self.fail(
'{!r} is not a valid datetime'.format(value),
... | |
14,775 | [
0.002872827695682645,
0.02737770415842533,
-0.030179569497704506,
-0.03572836145758629,
0.030619079247117043,
-0.004042560700327158,
0.023055873811244965,
0.009843154810369015,
0.02446596324443817,
-0.011134210042655468,
-0.01733310893177986,
-0.02311081252992153,
0.04684425890445709,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "datetime"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}},... | class DateTimeParamType(click.ParamType):
name = 'datetime'
def convert(self, context, option, value):
if value is None:
return value
elif isinstance(value, datetime):
return value
try:
result = parse(value)
except Exception:
self... | |
14,776 | [
0.06546330451965332,
-0.024749914184212685,
0.018595058470964432,
-0.021650737151503563,
0.01805134303867817,
-0.010917800478637218,
-0.007476083468645811,
0.00648108497262001,
-0.013973480090498924,
-0.03355810046195984,
0.009373649023473263,
-0.008514579385519028,
0.023358004167675972,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_insert_batch_items_dynamodb_table(self):
hook = AwsDynamoDBHook(aws_conn_id='aws_default',
table_name='test_airflow', table_keys=['id'], region_name='us-east-1')
# this table needs to be created in production
table = hook.get_conn().create_table(
... | |
14,777 | [
0.04446640983223915,
-0.025123294442892075,
0.03529549762606621,
-0.02778581716120243,
0.021231913939118385,
0.029014674946665764,
-0.0018774201162159443,
0.017545344308018684,
-0.006252377759665251,
-0.04282793402671814,
0.0006741645047441125,
-0.007589328568428755,
0.0007950589642859995,
... | 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 TestDynamoDBHook(unittest.TestCase):
@unittest.skipIf(mock_dynamodb2 is None, 'mock_dynamodb2 package not present')
@mock_dynamodb2
def test_get_conn_returns_a_boto3_connection(self):
hook = AwsDynamoDBHook(aws_conn_id='aws_default')
self.assertIsNotNone(hook.get_conn())
@unittes... | |
14,778 | [
0.023017756640911102,
0.02538706175982952,
0.025822008028626442,
-0.029393136501312256,
-0.05796216428279877,
0.038801684975624084,
-0.03566550463438034,
0.020728571340441704,
0.044066812843084335,
0.04344873130321503,
0.0049990080296993256,
-0.07229246199131012,
0.0077031077817082405,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "warnings", "annotation": null, "type_comment": null}}], "kwarg"... | def check_args(module, warnings):
provider = module.params['provider'] or {}
for key in dellos6_argument_spec:
if key != 'provider' and module.params[key]:
warnings.append('argument %s has been deprecated and will be '
'removed in a future version' % key)
if ... | |
14,779 | [
0.05871887877583504,
0.030514951795339584,
-0.0009101131581701338,
-0.03947606682777405,
-0.012592723593115807,
0.0347125269472599,
-0.009356110356748104,
-0.01616537757217884,
0.021188318729400635,
0.03530207276344299,
-0.0066324034705758095,
-0.011018632911145687,
0.020480861887335777,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "flags", "annotation": null, "type_comment": null}}], "kwarg": n... | def get_config(module, flags=[]):
cmd = 'show running-config '
cmd += ' '.join(flags)
cmd = cmd.strip()
try:
return _DEVICE_CONFIGS[cmd]
except KeyError:
rc, out, err = exec_command(module, cmd)
if rc != 0:
module.fail_json(msg='unable to retrieve current config'... | |
14,780 | [
0.002175185363739729,
0.05110187456011772,
0.04594854265451431,
-0.044750094413757324,
-0.018971450626850128,
0.006465633865445852,
-0.009311950765550137,
0.026006348431110382,
0.05014311522245407,
0.046787459403276443,
0.026581604033708572,
-0.015459994785487652,
0.019774412736296654,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "commands", "annotation": null, "type_comment": null}}, {"_type"... | def run_commands(module, commands, check_rc=True):
responses = list()
commands = to_commands(module, to_list(commands))
for cmd in commands:
cmd = module.jsonify(cmd)
rc, out, err = exec_command(module, cmd)
if check_rc and rc != 0:
module.fail_json(msg=to_text(err, error... | |
14,781 | [
-0.004701369907706976,
0.01679292693734169,
0.017442137002944946,
-0.026055004447698593,
-0.038022127002477646,
-0.03479771316051483,
-0.015927311033010483,
0.04570445790886879,
0.025102827697992325,
0.03899594396352768,
0.006254066713154316,
-0.020428508520126343,
0.01699850894510746,
-0.... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "commands", "annotation": null, "type_comment": null}}], "kwarg"... | def to_commands(module, commands):
spec = {
'command': dict(key=True),
'prompt': dict(),
'answer': dict()
}
transform = ComplexList(spec, module)
return transform(commands) | |
14,782 | [
0.034775108098983765,
0.058231353759765625,
0.05500407516956329,
-0.0801675021648407,
-0.010313264094293118,
-0.007834338583052158,
0.03832979500293732,
0.015341272577643394,
0.000384774204576388,
0.02064991369843483,
0.002053590724244714,
-0.01659242808818817,
0.018685482442378998,
0.0108... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "running_config", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "... | def get_sublevel_config(running_config, module):
contents = list()
current_config_contents = list()
sublevel_config = Dellos6NetworkConfig(indent=0)
obj = running_config.get_object(module.params['parents'])
if obj:
contents = obj._children
for c in contents:
if isinstance(c, Conf... | |
14,783 | [
0.05544872209429741,
0.014748986810445786,
0.024993931874632835,
-0.04651064798235893,
-0.012578644789755344,
0.03565894067287445,
0.01549577061086893,
0.006931090261787176,
0.03512218967080116,
0.05633552744984627,
0.0059801070019602776,
0.0011012149043381214,
0.037619251757860184,
0.0244... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "commands", "annotation": null, "type_comment": null}}], "kwarg"... | def load_config(module, commands):
rc, out, err = exec_command(module, 'configure terminal')
if rc != 0:
module.fail_json(msg='unable to enter configuration mode', err=to_text(err, errors='surrogate_or_strict'))
for command in to_list(commands):
if command == 'end':
continue
... | |
14,784 | [
0.048519860953092575,
0.012599185109138489,
0.009714118205010891,
-0.02698647789657116,
0.025122281163930893,
0.002274764934554696,
0.019276056438684464,
-0.0018229823326691985,
-0.013176199048757553,
0.02133047766983509,
0.0008655202691443264,
-0.023473670706152916,
0.04834232106804848,
-... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "contents", "annotation... | class Dellos6NetworkConfig(NetworkConfig):
def load(self, contents):
self._items = os6_parse(contents, self._indent, DEFAULT_COMMENT_TOKENS)
def _diff_line(self, other, path=None):
diff = list()
for item in self.items:
if str(item) == "exit":
for diff_item i... | |
14,785 | [
0.013666479848325253,
0.035279445350170135,
0.04836777225136757,
-0.0543706938624382,
-0.022732362151145935,
-0.021871287375688553,
-0.015007294714450836,
-0.026521088555455208,
-0.014650564640760422,
0.058553051203489304,
0.0111386114731431,
-0.001532251015305519,
0.056289657950401306,
0.... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lines", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "indent", "annotation": null, "type_comment": null}}, {"_type": "... | def os6_parse(lines, indent=None, comment_tokens=None):
sublevel_cmds = [
re.compile(r'^vlan.*$'),
re.compile(r'^stack.*$'),
re.compile(r'^interface.*$'),
re.compile(r'datacenter-bridging.*$'),
re.compile(r'line (console|telnet|ssh).*$'),
re.compile(r'ip ssh !(server)... | |
14,786 | [
0.04477514326572418,
-0.01135263778269291,
0.02880520187318325,
0.0013442868366837502,
-0.01185037475079298,
-0.01754787378013134,
-0.005559827666729689,
0.006004613824188709,
-0.005798105616122484,
0.015546336770057678,
-0.00752959493547678,
-0.02526809275150299,
0.0012741271639242768,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "Contact", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], "ty... | class ContactFormView(LoginRequiredMixin, FAENavigationMixin, SuccessMessageMixin, CreateView):
model = Contact
fields = ['topic', 'message']
template_name = 'contact/contact_form.html'
success_url = reverse_lazy('contact_form')
success_message = "Message on \"%(topic)s\" was sent successfully sent... | |
14,787 | [
0.02447356842458248,
0.04959852620959282,
0.02589266374707222,
-0.031662099063396454,
0.03412806615233421,
0.0205070823431015,
-0.004806892946362495,
0.0018436600221320987,
0.03682667389512062,
0.06509225070476532,
0.02835863269865513,
-0.03338362276554108,
0.0004958107601851225,
-0.006897... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "other", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _diff_line(self, other, path=None):
diff = list()
for item in self.items:
if str(item) == "exit":
for diff_item in diff:
if item._parents == diff_item._parents:
diff.append(item)
break
elif it... | |
14,788 | [
0.05618305131793022,
-0.03120533935725689,
-0.0015219043707475066,
0.05474935472011566,
0.003606647253036499,
-0.010315907187759876,
0.008019750006496906,
0.050672274082899094,
0.007666925434023142,
0.03167577087879181,
0.01438178587704897,
-0.00320621975697577,
-0.022211123257875443,
0.00... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "form", "annotation": null, "type_comment": null}}], "kwarg": null... | def form_valid(self, form):
user = self.request.user
form.instance.user = user
message = "The following message was submitted to the FAE contact system"
message += "\n\nUser: " + user.first_name + " " + user.last_name
message += "\nUsername: " + user.username
message += ... | |
14,789 | [
0.008817936293780804,
0.0035691645462065935,
0.025923406705260277,
-0.004141004290431738,
-0.013602606020867825,
-0.02629910781979561,
-0.017039170488715172,
0.02643170766532421,
-0.0020221583545207977,
0.039780162274837494,
-0.009845590218901634,
-0.04267527535557747,
0.028221815824508667,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "Contact", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], "ty... | class ResponseFormView(LoginRequiredMixin, FAENavigationMixin, UpdateView):
model = Contact
fields = ['topic', 'message', 'status', 'comments']
template_name = 'contact/response_form.html'
login_url = reverse_lazy('run_anonymous_report')
redirect_field_name = "Anonymous Report"
def form_valid(... | |
14,790 | [
0.03347742557525635,
-0.00788197387009859,
-0.0014438056387007236,
0.013458050787448883,
-0.02945258654654026,
-0.028257712721824646,
0.004834521561861038,
-0.01592116802930832,
-0.006839079316705465,
0.020805474370718002,
-0.008332671597599983,
-0.03521732985973358,
0.02335244230926037,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "Announcement", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}]... | class AnnouncementFormView(LoginRequiredMixin, FAENavigationMixin, SuccessMessageMixin, CreateView):
model = Announcement
fields = ['topic', 'message_text', 'message_markdown', 'scope', 'email', 'web', 'end_date']
template_name = 'contact/announcement_form.html'
success_url = reverse_lazy('create_annou... | |
14,791 | [
0.011868531815707684,
-0.04006906971335411,
0.005917229689657688,
0.00835908018052578,
-0.02111349254846573,
0.0013678624527528882,
-0.035889532417058945,
-0.05324370786547661,
-0.010091091506183147,
0.029143206775188446,
-0.03950119763612747,
-0.03797930106520653,
0.02187444269657135,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "contact/announcements.html"}}, "targets": [{"_type": "Name", "_fields": {"id": "template_name", "ctx": {"_type": "Store", "_fields": {}}}... | class AnnouncementsView(FAENavigationMixin, TemplateView):
template_name = 'contact/announcements.html'
def get_context_data(self, **kwargs):
context = super(AnnouncementsView, self).get_context_data(**kwargs)
context['current'] = Announcement.objects.exclude(status='Arch')
context['ar... | |
14,792 | [
0.02153470739722252,
-0.024144371971488,
0.04936448112130165,
-0.04808953031897545,
-0.025120506063103676,
-0.014363111928105354,
-0.020140230655670166,
-0.03771064057946205,
-0.04968322068452835,
0.08829031139612198,
-0.023566659539937973,
-0.015578298829495907,
0.025558769702911377,
-0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "arg", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "namespace", "annotation": null, "type_comment": null}}], "kwarg": ... | def include(arg, namespace=None):
app_name = None
if isinstance(arg, tuple):
# callable returning a namespace hint
try:
urlconf_module, app_name = arg
except ValueError:
if namespace:
raise ImproperlyConfigured(
'Cannot override... | |
14,793 | [
-0.027953624725341797,
0.06877017766237259,
-0.026616966351866722,
-0.030723804607987404,
-0.0049737305380403996,
0.010150865651667118,
0.023614324629306793,
0.01071265060454607,
-0.033745817840099335,
0.05435749888420105,
0.035799238830804825,
-0.013424714095890522,
0.08035456389188766,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "regex", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "view", "annotation": null, "type_comment": null}}, {"_type": "ar... | def url(regex, view, kwargs=None, name=None):
if isinstance(view, (list, tuple)):
# For include(...) processing.
urlconf_module, app_name, namespace = view
return RegexURLResolver(regex, urlconf_module, kwargs, app_name=app_name, namespace=namespace)
elif callable(view):
return R... | |
14,794 | [
0.011479509063065052,
0.02968618832528591,
-0.04441461339592934,
-0.026322603225708008,
0.01471568550914526,
0.03773840516805649,
-0.012543370015919209,
-0.005707902368158102,
-0.0003223037638235837,
-0.0019238687818869948,
0.03501186519861221,
-0.005593234673142433,
0.004577151499688625,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Global", "_fields": {"names": ["serInLines"]}}, {"_type": "Glo... | def parseSerial():
global serInLines
global crQ, crQbusy, crQcmd, crQrsp, crQnxt
if len(serInLines) > 0 :
#
txt = serInLines.pop(0).strip() # grab input line
if txt == 'e': # ERROR message from RetroSPEX
# was 'e' expected ??
if crQrsp == 'e': # this is an... | |
14,795 | [
0.04021475464105606,
0.0022330202627927065,
-0.020229734480381012,
0.0011451875325292349,
-0.017068838700652122,
0.016701767221093178,
-0.016569213941693306,
0.025531884282827377,
0.02742842212319374,
0.05204262584447861,
0.009865054860711098,
-0.02653113566339016,
-0.0076881153509020805,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "text", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def digitsOnly(text):
s = ''
for c in text:
if c in string.digits:
s = s + c
if s.strip() == '':
s = '0'
return str( int(s) ) | |
14,796 | [
0.051331404596567154,
-0.0185350701212883,
-0.06157026067376137,
-0.007330609019845724,
-0.012730005197227001,
0.03192786127328873,
0.0035081792157143354,
0.0014248407678678632,
0.061433132737874985,
-0.012775714509189129,
0.04845172539353371,
0.03759579733014107,
-0.010216000489890575,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Global", "_fields": {"names": ["serOutBuffer", "serialPort", "... | def xmitSerial():
global serOutBuffer,serialPort,serOutReady
if comtest:
print('.',end='')
# if serOutReady:
# print('.',end='')
while serOutReady and len(serOutBuffer) > 0: # Anything to send out?
# send byte
c = serOutBuffer[0:1]
# print('xmitSerial(): send b... | |
14,797 | [
0.03152329847216606,
-0.01688973978161812,
-0.08906649053096771,
0.009246131405234337,
-0.03900876268744469,
0.010279336012899876,
-0.0017092691268771887,
0.009230316616594791,
0.034981369972229004,
0.006246673408895731,
0.06022109463810921,
0.06806501746177673,
0.017617199569940567,
-0.02... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "text", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def serBufLoad(text):
global serOutBuffer
#
# convert 'string' characters to 'bytes' for output
serOutBuffer = serOutBuffer + text.encode() # add to transmit buffer
print('serBufLoad(text): serOutBuffer: {}'.format(serOutBuffer))
xmitSerial()
return | |
14,798 | [
0.013949684798717499,
-0.007857978343963623,
0.026635903865098953,
-0.06353423744440079,
-0.02805407904088497,
0.025011450052261353,
0.02631359174847603,
-0.018126854673027992,
-0.0017066446598619223,
0.06307011097669601,
0.04344772547483444,
-0.04373135790228844,
-0.011074657551944256,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [{"_type": "Constant", "_fields": {"kind": null, "value": nul... | def edsetDone(x=None):
# Write out Settings to 'settings.txt'
fo = open('settings.txt','w')
tempData = [ '# site default settings'
, 'EXinc: ' + varEXinc.get()
, 'EMinc: ' + varEMinc.get()
, 'TMinc: ' + varTMinc.get()
... | |
14,799 | [
0.002200949937105179,
0.04914098232984543,
0.004693063907325268,
-0.00023559243709314615,
-0.03599163889884949,
0.07448790967464447,
-0.04375601187348366,
0.031858984380960464,
0.026649340987205505,
0.0046648867428302765,
0.017307043075561523,
-0.014877545647323132,
-0.01623004861176014,
0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Expr", "_fields": {"value... | def PowerDown():
#
if portName != 'OFFLINE':
#
#TODO stop scan if one is in process
print("TODO: scan if one is in process")
#
#TODO if connected: ShutDown RetroSPEX controller settings
#TODO i.e. HV levels => (0 volts), ... ??
print("TODO: if connecte... | |
14,800 | [
0.0022935785818845034,
0.012576671317219734,
0.016317542642354965,
-0.04704776778817177,
-0.03798246383666992,
0.024992691352963448,
-0.027218854054808617,
-0.052418097853660583,
-0.04624451324343681,
0.0028271691408008337,
0.04606091231107712,
-0.017717501148581505,
-0.008078445680439472,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Global", "_fields": {"names": ["ax"]}}, {"_type": "Global", "_... | def updatePlot():
global ax
global scanDataX,scanDataY
global backgroundDataX,backgroundDataY
# #
# # returns Axes instance for single plot
# try:
# fig.axes.remove(ax)
# except:
# pass
#print('CALLED: updatePlot() len(scanDataX)={}'.format(len(scanDataX)))
#
# ... |