lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "@receiver(VAR_5, **decorator_kwargs)...\n", "if settings.SUSPEND_SIGNALS:\n", "return\n", "return VAR_17(VAR_23, **kwargs)\n" ]
[ "@receiver(signal, **decorator_kwargs)...\n", "if settings.SUSPEND_SIGNALS:\n", "return\n", "return func(sender, **kwargs)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_10(self, VAR_11):...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = FUNC_6(VAR_8=self.request.url)\n", "VAR_22 = helpers.get_user_email()\n", "if not VAR_22:\n", "self.redirect(VAR_21)\n", "VAR_23 = db_config.get_value('contact_string')\n", "return\n", "VAR_24 = {'message': VAR_11, 'user_email':...
[ "def render_forbidden(self, message):...\n", "\"\"\"docstring\"\"\"\n", "login_url = make_login_url(dest_url=self.request.url)\n", "user_email = helpers.get_user_email()\n", "if not user_email:\n", "self.redirect(login_url)\n", "contact_string = db_config.get_value('contact_string')\n", "return\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Return'", "Assign'", "Expr'" ]
[ "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_2(self, VAR_5):...\n", "" ]
[ "def _on_list_scroll(self, event):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_6(self):...\n", "self.client.login(username=self.tester.username, password='password')\n", "VAR_1 = self.client.post(self.many_comments_url, {'comment': 'new comment',\n 'run': '99999998,1009900'})\n", "self.assertJSONEqual(str(VAR_1.content, encoding=settings.DEFAULT_CHARSET),\n {'rc': 1, 're...
[ "def test_refuse_if_passed_case_run_pks_not_exist(self):...\n", "self.client.login(username=self.tester.username, password='password')\n", "response = self.client.post(self.many_comments_url, {'comment':\n 'new comment', 'run': '99999998,1009900'})\n", "self.assertJSONEqual(str(response.content, encoding=s...
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_16(VAR_1):...\n", "async def FUNC_15(VAR_3):...\n", "VAR_19 = await VAR_1(VAR_3, VAR_4)\n", "return VAR_19\n" ]
[ "def decorator(func):...\n", "async def ret(request):...\n", "out = await func(request, base)\n", "return out\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "AsyncFunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_7(self):...\n", "return {}\n" ]
[ "def Response(self):...\n", "return {}\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_9(self):...\n", "self._hosts_cache = None\n", "for VAR_12 in self.parent_groups:\n", "VAR_12.clear_hosts_cache()\n" ]
[ "def clear_hosts_cache(self):...\n", "self._hosts_cache = None\n", "for g in self.parent_groups:\n", "g.clear_hosts_cache()\n" ]
[ 0, 0, 1, 1 ]
[ "FunctionDef'", "Assign'", "For", "Expr'" ]
[ "def FUNC_1(self):...\n", "self.attachNeighbours()\n", "self.identifyTurning()\n", "self.genConnections()\n" ]
[ "def resetToOriginal(self):...\n", "self.attachNeighbours()\n", "self.identifyTurning()\n", "self.genConnections()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(self, VAR_1, VAR_2, *VAR_3, **VAR_4):...\n", "self.handled_resp = VAR_1\n", "self.handled_remote = VAR_2\n", "self.handled_args = VAR_3\n", "self.handled_kwargs = VAR_4\n", "return 'TEST'\n" ]
[ "def handler(self, resp, remote, *args, **kwargs):...\n", "self.handled_resp = resp\n", "self.handled_remote = remote\n", "self.handled_args = args\n", "self.handled_kwargs = kwargs\n", "return 'TEST'\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "\"\"\"\nCreated on 1 Feb 2018\n\n@author: Teodor Gherasim Nistor\n\"\"\"\n", "from beamr.debug import debug, warn\n", "from beamr.lexers import docLexer, slideLexer\n", "from beamr.parsers import docParser, slideParser\n", "from beamr.interpreters import Config, VerbatimEnv\n", "def __init__(self, VAR_0,...
[ "\"\"\"\nCreated on 1 Feb 2018\n\n@author: Teodor Gherasim Nistor\n\"\"\"\n", "from beamr.debug import debug, warn\n", "from beamr.lexers import docLexer, slideLexer\n", "from beamr.parsers import docParser, slideParser\n", "from beamr.interpreters import Config, VerbatimEnv\n", "def __init__(self, childr...
[ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "For", "AugAssign'", "AugAssign'", "Return'" ]
[ "def __init__(self, VAR_1, VAR_7):...\n", "self.message = VAR_1\n", "self.user = VAR_7\n", "self.image_handler = ImageHandler\n" ]
[ "def __init__(self, message, user):...\n", "self.message = message\n", "self.user = user\n", "self.image_handler = ImageHandler\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_6(self):...\n", "\"\"\"docstring\"\"\"\n", "if self.eng is not None and self.backend == 'Simulator' or self.backend == 'IBMBackend':\n", "pq.ops.All(pq.ops.Measure) | self.reg\n" ]
[ "def _deallocate(self):...\n", "\"\"\"docstring\"\"\"\n", "if self.eng is not None and self.backend == 'Simulator' or self.backend == 'IBMBackend':\n", "pq.ops.All(pq.ops.Measure) | self.reg\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'" ]
[ "def FUNC_2(VAR_14=None, VAR_15=None, VAR_16=None, VAR_17=None, VAR_18=None,...\n", "if VAR_16 is None:\n", "VAR_16 = time.strftime('%Y-%m-%d %H:%M:%S')\n", "VAR_32 = 'string'\n", "VAR_33 = (VAR_14, VAR_15, VAR_16, VAR_17, VAR_18, VAR_19, VAR_20, VAR_21,\n VAR_22, VAR_23, VAR_24, VAR_25, VAR_26)\n", "V...
[ "def add_history_record(username=None, action=None, sql_time=None, address=...\n", "if sql_time is None:\n", "sql_time = time.strftime('%Y-%m-%d %H:%M:%S')\n", "sql = (\n 'INSERT INTO history (username, action, sql_time, address, comment_or_message, recipient_username, recipient_address, amount, hash, comm...
[ 0, 4, 4, 4, 4, 4, 4, 4 ]
[ "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def __init__(self, VAR_0, VAR_1, VAR_2=[], VAR_3=[]):...\n", "self.realpath = VAR_0\n", "self.vpath = VAR_1\n", "self.uread = VAR_2\n", "self.uwrite = VAR_3\n", "self.nodes = {}\n" ]
[ "def __init__(self, realpath, vpath, uread=[], uwrite=[]):...\n", "self.realpath = realpath\n", "self.vpath = vpath\n", "self.uread = uread\n", "self.uwrite = uwrite\n", "self.nodes = {}\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_9(self):...\n", "\"\"\"docstring\"\"\"\n", "import soscollector.clusters\n", "VAR_4 = soscollector.clusters\n", "VAR_17 = {}\n", "VAR_18 = self._load_modules(VAR_4, 'clusters')\n", "for VAR_9 in VAR_18:\n", "VAR_17[VAR_9[0]] = VAR_9[1](self)\n", "return VAR_17\n" ]
[ "def _load_clusters(self):...\n", "\"\"\"docstring\"\"\"\n", "import soscollector.clusters\n", "package = soscollector.clusters\n", "supported_clusters = {}\n", "clusters = self._load_modules(package, 'clusters')\n", "for cluster in clusters:\n", "supported_clusters[cluster[0]] = cluster[1](self)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Import'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Return'" ]
[ "def __init__(self, VAR_18, VAR_35=200, **VAR_16):...\n", "CLASS_17.__init__(self, VAR_18, VAR_35=length, VAR_36=errors.NO_TITLE,\n VAR_37=errors.TITLE_TOO_LONG, **kw)\n" ]
[ "def __init__(self, item, length=200, **kw):...\n", "VLength.__init__(self, item, length=length, empty_error=errors.NO_TITLE,\n length_error=errors.TITLE_TOO_LONG, **kw)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_15(VAR_1, VAR_2, VAR_13, VAR_14, VAR_15):...\n", "\"\"\"docstring\"\"\"\n", "flash('Authorization with remote service failed.')\n", "return redirect('/')\n" ]
[ "def oauth2_handle_error(remote, resp, error_code, error_uri, error_description...\n", "\"\"\"docstring\"\"\"\n", "flash('Authorization with remote service failed.')\n", "return redirect('/')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Return'" ]
[ "def FUNC_12(self):...\n", "self.compilation_ok('string')\n", "self.representation_is('string')\n" ]
[ "def test_rfc5228_extended(self):...\n", "self.compilation_ok(\n \"\"\"\n#\n# Example Sieve Filter\n# Declare any optional features or extension used by the script\n#\nrequire [\"fileinto\"];\n\n#\n# Handle messages from known mailing lists\n# Move messages from IETF filter discussion list to filter mailbox\n#...
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "def FUNC_3(self):...\n", "FUNC_0()\n", "import yaml\n", "self.app_id = yaml.load(open(os.path.join(self.base_dir, 'app.yaml'), 'r'))[\n 'application']\n", "logging.debug('Instance app id: %s' % self.app_id)\n", "assert self.app_id\n" ]
[ "def install_prerequisites(self):...\n", "_load_modules()\n", "import yaml\n", "self.app_id = yaml.load(open(os.path.join(self.base_dir, 'app.yaml'), 'r'))[\n 'application']\n", "logging.debug('Instance app id: %s' % self.app_id)\n", "assert self.app_id\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Import'", "Assign'", "Expr'", "Assert'" ]
[ "def FUNC_4(self, VAR_4):...\n", "self.result = VAR_4\n" ]
[ "def set_result(self, result):...\n", "self.result = result\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Assign'" ]
[ "def FUNC_4(VAR_6, VAR_7, VAR_8):...\n", "\"\"\"docstring\"\"\"\n", "return VAR_6 and ('%s:%s' % (VAR_8 or '', VAR_7) in VAR_6.user_roles or \n ':%s' % VAR_7 in VAR_6.user_roles)\n" ]
[ "def check_user_role(auth, role, cc):...\n", "\"\"\"docstring\"\"\"\n", "return auth and ('%s:%s' % (cc or '', role) in auth.user_roles or ':%s' %\n role in auth.user_roles)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def __init__(self, VAR_2=2, VAR_3=10, VAR_4=False):...\n", "self.idleTimeout = VAR_2\n", "self.timeout = VAR_3\n", "self.insecure = VAR_4\n" ]
[ "def __init__(self, idleTimeout=2, timeout=10, insecure=False):...\n", "self.idleTimeout = idleTimeout\n", "self.timeout = timeout\n", "self.insecure = insecure\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_21(VAR_16):...\n", "return (VAR_16.input, VAR_16.dynamic_input) if VAR_4 else (VAR_16.output,\n VAR_16.dynamic_output)\n" ]
[ "def get_io(rule):...\n", "return (rule.input, rule.dynamic_input) if input else (rule.output, rule.\n dynamic_output)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_2():...\n", "VAR_9 = FUNC_0()\n", "VAR_10 = VAR_9.cursor()\n", "VAR_10.execute(VAR_7)\n", "VAR_9.commit()\n", "VAR_2.info('successfully created karma db for the first time')\n" ]
[ "def create_karma_table():...\n", "db = db_connect()\n", "cursor = db.cursor()\n", "cursor.execute(PEOPLE_TABLE)\n", "db.commit()\n", "logger.info('successfully created karma db for the first time')\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "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'" ]
[ "async def FUNC_2(self, *VAR_12, **VAR_13):...\n", "VAR_11 = VAR_13.pop('content', None)\n", "if VAR_11 is not None:\n", "await self.set_content(VAR_11)\n", "return await super().save(*VAR_12, **kwargs)\n" ]
[ "async def save(self, *args, **kwargs):...\n", "content = kwargs.pop('content', None)\n", "if content is not None:\n", "await self.set_content(content)\n", "return await super().save(*args, **kwargs)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_3(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "VAR_1 = {'name': self.volume_name, 'size': 1}\n", "self.driver._eql_execute('volume', 'select', VAR_1['name'], 'show')\n", "self.driver._eql_execute('volume', 'select', VAR_1['name'], 'offline')\n", "s...
[ "def test_delete_volume(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "volume = {'name': self.volume_name, 'size': 1}\n", "self.driver._eql_execute('volume', 'select', volume['name'], 'show')\n", "self.driver._eql_execute('volume', 'select', volume['name'], 'off...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_9(self, VAR_10=True):...\n", "return self.aq_parent.breadcrumbs_obj_path(VAR_10)\n" ]
[ "def breadcrumbs_obj_path(self, portalMaster=True):...\n", "return self.aq_parent.breadcrumbs_obj_path(portalMaster)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_19(self):...\n", "self._test_strtype('blob', None, 4000)\n" ]
[ "def test_large_null_blob(self):...\n", "self._test_strtype('blob', None, 4000)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "return FUNC_1(VAR_3, VAR_7, VAR_4)\n" ]
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "return create_resource_from_dict(d, cls, full_clean)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "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'" ]
[ "\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n", "from __future__ import unicode_literals\n", "import json\n", "import mock\n", "import requests\n", "from django.test import TransactionTestCase\n", "from api.models import Build\n", "def FUNC_0(*VAR...
[ "\"\"\"\nUnit tests for the Deis api app.\n\nRun the tests with \"./manage.py test api\\\"\n\"\"\"\n", "from __future__ import unicode_literals\n", "import json\n", "import mock\n", "import requests\n", "from django.test import TransactionTestCase\n", "from api.models import Build\n", "def mock_import...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "ImportFrom'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_4(VAR_5, VAR_6='csrf_token', VAR_7=VAR_1, VAR_8=True):...\n", "VAR_10 = VAR_5.params.get(VAR_6, VAR_5.headers.get(VAR_7))\n", "if VAR_10 != VAR_5.session.get_csrf_token():\n", "if VAR_8:\n", "return True\n", "return False\n" ]
[ "def check_csrf_token(request, token='csrf_token', header=HEADER_NAME,...\n", "supplied_token = request.params.get(token, request.headers.get(header))\n", "if supplied_token != request.session.get_csrf_token():\n", "if raises:\n", "return True\n", "return False\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Condition", "Return'", "Return'" ]
[ "def FUNC_8(self, VAR_9, VAR_10=None, VAR_11=None):...\n", "get_and_check_project(VAR_9, VAR_11)\n", "VAR_28 = self.queryset.get(VAR_10=pk, VAR_1=project_pk)\n", "VAR_26 = CLASS_1(VAR_28)\n", "return Response(VAR_26.data)\n" ]
[ "def retrieve(self, request, pk=None, project_pk=None):...\n", "get_and_check_project(request, project_pk)\n", "task = self.queryset.get(pk=pk, project=project_pk)\n", "serializer = TaskSerializer(task)\n", "return Response(serializer.data)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_0(VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "return u'̶'.join(VAR_2) + u'̶'\n" ]
[ "def strike(text):...\n", "\"\"\"docstring\"\"\"\n", "return u'̶'.join(text) + u'̶'\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_3(self, *VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = self.options\n", "VAR_3 = 'http://{host}:{port}/{path}'.format(host=options.host, port=\n options.port, path=COMMANDS[options.prog])\n", "log.logger.error('Daemon not available: %s', e)\n", "VAR_4 = json.dumps(VAR_2[1:])\n", "log.l...
[ "def executer(self, *args):...\n", "\"\"\"docstring\"\"\"\n", "options = self.options\n", "url = 'http://{host}:{port}/{path}'.format(host=options.host, port=options.\n port, path=COMMANDS[options.prog])\n", "log.logger.error('Daemon not available: %s', e)\n", "request = json.dumps(args[1:])\n", "log...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "For", "Expr'" ]
[ "def FUNC_9(VAR_13, VAR_14, VAR_15):...\n", "if VAR_15 == 0:\n", "VAR_15 = 'INFO : '\n", "if VAR_15 == 1:\n", "VAR_42 = 'INFO : '\n", "VAR_15 = '! WARNING : '\n", "VAR_15 = '!! ERROR : '\n", "VAR_27 = datetime.now()\n", "VAR_42 = '**WARNING : **'\n", "VAR_42 = '__**ERROR : **__'\n", "VAR_28 = VA...
[ "def Log(user, message, logLevel):...\n", "if logLevel == 0:\n", "logLevel = 'INFO : '\n", "if logLevel == 1:\n", "discordLogLevel = 'INFO : '\n", "logLevel = '! WARNING : '\n", "logLevel = '!! ERROR : '\n", "i = datetime.now()\n", "discordLogLevel = '**WARNING : **'\n", "discordLogLevel = '__**ER...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_4(self, VAR_9):...\n", "if not users.is_current_user_admin():\n", "self.response.set_status(403)\n", "VAR_0[VAR_9](self).post()\n", "return\n" ]
[ "def post(self, command):...\n", "if not users.is_current_user_admin():\n", "self.response.set_status(403)\n", "commands[command](self).post()\n", "return\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Expr'", "Return'" ]
[ "@VAR_0.route('/')...\n", "" ]
[ "@app.route('/')...\n", "" ]
[ 0, 0 ]
[ "Condition", "Condition" ]
[ "def FUNC_6(self, VAR_14=None, VAR_15=False, VAR_16=False):...\n", "self.write('\\n')\n", "self.read_until(VAR_12=True)\n", "if VAR_15:\n", "self.write('export PS1=\"DrSEUs# \"\\n')\n", "self.command('mkdir ~/.ssh')\n", "self.read_until('export PS1=\"DrSEUs# \"')\n", "self.command('touch ~/.ssh/author...
[ "def do_login(self, ip_address=None, change_prompt=False, simics=False):...\n", "self.write('\\n')\n", "self.read_until(boot=True)\n", "if change_prompt:\n", "self.write('export PS1=\"DrSEUs# \"\\n')\n", "self.command('mkdir ~/.ssh')\n", "self.read_until('export PS1=\"DrSEUs# \"')\n", "self.command('t...
[ 0, 0, 0, 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'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Condition", "Assign'", "Expr'", "For", "Expr'", "For", "Condition", "Expr'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condi...
[ "def FUNC_6():...\n", "if not request.method in VAR_0:\n", "return True\n", "if not request.environ.get('AUTH_TYPE') == 'cookie':\n", "return True\n", "if config.get('skip_authentication'):\n", "return True\n", "if request.environ.get('HTTP_REFERER'):\n", "VAR_7 = urlparse(request.environ.get('HTTP_...
[ "def check():...\n", "if not request.method in methods:\n", "return True\n", "if not request.environ.get('AUTH_TYPE') == 'cookie':\n", "return True\n", "if config.get('skip_authentication'):\n", "return True\n", "if request.environ.get('HTTP_REFERER'):\n", "ref_url = urlparse(request.environ.get('HT...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 5, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Assign'", "Condition", "Assign'", "Return'", "Return'", "Condition", "AugAssign'", "Condition", "Condition", "Return'" ]
[ "def __init__(self, VAR_6, VAR_7=None, VAR_8=None, VAR_30=None, VAR_31=utils...\n", "if VAR_9:\n", "self.nsx_api_managers = VAR_9.nsx_api_managers or []\n", "self.nsx_api_managers = VAR_30 or []\n", "self.max_attempts = VAR_9.max_attempts\n", "self.max_attempts = VAR_31\n", "VAR_7 = VAR_7 or VAR_32\n", ...
[ "def __init__(self, connection, url_prefix=None, default_headers=None,...\n", "if client_obj:\n", "self.nsx_api_managers = client_obj.nsx_api_managers or []\n", "self.nsx_api_managers = nsx_api_managers or []\n", "self.max_attempts = client_obj.max_attempts\n", "self.max_attempts = max_attempts\n", "url...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "AugAssign'", "Assign'", "Expr'" ]
[ "def FUNC_11(self):...\n", "self.run_test_case(self.scenario.create_instances())\n" ]
[ "def test_b_create_server_group(self):...\n", "self.run_test_case(self.scenario.create_instances())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_7(VAR_7, VAR_12):...\n", "VAR_9 = FUNC_6(VAR_7, 'Main')\n", "VAR_9.cmd('send-keys', VAR_12, 'Enter')\n" ]
[ "def send_main_session_command(session, cmd):...\n", "window = find_window(session, 'Main')\n", "window.cmd('send-keys', cmd, 'Enter')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def __init__(self, *VAR_0, **VAR_1):...\n", "super().__init__(*VAR_0, **kwargs)\n" ]
[ "def __init__(self, *args, **kwargs):...\n", "super().__init__(*args, **kwargs)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_7(self, VAR_9, VAR_10):...\n", "VAR_19 = urllib2.Request(self.url + VAR_9, urllib.urlencode(VAR_10))\n", "VAR_20 = self._opener.open(VAR_19)\n", "return VAR_20.read()\n" ]
[ "def post(self, suburl, data):...\n", "request = urllib2.Request(self.url + suburl, urllib.urlencode(data))\n", "f = self._opener.open(request)\n", "return f.read()\n" ]
[ 0, 5, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_9(self, *VAR_15, **VAR_75):...\n", "" ]
[ "def newfn(self, *a, **env):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_34(VAR_8, VAR_11):...\n", "return sum(len(VAR_34) for c, VAR_34 in VAR_8.items() if c.check.name == VAR_11\n )\n" ]
[ "def num_deps(graph, cname):...\n", "return sum(len(deps) for c, deps in graph.items() if c.check.name == cname)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "VAR_35 = VAR_14.search_keyword(VAR_22, VAR_16=1000) if VAR_22 else select(g for\n g in VAR_14)\n", "if VAR_20:\n", "if VAR_20 == 'HEALTH':\n", "return VAR_35\n", "VAR_35 = VAR_35.sort_by('(g.health.seeders, g.health.leechers)'\n ) if VAR_21 else VAR...
[ "@classmethod...\n", "\"\"\"docstring\"\"\"\n", "pony_query = cls.search_keyword(query_filter, lim=1000\n ) if query_filter else select(g for g in cls)\n", "if sort_by:\n", "if sort_by == 'HEALTH':\n", "return pony_query\n", "pony_query = pony_query.sort_by('(g.health.seeders, g.health.leechers)'\n ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_2(VAR_1):...\n", "VAR_9 = getRankingsFromDatabase(VAR_1)\n", "VAR_10 = ''\n", "VAR_11 = 0\n", "for VAR_2, row in enumerate(VAR_9):\n", "if VAR_2 != 0:\n", "VAR_12 = createAndUploadPlots(VAR_9, VAR_1.id)\n", "if VAR_9[VAR_2][1] != VAR_9[VAR_2 - 1][1] or VAR_9[VAR_2][2] != VAR_9[VAR_2 - 1\n", ...
[ "def replyTrackedStats(submission):...\n", "table = getRankingsFromDatabase(submission)\n", "text = ''\n", "place = 0\n", "for index, row in enumerate(table):\n", "if index != 0:\n", "url = createAndUploadPlots(table, submission.id)\n", "if table[index][1] != table[index - 1][1] or table[index][2] != ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "For", "Condition", "Assign'", "Condition", "AugAssign'", "Assign'", "Assign'", "For", "Expr'", "Condition", "AugAssign'", "AugAssign'", "AugAssign'" ]
[ "def FUNC_25(self, VAR_73):...\n", "def FUNC_39(VAR_101):...\n", "VAR_101.message = VAR_73\n", "return VAR_101\n" ]
[ "def message(self, message):...\n", "def decorate(ruleinfo):...\n", "ruleinfo.message = message\n", "return ruleinfo\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_12(self):...\n", "VAR_21 = []\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', lambda *VAR_24: VAR_21.append(VAR_24))\n", "self.e...
[ "def test_poll_server_restart(self):...\n", "restart = []\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', lambda *args: restart.append(args))\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "@pytest.mark.skip(reason='Rhyming not implemented yet')...\n", "FUNC_2(VAR_2)\n", "FUNC_3(VAR_2, 'GAYLEDESIGNS INC.', VAR_7='1')\n", "FUNC_3(VAR_2, 'GOLDSTREAM ELECTRICAL CORP', VAR_7='2')\n", "FUNC_3(VAR_2, 'GLADSTONE JEWELLERY LTD', VAR_7='3')\n", "FUNC_3(VAR_2, 'GOLDSTEIN HOLDINGS INC.', VAR_7='4')\n"...
[ "@pytest.mark.skip(reason='Rhyming not implemented yet')...\n", "clean_database(solr)\n", "seed_database_with(solr, 'GAYLEDESIGNS INC.', id='1')\n", "seed_database_with(solr, 'GOLDSTREAM ELECTRICAL CORP', id='2')\n", "seed_database_with(solr, 'GLADSTONE JEWELLERY LTD', id='3')\n", "seed_database_with(solr...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_0(VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "if isinstance(VAR_0, collections.Mapping):\n", "return VAR_0\n", "if hasattr(VAR_0, 'read') and callable(VAR_0.read):\n", "VAR_13 = VAR_0.read()\n", "if os.path.exists(os.path.expanduser(str(VAR_0))):\n", "return json.loads(VAR_13)\n", "return y...
[ "def load_source(source):...\n", "\"\"\"docstring\"\"\"\n", "if isinstance(source, collections.Mapping):\n", "return source\n", "if hasattr(source, 'read') and callable(source.read):\n", "raw_source = source.read()\n", "if os.path.exists(os.path.expanduser(str(source))):\n", "return json.loads(raw_sou...
[ 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Assign'", "Condition", "Return'", "Return'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "VAR_5 = self.config.get(self.section, 'verify_request_signatures')\n", "return bool(int(VAR_5))\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "res = self.config.get(self.section, 'verify_request_signatures')\n", "return bool(int(res))\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_21(VAR_12, VAR_13):...\n", "for VAR_7 in VAR_2.providers:\n", "if VAR_7.id == VAR_12 and VAR_7.url == VAR_13:\n", "self.fail('Provider: %s not found' % VAR_12)\n", "return\n" ]
[ "def _assert_provider(pid, purl):...\n", "for provider in cluster_api.providers:\n", "if provider.id == pid and provider.url == purl:\n", "self.fail('Provider: %s not found' % pid)\n", "return\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Condition", "Expr'", "Return'" ]
[ "def FUNC_0(self, VAR_1, VAR_6, VAR_7, VAR_3):...\n", "Attribute.make_input(self, VAR_1, VAR_6, '%g' % VAR_7, VAR_3)\n" ]
[ "def make_input(self, version, name, value, attribute):...\n", "Attribute.make_input(self, version, name, '%g' % value, attribute)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "\"\"\"string\"\"\"\n", "import time\n", "import unittest\n", "import psycopg2\n", "import tournament\n", "import tools\n", "def FUNC_0():...\n", "return psycopg2.connect(database='tournament', user='postgres')\n" ]
[ "\"\"\" The master Unit test set up. Each set of tests below should cover all\nfunctional aspects of tournament.py. The original file tournament_test.py has\nbeen rolled in here and its tests exist below. Most tests below are YAY/NAY\nin that we're expecitng very specific results. In most cases, each function\nin t...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "Import'", "FunctionDef'", "Return'" ]
[ "def FUNC_1():...\n", "VAR_1 = [{'fieldname': 'territory', 'fieldtype': 'Link', 'label': _(\n 'Territory'), 'options': 'Territory', 'width': 100}, {'fieldname':\n 'item_group', 'fieldtype': 'Link', 'label': _('Item Group'), 'options':\n 'Item Group', 'width': 150}, {'fieldname': 'item_name', 'fieldtype':...
[ "def get_columns():...\n", "columns = [{'fieldname': 'territory', 'fieldtype': 'Link', 'label': _(\n 'Territory'), 'options': 'Territory', 'width': 100}, {'fieldname':\n 'item_group', 'fieldtype': 'Link', 'label': _('Item Group'), 'options':\n 'Item Group', 'width': 150}, {'fieldname': 'item_name', 'fiel...
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_6(self):...\n", "VAR_21 = ', '.join(self.column_selects)\n", "return 'COALESCE({0}) AS {1}'.format(VAR_21, self.name)\n" ]
[ "def select(self):...\n", "fields = ', '.join(self.column_selects)\n", "return 'COALESCE({0}) AS {1}'.format(fields, self.name)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_1(self, VAR_5):...\n", "VAR_7 = False\n", "VAR_8 = str(VAR_5.event_type_id.name).lower()\n", "VAR_9 = datetime.strptime(VAR_5.date_begin, '%Y-%m-%d %H:%M:%S')\n", "if VAR_8 == 'open' and len(self.fit_subscriptions) > 0:\n", "VAR_0.info('Can subscribe for open event id: %s, name: %s', VAR_5.\n ...
[ "def can_subscribe(self, event):...\n", "can_subscribe = False\n", "event_type = str(event.event_type_id.name).lower()\n", "event_start = datetime.strptime(event.date_begin, '%Y-%m-%d %H:%M:%S')\n", "if event_type == 'open' and len(self.fit_subscriptions) > 0:\n", "_logger.info('Can subscribe for open eve...
[ 0, 0, 0, 0, 6, 6, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Return'", "Return'", "Condition", "Return'", "For", "Condition", "Return'", "Expr'", "Assign'" ]
[ "def FUNC_9(VAR_6):...\n", "VAR_12 = f\"\"\"\n SELECT id from {VAR_3}\n WHERE user_id={VAR_6}\n ORDER BY transaction_date DESC\n LIMIT 1\n \"\"\"\n", "VAR_14 = create_connection()\n", "VAR_14.close()\n", "VAR_15 = VAR_14.cursor()\n", "VAR_15.execute(V...
[ "def get_invoice_id(userId):...\n", "sql_query = f\"\"\"\n SELECT id from {INVOICES_TABLE}\n WHERE user_id={userId}\n ORDER BY transaction_date DESC\n LIMIT 1\n \"\"\"\n", "connection = create_connection()\n", "connection.close()\n", "cursor = connectio...
[ 0, 4, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "@classmethod...\n", "return ()\n" ]
[ "@classmethod...\n", "return ()\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def __init__(self, *VAR_2, **VAR_3):...\n", "super(CLASS_0, self).__init__(*VAR_2, **kwargs)\n", "self.common = None\n", "self.configuration.append_config_values(hpcommon.hp3par_opts)\n", "self.configuration.append_config_values(san.san_opts)\n" ]
[ "def __init__(self, *args, **kwargs):...\n", "super(HP3PARFCDriver, self).__init__(*args, **kwargs)\n", "self.common = None\n", "self.configuration.append_config_values(hpcommon.hp3par_opts)\n", "self.configuration.append_config_values(san.san_opts)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "@property...\n", "return self._input\n" ]
[ "@property...\n", "return self._input\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "\"\"\"\nImplementation of a help command.\n\"\"\"\n", "import asyncio\n", "import inspect\n", "import random\n", "import discord\n", "import neko\n", "__all__ = ['HelpCog', 'ActivityChangerCog', 'setup']\n", "VAR_0 = 2003199\n", "\"\"\"Provides the inner methods with access to bot directly.\"\"\"\n...
[ "\"\"\"\nImplementation of a help command.\n\"\"\"\n", "import asyncio\n", "import inspect\n", "import random\n", "import discord\n", "import neko\n", "__all__ = ['HelpCog', 'ActivityChangerCog', 'setup']\n", "default_color = 2003199\n", "\"\"\"Provides the inner methods with access to bot directly....
[ 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, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "Import'", "Assign'", "Assign'", "Expr'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Condition", "Docstring", "Assign'", "Assign'", "AugAssign'", "Assign'", "Assign'", "Assign'", "For", "AugAssign'", "Assign'...
[ "\"\"\"Set of functions for tasks to freeze the data within a GSoCProgram.\n\"\"\"\n", "__authors__ = ['\"Daniel Hans\" <daniel.m.hans@gmail.com>',\n '\"Lennard de Rijk\" <ljvderijk@gmail.com>']\n", "import pickle\n", "from google.appengine.ext import db\n", "from soc.tasks import responses\n", "from s...
[ "\"\"\"Set of functions for tasks to freeze the data within a GSoCProgram.\n\"\"\"\n", "__authors__ = ['\"Daniel Hans\" <daniel.m.hans@gmail.com>',\n '\"Lennard de Rijk\" <ljvderijk@gmail.com>']\n", "import pickle\n", "from google.appengine.ext import db\n", "from soc.tasks import responses\n", "from s...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Assign'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_0(VAR_0):...\n", "from os import path\n", "if not path.exists('./data/ed.db'):\n", "from to_sqlalchemy import update\n", "VAR_0.add_cog(CLASS_0(VAR_0))\n", "FUNC_8()\n" ]
[ "def setup(bot):...\n", "from os import path\n", "if not path.exists('./data/ed.db'):\n", "from to_sqlalchemy import update\n", "bot.add_cog(EDDB(bot))\n", "update()\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "ImportFrom'", "Condition", "ImportFrom'", "Expr'", "Expr'" ]
[ "def FUNC_15(self, VAR_18, VAR_19, VAR_20):...\n", "\"\"\"docstring\"\"\"\n", "VAR_49 = VAR_19.sub_names_idx[VAR_18.file_name]\n", "for VAR_65 in VAR_18.sub_items:\n", "VAR_65.parent = VAR_18\n", "VAR_18.uuid = FUNC_1(None, self.fs_uuid_idx)\n", "VAR_18.sub_names_idx[VAR_65.file_name] = VAR_65\n", "se...
[ "def _copy_recursive(self, item, target_par, new_owner):...\n", "\"\"\"docstring\"\"\"\n", "target_node = target_par.sub_names_idx[item.file_name]\n", "for i_sub in item.sub_items:\n", "i_sub.parent = item\n", "item.uuid = get_new_uuid(None, self.fs_uuid_idx)\n", "item.sub_names_idx[i_sub.file_name] = i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_6(self):...\n", "VAR_12 = Client()\n", "self.response = VAR_12.get('{}?{}'.format(reverse('login-redirect'),\n 'token=ABXZ'))\n", "return self\n" ]
[ "def when_call_login_email_redirect(self):...\n", "client = Client()\n", "self.response = client.get('{}?{}'.format(reverse('login-redirect'),\n 'token=ABXZ'))\n", "return self\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_10(self):...\n", "VAR_19 = []\n", "VAR_18 = threading.Event()\n", "self.mock(VAR_18, 'wait', self.fail)\n", "self.mock(bot_main, 'run_manifest', lambda *VAR_24: VAR_19.append(VAR_24))\n", "self.mock(bot_main, 'update_bot', self.fail)\n", "self.expected_requests([(\n 'https://localhost:1/aut...
[ "def test_poll_server_run(self):...\n", "manifest = []\n", "bit = threading.Event()\n", "self.mock(bit, 'wait', self.fail)\n", "self.mock(bot_main, 'run_manifest', lambda *args: manifest.append(args))\n", "self.mock(bot_main, 'update_bot', self.fail)\n", "self.expected_requests([(\n 'https://localhos...
[ 0, 0, 0, 0, 0, 0, 5, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "@VAR_0.route('/register', methods=['GET', 'POST'])...\n", "VAR_46 = CLASS_0(request.form)\n", "if request.method == 'POST' and VAR_46.validate():\n", "VAR_41 = VAR_46.name.data\n", "return render_template('register.html', VAR_46=form)\n", "VAR_43 = VAR_46.email.data\n", "VAR_42 = VAR_46.username.data\n...
[ "@app.route('/register', methods=['GET', 'POST'])...\n", "form = RegisterForm(request.form)\n", "if request.method == 'POST' and form.validate():\n", "name = form.name.data\n", "return render_template('register.html', form=form)\n", "email = form.email.data\n", "username = form.username.data\n", "pass...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_3(VAR_2):...\n", "VAR_13 = VAR_2[5:25]\n", "return datetime.datetime.strptime(VAR_13, '%d %b %Y %H:%M:%S')\n" ]
[ "def get_datetime(date):...\n", "sliced_date = date[5:25]\n", "return datetime.datetime.strptime(sliced_date, '%d %b %Y %H:%M:%S')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "@VAR_0.route('/video/<filename>')...\n", "if 'username' in VAR_19:\n", "return render_template('video_viewing_screen.html', video_name=filename)\n", "return redirect(url_for('index'))\n" ]
[ "@app.route('/video/<filename>')...\n", "if 'username' in session:\n", "return render_template('video_viewing_screen.html', video_name=filename)\n", "return redirect(url_for('index'))\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Return'" ]
[ "\"\"\"string\"\"\"\n", "import mimetypes\n", "import os\n", "import posixpath\n", "import re\n", "import stat\n", "from django.http import FileResponse, Http404, HttpResponse, HttpResponseNotModified, HttpResponseRedirect\n", "from django.template import Context, Engine, TemplateDoesNotExist, loader\...
[ "\"\"\"\nViews and functions for serving static files. These are only to be used\nduring development, and SHOULD NOT be used in a production setting.\n\"\"\"\n", "import mimetypes\n", "import os\n", "import posixpath\n", "import re\n", "import stat\n", "from django.http import FileResponse, Http404, Htt...
[ 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 6, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "For", "Condition", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Conditio...
[ "def FUNC_3(self, VAR_6):...\n", "self.common = self._init_common()\n", "self._check_flags()\n", "self.iscsi_ips = {}\n", "VAR_21 = {}\n", "if len(self.configuration.hp3par_iscsi_ips) > 0:\n", "for VAR_42 in self.configuration.hp3par_iscsi_ips:\n", "if self.configuration.iscsi_ip_address not in VAR_21...
[ "def do_setup(self, context):...\n", "self.common = self._init_common()\n", "self._check_flags()\n", "self.iscsi_ips = {}\n", "temp_iscsi_ip = {}\n", "if len(self.configuration.hp3par_iscsi_ips) > 0:\n", "for ip_addr in self.configuration.hp3par_iscsi_ips:\n", "if self.configuration.iscsi_ip_address n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "For", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "For", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Expr'",...
[ "def FUNC_4(VAR_3, VAR_4=True):...\n", "if VAR_4:\n", "VAR_1 = 1\n", "print(CLASS_0.MAYBE_FAIL + '?', VAR_3, CLASS_0.END)\n", "print(CLASS_0.FAIL + '✘', VAR_3, CLASS_0.END)\n" ]
[ "def print_error(str, reliable=True):...\n", "if reliable:\n", "return_code = 1\n", "print(c.MAYBE_FAIL + '?', str, c.END)\n", "print(c.FAIL + '✘', str, c.END)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_11(self):...\n", "for string in self.test_strings:\n", "self.assertEqual(prepare_string_argument(string, 'WeIrD_O/S'), string)\n" ]
[ "def test_prepare_string_argument_unsupported(self):...\n", "for string in self.test_strings:\n", "self.assertEqual(prepare_string_argument(string, 'WeIrD_O/S'), string)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'" ]
[ "def FUNC_5(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "VAR_1 = {'name': self.volume_name, 'size': 1}\n", "self.driver._eql_execute('volume', 'select', VAR_1['name'], 'show')\n", "self.mox.ReplayAll()\n", "self.driver.ensure_export({}, VAR_1)\n" ]
[ "def test_ensure_export(self):...\n", "self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n", "volume = {'name': self.volume_name, 'size': 1}\n", "self.driver._eql_execute('volume', 'select', volume['name'], 'show')\n", "self.mox.ReplayAll()\n", "self.driver.ensure_export({}, volume)...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_29(VAR_34):...\n", "self.assertEqual(logging.WARNING, VAR_34)\n" ]
[ "def check(x):...\n", "self.assertEqual(logging.WARNING, x)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def __unicode__(self):...\n", "return unicode(self.nickname())\n" ]
[ "def __unicode__(self):...\n", "return unicode(self.nickname())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_9(VAR_2, VAR_17):...\n", "VAR_2.cursor.execute('string' % (' AND %s' % VAR_17 if VAR_17 else ''))\n", "VAR_22 = VAR_2.cursor.fetchall()\n", "VAR_23 = []\n", "for VAR_27 in VAR_22:\n", "VAR_16, VAR_5, VAR_6, VAR_35, VAR_8, VAR_36, VAR_37, VAR_38, VAR_39 = VAR_27\n", "return VAR_23\n", "VAR_23...
[ "def get_full_sql(db, filter):...\n", "db.cursor.execute(\n \"\"\"SELECT\n submission.id,\n submission.sheet_id,\n submission.student_id,\n submission.time,\n submission.files_path,\n ...
[ 0, 4, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Expr'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.obj.__name__\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.obj.__name__\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def __init__(self, VAR_32):...\n", "super(CLASS_1, self).__init__()\n", "self.signal = VAR_32\n" ]
[ "def __init__(self, sig):...\n", "super(MustExit, self).__init__()\n", "self.signal = sig\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'" ]
[ "def FUNC_7():...\n", "VAR_9 = AnsibleModule(argument_spec=dict(login_user=dict(default='postgres'\n ), login_password=dict(default='', no_log=True), login_host=dict(\n default=''), login_unix_socket=dict(default=''), port=dict(default=\n '5432'), option=dict(required=True, aliases=['name', 'setting', 'g...
[ "def main():...\n", "module = AnsibleModule(argument_spec=dict(login_user=dict(default=\n 'postgres'), login_password=dict(default='', no_log=True), login_host=\n dict(default=''), login_unix_socket=dict(default=''), port=dict(default\n ='5432'), option=dict(required=True, aliases=['name', 'setting', 'gu...
[ 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4, 0, 4, 4, 4, 4, 0, 4, 4, 0, 4, 4, 4, 0, 4, 0, 4, 4, 4, 0, 4, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Expr'", "Expr'",...
[ "def __init__(self, VAR_6, VAR_7=None):...\n", "super().__init__(VAR_6, VAR_7)\n", "self.type = 'ip6'\n" ]
[ "def __init__(self, name, display_name=None):...\n", "super().__init__(name, display_name)\n", "self.type = 'ip6'\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'" ]
[ "def FUNC_0(*VAR_0, **VAR_1):...\n", "VAR_2 = requests.Response()\n", "VAR_2.status_code = 200\n", "VAR_2._content_consumed = True\n", "return VAR_2\n" ]
[ "def mock_import_repository_task(*args, **kwargs):...\n", "resp = requests.Response()\n", "resp.status_code = 200\n", "resp._content_consumed = True\n", "return resp\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "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 __str__(self):...\n", "return ' '.join(map(str, self))\n" ]
[ "def __str__(self):...\n", "return ' '.join(map(str, self))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_6(self):...\n", "if VAR_101.user_is_loggedin and VAR_101.user.safe_karma >= g.discussion_karma_to_post:\n", "return True\n", "abort(403, 'forbidden')\n" ]
[ "def run(self):...\n", "if c.user_is_loggedin and c.user.safe_karma >= g.discussion_karma_to_post:\n", "return True\n", "abort(403, 'forbidden')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Expr'" ]
[ "def FUNC_8(VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = block.sysfs_to_devpath(VAR_1)\n", "LOG.debug('using mdadm.mdadm_stop on dev: %s', VAR_11)\n", "mdadm.mdadm_stop(VAR_11)\n", "for wait in VAR_0:\n", "LOG.critical('Failed to stop mdadm device %s', VAR_1)\n", "if mdadm.md_present(block.path...
[ "def shutdown_mdadm(device):...\n", "\"\"\"docstring\"\"\"\n", "blockdev = block.sysfs_to_devpath(device)\n", "LOG.debug('using mdadm.mdadm_stop on dev: %s', blockdev)\n", "mdadm.mdadm_stop(blockdev)\n", "for wait in MDADM_RELEASE_RETRIES:\n", "LOG.critical('Failed to stop mdadm device %s', device)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "For", "Expr'", "Condition", "Condition", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_0():...\n", "VAR_1 = config('cuckoo:cuckoo:machinery')\n", "if config('routing:vpn:enabled'):\n", "VAR_4 = config('routing:vpn:vpns')\n", "VAR_4 = []\n", "return {'machine': config('%s:%s:machines' % (VAR_1, VAR_1)), 'package':\n None, 'priority': 2, 'timeout': config('cuckoo:timeouts:default...
[ "def defaults():...\n", "machinery = config('cuckoo:cuckoo:machinery')\n", "if config('routing:vpn:enabled'):\n", "vpns = config('routing:vpn:vpns')\n", "vpns = []\n", "return {'machine': config('%s:%s:machines' % (machinery, machinery)),\n 'package': None, 'priority': 2, 'timeout': config(\n 'cucko...
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_8(self):...\n", "if not exists(self.directory):\n", "self.checkout()\n", "if not exists(self.directory + '/.svn'):\n", "FUNC_1(self.directory, 'Subversion')\n", "if self.has_local_edit():\n", "VAR_0.warning(\"Directory '%s' contains local modifications\" % self.directory)\n", "VAR_77, VAR_78...
[ "def update(self):...\n", "if not exists(self.directory):\n", "self.checkout()\n", "if not exists(self.directory + '/.svn'):\n", "not_a_project(self.directory, 'Subversion')\n", "if self.has_local_edit():\n", "logger.warning(\"Directory '%s' contains local modifications\" % self.directory)\n", "target...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_5(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = '/api/apps'\n", "VAR_5 = self.client.post(VAR_4)\n", "self.assertEqual(VAR_5.status_code, 201)\n", "VAR_6 = VAR_5.data['id']\n", "VAR_14 = {'username': 'autotest', 'app': VAR_6}\n", "VAR_4 = '/api/hooks/builds'.format(**locals())\n", "VAR...
[ "def test_build_hook_procfile(self):...\n", "\"\"\"docstring\"\"\"\n", "url = '/api/apps'\n", "response = self.client.post(url)\n", "self.assertEqual(response.status_code, 201)\n", "app_id = response.data['id']\n", "build = {'username': 'autotest', 'app': app_id}\n", "url = '/api/hooks/builds'.format(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Exp...
[ "@api.public...\n", "VAR_6.assertEqual(model.Anonymous, api.get_current_identity())\n", "self.response.write('OK')\n" ]
[ "@api.public...\n", "test.assertEqual(model.Anonymous, api.get_current_identity())\n", "self.response.write('OK')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'" ]
[ "def FUNC_10(self):...\n", "VAR_4 = '/api/apps'\n", "VAR_5 = self.client.post(VAR_4)\n", "self.assertEqual(VAR_5.status_code, 201)\n", "VAR_6 = VAR_5.data['id']\n", "VAR_4 = '/api/apps/{app_id}/containers'.format(**locals())\n", "VAR_5 = self.client.get(VAR_4)\n", "self.assertEqual(VAR_5.status_code, ...
[ "def test_container_scale_errors(self):...\n", "url = '/api/apps'\n", "response = self.client.post(url)\n", "self.assertEqual(response.status_code, 201)\n", "app_id = response.data['id']\n", "url = '/api/apps/{app_id}/containers'.format(**locals())\n", "response = self.client.get(url)\n", "self.assert...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", ...
[ "def FUNC_1(self, VAR_1):...\n", "return self.properties\n" ]
[ "def _fake_get_iscsi_properties(self, volume):...\n", "return self.properties\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_13(self):...\n", "self.run_test_case(self.scenario.delete_load_balancer(), max_retries=5)\n" ]
[ "def test_y_delete_load_balancer(self):...\n", "self.run_test_case(self.scenario.delete_load_balancer(), max_retries=5)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_17(self):...\n", "VAR_7 = [('x', 'y'), (1, 2)]\n", "VAR_8 = [('key', 'filename', 'file data')]\n", "VAR_9, VAR_10 = url_helper.EncodeMultipartFormData()\n", "self.assertTrue(VAR_9.startswith('multipart/form-data; boundary='))\n", "self.assertEqual('', VAR_10)\n", "VAR_9, VAR_10 = url_helper.En...
[ "def testEncodeMultipartFormData(self):...\n", "fields = [('x', 'y'), (1, 2)]\n", "files = [('key', 'filename', 'file data')]\n", "content_type, body = url_helper.EncodeMultipartFormData()\n", "self.assertTrue(content_type.startswith('multipart/form-data; boundary='))\n", "self.assertEqual('', body)\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'" ]