lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_14(self, VAR_15, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_47 = SubprocPool.foreground().map_async(VAR_15, VAR_16)\n",
"SubprocPool.shutdown(True)\n",
"while not VAR_47.ready():\n",
"VAR_47.wait(60)\n",
"return VAR_47.get()\n",
"if not VAR_47.ready():\n",
"self.log.debug('subproc_map... | [
"def subproc_map(self, f, items):...\n",
"\"\"\"docstring\"\"\"\n",
"res = SubprocPool.foreground().map_async(f, items)\n",
"SubprocPool.shutdown(True)\n",
"while not res.ready():\n",
"res.wait(60)\n",
"return res.get()\n",
"if not res.ready():\n",
"self.log.debug('subproc_map result still not ready... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Return'",
"Condition",
"Expr'"
] |
[
"__author__ = 'Johannes Köster'\n",
"__copyright__ = 'Copyright 2015, Johannes Köster'\n",
"__email__ = 'koester@jimmy.harvard.edu'\n",
"__license__ = 'MIT'\n",
"import os\n",
"import re\n",
"import stat\n",
"import time\n",
"import json\n",
"from itertools import product, chain\n",
"from collec... | [
"__author__ = 'Johannes Köster'\n",
"__copyright__ = 'Copyright 2015, Johannes Köster'\n",
"__email__ = 'koester@jimmy.harvard.edu'\n",
"__license__ = 'MIT'\n",
"import os\n",
"import re\n",
"import stat\n",
"import time\n",
"import json\n",
"from itertools import product, chain\n",
"from collec... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0
] | [
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Return'"
] |
[
"def __enter__(self):...\n",
"if self._connection is None:\n",
"self._connection = self._engine.connect()\n",
"self._transactions.append(self._connection.begin())\n",
"return self\n"
] | [
"def __enter__(self):...\n",
"if self._connection is None:\n",
"self._connection = self._engine.connect()\n",
"self._transactions.append(self._connection.begin())\n",
"return self\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"@commands.command()...\n",
"\"\"\"docstring\"\"\"\n",
"await self.simple_embed('string')\n"
] | [
"@commands.command()...\n",
"\"\"\"docstring\"\"\"\n",
"await self.simple_embed(\n \" **Please keep the channels clean and on-topic, further derailing will result in intervention. A staff or helper will be the quickest route to resolution; you can contact available staff by private messaging the Mod-mail bo... | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'"
] |
[
"def __init__(self, VAR_3=False, VAR_4=False):...\n",
"\"\"\"docstring\"\"\"\n",
"RESTClient.__init__(self, 'workqueue')\n",
"VAR_8 = getConfig('worker')\n",
"self._uid = uuid.uuid4()\n",
"Daemon.__init__(self, pidfile='/tmp/worker-%s.pid' % self._uid, logfile=\n '/tmp/worker-%s.log' % self._uid, targe... | [
"def __init__(self, debug=False, one_shot=False):...\n",
"\"\"\"docstring\"\"\"\n",
"RESTClient.__init__(self, 'workqueue')\n",
"conf = getConfig('worker')\n",
"self._uid = uuid.uuid4()\n",
"Daemon.__init__(self, pidfile='/tmp/worker-%s.pid' % self._uid, logfile=\n '/tmp/worker-%s.log' % self._uid, tar... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
2,
0,
2,
2,
2,
0,
0,
2
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.get(self.section, 'sso_session_mongo_uri')\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.get(self.section, 'sso_session_mongo_uri')\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def __init__(self, VAR_64):...\n",
"self.func = VAR_64\n",
"self.shellcmd = None\n",
"self.norun = False\n",
"self.input = None\n",
"self.output = None\n",
"self.params = None\n",
"self.message = None\n",
"self.benchmark = None\n",
"self.threads = None\n",
"self.resources = None\n",
"self.pri... | [
"def __init__(self, func):...\n",
"self.func = func\n",
"self.shellcmd = None\n",
"self.norun = False\n",
"self.input = None\n",
"self.output = None\n",
"self.params = None\n",
"self.message = None\n",
"self.benchmark = None\n",
"self.threads = None\n",
"self.resources = None\n",
"self.priorit... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Docstring"
] |
[
"def FUNC_33(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'HIGH': 7}, 'CONFIDENCE': {'HIGH': 7}}\n",
"self.check_example('requests-ssl-verify-disabled.py', VAR_2)\n"
] | [
"def test_requests_ssl_verify_disabled(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'HIGH': 7}, 'CONFIDENCE': {'HIGH': 7}}\n",
"self.check_example('requests-ssl-verify-disabled.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"import datetime\n",
"import json\n",
"import logging\n",
"import re\n",
"import MySQLdb\n",
"from collections import namedtuple, defaultdict\n",
"VAR_0 = logging.getLogger(u'JSON2SQLGenerator')\n",
"\"\"\"\n To Generate SQL query from JSON data\n \"\"\"\n",
"VAR_1 = 'where'\n",
"VAR_2 = 'an... | [
"import datetime\n",
"import json\n",
"import logging\n",
"import re\n",
"import MySQLdb\n",
"from collections import namedtuple, defaultdict\n",
"logger = logging.getLogger(u'JSON2SQLGenerator')\n",
"\"\"\"\n To Generate SQL query from JSON data\n \"\"\"\n",
"WHERE_CONDITION = 'where'\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"A... |
[
"def FUNC_38(self, VAR_19):...\n",
"return [view.datamodel.get_related_fk(self.obj) for view in VAR_19]\n"
] | [
"def get_related_fks(self, related_views):...\n",
"return [view.datamodel.get_related_fk(self.obj) for view in related_views]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(VAR_16, VAR_17, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_15 is not None:\n",
"VAR_17 = str(VAR_17)\n",
"if VAR_15.alt_number is None:\n",
"print(\n '[VCF-Zarr] Determining maximum number of ALT alleles by scaling all variants in the VCF file.'\n )\n",
"print('[VCF-Zarr] Usin... | [
"def convert_to_zarr(input_vcf_path, output_zarr_path, conversion_config):...\n",
"\"\"\"docstring\"\"\"\n",
"if conversion_config is not None:\n",
"output_zarr_path = str(output_zarr_path)\n",
"if conversion_config.alt_number is None:\n",
"print(\n '[VCF-Zarr] Determining maximum number of ALT alleles... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
7,
7,
7
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"... |
[
"@VAR_0.route('/level-3')...\n",
"if int(current_user.progress) >= 3:\n",
"return render_template('ui.html', VAR_6='3', VAR_7='index', level_progress=\n current_user.level3_progress, max_level_progress=3)\n",
"return redirect(VAR_4)\n"
] | [
"@app.route('/level-3')...\n",
"if int(current_user.progress) >= 3:\n",
"return render_template('ui.html', level='3', page='index', level_progress=\n current_user.level3_progress, max_level_progress=3)\n",
"return redirect(url_prefix)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_3():...\n",
"def FUNC_7(VAR_11):...\n",
"return True\n"
] | [
"def test_it_can_walk_all_files():...\n",
"def directory_filter(_path):...\n",
"return True\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_13 = VAR_2 + '.md5'\n",
"VAR_13 = open(VAR_13, 'r')\n",
"VAR_13 = VAR_13.read()\n",
"return VAR_13\n"
] | [
"def get_md5_from_file(path):...\n",
"\"\"\"docstring\"\"\"\n",
"key_md5 = path + '.md5'\n",
"key_md5 = open(key_md5, 'r')\n",
"key_md5 = key_md5.read()\n",
"return key_md5\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_8(VAR_9):...\n",
"VAR_14 = __import__(VAR_9.replace('\\r', ''))\n",
"VAR_15 = getattr(VAR_14, VAR_9.replace('\\r', ''))\n",
"VAR_16 = VAR_15()\n",
"return FUNC_7(VAR_16, 'fetch') + VAR_4 + '.' + VAR_4\n"
] | [
"def runPlugin(name):...\n",
"module = __import__(name.replace('\\r', ''))\n",
"class_ = getattr(module, name.replace('\\r', ''))\n",
"instance = class_()\n",
"return callMethod(instance, 'fetch') + LINEBREAK + '.' + LINEBREAK\n"
] | [
0,
0,
0,
0,
1
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self, VAR_1, VAR_7, VAR_8, VAR_9, VAR_4=None):...\n",
"if VAR_4 is None:\n",
"VAR_4 = {}\n",
"VAR_29 = super(CLASS_0, self).view_header_get(VAR_1, VAR_7, VAR_8, VAR_9, VAR_4\n )\n",
"if VAR_29:\n",
"return VAR_29\n",
"if VAR_4.get('active_id', False) and VAR_4.get('active_model'\n",
"re... | [
"def view_header_get(self, cr, user, view_id, view_type, context=None):...\n",
"if context is None:\n",
"context = {}\n",
"res = super(product_product, self).view_header_get(cr, user, view_id,\n view_type, context)\n",
"if res:\n",
"return res\n",
"if context.get('active_id', False) and context.get('... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"import logging\n",
"from flask import g, request\n",
"from flask_restplus import Resource\n",
"from sqlalchemy import exc, or_\n",
"from app.models.bookings import Exam\n",
"from app.models.theq import CSR\n",
"from app.schemas.bookings import ExamSchema\n",
"from qsystem im... | [
"\"\"\"Copyright 2018 Province of British Columbia\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agr... | [
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
... |
[
"def FUNC_16(self):...\n",
"VAR_7 = Pa11yCrawler('')\n",
"VAR_7.get_test_course()\n",
"self._mock_sh.assert_has_calls([call(\n 'wget {targz} -O {dir}demo_course.tar.gz'.format(targz=suite.\n tar_gz_file, dir=suite.imports_dir)), call(\n 'tar zxf {dir}demo_course.tar.gz -C {dir}'.format(dir=suite.impo... | [
"def test_get_test_course(self):...\n",
"suite = Pa11yCrawler('')\n",
"suite.get_test_course()\n",
"self._mock_sh.assert_has_calls([call(\n 'wget {targz} -O {dir}demo_course.tar.gz'.format(targz=suite.\n tar_gz_file, dir=suite.imports_dir)), call(\n 'tar zxf {dir}demo_course.tar.gz -C {dir}'.format(d... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"for f in self.forums:\n",
"self.counter_tick()\n",
"self.addtopic(self.msgfun(), self.sbjfun(), f)\n",
"self.counters['topics'] += 1\n",
"self.w.sleep(self.topic_successtimeout)\n",
"self.topic_successtimeout = self.topic_successtimeout + 0.1\n",
"self.log.info('Wait5Min exc... | [
"def forumwipe_loop(self):...\n",
"for f in self.forums:\n",
"self.counter_tick()\n",
"self.addtopic(self.msgfun(), self.sbjfun(), f)\n",
"self.counters['topics'] += 1\n",
"self.w.sleep(self.topic_successtimeout)\n",
"self.topic_successtimeout = self.topic_successtimeout + 0.1\n",
"self.log.info('Wait... | [
0,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'",
"Expr'",
"AugAssign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_23(self, VAR_14):...\n",
""
] | [
"def is_unique(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_10(VAR_0, *VAR_1, **VAR_2):...\n",
"if not VAR_0.user.is_authenticated:\n",
"return invalid_permission_redirect(VAR_0)\n",
"VAR_15 = {'closed': False}\n",
"VAR_23 = CLASS_1.as_view()\n",
"return VAR_23(VAR_0, VAR_15=filter_data)\n"
] | [
"def transactions_open(request, *args, **kwargs):...\n",
"if not request.user.is_authenticated:\n",
"return invalid_permission_redirect(request)\n",
"filter_data = {'closed': False}\n",
"listview = TransactionList.as_view()\n",
"return listview(request, filter_data=filter_data)\n"
] | [
0,
0,
0,
0,
6,
6
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@VAR_0.inclusion_tag('exercise/_category_points.html', takes_context=True)...\n",
"return FUNC_2(VAR_1, VAR_2)\n"
] | [
"@register.inclusion_tag('exercise/_category_points.html', takes_context=True)...\n",
"return _get_toc(context, student)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_14(self):...\n",
"self.run_test_case(self.scenario.disable_server_group())\n"
] | [
"def test_e_disable_server_group(self):...\n",
"self.run_test_case(self.scenario.disable_server_group())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"VAR_21 = self.agent.type_to_payload('deleteGoogleHttpLoadBalancerDescription',\n {'loadBalancerName': self.__use_http_lb_name, 'credentials': self.\n bindings['GCE_CREDENTIALS']})\n",
"VAR_20 = gcp.GceContractBuilder(self.gce_observer)\n",
"VAR_20.new_clause_builder('Health Ch... | [
"def delete_http_load_balancer(self):...\n",
"payload = self.agent.type_to_payload('deleteGoogleHttpLoadBalancerDescription',\n {'loadBalancerName': self.__use_http_lb_name, 'credentials': self.\n bindings['GCE_CREDENTIALS']})\n",
"builder = gcp.GceContractBuilder(self.gce_observer)\n",
"builder.new_cla... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_3(self, VAR_3):...\n",
"logging.debug('API: Getting local path %s contents' % VAR_3.as_posix())\n",
"VAR_5 = list()\n",
"logging.debug('Checking path %s' % VAR_3)\n",
"if not VAR_3.exists():\n",
"while not VAR_3.exists():\n",
"for part in VAR_3.iterdir():\n",
"logging.debug('Path does not ex... | [
"def local_listing(self, path):...\n",
"logging.debug('API: Getting local path %s contents' % path.as_posix())\n",
"contents = list()\n",
"logging.debug('Checking path %s' % path)\n",
"if not path.exists():\n",
"while not path.exists():\n",
"for part in path.iterdir():\n",
"logging.debug('Path does no... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Condition",
"For",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"self.password = self.password_field.get()\n",
"self.username = self.username_field.get()\n",
"self.destroy_window(self.win)\n"
] | [
"def setLoginInfo(self):...\n",
"self.password = self.password_field.get()\n",
"self.username = self.username_field.get()\n",
"self.destroy_window(self.win)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"VAR_27 = {}\n",
"for VAR_33, col in self.columns.items():\n",
"VAR_27[VAR_33] = col.get_display_name()\n",
"return VAR_27\n"
] | [
"def get_columns(self):...\n",
"result = {}\n",
"for col_name, col in self.columns.items():\n",
"result[col_name] = col.get_display_name()\n",
"return result\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def __add__(self, VAR_35):...\n",
"if isinstance(VAR_35, CLASS_12):\n",
"return CLASS_12(self.columns + VAR_35.columns)\n",
"return CLASS_12(self.columns + VAR_35)\n"
] | [
"def __add__(self, other):...\n",
"if isinstance(other, ColumnSet):\n",
"return ColumnSet(self.columns + other.columns)\n",
"return ColumnSet(self.columns + other)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = {'title': 'Test title', 'body': 'Test body', 'answer_body':\n 'Test answer', 'user': self.user_id}\n",
"\"\"\" Add test question\"\"\"\n",
"self.client.post('/api/v1/questions/', json=data, headers={'Authorization':\n 'JWT ' + self.token})\... | [
"def test_post_update(self):...\n",
"\"\"\"docstring\"\"\"\n",
"data = {'title': 'Test title', 'body': 'Test body', 'answer_body':\n 'Test answer', 'user': self.user_id}\n",
"\"\"\" Add test question\"\"\"\n",
"self.client.post('/api/v1/questions/', json=data, headers={'Authorization':\n 'JWT ' + self... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_22 = map(lambda x: int(x), VAR_13.split('-'))\n",
"return CLASS_0.INVALID_DATE\n",
"return VAR_23.isoformat()\n",
"VAR_23 = datetime.date(VAR_22[2], VAR_22[0], VAR_22[1])\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"pieces = map(lambda x: int(x), date.split('-'))\n",
"return Database.INVALID_DATE\n",
"return valid_date.isoformat()\n",
"valid_date = datetime.date(pieces[2], pieces[0], pieces[1])\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Return'",
"Return'",
"Assign'"
] |
[
"def FUNC_38(VAR_16, VAR_18):...\n",
"VAR_96 = set()\n",
"for VAR_7 in VAR_18:\n",
"VAR_53 = \"SELECT * FROM matches WHERE url='{}';\".format(VAR_7)\n",
"return VAR_96\n",
"VAR_54 = set(VAR_16.exec(VAR_53))\n",
"VAR_96 |= set(VAR_54)\n"
] | [
"def get_matches_from_urls(db, urls):...\n",
"matches = set()\n",
"for url in urls:\n",
"sql = \"SELECT * FROM matches WHERE url='{}';\".format(url)\n",
"return matches\n",
"res = set(db.exec(sql))\n",
"matches |= set(res)\n"
] | [
0,
0,
0,
4,
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"AugAssign'"
] |
[
"def FUNC_14(self, VAR_10=None, VAR_14=None, VAR_16=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self.add_extra_args(VAR_10)\n",
"self.args = super().parse_args(VAR_10=args)\n",
"self.opt = vars(self.args)\n",
"self.opt['parlai_home'] = self.parlai_home\n",
"if 'batchsize' in self.opt and self.opt['batchsi... | [
"def parse_args(self, args=None, namespace=None, print_args=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self.add_extra_args(args)\n",
"self.args = super().parse_args(args=args)\n",
"self.opt = vars(self.args)\n",
"self.opt['parlai_home'] = self.parlai_home\n",
"if 'batchsize' in self.opt and self.opt['bat... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"For",
"Condition",
"Co... |
[
"@VAR_0.route('/articles/', methods=['GET', 'POST'])...\n",
"return 0\n"
] | [
"@app.route('/articles/', methods=['GET', 'POST'])...\n",
"return 0\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_2(self, VAR_1):...\n",
"VAR_2 = self.connect()\n",
"VAR_3 = \"INSERT INTO crimes (description) VALUES ('{}');\".format(VAR_1)\n",
"VAR_2.close()\n",
"cursor.execute(VAR_3)\n",
"VAR_2.commit()\n"
] | [
"def add_input(self, data):...\n",
"connection = self.connect()\n",
"query = \"INSERT INTO crimes (description) VALUES ('{}');\".format(data)\n",
"connection.close()\n",
"cursor.execute(query)\n",
"connection.commit()\n"
] | [
0,
0,
4,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_32(self, VAR_81):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.shellcmd = VAR_81\n",
"return VAR_101\n"
] | [
"def shellcmd(self, cmd):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.shellcmd = cmd\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, VAR_7=5):...\n",
"super().reset_dut(['- TARGET: processing user reset request',\n '- BDI asserts HRESET', '- Reset JTAG controller passed',\n '- JTAG exists check passed', '- BDI removes HRESET',\n '- TARGET: resetting target passed',\n '- TARGET: processing target startup \\\\.\\\\.... | [
"def reset_dut(self, attempts=5):...\n",
"super().reset_dut(['- TARGET: processing user reset request',\n '- BDI asserts HRESET', '- Reset JTAG controller passed',\n '- JTAG exists check passed', '- BDI removes HRESET',\n '- TARGET: resetting target passed',\n '- TARGET: processing target startup \\\\... | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_26(VAR_20=None):...\n",
"return json.loads(VAR_7.get('/request', VAR_20=headers).body)\n"
] | [
"def call(headers=None):...\n",
"return json.loads(app.get('/request', headers=headers).body)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_7(self, VAR_2, VAR_1=None):...\n",
"self.filter_string = '{0} = {1}'.format(self.name, VAR_2)\n",
"return self.filter_string\n"
] | [
"def filter(self, value, op=None):...\n",
"self.filter_string = '{0} = {1}'.format(self.name, value)\n",
"return self.filter_string\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self, VAR_12, VAR_13, VAR_14):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_18 = VAR_14.lower()\n",
"return [VAR_11 for VAR_11 in VAR_13 if VAR_18 in VAR_11.name.lower()]\n"
] | [
"def filter(self, table, keypairs, filter_string):...\n",
"\"\"\"docstring\"\"\"\n",
"query = filter_string.lower()\n",
"return [keypair for keypair in keypairs if query in keypair.name.lower()]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_8, VAR_9, VAR_10):...\n",
"self.content = VAR_10\n",
"self.instance = VAR_8\n",
"self.user = VAR_9\n",
"super().__init__(VAR_8, VAR_9)\n"
] | [
"def __init__(self, course_instance, user, content):...\n",
"self.content = content\n",
"self.instance = course_instance\n",
"self.user = user\n",
"super().__init__(course_instance, user)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_24(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.master.connected:\n",
"self.client_list.append(self.master)\n",
"self.console.info(\"\"\"\nConnecting to nodes...\"\"\")\n",
"VAR_25 = [self.master.address, self.master.hostname]\n",
"VAR_26 = [n for n in self.node_list if n not in VAR_25]\n... | [
"def collect(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.master.connected:\n",
"self.client_list.append(self.master)\n",
"self.console.info(\"\"\"\nConnecting to nodes...\"\"\")\n",
"filters = [self.master.address, self.master.hostname]\n",
"nodes = [n for n in self.node_list if n not in filters]\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"AugAss... |
[
"def FUNC_26(VAR_20):...\n",
"api.reset_local_state()\n",
"return VAR_7.get('/request', VAR_20=headers).body\n"
] | [
"def call(headers):...\n",
"api.reset_local_state()\n",
"return app.get('/request', headers=headers).body\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@property...\n",
"if self._hosts is None:\n",
"self._hosts = set(self.hosts)\n",
"return self._hosts\n"
] | [
"@property...\n",
"if self._hosts is None:\n",
"self._hosts = set(self.hosts)\n",
"return self._hosts\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_4(VAR_0):...\n",
"VAR_0.clear_filters()\n",
"for arg in request.args:\n",
"VAR_8 = re.findall('_flt_(\\\\d)_(.*)', arg)\n",
"if VAR_8:\n",
"VAR_0.add_filter_index(VAR_8[0][1], int(VAR_8[0][0]), request.args.get(arg))\n"
] | [
"def get_filter_args(filters):...\n",
"filters.clear_filters()\n",
"for arg in request.args:\n",
"re_match = re.findall('_flt_(\\\\d)_(.*)', arg)\n",
"if re_match:\n",
"filters.add_filter_index(re_match[0][1], int(re_match[0][0]), request.args.\n get(arg))\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"For",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_7(VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = FUNC_0()\n",
"VAR_7 = VAR_6.cursor()\n",
"def FUNC_9():...\n",
"if VAR_4 == VAR_5:\n",
"VAR_14 = 'string' % (VAR_4, VAR_5, VAR_5, VAR_4)\n",
"VAR_7.execute(VAR_14)\n",
"if VAR_7.fetchone()[0] > 0:\n",
"FUNC_9()\n",
"VAR_7.exec... | [
"def reportMatch(winner, loser):...\n",
"\"\"\"docstring\"\"\"\n",
"c = connect()\n",
"cur = c.cursor()\n",
"def _checkPairing():...\n",
"if winner == loser:\n",
"q = (\n \"\"\"\n SELECT COUNT(*) FROM matches\n WHERE (matches.winner_id = %s AND matches.loser_id = %s)\n OR (... | [
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@contextmanager...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1, VAR_2 = CredClient().get_cred(VAR_0)\n",
"proxyfile.write(VAR_2)\n",
"proxyfile.write(VAR_1)\n",
"proxyfile.flush()\n",
"os.fsync(proxyfile.fileno())\n",
"yield proxyfile\n"
] | [
"@contextmanager...\n",
"\"\"\"docstring\"\"\"\n",
"cert, key = CredClient().get_cred(token)\n",
"proxyfile.write(key)\n",
"proxyfile.write(cert)\n",
"proxyfile.flush()\n",
"os.fsync(proxyfile.fileno())\n",
"yield proxyfile\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_0, VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"self.b_mgr.metrics = metrics.Metrics()\n",
"self.b_mgr.scores = []\n",
"self.run_example(VAR_0)\n",
"VAR_7 = self.b_mgr.metrics.data\n",
"for k in VAR_2:\n",
"if k != 'issues':\n",
"if 'issues' in VAR_2:\n",
"self.assertEqual(VAR_... | [
"def check_metrics(self, example_script, expect):...\n",
"\"\"\"docstring\"\"\"\n",
"self.b_mgr.metrics = metrics.Metrics()\n",
"self.b_mgr.scores = []\n",
"self.run_example(example_script)\n",
"m = self.b_mgr.metrics.data\n",
"for k in expect:\n",
"if k != 'issues':\n",
"if 'issues' in expect:\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Condition",
"Condition",
"Expr'",
"For",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def __hash__(self):...\n",
"return hash(tuple(self))\n"
] | [
"def __hash__(self):...\n",
"return hash(tuple(self))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_1):...\n",
"for key in VAR_6.__all__:\n",
"if not hasattr(VAR_1, key):\n",
"setattr(VAR_1, key, getattr(VAR_6, key))\n"
] | [
"def _include_filters(obj):...\n",
"for key in filters.__all__:\n",
"if not hasattr(obj, key):\n",
"setattr(obj, key, getattr(filters, key))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Expr'"
] |
[
"import abc\n",
"import logging\n",
"import urlparse\n",
"import datetime\n",
"import random\n",
"import yaml\n",
"import flask\n",
"from flask import request, session\n",
"from flask import abort, jsonify, redirect\n",
"from werkzeug.security import safe_str_cmp\n",
"from authomatic import Auth... | [
"import abc\n",
"import logging\n",
"import urlparse\n",
"import datetime\n",
"import random\n",
"import yaml\n",
"import flask\n",
"from flask import request, session\n",
"from flask import abort, jsonify, redirect\n",
"from werkzeug.security import safe_str_cmp\n",
"from authomatic import Auth... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
5,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Condition",
"Assi... |
[
"def FUNC_1(self):...\n",
"VAR_5 = build_graph(VAR_0)\n",
"self.assertDictEqual(VAR_5, VAR_1)\n"
] | [
"def test_build_graph(self):...\n",
"graph = build_graph(test_offers)\n",
"self.assertDictEqual(graph, expected_graph)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_25(self):...\n",
"return False\n"
] | [
"def is_anonymous(self):...\n",
"return False\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@staticmethod...\n",
"return 0\n"
] | [
"@staticmethod...\n",
"return 0\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"from django import template\n",
"from django.core.urlresolvers import reverse\n",
"from course.models import CourseInstance\n",
"VAR_0 = template.Library()\n",
"def FUNC_0(VAR_1, VAR_2, **VAR_3):...\n",
"VAR_5 = VAR_1.get_url_kwargs()\n",
"VAR_5.update({'model': VAR_2})\n",
"VAR_5.update(VAR_3)\n",
... | [
"from django import template\n",
"from django.core.urlresolvers import reverse\n",
"from course.models import CourseInstance\n",
"register = template.Library()\n",
"def _normal_kwargs(instance, model_name, **extra_kwargs):...\n",
"kwargs = instance.get_url_kwargs()\n",
"kwargs.update({'model': model_nam... | [
0,
4,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@route('POST', '/-test/log', VAR_1=website)...\n",
"VAR_0.info(get_http_argument('message'))\n"
] | [
"@route('POST', '/-test/log', website=website)...\n",
"LOGGER.info(get_http_argument('message'))\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_14(self, VAR_18):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_25 = self._eql_execute('volume', 'select', VAR_18['volume_name'],\n 'snapshot', 'create-now')\n",
"VAR_0.error(_('Failed to create snapshot of volume %s'), VAR_18['volume_name'])\n",
"VAR_9 = 'Snapshot name is '\n",
"VAR_45 = self._get_... | [
"def create_snapshot(self, snapshot):...\n",
"\"\"\"docstring\"\"\"\n",
"out = self._eql_execute('volume', 'select', snapshot['volume_name'],\n 'snapshot', 'create-now')\n",
"LOG.error(_('Failed to create snapshot of volume %s'), snapshot['volume_name'])\n",
"prefix = 'Snapshot name is '\n",
"snap_name... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"\"\"\"Login page.\"\"\"\n",
"import datetime\n",
"from config import local_config\n",
"from handlers import base_handler\n",
"from libs import auth\n",
"from libs import handler\n",
"from libs import helpers\n",
"from metrics import logs\n",
"VAR_0 = 14\n",
"\"\"\"Login page.\"\"\"\n",
"@handle... | [
"\"\"\"Login page.\"\"\"\n",
"import datetime\n",
"from config import local_config\n",
"from handlers import base_handler\n",
"from libs import auth\n",
"from libs import handler\n",
"from libs import helpers\n",
"from metrics import logs\n",
"SESSION_EXPIRY_DAYS = 14\n",
"\"\"\"Login page.\"\"\"\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"Condition",
"Docstring",
"Expr'",
"Expr'",
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
... |
[
"def FUNC_22(VAR_30, VAR_3):...\n",
"if not isinstance(VAR_30, _IOFile):\n",
"return IOFile(VAR_30, VAR_16=self)\n",
"return VAR_30.apply_wildcards(VAR_3, fill_missing=f in self.dynamic_input,\n fail_dynamic=self.dynamic_output)\n"
] | [
"def concretize_iofile(f, wildcards):...\n",
"if not isinstance(f, _IOFile):\n",
"return IOFile(f, rule=self)\n",
"return f.apply_wildcards(wildcards, fill_missing=f in self.dynamic_input,\n fail_dynamic=self.dynamic_output)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_9(self, VAR_14, VAR_13=None):...\n",
"return self.Command(os.path.join(self.path, 'bin'), VAR_14, VAR_13 or [])\n"
] | [
"def _create_command(self, executable, args=None):...\n",
"return self.Command(os.path.join(self.path, 'bin'), executable, args or [])\n"
] | [
0,
2
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_1):...\n",
"VAR_2 = urllib3.PoolManager(cert_reqs='CERT_REQUIRED', ca_certs=certifi.where()\n )\n",
"VAR_3 = VAR_2.request('GET', VAR_1)\n",
"VAR_4 = BeautifulSoup(VAR_3.data, 'lxml')\n",
"VAR_5 = [a.get('href') for a in VAR_4('a') if a.get('href')]\n",
"VAR_6 = [VAR_22 for VAR_22 in VA... | [
"def getytlinks(link):...\n",
"pm = urllib3.PoolManager(cert_reqs='CERT_REQUIRED', ca_certs=certifi.where())\n",
"html_page = pm.request('GET', link)\n",
"soup = BeautifulSoup(html_page.data, 'lxml')\n",
"links = [a.get('href') for a in soup('a') if a.get('href')]\n",
"new_links = [x for x in links if re.... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_19(self):...\n",
""
] | [
"def test_x_terminate_instances(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@renderer...\n",
"return CLASS_0(self.disclaimer_banner_file).render(VAR_5)\n"
] | [
"@renderer...\n",
"return DisclaimerElement(self.disclaimer_banner_file).render(request)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_31():...\n",
"VAR_24 = vim.eval('tagfiles()')\n",
"VAR_25 = VAR_0.getcwd()\n",
"return [VAR_0.path.join(VAR_25, x) for x in VAR_24]\n"
] | [
"def GetTagFiles():...\n",
"tag_files = vim.eval('tagfiles()')\n",
"current_working_directory = os.getcwd()\n",
"return [os.path.join(current_working_directory, x) for x in tag_files]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"from __future__ import unicode_literals\n",
"from django.db import models, migrations\n",
"VAR_0 = [('external_services', '0004_auto_20150828_1210')]\n",
"VAR_1 = [migrations.AddField(model_name='menuitem', name='menu_group_label',\n field=models.CharField(blank=True, null=True, max_length=32, help_text=\... | [
"from __future__ import unicode_literals\n",
"from django.db import models, migrations\n",
"dependencies = [('external_services', '0004_auto_20150828_1210')]\n",
"operations = [migrations.AddField(model_name='menuitem', name=\n 'menu_group_label', field=models.CharField(blank=True, null=True,\n max_leng... | [
0,
0,
0,
4
] | [
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'"
] |
[
"__author__ = 'Johannes Köster'\n",
"__copyright__ = 'Copyright 2015, Johannes Köster'\n",
"__email__ = 'koester@jimmy.harvard.edu'\n",
"__license__ = 'MIT'\n",
"import os\n",
"import re\n",
"import sys\n",
"import inspect\n",
"import sre_constants\n",
"from collections import defaultdict\n",
"f... | [
"__author__ = 'Johannes Köster'\n",
"__copyright__ = 'Copyright 2015, Johannes Köster'\n",
"__email__ = 'koester@jimmy.harvard.edu'\n",
"__license__ = 'MIT'\n",
"import os\n",
"import re\n",
"import sys\n",
"import inspect\n",
"import sre_constants\n",
"from collections import defaultdict\n",
"f... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"FunctionDef... |
[
"def FUNC_6(self, VAR_11):...\n",
"self.cursor.execute('string', (VAR_11,))\n",
"return self.cursor.fetchall()\n"
] | [
"def find_product_by_type(self, product_type):...\n",
"self.cursor.execute(\n \"\"\"\n SELECT *\n FROM product\n WHERE id IN (\n SELECT product_id\n FROM product_to_types\n WHERE product_type_id = %s\n )\n \"\"\... | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_10(self, VAR_16):...\n",
"self._WriteHeader('text/html')\n",
"self._WriteTemplate('header.html')\n",
"self.wfile.write('<div class=\"doc\">')\n",
"self.wfile.write('<div class=\"Breadcrumbs\">\\n')\n",
"self.wfile.write('<a class=\"Breadcrumbs-crumb\">%s</a>\\n' % self.path)\n",
"self.wfile.wr... | [
"def _DoDirListing(self, full_path):...\n",
"self._WriteHeader('text/html')\n",
"self._WriteTemplate('header.html')\n",
"self.wfile.write('<div class=\"doc\">')\n",
"self.wfile.write('<div class=\"Breadcrumbs\">\\n')\n",
"self.wfile.write('<a class=\"Breadcrumbs-crumb\">%s</a>\\n' % self.path)\n",
"self... | [
0,
0,
0,
0,
0,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
3,
3
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"For",
"For",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"For",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_3 = VAR_0.lower()\n",
"if VAR_3 in ('yes', 'true', 't', '1', 'y'):\n",
"return True\n",
"if VAR_3 in ('no', 'false', 'f', 'n', '0'):\n",
"return False\n"
] | [
"def str2bool(value):...\n",
"v = value.lower()\n",
"if v in ('yes', 'true', 't', '1', 'y'):\n",
"return True\n",
"if v in ('no', 'false', 'f', 'n', '0'):\n",
"return False\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"def FUNC_10(VAR_12, VAR_13, VAR_14):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_18 = b64decode(VAR_12)\n",
"VAR_19 = HybridRSA.decrypt(VAR_18, VAR_14)\n",
"VAR_7 = jwt.decode(VAR_19, VAR_13, algorithm='RS256')\n",
"return VAR_7\n"
] | [
"def unpackJWT(encoded_jwt, verify_key, decrypt_key):...\n",
"\"\"\"docstring\"\"\"\n",
"decoded = b64decode(encoded_jwt)\n",
"dec_token = HybridRSA.decrypt(decoded, decrypt_key)\n",
"token = jwt.decode(dec_token, verify_key, algorithm='RS256')\n",
"return token\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __init__(self):...\n",
""
] | [
"def __init__(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_0(self, VAR_0):...\n",
"VAR_8 = open(VAR_0, 'r')\n",
"self.mapType = VAR_8.readline().split(' ')[1]\n",
"self.mapHeight = int(VAR_8.readline().split(' ')[1])\n",
"self.mapWidth = int(VAR_8.readline().split(' ')[1])\n",
"assert VAR_8.readline().rstrip('\\n') == 'map', 'Unknown map format'\n",
"... | [
"def initialiseMapFromFile(self, filename):...\n",
"file = open(filename, 'r')\n",
"self.mapType = file.readline().split(' ')[1]\n",
"self.mapHeight = int(file.readline().split(' ')[1])\n",
"self.mapWidth = int(file.readline().split(' ')[1])\n",
"assert file.readline().rstrip('\\n') == 'map', 'Unknown map... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assert'",
"Assign'",
"For",
"Assign'",
"Assign'",
"For",
"Expr'",
"Assign'"
] |
[
"def __init__(self, VAR_5=None):...\n",
"self._factory = VAR_5 or FUNC_2()\n",
"self._contexts = self._factory()\n"
] | [
"def __init__(self, factory=None):...\n",
"self._factory = factory or default_context_factory()\n",
"self._contexts = self._factory()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def FUNC_27(VAR_10, VAR_11):...\n",
"VAR_29 = '%s?query=%s&queryIndex=%s' % (settings.FAST_LOOKUP_BASE_URL,\n urllib.parse.quote(VAR_10), VAR_11)\n",
"VAR_29 = '%s&queryReturn=%s&suggest=autoSubject' % (VAR_29, urllib.parse.\n quote('idroot,auth,type,%s' % VAR_11))\n",
"return VAR_29\n"
] | [
"def _build_fast_url(term, index):...\n",
"url = '%s?query=%s&queryIndex=%s' % (settings.FAST_LOOKUP_BASE_URL, urllib.\n parse.quote(term), index)\n",
"url = '%s&queryReturn=%s&suggest=autoSubject' % (url, urllib.parse.quote(\n 'idroot,auth,type,%s' % index))\n",
"return url\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_9, VAR_10, VAR_7, VAR_6, VAR_8, VAR_11=None, VAR_12=None...\n",
"self.model = VAR_9\n",
"self.field_name = VAR_10\n",
"self.label = VAR_11\n",
"self.render_function = VAR_12\n",
"self.order_field = None\n",
"self.order = None\n",
"if not self.field_name:\n",
"return\n",
"if... | [
"def __init__(self, model, field, column_id, query_params,...\n",
"self.model = model\n",
"self.field_name = field\n",
"self.label = label\n",
"self.render_function = render_function\n",
"self.order_field = None\n",
"self.order = None\n",
"if not self.field_name:\n",
"return\n",
"if self.field_nam... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition"
] |
[
"def FUNC_14(self):...\n",
"self.db.close()\n"
] | [
"def close(self):...\n",
"self.db.close()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"if not FUNC_0():\n",
"return VAR_1\n",
"VAR_6 = os.path.normpath(VAR_1).split(os.path.sep)\n",
"for VAR_14 in xrange(2, len(VAR_6)):\n",
"VAR_13 = os.path.sep.join(VAR_6[:VAR_14])\n",
"return os.path.normpath(os.path.sep.join(VAR_6))\n",
"if os.... | [
"def resolve_symlink(path):...\n",
"\"\"\"docstring\"\"\"\n",
"if not is_windows():\n",
"return path\n",
"parts = os.path.normpath(path).split(os.path.sep)\n",
"for i in xrange(2, len(parts)):\n",
"partial = os.path.sep.join(parts[:i])\n",
"return os.path.normpath(os.path.sep.join(parts))\n",
"if os... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Assert'",
"Assign'"
] |
[
"def FUNC_34(self, VAR_48):...\n",
"VAR_69, VAR_73 = self.delete('/mail/%s' % VAR_48)\n",
"return VAR_69\n"
] | [
"def delete_mail(self, mail_ident):...\n",
"res, req = self.delete('/mail/%s' % mail_ident)\n",
"return res\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_9(*VAR_13, **VAR_14):...\n",
"VAR_15 = 'memory alloced: %s kb' % str(gc.mem_alloc() / 1024)\n",
"VAR_16 = 'memory free: %s kb' % str(gc.mem_free() / 1024)\n",
"gc.collect()\n",
"VAR_17 = 'after collect: %s kb available' % str(gc.mem_free() / 1024)\n",
"print(FUNC_3(VAR_15, VAR_2='red'))\n",
"p... | [
"def wrapper(*args, **kwargs):...\n",
"memory_alloc = 'memory alloced: %s kb' % str(gc.mem_alloc() / 1024)\n",
"memory_free = 'memory free: %s kb' % str(gc.mem_free() / 1024)\n",
"gc.collect()\n",
"memory_after_collect = 'after collect: %s kb available' % str(gc.mem_free() /\n 1024)\n",
"print(rainbow(... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@VAR_8.command()...\n",
"\"\"\"docstring\"\"\"\n",
"if FUNC_0(VAR_9):\n",
"pgsql.complete_quest(VAR_3, VAR_12, True)\n",
"await VAR_9.send(VAR_5)\n"
] | [
"@bot.command()...\n",
"\"\"\"docstring\"\"\"\n",
"if whitelist_check(ctx):\n",
"pgsql.complete_quest(pg_connection, quest_id, True)\n",
"await ctx.send(permission_error_message)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_11(VAR_1, *VAR_8, **VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"if current_user.is_authenticated():\n",
"return redirect('/')\n",
"VAR_21 = FUNC_5(VAR_1)\n",
"if not VAR_21:\n",
"return redirect('/')\n",
"if not VAR_16.get(VAR_17(VAR_1.name) + '_autoregister', False):\n",
"return redirect(u... | [
"def signup_handler(remote, *args, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"if current_user.is_authenticated():\n",
"return redirect('/')\n",
"oauth_token = token_getter(remote)\n",
"if not oauth_token:\n",
"return redirect('/')\n",
"if not session.get(token_session_key(remote.name) + '_autoregis... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Expr'",
... |
[
"@command...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = None\n",
"if self.state.active_project:\n",
"VAR_4 = self.state.active_project.obj_id\n",
"if VAR_1:\n",
"VAR_5 = 0\n",
"VAR_4 = VAR_1[0]\n",
"if VAR_4:\n",
"VAR_11 = Project(VAR_4)\n",
"VAR_3 = wrapper.todoist.get_projects()\n",
"prnt('<', ... | [
"@command...\n",
"\"\"\"docstring\"\"\"\n",
"project_id = None\n",
"if self.state.active_project:\n",
"project_id = self.state.active_project.obj_id\n",
"if args:\n",
"pos = 0\n",
"project_id = args[0]\n",
"if project_id:\n",
"project = Project(project_id)\n",
"projects = wrapper.todoist.get_pro... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Return'",
"Expr'",
"Return'",
"Assign'",
"Expr'"
] |
[
"@classmethod...\n",
"return VAR_12.tool_jar_from_products(VAR_6, 'compiler-interface', VAR_12.\n options_scope)\n"
] | [
"@classmethod...\n",
"return cls.tool_jar_from_products(products, 'compiler-interface', cls.\n options_scope)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_4(VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"return psycopg2.connect(dbname=db_name)\n",
"print(e)\n"
] | [
"def setup_connection(db_name):...\n",
"\"\"\"docstring\"\"\"\n",
"return psycopg2.connect(dbname=db_name)\n",
"print(e)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'",
"Expr'"
] |
[
"def FUNC_16(VAR_23):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_58 = {}\n",
"if VAR_23:\n",
"for VAR_91, expansions in iteritems(VAR_23):\n",
"return VAR_23\n",
"VAR_90 = ', '.join([('%s (%d)' % expansion) for expansion in expansions])\n",
"VAR_58[VAR_91] = VAR_90\n"
] | [
"def _get_acronyms(acronyms):...\n",
"\"\"\"docstring\"\"\"\n",
"acronyms_str = {}\n",
"if acronyms:\n",
"for acronym, expansions in iteritems(acronyms):\n",
"return acronyms\n",
"expansions_str = ', '.join([('%s (%d)' % expansion) for expansion in\n expansions])\n",
"acronyms_str[acronym] = expans... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"For",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_2(VAR_87):...\n",
"return map(self._rules.__getitem__, filter(self.is_rule, VAR_87))\n"
] | [
"def rules(items):...\n",
"return map(self._rules.__getitem__, filter(self.is_rule, items))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_4(self, VAR_9=None):...\n",
"if VAR_9 is None:\n",
"VAR_9 = self\n",
"VAR_21 = VAR_20.path.join(self.parlai_home, 'data')\n",
"VAR_9.add_argument('-dp', '--datapath', default=default_data_path, help=\n 'path to datasets, defaults to {parlai_dir}/data')\n"
] | [
"def add_parlai_data_path(self, argument_group=None):...\n",
"if argument_group is None:\n",
"argument_group = self\n",
"default_data_path = os.path.join(self.parlai_home, 'data')\n",
"argument_group.add_argument('-dp', '--datapath', default=default_data_path,\n help='path to datasets, defaults to {parla... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@property...\n",
"VAR_28 = None\n",
"VAR_28 = self.request.headers.get('X-Session')\n",
"if VAR_28 is None:\n",
"VAR_28 = self.get_argument('x-session', default=None)\n",
"if VAR_28 is None:\n",
"return None\n",
"VAR_41 = GLSetting.sessions[VAR_28]\n",
"return None\n",
"return VAR_41\n"
] | [
"@property...\n",
"session_id = None\n",
"session_id = self.request.headers.get('X-Session')\n",
"if session_id is None:\n",
"session_id = self.get_argument('x-session', default=None)\n",
"if session_id is None:\n",
"return None\n",
"session = GLSetting.sessions[session_id]\n",
"return None\n",
"r... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Return'",
"Return'"
] |
[
"@app.route('/api/sequences/<id>', methods=['GET'])...\n",
"return controller.sequences.lookup(VAR_4).to_map()\n"
] | [
"@app.route('/api/sequences/<id>', methods=['GET'])...\n",
"return controller.sequences.lookup(id).to_map()\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_19(self, VAR_13):...\n",
"self.override_dialog.destroy()\n",
"self.filechooser_creation_dialog.destroy()\n"
] | [
"def on_cancel_button_clicked(self, widget):...\n",
"self.override_dialog.destroy()\n",
"self.filechooser_creation_dialog.destroy()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(self, VAR_6):...\n",
"if isinstance(VAR_6, CLASS_0):\n",
"VAR_6 = VAR_6.get_valid_dict()\n",
"if 'doctype' in VAR_6:\n",
"self.set('doctype', VAR_6.get('doctype'))\n",
"for VAR_7, VAR_9 in iteritems(VAR_6):\n",
"if self.get(VAR_7\n",
"self.set(VAR_7, VAR_9)\n"
] | [
"def update_if_missing(self, d):...\n",
"if isinstance(d, BaseDocument):\n",
"d = d.get_valid_dict()\n",
"if 'doctype' in d:\n",
"self.set('doctype', d.get('doctype'))\n",
"for key, value in iteritems(d):\n",
"if self.get(key\n",
"self.set(key, value)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"For",
"Condition",
"Expr'"
] |
[
"@FUNC_7...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_16.pop(VAR_17(VAR_1.name) + '_autoregister', None)\n",
"VAR_5 = FUNC_1(VAR_1, VAR_2)\n",
"VAR_19 = signup_handlers[VAR_1.name]\n",
"if not current_user.is_authenticated():\n",
"VAR_27 = VAR_19['info'](VAR_2)\n",
"if not VAR_5.remote_account.extra_data an... | [
"@oauth_error_handler...\n",
"\"\"\"docstring\"\"\"\n",
"session.pop(token_session_key(remote.name) + '_autoregister', None)\n",
"token = response_token_setter(remote, resp)\n",
"handlers = signup_handlers[remote.name]\n",
"if not current_user.is_authenticated():\n",
"account_info = handlers['info'](res... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
5
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Return'",
"Return'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@hook.command(autohelp=False)...\n",
"return FUNC_1(VAR_8, 'ban', VAR_4, VAR_5, VAR_1, VAR_6, VAR_7)\n"
] | [
"@hook.command(autohelp=False)...\n",
"return process_vote(inp, 'ban', chan, mask, db, notice, conn)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_17(self, VAR_10='_cores _nodes'.split()):...\n",
"VAR_23 = {name: res for name, res in self.resources.items() if name not in\n VAR_10}\n",
"VAR_24 = {name: value for name, value in self.params.items()}\n",
"VAR_25 = {'rule': self.rule.name, 'local': self.dag.workflow.is_local(self.\n rule), 'i... | [
"def properties(self, omit_resources='_cores _nodes'.split()):...\n",
"resources = {name: res for name, res in self.resources.items() if name not in\n omit_resources}\n",
"params = {name: value for name, value in self.params.items()}\n",
"properties = {'rule': self.rule.name, 'local': self.dag.workflow.is_... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@compiles(DropTable, 'postgresql')...\n",
"return VAR_2.visit_drop_table(VAR_1) + ' CASCADE'\n"
] | [
"@compiles(DropTable, 'postgresql')...\n",
"return compiler.visit_drop_table(element) + ' CASCADE'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_8):...\n",
"self.cursor = VAR_8\n"
] | [
"def __init__(self, cursor):...\n",
"self.cursor = cursor\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_16(self, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"for o in self.products:\n",
"if o.match(VAR_15):\n",
"return False\n",
"return True\n"
] | [
"def is_producer(self, requested_output):...\n",
"\"\"\"docstring\"\"\"\n",
"for o in self.products:\n",
"if o.match(requested_output):\n",
"return False\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Condition",
"Return'",
"Return'"
] |
[
"@api.multi...\n",
"\"\"\"docstring\"\"\"\n",
"self.ensure_one()\n",
"VAR_49 = self.env['account.move.line']\n",
"VAR_50 = VAR_49.search([('partner_id', '=', self.id), ('account_id.code',\n '=', '1050'), ('credit', '>', '0'), ('full_reconcile_id', '=', False)])\n",
"VAR_51 = 0\n",
"for move_line in V... | [
"@api.multi...\n",
"\"\"\"docstring\"\"\"\n",
"self.ensure_one()\n",
"mv_line_obj = self.env['account.move.line']\n",
"move_line_ids = mv_line_obj.search([('partner_id', '=', self.id), (\n 'account_id.code', '=', '1050'), ('credit', '>', '0'), (\n 'full_reconcile_id', '=', False)])\n",
"res = 0\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"For",
"AugAssign'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"VAR_0 = requests.get('http://127.0.0.1:5000/profiles')\n",
"self.assertEqual(VAR_0.status_code, 200)\n",
"self.assertIsNotNone(VAR_0.text)\n",
"VAR_1 = json.loads(VAR_0.text)\n",
"for user in VAR_1:\n",
"if user['id'] != 191:\n",
"VAR_0 = requests.delete('http://127.0.0.1:50... | [
"def test_e_del_user(self):...\n",
"resp = requests.get('http://127.0.0.1:5000/profiles')\n",
"self.assertEqual(resp.status_code, 200)\n",
"self.assertIsNotNone(resp.text)\n",
"users = json.loads(resp.text)\n",
"for user in users:\n",
"if user['id'] != 191:\n",
"resp = requests.delete('http://127.0.0.... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"\"\"\"string\"\"\"\n",
"from io import BytesIO\n",
"from datetime import datetime, timedelta\n",
"from telebot import types\n",
"import requests\n",
"from photogpsbot import bot, log, log_files, db, User, users, messages, machine\n",
"from photogpsbot.process_image import ImageHandler\n",
"from photo... | [
"\"\"\"\nSmall bot for Telegram that receives your photo and returns you map where\nit was taken.\nWritten by Aleksandr Mikheev.\nhttps://github.com/RandyRomero/photogpsbot\n\nThis specific module contains methods to respond user messages, to make\ninteractive menus, to handle user language, to process user images\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Assign'"
] |
[
"@wraps(VAR_1)...\n",
"VAR_17 = make_response(VAR_1(*VAR_6, **kwargs))\n",
"VAR_17.headers['Last-Modified'] = datetime.now()\n",
"VAR_17.headers['Cache-Control'\n ] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0'\n",
"VAR_17.headers['Pragma'] = 'no-cache'\n",
"VAR_17.heade... | [
"@wraps(view)...\n",
"response = make_response(view(*args, **kwargs))\n",
"response.headers['Last-Modified'] = datetime.now()\n",
"response.headers['Cache-Control'\n ] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0'\n",
"response.headers['Pragma'] = 'no-cache'\n",
"respons... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.