lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_0():...\n",
"if VAR_9 in VAR_1:\n",
"print('Directory already exist.')\n",
"VAR_1.append(VAR_9)\n",
"VAR_2.append(VAR_9)\n"
] | [
"def mkdir():...\n",
"if dir in dirs:\n",
"print('Directory already exist.')\n",
"dirs.append(dir)\n",
"path.append(dir)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"return db.engine.execute('string' + VAR_1 +\n \"' OR signature_misc.member ISNULL;\")\n"
] | [
"def query_signed_alumni(member):...\n",
"\"\"\"docstring\"\"\"\n",
"return db.engine.execute(\n \"\"\"\n SELECT DISTINCT packet.freshman_username AS username, signature_misc.member AS signed \n FROM packet LEFT OUTER JOIN signature_misc ON packet.id = signature_misc.packet_id \n ... | [
0,
0,
4
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"import json\n",
"from psycopg2.extras import Json\n",
"from django.contrib.postgres import forms, lookups\n",
"from django.core import exceptions\n",
"from django.db.models import Field, TextField, Transform, lookups as builtin_lookups\n",
"from django.utils.translation import gettext_lazy as _\n",
"fr... | [
"import json\n",
"from psycopg2.extras import Json\n",
"from django.contrib.postgres import forms, lookups\n",
"from django.core import exceptions\n",
"from django.db.models import Field, TextField, Transform, lookups as builtin_lookups\n",
"from django.utils.translation import gettext_lazy as _\n",
"fr... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@VAR_0.route('/logout')...\n",
"VAR_10.clear()\n",
"flash('You are now logged out', 'success')\n",
"return redirect(url_for('login'))\n"
] | [
"@app.route('/logout')...\n",
"session.clear()\n",
"flash('You are now logged out', 'success')\n",
"return redirect(url_for('login'))\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_13(self, VAR_10, VAR_16):...\n",
"VAR_15 = self.find_products_by_upc(VAR_10)\n",
"self._purchase_by_product(VAR_15, VAR_16)\n"
] | [
"def purchase_by_product_upc(self, product_upc, quantity):...\n",
"product = self.find_products_by_upc(product_upc)\n",
"self._purchase_by_product(product, quantity)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"self.client.login(username='Karyn', password='specialP@55word')\n"
] | [
"def setUp(self):...\n",
"self.client.login(username='Karyn', password='specialP@55word')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_11(self, VAR_12):...\n",
"VAR_5 = {}\n",
"VAR_5['serverName'] = VAR_12['host']\n",
"VAR_16 = self._cliq_run_xml('getServerInfo', VAR_5, False)\n",
"VAR_33 = VAR_16.find('response')\n",
"VAR_34 = VAR_33.attrib.get('result')\n",
"if VAR_34 != '0':\n",
"VAR_5 = {}\n",
"VAR_5['serverName'] = V... | [
"def _create_server(self, connector):...\n",
"cliq_args = {}\n",
"cliq_args['serverName'] = connector['host']\n",
"out = self._cliq_run_xml('getServerInfo', cliq_args, False)\n",
"response = out.find('response')\n",
"result = response.attrib.get('result')\n",
"if result != '0':\n",
"cliq_args = {}\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"super(CLASS_0, self).tearDown()\n",
"if self.manager.clients_initialized:\n",
"if self.servers:\n",
"for VAR_7 in self.servers:\n",
"self._delete_server(VAR_7)\n",
"VAR_0.debug(traceback.format_exc())\n",
"self.servers.remove(VAR_7)\n",
"VAR_0.debug('Server was already del... | [
"def tearDown(self):...\n",
"super(TestNovaNetwork, self).tearDown()\n",
"if self.manager.clients_initialized:\n",
"if self.servers:\n",
"for server in self.servers:\n",
"self._delete_server(server)\n",
"LOG.debug(traceback.format_exc())\n",
"self.servers.remove(server)\n",
"LOG.debug('Server was al... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Condition",
"For",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"import os\n",
"import vim\n",
"import tempfile\n",
"import json\n",
"import signal\n",
"from subprocess import PIPE\n",
"from ycm import vimsupport\n",
"from ycm import utils\n",
"from ycm.diagnostic_interface import DiagnosticInterface\n",
"from ycm.completers.all.omni_completer import OmniCompl... | [
"import os\n",
"import vim\n",
"import tempfile\n",
"import json\n",
"import signal\n",
"from subprocess import PIPE\n",
"from ycm import vimsupport\n",
"from ycm import utils\n",
"from ycm.diagnostic_interface import DiagnosticInterface\n",
"from ycm.completers.all.omni_completer import OmniCompl... | [
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,
7,
0,
0,
0,
0,
0,
7,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'"... |
[
"\"\"\"string\"\"\"\n",
"from datetime import datetime\n",
"import logging\n",
"import os\n",
"import sys\n",
"from docopt import docopt\n",
"from monitoring_config_generator.exceptions import MonitoringConfigGeneratorException, ConfigurationContainsUndefinedVariables, NoSuchHostname, HostUnreachableExc... | [
"\"\"\"monconfgenerator\n\nCreates an Icinga monitoring configuration. It does it by querying an URL from\nwhich it receives a specially formatted yaml file. This file is transformed into\na valid Icinga configuration file.\nIf no URL is given it reads it's default configuration from file system. The\nconfiguration... | [
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
] | [
"Expr'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",... |
[
"def FUNC_1(self):...\n",
"VAR_3 = XsrfTool()\n",
"VAR_4 = users.get_current_user()\n",
"if not (self.params.xsrf_token and VAR_3.verify_token(self.params.\n",
"self.error(403)\n",
"VAR_5 = 'delete', str(self.params.id)\n",
"return False\n",
"self.redirect('/delete', id=self.params.id, signature=revea... | [
"def post(self):...\n",
"xsrf_tool = XsrfTool()\n",
"user = users.get_current_user()\n",
"if not (self.params.xsrf_token and xsrf_tool.verify_token(self.params.\n",
"self.error(403)\n",
"action = 'delete', str(self.params.id)\n",
"return False\n",
"self.redirect('/delete', id=self.params.id, signature... | [
0,
0,
0,
5,
5,
5,
5,
5
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Expr'"
] |
[
"def FUNC_0(VAR_0, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {}\n",
"for count in range(0, 50):\n",
"if kb.dbms == 'Oracle' and VAR_0.endswith(' FROM DUAL'):\n",
"return None\n",
"VAR_0 = VAR_0[:-len(' FROM DUAL')]\n",
"if count:\n",
"VAR_0 += ', NULL'\n",
"if kb.dbms == 'Oracle':\n",
"... | [
"def __effectiveUnionTest(query, comment):...\n",
"\"\"\"docstring\"\"\"\n",
"resultDict = {}\n",
"for count in range(0, 50):\n",
"if kb.dbms == 'Oracle' and query.endswith(' FROM DUAL'):\n",
"return None\n",
"query = query[:-len(' FROM DUAL')]\n",
"if count:\n",
"query += ', NULL'\n",
"if kb.dbms... | [
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
2,
2,
0,
2,
0,
0,
0,
0,
2,
0,
0,
2,
0,
2
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Condition",
"AugAssign'",
"Condition",
"AugAssign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"For",
"Condition",
"Condition",
"Assign'",
"Condition"... |
[
"@web.authenticated...\n",
"VAR_3 = self.contents_manager\n",
"if VAR_3.is_hidden(VAR_1) and not VAR_3.allow_hidden:\n",
"self.log.info('Refusing to serve hidden file, via 404 Error')\n",
"VAR_1 = VAR_1.strip('/')\n",
"if '/' in VAR_1:\n",
"VAR_5, VAR_6 = VAR_1.rsplit('/', 1)\n",
"VAR_6 = VAR_1\n",
... | [
"@web.authenticated...\n",
"cm = self.contents_manager\n",
"if cm.is_hidden(path) and not cm.allow_hidden:\n",
"self.log.info('Refusing to serve hidden file, via 404 Error')\n",
"path = path.strip('/')\n",
"if '/' in path:\n",
"_, name = path.rsplit('/', 1)\n",
"name = path\n",
"model = yield maybe_... | [
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
] | [
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Condition",
"For",
"Expr'",
"Condition",
"Assign'",
"For",
"Expr'",
"For",
"Expr'",
"Expr'",
"... |
[
"def FUNC_2(VAR_0):...\n",
"VAR_2 = []\n",
"VAR_3 = FUNC_4(VAR_0)\n",
"VAR_4 = FUNC_3(VAR_0)\n",
"for item in VAR_3:\n",
"if VAR_4.get(item.name):\n",
"return VAR_2\n",
"VAR_9 = VAR_4[item.name]\n",
"VAR_10 = {'item_group': item.item_group, 'item': item.name, 'item_name':\n item.item_name}\n",
... | [
"def get_data(filters):...\n",
"data = []\n",
"items = get_items(filters)\n",
"sales_invoice_data = get_sales_details(filters)\n",
"for item in items:\n",
"if sales_invoice_data.get(item.name):\n",
"return data\n",
"item_obj = sales_invoice_data[item.name]\n",
"row = {'item_group': item.item_group, ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_8(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = self.bindings\n",
"VAR_15 = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n",
"VAR_12 = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider':\n 'aws', 'type': 'destroyServerGroup', 'serverGroupNam... | [
"def delete_server_group(self):...\n",
"\"\"\"docstring\"\"\"\n",
"bindings = self.bindings\n",
"group_name = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n",
"payload = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider':\n 'aws', 'type': 'destroyServerGr... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
""
] | [
"def run_check(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"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_19(self):...\n",
"VAR_25 = c.get('/test')\n",
"self.assertEqual(VAR_25.status_code, 200)\n"
] | [
"def test_no_authn(self):...\n",
"resp = c.get('/test')\n",
"self.assertEqual(resp.status_code, 200)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_9, VAR_10):...\n",
"return ' %s %s);' % (VAR_9, VAR_10)\n"
] | [
"def create_table_field_end(self, current, field):...\n",
"return ' %s %s);' % (current, field)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_13(self, VAR_16):...\n",
"return VAR_6 in VAR_16.bookmarks\n"
] | [
"def does_intersect_rule(self, rulectx):...\n",
"return bookmark in rulectx.bookmarks\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"import tornado.ioloop\n",
"import tornado.web\n",
"import tornado.websocket\n",
"import tornado.httpclient\n",
"import tornado.gen\n",
"import os\n",
"import random\n",
"import shutil\n",
"import json\n",
"import multiprocessing\n",
"from utilities import sort_naturally\n",
"import settings\n... | [
"import tornado.ioloop\n",
"import tornado.web\n",
"import tornado.websocket\n",
"import tornado.httpclient\n",
"import tornado.gen\n",
"import os\n",
"import random\n",
"import shutil\n",
"import json\n",
"import multiprocessing\n",
"from utilities import sort_naturally\n",
"import settings\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
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"Import'",
"Assign'",
"Condition",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Expr'",
"For",
... |
[
"def FUNC_14(self, VAR_16, *VAR_9, **VAR_7):...\n",
"if self.closed:\n",
"if self._adapter is not None:\n",
"assert self._session is None\n",
"VAR_9 = ['-m', VAR_16] + list(VAR_9)\n",
"if VAR_7.pop('nodebug', False):\n",
"VAR_9.insert(0, '--nodebug')\n",
"self._launch(VAR_9, **kwargs)\n",
"return se... | [
"def launch_module(self, module, *argv, **kwargs):...\n",
"if self.closed:\n",
"if self._adapter is not None:\n",
"assert self._session is None\n",
"argv = ['-m', module] + list(argv)\n",
"if kwargs.pop('nodebug', False):\n",
"argv.insert(0, '--nodebug')\n",
"self._launch(argv, **kwargs)\n",
"return... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Assert'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_1():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = {}\n",
"for arg in request.args:\n",
"VAR_8 = re.findall('page_(.*)', arg)\n",
"return VAR_5\n",
"if VAR_8:\n",
"VAR_5[VAR_8[0]] = int(request.args.get(arg))\n"
] | [
"def get_page_args():...\n",
"\"\"\"docstring\"\"\"\n",
"pages = {}\n",
"for arg in request.args:\n",
"re_match = re.findall('page_(.*)', arg)\n",
"return pages\n",
"if re_match:\n",
"pages[re_match[0]] = int(request.args.get(arg))\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'"
] |
[
"def FUNC_23(self, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_35 = self.common._cli_run('showvlun -a -showcols Port', None)\n",
"VAR_36 = {}\n",
"for VAR_15 in VAR_16:\n",
"VAR_36[VAR_15] = 0\n",
"VAR_37 = None\n",
"if VAR_35:\n",
"VAR_35 = VAR_35[1:]\n",
"return VAR_37\n",
"for line in VAR... | [
"def _get_least_used_nsp(self, nspss):...\n",
"\"\"\"docstring\"\"\"\n",
"result = self.common._cli_run('showvlun -a -showcols Port', None)\n",
"nsp_counts = {}\n",
"for nsp in nspss:\n",
"nsp_counts[nsp] = 0\n",
"current_least_used_nsp = None\n",
"if result:\n",
"result = result[1:]\n",
"return c... | [
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"For",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_15(VAR_14):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_30 = get_object_or_404(Article, pk=int(request.POST['article']))\n",
"VAR_31 = VAR_14.POST['body']\n",
"VAR_32 = dmp.diff_main(VAR_30.content, VAR_31)\n",
"dmp.diff_cleanupSemantic(VAR_32)\n",
"return HttpResponse(dmp.diff_prettyHtml(VAR_32), ... | [
"def article_diff(request):...\n",
"\"\"\"docstring\"\"\"\n",
"current_article = get_object_or_404(Article, pk=int(request.POST['article']))\n",
"content = request.POST['body']\n",
"diffs = dmp.diff_main(current_article.content, content)\n",
"dmp.diff_cleanupSemantic(diffs)\n",
"return HttpResponse(dmp.... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"if not self.get_option('no-database') and self.conf:\n",
"return self.collect_database()\n",
"return False\n"
] | [
"def run_extra_cmd(self):...\n",
"if not self.get_option('no-database') and self.conf:\n",
"return self.collect_database()\n",
"return False\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_13(VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"if FUNC_12(VAR_16, 'protected'):\n",
"return VAR_19(VAR_16, 'temp')\n"
] | [
"def temp(value):...\n",
"\"\"\"docstring\"\"\"\n",
"if is_flagged(value, 'protected'):\n",
"return flag(value, 'temp')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'"
] |
[
"@staticmethod...\n",
"VAR_5 = CLASS_0._get_report(VAR_1)\n",
"if not VAR_5:\n",
"VAR_9 = {'analysis': VAR_5}\n",
"VAR_13 = CLASS_0._get_dnsinfo(VAR_5)\n",
"VAR_9.update(VAR_13)\n",
"return VAR_9\n"
] | [
"@staticmethod...\n",
"report = AnalysisController._get_report(task_id)\n",
"if not report:\n",
"data = {'analysis': report}\n",
"dnsinfo = AnalysisController._get_dnsinfo(report)\n",
"data.update(dnsinfo)\n",
"return data\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def __init__(self, VAR_2):...\n",
"self.__proxies = VAR_2\n"
] | [
"def __init__(self, proxies):...\n",
"self.__proxies = proxies\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_22(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = VAR_0[:]\n",
"for user in self.company.employees:\n",
"VAR_11.append((Allow, user.login, ('list_sale_products',\n 'view_sale_product', 'edit_sale_product')))\n",
"return VAR_11\n"
] | [
"def get_product_acl(self):...\n",
"\"\"\"docstring\"\"\"\n",
"acl = DEFAULT_PERM[:]\n",
"for user in self.company.employees:\n",
"acl.append((Allow, user.login, ('list_sale_products', 'view_sale_product',\n 'edit_sale_product')))\n",
"return acl\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Return'"
] |
[
"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'"
] |
[
"def FUNC_12(self, VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_24 = self.getfile(VAR_21)\n",
"return False\n",
"return VAR_24[VAR_2] == VAR_11\n"
] | [
"def islink(self, path):...\n",
"\"\"\"docstring\"\"\"\n",
"f = self.getfile(path)\n",
"return False\n",
"return f[A_TYPE] == T_LINK\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.host_status.get(self.hostname):\n",
"VAR_9 = 'ssh -F %s %s \"ps -p %s > /dev/null\"' % (config.\n CUSTOM_SSH_CONFIG_PATH, self.hostname, self.pid)\n",
"return True\n",
"if call(VAR_9, shell=True) == 0:\n",
"return True\n",
"return CLASS_... | [
"def run_check(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.host_status.get(self.hostname):\n",
"cmd = 'ssh -F %s %s \"ps -p %s > /dev/null\"' % (config.\n CUSTOM_SSH_CONFIG_PATH, self.hostname, self.pid)\n",
"return True\n",
"if call(cmd, shell=True) == 0:\n",
"return True\n",
"return RemoteC... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"@VAR_0.route('/')...\n",
"VAR_3 = request.args.get('start', None, float)\n",
"VAR_4 = request.args.get('end', None, float)\n",
"VAR_5 = request.args.get('limit', 100, int)\n",
"VAR_8 = request.args.get('degree', None, int)\n",
"if VAR_5 > 1000:\n",
"VAR_5 = 1000\n",
"if VAR_5 < 0:\n",
"VAR_5 = 100\... | [
"@FirstZeros.route('/')...\n",
"start = request.args.get('start', None, float)\n",
"end = request.args.get('end', None, float)\n",
"limit = request.args.get('limit', 100, int)\n",
"degree = request.args.get('degree', None, int)\n",
"if limit > 1000:\n",
"limit = 1000\n",
"if limit < 0:\n",
"limit = ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_10(self):...\n",
"return [self.actors[VAR_6] for VAR_6 in self.actors.keys()]\n"
] | [
"def allActors(self):...\n",
"return [self.actors[ID] for ID in self.actors.keys()]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_10(self, VAR_21, VAR_27, VAR_28, VAR_29, VAR_30, VAR_31=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.newcount > 10000:\n",
"if VAR_31 is None:\n",
"VAR_31 = time.time()\n",
"if not len(VAR_21.strip('/')):\n",
"VAR_58 = self.get_path(os.path.dirname(VAR_21.strip('/')))\n",
"return False\... | [
"def mkdir(self, path, uid, gid, size, mode, ctime=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.newcount > 10000:\n",
"if ctime is None:\n",
"ctime = time.time()\n",
"if not len(path.strip('/')):\n",
"dir = self.get_path(os.path.dirname(path.strip('/')))\n",
"return False\n",
"dir.append([os.pa... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Expr'",
"AugAssign'"
] |
[
"def FUNC_2():...\n",
"for blog in frappe.db.sql_list(\n",
"clear_cache(blog)\n",
"clear_cache('writers')\n"
] | [
"def clear_blog_cache():...\n",
"for blog in frappe.db.sql_list(\n",
"clear_cache(blog)\n",
"clear_cache('writers')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'",
"Expr'"
] |
[
"def FUNC_4():...\n",
"VAR_22 = self.request.body\n",
"VAR_23 = json.loads(VAR_22.decode('utf-8', 'ignore'))\n",
"VAR_24 = VAR_23['action']\n",
"VAR_25 = VAR_23['source']\n",
"if type(VAR_25) == list:\n",
"for VAR_33 in range(0, len(VAR_25)):\n",
"VAR_25 = FUNC_1(VAR_25)\n",
"VAR_25[VAR_33] = FUNC_1... | [
"def get_final_html_async():...\n",
"operation_content_raw = self.request.body\n",
"operation_content = json.loads(operation_content_raw.decode('utf-8', 'ignore'))\n",
"action = operation_content['action']\n",
"sources = operation_content['source']\n",
"if type(sources) == list:\n",
"for i in range(0, l... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
4,
0,
0,
4,
4,
0,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'",
"Expr'",
"For",
"Condition",
"Expr'",
"For",
"Conditio... |
[
"def __init__(self, VAR_10, VAR_13, VAR_14, VAR_11=None):...\n",
"CLASS_1.__init__(self, VAR_10, VAR_11)\n",
"self.username = VAR_13\n",
"self.password = VAR_14\n",
"self.url = '%slogin' % self.base_url\n",
"self.data = {'username': self.username, 'password': self.password, 'next': '/'}\n"
] | [
"def __init__(self, browser, username, password, base_url=None):...\n",
"GenericRequest.__init__(self, browser, base_url)\n",
"self.username = username\n",
"self.password = password\n",
"self.url = '%slogin' % self.base_url\n",
"self.data = {'username': self.username, 'password': self.password, 'next': '/... | [
0,
0,
0,
0,
5,
5
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"string\"\"\"\n",
"VAR_5 = 'northwood'\n",
"VAR_6 = request.json.get('username')\n",
"VAR_7 = request.json.get('firstName')\n",
"VAR_8 = request.json.get('lastName')\n",
"VAR_9 = request.json.get('password')\n",
"VAR_10 = request.json.get('b... | [
"def post(self):...\n",
"\"\"\"docstring\"\"\"\n",
"\"\"\"\n # Check the request comes from appropriate location.\n if not utils.validate_ip(request.remote_addr)\n return {}, 403\n \"\"\"\n",
"INSTITUTION_CODE = 'northwood'\n",
"username = request.json.get('username')\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
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Return'",
"Assign'",
"For",
"Expr'",
"Return'"
... |
[
"@property...\n",
"return 'Array of %s' % self.base_field.description\n"
] | [
"@property...\n",
"return 'Array of %s' % self.base_field.description\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_25(self, VAR_73):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.message = VAR_73\n",
"return VAR_101\n"
] | [
"def message(self, message):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.message = message\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_15(self):...\n",
"for VAR_7 in default_fields:\n",
"if VAR_7 not in self.__dict__:\n",
"for VAR_7 in self.get_valid_columns():\n",
"self.__dict__[VAR_7] = None\n",
"if VAR_7 in ('idx', 'docstatus') and self.__dict__[VAR_7] is None:\n",
"if VAR_7 not in self.__dict__:\n",
"self.__dict__[VAR_7... | [
"def init_valid_columns(self):...\n",
"for key in default_fields:\n",
"if key not in self.__dict__:\n",
"for key in self.get_valid_columns():\n",
"self.__dict__[key] = None\n",
"if key in ('idx', 'docstatus') and self.__dict__[key] is None:\n",
"if key not in self.__dict__:\n",
"self.__dict__[key] = 0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"For",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'"
] |
[
"@patch('invenio.ext.session.interface.SessionInterface.save_session')...\n",
"from invenio.modules.oauthclient.client import oauth\n",
"VAR_9 = MagicMock()\n",
"VAR_9.get_id = MagicMock(return_value=1)\n",
"VAR_9.is_authenticated = MagicMock(return_value=True)\n",
"VAR_10 = c.get(url_for('oauthclient.log... | [
"@patch('invenio.ext.session.interface.SessionInterface.save_session')...\n",
"from invenio.modules.oauthclient.client import oauth\n",
"user = MagicMock()\n",
"user.get_id = MagicMock(return_value=1)\n",
"user.is_authenticated = MagicMock(return_value=True)\n",
"res = c.get(url_for('oauthclient.login', r... | [
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assert'",
"Assert'",
"Expr'",
"Assign'",
"Assert'"
] |
[
"def FUNC_13(self, VAR_9, **VAR_4):...\n",
"if self.closed:\n",
"VAR_16, VAR_13 = VAR_9.command, VAR_9.seq\n",
"VAR_16, VAR_13 = VAR_9['command'], VAR_9['seq']\n",
"VAR_33 = {'msg': None}\n",
"def FUNC_27(VAR_21):...\n",
"if VAR_21.type != 'response':\n",
"return False\n",
"VAR_33['msg'] = VAR_21\n"... | [
"def _get_awaiter_for_request(self, req, **kwargs):...\n",
"if self.closed:\n",
"command, seq = req.command, req.seq\n",
"command, seq = req['command'], req['seq']\n",
"result = {'msg': None}\n",
"def match(msg):...\n",
"if msg.type != 'response':\n",
"return False\n",
"result['msg'] = msg\n",
"re... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"@api.public...\n",
"self.response.write(json.dumps({'peer_id': api.get_peer_identity().to_bytes\n (), 'cur_id': api.get_current_identity().to_bytes()}))\n"
] | [
"@api.public...\n",
"self.response.write(json.dumps({'peer_id': api.get_peer_identity().to_bytes\n (), 'cur_id': api.get_current_identity().to_bytes()}))\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import codecs\n",
"import datetime\n",
"import io\n",
"import os\n",
"import sys\n",
"import time\n",
"import traceback\n",
"import urllib\n",
"import requests\n... | [
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"import codecs\n",
"import datetime\n",
"import io\n",
"import os\n",
"import sys\n",
"import time\n",
"import traceback\n",
"import urllib\n",
"import requests\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"For",
"Condition",
"FunctionDef'",
"Assign'",
"Expr... |
[
"def FUNC_37(self):...\n",
"self.compilation_ko(\"\"\"\nif not {\n discard;\n}\n\"\"\")\n"
] | [
"def test_empty_not(self):...\n",
"self.compilation_ko(\"\"\"\nif not {\n discard;\n}\n\"\"\")\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_12(VAR_24):...\n",
"VAR_38 = argparse.ArgumentParser(description=\n 'Reads and merges JSON configuration files specified by colon separated environment variable OS_CONFIG_FILES, unless overridden by command line option --metadata. If no files are specified this way, falls back to legacy behavior of s... | [
"def parse_opts(argv):...\n",
"parser = argparse.ArgumentParser(description=\n 'Reads and merges JSON configuration files specified by colon separated environment variable OS_CONFIG_FILES, unless overridden by command line option --metadata. If no files are specified this way, falls back to legacy behavior of ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"return self.extracted_text\n"
] | [
"def get_extractedtext(self):...\n",
"return self.extracted_text\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from datetime import datetime, timedelta\n",
"import pytz\n",
"from constance.admin import Config, ConstanceAdmin, ConstanceForm\n",
"from cryptography.fernet import Fernet\n",
"from django.conf import settings\n",
"from django.contrib import admin\n",
"from django.contrib.auth.admin import GroupAdmin ... | [
"from datetime import datetime, timedelta\n",
"import pytz\n",
"from constance.admin import Config, ConstanceAdmin, ConstanceForm\n",
"from cryptography.fernet import Fernet\n",
"from django.conf import settings\n",
"from django.contrib import admin\n",
"from django.contrib.auth.admin import GroupAdmin ... | [
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'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"FunctionDef'",
"Expr'... |
[
"import gc\n",
"import os\n",
"def __setattr__(self, VAR_10, VAR_11):...\n",
"if self.__dict__.get(VAR_10):\n",
"self.__dict__[VAR_10] = VAR_11\n",
"def FUNC_0(VAR_0):...\n",
"os.listdir(VAR_0)\n",
"return False\n",
"def FUNC_1(VAR_0):...\n",
"return True\n",
"VAR_12 = dict(VAR_10=path, children... | [
"import gc\n",
"import os\n",
"def __setattr__(self, name, value):...\n",
"if self.__dict__.get(name):\n",
"self.__dict__[name] = value\n",
"def is_folder(path):...\n",
"os.listdir(path)\n",
"return False\n",
"def traverse(path):...\n",
"return True\n",
"n = dict(name=path, children=[])\n",
"f... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1
] | [
"Import'",
"Import'",
"FunctionDef'",
"Condition",
"Assign'",
"FunctionDef'",
"Expr'",
"Return'",
"FunctionDef'",
"Return'",
"Assign'",
"For",
"Condition",
"Return'",
"Expr'",
"Expr'"
] |
[
"import operator\n",
"from collections import deque\n",
"def FUNC_0(VAR_0):...\n",
"VAR_4, VAR_5 = VAR_0\n",
"VAR_6 = (VAR_4 * VAR_4 + 3 * VAR_4 + 2 * VAR_4 * VAR_5 + VAR_5 + VAR_5 *\n VAR_5 + 1358)\n",
"return VAR_4 >= 0 and VAR_5 >= 0 and bin(VAR_6).count('1') % 2 == 0\n"
] | [
"import operator\n",
"from collections import deque\n",
"def isopen(location):...\n",
"x, y = location\n",
"num = x * x + 3 * x + 2 * x * y + y + y * y + 1358\n",
"return x >= 0 and y >= 0 and bin(num).count('1') % 2 == 0\n"
] | [
0,
0,
0,
1,
1,
1
] | [
"Import'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self, VAR_4, *VAR_5, **VAR_6):...\n",
"return HttpResponse(self.submission.status, content_type='text/plain')\n"
] | [
"def get(self, request, *args, **kwargs):...\n",
"return HttpResponse(self.submission.status, content_type='text/plain')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(self, VAR_0):...\n",
"if not cint(self.published):\n",
"VAR_0.full_name = get_fullname(self.owner)\n",
"VAR_0.updated = global_date_format(self.published_on)\n",
"if self.blogger:\n",
"VAR_0.blogger_info = frappe.get_doc('Blogger', self.blogger).as_dict()\n",
"VAR_0.description = self.blog_i... | [
"def get_context(self, context):...\n",
"if not cint(self.published):\n",
"context.full_name = get_fullname(self.owner)\n",
"context.updated = global_date_format(self.published_on)\n",
"if self.blogger:\n",
"context.blogger_info = frappe.get_doc('Blogger', self.blogger).as_dict()\n",
"context.descriptio... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@require_POST...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_51 = datetime.datetime.now()\n",
"VAR_52 = VAR_0.POST.copy()\n",
"VAR_1 = VAR_52.get('content_type')\n",
"VAR_53 = VAR_52.get('value_type', 'str')\n",
"VAR_54 = VAR_52.get('object_pk')\n",
"VAR_55 = VAR_52.get('field')\n",
"VAR_45 = VAR_52.get('v... | [
"@require_POST...\n",
"\"\"\"docstring\"\"\"\n",
"now = datetime.datetime.now()\n",
"data = request.POST.copy()\n",
"ctype = data.get('content_type')\n",
"vtype = data.get('value_type', 'str')\n",
"object_pk_str = data.get('object_pk')\n",
"field = data.get('field')\n",
"value = data.get('value')\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
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Cond... |
[
"def FUNC_0():...\n",
"VAR_6 = odict({'id': 1, 'url':\n 'https://www.mozilla.org/en-US/firefox/central/', 'title': None,\n 'rev_host': 'gro.allizom.www.', 'visit_count': 0, 'hidden': 0, 'typed':\n 0, 'favicon_id': None, 'frecency': 76, 'last_visit_date': None, 'guid':\n 'NNqZA_f2KHI1', 'foreign_count'... | [
"def create_test_data():...\n",
"test_record = odict({'id': 1, 'url':\n 'https://www.mozilla.org/en-US/firefox/central/', 'title': None,\n 'rev_host': 'gro.allizom.www.', 'visit_count': 0, 'hidden': 0, 'typed':\n 0, 'favicon_id': None, 'frecency': 76, 'last_visit_date': None, 'guid':\n 'NNqZA_f2KHI1',... | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4, VAR_5, VAR_4 = parse_magnetlink(\n 'magnet:?xt=urn:btih:APCTQFWNOWUBXZOIDAZGAJ2BA6FS6JUC')\n",
"self.assertEqual(VAR_5, \"\\x03Å8\\x16Íu¨\\x1båÈ\\x182`'A\\x07\\x8b/&\\x82\")\n"
] | [
"def test_parse_magnetlink_uppercase(self):...\n",
"\"\"\"docstring\"\"\"\n",
"_, hashed, _ = parse_magnetlink(\n 'magnet:?xt=urn:btih:APCTQFWNOWUBXZOIDAZGAJ2BA6FS6JUC')\n",
"self.assertEqual(hashed, \"\\x03Å8\\x16Íu¨\\x1båÈ\\x182`'A\\x07\\x8b/&\\x82\")\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_19(self):...\n",
"print('INFO: Reconnecting...')\n",
"return DeadConnectionDetector.reconnect(self)\n"
] | [
"def reconnect(self):...\n",
"print('INFO: Reconnecting...')\n",
"return DeadConnectionDetector.reconnect(self)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self.get_pct_checked_numeric() >= self.QA_COMPLETE_PERCENTAGE * 100\n"
] | [
"def get_qa_status(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self.get_pct_checked_numeric() >= self.QA_COMPLETE_PERCENTAGE * 100\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_0(self, VAR_4):...\n",
""
] | [
"def run(self, headers):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_16(self):...\n",
"return sum(e.max_points for e in self.exercises)\n"
] | [
"def max_sum(self):...\n",
"return sum(e.max_points for e in self.exercises)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_14():...\n",
"self.logger.info('recursing', VAR_52='5b8498e4-868d-413c-a67e-004516b8452c',\n VAR_56=len(self.pending), have=len(self.have) - len(self.running),\n running=len(self.running))\n"
] | [
"def log():...\n",
"self.logger.info('recursing', uuid='5b8498e4-868d-413c-a67e-004516b8452c',\n pending=len(self.pending), have=len(self.have) - len(self.running),\n running=len(self.running))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(VAR_29, VAR_30, VAR_31, VAR_32, VAR_33):...\n",
"VAR_31.pack_forget()\n",
"VAR_10.forget()\n",
"VAR_40 = VAR_32, VAR_33\n",
"for key, value in VAR_25.items():\n",
"if value == VAR_40:\n",
"FUNC_5(VAR_29, VAR_32, VAR_33)\n",
"key.destroy()\n",
"FUNC_4(VAR_30)\n",
"VAR_41 = Label(VAR_15,... | [
"def add_recipe(recipe, ingredients, view, row, column):...\n",
"view.pack_forget()\n",
"viewRecipeFrame.forget()\n",
"searchIndex = row, column\n",
"for key, value in buttonDict.items():\n",
"if value == searchIndex:\n",
"save_weeks_recipes(recipe, row, column)\n",
"key.destroy()\n",
"save_ingredie... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"For",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"VAR_6 = self.client.get('/api/apps')\n",
"self.assertEqual(VAR_6.status_code, 200)\n",
"self.assertEqual(len(VAR_6.data['results']), 2)\n",
"VAR_8 = VAR_6.data['results'][0]['id']\n",
"self.assertTrue(self.client.login(VAR_1='autotest-2', VAR_2='password'))\n",
"VAR_6 = self.c... | [
"def test_create(self):...\n",
"response = self.client.get('/api/apps')\n",
"self.assertEqual(response.status_code, 200)\n",
"self.assertEqual(len(response.data['results']), 2)\n",
"app_id = response.data['results'][0]['id']\n",
"self.assertTrue(self.client.login(username='autotest-2', password='password'... | [
0,
5,
0,
0,
0,
5,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"For",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"For",
"Assign'",
"Expr'"
] |
[
"\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n",
"from __future__ import unicode_literals\n",
"import json\n",
"from django.test import TestCase\n",
"from api.models import Key\n",
"from api.utils import fingerprint\n",
"VAR_0 = 'string'\n",
"VAR_1... | [
"\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n",
"from __future__ import unicode_literals\n",
"import json\n",
"from django.test import TestCase\n",
"from api.models import Key\n",
"from api.utils import fingerprint\n",
"RSA_PUBKEY = (\n 'ssh-rsa ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
5,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
5,
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'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"... |
[
"def __init__(self, VAR_0, VAR_1):...\n",
"self.has_rows = VAR_1 is not None\n",
"self.keys = VAR_0\n",
"self.rows = VAR_1\n"
] | [
"def __init__(self, keys, rows):...\n",
"self.has_rows = rows is not None\n",
"self.keys = keys\n",
"self.rows = rows\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = os.path.join(DATA_DIRE, VAR_0 + '.db')\n",
"return VAR_14\n"
] | [
"def db_path(name):...\n",
"\"\"\"docstring\"\"\"\n",
"fil = os.path.join(DATA_DIRE, name + '.db')\n",
"return fil\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_2():...\n",
"VAR_9 = []\n",
"VAR_14 = re.compile('^.+SYS_(?P<syscall_name>[^ ]+)')\n",
"VAR_25 = FUNC_0(VAR_0['syscall_header_file'])\n",
"for line in VAR_25.split('\\n'):\n",
"VAR_24 = VAR_14.match(line)\n",
"return VAR_9\n",
"if VAR_24:\n",
"VAR_9.append(VAR_24.group('syscall_name'))\n"
... | [
"def parse_syscall_names():...\n",
"syscall_names = []\n",
"syscall_name_regex = re.compile('^.+SYS_(?P<syscall_name>[^ ]+)')\n",
"content = read_file_content(CONFIG['syscall_header_file'])\n",
"for line in content.split('\\n'):\n",
"match = syscall_name_regex.match(line)\n",
"return syscall_names\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"VAR_5 = database.users.get_current_user()\n",
"if VAR_5:\n",
"VAR_3 = db.get(db.Key.from_path('Item', int(cgi.escape(self.request.get(\n 'item_id')))))\n",
"self.redirect('/')\n",
"VAR_3.title = cgi.escape(self.request.get('title'))\n",
"VAR_3.description = cgi.escape(self.... | [
"def post(self):...\n",
"user = database.users.get_current_user()\n",
"if user:\n",
"item = db.get(db.Key.from_path('Item', int(cgi.escape(self.request.get(\n 'item_id')))))\n",
"self.redirect('/')\n",
"item.title = cgi.escape(self.request.get('title'))\n",
"item.description = cgi.escape(self.request... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"VAR_1 = '¡'\n",
"VAR_2 = VAR_1.encode('utf-8')\n",
"VAR_3 = VAR_1 if PY3 else VAR_2\n",
"self.assertEqual(os.environ['XXX'], VAR_3)\n",
"self.assertIn('AAA', os.environ)\n",
"self.assertEqual(os.environ['AAA'], VAR_3)\n",
"self.assertEqual(os.environ['XXX'], VAR_3)\n"
] | [
"def test_hermetic_environment_unicode(self):...\n",
"UNICODE_CHAR = '¡'\n",
"ENCODED_CHAR = UNICODE_CHAR.encode('utf-8')\n",
"expected_output = UNICODE_CHAR if PY3 else ENCODED_CHAR\n",
"self.assertEqual(os.environ['XXX'], expected_output)\n",
"self.assertIn('AAA', os.environ)\n",
"self.assertEqual(os.... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_43(VAR_127, VAR_96):...\n",
"for VAR_121 in VAR_127['events']:\n",
"if all([(match in VAR_121) for match in VAR_96]):\n",
"return None\n",
"return VAR_121\n"
] | [
"def get_event(events, matches):...\n",
"for e in events['events']:\n",
"if all([(match in e) for match in matches]):\n",
"return None\n",
"return e\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"For",
"Return'",
"Return'"
] |
[
"def FUNC_16(self, VAR_66):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_99 = snakemake.io.load_configfile(VAR_66)\n",
"update_config(VAR_85, VAR_99)\n",
"update_config(VAR_85, self.overwrite_config)\n"
] | [
"def configfile(self, jsonpath):...\n",
"\"\"\"docstring\"\"\"\n",
"c = snakemake.io.load_configfile(jsonpath)\n",
"update_config(config, c)\n",
"update_config(config, self.overwrite_config)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@property...\n",
"return itertools.chain(*(pe.jvm_locations for pe in self.\n _possible_environments))\n"
] | [
"@property...\n",
"return itertools.chain(*(pe.jvm_locations for pe in self.\n _possible_environments))\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_30(self, VAR_78):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.version = VAR_78\n",
"return VAR_101\n"
] | [
"def version(self, version):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.version = version\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_10(self, VAR_7):...\n",
"VAR_19 = ','.join([VAR_45.encode('utf-8') for VAR_45 in VAR_7.values.keys()])\n",
"VAR_20 = ','.join([VAR_45.encode('utf-8') for VAR_45 in VAR_7.values.values()])\n",
"VAR_21 = 'INSERT INTO {0} ({1}) VALUES ({2})'.format(VAR_7.model_class.\n _meta.table_name, VAR_19, VAR_... | [
"def generate_insert(self, query):...\n",
"keys = ','.join([x.encode('utf-8') for x in query.values.keys()])\n",
"values = ','.join([x.encode('utf-8') for x in query.values.values()])\n",
"str_query = 'INSERT INTO {0} ({1}) VALUES ({2})'.format(query.model_class.\n _meta.table_name, keys, values)\n",
"if... | [
0,
0,
4,
4,
0,
4,
0,
0,
0,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"AugAssign'",
"Condition",
"AugAssign'",
"AugAssign'",
"Return'"
] |
[
"def FUNC_6():...\n",
"VAR_13.throw(_('Invalid Search Field'), VAR_13.DataError)\n"
] | [
"def _raise_exception():...\n",
"frappe.throw(_('Invalid Search Field'), frappe.DataError)\n"
] | [
0,
4
] | [
"FunctionDef'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._observables\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._observables\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"VAR_13 = threading.Thread(target=self._periodically_flush_profile_events,\n name='ray_push_profiling_information')\n",
"VAR_13.daemon = True\n",
"VAR_13.start()\n"
] | [
"def start_flush_thread(self):...\n",
"t = threading.Thread(target=self._periodically_flush_profile_events, name=\n 'ray_push_profiling_information')\n",
"t.daemon = True\n",
"t.start()\n"
] | [
0,
6,
6,
6
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_8(self, VAR_12=False):...\n",
"VAR_86 = self.rules\n",
"if VAR_12:\n",
"VAR_86 = filterfalse(Rule.has_wildcards, VAR_86)\n",
"for VAR_13 in VAR_86:\n",
"logger.rule_info(VAR_10=rule.name, docstring=rule.docstring)\n"
] | [
"def list_rules(self, only_targets=False):...\n",
"rules = self.rules\n",
"if only_targets:\n",
"rules = filterfalse(Rule.has_wildcards, rules)\n",
"for rule in rules:\n",
"logger.rule_info(name=rule.name, docstring=rule.docstring)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"For",
"Docstring"
] |
[
"def FUNC_5(VAR_8, VAR_7):...\n",
"shutil.copyfileobj(file_in, file_out)\n"
] | [
"def decompress_gzip(local_file_gz, local_file):...\n",
"shutil.copyfileobj(file_in, file_out)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"VAR_1 = 'http://my.url.com'\n",
"VAR_2 = 'True'\n",
"url_helper.urllib2.urlopen(VAR_1, mox.IgnoreArg(), timeout=mox.IgnoreArg()\n ).AndReturn(StringIO.StringIO(VAR_2))\n",
"self._mox.ReplayAll()\n",
"self.assertEqual(url_helper.UrlOpen(VAR_1, method='POST'), VAR_2)\n",
"sel... | [
"def testUrlOpenPOSTSuccess(self):...\n",
"url = 'http://my.url.com'\n",
"response = 'True'\n",
"url_helper.urllib2.urlopen(url, mox.IgnoreArg(), timeout=mox.IgnoreArg()\n ).AndReturn(StringIO.StringIO(response))\n",
"self._mox.ReplayAll()\n",
"self.assertEqual(url_helper.UrlOpen(url, method='POST'), r... | [
0,
0,
0,
5,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_24(self, VAR_16):...\n",
""
] | [
"def local_path(self, volume):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_13(VAR_20, VAR_21):...\n",
"VAR_16 = {}\n",
"VAR_17 = [('manager', VAR_21)]\n",
"VAR_47 = FUNC_14(VAR_20)\n",
"FUNC_8('dataset/%d/managers/add' % VAR_47, VAR_17=files, VAR_16=args)\n"
] | [
"def add_manager(task_id, manager):...\n",
"args = {}\n",
"files = [('manager', manager)]\n",
"dataset_id = get_task_active_dataset_id(task_id)\n",
"admin_req('dataset/%d/managers/add' % dataset_id, files=files, args=args)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_2, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"super(CLASS_6, self).__init__(VAR_2)\n",
"self.hostname = VAR_3\n",
"self.message = 'Component %s crashed on remote host %s' % (VAR_2, VAR_3)\n"
] | [
"def __init__(self, comp_name, hostname):...\n",
"\"\"\"docstring\"\"\"\n",
"super(RemoteCrashEvent, self).__init__(comp_name)\n",
"self.hostname = hostname\n",
"self.message = 'Component %s crashed on remote host %s' % (comp_name, hostname)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_1(VAR_3, VAR_4=1):...\n",
"VAR_35 = 0\n",
"VAR_36 = VAR_4\n",
"while VAR_35 <= 30:\n",
"VAR_7 = VAR_3.replace('###', str(VAR_4))\n",
"return VAR_36\n",
"print('about to check url {}'.format(VAR_7))\n",
"if VAR_1:\n",
"print('start is ' + str(VAR_4))\n",
"VAR_6, VAR_45 = FUNC_5(VAR_7)\n",... | [
"def _get_last_valid_url(base_url, start=1):...\n",
"invalid_count = 0\n",
"end = start\n",
"while invalid_count <= 30:\n",
"url = base_url.replace('###', str(start))\n",
"return end\n",
"print('about to check url {}'.format(url))\n",
"if debug:\n",
"print('start is ' + str(start))\n",
"data, stat... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"@api.public...\n",
"FUNC_31(self, 'PUT')\n"
] | [
"@api.public...\n",
"record(self, 'PUT')\n"
] | [
0,
0
] | [
"Condition",
"Expr'"
] |
[
"def FUNC_5(self, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"self.lasttok = VAR_3.type\n",
"return VAR_3\n"
] | [
"def t_LPAR(self, tok):...\n",
"\"\"\"docstring\"\"\"\n",
"self.lasttok = tok.type\n",
"return tok\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = self.language\n",
"VAR_12 = 'ru-RU' if self.language == 'en-US' else 'en-US'\n",
"log.info('Changing user %s language from %s to %s...', self, VAR_11, VAR_12)\n",
"self.set_language(VAR_12)\n",
"return VAR_12\n"
] | [
"def switch_language(self):...\n",
"\"\"\"docstring\"\"\"\n",
"curr_lang = self.language\n",
"new_lang = 'ru-RU' if self.language == 'en-US' else 'en-US'\n",
"log.info('Changing user %s language from %s to %s...', self, curr_lang,\n new_lang)\n",
"self.set_language(new_lang)\n",
"return new_lang\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def __str__(self):...\n",
"return self.get_name()\n"
] | [
"def __str__(self):...\n",
"return self.get_name()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_7, VAR_54=None, VAR_55=None, *VAR_15, **VAR_16):...\n",
"self.min = VAR_54\n",
"self.max = VAR_55\n",
"CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n"
] | [
"def __init__(self, param, min=None, max=None, *a, **kw):...\n",
"self.min = min\n",
"self.max = max\n",
"Validator.__init__(self, param, *a, **kw)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.getboolean(self.section, 'syslog_debug')\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self.config.getboolean(self.section, 'syslog_debug')\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"for VAR_5 in self.groups:\n",
"self.add_group(VAR_5)\n"
] | [
"def populate_ancestors(self):...\n",
"for group in self.groups:\n",
"self.add_group(group)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"if self.redirected_to is None:\n",
"return None\n",
"VAR_14 = self.redirected_to.split('&')\n",
"if len(VAR_14) != 2:\n",
"VAR_0.warning(\"Redirected to an unexpected page: `%s'\", self.redirected_to)\n",
"VAR_21 = decrypt_number(VAR_14[-1])\n",
"VAR_0.warning(\"Unable to de... | [
"def get_user_test_id(self):...\n",
"if self.redirected_to is None:\n",
"return None\n",
"p = self.redirected_to.split('&')\n",
"if len(p) != 2:\n",
"logger.warning(\"Redirected to an unexpected page: `%s'\", self.redirected_to)\n",
"user_test_id = decrypt_number(p[-1])\n",
"logger.warning(\"Unable to... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'",
"Return'",
"Return'"
] |
[
"def FUNC_7(self, VAR_7=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from .qa_group import QAGroup\n",
"from .extracted_text import ExtractedText\n",
"VAR_10 = self\n",
"if QAGroup.objects.filter(extraction_script=es).count() == 1:\n",
"return QAGroup.objects.get(extraction_script=es)\n",
"if QAGroup.obj... | [
"def create_qa_group(self, force_doc_id=None):...\n",
"\"\"\"docstring\"\"\"\n",
"from .qa_group import QAGroup\n",
"from .extracted_text import ExtractedText\n",
"es = self\n",
"if QAGroup.objects.filter(extraction_script=es).count() == 1:\n",
"return QAGroup.objects.get(extraction_script=es)\n",
"if... | [
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",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"For",
"For",
"Expr'",
"Assign'",
"Assign'",
"Return'",
"A... |
[
"def __virtual__():...\n",
"\"\"\"docstring\"\"\"\n",
"if salt.utils.is_windows():\n",
"return False\n",
"return 'disk'\n"
] | [
"def __virtual__():...\n",
"\"\"\"docstring\"\"\"\n",
"if salt.utils.is_windows():\n",
"return False\n",
"return 'disk'\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_6(VAR_14, VAR_15, VAR_18=True):...\n",
"warn('string')\n",
"return FUNC_5(VAR_14, VAR_15, VAR_18)\n"
] | [
"def smartGrid(dims, files, implicitFillWidth=True):...\n",
"warn(\n 'Image Frame: PIL support not yet implemented, falling back to basic grid. Some images may be distorted.'\n )\n",
"return grid(dims, files, implicitFillWidth)\n"
] | [
0,
2,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_7(self, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = []\n",
"for entry in self.entries:\n",
"if entry.tag_name == VAR_9:\n",
"return VAR_19\n",
"VAR_19.append(entry.value)\n"
] | [
"def get_tag(self, tagname):...\n",
"\"\"\"docstring\"\"\"\n",
"values = []\n",
"for entry in self.entries:\n",
"if entry.tag_name == tagname:\n",
"return values\n",
"values.append(entry.value)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_24(VAR_25, VAR_23, *VAR_24):...\n",
"if VAR_23 == 'on_after_task':\n",
"VAR_50, VAR_51, VAR_5, VAR_52 = VAR_24\n",
"self.assertEqual(False, VAR_50)\n",
"self.assertEqual(True, VAR_51)\n",
"self.assertEqual({'pool': 'default'}, VAR_5)\n",
"self.assertEqual({}, VAR_52)\n"
] | [
"def call_hook(_botobj, name, *args):...\n",
"if name == 'on_after_task':\n",
"failure, internal_failure, dimensions, summary = args\n",
"self.assertEqual(False, failure)\n",
"self.assertEqual(True, internal_failure)\n",
"self.assertEqual({'pool': 'default'}, dimensions)\n",
"self.assertEqual({}, summar... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_21(self, VAR_28):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_70 = ''\n",
"VAR_58 = VAR_28,\n",
"if self.execute('SELECT script_log FROM history WHERE nzo_id=?', VAR_58):\n",
"return VAR_70\n",
"VAR_70 = zlib.decompress(self.c.fetchone().get('script_log'))\n"
] | [
"def get_script_log(self, nzo_id):...\n",
"\"\"\"docstring\"\"\"\n",
"data = ''\n",
"t = nzo_id,\n",
"if self.execute('SELECT script_log FROM history WHERE nzo_id=?', t):\n",
"return data\n",
"data = zlib.decompress(self.c.fetchone().get('script_log'))\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.