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,101
[ 0.021052584052085876, 0.07481997460126877, 0.027792440727353096, -0.009169485419988632, -0.032613836228847504, -0.01301271840929985, -0.010652506723999977, -0.029635172337293625, 0.0009529197122901678, 0.05755382776260376, -0.00975638348609209, -0.03882358968257904, 0.01004036609083414, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "analyzer", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "row", "annotation": null, "type_comment": null}}], "kwarg": n...
def should_report(analyzer, row): error_kind = row[utils.CSV_INDEX_KIND] error_type = row[utils.CSV_INDEX_TYPE] error_bucket = '' # can be updated later once we extract it from qualifier try: qualifier_xml = ET.fromstring(row[utils.CSV_INDEX_QUALIFIER_TAGS]) if qualifier_xml.tag == uti...
11,102
[ 0.004473838023841381, -0.02663399465382099, -0.003234929172322154, -0.04237782582640648, 0.014948482625186443, 0.005088194273412228, 0.04731306806206703, -0.046048667281866074, -0.015488911420106888, 0.017538465559482574, 0.0099010756239295, -0.023676928132772446, -0.022208591923117638, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "row_1", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "row_2", "annotation": null, "type_comment": null}}], "kwarg": nu...
def compare_rows(row_1, row_2): filename_1 = row_1[utils.CSV_INDEX_FILENAME] filename_2 = row_2[utils.CSV_INDEX_FILENAME] if filename_1 < filename_2: return -1 elif filename_1 > filename_2: return 1 else: line_1 = int(row_1[utils.CSV_INDEX_LINE]) line_2 = int(row_2[ut...
11,103
[ 0.027551399543881416, 0.028676796704530716, 0.01698516681790352, -0.04253586009144783, -0.060396336019039154, -0.02834334596991539, 0.029802195727825165, -0.01603691466152668, -0.014921938069164753, 0.05943766608834267, -0.0029828245751559734, -0.02753055840730667, 0.017683330923318863, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "csv_report", "annotation": null, "type_comment": null}}], "kwarg"...
def clean_csv(args, csv_report): collected_rows = [] with open(csv_report, 'r') as file_in: reader = csv.reader(file_in) rows = [row for row in reader] if len(rows) <= 1: return rows else: for row in rows[1:]: filename = row[utils.CSV_INDEX...
11,104
[ -0.00766491424292326, 0.04327528178691864, 0.08442262560129166, -0.02030225284397602, -0.07378294318914413, -0.031528204679489136, 0.028662003576755524, -0.0328744500875473, -0.000027841804694617167, 0.04129933938384056, -0.004380726721137762, 0.0011128239566460252, 0.003656033892184496, 0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "csv_report", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "bugs_out", "annotation": null, "type_comment": null}}], "kw...
def print_errors(csv_report, bugs_out): with open(csv_report, 'r') as file_in: reader = csv.reader(file_in) reader.next() # first line is header, skip it errors = filter( lambda row: row[utils.CSV_INDEX_KIND] in [ERROR, WARNING], reader ) with open(...
11,105
[ 0.021101005375385284, 0.022632267326116562, 0.02695455215871334, -0.05173709988594055, -0.01668098010122776, -0.005104206036776304, 0.025390710681676865, -0.04965198040008545, 0.012684495188295841, 0.06489943712949753, 0.01625743880867958, -0.01398769672960043, 0.0373801626265049, 0.006944...
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": "args", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__(self, args, javac_args): self.args = args if self.args.analyzer not in MODES: help_exit( 'Unknown analysis mode \"{0}\"'.format(self.args.analyzer) ) utils.configure_logging(self.args.debug) self.javac = jwlib.CompilerCall(javac_arg...
11,106
[ 0.004596397280693054, 0.03735951706767082, 0.03364037722349167, -0.024479098618030548, -0.031244995072484016, -0.006997029762715101, 0.001918667578138411, -0.003994925878942013, 0.03488009050488472, 0.0588759109377861, 0.04706710949540138, 0.02365962602198124, 0.04454565793275833, 0.011682...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cmd", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "debug_mode", "annotation": null, "type_comment": null}}, {"_type":...
def run_command(cmd, debug_mode, javac_arguments, step, analyzer): if debug_mode: print('\n{0}\n'.format(' '.join(cmd))) try: return subprocess.check_call(cmd) except subprocess.CalledProcessError as e: error_msg = 'Failure during {0}, original command was\n\n{1}\n\n' inferJ_...
11,107
[ 0.01079879142343998, 0.0037245166022330523, 0.034385476261377335, -0.027928108349442482, 0.003934957552701235, -0.005872167181223631, 0.02198963798582554, 0.014782756567001343, 0.01045862678438425, 0.041557762771844864, 0.017446419224143028, -0.016327911987900734, 0.04356415942311287, -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 run_infer_frontend(self): infer_cmd = [utils.get_cmd_in_bin_dir('InferJava')] if self.args.buck: infer_cmd += ['-project_root', os.getcwd()] infer_cmd += [ '-results_dir', self.args.infer_out, '-verbose_out', self.javac.verbose_out, ] i...
11,108
[ 0.04595266655087471, 0.055001262575387955, 0.040300462394952774, -0.060526732355356216, -0.01520772185176611, 0.015245741233229637, 0.021214772015810013, 0.018033822998404503, -0.011716282926499844, 0.07887738198041916, 0.0443558543920517, -0.028032900765538216, 0.038931768387556076, -0.02...
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 analyze(self): logging.info('Starting analysis') infer_analyze = [ utils.get_cmd_in_bin_dir(INFER_ANALYZE_BINARY), '-results_dir', self.args.infer_out ] infer_options = [] # remove specs if possible so that old issues are less likely ...
11,109
[ 0.03932281956076622, 0.03268695995211601, 0.03876626491546631, -0.04306887090206146, -0.00032276232377626, -0.002628924325108528, -0.014738030731678009, -0.006277309264987707, -0.015487240627408028, 0.0651598647236824, 0.02305426076054573, 0.03985797241330147, 0.032387278974056244, 0.00687...
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": "file", "annotation": null, "type_comment": null}}, {"_type": "arg...
def file_stats(self, file, stats): if file is not None: stats['files'] += 1 try: with open(file, 'r') as f: stats['lines'] += len(list(f)) except IOError: logging.warning('File {} not found'.format(file))
11,110
[ 0.020273856818675995, 0.028395501896739006, 0.06085788086056709, -0.04248432070016861, 0.019535524770617485, -0.0318329781293869, -0.0024570703972131014, 0.0035433857701718807, 0.013023682869970798, 0.053305111825466156, 0.016945311799645424, -0.001009153900668025, 0.028637578710913658, 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 javac_stats(self): stats = {'files': 0, 'lines': 0} for arg in self.javac.original_arguments: file = None if arg.endswith('.java'): file = arg self.file_stats(file, stats) if arg.startswith('@'): with open(arg[1:], ...
11,111
[ 0.0492832325398922, -0.001776825520209968, 0.03649454563856125, -0.029966523870825768, -0.022201962769031525, 0.007781269960105419, 0.028941646218299866, -0.018314113840460777, -0.017901934683322906, 0.0473225973546505, -0.020608946681022644, 0.004525613505393267, -0.03990337997674942, 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": "csv_report", "annotation": null, "type_comment": null}}], "kwarg"...
def update_stats(self, csv_report): with open(csv_report, 'r') as file_in: reader = csv.reader(file_in) rows = [row for row in reader][1:] for row in rows: key = row[utils.CSV_INDEX_TYPE] previous_value = self.stats['int'].get(key, 0) ...
11,112
[ 0.03329547867178917, 0.05831047147512436, 0.020837564021348953, -0.05459168925881386, -0.014329698868095875, 0.016523778438568115, 0.04125366732478142, -0.026552090421319008, 0.02952711284160614, 0.025076974183321, 0.0036815921775996685, -0.016771698370575905, 0.025250516831874847, -0.0542...
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 analyze_and_report(self): if self.args.analyzer not in [COMPILE, CAPTURE]: analysis_start_time = time.time() if self.analyze() == os.EX_OK: elapsed = utils.elapsed_time(analysis_start_time) self.timing['analysis'] = elapsed reporting_st...
11,113
[ 0.004015169106423855, 0.04297615587711334, 0.01711908169090748, -0.03938250243663788, -0.008128794841468334, -0.003596730064600706, 0.034164320677518845, 0.02559862658381462, 0.013205445371568203, 0.04147469624876976, 0.02655857428908348, -0.0017706742510199547, 0.00518433703109622, -0.015...
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 start(self): if self.javac.args.version: if self.args.buck: key = self.args.analyzer print(utils.infer_key(key), file=sys.stderr) else: return self.javac.run() else: start_time = time.time() if self.captu...
11,114
[ 0.028475692495703697, 0.028056932613253593, 0.06986682862043381, -0.03689497709274292, -0.013929286040365696, 0.014149686321616173, 0.013091765344142914, 0.0071409628726542, -0.04839986190199852, 0.01273912563920021, -0.03294981271028519, 0.0010407017543911934, 0.014623546041548252, -0.014...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {...
class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.CreateModel( name='Redirect', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ...
11,115
[ -0.015129751525819302, -0.011032859794795513, 0.012518282048404217, -0.030834505334496498, -0.08682537078857422, 0.010607597418129444, -0.026905322447419167, -0.018615704029798508, 0.027600117027759552, 0.05347522720694542, 0.028318870812654495, -0.021766237914562225, 0.03847724571824074, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "params", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def construct_rule(params): rule = [] append_param(rule, params['protocol'], '-p', False) append_param(rule, params['source'], '-s', False) append_param(rule, params['destination'], '-d', False) append_param(rule, params['match'], '-m', True) append_param(rule, params['jump'], '-j', False) a...
11,116
[ -0.014389853924512863, 0.009157179854810238, 0.011385911144316196, -0.05537913367152214, -0.012960558757185936, 0.06308279186487198, -0.0007517426856793463, -0.005662673618644476, -0.004000209737569094, 0.06671659648418427, 0.03212280571460724, -0.053247302770614624, 0.011918868869543076, ...
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( supports_check_mode=True, argument_spec=dict( table=dict( required=False, default='filter', choices=['filter', 'nat', 'mangle', 'raw', 'security']), state=dict( required=False,...
11,117
[ 0.025527354329824448, 0.033075764775276184, 0.015805914998054504, -0.001726984977722168, 0.004274573642760515, -0.026762548834085464, 0.028317978605628014, 0.04293444752693176, -0.00673638517037034, 0.014959578402340412, -0.010081703774631023, -0.04357491806149483, 0.014124678447842598, 0....
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "User", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}], "type_...
class Meta: model = User fields = [ 'username', # 'first_name', # 'last_name', # 'email', 'password1', 'password2', ] widgets = { 'username': forms.TextInput(attrs={'class': 'form-control', 'readonly': ''}), # 'first_name': forms.TextInput(attrs={'class': 'form-control'}), # 'last_nam...
11,118
[ 0.03015388548374176, 0.05128468573093414, 0.02553742378950119, 0.009836209937930107, -0.004267603624612093, -0.004438098054379225, 0.01691303588449955, 0.03489625081419945, -0.02664957195520401, 0.02448822744190693, -0.0259780865162611, -0.00974178221076727, 0.02654465101659298, -0.0014544...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "User", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {...
class RegistroForm(UserCreationForm): class Meta: model = User fields = [ 'username', # 'first_name', # 'last_name', # 'email', 'password1', 'password2', ] widgets = { 'username': forms.TextInput(attrs={'class': 'form-control', 'readonly': ''}), # 'first_name': forms.TextInput(attrs={'c...
11,119
[ 0.04345064237713814, 0.035070013254880905, 0.012912597507238388, -0.0037155121099203825, -0.0015475020045414567, -0.013425081968307495, 0.0046023111790418625, 0.02234834060072899, -0.02461935020983219, 0.012470453977584839, -0.03601459041237831, -0.027252113446593285, 0.039752714335918427, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "PerfilUsuario", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model",...
class PerfilForm(forms.ModelForm): class Meta: model = PerfilUsuario fields = [ 'rut', 'nombres', 'apellido1', 'apellido2', 'email', 'numero_telefono', 'tipo_usuario', ] widgets = { 'rut': forms.TextInput(attrs={'class': 'form-control'}), 'nombres': forms.TextInput(attrs={'class': ...
11,120
[ 0.03528113290667534, 0.03202275186777115, 0.021330518648028374, -0.007719770539551973, 0.007563325110822916, -0.018870551139116287, 0.01937764883041382, 0.03215222433209419, -0.029584361240267754, 0.018061349168419838, -0.01701478473842144, -0.04432259500026703, 0.040675800293684006, -0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "PerfilUsuario", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "model", "ctx": {"_type": "Store", "_fields": {}}}}...
class Meta: model = PerfilUsuario fields = [ 'rut', 'nombres', 'apellido1', 'apellido2', 'email', 'numero_telefono', 'tipo_usuario', ] widgets = { 'rut': forms.TextInput(attrs={'class': 'form-control'}), 'nombres': forms.TextInput(attrs={'class': 'form-control'}), 'apellido1': for...
11,121
[ -0.0011355399619787931, -0.014876720495522022, 0.022492866963148117, -0.026151828467845917, -0.029914021492004395, -0.015094651840627193, 0.012938273139297962, 0.014108223840594292, -0.08423642069101334, 0.007403949741274118, 0.01956799067556858, -0.0026137491222471, -0.01142422016710043, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def __init__(self): super(MusicBrainzCollectionPlugin, self).__init__() musicbrainzngs.auth( config['musicbrainz']['user'].get(unicode), config['musicbrainz']['pass'].get(unicode), ) self.config.add({'auto': False}) if self.config['auto']: self...
11,122
[ 0.03559321165084839, -0.06656514108181, 0.03227895870804787, 0.0050063892267644405, 0.0021939422003924847, -0.0208657905459404, 0.023421499878168106, 0.03634008392691612, 0.007883020676672459, -0.026444004848599434, 0.024530140683054924, -0.03234897553920746, -0.015322585590183735, -0.0575...
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 setUp(self): super(DOTAdapterTestCase, self).setUp() self.user = UserFactory() self.public_client = self.adapter.create_public_client( name='public app', user=self.user, redirect_uri=DUMMY_REDIRECT_URL, client_id='public-client-id', ) ...
11,123
[ -0.007826332002878189, -0.038737230002880096, 0.003080190857872367, -0.021527603268623352, 0.0070374710485339165, -0.008994054049253464, 0.004201204050332308, 0.04409318044781685, 0.0406055822968483, -0.008625572547316551, -0.007136078551411629, -0.0465012826025486, -0.002984178252518177, ...
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_access_token(self): token = models.AccessToken.objects.create( token='token-id', application=self.public_client, user=self.user, expires=now() + timedelta(days=30), ) self.assertEqual(self.adapter.get_access_token(token_string='token-i...
11,124
[ 0.02822226844727993, 0.034767236560583115, -0.012358847074210644, 0.009161793626844883, -0.00803615152835846, 0.020748937502503395, 0.006655210163444281, -0.02143360674381256, 0.006933719385415316, 0.024253511801362038, 0.005474447272717953, -0.03576522693037987, -0.017499662935733795, -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": "url", "annotation": nu...
class ToughTextureUploadCasesPage(page_module.Page): def __init__(self, url, page_set): super( ToughTextureUploadCasesPage, self).__init__( url=url, page_set=page_set) def RunSmoothness(self, action_runner): action_runner.RunAction(ScrollAction())
11,125
[ 0.023441968485713005, 0.012991128489375114, 0.027029570192098618, 0.0022728904150426388, 0.007325615268200636, 0.04576977342367172, 0.007236482109874487, -0.011720984242856503, 0.018951894715428352, 0.011247465386986732, 0.026561621576547623, 0.008879871107637882, -0.009425810538232327, -0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "addr", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "port", "annotation": null, "type_comment": null}}], "kwarg": null...
def main(addr, port): loop = asyncio.get_event_loop() coro = loop.create_connection(lambda: Worker(reverse, loop=loop), addr, port) _, worker = loop.run_until_complete(coro) try: loop.run_forever() except KeyboardInterrupt: loop.run_until_complete(worker.shutdown()) loop.close()
11,126
[ 0.010659397579729557, -0.04466795176267624, 0.02278020977973938, 0.009705574251711369, -0.0029033052269369364, -0.023047950118780136, 0.02130763977766037, -0.04680987074971199, 0.00467429356649518, 0.03772902488708496, -0.005229296162724495, -0.033601365983486176, 0.0008276232983916998, -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 __init__(self): super(ToughTextureUploadCasesPageSet, self).__init__() urls_list = [ 'file://tough_texture_upload_cases/background_color_animation.html', # pylint: disable=C0301 'file://tough_texture_upload_cases/background_color_animation_and_transform_animation.html', # pylint: di...
11,127
[ -0.018303925171494484, 0.00648905523121357, 0.032570723444223404, -0.03327779099345207, 0.031772419810295105, -0.0389571413397789, -0.015099313110113144, 0.009203282184898853, 0.014779992401599884, 0.013114961795508862, 0.04744194820523262, -0.007116292603313923, 0.049084171652793884, -0.0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "host", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "file_path", "annotation": null, "type_comment": null}}], "kwarg":...
def test_files(host, file_path): file_p = file_path[0] try: file_u, file_g = file_path[1].split(':') except IndexError: file_u = None file_g = None try: file_m = oct(int(file_path[2], 8)) except IndexError: file_m = None with host.sudo(): assert ho...
11,128
[ -0.014835430309176445, 0.0039427196606993675, -0.00010560856753727421, -0.027510104700922966, -0.01584993116557598, 0.04339956119656563, 0.005513879004865885, -0.0016732679214328527, 0.025731435045599937, 0.00882747583091259, -0.000421610806370154, -0.07151573151350021, -0.01831371895968914,...
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( subscription=dict(required=True), token=dict(required=True, no_log=True), room=dict(required=True), msg=dict(required=True), notify=dict(required=False, choices=["56k"...
11,129
[ -0.0069346958771348, 0.01328405924141407, 0.038850169628858566, -0.0633745864033699, -0.01786750741302967, -0.05230288580060005, 0.056231554597616196, 0.0019407722866162658, 0.005699546076357365, 0.025774449110031128, -0.03942558169364929, 0.011270120739936829, -0.0030556314159184694, 0.00...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "features", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "labels", "annotation": null, "type_comment": null}}, {"_type"...
def _model_fn(features, labels, mode, config): return _rnn_model_fn( features=features, labels=labels, mode=mode, head=head, rnn_cell_fn=rnn_cell_fn, sequence_feature_columns=tuple(sequence_feature_columns or []), context_feature_columns=tuple(...
11,130
[ -0.012674539349973202, 0.0014181208098307252, 0.024608004838228226, -0.049826305359601974, 0.0014658001018688083, -0.01011347584426403, 0.06294766813516617, 0.012652743607759476, 0.00490961316972971, 0.0033974959515035152, -0.05653956159949303, 0.027594096958637238, 0.042154014110565186, 0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mode", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def rnn_cell_fn(mode): # Unused. Part of the rnn_cell_fn interface since user specified functions # may need different behavior across modes (e.g. dropout). del mode cells = [_single_rnn_cell(n, cell_type) for n in num_units] if len(cells) == 1: return cells[0] return rnn_cell.MultiRNNCell...
11,131
[ -0.0069346958771348, 0.01328405924141407, 0.038850169628858566, -0.0633745864033699, -0.01786750741302967, -0.05230288580060005, 0.056231554597616196, 0.0019407722866162658, 0.005699546076357365, 0.025774449110031128, -0.03942558169364929, 0.011270120739936829, -0.0030556314159184694, 0.00...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "features", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "labels", "annotation": null, "type_comment": null}}, {"_type"...
def _model_fn(features, labels, mode, config): return _rnn_model_fn( features=features, labels=labels, mode=mode, head=head, rnn_cell_fn=rnn_cell_fn, sequence_feature_columns=tuple(sequence_feature_columns or []), context_feature_columns=tuple(...
11,132
[ 0.006869992706924677, -0.018615463748574257, 0.0014397336635738611, -0.01981336995959282, -0.00045969654456712306, -0.04051319137215614, 0.012146770022809505, -0.009673093445599079, 0.02783934213221073, -0.01848369464278221, 0.03842883184552193, -0.04441836476325989, -0.041591305285692215, ...
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 setUp(self): self.block = Mock(name='block', scope_ids=ScopeIds(None, None, None, 'dummy')) self.course_key = SlashSeparatedCourseKey("org", "course", "run") self.runtime = LmsModuleSystem( static_url='/static', track_function=Mock(), get_module=Mock(), ...
11,133
[ 0.022821955382823944, -0.014418013393878937, 0.03106832504272461, -0.027050189673900604, 0.01422104611992836, 0.006578711327165365, -0.012605913914740086, -0.0021173995919525623, 0.07127593457698822, 0.06313461810350418, -0.004920902196317911, -0.035086460411548615, -0.001481359009630978, ...
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_trailing_characters(self): self.assertFalse(self.runtime.handler_url(self.block, 'handler').endswith('?')) self.assertFalse(self.runtime.handler_url(self.block, 'handler').endswith('/')) self.assertFalse(self.runtime.handler_url(self.block, 'handler', 'suffix').endswith('?')) s...
11,134
[ 0.015014415606856346, -0.02658827230334282, -0.042901672422885895, -0.014955902472138405, 0.001159287290647626, 0.009683888405561447, 0.03288426250219345, -0.0236626248806715, 0.07110489904880524, -0.041403744369745255, 0.04461025074124336, 0.007928500883281231, -0.015751678496599197, 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_get_set_tag(self): # test for when we haven't set the tag yet tag = self.runtime.service(self.mock_block, 'user_tags').get_tag(self.scope, self.key) self.assertIsNone(tag) # set the tag set_value = 'value' self.runtime.service(self.mock_block, 'user_tags').set_t...
11,135
[ -0.016800764948129654, -0.04360700398683548, 0.024158421903848648, -0.05703355744481087, -0.00014031758473720402, 0.014422413893043995, 0.06462553888559341, 0.00436714431270957, 0.006678128149360418, 0.022822795435786247, 0.010509264655411243, -0.008921745233237743, -0.0015948424115777016, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "_", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},...
def main(_): sess = tf.Session() # Construct the TensorFlow network. n0 = tf.Variable(np.ones([FLAGS.tensor_size] * 2), name="node_00") n1 = tf.Variable(np.ones([FLAGS.tensor_size] * 2), name="node_01") if FLAGS.length > 100: raise ValueError("n is too big.") for i in xrange(2, FLAGS.length): n0,...
11,136
[ -0.0220598503947258, -0.04288541525602341, 0.015210769139230251, 0.021950943395495415, -0.02435901202261448, -0.005590592976659536, 0.02388707920908928, -0.0013235305668786168, 0.021975144743919373, 0.00983194075524807, 0.010927068069577217, 0.013008413836359978, -0.0174857284873724, 0.007...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tauMem", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "CMem", "annotation": null, "type_comment": null}}, {"_type": "a...
def ComputePSPnorm(tauMem, CMem, tauSyn): a = (tauMem / tauSyn) b = (1.0 / tauSyn - 1.0 / tauMem) # time of maximum t_max = 1.0 / b * (-LambertWm1(-np.exp(-1.0 / a) / a) - 1.0 / a) # maximum of PSP for current of unit amplitude return (np.exp(1.0) / (tauSyn * CMem * b) * ((np.exp(-...
11,137
[ -0.005266775842756033, -0.0060835643671453, 0.0339784175157547, -0.02443106286227703, 0.0033518595155328512, -0.05595306307077408, 0.02739570289850235, -0.012173179537057877, 0.0016608040314167738, 0.06476227939128876, 0.006473808083683252, -0.0034486642107367516, -0.009444499388337135, -0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "env", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def exists(env): env['WIXCANDLE'] = 'candle.exe' env['WIXLIGHT'] = 'light.exe' # try to find the candle.exe and light.exe tools and # add the install directory to light libpath. for path in os.environ['PATH'].split(os.pathsep): if not path: continue # workaround for s...
11,138
[ 0.025486864149570465, 0.0014770796988159418, -0.015005254186689854, -0.03493134677410126, -0.004669833462685347, 0.007795008830726147, 0.0040685199201107025, -0.021349387243390083, 0.004926357418298721, 0.012423467822372913, 0.011860770173370838, -0.030341506004333496, 0.0072598946280777454,...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def find_videos(data): encontrados = set() devuelve = [] patronvideos = r'//(?:www\.)?vidto\.me/(?:embed-)?([0-9A-Za-z]+)' logger.info("streamondemand.servers.vidtome find_videos #" + patronvideos + "#") matches = re.compile(patronvideos, re.DOTALL).findall(data) for match in matches: ...
11,139
[ -0.028922544792294502, 0.0012007629266008735, 0.024753132835030556, 0.02679395116865635, 0.030085589736700058, 0.0345841646194458, 0.00826201681047678, 0.015130572021007538, 0.03383805975317955, 0.005710995756089687, 0.0015607860404998064, -0.051481250673532486, 0.019212206825613976, -0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "number", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "base", "annotation": null, "type_comment": null}}], "kwarg": nu...
def is_palindrome(number, base=10): current_number = number reversed_number = 0 while current_number > 0: units_digit = current_number % base reversed_number = reversed_number * base + units_digit current_number //= base return number == reversed_number
11,140
[ 0.04138418287038803, 0.01577652432024479, 0.024333644658327103, 0.02707277238368988, 0.019333144649863243, 0.014821015298366547, 0.007092004641890526, 0.01165721658617258, 0.05079064145684242, 0.003965364769101143, 0.004652800969779491, -0.034419577568769455, -0.030724940821528435, 0.00374...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "max_number", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def sum_of_palindromic_numbers_under(max_number): sum = 0 for number in range(max_number): if is_palindrome(number, 10) and is_palindrome(number, 2): sum += number return sum
11,141
[ 0.018077481538057327, -0.02976979687809944, 0.05915261432528496, -0.014083297923207283, -0.0030319171492010355, 0.04021824896335602, -0.0045090047642588615, 0.015299520455300808, 0.02041318081319332, 0.05566979944705963, 0.05003095045685768, -0.04535955190658569, -0.02026115357875824, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_halfway_cases(self): # test halfway cases for the round-half-to-even rule for i in range(100 * TEST_SIZE): # bit pattern for a random finite positive (or +0.0) float bits = random.randrange(2047*2**52) # convert bit pattern to a number of the form m * 2**e ...
11,142
[ 0.010407564230263233, -0.04575260356068611, 0.06655417382717133, -0.031676966696977615, 0.006156396586447954, 0.04735272377729416, -0.019472654908895493, 0.0012772149639204144, 0.024612026289105415, 0.06470996886491776, 0.0309447068721056, -0.05603134632110596, -0.05120386183261871, -0.032...
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_short_halfway_cases(self): # exact halfway cases with a small number of significant digits for k in 0, 5, 10, 15, 20: # upper = smallest integer >= 2**54/5**k upper = -(-2**54//5**k) # lower = smallest odd number >= 2**53/5**k lower = -(-2**53//5*...
11,143
[ -0.0034693388734012842, 0.0022327094338834286, 0.11210301518440247, 0.022767536342144012, -0.012935484759509563, 0.0314679890871048, 0.010462225414812565, 0.005353081505745649, 0.009608442895114422, 0.06011714041233063, 0.006172983907163143, -0.0301669854670763, -0.03247084468603134, -0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_boundaries(self): # boundaries expressed as triples (n, e, u), where # n*10**e is an approximation to the boundary value and # u*10**e is 1ulp boundaries = [ (10000000000000000000, -19, 1110), # a power of 2 boundary (1.0) (17976931348623159077, 289, 19...
11,144
[ 0.0353383868932724, -0.037399791181087494, 0.0514012910425663, -0.0021383739076554775, -0.00518028624355793, 0.008560189045965672, 0.01682589016854763, 0.018003836274147034, 0.02610221691429615, 0.06376972794532776, 0.019329026341438293, 0.01112356036901474, -0.05804062262177467, 0.0194628...
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_underflow_boundary(self): # test values close to 2**-1075, the underflow boundary; similar # to boundary_tests, except that the random error doesn't scale # with n for exponent in range(-400, -320): base = 10**-exponent // 2**1075 for j in range(TEST_SIZE...
11,145
[ 0.0035886315163224936, -0.04621782898902893, 0.027639813721179962, -0.005329485051333904, 0.015450495295226574, -0.009950599633157253, 0.004323733039200306, 0.02493998594582081, 0.00109847541898489, 0.037851039320230484, 0.0016823798650875688, -0.040443941950798035, -0.031007913872599602, ...
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 test_parsing(self): # make '0' more likely to be chosen than other digits digits = '000000123456789' signs = ('+', '-', '') # put together random short valid strings # \d*[.\d*]?e for i in range(1000): for j in range(TEST_SIZE): s = random...
11,146
[ 0.03215571120381355, -0.0407034307718277, 0.037175800651311874, -0.005576370283961296, -0.0199718177318573, 0.018506493419408798, -0.005335541442036629, 0.002262432361021638, 0.0036768766585737467, 0.02130146324634552, 0.04322704300284386, -0.05451546236872673, -0.019483376294374466, -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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_bigcomp(self): for ndigs in 5, 10, 14, 15, 16, 17, 18, 19, 20, 40, 41, 50: dig10 = 10**ndigs for i in range(10 * TEST_SIZE): digits = random.randrange(dig10) exponent = random.randrange(-400, 400) s = '{}e{}'.format(digits, exponen...
11,147
[ -0.0104767344892025, -0.002415538765490055, 0.004746486898511648, -0.016128655523061752, 0.03606703504920006, 0.06692076474428177, 0.04128033667802811, -0.04308494180440903, 0.003634273773059249, 0.01431151945143938, 0.04759645462036133, 0.005676986183971167, -0.028648102656006813, 0.03752...
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 VariableClippingOptimizerTest(test.TestCase): def _setupCluster(self): def get_open_port(): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("", 0)) port = s.getsockname()[1] s.close() return port port1 = get_open_port() port2 = get_open_port() cs = ...
11,148
[ 0.031780146062374115, 0.026644187048077583, 0.09128101170063019, -0.012054924853146076, -0.00045766663970425725, -0.005309774074703455, 0.014869609847664833, 0.01869354397058487, -0.03588442876935005, 0.019613081589341164, -0.039248593151569366, 0.0012363307178020477, 0.008701973594725132, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {...
class Migration(migrations.Migration): dependencies = [ ('answers', '0001_initial'), ('users', '0001_initial'), ('questions', '0001_initial'), ('reviews', '0001_initial'), ] operations = [ migrations.AddField( model_name='answer', name='quest...
11,149
[ 0.025023378431797028, 0.008505533449351788, 0.044007327407598495, -0.010790451429784298, 0.02488246001303196, 0.0018017637776210904, 0.050610437989234924, -0.0260903462767601, 0.013165961019694805, -0.015078447759151459, 0.012421098537743092, 0.010589136742055416, -0.007755637168884277, 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 _setupCluster(self): def get_open_port(): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("", 0)) port = s.getsockname()[1] s.close() return port port1 = get_open_port() port2 = get_open_port() cs = server_lib.ClusterSpec({ "worker": ["localhost:...
11,150
[ 0.006529440637677908, 0.007661460433155298, 0.00011286972585367039, -0.003261593170464039, 0.008243106305599213, 0.012858744710683823, 0.05378657951951027, -0.03199676051735878, 0.02215256541967392, -0.0186251662671566, 0.009256294928491116, 0.020676562562584877, -0.001536200987175107, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "is_distributed", "annotation": null, "type_comment": null}}, {"_t...
def _setupDense(self, is_distributed, dtype): with self._maybeWithDevice("/job:ps" if is_distributed else None): var0 = variables.Variable([[0.0, 1.0], [2.0, 3.0]], dtype=dtype) var1 = variables.Variable([4.0, 5.0], dtype=dtype) with self._maybeWithDevice("/job:worker" if is_distributed else None): ...
11,151
[ -0.011073754169046879, -0.00454085785895586, 0.0058523863554000854, -0.0200441125780344, 0.0073123895563185215, 0.007083490490913391, 0.04414654150605202, -0.02838345430791378, 0.01529291644692421, -0.016542579978704453, 0.01651783473789692, 0.01660444401204586, 0.0021235006861388683, 0.01...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "is_distributed", "annotation": null, "type_comment": null}}, {"_t...
def _setupSparse(self, is_distributed, dtype): with self._maybeWithDevice("/job:ps" if is_distributed else None): var0 = variables.Variable( [[0.0, 1.0], [2.0, 3.0], [4.0, 5.0]], dtype=dtype) var1 = variables.Variable( [[0.0, 1.0], [0.0, 3.0], [0.0, 5.0]], dtype=dtype) with self....
11,152
[ -0.0065018776804208755, 0.024637406691908836, -0.01743212714791298, -0.026643630117177963, -0.040320202708244324, 0.007021783385425806, 0.004003272857517004, -0.048100437968969345, 0.02767120860517025, 0.06884773075580597, 0.039977677166461945, -0.0162822175770998, -0.0309496708214283, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "var0", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _assertDenseCorrect(self, var0, var1, update_op): # Fetch params to validate initial values self.assertAllCloseAccordingToType([[0.0, 1.0], [2.0, 3.0]], var0.eval()) self.assertAllCloseAccordingToType([4.0, 5.0], var1.eval()) # Run 1 step of sgd, clipping each var0[i] to max L2-norm 2.0 update_...
11,153
[ -0.012244271114468575, 0.015976089984178543, -0.0026784343644976616, -0.03280586749315262, -0.03795236349105835, 0.010957647114992142, 0.0056007783859968185, -0.045562345534563065, 0.04195248335599899, 0.05248938500881195, 0.030513113364577293, -0.016476105898618698, -0.029025264084339142, ...
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": "var0", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _assertSparseCorrect(self, var0, var1, update_op): # Fetch params to validate initial values self.assertAllCloseAccordingToType([[0.0, 1.0], [2.0, 3.0], [4.0, 5.0]], var0.eval()) self.assertAllCloseAccordingToType([[0.0, 1.0], [0.0, 3.0], [0.0, 5.0]], ...
11,154
[ 0.008026822470128536, 0.009038308635354042, 0.0008466020808555186, -0.01666881889104843, 0.024441290646791458, -0.009061969816684723, -0.04774687811732292, 0.02952829748392105, 0.03790411353111267, -0.00010101922089233994, 0.038779549300670624, -0.019318794831633568, -0.0128831397742033, 0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "e", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},...
def handle_invalid_usage(e): if (ClientException == type(e)): if (401 == e.http_status): logging.error("not logged in: {}".format(e)) return "not authenticated", 401 return e.http_response_content, e.http_status if (HttpError == type(e)): if e.status_code == 401: ...
11,155
[ -0.013351766392588615, 0.02244744263589382, 0.0015402584103867412, -0.04235495999455452, 0.023797493427991867, 0.02420937269926071, -0.024895839393138885, -0.03263002261519432, -0.012390714138746262, -0.02042236737906933, 0.039334509521722794, -0.06654145568609238, 0.022458884865045547, -0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def get_objectclasses(): swift = createConnection(request) internal_data = InternalStorageManager(swift) class_names = internal_data.get_keys(INTERNALOCNAME) for k in class_names: value = internal_data.get_data(INTERNALOCNAME, k) # TODO validate if invalid remove key # class_names.append...
11,156
[ 0.012621120549738407, 0.04056038334965706, -0.009281952865421772, -0.026176275685429573, 0.03701105713844299, 0.015983639284968376, -0.015002905391156673, -0.043175674974918365, 0.0038937500212341547, -0.03208403289318085, 0.03037942387163639, -0.057443030178546906, 0.02095736563205719, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def create_objectclass(): swift = createConnection(request) internal_data = InternalStorageManager(swift) try: class_definition = xform_header_names_on_classdef(request.json.get("objectClass")) class_name = class_definition.get("name") class_schema = class_definition.get("schema") ...
11,157
[ -0.026884043589234352, 0.01799844764173031, -0.003516742028295994, -0.021589046344161034, 0.03801944479346275, 0.026111382991075516, -0.03895118460059166, -0.030679170042276382, 0.006590340286493301, -0.04156459495425224, 0.014169231988489628, -0.03638322278857231, 0.022304892539978027, -0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "class_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def get_objectclass(class_name): swift = createConnection(request) internal_data = InternalStorageManager(swift) class_def = internal_data.get_data(INTERNALOCNAME, class_name) if not class_def: raise HttpError("class does not exist", 404) return Response(class_def, mimetype="application/js...
11,158
[ 0.024044601246714592, 0.04647579416632652, -0.012263108044862747, -0.02110675349831581, 0.023888077586889267, 0.020263928920030594, -0.02497171051800251, -0.0546150803565979, 0.007350640837103128, -0.03453175723552704, 0.04486238583922386, -0.03513377532362938, 0.007501145359128714, 0.0097...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "class_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def change_objectclass(class_name): swift = createConnection(request) internal_data = InternalStorageManager(swift) try: class_definition = xform_header_names_on_classdef(request.json.get("objectClass")) class_name = class_definition.get("name") class_schema = class_definition.get("s...
11,159
[ 0.008856174536049366, 0.03431478515267372, 0.0016316287219524384, -0.03771389275789261, 0.004780715797096491, 0.04596886411309242, -0.021851396188139915, -0.028233392164111137, 0.011908433400094509, -0.036372747272253036, 0.05244335159659386, -0.04878988862037659, 0.011336134746670723, -0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "class_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyarg...
def delete_objectclass(class_name): swift = createConnection(request) internal_data = InternalStorageManager(swift) class_def = internal_data.get_data(INTERNALOCNAME, class_name) if not class_def: raise HttpError("class does not exist", 404) internal_data.remove_data(INTERNALOCNAME, class_...
11,160
[ 0.002545740222558379, -0.01123776938766241, 0.011788356117904186, -0.0038570063188672066, 0.0018835868686437607, -0.005615986883640289, -0.027123650535941124, 0.012831573374569416, -0.0024964772164821625, 0.010026478208601475, 0.01776946894824505, -0.02656726911664009, 0.031250156462192535, ...
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 get_containers(): swift = createConnection(request) optional_params = {} limit = request.args.get("limit") if limit is not None: if limit.isdigit() and int(limit) > 0: optional_params["limit"] = int(limit) else: log.debug("invalid query parameter limit: {}, f...
11,161
[ -0.0025454810820519924, 0.005210785660892725, 0.01660323515534401, 0.00620316993445158, 0.030183229595422745, -0.007767020259052515, -0.021347016096115112, -0.0137889189645648, 0.00021122730686329305, -0.00985010527074337, 0.04126843810081482, -0.0026315082795917988, 0.03404216095805168, -...
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_container(): swift = createConnection(request) internal_data = InternalStorageManager(swift) # TODO: check schema validity since somebody else could store a rouge class definition in the object store (via direct interfacing with the object store) try: container_definition = request.j...
11,162
[ 0.0034962694626301527, 0.015854487195611, 0.005475122481584549, 0.0077261049300432205, 0.013192353770136833, -0.0022790825460106134, -0.022231778129935265, -0.02550916001200676, -0.007424396462738514, -0.008240784518420696, 0.055561698973178864, 0.0018146880902349949, 0.030383823439478874, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "container_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonl...
def change_container(container_name): swift = createConnection(request) # TODO: check schema validity since somebody else could store a rouge class definition in the object store (via direct interfacing with the object store) try: container_definition = request.json.get("container") contain...
11,163
[ 0.001050529070198536, 0.0020366962999105453, -0.00168914208188653, 0.01144783478230238, -0.018170077353715897, -0.007408768869936466, -0.04359445348381996, 0.006235952023416758, -0.009228064678609371, 0.008987780660390854, 0.026225324720144272, -0.01605328544974327, 0.026934735476970673, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "container_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonl...
def get_objects_in_container(container_name): swift = createConnection(request) optional_params = {} limit = request.args.get("limit") if limit is not None: if limit.isdigit() and int(limit) > 0: optional_params["limit"] = int(limit) else: log.debug("invalid quer...
11,164
[ 0.006556767039000988, 0.019577952101826668, -0.009234882891178131, 0.012972294352948666, 0.015482010319828987, 0.02133801206946373, 0.016568467020988464, -0.014895323663949966, 0.008343988098204136, -0.015851404517889023, 0.03950357064604759, 0.006545902229845524, 0.0005812544259242713, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "container_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "object_name", "annotation": null, "type_comment": null}...
def update_object(container_name, object_name): swift = createConnection(request) try: object_definition = request.json.get("metadata") except AttributeError: raise HttpError("malformed request", 400) if not object_definition: raise HttpError("object_definition is missing", 400)...
11,165
[ 0.0354626290500164, 0.036787744611501694, -0.012304648756980896, -0.018488522619009018, -0.007829752750694752, 0.04799864441156387, -0.005058577749878168, 0.01592242531478405, 0.004711523652076721, -0.03338030353188515, 0.07286034524440765, -0.018898678943514824, -0.002697557443752885, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "container_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "object_name", "annotation": null, "type_comment": null}...
def delete_object(container_name, object_name): swift = createConnection(request) metadata = swift.get_object_metadata(container_name, object_name) retentimestamp = metadata.get("x-object-meta-retentiontime") if retentimestamp and not isRetentionPeriodExpired(retentimestamp): error_msg = "Deleti...
11,166
[ 0.015812033787369728, 0.04098645597696304, -0.023012982681393623, -0.0061375657096505165, 0.00032255452242679894, -0.004357556346803904, 0.004496258217841387, -0.01791568286716938, -0.0012461512815207243, -0.023359738290309906, 0.030537568032741547, 0.008015822619199753, 0.03000587783753872,...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "container_name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonl...
def create_object(container_name): swift = createConnection(request) # returns werkzeug.datastructures.FileStorage i.e. file-like # Underlying stream is either BytesIO for small files or _TemporaryFileWrapper for large files file = request.files["objectName"] object_name = file.filename headers...
11,167
[ 0.012643621303141117, 0.02824481576681137, -0.014154096134006977, -0.010657822713255882, 0.007219645194709301, 0.026766030117869377, -0.005582417827099562, -0.021600840613245964, -0.0007407134398818016, -0.047954920679330826, 0.02022768184542656, -0.008714275434613228, 0.03238541632890701, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "container_name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "object_name", "annotation": null, "type_comment": null}...
def get_object_metadata(container_name, object_name): swift = createConnection(request) metadata = swift.get_object_metadata(container_name, object_name) retention_timestamp = metadata.get("x-object-meta-retentiontime") if retention_timestamp: # convert time stamp to human readable format ...
11,168
[ 0.0896383747458458, 0.00796382874250412, 0.017942601814866066, -0.02526676468551159, -0.025416020303964615, -0.013891389593482018, -0.009557659737765789, -0.03752700984477997, 0.03739907592535019, -0.007361477240920067, -0.01114083081483841, -0.03140754625201225, -0.04025624692440033, 0.02...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def xform_header_names(name): tmp = name.strip() tmp = tmp.lower() tmp = re.sub("\s+", " ", tmp) # collapse inner whitespace to single space tmp = tmp.replace(" ", "-") tmp = tmp.replace("ä", "ae") tmp = tmp.replace("ö", "oe") tmp = tmp.replace("ü", "ue") tmp = tmp.replace("ß", "ss") ...
11,169
[ 0.02294112928211689, 0.022853149101138115, -0.06471025943756104, -0.01826712116599083, 0.033212948590517044, -0.004264344461262226, 0.004209356382489204, -0.02890186384320259, -0.010161842219531536, 0.028351981192827225, 0.02938576228916645, -0.005050677806138992, -0.002350750844925642, -0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "node", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def assert_attr(node, **kwargs): __tracebackhide__ = True for name, expected in kwargs.items(): anode = node.getAttributeNode(name) assert anode, "node %r has no attribute %r" %(node, name) val = anode.value if val != str(expected): py.test.fail("%r != %r" %(str(val),...
11,170
[ 0.071230947971344, 0.03624657914042473, 0.022214967757463455, -0.019427577033638954, 0.008435796946287155, 0.030082767829298973, -0.04253661260008812, -0.05385446548461914, 0.008283279836177826, -0.02909403294324875, 0.04047499597072601, -0.033238302916288376, -0.0017276554135605693, -0.00...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "classdef", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"...
def xform_header_names_on_classdef(classdef): # print(classdef) classdef["name"] = xform_header_names(classdef["name"]) classdef["schema"]["description"] = xform_header_names(classdef["schema"]["description"]) newP = {} for oldP in classdef["schema"]["properties"]: newP[xform_header_names(ol...
11,171
[ -0.0016875191358849406, -0.01655825972557068, 0.02733391709625721, -0.060628365725278854, 0.024064524099230766, -0.007439540699124336, -0.0022226879373192787, -0.008140125311911106, 0.024331413209438324, 0.030847961083054543, 0.015057007782161236, 0.020695045590400696, 0.03253826126456261, ...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_summing_simple(self, testdir): testdir.makepyfile(""" import pytest def test_pass(): pass def test_fail(): assert 0 def test_skip(): pytest.skip("") @pytest.mark.xfail def test_xfail(...
11,172
[ -0.015569028444588184, -0.004393509589135647, -0.00861792266368866, -0.06459516286849976, 0.0015475420514121652, -0.006135815754532814, 0.022912681102752686, 0.003650689497590065, 0.03645254299044609, 0.005492642056196928, 0.039762016385793686, 0.016547376289963722, 0.012984255328774452, -...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_timing_function(self, testdir): testdir.makepyfile(""" import time, pytest def setup_module(): time.sleep(0.01) def teardown_module(): time.sleep(0.01) def test_sleep(): time.sleep(0.01) """) ...
11,173
[ -0.0029507202561944723, -0.009685873985290527, -0.01180288102477789, -0.05208291485905647, -0.005901440512388945, -0.03155022859573364, -0.007972920313477516, 0.008946060203015804, 0.011125666089355946, 0.008786715567111969, 0.029842963442206383, 0.013225600123405457, 0.048577334731817245, ...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_setup_error(self, testdir): testdir.makepyfile(""" def pytest_funcarg__arg(request): raise ValueError() def test_function(arg): pass """) result, dom = runandparse(testdir) assert result.ret node = dom.getElementsBy...
11,174
[ 0.011287456378340721, 0.00925456266850233, 0.006213860120624304, -0.05054016411304474, 0.016597168520092964, 0.02630668506026268, -0.03648843243718147, 0.017714396119117737, -0.015917617827653885, -0.014178427867591381, 0.012542897835373878, 0.003458223305642605, 0.03517540171742439, -0.03...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_skip_contains_name_reason(self, testdir): testdir.makepyfile(""" import pytest def test_skip(): pytest.skip("hello23") """) result, dom = runandparse(testdir) assert result.ret == 0 node = dom.getElementsByTagName("testsuite")[0] ...
11,175
[ 0.011719350703060627, 0.004810828249901533, 0.04572165012359619, -0.09578893333673477, 0.019335772842168808, 0.017024263739585876, 0.03212997689843178, -0.014157992787659168, -0.003094532759860158, 0.004394756630063057, 0.014169550500810146, 0.013591673225164413, 0.02917124517261982, -0.02...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_classname_nested_dir(self, testdir): p = testdir.tmpdir.ensure("sub", "test_hello.py") p.write("def test_func(): 0/0") result, dom = runandparse(testdir) assert result.ret node = dom.getElementsByTagName("testsuite")[0] assert_attr(node, failures=1) tnode...
11,176
[ 0.00537589006125927, -0.014979636296629906, -0.0014419418293982744, -0.0895024985074997, 0.019163336604833603, 0.013158236630260944, -0.011016711592674255, -0.010691067203879356, 0.001877973903901875, -0.012915383093059063, 0.03179171308875084, 0.013886796310544014, 0.03278520330786705, -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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_classname_instance(self, testdir): testdir.makepyfile(""" class TestClass: def test_method(self): assert 0 """) result, dom = runandparse(testdir) assert result.ret node = dom.getElementsByTagName("testsuite")[0] as...
11,177
[ 0.003155448939651251, -0.0017912273760885, 0.06234287843108177, -0.030769551172852516, 0.016602998599410057, -0.010838417336344719, -0.025394298136234283, 0.03300505131483078, 0.025243591517210007, 0.002056536264717579, 0.02594689466059208, 0.010794460773468018, 0.04631759226322174, -0.027...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_internal_error(self, testdir): testdir.makeconftest("def pytest_runtest_protocol(): 0 / 0") testdir.makepyfile("def test_function(): pass") result, dom = runandparse(testdir) assert result.ret node = dom.getElementsByTagName("testsuite")[0] assert_attr(node, erro...
11,178
[ 0.004324516747146845, -0.007379395887255669, 0.006467402912676334, -0.06437598913908005, -0.010526666417717934, -0.021899757906794548, -0.016749680042266846, -0.007474767975509167, 0.027085602283477783, 0.025988826528191566, 0.027061758562922478, -0.0007462101057171822, 0.021923601627349854,...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_failure_function(self, testdir): testdir.makepyfile(""" import sys def test_fail(): print ("hello-stdout") sys.stderr.write("hello-stderr\\n") raise ValueError(42) """) result, dom = runandparse(testdir) as...
11,179
[ 0.005240637809038162, -0.008799917064607143, 0.010590140707790852, -0.05481955036520958, -0.009822038002312183, -0.016474897041916847, -0.008539850823581219, 0.020345650613307953, 0.02878873236477375, 0.011442916467785835, 0.03544158861041069, 0.017345815896987915, 0.05980314686894417, -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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_failure_escape(self, testdir): testdir.makepyfile(""" import pytest @pytest.mark.parametrize('arg1', "<&'", ids="<&'") def test_func(arg1): print(arg1) assert 0 """) result, dom = runandparse(testdir) assert res...
11,180
[ 0.02770795300602913, -0.023722562938928604, -0.0027295774780213833, -0.03779004141688347, -0.00752005260437727, -0.0075319139286875725, -0.024457963183522224, -0.01532477606087923, 0.02616598643362522, 0.022002676501870155, 0.013426970690488815, 0.033164143562316895, 0.021907787770032883, ...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_failure_verbose_message(self, testdir): testdir.makepyfile(""" import sys def test_fail(): assert 0, "An error" """) result, dom = runandparse(testdir) node = dom.getElementsByTagName("testsuite")[0] tnode = node.getElementsByTagN...
11,181
[ -0.006388316862285137, -0.03638823702931404, 0.03051530010998249, -0.03933669254183769, 0.004060117062181234, -0.0072213150560855865, 0.012704720720648766, 0.024714278057217598, 0.022856511175632477, 0.02900511771440506, 0.013423855416476727, 0.029556453227996826, 0.03729914128780365, -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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_junit_prefixing(self, testdir): testdir.makepyfile(""" def test_func(): assert 0 class TestHello: def test_hello(self): pass """) result, dom = runandparse(testdir, "--junitprefix=xyz") assert result.ret...
11,182
[ 0.00255001662299037, -0.008691930212080479, 0.004760414827615023, -0.045704588294029236, -0.0010425999062135816, -0.016900336369872093, -0.012445001862943172, 0.0015297221252694726, 0.035090070217847824, 0.0006831943173892796, 0.023117080330848694, -0.021401720121502876, 0.023899929597973824...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_xfailure_function(self, testdir): testdir.makepyfile(""" import pytest def test_xfail(): pytest.xfail("42") """) result, dom = runandparse(testdir) assert not result.ret node = dom.getElementsByTagName("testsuite")[0] asser...
11,183
[ 0.015471721068024635, -0.004738432355225086, 0.02225003018975258, -0.04786600172519684, 0.007468906696885824, -0.0032759890891611576, -0.012964676134288311, -0.010480843484401703, 0.030804162845015526, -0.006093513686209917, 0.01615651696920395, -0.0013761185109615326, 0.02353837341070175, ...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_xfailure_xpass(self, testdir): testdir.makepyfile(""" import pytest @pytest.mark.xfail def test_xpass(): pass """) result, dom = runandparse(testdir) #assert result.ret node = dom.getElementsByTagName("testsuite")[0] ...
11,184
[ 0.010158049874007702, -0.021447312086820602, 0.007632820401340723, -0.023584043607115746, 0.0003517181903589517, -0.007181478664278984, 0.000820556771941483, 0.018990639597177505, 0.002665202599018812, 0.012580442242324352, 0.050001829862594604, -0.037067171186208725, 0.04762514308094978, ...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_collect_error(self, testdir): testdir.makepyfile("syntax error") result, dom = runandparse(testdir) assert result.ret node = dom.getElementsByTagName("testsuite")[0] assert_attr(node, errors=1, tests=0) tnode = node.getElementsByTagName("testcase")[0] ass...
11,185
[ 0.02068023383617401, 0.003296246286481619, 0.014788564294576645, -0.04219195246696472, 0.012709850445389748, 0.022165028378367424, -0.007584335748106241, -0.005354173015803099, -0.02322220243513584, -0.0027335085906088352, 0.007536822464317083, -0.025372186675667763, 0.026108646765351295, ...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_collect_skipped(self, testdir): testdir.makepyfile("import pytest; pytest.skip('xyz')") result, dom = runandparse(testdir) assert not result.ret node = dom.getElementsByTagName("testsuite")[0] assert_attr(node, skips=1, tests=0) tnode = node.getElementsByTagName(...
11,186
[ 0.021608656272292137, -0.035715799778699875, 0.0045898980461061, -0.00782402977347374, 0.0042763398960232735, -0.03277730941772461, -0.0015200118068605661, 0.021023346111178398, 0.05222390219569206, 0.011700209230184555, 0.013605449348688126, 0.023484034463763237, -0.016376709565520287, -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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_unicode(self, testdir): value = 'hx\xc4\x85\xc4\x87\n' testdir.makepyfile(""" # coding: latin1 def test_hello(): print (%r) assert 0 """ % value) result, dom = runandparse(testdir) assert result.ret == 1 tno...
11,187
[ 0.041837047785520554, -0.011404085904359818, 0.008154372684657574, -0.04007979482412338, -0.0026524278800934553, -0.005954798310995102, 0.006379066500812769, -0.014094126410782337, 0.030932454392313957, -0.004660930950194597, 0.03218419477343559, -0.0017873422475531697, 0.02789938822388649, ...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_pass_captures_stderr(self, testdir): testdir.makepyfile(""" import sys def test_pass(): sys.stderr.write('hello-stderr') """) result, dom = runandparse(testdir) node = dom.getElementsByTagName("testsuite")[0] pnode = node.getElemen...
11,188
[ 0.04220971837639809, -0.014772236347198486, 0.007985621690750122, -0.04612104222178459, -0.0050928713753819466, -0.013875891454517841, -0.015750067308545113, -0.021628696471452713, 0.04151126742362976, -0.01840418204665184, 0.015330997295677662, -0.002139005810022354, 0.029637601226568222, ...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_pass_captures_stdout(self, testdir): testdir.makepyfile(""" def test_pass(): print('hello-stdout') """) result, dom = runandparse(testdir) node = dom.getElementsByTagName("testsuite")[0] pnode = node.getElementsByTagName("testcase")[0] ...
11,189
[ -0.005991850979626179, -0.015353064984083176, 0.033536396920681, -0.03542323783040047, 0.018756121397018433, -0.010883043520152569, 0.0047255321405828, 0.006048006936907768, 0.01375823374837637, 0.027336766943335533, -0.010529260151088238, -0.0028695743530988693, 0.038096267729997635, -0.0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "testdir", "annotation"...
class TestNonPython: def test_summing_simple(self, testdir): testdir.makeconftest(""" import pytest def pytest_collect_file(path, parent): if path.ext == ".xyz": return MyItem(path, parent) class MyItem(pytest.Item): def...
11,190
[ 0.012407705187797546, -0.008641942404210567, 0.03944395110011101, -0.03821283578872681, -0.0028288480825722218, -0.019903020933270454, -0.0005540770362131298, -0.002501456066966057, 0.013892284594476223, 0.026625873520970345, 0.00919715128839016, 0.011834392324090004, 0.03572646528482437, ...
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": "testdir", "annotation": null, "type_comment": null}}], "kwarg": n...
def test_summing_simple(self, testdir): testdir.makeconftest(""" import pytest def pytest_collect_file(path, parent): if path.ext == ".xyz": return MyItem(path, parent) class MyItem(pytest.Item): def __init__(self, path, par...
11,191
[ 0.015054075047373772, 0.005406083073467016, 0.02353789284825325, -0.029156900942325592, 0.02546251378953457, 0.009512494318187237, 0.023206060752272606, -0.0005008577136322856, 0.05180991068482399, -0.0019979001954197884, 0.043823838233947754, 0.03216550499200821, 0.03931093588471413, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "testdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def test_logxml_changingdir(testdir): testdir.makepyfile(""" def test_func(): import os os.chdir("a") """) testdir.tmpdir.mkdir("a") result = testdir.runpytest("--junitxml=a/x.xml") assert result.ret == 0 assert testdir.tmpdir.join("a/x.xml").check()
11,192
[ 0.03542914614081383, 0.02542792819440365, 0.03861036151647568, -0.029393553733825684, -0.00632974598556757, 0.032749079167842865, 0.048589788377285004, -0.018477192148566246, 0.04649803042411804, 0.0035134991630911827, 0.007560832425951958, -0.02595086768269539, 0.035233043134212494, -0.01...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tmpdir", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "monkeypatch", "annotation": null, "type_comment": null}}], "kwa...
def test_logxml_path_expansion(tmpdir, monkeypatch): home_tilde = py.path.local(os.path.expanduser('~')).join('test.xml') xml_tilde = LogXML('~%stest.xml' % tmpdir.sep, None) assert xml_tilde.logfile == home_tilde # this is here for when $HOME is not set correct monkeypatch.setenv("HOME", tmpdir) ...
11,193
[ -0.014732107520103455, -0.035400886088609695, 0.014373516663908958, -0.0006153942085802555, 0.03346848115324974, 0.01822836883366108, -0.005334038753062487, -0.028747033327817917, -0.021794354543089867, 0.010120230726897717, 0.01331766601651907, -0.035938773304224014, 0.04936600849032402, ...
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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul...
def __eq__(self, other): if isinstance(other, tuple): warnings.warn("IPv4Address.__getitem__ is deprecated. Use attributes instead.", category=DeprecationWarning, stacklevel=2) return (self.host, self.port) == other elif isinstance(other, IPv4Address): ...
11,194
[ 0.03640744835138321, 0.005870466120541096, -0.009330580942332745, -0.03455423191189766, 0.007823378778994083, 0.0006121178157627583, -0.017042532563209534, 0.005808888003230095, 0.038753289729356766, 0.000849634176120162, 0.0301909688860178, 0.00948306079953909, 0.04145100340247154, -0.029...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "testdir", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def test_escaped_parametrized_names_xml(testdir): testdir.makepyfile(""" import pytest @pytest.mark.parametrize('char', ["\\x00"]) def test_func(char): assert char """) result, dom = runandparse(testdir) assert result.ret == 0 node = dom.getElementsByTagName("test...
11,195
[ 0.030788850039243698, -0.004086948931217194, 0.018515460193157196, -0.05158236250281334, -0.021576279774308205, -0.023362595587968826, -0.024326002225279808, -0.013507755473256111, -0.035646021366119385, 0.019639432430267334, -0.006437759846448898, -0.10565352439880371, -0.010547288693487644...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "CharField", "value": {"_type": "Name", "_fields": {"id": "mo...
class Article(models.Model): title = models.CharField(max_length=150) author = models.ForeignKey(Author, models.SET_NULL, null=True) def __str__(self): return 'Article titled: %s' % (self.title, ) class Meta: ordering = ['author__name', ]
11,196
[ -0.0004946202388964593, 0.013272138312458992, 0.020950235426425934, -0.0459369532763958, 0.011933955363929272, 0.011988799087703228, -0.04409421235322952, -0.03288419172167778, -0.016760187223553658, 0.07151598483324051, 0.0066963969729840755, -0.029023203998804092, 0.05453642085194588, 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": "file_path", "annotation": null, "type_comment": null}}], "kwarg":...
def match(self, file_path): cmd = ["file", file_path] try: output = subprocess.check_output(cmd).decode() except subprocess.CalledProcessError as cmd_err: raise ValueError( "Failed to get architecture info: {}", cmd_err ) from cmd_err ...
11,197
[ -0.032509565353393555, -0.004818624816834927, 0.03008834831416607, -0.035638097673654556, -0.0138471694663167, 0.033380113542079926, -0.004570382181555033, 0.007651309482753277, 0.011752411723136902, 0.025653989985585213, 0.03381538763642311, -0.052450574934482574, -0.015860313549637794, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": ...
def test_fetch_recent_meetings_week(client, mocker): datagrepper = mocker.patch("urllib.request.urlopen", side_effect=fake_datagrepper) r, d = mote.modules.late.fetch_recent_meetings(7) datagrepper.assert_called_once() assert f"delta={mote.modules.late.seconds_delta * 7}" in datagrepper.call_args[0][0]...
11,198
[ -0.02792399749159813, -0.00828058086335659, 0.03154377639293671, -0.02683534286916256, -0.00025260195252485573, 0.04030744731426239, -0.0012272882740944624, 0.004827504046261311, 0.005684819538146257, 0.02966584637761116, 0.036061692982912064, -0.05013255774974823, -0.0176498182117939, -0....
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg": ...
def test_fetch_recent_meetings_day(client, mocker): datagrepper = mocker.patch("urllib.request.urlopen", side_effect=fake_datagrepper) r, d = mote.modules.late.fetch_recent_meetings(1) datagrepper.assert_called_once() assert f"delta={mote.modules.late.seconds_delta * 1}" in datagrepper.call_args[0][0] ...
11,199
[ 0.05126066133379936, 0.014105581678450108, -0.01621919497847557, -0.008070661686360836, 0.030102290213108063, -0.01488428097218275, 0.012169958092272282, -0.04211650788784027, 0.02329423278570175, 0.041048578917980194, -0.010000724345445633, 0.013627237640321255, 0.028700631111860275, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "device", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, device, path): self.device = device self.path = path self.id = self.device.path.basename(self.path) self.cpu = self.device.path.basename(self.device.path.dirname(path)) self.desc = self.get('desc') self.name = self.get('name') self.latency = sel...
11,200
[ 0.04201066866517067, 0.0013373648980632424, 0.004985443316400051, 0.02480376698076725, 0.028007112443447113, 0.02279059775173664, -0.03010891191661358, -0.036085113883018494, 0.032691847532987595, 0.033806052058935165, 0.032008130103349686, -0.0416308268904686, 0.02628515660762787, 0.02836...
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 CpuidleState(object): @property def usage(self): return self.get('usage') @property def time(self): return self.get('time') @property def disable(self): return self.get('disable') @disable.setter def disable(self, value): self.set('disable', valu...