lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_2(self):...\n",
"VAR_7 = Pa11yCrawler('')\n",
"self.assertEqual(VAR_7.cmd, self._expected_command(VAR_7.pa11y_report_dir,\n VAR_7.start_urls))\n"
] | [
"def test_default(self):...\n",
"suite = Pa11yCrawler('')\n",
"self.assertEqual(suite.cmd, self._expected_command(suite.pa11y_report_dir,\n suite.start_urls))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_12(VAR_35):...\n",
"return VAR_35.format(host=url.host, date=datetime.utcnow().isoformat(),\n VAR_30=seqnum)\n"
] | [
"def formatOutput(p):...\n",
"return p.format(host=url.host, date=datetime.utcnow().isoformat(), seqnum=\n seqnum)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"self.parser = Parser()\n"
] | [
"def setUp(self):...\n",
"self.parser = Parser()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_4(self, VAR_8):...\n",
"VAR_0.info('Handling daily repeating event')\n",
"VAR_16 = datetime.strptime(VAR_8.date_end, '%Y-%m-%d %H:%M:00')\n",
"VAR_17 = datetime.now()\n",
"if VAR_17 >= VAR_16:\n",
"VAR_10 = datetime.strptime(VAR_8.date_begin, '%Y-%m-%d %H:%M:00'\n ) + relativedelta(days=+1)\n... | [
"def _handle_daily_event_repetition(self, old_repeating_event):...\n",
"_logger.info('Handling daily repeating event')\n",
"end_date = datetime.strptime(old_repeating_event.date_end, '%Y-%m-%d %H:%M:00')\n",
"present = datetime.now()\n",
"if present >= end_date:\n",
"new_start_date = datetime.strptime(old... | [
0,
0,
6,
0,
0,
6,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_18(self, VAR_28: str) ->UserDTO:...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = UserDTO()\n",
"VAR_19.id = self.id\n",
"VAR_19.username = self.username\n",
"VAR_19.role = UserRole(self.role).name\n",
"VAR_19.mapping_level = MappingLevel(self.mapping_level).name\n",
"VAR_19.is_expert = self.is_e... | [
"def as_dto(self, logged_in_username: str) ->UserDTO:...\n",
"\"\"\"docstring\"\"\"\n",
"user_dto = UserDTO()\n",
"user_dto.id = self.id\n",
"user_dto.username = self.username\n",
"user_dto.role = UserRole(self.role).name\n",
"user_dto.mapping_level = MappingLevel(self.mapping_level).name\n",
"user_dt... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"... |
[
"\"\"\"Volume driver for Dell EqualLogic Storage.\"\"\"\n",
"import functools\n",
"import random\n",
"import eventlet\n",
"from eventlet import greenthread\n",
"import greenlet\n",
"from oslo.config import cfg\n",
"from cinder import exception\n",
"from cinder.openstack.common import excutils\n",
... | [
"\"\"\"Volume driver for Dell EqualLogic Storage.\"\"\"\n",
"import functools\n",
"import random\n",
"import eventlet\n",
"from eventlet import greenthread\n",
"import greenlet\n",
"from oslo.config import cfg\n",
"from cinder import exception\n",
"from cinder.openstack.common import excutils\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
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Conditi... |
[
"def FUNC_19(self, VAR_18, VAR_24):...\n",
"\"\"\"docstring\"\"\"\n",
"if type(VAR_18) == str:\n",
"VAR_18 = self.locate(VAR_18)\n",
"def FUNC_26(VAR_51, VAR_52):...\n",
"if not VAR_18:\n",
"for sub_ in VAR_51.sub_items:\n",
"return False\n",
"FUNC_26(sub_, VAR_52)\n",
"VAR_51.owner = VAR_52\n",
... | [
"def chown(self, item, owner):...\n",
"\"\"\"docstring\"\"\"\n",
"if type(item) == str:\n",
"item = self.locate(item)\n",
"def _chown_recursive(item_, owner_):...\n",
"if not item:\n",
"for sub_ in item_.sub_items:\n",
"return False\n",
"_chown_recursive(sub_, owner_)\n",
"item_.owner = owner_\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"FunctionDef'",
"Condition",
"For",
"Return'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_13(self):...\n",
"VAR_11 = {}\n",
"for VAR_12 in self.parent_groups:\n",
"VAR_11[VAR_12.name] = VAR_12\n",
"return VAR_11\n",
"VAR_11.update(VAR_12._get_ancestors())\n"
] | [
"def _get_ancestors(self):...\n",
"results = {}\n",
"for g in self.parent_groups:\n",
"results[g.name] = g\n",
"return results\n",
"results.update(g._get_ancestors())\n"
] | [
0,
1,
0,
1,
1,
1
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'"
] |
[
"from __future__ import absolute_import\n",
"import os\n",
"from pony.orm import db_session\n",
"from six.moves import xrange\n",
"from twisted.internet.defer import inlineCallbacks\n",
"from Tribler.Core.Modules.MetadataStore.OrmBindings.channel_node import NEW\n",
"from Tribler.Core.Modules.MetadataSt... | [
"from __future__ import absolute_import\n",
"import os\n",
"from pony.orm import db_session\n",
"from six.moves import xrange\n",
"from twisted.internet.defer import inlineCallbacks\n",
"from Tribler.Core.Modules.MetadataStore.OrmBindings.channel_node import NEW\n",
"from Tribler.Core.Modules.MetadataSt... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'... |
[
"def FUNC_1(VAR_1):...\n",
"VAR_8 = ['gif', 'png', 'jpg']\n",
"if VAR_1[-3:].lower() in VAR_8:\n",
"return VAR_1\n",
"return 'http://ic.pics.livejournal.com/masio/8221809/287143/287143_original.gif'\n"
] | [
"def validate_image(image):...\n",
"checklist = ['gif', 'png', 'jpg']\n",
"if image[-3:].lower() in checklist:\n",
"return image\n",
"return 'http://ic.pics.livejournal.com/masio/8221809/287143/287143_original.gif'\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"@user_passes_test(user_is_staff)...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = []\n",
"VAR_6 = ''\n",
"VAR_7 = VAR_0.GET.get('level', '')\n",
"if VAR_7 == 'project':\n",
"create_testcases_celery(VAR_1, call_from='OldTC')\n",
"if VAR_7 == 'module':\n",
"VAR_4 = context_testcases()\n",
"VAR_18 = get_o... | [
"@user_passes_test(user_is_staff)...\n",
"\"\"\"docstring\"\"\"\n",
"testcases = []\n",
"link_id = ''\n",
"level = request.GET.get('level', '')\n",
"if level == 'project':\n",
"create_testcases_celery(object_id, call_from='OldTC')\n",
"if level == 'module':\n",
"context = context_testcases()\n",
"... | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_16(self, VAR_20):...\n",
""
] | [
"def form_valid(self, form):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"self.common.terminate_connection(VAR_7, VAR_10['host'], VAR_10['initiator'])\n",
"self.common.client_logout()\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"\"\"\"docstring\"\"\"\n",
"self.common.client_login()\n",
"self.common.terminate_connection(volume, connector['host'], connector[\n 'initiator'])\n",
"self.common.client_logout()\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(self, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_16 = []\n",
"for VAR_2 in VAR_4.__path__:\n",
"if os.path.isdir(VAR_2):\n",
"return VAR_16\n",
"VAR_16.extend(self._find_modules_in_path(VAR_2, VAR_5))\n"
] | [
"def _load_modules(self, package, submod):...\n",
"\"\"\"docstring\"\"\"\n",
"modules = []\n",
"for path in package.__path__:\n",
"if os.path.isdir(path):\n",
"return modules\n",
"modules.extend(self._find_modules_in_path(path, submod))\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_13(self, VAR_1):...\n",
"VAR_19 = 80\n",
"VAR_20 = ''\n",
"for line in VAR_1.splitlines():\n",
"VAR_20 = VAR_20 + fill(line, VAR_19, replace_whitespace=False) + '\\n'\n",
"return VAR_20\n"
] | [
"def _fmt_msg(self, msg):...\n",
"width = 80\n",
"_fmt = ''\n",
"for line in msg.splitlines():\n",
"_fmt = _fmt + fill(line, width, replace_whitespace=False) + '\\n'\n",
"return _fmt\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7, VAR_12 = self.make_xsrf_handling_app()\n",
"VAR_17 = VAR_7.get('/request').body\n",
"VAR_7.post('/request', {'xsrf_token': VAR_17})\n",
"self.assertEqual([('POST', True)], VAR_12)\n"
] | [
"def test_xsrf_token_post_param(self):...\n",
"\"\"\"docstring\"\"\"\n",
"app, calls = self.make_xsrf_handling_app()\n",
"token = app.get('/request').body\n",
"app.post('/request', {'xsrf_token': token})\n",
"self.assertEqual([('POST', True)], calls)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@app.route('/articles')...\n",
"VAR_4 = FUNC_0('Article')\n",
"return render_template('articles.html', allarticles=results)\n"
] | [
"@app.route('/articles')...\n",
"results = get_table_dict('Article')\n",
"return render_template('articles.html', allarticles=results)\n"
] | [
0,
4,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_3(VAR_1):...\n",
"return frappe.db.get_value('Blog Category', {'name': VAR_1}, 'title') or VAR_1\n"
] | [
"def get_blog_category(route):...\n",
"return frappe.db.get_value('Blog Category', {'name': route}, 'title') or route\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(self):...\n",
"self.run_test_case(self.scenario.create_app())\n"
] | [
"def test_a_create_app(self):...\n",
"self.run_test_case(self.scenario.create_app())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_17(self):...\n",
"self.connections.remove(self)\n"
] | [
"def on_close(self):...\n",
"self.connections.remove(self)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_18(self, VAR_14):...\n",
""
] | [
"def is_relation_many_to_one(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_16(self, **VAR_17):...\n",
"\"\"\"docstring\"\"\"\n",
"self.set_defaults(**kwargs)\n",
"for VAR_42, VAR_3 in VAR_17.items():\n",
"self.overridable[VAR_42] = VAR_3\n"
] | [
"def set_params(self, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"self.set_defaults(**kwargs)\n",
"for k, v in kwargs.items():\n",
"self.overridable[k] = v\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"For",
"Assign'"
] |
[
"def FUNC_1(self, VAR_10, VAR_11, VAR_12):...\n",
"fd.write(VAR_12)\n",
"fd.flush()\n",
"fd.seek(0)\n",
"VAR_35 = os.path.basename(fd.name)\n",
"if self.shouldLog:\n",
"self.logger.debug('Sending file %s with mime type : %s', VAR_35, VAR_11)\n",
"VAR_30 = self.session.post(self.uploadUrl, files={self.... | [
"def uploadFile(self, suffix, mime, payload):...\n",
"fd.write(payload)\n",
"fd.flush()\n",
"fd.seek(0)\n",
"filename = os.path.basename(fd.name)\n",
"if self.shouldLog:\n",
"self.logger.debug('Sending file %s with mime type : %s', filename, mime)\n",
"fu = self.session.post(self.uploadUrl, files={sel... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"AugAssign'",
"Condition",
"Condition",
"Return'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_16(self, VAR_10=True):...\n",
"VAR_25 = self.get_dvd_device()\n",
"VAR_17 = shellutil.run('cdcontrol -f {0} eject'.format(VAR_25))\n",
"if VAR_10 and VAR_17 != 0:\n"
] | [
"def eject_dvd(self, chk_err=True):...\n",
"dvd = self.get_dvd_device()\n",
"retcode = shellutil.run('cdcontrol -f {0} eject'.format(dvd))\n",
"if chk_err and retcode != 0:\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition"
] |
[
"from DateTime.DateTime import DateTime\n",
"from Products.PageTemplates.PageTemplateFile import PageTemplateFile\n",
"from Persistence import Persistent\n",
"from Acquisition import Implicit\n",
"import OFS.SimpleItem, OFS.ObjectManager\n",
"import zope.interface\n",
"import IZMSDaemon\n",
"__doc__ =... | [
"from DateTime.DateTime import DateTime\n",
"from Products.PageTemplates.PageTemplateFile import PageTemplateFile\n",
"from Persistence import Persistent\n",
"from Acquisition import Implicit\n",
"import OFS.SimpleItem, OFS.ObjectManager\n",
"import zope.interface\n",
"import IZMSDaemon\n",
"__doc__ =... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(VAR_9, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_10 = urlencode(VAR_10)\n",
"VAR_21 = requests.get('http://%s/solr/biblio/select?%s' % (VAR_9, VAR_10))\n",
"return VAR_21.json()\n"
] | [
"def get_solr_result(index, params):...\n",
"\"\"\"docstring\"\"\"\n",
"params = urlencode(params)\n",
"result = requests.get('http://%s/solr/biblio/select?%s' % (index, params))\n",
"return result.json()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(VAR_3):...\n",
"return VAR_3 if VAR_3 and VAR_4.match(VAR_3) else None\n"
] | [
"def chkpass(x):...\n",
"return x if x and pass_rx.match(x) else None\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1():...\n",
"VAR_2.set('user:ids', '0')\n"
] | [
"def auth_init():...\n",
"db.set('user:ids', '0')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"\"\"\"string\"\"\"\n",
"from hp3parclient import exceptions as hpexceptions\n",
"from oslo.config import cfg\n",
"from cinder import exception\n",
"from cinder.openstack.common import log as logging\n",
"from cinder import utils\n",
"import cinder.volume.driver\n",
"from cinder.volume.drivers.san.hp ... | [
"\"\"\"\nVolume driver for HP 3PAR Storage array.\nThis driver requires 3.1.2 MU2 firmware on the 3PAR array.\n\nYou will need to install the python hp3parclient.\nsudo pip install hp3parclient\n\nSet the following in the cinder.conf file to enable the\n3PAR Fibre Channel Driver along with the required flags:\n\nvo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"FunctionDef'",
"Return'"
] |
[
"@staticmethod...\n",
"VAR_14 = mongo.db.analysis.find(VAR_4, sort=[('_id', pymongo.DESCENDING)])\n",
"return [VAR_5 for VAR_5 in VAR_14]\n"
] | [
"@staticmethod...\n",
"cursor = mongo.db.analysis.find(filters, sort=[('_id', pymongo.DESCENDING)])\n",
"return [report for report in cursor]\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_8):...\n",
"self.spdx = VAR_8\n",
"self.lasttok = None\n",
"self.lastid = None\n",
"self.lexer = lex.lex(module=self, reflags=re.UNICODE)\n",
"self.parser = yacc.yacc(module=self, write_tables=False, debug=False)\n",
"self.lines_checked = 0\n",
"self.checked = 0\n",
"self.spd... | [
"def __init__(self, spdx):...\n",
"self.spdx = spdx\n",
"self.lasttok = None\n",
"self.lastid = None\n",
"self.lexer = lex.lex(module=self, reflags=re.UNICODE)\n",
"self.parser = yacc.yacc(module=self, write_tables=False, debug=False)\n",
"self.lines_checked = 0\n",
"self.checked = 0\n",
"self.spdx_... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_4(VAR_6):...\n",
"VAR_7 = HttpResponse(VAR_6)\n",
"VAR_7['Access-Control-Allow-Origin'] = '*'\n",
"return VAR_7\n"
] | [
"def respond_text(text):...\n",
"response = HttpResponse(text)\n",
"response['Access-Control-Allow-Origin'] = '*'\n",
"return response\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"__author__ = 'Johannes Köster'\n",
"__copyright__ = 'Copyright 2015, Johannes Köster'\n",
"__email__ = 'koester@jimmy.harvard.edu'\n",
"__license__ = 'MIT'\n",
"import re\n",
"import os\n",
"import sys\n",
"import signal\n",
"import json\n",
"import urllib\n",
"from collections import OrderedDi... | [
"__author__ = 'Johannes Köster'\n",
"__copyright__ = 'Copyright 2015, Johannes Köster'\n",
"__email__ = 'koester@jimmy.harvard.edu'\n",
"__license__ = 'MIT'\n",
"import re\n",
"import os\n",
"import sys\n",
"import signal\n",
"import json\n",
"import urllib\n",
"from collections import OrderedDi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
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'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
... |
[
"def FUNC_4(VAR_6, VAR_7, VAR_8):...\n",
"VAR_12 = f\"\"\"\n INSERT INTO {VAR_1} (user_id, product_id, quantity)\n VALUES({VAR_6}, {VAR_7}, {VAR_8['quantity']})\n \"\"\"\n",
"VAR_14 = create_connection()\n",
"VAR_14.close()\n",
"VAR_15 = VAR_14.cursor()\n",
"VAR_15.execute... | [
"def add_product_to_cart(userId, productId, cart):...\n",
"sql_query = f\"\"\"\n INSERT INTO {CARTS_TABLE} (user_id, product_id, quantity)\n VALUES({userId}, {productId}, {cart['quantity']})\n \"\"\"\n",
"connection = create_connection()\n",
"connection.close()\n",
"cursor =... | [
0,
4,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"self.log.debug('Clearing our auth records')\n",
"def FUNC_23(VAR_33, VAR_13, VAR_20, VAR_21, VAR_12):...\n",
"if VAR_21 == wzrpc.status.success:\n",
"self.log.debug('Auth records on router were cleared')\n",
"self.log.warn('Status %s, passing', wzrpc.name_status(VAR_21))\n",
"... | [
"def clear_auth(self):...\n",
"self.log.debug('Clearing our auth records')\n",
"def accept(that, reqid, seqnum, status, data):...\n",
"if status == wzrpc.status.success:\n",
"self.log.debug('Auth records on router were cleared')\n",
"self.log.warn('Status %s, passing', wzrpc.name_status(status))\n",
"re... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_1(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = FUNC_0(VAR_0)\n",
"VAR_3 = os.listdir(VAR_2)\n",
"VAR_4 = []\n",
"VAR_5 = re.compile('\\\\b\\\\d{14}\\\\b')\n",
"for VAR_13 in VAR_3:\n",
"return VAR_4\n",
"VAR_18 = codecs.open(os.path.join(VAR_2, VAR_13), encoding='utf-8', errors=\n ... | [
"def get_all_files(window):...\n",
"\"\"\"docstring\"\"\"\n",
"path = get_path(window)\n",
"files = os.listdir(path)\n",
"urtext_files = []\n",
"regexp = re.compile('\\\\b\\\\d{14}\\\\b')\n",
"for file in files:\n",
"return urtext_files\n",
"f = codecs.open(os.path.join(path, file), encoding='utf-8'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Return'",
"Assign'",
"Expr'",
"For",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = []\n",
"VAR_7 = self.pool.get('ir.model.data')\n",
"VAR_8 = self.pool.get('res.users').browse(VAR_2, VAR_3, VAR_3).company_id.id\n",
"VAR_9 = self.pool.get('account.bank.statement')\n",
"VAR_10 = self.pool.get('ir.... | [
"def open_statement(self, cr, uid, ids, context):...\n",
"\"\"\"docstring\"\"\"\n",
"list_statement = []\n",
"mod_obj = self.pool.get('ir.model.data')\n",
"company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id\n",
"statement_obj = self.pool.get('account.bank.statement')\n",
"sequenc... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
... |
[
"def FUNC_22(self, VAR_21, VAR_40):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_57 = self.getfile(VAR_21)\n",
"if VAR_57 == False:\n",
"VAR_57[VAR_6] = FUNC_30.S_IFMT(VAR_57[VAR_6]) | VAR_40\n"
] | [
"def chmod(self, path, perm):...\n",
"\"\"\"docstring\"\"\"\n",
"p = self.getfile(path)\n",
"if p == False:\n",
"p[A_MODE] = stat.S_IFMT(p[A_MODE]) | perm\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'"
] |
[
"from django.conf.urls import url\n",
"from .django_views import email_confirmation_redirect, login_redirect, experience_redirect, profile_redirect, root_redirect, aasa_redirect\n",
"VAR_0 = [url('^redirects/people/me/email-confirmation$',\n email_confirmation_redirect, name='email-confirmation-redirect'), u... | [
"from django.conf.urls import url\n",
"from .django_views import email_confirmation_redirect, login_redirect, experience_redirect, profile_redirect, root_redirect, aasa_redirect\n",
"urlpatterns = [url('^redirects/people/me/email-confirmation$',\n email_confirmation_redirect, name='email-confirmation-redirec... | [
0,
6,
6
] | [
"ImportFrom'",
"ImportFrom'",
"Assign'"
] |
[
"def FUNC_6(self, VAR_33):...\n",
"if not VAR_33:\n",
"VAR_101.errors.add(self.error)\n",
"VAR_33 = float(VAR_33)\n",
"VAR_101.errors.add(self.error)\n",
"return\n",
"if self.min is not None and VAR_33 < self.min:\n",
"VAR_33 = self.min\n",
"if self.max is not None and VAR_33 > self.max:\n",
"retu... | [
"def run(self, val):...\n",
"if not val:\n",
"c.errors.add(self.error)\n",
"val = float(val)\n",
"c.errors.add(self.error)\n",
"return\n",
"if self.min is not None and val < self.min:\n",
"val = self.min\n",
"if self.max is not None and val > self.max:\n",
"return val\n",
"val = self.max\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_1(self):...\n",
"VAR_2 = self.get_secure_cookie('sid')\n",
"if not VAR_2:\n",
"return False\n",
"VAR_3 = self.session.get('email')\n",
"VAR_4 = dbapi.User()\n",
"if VAR_3 and VAR_4.get_user(VAR_3) == 0:\n",
"VAR_7 = VAR_4.get_user_all(VAR_3)\n",
"self.clear_cookies()\n",
"if VAR_7:\n",
... | [
"def check(self):...\n",
"sid = self.get_secure_cookie('sid')\n",
"if not sid:\n",
"return False\n",
"email = self.session.get('email')\n",
"user = dbapi.User()\n",
"if email and user.get_user(email) == 0:\n",
"profile = user.get_user_all(email)\n",
"self.clear_cookies()\n",
"if profile:\n",
"re... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@VAR_7.route('/view-calendar', methods=['GET', 'POST'])...\n",
"VAR_10 = FUNC_0()\n",
"if not VAR_10:\n",
"return 'Unauthorized'\n",
"VAR_13 = request.args.get('calendar')\n",
"if VAR_13 is None:\n",
"return 'Must provide a calendar id'\n",
"VAR_8, VAR_3 = FUNC_1()\n",
"if request.method == 'GET':\... | [
"@app.route('/view-calendar', methods=['GET', 'POST'])...\n",
"isAuthorized = isUserAuthorized()\n",
"if not isAuthorized:\n",
"return 'Unauthorized'\n",
"id = request.args.get('calendar')\n",
"if id is None:\n",
"return 'Must provide a calendar id'\n",
"username, password = getUsernameAndPassword()\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"@functools.wraps(VAR_1)...\n",
"if g.user is None:\n",
"return redirect(url_for('auth.login'))\n",
"if g.user['admin'] != 1:\n",
"return redirect(url_for('blog.feedpage', VAR_3=0))\n",
"return VAR_1(**kwargs)\n"
] | [
"@functools.wraps(view)...\n",
"if g.user is None:\n",
"return redirect(url_for('auth.login'))\n",
"if g.user['admin'] != 1:\n",
"return redirect(url_for('blog.feedpage', page=0))\n",
"return view(**kwargs)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_11(self):...\n",
"return True\n"
] | [
"def use_client_cert_auth(self):...\n",
"return True\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@functools.wraps(VAR_3)...\n",
"VAR_23 = VAR_5.pop('timeout', None)\n",
"VAR_24 = eventlet.spawn(VAR_3, self, *VAR_4, **kwargs)\n",
"if VAR_23 is None:\n",
"return VAR_24.wait()\n",
"VAR_36 = eventlet.spawn_after(VAR_23, VAR_24.kill)\n",
"VAR_48 = VAR_24.wait()\n",
"VAR_36.cancel()\n",
"return VAR_... | [
"@functools.wraps(f)...\n",
"timeout = kwargs.pop('timeout', None)\n",
"gt = eventlet.spawn(f, self, *args, **kwargs)\n",
"if timeout is None:\n",
"return gt.wait()\n",
"kill_thread = eventlet.spawn_after(timeout, gt.kill)\n",
"res = gt.wait()\n",
"kill_thread.cancel()\n",
"return res\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_22(self):...\n",
"self.assertEqual('', sys.stdin.read())\n",
"print('garbage', file=sys.stdout)\n",
"print('garbage', file=sys.stderr)\n"
] | [
"def test_stdio_as_dev_null(self):...\n",
"self.assertEqual('', sys.stdin.read())\n",
"print('garbage', file=sys.stdout)\n",
"print('garbage', file=sys.stderr)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@VAR_0.route('/')...\n",
""
] | [
"@app.route('/')...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.get(self.section, 'static_dir')\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.get(self.section, 'static_dir')\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"VAR_83 = []\n",
"if self.rate_user and VAR_101.user_is_loggedin:\n",
"VAR_83.append('user' + VAR_100(VAR_101.user._id36))\n",
"if self.rate_ip:\n",
"VAR_83.append('ip' + VAR_100(VAR_102.ip))\n",
"VAR_84 = cache.get_multi(VAR_83, self.prefix)\n",
"if VAR_84:\n",
"VAR_87 = V... | [
"def run(self):...\n",
"to_check = []\n",
"if self.rate_user and c.user_is_loggedin:\n",
"to_check.append('user' + str(c.user._id36))\n",
"if self.rate_ip:\n",
"to_check.append('ip' + str(request.ip))\n",
"r = cache.get_multi(to_check, self.prefix)\n",
"if r:\n",
"expire_time = max(r.values())\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, *VAR_20, **VAR_21):...\n",
"FlaskForm.__init__(self, *VAR_20, **kwargs)\n",
"self.user = None\n"
] | [
"def __init__(self, *args, **kwargs):...\n",
"FlaskForm.__init__(self, *args, **kwargs)\n",
"self.user = None\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_12(self, VAR_16='svc'):...\n",
"VAR_22 = {VAR_20: key for key, VAR_20 in self.modes.items()}\n",
"VAR_32 = VAR_22[VAR_16]\n",
"VAR_31 = int(self.get_register_value('cpsr', 'CPU', None), base=16)\n",
"self.set_register_value('cpsr', 'CPU', None, hex(int(str(bin(VAR_31))[:-5] +\n VAR_32, base=2))... | [
"def set_mode(self, mode='svc'):...\n",
"modes = {value: key for key, value in self.modes.items()}\n",
"mask = modes[mode]\n",
"cpsr = int(self.get_register_value('cpsr', 'CPU', None), base=16)\n",
"self.set_register_value('cpsr', 'CPU', None, hex(int(str(bin(cpsr))[:-5] +\n mask, base=2)))\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"VAR_1 = []\n",
"VAR_2 = sqlite3.connect('brewdie.db')\n",
"print('Something went wrong')\n",
"if VAR_2:\n",
"return VAR_1\n",
"VAR_3 = VAR_2.cursor()\n",
"print(e)\n",
"VAR_2.close()\n",
"for row in VAR_3.execute('SELECT * FROM Recipes'):\n",
"if VAR_2:\n",
"VAR_0 = ... | [
"def load_recipes(self):...\n",
"recipes = []\n",
"connection = sqlite3.connect('brewdie.db')\n",
"print('Something went wrong')\n",
"if connection:\n",
"return recipes\n",
"cursor = connection.cursor()\n",
"print(e)\n",
"connection.close()\n",
"for row in cursor.execute('SELECT * FROM Recipes'):\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
4,
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Expr'",
"Expr'",
"For",
"Condition",
"Assign'",
"Expr'",
"Return'",
"For",
"Assign'",
"For",
"Expr'",
"For",
"Expr'",
"Expr'"
] |
[
"def FUNC_23(self, *VAR_69, **VAR_70):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.output = VAR_69, VAR_70\n",
"return VAR_101\n"
] | [
"def output(self, *paths, **kwpaths):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.output = paths, kwpaths\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"if VAR_5 == 'north':\n",
"return 'west'\n",
"if VAR_5 == 'west':\n",
"return 'north'\n",
"if VAR_5 == 'south':\n",
"return 'east'\n",
"if VAR_5 == 'east':\n",
"return 'south'\n"
] | [
"@staticmethod...\n",
"if direction == 'north':\n",
"return 'west'\n",
"if direction == 'west':\n",
"return 'north'\n",
"if direction == 'south':\n",
"return 'east'\n",
"if direction == 'east':\n",
"return 'south'\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"from __future__ import absolute_import, division, print_function, with_statement\n",
"import os\n",
"import sys\n",
"import argparse\n",
"if __name__ == '__main__':\n",
"VAR_0 = argparse.ArgumentParser(description='See README')\n",
"VAR_0.add_argument('-c', '--count', default=3, type=int, help=\n 'w... | [
"from __future__ import absolute_import, division, print_function, with_statement\n",
"import os\n",
"import sys\n",
"import argparse\n",
"if __name__ == '__main__':\n",
"parser = argparse.ArgumentParser(description='See README')\n",
"parser.add_argument('-c', '--count', default=3, type=int, help=\n ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
2,
0,
0,
0,
2,
0,
0,
0,
2,
2,
0,
2
] | [
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Condition",
"Assign'",
"AugAssign'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@wraps(VAR_7)...\n",
"if VAR_1.is_expired():\n",
"return VAR_1.redirect_to_goodbye()\n",
"if VAR_1.is_authenticated():\n",
"return VAR_7(*VAR_9, **kwargs)\n",
"return VAR_1.redirect_to_goodbye()\n"
] | [
"@wraps(f)...\n",
"if user_mod.is_expired():\n",
"return user_mod.redirect_to_goodbye()\n",
"if user_mod.is_authenticated():\n",
"return f(*args, **kwargs)\n",
"return user_mod.redirect_to_goodbye()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_11(self, VAR_7=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_18 = set()\n",
"if self.benchmark and (VAR_7 is None or self.benchmark in VAR_7):\n",
"if not self.benchmark.exists:\n",
"for VAR_28, VAR_27 in zip(self.output, self.rule.output):\n",
"VAR_18.add(self.benchmark)\n",
"if VAR_7 is No... | [
"def missing_output(self, requested=None):...\n",
"\"\"\"docstring\"\"\"\n",
"files = set()\n",
"if self.benchmark and (requested is None or self.benchmark in requested):\n",
"if not self.benchmark.exists:\n",
"for f, f_ in zip(self.output, self.rule.output):\n",
"files.add(self.benchmark)\n",
"if req... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Condition",
"For",
"Expr'",
"Condition",
"Return'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_6):...\n",
"if 'doctype' in VAR_6:\n",
"self.set('doctype', VAR_6.get('doctype'))\n",
"for VAR_7 in default_fields:\n",
"if VAR_7 in VAR_6:\n",
"for VAR_7, VAR_9 in iteritems(VAR_6):\n",
"self.set(VAR_7, VAR_6.get(VAR_7))\n",
"self.set(VAR_7, VAR_9)\n",
"return self\n"
] | [
"def update(self, d):...\n",
"if 'doctype' in d:\n",
"self.set('doctype', d.get('doctype'))\n",
"for key in default_fields:\n",
"if key in d:\n",
"for key, value in iteritems(d):\n",
"self.set(key, d.get(key))\n",
"self.set(key, value)\n",
"return self\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"For",
"Condition",
"For",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_11(self, VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_24 = self.getfile(VAR_21)\n",
"return False\n",
"return VAR_24[VAR_2] == VAR_13\n"
] | [
"def isfile(self, path):...\n",
"\"\"\"docstring\"\"\"\n",
"f = self.getfile(path)\n",
"return False\n",
"return f[A_TYPE] == T_FILE\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'",
"Return'"
] |
[
"from setuptools import find_packages, setup\n",
"setup(name='jupyter-notebook-gist', version='0.4.0', description=\n 'Create a gist from the Jupyter Notebook UI', author=\n 'Mozilla Firefox Data Platform', author_email=\n 'fx-data-platform@mozilla.com', packages=find_packages(where='src'),\n package_... | [
"from setuptools import find_packages, setup\n",
"setup(name='jupyter-notebook-gist', version='0.4.0', description=\n 'Create a gist from the Jupyter Notebook UI', author=\n 'Mozilla Firefox Data Platform', author_email=\n 'fx-data-platform@mozilla.com', packages=find_packages(where='src'),\n package_... | [
0,
5
] | [
"ImportFrom'",
"Expr'"
] |
[
"@staticmethod...\n",
"return FUNC_1(CLASS_0.PostDataToHandlerAsync(VAR_9, VAR_7, VAR_10))\n"
] | [
"@staticmethod...\n",
"return JsonFromFuture(BaseRequest.PostDataToHandlerAsync(data, handler,\n timeout))\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"from typing import Iterator, TypeVar\n",
"from .interface import ISpy\n",
"VAR_0 = TypeVar('T')\n",
"def FUNC_0(VAR_1: ISpy, VAR_2: str) ->str:...\n",
"return f\"SELECT {', '.join(FUNC_1(VAR_1))} FROM {VAR_2}\"\n"
] | [
"from typing import Iterator, TypeVar\n",
"from .interface import ISpy\n",
"T = TypeVar('T')\n",
"def construct_select_statement(spy: ISpy, from_: str) ->str:...\n",
"return f\"SELECT {', '.join(construct_selects(spy))} FROM {from_}\"\n"
] | [
4,
4,
0,
0,
4
] | [
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_1 = {'name': self.volume_name}\n",
"self.stubs.Set(self.driver, '_get_iscsi_properties', self.\n _fake_get_iscsi_properties)\n",
"self.driver._eql_execute('volume', 'select', VAR_1['name'], 'acce... | [
"def test_initialize_connection(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"volume = {'name': self.volume_name}\n",
"self.stubs.Set(self.driver, '_get_iscsi_properties', self.\n _fake_get_iscsi_properties)\n",
"self.driver._eql_execute('volume', 'select', ... | [
0,
0,
0,
0,
2,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_0):...\n",
"return VAR_0.id\n"
] | [
"def to_representation(self, obj):...\n",
"return obj.id\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_2(self, VAR_2, VAR_4):...\n",
"return False\n"
] | [
"def has_permission(self, request, view):...\n",
"return False\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"\"\"\"netgrph is the primary CLI query too for NetGrph\n Also see ngreport\n\"\"\"\n",
"import os\n",
"import re\n",
"import argparse\n",
"import nglib\n",
"import nglib.query\n",
"VAR_0 = '/etc/netgrph.ini'\n",
"VAR_1 = './docs/netgrph.ini'\n",
"VAR_2 = os.path.dirname(os.path.realpath(__file__)... | [
"\"\"\"netgrph is the primary CLI query too for NetGrph\n Also see ngreport\n\"\"\"\n",
"import os\n",
"import re\n",
"import argparse\n",
"import nglib\n",
"import nglib.query\n",
"config_file = '/etc/netgrph.ini'\n",
"alt_config = './docs/netgrph.ini'\n",
"dirname = os.path.dirname(os.path.realp... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
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,
1,
0... | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
... |
[
"def __init__(self, VAR_13):...\n",
"self.filters = VAR_13\n"
] | [
"def __init__(self, filters):...\n",
"self.filters = filters\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_21(VAR_16):...\n",
"return (VAR_16.input, VAR_16.dynamic_input) if VAR_4 else (VAR_16.output,\n VAR_16.dynamic_output)\n"
] | [
"def get_io(rule):...\n",
"return (rule.input, rule.dynamic_input) if input else (rule.output, rule.\n dynamic_output)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"if self._ownsock:\n",
"close(self._sock)\n"
] | [
"def _close(self):...\n",
"if self._ownsock:\n",
"close(self._sock)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'"
] |
[
"def FUNC_6(self, VAR_7):...\n",
"VAR_14 = [data for data in VAR_7 if len(data) > VAR_6]\n",
"if VAR_14:\n",
"return False, VAR_14\n",
"return True, []\n"
] | [
"def validate_row(self, input_row):...\n",
"length_exceeded = [data for data in input_row if len(data) > max_data_length]\n",
"if length_exceeded:\n",
"return False, length_exceeded\n",
"return True, []\n"
] | [
0,
4,
4,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def __str__(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self.__repr__(\n ) + '\\nName: ' + self.name + '\\nAPI version: ' + self.api_version + \"\"\"\nPlugin version: \"\"\" + self.version + '\\nAuthor: ' + self.author + '\\n'\n"
] | [
"def __str__(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self.__repr__(\n ) + '\\nName: ' + self.name + '\\nAPI version: ' + self.api_version + \"\"\"\nPlugin version: \"\"\" + self.version + '\\nAuthor: ' + self.author + '\\n'\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_20(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_61 = super(CLASS_0, self)._get_active_sponsorships_domain()\n",
"VAR_61.insert(0, '|')\n",
"VAR_61.insert(3, ('partner_id', 'in', self.mapped('member_ids').ids))\n",
"VAR_61.insert(4, '|')\n",
"VAR_61.insert(6, ('correspondent_id', 'in', self.ma... | [
"def _get_active_sponsorships_domain(self):...\n",
"\"\"\"docstring\"\"\"\n",
"domain = super(ResPartner, self)._get_active_sponsorships_domain()\n",
"domain.insert(0, '|')\n",
"domain.insert(3, ('partner_id', 'in', self.mapped('member_ids').ids))\n",
"domain.insert(4, '|')\n",
"domain.insert(6, ('corre... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def __init__(self, VAR_6):...\n",
"self.path = VAR_6\n",
"self.abspath = VAR_3.STORAGE_DIR + VAR_6\n",
"self.meta = ImageMetadata(self.abspath)\n",
"self.meta.read()\n"
] | [
"def __init__(self, path):...\n",
"self.path = path\n",
"self.abspath = settings.STORAGE_DIR + path\n",
"self.meta = ImageMetadata(self.abspath)\n",
"self.meta.read()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"import json\n",
"import os\n",
"import stat\n",
"import tempfile\n",
"from django.conf import settings\n",
"def FUNC_0(VAR_0, VAR_1, VAR_2):...\n",
"VAR_1['AWS_ACCESS_KEY_ID'] = VAR_0.get_input('username', default='')\n",
"VAR_1['AWS_SECRET_ACCESS_KEY'] = VAR_0.get_input('password', default='')\n",
... | [
"import json\n",
"import os\n",
"import stat\n",
"import tempfile\n",
"from django.conf import settings\n",
"def aws(cred, env, private_data_dir):...\n",
"env['AWS_ACCESS_KEY_ID'] = cred.get_input('username', default='')\n",
"env['AWS_SECRET_ACCESS_KEY'] = cred.get_input('password', default='')\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
2,
2,
2,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"FunctionDef'",
"A... |
[
"def FUNC_21(VAR_49, **VAR_18):...\n",
"VAR_63 = mock.Mock()\n",
"VAR_63.history = None\n",
"VAR_63.headers = {'location': ''}\n",
"VAR_63.raw._original_response = {}\n",
"VAR_20.record_call(VAR_49, **kwargs)\n",
"return VAR_63\n"
] | [
"def _adapter_send(request, **kwargs):...\n",
"mock_response = mock.Mock()\n",
"mock_response.history = None\n",
"mock_response.headers = {'location': ''}\n",
"mock_response.raw._original_response = {}\n",
"cluster_api.record_call(request, **kwargs)\n",
"return mock_response\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_2(self, VAR_0, VAR_1, *VAR_2, **VAR_3):...\n",
"VAR_12 = JustURL.objects.get(VAR_1=pk)\n",
"VAR_11 = CounterCountingForm(VAR_0.POST or None)\n",
"if VAR_11.is_valid():\n",
"VAR_12.count += 1\n",
"return redirect('home-view')\n",
"VAR_22 = get_client_ip(VAR_0)\n",
"VAR_23 = VAR_0.META['HTTP_U... | [
"def post(self, request, pk, *args, **kwargs):...\n",
"object = JustURL.objects.get(pk=pk)\n",
"form = CounterCountingForm(request.POST or None)\n",
"if form.is_valid():\n",
"object.count += 1\n",
"return redirect('home-view')\n",
"ip = get_client_ip(request)\n",
"client_agent = request.META['HTTP_USE... | [
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
6,
6
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"AugAssign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_26 = ''\n",
"VAR_27 = ''\n",
"VAR_28 = ''\n",
"VAR_23, VAR_22 = shellutil.run_get_output('ifconfig -l ether', VAR_10=False)\n",
"if VAR_23:\n",
"VAR_29 = VAR_22.split()\n",
"if not VAR_29:\n",
"VAR_26 = VAR_29[0]\n",
"VAR_23, VAR_22 = shellut... | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"iface = ''\n",
"inet = ''\n",
"mac = ''\n",
"err, output = shellutil.run_get_output('ifconfig -l ether', chk_err=False)\n",
"if err:\n",
"ifaces = output.split()\n",
"if not ifaces:\n",
"iface = ifaces[0]\n",
"err, output = shellutil.run_get_outp... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"For",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_28(self):...\n",
"VAR_54 = Digraph('Deps', strict=True)\n",
"VAR_54.graph_attr.update(rankdir='BT')\n",
"VAR_49 = self.nodes.get('master_node')\n",
"self.logger.error(\n 'Detected circular dependency reference between %s and %s!' % (ex.node1,\n ex.node2))\n",
"VAR_54.view()\n",
"for curr... | [
"def draw_graph(self):...\n",
"deps = Digraph('Deps', strict=True)\n",
"deps.graph_attr.update(rankdir='BT')\n",
"node = self.nodes.get('master_node')\n",
"self.logger.error(\n 'Detected circular dependency reference between %s and %s!' % (ex.node1,\n ex.node2))\n",
"deps.view()\n",
"for current i... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Condition",
"For",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"@property...\n",
"if self._xsrf_token is None:\n",
"self.clear_cookies()\n",
"return self._xsrf_token\n",
"VAR_25 = self.get(\n '_ah/login?email=georges%40example.com&admin=True&action=Login&continue=/_ah/admin/interactive'\n )\n",
"self._xsrf_token = re.search('name=\"xsrf_token\" value=\"(.*?)\"/... | [
"@property...\n",
"if self._xsrf_token is None:\n",
"self.clear_cookies()\n",
"return self._xsrf_token\n",
"interactive = self.get(\n '_ah/login?email=georges%40example.com&admin=True&action=Login&continue=/_ah/admin/interactive'\n )\n",
"self._xsrf_token = re.search('name=\"xsrf_token\" value=\"(.*... | [
0,
0,
0,
0,
5,
5,
0
] | [
"Condition",
"Condition",
"Expr'",
"Return'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_1():...\n",
"VAR_0 = raw_input('Run another query? (y/n): ')\n",
"if VAR_0 == 'y' or VAR_0 == 'Y':\n",
"FUNC_0()\n",
"print('Goodbye.')\n",
"FUNC_2()\n"
] | [
"def run_another():...\n",
"opt = raw_input('Run another query? (y/n): ')\n",
"if opt == 'y' or opt == 'Y':\n",
"print_menu()\n",
"print('Goodbye.')\n",
"run_query_case()\n"
] | [
0,
0,
0,
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __getattr__(self, VAR_8):...\n",
"def FUNC_10(*VAR_11):...\n",
"VAR_12 = ' '.join(str(elem) for elem in VAR_11)\n",
"return VAR_12\n"
] | [
"def __getattr__(self, name):...\n",
"def fastboot_call(*args):...\n",
"arg_str = ' '.join(str(elem) for elem in args)\n",
"return arg_str\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(VAR_1: ISpy, VAR_4: str) ->str:...\n",
"VAR_6 = FUNC_3(FUNC_1(field_spy, field_name) for field_name, field_spy in\n VAR_1.selected_fields.items())\n",
"return f\"(SELECT {', '.join(VAR_6)} FROM {VAR_4})\"\n"
] | [
"def construct_subquery(spy: ISpy, name: str) ->str:...\n",
"select_fields = _flatten(construct_selects(field_spy, field_name) for \n field_name, field_spy in spy.selected_fields.items())\n",
"return f\"(SELECT {', '.join(select_fields)} FROM {name})\"\n"
] | [
0,
0,
4
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(VAR_0, VAR_1):...\n",
"for VAR_32, v in VAR_1.items():\n",
"if isinstance(v, dict):\n",
"return VAR_0\n",
"VAR_31 = VAR_0.setdefault(VAR_32, {})\n",
"VAR_0[VAR_32] = v\n",
"FUNC_1(VAR_31, v)\n"
] | [
"def merge_cfg(dest, source):...\n",
"for k, v in source.items():\n",
"if isinstance(v, dict):\n",
"return dest\n",
"subdest = dest.setdefault(k, {})\n",
"dest[k] = v\n",
"merge_cfg(subdest, v)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_0, VAR_1):...\n",
"if VAR_1 and self.db.check_date(VAR_1):\n",
"return self.csv_generator.write_csv(VAR_1)\n",
"if VAR_1:\n",
"return 'Нет данных за этот день.'\n",
"if VAR_0 == 'отчет' or VAR_0 == 'отчёт':\n",
"return self.csv_generator.write_csv()\n",
"return 'Ошибка! Неверный ... | [
"def parse_report_message(self, string, date):...\n",
"if date and self.db.check_date(date):\n",
"return self.csv_generator.write_csv(date)\n",
"if date:\n",
"return 'Нет данных за этот день.'\n",
"if string == 'отчет' or string == 'отчёт':\n",
"return self.csv_generator.write_csv()\n",
"return 'Ошибк... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_22 = CLASS_1.get_user_by_id(VAR_3)\n",
"VAR_39 = MappingLevel(VAR_22.mapping_level)\n",
"if VAR_39 == MappingLevel.ADVANCED:\n",
"return\n",
"VAR_24 = current_app.config['MAPPER_LEVEL_INTERMEDIATE']\n",
"VAR_25 = current_app.config['MAPPER_LEVEL_AD... | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"user = UserService.get_user_by_id(user_id)\n",
"user_level = MappingLevel(user.mapping_level)\n",
"if user_level == MappingLevel.ADVANCED:\n",
"return\n",
"intermediate_level = current_app.config['MAPPER_LEVEL_INTERMEDIATE']\n",
"advanced_level = curre... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"if self.get_option('no-hypervisors'):\n",
"return []\n",
"VAR_6 = self.exec_master_cmd(self.dbcmd, need_root=True)\n",
"if VAR_6['status'] == 0:\n",
"VAR_12 = VAR_6['stdout'].splitlines()[2:-1]\n",
"return [n.split('(')[0].strip() for n in VAR_12]\n"
] | [
"def get_nodes(self):...\n",
"if self.get_option('no-hypervisors'):\n",
"return []\n",
"res = self.exec_master_cmd(self.dbcmd, need_root=True)\n",
"if res['status'] == 0:\n",
"nodes = res['stdout'].splitlines()[2:-1]\n",
"return [n.split('(')[0].strip() for n in nodes]\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"super(CLASS_1, self).setUp()\n",
"VAR_12 = patch('pavelib.utils.test.suites.bokchoy_suite.sh')\n",
"self._mock_sh = VAR_12.start()\n",
"self.addCleanup(VAR_12.stop)\n"
] | [
"def setUp(self):...\n",
"super(TestPaverPa11yCrawlerCmd, self).setUp()\n",
"mock_sh = patch('pavelib.utils.test.suites.bokchoy_suite.sh')\n",
"self._mock_sh = mock_sh.start()\n",
"self.addCleanup(mock_sh.stop)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_4(self, VAR_14):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_28 = VAR_14.groupdict()\n",
"if isinstance(self.severity_map, dict) and 'severity' in VAR_28 and VAR_28[\n",
"VAR_28['severity'] = self.severity_map[VAR_28['severity']]\n",
"return VAR_28\n"
] | [
"def _get_groupdict(self, match):...\n",
"\"\"\"docstring\"\"\"\n",
"groups = match.groupdict()\n",
"if isinstance(self.severity_map, dict) and 'severity' in groups and groups[\n",
"groups['severity'] = self.severity_map[groups['severity']]\n",
"return groups\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_9(self, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_26 = 'string' % {'database': VAR_10}\n",
"self.db.executescript(VAR_26)\n",
"self.db.commit()\n"
] | [
"def drop_indexes(self, database):...\n",
"\"\"\"docstring\"\"\"\n",
"sqlstr = (\n \"\"\"\n DROP INDEX IF EXISTS %(database)s.phrases_index_p;\n DROP INDEX IF EXISTS %(database)s.phrases_index_i;\n VACUUM;\n \"\"\"\n % {'database': database})\n",
"self.db.exe... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_9 = model.Identity(model.IDENTITY_USER, 'a@example.com')\n",
"VAR_10 = model.Identity(model.IDENTITY_USER, 'b@example.com')\n",
"model.bootstrap_ip_whitelist('whitelist', ['192.168.1.100/32'])\n",
"model.bootstrap_ip_whitelist_assignment(VAR_9, 'wh... | [
"def test_ip_whitelist(self):...\n",
"\"\"\"docstring\"\"\"\n",
"ident1 = model.Identity(model.IDENTITY_USER, 'a@example.com')\n",
"ident2 = model.Identity(model.IDENTITY_USER, 'b@example.com')\n",
"model.bootstrap_ip_whitelist('whitelist', ['192.168.1.100/32'])\n",
"model.bootstrap_ip_whitelist_assignmen... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_18, *VAR_15, **VAR_16):...\n",
"CLASS_3.__init__(self, VAR_18, errors.BAD_PASSWORD, *VAR_15, **kw)\n"
] | [
"def __init__(self, item, *a, **kw):...\n",
"VRequired.__init__(self, item, errors.BAD_PASSWORD, *a, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@VAR_7.context_processor...\n",
"return dict(admin_base_template=admin.base_template, admin_view=admin.\n index_view, h=helpers, get_url=url_for)\n"
] | [
"@security_ctx.context_processor...\n",
"return dict(admin_base_template=admin.base_template, admin_view=admin.\n index_view, h=helpers, get_url=url_for)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_16(VAR_1):...\n",
"async def FUNC_15(VAR_3):...\n",
"VAR_19 = await VAR_1(VAR_3, VAR_4)\n",
"return VAR_19\n"
] | [
"def decorator(func):...\n",
"async def ret(request):...\n",
"out = await func(request, base)\n",
"return out\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"AsyncFunctionDef'",
"Assign'",
"Return'"
] |
[
"from lxml import html\n",
"from importlib import import_module\n",
"from django.test import Client\n",
"from django.test import TestCase\n",
"from dashboard.tests.loader import load_model_objects, fixtures_standard\n",
"from dashboard.views.data_group import ExtractionScriptForm, DataGroupForm\n",
"fro... | [
"from lxml import html\n",
"from importlib import import_module\n",
"from django.test import Client\n",
"from django.test import TestCase\n",
"from dashboard.tests.loader import load_model_objects, fixtures_standard\n",
"from dashboard.views.data_group import ExtractionScriptForm, DataGroupForm\n",
"fro... | [
6,
6,
6,
0,
0,
6,
6,
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... | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
... |
[
"def __init__(self, VAR_3):...\n",
"QObject.__init__(self)\n",
"self.main = VAR_3\n",
"self.lsp_plugins = {}\n",
"self.clients = {}\n",
"self.requests = {}\n",
"self.register_queue = {}\n",
"self.configurations_for_servers = CONF.options('lsp-server')\n",
"for VAR_6 in self.configurations_for_server... | [
"def __init__(self, parent):...\n",
"QObject.__init__(self)\n",
"self.main = parent\n",
"self.lsp_plugins = {}\n",
"self.clients = {}\n",
"self.requests = {}\n",
"self.register_queue = {}\n",
"self.configurations_for_servers = CONF.options('lsp-server')\n",
"for language in self.configurations_for_s... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'"
] |
[
"def FUNC_15(self, VAR_6):...\n",
""
] | [
"def set_priority(self, priority):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_5(self, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"self.logger.warn(VAR_1)\n",
"self.console.warn('WARNING: %s' % VAR_1)\n"
] | [
"def log_warn(self, msg):...\n",
"\"\"\"docstring\"\"\"\n",
"self.logger.warn(msg)\n",
"self.console.warn('WARNING: %s' % msg)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Expr'"
] |
[
"def __gt__(self, VAR_16):...\n",
"VAR_39 = self.workflow._ruleorder.compare(self, VAR_16)\n",
"return VAR_39 > 0\n"
] | [
"def __gt__(self, rule):...\n",
"comp = self.workflow._ruleorder.compare(self, rule)\n",
"return comp > 0\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self, VAR_10):...\n",
"return os.path.join(self.target_dir, VAR_10)\n"
] | [
"def output_path(self, file_name):...\n",
"return os.path.join(self.target_dir, file_name)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_4(VAR_14):...\n",
"VAR_17 = generate_account()\n",
"VAR_35 = VAR_17['private']\n",
"VAR_17 = VAR_17['account']\n",
"print(type(VAR_35), type(VAR_17), type(VAR_14))\n",
"print(VAR_35, VAR_17, VAR_14)\n",
"VAR_32 = (\n 'INSERT INTO accounts (username, private_key, address, minimum) VALUES (%s... | [
"def add_new_account(username):...\n",
"address = generate_account()\n",
"private = address['private']\n",
"address = address['account']\n",
"print(type(private), type(address), type(username))\n",
"print(private, address, username)\n",
"sql = (\n 'INSERT INTO accounts (username, private_key, address... | [
0,
4,
4,
4,
4,
4,
4,
4,
0,
0,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.