lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_8(self, VAR_4, VAR_5, VAR_0, VAR_1):...\n",
""
] | [
"def _parse_sig(self, iden, msg, interface, method):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@app.route('/api/cameras', methods=['GET'])...\n",
"return [x.to_map() for x in controller.indi_server.cameras()]\n"
] | [
"@app.route('/api/cameras', methods=['GET'])...\n",
"return [x.to_map() for x in controller.indi_server.cameras()]\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_3(self):...\n",
"return 'SQLite %s' % sqlite.sqlite_version\n"
] | [
"def dbVersion(self):...\n",
"return 'SQLite %s' % sqlite.sqlite_version\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from __future__ import unicode_literals, print_function, division\n",
"import contextlib\n",
"import httplib\n",
"import uuid\n",
"from logging import getLogger\n",
"from markupsafe import Markup\n",
"from tornado.escape import xhtml_escape\n",
"from veil.frontend.template import template_utility\n",... | [
"from __future__ import unicode_literals, print_function, division\n",
"import contextlib\n",
"import httplib\n",
"import uuid\n",
"from logging import getLogger\n",
"from markupsafe import Markup\n",
"from tornado.escape import xhtml_escape\n",
"from veil.frontend.template import template_utility\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Expr'",
... |
[
"\"\"\"string\"\"\"\n",
"import collections as _co\n",
"import bisect as _bs\n",
"import itertools as _iter\n",
"import numpy as _np\n",
"import scipy.sparse as _sparse\n",
"import scipy.sparse.linalg as _sla\n",
"import scipy.linalg as _la\n",
"import scipy as _sp\n",
"from pathpy.Log import Log\... | [
"\"\"\"\n pathpy is an OpenSource python package for the analysis of time series data\n on networks using higher- and multi order graphical models.\n\n Copyright (C) 2016-2017 Ingo Scholtes, ETH Zürich\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of th... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"Expr'",
"Condition",
"Docstring",
"Assert'",
"Assert'",
"Assert'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
... |
[
"def FUNC_13(self, VAR_16):...\n",
"return True\n"
] | [
"def does_intersect_rule(self, rulectx):...\n",
"return True\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __init__(self, VAR_7, VAR_20=True, *VAR_15, **VAR_16):...\n",
"CLASS_0.__init__(self, VAR_7, *VAR_15, **kw)\n",
"self.redirect = VAR_20\n"
] | [
"def __init__(self, param, redirect=True, *a, **kw):...\n",
"Validator.__init__(self, param, *a, **kw)\n",
"self.redirect = redirect\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_4(self, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"self.lasttok = VAR_3.type\n",
"return VAR_3\n"
] | [
"def t_RPAR(self, tok):...\n",
"\"\"\"docstring\"\"\"\n",
"self.lasttok = tok.type\n",
"return tok\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"@VAR_0.route('/regions/<region_id>', methods=['GET'])...\n",
"return get_by_id('regions', VAR_2)\n"
] | [
"@locations.route('/regions/<region_id>', methods=['GET'])...\n",
"return get_by_id('regions', region_id)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_20(VAR_6):...\n",
"return FUNC_7(VAR_6, 'X-Frame-Options', 'DENY')\n"
] | [
"def validate_clickjacking_protection(page):...\n",
"return validate_security_header(page, 'X-Frame-Options', 'DENY')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_40(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = {'SEVERITY': {'LOW': 5}, 'CONFIDENCE': {'HIGH': 5}}\n",
"self.check_example('utils-shell.py', VAR_2)\n"
] | [
"def test_utils_shell(self):...\n",
"\"\"\"docstring\"\"\"\n",
"expect = {'SEVERITY': {'LOW': 5}, 'CONFIDENCE': {'HIGH': 5}}\n",
"self.check_example('utils-shell.py', expect)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"VAR_1 = self.c.get('/find/?q=avcat')\n",
"self.assertContains(VAR_1, 'stub_1845')\n"
] | [
"def test_faceted_search_returns_upc(self):...\n",
"response = self.c.get('/find/?q=avcat')\n",
"self.assertContains(response, 'stub_1845')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._workspace\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._workspace\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_15(self, VAR_34):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_34 = get_filter(self.doctype, VAR_34)\n",
"VAR_53 = '`tab' + VAR_34.doctype + '`'\n",
"if not VAR_53 in self.tables:\n",
"self.append_table(VAR_53)\n",
"if 'ifnull(' in VAR_34.fieldname:\n",
"VAR_60 = VAR_34.fieldname\n",
"VAR_60 = '... | [
"def prepare_filter_condition(self, f):...\n",
"\"\"\"docstring\"\"\"\n",
"f = get_filter(self.doctype, f)\n",
"tname = '`tab' + f.doctype + '`'\n",
"if not tname in self.tables:\n",
"self.append_table(tname)\n",
"if 'ifnull(' in f.fieldname:\n",
"column_name = f.fieldname\n",
"column_name = '{tname... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
... |
[
"def FUNC_0(self):...\n",
"TestBase.setUp(self)\n",
"self.app = webtest.TestApp(app)\n"
] | [
"def setUp(self):...\n",
"TestBase.setUp(self)\n",
"self.app = webtest.TestApp(app)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'"
] |
[
"def FUNC_4(VAR_4, VAR_5):...\n",
"VAR_37 = 'preview-{}'.format(VAR_4)\n",
"import zlib\n",
"return 'preview-' + str(zlib.crc32(VAR_37.encode('utf-8'), 65535)\n ) + '.' + VAR_5\n"
] | [
"def preview_file(identifier, extension):...\n",
"file_identifier = 'preview-{}'.format(identifier)\n",
"import zlib\n",
"return 'preview-' + str(zlib.crc32(file_identifier.encode('utf-8'), 65535)\n ) + '.' + extension\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Import'",
"Return'"
] |
[
"from flask import Blueprint, request, make_response, jsonify\n",
"from flask.views import MethodView\n",
"from ...models import Table\n",
"from ....utils import jwt_required, encode_auth_token\n",
"VAR_0 = Blueprint('auth', __name__)\n",
"\"\"\"\n User Signup API Resource\n \"\"\"\n",
"def FUNC_0... | [
"from flask import Blueprint, request, make_response, jsonify\n",
"from flask.views import MethodView\n",
"from ...models import Table\n",
"from ....utils import jwt_required, encode_auth_token\n",
"auth_blueprint = Blueprint('auth', __name__)\n",
"\"\"\"\n User Signup API Resource\n \"\"\"\n",
"d... | [
4,
0,
0,
0,
0,
4,
0,
4,
4,
0,
4,
4,
4,
0,
0,
0,
4,
0,
4,
0,
4,
0,
4,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Expr'",
"Return'",
"Assign'... |
[
"def FUNC_1(self):...\n",
"VAR_1 = 'cmd'\n",
"self.assertEqual(escape_path_argument('C:\\\\Windows\\\\has-a-weird-shell.txt',\n VAR_1), '\"C:\\\\Windows\\\\has-a-weird-shell.txt\"')\n",
"self.assertEqual(escape_path_argument('C:\\\\Windows\\\\lolrofl\\\\dirs\\\\', VAR_1\n ), '\"C:\\\\Windows\\\\lolrofl\... | [
"def test_escape_path_argument_cmd(self):...\n",
"_type = 'cmd'\n",
"self.assertEqual(escape_path_argument('C:\\\\Windows\\\\has-a-weird-shell.txt',\n _type), '\"C:\\\\Windows\\\\has-a-weird-shell.txt\"')\n",
"self.assertEqual(escape_path_argument('C:\\\\Windows\\\\lolrofl\\\\dirs\\\\', _type\n ), '\"C:... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(VAR_6, VAR_4):...\n",
"VAR_8 = VAR_4.connect()\n",
"VAR_9 = VAR_8.cursor()\n",
"VAR_12 = 'string'.format(VAR_6)\n",
"VAR_9.execute(VAR_12)\n",
"VAR_13 = VAR_9.fetchone()\n",
"return VAR_13\n"
] | [
"def getCalendarDetails(id, sqlInstance):...\n",
"conn = sqlInstance.connect()\n",
"cursor = conn.cursor()\n",
"getCalendarDetails = (\n \"SELECT Calendars.calendarId, Calendars.name, Calendars.day, Users.userEmail FROM Calendars, Users WHERE Calendars.userId = Users.userId AND Calendars.calendarId = '{0}... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self, VAR_3=0, VAR_4='Incomplete', VAR_5='Incomplete'):...\n",
"self.result_data.update({'aux_output': '', 'data_diff': None,\n 'debugger_output': '', 'detected_errors': None, 'dut_output': '',\n 'num_injections': VAR_3, 'outcome_category': VAR_4, 'outcome': VAR_5,\n 'timestamp': None})\n",
... | [
"def create_result(self, num_injections=0, outcome_category='Incomplete',...\n",
"self.result_data.update({'aux_output': '', 'data_diff': None,\n 'debugger_output': '', 'detected_errors': None, 'dut_output': '',\n 'num_injections': num_injections, 'outcome_category': outcome_category,\n 'outcome': outcom... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_15(VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"if FUNC_12(VAR_16, 'temp'):\n",
"return VAR_19(VAR_16, 'protected')\n"
] | [
"def protected(value):...\n",
"\"\"\"docstring\"\"\"\n",
"if is_flagged(value, 'temp'):\n",
"return flag(value, 'protected')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'"
] |
[
"def FUNC_5(VAR_3, VAR_10, VAR_2):...\n",
"if '%(key)s' in VAR_3:\n",
"VAR_3 = VAR_3.replace('%(key)s', VAR_10)\n",
"if '%s' in VAR_3:\n",
"VAR_3 = VAR_3.replace('%s', (VAR_2 or '') + '%')\n",
"return VAR_3\n"
] | [
"def scrub_custom_query(query, key, txt):...\n",
"if '%(key)s' in query:\n",
"query = query.replace('%(key)s', key)\n",
"if '%s' in query:\n",
"query = query.replace('%s', (txt or '') + '%')\n",
"return query\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_9(self, VAR_0):...\n",
"if not cint(self.published):\n",
"VAR_0.full_name = get_fullname(self.owner)\n",
"VAR_0.updated = global_date_format(self.published_on)\n",
"if self.blogger:\n",
"VAR_0.blogger_info = frappe.get_doc('Blogger', self.blogger).as_dict()\n",
"VAR_0.description = self.blog_i... | [
"def get_context(self, context):...\n",
"if not cint(self.published):\n",
"context.full_name = get_fullname(self.owner)\n",
"context.updated = global_date_format(self.published_on)\n",
"if self.blogger:\n",
"context.blogger_info = frappe.get_doc('Blogger', self.blogger).as_dict()\n",
"context.descriptio... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_14(self, VAR_17, VAR_18, VAR_19, VAR_20):...\n",
"if 'memory_mapped' in self.targets[VAR_18] and self.targets[VAR_18][\n",
"VAR_10 = 'mm'\n",
"self.command('rm ' + VAR_17 + ' ' + VAR_20, VAR_11=\n 'Error setting register value')\n",
"if 'bits' in self.targets[VAR_18]['registers'][VAR_17]:\n",
... | [
"def set_register_value(self, register, target, target_index, value):...\n",
"if 'memory_mapped' in self.targets[target] and self.targets[target][\n",
"command = 'mm'\n",
"self.command('rm ' + register + ' ' + value, error_message=\n 'Error setting register value')\n",
"if 'bits' in self.targets[target][... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"AugAssign'",
"Condition",
"AugAssign'",
"Condition",
"AugAssign'"
] |
[
"def FUNC_0(self):...\n",
"from cores.xeger import Xeger\n",
"VAR_4 = Xeger()\n",
"while True:\n",
"VAR_5 = VAR_4.xeger(\n \"\"\"((\\\\%3C)|<)((\\\\%69)|i|(\\\\%49))((\\\\%6D)|m|(\\\\%4D))((\\\\%67)|g|(\\\\%47))[^\n]+((\\\\%3E)|>)\"\"\"\n )\n",
"if any(x in VAR_5 for x in '\"\\'><;/'):\n",
"return... | [
"def gen_payload(self):...\n",
"from cores.xeger import Xeger\n",
"generate = Xeger()\n",
"while True:\n",
"_payload = generate.xeger(\n \"\"\"((\\\\%3C)|<)((\\\\%69)|i|(\\\\%49))((\\\\%6D)|m|(\\\\%4D))((\\\\%67)|g|(\\\\%47))[^\n]+((\\\\%3E)|>)\"\"\"\n )\n",
"if any(x in _payload for x in '\"\\'><;/... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"Assign'",
"Condition",
"Assign'",
"For",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"import random\n",
"import hashlib\n",
"from urlparse import urlparse\n",
"from decorator import decorator\n",
"from pylons import session, request, config\n",
"from pylons.controllers.util import abort\n",
"from pylons.i18n import _\n",
"def FUNC_0(VAR_0=['POST', 'GET', 'PUT... | [
"\"\"\"\nXSRF is Cross-Site Request Forgery, where an attacker has a user follow a link that triggers an \naction on a site which the user did not intentionally want to perform (i.e. vote in \na certain way). To prevent this, some actions are only possible if authorized via HTTP or if a\nmodtoken - a shared SHA1 ha... | [
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,
5,
0
] | [
"Expr'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"FunctionDef'",
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
... |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = '/api/keys'\n",
"VAR_5 = {'id': 'autotest', 'public': 'string'}\n",
"VAR_6 = self.client.post(VAR_4, json.dumps(VAR_5), content_type=\n 'application/json')\n",
"self.assertEqual(VAR_6.status_code, 201)\n",
"VAR_8 = Key.objects.get(uuid=res... | [
"def test_rsa_key_str(self):...\n",
"\"\"\"docstring\"\"\"\n",
"url = '/api/keys'\n",
"body = {'id': 'autotest', 'public':\n 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDzqPAwHN70xsB0LXG//KzOgcPikyhdN/KRc4x3j/RA0pmFj63Ywv0PJ2b1LcMSqfR8F11WBlrW8c9xFua0ZAKzI+gEk5uqvOR78bs/SITOtKPomW4e/1d2xEkJqOmYH30u94+NZZYwEBqYa... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def __str__(self):...\n",
"return self.get_name()\n"
] | [
"def __str__(self):...\n",
"return self.get_name()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_7(self, VAR_2, VAR_1=None):...\n",
"VAR_20 = VAR_2.split('/')\n",
"if len(VAR_20) > 1:\n",
"VAR_30 = ipaddress.ip_network(VAR_2, strict=False)\n",
"VAR_30 = ipaddress.ip_address(VAR_2)\n",
"VAR_31 = VAR_30.network_address\n",
"self.filter_string = '{0} = {1}'.format(self.name, int(VAR_30))\n",... | [
"def filter(self, value, op=None):...\n",
"s = value.split('/')\n",
"if len(s) > 1:\n",
"ip = ipaddress.ip_network(value, strict=False)\n",
"ip = ipaddress.ip_address(value)\n",
"start_ip = ip.network_address\n",
"self.filter_string = '{0} = {1}'.format(self.name, int(ip))\n",
"end_ip = ip.broadcast_a... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_17(self, VAR_14):...\n",
""
] | [
"def is_relation(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_27(self, VAR_43, VAR_44):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_63 = self.getfile(VAR_43)\n",
"if VAR_63 == False:\n",
"VAR_64 = self.getfile(VAR_44)\n",
"if VAR_64 != False:\n",
"self.get_path(os.path.dirname(VAR_43)).remove(VAR_63)\n",
"VAR_63[VAR_1] = os.path.basename(VAR_44)\n",
"self... | [
"def rename(self, oldpath, newpath):...\n",
"\"\"\"docstring\"\"\"\n",
"old = self.getfile(oldpath)\n",
"if old == False:\n",
"new = self.getfile(newpath)\n",
"if new != False:\n",
"self.get_path(os.path.dirname(oldpath)).remove(old)\n",
"old[A_NAME] = os.path.basename(newpath)\n",
"self.get_path(os... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_2():...\n",
""
] | [
"def main():...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"async def FUNC_2(self) ->None:...\n",
"VAR_7 = await as_future(session.query(database.Paste).filter(database.Paste\n .removal_id == self.get_body_argument('removal_id')).first)\n",
"if not VAR_7:\n",
"self.set_status(400)\n",
"session.delete(VAR_7)\n",
"return\n",
"session.commit()\n",
"self.set_h... | [
"async def post(self) ->None:...\n",
"paste = await as_future(session.query(database.Paste).filter(database.Paste\n .removal_id == self.get_body_argument('removal_id')).first)\n",
"if not paste:\n",
"self.set_status(400)\n",
"session.delete(paste)\n",
"return\n",
"session.commit()\n",
"self.set_hea... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"AsyncFunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_13(self, VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_31 = VAR_12,\n",
"self.cursor.execute('insert into lists (listhash) values (?)', VAR_31)\n",
"self.connection.commit()\n",
"VAR_30 = self.cursor.execute(\n 'select listid, listhash from lists where listhash = \"%s\"' % VAR_12\n ).fet... | [
"def add_shoppinglist(self, slist):...\n",
"\"\"\"docstring\"\"\"\n",
"t = slist,\n",
"self.cursor.execute('insert into lists (listhash) values (?)', t)\n",
"self.connection.commit()\n",
"r = self.cursor.execute(\n 'select listid, listhash from lists where listhash = \"%s\"' % slist\n ).fetchall()[0... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_18(self):...\n",
"VAR_13 = ['Line1 passed', 'Line1 failed']\n",
"VAR_14 = ['Line1', 'Line2']\n",
"VAR_15 = [' passed', None]\n",
"self.assertEqual(self.driver._get_prefixed_value(VAR_13, VAR_14[0]), VAR_15[0])\n",
"self.assertEqual(self.driver._get_prefixed_value(VAR_13, VAR_14[1]), VAR_15[1])\n... | [
"def test_get_prefixed_value(self):...\n",
"lines = ['Line1 passed', 'Line1 failed']\n",
"prefix = ['Line1', 'Line2']\n",
"expected_output = [' passed', None]\n",
"self.assertEqual(self.driver._get_prefixed_value(lines, prefix[0]),\n expected_output[0])\n",
"self.assertEqual(self.driver._get_prefixed_v... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(VAR_0, VAR_1):...\n",
"VAR_9 = get_object_or_404(Hunt, id=pk)\n",
"VAR_9.stop()\n",
"VAR_9.delete()\n",
"return redirect('twitter_hunter:index')\n"
] | [
"def hunt_del(request, pk):...\n",
"hunt = get_object_or_404(Hunt, id=pk)\n",
"hunt.stop()\n",
"hunt.delete()\n",
"return redirect('twitter_hunter:index')\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"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'"
] |
[
"def FUNC_14(self):...\n",
"self.run_test_case(self.scenario.disable_server_group())\n"
] | [
"def test_e_disable_server_group(self):...\n",
"self.run_test_case(self.scenario.disable_server_group())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_2(VAR_3, VAR_4):...\n",
"VAR_14 = {}\n",
"for VAR_24, group in enumerate(VAR_3):\n",
"for VAR_25 in group:\n",
"VAR_15 = [[(0) for _ in range(len(VAR_3))] for _ in range(len(VAR_3))]\n",
"VAR_14[VAR_25] = VAR_24\n",
"for tweet in VAR_4:\n",
"if tweet[0] in VAR_14 and tweet[1] in VAR_14:\n",
... | [
"def get_sentiment(groups, tweets):...\n",
"groups_dict = {}\n",
"for i, group in enumerate(groups):\n",
"for user in group:\n",
"total_sentiment = [[(0) for _ in range(len(groups))] for _ in range(len(\n groups))]\n",
"groups_dict[user] = i\n",
"for tweet in tweets:\n",
"if tweet[0] in groups_dict... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"For",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"AugAssign'"
] |
[
"def FUNC_6(self, VAR_68):...\n",
"if not VAR_68:\n",
"return\n",
"if VAR_68.startswith('redirect_'):\n",
"VAR_104 = VAR_68[9:]\n",
"if VAR_68.startswith('vote_'):\n",
"if not VAR_104.startswith(VAR_101.site.path) and not VAR_104.startswith('http:'\n",
"VAR_41 = VAR_68[5:]\n",
"if VAR_68.startswith(... | [
"def run(self, reason):...\n",
"if not reason:\n",
"return\n",
"if reason.startswith('redirect_'):\n",
"dest = reason[9:]\n",
"if reason.startswith('vote_'):\n",
"if not dest.startswith(c.site.path) and not dest.startswith('http:'):\n",
"fullname = reason[5:]\n",
"if reason.startswith('share_'):\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
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Return'",
"Assign'",
... |
[
"def FUNC_14(self):...\n",
"self.compilation_ok(\n \"\"\"\nif address :all :is \"from\" \"tim@example.com\" {\n discard;\n}\n\"\"\")\n",
"self.representation_is('string')\n"
] | [
"def test_non_ordered_args(self):...\n",
"self.compilation_ok(\n \"\"\"\nif address :all :is \"from\" \"tim@example.com\" {\n discard;\n}\n\"\"\")\n",
"self.representation_is(\n \"\"\"\nif (type: control)\n address (type: test)\n :all\n :is\n \"from\"\n \"tim@example.com\... | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"@staticmethod...\n",
"return tornado.web.authenticated(VAR_7)\n"
] | [
"@staticmethod...\n",
"return tornado.web.authenticated(method)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"@VAR_2.route('/data/jobnames/')...\n",
"VAR_61 = {'results': VAR_3.jobnames_query()}\n",
"return VAR_61\n"
] | [
"@app.route('/data/jobnames/')...\n",
"json_jobnames = {'results': JOBSDATA.jobnames_query()}\n",
"return json_jobnames\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_26(self, VAR_0, VAR_7):...\n",
"self.set_max_jobs(VAR_7)\n",
"self.assertRaises(KeyboardInterrupt, self.runall, VAR_0)\n",
"self.assertEqual(4, self.runner.stats.num_cases())\n",
"self.assertEqual(4, len(self.runner.stats.failures()))\n",
"self.assert_all_dead()\n"
] | [
"def _run_checks(self, checks, max_jobs):...\n",
"self.set_max_jobs(max_jobs)\n",
"self.assertRaises(KeyboardInterrupt, self.runall, checks)\n",
"self.assertEqual(4, self.runner.stats.num_cases())\n",
"self.assertEqual(4, len(self.runner.stats.failures()))\n",
"self.assert_all_dead()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_13(self, VAR_16):...\n",
"VAR_16 = VAR_0.select('directory', 'id = ' + VAR_16)[0]['id']\n",
"self.path.append(VAR_16)\n"
] | [
"def go_to_directory(self, directory_id):...\n",
"directory_id = db.select('directory', 'id = ' + directory_id)[0]['id']\n",
"self.path.append(directory_id)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_19(self):...\n",
"self.mock(self.bot, 'post_error', lambda *VAR_15: None)\n",
"self.mock(bot_main, 'THIS_FILE', VAR_7.path.join(self.root_dir,\n 'swarming_bot.1.zip'))\n",
"VAR_31 = VAR_7.path.join(self.root_dir, 'swarming_bot.2.zip')\n",
"self.mock(time, 'time', lambda : 1400000000)\n",
"def... | [
"def test_update_bot(self):...\n",
"self.mock(self.bot, 'post_error', lambda *_: None)\n",
"self.mock(bot_main, 'THIS_FILE', os.path.join(self.root_dir,\n 'swarming_bot.1.zip'))\n",
"new_zip = os.path.join(self.root_dir, 'swarming_bot.2.zip')\n",
"self.mock(time, 'time', lambda : 1400000000)\n",
"def u... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_12():...\n",
"\"\"\"docstring\"\"\"\n",
"from .diary import get_task_info\n",
"VAR_21 = True\n",
"if os.path.isfile(VAR_0):\n",
"while VAR_21:\n",
"click.echo(chalk.red(\n 'There are no goals set. Set a new goal by entering \"yoda goals new\"'))\n",
"click.echo(chalk.blue('Enter the goal ... | [
"def view_related_tasks():...\n",
"\"\"\"docstring\"\"\"\n",
"from .diary import get_task_info\n",
"not_valid_name = True\n",
"if os.path.isfile(GOALS_CONFIG_FILE_PATH):\n",
"while not_valid_name:\n",
"click.echo(chalk.red(\n 'There are no goals set. Set a new goal by entering \"yoda goals new\"'))\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
] | [
"FunctionDef'",
"Docstring",
"ImportFrom'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"For",
"Assign'",
"Expr'",
"Assi... |
[
"def FUNC_9(self):...\n",
"\"\"\"docstring\"\"\"\n",
"frappe.db.sql('delete from tabEvent')\n",
"VAR_4 = FUNC_0()\n",
"VAR_5 = FUNC_0(VAR_1='2016-07-05 23:59:59')\n",
"VAR_6 = FUNC_0(VAR_1='2016-07-06 00:00:00')\n",
"VAR_7 = FUNC_0(VAR_1='2016-07-07 23:59:59')\n",
"VAR_8 = FUNC_0(VAR_1='2016-07-08 00:... | [
"def test_between_filters(self):...\n",
"\"\"\"docstring\"\"\"\n",
"frappe.db.sql('delete from tabEvent')\n",
"todays_event = create_event()\n",
"event1 = create_event(starts_on='2016-07-05 23:59:59')\n",
"event2 = create_event(starts_on='2016-07-06 00:00:00')\n",
"event3 = create_event(starts_on='2016-... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"from urllib.parse import urlencode, quote_plus\n",
"from django.http import HttpResponse, JsonResponse\n",
"from django.conf import settings\n",
"from experiences.factories import create_get_experience_interactor\n",
"from profiles.factories import create_get_profile_interactor\n",
"VAR_0 = '/people/me/e... | [
"from urllib.parse import urlencode, quote_plus\n",
"from django.http import HttpResponse, JsonResponse\n",
"from django.conf import settings\n",
"from experiences.factories import create_get_experience_interactor\n",
"from profiles.factories import create_get_profile_interactor\n",
"EMAIL_CONFIRMATION_PA... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"VAR_0.full_clean()\n",
"VAR_8 = CLASS_3(VAR_1)\n",
"VAR_9 = [('%s %s %s' % (VAR_11, VAR_11.name, VAR_8.depth)) for VAR_11 in VAR_8]\n",
"self.assertListEqual(['on_enter: ', 'on_enter: level2', 'on_exit: level2',\n 'on_enter: level2s[a]', 'on_exit: level2s[a]', 'on_enter: level2... | [
"def test_list_structure(self):...\n",
"TEST_STRUCTURE.full_clean()\n",
"resource_iter = TestResourceTraversalIterator(TEST_LIST_STRUCTURE)\n",
"resources = [('%s %s %s' % (r, r.name, resource_iter.depth)) for r in\n resource_iter]\n",
"self.assertListEqual(['on_enter: ', 'on_enter: level2', 'on_exit: le... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_11(VAR_9):...\n",
"@functools.wraps(VAR_9)...\n",
"VAR_19 = {'$schema': 'http://json-schema.org/draft-07/schema#',\n 'definitions': {'tag': {'type': 'object', 'required': ['namespace',\n 'predicate', 'value'], 'properties': {'namespace': {'type': 'string'},\n 'predicate': {'type': 'string'}, ... | [
"def decorator(func):...\n",
"@functools.wraps(func)...\n",
"request_schema = {'$schema': 'http://json-schema.org/draft-07/schema#',\n 'definitions': {'tag': {'type': 'object', 'required': ['namespace',\n 'predicate', 'value'], 'properties': {'namespace': {'type': 'string'},\n 'predicate': {'type': 'st... | [
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_15(VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"if FUNC_12(VAR_16, 'temp'):\n",
"return VAR_19(VAR_16, 'protected')\n"
] | [
"def protected(value):...\n",
"\"\"\"docstring\"\"\"\n",
"if is_flagged(value, 'temp'):\n",
"return flag(value, 'protected')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'"
] |
[
"import azurelinuxagent.common.utils.fileutil as fileutil\n",
"import azurelinuxagent.common.utils.shellutil as shellutil\n",
"import azurelinuxagent.common.utils.textutil as textutil\n",
"import azurelinuxagent.common.logger as logger\n",
"from azurelinuxagent.common.exception import OSUtilError\n",
"fro... | [
"import azurelinuxagent.common.utils.fileutil as fileutil\n",
"import azurelinuxagent.common.utils.shellutil as shellutil\n",
"import azurelinuxagent.common.utils.textutil as textutil\n",
"import azurelinuxagent.common.logger as logger\n",
"from azurelinuxagent.common.exception import OSUtilError\n",
"fro... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Expr'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"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 FUNC_6(self, VAR_18):...\n",
"if not VAR_18:\n",
"self.error()\n",
"return VAR_18\n"
] | [
"def run(self, item):...\n",
"if not item:\n",
"self.error()\n",
"return item\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_12(self, *VAR_10, **VAR_11):...\n",
"return FUNC_12(*VAR_10, distribution=self, **kwargs)\n"
] | [
"def execute_java_async(self, *args, **kwargs):...\n",
"return execute_java_async(*args, distribution=self, **kwargs)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_61():...\n",
"self.cursor.execute('create table t1 (word varchar (100))')\n",
"VAR_39 = set(['a'])\n",
"self.cursor.executemany('insert into t1 (word) values (?)', [VAR_39])\n"
] | [
"def f():...\n",
"self.cursor.execute('create table t1 (word varchar (100))')\n",
"words = set(['a'])\n",
"self.cursor.executemany('insert into t1 (word) values (?)', [words])\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_3 = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n",
"self.driver._eql_execute('volume', 'select', VAR_3['volume_name'],\n 'snapshot', 'delete', VAR_3['name'])\n",
"self.mox.ReplayAll()\... | [
"def test_delete_snapshot(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"snapshot = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}\n",
"self.driver._eql_execute('volume', 'select', snapshot['volume_name'],\n 'snapshot', 'delete', snapshot['name'])\n",
... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@VAR_7.route('/register', methods=['GET', 'POST'])...\n",
"if request.method == 'POST':\n",
"VAR_14 = generate_password_hash(request.form['password'])\n",
"return render_template('user/register/registration.html')\n",
"VAR_15 = reg.registerUser(request.form['email'], VAR_14, VAR_6)\n",
"if VAR_15 == 'Suc... | [
"@app.route('/register', methods=['GET', 'POST'])...\n",
"if request.method == 'POST':\n",
"hashedPassword = generate_password_hash(request.form['password'])\n",
"return render_template('user/register/registration.html')\n",
"status = reg.registerUser(request.form['email'], hashedPassword, mysql)\n",
"if ... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_34(self, VAR_64):...\n",
"return CLASS_1(VAR_64)\n"
] | [
"def run(self, func):...\n",
"return RuleInfo(func)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(VAR_26, VAR_27, VAR_28=bconfig.CFG_MAIN_FIELD, VAR_29=bconfig....\n",
"\"\"\"docstring\"\"\"\n",
"VAR_53 = 'string'\n",
"VAR_52 = []\n",
"VAR_54, VAR_55, VAR_56 = FUNC_29(VAR_28)\n",
"for VAR_36 in (VAR_26['Single keywords'], VAR_26['Core keywords']):\n",
"for VAR_62 in VAR_36:\n",
"for VA... | [
"def _output_marc(output_complete, categories, kw_field=bconfig....\n",
"\"\"\"docstring\"\"\"\n",
"kw_template = \"\"\"<datafield tag=\"%s\" ind1=\"%s\" ind2=\"%s\">\n <subfield code=\"2\">%s</subfield>\n <subfield code=\"a\">%s</subfield>\n <subfield code=\"n\">%s</subfield>\n <subfield code=\"9\"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"For",
"Expr'",
"Condition",
"Return'",
"Assign'",
"For",
"Expr'"
] |
[
"def __add__(self, VAR_3):...\n",
"if isinstance(VAR_3, CLASS_1):\n",
"return CLASS_1(*(self._path + VAR_3._path))\n",
"if isinstance(VAR_3, six.string_types):\n",
"return CLASS_1(*(self._path + tuple([(CLASS_0, CLASS_0, VAR_3)])))\n"
] | [
"def __add__(self, other):...\n",
"if isinstance(other, TraversalPath):\n",
"return TraversalPath(*(self._path + other._path))\n",
"if isinstance(other, six.string_types):\n",
"return TraversalPath(*(self._path + tuple([(NotSupplied, NotSupplied, other)]))\n )\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"def __eq__(self, VAR_12):...\n",
"return self.etag == VAR_12.etag and self.mtime == VAR_12.mtime\n"
] | [
"def __eq__(self, other):...\n",
"return self.etag == other.etag and self.mtime == other.mtime\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@app.route('/people/', methods=['GET'])...\n",
"return render_template('/people/list.html', VAR_14=get_people())\n"
] | [
"@app.route('/people/', methods=['GET'])...\n",
"return render_template('/people/list.html', people=get_people())\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_15, VAR_16, VAR_17):...\n",
"\"\"\"docstring\"\"\"\n",
"self._name = 'Netatmo {} {}'.format(VAR_16, VAR_5[VAR_17][0])\n",
"self.netatmo_data = VAR_15\n",
"self.module_name = VAR_16\n",
"self.type = VAR_17\n",
"self._state = None\n",
"self._device_class = VAR_5[self.type][3]\n",... | [
"def __init__(self, netatmo_data, module_name, sensor_type):...\n",
"\"\"\"docstring\"\"\"\n",
"self._name = 'Netatmo {} {}'.format(module_name, SENSOR_TYPES[sensor_type][0])\n",
"self.netatmo_data = netatmo_data\n",
"self.module_name = module_name\n",
"self.type = sensor_type\n",
"self._state = None\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_7(self):...\n",
"self._tab_after('ls \"comp')\n",
"eq_(self.terminal.method_calls, [('write', ('utes\" ',), {})])\n"
] | [
"def test_complete_quotes(self):...\n",
"self._tab_after('ls \"comp')\n",
"eq_(self.terminal.method_calls, [('write', ('utes\" ',), {})])\n"
] | [
0,
0,
1
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(VAR_1, VAR_3=None):...\n",
"if VAR_3 == None:\n",
"VAR_3 = len(VAR_1)\n",
"return VAR_1 + (VAR_3 - len(VAR_1)) * ' '\n"
] | [
"def print_left_just(output, length=None):...\n",
"if length == None:\n",
"length = len(output)\n",
"return output + (length - len(output)) * ' '\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"@mock.patch('requests.post', FUNC_0)...\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_4 = '/api/apps/{app_id}/containers'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\n",
"self.assertEqual(V... | [
"@mock.patch('requests.post', mock_import_repository_task)...\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}/containers'.format(**locals())\n",
"response = self.client.get(url)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr... |
[
"def FUNC_10(VAR_20, VAR_21):...\n",
"return VAR_21[len(VAR_20):] if VAR_21.startswith(VAR_20) else VAR_21\n"
] | [
"def strip_prefix(prefix, s):...\n",
"return s[len(prefix):] if s.startswith(prefix) else s\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_21(VAR_38, VAR_20):...\n",
"VAR_63, VAR_64 = os.path.split(VAR_20)\n",
"FUNC_19(VAR_63)\n",
"shutil.copy2(VAR_38, VAR_20)\n"
] | [
"def cp(src, dst):...\n",
"r, f = os.path.split(dst)\n",
"mkdir_p(r)\n",
"shutil.copy2(src, dst)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_14(self, VAR_10=None, VAR_14=None, VAR_16=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self.add_extra_args(VAR_10)\n",
"self.args = super().parse_args(VAR_10=args)\n",
"self.opt = vars(self.args)\n",
"self.opt['parlai_home'] = self.parlai_home\n",
"if 'batchsize' in self.opt and self.opt['batchsi... | [
"def parse_args(self, args=None, namespace=None, print_args=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self.add_extra_args(args)\n",
"self.args = super().parse_args(args=args)\n",
"self.opt = vars(self.args)\n",
"self.opt['parlai_home'] = self.parlai_home\n",
"if 'batchsize' in self.opt and self.opt['bat... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"For",
"Condition",
"Co... |
[
"def FUNC_1(self, VAR_0, VAR_1, *VAR_2, **VAR_3):...\n",
"VAR_12 = get_object_or_404(JustURL, VAR_1=pk)\n",
"VAR_17 = VAR_12.clicktracking_set.all().order_by('timestamp')\n",
"return render(VAR_0, 'clicktracking-detail-view.html', {'object': VAR_12,\n 'reports': VAR_17})\n"
] | [
"def get(self, request, pk, *args, **kwargs):...\n",
"object = get_object_or_404(JustURL, pk=pk)\n",
"reports = object.clicktracking_set.all().order_by('timestamp')\n",
"return render(request, 'clicktracking-detail-view.html', {'object': object,\n 'reports': reports})\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(VAR_9, VAR_10, VAR_11):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_9 = str(VAR_9)\n",
"VAR_10 = str(VAR_10)\n",
"VAR_11 = str(VAR_11)\n",
"FUNC_0(VAR_9)\n",
"FUNC_0(VAR_10)\n",
"FUNC_0(VAR_11)\n",
"VAR_21 = pathlib.Path(VAR_9).glob('**/*.gz')\n",
"for VAR_0 in VAR_21:\n",
"VAR_31 = str(V... | [
"def process_data_files(input_dir, temp_dir, output_dir):...\n",
"\"\"\"docstring\"\"\"\n",
"input_dir = str(input_dir)\n",
"temp_dir = str(temp_dir)\n",
"output_dir = str(output_dir)\n",
"create_directory_tree(input_dir)\n",
"create_directory_tree(temp_dir)\n",
"create_directory_tree(output_dir)\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
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Expr'",
"Expr'",
"Assign'",... |
[
"@property...\n",
"return self.request.site.id\n"
] | [
"@property...\n",
"return self.request.site.id\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_5(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1.value = beamr.interpreters.Footnote(VAR_1.value[2:-2])\n",
"return VAR_1\n"
] | [
"def t_FOOTNOTE(t):...\n",
"\"\"\"docstring\"\"\"\n",
"t.value = beamr.interpreters.Footnote(t.value[2:-2])\n",
"return t\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"from twisted.internet.defer import inlineCallbacks, returnValue\n",
"from base import Query\n",
"\"\"\"\n Object representing an insert query\n \"\"\"\n",
"def __init__(self, VAR_0, VAR_1):...\n",
"super(CLASS_0, self).__init__(VAR_0)\n",
"self.values = VAR_1\n",
"self.on_conflict = self.model_cl... | [
"from twisted.internet.defer import inlineCallbacks, returnValue\n",
"from base import Query\n",
"\"\"\"\n Object representing an insert query\n \"\"\"\n",
"def __init__(self, model_class, values):...\n",
"super(InsertQuery, self).__init__(model_class)\n",
"self.values = values\n",
"self.on_confli... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
4,
4,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(self, VAR_23, VAR_20=None, VAR_21=None, VAR_22=True):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_38 = self.metadata('plugins', VAR_20=database, VAR_21=table, VAR_22=\n fallback)\n",
"if VAR_38 is None:\n",
"return None\n",
"return VAR_38.get(VAR_23)\n"
] | [
"def plugin_config(self, plugin_name, database=None, table=None, fallback=True):...\n",
"\"\"\"docstring\"\"\"\n",
"plugins = self.metadata('plugins', database=database, table=table, fallback\n =fallback)\n",
"if plugins is None:\n",
"return None\n",
"return plugins.get(plugin_name)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_5(self, VAR_3, **VAR_6):...\n",
"logging.warn('url_read_json(%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_read_json(self, url, **kwargs):...\n",
"logging.warn('url_read_json(%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)... | [
0,
0,
0,
0,
0,
0,
0,
0,
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 FUNC_1(self, VAR_7):...\n",
"VAR_10, VAR_11 = self.validate_row(VAR_7)\n",
"if VAR_10:\n",
"VAR_15, VAR_16, VAR_17 = VAR_7\n",
"return VAR_10, VAR_11\n",
"VAR_18 = int(time())\n",
"VAR_19 = VAR_18, VAR_15, VAR_16, VAR_17\n",
"VAR_9 = 'INSERT INTO {} ({}) VALUES {}'.format(VAR_1, VAR_3, str(VAR_19... | [
"def insert(self, input_row):...\n",
"is_valid, violations = self.validate_row(input_row)\n",
"if is_valid:\n",
"name, location, description = input_row\n",
"return is_valid, violations\n",
"date = int(time())\n",
"args = date, name, location, description\n",
"stmt = 'INSERT INTO {} ({}) VALUES {}'.fo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"if self._IsServerAlive():\n",
"self._server_popen.terminate()\n",
"utils.RemoveIfExists(self._temp_options_filename)\n"
] | [
"def _ServerCleanup(self):...\n",
"if self._IsServerAlive():\n",
"self._server_popen.terminate()\n",
"utils.RemoveIfExists(self._temp_options_filename)\n"
] | [
0,
0,
0,
7
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Expr'"
] |
[
"async def FUNC_2(VAR_0, VAR_1):...\n",
"if VAR_1.content.startswith('user add '):\n",
"VAR_7 = VAR_1.content.split()[2:]\n",
"if db.rank_check(VAR_1.author.id, 'user add') and len(VAR_7\n",
"db.update(\"INSERT INTO {} (id, nickname, rank) VALUES ('{}', '{}', 'member');\"\n .format(db.user_table, VAR_7[0... | [
"async def user_add(bot, message):...\n",
"if message.content.startswith('user add '):\n",
"msg = message.content.split()[2:]\n",
"if db.rank_check(message.author.id, 'user add') and len(msg\n",
"db.update(\"INSERT INTO {} (id, nickname, rank) VALUES ('{}', '{}', 'member');\"\n .format(db.user_table, msg... | [
0,
0,
0,
0,
4
] | [
"AsyncFunctionDef'",
"Condition",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_56(self):...\n",
"self.run_example('binding.py')\n",
"VAR_10 = self.b_mgr.get_issue_list()\n",
"VAR_11 = VAR_10[0].get_code().splitlines()\n",
"VAR_12 = VAR_10[0].lineno\n",
"self.assertEqual('%i ' % (VAR_12 - 1), VAR_11[0][:2])\n",
"self.assertEqual('%i ' % VAR_12, VAR_11[1][:2])\n",
"self.... | [
"def test_code_line_numbers(self):...\n",
"self.run_example('binding.py')\n",
"issues = self.b_mgr.get_issue_list()\n",
"code_lines = issues[0].get_code().splitlines()\n",
"lineno = issues[0].lineno\n",
"self.assertEqual('%i ' % (lineno - 1), code_lines[0][:2])\n",
"self.assertEqual('%i ' % lineno, code... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"self._hosts_cache = None\n",
"for VAR_12 in self.parent_groups:\n",
"VAR_12.clear_hosts_cache()\n"
] | [
"def clear_hosts_cache(self):...\n",
"self._hosts_cache = None\n",
"for g in self.parent_groups:\n",
"g.clear_hosts_cache()\n"
] | [
0,
0,
1,
1
] | [
"FunctionDef'",
"Assign'",
"For",
"Expr'"
] |
[
"def FUNC_11(VAR_10, VAR_11):...\n",
"VAR_13 = ''\n",
"for product in VAR_11['products']:\n",
"VAR_13 += '('\n",
"VAR_13 = VAR_13[:-1]\n",
"VAR_13 += str(VAR_10['id'])\n",
"return VAR_13\n",
"VAR_13 += ','\n",
"VAR_13 += str(product['product']['productId'])\n",
"VAR_13 += ','\n",
"VAR_13 += str(... | [
"def create_invoice_products_values_query(invoiceId, products):...\n",
"invoice_products_values = ''\n",
"for product in products['products']:\n",
"invoice_products_values += '('\n",
"invoice_products_values = invoice_products_values[:-1]\n",
"invoice_products_values += str(invoiceId['id'])\n",
"return ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"AugAssign'",
"Assign'",
"AugAssign'",
"Return'",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"AugAssign'",
"AugAssign'"
] |
[
"def FUNC_45(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.assertTrue(tournament.playerStandings())\n"
] | [
"def test_list_win_ranking(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.assertTrue(tournament.playerStandings())\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"@staticmethod...\n",
"VAR_3 = AnalysisController.get_report(VAR_0)\n",
"VAR_3 = VAR_3['analysis']\n",
"VAR_5 = VAR_3['info']['analysis_path']\n",
"VAR_6 = 0\n",
"for directory in VAR_1:\n",
"VAR_14 = '%s/%s' % (VAR_5, directory)\n",
"for filename in VAR_2:\n",
"if os.path.isdir(VAR_14):\n",
"VAR_... | [
"@staticmethod...\n",
"report = AnalysisController.get_report(task_id)\n",
"report = report['analysis']\n",
"path = report['info']['analysis_path']\n",
"size_total = 0\n",
"for directory in taken_dirs:\n",
"destination = '%s/%s' % (path, directory)\n",
"for filename in taken_files:\n",
"if os.path.i... | [
0,
0,
0,
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"AugAssign'",
"Condition",
"Return'",
"AugAssign'"
] |
[
"def __init__(self, VAR_6=None, VAR_7=None):...\n",
"super(CLASS_1, self).__init__()\n",
"self._error_msg = VAR_6\n",
"self.disclaimer_banner_file = VAR_7\n"
] | [
"def __init__(self, error_msg=None, disclaimer_banner_file=None):...\n",
"super(LoginWebSite, self).__init__()\n",
"self._error_msg = error_msg\n",
"self.disclaimer_banner_file = disclaimer_banner_file\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_2 = Post.objects.order_by('pub_date')\n",
"return render(VAR_0, 'posts/home.html', {'posts': VAR_2})\n"
] | [
"def home(request):...\n",
"posts = Post.objects.order_by('pub_date')\n",
"return render(request, 'posts/home.html', {'posts': posts})\n"
] | [
0,
6,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_3, **VAR_6):...\n",
"logging.warn('url_read_json(%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_read_json(self, url, **kwargs):...\n",
"logging.warn('url_read_json(%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)... | [
0,
0,
0,
0,
0,
0,
0,
0,
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 FUNC_16(self):...\n",
"return False\n"
] | [
"def do_existing_paths(self):...\n",
"return False\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __setstate__(self, VAR_0):...\n",
"return self.deserialize(VAR_0)\n"
] | [
"def __setstate__(self, data):...\n",
"return self.deserialize(data)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(VAR_14, VAR_19, VAR_3=None, VAR_4=None, VAR_5=None, VAR_2=VAR_0,...\n",
"if VAR_14.method == 'GET':\n",
"VAR_27 = {'title': VAR_19}\n",
"return HttpResponseNotAllowed(['GET'])\n",
"if VAR_3 is not None:\n",
"VAR_8 = get_object_or_404(VAR_5, **{group_slug_field: group_slug})\n",
"VAR_46 = VAR... | [
"def article_history(request, title, group_slug=None, group_slug_field=None,...\n",
"if request.method == 'GET':\n",
"article_args = {'title': title}\n",
"return HttpResponseNotAllowed(['GET'])\n",
"if group_slug is not None:\n",
"group = get_object_or_404(group_qs, **{group_slug_field: group_slug})\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Return'"
] |
[
"import pymysql\n",
"def FUNC_0():...\n",
"VAR_3 = pymysql.connect(host='localhost', user='root', passwd='', db='ebola')\n",
"print('connection error: ', error)\n",
"return VAR_3\n"
] | [
"import pymysql\n",
"def create_connection():...\n",
"connection = pymysql.connect(host='localhost', user='root', passwd='', db=\n 'ebola')\n",
"print('connection error: ', error)\n",
"return connection\n"
] | [
0,
0,
0,
0,
0
] | [
"Import'",
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"from flask import request\n",
"from flask_jwt_extended import jwt_required\n",
"from flask_restplus import Namespace, Resource, fields, reqparse\n",
"from utilities import database_utilities\n",
"VAR_0 = Namespace('spaces', description='Information relating to spaces')\n",
"def FUNC_0(self):...\n",
"\"... | [
"from flask import request\n",
"from flask_jwt_extended import jwt_required\n",
"from flask_restplus import Namespace, Resource, fields, reqparse\n",
"from utilities import database_utilities\n",
"api = Namespace('spaces', description='Information relating to spaces')\n",
"def get(self):...\n",
"\"\"\"d... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_11(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.fileExists(VAR_8):\n",
"VAR_7 = \"SELECT meta FROM {0} where path='{1}';\".format(VAR_2, VAR_8)\n",
"print(\"getMetadata: file doesn't exist!\")\n",
"VAR_4 = self._run_command(VAR_7)\n",
"VAR_4 = None\n",
"VAR_4 = VAR_4[0][0]\n",
... | [
"def getMetadata(self, pth):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.fileExists(pth):\n",
"command = \"SELECT meta FROM {0} where path='{1}';\".format(TABLE_NAME, pth)\n",
"print(\"getMetadata: file doesn't exist!\")\n",
"data = self._run_command(command)\n",
"data = None\n",
"data = data[0][0]\n",... | [
0,
0,
0,
4,
0,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"import sqlite3\n",
"import os\n",
"from collections import defaultdict\n",
"from HistoryEdge import HistoryEdge\n",
"from HistoryGraph import HistoryGraph\n",
"def FUNC_0(VAR_0, VAR_1, VAR_2):...\n",
"os.remove(VAR_1)\n",
"VAR_13 = sqlite3.connect(VAR_1)\n",
"VAR_13.execute('string')\n",
"VAR_13.... | [
"import sqlite3\n",
"import os\n",
"from collections import defaultdict\n",
"from HistoryEdge import HistoryEdge\n",
"from HistoryGraph import HistoryGraph\n",
"def SaveDocumentCollection(dc, filenameedges, filenamedata):...\n",
"os.remove(filenameedges)\n",
"c = sqlite3.connect(filenameedges)\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,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
4,
0,
0,
0... | [
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"For",
"Assign'",
"Expr'",
"For",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'"... |
[
"def FUNC_24(self, *VAR_71, **VAR_72):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.params = VAR_71, VAR_72\n",
"return VAR_101\n"
] | [
"def params(self, *params, **kwparams):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.params = params, kwparams\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_20(self):...\n",
"self.compilation_ok('string')\n"
] | [
"def test_vacationext_medium(self):...\n",
"self.compilation_ok(\n \"\"\"\nrequire \"vacation\";\nif header :contains \"subject\" \"lunch\" {\n vacation :handle \"ran-away\" \"I'm out and can't meet for lunch\";\n} else {\n vacation :handle \"ran-away\" \"I'm out\";\n}\n\"\"\"\n )\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"self.run_test_case(self.scenario.create_app())\n"
] | [
"def test_a_create_app(self):...\n",
"self.run_test_case(self.scenario.create_app())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_39(VAR_101):...\n",
"VAR_101.benchmark = VAR_74\n",
"return VAR_101\n"
] | [
"def decorate(ruleinfo):...\n",
"ruleinfo.benchmark = benchmark\n",
"return ruleinfo\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.