lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "def FUNC_3(self):...\n", "if self.telnet:\n", "self.telnet.write(bytes('quit\\r', encoding='utf-8'))\n", "super().close()\n" ]
[ "def close(self):...\n", "if self.telnet:\n", "self.telnet.write(bytes('quit\\r', encoding='utf-8'))\n", "super().close()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Expr'" ]
[ "@tornado.gen.coroutine...\n", "VAR_17 = 'SELECT {} FROM districts WHERE name = %s'.format(VAR_6)\n", "VAR_18 = VAR_8,\n", "VAR_19 = yield VAR_1.execute(query=sql, VAR_18=params)\n", "return VAR_19.fetchone()\n" ]
[ "@tornado.gen.coroutine...\n", "sql = 'SELECT {} FROM districts WHERE name = %s'.format(cols)\n", "params = name,\n", "cursor = yield tx.execute(query=sql, params=params)\n", "return cursor.fetchone()\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2(VAR_8, VAR_9):...\n", "if VAR_8 == VAR_1 - 1:\n", "VAR_15 = [frozenset((VAR_9[i], VAR_9[i + 1])) for i in range(len(VAR_9) - 1)]\n", "for node in VAR_3[VAR_8]:\n", "VAR_13 = sum(VAR_4[edge] for edge in VAR_15)\n", "if node not in VAR_9:\n", "if VAR_13 < VAR_6:\n", "VAR_9.append(node)\n", ...
[ "def dfs_recur(current_node, path):...\n", "if current_node == num_points - 1:\n", "edges = [frozenset((path[i], path[i + 1])) for i in range(len(path) - 1)]\n", "for node in adj_lst[current_node]:\n", "length = sum(trail_len[edge] for edge in edges)\n", "if node not in path:\n", "if length < shortest_p...
[ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "For", "Assign'", "Condition", "Condition", "Expr'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_4(self, VAR_10, VAR_12, VAR_13):...\n", "if VAR_10.get_visibility():\n", "VAR_10.set_invisible_char('●')\n", "VAR_10.set_visibility(True)\n", "VAR_10.set_visibility(False)\n" ]
[ "def on_password_unlock_entry_secondary_clicked(self, widget, position,...\n", "if widget.get_visibility():\n", "widget.set_invisible_char('●')\n", "widget.set_visibility(True)\n", "widget.set_visibility(False)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_28(self, VAR_15):...\n", "" ]
[ "def edit(self, item):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_15(self):...\n", "for VAR_7 in default_fields:\n", "if VAR_7 not in self.__dict__:\n", "for VAR_7 in self.get_valid_columns():\n", "self.__dict__[VAR_7] = None\n", "if VAR_7 in ('idx', 'docstatus') and self.__dict__[VAR_7] is None:\n", "if VAR_7 not in self.__dict__:\n", "self.__dict__[VAR_7...
[ "def init_valid_columns(self):...\n", "for key in default_fields:\n", "if key not in self.__dict__:\n", "for key in self.get_valid_columns():\n", "self.__dict__[key] = None\n", "if key in ('idx', 'docstatus') and self.__dict__[key] is None:\n", "if key not in self.__dict__:\n", "self.__dict__[key] = 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Condition", "For", "Assign'", "Condition", "Condition", "Assign'", "Assign'" ]
[ "@FUNC_3...\n", "\"\"\"docstring\"\"\"\n", "VAR_27 = []\n", "def FUNC_15(VAR_38):...\n", "\"\"\"docstring\"\"\"\n", "if not VAR_38:\n", "return None\n", "if isinstance(VAR_38, basestring):\n", "for d in self.doc_types:\n", "if not any(d['name'] == VAR_38['name'] for d in VAR_27):\n", "if d['name...
[ "@redirect_ui_on_replica...\n", "\"\"\"docstring\"\"\"\n", "doc_types = []\n", "def add_doc_type(tp):...\n", "\"\"\"docstring\"\"\"\n", "if not tp:\n", "return None\n", "if isinstance(tp, basestring):\n", "for d in self.doc_types:\n", "if not any(d['name'] == tp['name'] for d in doc_types):\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "For", "For", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_11(self, VAR_14):...\n", "\"\"\"docstring\"\"\"\n", "if type(VAR_14) != type(u''):\n", "VAR_14 = VAR_14.decode('utf8')\n", "VAR_14 = VAR_14[:self._mlen]\n", "VAR_26 = 'string' % {'input_phrase': VAR_14}\n", "VAR_35 = self.db.execute(VAR_26).fetchall()\n", "VAR_36 = self.hunspell_obj.suggest(...
[ "def select_words(self, input_phrase):...\n", "\"\"\"docstring\"\"\"\n", "if type(input_phrase) != type(u''):\n", "input_phrase = input_phrase.decode('utf8')\n", "input_phrase = input_phrase[:self._mlen]\n", "sqlstr = (\n \"\"\"SELECT * FROM user_db.phrases WHERE phrase LIKE \"%(input_phrase)s%%\"\n ...
[ 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_23(self, VAR_14):...\n", "" ]
[ "def is_unique(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return import_from_settings('LOGOUT_REDIRECT_URL', '/')\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return import_from_settings('LOGOUT_REDIRECT_URL', '/')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def __init__(self, VAR_1, VAR_2, VAR_3, VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "super(CLASS_2, self).__init__(VAR_1, VAR_2)\n", "self.hostname = VAR_3\n", "self.host_status = VAR_4\n" ]
[ "def __init__(self, pid, comp_name, hostname, host_status):...\n", "\"\"\"docstring\"\"\"\n", "super(RemoteComponentMonitoringJob, self).__init__(pid, comp_name)\n", "self.hostname = hostname\n", "self.host_status = host_status\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'" ]
[ "def FUNC_9(self, VAR_20, VAR_23):...\n", "VAR_58 = super(CLASS_2.MockHTTPProvider, self).new_connection(VAR_20, VAR_23)\n", "VAR_59 = mock.Mock()\n", "VAR_60 = VAR_58.send\n", "def FUNC_21(VAR_49, **VAR_18):...\n", "VAR_63 = mock.Mock()\n", "VAR_63.history = None\n", "VAR_63.headers = {'location': ''...
[ "def new_connection(self, cluster_api, provider):...\n", "session = super(NsxClientTestCase.MockHTTPProvider, self).new_connection(\n cluster_api, provider)\n", "mock_adapter = mock.Mock()\n", "session_send = session.send\n", "def _adapter_send(request, **kwargs):...\n", "mock_response = mock.Mock()\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_24(self):...\n", "return self.authenticated\n" ]
[ "def is_authenticated(self):...\n", "return self.authenticated\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_7(self, VAR_11):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def create_snapshot(self, snapshot):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "def FUNC_40(self, VAR_35):...\n", "\"\"\"docstring\"\"\"\n", "for VAR_40, (i, j) in VAR_35:\n", "self.set_name(VAR_40, i, VAR_42=j)\n" ]
[ "def take_names(self, names):...\n", "\"\"\"docstring\"\"\"\n", "for name, (i, j) in names:\n", "self.set_name(name, i, end=j)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "Expr'" ]
[ "\"\"\"Handlers for customizing oauthclient endpoints.\"\"\"\n", "import six\n", "from flask import current_app, flash, redirect, render_template, request, session, url_for\n", "from flask.ext.login import current_user\n", "from functools import partial, wraps\n", "from werkzeug.utils import import_string...
[ "\"\"\"Handlers for customizing oauthclient endpoints.\"\"\"\n", "import six\n", "from flask import current_app, flash, redirect, render_template, request, session, url_for\n", "from flask.ext.login import current_user\n", "from functools import partial, wraps\n", "from werkzeug.utils import import_string...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_4(self):...\n", "return dbi\n" ]
[ "def dbapiModule(self):...\n", "return dbi\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_4(self, VAR_9):...\n", "" ]
[ "def _prepare_error_msg(self, msg):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_1(VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_4(**VAR_4):...\n", "return VAR_5()\n" ]
[ "def create_on_missing(factory):...\n", "\"\"\"docstring\"\"\"\n", "def on_missing(**kwargs):...\n", "return factory()\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Return'" ]
[ "@VAR_0.route('/ping')...\n", "return 'pong'\n" ]
[ "@locations.route('/ping')...\n", "return 'pong'\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_14(self, VAR_22=4567, VAR_23='127.0.0.1'):...\n", "reactor.listenTCP(VAR_22, PixelatedSite(self.resource), interface=host)\n" ]
[ "def listenTCP(self, port=4567, host='127.0.0.1'):...\n", "reactor.listenTCP(port, PixelatedSite(self.resource), interface=host)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_3():...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = environ.paths.package()\n", "VAR_12 = environ.paths.resources()\n", "VAR_13 = list(traceback.extract_tb(sys.exc_info()[-1])).copy()\n", "def FUNC_7(VAR_14: str) ->bool:...\n", "if not VAR_14 or not VAR_14.startswith(VAR_11):\n", "return False\...
[ "def get_stack_frames():...\n", "\"\"\"docstring\"\"\"\n", "cauldron_path = environ.paths.package()\n", "resources_path = environ.paths.resources()\n", "frames = list(traceback.extract_tb(sys.exc_info()[-1])).copy()\n", "def is_cauldron_code(test_filename: str) ->bool:...\n", "if not test_filename or no...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "def FUNC_8(self, VAR_7, VAR_9, VAR_10=False):...\n", "if isinstance(VAR_9, list) and not VAR_10:\n", "self.__dict__[VAR_7] = []\n", "self.__dict__[VAR_7] = VAR_9\n", "self.extend(VAR_7, VAR_9)\n" ]
[ "def set(self, key, value, as_value=False):...\n", "if isinstance(value, list) and not as_value:\n", "self.__dict__[key] = []\n", "self.__dict__[key] = value\n", "self.extend(key, value)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_5(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_22 = list(filter(lambda VAR_26: not VAR_26.qualified_name.startswith(\n 'sudo'), self.bot.walk_commands()))\n", "VAR_23 = random.choice(VAR_22)\n", "return self.bot.change_presence(game=discord.Game(name=\n f'for {self.bot.command_prefix}{comma...
[ "def next_activity(self):...\n", "\"\"\"docstring\"\"\"\n", "command_choice = list(filter(lambda c: not c.qualified_name.startswith(\n 'sudo'), self.bot.walk_commands()))\n", "command = random.choice(command_choice)\n", "return self.bot.change_presence(game=discord.Game(name=\n f'for {self.bot.command...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_4(self, VAR_5='/'):...\n", "VAR_6 = os.path.join(self.namespace, VAR_5)\n", "if VAR_6 != '/':\n", "VAR_6 = VAR_6.rstrip('/')\n", "VAR_7 = self.etcd.read(VAR_6, recursive=True)\n", "return None\n", "VAR_3 = FUNC_2()\n", "for entry in VAR_7.get_subtree():\n", "if entry.key == VAR_6:\n", "r...
[ "def list(self, keyfilter='/'):...\n", "path = os.path.join(self.namespace, keyfilter)\n", "if path != '/':\n", "path = path.rstrip('/')\n", "result = self.etcd.read(path, recursive=True)\n", "return None\n", "value = set()\n", "for entry in result.get_subtree():\n", "if entry.key == path:\n", "re...
[ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Return'", "Assign'", "For", "Condition", "Return'", "Assign'", "Condition", "AugAssign'", "Expr'" ]
[ "def FUNC_6(self):...\n", "\"\"\"docstring\"\"\"\n", "tools.connect()\n" ]
[ "def test_connect_to_database(self):...\n", "\"\"\"docstring\"\"\"\n", "tools.connect()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'" ]
[ "def FUNC_1(self, **VAR_3):...\n", "VAR_13 = super().get_context_data(**kwargs)\n", "VAR_13['is_mobile'] = FUNC_0(self.request.META['HTTP_USER_AGENT'])\n", "return VAR_13\n" ]
[ "def get_context_data(self, **kwargs):...\n", "context = super().get_context_data(**kwargs)\n", "context['is_mobile'] = is_mobile(self.request.META['HTTP_USER_AGENT'])\n", "return context\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_10(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_25 = VAR_18.pop('oidc_csrf_token')\n", "VAR_0.debug(\"Can't retrieve CSRF token, state, or code\", exc_info=True)\n", "if VAR_17 != VAR_25:\n", "VAR_19 = json.loads(request.args['state'])\n", "return self.oidc_error()\n", "VAR_0.debug('CSRF to...
[ "def oidc_callback(self):...\n", "\"\"\"docstring\"\"\"\n", "session_csrf_token = session.pop('oidc_csrf_token')\n", "logger.debug(\"Can't retrieve CSRF token, state, or code\", exc_info=True)\n", "if csrf_token != session_csrf_token:\n", "state = json.loads(request.args['state'])\n", "return self.oidc_...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Condition", "Assign'", "Return'", "Expr'", "Assign'", "Assign'", "Return'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Condition", "Assign'", "Return'", "Return'", "Expr'", "Return'" ]
[ "def FUNC_45(self):...\n", "def FUNC_57():...\n", "self.cursor.execute('create table t1 (word varchar (100))')\n", "VAR_38 = set(['a'])\n", "self.cursor.execute('insert into t1 (word) VALUES (?)', [VAR_38])\n", "self.assertRaises(pyodbc.ProgrammingError, FUNC_57)\n" ]
[ "def test_sets_execute(self):...\n", "def f():...\n", "self.cursor.execute('create table t1 (word varchar (100))')\n", "words = set(['a'])\n", "self.cursor.execute('insert into t1 (word) VALUES (?)', [words])\n", "self.assertRaises(pyodbc.ProgrammingError, f)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Expr'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_7(VAR_11):...\n", "return True\n" ]
[ "def directory_filter(_path):...\n", "return True\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "import cgi\n", "import os, sys\n", "import funct\n", "import sql\n", "import ovw\n", "VAR_0 = cgi.FieldStorage()\n", "VAR_1 = VAR_0.getvalue('serv')\n", "VAR_2 = VAR_0.getvalue('act')\n", "print('Content-type: text/html\\n')\n", "if VAR_2 == 'checkrestart':\n", "VAR_3 = sql.get_dick_permit(ip=s...
[ "import cgi\n", "import os, sys\n", "import funct\n", "import sql\n", "import ovw\n", "form = cgi.FieldStorage()\n", "serv = form.getvalue('serv')\n", "act = form.getvalue('act')\n", "print('Content-type: text/html\\n')\n", "if act == 'checkrestart':\n", "servers = sql.get_dick_permit(ip=serv)\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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Assign'", "Condition", "For", "Expr'", "Condition", "Condition", "Expr'", "Expr'", "Assign'", "Condition", "Expr'", "Assign'", "Condition", "Expr'", "Expr'",...
[ "def FUNC_2(self):...\n", "VAR_1 = self.client.get(reverse('core-views-index'))\n", "self.assertRedirects(VAR_1, reverse('tcms-login'), target_status_code=\n HTTPStatus.OK)\n" ]
[ "def test_when_not_logged_in_index_page_redirects_to_login(self):...\n", "response = self.client.get(reverse('core-views-index'))\n", "self.assertRedirects(response, reverse('tcms-login'), target_status_code=\n HTTPStatus.OK)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "@login_required...\n", "\"\"\"docstring\"\"\"\n", "return render_to_response('student_account/finish_auth.html', {\n 'disable_courseware_js': True, 'disable_footer': True})\n" ]
[ "@login_required...\n", "\"\"\"docstring\"\"\"\n", "return render_to_response('student_account/finish_auth.html', {\n 'disable_courseware_js': True, 'disable_footer': True})\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def __call__(self, VAR_20):...\n", "" ]
[ "def __call__(self, urls):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_14(self, VAR_20, VAR_21):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_21 == VAR_20 + '/':\n", "VAR_29 = VAR_20.split('/')[-1] + '/'\n", "if VAR_20 == VAR_21 + self.index_file:\n", "if self.max_age is not None:\n", "VAR_29 = './'\n", "VAR_19 = {'Cache-Control': 'max-age={0}, public'.format(self...
[ "def redirect(self, from_url, to_url):...\n", "\"\"\"docstring\"\"\"\n", "if to_url == from_url + '/':\n", "relative_url = from_url.split('/')[-1] + '/'\n", "if from_url == to_url + self.index_file:\n", "if self.max_age is not None:\n", "relative_url = './'\n", "headers = {'Cache-Control': 'max-age={0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_0():...\n", "\"\"\"docstring\"\"\"\n", "VAR_0 = subprocess.run(['/opt/tljh/user/bin/jupyter-serverextension',\n 'list', '--sys-prefix'], stderr=subprocess.PIPE)\n", "VAR_1 = ['jupyterlab 0.35.3', 'nbgitpuller 0.6.1',\n 'nteract_on_jupyter 1.9.12', 'nbresuse ']\n", "for e in VAR_1:\n", "ass...
[ "def test_serverextensions():...\n", "\"\"\"docstring\"\"\"\n", "proc = subprocess.run(['/opt/tljh/user/bin/jupyter-serverextension', 'list',\n '--sys-prefix'], stderr=subprocess.PIPE)\n", "extensions = ['jupyterlab 0.35.3', 'nbgitpuller 0.6.1',\n 'nteract_on_jupyter 1.9.12', 'nbresuse ']\n", "for e i...
[ 0, 0, 0, 6, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Assert'" ]
[ "def FUNC_3(self):...\n", "VAR_15 = self._server_popen.poll()\n", "return VAR_15 is None\n" ]
[ "def _IsServerAlive(self):...\n", "returncode = self._server_popen.poll()\n", "return returncode is None\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_6(self, VAR_38):...\n", "VAR_38 = CLASS_17.run(self, VAR_38)\n", "if VAR_38 and self.only_whitespace.match(VAR_38):\n", "VAR_101.errors.add(errors.NO_TITLE)\n", "return VAR_38\n" ]
[ "def run(self, title):...\n", "title = VLength.run(self, title)\n", "if title and self.only_whitespace.match(title):\n", "c.errors.add(errors.NO_TITLE)\n", "return title\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_2(self, VAR_21, VAR_22):...\n", "\"\"\"docstring\"\"\"\n", "VAR_55 = VAR_21.rstrip('/').split('/')\n", "if len(VAR_55[0]):\n", "VAR_22 = [x for x in VAR_22.split('/') if len(x) and x is not None]\n", "VAR_22, VAR_55 = [], VAR_55[1:]\n", "VAR_21 = VAR_21[1:]\n", "VAR_56 = []\n", "def FUNC_3...
[ "def resolve_path_wc(self, path, cwd):...\n", "\"\"\"docstring\"\"\"\n", "pieces = path.rstrip('/').split('/')\n", "if len(pieces[0]):\n", "cwd = [x for x in cwd.split('/') if len(x) and x is not None]\n", "cwd, pieces = [], pieces[1:]\n", "path = path[1:]\n", "found = []\n", "def foo(p, cwd):...\n"...
[ 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", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "Return'", "Expr'", "Assign'", "Assign'", "For", "Expr'" ]
[ "def __init__(self, VAR_7, VAR_8=False):...\n", "super(CLASS_0, self).__init__()\n", "self._sock = VAR_7\n", "self._ownsock = VAR_8\n" ]
[ "def __init__(self, sock, ownsock=False):...\n", "super(DebugSessionConnection, self).__init__()\n", "self._sock = sock\n", "self._ownsock = ownsock\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'" ]
[ "def FUNC_3(self) ->bool:...\n", "\"\"\"docstring\"\"\"\n", "return True\n" ]
[ "def check_xsrf_cookie(self) ->bool:...\n", "\"\"\"docstring\"\"\"\n", "return True\n" ]
[ 0, 0, 5 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "import subprocess\n", "def __init__(self, VAR_0, VAR_1, VAR_2, VAR_3):...\n", "self.connection = VAR_0\n", "self.logger = VAR_2\n", "self.verb = VAR_3\n", "self.path = VAR_1.pop()\n", "self.pipe_command = VAR_1.pop() if VAR_1 else None\n", "def __del__(self):...\n", "self.connection.close()\n", "...
[ "import subprocess\n", "def __init__(self, connection, args, logger, verb):...\n", "self.connection = connection\n", "self.logger = logger\n", "self.verb = verb\n", "self.path = args.pop()\n", "self.pipe_command = args.pop() if args else None\n", "def __del__(self):...\n", "self.connection.close()\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Expr'", "FunctionDef'", "Expr'", "Return'" ]
[ "@VAR_1.route('/demo3', methods=['GET', 'POST'])...\n", "if request.method == 'GET':\n", "return render_template('demo3.html', faculty_status=faculty_status,\n fields_of_study=fields_of_study, departments=departments, careerareas=\n careerareas, ipedssectornames=ipedssectornames, occupations=occupations)\...
[ "@app.route('/demo3', methods=['GET', 'POST'])...\n", "if request.method == 'GET':\n", "return render_template('demo3.html', faculty_status=faculty_status,\n fields_of_study=fields_of_study, departments=departments, careerareas=\n careerareas, ipedssectornames=ipedssectornames, occupations=occupations)\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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "AugAssign'", "Condition", "AugAssign'", "AugAssig...
[ "@app.route('/api/uploads/<sid>/download')...\n", "if not utils.sid_is_valid(VAR_0):\n", "abort(400)\n", "VAR_4 = os.path.join(app.config['UPLOAD_FOLDER'], VAR_0)\n", "if os.path.isfile(os.path.join(VAR_4, app.config['RESULTS_ZIP'])):\n", "return send_from_directory(directory=path, filename=app.config['RE...
[ "@app.route('/api/uploads/<sid>/download')...\n", "if not utils.sid_is_valid(sid):\n", "abort(400)\n", "path = os.path.join(app.config['UPLOAD_FOLDER'], sid)\n", "if os.path.isfile(os.path.join(path, app.config['RESULTS_ZIP'])):\n", "return send_from_directory(directory=path, filename=app.config['RESULTS_...
[ 0, 2, 0, 0, 2, 0, 0 ]
[ "Condition", "Condition", "Expr'", "Assign'", "Condition", "Return'", "Expr'" ]
[ "def FUNC_3(VAR_5, VAR_6=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_43 = None\n", "VAR_44 = None\n", "VAR_45 = '%Y-%m-%d %H:%M:%S.%f'\n", "if VAR_6:\n", "VAR_45 = ('%Y-%m-%d %H:%M:%S.%f' if VAR_6.fieldtype == 'Datetime' else\n '%Y-%m-%d')\n", "if VAR_5 and isinstance(VAR_5, (list, tuple)):\n", ...
[ "def get_between_date_filter(value, df=None):...\n", "\"\"\"docstring\"\"\"\n", "from_date = None\n", "to_date = None\n", "date_format = '%Y-%m-%d %H:%M:%S.%f'\n", "if df:\n", "date_format = ('%Y-%m-%d %H:%M:%S.%f' if df.fieldtype == 'Datetime' else\n '%Y-%m-%d')\n", "if value and isinstance(value,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2(self):...\n", "self._check_key(VAR_0)\n" ]
[ "def test_rsa_key(self):...\n", "self._check_key(RSA_PUBKEY)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_28(VAR_25, VAR_26, VAR_27):...\n", "\"\"\"docstring\"\"\"\n", "VAR_54 = VAR_25.strftime(VAR_27)\n", "VAR_27 = VAR_18(VAR_54, **tags.__dict__)\n", "return VAR_27\n" ]
[ "def generate_date_mapping(date_value, tags, path_string):...\n", "\"\"\"docstring\"\"\"\n", "time_string = date_value.strftime(path_string)\n", "path_string = tpl(time_string, **tags.__dict__)\n", "return path_string\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_1(self):...\n", "return 'load page for task %s (%s)' % (self.task_id, self.url)\n" ]
[ "def describe(self):...\n", "return 'load page for task %s (%s)' % (self.task_id, self.url)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@integration_synonym_api...\n", "FUNC_2(VAR_2)\n", "FUNC_3(VAR_2, 'AYAAN', VAR_7='1')\n", "FUNC_5(VAR_4, VAR_5, VAR_11='AYAN', VAR_10=[{'name': '----AYAN'}, {'name':\n 'AYAAN'}])\n" ]
[ "@integration_synonym_api...\n", "clean_database(solr)\n", "seed_database_with(solr, 'AYAAN', id='1')\n", "verify_results(client, jwt, query='AYAN', expected=[{'name': '----AYAN'}, {\n 'name': 'AYAAN'}])\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_1(self):...\n", "return dict(VAR_2=self.idleTimeout, VAR_3=self.timeout, VAR_4=self.insecure)\n" ]
[ "def toDict(self):...\n", "return dict(idleTimeout=self.idleTimeout, timeout=self.timeout, insecure=\n self.insecure)\n" ]
[ 0, 2 ]
[ "FunctionDef'", "Return'" ]
[ "def __len__(self):...\n", "return len(self._data)\n" ]
[ "def __len__(self):...\n", "return len(self._data)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'pysaml2_config')\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self.config.get(self.section, 'pysaml2_config')\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]
[ "def __str__(self):...\n", "return 'Error executing adb cmd \"%s\". ret: %d, stdout: %s, stderr: %s' % (self\n .cmd, self.ret_code, self.stdout, self.stderr)\n" ]
[ "def __str__(self):...\n", "return 'Error executing adb cmd \"%s\". ret: %d, stdout: %s, stderr: %s' % (self\n .cmd, self.ret_code, self.stdout, self.stderr)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "\"\"\"string\"\"\"\n", "import MySQLdb\n", "import dbconn2\n", "VAR_0 = 'svoigt'\n", "def FUNC_0(VAR_1):...\n", "VAR_6 = FUNC_3(VAR_1)\n", "VAR_7 = VAR_6.cursor(MySQLdb.cursors.DictCursor)\n", "VAR_8 = (\n \"SELECT * FROM questions WHERE status='not-started' OR status='in-progress' ORDER BY ts DES...
[ "\"\"\"\nAuthor: Samantha Voigt\nLast Modified: 4/19/16\nanswerQuestions.py\n\nTODO: Write a description of the file\n\nTODO: sort by timestamp\n\n\"\"\"\n", "import MySQLdb\n", "import dbconn2\n", "USER = 'svoigt'\n", "def makeQuestionSelect(database):...\n", "conn = dbConnect(database)\n", "curs = con...
[ 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Expr'", "Return'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_22(VAR_18, VAR_31, VAR_30=60):...\n", "VAR_50 = re.compile('Compiling\\\\.\\\\.\\\\.|Evaluating\\\\.\\\\.\\\\.')\n", "VAR_51 = re.compile('Compilation failed|Evaluated')\n", "VAR_34 = FUNC_0()\n", "VAR_52 = 0.1\n", "while VAR_30 > 0:\n", "VAR_30 -= VAR_52\n", "VAR_49 = AWSUserTestViewRequest...
[ "def get_user_test_result(contest_id, user_test_id, timeout=60):...\n", "WAITING_STATUSES = re.compile('Compiling\\\\.\\\\.\\\\.|Evaluating\\\\.\\\\.\\\\.')\n", "COMPLETED_STATUS = re.compile('Compilation failed|Evaluated')\n", "browser = get_aws_browser()\n", "sleep_interval = 0.1\n", "while timeout > 0:...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "AugAssign'", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Return'", "Condition", "Expr'" ]
[ "def FUNC_0(VAR_2):...\n", "if isinstance(VAR_2, type) and issubclass(VAR_2, CLASS_2):\n", "return VAR_2._meta.resource_name, VAR_2._meta.type_field\n", "return VAR_2, VAR_0\n" ]
[ "def resolve_resource_type(resource):...\n", "if isinstance(resource, type) and issubclass(resource, Resource):\n", "return resource._meta.resource_name, resource._meta.type_field\n", "return resource, DEFAULT_TYPE_FIELD\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_7():...\n", "if len(sys.argv) != 2:\n", "print('Give one app package path.')\n", "VAR_17 = sys.argv[1]\n", "exit()\n", "FUNC_0(VAR_17)\n", "CLASS_1(VAR_17).analyze()\n", "sys.exit(VAR_1)\n" ]
[ "def main():...\n", "if len(sys.argv) != 2:\n", "print('Give one app package path.')\n", "app_path = sys.argv[1]\n", "exit()\n", "header(app_path)\n", "App(app_path).analyze()\n", "sys.exit(return_code)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "from __future__ import unicode_literals\n", "import frappe\n", "from frappe import _\n", "from erpnext.hr.doctype.leave_application.leave_application import get_leave_allocation_records, get_leave_balance_on, get_approved_leaves_for_period\n", "def FUNC_0(VAR_0=None):...\n", "VAR_1 = frappe.db.sql_list('...
[ "from __future__ import unicode_literals\n", "import frappe\n", "from frappe import _\n", "from erpnext.hr.doctype.leave_application.leave_application import get_leave_allocation_records, get_leave_balance_on, get_approved_leaves_for_period\n", "def execute(filters=None):...\n", "leave_types = frappe.db.s...
[ 0, 0, 0, 4, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_15(VAR_10, VAR_8, VAR_12=2):...\n", "" ]
[ "def get_html_float_to_str(src, name, precision=2):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_15(self, VAR_16, VAR_18):...\n", "\"\"\"docstring\"\"\"\n", "VAR_25 = self._eql_execute('volume', 'select', VAR_18['volume_name'],\n 'snapshot', 'select', VAR_18['name'], 'clone', VAR_16['name'])\n", "VAR_0.error(_('Failed to create volume from snapshot %s'), VAR_18['name'])\n", "return self._g...
[ "def create_volume_from_snapshot(self, volume, snapshot):...\n", "\"\"\"docstring\"\"\"\n", "out = self._eql_execute('volume', 'select', snapshot['volume_name'],\n 'snapshot', 'select', snapshot['name'], 'clone', volume['name'])\n", "LOG.error(_('Failed to create volume from snapshot %s'), snapshot['name']...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_7(self):...\n", "VAR_11 = []\n", "for VAR_1, VAR_2 in self.turningNodes:\n", "VAR_17 = 0\n", "return VAR_11\n", "for turn in self.stateMap[VAR_1][VAR_2].getTurning():\n", "if turn != -1:\n", "VAR_11.append([(VAR_1, VAR_2), turn[0], turn[1]])\n", "VAR_17 += 1\n" ]
[ "def getNodeConnectionCoords(self):...\n", "coords = []\n", "for x, y in self.turningNodes:\n", "z = 0\n", "return coords\n", "for turn in self.stateMap[x][y].getTurning():\n", "if turn != -1:\n", "coords.append([(x, y), turn[0], turn[1]])\n", "z += 1\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Assign'", "Return'", "For", "Condition", "Expr'", "AugAssign'" ]
[ "def FUNC_5(self):...\n", "VAR_1 = self.c.get('/find/?q=insecticide')\n", "VAR_2 = VAR_1.content.count(b'name=\"brand_name\"')\n", "self.assertTrue(VAR_2 > 10,\n 'There should be ~143 product returns for this search term')\n" ]
[ "def test_product_facet_returns(self):...\n", "response = self.c.get('/find/?q=insecticide')\n", "brands = response.content.count(b'name=\"brand_name\"')\n", "self.assertTrue(brands > 10,\n 'There should be ~143 product returns for this search term')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "@integration_synonym_api...\n", "FUNC_2(VAR_2)\n", "FUNC_3(VAR_2, 'KRYSTAL', VAR_7='1')\n", "FUNC_5(VAR_4, VAR_5, VAR_11='CRISTAL', VAR_10=[{'name': '----CRISTAL'}, {\n 'name': 'KRYSTAL'}])\n" ]
[ "@integration_synonym_api...\n", "clean_database(solr)\n", "seed_database_with(solr, 'KRYSTAL', id='1')\n", "verify_results(client, jwt, query='CRISTAL', expected=[{'name':\n '----CRISTAL'}, {'name': 'KRYSTAL'}])\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_34(self, VAR_14):...\n", "return self.list_properties[VAR_14].mapper.class_\n" ]
[ "def get_related_model(self, col_name):...\n", "return self.list_properties[col_name].mapper.class_\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "async def FUNC_2(self, VAR_5):...\n", "if isinstance(VAR_5, ExtractLinksEvent):\n", "VAR_37 = iter(VAR_5.links)\n", "VAR_38 = 100\n", "while True:\n", "VAR_48 = list(islice(VAR_37, 0, VAR_38))\n", "if not VAR_48:\n", "self.logger.info('extracted links', context=type(item).__name__, VAR_52=\n '8ee5...
[ "async def push(self, item):...\n", "if isinstance(item, ExtractLinksEvent):\n", "it = iter(item.links)\n", "limit = 100\n", "while True:\n", "limitlinks = list(islice(it, 0, limit))\n", "if not limitlinks:\n", "self.logger.info('extracted links', context=type(item).__name__, uuid=\n '8ee5e9c9-1130...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_1(VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "VAR_3 = sqlite3.connect(VAR_0)\n", "VAR_1 = 'select * from home_user WHERE id={};'.format(VAR_2)\n", "print('sql', VAR_1)\n", "VAR_4 = VAR_3.cursor()\n", "VAR_4.execute(VAR_1)\n", "VAR_5 = VAR_4.fetchall()\n", "return VAR_5\n" ]
[ "def get_one_user(user_id):...\n", "\"\"\"docstring\"\"\"\n", "conn = sqlite3.connect(DB_FILE)\n", "sql = 'select * from home_user WHERE id={};'.format(user_id)\n", "print('sql', sql)\n", "cursor = conn.cursor()\n", "cursor.execute(sql)\n", "res = cursor.fetchall()\n", "return res\n" ]
[ 0, 0, 0, 0, 4, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "async def FUNC_2(self, VAR_1, VAR_2):...\n", "VAR_6 = self.get_all_channels()\n", "VAR_7 = [x for x in VAR_6 if x.name == VAR_2][0]\n", "await VAR_7.send(VAR_1)\n" ]
[ "async def send_channel_message(self, message, channel_name):...\n", "channels = self.get_all_channels()\n", "channel = [x for x in channels if x.name == channel_name][0]\n", "await channel.send(message)\n" ]
[ 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "@query_cached...\n", "VAR_36 = [VAR_26]\n", "for entry in lore.io.bucket.objects.filter(Prefix=os.path.join(self.\n", "VAR_39 = tempfile.NamedTemporaryFile()\n", "return VAR_36\n", "lore.io.bucket.download_file(entry.key, VAR_39.name)\n", "VAR_36 += list(csv.reader(gz, delimiter='|', quotechar='\"'))\n...
[ "@query_cached...\n", "result = [columns]\n", "for entry in lore.io.bucket.objects.filter(Prefix=os.path.join(self.\n", "temp = tempfile.NamedTemporaryFile()\n", "return result\n", "lore.io.bucket.download_file(entry.key, temp.name)\n", "result += list(csv.reader(gz, delimiter='|', quotechar='\"'))\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "For", "Assign'", "Return'", "Expr'", "AugAssign'" ]
[ "def FUNC_2(VAR_1: str) ->str:...\n", "\"\"\"docstring\"\"\"\n", "return FUNC_0(f'git -C {VAR_1} reset --hard')\n" ]
[ "def hard_reset(repo_path: str) ->str:...\n", "\"\"\"docstring\"\"\"\n", "return shell(f'git -C {repo_path} reset --hard')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_30(self):...\n", "\"\"\"docstring\"\"\"\n", "self.sos_cmd = self.config['sos_cmd']\n", "self.sos_cmd = self.host.prefix + self.sos_cmd\n", "VAR_43 = self.determine_sos_label()\n", "if VAR_43:\n", "self.sos_cmd = ' %s %s' % (self.sos_cmd, VAR_43)\n", "if self.config['sos_opt_line']:\n", "re...
[ "def finalize_sos_cmd(self):...\n", "\"\"\"docstring\"\"\"\n", "self.sos_cmd = self.config['sos_cmd']\n", "self.sos_cmd = self.host.prefix + self.sos_cmd\n", "label = self.determine_sos_label()\n", "if label:\n", "self.sos_cmd = ' %s %s' % (self.sos_cmd, label)\n", "if self.config['sos_opt_line']:\n",...
[ 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 2 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Return'", "Condition", "Assign'", "Condition", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Condition", "Assign...
[ "def FUNC_19(self, VAR_20, VAR_17=None, VAR_18=None):...\n", "\"\"\"docstring\"\"\"\n", "self.full_clean(VAR_18)\n", "VAR_38 = registration.get_mapping(self.__class__, VAR_20.__class__)\n", "return VAR_38(self, VAR_17).update(VAR_20, VAR_18)\n" ]
[ "def update_existing(self, dest_obj, context=None, ignore_fields=None):...\n", "\"\"\"docstring\"\"\"\n", "self.full_clean(ignore_fields)\n", "mapping = registration.get_mapping(self.__class__, dest_obj.__class__)\n", "return mapping(self, context).update(dest_obj, ignore_fields)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_12(self, VAR_16):...\n", "\"\"\"docstring\"\"\"\n", "VAR_28 = ['volume', 'create', VAR_16['name'], '%sG' % VAR_16['size']]\n", "VAR_0.error(_('Failed to create volume %s'), VAR_16['name'])\n", "if self.configuration.eqlx_pool != 'default':\n", "VAR_28.append('pool')\n", "if self.configuration....
[ "def create_volume(self, volume):...\n", "\"\"\"docstring\"\"\"\n", "cmd = ['volume', 'create', volume['name'], '%sG' % volume['size']]\n", "LOG.error(_('Failed to create volume %s'), volume['name'])\n", "if self.configuration.eqlx_pool != 'default':\n", "cmd.append('pool')\n", "if self.configuration.sa...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_7(self):...\n", "\"\"\"docstring\"\"\"\n", "return self.__entities\n" ]
[ "def get_all(self):...\n", "\"\"\"docstring\"\"\"\n", "return self.__entities\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_0(VAR_1):...\n", "@wraps(VAR_1)...\n", "VAR_17 = make_response(VAR_1(*VAR_6, **kwargs))\n", "VAR_17.headers['Last-Modified'] = datetime.now()\n", "VAR_17.headers['Cache-Control'\n ] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0'\n", "VAR_17.headers['Pragma'] = '...
[ "def nocache(view):...\n", "@wraps(view)...\n", "response = make_response(view(*args, **kwargs))\n", "response.headers['Last-Modified'] = datetime.now()\n", "response.headers['Cache-Control'\n ] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0'\n", "response.headers['Pragma'...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_19(self, VAR_11):...\n", "\"\"\"docstring\"\"\"\n", "if len(self.iscsi_ips) == 1:\n", "return self.iscsi_ips.keys()[0]\n", "VAR_15 = self._get_active_nsp(VAR_11)\n", "if VAR_15 is None:\n", "VAR_15 = self._get_least_used_nsp(self._get_iscsi_nsps())\n", "return self._get_ip_using_nsp(VAR_15)\...
[ "def _get_iscsi_ip(self, hostname):...\n", "\"\"\"docstring\"\"\"\n", "if len(self.iscsi_ips) == 1:\n", "return self.iscsi_ips.keys()[0]\n", "nsp = self._get_active_nsp(hostname)\n", "if nsp is None:\n", "nsp = self._get_least_used_nsp(self._get_iscsi_nsps())\n", "return self._get_ip_using_nsp(nsp)\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Assign'", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_15(self):...\n", "" ]
[ "def testDownloadFileDownloadError(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_6(self):...\n", "VAR_5 = Mock()\n", "VAR_5.sendmail.side_effect = lambda VAR_68: succeed(VAR_68)\n", "return VAR_5\n" ]
[ "def _create_mail_sender(self):...\n", "mail_sender = Mock()\n", "mail_sender.sendmail.side_effect = lambda mail: succeed(mail)\n", "return mail_sender\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.create_snapshot(VAR_9)\n", "self.common.client_logout()\n" ]
[ "@utils.synchronized('3par', external=True)...\n", "self.common.client_login()\n", "self.common.create_snapshot(snapshot)\n", "self.common.client_logout()\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_7(self):...\n", "\"\"\"docstring\"\"\"\n", "if self.eng is not None and self.backend == 'Simulator' or self.backend == 'IBMBackend':\n", "for qubit in self.reg:\n", "self.eng.deallocate_qubit(qubit)\n" ]
[ "def _deallocate2(self):...\n", "\"\"\"docstring\"\"\"\n", "if self.eng is not None and self.backend == 'Simulator' or self.backend == 'IBMBackend':\n", "for qubit in self.reg:\n", "self.eng.deallocate_qubit(qubit)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "For", "Expr'" ]
[ "def FUNC_8(VAR_3, VAR_11):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_11 == 'login':\n", "return external_auth_login(VAR_3)\n", "if VAR_11 == 'register':\n", "return external_auth_register(VAR_3)\n" ]
[ "def _external_auth_intercept(request, mode):...\n", "\"\"\"docstring\"\"\"\n", "if mode == 'login':\n", "return external_auth_login(request)\n", "if mode == 'register':\n", "return external_auth_register(request)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Return'" ]
[ "def FUNC_9(self, VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "return None\n" ]
[ "def set_dhcp_hostname(self, hostname):...\n", "\"\"\"docstring\"\"\"\n", "return None\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_35(self, VAR_25):...\n", "\"\"\"docstring\"\"\"\n", "VAR_45 = self.config['tmp_dir'] + '/'\n", "VAR_46 = VAR_45 + VAR_25.split('/')[-1]\n", "if not self.local:\n", "self.log_debug('Failed to retrieve %s: %s' % (VAR_25, VAR_67))\n", "if self.file_exists(VAR_25):\n", "self.log_debug('Moving %s...
[ "def retrieve_file(self, path):...\n", "\"\"\"docstring\"\"\"\n", "destdir = self.config['tmp_dir'] + '/'\n", "dest = destdir + path.split('/')[-1]\n", "if not self.local:\n", "self.log_debug('Failed to retrieve %s: %s' % (path, err))\n", "if self.file_exists(path):\n", "self.log_debug('Moving %s to %...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Return'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_0(self):...\n", "VAR_7 = []\n", "for parent in self.parent_groups:\n", "VAR_7.append(parent.serialize())\n", "self._hosts = None\n", "VAR_8 = dict(VAR_0=self.name, vars=self.vars.copy(), VAR_7=parent_groups,\n depth=self.depth, VAR_9=self.hosts)\n", "return VAR_8\n" ]
[ "def serialize(self):...\n", "parent_groups = []\n", "for parent in self.parent_groups:\n", "parent_groups.append(parent.serialize())\n", "self._hosts = None\n", "result = dict(name=self.name, vars=self.vars.copy(), parent_groups=\n parent_groups, depth=self.depth, hosts=self.hosts)\n", "return resul...
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_9(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_31 = self.commands()\n", "self.expect(CLASS_1.EOF)\n", "return VAR_31\n" ]
[ "def parse(self):...\n", "\"\"\"docstring\"\"\"\n", "root = self.commands()\n", "self.expect(TokenType.EOF)\n", "return root\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Return'" ]
[ "def __getattr__(VAR_0, VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "def FUNC_7(*VAR_15, **VAR_16):...\n", "\"\"\"docstring\"\"\"\n", "return VAR_0(VAR_1, *VAR_15, **kwargs)\n" ]
[ "def __getattr__(cls, name):...\n", "\"\"\"docstring\"\"\"\n", "def new_object(*args, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "return cls(name, *args, **kwargs)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "FunctionDef'", "Docstring", "Return'" ]
[ "def FUNC_8(self, VAR_7, VAR_8, VAR_9):...\n", "VAR_20 = 'route add {0} {1} {2}'.format(VAR_7, VAR_9, VAR_8)\n", "return shellutil.run(VAR_20, VAR_10=False)\n" ]
[ "def route_add(self, net, mask, gateway):...\n", "cmd = 'route add {0} {1} {2}'.format(net, gateway, mask)\n", "return shellutil.run(cmd, chk_err=False)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_6(self, VAR_51):...\n", "VAR_81 = VAR_51\n", "VAR_51 = FUNC_3(VAR_51)\n", "if not VAR_51:\n", "return self.error(FUNC_4(VAR_81))\n", "VAR_15 = Account._by_name(VAR_51, True)\n", "return VAR_51\n", "return self.error(errors.USERNAME_TAKEN)\n" ]
[ "def run(self, user_name):...\n", "original_user_name = user_name\n", "user_name = chkuser(user_name)\n", "if not user_name:\n", "return self.error(whyuserbad(original_user_name))\n", "a = Account._by_name(user_name, True)\n", "return user_name\n", "return self.error(errors.USERNAME_TAKEN)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Return'", "Assign'", "Return'", "Return'" ]
[ "@VAR_0.route('/api/issue', methods=['POST'])...\n", "VAR_10 = FUNC_1()\n", "for VAR_7 in request.get_json()['data']:\n", "return jsonify({'data': [], 'errors': ['failed to create rows in sqlite',\n str(error)]}), 400\n", "return 'Not implemented.', 501\n", "FUNC_4(VAR_10.cursor(), VAR_7)\n" ]
[ "@app.route('/api/issue', methods=['POST'])...\n", "connection = get_database_connection()\n", "for issue in request.get_json()['data']:\n", "return jsonify({'data': [], 'errors': ['failed to create rows in sqlite',\n str(error)]}), 400\n", "return 'Not implemented.', 501\n", "create_issue(connection.c...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "For", "Return'", "Return'", "Expr'" ]
[ "def FUNC_8(self, VAR_7):...\n", "\"\"\"docstring\"\"\"\n", "VAR_45 = self._relationships[VAR_7.entity_attr]\n", "return VAR_45.relatee\n" ]
[ "def _get_relatee(self, attribute):...\n", "\"\"\"docstring\"\"\"\n", "rel = self._relationships[attribute.entity_attr]\n", "return rel.relatee\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Return'" ]
[ "def FUNC_10(self):...\n", "frappe.set_user('test1@example.com')\n", "self.assertRaises(frappe.PermissionError, get_filters_cond, 'DocType', dict\n (istable=1), [])\n", "self.assertTrue(get_filters_cond('DocType', dict(istable=1), [],\n ignore_permissions=True))\n", "frappe.set_user('Administrator')\n...
[ "def test_ignore_permissions_for_get_filters_cond(self):...\n", "frappe.set_user('test1@example.com')\n", "self.assertRaises(frappe.PermissionError, get_filters_cond, 'DocType', dict\n (istable=1), [])\n", "self.assertTrue(get_filters_cond('DocType', dict(istable=1), [],\n ignore_permissions=True))\n", ...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "\"\"\"string\"\"\"\n", "import requests\n", "import toml\n", "import os\n", "def FUNC_0(VAR_0):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = os.path.basename(VAR_0)\n", "if os.path.exists(VAR_1):\n", "return\n", "VAR_15 = requests.get(VAR_0, stream=True)\n", "VAR_15.raise_for_status()\n", "for ...
[ "\"\"\"\nThis script downloads and repacks official rust language builds\nwith the necessary tool and target support for the Firefox\nbuild environment.\n\"\"\"\n", "import requests\n", "import toml\n", "import os\n", "def fetch_file(url):...\n", "\"\"\"docstring\"\"\"\n", "filename = os.path.basename(u...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0, 0 ]
[ "Expr'", "Import'", "Import'", "Import'", "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'", "Assign'", "Expr'", "For", "Expr'", "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Ex...
[ "def FUNC_15(self, VAR_9):...\n", "\"\"\"docstring\"\"\"\n", "VAR_19 = self.session.query(self.resource_type).get(VAR_9)\n", "if VAR_19 is None:\n", "VAR_19.deleted = True\n" ]
[ "def delete(self, model_id):...\n", "\"\"\"docstring\"\"\"\n", "model = self.session.query(self.resource_type).get(model_id)\n", "if model is None:\n", "model.deleted = True\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'" ]
[ "def FUNC_32(self, VAR_32, VAR_29):...\n", "\"\"\"docstring\"\"\"\n", "VAR_24 = self.getfile(VAR_32)\n", "if VAR_24 == False:\n", "return\n", "if VAR_24[VAR_2] != VAR_13:\n", "return\n", "VAR_24[VAR_5] = VAR_29\n" ]
[ "def update_size(self, filename, size):...\n", "\"\"\"docstring\"\"\"\n", "f = self.getfile(filename)\n", "if f == False:\n", "return\n", "if f[A_TYPE] != T_FILE:\n", "return\n", "f[A_SIZE] = size\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Return'", "Condition", "Return'", "Assign'" ]
[ "def FUNC_1(self):...\n", "VAR_1 = self.c.get('/find/?q=ethyl')\n", "self.assertContains(VAR_1, 'Data Document')\n", "self.assertNotContains(VAR_1, 'Extracted Chemical')\n", "self.assertNotContains(VAR_1, 'DSSTox Substance')\n" ]
[ "def test_faceted_search_excludes_chemicals(self):...\n", "response = self.c.get('/find/?q=ethyl')\n", "self.assertContains(response, 'Data Document')\n", "self.assertNotContains(response, 'Extracted Chemical')\n", "self.assertNotContains(response, 'DSSTox Substance')\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2():...\n", "if VAR_9 == '':\n", "VAR_3 = VAR_0\n", "if VAR_9 in VAR_1:\n", "VAR_2 = VAR_0\n", "VAR_3.append(VAR_9)\n", "if VAR_9 == '..':\n", "VAR_2.clear()\n", "VAR_3.pop()\n", "print(\"Directory doesn't exist.\")\n", "print(*VAR_3, sep='/')\n", "VAR_10 = len(VAR_1) - 1\n", "if V...
[ "def cd():...\n", "if dir == '':\n", "curr_path = root\n", "if dir in dirs:\n", "path = root\n", "curr_path.append(dir)\n", "if dir == '..':\n", "path.clear()\n", "curr_path.pop()\n", "print(\"Directory doesn't exist.\")\n", "print(*curr_path, sep='/')\n", "i = len(dirs) - 1\n", "if dirs[i] ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_28(self, *VAR_76, **VAR_52):...\n", "def FUNC_39(VAR_101):...\n", "VAR_101.resources = VAR_76, VAR_52\n", "return VAR_101\n" ]
[ "def resources(self, *args, **resources):...\n", "def decorate(ruleinfo):...\n", "ruleinfo.resources = args, resources\n", "return ruleinfo\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_1(VAR_6, VAR_2=None):...\n", "if VAR_2 is None:\n", "VAR_2 = VAR_0\n", "return VAR_2.filter(content_type=get_ct(object), object_id=object.id)\n" ]
[ "def get_articles_for_object(object, article_qs=None):...\n", "if article_qs is None:\n", "article_qs = ALL_ARTICLES\n", "return article_qs.filter(content_type=get_ct(object), object_id=object.id)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_7(self, VAR_11):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def create_snapshot(self, snapshot):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "@VAR_3.callback_query_handler(func=lambda call: True)...\n", "VAR_10 = VAR_9.from_user.id\n", "VAR_29 = VAR_9.data[:1]\n", "VAR_30 = VAR_9.data[1:]\n", "if VAR_9.data == '..':\n", "VAR_1[VAR_10].go_to_parent_directory()\n", "if VAR_29 == 'd':\n", "FUNC_7(VAR_10, VAR_3)\n", "VAR_1[VAR_10].go_to_dire...
[ "@bot.callback_query_handler(func=lambda call: True)...\n", "telegram_id = call.from_user.id\n", "action = call.data[:1]\n", "content_id = call.data[1:]\n", "if call.data == '..':\n", "explorers[telegram_id].go_to_parent_directory()\n", "if action == 'd':\n", "send_replacing_message(telegram_id, bot)\...
[ 0, 0, 0, 0, 0, 4, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 4, 4 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._server\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "return self._server\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Return'" ]