lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_3(self):...\n",
""
] | [
"def tearDown(self):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def __str__(self):...\n",
"return str(self.nickname())\n"
] | [
"def __str__(self):...\n",
"return str(self.nickname())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@handled_slot(bool)...\n",
"print(f\"{'Locking' if VAR_4 else 'Unlocking'} fast piezo.\")\n",
"self.lock_fast_piezo_action.setChecked(not VAR_4)\n",
"self.matisse.set_piezo_etalon_lock(VAR_4)\n",
"self.lock_fast_piezo_action.setChecked(VAR_4)\n"
] | [
"@handled_slot(bool)...\n",
"print(f\"{'Locking' if checked else 'Unlocking'} fast piezo.\")\n",
"self.lock_fast_piezo_action.setChecked(not checked)\n",
"self.matisse.set_piezo_etalon_lock(checked)\n",
"self.lock_fast_piezo_action.setChecked(checked)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_8(VAR_3, VAR_2):...\n",
"VAR_10 = {}\n",
"for measure_value in VAR_3:\n",
"VAR_32 = measure_value.measure_id\n",
"return VAR_10.values()\n",
"VAR_33 = {'date': measure_value.month, 'numerator': measure_value.numerator,\n 'denominator': measure_value.denominator, 'calc_value': measure_value.\n... | [
"def _roll_up_measure_values(measure_values, org_type):...\n",
"rolled = {}\n",
"for measure_value in measure_values:\n",
"measure_id = measure_value.measure_id\n",
"return rolled.values()\n",
"measure_value_data = {'date': measure_value.month, 'numerator':\n measure_value.numerator, 'denominator': mea... | [
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'",
"For",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Assert'",
"Expr'"
] |
[
"def FUNC_17(self, VAR_18):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_31 = VAR_18[0],\n",
"self.cursor.execute('insert into store (name) values (?)', VAR_31)\n",
"self.connection.commit()\n"
] | [
"def add_store(self, store):...\n",
"\"\"\"docstring\"\"\"\n",
"t = store[0],\n",
"self.cursor.execute('insert into store (name) values (?)', t)\n",
"self.connection.commit()\n"
] | [
0,
0,
4,
4,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def __init__(self):...\n",
"self.conn = pymysql.connect(user=config.mysql_credentials['user'], password\n =config.mysql_credentials['password'], host=config.mysql_credentials[\n 'host'], db=config.mysql_credentials['database'], cursorclass=pymysql.\n cursors.DictCursor)\n",
"self.cur = self.conn.curso... | [
"def __init__(self):...\n",
"self.conn = pymysql.connect(user=config.mysql_credentials['user'], password\n =config.mysql_credentials['password'], host=config.mysql_credentials[\n 'host'], db=config.mysql_credentials['database'], cursorclass=pymysql.\n cursors.DictCursor)\n",
"self.cur = self.conn.curso... | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"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_7(self, **VAR_10):...\n",
"return super().formfield(**{'form_class': forms.JSONField, **kwargs})\n"
] | [
"def formfield(self, **kwargs):...\n",
"return super().formfield(**{'form_class': forms.JSONField, **kwargs})\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"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_12(self, VAR_5):...\n",
"VAR_20 = VAR_5.args['username'][0]\n",
"VAR_21 = VAR_5.args['password'][0]\n",
"return credentials.UsernamePassword(VAR_20, VAR_21)\n"
] | [
"def _get_creds_from(self, request):...\n",
"username = request.args['username'][0]\n",
"password = request.args['password'][0]\n",
"return credentials.UsernamePassword(username, password)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"from __future__ import unicode_literals\n",
"import mimetypes\n",
"import os\n",
"import posixpath\n",
"import re\n",
"import stat\n",
"from django.http import FileResponse, Http404, HttpResponse, HttpResponseNotModified, HttpResponseRedirect\n",
"from django.template import... | [
"\"\"\"\nViews and functions for serving static files. These are only to be used\nduring development, and SHOULD NOT be used in a production setting.\n\"\"\"\n",
"from __future__ import unicode_literals\n",
"import mimetypes\n",
"import os\n",
"import posixpath\n",
"import re\n",
"import stat\n",
"fro... | [
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
0,
6,
0,
0,
6,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Return'",
"... |
[
"def FUNC_0(VAR_0):...\n",
"print(VAR_0, file=sys.stderr)\n"
] | [
"def log_error(error):...\n",
"print(error, file=sys.stderr)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_13(self, VAR_17, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"return False\n"
] | [
"def immutable_file_test(self, path, url):...\n",
"\"\"\"docstring\"\"\"\n",
"return False\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_24(self, VAR_14):...\n",
""
] | [
"def is_pk(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_18(self, VAR_2, VAR_3, VAR_4, *VAR_5):...\n",
"self.write_data({'type': 'market_payment_received', 'event': VAR_5[0]})\n"
] | [
"def on_market_payment_received(self, subject, changetype, objectID, *args):...\n",
"self.write_data({'type': 'market_payment_received', 'event': args[0]})\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_20(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_34 = []\n",
"for value in self.iscsi_ips.values():\n",
"VAR_34.append(value['nsp'])\n",
"return VAR_34\n"
] | [
"def _get_iscsi_nsps(self):...\n",
"\"\"\"docstring\"\"\"\n",
"nsps = []\n",
"for value in self.iscsi_ips.values():\n",
"nsps.append(value['nsp'])\n",
"return nsps\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Return'"
] |
[
"def __init__(self):...\n",
"self.content = VAR_2\n"
] | [
"def __init__(self):...\n",
"self.content = content\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_9(self, VAR_12):...\n",
"print('Test type: %s' % self.__class__.__name__, file=fd)\n",
"print('Execution start time: %s' % datetime.datetime.fromtimestamp(self.\n start_time).strftime('%d/%m/%Y %H:%M:%S.%f'), file=fd)\n",
"print('Execution stop time: %s' % datetime.datetime.fromtimestamp(self.\n ... | [
"def store_to_file(self, fd):...\n",
"print('Test type: %s' % self.__class__.__name__, file=fd)\n",
"print('Execution start time: %s' % datetime.datetime.fromtimestamp(self.\n start_time).strftime('%d/%m/%Y %H:%M:%S.%f'), file=fd)\n",
"print('Execution stop time: %s' % datetime.datetime.fromtimestamp(self.... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __gt__(self, VAR_11):...\n",
"return self.rule.__gt__(VAR_11.rule)\n"
] | [
"def __gt__(self, other):...\n",
"return self.rule.__gt__(other.rule)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"VAR_1 = bot.Bot(None, {'dimensions': {'foo': 'bar'}},\n 'https://localhost:1/', '1234-1a2b3c4-tainted-joe', 'base_dir', None)\n",
"self.assertEqual({'foo': 'bar'}, VAR_1.dimensions)\n",
"self.assertEqual(os.path.join(os.path.dirname(VAR_0), 'swarming_bot.zip'),\n VAR_1.swarmin... | [
"def test_bot(self):...\n",
"obj = bot.Bot(None, {'dimensions': {'foo': 'bar'}}, 'https://localhost:1/',\n '1234-1a2b3c4-tainted-joe', 'base_dir', None)\n",
"self.assertEqual({'foo': 'bar'}, obj.dimensions)\n",
"self.assertEqual(os.path.join(os.path.dirname(THIS_FILE),\n 'swarming_bot.zip'), obj.swarmin... | [
0,
5,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_25(VAR_14, VAR_27, VAR_28):...\n",
"VAR_26.append((VAR_14, VAR_27.splitlines()[0], VAR_28))\n"
] | [
"def post_error_task(botobj, msg, task_id):...\n",
"posted.append((botobj, msg.splitlines()[0], task_id))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"from .common_info import CommonInfo\n",
"from .data_source import DataSource\n",
"from .group_type import GroupType\n",
"from .data_group import DataGroup\n",
"from .document_type import DocumentType\n",
"from .data_document import DataDocument\n",
"from .ingredient import Ingredient\n",
"from .produ... | [
"from .common_info import CommonInfo\n",
"from .data_source import DataSource\n",
"from .group_type import GroupType\n",
"from .data_group import DataGroup\n",
"from .document_type import DocumentType\n",
"from .data_document import DataDocument\n",
"from .ingredient import Ingredient\n",
"from .produ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFro... |
[
"def FUNC_9(self, VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = {}\n",
"for VAR_3 in VAR_7:\n",
"VAR_11[VAR_3] = self.get_tags(VAR_3)\n",
"return VAR_11\n"
] | [
"def get_tags_dict(self, tids):...\n",
"\"\"\"docstring\"\"\"\n",
"tags_dict = {}\n",
"for tid in tids:\n",
"tags_dict[tid] = self.get_tags(tid)\n",
"return tags_dict\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_9):...\n",
"self.controller = VAR_9\n",
"self._loaded = False\n"
] | [
"def __init__(self, controller):...\n",
"self.controller = controller\n",
"self._loaded = False\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def FUNC_8(self, VAR_14):...\n",
""
] | [
"def is_file(self, col_name):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_11(self):...\n",
"VAR_10 = self.objects.dg.pk\n",
"VAR_11 = str(self.objects.ds.pk)\n",
"VAR_12 = str(self.objects.gt.pk)\n",
"VAR_13 = {'name': ['Changed Name'], 'group_type': [VAR_12], 'downloaded_by':\n [str(User.objects.get(username='Karyn').pk)], 'downloaded_at': [\n '08/20/2017'], 'dat... | [
"def test_edit_redirect(self):...\n",
"dgpk = self.objects.dg.pk\n",
"dspk = str(self.objects.ds.pk)\n",
"gtpk = str(self.objects.gt.pk)\n",
"data = {'name': ['Changed Name'], 'group_type': [gtpk], 'downloaded_by': [\n str(User.objects.get(username='Karyn').pk)], 'downloaded_at': [\n '08/20/2017'], 'd... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_1, VAR_4):...\n",
""
] | [
"def run(self, args, headers):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_10(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = VAR_8\n",
"VAR_25 = CLASS_1(VAR_8)\n",
"if VAR_25.get_tag('pulled from'):\n",
"VAR_21 = VAR_25.get_tag('pulled from')[0].split(' |')[0].strip(' ->')\n",
"return VAR_21\n",
"return self.find_oldest_node(VAR_21)\n"
] | [
"def find_oldest_node(self, filename):...\n",
"\"\"\"docstring\"\"\"\n",
"oldest_known_filename = filename\n",
"this_meta = NodeMetadata(filename)\n",
"if this_meta.get_tag('pulled from'):\n",
"oldest_known_filename = this_meta.get_tag('pulled from')[0].split(' |')[0\n ].strip(' ->')\n",
"return olde... | [
0,
0,
0,
1,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Return'"
] |
[
"\"\"\"SchoolCMS-handler-init.\n\nroute.\n\"\"\"\n",
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"from .. import version as system_version\n",
"from ..db import SQL_Session, User, GroupList, Login_Session\n",
"from .... | [
"\"\"\"SchoolCMS-handler-init.\n\nroute.\n\"\"\"\n",
"from __future__ import absolute_import\n",
"from __future__ import print_function\n",
"from __future__ import unicode_literals\n",
"from .. import version as system_version\n",
"from ..db import SQL_Session, User, GroupList, Login_Session\n",
"from .... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
5,
5,
5,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"FunctionDef'",
"Do... |
[
"def FUNC_1(self, VAR_21, VAR_22):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_55 = VAR_21.rstrip('/').split('/')\n",
"if VAR_21[0] == '/':\n",
"VAR_22 = []\n",
"VAR_22 = [x for x in VAR_22.split('/') if len(x) and x is not None]\n",
"while 1:\n",
"if not len(VAR_55):\n",
"VAR_66 = VAR_55.pop(0)\n",
"r... | [
"def resolve_path(self, path, cwd):...\n",
"\"\"\"docstring\"\"\"\n",
"pieces = path.rstrip('/').split('/')\n",
"if path[0] == '/':\n",
"cwd = []\n",
"cwd = [x for x in cwd.split('/') if len(x) and x is not None]\n",
"while 1:\n",
"if not len(pieces):\n",
"piece = pieces.pop(0)\n",
"return '/%s' %... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Return'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_19(VAR_36):...\n",
"if VAR_36.strip() != '' and not os.path.exists(VAR_36):\n",
"os.makedirs(VAR_36)\n"
] | [
"def mkdir_p(path):...\n",
"if path.strip() != '' and not os.path.exists(path):\n",
"os.makedirs(path)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'"
] |
[
"def __str__(self):...\n",
"return '{} - {}'.format(self.parent, self.child)\n"
] | [
"def __str__(self):...\n",
"return '{} - {}'.format(self.parent, self.child)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"return VAR_3\n"
] | [
"def getDjangoURLPatterns():...\n",
"\"\"\"docstring\"\"\"\n",
"return ROLE_MODELS_URL_PATTERNS\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_4(VAR_11, VAR_12=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_1['VERBOSITY'] >= 1:\n",
"VAR_0.info('$ ' + ' '.join(VAR_11))\n",
"VAR_19 = dict()\n",
"if VAR_1['VERBOSITY'] >= 3:\n",
"VAR_19['stdout'] = io.open(os.devnull, 'wb')\n",
"VAR_32 = subprocess.call(VAR_11, **kwargs)\n",
"VAR_... | [
"def sh(cmdline, ignore_failure=False):...\n",
"\"\"\"docstring\"\"\"\n",
"if CONFIG['VERBOSITY'] >= 1:\n",
"logger.info('$ ' + ' '.join(cmdline))\n",
"kwargs = dict()\n",
"if CONFIG['VERBOSITY'] >= 3:\n",
"kwargs['stdout'] = io.open(os.devnull, 'wb')\n",
"ret = subprocess.call(cmdline, **kwargs)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition"
] |
[
"def FUNC_1(self, VAR_2):...\n",
"print('remove_frame: ' + str(VAR_2))\n",
"self.frames.pop(VAR_2, None)\n"
] | [
"def remove_frame(self, frame):...\n",
"print('remove_frame: ' + str(frame))\n",
"self.frames.pop(frame, None)\n"
] | [
0,
4,
4
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"self._check_duplicate_key(VAR_1)\n"
] | [
"def test_ecdsa_duplicate_key(self):...\n",
"self._check_duplicate_key(ECDSA_PUBKEY)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_10):...\n",
"return '%s%s' % (self.configuration.iscsi_target_prefix, VAR_10['name'])\n"
] | [
"def _build_iscsi_target_name(self, volume):...\n",
"return '%s%s' % (self.configuration.iscsi_target_prefix, volume['name'])\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_27(self, VAR_8=True):...\n",
"\"\"\"docstring\"\"\"\n",
"logging.debug('Processing SAML logout response')\n",
"VAR_11 = self._saml_auth()\n",
"VAR_32 = []\n",
"VAR_11.process_slo()\n",
"VAR_32 = VAR_11.get_errors()\n",
"if VAR_32:\n",
"if VAR_8:\n",
"logging.info('SAML SLO request was su... | [
"def log_out_callback(self, clear_session_on_errors=True):...\n",
"\"\"\"docstring\"\"\"\n",
"logging.debug('Processing SAML logout response')\n",
"auth = self._saml_auth()\n",
"errors = []\n",
"auth.process_slo()\n",
"errors = auth.get_errors()\n",
"if errors:\n",
"if clear_session_on_errors:\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"VAR_12 = ['select', 'delete', 'drop', 'update', 'case', 'and', 'or', 'like']\n",
"def FUNC_6():...\n",
"VAR_13.throw(_('Invalid Search Field'), VAR_13.DataError)\n",
"if len(VAR_0) >= 3:\n",
"if '=' in VAR_0:\n",
"FUNC_6()\n",
"if ' --' in VAR_0:\n",
"FUNC_6()\n",
"if a... | [
"def sanitize_searchfield(searchfield):...\n",
"blacklisted_keywords = ['select', 'delete', 'drop', 'update', 'case', 'and',\n 'or', 'like']\n",
"def _raise_exception():...\n",
"frappe.throw(_('Invalid Search Field'), frappe.DataError)\n",
"if len(searchfield) >= 3:\n",
"if '=' in searchfield:\n",
"_... | [
0,
0,
0,
4,
0,
0,
4,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"FunctionDef'",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
"For",
"Expr'",
"For",
"Expr'"
] |
[
"@staticmethod...\n",
"if tuple(VAR_17) != tuple(VAR_12):\n",
"VAR_31 = Diff.from_string_arrays(VAR_12, VAR_17)\n",
"for diff in VAR_31.split_diff():\n",
"yield diff\n"
] | [
"@staticmethod...\n",
"if tuple(new_file) != tuple(file):\n",
"wholediff = Diff.from_string_arrays(file, new_file)\n",
"for diff in wholediff.split_diff():\n",
"yield diff\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"For",
"Expr'"
] |
[
"def FUNC_16(self, VAR_34, VAR_35):...\n",
"\"\"\"docstring\"\"\"\n",
"return os.write(VAR_34, VAR_35)\n"
] | [
"def write(self, fd, string):...\n",
"\"\"\"docstring\"\"\"\n",
"return os.write(fd, string)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"from __future__ import unicode_literals\n",
"from django.conf import settings\n",
"from django.conf.urls import include\n",
"from django.conf.urls import patterns\n",
"from django.conf.urls import url\n",
"from api import routers\n",
"from api import views\n",
"VAR_0 = route... | [
"\"\"\"\nRESTful URL patterns and routing for the Deis API app.\n\n\nApplications\n============\n\n.. http:get:: /api/apps/(string:id)/\n\n Retrieve a :class:`~api.models.App` by its `id`.\n\n.. http:delete:: /api/apps/(string:id)/\n\n Destroy a :class:`~api.models.App` by its `id`.\n\n.. http:get:: /api/apps/\n\... | [
5,
0,
0,
0,
0,
0,
0,
0,
0,
5
] | [
"Expr'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'"
] |
[
"def __init__(self, VAR_14):...\n",
"self.is_authenticated = False\n",
"self.is_active = False\n",
"self.is_anonymous = True\n",
"self.username = None\n",
"self.user_id = VAR_14\n"
] | [
"def __init__(self, uid):...\n",
"self.is_authenticated = False\n",
"self.is_active = False\n",
"self.is_anonymous = True\n",
"self.username = None\n",
"self.user_id = uid\n"
] | [
0,
4,
4,
4,
4,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_0(self):...\n",
"return Locality.objects.raw(VAR_0)\n"
] | [
"def get_queryset(self):...\n",
"return Locality.objects.raw(locality_list_raw_query)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1():...\n",
"task(name='interpreter', action=SelectInterpreter).install('pyprep')\n",
"task(name='build-local-dists', action=BuildLocalPythonDistributions).install(\n 'pyprep')\n",
"task(name='requirements', action=ResolveRequirements).install('pyprep')\n",
"task(name='sources', action=GatherSo... | [
"def register_goals():...\n",
"task(name='interpreter', action=SelectInterpreter).install('pyprep')\n",
"task(name='build-local-dists', action=BuildLocalPythonDistributions).install(\n 'pyprep')\n",
"task(name='requirements', action=ResolveRequirements).install('pyprep')\n",
"task(name='sources', action=... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_15 = set()\n",
"for VAR_28, VAR_27 in zip(self.output, self.rule.output):\n",
"if VAR_28 in self.dynamic_output:\n",
"VAR_16 = defaultdict(list)\n",
"for VAR_28, w in self.expand_dynamic(VAR_27, VAR_13=self.wildcards, VAR_14=\n",
"for combination in VA... | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"combinations = set()\n",
"for f, f_ in zip(self.output, self.rule.output):\n",
"if f in self.dynamic_output:\n",
"wildcards = defaultdict(list)\n",
"for f, w in self.expand_dynamic(f_, restriction=self.wildcards, omit_value=\n",
"for combination in combina... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"For",
"Condition",
"Assign'",
"For",
"For",
"Expr'",
"For",
"Return'",
"Expr'"
] |
[
"def __init__(self, VAR_1=None, VAR_2=5):...\n",
"self.size = VAR_2\n",
"self.data = VAR_1 or []\n"
] | [
"def __init__(self, list=None, size=5):...\n",
"self.size = size\n",
"self.data = list or []\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def __lt__(self, VAR_11):...\n",
"return self.rule.__lt__(VAR_11.rule)\n"
] | [
"def __lt__(self, other):...\n",
"return self.rule.__lt__(other.rule)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = '.yml'\n",
"VAR_3 = os.path.basename(VAR_0)\n",
"if os.path.isdir(VAR_0):\n",
"VAR_4 = {}\n",
"if os.path.isfile(VAR_0):\n",
"for entry in os.listdir(VAR_0):\n",
"if os.path.abspath(VAR_0) == os.path.abspath(sys.argv[0]):\n",
"VAR_5 = ... | [
"def _load_yml_filedir(path):...\n",
"\"\"\"docstring\"\"\"\n",
"YML_FILE_SUFFIX = '.yml'\n",
"bpath = os.path.basename(path)\n",
"if os.path.isdir(path):\n",
"result = {}\n",
"if os.path.isfile(path):\n",
"for entry in os.listdir(path):\n",
"if os.path.abspath(path) == os.path.abspath(sys.argv[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",
"Assign'",
"Condition",
"For",
"Condition",
"Assign'",
"Return'",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Return'",
"Return'",
"Assign'"
] |
[
"def __init__(VAR_39, VAR_40, VAR_41, VAR_42, VAR_43, VAR_44, VAR_45, VAR_46):...\n",
"VAR_39.returncode = None\n",
"VAR_6 = [sys.executable, bot_main.THIS_FILE, 'run_isolated']\n",
"self.assertEqual(VAR_6, VAR_40[:len(VAR_6)])\n",
"self.assertEqual(True, VAR_41)\n",
"self.assertEqual(subprocess42.PIPE, V... | [
"def __init__(self2, cmd, detached, cwd, stdout, stderr, stdin, close_fds):...\n",
"self2.returncode = None\n",
"expected = [sys.executable, bot_main.THIS_FILE, 'run_isolated']\n",
"self.assertEqual(expected, cmd[:len(expected)])\n",
"self.assertEqual(True, detached)\n",
"self.assertEqual(subprocess42.PIP... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_2, *VAR_3, VAR_4=None, VAR_5=True, VAR_6=False, **VAR_7):...\n",
"VAR_2 = FUNC_0(VAR_2)\n",
"if VAR_4 is not None:\n",
"VAR_4 = FUNC_0(VAR_4)\n",
"VAR_15 = CLASS_0(VAR_2, VAR_4, VAR_10={'inference': inference,\n 'abort_on_error': abort_on_error})\n",
"return VAR_15.run()\n"
] | [
"def validate(target_graph, *args, shacl_graph=None, inference=True,...\n",
"target_graph = _load_into_graph(target_graph)\n",
"if shacl_graph is not None:\n",
"shacl_graph = _load_into_graph(shacl_graph)\n",
"validator = Validator(target_graph, shacl_graph, options={'inference':\n inference, 'abort_on_e... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_1, VAR_2, VAR_3, VAR_4, VAR_5=5432):...\n",
"self.db_conn = psycopg2.connect(VAR_4=host, VAR_1=dbname, VAR_2=user, VAR_3\n =password, VAR_5=port)\n",
"self.cursor = self.db_conn.cursor()\n"
] | [
"def __init__(self, dbname, user, password, host, port=5432):...\n",
"self.db_conn = psycopg2.connect(host=host, dbname=dbname, user=user,\n password=password, port=port)\n",
"self.cursor = self.db_conn.cursor()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"@VAR_0.route('/loadValues/<protocole>', methods=['GET'])...\n",
"VAR_8 = getConnexion()\n",
"VAR_9 = 'SELECT * FROM ' + VAR_5\n",
"VAR_8.cur.execute(VAR_9)\n",
"VAR_11 = VAR_8.cur.fetchall()\n",
"VAR_13 = dict()\n",
"for VAR_19 in VAR_11:\n",
"VAR_18 = ast.literal_eval(VAR_19[3])\n",
"return Respon... | [
"@addObs.route('/loadValues/<protocole>', methods=['GET'])...\n",
"db = getConnexion()\n",
"sql = 'SELECT * FROM ' + protocole\n",
"db.cur.execute(sql)\n",
"res = db.cur.fetchall()\n",
"finalDict = dict()\n",
"for r in res:\n",
"dictValues = ast.literal_eval(r[3])\n",
"return Response(flask.json.dum... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_20(VAR_36):...\n",
"VAR_63 = {}\n",
"for VAR_62, info in VAR_36.items():\n",
"if VAR_62.core:\n",
"return VAR_63\n",
"VAR_63[VAR_62] = info\n"
] | [
"def _filter_core_keywors(keywords):...\n",
"matches = {}\n",
"for kw, info in keywords.items():\n",
"if kw.core:\n",
"return matches\n",
"matches[kw] = info\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'"
] |
[
"@classmethod...\n",
"VAR_31 = lambda _request: None\n",
"return [VAR_31, VAR_31]\n"
] | [
"@classmethod...\n",
"non_applicable = lambda _request: None\n",
"return [non_applicable, non_applicable]\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_4(VAR_7, **VAR_6):...\n",
"import telebot\n",
"from telebot import apihelper\n",
"import sql\n",
"VAR_23 = sql.get_telegram_by_ip(VAR_6.get('ip'))\n",
"VAR_24 = sql.get_setting('proxy')\n",
"for telegram in VAR_23:\n",
"VAR_69 = telegram[1]\n",
"if VAR_24 is not None:\n",
"VAR_70 = teleg... | [
"def telegram_send_mess(mess, **kwargs):...\n",
"import telebot\n",
"from telebot import apihelper\n",
"import sql\n",
"telegrams = sql.get_telegram_by_ip(kwargs.get('ip'))\n",
"proxy = sql.get_setting('proxy')\n",
"for telegram in telegrams:\n",
"token_bot = telegram[1]\n",
"if proxy is not None:\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Import'",
"ImportFrom'",
"Import'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_11(self, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"self.mock(handler.api, 'get_current_identity', lambda : VAR_5)\n"
] | [
"def mock_get_current_identity(self, ident):...\n",
"\"\"\"docstring\"\"\"\n",
"self.mock(handler.api, 'get_current_identity', lambda : ident)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_21(self, VAR_21, VAR_38, VAR_39):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_57 = self.getfile(VAR_21)\n",
"if VAR_57 == False:\n",
"VAR_57[VAR_7] = VAR_39\n"
] | [
"def utime(self, path, atime, mtime):...\n",
"\"\"\"docstring\"\"\"\n",
"p = self.getfile(path)\n",
"if p == False:\n",
"p[A_CTIME] = mtime\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'"
] |
[
"def FUNC_11(self):...\n",
"VAR_9 = []\n",
"VAR_10 = {}\n",
"for kid in self.child_groups:\n",
"VAR_13 = kid.get_hosts()\n",
"for VAR_14 in self.hosts:\n",
"for VAR_15 in VAR_13:\n",
"if VAR_14 not in VAR_10:\n",
"return VAR_9\n",
"if VAR_15 not in VAR_10:\n",
"VAR_10[VAR_14] = 1\n",
"VAR_10[V... | [
"def _get_hosts(self):...\n",
"hosts = []\n",
"seen = {}\n",
"for kid in self.child_groups:\n",
"kid_hosts = kid.get_hosts()\n",
"for mine in self.hosts:\n",
"for kk in kid_hosts:\n",
"if mine not in seen:\n",
"return hosts\n",
"if kk not in seen:\n",
"seen[mine] = 1\n",
"seen[kk] = 1\n",
"i... | [
0,
0,
0,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"For",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self):...\n",
"VAR_6 = BeautifulSoup(self.res_data, 'html.parser')\n",
"VAR_7 = {}\n",
"VAR_8 = VAR_6.findAll(id='user_test_status')[0]\n",
"VAR_7['status'] = VAR_8.text.strip()\n",
"VAR_9 = VAR_6.findAll(id='compilation')\n",
"if VAR_9:\n",
"VAR_12 = VAR_9[0]\n",
"VAR_7['compile_output'... | [
"def get_user_test_info(self):...\n",
"soup = BeautifulSoup(self.res_data, 'html.parser')\n",
"info = {}\n",
"tag = soup.findAll(id='user_test_status')[0]\n",
"info['status'] = tag.text.strip()\n",
"tags = soup.findAll(id='compilation')\n",
"if tags:\n",
"content = tags[0]\n",
"info['compile_output'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"from __future__ import unicode_literals\n",
"from six.moves import urllib_parse as urlparse\n",
"import os\n",
"import collections\n",
"import requests\n",
"import six\n",
"import json\n",
"import yaml\n",
"from flex.context_managers import ErrorDict\n",
"from flex.exceptions import ValidationErr... | [
"from __future__ import unicode_literals\n",
"from six.moves import urllib_parse as urlparse\n",
"import os\n",
"import collections\n",
"import requests\n",
"import six\n",
"import json\n",
"import yaml\n",
"from flex.context_managers import ErrorDict\n",
"from flex.exceptions import ValidationErr... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Condition",
"Re... |
[
"def FUNC_2():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = subprocess.Popen('nmcli -t -f SSID,BARS device wifi list', shell=\n True, stdout=subprocess.PIPE).communicate()[0]\n",
"VAR_9 = VAR_8.split('\\n')\n",
"VAR_10 = []\n",
"for row in VAR_9:\n",
"VAR_20 = row.split(':')\n",
"return VAR_10\n",
... | [
"def get_allAPs():...\n",
"\"\"\"docstring\"\"\"\n",
"ps = subprocess.Popen('nmcli -t -f SSID,BARS device wifi list', shell=True,\n stdout=subprocess.PIPE).communicate()[0]\n",
"wifirows = ps.split('\\n')\n",
"wifi = []\n",
"for row in wifirows:\n",
"entry = row.split(':')\n",
"return wifi\n",
"p... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'",
"Expr'"
] |
[
"def FUNC_12(self):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
"def _attribute_iterator(self):...\n",
"\"\"\"docstring\"\"\"\n"
] | [
0,
0
] | [
"FunctionDef'",
"Docstring"
] |
[
"def FUNC_26():...\n",
"return self.closed\n"
] | [
"def stop():...\n",
"return self.closed\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(self, VAR_17):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_44 = 'confirmation', 'paging', 'events', 'formatoutput'\n",
"VAR_0.error(_('Failed to setup the Dell EqualLogic driver'))\n",
"for feature in VAR_44:\n",
"self._eql_execute('cli-settings', feature, 'off')\n",
"for line in self._eql_execu... | [
"def do_setup(self, context):...\n",
"\"\"\"docstring\"\"\"\n",
"disabled_cli_features = 'confirmation', 'paging', 'events', 'formatoutput'\n",
"LOG.error(_('Failed to setup the Dell EqualLogic driver'))\n",
"for feature in disabled_cli_features:\n",
"self._eql_execute('cli-settings', feature, 'off')\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"For",
"Expr'",
"For",
"Condition",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_18(*VAR_20, **VAR_11):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_32 = VAR_20[0]\n",
"if len(VAR_20) == 1:\n",
"VAR_53 = product\n",
"if len(VAR_20) == 2:\n",
"if isinstance(VAR_32, str):\n",
"VAR_53 = VAR_20[1]\n",
"VAR_32 = [VAR_32]\n",
"def FUNC_36(VAR_11):...\n",
"for VAR_51, VAR_58 in... | [
"def expand(*args, **wildcards):...\n",
"\"\"\"docstring\"\"\"\n",
"filepatterns = args[0]\n",
"if len(args) == 1:\n",
"combinator = product\n",
"if len(args) == 2:\n",
"if isinstance(filepatterns, str):\n",
"combinator = args[1]\n",
"filepatterns = [filepatterns]\n",
"def flatten(wildcards):...\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"FunctionDef'",
"For",
"Condition",
"Return'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_5='table.db', VAR_6=None, VAR_7=None):...\n",
"self._phrase_table_column_names = ['id', 'mlen', 'clen', 'input_phrase',\n 'phrase', 'freq', 'user_freq']\n",
"self.old_phrases = []\n",
"self._conf_file_path = '/usr/share/ibus-typing-booster/hunspell-tables/'\n",
"self.ime_propertie... | [
"def __init__(self, name='table.db', user_db=None, filename=None):...\n",
"self._phrase_table_column_names = ['id', 'mlen', 'clen', 'input_phrase',\n 'phrase', 'freq', 'user_freq']\n",
"self.old_phrases = []\n",
"self._conf_file_path = '/usr/share/ibus-typing-booster/hunspell-tables/'\n",
"self.ime_prope... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
... |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = config.ensure_configured()\n",
"VAR_40 = api.reinitialize_request_cache()\n",
"self.response.headers['Content-Security-Policy'] = 'string'\n",
"self.response.headers['Strict-Transport-Security'\n ] = 'max-age=31536000; includeSubDomains; pr... | [
"def dispatch(self):...\n",
"\"\"\"docstring\"\"\"\n",
"conf = config.ensure_configured()\n",
"auth_context = api.reinitialize_request_cache()\n",
"self.response.headers['Content-Security-Policy'] = (\n \"default-src https: 'self' 'unsafe-inline' https://www.google.com https://www.google-analytics.com 'u... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assert'",
"Condition",
"Assign'",
"Assign'... |
[
"def FUNC_8(self, VAR_26):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = self.resolve_path(VAR_26, os.path.dirname(VAR_26))\n",
"if not VAR_21 or not self.exists(VAR_21):\n",
"VAR_24 = self.getfile(VAR_21)\n",
"if VAR_24[VAR_2] == VAR_12:\n",
"if VAR_24[VAR_2] == VAR_13 and VAR_24[VAR_10]:\n",
"return F... | [
"def file_contents(self, target):...\n",
"\"\"\"docstring\"\"\"\n",
"path = self.resolve_path(target, os.path.dirname(target))\n",
"if not path or not self.exists(path):\n",
"f = self.getfile(path)\n",
"if f[A_TYPE] == T_DIR:\n",
"if f[A_TYPE] == T_FILE and f[A_REALFILE]:\n",
"return open(f[A_REALFILE... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"def FUNC_3():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = {}\n",
"for arg in request.args:\n",
"VAR_8 = re.findall('_oc_(.*)', arg)\n",
"return VAR_7\n",
"if VAR_8:\n",
"VAR_7[VAR_8[0]] = request.args.get(arg), request.args.get('_od_' + VAR_8[0])\n"
] | [
"def get_order_args():...\n",
"\"\"\"docstring\"\"\"\n",
"orders = {}\n",
"for arg in request.args:\n",
"re_match = re.findall('_oc_(.*)', arg)\n",
"return orders\n",
"if re_match:\n",
"orders[re_match[0]] = request.args.get(arg), request.args.get('_od_' +\n re_match[0])\n"
] | [
0,
0,
0,
0,
0,
0,
0,
4
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'"
] |
[
"def FUNC_6(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_15 = {}\n",
"for idx, VAR_25 in enumerate(self.nodes):\n",
"VAR_15[VAR_25] = idx\n",
"return VAR_15\n"
] | [
"def getNodeNameMap(self):...\n",
"\"\"\"docstring\"\"\"\n",
"name_map = {}\n",
"for idx, v in enumerate(self.nodes):\n",
"name_map[v] = idx\n",
"return name_map\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_5(VAR_4, *VAR_5, **VAR_6):...\n",
""
] | [
"def dummy_handler(remote, *args, **kargs):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_1(VAR_10):...\n",
"if VAR_9 is None:\n",
"VAR_9 = Browser()\n",
"return VAR_9\n",
"VAR_54 = VAR_3[VAR_10]['username']\n",
"VAR_55 = VAR_3[VAR_10]['password']\n",
"VAR_53 = CWSLoginRequest(VAR_9, VAR_54, VAR_55, base_url=CWS_BASE_URL)\n",
"VAR_9.login(VAR_53)\n"
] | [
"def get_cws_browser(user_id):...\n",
"if cws_browser is None:\n",
"cws_browser = Browser()\n",
"return cws_browser\n",
"username = created_users[user_id]['username']\n",
"password = created_users[user_id]['password']\n",
"lr = CWSLoginRequest(cws_browser, username, password, base_url=CWS_BASE_URL)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_0(self):...\n",
"VAR_8 = self.request.query_params.get('search', '')\n",
"VAR_9 = ' & '.join(VAR_8.split())\n",
"return Locality.objects.raw(VAR_1.format(VAR_9=tokens))\n"
] | [
"def get_queryset(self):...\n",
"search = self.request.query_params.get('search', '')\n",
"tokens = ' & '.join(search.split())\n",
"return Locality.objects.raw(locality_list_search_query.format(tokens=tokens))\n"
] | [
0,
0,
0,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.URLError('url'))\n",
"time.sleep(mox.IgnoreArg())\n",
"VAR_2 = 'True'\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRe... | [
"def testUrlOpenSuccessAfterFailure(self):...\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.URLError('url'))\n",
"time.sleep(mox.IgnoreArg())\n",
"response = 'True'\n",
"url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=m... | [
0,
5,
0,
0,
5,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_33):...\n",
"return VAR_33 != 'off' and bool(VAR_33)\n"
] | [
"def run(self, val):...\n",
"return val != 'off' and bool(val)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def __hash__(self):...\n",
"return self.name.__hash__()\n"
] | [
"def __hash__(self):...\n",
"return self.name.__hash__()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_14(self):...\n",
"self.run_test_case(self.scenario.delete_load_balancer(VAR_5=True),\n max_retries=5)\n"
] | [
"def test_y_delete_load_balancer_vpc(self):...\n",
"self.run_test_case(self.scenario.delete_load_balancer(use_vpc=True),\n max_retries=5)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def __init__(self, VAR_4, VAR_5):...\n",
"self.prompts = ['P2020>']\n",
"self.targets = devices['p2020']\n",
"super().__init__(VAR_4, VAR_5)\n"
] | [
"def __init__(self, database, options):...\n",
"self.prompts = ['P2020>']\n",
"self.targets = devices['p2020']\n",
"super().__init__(database, options)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_41(self):...\n",
"for VAR_40 in self._names:\n",
"yield VAR_40, getattr(self, VAR_40)\n"
] | [
"def items(self):...\n",
"for name in self._names:\n",
"yield name, getattr(self, name)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'"
] |
[
"def FUNC_4(self):...\n",
"VAR_0 = Library(id='org/repo', metadata=\n '{\"full_name\": \"NSS Bob\", \"stargazers_count\": 420, \"subscribers_count\": 419, \"forks\": 418, \"updated_at\": \"2011-8-10T13:47:12Z\"}'\n , contributor_count=417)\n",
"VAR_2 = Version(parent=library.key, id='v1.0.0', sha='lol')\n... | [
"def test_ingest_version(self):...\n",
"library = Library(id='org/repo', metadata=\n '{\"full_name\": \"NSS Bob\", \"stargazers_count\": 420, \"subscribers_count\": 419, \"forks\": 418, \"updated_at\": \"2011-8-10T13:47:12Z\"}'\n , contributor_count=417)\n",
"version = Version(parent=library.key, id='v1.0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"import sqlobject\n",
"import vdm.sqlobject.base as vdmbase\n",
"import vdm.base as vdmbase\n",
"VAR_16 = 'name'\n",
"from vdm.sqlobject.base import State\n",
"from vdm.base import State\n",
"VAR_0 = sqlobject.UnicodeCol(alternateID=True)\n",
"VAR_1 = sqlobject.MultipleJoin('Package')\n",
"VAR_2 = s... | [
"import sqlobject\n",
"import vdm.sqlobject.base as vdmbase\n",
"import vdm.base as vdmbase\n",
"_defaultOrder = 'name'\n",
"from vdm.sqlobject.base import State\n",
"from vdm.base import State\n",
"name = sqlobject.UnicodeCol(alternateID=True)\n",
"packages = sqlobject.MultipleJoin('Package')\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,
4,
4,
4
] | [
"Import'",
"Import'",
"Import'",
"Assign'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Exp... |
[
"def FUNC_1(VAR_2, VAR_3):...\n",
"VAR_15 = set()\n",
"for level in VAR_2:\n",
"VAR_24 = level[0]\n",
"return VAR_15\n",
"VAR_11 = level[1]\n",
"VAR_15 |= VAR_0[VAR_24].get_bookmarks(VAR_11, VAR_3)\n"
] | [
"def get_rule_bookmarks(levellist, doc):...\n",
"ret = set()\n",
"for level in levellist:\n",
"leveltype = level[0]\n",
"return ret\n",
"levelfields = level[1]\n",
"ret |= FnLevel[leveltype].get_bookmarks(levelfields, doc)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"AugAssign'"
] |
[
"def FUNC_6(self, VAR_47):...\n",
"if VAR_101.user_is_admin:\n",
"return True\n",
"if VAR_101.user_is_loggedin:\n",
"VAR_18 = Thing._by_fullname(VAR_47, data=True)\n",
"abort(403, 'forbidden')\n",
"VAR_109 = VAR_18.subreddit_slow\n",
"if VAR_109.can_ban(VAR_101.user):\n",
"return True\n"
] | [
"def run(self, thing_name):...\n",
"if c.user_is_admin:\n",
"return True\n",
"if c.user_is_loggedin:\n",
"item = Thing._by_fullname(thing_name, data=True)\n",
"abort(403, 'forbidden')\n",
"subreddit = item.subreddit_slow\n",
"if subreddit.can_ban(c.user):\n",
"return True\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_35(self, VAR_14):...\n",
"VAR_20 = self.get_related_model(VAR_14)\n",
"return self.session.query(VAR_20).all()\n"
] | [
"def query_model_relation(self, col_name):...\n",
"model = self.get_related_model(col_name)\n",
"return self.session.query(model).all()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_17(VAR_5):...\n",
"VAR_10 = 'https://api.github.com/repos/{}/git/refs/heads'\n",
"VAR_10 = VAR_10.format(VAR_5['fork_fullname'])\n",
"VAR_8 = {'Authorization': 'token ' + os.environ['GITHUB_TOKEN']}\n",
"VAR_9 = os.environ['BOT_USERNAME'], os.environ['BOT_PASSWORD']\n",
"VAR_41 = None\n",
"VAR... | [
"def create_new_branch(data):...\n",
"url = 'https://api.github.com/repos/{}/git/refs/heads'\n",
"url = url.format(data['fork_fullname'])\n",
"headers = {'Authorization': 'token ' + os.environ['GITHUB_TOKEN']}\n",
"auth = os.environ['BOT_USERNAME'], os.environ['BOT_PASSWORD']\n",
"sha = None\n",
"r = re... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"def FUNC_1():...\n",
"return frappe.db.sql('string', as_dict=1)\n"
] | [
"def get_children():...\n",
"return frappe.db.sql(\n \"\"\"select route as name,\n\t\ttitle from `tabBlog Category`\n\t\twhere published = 1\n\t\tand exists (select name from `tabBlog Post`\n\t\t\twhere `tabBlog Post`.blog_category=`tabBlog Category`.name and published=1)\n\t\torder by title asc\"\"\"\n , a... | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"super().halt_dut('halt', ['target state: halted'] * 2)\n"
] | [
"def halt_dut(self):...\n",
"super().halt_dut('halt', ['target state: halted'] * 2)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_5(self):...\n",
"VAR_24 = None, None, None\n",
"for i, step in enumerate(self._r_steps_, 1):\n",
"VAR_31, VAR_3 = step\n",
"return VAR_24\n",
"if VAR_3 != VAR_0:\n",
"VAR_24 = i, VAR_31, VAR_3\n"
] | [
"def _last_found(self):...\n",
"last_found_step = None, None, None\n",
"for i, step in enumerate(self._r_steps_, 1):\n",
"desc, roamer = step\n",
"return last_found_step\n",
"if roamer != MISSING:\n",
"last_found_step = i, desc, roamer\n"
] | [
0,
1,
0,
1,
0,
1,
1
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'"
] |
[
"def FUNC_21(VAR_14, VAR_15):...\n",
"if not VAR_15 in VAR_1:\n",
"VAR_1[VAR_15] = CachedPoints(VAR_13, VAR_14, VAR_1['content'])\n",
"return VAR_1[VAR_15]\n"
] | [
"def points(user, key):...\n",
"if not key in context:\n",
"context[key] = CachedPoints(instance, user, context['content'])\n",
"return context[key]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self, VAR_64):...\n",
"self._onsuccess = VAR_64\n"
] | [
"def onsuccess(self, func):...\n",
"self._onsuccess = func\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_3(self):...\n",
"self.client.login(username=self.tester.username, password='password')\n",
"VAR_1 = self.client.get(reverse('core-views-index'))\n",
"self.assertRedirects(VAR_1, reverse('tcms-recent', args=[self.tester.\n username]), target_status_code=HTTPStatus.OK)\n"
] | [
"def test_when_logged_in_index_page_redirects_to_dashboard(self):...\n",
"self.client.login(username=self.tester.username, password='password')\n",
"response = self.client.get(reverse('core-views-index'))\n",
"self.assertRedirects(response, reverse('tcms-recent', args=[self.tester.\n username]), target_sta... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@VAR_19.route('/test')...\n",
"return 'OK'\n"
] | [
"@test_views.route('/test')...\n",
"return 'OK'\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_21(VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"return json.load(VAR_0)\n",
"VAR_0.seek(0)\n",
"import yaml\n",
"return yaml.load(VAR_0)\n"
] | [
"def _load_configfile(configpath):...\n",
"\"\"\"docstring\"\"\"\n",
"return json.load(f)\n",
"f.seek(0)\n",
"import yaml\n",
"return yaml.load(f)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'",
"Expr'",
"Import'",
"Return'"
] |
[
"def FUNC_13(VAR_9, VAR_7, VAR_11, VAR_10):...\n",
"if VAR_11 == 'POST':\n",
"return CLASS_0.session.post(FUNC_2(VAR_7), VAR_9=ToUtf8Json(data), headers=\n _HEADERS, VAR_10=timeout)\n",
"if VAR_11 == 'GET':\n",
"return CLASS_0.session.get(FUNC_2(VAR_7), headers=_HEADERS, VAR_10=timeout)\n"
] | [
"def SendRequest(data, handler, method, timeout):...\n",
"if method == 'POST':\n",
"return BaseRequest.session.post(_BuildUri(handler), data=ToUtf8Json(data),\n headers=_HEADERS, timeout=timeout)\n",
"if method == 'GET':\n",
"return BaseRequest.session.get(_BuildUri(handler), headers=_HEADERS,\n timeo... | [
0,
0,
7,
0,
7
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"from __future__ import absolute_import, division, print_function\n",
"__metaclass__ = type\n",
"from ansible.inventory.group import Group\n",
"from ansible.utils.vars import combine_vars, get_unique_id\n",
"__all__ = ['Host']\n",
"\"\"\" a single ansible host \"\"\"\n",
"def __getstate__(self):...\n",
... | [
"from __future__ import absolute_import, division, print_function\n",
"__metaclass__ = type\n",
"from ansible.inventory.group import Group\n",
"from ansible.utils.vars import combine_vars, get_unique_id\n",
"__all__ = ['Host']\n",
"\"\"\" a single ansible host \"\"\"\n",
"def __getstate__(self):...\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Assign'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_31(self):...\n",
"if VAR_54.flags.in_install:\n",
"return\n",
"if self.meta.issingle:\n",
"return\n",
"VAR_43 = 'varchar', 'int', 'bigint'\n",
"for VAR_16, VAR_9 in iteritems(self.get_valid_dict()):\n",
"VAR_25 = self.meta.get_field(VAR_16)\n",
"if not VAR_25 or VAR_25.fieldtype == 'Check'... | [
"def _validate_length(self):...\n",
"if frappe.flags.in_install:\n",
"return\n",
"if self.meta.issingle:\n",
"return\n",
"column_types_to_check_length = 'varchar', 'int', 'bigint'\n",
"for fieldname, value in iteritems(self.get_valid_dict()):\n",
"df = self.meta.get_field(fieldname)\n",
"if not df o... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Assign'",
"For",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@classmethod...\n",
""
] | [
"@classmethod...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_32(VAR_39, VAR_49=None):...\n",
"VAR_39.returncode = VAR_1\n",
"json.dump(VAR_22, VAR_32)\n",
"return 0\n"
] | [
"def wait(self2, timeout=None):...\n",
"self2.returncode = returncode\n",
"json.dump(result, f)\n",
"return 0\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_3(VAR_4, VAR_5):...\n",
"if VAR_4.get('token'):\n",
"return FUNC_0(VAR_4.get('token'))\n",
"if VAR_5:\n",
"return FUNC_1(VAR_5.email()) or FUNC_2(VAR_5.user_id())\n"
] | [
"def check_request(request, user):...\n",
"if request.get('token'):\n",
"return check_token(request.get('token'))\n",
"if user:\n",
"return check_email(user.email()) or check_user_id(user.user_id())\n"
] | [
0,
5,
5,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.