lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "def FUNC_5(self, VAR_1, VAR_2, VAR_8=None, VAR_9='form', VAR_4=None, VAR_14...\n", "VAR_29 = super(CLASS_0, self).fields_view_get(VAR_1, VAR_2, VAR_8, VAR_9,\n VAR_4, VAR_14=toolbar, VAR_15=submenu)\n", "if VAR_4 is None:\n", "VAR_4 = {}\n", "if 'location' in VAR_4 and VAR_4['location']:\n", "VAR_51 =...
[ "def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=...\n", "res = super(product_product, self).fields_view_get(cr, uid, view_id,\n view_type, context, toolbar=toolbar, submenu=submenu)\n", "if context is None:\n", "context = {}\n", "if 'location' in context and context['location'...
[ 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 ]
[ "For", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Condition", "Condition", "Condition", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Condition...
[ "def FUNC_5(VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "if 'CF-Cache-Status' in VAR_6.headers or 'CF-RAY' in VAR_6.headers:\n", "return False\n", "return True\n" ]
[ "def validate_not_using_cdn(page):...\n", "\"\"\"docstring\"\"\"\n", "if 'CF-Cache-Status' in page.headers or 'CF-RAY' in page.headers:\n", "return False\n", "return True\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Return'" ]
[ "def FUNC_35(self):...\n", "\"\"\"docstring\"\"\"\n", "pyodbc.lowercase = True\n", "self.cursor = self.cnxn.cursor()\n", "self.cursor.execute('create table t1(Abc int, dEf int)')\n", "self.cursor.execute('select * from t1')\n", "VAR_27 = [VAR_31[0] for VAR_31 in self.cursor.description]\n", "VAR_27.so...
[ "def test_lower_case(self):...\n", "\"\"\"docstring\"\"\"\n", "pyodbc.lowercase = True\n", "self.cursor = self.cnxn.cursor()\n", "self.cursor.execute('create table t1(Abc int, dEf int)')\n", "self.cursor.execute('select * from t1')\n", "names = [t[0] for t in self.cursor.description]\n", "names.sort()...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'" ]
[ "def FUNC_26(self):...\n", "return 'management/get_tag.html', TestPlan.objects.get(pk=self.object_pk)\n" ]
[ "def plan(self):...\n", "return 'management/get_tag.html', TestPlan.objects.get(pk=self.object_pk)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_8(VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_9(*VAR_13, **VAR_14):...\n", "VAR_15 = 'memory alloced: %s kb' % str(gc.mem_alloc() / 1024)\n", "VAR_16 = 'memory free: %s kb' % str(gc.mem_free() / 1024)\n", "gc.collect()\n", "VAR_17 = 'after collect: %s kb available' % str(gc.mem_free() ...
[ "def mem_analyze(func):...\n", "\"\"\"docstring\"\"\"\n", "def wrapper(*args, **kwargs):...\n", "memory_alloc = 'memory alloced: %s kb' % str(gc.mem_alloc() / 1024)\n", "memory_free = 'memory free: %s kb' % str(gc.mem_free() / 1024)\n", "gc.collect()\n", "memory_after_collect = 'after collect: %s kb ava...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_8(self):...\n", "\"\"\"docstring\"\"\"\n", "self.assertTrue(self.client.login(username='autotest2', password='password'))\n", "VAR_4 = 'autotest'\n", "VAR_2 = '/api/apps'\n", "VAR_5 = {'id': VAR_4}\n", "VAR_3 = self.client.post(VAR_2, json.dumps(VAR_5), content_type=\n 'application/json')\n...
[ "def test_admin_can_manage_other_apps(self):...\n", "\"\"\"docstring\"\"\"\n", "self.assertTrue(self.client.login(username='autotest2', password='password'))\n", "app_id = 'autotest'\n", "url = '/api/apps'\n", "body = {'id': app_id}\n", "response = self.client.post(url, json.dumps(body), content_type=\n...
[ 0, 0, 5, 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'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_15(self):...\n", "" ]
[ "def testDownloadFileDownloadError(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_2(self):...\n", "self.result.update({'campaign_id': self.campaign['id'], 'aux_output': '',\n 'data_diff': None, 'debugger_output': '', 'detected_errors': None,\n 'dut_output': '', 'num_injections': None, 'outcome_category':\n 'Incomplete', 'outcome': 'Incomplete', 'timestamp': None})\n", "sel...
[ "def __create_result(self):...\n", "self.result.update({'campaign_id': self.campaign['id'], 'aux_output': '',\n 'data_diff': None, 'debugger_output': '', 'detected_errors': None,\n 'dut_output': '', 'num_injections': None, 'outcome_category':\n 'Incomplete', 'outcome': 'Incomplete', 'timestamp': None})\n...
[ 0, 2, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "@VAR_0.route('/level-1/login', methods=['POST'])...\n", "VAR_19 = CLASS_1.query.get(request.form['account'])\n", "if VAR_19:\n", "if request.form['password'] == VAR_19.pwd:\n", "return redirect(VAR_4 + 'level-1/index')\n", "if int(current_user.level1_progress) <= 1 and str(request.form['account']\n", "...
[ "@app.route('/level-1/login', methods=['POST'])...\n", "user = BMailUser.query.get(request.form['account'])\n", "if user:\n", "if request.form['password'] == user.pwd:\n", "return redirect(url_prefix + 'level-1/index')\n", "if int(current_user.level1_progress) <= 1 and str(request.form['account']\n", "c...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "For", "Return'", "For", "Assign'", "Return'", "Expr'" ]
[ "def FUNC_0(self, VAR_1, VAR_2, VAR_3, VAR_4=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_4 is None:\n", "VAR_4 = {}\n", "VAR_17 = self.pool.get('product.product').browse(VAR_1, VAR_2, VAR_3, VAR_4\n =context)\n", "VAR_18 = (VAR_17.property_stock_account_input and VAR_17.\n property_stock_accoun...
[ "def get_product_accounts(self, cr, uid, product_id, context=None):...\n", "\"\"\"docstring\"\"\"\n", "if context is None:\n", "context = {}\n", "product_obj = self.pool.get('product.product').browse(cr, uid, product_id,\n context=context)\n", "stock_input_acc = (product_obj.property_stock_account_inpu...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "@property...\n", "return self._result_getter()\n" ]
[ "@property...\n", "return self._result_getter()\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_8(self, VAR_4, VAR_5):...\n", "if VAR_4 == 'ansible_group_priority':\n", "self.set_priority(int(VAR_5))\n", "self.vars[VAR_4] = VAR_5\n" ]
[ "def set_variable(self, key, value):...\n", "if key == 'ansible_group_priority':\n", "self.set_priority(int(value))\n", "self.vars[key] = value\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'" ]
[ "def FUNC_4(self, VAR_4):...\n", "if is_sqlite(VAR_4):\n", "VAR_7 = self._sqlite_engine_cache.get_or_set(VAR_4, lambda : self.\n _create_sqlite_engine(VAR_4))\n", "VAR_7 = create_engine(VAR_4)\n", "return VAR_7\n" ]
[ "def _get_engine(self, connection_url):...\n", "if is_sqlite(connection_url):\n", "engine = self._sqlite_engine_cache.get_or_set(connection_url, lambda : self\n ._create_sqlite_engine(connection_url))\n", "engine = create_engine(connection_url)\n", "return engine\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "from django.conf import settings\n", "from django.contrib import messages\n", "from django.core.exceptions import MultipleObjectsReturned, PermissionDenied\n", "from django.http.response import Http404, HttpResponse\n", "from django.shortcuts import get_object_or_404\n", "from django.utils.decorators imp...
[ "from django.conf import settings\n", "from django.contrib import messages\n", "from django.core.exceptions import MultipleObjectsReturned, PermissionDenied\n", "from django.http.response import Http404, HttpResponse\n", "from django.shortcuts import get_object_or_404\n", "from django.utils.decorators imp...
[ 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'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFro...
[ "def FUNC_1(self):...\n", "self.clear_cookie('user')\n" ]
[ "def delete_session_cookie(self):...\n", "self.clear_cookie('user')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_1(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_15 = ['hp3par_api_url', 'hp3par_username', 'hp3par_password', 'san_ip',\n 'san_login', 'san_password']\n", "self.common.check_flags(self.configuration, VAR_15)\n" ]
[ "def _check_flags(self):...\n", "\"\"\"docstring\"\"\"\n", "required_flags = ['hp3par_api_url', 'hp3par_username', 'hp3par_password',\n 'san_ip', 'san_login', 'san_password']\n", "self.common.check_flags(self.configuration, required_flags)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_5(self):...\n", "VAR_15 = []\n", "for VAR_6 in self.actors.keys():\n", "VAR_15 = VAR_15 + self.actors[VAR_6].draw()\n", "return VAR_15\n" ]
[ "def draw(self):...\n", "drawings = []\n", "for ID in self.actors.keys():\n", "drawings = drawings + self.actors[ID].draw()\n", "return drawings\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'" ]
[ "from __future__ import absolute_import, division\n", "from abc import abstractmethod\n", "from PyQt5.QtCore import QAbstractTableModel, QModelIndex, Qt, pyqtSignal\n", "from TriblerGUI.defs import ACTION_BUTTONS\n", "from TriblerGUI.utilities import format_size, pretty_date\n", "\"\"\"string\"\"\"\n", ...
[ "from __future__ import absolute_import, division\n", "from abc import abstractmethod\n", "from PyQt5.QtCore import QAbstractTableModel, QModelIndex, Qt, pyqtSignal\n", "from TriblerGUI.defs import ACTION_BUTTONS\n", "from TriblerGUI.utilities import format_size, pretty_date\n", "\"\"\"\n The base mode...
[ 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'", "Expr'", "Assign'", "FunctionDef'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "FunctionDef'", "Expr'", "Assign'", "Expr'", "FunctionDef'", "Expr'", "Expr'", "Fu...
[ "def FUNC_0(VAR_1: ISpy, VAR_2: str) ->str:...\n", "return f\"SELECT {', '.join(FUNC_1(VAR_1))} FROM {VAR_2}\"\n" ]
[ "def construct_select_statement(spy: ISpy, from_: str) ->str:...\n", "return f\"SELECT {', '.join(construct_selects(spy))} FROM {from_}\"\n" ]
[ 0, 4 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(self, VAR_6, VAR_7):...\n", "VAR_1 = None\n", "VAR_9 = []\n", "VAR_10 = []\n", "VAR_11 = []\n", "if len(VAR_7) == 0:\n", "VAR_1 = 'global'\n", "if len(VAR_7) == 1:\n", "if not VAR_1:\n", "VAR_9 = self.getOSNames(VAR_7)\n", "VAR_9 = []\n", "VAR_10 = self.getApplianceNames(VAR_7)\n",...
[ "def run(self, params, args):...\n", "scope = None\n", "oses = []\n", "appliances = []\n", "hosts = []\n", "if len(args) == 0:\n", "scope = 'global'\n", "if len(args) == 1:\n", "if not scope:\n", "oses = self.getOSNames(args)\n", "oses = []\n", "appliances = self.getApplianceNames(args)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0...
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Assign'"...
[ "def FUNC_8(self, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = []\n", "for VAR_5 in self.tid_num_to_tag_nums(self.tid_to_tid_num(VAR_3)):\n", "VAR_10.append(self.tag_num_to_tag(VAR_5))\n", "return VAR_10\n" ]
[ "def get_tags(self, tid):...\n", "\"\"\"docstring\"\"\"\n", "tags = []\n", "for tag_num in self.tid_num_to_tag_nums(self.tid_to_tid_num(tid)):\n", "tags.append(self.tag_num_to_tag(tag_num))\n", "return tags\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Expr'", "Return'" ]
[ "def FUNC_0(self, VAR_6):...\n", "if not self.logined:\n", "self._capdata = 0, 0\n", "self.log.warning('Caprate limit reached, calling dologin() for now')\n", "return\n", "self.dologin()\n" ]
[ "def on_caprate_limit(self, rate):...\n", "if not self.logined:\n", "self._capdata = 0, 0\n", "self.log.warning('Caprate limit reached, calling dologin() for now')\n", "return\n", "self.dologin()\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'", "Return'", "Expr'" ]
[ "def FUNC_31(VAR_1, VAR_16):...\n", "VAR_30 = VAR_1.xsrf_token_data == {'some': 'data'}\n", "VAR_12.append((VAR_16, VAR_30))\n" ]
[ "def record(request_handler, method):...\n", "is_valid = request_handler.xsrf_token_data == {'some': 'data'}\n", "calls.append((method, is_valid))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_4(self, VAR_9, VAR_10):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def remove_export(self, context, volume):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "def FUNC_5(self, VAR_7, VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "return self.tool_classpath_from_products(VAR_9, self._key_for_tool_version(\n VAR_7, self.version), scope=self.options_scope)\n" ]
[ "def _tool_classpath(self, tool, products):...\n", "\"\"\"docstring\"\"\"\n", "return self.tool_classpath_from_products(products, self.\n _key_for_tool_version(tool, self.version), scope=self.options_scope)\n" ]
[ 0, 0, 7 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_7(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "VAR_3 = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n", "VAR_1 = {'name': self.volume_name}\n", "self.driver._eql_execute('volume', 'select', VAR_3['volume_name'],\n 'snapshot', 'select', V...
[ "def test_create_volume_from_snapshot(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "snapshot = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n", "volume = {'name': self.volume_name}\n", "self.driver._eql_execute('volume', 'select', snapshot['volume_nam...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "def __init__(self, VAR_22):...\n", "VAR_71, VAR_72, VAR_73 = VAR_22.year, VAR_22.month, VAR_22.day\n", "self.yold = VAR_71 + 1166\n", "self.hour = VAR_22.hour\n", "self.minute = VAR_22.minute\n", "self.second = VAR_22.second\n", "if (VAR_72, VAR_73) == (2, 29):\n", "self.weekdayname = self.ST_TIBS_DA...
[ "def __init__(self, dt):...\n", "y, m, d = dt.year, dt.month, dt.day\n", "self.yold = y + 1166\n", "self.hour = dt.hour\n", "self.minute = dt.minute\n", "self.second = dt.second\n", "if (m, d) == (2, 29):\n", "self.weekdayname = self.ST_TIBS_DAY\n", "day_of_year = int(dt.strftime('%j'))\n", "if ca...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "AugAssign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_5(self, VAR_2):...\n", "" ]
[ "def cut(self, key):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_0():...\n", "VAR_1 = Context().list_devices(ID_VENDOR_ID='0403', ID_MODEL_ID='6014')\n", "VAR_2 = []\n", "for debugger in VAR_1:\n", "if 'DEVLINKS' not in debugger:\n", "return VAR_2\n", "VAR_2.append(debugger['ID_SERIAL_SHORT'])\n" ]
[ "def find_ftdi_serials():...\n", "debuggers = Context().list_devices(ID_VENDOR_ID='0403', ID_MODEL_ID='6014')\n", "serials = []\n", "for debugger in debuggers:\n", "if 'DEVLINKS' not in debugger:\n", "return serials\n", "serials.append(debugger['ID_SERIAL_SHORT'])\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "For", "Condition", "Return'", "Expr'" ]
[ "def FUNC_11(self):...\n", "VAR_4 = 'hubba-bubba'\n", "def FUNC_29():...\n", "VAR_4 = 'hubba-bubba'\n", "self.assertEquals(VAR_32['eduPersonPrincipalName'], VAR_4)\n", "self.acs('/login', VAR_4, FUNC_29)\n" ]
[ "def test_login_assertion_consumer_service(self):...\n", "eppn = 'hubba-bubba'\n", "def _check():...\n", "eppn = 'hubba-bubba'\n", "self.assertEquals(session['eduPersonPrincipalName'], eppn)\n", "self.acs('/login', eppn, _check)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "import mimetypes\n", "import os\n", "from django.contrib.gis.db.models import GeometryField\n", "from django.contrib.gis.db.models.functions import Envelope\n", "from django.core.exceptions import ObjectDoesNotExist\n", "from django.db.models.functions import Cast\n", "from django.http import HttpRespo...
[ "import mimetypes\n", "import os\n", "from django.contrib.gis.db.models import GeometryField\n", "from django.contrib.gis.db.models.functions import Envelope\n", "from django.core.exceptions import ObjectDoesNotExist\n", "from django.db.models.functions import Cast\n", "from django.http import HttpRespo...
[ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 ]
[ "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Return'" ]
[ "@classmethod...\n", "super(CLASS_0, VAR_6).register_options(VAR_8)\n" ]
[ "@classmethod...\n", "super(JavacCompile, cls).register_options(register)\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "def FUNC_1(self, VAR_2, VAR_3, VAR_4, *VAR_5):...\n", "self.write_data({'type': 'upgrader_started'})\n" ]
[ "def on_upgrader_started(self, subject, changetype, objectID, *args):...\n", "self.write_data({'type': 'upgrader_started'})\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@VAR_2.route('/data/slaves/')...\n", "VAR_24, VAR_23 = FUNC_4(request.args)\n", "VAR_30 = (VAR_23 - VAR_24).days\n", "if VAR_30 <= 8:\n", "VAR_66 = 5\n", "VAR_66 = int(round(VAR_30 * 0.4))\n", "VAR_31 = 'Only slaves with more than %d jobs are displayed.' % VAR_66\n", "VAR_28 = FUNC_0()\n", "VAR_32 ...
[ "@app.route('/data/slaves/')...\n", "start_date, end_date = clean_date_params(request.args)\n", "days_to_show = (end_date - start_date).days\n", "if days_to_show <= 8:\n", "jobs = 5\n", "jobs = int(round(days_to_show * 0.4))\n", "info = 'Only slaves with more than %d jobs are displayed.' % jobs\n", "d...
[ 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 ]
[ "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Assign'", "AugAssign'", "For", ...
[ "def FUNC_6(VAR_1, VAR_5=''):...\n", "\"\"\"docstring\"\"\"\n", "VAR_18 = VAR_17(VAR_1.name)\n", "return VAR_16.pop(VAR_18, None)\n" ]
[ "def token_delete(remote, token=''):...\n", "\"\"\"docstring\"\"\"\n", "session_key = token_session_key(remote.name)\n", "return session.pop(session_key, None)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "@session_manager...\n", "\"\"\"docstring\"\"\"\n", "from invenio.modules.accounts.models import User, UserEXT\n", "from invenio.ext.sqlalchemy import db\n", "from ..handlers import token_session_key\n", "from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound\n", "import json\n", "import r...
[ "@session_manager...\n", "\"\"\"docstring\"\"\"\n", "from invenio.modules.accounts.models import User, UserEXT\n", "from invenio.ext.sqlalchemy import db\n", "from ..handlers import token_session_key\n", "from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound\n", "import json\n", "import r...
[ 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", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Import'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Expr'", ...
[ "def __init__(self, VAR_3, VAR_4, VAR_5=None, VAR_6=None):...\n", "self.rule = VAR_3\n", "self.dag = VAR_4\n", "self.targetfile = VAR_5\n", "self.wildcards_dict = self.rule.get_wildcards(VAR_5)\n", "self.wildcards = Wildcards(fromdict=self.wildcards_dict)\n", "self._format_wildcards = self.wildcards if ...
[ "def __init__(self, rule, dag, targetfile=None, format_wildcards=None):...\n", "self.rule = rule\n", "self.dag = dag\n", "self.targetfile = targetfile\n", "self.wildcards_dict = self.rule.get_wildcards(targetfile)\n", "self.wildcards = Wildcards(fromdict=self.wildcards_dict)\n", "self._format_wildcards ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "For", "Condition", "Assign'", "Assign'", "Expr'", "Condition", "Cond...
[ "def FUNC_2(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_lowercase(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_0():...\n", "\"\"\"docstring\"\"\"\n", "VAR_8 = (\n b'\\n-----BEGIN PGP PUBLIC KEY BLOCK-----\\nVersion: GnuPG v1\\nComment: GPGTools - https://gpgtools.org\\n\\nmQINBFObJLYBEADkFW8HMjsoYRJQ4nCYC/6Eh0yLWHWfCh+/9ZSIj4w/pOe2V6V+\\nW6DHY3kK3a+2bxrax9EqKe7uxkSKf95gfns+I9+R+RJfRpb1qvljURr54y35IZgs\\nfMG...
[ "def ensure_node():...\n", "\"\"\"docstring\"\"\"\n", "key = (\n b'\\n-----BEGIN PGP PUBLIC KEY BLOCK-----\\nVersion: GnuPG v1\\nComment: GPGTools - https://gpgtools.org\\n\\nmQINBFObJLYBEADkFW8HMjsoYRJQ4nCYC/6Eh0yLWHWfCh+/9ZSIj4w/pOe2V6V+\\nW6DHY3kK3a+2bxrax9EqKe7uxkSKf95gfns+I9+R+RJfRpb1qvljURr54y35IZgs\\n...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def __init__(self, *VAR_6, **VAR_7):...\n", "super(CLASS_2, self).__init__(*VAR_6, **kwargs)\n", "self.fields['script_selection'].widget.attrs.update({'style':\n 'height:2.75rem; !important'})\n", "self.fields['clean_comp_data_file'].widget.attrs.update({'accept': '.csv'})\n", "self.collapsed = True\n" ...
[ "def __init__(self, *args, **kwargs):...\n", "super(CleanCompDataForm, self).__init__(*args, **kwargs)\n", "self.fields['script_selection'].widget.attrs.update({'style':\n 'height:2.75rem; !important'})\n", "self.fields['clean_comp_data_file'].widget.attrs.update({'accept': '.csv'})\n", "self.collapsed =...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Assign'" ]
[ "def FUNC_5(self):...\n", "VAR_8 = 'test_foo.py:FooTest.test_bar'\n", "VAR_7 = BokChoyTestSuite('', test_spec=spec)\n", "VAR_1 = 'tests/{}'.format(VAR_8)\n", "self.assertEqual(VAR_7.cmd, self._expected_command(VAR_1=name))\n" ]
[ "def test_testcase_spec(self):...\n", "spec = 'test_foo.py:FooTest.test_bar'\n", "suite = BokChoyTestSuite('', test_spec=spec)\n", "name = 'tests/{}'.format(spec)\n", "self.assertEqual(suite.cmd, self._expected_command(name=name))\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_2(VAR_1, VAR_2, VAR_3, VAR_4=False):...\n", "\"\"\"docstring\"\"\"\n", "VAR_16 = f'SELECT * FROM {VAR_2};'\n", "if VAR_4:\n", "print(VAR_16)\n", "VAR_17 = VAR_1.cursor()\n", "VAR_17.execute(VAR_16)\n", "VAR_18 = list(next(zip(*VAR_17.description)))\n", "for col in VAR_3:\n", "if col not ...
[ "def db_check(conn, table, columns, debug=False):...\n", "\"\"\"docstring\"\"\"\n", "sql = f'SELECT * FROM {table};'\n", "if debug:\n", "print(sql)\n", "cursor = conn.cursor()\n", "cursor.execute(sql)\n", "db_columns = list(next(zip(*cursor.description)))\n", "for col in columns:\n", "if col not i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'", "Assign'", "Expr'", "Assign'", "For", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_22(VAR_14, VAR_15):...\n", "VAR_37 = VAR_14.state['sleep_streak']\n", "self.assertEqual(VAR_14.remote, self.server)\n", "if VAR_37 == 5:\n", "return False\n" ]
[ "def poll_server(botobj, _):...\n", "sleep_streak = botobj.state['sleep_streak']\n", "self.assertEqual(botobj.remote, self.server)\n", "if sleep_streak == 5:\n", "return False\n" ]
[ 0, 0, 5, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Condition", "Return'" ]
[ "@utils.synchronized('3par', external=True)...\n", "" ]
[ "@utils.synchronized('3par', external=True)...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def FUNC_0(self, VAR_0='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, passwd=\n dbconfig.db_password, db=database)\n" ]
[ "def connect(self, database='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, passwd=\n dbconfig.db_password, db=database)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_15(self, VAR_33, VAR_34, VAR_35, VAR_36=nsx_client.JSONRESTClient....\n", "VAR_55 = VAR_34._conn\n", "if VAR_38:\n", "VAR_38 = jsonutils.dumps(VAR_38, sort_keys=True)\n", "VAR_55.assert_called_once(VAR_33, **{'url': url, 'verify': NSX_CERT, 'body':\n data, 'headers': headers, 'cert': None, 'tim...
[ "def assert_json_call(self, method, client, url, headers=nsx_client....\n", "cluster = client._conn\n", "if data:\n", "data = jsonutils.dumps(data, sort_keys=True)\n", "cluster.assert_called_once(method, **{'url': url, 'verify': NSX_CERT,\n 'body': data, 'headers': headers, 'cert': None, 'timeout': timeo...
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Assign'", "Expr'" ]
[ "@VAR_0.filter...\n", "return News.AUDIENCE[VAR_6]\n" ]
[ "@register.filter...\n", "return News.AUDIENCE[audience]\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_6(self, VAR_11):...\n", "VAR_33 = CLASS_43.run(self, VAR_11)\n", "if VAR_33 is None:\n", "return ''\n", "return VAR_33\n" ]
[ "def run(self, url):...\n", "val = VSanitizedUrl.run(self, url)\n", "if val is None:\n", "return ''\n", "return val\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_6(VAR_13):...\n", "return os.path.isfile(VAR_13) and os.access(VAR_13, os.X_OK)\n" ]
[ "def is_executable(path):...\n", "return os.path.isfile(path) and os.access(path, os.X_OK)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_2(self):...\n", "\"\"\"docstring\"\"\"\n", "while True:\n", "self.update_log_filenames()\n", "self.check_log_files_and_push_updates()\n", "time.sleep(1)\n" ]
[ "def run(self):...\n", "\"\"\"docstring\"\"\"\n", "while True:\n", "self.update_log_filenames()\n", "self.check_log_files_and_push_updates()\n", "time.sleep(1)\n" ]
[ 0, 0, 6, 0, 6, 6 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_26(*VAR_29, **VAR_30):...\n", "" ]
[ "def raiseOSError(*_a, **_k):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def __init__(self, VAR_1, VAR_2, VAR_3, VAR_4, VAR_5=False):...\n", "self.campaign_data = VAR_1\n", "self.result_data = VAR_2\n", "self.options = VAR_3\n", "self.aux = VAR_5\n", "self.uboot_command = (self.options.dut_uboot if not self.aux else self.\n options.aux_uboot)\n", "VAR_17 = VAR_3.dut_seri...
[ "def __init__(self, campaign_data, result_data, options, rsakey, aux=False):...\n", "self.campaign_data = campaign_data\n", "self.result_data = result_data\n", "self.options = options\n", "self.aux = aux\n", "self.uboot_command = (self.options.dut_uboot if not self.aux else self.\n options.aux_uboot)\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "AugAssign'", "Assign'" ]
[ "\"\"\"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_2(self, VAR_3, VAR_4=None, VAR_5=0):...\n", "\"\"\"docstring\"\"\"\n", "if not self.conn or not self.conn.open:\n", "self.connect()\n", "VAR_7 = self.conn.cursor()\n", "if e.args[0] in [2006, 2013]:\n", "return VAR_7\n", "VAR_7.execute(VAR_3, VAR_4)\n", "log.info(e)\n", "log.error(e)\n",...
[ "def execute_query(self, query, parameters=None, trials=0):...\n", "\"\"\"docstring\"\"\"\n", "if not self.conn or not self.conn.open:\n", "self.connect()\n", "cursor = self.conn.cursor()\n", "if e.args[0] in [2006, 2013]:\n", "return cursor\n", "cursor.execute(query, parameters)\n", "log.info(e)\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Assign'", "Condition", "Return'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "AugAssign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "import pymysql\n", "import dbconfig\n", "def FUNC_0(self, VAR_0='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, passwd=\n dbconfig.db_password, db=database)\n" ]
[ "import pymysql\n", "import dbconfig\n", "def connect(self, database='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, passwd=\n dbconfig.db_password, db=database)\n" ]
[ 0, 0, 0, 0 ]
[ "Import'", "Import'", "FunctionDef'", "Return'" ]
[ "def FUNC_12(self):...\n", "VAR_8 = VAR_3.connection\n", "VAR_9 = VAR_8.cursor()\n", "VAR_9.execute('SELECT id FROM users WHERE username=\"%s\" ' % self.username)\n", "VAR_10 = VAR_9.fetchall()\n", "return str(VAR_10[0]['id'])\n" ]
[ "def get_id(self):...\n", "conn = mysql.connection\n", "cur = conn.cursor()\n", "cur.execute('SELECT id FROM users WHERE username=\"%s\" ' % self.username)\n", "rv = cur.fetchall()\n", "return str(rv[0]['id'])\n" ]
[ 0, 0, 0, 4, 0, 4 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_0(self, VAR_0='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, passwd=\n dbconfig.db_password, db=database)\n" ]
[ "def connect(self, database='crimemap'):...\n", "return pymysql.connect(host='localhost', user=dbconfig.db_user, passwd=\n dbconfig.db_password, db=database)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_5(self, VAR_5):...\n", "if VAR_5 in self.groups:\n", "self.groups.remove(VAR_5)\n", "for oldg in VAR_5.get_ancestors():\n", "if oldg.name != 'all':\n", "for childg in self.groups:\n", "if oldg in childg.get_ancestors():\n" ]
[ "def remove_group(self, group):...\n", "if group in self.groups:\n", "self.groups.remove(group)\n", "for oldg in group.get_ancestors():\n", "if oldg.name != 'all':\n", "for childg in self.groups:\n", "if oldg in childg.get_ancestors():\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "For", "Condition", "For", "Condition" ]
[ "from __future__ import absolute_import\n", "from __future__ import division\n", "from __future__ import print_function\n", "import atexit\n", "import json\n", "import os\n", "import logging\n", "import signal\n", "import threading\n", "import time\n", "import ray\n", "import ray.ray_constants...
[ "from __future__ import absolute_import\n", "from __future__ import division\n", "from __future__ import print_function\n", "import atexit\n", "import json\n", "import os\n", "import logging\n", "import signal\n", "import threading\n", "import time\n", "import ray\n", "import ray.ray_constants...
[ 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'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "Assign'", "Expr'", "FunctionDef'", "Docstring", "Assign'", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", ...
[ "def __init__(self, *VAR_3, **VAR_4):...\n", "super(CLASS_1, self).__init__(*VAR_3, **kwargs)\n" ]
[ "def __init__(self, *args, **kwargs):...\n", "super(SanISCSIDriver, self).__init__(*args, **kwargs)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_10(self):...\n", "self.run_test_case(self.scenario.create_load_balancer())\n" ]
[ "def test_a_create_load_balancer(self):...\n", "self.run_test_case(self.scenario.create_load_balancer())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_5():...\n", "\"\"\"docstring\"\"\"\n", "VAR_7 = FUNC_4('news')\n", "if VAR_7 is not None:\n", "VAR_0 = VAR_7.cursor()\n", "if FUNC_0(VAR_0, 'DESC', 3):\n", "print('Successful creating top articles report.')\n", "print('Error creating top articles report.')\n", "if FUNC_1(VAR_0, 'DESC'):\n"...
[ "def main():...\n", "\"\"\"docstring\"\"\"\n", "conn = setup_connection('news')\n", "if conn is not None:\n", "cur = conn.cursor()\n", "if get_top_articles(cur, 'DESC', 3):\n", "print('Successful creating top articles report.')\n", "print('Error creating top articles report.')\n", "if get_top_author...
[ 0, 0, 0, 0, 0, 4, 0, 0, 4, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_11(self, VAR_15, VAR_16, VAR_17):...\n", "self.checked += 1\n", "self.curline = 0\n", "for VAR_25 in VAR_15:\n", "if pe.tok:\n", "VAR_25 = VAR_25.decode(locale.getpreferredencoding(False), errors='ignore')\n", "VAR_27 = VAR_25.find(VAR_14) + pe.tok.lexpos\n", "sys.stdout.write('%s: %d:0 %s\\...
[ "def parse_lines(self, fd, maxlines, fname):...\n", "self.checked += 1\n", "self.curline = 0\n", "for line in fd:\n", "if pe.tok:\n", "line = line.decode(locale.getpreferredencoding(False), errors='ignore')\n", "col = line.find(expr) + pe.tok.lexpos\n", "sys.stdout.write('%s: %d:0 %s\\n' % (fname, sel...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "AugAssign'", "Assign'", "For", "Condition", "Assign'", "Assign'", "Expr'", "AugAssign'", "Assign'", "AugAssign'", "Condition", "Expr'", "AugAssign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Expr'", "AugAssign'" ]
[ "def FUNC_20(self):...\n", "self._ServerCleanup()\n" ]
[ "def OnVimLeave(self):...\n", "self._ServerCleanup()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@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 FUNC_2(self):...\n", "self.uut.output_regex = 'string'\n", "self.uut.severity_map = {'I': RESULT_SEVERITY.INFO}\n", "VAR_1 = list(self.uut.process_output(['info_msg|1.0|2.3|I: Info message\\n'],\n 'a/file.py', ['original_file_lines_placeholder']))\n", "self.assertEqual(len(VAR_1), 1)\n", "self.ass...
[ "def test_custom_regex(self):...\n", "self.uut.output_regex = (\n '(?P<origin>\\\\w+)\\\\|(?P<line>\\\\d+)\\\\.(?P<column>\\\\d+)\\\\|(?P<end_line>\\\\d+)\\\\.(?P<end_column>\\\\d+)\\\\|(?P<severity>\\\\w+): (?P<message>.*)'\n )\n", "self.uut.severity_map = {'I': RESULT_SEVERITY.INFO}\n", "out = list(se...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def __db_connect__(self):...\n", "self.db = sqlite3.connect(self.db_name)\n", "self.db.row_factory = sqlite3.Row\n", "self.cursor = self.db.cursor()\n" ]
[ "def __db_connect__(self):...\n", "self.db = sqlite3.connect(self.db_name)\n", "self.db.row_factory = sqlite3.Row\n", "self.cursor = self.db.cursor()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_16(self):...\n", "VAR_7 = Pa11yCrawler('')\n", "VAR_7.get_test_course()\n", "self._mock_sh.assert_has_calls([call(\n 'wget {targz} -O {dir}demo_course.tar.gz'.format(targz=suite.\n tar_gz_file, dir=suite.imports_dir)), call(\n 'tar zxf {dir}demo_course.tar.gz -C {dir}'.format(dir=suite.impo...
[ "def test_get_test_course(self):...\n", "suite = Pa11yCrawler('')\n", "suite.get_test_course()\n", "self._mock_sh.assert_has_calls([call(\n 'wget {targz} -O {dir}demo_course.tar.gz'.format(targz=suite.\n tar_gz_file, dir=suite.imports_dir)), call(\n 'tar zxf {dir}demo_course.tar.gz -C {dir}'.format(d...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "@api_view(['GET'])...\n", "VAR_7 = utils.param_to_list(VAR_0.query_params.get('measure', None))\n", "VAR_8 = utils.param_to_list(VAR_0.query_params.get('tags', None))\n", "VAR_9 = MeasureGlobal.objects.select_related('measure')\n", "if VAR_7:\n", "VAR_9 = VAR_9.filter(measure_id__in=measures)\n", "if V...
[ "@api_view(['GET'])...\n", "measures = utils.param_to_list(request.query_params.get('measure', None))\n", "tags = utils.param_to_list(request.query_params.get('tags', None))\n", "qs = MeasureGlobal.objects.select_related('measure')\n", "if measures:\n", "qs = qs.filter(measure_id__in=measures)\n", "if t...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Return'", "Condition", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_11(self):...\n", "VAR_21 = ['vim', VAR_2]\n", "if not self.writeable:\n", "VAR_21.insert(1, '-R')\n", "subprocess.call(VAR_21)\n", "return None\n" ]
[ "def open_temp_file(self):...\n", "params = ['vim', TEMP_FILE]\n", "if not self.writeable:\n", "params.insert(1, '-R')\n", "subprocess.call(params)\n", "return None\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_1(self):...\n", "super(CLASS_0, self).setUp()\n", "self.mock(net, 'url_open', self._url_open)\n", "self.mock(net, 'url_read_json', self._url_read_json)\n", "self.mock(net, 'sleep_before_retry', lambda *VAR_10: None)\n", "self._lock = threading.Lock()\n", "self._requests = []\n" ]
[ "def setUp(self):...\n", "super(TestCase, self).setUp()\n", "self.mock(net, 'url_open', self._url_open)\n", "self.mock(net, 'url_read_json', self._url_read_json)\n", "self.mock(net, 'sleep_before_retry', lambda *_: None)\n", "self._lock = threading.Lock()\n", "self._requests = []\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'" ]
[ "@utils.synchronized('3par', external=True)...\n", "\"\"\"docstring\"\"\"\n", "self.common.client_login()\n", "VAR_25 = self._create_host(VAR_7, VAR_10)\n", "VAR_26 = self.common.create_vlun(VAR_7, VAR_25)\n", "self.common.client_logout()\n", "VAR_27 = self._get_iscsi_ip(VAR_25['name'])\n", "VAR_28 = ...
[ "@utils.synchronized('3par', external=True)...\n", "\"\"\"docstring\"\"\"\n", "self.common.client_login()\n", "host = self._create_host(volume, connector)\n", "vlun = self.common.create_vlun(volume, host)\n", "self.common.client_logout()\n", "iscsi_ip = self._get_iscsi_ip(host['name'])\n", "iscsi_ip_p...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_14(VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "return \"<input type='hidden' name='csrf' id='csrf' value='{}'>\".format(FUNC_13\n (VAR_10))\n" ]
[ "def csrf_tag(csrf):...\n", "\"\"\"docstring\"\"\"\n", "return \"<input type='hidden' name='csrf' id='csrf' value='{}'>\".format(\n csrf_hash(csrf))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "@VAR_0.route('/peti/')...\n", "VAR_9 = ''\n", "VAR_2.execute('select * from PETITION_DATA_TB')\n", "VAR_11 = VAR_2.fetchall()\n", "VAR_9 += 'string'\n", "for i in range(len(VAR_11)):\n", "VAR_9 += (\n '<tr><th scope=\"row\">{}</th><td><a href=\"/peti/a/{}\">{}</a></td></tr>'.\n format(VAR_11[i][0...
[ "@app.route('/peti/')...\n", "BODY_CONTENT = ''\n", "curs.execute('select * from PETITION_DATA_TB')\n", "result = curs.fetchall()\n", "BODY_CONTENT += (\n '<h1>새로운 청원들</h1><table class=\"table table-hover\"><thead><tr><th scope=\"col\">N</th><th scope=\"col\">Column heading</th></tr></thead><tbody>'\n ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Expr'", "Assign'", "AugAssign'", "For", "AugAssign'", "AugAssign'", "AugAssign'", "Return'" ]
[ "def FUNC_56(self):...\n", "self._test_strtype('blob', VAR_13, VAR_23(VAR_13))\n" ]
[ "def t(self):...\n", "self._test_strtype('blob', value, len(value))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_0(self):...\n", "\"\"\"docstring\"\"\"\n", "self.write(api.survey.get_all(get_email(self)))\n" ]
[ "def get(self):...\n", "\"\"\"docstring\"\"\"\n", "self.write(api.survey.get_all(get_email(self)))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'" ]
[ "@api.require(lambda : True)...\n", "" ]
[ "@api.require(lambda : True)...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def FUNC_13(self):...\n", "self.run_test_case(self.scenario.delete_server_group(), max_retries=5)\n" ]
[ "def test_x_delete_server_group(self):...\n", "self.run_test_case(self.scenario.delete_server_group(), max_retries=5)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_0(VAR_9):...\n", "VAR_11 = {unquote(x.split('=')[0]): str(unquote(x.split('=')[1])).replace(\n '+', ' ') for x in VAR_9['content'].split('&')}\n", "VAR_12 = VAR_11['job_number']\n", "VAR_27 = pd.read_sql(f'SELECT * FROM df_dilfo WHERE job_number={VAR_12}', conn\n ).iloc[0].closed\n", "VAR_27...
[ "def process_as_form(email_obj):...\n", "dict_input = {unquote(x.split('=')[0]): str(unquote(x.split('=')[1])).\n replace('+', ' ') for x in email_obj['content'].split('&')}\n", "job_number = dict_input['job_number']\n", "was_prev_closed = pd.read_sql(\n f'SELECT * FROM df_dilfo WHERE job_number={job_nu...
[ 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Assign'", "Assign'", "Condition", "AugAssign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Assign'", "Expr'", "Expr'", "Assign'", ...
[ "def FUNC_35(self):...\n", "self.cursor.execute('create table t1(i int)')\n", "self.cursor.execute('insert into t1 values (1)')\n", "VAR_4 = self.cursor.execute('delete from t1')\n", "self.assertEqual(VAR_4, self.cursor)\n" ]
[ "def test_retcursor_delete(self):...\n", "self.cursor.execute('create table t1(i int)')\n", "self.cursor.execute('insert into t1 values (1)')\n", "v = self.cursor.execute('delete from t1')\n", "self.assertEqual(v, self.cursor)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_3(self, VAR_10, VAR_11):...\n", "\"\"\"docstring\"\"\"\n", "VAR_17 = {}\n", "if not int(VAR_11['simulated-human-interaction']):\n", "VAR_17['human'] = int(VAR_11['simulated-human-interaction'])\n", "return emit_options(VAR_17)\n" ]
[ "def translate_options(self, info, options):...\n", "\"\"\"docstring\"\"\"\n", "ret = {}\n", "if not int(options['simulated-human-interaction']):\n", "ret['human'] = int(options['simulated-human-interaction'])\n", "return emit_options(ret)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Return'" ]
[ "\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n", "from __future__ import unicode_literals\n", "from django.test import TestCase\n", "from deis import __version__\n", "\"\"\"Tests middleware.py's business logic\"\"\"\n", "VAR_0 = ['tests.json']\n", "d...
[ "\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n", "from __future__ import unicode_literals\n", "from django.test import TestCase\n", "from deis import __version__\n", "\"\"\"Tests middleware.py's business logic\"\"\"\n", "fixtures = ['tests.json']\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0 ]
[ "Expr'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Expr'", "Assign'", "FunctionDef'", "Expr'", "FunctionDef'", "Docstring", "Assign'", "Expr'", "FunctionDef'", "Docstring", "Assign'", "Expr'", "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_3(VAR_4, VAR_5, *VAR_6):...\n", "VAR_14 = 'could not resolve dependency: %s' % VAR_4\n", "VAR_20 = VAR_5[VAR_6]\n", "if not VAR_20:\n", "return VAR_20\n" ]
[ "def resolve_dep(target, from_map, *args):...\n", "errmsg = 'could not resolve dependency: %s' % target\n", "ret = from_map[args]\n", "if not ret:\n", "return ret\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_19(self):...\n", "self._diag_interface.OnCursorMoved()\n" ]
[ "def OnCursorMoved(self):...\n", "self._diag_interface.OnCursorMoved()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@api.model...\n", "\"\"\"docstring\"\"\"\n", "return list(VAR_0)\n" ]
[ "@api.model...\n", "\"\"\"docstring\"\"\"\n", "return list(ADDRESS_FIELDS)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def FUNC_4(VAR_2):...\n", "VAR_7 = files.get_static_data('./static/files.html')\n", "VAR_2 = FUNC_1(VAR_2)\n", "VAR_2 = '/'\n", "if not VAR_2:\n", "VAR_2 = '/'\n", "VAR_14 = VAR_2.split('/')\n", "VAR_15 = list()\n", "while '' in VAR_14:\n", "VAR_14.remove('')\n", "VAR_14 = [''] + VAR_14\n", "...
[ "def get_final_html_async(target_path):...\n", "file_temp = files.get_static_data('./static/files.html')\n", "target_path = decode_hexed_b64_to_str(target_path)\n", "target_path = '/'\n", "if not target_path:\n", "target_path = '/'\n", "files_hierarchy = target_path.split('/')\n", "files_hierarchy_lis...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "For", "AugAssign'", "Assign'", "AugAssign'", "For", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "...
[ "def FUNC_29(VAR_13):...\n", "" ]
[ "def failing(request):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_5(VAR_6):...\n", "if re.search('[^a-zA-Z0-9]', VAR_6):\n", "if not os.path.isdir('keys/' + VAR_6):\n" ]
[ "def validateClient(client):...\n", "if re.search('[^a-zA-Z0-9]', client):\n", "if not os.path.isdir('keys/' + client):\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition" ]
[ "@login_required()...\n", "VAR_12 = DataSourceForm(VAR_0.POST or None)\n", "if VAR_12.is_valid():\n", "VAR_12.save()\n", "return render(VAR_0, VAR_1, {'form': VAR_12})\n", "return redirect('data_source_list')\n" ]
[ "@login_required()...\n", "form = DataSourceForm(request.POST or None)\n", "if form.is_valid():\n", "form.save()\n", "return render(request, template_name, {'form': form})\n", "return redirect('data_source_list')\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Expr'", "Return'", "Return'" ]
[ "import os\n", "import re\n", "import shutil\n", "from subprocess import check_call, CalledProcessError, DEVNULL\n", "import tempfile\n", "from coalib.bears.Bear import Bear\n", "from coalib.misc.Decorators import enforce_signature\n", "from coalib.misc.Shell import escape_path_argument, run_shell_com...
[ "import os\n", "import re\n", "import shutil\n", "from subprocess import check_call, CalledProcessError, DEVNULL\n", "import tempfile\n", "from coalib.bears.Bear import Bear\n", "from coalib.misc.Decorators import enforce_signature\n", "from coalib.misc.Shell import escape_path_argument, run_shell_com...
[ 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, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Ass...
[ "def FUNC_7(VAR_8):...\n", "VAR_11 = VAR_8.split('/')\n", "if len(VAR_11) == 3:\n", "VAR_15 = int(VAR_11[0])\n", "if len(VAR_11) == 1:\n", "VAR_2 = VAR_11[1]\n", "VAR_15 = 1\n", "return VAR_15, VAR_2, VAR_8\n", "VAR_8 = VAR_11[2]\n", "VAR_8 = VAR_11[0]\n", "VAR_2 = 'service'\n" ]
[ "def _parse_username(username):...\n", "username_arr = username.split('/')\n", "if len(username_arr) == 3:\n", "version = int(username_arr[0])\n", "if len(username_arr) == 1:\n", "user_type = username_arr[1]\n", "version = 1\n", "return version, user_type, username\n", "username = username_arr[2]\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Return'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_6():...\n", "if not request.method in VAR_0:\n", "return True\n", "if not request.environ.get('AUTH_TYPE') == 'cookie':\n", "return True\n", "if config.get('skip_authentication'):\n", "return True\n", "if request.environ.get('HTTP_REFERER'):\n", "VAR_7 = urlparse(request.environ.get('HTTP_...
[ "def check():...\n", "if not request.method in methods:\n", "return True\n", "if not request.environ.get('AUTH_TYPE') == 'cookie':\n", "return True\n", "if config.get('skip_authentication'):\n", "return True\n", "if request.environ.get('HTTP_REFERER'):\n", "ref_url = urlparse(request.environ.get('HT...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 5, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Assign'", "Condition", "Assign'", "Return'", "Return'", "Condition", "AugAssign'", "Condition", "Condition", "Return'" ]
[ "def FUNC_0(VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "if '<' in VAR_0:\n", "FUNC_1(VAR_0)\n", "if '>' in VAR_0:\n", "FUNC_2(VAR_0)\n", "if '>>' in VAR_0:\n", "FUNC_3(VAR_0)\n" ]
[ "def IO_redirection(cmd):...\n", "\"\"\"docstring\"\"\"\n", "if '<' in cmd:\n", "SetUpInputRedirect(cmd)\n", "if '>' in cmd:\n", "SetUpOutputRedirect(cmd)\n", "if '>>' in cmd:\n", "SetUpAppendRedirect(cmd)\n" ]
[ 0, 0, 0, 6, 0, 6, 0, 6 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Condition", "Expr'", "Condition", "Expr'" ]
[ "def FUNC_15(self, VAR_65):...\n", "if self.overwrite_workdir is None:\n", "if not os.path.exists(VAR_65):\n", "os.makedirs(VAR_65)\n", "self._workdir = VAR_65\n", "os.chdir(VAR_65)\n" ]
[ "def workdir(self, workdir):...\n", "if self.overwrite_workdir is None:\n", "if not os.path.exists(workdir):\n", "os.makedirs(workdir)\n", "self._workdir = workdir\n", "os.chdir(workdir)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_9(self):...\n", "VAR_1 = self.objects.dg.pk\n", "VAR_2 = self.client.get(f'/datagroup/{VAR_1}/').content.decode('utf8')\n", "self.assertIn('<th>Product</th>', VAR_2,\n 'Data Group should have Product column.')\n", "VAR_9 = GroupType.objects.create(title='Functional use')\n", "self.objects.dg....
[ "def test_detail_table_headers(self):...\n", "pk = self.objects.dg.pk\n", "response = self.client.get(f'/datagroup/{pk}/').content.decode('utf8')\n", "self.assertIn('<th>Product</th>', response,\n 'Data Group should have Product column.')\n", "fu = GroupType.objects.create(title='Functional use')\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_36(VAR_11):...\n", "for VAR_51, VAR_58 in VAR_11.items():\n", "if isinstance(VAR_58, str) or not isinstance(VAR_58, Iterable):\n", "VAR_58 = [VAR_58]\n", "yield [(VAR_51, VAR_16) for VAR_16 in VAR_58]\n" ]
[ "def flatten(wildcards):...\n", "for wildcard, values in wildcards.items():\n", "if isinstance(values, str) or not isinstance(values, Iterable):\n", "values = [values]\n", "yield [(wildcard, value) for value in values]\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Condition", "Assign'", "Expr'" ]
[ "import logging\n", "import traceback\n", "from django.conf import settings\n", "from django.core.mail import send_mail\n", "from django.core.urlresolvers import reverse\n", "VAR_0 = logging.getLogger('lib.email_messages')\n", "def FUNC_0(VAR_1, VAR_2, VAR_3, VAR_4=True):...\n", "\"\"\"docstring\"\"\"...
[ "import logging\n", "import traceback\n", "from django.conf import settings\n", "from django.core.mail import send_mail\n", "from django.core.urlresolvers import reverse\n", "logger = logging.getLogger('lib.email_messages')\n", "def email_course_error(request, exercise, message, exception=True):...\n", ...
[ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_0(self):...\n", "\"\"\"docstring\"\"\"\n", "return len(self.nodes)\n" ]
[ "def vcount(self):...\n", "\"\"\"docstring\"\"\"\n", "return len(self.nodes)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_5(VAR_4, *VAR_5, **VAR_6):...\n", "" ]
[ "def dummy_handler(remote, *args, **kargs):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_0(VAR_3):...\n", "@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_3...
[ "def with_timeout(f):...\n", "@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...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Return'", "Return'" ]