lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "def FUNC_8(self, VAR_13):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def p_expr(self, p):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "def FUNC_7(VAR_20, VAR_21, VAR_2, VAR_22=None, VAR_23=None, VAR_24='text',...\n", "\"\"\"docstring\"\"\"\n", "VAR_27 = {}\n", "VAR_48 = FUNC_25(VAR_20)\n", "VAR_49 = FUNC_25(VAR_21)\n", "for VAR_77 in VAR_48:\n", "VAR_27[VAR_77[0].concept] = VAR_77[0].type\n", "for VAR_77 in VAR_48:\n", "VAR_27[VAR...
[ "def get_keywords_output(single_keywords, composite_keywords, taxonomy_name,...\n", "\"\"\"docstring\"\"\"\n", "categories = {}\n", "single_keywords_p = _sort_kw_matches(single_keywords)\n", "composite_keywords_p = _sort_kw_matches(composite_keywords)\n", "for w in single_keywords_p:\n", "categories[w[0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "For", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_18(self):...\n", "self.__sinit__()\n", "if self.start_timer:\n", "self.inter_sleep(self.start_timer)\n", "if self.running:\n", "self.log.info('Starting')\n", "self.log.info('Aborted')\n", "self.child = self.call[0](*self.call[1], **self.call[2])\n", "self.log.warn(e)\n", "self.log.info('...
[ "def run(self):...\n", "self.__sinit__()\n", "if self.start_timer:\n", "self.inter_sleep(self.start_timer)\n", "if self.running:\n", "self.log.info('Starting')\n", "self.log.info('Aborted')\n", "self.child = self.call[0](*self.call[1], **self.call[2])\n", "self.log.warn(e)\n", "self.log.info('Term...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_10(self):...\n", "VAR_2 = 'response'\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.HTTPError('url', 500, 'error message',\n None, None))\n", "time.sleep(mox.IgnoreArg())\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.Igno...
[ "def testUrlOpenHTTPErrorWithRetry(self):...\n", "response = 'response'\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.HTTPError('url', 500, 'error message',\n None, None))\n", "time.sleep(mox.IgnoreArg())\n", "url_helper.urllib2.urlopen(...
[ 0, 0, 0, 0, 5, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_39(VAR_101):...\n", "VAR_101.input = VAR_69, VAR_70\n", "return VAR_101\n" ]
[ "def decorate(ruleinfo):...\n", "ruleinfo.input = paths, kwpaths\n", "return ruleinfo\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_18(self):...\n", "if not self._IsServerAlive():\n", "return\n", "SendEventNotificationAsync('InsertLeave')\n" ]
[ "def OnInsertLeave(self):...\n", "if not self._IsServerAlive():\n", "return\n", "SendEventNotificationAsync('InsertLeave')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Expr'" ]
[ "def FUNC_46(self):...\n", "def FUNC_57():...\n", "self.cursor.execute('create table t1 (word varchar (100))')\n", "VAR_38 = set(['a'])\n", "self.cursor.executemany('insert into t1 (word) values (?)', [VAR_38])\n", "self.assertRaises(TypeError, FUNC_57)\n" ]
[ "def test_sets_executemany(self):...\n", "def f():...\n", "self.cursor.execute('create table t1 (word varchar (100))')\n", "words = set(['a'])\n", "self.cursor.executemany('insert into t1 (word) values (?)', [words])\n", "self.assertRaises(TypeError, f)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "@rest_utils.ajax(data_required=True)...\n", "VAR_30 = VAR_1.DATA.get('flavor_access', [])\n", "VAR_5 = VAR_1.DATA['id']\n", "VAR_27 = not VAR_30\n", "VAR_31 = api.nova.flavor_create(VAR_1, VAR_6=request.DATA['name'], memory=\n request.DATA['ram'], vcpu=request.DATA['vcpus'], disk=request.DATA[\n 'dis...
[ "@rest_utils.ajax(data_required=True)...\n", "flavor_access = request.DATA.get('flavor_access', [])\n", "flavor_id = request.DATA['id']\n", "is_public = not flavor_access\n", "flavor = api.nova.flavor_create(request, name=request.DATA['name'], memory=\n request.DATA['ram'], vcpu=request.DATA['vcpus'], di...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Return'" ]
[ "\"\"\"string\"\"\"\n", "import os\n", "import re\n", "import tempfile\n", "import urllib2\n", "from invenio.legacy.bibclassify import config as bconfig\n", "if bconfig.STANDALONE:\n", "from urllib2 import urlopen\n", "from invenio.utils.url import make_invenio_opener\n", "VAR_0 = bconfig.get_logg...
[ "\"\"\"\nBibClassify text extractor.\n\nThis module provides method to extract the fulltext from local or remote\ndocuments. Currently 2 formats of documents are supported: PDF and text\ndocuments.\n\n2 methods provide the functionality of the module: text_lines_from_local_file\nand text_lines_from_url.\n\nThis mod...
[ 7, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "Condition", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Condition", "Expr'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Return'", "Return'", ...
[ "def FUNC_3(VAR_12, VAR_13):...\n", "" ]
[ "def interrupt_handler(signal, frame):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_8(self, VAR_1):...\n", "if settings.SHIBBOLETH_VARIABLES_URL_ENCODED:\n", "for VAR_4 in VAR_1.keys():\n", "return self.client.generic('GET', self.login_url, **meta)\n", "VAR_1[VAR_4] = urllib.parse.quote(VAR_1[VAR_4])\n" ]
[ "def _get(self, meta):...\n", "if settings.SHIBBOLETH_VARIABLES_URL_ENCODED:\n", "for key in meta.keys():\n", "return self.client.generic('GET', self.login_url, **meta)\n", "meta[key] = urllib.parse.quote(meta[key])\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "For", "Return'", "Assign'" ]
[ "from django.db import models\n", "from .common_info import CommonInfo\n", "from django.core.exceptions import ValidationError\n", "from .extracted_text import ExtractedText\n", "from .raw_chem import RawChem\n", "VAR_0 = models.CharField('Raw CAS', max_length=50, null=True, blank=True)\n", "VAR_1 = mod...
[ "from django.db import models\n", "from .common_info import CommonInfo\n", "from django.core.exceptions import ValidationError\n", "from .extracted_text import ExtractedText\n", "from .raw_chem import RawChem\n", "raw_cas_old = models.CharField('Raw CAS', max_length=50, null=True, blank=True)\n", "raw_c...
[ 0, 0, 6, 6, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Return'" ]
[ "def FUNC_15(self, VAR_6):...\n", "" ]
[ "def set_priority(self, priority):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_17(self):...\n", "" ]
[ "def touch(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_15(self):...\n", "self.eval_action('REVIEW')\n" ]
[ "def _rendering_done_hook(self):...\n", "self.eval_action('REVIEW')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_25(self, VAR_2, VAR_3, VAR_4, *VAR_6):...\n", "self.write(VAR_2, VAR_3, VAR_4, {'state': 'draft'})\n", "return True\n" ]
[ "def do_draft(self, cr, uid, ids, *args):...\n", "self.write(cr, uid, ids, {'state': 'draft'})\n", "return True\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def __init__(self, VAR_6, VAR_7, VAR_8, VAR_9, VAR_10=None):...\n", "self.name = VAR_6\n", "self.value = VAR_7\n", "self.opt_type = VAR_8\n", "self.cluster = VAR_9\n", "self.description = VAR_10\n" ]
[ "def __init__(self, name, value, opt_type, cluster, description=None):...\n", "self.name = name\n", "self.value = value\n", "self.opt_type = opt_type\n", "self.cluster = cluster\n", "self.description = description\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_1(self, VAR_0, VAR_1=False):...\n", "\"\"\"docstring\"\"\"\n", "VAR_3 = os.path.join(os.getcwd(), 'examples', VAR_0)\n", "self.b_mgr.ignore_nosec = VAR_1\n", "self.b_mgr.discover_files([VAR_3], True)\n", "self.b_mgr.run_tests()\n" ]
[ "def run_example(self, example_script, ignore_nosec=False):...\n", "\"\"\"docstring\"\"\"\n", "path = os.path.join(os.getcwd(), 'examples', example_script)\n", "self.b_mgr.ignore_nosec = ignore_nosec\n", "self.b_mgr.discover_files([path], True)\n", "self.b_mgr.run_tests()\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_19(self, VAR_14):...\n", "" ]
[ "def is_relation_many_to_many(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_0(self):...\n", "VAR_8 = lambda x: dict(request_token_params={'scope': ''}, base_url=\n 'https://foo.bar/', request_token_url=None, access_token_url=\n 'https://foo.bar/oauth/access_token', authorize_url=\n 'https://foo.bar/oauth/authorize', consumer_key=x, consumer_secret=\n 'testsecret')\n...
[ "def setUp(self):...\n", "params = lambda x: dict(request_token_params={'scope': ''}, base_url=\n 'https://foo.bar/', request_token_url=None, access_token_url=\n 'https://foo.bar/oauth/access_token', authorize_url=\n 'https://foo.bar/oauth/authorize', consumer_key=x, consumer_secret=\n 'testsecret')\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "ImportFrom'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_23(self, VAR_12=False):...\n", "if self.DiagnosticsForCurrentFileReady():\n", "VAR_22 = self._latest_file_parse_request.Response()\n", "return []\n", "self._latest_file_parse_request = None\n", "if VAR_12:\n", "return vimsupport.ConvertDiagnosticsToQfList(VAR_22)\n", "return VAR_22\n" ]
[ "def GetDiagnosticsFromStoredRequest(self, qflist_format=False):...\n", "if self.DiagnosticsForCurrentFileReady():\n", "diagnostics = self._latest_file_parse_request.Response()\n", "return []\n", "self._latest_file_parse_request = None\n", "if qflist_format:\n", "return vimsupport.ConvertDiagnosticsToQf...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_6(VAR_4):...\n", "VAR_4 = VAR_4.strip()\n", "if isinstance(VAR_4, six.binary_type):\n", "VAR_4 = six.text_type(VAR_4, 'utf-8', 'ignore')\n", "if not VAR_4:\n", "return False\n", "VAR_23 = VAR_4.count('\"')\n", "if VAR_23 % 2 == 1:\n", "return False\n", "if VAR_23 > 1:\n", "VAR_24 = VAR...
[ "def isSimpleSearch(term):...\n", "term = term.strip()\n", "if isinstance(term, six.binary_type):\n", "term = six.text_type(term, 'utf-8', 'ignore')\n", "if not term:\n", "return False\n", "num_quotes = term.count('\"')\n", "if num_quotes % 2 == 1:\n", "return False\n", "if num_quotes > 1:\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 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Condition", "Assign'", "Condition", "Assign'", "Return'", "Condition", "For", "Return'", "Condition", "Condition", "Assign'", "Return'", "Assign'", "Expr'", "E...
[ "@patch('invenio.ext.session.interface.SessionInterface.save_session')...\n", "from invenio.modules.oauthclient.client import oauth\n", "VAR_9 = MagicMock()\n", "VAR_9.get_id = MagicMock(return_value=1)\n", "VAR_9.is_authenticated = MagicMock(return_value=True)\n", "VAR_10 = c.get(url_for('oauthclient.log...
[ "@patch('invenio.ext.session.interface.SessionInterface.save_session')...\n", "from invenio.modules.oauthclient.client import oauth\n", "user = MagicMock()\n", "user.get_id = MagicMock(return_value=1)\n", "user.is_authenticated = MagicMock(return_value=True)\n", "res = c.get(url_for('oauthclient.login', r...
[ 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Assert'", "Assert'", "Expr'", "Assign'", "Assert'" ]
[ "def FUNC_40(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = {'SEVERITY': {'LOW': 5}, 'CONFIDENCE': {'HIGH': 5}}\n", "self.check_example('utils-shell.py', VAR_2)\n" ]
[ "def test_utils_shell(self):...\n", "\"\"\"docstring\"\"\"\n", "expect = {'SEVERITY': {'LOW': 5}, 'CONFIDENCE': {'HIGH': 5}}\n", "self.check_example('utils-shell.py', expect)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def FUNC_4(self, VAR_5, VAR_6=False):...\n", "\"\"\"docstring\"\"\"\n", "VAR_25 = c.get(VAR_5)\n", "VAR_26 = get_location(get_authn_request(self.app.config, VAR_32, '/', None,\n VAR_6=force_authn))\n", "VAR_27 = VAR_26.split('?')[0]\n", "self.assertEqual(VAR_25.status_code, 302)\n", "self.assertTrue...
[ "def authn(self, url, force_authn=False):...\n", "\"\"\"docstring\"\"\"\n", "resp = c.get(url)\n", "authn_req = get_location(get_authn_request(self.app.config, session, '/',\n None, force_authn=force_authn))\n", "idp_url = authn_req.split('?')[0]\n", "self.assertEqual(resp.status_code, 302)\n", "self...
[ 0, 0, 6, 6, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_14(VAR_4):...\n", "VAR_9 = FUNC_0()\n", "VAR_10 = VAR_9.cursor()\n", "if VAR_1.name == None:\n", "VAR_19 = 'RANDOM()'\n", "VAR_19 = 'RANDOM()'\n", "VAR_10.execute(\n \"\"\"\n SELECT also FROM isalso WHERE name='{0}' ORDER BY {1} LIMIT 1\n \"\"\"\n .format(VAR_4, VAR...
[ "def also_ask(name):...\n", "db = db_connect()\n", "cursor = db.cursor()\n", "if env.name == None:\n", "r = 'RANDOM()'\n", "r = 'RANDOM()'\n", "cursor.execute(\n \"\"\"\n SELECT also FROM isalso WHERE name='{0}' ORDER BY {1} LIMIT 1\n \"\"\"\n .format(name, r))\n", "logger....
[ 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Condition", "Expr'", "Assign'", "Return'", "Expr'", "Return'" ]
[ "async def FUNC_10(VAR_6):...\n", "VAR_10 = {'Authorization': f'Bearer {VAR_1}'}\n", "VAR_8 = await VAR_6.get('/results?page=-1&count=2', VAR_10=headers)\n", "assert VAR_8.status == 400\n", "VAR_8 = await VAR_6.get('/results?page=1&count=0', VAR_10=headers)\n", "assert VAR_8.status == 400\n" ]
[ "async def test_negative_bad_paging(test_cli):...\n", "headers = {'Authorization': f'Bearer {access_token}'}\n", "resp = await test_cli.get('/results?page=-1&count=2', headers=headers)\n", "assert resp.status == 400\n", "resp = await test_cli.get('/results?page=1&count=0', headers=headers)\n", "assert res...
[ 0, 0, 4, 0, 4, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Assign'", "Assert'", "Assign'", "Assert'" ]
[ "@classmethod...\n", "return VAR_14(VAR_14._OSX_JAVA_HOME_EXE)\n" ]
[ "@classmethod...\n", "return cls(cls._OSX_JAVA_HOME_EXE)\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_3(self, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "VAR_7 = logging.getLogger(__name__)\n", "VAR_7.debug('Added subscriber')\n", "self.subscribed_queues.append(VAR_6)\n" ]
[ "def add_subscriber(self, queue):...\n", "\"\"\"docstring\"\"\"\n", "logger = logging.getLogger(__name__)\n", "logger.debug('Added subscriber')\n", "self.subscribed_queues.append(queue)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_2(self, VAR_0, *VAR_2, **VAR_3):...\n", "VAR_11 = ManyURLSForm(VAR_0.POST or None)\n", "if VAR_11.is_valid():\n", "VAR_25 = VAR_11.cleaned_data['input_url']\n", "return redirect('home-view')\n", "VAR_26 = re.findall(\"[\\\\w.']+\", VAR_25)\n", "VAR_27 = []\n", "for VAR_18 in VAR_26:\n", "V...
[ "def post(self, request, *args, **kwargs):...\n", "form = ManyURLSForm(request.POST or None)\n", "if form.is_valid():\n", "urls = form.cleaned_data['input_url']\n", "return redirect('home-view')\n", "urls_list = re.findall(\"[\\\\w.']+\", urls)\n", "data_list = []\n", "for url in urls_list:\n", "res...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'", "Assign'", "Expr'" ]
[ "def FUNC_10(self, VAR_9, VAR_10=None, VAR_11=None, VAR_15=False):...\n", "get_and_check_project(VAR_9, VAR_11, ('change_project',))\n", "VAR_28 = self.queryset.get(VAR_10=pk, VAR_1=project_pk)\n", "VAR_26 = CLASS_1(VAR_28, data=request.data, VAR_15=partial)\n", "VAR_26.is_valid(raise_exception=True)\n", ...
[ "def update(self, request, pk=None, project_pk=None, partial=False):...\n", "get_and_check_project(request, project_pk, ('change_project',))\n", "task = self.queryset.get(pk=pk, project=project_pk)\n", "serializer = TaskSerializer(task, data=request.data, partial=partial)\n", "serializer.is_valid(raise_exce...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "\"\"\"string\"\"\"\n", "from google.appengine.api import users\n", "from google.appengine.ext import ndb\n", "from gae_libs.handlers.base_handler import BaseHandler\n", "from gae_libs.handlers.base_handler import Permission\n", "from libs import time_util\n", "from model import result_status\n", "fro...
[ "\"\"\"This module is to handle manual triage of a suspected CL.\n\nThis handler will flag the suspected cl as correct or incorrect.\n\"\"\"\n", "from google.appengine.api import users\n", "from google.appengine.ext import ndb\n", "from gae_libs.handlers.base_handler import BaseHandler\n", "from gae_libs.ha...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Condition", "Assign'", "Condition", "Return'", "Condition", "Return'", "Assign'", "Ass...
[ "def FUNC_10(self, VAR_10, VAR_12):...\n", "\"\"\"docstring\"\"\"\n", "self._create_server(VAR_12)\n", "VAR_5 = {}\n", "VAR_5['volumeName'] = VAR_10['name']\n", "VAR_5['serverName'] = VAR_12['host']\n", "self._cliq_run_xml('assignVolumeToServer', VAR_5)\n", "VAR_32 = self._get_iscsi_properties(VAR_10)...
[ "def initialize_connection(self, volume, connector):...\n", "\"\"\"docstring\"\"\"\n", "self._create_server(connector)\n", "cliq_args = {}\n", "cliq_args['volumeName'] = volume['name']\n", "cliq_args['serverName'] = connector['host']\n", "self._cliq_run_xml('assignVolumeToServer', cliq_args)\n", "iscs...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "__author__ = 'Johannes Köster'\n", "__copyright__ = 'Copyright 2015, Johannes Köster'\n", "__email__ = 'koester@jimmy.harvard.edu'\n", "__license__ = 'MIT'\n", "import os\n", "import re\n", "import stat\n", "import time\n", "import json\n", "from itertools import product, chain\n", "from collec...
[ "__author__ = 'Johannes Köster'\n", "__copyright__ = 'Copyright 2015, Johannes Köster'\n", "__email__ = 'koester@jimmy.harvard.edu'\n", "__license__ = 'MIT'\n", "import os\n", "import re\n", "import stat\n", "import time\n", "import json\n", "from itertools import product, chain\n", "from collec...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0 ]
[ "Assign'", "Assign'", "Assign'", "Assign'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Return'" ]
[ "def FUNC_0():...\n", "VAR_2 = psycopg2.connect('dbname=forum')\n", "VAR_3 = VAR_2.cursor()\n", "VAR_3.execute('select content, time from posts order by time desc')\n", "VAR_0 = VAR_3.fetchall()\n", "VAR_2.close()\n", "return VAR_0\n" ]
[ "def get_posts():...\n", "data_base = psycopg2.connect('dbname=forum')\n", "cursor = data_base.cursor()\n", "cursor.execute('select content, time from posts order by time desc')\n", "POSTS = cursor.fetchall()\n", "data_base.close()\n", "return POSTS\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_16(self, VAR_11=None):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def make_source_proxy(self, options=None):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "def __iter__(self):...\n", "return self.order.__iter__()\n" ]
[ "def __iter__(self):...\n", "return self.order.__iter__()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_2(VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "if isinstance(VAR_9, str):\n", "return VAR_9\n", "if isinstance(VAR_9, unicode):\n", "return VAR_9.encode('utf-8')\n", "return str(VAR_9)\n" ]
[ "def _ConvertToAscii(value):...\n", "\"\"\"docstring\"\"\"\n", "if isinstance(value, str):\n", "return value\n", "if isinstance(value, unicode):\n", "return value.encode('utf-8')\n", "return str(value)\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_6(self, VAR_4, VAR_5, VAR_3, VAR_0, VAR_1):...\n", "" ]
[ "def _parse_req(self, iden, msg, reqid, interface, method):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "import os\n", "import calendar\n", "from datetime import datetime, timedelta\n", "from itertools import groupby\n", "from collections import Counter\n", "from functools import wraps\n", "from tools.failures import SETA_WINDOW\n", "from src import jobtypes\n", "import MySQLdb\n", "from flask impor...
[ "import os\n", "import calendar\n", "from datetime import datetime, timedelta\n", "from itertools import groupby\n", "from collections import Counter\n", "from functools import wraps\n", "from tools.failures import SETA_WINDOW\n", "from src import jobtypes\n", "import MySQLdb\n", "from flask impor...
[ 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'", "Import'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Retu...
[ "import os\n", "from core.colors import *\n", "from files.config import *\n", "from core.verbout import verbout\n", "from files.discovered import INTERNAL_URLS, FILES_EXEC, SCAN_ERRORS\n", "from files.discovered import VULN_LIST, FORMS_TESTED, REQUEST_TOKENS\n", "def FUNC_0(VAR_0, VAR_1):...\n", "\"\"...
[ "import os\n", "from core.colors import *\n", "from files.config import *\n", "from core.verbout import verbout\n", "from files.discovered import INTERNAL_URLS, FILES_EXEC, SCAN_ERRORS\n", "from files.discovered import VULN_LIST, FORMS_TESTED, REQUEST_TOKENS\n", "def logger(filename, content):...\n", ...
[ 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Docstring", "Assign'", "Condition", "For", "Expr'", "Expr'", "Expr'", "FunctionDef'", "Docstring", "Expr'", "Expr'", "For", "Expr'", "Expr'", "FunctionDef'", "Condition"...
[ "def FUNC_29(self):...\n", "VAR_13 = -200\n", "self.cursor.execute('create table t1(n float)')\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_13, VAR_20)\n" ]
[ "def test_negative_float(self):...\n", "value = -200\n", "self.cursor.execute('create table t1(n float)')\n", "self.cursor.execute('insert into t1 values (?)', value)\n", "result = self.cursor.execute('select n from t1').fetchone()[0]\n", "self.assertEqual(value, result)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "def __eq__(self, VAR_25):...\n", "VAR_0 = VAR_25._file if isinstance(VAR_25, CLASS_0) else VAR_25\n", "return self._file == VAR_0\n" ]
[ "def __eq__(self, other):...\n", "f = other._file if isinstance(other, _IOFile) else other\n", "return self._file == f\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_12():...\n", "VAR_39 = ''\n", "if not VAR_3:\n", "logging.error('Could not read metafile!', full_traceback())\n", "return VAR_39\n", "VAR_39 = f.read()\n", "VAR_39 = self.getDropboxFile(VAR_12).decode()\n" ]
[ "def getMetadata():...\n", "metadata = ''\n", "if not FROM_DROPBOX:\n", "logging.error('Could not read metafile!', full_traceback())\n", "return metadata\n", "metadata = f.read()\n", "metadata = self.getDropboxFile(filepath).decode()\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Return'", "Assign'", "Assign'" ]
[ "def FUNC_1(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = self.id\n", "return apps.get_model('dashboard.ExtractedChemical').objects.get(rawchem_ptr=id\n ).data_document\n", "return apps.get_model('dashboard.ExtractedFunctionalUse').objects.get(\n rawchem_ptr=id).data_document\n", "return apps.g...
[ "def get_data_document(self):...\n", "\"\"\"docstring\"\"\"\n", "id = self.id\n", "return apps.get_model('dashboard.ExtractedChemical').objects.get(rawchem_ptr=id\n ).data_document\n", "return apps.get_model('dashboard.ExtractedFunctionalUse').objects.get(\n rawchem_ptr=id).data_document\n", "return...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'", "Return'", "Return'", "Return'" ]
[ "def FUNC_5(VAR_0):...\n", "VAR_7 = psycopg2.connect(dbname=pg_connection['database'], user=\n pg_connection['user'], password=pg_connection['password'], host=\n pg_connection['host'])\n", "VAR_8 = VAR_7.cursor()\n", "VAR_8.execute(\n \"\"\"\n SELECT id, tier, creator, description FROM quests\n ...
[ "def retrieve_all_quests(pg_connection):...\n", "conn = psycopg2.connect(dbname=pg_connection['database'], user=\n pg_connection['user'], password=pg_connection['password'], host=\n pg_connection['host'])\n", "cur = conn.cursor()\n", "cur.execute(\n \"\"\"\n SELECT id, tier, creator, description F...
[ 0, 0, 0, 4, 4, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "\"\"\"Serve files directly from the ContentsManager.\"\"\"\n", "import mimetypes\n", "import json\n", "from base64 import decodebytes\n", "from tornado import web\n", "from notebook.base.handlers import IPythonHandler\n", "from notebook.utils import maybe_future\n", "\"\"\"string\"\"\"\n", "@proper...
[ "\"\"\"Serve files directly from the ContentsManager.\"\"\"\n", "import mimetypes\n", "import json\n", "from base64 import decodebytes\n", "from tornado import web\n", "from notebook.base.handlers import IPythonHandler\n", "from notebook.utils import maybe_future\n", "\"\"\"serve files via ContentsMan...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Expr'", "Condition", "Return'" ]
[ "@api.public...\n", "FUNC_31(self, 'DELETE')\n" ]
[ "@api.public...\n", "record(self, 'DELETE')\n" ]
[ 0, 0 ]
[ "Condition", "Expr'" ]
[ "\"\"\"string\"\"\"\n", "import argparse\n", "import io\n", "import logging\n", "import os\n", "import re\n", "import smtplib\n", "import sqlite3\n", "import sys\n", "import tempfile\n", "import time\n", "from sqlite3 import Error\n", "import requests\n", "from siskin.mail import send_mail...
[ "\"\"\"\n\nAutomated content verification of all sources in the (live) solr\nTicket: #15656\n\nUsage:\n\n $ solrcheckup.py -d my.db -k 1.2.3.4:8080 -a solr.index.xyz --smtp-sender \"beep@friendlyalarms.com\"\n\nThis script should run fine in cron.\n\"\"\"\n", "import argparse\n", "import io\n", "import log...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Function...
[ "def FUNC_14(self, VAR_21, VAR_11):...\n", "if VAR_0(VAR_11):\n", "VAR_37, VAR_41 = self.process_lhs(VAR_21, VAR_11)\n", "VAR_42, VAR_43 = self.process_rhs(VAR_21, VAR_11)\n", "assert len(VAR_43) == 1, _('A list of strings must be provided as argument')\n", "VAR_4, *VAR_44 = VAR_43\n", "VAR_42 = ','.joi...
[ "def as_sql(self, compiler, connection):...\n", "if is_postgresql(connection):\n", "lhs, lhs_params = self.process_lhs(compiler, connection)\n", "rhs, rhs_params = self.process_rhs(compiler, connection)\n", "assert len(rhs_params) == 1, _('A list of strings must be provided as argument'\n )\n", "value,...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assert'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_0(self, VAR_2=None, VAR_3=60):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_2 is None:\n", "VAR_2 = self.sensors\n", "if self.debug:\n", "print('sensors:', VAR_2)\n", "while not self.is_open:\n", "self.flush()\n", "self.open()\n", "time.sleep(VAR_3)\n", "for sen in VAR_2:\n", "self.flus...
[ "def read_data(self, sensors=None, reset_wait=60):...\n", "\"\"\"docstring\"\"\"\n", "if sensors is None:\n", "sensors = self.sensors\n", "if self.debug:\n", "print('sensors:', sensors)\n", "while not self.is_open:\n", "self.flush()\n", "self.open()\n", "time.sleep(reset_wait)\n", "for sen in se...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "For", "Expr'", "Expr'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Ex...
[ "from flask import Flask, flash, render_template, request, url_for, redirect, session, g\n", "from flask_limiter import Limiter\n", "from flask_limiter.util import get_remote_address\n", "import MySQLdb\n", "from flask_sqlalchemy import SQLAlchemy\n", "from MySQLdb import escape_string as thwart\n", "fr...
[ "from flask import Flask, flash, render_template, request, url_for, redirect, session, g\n", "from flask_limiter import Limiter\n", "from flask_limiter.util import get_remote_address\n", "import MySQLdb\n", "from flask_sqlalchemy import SQLAlchemy\n", "from MySQLdb import escape_string as thwart\n", "fr...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Import'", "ImportFrom'", "Import'", "Import'", "Import'", "ImportFrom'", "Import'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "A...
[ "def FUNC_15(VAR_33, VAR_5=False):...\n", "\"\"\"docstring\"\"\"\n", "VAR_52 = {}\n", "for VAR_82, info in VAR_33:\n", "VAR_52[VAR_82.output(VAR_5)] = {'numbers': len(info[0]), 'details': info[1]}\n", "return VAR_52\n" ]
[ "def _get_compositekws(ckw_matches, spires=False):...\n", "\"\"\"docstring\"\"\"\n", "output = {}\n", "for composite_keyword, info in ckw_matches:\n", "output[composite_keyword.output(spires)] = {'numbers': len(info[0]),\n 'details': info[1]}\n", "return output\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Assign'", "Return'" ]
[ "def FUNC_14(self):...\n", "\"\"\"docstring\"\"\"\n", "self.xsrf_token\n", "if not FUNC_0(self.request.host):\n", "if GLSetting.http_log >= 0:\n", "GLSetting.http_log_counter += 1\n", "VAR_15 = '>' * 15\n", "log.err('JSON logging fail (prepare): %s' % excep.message)\n", "self.globaleaks_io_debug = G...
[ "def prepare(self):...\n", "\"\"\"docstring\"\"\"\n", "self.xsrf_token\n", "if not validate_host(self.request.host):\n", "if GLSetting.http_log >= 0:\n", "GLSetting.http_log_counter += 1\n", "content = '>' * 15\n", "log.err('JSON logging fail (prepare): %s' % excep.message)\n", "self.globaleaks_io_d...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Condition", "Condition", "AugAssign'", "Assign'", "Expr'", "Assign'", "AugAssign'", "Return'", "Condition", "AugAssign'", "Expr'", "AugAssign'", "Assign'", "AugAssign'", "For", "AugAssign'", "Condition", "Assign'", "Assign'", "Condit...
[ "def FUNC_0(self, VAR_0, *VAR_1, **VAR_2):...\n", "VAR_3 = VAR_0.GET.get('locale')\n", "VAR_4 = redirect(VAR_0.GET.get('next', VAR_0.META.get('HTTP_REFERER', '/')))\n", "if VAR_3 in [lc for lc, ll in settings.LANGUAGES]:\n", "if VAR_0.user.is_authenticated():\n", "return VAR_4\n", "VAR_0.user.locale = V...
[ "def get(self, request, *args, **kwargs):...\n", "locale = request.GET.get('locale')\n", "resp = redirect(request.GET.get('next', request.META.get('HTTP_REFERER', '/')))\n", "if locale in [lc for lc, ll in settings.LANGUAGES]:\n", "if request.user.is_authenticated():\n", "return resp\n", "request.user.l...
[ 0, 0, 6, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "For", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Expr'" ]
[ "@property...\n", "if not hasattr(self, '_meta'):\n", "self._meta = VAR_54.get_meta(self.doctype)\n", "return self._meta\n" ]
[ "@property...\n", "if not hasattr(self, '_meta'):\n", "self._meta = frappe.get_meta(self.doctype)\n", "return self._meta\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Return'" ]
[ "def FUNC_17(self, VAR_15):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_15 is None:\n", "return dict()\n", "VAR_37 = 0\n", "VAR_38 = None\n", "for o in self.products:\n", "VAR_47 = o.match(VAR_15)\n", "return VAR_38\n", "if VAR_47:\n", "VAR_50 = self.get_wildcard_len(VAR_47.groupdict())\n", "if ...
[ "def get_wildcards(self, requested_output):...\n", "\"\"\"docstring\"\"\"\n", "if requested_output is None:\n", "return dict()\n", "bestmatchlen = 0\n", "bestmatch = None\n", "for o in self.products:\n", "match = o.match(requested_output)\n", "return bestmatch\n", "if match:\n", "l = self.get_wi...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Condition", "Assign'", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_2(self):...\n", "self.uut.output_regex = 'string'\n", "self.uut.severity_map = {'I': RESULT_SEVERITY.INFO}\n", "VAR_1 = list(self.uut.process_output(['info_msg|1.0|2.3|I: Info message\\n'],\n 'a/file.py', ['original_file_lines_placeholder']))\n", "self.assertEqual(len(VAR_1), 1)\n", "self.ass...
[ "def test_custom_regex(self):...\n", "self.uut.output_regex = (\n '(?P<origin>\\\\w+)\\\\|(?P<line>\\\\d+)\\\\.(?P<column>\\\\d+)\\\\|(?P<end_line>\\\\d+)\\\\.(?P<end_column>\\\\d+)\\\\|(?P<severity>\\\\w+): (?P<message>.*)'\n )\n", "self.uut.severity_map = {'I': RESULT_SEVERITY.INFO}\n", "out = list(se...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_0(self):...\n", "if self.check_xsrf_cookie() == False:\n", "VAR_0 = 'xsrf invalid'\n", "self.get(VAR_0)\n" ]
[ "def check_xsrf(self):...\n", "if self.check_xsrf_cookie() == False:\n", "error = 'xsrf invalid'\n", "self.get(error)\n" ]
[ 0, 0, 5, 5 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'" ]
[ "def FUNC_15(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = [VAR_28 for VAR_28 in self.expanded_output if VAR_28.exists]\n", "if VAR_21:\n", "logger.info(\n \"\"\"Removing output files of failed job {} since they might be corrupted:\n{}\"\"\"\n .format(self, ', '.join(VAR_21)))\n", "for VAR_28 i...
[ "def cleanup(self):...\n", "\"\"\"docstring\"\"\"\n", "to_remove = [f for f in self.expanded_output if f.exists]\n", "if to_remove:\n", "logger.info(\n \"\"\"Removing output files of failed job {} since they might be corrupted:\n{}\"\"\"\n .format(self, ', '.join(to_remove)))\n", "for f in to_remove...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Expr'", "For", "Expr'" ]
[ "def FUNC_0():...\n", "\"\"\"docstring\"\"\"\n", "if hasattr(g, 'username'):\n", "return g.username\n", "if VAR_1.is_authenticated():\n", "return VAR_1.current_email()\n" ]
[ "def get_logged_in_user():...\n", "\"\"\"docstring\"\"\"\n", "if hasattr(g, 'username'):\n", "return g.username\n", "if user_mod.is_authenticated():\n", "return user_mod.current_email()\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Return'" ]
[ "def FUNC_1():...\n", "\"\"\"docstring\"\"\"\n", "VAR_8 = subprocess.Popen('nmcli -t -f NAME,TYPE conn | grep 802-11-wireless',\n shell=True, stdout=subprocess.PIPE).communicate()[0]\n", "VAR_9 = VAR_8.split('\\n')\n", "VAR_10 = []\n", "for row in VAR_9:\n", "VAR_19 = row.split(':')\n", "return VAR...
[ "def get_allconfiguredwifi():...\n", "\"\"\"docstring\"\"\"\n", "ps = subprocess.Popen('nmcli -t -f NAME,TYPE conn | grep 802-11-wireless',\n shell=True, stdout=subprocess.PIPE).communicate()[0]\n", "wifirows = ps.split('\\n')\n", "wifi = []\n", "for row in wifirows:\n", "name = row.split(':')\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Expr'", "Expr'" ]
[ "def FUNC_1(VAR_6):...\n", "VAR_9 = HttpResponse('', status=302)\n", "VAR_9['Location'] = '{}{}?{}'.format(settings.APP_DEEPLINK_DOMAIN, VAR_1,\n VAR_6.GET.urlencode())\n", "return VAR_9\n" ]
[ "def login_redirect(request):...\n", "response = HttpResponse('', status=302)\n", "response['Location'] = '{}{}?{}'.format(settings.APP_DEEPLINK_DOMAIN,\n LOGIN_PATH, request.GET.urlencode())\n", "return response\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "@FUNC_0...\n", "VAR_14 = []\n", "VAR_16 = 'all'\n", "for key, i in VAR_3.query.items():\n", "if key == 'mode':\n", "if not VAR_14:\n", "VAR_16 = i\n", "if key == 'tag':\n", "VAR_22 = await database.select_toilet_statuses(VAR_3)\n", "VAR_22 = await database.select_toilet_statuses_by_tags(VAR_3, VA...
[ "@handle_html...\n", "tags = []\n", "mode = 'all'\n", "for key, i in request.query.items():\n", "if key == 'mode':\n", "if not tags:\n", "mode = i\n", "if key == 'tag':\n", "toilets = await database.select_toilet_statuses(request)\n", "toilets = await database.select_toilet_statuses_by_tags(reques...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "For", "Condition", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "For", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_2(VAR_6, VAR_7):...\n", "VAR_8 = VAR_1 and VAR_2\n", "VAR_9 = 'SELECT COALESCE(COUNT(' + VAR_0 + '.' + VAR_3 + '), 0) FROM ' + VAR_0\n", "if VAR_8:\n", "VAR_9 += ' LEFT JOIN ' + VAR_1\n", "VAR_9 += ' WHERE (' + VAR_0 + '.' + VAR_3 + ' = :x'\n", "if VAR_8:\n", "VAR_9 += ' AND ' + VAR_1 + '.id...
[ "def _unique(form, field):...\n", "sub = subtable and subname\n", "query = 'SELECT COALESCE(COUNT(' + table + '.' + name + '), 0) FROM ' + table\n", "if sub:\n", "query += ' LEFT JOIN ' + subtable\n", "query += ' WHERE (' + table + '.' + name + ' = :x'\n", "if sub:\n", "query += ' AND ' + subtable + '...
[ 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 4, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "AugAssign'", "AugAssign'", "Condition", "AugAssign'", "AugAssign'", "Assign'", "Assign'", "For", "Condition" ]
[ "\"\"\"Base core views.\"\"\"\n", "from __future__ import unicode_literals\n", "from django.core.urlresolvers import reverse\n", "from django.views import generic\n", "from django.contrib.auth import mixins as auth_mixins\n", "from ..extensions import exts_pool\n", "def FUNC_0(VAR_0, VAR_1):...\n", "\...
[ "\"\"\"Base core views.\"\"\"\n", "from __future__ import unicode_literals\n", "from django.core.urlresolvers import reverse\n", "from django.views import generic\n", "from django.contrib.auth import mixins as auth_mixins\n", "from ..extensions import exts_pool\n", "def find_nextlocation(request, user):...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Docstring", "Condition", "Return'", "Assign'", "Condition", "Condition", "Return'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_5(VAR_12):...\n", "def FUNC_9(self, *VAR_15, **VAR_75):...\n", "for validator in VAR_0:\n", "if VAR_102.method == 'POST' and hasattr(self, 'ajax_login_redirect'):\n", "return FUNC_9\n", "validator(VAR_75)\n", "VAR_16 = self.build_arg_list(VAR_12, VAR_75)\n", "return self.ajax_login_redirect(...
[ "def val(fn):...\n", "def newfn(self, *a, **env):...\n", "for validator in simple_vals:\n", "if request.method == 'POST' and hasattr(self, 'ajax_login_redirect'):\n", "return newfn\n", "validator(env)\n", "kw = self.build_arg_list(fn, env)\n", "return self.ajax_login_redirect('/')\n", "return self.i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "For", "Condition", "Return'", "Expr'", "Assign'", "Return'", "Return'", "For", "Assign'", "Return'" ]
[ "def __exit__(self, VAR_7, VAR_8, VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "for VAR_12, VAR_8 in self.extra_data.items():\n", "if not isinstance(VAR_12, str) or not isinstance(VAR_8, str):\n", "if VAR_7 is not None:\n", "VAR_5 = json.dumps({'type': str(VAR_7), 'value': str(VAR_8), 'traceback':\n str(t...
[ "def __exit__(self, type, value, tb):...\n", "\"\"\"docstring\"\"\"\n", "for key, value in self.extra_data.items():\n", "if not isinstance(key, str) or not isinstance(value, str):\n", "if type is not None:\n", "extra_data = json.dumps({'type': str(type), 'value': str(value),\n 'traceback': str(tracebac...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_3(VAR_5, VAR_6):...\n", "\"\"\"docstring\"\"\"\n", "VAR_5.execute(f'string{VAR_6}\\n ')\n", "VAR_7 = None\n", "for row in VAR_5:\n", "if VAR_7 is None:\n", "return VAR_7\n", "VAR_7 = {'id': row['id'], 'title': row['title'], 'description': row[\n 'description'], 'tags': []}\n", "if ro...
[ "def fetch_issue(cursor, id):...\n", "\"\"\"docstring\"\"\"\n", "cursor.execute(\n f\"\"\"\n SELECT\n issue.id,\n issue.title,\n issue.description,\n tag.namespace,\n tag.predicate,\n tag.value\n FROM\n issue LEFT JOIN...
[ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "For", "Condition", "Return'", "Assign'", "Condition", "Expr'" ]
[ "@VAR_0.route('/')...\n", "" ]
[ "@app.route('/')...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def FUNC_17(self, VAR_18):...\n", "if not isinstance(VAR_18, JvmTarget):\n", "return False\n", "return VAR_18.has_sources('.java') or VAR_18.has_sources('.scala')\n" ]
[ "def select(self, target):...\n", "if not isinstance(target, JvmTarget):\n", "return False\n", "return target.has_sources('.java') or target.has_sources('.scala')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "from osv import fields, osv\n", "from tools.translate import _\n", "VAR_0 = 'product.product'\n", "def FUNC_0(self, VAR_1, VAR_2, VAR_3, VAR_4=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_4 is None:\n", "VAR_4 = {}\n", "VAR_17 = self.pool.get('product.product').browse(VAR_1, VAR_2, VAR_3, VAR_4\n...
[ "from osv import fields, osv\n", "from tools.translate import _\n", "_inherit = 'product.product'\n", "def get_product_accounts(self, cr, uid, product_id, context=None):...\n", "\"\"\"docstring\"\"\"\n", "if context is None:\n", "context = {}\n", "product_obj = self.pool.get('product.product').browse(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "Assign'", "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_26(self, VAR_2, VAR_3, VAR_4, *VAR_6):...\n", "self.write(VAR_2, VAR_3, VAR_4, {'state': 'pending'})\n", "return True\n" ]
[ "def do_pending(self, cr, uid, ids, *args):...\n", "self.write(cr, uid, ids, {'state': 'pending'})\n", "return True\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_49(self):...\n", "for VAR_14 in self.list_columns.keys():\n", "if self.is_pk(VAR_14):\n", "return VAR_14\n" ]
[ "def get_pk_name(self):...\n", "for col_name in self.list_columns.keys():\n", "if self.is_pk(col_name):\n", "return col_name\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Condition", "Return'" ]
[ "def FUNC_1(self):...\n", "self.assertTrue(self.client.login(username='autotest', password='password'))\n" ]
[ "def setUp(self):...\n", "self.assertTrue(self.client.login(username='autotest', password='password'))\n" ]
[ 0, 5 ]
[ "FunctionDef'", "Expr'" ]
[ "def __init__(self, VAR_0):...\n", "super().__init__()\n", "self.required_opts = ['SQL_SERVER', 'SQL_USERNAME', 'SQL_DB']\n", "self.parse_options(VAR_0)\n", "self.columns = {}\n", "VAR_12 = os.environ.get('SQL_PASSWORD')\n", "if not VAR_12:\n", "VAR_12 = self.OPTIONS['SQL_PASSWORD']\n", "self.db = m...
[ "def __init__(self, OPTIONS):...\n", "super().__init__()\n", "self.required_opts = ['SQL_SERVER', 'SQL_USERNAME', 'SQL_DB']\n", "self.parse_options(OPTIONS)\n", "self.columns = {}\n", "pw = os.environ.get('SQL_PASSWORD')\n", "if not pw:\n", "pw = self.OPTIONS['SQL_PASSWORD']\n", "self.db = mysql.con...
[ 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_3(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_13 = self.get_secure_cookie('session_key')\n", "if not VAR_13:\n", "return None\n", "VAR_14 = Login_Session.get_by_key(VAR_13, self.sql_session)\n", "if not VAR_14:\n", "return None\n", "return User.by_key(VAR_14.userkey, self.sql_session).sc...
[ "def get_current_user(self):...\n", "\"\"\"docstring\"\"\"\n", "session_key = self.get_secure_cookie('session_key')\n", "if not session_key:\n", "return None\n", "login_session = Login_Session.get_by_key(session_key, self.sql_session)\n", "if not login_session:\n", "return None\n", "return User.by_k...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_10(self):...\n", "self.run_test_case(self.scenario.upsert_load_balancer())\n" ]
[ "def test_b_upsert_load_balancer(self):...\n", "self.run_test_case(self.scenario.upsert_load_balancer())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_2(self):...\n", "\"\"\"docstring\"\"\"\n", "\"\"\"string\"\"\"\n", "VAR_4 = False\n", "VAR_2 = request.form.get('userId')\n", "VAR_7 = request.form.get('firstName')\n", "VAR_8 = request.form.get('lastName')\n", "VAR_6 = request.form.get('username')\n", "VAR_9 = request.form.get('password')...
[ "def put(self):...\n", "\"\"\"docstring\"\"\"\n", "\"\"\"\n # Check the request comes from appropriate location.\n if not utils.validate_ip(request.remote_addr)\n return {}, 403\n \"\"\"\n", "return_obj = False\n", "user_id = request.form.get('userId')\n", "firstname = requ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Condition", "Return'", "Assign'", "Return'" ]
[ "def FUNC_3(VAR_11):...\n", "\"\"\"docstring\"\"\"\n", "VAR_54 = VAR_11['stage_log']\n", "if VAR_54:\n", "if VAR_11['script_log']:\n", "VAR_49 = VAR_54.split('\\r\\n')\n", "logging.error(T('Invalid stage logging in history for %s') + ' (\\\\r\\\\n)',\n unicoder(VAR_11['name']))\n", "VAR_54 = [None ...
[ "def unpack_history_info(item):...\n", "\"\"\"docstring\"\"\"\n", "lst = item['stage_log']\n", "if lst:\n", "if item['script_log']:\n", "lines = lst.split('\\r\\n')\n", "logging.error(T('Invalid stage logging in history for %s') + ' (\\\\r\\\\n)',\n unicoder(item['name']))\n", "lst = [None for x in...
[ 0, 0, 0, 0, 0, 0, 0, 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'", "Condition", "Condition", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Expr'", "For", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "...
[ "@query_cached...\n", "VAR_46 = []\n", "for entry in lore.io.bucket.objects.filter(Prefix=os.path.join(self.\n", "VAR_39 = tempfile.NamedTemporaryFile()\n", "VAR_36 = pandas.concat(VAR_46)\n", "lore.io.bucket.download_file(entry.key, VAR_39.name)\n", "VAR_36.columns = VAR_26\n", "VAR_22 = pandas.read_...
[ "@query_cached...\n", "frames = []\n", "for entry in lore.io.bucket.objects.filter(Prefix=os.path.join(self.\n", "temp = tempfile.NamedTemporaryFile()\n", "result = pandas.concat(frames)\n", "lore.io.bucket.download_file(entry.key, temp.name)\n", "result.columns = columns\n", "dataframe = pandas.read_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "For", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_27(self):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_45(VAR_25):...\n", "if VAR_25.fieldtype == 'Table':\n", "return '{}: {}: {}'.format(_('Error'), _('Data missing in table'), _(VAR_25\n .label))\n", "if self.parentfield:\n", "return '{}: {} {} #{}: {}: {}'.format(_('Error'), VAR_54.bold(...
[ "def _get_missing_mandatory_fields(self):...\n", "\"\"\"docstring\"\"\"\n", "def get_msg(df):...\n", "if df.fieldtype == 'Table':\n", "return '{}: {}: {}'.format(_('Error'), _('Data missing in table'), _(df.label))\n", "if self.parentfield:\n", "return '{}: {} {} #{}: {}: {}'.format(_('Error'), frappe.b...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "@app.route('/api/sequences/<id>/sequence_items', methods=['POST'])...\n", "VAR_21 = SequenceItem(VAR_3)\n", "app.logger.debug('adding sequence item {} to id {}'.format(VAR_21, VAR_4))\n", "VAR_19.sequence_items.append(VAR_21)\n", "return VAR_21.to_map()\n" ]
[ "@app.route('/api/sequences/<id>/sequence_items', methods=['POST'])...\n", "new_sequence_item = SequenceItem(json)\n", "app.logger.debug('adding sequence item {} to id {}'.format(\n new_sequence_item, id))\n", "sequence.sequence_items.append(new_sequence_item)\n", "return new_sequence_item.to_map()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Expr'", "Expr'", "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_13(self):...\n", "VAR_7.environ['SWARMING_LOAD_TEST'] = '1'\n", "VAR_18 = threading.Event()\n", "self.mock(VAR_18, 'wait', self.fail)\n", "self.mock(bot_main, 'run_manifest', self.fail)\n", "self.mock(bot_main, 'update_bot', self.fail)\n", "self.mock(self.bot, 'restart', self.fail)\n", "self...
[ "def test_poll_server_restart_load_test(self):...\n", "os.environ['SWARMING_LOAD_TEST'] = '1'\n", "bit = threading.Event()\n", "self.mock(bit, 'wait', self.fail)\n", "self.mock(bot_main, 'run_manifest', self.fail)\n", "self.mock(bot_main, 'update_bot', self.fail)\n", "self.mock(self.bot, 'restart', self...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_22(self, VAR_25):...\n", "self.final = None\n", "self.marks.append((VAR_25, time.time()))\n" ]
[ "def mark(self, name):...\n", "self.final = None\n", "self.marks.append((name, time.time()))\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def __call__(self, VAR_2, VAR_3, VAR_4=None):...\n", "if self.variableTo:\n", "if VAR_2['type'] == 'groupchat':\n", "VAR_105, VAR_93, VAR_92 = VAR_3.split(' ', 2)\n", "self.reply(VAR_2, VAR_92, overrideTo=to, overrideMType=mtype)\n", "VAR_105 = VAR_2['from'].bare\n", "VAR_105 = VAR_2['from']\n", "VAR...
[ "def __call__(self, msg, arguments, errorSink=None):...\n", "if self.variableTo:\n", "if msg['type'] == 'groupchat':\n", "to, mtype, body = arguments.split(' ', 2)\n", "self.reply(msg, body, overrideTo=to, overrideMType=mtype)\n", "to = msg['from'].bare\n", "to = msg['from']\n", "body = arguments\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_43(self, VAR_9, VAR_25):...\n", "return cast_fieldtype(VAR_25.fieldtype, VAR_9)\n" ]
[ "def cast(self, value, df):...\n", "return cast_fieldtype(df.fieldtype, value)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_10(self, VAR_13):...\n", "VAR_24 = []\n", "VAR_25 = self.value_from_object(VAR_13)\n", "VAR_3 = self.base_field\n", "for val in VAR_25:\n", "if val is None:\n", "return json.dumps(VAR_24)\n", "VAR_24.append(None)\n", "VAR_13 = AttributeSetter(VAR_3.attname, val)\n", "VAR_24.append(VAR_3....
[ "def value_to_string(self, obj):...\n", "values = []\n", "vals = self.value_from_object(obj)\n", "base_field = self.base_field\n", "for val in vals:\n", "if val is None:\n", "return json.dumps(values)\n", "values.append(None)\n", "obj = AttributeSetter(base_field.attname, val)\n", "values.append(b...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Return'", "Expr'", "Assign'", "Expr'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "VAR_9 = db.session.query(TaskHistory.id, TaskHistory.task_id, TaskHistory.\n action, TaskHistory.action_date, TaskHistory.action_text, User.username\n ).join(User).filter(TaskHistory.project_id == VAR_1, TaskHistory.action !=\n 'COMMENT').order_by(TaskH...
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "results = db.session.query(TaskHistory.id, TaskHistory.task_id, TaskHistory\n .action, TaskHistory.action_date, TaskHistory.action_text, User.username\n ).join(User).filter(TaskHistory.project_id == project_id, TaskHistory.\n action != 'COMMENT').order_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "@classmethod...\n", "def FUNC_13(VAR_6):...\n", "VAR_4.register_jvm_tool(VAR_8, VAR_4._key_for_tool_version('scalac', VAR_6),\n VAR_15=[cls._create_compiler_jardep(version)])\n", "def FUNC_14(VAR_6, VAR_11=False):...\n", "VAR_15 = [VAR_4._create_compiler_jardep(VAR_6)]\n", "if VAR_11:\n", "VAR_20 = ...
[ "@classmethod...\n", "def register_scala_compiler_tool(version):...\n", "cls.register_jvm_tool(register, cls._key_for_tool_version('scalac', version\n ), classpath=[cls._create_compiler_jardep(version)])\n", "def register_scala_repl_tool(version, with_jline=False):...\n", "classpath = [cls._create_compil...
[ 0, 0, 7, 0, 0, 0, 0, 7, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0 ]
[ "Condition", "FunctionDef'", "Expr'", "FunctionDef'", "Assign'", "Condition", "Assign'", "Expr'", "Expr'", "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'",...
[ "@utils.synchronized('3par', external=True)...\n", "" ]
[ "@utils.synchronized('3par', external=True)...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def FUNC_8(VAR_12, VAR_8, VAR_7, VAR_13, VAR_27, VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = VAR_14 = VAR_20 = FUNC_0()\n", "VAR_16 = {'cost_usd': VAR_13 * (VAR_20 - VAR_27) / 60.0 / 60.0, 'id': VAR_8\n .bot_id, 'task_id': VAR_8.task_id}\n", "FUNC_4(VAR_12, VAR_16, None, '', 0)\n", "if VAR_8....
[ "def run_command(swarming_server, task_details, work_dir, cost_usd_hour,...\n", "\"\"\"docstring\"\"\"\n", "last_packet = start = now = monotonic_time()\n", "params = {'cost_usd': cost_usd_hour * (now - task_start) / 60.0 / 60.0,\n 'id': task_details.bot_id, 'task_id': task_details.task_id}\n", "post_upd...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Condition", "Assign'", "Expr'", "AugAssign'", "For", "Expr'", "Condition", "Assign'", "Assign'"...
[ "def FUNC_20(self):...\n", "\"\"\"docstring\"\"\"\n", "self.cursor.execute('create table t1(id integer, s varchar(20))')\n", "self.cursor.execute('insert into t1 values (?,?)', 1, 'test')\n", "VAR_24 = self.cursor.execute('string', 'test', 1, 10).fetchone()\n", "self.assertNotEqual(VAR_24, None)\n", "se...
[ "def test_subquery_params(self):...\n", "\"\"\"docstring\"\"\"\n", "self.cursor.execute('create table t1(id integer, s varchar(20))')\n", "self.cursor.execute('insert into t1 values (?,?)', 1, 'test')\n", "row = self.cursor.execute(\n \"\"\"\n select x.id\n ...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_1(self):...\n", "self.assertTrue(self.client.login(VAR_8='autotest', VAR_9='password'))\n" ]
[ "def setUp(self):...\n", "self.assertTrue(self.client.login(username='autotest', password='password'))\n" ]
[ 0, 5 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_4(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = jc.Contract()\n", "return st.OperationContract(self.agent.make_delete_app_operation(VAR_1=self\n .bindings, application=self.TEST_APP), VAR_6=contract)\n" ]
[ "def delete_app(self):...\n", "\"\"\"docstring\"\"\"\n", "contract = jc.Contract()\n", "return st.OperationContract(self.agent.make_delete_app_operation(bindings=\n self.bindings, application=self.TEST_APP), contract=contract)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "@app.route('/auth/register/', methods=['POST'])...\n", "VAR_0 = RegisterForm(request.form)\n", "if not VAR_0.validate():\n", "return FUNC_8(VAR_0)\n", "VAR_2 = User(VAR_0.username.data, VAR_0.password.data)\n", "db.session().add(VAR_2)\n", "db.session.commit()\n", "login_user(VAR_2)\n", "return red...
[ "@app.route('/auth/register/', methods=['POST'])...\n", "form = RegisterForm(request.form)\n", "if not form.validate():\n", "return render_registerForm(form)\n", "u = User(form.username.data, form.password.data)\n", "db.session().add(u)\n", "db.session.commit()\n", "login_user(u)\n", "return redirec...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Return'", "Assign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_8(self):...\n", "user_should_have_perm(self.tester, self.permission)\n" ]
[ "def setUp(self):...\n", "user_should_have_perm(self.tester, self.permission)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_8(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "VAR_5 = {'id': 'fake_uuid'}\n", "VAR_1 = {'name': self.volume_name}\n", "VAR_6 = self.configuration.volume_name_template % VAR_5['id']\n", "self.driver._eql_execute('volume', 'select', VAR_6, 'clone', ...
[ "def test_create_cloned_volume(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "src_vref = {'id': 'fake_uuid'}\n", "volume = {'name': self.volume_name}\n", "src_volume_name = self.configuration.volume_name_template % src_vref['id']\n", "self.driver._eql_execute(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "@VAR_8.command()...\n", "\"\"\"docstring\"\"\"\n", "VAR_14 = ' '.join(map(str, VAR_13))\n", "VAR_15 = 'id=([\\\\d])'\n", "VAR_16 = 'tier=([^\\\\s]+)'\n", "VAR_17 = 'creator=([^\\\\s]+)'\n", "VAR_18 = ''\n", "VAR_19 = ''\n", "VAR_20 = ''\n", "if re.search(VAR_15, VAR_14) is not None:\n", "VAR_25...
[ "@bot.command()...\n", "\"\"\"docstring\"\"\"\n", "command = ' '.join(map(str, args))\n", "idsearch = 'id=([\\\\d])'\n", "tiersearch = 'tier=([^\\\\s]+)'\n", "creatorsearch = 'creator=([^\\\\s]+)'\n", "idformat = ''\n", "tierformat = ''\n", "creatorformat = ''\n", "if re.search(idsearch, command) ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "For", ...