lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_3(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = VAR_5[:]\n",
"for request in VAR_5:\n",
"self.assertEqual(tuple, request.__class__)\n",
"self.assertEqual([], self._requests)\n",
"self.assertIn(len(request), (3, 4))\n",
"self._requests = VAR_5\n"
] | [
"def expected_requests(self, requests):...\n",
"\"\"\"docstring\"\"\"\n",
"requests = requests[:]\n",
"for request in requests:\n",
"self.assertEqual(tuple, request.__class__)\n",
"self.assertEqual([], self._requests)\n",
"self.assertIn(len(request), (3, 4))\n",
"self._requests = requests\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Expr'",
"Expr'",
"Assign'"
] |
[
"def FUNC_19(VAR_8, **VAR_11):...\n",
"\"\"\"docstring\"\"\"\n",
"return VAR_8.format(**{wildcard: '{{{},{}}}'.format(wildcard, '|'.join(\n values)) for wildcard, values in wildcards.items()})\n"
] | [
"def limit(pattern, **wildcards):...\n",
"\"\"\"docstring\"\"\"\n",
"return pattern.format(**{wildcard: '{{{},{}}}'.format(wildcard, '|'.join(\n values)) for wildcard, values in wildcards.items()})\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_21(VAR_12, VAR_14, VAR_15):...\n",
"VAR_31 = getattr(VAR_1, VAR_15, None)\n",
"if VAR_31 is not None:\n",
"VAR_12 += \"{}='{}' \".format(VAR_14, VAR_31)\n",
"return VAR_12\n"
] | [
"def _addCredential(credentials, env_key, data_key):...\n",
"value = getattr(data, data_key, None)\n",
"if value is not None:\n",
"credentials += \"{}='{}' \".format(env_key, value)\n",
"return credentials\n"
] | [
0,
0,
0,
2,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"AugAssign'",
"Return'"
] |
[
"def FUNC_0(VAR_3, VAR_4=False):...\n",
"VAR_5 = sqlite3.connect(VAR_0)\n",
"VAR_6 = VAR_5.cursor()\n",
"VAR_6.execute(VAR_3)\n",
"if VAR_4:\n",
"VAR_17 = VAR_6.fetchall()\n",
"VAR_17 = None\n",
"VAR_5.close()\n",
"VAR_5.commit()\n",
"return VAR_17\n"
] | [
"def db_execute(sql, expect_return_values=False):...\n",
"db_connection = sqlite3.connect(DB_FILE)\n",
"db_cursor = db_connection.cursor()\n",
"db_cursor.execute(sql)\n",
"if expect_return_values:\n",
"return_values = db_cursor.fetchall()\n",
"return_values = None\n",
"db_connection.close()\n",
"db_... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_6(VAR_12, VAR_2, VAR_5):...\n",
"VAR_26 = VAR_12.request.body\n",
"VAR_2 = FUNC_1(VAR_2)\n",
"def FUNC_8(VAR_4):...\n",
"if not os.path.exists('D:' + VAR_4):\n",
"return VAR_4\n",
"VAR_28 = 1\n",
"while VAR_28 < 101:\n",
"VAR_32 = re.sub('\\\\.(.*?)$', ' (%d).\\\\1' % VAR_28, VAR_4)\n",
... | [
"def save_file_async(alter_ego, target_path, file_name):...\n",
"upload_data = alter_ego.request.body\n",
"target_path = decode_hexed_b64_to_str(target_path)\n",
"def get_non_duplicate_path(file_path):...\n",
"if not os.path.exists('D:' + file_path):\n",
"return file_path\n",
"duplicate = 1\n",
"while... | [
0,
0,
0,
0,
4,
4,
4,
4,
4,
4,
4,
4,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_9(VAR_13, VAR_14, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_25 = 'string' % VAR_15\n",
"VAR_14.execute(VAR_25)\n",
"for record in VAR_14:\n",
"VAR_39 = record[0]\n",
"return VAR_39\n"
] | [
"def get_old_sourcebyinstitution_number(conn, sqlite, sourcebyinstitution):...\n",
"\"\"\"docstring\"\"\"\n",
"query = (\n \"\"\"\n SELECT\n titles\n FROM\n history\n WHERE\n sourcebyinstitution = \"%s\"\n ORDER BY\n titles DESC\n ... | [
0,
0,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"For",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_3, VAR_4):...\n",
"self.email = VAR_3\n",
"self.password = VAR_4\n"
] | [
"def __init__(self, email, password):...\n",
"self.email = email\n",
"self.password = password\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def __init__(self, *VAR_19, **VAR_46):...\n",
"super(CLASS_1, self).__init__(*VAR_19, **kwargs)\n",
"self._tags = VAR_46.get('tags', None)\n"
] | [
"def __init__(self, *args, **kwargs):...\n",
"super(MetalTemplate, self).__init__(*args, **kwargs)\n",
"self._tags = kwargs.get('tags', None)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_7(self, VAR_6, VAR_7=None, VAR_8='icon', VAR_9=None):...\n",
"if VAR_7 is None:\n",
"return self.icon\n",
"return self.aq_parent.display_icon(VAR_6, VAR_7, VAR_8, VAR_9)\n"
] | [
"def display_icon(self, REQUEST, meta_type=None, key='icon', zpt=None):...\n",
"if meta_type is None:\n",
"return self.icon\n",
"return self.aq_parent.display_icon(REQUEST, meta_type, key, zpt)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_2(VAR_4):...\n",
"VAR_5 = '<title>{0}</title>'.format(self.MAIL_ADDRESS)\n",
"VAR_6 = re.findall(VAR_5, VAR_2.written[0])\n",
"self.assertEquals(len(VAR_6), 1)\n"
] | [
"def assert_response(_):...\n",
"expected = '<title>{0}</title>'.format(self.MAIL_ADDRESS)\n",
"matches = re.findall(expected, request.written[0])\n",
"self.assertEquals(len(matches), 1)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def __init__(self):...\n",
""
] | [
"def __init__(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_0(self):...\n",
"VAR_3 = XsrfTool()\n",
"VAR_4 = users.get_current_user()\n",
"self.render('admin_delete_record.html', id=self.env.domain + '/person.',\n xsrf_token=xsrf_tool.generate_token(user.user_id(), 'admin_delete_record'))\n"
] | [
"def get(self):...\n",
"xsrf_tool = XsrfTool()\n",
"user = users.get_current_user()\n",
"self.render('admin_delete_record.html', id=self.env.domain + '/person.',\n xsrf_token=xsrf_tool.generate_token(user.user_id(), 'admin_delete_record'))\n"
] | [
0,
5,
5,
5
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_8(VAR_25, VAR_20, VAR_21, VAR_5=False, VAR_22=None, VAR_23=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_52 = [\n \"\"\"<collection><record>\n<controlfield tag=\"001\">%s</controlfield>\"\"\" %\n VAR_25]\n",
"VAR_20 = VAR_20.items()\n",
"VAR_21 = VAR_21.items()\n",
"VAR_52.append(FUNC_9(VA... | [
"def build_marc(recid, single_keywords, composite_keywords, spires=False,...\n",
"\"\"\"docstring\"\"\"\n",
"output = [\n \"\"\"<collection><record>\n<controlfield tag=\"001\">%s</controlfield>\"\"\" %\n recid]\n",
"single_keywords = single_keywords.items()\n",
"composite_keywords = composite_keywords... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_23(self):...\n",
"VAR_22 = model.Identity.from_bytes('user:peer@a.com')\n",
"@classmethod...\n",
"return [lambda _request: VAR_22]\n"
] | [
"def test_delegation_token(self):...\n",
"peer_ident = model.Identity.from_bytes('user:peer@a.com')\n",
"@classmethod...\n",
"return [lambda _request: peer_ident]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_32(VAR_6):...\n",
"VAR_22 = VAR_6.find_all('a')\n",
"for link in VAR_22:\n",
"return True\n",
"if '.onion' in link.attrs['href']:\n",
"return False\n"
] | [
"def validate_onion_address_not_in_href(page):...\n",
"links_on_landing_page = page.find_all('a')\n",
"for link in links_on_landing_page:\n",
"return True\n",
"if '.onion' in link.attrs['href']:\n",
"return False\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Return'",
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_65, VAR_7, *VAR_15, **VAR_16):...\n",
"self.cache_prefix = VAR_65\n",
"CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n"
] | [
"def __init__(self, cache_prefix, param, *a, **kw):...\n",
"self.cache_prefix = cache_prefix\n",
"Validator.__init__(self, param, *a, **kw)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"@staticmethod...\n",
"VAR_18 = 0\n",
"if VAR_13:\n",
"VAR_23 = (\"(jdk_entries.title LIKE '%\" + VAR_13 + \"%' OR \" +\n \"jdk_entries.body LIKE '%\" + VAR_13 + \"%') \")\n",
"VAR_23 = ''\n",
"VAR_18 += 1\n",
"if VAR_14:\n",
"VAR_24 = \"jdk_entries.date_last_modified >= '\" + VAR_14 + \"' \"\n",
... | [
"@staticmethod...\n",
"total_parameters = 0\n",
"if keyword:\n",
"keyword_string = (\"(jdk_entries.title LIKE '%\" + keyword + \"%' OR \" +\n \"jdk_entries.body LIKE '%\" + keyword + \"%') \")\n",
"keyword_string = ''\n",
"total_parameters += 1\n",
"if from_date:\n",
"from_date_string = \"jdk_entri... | [
0,
0,
0,
4,
0,
0,
0,
4,
0,
0,
0,
4,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"AugAssign'",
"Condition",
"Assign'",
"Assign'",
"AugAssign'",
"Condition",
"Assign'",
"Assign'",
"AugAssign'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self, VAR_15):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_29 = iter(VAR_15)\n",
"VAR_30 = next(VAR_29)\n",
"for x in VAR_29:\n",
"yield VAR_30, False\n",
"yield VAR_30, True\n",
"VAR_30 = x\n"
] | [
"def laggy_iter(self, iterable):...\n",
"\"\"\"docstring\"\"\"\n",
"it = iter(iterable)\n",
"prev = next(it)\n",
"for x in it:\n",
"yield prev, False\n",
"yield prev, True\n",
"prev = x\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Expr'",
"Expr'",
"Assign'"
] |
[
"def FUNC_2(VAR_7, VAR_8=None, VAR_9=None, VAR_10=None):...\n",
"if VAR_8 is None:\n",
"return reverse(VAR_7, VAR_9=args)\n",
"VAR_42 = VAR_8._meta.app_label\n",
"VAR_43 = '.'.join([VAR_42, 'urls'])\n",
"VAR_44 = reverse(VAR_7, VAR_43, kwargs=kw)\n",
"return ''.join(['/', VAR_42, VAR_44])\n"
] | [
"def get_url(urlname, group=None, args=None, kw=None):...\n",
"if group is None:\n",
"return reverse(urlname, args=args)\n",
"app = group._meta.app_label\n",
"urlconf = '.'.join([app, 'urls'])\n",
"url = reverse(urlname, urlconf, kwargs=kw)\n",
"return ''.join(['/', app, url])\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_18(self, VAR_38):...\n",
"\"\"\"docstring\"\"\"\n",
"return self._parse_conditions(self.AND_CONDITION, VAR_38)\n"
] | [
"def _parse_and(self, data):...\n",
"\"\"\"docstring\"\"\"\n",
"return self._parse_conditions(self.AND_CONDITION, data)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"from engineauth.strategies.google import GoogleStrategy\n",
"VAR_1 = VAR_0._load_strategy('google')\n",
"self.assertEqual(VAR_1, GoogleStrategy)\n",
"self.assertRaises(Exception, VAR_0._load_strategy, 'enron')\n",
"from engineauth.strategies.appengine_openid import AppEngineOpen... | [
"def test_load_strategy(self):...\n",
"from engineauth.strategies.google import GoogleStrategy\n",
"strategy_class = app._load_strategy('google')\n",
"self.assertEqual(strategy_class, GoogleStrategy)\n",
"self.assertRaises(Exception, app._load_strategy, 'enron')\n",
"from engineauth.strategies.appengine_o... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Assign'",
"Expr'",
"Expr'",
"ImportFrom'",
"Assign'",
"Expr'"
] |
[
"VAR_0 = 'string'\n",
"import sys, os, re\n",
"import unittest\n",
"from decimal import Decimal\n",
"from datetime import datetime, date, time\n",
"from os.path import join, getsize, dirname, abspath\n",
"from testutils import *\n",
"VAR_1 = '0123456789-abcdefghijklmnopqrstuvwxyz-'\n",
"def FUNC_0(V... | [
"usage = \"\"\"usage: %prog [options] connection_string\n\nUnit tests for SQLite using the ODBC driver from http://www.ch-werner.de/sqliteodbc\n\nTo use, pass a connection string as the parameter. The tests will create and\ndrop tables t1 and t2 as necessary. On Windows, use the 32-bit driver with\n32-bit Python a... | [
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Assign'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_12(self):...\n",
"VAR_3 = self.get_group()\n",
"return VAR_3.id if VAR_3 else 0\n"
] | [
"def get_group_id(self):...\n",
"group = self.get_group()\n",
"return group.id if group else 0\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"@api_view(['GET'])...\n",
"return FUNC_7(VAR_0, 'regional_team')\n"
] | [
"@api_view(['GET'])...\n",
"return _measure_by_org(request, 'regional_team')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_17(self):...\n",
"VAR_26 = []\n",
"self.mock(bot_main, 'post_error_task', lambda *VAR_24: VAR_26.append(VAR_24))\n",
"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.mock(bot_main, 'call_hook', FUNC_24)\n",
"se... | [
"def test_run_manifest_internal_failure(self):...\n",
"posted = []\n",
"self.mock(bot_main, 'post_error_task', lambda *args: posted.append(args))\n",
"def call_hook(_botobj, name, *args):...\n",
"if name == 'on_after_task':\n",
"failure, internal_failure, dimensions, summary = args\n",
"self.mock(bot_ma... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_19(self):...\n",
""
] | [
"def test_x_terminate_instances(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._node_ip_address\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._node_ip_address\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_4(self, VAR_3, **VAR_6):...\n",
"logging.warn('url_open(%s, %s)', VAR_3[:500], str(VAR_6)[:500])\n",
"if not self._requests:\n",
"return None\n",
"VAR_6.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == VAR_3:\n",
"self.fail('Unknown request %s' % VAR_3)\n",
"... | [
"def _url_open(self, url, **kwargs):...\n",
"logging.warn('url_open(%s, %s)', url[:500], str(kwargs)[:500])\n",
"if not self._requests:\n",
"return None\n",
"kwargs.pop('stream', None)\n",
"for i, n in enumerate(self._requests):\n",
"if n[0] == url:\n",
"self.fail('Unknown request %s' % url)\n",
"da... | [
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"For",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Return'",
"Return'"
] |
[
"def __init__(self, *VAR_0, VAR_1=None, VAR_2=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if len(VAR_0) == 2:\n",
"VAR_10, VAR_41 = VAR_0\n",
"if len(VAR_0) == 1:\n",
"self.name = VAR_10\n",
"VAR_17 = VAR_0[0]\n",
"self.workflow = VAR_41\n",
"self.name = VAR_17.name\n",
"self.docstring = None\n",
... | [
"def __init__(self, *args, lineno=None, snakefile=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if len(args) == 2:\n",
"name, workflow = args\n",
"if len(args) == 1:\n",
"self.name = name\n",
"other = args[0]\n",
"self.workflow = workflow\n",
"self.name = other.name\n",
"self.docstring = None\n",
"s... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Docstring",
"Assign'",
"Assign'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"A... |
[
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_28 = self.extract_boolean(VAR_1, 'get_extras')\n",
"VAR_32 = self.extract_boolean(VAR_1, 'get_access_list')\n",
"VAR_31 = api.nova.flavor_get(VAR_1, VAR_5, VAR_28=get_extras)\n",
"VAR_10 = VAR_31.to_dict()\n",
"if 'swap' in VAR_10 and VAR_10['sw... | [
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"get_extras = self.extract_boolean(request, 'get_extras')\n",
"get_access_list = self.extract_boolean(request, 'get_access_list')\n",
"flavor = api.nova.flavor_get(request, flavor_id, get_extras=get_extras)\n",
"result = flavor.to_dict()\n",
"if 'swa... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_3(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = '/api/apps'\n",
"VAR_5 = self.client.post(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_6 = VAR_5.data['id']\n",
"VAR_8, VAR_9 = 'eviluser', 'password'\n",
"VAR_10, VAR_11 = 'Evil', 'User'\n",
"VAR_12 = 'evil@deis.io'\n",
... | [
"def test_push_abuse(self):...\n",
"\"\"\"docstring\"\"\"\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"username, password = 'eviluser', 'password'\n",
"first_name, last_name = 'Evil', 'User'\n",
"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@staticmethod...\n",
"return FUNC_1(CLASS_0._TalkToHandlerAsync('', VAR_7, 'GET', VAR_10))\n"
] | [
"@staticmethod...\n",
"return JsonFromFuture(BaseRequest._TalkToHandlerAsync('', handler, 'GET',\n timeout))\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __new__(VAR_7, VAR_8, VAR_10, VAR_11):...\n",
"VAR_25 = super(CLASS_1, VAR_7).__new__\n",
"if VAR_8 == 'NewBase' and VAR_11 == {}:\n",
"return VAR_25(VAR_7, VAR_8, VAR_10, VAR_11)\n",
"VAR_26 = [b for b in VAR_10 if isinstance(b, CLASS_1) and not (b.__name__ ==\n 'NewBase' and b.__mro__ == (b, objec... | [
"def __new__(cls, name, bases, attrs):...\n",
"super_new = super(ResourceBase, cls).__new__\n",
"if name == 'NewBase' and attrs == {}:\n",
"return super_new(cls, name, bases, attrs)\n",
"parents = [b for b in bases if isinstance(b, ResourceBase) and not (b.\n __name__ == 'NewBase' and b.__mro__ == (b, ob... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
... |
[
"def FUNC_6(self):...\n",
"if len(self.data) == 0:\n",
"return None\n",
"return self.data.pop(len(self.data) - 1)\n"
] | [
"def pop(self):...\n",
"if len(self.data) == 0:\n",
"return None\n",
"return self.data.pop(len(self.data) - 1)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_0():...\n",
"VAR_7.pack_forget()\n",
"VAR_5.pack(expand=True, fill='both')\n",
"VAR_12 = 'meal_planner.db'\n",
"VAR_20 = conn.cursor()\n",
"VAR_21 = VAR_20.execute('SELECT * FROM recipe')\n",
"for result in [VAR_21]:\n",
"for row in result.fetchall():\n",
"conn.close()\n",
"VAR_24 = row[... | [
"def view_recipes():...\n",
"frame.pack_forget()\n",
"viewRecipeFrame.pack(expand=True, fill='both')\n",
"database_file = 'meal_planner.db'\n",
"cursor = conn.cursor()\n",
"selection = cursor.execute('SELECT * FROM recipe')\n",
"for result in [selection]:\n",
"for row in result.fetchall():\n",
"conn... | [
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"Expr'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(self, VAR_11):...\n",
"VAR_60 = SRPSession(VAR_11.username, VAR_1.uuid4(), VAR_1.uuid4(), VAR_1.\n uuid4())\n",
"return defer.succeed(LeapSession(self._leap_provider, VAR_60, None, None,\n None, None))\n"
] | [
"def requestAvatarId(self, credentials):...\n",
"leap_auth = SRPSession(credentials.username, uuid.uuid4(), uuid.uuid4(),\n uuid.uuid4())\n",
"return defer.succeed(LeapSession(self._leap_provider, leap_auth, None, None,\n None, None))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"VAR_5 = [{'targetSize': 2, 'capacity': {'min': 2, 'max': 2, 'desired': 2},\n 'replicaPoolName': self.__server_group_name, 'numReplicas': 2, 'region':\n self.TEST_REGION, 'zone': self.TEST_ZONE, 'asgName': self.\n __server_group_name, 'type': 'resizeServerGroup', 'regions': [sel... | [
"def resize_server_group(self):...\n",
"job = [{'targetSize': 2, 'capacity': {'min': 2, 'max': 2, 'desired': 2},\n 'replicaPoolName': self.__server_group_name, 'numReplicas': 2, 'region':\n self.TEST_REGION, 'zone': self.TEST_ZONE, 'asgName': self.\n __server_group_name, 'type': 'resizeServerGroup', 'reg... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_27 = VAR_1.GET.get('is_public')\n",
"VAR_27 = VAR_27 and VAR_27.lower() == 'true'\n",
"VAR_28 = VAR_1.GET.get('get_extras')\n",
"VAR_28 = bool(VAR_28 and VAR_28.lower() == 'true')\n",
"VAR_29 = api.nova.flavor_list(VAR_1, VAR_27=is_public, VAR_2... | [
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"is_public = request.GET.get('is_public')\n",
"is_public = is_public and is_public.lower() == 'true'\n",
"get_extras = request.GET.get('get_extras')\n",
"get_extras = bool(get_extras and get_extras.lower() == 'true')\n",
"flavors = api.nova.flavor_li... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_15(self):...\n",
"if not FUNC_3(self):\n",
"return None\n",
"VAR_12.add(self)\n"
] | [
"def open(self):...\n",
"if not login_get_current_user(self):\n",
"return None\n",
"runScriptWebSocketConnections.add(self)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"VAR_0 = {'granularity': 86400}\n",
"assert column_expr('tags[foo]', VAR_0.copy()\n ) == \"(tags.value[indexOf(tags.key, 'foo')] AS `tags[foo]`)\"\n",
"assert column_expr('tags[server_name]', VAR_0.copy()\n ) == '(server_name AS `tags[server_name]`)'\n",
"assert column_expr('... | [
"def test_column_expr(self):...\n",
"body = {'granularity': 86400}\n",
"assert column_expr('tags[foo]', body.copy()\n ) == \"(tags.value[indexOf(tags.key, 'foo')] AS `tags[foo]`)\"\n",
"assert column_expr('tags[server_name]', body.copy()\n ) == '(server_name AS `tags[server_name]`)'\n",
"assert column... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assign'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assign'",
"Assert'"
] |
[
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"return kato.new_agent(VAR_2)\n"
] | [
"@classmethod...\n",
"\"\"\"docstring\"\"\"\n",
"return kato.new_agent(bindings)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = []\n",
"if CLASS_0.cve_cwe_map is not None:\n",
"VAR_8 = [item[1] for item in CLASS_0.cve_cwe_map if self.get_val('cve.id') ==\n item[0]]\n",
"return VAR_8\n"
] | [
"def associate_cwes(self):...\n",
"\"\"\"docstring\"\"\"\n",
"cwe_map = []\n",
"if CVE.cve_cwe_map is not None:\n",
"cwe_map = [item[1] for item in CVE.cve_cwe_map if self.get_val('cve.id') ==\n item[0]]\n",
"return cwe_map\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_11():...\n",
"populate_test_database()\n",
"FUNC_1('first playlist')\n",
"FUNC_0(1, 'title', 'thumbnail', 1)\n",
"FUNC_0(1, 'title2', 'thumbnail2', 2)\n",
"FUNC_0(1, 'title3', 'thumbnail3', 3)\n",
"FUNC_0(1, 'title4', 'thumbnail4', 4)\n",
"VAR_11 = VAR_3.put('/videos/4/1/2')\n",
"assert VA... | [
"def test_should_update_a_video_position():...\n",
"populate_test_database()\n",
"create_playlist('first playlist')\n",
"create_video(1, 'title', 'thumbnail', 1)\n",
"create_video(1, 'title2', 'thumbnail2', 2)\n",
"create_video(1, 'title3', 'thumbnail3', 3)\n",
"create_video(1, 'title4', 'thumbnail4', 4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assert'",
"Assign'",
"Assert'",
"Assert'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = [VAR_28.mtime for VAR_28 in self.expanded_output if VAR_28.exists]\n",
"if self.benchmark and self.benchmark.exists:\n",
"VAR_17.append(self.benchmark.mtime)\n",
"if VAR_17:\n",
"return min(VAR_17)\n",
"return None\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"existing = [f.mtime for f in self.expanded_output if f.exists]\n",
"if self.benchmark and self.benchmark.exists:\n",
"existing.append(self.benchmark.mtime)\n",
"if existing:\n",
"return min(existing)\n",
"return None\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_4(self, VAR_5) ->dict:...\n",
"VAR_5 = super().clean(VAR_5)\n",
"if self.one_required and (not VAR_5 or not any(v for v in VAR_5)):\n",
"if self.require_all_fields and not all(v for v in VAR_5):\n",
"return VAR_5\n"
] | [
"def clean(self, value) ->dict:...\n",
"value = super().clean(value)\n",
"if self.one_required and (not value or not any(v for v in value)):\n",
"if self.require_all_fields and not all(v for v in value):\n",
"return value\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"For",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"if not GenericRequest.test_success(self):\n",
"return False\n",
"return self.get_submission_id() is not None\n"
] | [
"def test_success(self):...\n",
"if not GenericRequest.test_success(self):\n",
"return False\n",
"return self.get_submission_id() is not None\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_6(self):...\n",
"c.get(url_for('oauthclient.login', remote_app='test'))\n",
"self.mock_response(VAR_5='test')\n",
"self.mock_response(VAR_5='test_invalid')\n",
"VAR_1 = c.get(url_for('oauthclient.authorized', remote_app='test', code='test')\n )\n",
"assert VAR_1.data == 'TEST'\n",
"assert s... | [
"def test_authorized(self):...\n",
"c.get(url_for('oauthclient.login', remote_app='test'))\n",
"self.mock_response(app='test')\n",
"self.mock_response(app='test_invalid')\n",
"resp = c.get(url_for('oauthclient.authorized', remote_app='test', code='test'))\n",
"assert resp.data == 'TEST'\n",
"assert self... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assert'",
"Assign'"
] |
[
"def FUNC_1(VAR_0, VAR_1=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_0:\n",
"VAR_0 = uuid.uuid4().hex\n",
"return VAR_0\n",
"if type(VAR_1) in [set, dict]:\n",
"while VAR_0 in VAR_1:\n",
"VAR_0 = uuid.uuid4().hex\n"
] | [
"def get_new_uuid(uuid_, uuid_list=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if not uuid_:\n",
"uuid_ = uuid.uuid4().hex\n",
"return uuid_\n",
"if type(uuid_list) in [set, dict]:\n",
"while uuid_ in uuid_list:\n",
"uuid_ = uuid.uuid4().hex\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Return'",
"Condition",
"Condition",
"Assign'"
] |
[
"def FUNC_6(self):...\n",
"VAR_91 = Subreddit._by_fullname(VAR_102.post.keys())\n",
"return VAR_91.values()\n"
] | [
"def run(self):...\n",
"subreddits = Subreddit._by_fullname(request.post.keys())\n",
"return subreddits.values()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self, VAR_5=None, VAR_6=None, VAR_7=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.request.method == 'GET':\n",
"if VAR_5:\n",
"if VAR_6:\n",
"for key, validator in VAR_5.items():\n",
"for key, validator in VAR_6.items():\n",
"if VAR_7:\n",
"if key in self.request.GET:\n",
"if key i... | [
"def read_params(self, get_params=None, post_params=None, file_params=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.request.method == 'GET':\n",
"if get_params:\n",
"if post_params:\n",
"for key, validator in get_params.items():\n",
"for key, validator in post_params.items():\n",
"if file_params:\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Condition",
"For",
"For",
"Condition",
"Condition",
"Condition",
"For",
"Expr'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_16(self):...\n",
"return True\n"
] | [
"def do_existing_paths(self):...\n",
"return True\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_7, VAR_20=True, *VAR_15, **VAR_16):...\n",
"CLASS_5.__init__(self, VAR_7, *VAR_15, VAR_20=redirect, **kw)\n"
] | [
"def __init__(self, param, redirect=True, *a, **kw):...\n",
"VLink.__init__(self, param, *a, redirect=redirect, **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(VAR_0, VAR_1=None, VAR_2=False):...\n",
"VAR_3 = None\n",
"if conf.eString and conf.eString in VAR_0:\n",
"VAR_4 = VAR_0.index(conf.eString)\n",
"if conf.eRegexp:\n",
"VAR_5 = len(conf.eString)\n",
"VAR_3 = re.findall(conf.eRegexp, VAR_0, re.I | re.M)\n",
"if conf.string:\n",
"VAR_6 = VA... | [
"def comparison(page, headers=None, getSeqMatcher=False):...\n",
"regExpResults = None\n",
"if conf.eString and conf.eString in page:\n",
"index = page.index(conf.eString)\n",
"if conf.eRegexp:\n",
"length = len(conf.eString)\n",
"regExpResults = re.findall(conf.eRegexp, page, re.I | re.M)\n",
"if con... | [
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,
2,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"AugAssign'",
"For",
"Return'",
"Return'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Return'",
"Return'",
"Condition",
... |
[
"def __str__(self):...\n",
"return ' '.join(map(str, self))\n"
] | [
"def __str__(self):...\n",
"return ' '.join(map(str, self))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@defer.inlineCallbacks...\n",
"VAR_9 = yield VAR_2.client.mail_store.all_mails()\n",
"for mail in VAR_9:\n",
"yield VAR_2.client.mail_store.delete_mail(mail.ident)\n"
] | [
"@defer.inlineCallbacks...\n",
"mails = yield context.client.mail_store.all_mails()\n",
"for mail in mails:\n",
"yield context.client.mail_store.delete_mail(mail.ident)\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"For",
"Expr'"
] |
[
"def FUNC_1(VAR_0, VAR_1):...\n",
"return render(VAR_0, 'posts/posts_detail.html', {'post_id': VAR_1})\n"
] | [
"def post_details(request, post_id):...\n",
"return render(request, 'posts/posts_detail.html', {'post_id': post_id})\n"
] | [
0,
6
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(self, VAR_3, *VAR_7, **VAR_8):...\n",
"self.log(VAR_3.rstrip())\n",
"self.reply(b'<pre>' + VAR_3.encode('utf-8'), *list(VAR_7), **kwargs)\n"
] | [
"def loud_reply(self, body, *args, **kwargs):...\n",
"self.log(body.rstrip())\n",
"self.reply(b'<pre>' + body.encode('utf-8'), *list(args), **kwargs)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"import psycopg2\n",
"def __init__(self, VAR_0, VAR_1, VAR_2, VAR_3, VAR_4):...\n",
"self.connection = psycopg2.connect(dbname=database, VAR_0=host, VAR_1=port,\n user=username, VAR_4=password)\n",
"\"\"\"string\"\"\"\n",
"def FUNC_0(self, VAR_5, VAR_6, VAR_7):...\n",
"VAR_9 = ''\n",
"VAR_10 = ''\n",... | [
"import psycopg2\n",
"def __init__(self, host, port, database, username, password):...\n",
"self.connection = psycopg2.connect(dbname=database, host=host, port=port,\n user=username, password=password)\n",
"\"\"\"\n Inserts data into an existing table. On failure due to not enough columns\n will auto... | [
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
4,
0,
4,
4,
0,
0,
4,
0,
0,
4,
4,
0,
0,
4,
0,
4,
4,
0,
4,
0,
4,
0,
0,
0,
0,
4,
0,
0,
0,
0,
4,
4,
0,
4,
0,
0,
0,
4,
4,
4,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
4,
0... | [
"Import'",
"FunctionDef'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Expr'",
"Con... |
[
"def __init__(self, VAR_1):...\n",
"self.debug = VAR_1.debug\n",
"self.path = VAR_1.path\n",
"self.repos = VAR_1.repos\n"
] | [
"def __init__(self, args):...\n",
"self.debug = args.debug\n",
"self.path = args.path\n",
"self.repos = args.repos\n"
] | [
0,
0,
1,
1
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_0(self, VAR_2):...\n",
"self.log_func(self.log_src, VAR_2)\n"
] | [
"def log(self, msg):...\n",
"self.log_func(self.log_src, msg)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __init__(self, VAR_0):...\n",
"os.umask(63)\n",
"self.config = VAR_0\n",
"self.client_list = []\n",
"self.node_list = []\n",
"self.master = False\n",
"self.retrieved = 0\n",
"self.need_local_sudo = False\n",
"self.clusters = self.config['cluster_types']\n",
"if not self.config['list_options']... | [
"def __init__(self, config):...\n",
"os.umask(63)\n",
"self.config = config\n",
"self.client_list = []\n",
"self.node_list = []\n",
"self.master = False\n",
"self.retrieved = 0\n",
"self.need_local_sudo = False\n",
"self.clusters = self.config['cluster_types']\n",
"if not self.config['list_options... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(self, **VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_40 = 'SELECT id FROM wins_completed_wins_fy'\n",
"if self.end_date:\n",
"VAR_40 = f\"{VAR_40} where created <= '{self.end_date.strftime('%m-%d-%Y')}'\"\n",
"VAR_31.execute(VAR_40)\n",
"VAR_49 = VAR_31.fetchall()\n",
"VAR_25 = Win.objec... | [
"def _make_flat_wins_csv(self, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"sql_str = 'SELECT id FROM wins_completed_wins_fy'\n",
"if self.end_date:\n",
"sql_str = f\"{sql_str} where created <= '{self.end_date.strftime('%m-%d-%Y')}'\"\n",
"cursor.execute(sql_str)\n",
"ids = cursor.fetchall()\n",
"win... | [
0,
0,
4,
0,
4,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"if keepassgtk.config_manager.has_group('history'\n",
"self.logging_manager.log_debug('Found last opened database entry (' +\n keepassgtk.config_manager.get_string('history', 'last-opened-db') + ')')\n",
"self.logging_manager.log_debug(\n 'No / Not valid last opened database en... | [
"def first_start_screen(self):...\n",
"if keepassgtk.config_manager.has_group('history'\n",
"self.logging_manager.log_debug('Found last opened database entry (' +\n keepassgtk.config_manager.get_string('history', 'last-opened-db') + ')')\n",
"self.logging_manager.log_debug(\n 'No / Not valid last opened... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(VAR_1=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if __grains__['kernel'] == 'Linux':\n",
"VAR_4 = 'df -P'\n",
"if __grains__['kernel'] == 'OpenBSD':\n",
"if VAR_1:\n",
"VAR_4 = 'df -kP'\n",
"VAR_4 = 'df'\n",
"VAR_4 = VAR_4 + ' -' + VAR_1\n",
"VAR_2 = {}\n",
"VAR_3 = __salt__['cmd.run'... | [
"def usage(args=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if __grains__['kernel'] == 'Linux':\n",
"cmd = 'df -P'\n",
"if __grains__['kernel'] == 'OpenBSD':\n",
"if args:\n",
"cmd = 'df -kP'\n",
"cmd = 'df'\n",
"cmd = cmd + ' -' + args\n",
"ret = {}\n",
"out = __salt__['cmd.run'](cmd).splitlines(... | [
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Ass... |
[
"def FUNC_5(self, VAR_10=None, VAR_11=None, VAR_1=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_10 is None:\n",
"VAR_10 = str(len(self._rules) + 1)\n",
"if self.is_rule(VAR_10):\n",
"VAR_13 = Rule(VAR_10, self, VAR_11=lineno, VAR_1=snakefile)\n",
"self._rules[VAR_13.name] = VAR_13\n",
"self.rule_co... | [
"def add_rule(self, name=None, lineno=None, snakefile=None):...\n",
"\"\"\"docstring\"\"\"\n",
"if name is None:\n",
"name = str(len(self._rules) + 1)\n",
"if self.is_rule(name):\n",
"rule = Rule(name, self, lineno=lineno, snakefile=snakefile)\n",
"self._rules[rule.name] = rule\n",
"self.rule_count +=... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"AugAssign'",
"Condition",
"Assign'",
"Return'"
] |
[
"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_0(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"if len(VAR_1) > 2:\n",
"VAR_1[0] = VAR_1[1]\n",
"VAR_1[0] = []\n",
"VAR_1[0].append(VAR_1[2])\n"
] | [
"def p_main(t):...\n",
"\"\"\"docstring\"\"\"\n",
"if len(t) > 2:\n",
"t[0] = t[1]\n",
"t[0] = []\n",
"t[0].append(t[2])\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(VAR_4, VAR_3):...\n",
"VAR_9 = {}\n",
"VAR_9['date'] = '1-Jan-' + str(VAR_4)\n",
"VAR_9['close'] = VAR_3\n",
"return VAR_9\n"
] | [
"def makeObj2(y, x):...\n",
"z = {}\n",
"z['date'] = '1-Jan-' + str(y)\n",
"z['close'] = x\n",
"return z\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"log.info('Figuring out the least active users...')\n",
"VAR_14 = tuple(self.users.keys())\n",
"VAR_10 = (\n f'SELECT chat_id FROM photo_queries_table2 WHERE chat_id in {VAR_14} GROUP BY chat_id ORDER BY MAX(time) LIMIT {VAR_6}'\n )\n",
"VA... | [
"def clean_cache(self, limit):...\n",
"\"\"\"docstring\"\"\"\n",
"log.info('Figuring out the least active users...')\n",
"user_ids = tuple(self.users.keys())\n",
"query = (\n f'SELECT chat_id FROM photo_queries_table2 WHERE chat_id in {user_ids} GROUP BY chat_id ORDER BY MAX(time) LIMIT {limit}'\n )\n... | [
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Return'",
"Expr'",
"Assign'",
"For",
"Expr'",
"Expr'",
"Assign'",
"Condition",
"AugAssign'"
] |
[
"def FUNC_8(self, VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self._any_targets_have_native_sources(VAR_6):\n",
"return False\n",
"VAR_7 = pex_build_util.targets_by_platform(VAR_6, self._python_setup)\n",
"VAR_8 = list(VAR_7.keys())\n",
"if not VAR_8 or VAR_8 == ['current']:\n",
"return True\n",... | [
"def check_build_for_current_platform_only(self, targets):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self._any_targets_have_native_sources(targets):\n",
"return False\n",
"platforms_with_sources = pex_build_util.targets_by_platform(targets, self.\n _python_setup)\n",
"platform_names = list(platforms_wi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"For",
"For",
"Expr'"
] |
[
"@staticmethod...\n",
"if not VAR_1 or not VAR_6:\n",
"if not VAR_5:\n",
"VAR_5 = CLASS_0.get_report(VAR_1)['analysis']\n",
"VAR_16 = VAR_5['behavior']['generic']\n",
"VAR_17 = [z for z in VAR_16 if z['pid'] == VAR_6]\n",
"if not VAR_17:\n",
"VAR_17 = VAR_17[0]\n",
"VAR_9 = {}\n",
"for VAR_30, VAR... | [
"@staticmethod...\n",
"if not task_id or not pid:\n",
"if not report:\n",
"report = AnalysisController.get_report(task_id)['analysis']\n",
"behavior_generic = report['behavior']['generic']\n",
"process = [z for z in behavior_generic if z['pid'] == pid]\n",
"if not process:\n",
"process = process[0]\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"For",
"Return'",
"Condition",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_19(self):...\n",
"return VAR_54.as_json(self.as_dict())\n"
] | [
"def as_json(self):...\n",
"return frappe.as_json(self.as_dict())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_4(self, VAR_5):...\n",
"for oldg in VAR_5.get_ancestors():\n",
"if oldg not in self.groups:\n",
"if VAR_5 not in self.groups:\n",
"self.add_group(oldg)\n",
"self.groups.append(VAR_5)\n"
] | [
"def add_group(self, group):...\n",
"for oldg in group.get_ancestors():\n",
"if oldg not in self.groups:\n",
"if group not in self.groups:\n",
"self.add_group(oldg)\n",
"self.groups.append(group)\n"
] | [
0,
0,
0,
0,
1,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"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'"
] |
[
"@gallery.route('/gallery/benwa/add', methods=['GET', 'POST'])...\n",
"VAR_6 = PostForm()\n",
"if VAR_6.validate_on_submit():\n",
"VAR_11 = VAR_6.image.data\n",
"flash('There was an issue with adding the benwa')\n",
"VAR_12 = secure_filename(VAR_11.filename)\n",
"return render_template('image_upload.htm... | [
"@gallery.route('/gallery/benwa/add', methods=['GET', 'POST'])...\n",
"form = PostForm()\n",
"if form.validate_on_submit():\n",
"f = form.image.data\n",
"flash('There was an issue with adding the benwa')\n",
"fname = secure_filename(f.filename)\n",
"return render_template('image_upload.html', form=form)... | [
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"\"\"\"\nThis module contains ...\n\"\"\"\n",
"from __future__ import division, absolute_import\n",
"import cPickle as pickle\n",
"import pickle\n",
"import os\n",
"import time\n",
"import fnmatch\n",
"import hashlib\n",
"import re\n",
"import stat\n",
"import errno\n",
"from twisted.python im... | [
"\"\"\"\nThis module contains ...\n\"\"\"\n",
"from __future__ import division, absolute_import\n",
"import cPickle as pickle\n",
"import pickle\n",
"import os\n",
"import time\n",
"import fnmatch\n",
"import hashlib\n",
"import re\n",
"import stat\n",
"import errno\n",
"from twisted.python im... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'... |
[
"__author__ = 'Johannes Köster'\n",
"__copyright__ = 'Copyright 2015, Johannes Köster'\n",
"__email__ = 'koester@jimmy.harvard.edu'\n",
"__license__ = 'MIT'\n",
"import re\n",
"import os\n",
"import sys\n",
"import signal\n",
"import json\n",
"import urllib\n",
"from collections import OrderedDi... | [
"__author__ = 'Johannes Köster'\n",
"__copyright__ = 'Copyright 2015, Johannes Köster'\n",
"__email__ = 'koester@jimmy.harvard.edu'\n",
"__license__ = 'MIT'\n",
"import re\n",
"import os\n",
"import sys\n",
"import signal\n",
"import json\n",
"import urllib\n",
"from collections import OrderedDi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
... |
[
"def FUNC_0(VAR_2, VAR_3):...\n",
"VAR_11 = VAR_2 - sum(d['points'] for d in VAR_3)\n",
"if VAR_11 < 0:\n",
"VAR_11 = 0\n",
"print(json.dumps({'score': VAR_11, 'deductions': VAR_3}))\n"
] | [
"def output_json(points, deductions):...\n",
"score = points - sum(d['points'] for d in deductions)\n",
"if score < 0:\n",
"score = 0\n",
"print(json.dumps({'score': score, 'deductions': deductions}))\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
""
] | [
"def run(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_0(self):...\n",
"super().get_common_objects()\n",
"self.page = {'is_wait': 'wait' in self.request.GET}\n",
"self.note('page')\n",
"self.get_summary_submissions()\n"
] | [
"def get_common_objects(self):...\n",
"super().get_common_objects()\n",
"self.page = {'is_wait': 'wait' in self.request.GET}\n",
"self.note('page')\n",
"self.get_summary_submissions()\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_31(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'LOW': 7}, 'CONFIDENCE': {'HIGH': 7}}\n",
"self.check_example('popen_wrappers.py', VAR_2)\n"
] | [
"def test_popen_wrappers(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'LOW': 7}, 'CONFIDENCE': {'HIGH': 7}}\n",
"self.check_example('popen_wrappers.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"@VAR_0.route('/chpass')...\n",
"\"\"\"docstring\"\"\"\n",
"return FUNC_3('change-password-action', VAR_2=True)\n"
] | [
"@authn_views.route('/chpass')...\n",
"\"\"\"docstring\"\"\"\n",
"return _authn('change-password-action', force_authn=True)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"@staticmethod...\n",
"return [col[0] for col in VAR_5.description]\n"
] | [
"@staticmethod...\n",
"return [col[0] for col in cursor.description]\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@wraps(VAR_6)...\n",
"if 'logged_in' in VAR_10:\n",
"return VAR_6(*VAR_8, **kwargs)\n",
"flash('Unauthorized, Please login', 'danger')\n",
"return redirect(url_for('login'))\n"
] | [
"@wraps(f)...\n",
"if 'logged_in' in session:\n",
"return f(*args, **kwargs)\n",
"flash('Unauthorized, Please login', 'danger')\n",
"return redirect(url_for('login'))\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_6(self, VAR_11='', VAR_15=None, VAR_12=None):...\n",
"return self.url_post(VAR_11, VAR_15, VAR_12=headers)\n"
] | [
"def create(self, resource='', body=None, headers=None):...\n",
"return self.url_post(resource, body, headers=headers)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@classmethod...\n",
"super(CLASS_2, VAR_0).setUpTestData()\n",
"VAR_0.many_comments_url = reverse('ajax-comment_case_runs')\n"
] | [
"@classmethod...\n",
"super(TestCommentCaseRuns, cls).setUpTestData()\n",
"cls.many_comments_url = reverse('ajax-comment_case_runs')\n"
] | [
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'"
] |
[
"import pymysql\n",
"from config import create_connection\n",
"VAR_0 = 'products'\n",
"VAR_1 = 'product_types'\n",
"VAR_2 = 'reviews'\n",
"VAR_3 = 'users'\n",
"def FUNC_0(VAR_4):...\n",
"VAR_10 = (VAR_4['page'] - 1) * VAR_4['perPage']\n",
"VAR_11 = f\"\"\"string{VAR_0} AS p INNER JOIN {VAR_1} AS pt ... | [
"import pymysql\n",
"from config import create_connection\n",
"PRODUCTS_TABLE = 'products'\n",
"PRODUCTS_TYPES_TABLE = 'product_types'\n",
"REVIEWS_TABLE = 'reviews'\n",
"USERS_TABLE = 'users'\n",
"def get_products(filters):...\n",
"offset = (filters['page'] - 1) * filters['perPage']\n",
"sql_query ... | [
0,
0,
4,
4,
4,
4,
0,
0,
4,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"Import'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assig... |
[
"@auth.require(acl.is_bot)...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_28, VAR_14, VAR_9, VAR_25, VAR_24, VAR_26 = self._process()\n",
"VAR_15 = VAR_25.get('sleep_streak', 0)\n",
"VAR_16 = bool(VAR_26)\n",
"VAR_30 = 'bot_inactive' if VAR_16 else 'bot_active'\n",
"stats.add_entry(VAR_30=action, VAR_14=bot_id,... | [
"@auth.require(acl.is_bot)...\n",
"\"\"\"docstring\"\"\"\n",
"_request, bot_id, version, state, dimensions, quarantined_msg = self._process()\n",
"sleep_streak = state.get('sleep_streak', 0)\n",
"quarantined = bool(quarantined_msg)\n",
"action = 'bot_inactive' if quarantined else 'bot_active'\n",
"stats... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Expr'",
"FunctionDef'",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Return'",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Condit... |
[
"def FUNC_3(self):...\n",
"VAR_1 = '/api/apps'\n",
"VAR_2 = self.client.post(VAR_1)\n",
"self.assertEqual(VAR_2.status_code, 201)\n",
"VAR_3 = VAR_2.data['id']\n",
"VAR_1 = '/api/apps/{app_id}/builds'.format(**locals())\n",
"VAR_4 = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile': json.\n d... | [
"def test_start_chaos(self):...\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"url = '/api/apps/{app_id}/builds'.format(**locals())\n",
"body = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile':... | [
0,
0,
0,
0,
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'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
... |
[
"def FUNC_7(self):...\n",
"self.mock(time, 'time', lambda : 126.0)\n",
"self.mock(logging, 'error', lambda *VAR_15, **_kw: None)\n",
"self.mock(bot_main, 'get_remote', lambda : self.server)\n",
"self.mock(os_utilities, 'get_state', lambda : {'foo': 'bar'})\n",
"VAR_13 = bot_main.get_attributes(None)\n",
... | [
"def test_post_error_task(self):...\n",
"self.mock(time, 'time', lambda : 126.0)\n",
"self.mock(logging, 'error', lambda *_, **_kw: None)\n",
"self.mock(bot_main, 'get_remote', lambda : self.server)\n",
"self.mock(os_utilities, 'get_state', lambda : {'foo': 'bar'})\n",
"expected_attribs = bot_main.get_att... | [
0,
0,
0,
0,
5,
0,
5,
0,
5
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_11(**VAR_19):...\n",
"VAR_39 = {'name': VAR_19.get('name'), 'description': VAR_19.get('description')}\n",
"VAR_40 = FUNC_8('contests/add', VAR_16=add_args)\n",
"VAR_41 = VAR_40.text\n",
"VAR_42 = re.search('string', VAR_41)\n",
"if VAR_42 is not None:\n",
"VAR_18 = int(VAR_42.groups()[0])\n",
... | [
"def add_contest(**kwargs):...\n",
"add_args = {'name': kwargs.get('name'), 'description': kwargs.get(\n 'description')}\n",
"resp = admin_req('contests/add', args=add_args)\n",
"page = resp.text\n",
"match = re.search(\n '<form enctype=\"multipart/form-data\" action=\"../contest/([0-9]+)\" method=\"P... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_1(self, VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = 0\n",
"while VAR_11 < len(self.observers):\n",
"VAR_12 = self.observers[VAR_11][0]\n",
"if VAR_12 == VAR_1:\n",
"VAR_11 += 1\n"
] | [
"def remove_observer(self, func):...\n",
"\"\"\"docstring\"\"\"\n",
"i = 0\n",
"while i < len(self.observers):\n",
"ofunc = self.observers[i][0]\n",
"if ofunc == func:\n",
"i += 1\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"AugAssign'"
] |
[
"def FUNC_1(self, VAR_4, VAR_10, VAR_11, VAR_12, VAR_13=None, VAR_14=None):...\n",
"VAR_27, VAR_28, VAR_19, VAR_29 = (self.wz_sock, self.poll, self.\n sleep_ticker, self.wz)\n",
"VAR_14 = VAR_14 if VAR_14 else self.wz_poll_timeout\n",
"VAR_30 = wzrpc.RequestState(VAR_4)\n",
"VAR_23 = self.wz.make_req_msg... | [
"def wz_wait_reply(self, fun, interface, method, data, reqid=None, timeout=None...\n",
"s, p, t, wz = self.wz_sock, self.poll, self.sleep_ticker, self.wz\n",
"timeout = timeout if timeout else self.wz_poll_timeout\n",
"rs = wzrpc.RequestState(fun)\n",
"msg = self.wz.make_req_msg(interface, method, data, rs.... | [
0,
7,
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'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_1(self, VAR_4, VAR_5, VAR_7=True):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5['output'] = 'XML'\n",
"VAR_16, VAR_17 = self._cliq_run(VAR_4, VAR_5, VAR_7)\n",
"VAR_0.debug(_('CLIQ command returned %s'), VAR_16)\n",
"VAR_18 = etree.fromstring(VAR_16)\n",
"if VAR_7:\n",
"VAR_41 = VAR_18.find('res... | [
"def _cliq_run_xml(self, verb, cliq_args, check_cliq_result=True):...\n",
"\"\"\"docstring\"\"\"\n",
"cliq_args['output'] = 'XML'\n",
"out, _err = self._cliq_run(verb, cliq_args, check_cliq_result)\n",
"LOG.debug(_('CLIQ command returned %s'), out)\n",
"result_xml = etree.fromstring(out)\n",
"if check_c... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"\"\"\"A helper script for wrapping url calls.\"\"\"\n",
"import hashlib\n",
"import httplib\n",
"import logging\n",
"import math\n",
"import os\n",
"import random\n",
"import socket\n",
"import time\n",
"import urllib\n",
"import urllib2\n",
"import urlparse\n",
"from common import swarm_co... | [
"\"\"\"A helper script for wrapping url calls.\"\"\"\n",
"import hashlib\n",
"import httplib\n",
"import logging\n",
"import math\n",
"import os\n",
"import random\n",
"import socket\n",
"import time\n",
"import urllib\n",
"import urllib2\n",
"import urlparse\n",
"from common import swarm_co... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Return'... |
[
"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'"
] |
[
"\"\"\"Handlers for customizing oauthclient endpoints.\"\"\"\n",
"import six\n",
"from flask import current_app, flash, redirect, render_template, request, session, url_for\n",
"from flask.ext.login import current_user\n",
"from functools import partial, wraps\n",
"from werkzeug.utils import import_string... | [
"\"\"\"Handlers for customizing oauthclient endpoints.\"\"\"\n",
"import six\n",
"from flask import current_app, flash, redirect, render_template, request, session, url_for\n",
"from flask.ext.login import current_user\n",
"from functools import partial, wraps\n",
"from werkzeug.utils import import_string... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_8(self):...\n",
"self.assertEquals('123456 test course: Fall 2011 day 1 -> test_hook_url',\n str(self.course_hook))\n"
] | [
"def test_course_hook_unicode_string(self):...\n",
"self.assertEquals('123456 test course: Fall 2011 day 1 -> test_hook_url',\n str(self.course_hook))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@property...\n",
"return self._subworkflows.values()\n"
] | [
"@property...\n",
"return self._subworkflows.values()\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"VAR_30 = [b'GLOBAL']\n",
"VAR_30.extend(wzrpc.make_sig_msg(b'WZWorker', b'terminate', []))\n",
"if hasattr(self, 'th_sock'):\n",
"self.th_sock.send_multipart(VAR_30)\n",
"if hasattr(self, 'pr_sock'):\n",
"self.pr_sock.send_multipart(VAR_30)\n"
] | [
"def terminate(self):...\n",
"msg = [b'GLOBAL']\n",
"msg.extend(wzrpc.make_sig_msg(b'WZWorker', b'terminate', []))\n",
"if hasattr(self, 'th_sock'):\n",
"self.th_sock.send_multipart(msg)\n",
"if hasattr(self, 'pr_sock'):\n",
"self.pr_sock.send_multipart(msg)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.