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 |
|---|---|---|---|---|---|
11,401 | [
0.013068879023194313,
0.046004459261894226,
0.007857631891965866,
-0.011557554826140404,
-0.023491373285651207,
0.0014603720046579838,
0.014912568964064121,
-0.005854030139744282,
-0.005728608928620815,
0.01156382542103529,
0.06717554479837418,
0.05363006517291069,
0.011921276338398457,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "commitMessage", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "expectedLogMessage", "annotation": null, "type_comment":... | def commit(commitMessage, expectedLogMessage, uncheckUntracked=False):
openVcsLog()
clickButton(waitForObject(":*Qt Creator.Clear_QToolButton"))
invokeMenuItem("Tools", "Git", "Local Repository", "Commit...")
replaceEditorContent(waitForObject(":Description.description_Utils::CompletingTextEdit"), commi... | |
11,402 | [
0.0024969084188342094,
-0.03204978257417679,
0.023326033726334572,
-0.02600664645433426,
-0.02720586769282818,
-0.020245680585503578,
0.02861671708524227,
0.004256060812622309,
0.0023043863475322723,
0.02965134009718895,
0.017753180116415024,
-0.044676877558231354,
0.040185678750276566,
-0... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "producerroles", "annotation": null, "type_comment": null}}], "kwa... | def _processProducerRoles(self, producerroles):
if j.data.types.string.check(producerroles):
if producerroles == "*":
return "*"
elif producerroles == "":
producerroles = []
elif producerroles.find(",") != -1:
producerroles = [i... | |
11,403 | [
-0.002547885524109006,
0.0466892383992672,
-0.010165789164602757,
-0.03453407064080238,
-0.020202817395329475,
0.007397398352622986,
0.026228895410895348,
-0.01023017056286335,
-0.009953332133591175,
0.022185757756233215,
0.038396939635276794,
0.019674891605973244,
-0.01937873847782612,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "labelName", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "lineEditName", "annotation": null, "type_comment": null}}, {... | def checkOrFixCommitterInformation(labelName, lineEditName, expected):
lineEd = waitForObject("{name='%s' type='QLineEdit' visible='1'}" % lineEditName)
if not (test.compare(lineEd.text, expected, "Verifying commit information matches local config")
and test.verify(checkIfObjectExists("{name='%s' type='... | |
11,404 | [
0.015137951821088791,
0.01784645766019821,
-0.02552674151957035,
-0.023226367309689522,
-0.0253288596868515,
-0.009683836251497269,
0.0029156634118407965,
-0.01834116131067276,
-0.0012614959850907326,
0.004829550627619028,
0.07296888530254364,
0.04303927347064018,
0.016176830977201462,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "count", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def __clickCommit__(count):
gitEditor = waitForObject(":Qt Creator_Git::Internal::GitEditor")
fileName = waitForObject(":Qt Creator_FilenameQComboBox")
test.verify(waitFor('str(fileName.currentText).startswith("Git Log")', 1000),
"Verifying Qt Creator still displays git log inside editor.")
... | |
11,405 | [
0.014188268221914768,
0.01087177637964487,
0.030120063573122025,
-0.03044855408370495,
-0.03060016594827175,
-0.026481399312615395,
0.006828814744949341,
0.00638977438211441,
-0.023322835564613342,
0.0351484976708889,
0.04113713279366493,
0.05089078098535538,
0.011749857105314732,
-0.00534... | 13 | {"_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():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
createProject_Qt_GUI(srcPath, projectName, addToVersionControl = "Git")
openVcsLog()
vcsLog = waitForObject("{type='Core::OutputWindow' unnamed='1' visible='1' "
"wi... | |
11,406 | [
0.03214280307292938,
0.013341814279556274,
-0.006741059944033623,
-0.05155603587627411,
-0.0021157490555197,
-0.004575884900987148,
-0.0006174255977384746,
-0.024132613092660904,
-0.0031919588800519705,
0.02302291989326477,
0.07989782094955444,
0.04165809229016304,
-0.008871158584952354,
0... | 12 | {"_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 verifyClickCommit():
for i in range(1, 3):
if not __clickCommit__(i):
continue
changed = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget")
original = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget2")
waitFor('str(changed.plainText) != "Waiting... | |
11,407 | [
0.04183878004550934,
0.019605979323387146,
-0.01862568035721779,
-0.0435899943113327,
-0.04290473833680153,
-0.01213476900011301,
0.008146950975060463,
0.013381557539105415,
-0.0010784479090943933,
0.030722379684448242,
0.05287903919816017,
0.023070337250828743,
0.004049681592732668,
-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 deleteProject():
path = os.path.join(srcPath, projectName)
if os.path.exists(path):
try:
# Make files in .git writable to remove them
for root, dirs, files in os.walk(path):
for name in files:
os.chmod(os.path.join(root, name), stat.S_IWUSR... | |
11,408 | [
-0.010493832640349865,
0.010957589372992516,
0.05716065317392349,
-0.023274092003703117,
-0.004882921930402517,
0.013901902362704277,
-0.033433590084314346,
-0.009695740416646004,
-0.0638473704457283,
-0.04201847314834595,
-0.008541742339730263,
-0.05103475600481033,
0.07484810054302216,
-... | 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 BQTable(collections.namedtuple('BQTable', 'project_id dataset_id table_id location')):
@property
def dataset(self):
return BQDataset(project_id=self.project_id, dataset_id=self.dataset_id, location=self.location)
@property
def uri(self):
return "bq://" + self.project_id + "/" + \
... | |
11,409 | [
-0.017634959891438484,
0.031402893364429474,
0.03229186683893204,
-0.037136755883693695,
-0.029669402167201042,
0.00793962087482214,
0.003158624516800046,
0.03613666445016861,
-0.015056943520903587,
0.05360494181513786,
-0.0052754865027964115,
-0.02495785616338253,
0.03073616698384285,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parameter_tuples", "annotation": null, "type_comment": null}}], "k... | def bulk_complete(cls, parameter_tuples):
# Instantiate the tasks to inspect them
tasks_with_params = [(cls(p), p) for p in parameter_tuples]
if not tasks_with_params:
return
# Grab the set of BigQuery datasets we are interested in
datasets = {t.output().table.datase... | |
11,410 | [
0.030030155554413795,
0.005951718892902136,
0.07006282359361649,
-0.028129227459430695,
-0.03247420862317085,
-0.021249674260616302,
0.01988055184483528,
0.03645710647106171,
-0.04338192194700241,
0.016768911853432655,
0.023003507405519485,
-0.00784699060022831,
0.01837565004825592,
-0.047... | 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):
output = self.output()
assert isinstance(output, BigQueryTarget), 'Output must be a BigQueryTarget, not %s' % (output)
bq_client = output.client
source_uris = self.source_uris()
assert all(x.startswith('gs://') for x in source_uris)
job = {
'... | |
11,411 | [
0.03269171714782715,
-0.003083794377744198,
0.012475084513425827,
-0.03642258420586586,
-0.025836249813437462,
0.007794013246893883,
0.029776977375149727,
-0.02037985809147358,
-0.037658434361219406,
-0.010312347672879696,
0.026885556057095528,
-0.01463199220597744,
0.017698297277092934,
-... | 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 complete(self):
output = self.output()
assert isinstance(output, BigQueryTarget), 'Output must be a BigQueryTarget, not %s' % (output)
if not output.exists():
return False
existing_view = output.client.get_view(output.table)
return existing_view == self.view | |
11,412 | [
0.031946226954460144,
0.0013912022113800049,
0.07323935627937317,
-0.02613183669745922,
-0.022368939593434334,
-0.015227115713059902,
0.007750689517706633,
0.051912616938352585,
-0.03038840740919113,
-0.0006880588480271399,
0.008299216628074646,
-0.003307619132101536,
0.0028825104236602783,
... | 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):
output = self.output()
assert isinstance(output, BigQueryTarget), 'Output must be a BigQueryTarget, not %s' % (output)
query = self.query
assert query, 'No query was provided'
bq_client = output.client
logger.info('Launching Query')
logger.info('... | |
11,413 | [
-0.013132876716554165,
-0.0008734550792723894,
0.0208981204777956,
-0.03412819653749466,
-0.035877808928489685,
-0.03164418414235115,
-0.005799633916467428,
0.05965954810380936,
-0.030780179426074028,
-0.0054513318464159966,
0.005713233258575201,
0.010476061142981052,
0.01887851022183895,
... | 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):
input = luigi.task.flatten(self.input())[0]
assert (
isinstance(input, BigQueryTarget) or
(len(input) == 1 and isinstance(input[0], BigQueryTarget))), \
'Input must be exactly one BigQueryTarget, not %s' % (input)
bq_client = input.client
... | |
11,414 | [
0.05248392000794411,
0.012052495963871479,
0.03365723788738251,
-0.03540955111384392,
-0.024981148540973663,
-0.02438279800117016,
0.02746003121137619,
0.012661531567573547,
-0.04957764595746994,
-0.007725137285888195,
0.019927220419049263,
0.006485695950686932,
0.01693546772003174,
-0.044... | 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 run(self):
output = self.output()
assert isinstance(output, BigQueryTarget), 'Output must be a BigQueryTarget, not %s' % (output)
view = self.view
assert view, 'No view was provided'
logger.info('Create view')
logger.info('Destination: %s', output)
logger.in... | |
11,415 | [
0.013096180744469166,
-0.03234933316707611,
0.05712861940264702,
-0.0337371751666069,
-0.003513763193041086,
0.0016937978798523545,
-0.005551367532461882,
-0.017562508583068848,
-0.009096672758460045,
0.029750283807516098,
0.01771390810608864,
-0.049987539649009705,
-0.012225625105202198,
... | 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 FunFactManagerTests(TestCase):
def setUp(self):
self.published_1 = FunFactFactory.create(published=True)
self.published_2 = FunFactFactory.create(published=True)
self.unpublished_1 = FunFactFactory.create(published=False)
def test_published(self):
facts = FunFact.objects.p... | |
11,416 | [
-0.00333888060413301,
-0.015507965348660946,
0.00982214417308569,
0.011293844319880009,
-0.0016969941789284348,
0.019657254219055176,
-0.02047414518892765,
-0.007617834489792585,
0.02446783520281315,
0.04076676070690155,
0.04483824968338013,
-0.011877338401973248,
-0.019047826528549194,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "clean_mock", "annotati... | class FunFactTests(TestCase):
@patch('mozillians.funfacts.models.ALLOWED_TAGS', ['em', 'strong'])
@patch('mozillians.funfacts.models.bleach.clean', wraps=clean)
def test_clean(self, clean_mock):
text = '<strong><a href="#">foo</a></strong>'
tags = ['em', 'strong']
fact = FunFactFacto... | |
11,417 | [
0.0023433787282556295,
0.006993221119046211,
-0.005738103296607733,
-0.010147258639335632,
-0.027193235233426094,
0.02955581061542034,
0.009975971654057503,
-0.021546682342886925,
0.05306342989206314,
0.01179515477269888,
-0.003910061437636614,
-0.03626552224159241,
-0.017364924773573875,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
module = AnsibleModule(
argument_spec=dict(
msg=dict(required=True),
app_token=dict(required=True),
user_key=dict(required=True),
pri=dict(required=False, default=0),
),
)
msg_object = Pushover(module, module.params['user_key'], m... | |
11,418 | [
0.005714038852602243,
-0.011544426903128624,
0.05745065212249756,
-0.05295181646943092,
-0.01926225796341896,
0.012307160533964634,
0.010620096698403358,
0.048168569803237915,
0.0012564097996801138,
0.03477548435330391,
0.03467206284403801,
-0.005885330494493246,
0.02663104049861431,
-0.00... | 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 ErtTestContextTest(ExtendedTestCase):
def setUp(self):
self.config = self.createTestPath("Statoil/config/with_data/config")
def test_raises(self):
with self.assertRaises(IOError):
testContext = ErtTestContext("ExistTest" , "Does/not/exist")
def initFromCaseTest(self, con... | |
11,419 | [
-0.0001701845321804285,
-0.023766187950968742,
0.0662497878074646,
-0.018606586381793022,
-0.0007161411340348423,
-0.0005064168362878263,
0.009383334778249264,
0.04157235845923424,
-0.02427106536924839,
0.023162798956036568,
0.006846632342785597,
-0.022756433114409447,
0.042286574840545654,
... | 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": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def selectCaseTest(self, context, root_path):
ert = context.getErt()
select_case_job = self.createSharePath("%s/SELECT_CASE" % root_path)
default_fs = ert.getEnkfFsManager().getCurrentFileSystem()
custom_fs = ert.getEnkfFsManager().getFileSystem("CustomCase")
self.assertEqual(... | |
11,420 | [
-0.018902508541941643,
-0.010194683447480202,
0.04817424342036247,
0.006606827490031719,
-0.0011555482633411884,
-0.00656157499179244,
0.030642231926321983,
0.03868420049548149,
0.020402297377586365,
0.04362316057085991,
0.031288694590330124,
0.0038561373949050903,
0.02849598228931427,
-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": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def initFromCaseTest(self, context, root_path):
ert = context.getErt()
init_case_job = self.createSharePath("%s/INIT_CASE_FROM_EXISTING" % root_path)
self.assertTrue(context.installWorkflowJob("INIT_CASE_JOB", init_case_job))
self.assertTrue(context.runWorkflowJob("INIT_CASE_JOB", "defa... | |
11,421 | [
-0.0026040351949632168,
0.0029598562978208065,
0.05795254930853844,
-0.035792719572782516,
0.00890988577157259,
-0.009254537522792816,
0.006510088220238686,
0.06693902611732483,
-0.004940008278936148,
0.025108516216278076,
0.03321421518921852,
-0.021496055647730827,
0.012286195531487465,
-... | 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_workflow_function_jobs(self):
with ErtTestContext("python/enkf/ert_test_context_workflow_function_job", self.config) as context:
internal_config = "workflows/jobs/internal-tui/config"
self.createCaseTest(context, root_path=internal_config)
self.selectCaseTest(contex... | |
11,422 | [
0.030066508799791336,
0.025866618379950523,
0.03195057436823845,
-0.022608758881688118,
-0.04257459565997124,
-0.00800726842135191,
-0.005619480274617672,
-0.03095620684325695,
0.030014174059033394,
0.025199346244335175,
0.01771542802453041,
0.007274577394127846,
0.013371615670621395,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}], "kwarg": n... | def rankRealizationsOnObservationsTest(self, context):
rank_job = self.createSharePath("workflows/jobs/internal/config/OBSERVATION_RANKING")
self.assertTrue(context.installWorkflowJob("OBS_RANK_JOB", rank_job))
self.assertTrue(context.runWorkflowJob("OBS_RANK_JOB", "NameOfObsRanking1", "|", "W... | |
11,423 | [
0.02752986177802086,
0.00030686857644468546,
-0.028664277866482735,
-0.023356828838586807,
0.04132517799735069,
-0.008173877373337746,
0.00468453299254179,
0.014311881735920906,
-0.003940072376281023,
0.05214264988899231,
-0.002912007039412856,
-0.041041575372219086,
-0.003621017560362816,
... | 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": "request", "annotation": null, "type_comment": null}}], "kwarg": n... | def post(self, request):
serializer = BulkEnrollmentSerializer(data=request.data)
if serializer.is_valid():
# Setting the content type to be form data makes Django Rest Framework v3.6.3 treat all passed JSON data as
# POST parameters. This is necessary because this request is for... | |
11,424 | [
0.07435884326696396,
0.02637195959687233,
0.055418383330106735,
-0.05489225685596466,
-0.042484503239393234,
-0.02422362007200718,
0.0035431154537945986,
-0.010270376689732075,
-0.008807094767689705,
0.019477544352412224,
0.007436980493366718,
-0.014534172601997852,
-0.010938992723822594,
... | 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 finalize_options(self):
filenames = []
if self.global_config:
filenames.append(config_file('global'))
if self.user_config:
filenames.append(config_file('user'))
if self.filename is not None:
filenames.append(self.filename)
if not filenames:... | |
11,425 | [
-0.008593394421041012,
-0.009621663950383663,
0.037238042801618576,
-0.028595684096217155,
0.01808040402829647,
-0.005233156960457563,
-0.018692469224333763,
-0.010992689989507198,
0.008495463989675045,
-0.024641742929816246,
0.02578018419444561,
-0.01590145379304886,
-0.01411422248929739,
... | 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 FileTest(BaseTestCase):
def setUp(self):
self.login_as(self.user)
self.video = self.create_file(repo_id=self.repo.id,
parent_dir='/',
filename='test.mp4',
username=self.user.userna... | |
11,426 | [
0.011354358866810799,
-0.0036699268966913223,
0.03048347681760788,
-0.012465039268136024,
-0.006068593822419643,
-0.01518821157515049,
0.05015455186367035,
0.011213851161301136,
-0.0008497369708493352,
-0.034337401390075684,
0.03880688548088074,
0.005533326417207718,
-0.001205187989398837,
... | 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.login_as(self.user)
self.video = self.create_file(repo_id=self.repo.id,
parent_dir='/',
filename='test.mp4',
username=self.user.username)
self.audio = self.crea... | |
11,427 | [
0.008111915551126003,
-0.006325149908661842,
0.004946362692862749,
-0.010988608002662659,
0.0567476749420166,
0.006402576342225075,
-0.029398249462246895,
0.006819488480687141,
-0.024633541703224182,
0.0006372797070071101,
0.008546695113182068,
-0.020833685994148254,
0.008564562536776066,
... | 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_can_download(self):
dl_url = reverse('view_lib_file', args=[self.repo.id, self.file]) + '?dl=1'
resp = self.client.get(dl_url)
self.assertEqual(302, resp.status_code)
assert '8082/files/' in resp.get('location')
resp = requests.request('GET', resp.get('location'))
... | |
11,428 | [
-0.01345478743314743,
-0.010481039062142372,
0.013657687231898308,
-0.02112693339586258,
0.018666774034500122,
0.0201631598174572,
-0.0026678142603486776,
-0.02263600006699562,
0.04466330260038376,
-0.024246517568826675,
0.026884213089942932,
-0.02467767894268036,
0.003200425999239087,
-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 FileAccessLogTest(BaseTestCase):
def setUp(self):
self.login_as(self.user)
self.file_path = self.file
self.repo_id = self.repo.id
def tearDown(self):
self.remove_repo()
def generate_file_audit_event_type(self, e):
return {
'file-download-web': ('we... | |
11,429 | [
-0.019589366391301155,
0.010546299628913403,
-0.03633797913789749,
-0.005758445244282484,
-0.0020269963424652815,
0.012451971881091595,
-0.00006121677142800763,
-0.018725303933024406,
0.029046710580587387,
-0.005501002073287964,
0.053122103214263916,
-0.033781301230192184,
0.0490503534674644... | 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": "mock_file_audit_enabled", "annotation": null, "type_comment": nul... | def test_can_show_share_link_type(self, mock_file_audit_enabled, mock_is_pro_version,
mock_get_file_audit_events_by_path, mock_generate_file_audit_event_type):
etype = 'file-download-share-link'
event = Event(self.user.email, self.repo_id, self.file_path, etype)
mock_file_audit_ena... | |
11,430 | [
-0.01884124055504799,
0.0350974015891552,
-0.013049671426415443,
-0.023302985355257988,
0.006866612937301397,
0.0009360032272525132,
-0.0199473537504673,
-0.01594545505940914,
0.045512281358242035,
0.005701463669538498,
0.032437752932310104,
-0.05030959099531174,
0.049787603318691254,
-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": "mock_file_audit_enabled", "annotation": null, "type_comment": nul... | def test_can_show_web_type(self, mock_file_audit_enabled, mock_is_pro_version,
mock_get_file_audit_events_by_path, mock_generate_file_audit_event_type):
etype = 'file-download-web'
event = Event(self.user.email, self.repo_id, self.file_path, etype)
mock_file_audit_enabled.return_va... | |
11,431 | [
-0.0070579769089818,
0.027483424171805382,
-0.02280539460480213,
-0.03749440610408783,
0.0025977683253586292,
0.010993369854986668,
-0.04198531433939934,
-0.0132271284237504,
0.04378635808825493,
-0.026056624948978424,
0.02177622728049755,
-0.050990521907806396,
0.026828499510884285,
0.020... | 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": "mock_file_audit_enabled", "annotation": null, "type_comment": nul... | def test_can_show_api_type(self, mock_file_audit_enabled, mock_is_pro_version,
mock_get_file_audit_events_by_path, mock_generate_file_audit_event_type):
etype = 'file-download-api'
event = Event(self.user.email, self.repo_id, self.file_path, etype)
mock_file_audit_enabled.return_va... | |
11,432 | [
-0.01130521297454834,
0.018826352432370186,
-0.03741767257452011,
-0.023832611739635468,
0.0022534041199833155,
0.026841068640351295,
0.009313286282122135,
-0.025642385706305504,
0.011522620916366577,
-0.022128604352474213,
0.02352706529200077,
-0.03154177963733673,
0.024091150611639023,
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": "mock_file_audit_enabled", "annotation": null, "type_comment": nul... | def test_can_show_download_sync_type(self, mock_file_audit_enabled, mock_is_pro_version,
mock_get_file_audit_events_by_path, mock_generate_file_audit_event_type):
etype = 'repo-download-sync'
event = Event(self.user.email, self.repo_id, self.file_path, etype)
mock_file_audit_enable... | |
11,433 | [
0.0008478452800773084,
0.03163304179906845,
-0.04368599131703377,
-0.032109443098306656,
-0.00616939552128315,
0.02377242036163807,
0.010147345252335072,
-0.020449521020054817,
0.009140947833657265,
-0.023307928815484047,
0.016007080674171448,
-0.021128393709659576,
0.026964308694005013,
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": "mock_file_audit_enabled", "annotation": null, "type_comment": nul... | def test_can_show_upload_sync_type(self, mock_file_audit_enabled, mock_is_pro_version,
mock_get_file_audit_events_by_path, mock_generate_file_audit_event_type):
etype = 'repo-upload-sync'
event = Event(self.user.email, self.repo_id, self.file_path, etype)
mock_file_audit_enabled.re... | |
11,434 | [
0.03328784927725792,
0.01555208396166563,
0.05560402572154999,
0.017216475680470467,
-0.04748179018497467,
0.021224332973361015,
-0.006890585180372,
0.03200959786772728,
0.012968946248292923,
-0.002726275008171797,
0.001707666669972241,
0.003445292590186,
0.01129789650440216,
-0.0160181131... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "core", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def addSpawnArea(core):
dynamicGroups = Vector()
dynamicGroups.add('endor_bark_mite')
dynamicGroups.add('endor_bloodseeker')
dynamicGroups.add('endor_bolle')
dynamicGroups.add('endor_donkuwah')
dynamicGroups.add('endor_jinda')
core.spawnService.addDynamicSpawnArea(dynamicGroups, 5000, 0, 4000, 'endor')
return | |
11,435 | [
0.01937652938067913,
0.017281146720051765,
0.008318206295371056,
0.027286021038889885,
-0.014218664728105068,
0.013378209434449673,
-0.01888146623969078,
-0.0236018318682909,
-0.032305728644132614,
0.02974982187151909,
-0.012952225282788277,
-0.000008786600119492505,
-0.00520679447799921,
... | 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 data(self):
# NOTE(mrodden): this should always resolve to a unicode string
# that best represents the state of the message currently
localedir = os.environ.get(self.domain.upper() + '_LOCALEDIR')
if self.locale:
lang = gettext.translation(self.domain,
... | |
11,436 | [
0.06444381177425385,
-0.030599383637309074,
-0.02242964506149292,
0.00010310367360943928,
-0.004173422232270241,
0.013528630137443542,
-0.002807990415021777,
0.011243388056755066,
-0.034918490797281265,
0.048675645142793655,
0.03871199116110802,
-0.027674274519085884,
0.020487191155552864,
... | 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 __getstate__(self):
to_copy = ['_msg', '_right_extra_msg', '_left_extra_msg',
'domain', 'params', 'locale']
new_dict = self.__dict__.fromkeys(to_copy)
for attr in to_copy:
new_dict[attr] = copy.deepcopy(self.__dict__[attr])
return new_dict | |
11,437 | [
-0.012726971879601479,
0.044397983700037,
-0.04667307063937187,
0.0017823391826823354,
0.022401724010705948,
-0.00665631890296936,
-0.025769302621483803,
0.01071092952042818,
0.016916736960411072,
-0.04613245651125908,
0.0003889187937602401,
0.032256677746772766,
-0.0056060622446238995,
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": "name", "annotation": null, "type_comment": null}}], "kwarg": null... | def __getattribute__(self, name):
# NOTE(mrodden): handle lossy operations that we can't deal with yet
# These override the UserString implementation, since UserString
# uses our __class__ attribute to try and build a new message
# after running the inner data string through the operatio... | |
11,438 | [
-0.02453235723078251,
0.0382666140794754,
-0.07239942997694016,
-0.002868547337129712,
0.020456509664654732,
0.033340826630592346,
-0.01862141117453575,
-0.012826366350054741,
0.014091618359088898,
0.034229401499032974,
-0.005389391910284758,
-0.027893483638763428,
0.022272290661931038,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def asbool(obj):
if isinstance(obj, (str, unicode)):
obj = obj.strip().lower()
if obj in ['true', 'yes', 'on', 'y', 't', '1']:
return True
elif obj in ['false', 'no', 'off', 'n', 'f', '0']:
return False
else:
raise ValueError(
"Stri... | |
11,439 | [
0.009075181558728218,
0.024697037413716316,
-0.04351382702589035,
-0.02646111138164997,
-0.02085527591407299,
0.0033664414659142494,
-0.06468271464109421,
-0.03731996566057205,
0.02985205315053463,
0.059743307530879974,
-0.00891837477684021,
-0.04116172716021538,
0.05774402618408203,
-0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "obj", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "sep", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def aslist(obj, sep=None, strip=True):
if isinstance(obj, (str, unicode)):
lst = obj.split(sep)
if strip:
lst = [v.strip() for v in lst]
return lst
elif isinstance(obj, (list, tuple)):
return obj
elif obj is None:
return []
else:
return [obj] | |
11,440 | [
-0.0028650755994021893,
0.01182134822010994,
-0.00027169447275809944,
-0.028021836653351784,
-0.04262673482298851,
-0.04244038835167885,
-0.015548275783658028,
0.016619767993688583,
-0.03587167710065842,
0.03808454051613808,
0.0522235743701458,
0.01694587431848049,
-0.012706493958830833,
-... | 17 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "requirement", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "find_links", "annotation": null, "type_comment": null}}, {... | def freeze(
requirement=None,
find_links=None, local_only=None, user_only=None, skip_regex=None,
find_tags=False,
default_vcs=None,
isolated=False,
wheel_cache=None):
find_links = find_links or []
skip_match = None
if skip_regex:
skip_match = re.compi... | |
11,441 | [
-0.005244736559689045,
-0.002822225447744131,
0.06254923343658447,
-0.021124297752976418,
0.026550721377134323,
0.0012710612500086427,
-0.01843530870974064,
0.034714583307504654,
-0.0030190544202923775,
0.024443136528134346,
-0.00494192261248827,
-0.03868750110268593,
-0.0026738466694951057,... | 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 reports_counts():
context = flask.request.environ.get('context')
tenants = central_api.count_tenants(context)
domains = central_api.count_domains(context)
records = central_api.count_records(context)
return flask.jsonify(tenants=tenants, domains=domains, records=records) | |
11,442 | [
-0.004307783208787441,
0.007345518562942743,
0.062476594001054764,
-0.026109257712960243,
0.007058536633849144,
0.03006594628095627,
0.027183912694454193,
-0.002115729032084346,
-0.019246112555265427,
0.023483676835894585,
0.02380118891596794,
-0.009659692645072937,
0.01671822927892208,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "subtxn", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def _test(subtxn):
ctr[0] += 1
if ctr[0] == 1:
raise ValueError
cs = schema.CALENDARSERVER
return Select(
[cs.VALUE, ],
From=cs,
Where=cs.NAME == 'VERSION',
).on(subtxn) | |
11,443 | [
0.021608565002679825,
-0.007864300161600113,
0.03325892984867096,
-0.020598137751221657,
0.014182522892951965,
0.025686802342534065,
-0.016154685989022255,
0.026709403842687607,
-0.003551717847585678,
0.029558083042502403,
0.012478185817599297,
-0.025978974997997284,
-0.006245180033147335,
... | 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_get_full_configuration(self):
self._set_args()
resp = dict(result=None)
with mock.patch(self.REQ_FUNC, return_value=(200, resp)):
ldap = self._make_ldap_instance()
result = ldap.get_full_configuration()
self.assertEqual(resp, result) | |
11,444 | [
0.023524468764662743,
0.003999159671366215,
0.030400851741433144,
-0.023174617439508438,
-0.011134915053844452,
0.03597434237599373,
-0.011050468310713768,
0.011074596084654331,
-0.01557440496981144,
0.024200042709708214,
-0.004771244712173939,
-0.0471213199198246,
-0.012920361943542957,
-... | 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_get_full_configuration_failure(self):
self._set_args()
resp = dict(result=None)
with self.assertRaises(AnsibleFailJson):
with mock.patch(self.REQ_FUNC, side_effect=Exception):
ldap = self._make_ldap_instance()
ldap.get_full_configuration() | |
11,445 | [
0.03878764435648918,
-0.0016855602152645588,
0.053792014718055725,
-0.02592327818274498,
0.03248921036720276,
0.035431720316410065,
-0.005310502368956804,
0.02114473655819893,
0.02762555703520775,
0.044648345559835434,
0.0376933217048645,
-0.01939382217824459,
-0.009648274630308151,
0.0377... | 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_clear_configuration(self):
self._set_args()
# No changes are required if the domains are empty
config = dict(ldapDomains=[])
ldap = self._make_ldap_instance()
with mock.patch.object(ldap, 'get_full_configuration', return_value=config):
with mock.patch(self.... | |
11,446 | [
0.01611264981329441,
-0.027428314089775085,
0.046924978494644165,
-0.026074709370732307,
0.011232547461986542,
0.02402055449783802,
-0.01534085813909769,
-0.00482370238751173,
0.008650011382997036,
0.012111203745007515,
0.0012801364064216614,
-0.05694640427827835,
0.001200730912387371,
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 test_get_configuration(self):
self._set_args()
resp = dict(result=None)
with mock.patch(self.REQ_FUNC, return_value=(200, resp)):
ldap = self._make_ldap_instance()
result = ldap.get_configuration('')
self.assertEqual(resp, result)
with mock.patc... | |
11,447 | [
0.04932460933923721,
-0.0049432991072535515,
0.061414919793605804,
-0.03619867563247681,
0.024782726541161537,
0.028877055272459984,
-0.005482184700667858,
0.013113891705870628,
0.02964775077998638,
0.04742195084691048,
0.03448869287967682,
-0.029695920646190643,
-0.002054690383374691,
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 test_clear_single_configuration(self):
self._set_args()
# No changes are required if the domains are empty
config = 'abc'
ldap = self._make_ldap_instance()
with mock.patch.object(ldap, 'get_configuration', return_value=config):
with mock.patch(self.REQ_FUNC, ret... | |
11,448 | [
0.045248642563819885,
-0.01477725338190794,
0.04803500697016716,
-0.024577157571911812,
0.016182342544198036,
0.034293707460165024,
0.025458315387368202,
0.0054030450992286205,
-0.0002610355440992862,
0.029054390266537666,
0.017480265349149704,
-0.030673816800117493,
-0.020373797044157982,
... | 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_update_configuration(self):
self._set_args()
config = dict(id='abc')
body = dict(id='xyz')
ldap = self._make_ldap_instance()
with mock.patch.object(ldap, 'make_configuration', return_value=body):
with mock.patch.object(ldap, 'get_configuration', return_valu... | |
11,449 | [
0.023834943771362305,
0.0037545361556112766,
0.02259230799973011,
-0.022343778982758522,
-0.0012966315262019634,
0.06092467159032822,
0.0329476073384285,
0.008733956143260002,
-0.0011065378785133362,
0.017006361857056618,
-0.006278270855545998,
-0.036734689027071,
-0.0229710154235363,
0.00... | 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_update_disable(self):
self._set_args()
ldap = self._make_ldap_instance()
with self.assertRaises(AnsibleExitJson):
with mock.patch.object(ldap, 'get_base_path', return_value='/'):
with mock.patch.object(ldap, 'clear_single_configuration', return_value=('', Tr... | |
11,450 | [
-0.007934381254017353,
-0.004316899925470352,
0.025316638872027397,
-0.0229546707123518,
0.018781093880534172,
0.05604517087340355,
0.020959608256816864,
0.005764465779066086,
-0.0032161762937903404,
0.0287564005702734,
0.015903159976005554,
-0.04572588577866554,
-0.026165112853050232,
-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_update(self):
self._set_args()
ldap = self._make_ldap_instance()
with self.assertRaises(AnsibleExitJson):
with mock.patch.object(ldap, 'get_base_path', return_value='/'):
with mock.patch.object(ldap, 'update_configuration', return_value=('', True)) as update... | |
11,451 | [
0.024422243237495422,
0.013925972394645214,
0.020071815699338913,
-0.020958013832569122,
-0.007475139573216438,
0.05588803440332413,
0.025596167892217636,
0.005884011276066303,
-0.00013801890600007027,
0.01619325950741768,
0.007975784130394459,
-0.0327548086643219,
-0.01768943853676319,
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_update_disable_all(self):
self._set_args()
ldap = self._make_ldap_instance()
with self.assertRaises(AnsibleExitJson):
with mock.patch.object(ldap, 'get_base_path', return_value='/'):
with mock.patch.object(ldap, 'clear_configuration', return_value=('', True)... | |
11,452 | [
0.0037267429288476706,
-0.01395245362073183,
0.038463521748781204,
-0.02875336818397045,
0.00663448590785265,
0.037615060806274414,
-0.007871823385357857,
-0.012078771367669106,
0.00009942890756065026,
0.006905521731823683,
-0.011247987858951092,
-0.06891380995512009,
0.00045221741311252117,... | 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_get_configuration_failure(self):
self._set_args()
with self.assertRaises(AnsibleFailJson):
with mock.patch(self.REQ_FUNC, side_effect=Exception):
ldap = self._make_ldap_instance()
ldap.get_configuration('')
# We expect this for any code not ... | |
11,453 | [
-0.00999065488576889,
0.042386822402477264,
-0.01709185540676117,
-0.024009404703974724,
-0.0037801649887114763,
0.05343041196465492,
-0.02032412588596344,
0.008148015476763248,
-0.010168184526264668,
0.05465475842356682,
0.02027515321969986,
-0.07786834239959717,
0.03736700862646103,
0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def main():
module = AnsibleModule(
argument_spec=dict(
hosts=dict(required=True, type='str'),
name=dict(required=True, type='str'),
value=dict(required=False, default=None, type='str'),
op=dict(required=False, default=None, choices=['get', 'wait', 'list']),
... | |
11,454 | [
0.011444084346294403,
0.023947229608893394,
-0.021692054346203804,
0.0056971232406795025,
0.03271874412894249,
0.04926500841975212,
-0.015649178996682167,
0.03553459793329239,
-0.04171453043818474,
0.012409699149429798,
0.0033640749752521515,
-0.06488926708698273,
0.02229011245071888,
-0.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}}, {"_type": "arg", "_fields": {"arg": "module", "annotation":... | class KazooCommandProxy():
def __init__(self, module):
self.module = module
self.zk = KazooClient(module.params['hosts'])
def absent(self):
return self._absent(self.module.params['name'])
def exists(self, znode):
return self.zk.exists(znode)
def list(self):
chi... | |
11,455 | [
0.020892299711704254,
0.05316721647977829,
-0.028565295040607452,
-0.009189469739794731,
0.028589462861418724,
0.01260304730385542,
-0.025278594344854355,
0.015382242389023304,
0.0003028416831512004,
0.013062218204140663,
0.02699444629251957,
0.030981985852122307,
-0.014584734104573727,
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": "path", "annotation": null, "type_comment": null}}], "kwarg": null... | def _get(self, path):
if self.exists(path):
value, zstat = self.zk.get(path)
stat_dict = {}
for i in dir(zstat):
if not i.startswith('_'):
attr = getattr(zstat, i)
if isinstance(attr, (int, str)):
... | |
11,456 | [
0.03678518906235695,
0.061837390065193176,
-0.016013266518712044,
-0.00008300902118207887,
0.034770943224430084,
0.013986429199576378,
0.04199705645442009,
0.013734648935496807,
0.016390936449170113,
0.0365334078669548,
0.02799803763628006,
0.052320074290037155,
-0.010832873173058033,
0.04... | 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": "path", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _present(self, path, value):
if self.exists(path):
(current_value, zstat) = self.zk.get(path)
if value != current_value:
self.zk.set(path, value)
return True, {'changed': True, 'msg': 'Updated the znode value.', 'znode': path,
... | |
11,457 | [
0.01754690334200859,
0.06376650929450989,
-0.000965480983722955,
-0.0304508525878191,
-0.007186697795987129,
0.04492303356528282,
0.029314812272787094,
0.030129797756671906,
0.0034359083510935307,
0.03168568015098572,
-0.000640181009657681,
0.01442278828471899,
-0.018250754103064537,
-0.03... | 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": "path", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _wait(self, path, timeout, interval=5):
lim = time.time() + timeout
while time.time() < lim:
if self.exists(path):
return True, {'msg': 'The node appeared before the configured timeout.',
'znode': path, 'timeout': timeout}
else:
... | |
11,458 | [
0.04530685395002365,
0.038786016404628754,
-0.017797697335481644,
-0.007906763814389706,
0.023072196170687675,
-0.04494791105389595,
0.03212559223175049,
0.022793017327785492,
-0.036811817437410355,
0.012573051266372204,
-0.006690338719636202,
0.0039284550584852695,
0.04275435581803322,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {"kind": null, "value": "file"}}, {"_type": "Constant", "_fields": {"kind": null, ... | class DocumentCreate(RestrictedDocumentMixin, CreateView):
fields = ['file', 'slug', 'info']
template_name = 'upload_form.html'
def form_valid(self, form):
form.instance.user = self.request.user
try:
self.object = form.save()
except: # pragma: no cover
messag... | |
11,459 | [
0.01271770428866148,
0.01477863546460867,
0.04266852140426636,
0.02466903254389763,
0.04283422231674194,
-0.013846556656062603,
0.01066713035106659,
0.010180377401411533,
0.03529473766684532,
0.00910330843180418,
-0.01488220039755106,
-0.04585830122232437,
0.050705116242170334,
-0.05033228... | 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": "uid", "annotation": nu... | class RPCProxy(object):
def __init__(self, uid, passwd, host='localhost', port=8069, path='object'):
self.rpc = xmlrpclib.ServerProxy('http://%s:%s/%s' % (host, port, path))
self.user_id = uid
self.passwd = passwd
def __call__(self, request):
return self.rpc.execute(self.us... | |
11,460 | [
0.05350136011838913,
0.0036535903345793486,
-0.030081819742918015,
0.023683592677116394,
0.02321642078459263,
-0.017346302047371864,
0.018676728010177612,
0.09075325727462769,
-0.016980689018964767,
-0.015172936953604221,
-0.009846159256994724,
-0.004059826955199242,
0.004372121300548315,
... | 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):
form.instance.user = self.request.user
try:
self.object = form.save()
except: # pragma: no cover
messages.error(self.request,
'An internal server error occured.',
extra_tags='form_invalid',
)
... | |
11,461 | [
0.021948769688606262,
0.0233815535902977,
0.029594402760267258,
-0.03327517583966255,
-0.009029010310769081,
0.007787675596773624,
-0.027914585545659065,
0.020590094849467278,
0.008275562897324562,
0.016674641519784927,
0.004088375251740217,
-0.054841045290231705,
-0.0032978737726807594,
-... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "\n ([a-zA-Z][\\w\\.-]*[a-zA-Z0-9] # username part\n @ ... | class ReceiverEmail2Event(object):
email_re = re.compile(r"""
([a-zA-Z][\w\.-]*[a-zA-Z0-9] # username part
@ # mandatory @ sign
[a-zA-Z0-9][\w\.-]* # domain must start with a letter
\.
[a-z]{2,3} # TLD
... | |
11,462 | [
0.029049241915345192,
0.017614709213376045,
0.01501759234815836,
-0.00988948717713356,
0.01623198576271534,
-0.013009635731577873,
-0.028880909085273743,
0.04520908370614052,
0.021859074011445045,
0.02570665441453457,
-0.016003534197807312,
-0.039654139429330826,
-0.027919014915823936,
-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": "request", "annotation": null, "type_comment": null}}], "kwarg": n... | def __call__(self, request):
headers, msg = request
partners = self.get_partners(headers, msg)
subject = u''
for string, charset in decode_header(msg['Subject']):
if charset:
subject += string.decode(charset)
else:
subject += unicod... | |
11,463 | [
0.02364584244787693,
0.0280247014015913,
0.027974657714366913,
-0.008745208382606506,
-0.020955972373485565,
0.0036907531321048737,
0.00299795507453382,
0.016889886930584908,
0.030827172100543976,
0.02035544253885746,
-0.011378780007362366,
-0.02562258578836918,
0.010809527710080147,
-0.03... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "msg", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def save_mail(self, msg, subject, partners):
counter, description = 1, u''
if msg.is_multipart():
for part in msg.get_payload():
stockdir = os.path.join('emails', msg['Message-Id'][1:-1])
newdir = os.path.join('/tmp', stockdir)
filename = part.... | |
11,464 | [
0.038424599915742874,
0.027449604123830795,
0.046807270497083664,
0.004264016170054674,
-0.004191333893686533,
-0.00980602577328682,
0.016050629317760468,
-0.00950924027711153,
0.007171299774199724,
0.07491101324558258,
-0.05010218918323517,
-0.049617644399404526,
-0.03386985510587692,
-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": "n", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def best(self, n=10, classifier_type=None):
if classifier_type is not None:
r = [(cm.correct() * 100. / cm.total(), cm.stdNfold(normalizedAccuracies=False),
cm.normalizedAccuracy(), cm.stdNfold(normalizedAccuracies=True), filename, param)
for (filename, cm, param) ... | |
11,465 | [
0.031121132895350456,
0.010292981751263142,
-0.01774025708436966,
0.026132063940167427,
-0.006399813108146191,
0.026325814425945282,
-0.002639847109094262,
-0.025575032457709312,
0.027706285938620567,
0.024448860436677933,
-0.006094050593674183,
-0.007471493910998106,
0.03046722710132599,
... | 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": "X", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def fit(self, X, y=None):
if self.cov_estimator is None:
self.cov_estimator_ = EmpiricalCovariance(
assume_centered=True)
else:
self.cov_estimator_ = clone(self.cov_estimator)
if self.kind == 'tangent':
covs = [self.cov_estimator_.fit(x).covar... | |
11,466 | [
-0.018207835033535957,
-0.0022916975431144238,
0.0304805189371109,
-0.006557587068527937,
-0.0013611866161227226,
-0.032869670540094376,
0.01388221699744463,
0.03020388074219227,
0.030455371364951134,
0.05117810145020485,
0.007727012969553471,
-0.03498218208551407,
-0.007997363805770874,
-... | 7 | {"_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 simple_example():
utils.fix_random_seeds()
X = np.array([
[4., 4., 2., 0.],
[4., 61., 8., 18.],
[2., 8., 10., 0.],
[0., 18., 0., 5.]])
mod = GloVe(n=2, max_iter=1000)
print(mod)
G = mod.fit(X)
print("\nLearned vectors:")
print(G)
print("W... | |
11,467 | [
0.03935994207859039,
-0.004167628008872271,
0.020521197468042374,
-0.0069371601566672325,
-0.0370376817882061,
0.0048044719733297825,
0.0014736282173544168,
-0.010094722732901573,
-0.04658738523721695,
-0.00410838657990098,
0.00935420673340559,
-0.004120234865695238,
-0.023672835901379585,
... | 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": "baseAddress", "annotation": null, "type_comment": null}}, {"_type... | def __init__(self, baseAddress, decodeInfo):
self.baseAddress = baseAddress
self.decodeInfo = []
for i in decodeInfo:
CName = None
if len(i) > 6:
CName = (i[6])
self.decodeInfo = (self.decodeInfo + [IBEntry((i[0]), (i[1]), (i[2]), (i[3]), (i[4]), (i[5]), CName)]) | |
11,468 | [
0.02762439101934433,
0.022122249007225037,
-0.016244960948824883,
-0.012357083149254322,
-0.036400534212589264,
-0.013175583444535732,
-0.020326094701886177,
0.016449585556983948,
-0.028306474909186363,
0.001688157208263874,
0.02201993577182293,
-0.014437438920140266,
-0.034695323556661606,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "baseAddress", "annotat... | class IBDecoder(object):
def __init__(self, baseAddress, decodeInfo):
self.baseAddress = baseAddress
self.decodeInfo = []
for i in decodeInfo:
CName = None
if len(i) > 6:
CName = (i[6])
self.decodeInfo = (self.decodeInfo + [IBEntry((i[0]), (i[1]), (i[2]), (i[3]), (i[4]), (i[5]), CName)])
def decod... | |
11,469 | [
0.05063318461179733,
0.048533521592617035,
-0.01773850806057453,
-0.002135861199349165,
0.018728002905845642,
-0.01841426081955433,
-0.05217776075005531,
-0.0007040347554720938,
-0.0016199963865801692,
0.004187253303825855,
0.048702459782361984,
0.011873940005898476,
-0.03108462318778038,
... | 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": "rawData", "annotation": null, "type_comment": null}}], "kwarg": n... | def decodeRawData(self, rawData):
for i in self.decodeInfo:
i.rawData = rawData[(i.address - (self.baseAddress & 65535)):((i.address - (self.baseAddress & 65535)) + i.length)]
autoData = None
if i.name == 'Die Info Checksum':
autoData = rawData[1918:1936]
else:
if i.name == 'Configuration Info Che... | |
11,470 | [
0.011077061295509338,
0.03711587190628052,
-0.0307017769664526,
-0.048280153423547745,
-0.007769374176859856,
-0.004169832449406385,
-0.03746475651860237,
-0.03113117255270481,
0.004958176054060459,
0.007722409442067146,
0.03309028968214989,
0.013727236539125443,
-0.031480055302381516,
-0.... | 35 | {"_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": "type", "annotation": n... | class VALUE(object):
def __init__(self, type):
self.type = type
def decode(self, data, validRange, autoData=None, rawData=None):
valid = True
minVal, maxVal = validRangeMinMax(validRange)
if minVal != None:
tempValue = 0
for i in range(len(data)):
tempValue = (tempValue + ((data[i]) << (8 * i)))
... | |
11,471 | [
0.009902171790599823,
0.05145326256752014,
-0.014941548928618431,
-0.03311590477824211,
-0.0024161164183169603,
0.005684580188244581,
-0.0356152206659317,
-0.0185546875,
-0.0012530526146292686,
0.015403378754854202,
0.036240048706531525,
0.02082308568060398,
-0.04145600646734238,
0.0119056... | 34 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg... | def decode(self, data, validRange, autoData=None, rawData=None):
valid = True
minVal, maxVal = validRangeMinMax(validRange)
if minVal != None:
tempValue = 0
for i in range(len(data)):
tempValue = (tempValue + ((data[i]) << (8 * i)))
continue
if (tempValue < minVal or tempValue > maxVal):
vali... | |
11,472 | [
0.0041812751442193985,
-0.018625935539603233,
0.026094304397702217,
0.02631925605237484,
-0.016668861731886864,
0.01757991313934326,
0.002735965419560671,
0.0360371358692646,
-0.01743369549512863,
0.021685266867280006,
-0.015082958154380322,
-0.022573823109269142,
0.00972912646830082,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "byte", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "crc", "annotation": null, "type_comment": null}}], "kwarg": null,... | def crc16(byte, crc):
byte = (byte & 255)
crc = (crc & 65535)
crc = ((crc >> 8) | (crc << 8))
crc = (crc ^ byte)
crc = (crc ^ ((crc & 255) >> 4))
crc = (crc ^ ((crc << 8) << 4))
crc = (crc ^ (((crc & 255) << 4) << 1))
return (crc & 65535) | |
11,473 | [
0.011174439452588558,
0.03269095718860626,
0.02886210009455681,
-0.024658679962158203,
-0.024471398442983627,
-0.017604423686861992,
-0.021932698786258698,
0.0014722376363351941,
0.03416839614510536,
0.05381210520863533,
0.02482515200972557,
-0.014847230166196823,
-0.056017860770225525,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "validRange", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg... | def validRangeMinMax(validRange):
minValue, maxValue = (None, None)
if validRange != 'Not specified':
tmp = validRange.split('-')
minValue = int((tmp[0]), 16)
maxValue = minValue
if len(tmp) > 1:
maxValue = int((tmp[1]), 16)
return (minValue, maxValue) | |
11,474 | [
-0.002041015774011612,
0.0048580835573375225,
0.03168774023652077,
-0.011603524908423424,
-0.027391519397497177,
-0.008747654035687447,
-0.03325226157903671,
-0.02526824176311493,
-0.0003938462177757174,
-0.02023942768573761,
0.04492408037185669,
-0.01169665064662695,
0.0076363482512533665,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "OFP_VERSION", "value": {"_type... | class SimpleSwitch14(app_manager.RyuApp):
OFP_VERSIONS = [ofproto_v1_4.OFP_VERSION]
def __init__(self, *args, **kwargs):
super(SimpleSwitch14, self).__init__(*args, **kwargs)
self.mac_to_port = {}
@set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
def switch_features_hand... | |
11,475 | [
0.025698931887745857,
-0.0039826007559895515,
0.04614070802927017,
-0.01556362584233284,
-0.06015164032578468,
-0.01640721596777439,
-0.01740974374115467,
-0.0016856519505381584,
0.02226344309747219,
0.001803326653316617,
0.051397863775491714,
-0.014279901050031185,
0.022300120443105698,
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": "ev", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def switch_features_handler(self, ev):
datapath = ev.msg.datapath
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
# install table-miss flow entry
#
# We specify NO BUFFER to max_len of the output action due to
# OVS bug. At this moment, if we specify ... | |
11,476 | [
0.0025531265418976545,
0.027201756834983826,
0.04156087338924408,
-0.002279154257848859,
-0.019358741119503975,
-0.0019029974937438965,
-0.028078468516469002,
-0.016811538487672806,
0.003933355212211609,
0.015081810764968395,
0.013209912925958633,
0.01309143751859665,
0.0009278038050979376,
... | 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": "datapath", "annotation": null, "type_comment": null}}, {"_type": ... | def add_flow(self, datapath, priority, match, actions):
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
actions)]
mod = parser.OFPFlowMod(datapath=datapath, priori... | |
11,477 | [
-0.01388841588050127,
0.010344437323510647,
-0.029457595199346542,
-0.012848996557295322,
0.025742223486304283,
-0.022933578118681908,
-0.007463918067514896,
-0.006081711035221815,
-0.003447224386036396,
-0.007458389271050692,
-0.015801390632987022,
-0.050511375069618225,
0.05347482487559318... | 11 | {"_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 _any(data):
ret = None
if type(data) is types.ListType:
ret = _list(data)
elif type(data) is types.DictType:
ret = _dict(data)
elif isinstance(data, Decimal):
# json.dumps() cant handle Decimal
ret = "%d" % data
elif isinstance(... | |
11,478 | [
0.01031898520886898,
-0.009224285371601582,
0.01638592593371868,
0.030536361038684845,
0.008043162524700165,
0.011690240353345871,
-0.0008116622339002788,
-0.004462341777980328,
0.009616073220968246,
0.03238006681203842,
0.05296042189002037,
0.032195694744586945,
0.018229631707072258,
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}}, {"_type": "arg", "_fields": {"arg": "ev", "annotation": null, "type_comment": null}}], "kwarg": null, ... | def _packet_in_handler(self, ev):
msg = ev.msg
datapath = msg.datapath
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
in_port = msg.match['in_port']
pkt = packet.Packet(msg.data)
eth = pkt.get_protocols(ethernet.ethernet)[0]
dst = eth.dst
... | |
11,479 | [
0.03995668888092041,
0.04367664456367493,
-0.026674263179302216,
-0.03691507875919342,
0.004480357281863689,
-0.0062418654561042786,
0.01845753937959671,
-0.019081179052591324,
-0.028052834793925285,
0.0008274164283648133,
0.012790080159902573,
-0.022779252380132675,
0.03512074798345566,
-... | 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 _model(data):
ret = {}
# If we only have a model, we only want to encode the fields.
for f in data._meta.fields:
ret[f.attname] = _any(getattr(data, f.attname))
# And additionally encode arbitrary properties that had been added.
fields = dir(data.__class__) + ret.... | |
11,480 | [
0.005031193140894175,
0.0238222386687994,
-0.005506581626832485,
-0.030926652252674103,
0.006506877951323986,
0.014037161134183407,
-0.01955694705247879,
0.01671782322227955,
-0.01913437992334366,
0.06343793123960495,
-0.05165886506438255,
-0.025472892448306084,
-0.023056333884596825,
-0.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 LRSubtractAverageBackground(PythonAlgorithm):
def category(self):
return "Reflectometry\\SNS"
def name(self):
return "LRSubtractAverageBackground"
def version(self):
return 1
def summary(self):
return "Liquids Reflectometer background subtraction using the avera... | |
11,481 | [
0.03478848561644554,
0.00456248177215457,
0.008774273097515106,
-0.03153407946228981,
-0.0013264863518998027,
0.015374266542494297,
0.008136017248034477,
0.03720123693346977,
0.0222477987408638,
0.0443272665143013,
-0.019358109682798386,
-0.0022075960878282785,
-0.0010643453570082784,
-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 PyExec(self):
workspace = self.getProperty("InputWorkspace").value
# Signal region
peak_range = self.getProperty("PeakRange").value
peak_min = int(peak_range[0])
peak_max = int(peak_range[1])
# Background outer region
bck_range = self.getProperty("Background... | |
11,482 | [
0.026212520897388458,
0.024531908333301544,
0.027893131598830223,
0.0023563047870993614,
-0.023014342412352562,
0.028194136917591095,
-0.009143027476966381,
-0.011400564573705196,
0.016279354691505432,
0.03173094615340233,
0.002108602784574032,
0.011419378221035004,
0.0021572026889771223,
... | 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 PyInit(self):
self.declareProperty(WorkspaceProperty("InputWorkspace", "",Direction.Input), "The workspace to check.")
self.declareProperty(IntArrayProperty("PeakRange", [150, 160],
IntArrayLengthValidator(2), direction=Direction.Input),
... | |
11,483 | [
0.012301143258810043,
0.044587522745132446,
0.09242896735668182,
-0.00990467332303524,
-0.031176086515188217,
0.009036228060722351,
0.01674230583012104,
-0.005743831396102905,
-0.02559165470302105,
-0.008810872212052345,
-0.04252083972096443,
0.01144369039684534,
-0.0003565847291611135,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Call", "_fields": {"args": [{"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, ... | class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.CITIES_COUNTRY_MODEL),
('scoping', '0282_doc_regions'),
]
operations = [
migrations.AddField(
model_name='doc',
name='countries',
field=models.ManyTo... | |
11,484 | [
0.006118904799222946,
0.012470967136323452,
0.03759225457906723,
0.018640687689185143,
0.019740715622901917,
-0.008471409790217876,
-0.002228453056886792,
0.04916645959019661,
0.0052221426740288734,
0.05375787988305092,
0.018509162589907646,
-0.045890290290117264,
0.009374150075018406,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "environ", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "start_response", "annotation": null, "type_comment": null}}], ... | def term_list(environ, start_response):
status = "200 OK"
headers = [("Content-type", "application/json; charset=UTF-8"), ("Access-Control-Allow-Origin", "*")]
start_response(status, headers)
config = WebConfig(os.path.abspath(os.path.dirname(__file__)).replace("scripts", ""))
db = DB(config.db_path... | |
11,485 | [
0.03597617894411087,
-0.04862615466117859,
0.03613318130373955,
0.0031877271831035614,
-0.004264321178197861,
-0.05131763964891434,
0.008175384253263474,
-0.03337441012263298,
-0.05750805512070656,
0.012010750360786915,
0.00025898529565893114,
-0.009868777357041836,
-0.03086235746741295,
-... | 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": "color_data", "annotation": null, "type_comment": null}}], "kwarg"... | def putdata(self, color_data):
for y in range(self.height):
for x in range(self.width):
i = x + y * self.width
if i > len(color_data) - 1:
return
self.img[i * 3: i * 3 + 3] = color_data[i][::-1] | |
11,486 | [
-0.03431156277656555,
-0.012786918319761753,
0.028003349900245667,
0.018455784767866135,
0.025957442820072174,
-0.013564788736402988,
-0.0509345568716526,
0.03030499629676342,
-0.025360720232129097,
0.04680011793971062,
0.0014158848207443953,
-0.051872264593839645,
-0.002548059681430459,
0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment"... | def apply_response(*args, **kwargs):
if "Authorization" in request.headers.keys():
creds = str(b64decode(request.headers["Authorization"].replace("Basic ", "")), "utf-8")
if creds in ["admin:admin", "support:support", "user:user"]:
return "Authorized", 200
resp = Response("Unauthor... | |
11,487 | [
0.039829496294260025,
0.03219292312860489,
0.05660609155893326,
-0.021179554983973503,
-0.04040224105119705,
-0.02861328236758709,
0.0058437674306333065,
-0.03288498893380165,
-0.06199942156672478,
0.020952844992280006,
0.015380533412098885,
-0.0026534106582403183,
-0.026775730773806572,
-... | 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": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def save(self, f, type):
assert type == "BMP"
# 54 bytes of preambule + image color data.
filesize = 54 + 3 * self.width * self.height
# 14 bytes of header.
bmpfileheader = bytearray([ord('B'), ord('M')] + self._int_to_bytes(filesize) +
[0, 0, 0,... | |
11,488 | [
0.04637427628040314,
-0.024090277031064034,
-0.01875978894531727,
0.024914883077144623,
-0.008260785602033138,
-0.03728397563099861,
0.016560839489102364,
-0.048494692891836166,
-0.029862521216273308,
-0.007082777097821236,
0.03349471464753151,
-0.011220532469451427,
-0.0069993347860872746,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "string_data", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyar... | def encode_string_as_bmp_image(string_data):
data_bytes = array.array("B", string_data.encode("utf-8"))
num_bytes = len(data_bytes)
# Encode data bytes to color data (RGB), one bit per channel.
# This is to avoid errors due to different color spaces used in decoding.
color_data = []
for byte i... | |
11,489 | [
-0.004997634794563055,
-0.00632902979850769,
0.023342851549386978,
-0.0207305159419775,
-0.005964647978544235,
-0.014081951230764389,
0.02565247006714344,
-0.04074347764253616,
0.0047874148003757,
-0.011413555592298508,
-0.034868523478507996,
-0.054847851395606995,
0.00020233694522175938,
... | 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 SLABaseForTestCase(test.TestCase):
def setUp(self):
super(SLABaseForTestCase, self).setUp()
@plugin.configure(name="test_criterion")
class FakeCriterion(sla.SLA):
CONFIG_SCHEMA = {"type": "integer"}
def add_iteration(self, iteration):
self.suc... | |
11,490 | [
-0.0008435337222181261,
-0.00805171113461256,
0.022798368707299232,
-0.01920798234641552,
-0.019231680780649185,
-0.015416152775287628,
0.03725471720099449,
-0.028035832569003105,
-0.000940551224630326,
-0.00017755682347342372,
-0.0070622810162603855,
-0.06877429038286209,
-0.024007014930248... | 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):
super(SLABaseForTestCase, self).setUp()
@plugin.configure(name="test_criterion")
class FakeCriterion(sla.SLA):
CONFIG_SCHEMA = {"type": "integer"}
def add_iteration(self, iteration):
self.success = self.criterion_value == iteration
... | |
11,491 | [
0.03300463780760765,
0.002381020924076438,
0.024583755061030388,
-0.05728811398148537,
-0.013447300530970097,
0.01808205060660839,
0.015392590314149857,
-0.005297322757542133,
0.03154240548610687,
0.02556292712688446,
-0.0004952980089001358,
-0.07117930799722672,
-0.062353696674108505,
-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_add_iteration_and_results(self):
sla_checker = sla.SLAChecker({"sla": {"test_criterion": 42}})
iteration = {"key": {"name": "fake", "pos": 0}, "data": 42}
self.assertTrue(sla_checker.add_iteration(iteration["data"]))
expected_result = [{"criterion": "test_criterion",
... | |
11,492 | [
0.024266697466373444,
0.016920020803809166,
0.03834671527147293,
-0.049173396080732346,
0.022040028125047684,
0.021613359451293945,
0.02192002721130848,
-0.03000003658235073,
0.02404003031551838,
0.02965337038040161,
0.01082667987793684,
-0.07306675612926483,
-0.040266718715429306,
0.02150... | 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 SLACheckerTestCase(SLABaseForTestCase):
def test_add_iteration_and_results(self):
sla_checker = sla.SLAChecker({"sla": {"test_criterion": 42}})
iteration = {"key": {"name": "fake", "pos": 0}, "data": 42}
self.assertTrue(sla_checker.add_iteration(iteration["data"]))
expected_r... | |
11,493 | [
0.004804329946637154,
0.017867185175418854,
0.020024875178933144,
-0.024012185633182526,
-0.008952519856393337,
0.04227053001523018,
-0.007122899871319532,
0.0008753785514272749,
0.0337911881506443,
0.007293243892490864,
0.006381588522344828,
-0.06309034675359726,
-0.0005449428572319448,
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 test_set_unexpected_failure(self):
exc = "error;("
sla_checker = sla.SLAChecker({"sla": {}})
self.assertEqual([], sla_checker.results())
sla_checker.set_unexpected_failure(exc)
self.assertEqual([{"criterion": "something_went_wrong",
"success": False... | |
11,494 | [
-0.0035935724154114723,
0.05591512471437454,
0.049685850739479065,
-0.03732618689537048,
-0.013941701501607895,
0.03599134460091591,
-0.011154597625136375,
-0.012891130521893501,
0.06545678526163101,
0.018737250939011574,
0.023965390399098396,
-0.07168605178594589,
-0.027240701019763947,
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_set_aborted_on_sla(self):
sla_checker = sla.SLAChecker({"sla": {}})
self.assertEqual([], sla_checker.results())
sla_checker.set_aborted_on_sla()
self.assertEqual(
[{"criterion": "aborted_on_sla", "success": False,
"detail": "Task was aborted due to SLA ... | |
11,495 | [
-0.00017413303430657834,
0.028947431594133377,
0.05971638485789299,
-0.07970389723777771,
-0.008227617479860783,
0.004033809527754784,
0.008670690469443798,
-0.052036453038454056,
0.03426430746912956,
0.023359788581728935,
0.039285797625780106,
-0.05028877779841423,
-0.037488892674446106,
... | 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__validate_sla_types(self):
sla_checker = sla.SLAChecker({"sla": {}})
mock_sla1 = mock.MagicMock()
mock_sla2 = mock.MagicMock()
sla_checker.sla_criteria = [mock_sla1, mock_sla2]
another_sla_checker = sla.SLAChecker({"sla": {}})
mock_sla3 = mock.MagicMock()
... | |
11,496 | [
-0.0019407786894589663,
0.06376440078020096,
0.04865304380655289,
-0.040053900331258774,
-0.02640087716281414,
0.023873936384916306,
-0.004714442417025566,
-0.00847342424094677,
0.06818969547748566,
0.011867823079228401,
0.024137943983078003,
-0.04734557121992111,
-0.020492108538746834,
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_set_aborted_manually(self):
sla_checker = sla.SLAChecker({"sla": {}})
self.assertEqual([], sla_checker.results())
sla_checker.set_aborted_manually()
self.assertEqual(
[{"criterion": "aborted_manually", "success": False,
"detail": "Task was aborted due t... | |
11,497 | [
0.05410376563668251,
0.01004626415669918,
0.01773592084646225,
-0.04565925896167755,
0.032845210283994675,
-0.002684936160221696,
0.017183592543005943,
-0.022866452112793922,
-0.003685266710817814,
0.02426568605005741,
-0.005550913978368044,
-0.051845353096723557,
-0.057884156703948975,
-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": "merge_result1", "annotation": null, "type_comment": null}}, {"_ty... | def test_merge(self, merge_result1, merge_result2, result):
sla_checker = sla.SLAChecker({"sla": {}})
mock_sla1 = mock.MagicMock()
mock_sla2 = mock.MagicMock()
sla_checker.sla_criteria = [mock_sla1, mock_sla2]
mock_sla1.merge.return_value = merge_result1
mock_sla2.merge.... | |
11,498 | [
0.0013048716355115175,
0.03985346108675003,
0.03641445189714432,
-0.03170716017484665,
0.012463352642953396,
0.01365846861153841,
0.0034237634390592575,
-0.04604855179786682,
0.03326812759041786,
0.007329232059419155,
0.0013925236416980624,
-0.0674142986536026,
-0.012609693221747875,
0.016... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class SLATestCase(SLABaseForTestCase):
def test_validate_type_positive(self):
sla1 = self.FakeCriterion(0)
sla2 = self.FakeCriterion(0)
sla1.validate_type(sla2)
def test_validate_type_negative(self):
sla1 = self.FakeCriterion(0)
class AnotherFakeCriterion(self.FakeCrite... | |
11,499 | [
-0.00035330993705429137,
-0.034258145838975906,
-0.03384481370449066,
-0.021894579753279686,
0.02961421199142933,
0.017153387889266014,
-0.018259664997458458,
0.02997891791164875,
0.04896799847483635,
0.046463675796985626,
0.041722483932971954,
-0.01795574277639389,
-0.02455694042146206,
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": "request", "annotation": null, "type_comment": null}}, {"_type": "... | def handle_POST(self, request, context, view, *args, **kwargs):
if 'clear_session' in request.POST:
for key in request.secure_session.keys():
del request.secure_session[key]
request.secure_session['is_secure'] = True
return self.redirect('.', request)
... | |
11,500 | [
-0.010740946978330612,
0.032663557678461075,
0.005974887870252132,
-0.04520515725016594,
0.01565181277692318,
0.015576261095702648,
0.01743987202644348,
-0.03011998161673546,
0.029465200379490852,
0.000024298558855662122,
-0.014606679789721966,
-0.07147199660539627,
-0.03475382551550865,
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_validate_type_negative(self):
sla1 = self.FakeCriterion(0)
class AnotherFakeCriterion(self.FakeCriterion):
pass
sla2 = AnotherFakeCriterion(0)
self.assertRaises(TypeError, sla1.validate_type, sla2) |