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 |
|---|---|---|---|---|---|
19,601 | [
0.03103356622159481,
0.04191131144762039,
0.007792670279741287,
-0.009677993133664131,
0.010929162614047527,
-0.008923863992094994,
-0.006347255315631628,
-0.06444378197193146,
0.0010840609902516007,
-0.0003476065176073462,
0.026280265301465988,
-0.04799005016684532,
0.015379668213427067,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "document.page"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": n... | class document_page(osv.osv):
_name = "document.page"
_description = "Document Page"
_order = 'name'
def _get_page_index(self, cr, uid, page, link=True):
index = []
for subpage in page.child_ids:
index += ["<li>"+ self._get_page_index(cr, uid, subpage) +"</li>"]
r = ... | |
19,602 | [
0.02719377912580967,
0.007184011396020651,
-0.04354633763432503,
0.003385047195479274,
0.0023275744169950485,
-0.064503014087677,
0.0032291195821017027,
-0.004864942282438278,
-0.003566490253433585,
0.029098931699991226,
0.018586574122309685,
-0.048898905515670776,
-0.006480919662863016,
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _get_display_content(self, cr, uid, ids, name, args, context=None):
res = {}
for page in self.browse(cr, uid, ids, context=context):
if page.type == "category":
content = self._get_page_index(cr, uid, page, link=False)
else:
content = page.conten... | |
19,603 | [
0.025097280740737915,
-0.015090543776750565,
-0.030352693051099777,
-0.020260155200958252,
-0.017407216131687164,
-0.005695152096450329,
-0.0038879334460943937,
-0.007497007958590984,
0.019734613597393036,
0.056501056998968124,
0.031146368011832237,
-0.04294423386454582,
-0.01002818625420332... | 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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _get_page_index(self, cr, uid, page, link=True):
index = []
for subpage in page.child_ids:
index += ["<li>"+ self._get_page_index(cr, uid, subpage) +"</li>"]
r = ''
if link:
r = '<a href="#id=%s">%s</a>'%(page.id,page.name)
if index:
r += "... | |
19,604 | [
0.04503193497657776,
0.014177572913467884,
-0.03519631549715996,
0.01128101721405983,
0.005237409844994545,
-0.060626111924648285,
0.016642237082123756,
0.0017232488607987761,
0.00017635588301345706,
0.027986597269773483,
0.0637127012014389,
-0.012830070219933987,
0.03508114442229271,
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def onchange_parent_id(self, cr, uid, ids, parent_id, content, context=None):
res = {}
if parent_id and not content:
parent = self.browse(cr, uid, parent_id, context=context)
if parent.type == "category":
res['value'] = {
'content': parent.cont... | |
19,605 | [
0.045642804354429245,
0.002755028661340475,
0.03336723521351814,
0.0014409846626222134,
0.02245313487946987,
-0.04539729282259941,
-0.010305900126695633,
-0.017230438068509102,
-0.011025694198906422,
0.049771860241889954,
0.02276560477912426,
-0.04838806763291359,
-0.012822391465306282,
-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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def create_history(self, cr, uid, ids, vals, context=None):
for i in ids:
history = self.pool.get('document.page.history')
if vals.get('content'):
res = {
'content': vals.get('content', ''),
'page_id': i,
}
... | |
19,606 | [
0.002338627353310585,
-0.0018669476266950369,
0.0449875071644783,
-0.039632391184568405,
-0.0006771569023840129,
0.016291307285428047,
0.023521846160292625,
-0.03603971749544144,
0.005434201564639807,
0.07122080773115158,
0.010009776800870895,
-0.019138332456350327,
-0.04799269884824753,
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def getDiff(self, cr, uid, v1, v2, context=None):
history_pool = self.pool.get('document.page.history')
text1 = history_pool.read(cr, uid, [v1], ['content'])[0]['content']
text2 = history_pool.read(cr, uid, [v2], ['content'])[0]['content']
line1 = line2 = ''
if text1:
... | |
19,607 | [
0.0055387900210917,
0.024067027494311333,
0.02627129666507244,
-0.039182018488645554,
0.003660662332549691,
0.03076980635523796,
-0.006354144774377346,
-0.06711776554584503,
0.004054281860589981,
0.030724821612238884,
0.014653895050287247,
-0.04885381460189819,
-0.008147926069796085,
0.028... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "document.page.history"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_com... | class document_page_history(osv.osv):
_name = "document.page.history"
_description = "Document Page History"
_order = 'id DESC'
_rec_name = "create_date"
_columns = {
'page_id': fields.many2one('document.page', 'Page'),
'summary': fields.char('Summary', size=256, select=True),
... | |
19,608 | [
-0.039881132543087006,
0.01564772240817547,
0.014269175007939339,
-0.03557619825005531,
0.0027162826154381037,
-0.008283376693725586,
-0.035431087017059326,
-0.053787533193826675,
0.014498932287096977,
-0.04774127155542374,
0.004244474694132805,
-0.06172022596001625,
0.037922147661447525,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "jp.time.sheet"}}, "targets": [{"_type": "Name", "_fields": {"id": "_name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": n... | class jp_time_sheet(osv.Model):
_name = "jp.time.sheet"
_inherit = 'mail.thread'
_description = 'Time sheet'
_columns = {
'name': fields.char('Name',Size=64),
'agreement_id': fields.many2one('jp.agreement', 'Agreement'),
'hours': fields.integer('Regular hours'),
'year': fields.select... | |
19,609 | [
-0.005067176651209593,
-0.006081596482545137,
-0.006145613268017769,
-0.014920840039849281,
0.04195563122630119,
0.02446426823735237,
0.0017703109188005328,
0.00002612224307085853,
0.031003832817077637,
0.003914874047040939,
0.014379159547388554,
-0.006746386643499136,
-0.015048873610794544,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ssh", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def ssh_status(ssh):
LOG.debug('Trying to get ssh status')
with fab.settings(
host_string=ssh.host,
user=ssh.user,
key_filename=os.path.join(ssh.env.envdir, ssh.key_filename),
timeout=ssh.connection_timeout):
try:
with fab.hide('running', 'stdo... | |
19,610 | [
0.02265692874789238,
-0.015259678475558758,
0.022292083129286766,
-0.013398964889347553,
0.045459795743227005,
-0.0036051333881914616,
0.020504338666796684,
0.010598772205412388,
-0.016664335504174232,
-0.008856633678078651,
0.029424820095300674,
0.0028001919854432344,
0.022492747753858566,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ssh", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "filename", "annotation": null, "type_comment": null}}, {"_type": "... | def ssh_put_file(ssh, filename, remote_filename):
LOG.debug('Trying to put file on remote host: '
'local=%s remote=%s' % (filename, remote_filename))
with fab.settings(
host_string=ssh.host,
user=ssh.user,
key_filename=os.path.join(ssh.env.envdir, ssh.key_filena... | |
19,611 | [
0.041230812668800354,
-0.01801374927163124,
0.01002577506005764,
-0.014492115937173367,
0.046572618186473846,
-0.032288238406181335,
0.04455460235476494,
0.010357164777815342,
-0.008195712231099606,
-0.005193420685827732,
0.03917323052883148,
0.010030720382928848,
0.0018733409233391285,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ssh", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "file_content", "annotation": null, "type_comment": null}}, {"_type... | def ssh_put_content(ssh, file_content, remote_filename):
LOG.debug('Trying to put content into remote file: %s' % remote_filename)
with fab.settings(
host_string=ssh.host,
user=ssh.user,
key_filename=os.path.join(ssh.env.envdir, ssh.key_filename),
timeout=ssh.conn... | |
19,612 | [
0.013009308837354183,
-0.000567225506529212,
0.023115171119570732,
-0.029090648517012596,
0.057357095181941986,
-0.00819989200681448,
0.01063972245901823,
0.013599363155663013,
-0.012728329747915268,
-0.004343460779637098,
0.015790997073054314,
0.005942697171121836,
0.028116589412093163,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ssh", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "remote_filename", "annotation": null, "type_comment": null}}, {"_t... | def ssh_get_file(ssh, remote_filename, filename):
LOG.debug('Trying to get file from remote host: '
'local=%s remote=%s' % (filename, remote_filename))
with fab.settings(
host_string=ssh.host,
user=ssh.user,
key_filename=os.path.join(ssh.env.envdir, ssh.key_file... | |
19,613 | [
0.008863106369972229,
0.014217010699212551,
0.029818734154105186,
-0.0317535363137722,
0.04465222731232643,
-0.0028713808860629797,
0.022857235744595528,
0.0434761717915535,
-0.02304692193865776,
0.029401423409581184,
0.013913512229919434,
0.009659790433943272,
0.03518686443567276,
-0.0327... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ssh", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "command", "annotation": null, "type_comment": null}}, {"_type": "a... | def ssh_run(ssh, command, command_timeout=10):
LOG.debug('Trying to run command on remote host: %s' % command)
with fab.settings(
host_string=ssh.host,
user=ssh.user,
key_filename=os.path.join(ssh.env.envdir, ssh.key_filename),
timeout=ssh.connection_timeout,
... | |
19,614 | [
0.005942710675299168,
0.0332791805267334,
0.011544845066964626,
-0.04943223297595978,
0.03414104878902435,
0.026300840079784393,
0.013331133872270584,
-0.034446872770786285,
0.016333766281604767,
-0.0019322498701512814,
-0.003075613407418132,
-0.015207779593765736,
-0.0249941386282444,
-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 testMetadata( self ) :
shader = GafferArnold.ArnoldShader()
shader.loadShader( "noise" )
self.assertEqual(
Gaffer.Metadata.value( shader["parameters"]["octaves"], "nodule:type" ),
""
)
self.assertEqual(
Gaffer.Metadata.value( shader["parameters"]["amplitude"], "nodule:type" ),
None
)
s... | |
19,615 | [
-0.018251432105898857,
0.0501035638153553,
0.030040506273508072,
-0.040234267711639404,
0.03209548071026802,
0.02420004829764366,
0.02223970927298069,
-0.030148662626743317,
0.024024292826652527,
0.009227112866938114,
-0.002830662066116929,
-0.036340631544589996,
-0.018048638477921486,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class ArnoldShaderUITest( GafferUITest.TestCase ) :
def testMetadata( self ) :
shader = GafferArnold.ArnoldShader()
shader.loadShader( "noise" )
self.assertEqual(
Gaffer.Metadata.value( shader["parameters"]["octaves"], "nodule:type" ),
""
)
self.assertEqual(
Gaffer.Metadata.value( shader["parame... | |
19,616 | [
0.008967782370746136,
0.023339852690696716,
-0.01296195387840271,
-0.047346558421850204,
0.02484027110040188,
0.01351766474545002,
0.00016399979358538985,
-0.05307037755846977,
0.03550991788506508,
0.011558784171938896,
-0.0142678739503026,
-0.02220064587891102,
-0.017768852412700653,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testLightMetadata( self ) :
light = GafferArnold.ArnoldLight()
with IECore.CapturingMessageHandler() as mh :
light.loadShader( "skydome_light" )
## \todo Here we're suppressing warnings about not being
# able to create plugs for some parameters. In many cases
# these are parameters like "matrix"
# ... | |
19,617 | [
-0.02068820223212242,
0.048947643488645554,
0.025647222995758057,
-0.01990593411028385,
0.03324640169739723,
0.0023939504753798246,
0.04159991070628166,
-0.000543047848623246,
0.018970005214214325,
-0.003312417073175311,
-0.005199988838285208,
-0.037129804491996765,
-0.019864026457071304,
... | 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 testUserDefaultMetadata( self ) :
cacheFile = os.path.join( self.temporaryDirectory(), "testShaderUserDefaults.scc" )
script = """
import Gaffer
import GafferScene
import GafferArnold
import GafferArnoldUI
root = Gaffer.ScriptNode()
root["image"] = GafferArnold.ArnoldShader( "image" )
root["image"].loadShader(... | |
19,618 | [
-0.000006728173048031749,
0.04803285002708435,
0.05486597493290901,
-0.013038205914199352,
0.005542493425309658,
0.030774185433983803,
0.024631910026073456,
-0.0478067547082901,
0.014784170314669609,
-0.0003980232577305287,
-0.009678167290985584,
-0.0650654211640358,
-0.010821208357810974,
... | 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 testBaseClassMetadataLookup( self ) :
surface = GafferArnold.ArnoldShader()
surface.loadShader( "standard_surface" )
# Make sure that metadata registration based on mechanism in GafferScene.ShaderUI works
Gaffer.Metadata.registerValue( "ai:surface:standard_surface:aov_id1", "userDefault", "id_1" )
self... | |
19,619 | [
0.002482432872056961,
0.08022990077733994,
-0.026883073151111603,
-0.035688791424036026,
-0.02595124952495098,
-0.013825912959873676,
-0.02051173709332943,
0.009201744571328163,
0.004662023391574621,
0.04249109700322151,
0.05521047115325928,
-0.017518259584903717,
-0.028420578688383102,
0.... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def read_text():
movies = open("curse_movies.txt")
contents_of_file = movies.read()
length_of_file = len(contents_of_file)
print (length_of_file)
print (contents_of_file)
movies.close()
# find_curse_words(contents_of_file)
check_profanity(contents_of_file) | |
19,620 | [
-0.00840088538825512,
0.0041596051305532455,
0.004845093935728073,
-0.022367358207702637,
-0.05479244142770767,
-0.017420168966054916,
-0.023965859785676003,
-0.0020900119561702013,
0.02431589737534523,
0.06193319708108902,
0.030453210696578026,
0.008231701329350471,
-0.008937608450651169,
... | 9 | {"_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 find_curse_words(text):
#split the text into an array
words = text.split(" ")
count_of_words = 0
for word in words:
count_of_words = count_of_words + 1
connection = urllib.urlopen(url_direct + word)
output = connection.read()
print(output)
connection.close()
# if (urllib.urlopen(url_direct + word).r... | |
19,621 | [
-0.020323563367128372,
0.031152192503213882,
-0.002899870276451111,
-0.0025220916140824556,
-0.04370605945587158,
-0.011318058706820011,
0.004218271002173424,
0.014009920880198479,
0.03467608615756035,
0.07121200114488602,
0.05403302237391472,
0.001954659353941679,
-0.018708445131778717,
0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "text_to_check", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonly... | def check_profanity(text_to_check):
connection = urllib.urlopen(url_direct + text_to_check)
output = connection.read()
print(output)
connection.close()
if "true" in output:
print("Profanity Alert!!")
elif "false" in output:
print("This document has no curse words")
else:
print("This document cannot be scan... | |
19,622 | [
0.040935542434453964,
0.029019126668572426,
-0.0007116078049875796,
-0.06421355903148651,
-0.006066758185625076,
0.01826058141887188,
0.022735267877578735,
-0.009853959083557129,
-0.020491892471909523,
0.054516397416591644,
0.025834983214735985,
-0.003205250483006239,
0.019671734422445297,
... | 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": "result", "annotation": null, "type_comment": null}}], "kwarg": nu... | def v2_runner_on_ok(self, result):
if not self._plugin_options.get('display_ok_hosts'):
return
delegated_vars = result._result.get('_ansible_delegated_vars', None)
if self._last_task_banner != result._task._uuid:
self._print_task_banner(result._task)
if isinsta... | |
19,623 | [
0.05632924661040306,
0.021495318040251732,
0.019636068493127823,
-0.07254669815301895,
0.0031277367379516363,
0.04646923020482063,
0.007934794761240482,
0.002174121793359518,
-0.0073530301451683044,
0.07307448238134384,
-0.011215469799935818,
-0.017261028289794922,
0.014046326279640198,
-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": "result", "annotation": null, "type_comment": null}}, {"_type": "a... | def v2_runner_on_failed(self, result, ignore_errors=False):
delegated_vars = result._result.get('_ansible_delegated_vars', None)
self._clean_results(result._result, result._task.action)
if self._last_task_banner != result._task._uuid:
self._print_task_banner(result._task)
... | |
19,624 | [
0.02679070457816124,
0.053280387073755264,
0.019603872671723366,
-0.06256181001663208,
-0.0007110009319148958,
0.04126470908522606,
-0.005963941570371389,
-0.010159396566450596,
-0.029399536550045013,
0.0456044003367424,
-0.02829580008983612,
-0.025273066014051437,
0.0033112105447798967,
-... | 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": "result", "annotation": null, "type_comment": null}}], "kwarg": nu... | def v2_runner_on_skipped(self, result):
if self._plugin_options.get('display_skipped_hosts', C.DISPLAY_SKIPPED_HOSTS): # fallback on constants for inherited plugins missing docs
self._clean_results(result._result, result._task.action)
if self._last_task_banner != result._task._uuid:
... | |
19,625 | [
0.032870713621377945,
0.019183063879609108,
0.025988725945353508,
-0.04449758678674698,
-0.0048752715811133385,
0.044472143054008484,
-0.00574029004201293,
0.009610612876713276,
-0.014985178597271442,
0.07001563906669617,
-0.006754779256880283,
0.008249481208622456,
0.012778108939528465,
-... | 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": "result", "annotation": null, "type_comment": null}}], "kwarg": nu... | def v2_runner_on_unreachable(self, result):
if self._last_task_banner != result._task._uuid:
self._print_task_banner(result._task)
delegated_vars = result._result.get('_ansible_delegated_vars', None)
if delegated_vars:
self._display.display("fatal: [%s -> %s]: UNREACHABL... | |
19,626 | [
0.05488496646285057,
-0.0005542684812098742,
-0.015191830694675446,
0.0015553084667772055,
-0.013414335437119007,
0.03079286962747574,
0.009987222030758858,
-0.0073209791444242,
0.015447585843503475,
-0.00037404129398055375,
0.035984691232442856,
0.007161132525652647,
0.05795402079820633,
... | 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": "task", "annotation": null, "type_comment": null}}, {"_type": "arg... | def v2_playbook_on_task_start(self, task, is_conditional):
# Preserve task name, as all vars may not be available for templating
# when we need it later
if self._play.strategy != 'free':
self._last_task_name = task.get_name().strip()
# Display the task banner immediately... | |
19,627 | [
0.04750928655266762,
0.008244326338171959,
0.0029664698522537947,
-0.024876009672880173,
-0.02037910372018814,
-0.002311386400833726,
-0.007431908044964075,
-0.027873946353793144,
0.028079912066459656,
0.05281861126422882,
-0.014829488471150398,
0.02393772453069687,
0.037600077688694,
-0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "task", "annotation": null, "type_comment": null}}], "kwarg": null... | def _print_task_banner(self, task):
# args can be specified as no_log in several places: in the task or in
# the argument spec. We can check whether the task is no_log but the
# argument spec can't be because that is only run on the target
# machine and we haven't run it thereyet at thi... | |
19,628 | [
0.05325443670153618,
0.026164771988987923,
0.0035717955324798822,
-0.04707225039601326,
0.043275315314531326,
0.020858800038695335,
0.014834817498922348,
-0.004085964057594538,
0.011232597753405571,
0.07613340020179749,
0.03409939259290695,
-0.015723202377557755,
-0.015528487972915173,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "result", "annotation": null, "type_comment": null}}], "kwarg": nu... | def v2_on_file_diff(self, result):
if result._task.loop and 'results' in result._result:
for res in result._result['results']:
if 'diff' in res and res['diff'] and res.get('changed', False):
diff = self._get_diff(res['diff'])
if diff:
... | |
19,629 | [
0.05802074447274208,
-0.024279875680804253,
-0.0073027838952839375,
-0.02321331761777401,
-0.03109329752624035,
0.016512824222445488,
-0.0031494824215769768,
-0.03503328561782837,
0.015483910217881203,
0.010540100745856762,
0.016199130564928055,
-0.020854342728853226,
0.03458156809210777,
... | 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": "play", "annotation": null, "type_comment": null}}], "kwarg": null... | def v2_playbook_on_play_start(self, play):
name = play.get_name().strip()
if not name:
msg = u"PLAY"
else:
msg = u"PLAY [%s]" % name
self._play = play
self._display.banner(msg) | |
19,630 | [
0.04974420741200447,
0.03440488874912262,
-0.0031375885009765625,
-0.05760818347334862,
-0.019408471882343292,
0.02647233195602894,
-0.006280892062932253,
-0.0003654090396594256,
-0.00402914360165596,
0.04988137260079384,
-0.002171737141907215,
-0.023123284801840782,
0.023134715855121613,
... | 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}}], "kwarg": nu... | def v2_runner_item_on_failed(self, result):
delegated_vars = result._result.get('_ansible_delegated_vars', None)
self._clean_results(result._result, result._task.action)
self._handle_exception(result._result)
msg = "failed: "
if delegated_vars:
msg += "[%s -> %s]" %... | |
19,631 | [
0.04688744246959686,
0.03498578071594238,
-0.009430848062038422,
-0.05159706622362137,
-0.016274884343147278,
0.004990925546735525,
0.015544080175459385,
-0.02454572543501854,
-0.02533452957868576,
0.040414609014987946,
0.028304144740104675,
-0.008491243235766888,
0.022214114665985107,
-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}}], "kwarg": nu... | def v2_runner_item_on_ok(self, result):
if not self._plugin_options.get('display_ok_hosts'):
return
delegated_vars = result._result.get('_ansible_delegated_vars', None)
self._clean_results(result._result, result._task.action)
if isinstance(result._task, TaskInclude):
... | |
19,632 | [
0.025480786338448524,
0.0026411814615130424,
0.030890554189682007,
-0.05843593552708626,
-0.015458343550562859,
0.009839504025876522,
-0.01115274429321289,
-0.05948130413889885,
0.018829647451639175,
0.03765929490327835,
0.03162230923771858,
-0.0230241771787405,
0.013184674084186554,
0.010... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "stats", "annotation": null, "type_comment": null}}], "kwarg": nul... | def v2_playbook_on_stats(self, stats):
self._display.banner("PLAY RECAP")
hosts = sorted(stats.processed.keys())
for h in hosts:
t = stats.summarize(h)
self._display.display(u"%s : %s %s %s %s" % (
hostcolor(h, t),
colorize(u'ok', t['ok']... | |
19,633 | [
0.016485949978232384,
-0.004318448714911938,
0.03769896924495697,
-0.022153731435537338,
-0.027468744665384293,
-0.005015162751078606,
0.04143829643726349,
0.005191545933485031,
-0.019037626683712006,
0.017614802345633507,
0.04597722366452217,
0.012511448934674263,
-0.0016918089240789413,
... | 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 setup(self):
self.indir_addpkg(PACKAGES[0])
self.indir_addpkg(PACKAGES[1])
self.indir_addpkg(PACKAGES[2])
res = self.assert_run_cr(self.indir)
self.update_md_path = os.path.join(self.tdir, "update_md_path")
os.rename(res.outdir, self.update_md_path)
os.rename(... | |
19,634 | [
-0.004523846786469221,
0.005964335054159164,
-0.022845426574349403,
0.012077480554580688,
-0.04766706004738808,
-0.023131143301725388,
-0.0023318645544350147,
-0.030024057254195213,
-0.03569077327847481,
0.007940541952848434,
-0.0436670295894146,
-0.018369199708104134,
0.031881216913461685,
... | 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 retranslateUi(self):
self.serverSettingsGroupBox.setTitle(
translate('RemotePlugin.RemoteTab', 'Server Settings'))
self.addressLabel.setText(translate('RemotePlugin.RemoteTab', 'Serve on IP address:'))
self.portLabel.setText(translate('RemotePlugin.RemoteTab', 'Port number:'))
... | |
19,635 | [
-0.02426544763147831,
-0.012758249416947365,
-0.0031926590017974377,
0.01319178193807602,
-0.027547908946871758,
0.0024959100410342216,
-0.013253715820610523,
-0.023893848061561584,
-0.02772132307291031,
0.010937412269413471,
-0.03319622203707695,
-0.003279365599155426,
0.06743292510509491,
... | 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 setupUi(self):
self.setObjectName(u'RemoteTab')
SettingsTab.setupUi(self)
self.serverSettingsGroupBox = QtGui.QGroupBox(self.leftColumn)
self.serverSettingsGroupBox.setObjectName(u'serverSettingsGroupBox')
self.serverSettingsLayout = QtGui.QFormLayout(self.serverSettingsGroup... | |
19,636 | [
0.013338910415768623,
-0.024680087342858315,
-0.013326502405107021,
-0.015349053777754307,
-0.032336000353097916,
0.052065178751945496,
0.028489431366324425,
-0.00038582022534683347,
0.02918429486453533,
0.031293705105781555,
0.017992019653320312,
-0.013450585305690765,
0.0018643453950062394... | 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 save(self):
changed = False
if Settings().value(self.settingsSection + u'/ip address') != self.addressEdit.text() or \
Settings().value(self.settingsSection + u'/port') != self.portSpinBox.value():
changed = True
Settings().setValue(self.settingsSection + u'/port'... | |
19,637 | [
-0.03548026084899902,
-0.05535200238227844,
-0.004536953754723072,
0.0019146644044667482,
0.007728546392172575,
-0.009889277629554272,
-0.00017827126430347562,
0.007431518752127886,
-0.0055765509605407715,
0.0804654061794281,
-0.017763426527380943,
0.0032032409217208624,
0.04603348299860954,... | 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 setUrls(self):
ipAddress = u'localhost'
if self.addressEdit.text() == ZERO_URL:
ifaces = QtNetwork.QNetworkInterface.allInterfaces()
for iface in ifaces:
if not iface.isValid():
continue
if not (iface.flags() & (QtNetwork.QN... | |
19,638 | [
-0.021201571449637413,
-0.03567209839820862,
-0.0347244068980217,
-0.018808042630553246,
-0.011129306629300117,
-0.01377798430621624,
-0.039827365428209305,
-0.037251587957143784,
0.02372875064611435,
0.04736030101776123,
-0.008152581751346588,
-0.029815848916769028,
-0.09355421364307404,
... | 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 weatherTxt(self):
req = urllib2.Request("http://www.cornell.edu/about/status/weather.cfm")
try:
response = urllib2.urlopen(req).read()
except:
return "Connection error, please try again."
soup = BeautifulSoup(response)
try:
... | |
19,639 | [
0.033255334943532944,
-0.015370790846645832,
0.002819323679432273,
-0.010775696486234665,
-0.030026661232113838,
-0.0019054937874898314,
-0.033901069313287735,
-0.059269215911626816,
-0.03293246775865555,
-0.005566578358411789,
0.041696008294820786,
0.015128640457987785,
0.036022767424583435... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "title", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "figsize", "annotation": null, "type_comment": null}}], "kwarg": ... | def create_axes(title, figsize=(16, 6)):
fig = plt.figure(figsize=figsize)
fig.suptitle(title)
# define the axis for the first plot
left, width = 0.1, 0.22
bottom, height = 0.1, 0.7
bottom_h = height + 0.15
left_h = left + width + 0.02
rect_scatter = [left, bottom, width, height]
r... | |
19,640 | [
0.01706540770828724,
0.01443107333034277,
0.020970694720745087,
0.004907604772597551,
-0.04418288543820381,
-0.010080954059958458,
-0.017111623659729958,
0.005967693403363228,
0.001470259390771389,
-0.012478429824113846,
0.032859865576028824,
0.004965375177562237,
0.010150277987122536,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "item_idx", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def make_plot(item_idx):
title, X = distributions[item_idx]
ax_zoom_out, ax_zoom_in, ax_colorbar = create_axes(title)
axarr = (ax_zoom_out, ax_zoom_in)
plot_distribution(axarr[0], X, y, hist_nbins=200,
x0_label="Median Income",
x1_label="Number of households",... | |
19,641 | [
-0.005665685050189495,
-0.005280482582747936,
0.016371101140975952,
-0.014883792027831078,
-0.03180059790611267,
-0.010657265782356262,
-0.022769739851355553,
-0.05953516811132431,
0.00015448220074176788,
0.0015127218794077635,
0.04023224860429764,
-0.011566771194338799,
0.009721009992063046... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "axes", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "X", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def plot_distribution(axes, X, y, hist_nbins=50, title="",
x0_label="", x1_label=""):
ax, hist_X1, hist_X0 = axes
ax.set_title(title)
ax.set_xlabel(x0_label)
ax.set_ylabel(x1_label)
# The scatter plot
colors = cmap(y)
ax.scatter(X[:, 0], X[:, 1], alpha=0.5, marker='o'... | |
19,642 | [
-0.014369848184287548,
-0.025560911744832993,
0.05160081759095192,
-0.00944382045418024,
0.03285469859838486,
0.004142217803746462,
0.009187993593513966,
-0.013019952923059464,
0.018430419266223907,
0.05543277785181999,
-0.005287995096296072,
-0.05774066224694252,
0.016536211594939232,
-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 Application(tornado.web.Application):
def __init__(self):
handlers = [
(r"/", MainHandler),
(r"/auth/login", AuthLoginHandler),
(r"/auth/logout", AuthLogoutHandler),
]
settings = dict(
cookie_secret="12oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP... | |
19,643 | [
-0.003309693420305848,
-0.03137676417827606,
0.036929212510585785,
0.0039602005854249,
0.02182873524725437,
-0.0036199772730469704,
0.028850946575403214,
0.0028660420794039965,
0.035056620836257935,
0.07856167107820511,
0.008219798095524311,
-0.05251960828900337,
0.02142591029405594,
-0.04... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def __init__(self):
handlers = [
(r"/", MainHandler),
(r"/auth/login", AuthLoginHandler),
(r"/auth/logout", AuthLogoutHandler),
]
settings = dict(
cookie_secret="12oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo=",
login_url="/auth/login",
... | |
19,644 | [
0.01299612782895565,
-0.01873541809618473,
0.012939076870679855,
0.018199142068624496,
0.052075792104005814,
0.02248934842646122,
0.028753504157066345,
0.004461357370018959,
0.030168358236551285,
0.022569218650460243,
0.00820387713611126,
-0.04951992258429527,
0.011552747339010239,
0.01827... | 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 MainHandler(BaseHandler, tornado.auth.FacebookGraphMixin):
@tornado.web.authenticated
@tornado.web.asynchronous
def get(self):
self.facebook_request("/me/home", self._on_stream,
access_token=self.current_user["access_token"])
def _on_stream(self, stream):
... | |
19,645 | [
-0.01856616511940956,
-0.026842650026082993,
-0.021585963666439056,
0.012616044841706753,
0.05815907195210457,
0.01244827825576067,
0.010440671816468239,
0.018174709752202034,
0.03252434358000755,
0.021530041471123695,
-0.013980546034872532,
-0.045408815145492554,
0.00006968428351683542,
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 AuthLoginHandler(BaseHandler, tornado.auth.FacebookGraphMixin):
@tornado.web.asynchronous
def get(self):
my_url = (self.request.protocol + "://" + self.request.host +
"/auth/login?next=" +
tornado.escape.url_escape(self.get_argument("next", "/")))
if sel... | |
19,646 | [
0.0025656369980424643,
0.0028046618681401014,
0.000559147447347641,
-0.029179658740758896,
0.0064133163541555405,
0.01862531341612339,
0.053938910365104675,
-0.02741646207869053,
0.01151044387370348,
-0.004606660921126604,
0.011150354519486427,
-0.01114414632320404,
0.009120195172727108,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "sphere", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}], "kwarg": ... | def test_compare_images_two_plotters_same(sphere, tmpdir):
filename = str(tmpdir.mkdir("tmpdir").join('tmp.png'))
pl1 = pv.Plotter()
pl1.add_mesh(sphere)
arr1 = pl1.screenshot(filename)
im1 = pv.read(filename)
pl2 = pv.Plotter()
pl2.add_mesh(sphere)
assert not pv.compare_images(pl1, pl... | |
19,647 | [
-0.011697792448103428,
-0.010515401139855385,
-0.04414261505007744,
0.002236033556982875,
0.03775244578719139,
0.01329533476382494,
0.02970167249441147,
0.027347400784492493,
0.00016003339260350913,
0.025518635287880898,
-0.0014556552050635219,
-0.040947530418634415,
0.01618562452495098,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get(self):
my_url = (self.request.protocol + "://" + self.request.host +
"/auth/login?next=" +
tornado.escape.url_escape(self.get_argument("next", "/")))
if self.get_argument("code", False):
self.get_authenticated_user(
redirect_uri=my_... | |
19,648 | [
-0.012687738984823227,
-0.0033353175967931747,
0.007459492888301611,
-0.03424765542149544,
0.0018582718912512064,
0.028200844302773476,
0.03686177730560303,
-0.018285660073161125,
0.01944749243557453,
0.02056971751153469,
0.013044210150837898,
-0.018787359818816185,
-0.011750351637601852,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "sphere", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "airplane", "annotation": null, "type_comment": null}}, {"_type"... | def test_compare_images_two_plotter_different(sphere, airplane, tmpdir):
tmppath = tmpdir.mkdir("tmpdir")
filename = str(tmppath.join('tmp.png'))
filename2 = str(tmppath.join('tmp2.png'))
pl1 = pv.Plotter()
pl1.add_mesh(sphere)
arr1 = pl1.screenshot(filename)
im1 = pv.read(filename)
pl2... | |
19,649 | [
0.013903369195759296,
0.028393026441335678,
0.04602350294589996,
-0.020855054259300232,
-0.047237955033779144,
0.012961123138666153,
-0.023367712274193764,
0.02248828113079071,
-0.006459622643887997,
0.052598290145397186,
0.010568863712251186,
0.005543550010770559,
0.025796612724661827,
0.... | 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": "Dict", "_fields": {"k... | def create_main_parser():
parser_kw = {
'usage': '\n%prog <command> [options]',
'add_help_option': False,
'formatter': UpdatingDefaultsHelpFormatter(),
'name': 'global',
'prog': get_prog(),
}
parser = ConfigOptionParser(**parser_kw)
parser.disable_interspersed_ar... | |
19,650 | [
0.02699153684079647,
0.009805596433579922,
0.016892120242118835,
-0.043226297944784164,
-0.05466035008430481,
0.003274342278018594,
0.018894074484705925,
-0.017659038305282593,
0.002548509044572711,
0.03135400637984276,
0.011683052405714989,
-0.005288747604936361,
0.030338088050484657,
-0.... | 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 parseopts(args):
parser = create_main_parser()
# Note: parser calls disable_interspersed_args(), so the result of this
# call is to split the initial args into the general options before the
# subcommand and everything else.
# For example:
# args: ['--timeout=5', 'install', '--user', 'INIT... | |
19,651 | [
0.026238568127155304,
0.025743944570422173,
0.029064984992146492,
-0.019254963845014572,
-0.030548853799700737,
-0.011870949529111385,
-0.019890906289219856,
0.008496914990246296,
0.00003482417741906829,
0.05134657025337219,
0.02254067175090313,
0.021857621148228645,
0.03455294296145439,
-... | 10 | {"_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": [{"_type": "Constant", "_fields": {"kind": null, "value": ... | def main(args=None):
if args is None:
args = sys.argv[1:]
# Enable our Deprecation Warnings
for deprecation_warning in deprecation.DEPRECATIONS:
warnings.simplefilter("default", deprecation_warning)
# Configure our deprecation warnings to be sent through loggers
deprecation.install... | |
19,652 | [
0.02201642468571663,
0.021660782396793365,
0.000386204308597371,
-0.026450827717781067,
-0.003028508508577943,
-0.029340414330363274,
0.018082141876220703,
-0.032674551010131836,
0.041409991681575775,
0.00101204973179847,
0.05539114400744438,
0.0004785877245012671,
0.026206323876976967,
-0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "doc", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "task", "annotation": null, "type_comment": null}}], "kwarg": null,... | def task_to_xml(doc, task):
t_xml = doc.createElement("task")
t_xml.setAttribute("id", task.get_id())
t_xml.setAttribute("status", task.get_status())
t_xml.setAttribute("uuid", task.get_uuid())
tags_str = ""
for tag in task.get_tags_name():
tags_str = tags_str + saxutils.escape(str(tag))... | |
19,653 | [
0.009868993423879147,
0.027267828583717346,
0.016117870807647705,
-0.00840980838984251,
0.008114629425108433,
0.017287446185946465,
0.014257688075304031,
0.0035198668483644724,
-0.015182210132479668,
0.07258054614067078,
-0.03900814428925514,
0.0075075640343129635,
-0.013366582803428173,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "x", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "y", "annotation": null, "type_comment": null}}, {"_type": "arg", "_f... | def _estimate_scale(x,y,u,v):
pos = np.array([x,y]).T
# return a scale of 1 if there is only one datum
if pos.shape[0] == 0:
return 1.0
T = cKDTree(pos)
average_dist = np.mean(T.query(pos,2)[0][:,1])
average_length = np.mean(np.sqrt(u**2 + v**2))
return average_length/... | |
19,654 | [
-0.017911629751324654,
-0.002116724383085966,
0.02443436160683632,
0.03267117962241173,
-0.034120675176382065,
-0.05563303828239441,
-0.0011396086774766445,
0.009548267349600792,
0.03186590597033501,
0.03830811008810997,
-0.005107747856527567,
0.004903553053736687,
-0.018452314659953117,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "sigma_x", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "sigma_y", "annotation": null, "type_comment": null}}, {"_type"... | def compute_abphi(sigma_x,sigma_y,rho):
n = len(sigma_x)
a = []
b = []
phi = []
for i in range(n):
if ((not np.isfinite(sigma_x[i])) |
(not np.isfinite(sigma_y[i])) |
(not np.isfinite(rho[i]))):
# this block should run if the uncertainties or correlations are
# not finite or ... | |
19,655 | [
0.037854909896850586,
0.046692412346601486,
0.014192072674632072,
0.05018237978219986,
-0.02215004712343216,
-0.007929829880595207,
-0.029721029102802277,
-0.022262627258896828,
0.008753067813813686,
0.012904442846775055,
0.047593049705028534,
-0.05229324847459793,
0.010561378672719002,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kw", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": nu... | def quiver(*args, **kw):
ax = gca()
# allow callers to override the hold state by passing hold=True|False
washold = ax.ishold()
hold = kw.pop('hold', None)
if hold is not None:
ax.hold(hold)
try:
if not ax._hold:
ax.cla()
q = Quiver(ax, *args, **kw)
... | |
19,656 | [
0.003480911487713456,
0.035268206149339676,
0.04221116006374359,
0.026488887146115303,
-0.015093383379280567,
0.02983458712697029,
-0.03541914001107216,
-0.017847925424575806,
0.007892581634223461,
0.039343416690826416,
-0.014539958909153938,
-0.019558507949113846,
-0.012841952964663506,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ax", "annotation": nul... | class Quiver(_Quiver):
def __init__(self,ax,*args,**kwargs):
if 'sigma' in kwargs:
scale_units = kwargs.get('scale_units','xy')
kwargs['scale_units'] = scale_units
if kwargs['scale_units'] != 'xy':
raise ValueError('scale units must be "xy" when sigma is given')
angles = kwargs.ge... | |
19,657 | [
0.023149052634835243,
0.027769433334469795,
0.050211284309625626,
0.009641509503126144,
-0.01289463508874178,
0.02410377375781536,
-0.03147045522928238,
-0.02765156701207161,
-0.026967938989400864,
0.04648669436573982,
-0.002182010328397155,
-0.020756354555487633,
-0.007673133164644241,
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": "ax", "annotation": null, "type_comment": null}}], "kwarg": {"_typ... | def __init__(self,ax,*args,**kwargs):
if 'sigma' in kwargs:
scale_units = kwargs.get('scale_units','xy')
kwargs['scale_units'] = scale_units
if kwargs['scale_units'] != 'xy':
raise ValueError('scale units must be "xy" when sigma is given')
angles = kwargs.get('angles','xy')
kw... | |
19,658 | [
-0.0010175283532589674,
-0.001793451840057969,
-0.001084898947738111,
0.04529782384634018,
-0.03560884669423103,
0.05610189959406853,
-0.0063498723320662975,
0.0072853174060583115,
0.043166741728782654,
0.003083560150116682,
-0.027109310030937195,
-0.008703971281647682,
0.008784506469964981,... | 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": "u", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def set_UVC(self,u,v,C=None,sigma=None):
if C is None:
_Quiver.set_UVC(self,u,v)
else:
_Quiver.set_UVC(self,u,v,C)
if sigma is not None:
su,sv,rho = sigma[0],sigma[1],sigma[2]
self._update_ellipsoids(su,sv,rho) | |
19,659 | [
-0.035589586943387985,
-0.001863770536147058,
0.09335710853338242,
0.0234516654163599,
-0.008216824382543564,
-0.0011753930011764169,
-0.008678864687681198,
-0.0005396973574534059,
-0.0009217390906997025,
0.052297960966825485,
-0.02330181375145912,
-0.058142147958278656,
0.000760181108489632... | 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": "su", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _update_ellipsoids(self,su,sv,rho):
self.scale_units = 'xy'
self.angles = 'xy'
tips_x = self.X + self.U/self.scale
tips_y = self.Y + self.V/self.scale
tips = np.array([tips_x,tips_y]).transpose()
a,b,angle = compute_abphi(su,sv,rho)
width = 2.0*a/self.scale
height = 2.0*b/self.scale
... | |
19,660 | [
-0.005871907342225313,
0.047139424830675125,
0.02783805876970291,
-0.02619638666510582,
-0.05745850130915642,
0.007141271140426397,
0.025844600051641464,
0.03109794855117798,
-0.007100229151546955,
0.04038511961698532,
0.0030781340319663286,
-0.019453806802630424,
0.014986115507781506,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def launch_egads_gui(path):
app = QtWidgets.QApplication(sys.argv)
splash_pix = QtGui.QPixmap('icons/egads_gui_splashscreen.png')
splash = QtWidgets.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint)
splash.setMask(splash_pix.mask())
splash.show()
config_dict = ConfigParser.ConfigParser()... | |
19,661 | [
-0.02166910655796528,
-0.0014170731883496046,
0.03539910167455673,
-0.06169157475233078,
-0.00864546000957489,
-0.0345584899187088,
0.001948293298482895,
0.03859809786081314,
-0.017991429194808006,
0.04242755100131035,
0.049689505249261856,
0.008592922240495682,
-0.023864038288593292,
0.04... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def main():
print("Script to convert Viet SentiWordnet to Open Multilingual Wordnet format")
c = Counter()
# Fix VSW format
with open(VSW_DATA, 'r') as vsw_input:
with open(VSW_FIXED, 'w') as vsw_fixed:
for line in vsw_input.readlines():
if line.startswith('#'):
vsw_fixed.write(line)
if line.st... | |
19,662 | [
-0.008706144988536835,
0.003283623605966568,
-0.03060908243060112,
-0.009396614506840706,
-0.0015003434382379055,
-0.06487298011779785,
-0.022801067680120468,
0.012874919921159744,
-0.04909082129597664,
-0.0058092884719371796,
0.015885990113019943,
-0.057314157485961914,
0.023299451917409897... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "object_id", "annotation": null, "type_comment": null}}], "kwar... | def books(request, object_id, **kwargs):
repository = get_object_or_404(Repository, pk=object_id)
kwargs.setdefault('template_object_name','book')
kwargs.setdefault('template_name', 'bookreader/repository_books.html')
kwargs.setdefault('queryset', Book.objects.filter(collection__repository=reposito... | |
19,663 | [
-0.01886773481965065,
-0.014058928936719894,
-0.03172971308231354,
0.004115832969546318,
-0.020589664578437805,
-0.036097534000873566,
-0.022868072614073753,
0.012022011913359165,
-0.03823944926261902,
-0.016767818480730057,
0.025660958141088486,
-0.05934359133243561,
0.0414523184299469,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "object_id", "annotation": null, "type_comment": null}}], "kwar... | def view(request, object_id, **kwargs):
repository = get_object_or_404(Repository, pk=object_id)
kwargs.setdefault('template_object_name','collection')
kwargs.setdefault('template_name', 'bookreader/repository_detail.html')
kwargs.setdefault('queryset', repository.collections.all())
kwargs.setd... | |
19,664 | [
0.02835601381957531,
0.00022496975725516677,
0.032882917672395706,
-0.03703257814049721,
0.009996909648180008,
-0.017939947545528412,
-0.0011533384677022696,
0.03994572162628174,
-0.029927855357527733,
0.00518969539552927,
0.012773828580975533,
-0.015477395616471767,
0.023514743894338608,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "conf", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def create_server(conf, name, host, port, workers):
app = keystone_service.loadapp('config:%s' % conf, name)
server = environment.Server(app, host=host, port=port,
keepalive=CONF.eventlet_server.tcp_keepalive,
keepidle=CONF.eventlet_server.tcp_keep... | |
19,665 | [
-0.0009075786219909787,
0.02275885082781315,
0.08637261390686035,
-0.05946166440844536,
0.035526011139154434,
-0.00402720645070076,
0.018717767670750618,
0.04631703719496727,
0.002947548869997263,
0.03534838184714317,
-0.024690577760338783,
0.010668905451893806,
-0.0077990698628127575,
-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": "launcher", "annotation": null, "type_comment": null}}], "kwarg": ... | def launch_with(self, launcher):
self.server.listen()
if self.workers > 1:
# Use multi-process launcher
launcher.launch_service(self.server, self.workers)
else:
# Use single process launcher
launcher.launch_service(self.server) | |
19,666 | [
0.03685017302632332,
-0.01987813040614128,
0.01277964934706688,
-0.01819879189133644,
-0.009897379204630852,
0.053119510412216187,
0.012124587781727314,
0.045687541365623474,
0.011076489463448524,
0.003570083761587739,
-0.001726979622617364,
-0.0052881306037306786,
-0.018043959513306618,
0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "UnaryOp", "_fields": ... | def configure_threading():
monkeypatch_thread = not CONF.standard_threads
pydev_debug_url = utils.setup_remote_pydev_debug()
if pydev_debug_url:
# in order to work around errors caused by monkey patching we have to
# set the thread to False. An explanation is here:
# http://lists.op... | |
19,667 | [
0.00446698721498251,
0.045408595353364944,
0.04575487598776817,
-0.04834041744470596,
-0.021677006036043167,
0.022311849519610405,
-0.03123428113758564,
0.05161851644515991,
-0.0007495477329939604,
0.015998046845197678,
0.019645508378744125,
-0.024100953713059425,
-0.021561579778790474,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": {"_type": "arg", "_fields": {"arg": "servers", "annotation": null, "type_comment": null}}, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def serve(*servers):
logging.warning(_('Running keystone via eventlet is deprecated as of Kilo '
'in favor of running in a WSGI server (e.g. mod_wsgi). '
'Support for keystone under eventlet will be removed in '
'the "M"-Release.'))
if max([serve... | |
19,668 | [
0.031140074133872986,
0.0013919034972786903,
0.054085392504930496,
-0.04979519546031952,
0.003955777734518051,
-0.008224884048104286,
-0.012111367657780647,
0.0053024897351861,
-0.004651729483157396,
-0.0035791804548352957,
0.02913958951830864,
-0.014449283480644226,
0.04577012360095978,
-... | 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 create_servers():
admin_worker_count = _get_workers('admin_workers')
public_worker_count = _get_workers('public_workers')
servers = []
servers.append(create_server(paste_config,
'admin',
CONF.eventlet_server.a... | |
19,669 | [
0.03897835314273834,
0.0033994964323937893,
0.04857693240046501,
-0.03085257299244404,
-0.003958143759518862,
0.01670863665640354,
0.023856783285737038,
0.03796263039112091,
0.0011141207069158554,
0.022891847416758537,
-0.000329911446897313,
-0.023767909035086632,
0.008912965655326843,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "possible_topdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "poson... | def run(possible_topdir):
dev_conf = os.path.join(possible_topdir,
'etc',
'keystone.conf')
config_files = None
if os.path.exists(dev_conf):
config_files = [dev_conf]
common.configure(
version=pbr.version.VersionInfo('keystone').ver... | |
19,670 | [
0.07506143301725388,
0.04495594650506973,
0.014374478720128536,
-0.012339681386947632,
-0.011197338812053204,
0.035269830375909805,
0.015992797911167145,
-0.007419277913868427,
0.03274715691804886,
0.029819903895258904,
0.04776420444250107,
0.012875154614448547,
0.010209687985479832,
0.017... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "reason", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def processEnded(reason):
# Copy the child's log to ours so it's more visible.
with open(errorLogFile, 'r') as f:
for line in f:
log.msg("Child logged: " + line.rstrip())
self.failIfIn(1, p.data)
reason.trap(error.ProcessDone) | |
19,671 | [
0.001499656238593161,
-0.01626727357506752,
0.0300635676831007,
-0.08258269727230072,
-0.040879517793655396,
0.013861320912837982,
-0.04185490310192108,
0.018445635214447975,
0.04530126601457596,
0.018987517803907394,
0.02291073650121689,
-0.0008643005276098847,
0.011997249908745289,
0.001... | 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": "Subscript", "_fields"... | def main():
execName = sys.argv[0]
argv = sys.argv[1:]
configfile = None
try:
opts, args = getopt.getopt(argv, "hc:", ["config="])
except getopt.GetoptError:
print(execName + " -c <inputfile> ")
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
print(... | |
19,672 | [
0.023232458159327507,
-0.03243527188897133,
-0.005784908775240183,
-0.007001562975347042,
0.0017139242263510823,
0.0045715696178376675,
-0.0002627243520691991,
-0.010893530212342739,
0.020726216956973076,
-0.0003924289776477963,
0.07590330392122269,
0.0027664792723953724,
-0.0093884589150547... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "For", "_fields": {"body": [{"_type": "If", "_fields": {"body":... | def spin():
for value in count:
if value == howMany:
connection.loseConnection()
return
connection.write(intToBytes(value))
break
reactor.callLater(0, spin) | |
19,673 | [
0.026629997417330742,
0.012592184357345104,
-0.027904432266950607,
-0.06113486364483833,
0.007194854319095612,
-0.018469804897904396,
0.005910908337682486,
-0.026002289727330208,
0.0043654171749949455,
-0.005249913781881332,
-0.006762117147445679,
-0.027200639247894287,
0.07399334758520126,
... | 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": "template_name", "annotation": null, "type_comment": null}}, {"_ty... | def load_template_source(self, template_name, template_dirs=None):
for filepath in self.get_template_sources(template_name, template_dirs):
try:
with io.open(filepath, encoding=self.engine.file_charset) as fp:
return fp.read(), filepath
except IOE... | |
19,674 | [
0.006180264987051487,
0.00926162675023079,
0.028346192091703415,
-0.008940042927861214,
0.00850151851773262,
-0.006291357800364494,
-0.03197132423520088,
-0.007121630012989044,
0.00865938700735569,
0.05023730918765068,
0.01650019735097885,
-0.03162050247192383,
0.06136997416615486,
-0.0648... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fos", "annotation": null, "type_comment": null}}], "kwarg": null,... | def firewall_address6_template(data, fos):
vdom = data['vdom']
if 'state' in data and data['state']:
state = data['state']
elif 'state' in data['firewall_address6_template'] and data['firewall_address6_template']:
state = data['firewall_address6_template']['state']
else:
state = ... | |
19,675 | [
0.004781389143317938,
-0.01328649278730154,
0.03354256600141525,
0.006759794894605875,
0.031607866287231445,
0.016643080860376358,
-0.044987600296735764,
0.0016054512234404683,
0.009370474144816399,
0.013647792860865593,
-0.018006695434451103,
-0.019510166719555855,
0.05687551572918892,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fos", "annotation": null, "type_comment": null}}], "kwarg": null,... | def fortios_firewall(data, fos):
if data['firewall_address6_template']:
resp = firewall_address6_template(data, fos)
return not is_successful_status(resp), \
resp['status'] == "success", \
resp | |
19,676 | [
-0.0007415959844365716,
0.04211931303143501,
0.005551534704864025,
-0.020124660804867744,
0.005398484878242016,
-0.025801418349146843,
0.002866205759346485,
0.05022260546684265,
-0.03036508522927761,
0.07417629659175873,
0.021983521059155464,
-0.015783611685037613,
-0.02571237087249756,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "idx", "annotation": null, "type_comment": null}}], "kwarg": null,... | def sql_trim(node, idx=0):
tokens = node.tokens
count = len(tokens)
min_count = abs(idx)
while count > min_count and tokens[idx].is_whitespace:
tokens.pop(idx)
count -= 1 | |
19,677 | [
0.030379120260477066,
0.01308430079370737,
-0.019207661971449852,
-0.013355947099626064,
-0.005523476283997297,
0.030786588788032532,
0.03189581260085106,
0.0202829297631979,
0.010577230714261532,
0.049484916031360626,
0.022275002673268318,
-0.039184991270303726,
-0.006078087724745274,
0.0... | 7 | {"_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 sql_recursively_strip(node):
for sub_node in node.get_sublists():
sql_recursively_strip(sub_node)
if isinstance(node, Comment):
return node
sql_strip(node)
# strip duplicate whitespaces between parenthesis
if isinstance(node, Parenthesis):
sql_trim(node, 1)
sql... | |
19,678 | [
0.027307523414492607,
0.01949167437851429,
-0.02362736128270626,
-0.027834974229335785,
0.0043754372745752335,
0.008870749734342098,
0.038695648312568665,
0.026204673573374748,
-0.0318387970328331,
0.038120247423648834,
0.01910807378590107,
-0.026564298197627068,
-0.0234475489705801,
0.020... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "hide_columns", "annotation": null, "type_comment": null}}], "kwar... | def sql_recursively_simplify(node, hide_columns=True):
# Erase which fields are being updated in an UPDATE
if node.tokens[0].value == "UPDATE":
i_set = [i for (i, t) in enumerate(node.tokens) if t.value == "SET"][0]
i_where = [
i
for (i, t) in enumerate(node.tokens)
... | |
19,679 | [
0.012805094011127949,
0.027612438425421715,
0.03324668109416962,
-0.02854371815919876,
0.02432967908680439,
0.01368980947881937,
0.026820851489901543,
-0.0015933611430227757,
-0.006198829505592585,
0.0440029613673687,
-0.0501028411090374,
-0.050149403512477875,
0.04551628977060318,
0.02031... | 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 AzureRMMariaDbConfiguration(AzureRMModuleBase):
def __init__(self):
self.module_arg_spec = dict(
resource_group=dict(
type='str',
required=True
),
server_name=dict(
type='str',
required=True
... | |
19,680 | [
0.047651778906583786,
0.02608262188732624,
0.017717521637678146,
-0.08115557581186295,
-0.01173934992402792,
0.04591583088040352,
0.000758121139369905,
0.03402458503842354,
0.02089647576212883,
0.031355563551187515,
0.00174408545717597,
-0.08519165962934494,
0.014744710177183151,
-0.013996... | 11 | {"_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 list(self.module_arg_spec.keys()):
if hasattr(self, key):
setattr(self, key, kwargs[key])
old_response = None
response = None
old_response = self.get_configuration()
if not old_response:
self.... | |
19,681 | [
0.034942690283060074,
0.02969246357679367,
0.0309939906001091,
0.024001041427254677,
0.013191748410463333,
0.01331307739019394,
0.04286215454339981,
-0.009860721416771412,
0.029317447915673256,
0.048002082854509354,
-0.03547212854027748,
-0.057046592235565186,
0.062032103538513184,
-0.0116... | 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(
resource_group=dict(
type='str',
required=True
),
server_name=dict(
type='str',
required=True
),
name=dict(
type='str',
... | |
19,682 | [
0.027660632506012917,
0.0027199622709304094,
0.046183012425899506,
-0.03173801675438881,
0.01803063414990902,
-0.0004642120038624853,
0.06425462663173676,
0.02634931355714798,
-0.0023895713966339827,
-0.03210682421922684,
-0.03581539914011955,
-0.014219614677131176,
0.006116073112934828,
-... | 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 create_update_configuration(self):
self.log("Creating / Updating the Configuration instance {0}".format(self.name))
try:
response = self.mariadb_client.configurations.create_or_update(resource_group_name=self.resource_group,
... | |
19,683 | [
0.04987974837422371,
0.01906132884323597,
0.05429353937506676,
-0.03763440623879433,
-0.015692396089434624,
0.036306362599134445,
0.032068341970443726,
0.0296466164290905,
0.02339700050652027,
-0.018514487892389297,
-0.008578574284911156,
-0.04038814455270767,
0.016180647537112236,
-0.0031... | 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 delete_configuration(self):
self.log("Deleting the Configuration instance {0}".format(self.name))
try:
response = self.mariadb_client.configurations.create_or_update(resource_group_name=self.resource_group,
server... | |
19,684 | [
-0.012699007987976074,
0.01537920068949461,
0.05283808335661888,
-0.02138836309313774,
0.02150535397231579,
0.04620141535997391,
0.04722243919968605,
-0.004041560459882021,
-0.01827210746705532,
-0.02053750678896904,
-0.037586510181427,
-0.045350559055805206,
0.03792685270309448,
0.0130712... | 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_configuration(self):
self.log("Checking if the Configuration instance {0} is present".format(self.name))
found = False
try:
response = self.mariadb_client.configurations.get(resource_group_name=self.resource_group,
... | |
19,685 | [
0.026782719418406487,
-0.031790319830179214,
0.006593715399503708,
0.023078003898262978,
0.015419323928654194,
-0.0551515556871891,
-0.0020520389080047607,
-0.055650051683187485,
-0.04894304275512695,
-0.014830194413661957,
-0.028844671323895454,
-0.016416311264038086,
-0.011119813658297062,... | 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": "size", "annotation": n... | class HeadPhoto(Ui.RelativeLayout):
def __init__(self, size = 9):
self.value = [None] * (size * size)
self.size = size
Ui.RelativeLayout.__init__(self,
background = '#7fffff7f',
gravity = Ui.CENTER,
)
self.array = []
row = [Ui.TextView(self,
text = 0,
layout_width = '34dp',
layout_heig... | |
19,686 | [
-0.010960135608911514,
0.03659811243414879,
0.025087416172027588,
-0.031013039872050285,
0.01886664517223835,
0.012668577022850513,
0.01952504739165306,
0.018673663958907127,
-0.06116334721446037,
0.015585982240736485,
0.003436748869717121,
0.01187395304441452,
0.0560777522623539,
0.024360... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ngram_file", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg... | def read_ngram_iter(ngram_file):
cur_opes, cur_locs, cur_deps = [], [], []
for L in readline_iter(ngram_file):
if L.startswith('#'):
yield None, L, None
elif L == '': # separator of ngram
if cur_opes:
oseq = tuple(cur_opes)
ls = tuple(cur_... | |
19,687 | [
0.016161061823368073,
-0.02181396447122097,
0.016519425436854362,
0.019455699250102043,
0.0014226185157895088,
-0.042656879872083664,
-0.002018687780946493,
-0.06700251251459122,
-0.04966231808066368,
0.033038850873708725,
-0.02892344444990158,
-0.01744423620402813,
-0.013837475329637527,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "size", "annotation": null, "type_comment": null}}], "kwarg": null... | def __init__(self, size = 9):
self.value = [None] * (size * size)
self.size = size
Ui.RelativeLayout.__init__(self,
background = '#7fffff7f',
gravity = Ui.CENTER,
)
self.array = []
row = [Ui.TextView(self,
text = 0,
layout_width = '34dp',
layout_height = '34dp',
background = '#7f0f... | |
19,688 | [
0.0050039468333125114,
0.01657942496240139,
0.03187192231416702,
-0.05374964326620102,
-0.021822957322001457,
0.004579535219818354,
0.014156172052025795,
-0.01956399343907833,
-0.011602859012782574,
0.02324678935110569,
0.05506395176053047,
-0.03370647504925728,
0.007584641687572002,
0.040... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "argv", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def main(argv):
psr = gen_argpsr()
args = psr.parse_args(argv[1:])
# bag_comparison = args.bag_comparison
remove_fanin_fanout_clone = not args.debug_keep_fanin_fanout_clone
ope2locs = {} # oiseq -> [liseq]
ope_enum = EnumGenerator()
loc_enum = EnumGenerator()
oiseq_startingli2dep = {}
... | |
19,689 | [
0.04648059979081154,
-0.010523227043449879,
0.047541361302137375,
-0.007811055053025484,
0.0558345802128315,
0.012958155013620853,
0.023843005299568176,
0.014043022878468037,
0.009504655376076698,
0.060125838965177536,
0.035197965800762177,
-0.047348495572805405,
-0.015368973836302757,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": nu... | def __init__(self, module):
self.module = module
self.version = module.params['acme_version']
self.challenge = module.params['challenge']
self.csr = module.params['csr']
self.dest = module.params.get('dest')
self.fullchain_dest = module.params.get('fullchain_dest')
... | |
19,690 | [
0.012116589583456516,
0.021568918600678444,
0.04934672266244888,
-0.038573846220970154,
0.006741735152900219,
0.0718655064702034,
-0.0001358374283881858,
0.003718379884958267,
0.021789010614156723,
0.0770086869597435,
0.036558277904987335,
-0.055092256516218185,
-0.008033322170376778,
0.01... | 13 | {"_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(
account_key_src=dict(type='path', aliases=['account_key']),
account_key_content=dict(type='str', no_log=True),
account_uri=dict(type='str'),
modify_account=dict(type='bool', default=True),
acm... | |
19,691 | [
0.04905955120921135,
-0.013220593333244324,
0.02119542472064495,
0.0022419258020818233,
0.03597700223326683,
0.007762452587485313,
-0.00973757728934288,
0.029563158750534058,
0.026547376066446304,
-0.012094984762370586,
0.02055828832089901,
-0.008930536918342113,
-0.050546202808618546,
-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": "email_messages", "annotation": null, "type_comment": null}}], "kw... | def send_messages(self, email_messages):
num_sent = 0
if not email_messages:
return
for email_message in email_messages:
if self._send(email_message):
num_sent += 1
return num_sent | |
19,692 | [
0.020198820158839226,
0.00714879808947444,
-0.005142117850482464,
-0.003742722561582923,
0.004006759263575077,
0.00854159239679575,
-0.00880562886595726,
-0.04731540381908417,
0.01052186917513609,
0.023420069366693497,
0.05338825285434723,
0.009861776605248451,
-0.01634388230741024,
0.0222... | 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 TestWikiViews(OsfTestCase):
def setUp(self):
super(TestWikiViews, self).setUp()
self.user = AuthUserFactory()
self.project = ProjectFactory(is_public=True, creator=self.user)
self.consolidate_auth = Auth(user=self.project.creator)
def test_wiki_url_get_returns_200(self):
... | |
19,693 | [
0.00260128709487617,
0.005045612342655659,
-0.01670074835419655,
-0.013983880169689655,
0.014897112734615803,
-0.007979373447597027,
0.019965555518865585,
-0.0018963853362947702,
-0.02279657870531082,
0.030456319451332092,
0.06739659607410431,
-0.012328645214438438,
-0.042374011129140854,
... | 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": "mock_sharejs", "annotation": null, "type_comment": null}}], "kwar... | def test_wiki_deleted_404_with_no_write_permission(self, mock_sharejs):
self.project.update_node_wiki('funpage', 'Version 1', Auth(self.user))
self.project.save()
url = self.project.web_url_for('project_wiki_view', wname='funpage')
res = self.app.get(url)
assert_equal(res.status_... | |
19,694 | [
-0.015335479751229286,
-0.029407108202576637,
-0.0004228118050377816,
-0.05502266064286232,
-0.0049566663801670074,
0.011132045648992062,
0.013800802640616894,
0.022049687802791595,
-0.015369332395493984,
0.06964722275733948,
0.024487115442752838,
0.006375677417963743,
-0.04626597836613655,
... | 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_wiki_url_with_path_get_returns_200(self):
self.project.update_node_wiki('funpage', 'Version 1', Auth(self.user))
self.project.update_node_wiki('funpage', 'Version 2', Auth(self.user))
self.project.save()
url = self.project.web_url_for(
'project_wiki_view',
... | |
19,695 | [
0.01656915992498398,
0.015756290405988693,
-0.0027865807060152292,
-0.04462983459234238,
-0.012527086772024632,
0.012660709209740162,
-0.011252107098698616,
0.011341189034283161,
-0.039841704070568085,
0.052736248821020126,
0.019742688164114952,
0.003763693617656827,
-0.033739618957042694,
... | 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_wiki_url_with_edit_get_redirects_to_no_edit_params_with_no_write_permission(self):
self.project.update_node_wiki('funpage', 'Version 1', Auth(self.user))
self.project.update_node_wiki('funpage', 'Version 2', Auth(self.user))
self.project.save()
url = self.project.web_url_for(
... | |
19,696 | [
0.02788306213915348,
-0.010381773114204407,
-0.00500879529863596,
-0.01927603967487812,
-0.014741707593202591,
-0.006673264317214489,
0.015459814108908176,
0.03561810031533241,
-0.026590470224618912,
0.0517447255551815,
0.037054311484098434,
0.008868619799613953,
-0.040685880929231644,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_project_wiki_edit_post(self):
self.project.update_node_wiki(
'home',
content='old content',
auth=Auth(self.project.creator)
)
url = self.project.web_url_for('project_wiki_edit_post', wname='home')
res = self.app.post(url, {'content': 'new cont... | |
19,697 | [
0.04237988218665123,
-0.003954586107283831,
-0.03673555329442024,
-0.018711654469370842,
0.002914061537012458,
-0.03578692674636841,
0.04036404937505722,
-0.01454955618828535,
-0.012593014165759087,
0.009041594341397285,
0.035478625446558,
0.0039812661707401276,
-0.06616668403148651,
0.023... | 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": "mock_rendered_before_update", "annotation": null, "type_comment":... | def test_wiki_content_rendered_before_update(self, mock_rendered_before_update):
content = 'Some content'
self.project.update_node_wiki('somerandomid', content, Auth(self.user))
self.project.save()
mock_rendered_before_update.return_value = True
url = self.project.api_url_for('w... | |
19,698 | [
0.08003410696983337,
0.004321931395679712,
-0.013413663022220135,
-0.016761479899287224,
-0.006124602165073156,
-0.005069312173873186,
0.02378181926906109,
-0.005002131685614586,
-0.01425341609865427,
0.04622003436088562,
0.04075603559613228,
0.0081176171079278,
-0.038068827241659164,
0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_project_wiki_edit_post_with_new_wname_and_content(self):
# note: forward slashes not allowed in page_name
page_name = fake.catch_phrase().replace('/', ' ')
page_content = fake.bs()
old_wiki_page_count = WikiVersion.objects.all().count()
url = self.project.web_url_for('p... | |
19,699 | [
0.06988551467657089,
0.011578211560845375,
-0.024098454043269157,
-0.019574517384171486,
-0.004775875248014927,
-0.005827444139868021,
0.015488733537495136,
-0.010154211893677711,
-0.016277410089969635,
0.041120726615190506,
0.041427433490753174,
0.009874888695776463,
-0.0329272523522377,
... | 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_project_wiki_edit_post_with_new_wname_and_no_content(self):
# note: forward slashes not allowed in page_name
page_name = fake.catch_phrase().replace('/', ' ')
old_wiki_page_count = WikiVersion.objects.all().count()
url = self.project.web_url_for('project_wiki_edit_post', wname=p... | |
19,700 | [
0.05797739326953888,
-0.002505491953343153,
0.0011237349826842546,
-0.002372956136241555,
-0.026913242414593697,
-0.013614536263048649,
-0.01342278253287077,
0.008346940390765667,
-0.013185909949243069,
0.05513492226600647,
0.027206512168049812,
-0.007816796191036701,
-0.05093889310956001,
... | 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_project_wiki_edit_post_with_special_characters(self):
new_wname = 'title: ' + SPECIAL_CHARACTERS_ALLOWED
new_wiki_content = 'content: ' + SPECIAL_CHARACTERS_ALL
url = self.project.web_url_for('project_wiki_edit_post', wname=new_wname)
res = self.app.post(url, {'content': new_wik... |