lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_15(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"self.driver._eql_execute('pool', 'select', self.configuration.eqlx_pool, 'show'\n ).AndReturn(['TotalCapacity: 111GB', 'FreeSpace: 11GB'])\n",
"self.mox.ReplayAll()\n",
"VAR_10 = self.driver.get_volu... | [
"def test_get_volume_stats(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"self.driver._eql_execute('pool', 'select', self.configuration.eqlx_pool, 'show'\n ).AndReturn(['TotalCapacity: 111GB', 'FreeSpace: 11GB'])\n",
"self.mox.ReplayAll()\n",
"stats = self.dr... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@classmethod...\n",
"if VAR_12.count:\n",
"from beamr.interpreters import Config\n",
"VAR_29 = VAR_31.getRaw('verbatim')\n",
"VAR_30 = VAR_31.getRaw('vbtmCmds', 'packageNames')\n",
"if VAR_29 not in VAR_30:\n",
"VAR_29 = VAR_30[0]\n",
"VAR_31.effectiveConfig['packages'].append(VAR_29)\n",
"VAR_31.e... | [
"@classmethod...\n",
"if cls.count:\n",
"from beamr.interpreters import Config\n",
"package = Config.getRaw('verbatim')\n",
"packageList = Config.getRaw('vbtmCmds', 'packageNames')\n",
"if package not in packageList:\n",
"package = packageList[0]\n",
"Config.effectiveConfig['packages'].append(package)... | [
0,
0,
0,
0,
2,
0,
0,
0,
0,
2,
0,
0,
2,
2
] | [
"Condition",
"Condition",
"ImportFrom'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Condition",
"AugAssign'",
"AugAssign'"
] |
[
"def FUNC_14(self):...\n",
"return self._get_ancestors().values()\n"
] | [
"def get_ancestors(self):...\n",
"return self._get_ancestors().values()\n"
] | [
0,
1
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_4(self):...\n",
"VAR_15 = self.runner.stats\n",
"for VAR_33 in self.runner.stats.tasks():\n",
"VAR_45 = VAR_33.check.poll()\n",
"VAR_45 = True\n",
"self.assertTrue(VAR_45)\n"
] | [
"def assert_all_dead(self):...\n",
"stats = self.runner.stats\n",
"for t in self.runner.stats.tasks():\n",
"finished = t.check.poll()\n",
"finished = True\n",
"self.assertTrue(finished)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_23(VAR_3):...\n",
"if VAR_3[0] == '%':\n",
"VAR_3 = '\\\\' + VAR_3\n",
"return VAR_3\n"
] | [
"def tpl_oneline(string):...\n",
"if string[0] == '%':\n",
"string = '\\\\' + string\n",
"return string\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_24(self):...\n",
"if not self.DiagnosticsForCurrentFileReady():\n",
"return\n",
"self._diag_interface.UpdateWithNewDiagnostics(self.\n GetDiagnosticsFromStoredRequest())\n"
] | [
"def UpdateDiagnosticInterface(self):...\n",
"if not self.DiagnosticsForCurrentFileReady():\n",
"return\n",
"self._diag_interface.UpdateWithNewDiagnostics(self.\n GetDiagnosticsFromStoredRequest())\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_4(VAR_5):...\n",
"return app.config['SCOPED_AUTH_KEYS'].get(VAR_5)\n"
] | [
"def account_for_key_alias(key_alias):...\n",
"return app.config['SCOPED_AUTH_KEYS'].get(key_alias)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from __future__ import absolute_import\n",
"import logging\n",
"from twisted.internet import reactor\n",
"from twisted.internet.defer import Deferred, inlineCallbacks\n",
"from twisted.internet.protocol import Protocol\n",
"from twisted.internet.task import deferLater\n",
"from twisted.web.client impor... | [
"from __future__ import absolute_import\n",
"import logging\n",
"from twisted.internet import reactor\n",
"from twisted.internet.defer import Deferred, inlineCallbacks\n",
"from twisted.internet.protocol import Protocol\n",
"from twisted.internet.task import deferLater\n",
"from twisted.web.client impor... | [
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assi... |
[
"def FUNC_13(self, VAR_7):...\n",
"VAR_12 = VAR_7.model_class._meta.table_name\n",
"VAR_7 = 'string'.format(VAR_12, ','.join(VAR_7.model_class._meta.\n sorted_fields_names), ','.join([VAR_39(obj.id) for obj in VAR_7.objs]),\n VAR_7.model_class._meta.sorted_fields_names[0], VAR_7.model_class._meta\n .so... | [
"def generate_add(self, query):...\n",
"table_name = query.model_class._meta.table_name\n",
"query = (\n \"INSERT INTO {0} ({1}) SELECT {2} WHERE NOT EXISTS (SELECT {3} FROM {0} WHERE {3}='{5}' AND {4}='{6}');\"\n .format(table_name, ','.join(query.model_class._meta.\n sorted_fields_names), ','.join([s... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"User.upsert_mapped_projects(VAR_3, VAR_13)\n"
] | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"User.upsert_mapped_projects(user_id, project_id)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'"
] |
[
"def FUNC_15(self, VAR_16, VAR_18):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_25 = self._eql_execute('volume', 'select', VAR_18['volume_name'],\n 'snapshot', 'select', VAR_18['name'], 'clone', VAR_16['name'])\n",
"VAR_0.error(_('Failed to create volume from snapshot %s'), VAR_18['name'])\n",
"return self._g... | [
"def create_volume_from_snapshot(self, volume, snapshot):...\n",
"\"\"\"docstring\"\"\"\n",
"out = self._eql_execute('volume', 'select', snapshot['volume_name'],\n 'snapshot', 'select', snapshot['name'], 'clone', volume['name'])\n",
"LOG.error(_('Failed to create volume from snapshot %s'), snapshot['name']... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"self.cnxn = pyodbc.connect(self.connection_string)\n",
"self.cursor = self.cnxn.cursor()\n",
"for i in range(3):\n",
"self.cnxn.rollback()\n",
"self.cursor.execute('drop table t%d' % i)\n",
"self.cnxn.commit()\n"
] | [
"def setUp(self):...\n",
"self.cnxn = pyodbc.connect(self.connection_string)\n",
"self.cursor = self.cnxn.cursor()\n",
"for i in range(3):\n",
"self.cnxn.rollback()\n",
"self.cursor.execute('drop table t%d' % i)\n",
"self.cnxn.commit()\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Expr'",
"Expr'"
] |
[
"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_25(self, VAR_31=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = self.build_graph.clone_new()\n",
"for VAR_21 in self.address_mapper.scan_addresses(VAR_31):\n",
"VAR_5.inject_address_closure(VAR_21)\n",
"return VAR_5\n"
] | [
"def scan(self, root=None):...\n",
"\"\"\"docstring\"\"\"\n",
"build_graph = self.build_graph.clone_new()\n",
"for address in self.address_mapper.scan_addresses(root):\n",
"build_graph.inject_address_closure(address)\n",
"return build_graph\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Expr'",
"Return'"
] |
[
"def FUNC_37(self, VAR_69):...\n",
"if not_iterable(VAR_69):\n",
"return flag(os.path.join(self.workdir, VAR_69), 'subworkflow', self)\n",
"return [self.target(VAR_0) for VAR_0 in VAR_69]\n"
] | [
"def target(self, paths):...\n",
"if not_iterable(paths):\n",
"return flag(os.path.join(self.workdir, paths), 'subworkflow', self)\n",
"return [self.target(path) for path in paths]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = self.config.get(self.section, 'logfile')\n",
"if not VAR_5:\n",
"VAR_5 = None\n",
"return VAR_5\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"res = self.config.get(self.section, 'logfile')\n",
"if not res:\n",
"res = None\n",
"return res\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self):...\n",
"VAR_28 = f.readlines()\n",
"VAR_28 = [VAR_46.strip() for VAR_46 in VAR_28]\n",
"VAR_28 = [VAR_46 for VAR_46 in VAR_28 if VAR_46 and not VAR_46.startswith('#')]\n",
"VAR_28 = '\\n'.join(VAR_28).replace('\\\\\\n', '').split('\\n')\n",
"for VAR_46 in VAR_28:\n",
"VAR_46 = shlex.... | [
"def read_file(self):...\n",
"lines = f.readlines()\n",
"lines = [line.strip() for line in lines]\n",
"lines = [line for line in lines if line and not line.startswith('#')]\n",
"lines = '\\n'.join(lines).replace('\\\\\\n', '').split('\\n')\n",
"for line in lines:\n",
"line = shlex.split(line, True)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_10(self):...\n",
"VAR_13 = self.cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)\n",
"self.assertTrue(isinstance(VAR_13, int))\n"
] | [
"def test_getinfo_int(self):...\n",
"value = self.cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)\n",
"self.assertTrue(isinstance(value, int))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"import collections\n",
"import mimetypes\n",
"import os\n",
"import re\n",
"import shutil\n",
"import urllib.parse\n",
"from fooster import web\n",
"def FUNC_0(VAR_0):...\n",
"VAR_6 = VAR_0.split('/')\n",
"VAR_7 = collections.deque()\n",
"for entry in VAR_6:\n",
"if not entry:\n",
"if VAR_6... | [
"import collections\n",
"import mimetypes\n",
"import os\n",
"import re\n",
"import shutil\n",
"import urllib.parse\n",
"from fooster import web\n",
"def normpath(path):...\n",
"old_path = path.split('/')\n",
"new_path = collections.deque()\n",
"for entry in old_path:\n",
"if not entry:\n",
... | [
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Condition",
"Condition",
"Condition",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Return'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_2():...\n",
"super(CLASS_5, self).__init__(slideParser.parse(VAR_10, slideLexer), self.\n begin % (VAR_41, VAR_36), self.end % VAR_41)\n"
] | [
"def innerFunc():...\n",
"super(Box, self).__init__(slideParser.parse(txt, slideLexer), self.begin %\n (kind, head), self.end % kind)\n"
] | [
0,
2
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_28(self, VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_65 = [x[VAR_1] for x in self.get_path(VAR_21)]\n",
"return VAR_65\n"
] | [
"def listdir(self, path):...\n",
"\"\"\"docstring\"\"\"\n",
"names = [x[A_NAME] for x in self.get_path(path)]\n",
"return names\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self, VAR_5=None, VAR_6=None, VAR_7='', VAR_8=''):...\n",
"if VAR_6:\n",
"VAR_5 = VAR_6.apply_all(VAR_5)\n",
"if VAR_7 != '':\n",
"if hasattr(self.obj, VAR_7):\n",
"return VAR_5\n",
"if hasattr(getattr(self.obj, VAR_7), '_col_name'):\n",
"VAR_5 = VAR_5.order_by(VAR_7 + ' ' + VAR_8)\n",
"... | [
"def _get_base_query(self, query=None, filters=None, order_column='',...\n",
"if filters:\n",
"query = filters.apply_all(query)\n",
"if order_column != '':\n",
"if hasattr(self.obj, order_column):\n",
"return query\n",
"if hasattr(getattr(self.obj, order_column), '_col_name'):\n",
"query = query.order... | [
0,
0,
0,
0,
0,
0,
0,
4,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_27(VAR_6):...\n",
"if callable(VAR_6):\n",
"return VAR_6()\n"
] | [
"def default_encode(value):...\n",
"if callable(value):\n",
"return value()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'"
] |
[
"def FUNC_9(self, *VAR_15, **VAR_75):...\n",
""
] | [
"def newfn(self, *a, **env):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_6(self, VAR_40):...\n",
"if VAR_40 and len(VAR_40) > 500:\n",
"VAR_101.errors.add(errors.DESC_TOO_LONG)\n",
"return unkeep_space(VAR_40 or '')\n"
] | [
"def run(self, description):...\n",
"if description and len(description) > 500:\n",
"c.errors.add(errors.DESC_TOO_LONG)\n",
"return unkeep_space(description or '')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_1(self, VAR_0):...\n",
"VAR_2 = re.search('\\\\d{2}.\\\\d{2}.\\\\d{4}', VAR_0)\n",
"if VAR_2:\n",
"VAR_1 = VAR_2.group()\n",
"return VAR_1\n"
] | [
"def search_date(self, string):...\n",
"search_date_result = re.search('\\\\d{2}.\\\\d{2}.\\\\d{4}', string)\n",
"if search_date_result:\n",
"date = search_date_result.group()\n",
"return date\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_30(self, VAR_16):...\n",
""
] | [
"def delete_all(self, items):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_3(self, VAR_13, VAR_11):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_27 = self.output_regex\n",
"if isinstance(VAR_27, str):\n",
"VAR_27 = VAR_27 % {'file_name': VAR_11}\n",
"for VAR_14 in re.finditer(VAR_27, ''.join(VAR_13)):\n",
"yield self.match_to_result(VAR_14, VAR_11)\n"
] | [
"def _process_issues(self, output, filename):...\n",
"\"\"\"docstring\"\"\"\n",
"regex = self.output_regex\n",
"if isinstance(regex, str):\n",
"regex = regex % {'file_name': filename}\n",
"for match in re.finditer(regex, ''.join(output)):\n",
"yield self.match_to_result(match, filename)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"For",
"Expr'"
] |
[
"def FUNC_18(self):...\n",
"self.compilation_ok(\"\"\"\nif anyof(true, false) {\n discard;\n}\n\"\"\")\n",
"self.representation_is('string')\n"
] | [
"def test_truefalse_testlist(self):...\n",
"self.compilation_ok(\"\"\"\nif anyof(true, false) {\n discard;\n}\n\"\"\")\n",
"self.representation_is(\n \"\"\"\nif (type: control)\n anyof (type: test)\n true (type: test)\n false (type: test)\n discard (type: action)\n\"\"\"\n )\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0():...\n",
"return [webapp2.Route('/', handler=RootHandler), webapp2.Route('/catalog',\n handler=CatalogHandler), webapp2.Route('/catalog/<machine_id>', handler\n =CatalogHandler), webapp2.Route('/leases', handler=LeaseRequestHandler),\n webapp2.Route('/leases/<lease_id>', handler=LeaseRequest... | [
"def get_routes():...\n",
"return [webapp2.Route('/', handler=RootHandler), webapp2.Route('/catalog',\n handler=CatalogHandler), webapp2.Route('/catalog/<machine_id>', handler\n =CatalogHandler), webapp2.Route('/leases', handler=LeaseRequestHandler),\n webapp2.Route('/leases/<lease_id>', handler=LeaseReq... | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_12 = {}\n",
"VAR_8 = []\n",
"VAR_26 = Contest.get_from_id(VAR_0, session)\n",
"for participation in VAR_26.participations:\n",
"VAR_31 = participation.user\n",
"for VAR_30 in VAR_26.tasks:\n",
"VAR_12[VAR_31.username] = {'password': VAR_31.p... | [
"def harvest_contest_data(contest_id):...\n",
"\"\"\"docstring\"\"\"\n",
"users = {}\n",
"tasks = []\n",
"contest = Contest.get_from_id(contest_id, session)\n",
"for participation in contest.participations:\n",
"user = participation.user\n",
"for task in contest.tasks:\n",
"users[user.username] = {'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Assign'",
"Expr'",
"Return'"
] |
[
"import re, requests, argparse, logging, os, coloredlogs, datetime, getpass, tempfile, itertools, json, concurrent.futures, random\n",
"from utils import *\n",
"from UploadForm import UploadForm\n",
"from threading import Lock\n",
"VAR_0 = '0.5.0'\n",
"logging.basicConfig(datefmt='[%m/%d/%Y-%H:%M:%S]')\n"... | [
"import re, requests, argparse, logging, os, coloredlogs, datetime, getpass, tempfile, itertools, json, concurrent.futures, random\n",
"from utils import *\n",
"from UploadForm import UploadForm\n",
"from threading import Lock\n",
"version = '0.5.0'\n",
"logging.basicConfig(datefmt='[%m/%d/%Y-%H:%M:%S]')\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"AugAssign'",
"For",
"AugAssign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
... |
[
"def FUNC_6(self, VAR_7, VAR_5):...\n",
"VAR_8 = VAR_7.connect()\n",
"VAR_3 = VAR_8.execution_options(no_parameters=True).execute(VAR_5)\n",
"return VAR_3\n"
] | [
"def _execute_with_engine(self, engine, query):...\n",
"connection = engine.connect()\n",
"result = connection.execution_options(no_parameters=True).execute(query)\n",
"return result\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"return 'check user_test %s' % self.user_test_id\n"
] | [
"def describe(self):...\n",
"return 'check user_test %s' % self.user_test_id\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from osv import osv\n",
"from tools.translate import _\n",
"VAR_0 = 'pos.close.statement'\n",
"VAR_1 = 'Close Statements'\n",
"def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = self.pool.get('res.users').browse(VAR_2, VAR_3, VAR_3).company_id.id\n",
"VAR_7 = []\... | [
"from osv import osv\n",
"from tools.translate import _\n",
"_name = 'pos.close.statement'\n",
"_description = 'Close Statements'\n",
"def close_statement(self, cr, uid, ids, context):...\n",
"\"\"\"docstring\"\"\"\n",
"company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id\n",
"li... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Conditi... |
[
"def FUNC_6(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"return {'password_reset': get_password_reset_form().to_json(), 'login':\n get_login_session_form().to_json(), 'registration':\n RegistrationFormFactory().get_registration_form(VAR_3).to_json()}\n"
] | [
"def _get_form_descriptions(request):...\n",
"\"\"\"docstring\"\"\"\n",
"return {'password_reset': get_password_reset_form().to_json(), 'login':\n get_login_session_form().to_json(), 'registration':\n RegistrationFormFactory().get_registration_form(request).to_json()}\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1, VAR_2=None, VAR_3=False):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = posixpath.normpath(VAR_1)\n",
"VAR_1 = VAR_1.lstrip('/')\n",
"VAR_10 = ''\n",
"for VAR_18 in VAR_1.split('/'):\n",
"if not VAR_18:\n",
"if VAR_10 and VAR_1 != VAR_10:\n",
"VAR_17, VAR_18 = os.path.splitdri... | [
"def serve(request, path, document_root=None, show_indexes=False):...\n",
"\"\"\"docstring\"\"\"\n",
"path = posixpath.normpath(path)\n",
"path = path.lstrip('/')\n",
"newpath = ''\n",
"for part in path.split('/'):\n",
"if not part:\n",
"if newpath and path != newpath:\n",
"drive, part = os.path.spl... | [
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
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
... |
[
"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 FUNC_15(self, VAR_6, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = None\n",
"VAR_10 = self.common._safe_hostname(VAR_9['host'])\n",
"VAR_25 = self.common.get_cpg(VAR_6, allowSnap=True)\n",
"VAR_12 = self.common.get_domain(VAR_25)\n",
"VAR_20 = self.common._get_3par_host(VAR_10)\n",
"VAR_13 ... | [
"def _create_host(self, volume, connector):...\n",
"\"\"\"docstring\"\"\"\n",
"host = None\n",
"hostname = self.common._safe_hostname(connector['host'])\n",
"cpg = self.common.get_cpg(volume, allowSnap=True)\n",
"domain = self.common.get_domain(cpg)\n",
"host = self.common._get_3par_host(hostname)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_4(VAR_14, VAR_2, VAR_15, VAR_3, VAR_4):...\n",
"VAR_1 = helper.get_header(VAR_4, 'Subject', '(none)')\n",
"if not FUNC_0(VAR_1):\n",
"return\n",
"VAR_21 = VAR_4.get('From', 'anonymous')\n",
"VAR_28 = student.resolve_alias(VAR_2, VAR_21)\n",
"sendmail.send_template(VAR_14, VAR_21, 'Mail fehlerh... | [
"def handle_mail(config, db, imapmail, uid, message):...\n",
"subject = helper.get_header(message, 'Subject', '(none)')\n",
"if not _match_subject(subject):\n",
"return\n",
"alias = message.get('From', 'anonymous')\n",
"stu = student.resolve_alias(db, alias)\n",
"sendmail.send_template(config, alias, 'M... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"For",
"Assign'",
"Condition",
"Assign'",
"As... |
[
"def FUNC_3(VAR_6):...\n",
"for settings_key in VAR_12:\n",
"assert VAR_5.registry.settings.get(settings_key)\n"
] | [
"def assert_settings_keys(keys):...\n",
"for settings_key in key:\n",
"assert config.registry.settings.get(settings_key)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"For",
"Assert'"
] |
[
"\"\"\"\nCreated on Sun Jan 14 21:55:57 2018\n\n@author: adam\n\"\"\"\n",
"import os\n",
"import warnings\n",
"import sqlite3\n",
"import datetime\n",
"from collections.abc import Iterable\n",
"from ast import literal_eval\n",
"import numpy as np\n",
"import pandas as pd\n",
"from .core import DAT... | [
"\"\"\"\nCreated on Sun Jan 14 21:55:57 2018\n\n@author: adam\n\"\"\"\n",
"import os\n",
"import warnings\n",
"import sqlite3\n",
"import datetime\n",
"from collections.abc import Iterable\n",
"from ast import literal_eval\n",
"import numpy as np\n",
"import pandas as pd\n",
"from .core import DAT... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def __init__(self, *VAR_5, **VAR_6):...\n",
"VAR_29 = VAR_6.get('default', None)\n",
"if VAR_29 is not None:\n",
"VAR_6['default'] = pickle.dumps(VAR_29)\n",
"super().__init__(*VAR_5, **kwargs)\n"
] | [
"def __init__(self, *args, **kwargs):...\n",
"default = kwargs.get('default', None)\n",
"if default is not None:\n",
"kwargs['default'] = pickle.dumps(default)\n",
"super().__init__(*args, **kwargs)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_16(self, VAR_35=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self.match_filters = []\n",
"self.match_conditions = []\n",
"VAR_54 = False\n",
"if not self.user:\n",
"self.user = frappe.session.user\n",
"if not self.tables:\n",
"self.extract_tables()\n",
"VAR_1 = frappe.get_meta(self.doctype)... | [
"def build_match_conditions(self, as_condition=True):...\n",
"\"\"\"docstring\"\"\"\n",
"self.match_filters = []\n",
"self.match_conditions = []\n",
"only_if_shared = False\n",
"if not self.user:\n",
"self.user = frappe.session.user\n",
"if not self.tables:\n",
"self.extract_tables()\n",
"meta = f... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
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'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Assig... |
[
"def FUNC_12(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return replication.decode_link_ticket(self.request.get('t').encode('ascii'))\n",
"self.abort(400)\n",
"return\n"
] | [
"def decode_link_ticket(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return replication.decode_link_ticket(self.request.get('t').encode('ascii'))\n",
"self.abort(400)\n",
"return\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'",
"Expr'",
"Return'"
] |
[
"def FUNC_4():...\n",
"VAR_22 = self.request.body\n",
"VAR_23 = json.loads(VAR_22.decode('utf-8', 'ignore'))\n",
"VAR_24 = VAR_23['action']\n",
"VAR_25 = VAR_23['source']\n",
"if type(VAR_25) == list:\n",
"for VAR_31 in range(0, len(VAR_25)):\n",
"VAR_25 = FUNC_1(VAR_25)\n",
"VAR_25[VAR_31] = FUNC_1... | [
"def get_final_html_async():...\n",
"operation_content_raw = self.request.body\n",
"operation_content = json.loads(operation_content_raw.decode('utf-8', 'ignore'))\n",
"action = operation_content['action']\n",
"sources = operation_content['source']\n",
"if type(sources) == list:\n",
"for i in range(0, l... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"For",
"Condition",
"Expr'",
"Expr'",
"For",
"Condition",
"Expr'",
"For",
"Conditio... |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._state\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._state\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_18(VAR_30, VAR_9, VAR_31, VAR_6, VAR_11, **VAR_12):...\n",
"if VAR_31 is None:\n",
"VAR_31 = VAR_23[VAR_9].urlstring\n",
"VAR_52 = join(VAR_27, VAR_9)\n",
"VAR_53 = os.path.realpath(VAR_52)\n",
"if not VAR_53.startswith(VAR_26):\n",
"VAR_54 = CLASS_1.create(VAR_9, VAR_31, VAR_52, VAR_6, VAR_11... | [
"def add_module(parent, name, uri, options, conf, **kwargs):...\n",
"if uri is None:\n",
"uri = modules[name].urlstring\n",
"target_dir = join(subproject_dir, name)\n",
"target_dir_rp = os.path.realpath(target_dir)\n",
"if not target_dir_rp.startswith(source_dir_rp):\n",
"newmodule = Subproject.create(n... | [
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Assign'",
"Expr'",
"Condition"
] |
[
"from django.test import RequestFactory\n",
"from django.shortcuts import reverse\n",
"from test_plus.test import TestCase\n",
"from django.test import Client\n",
"from realpal.apps.users.constants import *\n",
"from realpal.apps.users.views import UserRedirectView, UserUpdateView\n",
"def FUNC_0(self):... | [
"from django.test import RequestFactory\n",
"from django.shortcuts import reverse\n",
"from test_plus.test import TestCase\n",
"from django.test import Client\n",
"from realpal.apps.users.constants import *\n",
"from realpal.apps.users.views import UserRedirectView, UserUpdateView\n",
"def setUp(self):.... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
6,
0,
0,
0,
0,
0,
6,
6,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'... |
[
"import os\n",
"import unittest\n",
"from coalib.bearlib.abstractions.Lint import Lint\n",
"from coalib.misc.ContextManagers import prepare_file\n",
"from coalib.misc.Shell import escape_path_argument\n",
"from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY\n",
"from coalib.results.SourceRange im... | [
"import os\n",
"import unittest\n",
"from coalib.bearlib.abstractions.Lint import Lint\n",
"from coalib.misc.ContextManagers import prepare_file\n",
"from coalib.misc.Shell import escape_path_argument\n",
"from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY\n",
"from coalib.results.SourceRange im... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Ex... |
[
"def FUNC_2(self, VAR_5):...\n",
"VAR_9 = datetime.strptime(VAR_5.date_begin_located, '%Y-%m-%d %H:%M:%S')\n",
"if VAR_9 < datetime.now():\n",
"return False\n",
"return True\n"
] | [
"def can_unsubscribe(self, event):...\n",
"event_start = datetime.strptime(event.date_begin_located, '%Y-%m-%d %H:%M:%S')\n",
"if event_start < datetime.now():\n",
"return False\n",
"return True\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_2(self, VAR_18: int):...\n",
"\"\"\"docstring\"\"\"\n",
"return CLASS_0.query.get(VAR_18)\n"
] | [
"def get_by_id(self, user_id: int):...\n",
"\"\"\"docstring\"\"\"\n",
"return User.query.get(user_id)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def __init__(self, VAR_3, VAR_4, VAR_5=None, VAR_6=None):...\n",
"self.rule = VAR_3\n",
"self.dag = VAR_4\n",
"self.targetfile = VAR_5\n",
"self.wildcards_dict = self.rule.get_wildcards(VAR_5)\n",
"self.wildcards = Wildcards(fromdict=self.wildcards_dict)\n",
"self._format_wildcards = self.wildcards if ... | [
"def __init__(self, rule, dag, targetfile=None, format_wildcards=None):...\n",
"self.rule = rule\n",
"self.dag = dag\n",
"self.targetfile = targetfile\n",
"self.wildcards_dict = self.rule.get_wildcards(targetfile)\n",
"self.wildcards = Wildcards(fromdict=self.wildcards_dict)\n",
"self._format_wildcards ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Condition",
"Cond... |
[
"def FUNC_3(VAR_3):...\n",
"print(CLASS_0.WARNING + '!', VAR_3, CLASS_0.END)\n"
] | [
"def print_warning(str):...\n",
"print(c.WARNING + '!', str, c.END)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"@VAR_0.route('/<page_name>/history/record')...\n",
"VAR_12 = request.args.get('id')\n",
"VAR_3 = VAR_1.query('string' % VAR_12)\n",
"VAR_13 = VAR_3.namedresult()[0]\n",
"return render_template('page_record.html', VAR_2=page_name, VAR_13=page_record)\n"
] | [
"@app.route('/<page_name>/history/record')...\n",
"content_id = request.args.get('id')\n",
"query = db.query(\n \"select page_content.content, page_content.timestamp from page, page_content where page.id = page_content.page_id and page_content.id = '%s'\"\n % content_id)\n",
"page_record = query.namedr... | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = pd.read_sql('select date, league, team1, team2 from spi_historical',\n VAR_0)\n",
"VAR_21 = pd.read_sql('select Date, Div, HomeTeam, AwayTeam from fd_historical',\n VAR_0)\n",
"VAR_22 = ['key0', 'key1']\n",
"VAR_20.columns = VAR_22 + ['left_... | [
"def create_names_mapping_table():...\n",
"\"\"\"docstring\"\"\"\n",
"left_data = pd.read_sql('select date, league, team1, team2 from spi_historical'\n , DB_CONNECTION)\n",
"right_data = pd.read_sql(\n 'select Date, Div, HomeTeam, AwayTeam from fd_historical', DB_CONNECTION)\n",
"key_columns = ['key0'... | [
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'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(self, VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_30 = self.cursor.execute('delete from items where itemname = \"%s\"' % VAR_6)\n",
"self.connection.commit()\n"
] | [
"def remove_item(self, item):...\n",
"\"\"\"docstring\"\"\"\n",
"r = self.cursor.execute('delete from items where itemname = \"%s\"' % item)\n",
"self.connection.commit()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'"
] |
[
"def FUNC_43(self, VAR_21=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_32 = list()\n",
"VAR_21 = VAR_21 or self.get_columns_list()\n",
"for VAR_14 in VAR_21:\n",
"if not self.is_relation(VAR_14):\n",
"return VAR_32\n",
"if hasattr(self.obj, VAR_14):\n",
"if not hasattr(getattr(self.obj, VAR_14), '_... | [
"def get_order_columns_list(self, list_columns=None):...\n",
"\"\"\"docstring\"\"\"\n",
"ret_lst = list()\n",
"list_columns = list_columns or self.get_columns_list()\n",
"for col_name in list_columns:\n",
"if not self.is_relation(col_name):\n",
"return ret_lst\n",
"if hasattr(self.obj, col_name):\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Condition",
"Return'",
"Condition",
"Condition",
"Expr'",
"Expr'"
] |
[
"\"\"\"string\"\"\"\n",
"import argparse\n",
"import importlib\n",
"import os\n",
"import sys\n",
"from parlai.core.agents import get_agent_module, get_task_module\n",
"from parlai.tasks.tasks import ids_to_tasks\n",
"def FUNC_0(VAR_0):...\n",
"VAR_3 = VAR_0.lower()\n",
"if VAR_3 in ('yes', 'true'... | [
"\"\"\"Provides an argument parser and a set of default command line options for\nusing the ParlAI package.\n\"\"\"\n",
"import argparse\n",
"import importlib\n",
"import os\n",
"import sys\n",
"from parlai.core.agents import get_agent_module, get_task_module\n",
"from parlai.tasks.tasks import ids_to_t... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_11(self):...\n",
"shellutil.run('/etc/rc.d/dhclient start {0}'.format(self.get_if_name()),\n VAR_10=False)\n"
] | [
"def start_dhcp_service(self):...\n",
"shellutil.run('/etc/rc.d/dhclient start {0}'.format(self.get_if_name()),\n chk_err=False)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_23):...\n",
"VAR_82 = CLASS_46.run(self, VAR_23)\n",
"if not VAR_82 or not hasattr(VAR_82, 'email') or not VAR_82.email:\n",
"return self.error(errors.NO_EMAIL_FOR_USER)\n",
"return VAR_82\n"
] | [
"def run(self, name):...\n",
"user = VExistingUname.run(self, name)\n",
"if not user or not hasattr(user, 'email') or not user.email:\n",
"return self.error(errors.NO_EMAIL_FOR_USER)\n",
"return user\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_10(VAR_32, VAR_34):...\n",
"logging.info('Got signal %s', VAR_32)\n"
] | [
"def handler(sig, _):...\n",
"logging.info('Got signal %s', sig)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_9(VAR_9):...\n",
"VAR_14 = __import__(VAR_9.replace('\\r', ''))\n",
"VAR_15 = getattr(VAR_14, VAR_9.replace('\\r', ''))\n",
"VAR_16 = VAR_15()\n",
"return FUNC_7(VAR_16, 'config') + VAR_4 + '.' + VAR_4\n"
] | [
"def configPlugin(name):...\n",
"module = __import__(name.replace('\\r', ''))\n",
"class_ = getattr(module, name.replace('\\r', ''))\n",
"instance = class_()\n",
"return callMethod(instance, 'config') + LINEBREAK + '.' + LINEBREAK\n"
] | [
0,
0,
0,
0,
1
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_9():...\n",
"VAR_9 = FUNC_0()\n",
"VAR_10 = VAR_9.cursor()\n",
"VAR_10.execute(' SELECT name, karma FROM people ORDER BY karma ASC LIMIT 5 ')\n",
"VAR_2.error('Execution failed with error: {}'.format(e))\n",
"VAR_18 = VAR_10.fetchall()\n",
"VAR_2.debug('fetched bottom karma values')\n",
"VAR... | [
"def karma_bottom():...\n",
"db = db_connect()\n",
"cursor = db.cursor()\n",
"cursor.execute(' SELECT name, karma FROM people ORDER BY karma ASC LIMIT 5 ')\n",
"logger.error('Execution failed with error: {}'.format(e))\n",
"leaders = cursor.fetchall()\n",
"logger.debug('fetched bottom karma values')\n",... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self, VAR_2, VAR_3, VAR_4):...\n",
"if not VAR_4:\n",
"return\n",
"if validate_hash(VAR_4):\n",
"if validate_url(VAR_4):\n",
"VAR_21 = VirusTotalAPI().hash_fetch(VAR_4)\n",
"VAR_2['errors'].append('Error retrieving file hash: %s' % e)\n",
"VAR_18 = Files.create(VAR_3, VAR_4, VAR_21)\n",
... | [
"def _handle_string(self, submit, tmppath, line):...\n",
"if not line:\n",
"return\n",
"if validate_hash(line):\n",
"if validate_url(line):\n",
"filedata = VirusTotalAPI().hash_fetch(line)\n",
"submit['errors'].append('Error retrieving file hash: %s' % e)\n",
"filepath = Files.create(tmppath, line, fi... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_27(self, VAR_15):...\n",
""
] | [
"def add(self, item):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_42 = User.get_all_users_not_pagainated()\n",
"VAR_43 = 1\n",
"VAR_44 = len(VAR_42)\n",
"for VAR_22 in VAR_42:\n",
"CLASS_1.check_and_update_mapper_level(VAR_22.id)\n",
"return VAR_43\n",
"if VAR_43 % 50 == 0:\n",
"print(f'{VAR_43} users updated... | [
"@staticmethod...\n",
"\"\"\"docstring\"\"\"\n",
"users = User.get_all_users_not_pagainated()\n",
"users_updated = 1\n",
"total_users = len(users)\n",
"for user in users:\n",
"UserService.check_and_update_mapper_level(user.id)\n",
"return users_updated\n",
"if users_updated % 50 == 0:\n",
"print(f... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"Return'",
"Condition",
"Expr'",
"AugAssign'"
] |
[
"def FUNC_40(*VAR_19, **VAR_20):...\n",
"VAR_62 = Thread(target=function, VAR_19=args, VAR_46=ka)\n",
"VAR_62.daemon = True\n",
"VAR_62.start()\n"
] | [
"def decorator(*args, **ka):...\n",
"t = Thread(target=function, args=args, kwargs=ka)\n",
"t.daemon = True\n",
"t.start()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_3(*VAR_17, **VAR_18):...\n",
"return {'id': uuidutils.generate_uuid()}\n"
] | [
"def _return_id_key(*args, **kwargs):...\n",
"return {'id': uuidutils.generate_uuid()}\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_7(VAR_21):...\n",
"VAR_31 = len(VAR_21) > VAR_10\n",
"logging.info('validate_answer: %s returns %r', str(VAR_21), not VAR_31)\n",
"return not VAR_31\n"
] | [
"def validate_answer(ans):...\n",
"too_long = len(ans) > max_ans_len\n",
"logging.info('validate_answer: %s returns %r', str(ans), not too_long)\n",
"return not too_long\n"
] | [
0,
4,
4,
4
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_2(VAR_1):...\n",
"VAR_2 = True\n",
"VAR_0 = FUNC_0()\n",
"print('insert error: ', error)\n",
"return VAR_2\n",
"VAR_4 = VAR_0.cursor()\n",
"VAR_2 = False\n",
"VAR_4.execute(VAR_1)\n",
"VAR_5 = VAR_4.fetchall()\n",
"VAR_6 = []\n",
"VAR_7 = []\n",
"VAR_8 = '|'\n",
"VAR_9 = '+'\n",
... | [
"def run_insert(insert_stmt):...\n",
"is_success = True\n",
"conn = create_connection()\n",
"print('insert error: ', error)\n",
"return is_success\n",
"cur = conn.cursor()\n",
"is_success = False\n",
"cur.execute(insert_stmt)\n",
"results = cur.fetchall()\n",
"widths = []\n",
"columns = []\n",
... | [
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
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Expr'",
"For",
"Expr'",
"AugAssign'",
"Expr'",
"AugAssign'",
"Expr'",
"Expr'",
"For",
"Expr'",
"Expr'",
"Expr'",
... |
[
"def FUNC_25(self):...\n",
"VAR_13 = -1\n",
"self.cursor.execute('create table t1(n int)')\n",
"self.cursor.execute('insert into t1 values (?)', VAR_13)\n",
"VAR_20 = self.cursor.execute('select n from t1').fetchone()[0]\n",
"self.assertEqual(VAR_20, VAR_13)\n"
] | [
"def test_negative_int(self):...\n",
"value = -1\n",
"self.cursor.execute('create table t1(n int)')\n",
"self.cursor.execute('insert into t1 values (?)', value)\n",
"result = self.cursor.execute('select n from t1').fetchone()[0]\n",
"self.assertEqual(result, value)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"@VAR_13.whitelist()...\n",
"FUNC_2(VAR_1, VAR_2, VAR_3, VAR_0=searchfield, VAR_5=page_length, VAR_4=filters\n )\n",
"VAR_13.response['results'] = FUNC_4(VAR_13.response['values'])\n"
] | [
"@frappe.whitelist()...\n",
"search_widget(doctype, txt, query, searchfield=searchfield, page_length=\n page_length, filters=filters)\n",
"frappe.response['results'] = build_for_autosuggest(frappe.response['values'])\n"
] | [
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'"
] |
[
"import json\n",
"import logging\n",
"VAR_0 = logging.getLogger(__name__)\n",
"def FUNC_0(VAR_1):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_1.content_type in ('application/json', 'text/json'):\n",
"return VAR_1\n",
"VAR_4 = json.loads(VAR_1.body)\n",
"if isinstance(VAR_4, (list, tuple)):\n",
"VAR_... | [
"import json\n",
"import logging\n",
"log = logging.getLogger(__name__)\n",
"def filter_json_xsrf(response):...\n",
"\"\"\"docstring\"\"\"\n",
"if response.content_type in ('application/json', 'text/json'):\n",
"return response\n",
"content = json.loads(response.body)\n",
"if isinstance(content, (li... | [
5,
0,
5,
0,
0,
0,
0,
5,
5,
0
] | [
"Import'",
"Import'",
"Assign'",
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_22(self, *VAR_69, **VAR_70):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.input = VAR_69, VAR_70\n",
"return VAR_101\n"
] | [
"def input(self, *paths, **kwpaths):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.input = paths, kwpaths\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_3():...\n",
"VAR_3 = FUNC_1()\n",
"FUNC_2(VAR_3)\n"
] | [
"def main():...\n",
"dms = getDMs()\n",
"replyToUnansweredDMs(dms)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"def FUNC_40(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.reportMatch(p1=2, p2='A')\n"
] | [
"def test_p2_contains_letter(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.reportMatch(p1=2, p2='A')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_0(self, VAR_3, VAR_4, VAR_7):...\n",
"if VAR_4.is_course_staff:\n",
"return True\n",
"if not VAR_7.visible_to_students:\n",
"self.error_msg(_('The resource is not currently visible.'))\n",
"if VAR_7.view_content_to != VAR_7.VIEW_ACCESS.PUBLIC and not VAR_3.user.is_authenticated:\n",
"return Fa... | [
"def is_object_visible(self, request, view, course_instance):...\n",
"if view.is_course_staff:\n",
"return True\n",
"if not course_instance.visible_to_students:\n",
"self.error_msg(_('The resource is not currently visible.'))\n",
"if course_instance.view_content_to != course_instance.VIEW_ACCESS.PUBLIC an... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Expr'",
"Condition",
"Return'",
"Expr'",
"Return'",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1='_', VAR_2=-2, VAR_3=-1):...\n",
"\"\"\"docstring\"\"\"\n",
"import pandas as pd\n",
"VAR_15 = [int(fn.split('.')[0].split(VAR_1)[VAR_2]) for fn in VAR_0]\n",
"VAR_16 = [int(fn.split('.')[0].split(VAR_1)[VAR_3]) for fn in VAR_0]\n",
"VAR_17 = pd.DataFrame({'fn': VAR_0, 'month': VA... | [
"def sort_files(files, split_on='_', elem_month=-2, elem_year=-1):...\n",
"\"\"\"docstring\"\"\"\n",
"import pandas as pd\n",
"months = [int(fn.split('.')[0].split(split_on)[elem_month]) for fn in files]\n",
"years = [int(fn.split('.')[0].split(split_on)[elem_year]) for fn in files]\n",
"df = pd.DataFrame... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"from itemPrices.models import ItemSale\n",
"from django.db import connection\n",
"from django.db.models import Count\n",
"from rest_framework.views import APIView\n",
"from rest_framework.response import Response\n",
"from rest_framework import status\n",
"VAR_0 = {'status': 404, 'content': {'message':... | [
"from itemPrices.models import ItemSale\n",
"from django.db import connection\n",
"from django.db.models import Count\n",
"from rest_framework.views import APIView\n",
"from rest_framework.response import Response\n",
"from rest_framework import status\n",
"NOT_FOUND_JSON_RESPONSE = {'status': 404, 'con... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
4,
4,
4,
4,
4,
4,
4,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",... |
[
"def __init__(self, VAR_2=None, VAR_3=None, VAR_4=True):...\n",
"self.vars = {}\n",
"self.groups = []\n",
"self._uuid = None\n",
"self.name = VAR_2\n",
"self.address = VAR_2\n",
"if VAR_3:\n",
"self.set_variable('ansible_port', int(VAR_3))\n",
"if VAR_4:\n",
"self._uuid = get_unique_id()\n",
"se... | [
"def __init__(self, name=None, port=None, gen_uuid=True):...\n",
"self.vars = {}\n",
"self.groups = []\n",
"self._uuid = None\n",
"self.name = name\n",
"self.address = name\n",
"if port:\n",
"self.set_variable('ansible_port', int(port))\n",
"if gen_uuid:\n",
"self._uuid = get_unique_id()\n",
"se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_3(self, VAR_5):...\n",
"VAR_14 = 'string'.format(VAR_5)\n",
"self.cur.execute(VAR_14)\n",
"return self.cur.fetchall()\n"
] | [
"def get_events(self, server_id):...\n",
"sql = (\n \"\"\"SELECT events.event_id as e, title, description, start_time, time_zone, (\n SELECT GROUP_CONCAT(DISTINCT username)\n FROM user_event, events\n WHERE user_event.event_id = e\n AND ev... | [
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(VAR_0, VAR_1, **VAR_2):...\n",
"VAR_6 = '{}/{}?'.format(VAR_0, VAR_1)\n",
"VAR_7 = sorted(VAR_2.keys())\n",
"for key in VAR_7:\n",
"VAR_6 += '{}={}&'.format(key, VAR_2[key])\n",
"return hashlib.sha224(VAR_6.encode('utf8')).hexdigest()\n"
] | [
"def query_hash(project_id, query_name, **query_params):...\n",
"id_string = '{}/{}?'.format(project_id, query_name)\n",
"keylist = sorted(query_params.keys())\n",
"for key in keylist:\n",
"id_string += '{}={}&'.format(key, query_params[key])\n",
"return hashlib.sha224(id_string.encode('utf8')).hexdigest(... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"AugAssign'",
"Return'"
] |
[
"def FUNC_1(VAR_5):...\n",
"if not VAR_6:\n",
"return\n",
"VAR_20 = UltiSnips_Manager._snips('', 1)\n",
"return\n",
"VAR_5['ultisnips_snippets'] = [{'trigger': x.trigger, 'description': x.\n description} for x in VAR_20]\n"
] | [
"def _AddUltiSnipsDataIfNeeded(extra_data):...\n",
"if not USE_ULTISNIPS_DATA:\n",
"return\n",
"rawsnips = UltiSnips_Manager._snips('', 1)\n",
"return\n",
"extra_data['ultisnips_snippets'] = [{'trigger': x.trigger, 'description': x\n .description} for x in rawsnips]\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Return'",
"Assign'"
] |
[
"def FUNC_6(self, VAR_7):...\n",
"VAR_8 = self.content\n",
"while VAR_8:\n",
"yield VAR_8[:VAR_7]\n",
"VAR_8 = VAR_8[VAR_7:]\n"
] | [
"def iter_content(self, chunk_size):...\n",
"c = self.content\n",
"while c:\n",
"yield c[:chunk_size]\n",
"c = c[chunk_size:]\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Expr'",
"Assign'"
] |
[
"import asyncio\n",
"import tormysql\n",
"VAR_0 = None\n",
"VAR_1 = None\n",
"def FUNC_0(VAR_2):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_1 = VAR_2\n",
"def FUNC_1(VAR_3, VAR_4, VAR_5, VAR_6, VAR_7):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_0 = tormysql.ConnectionPool(max_connections=20, idle_seconds=... | [
"import asyncio\n",
"import tormysql\n",
"_pool = None\n",
"_handler = None\n",
"def set_log_handler(handler):...\n",
"\"\"\"docstring\"\"\"\n",
"_handler = handler\n",
"def connect_db_server(host_addr, user_id, password, db, loop):...\n",
"\"\"\"docstring\"\"\"\n",
"_pool = tormysql.ConnectionPoo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Assign'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"@api.model...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_55 = False\n",
"for arg in VAR_34:\n",
"if arg[0] == 'name' and arg[1] == '%':\n",
"if VAR_55:\n",
"VAR_55 = arg[2]\n",
"VAR_38 = u\"similarity(res_partner.name, '%s') DESC\" % VAR_55\n",
"return super(CLASS_0, self).search(VAR_34, VAR_37, VAR_36, V... | [
"@api.model...\n",
"\"\"\"docstring\"\"\"\n",
"fuzzy_search = False\n",
"for arg in args:\n",
"if arg[0] == 'name' and arg[1] == '%':\n",
"if fuzzy_search:\n",
"fuzzy_search = arg[2]\n",
"order = u\"similarity(res_partner.name, '%s') DESC\" % fuzzy_search\n",
"return super(ResPartner, self).search(a... | [
0,
0,
0,
0,
0,
0,
0,
4,
0
] | [
"Condition",
"Docstring",
"Assign'",
"For",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"import sqlalchemy\n",
"VAR_0 = \"SELECT * FROM foo WHERE id = '%s'\" % identifier\n",
"VAR_0 = \"INSERT INTO foo VALUES ('a', 'b', '%s')\" % value\n",
"VAR_0 = \"DELETE FROM foo WHERE id = '%s'\" % identifier\n",
"VAR_0 = \"UPDATE foo SET value = 'b' WHERE id = '%s'\" % identifier\n",
"VAR_0 = (\n \"\... | [
"import sqlalchemy\n",
"query = \"SELECT * FROM foo WHERE id = '%s'\" % identifier\n",
"query = \"INSERT INTO foo VALUES ('a', 'b', '%s')\" % value\n",
"query = \"DELETE FROM foo WHERE id = '%s'\" % identifier\n",
"query = \"UPDATE foo SET value = 'b' WHERE id = '%s'\" % identifier\n",
"query = (\n \"\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
0,
0,
0
] | [
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"FunctionDef'",
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_17 = [VAR_28.mtime for VAR_28 in self.input if VAR_28.exists]\n",
"if VAR_17:\n",
"return max(VAR_17)\n",
"return None\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"existing = [f.mtime for f in self.input if f.exists]\n",
"if existing:\n",
"return max(existing)\n",
"return None\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_27(VAR_13):...\n",
"self.assertEqual('/request', VAR_13.path)\n",
"VAR_12.append('not_applicable')\n",
"return None\n"
] | [
"def not_applicable(request):...\n",
"self.assertEqual('/request', request.path)\n",
"calls.append('not_applicable')\n",
"return None\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_12(self, VAR_6):...\n",
"VAR_22 = 'string' + \"({}, {}, '{}', '{}', '{}', {})\".format(json.dumps(\n VAR_4), json.dumps(VAR_5), VAR_6, datetime.now(), VAR_7, json.dumps(VAR_8))\n",
"self.cur.execute(VAR_22)\n",
"self.conn.commit()\n"
] | [
"def check_query(self, qhash):...\n",
"sql = (\n 'INSERT INTO log_query (query_text, query_search, query_hash, query_time, client_ip, client_browser) VALUES'\n + \"({}, {}, '{}', '{}', '{}', {})\".format(json.dumps(text), json.dumps\n (search), qhash, datetime.now(), ip, json.dumps(browser)))\n",
"sel... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0():...\n",
"VAR_2.flushdb()\n",
"FUNC_1()\n",
"FUNC_2('gleb.kondratenko@skybonds.com', 'pwd')\n"
] | [
"def db_init():...\n",
"db.flushdb()\n",
"auth_init()\n",
"auth_add_user('gleb.kondratenko@skybonds.com', 'pwd')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_31(self, VAR_48, VAR_49):...\n",
"VAR_69, VAR_73 = self.post('/mail/%s/tags' % VAR_48, VAR_49)\n",
"return VAR_69\n"
] | [
"def post_tags(self, mail_ident, tags_json):...\n",
"res, req = self.post('/mail/%s/tags' % mail_ident, tags_json)\n",
"return res\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self, VAR_17, VAR_16):...\n",
"if VAR_16.endswith('/'):\n",
"VAR_17 = os.path.join(VAR_17, self.index_file)\n",
"if VAR_16.endswith('/' + self.index_file):\n",
"return self.get_static_file(VAR_17, VAR_16)\n",
"if os.path.isfile(VAR_17):\n",
"return self.get_static_file(VAR_17, VAR_16)\n",
... | [
"def find_file_at_path_with_indexes(self, path, url):...\n",
"if url.endswith('/'):\n",
"path = os.path.join(path, self.index_file)\n",
"if url.endswith('/' + self.index_file):\n",
"return self.get_static_file(path, url)\n",
"if os.path.isfile(path):\n",
"return self.get_static_file(path, url)\n",
"if... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"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 __init__(self, VAR_9, *, VAR_10=0, VAR_11=None, VAR_12=2):...\n",
"self.wires = VAR_9\n",
"self.cutoff = VAR_11\n",
"self.hbar = VAR_12\n",
"self.eng = None\n",
"self.state = None\n",
"super().__init__(self.short_name, VAR_10)\n"
] | [
"def __init__(self, wires, *, shots=0, cutoff=None, hbar=2):...\n",
"self.wires = wires\n",
"self.cutoff = cutoff\n",
"self.hbar = hbar\n",
"self.eng = None\n",
"self.state = None\n",
"super().__init__(self.short_name, shots)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_9(self):...\n",
"remove_perm_from_user(self.tester, self.permission)\n",
"self.client.login(username=self.tester.username, password='password')\n",
"VAR_1 = self.client.post(self.update_url, {'content_type':\n 'testruns.testcaserun', 'object_pk': self.case_run_1.pk, 'field':\n 'case_run_status... | [
"def test_refuse_if_missing_permission(self):...\n",
"remove_perm_from_user(self.tester, self.permission)\n",
"self.client.login(username=self.tester.username, password='password')\n",
"response = self.client.post(self.update_url, {'content_type':\n 'testruns.testcaserun', 'object_pk': self.case_run_1.pk, ... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_6(self, VAR_40):...\n",
"if VAR_40 and len(VAR_40) > 500:\n",
"VAR_101.errors.add(errors.DESC_TOO_LONG)\n",
"return unkeep_space(VAR_40 or '')\n"
] | [
"def run(self, description):...\n",
"if description and len(description) > 500:\n",
"c.errors.add(errors.DESC_TOO_LONG)\n",
"return unkeep_space(description or '')\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_13(VAR_5, VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_34 = {}\n",
"VAR_34['public'] = True\n",
"VAR_34['files'] = {}\n",
"VAR_34['description'] = \"In response to @{0}'s comment : {1}\".format(VAR_5[\n 'reviewer'], VAR_5['review_url'])\n",
"for VAR_47, diffs in VAR_5['diff'].items():\n",... | [
"def create_gist(data, config):...\n",
"\"\"\"docstring\"\"\"\n",
"REQUEST_JSON = {}\n",
"REQUEST_JSON['public'] = True\n",
"REQUEST_JSON['files'] = {}\n",
"REQUEST_JSON['description'] = \"In response to @{0}'s comment : {1}\".format(data\n ['reviewer'], data['review_url'])\n",
"for file, diffs in da... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_0(self, VAR_3):...\n",
"VAR_5 = '%s int' % str(VAR_3)\n",
"if self.unique:\n",
"VAR_5 += ' UNIQUE'\n",
"return VAR_5\n"
] | [
"def create_field(self, name):...\n",
"field_string = '%s int' % str(name)\n",
"if self.unique:\n",
"field_string += ' UNIQUE'\n",
"return field_string\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"AugAssign'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.