lines listlengths 1 444 | raw_lines listlengths 1 444 | label listlengths 1 444 | type listlengths 1 444 |
|---|---|---|---|
[
"def FUNC_9(self, VAR_12, VAR_13):...\n",
"if VAR_12:\n",
"VAR_35 = {'active_model': self._name, 'active_id': self.id, 'active_ids':\n self.ids}\n",
"if VAR_13:\n",
"VAR_12.with_delay().run_async(VAR_35)\n",
"VAR_12.with_context(VAR_35).run()\n"
] | [
"def exec_action(self, action, async_action):...\n",
"if action:\n",
"context = {'active_model': self._name, 'active_id': self.id, 'active_ids':\n self.ids}\n",
"if async_action:\n",
"action.with_delay().run_async(context)\n",
"action.with_context(context).run()\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self, VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = {}\n",
"VAR_5['clusterName'] = VAR_8\n",
"VAR_5['searchDepth'] = '1'\n",
"VAR_5['verbose'] = '0'\n",
"VAR_18 = self._cliq_run_xml('getClusterInfo', VAR_5)\n",
"return VAR_18\n"
] | [
"def _cliq_get_cluster_info(self, cluster_name):...\n",
"\"\"\"docstring\"\"\"\n",
"cliq_args = {}\n",
"cliq_args['clusterName'] = cluster_name\n",
"cliq_args['searchDepth'] = '1'\n",
"cliq_args['verbose'] = '0'\n",
"result_xml = self._cliq_run_xml('getClusterInfo', cliq_args)\n",
"return result_xml\n... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"import os, sys, platform\n",
"from os.path import join, dirname, abspath, basename\n",
"import unittest\n",
"def FUNC_0():...\n",
"\"\"\"docstring\"\"\"\n",
"import imp\n",
"VAR_5 = [VAR_13[0] for VAR_13 in imp.get_suffixes() if VAR_13[-1] == imp.\n C_EXTENSION]\n",
"VAR_6 = [('pyodbc%s' % ext) fo... | [
"import os, sys, platform\n",
"from os.path import join, dirname, abspath, basename\n",
"import unittest\n",
"def add_to_path():...\n",
"\"\"\"docstring\"\"\"\n",
"import imp\n",
"library_exts = [t[0] for t in imp.get_suffixes() if t[-1] == imp.C_EXTENSION]\n",
"library_names = [('pyodbc%s' % ext) for... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"ImportFrom'",
"Import'",
"FunctionDef'",
"Docstring",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"For",
"For",
"Expr'",
"Condition",
"For",
"FunctionDef'",
"Expr'",
"Condition",
"Import'",
"Expr'",
"Expr'",
"Return'",
"Expr'",
"Expr'",
"Expr'",... |
[
"def FUNC_1(self, VAR_5):...\n",
"VAR_16 = super().get_transform(VAR_5)\n",
"if VAR_16:\n",
"return VAR_16\n",
"return CLASS_2(VAR_5)\n"
] | [
"def get_transform(self, name):...\n",
"transform = super().get_transform(name)\n",
"if transform:\n",
"return transform\n",
"return KeyTransformFactory(name)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"VAR_0 = ExtractedText(doc_date='Wednesday, January 21, 2014', data_document\n =self.objects.doc, extraction_script=self.objects.script)\n",
"self.assertRaises(ValidationError, VAR_0.clean())\n",
"VAR_0 = ExtractedText(doc_date='January 1984', data_document=self.objects.\n doc,... | [
"def test_extracted_doc_date_validation(self):...\n",
"text = ExtractedText(doc_date='Wednesday, January 21, 2014', data_document=\n self.objects.doc, extraction_script=self.objects.script)\n",
"self.assertRaises(ValidationError, text.clean())\n",
"text = ExtractedText(doc_date='January 1984', data_documen... | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.delete_snapshot(VAR_8)\n",
"self.common.client_logout()\n"
] | [
"@utils.synchronized('3par', external=True)...\n",
"self.common.client_login()\n",
"self.common.delete_snapshot(snapshot)\n",
"self.common.client_logout()\n"
] | [
0,
0,
0,
0
] | [
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"\"\"\"docstring\"\"\"\n",
"while True:\n",
"self.update_log_filenames()\n",
"self.check_log_files_and_push_updates()\n",
"time.sleep(1)\n"
] | [
"def run(self):...\n",
"\"\"\"docstring\"\"\"\n",
"while True:\n",
"self.update_log_filenames()\n",
"self.check_log_files_and_push_updates()\n",
"time.sleep(1)\n"
] | [
0,
0,
6,
0,
6,
6
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_1(VAR_2):...\n",
"VAR_5 = socket.socket()\n",
"return VAR_5.connect_ex(('127.0.0.1', VAR_2)) == 0\n",
"VAR_5.close()\n"
] | [
"def test_port(port):...\n",
"s = socket.socket()\n",
"return s.connect_ex(('127.0.0.1', port)) == 0\n",
"s.close()\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Return'",
"Expr'"
] |
[
"@handled_function...\n",
""
] | [
"@handled_function...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_1():...\n",
"from pyramid import session\n",
"def FUNC_4(VAR_5, VAR_6='csrf_token', VAR_7=VAR_1, VAR_8=True):...\n",
"VAR_10 = VAR_5.params.get(VAR_6, VAR_5.headers.get(VAR_7))\n",
"if VAR_10 != VAR_5.session.get_csrf_token():\n",
"if VAR_8:\n",
"return True\n",
"return False\n"
] | [
"def monkeypatch_pyramid_csrf_check():...\n",
"from pyramid import session\n",
"def check_csrf_token(request, token='csrf_token', header=HEADER_NAME,...\n",
"supplied_token = request.params.get(token, request.headers.get(header))\n",
"if supplied_token != request.session.get_csrf_token():\n",
"if raises:\... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Condition",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_3(self, VAR_3):...\n",
"VAR_6 = \"SELECT COUNT(email) FROM members WHERE email = '{email}'\".format(email\n =member)\n",
"self.cursor.execute(VAR_6)\n",
"VAR_9 = self.cursor.fetchone()\n",
"if int(VAR_9[0]) > 0:\n",
"return True\n",
"return False\n"
] | [
"def verify_email(self, member):...\n",
"query = \"SELECT COUNT(email) FROM members WHERE email = '{email}'\".format(email\n =member)\n",
"self.cursor.execute(query)\n",
"result = self.cursor.fetchone()\n",
"if int(result[0]) > 0:\n",
"return True\n",
"return False\n"
] | [
0,
4,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_11(self, VAR_12, VAR_13=None):...\n",
"VAR_41 = VAR_12.GET.get('end', None)\n",
"if VAR_41:\n",
"return self.streaming_response(f'wins_current_fy_{now().isoformat()}.csv')\n",
"self.end_date = models.DateField().to_python(VAR_41)\n",
"self.end_date = None\n"
] | [
"def get(self, request, format=None):...\n",
"end_str = request.GET.get('end', None)\n",
"if end_str:\n",
"return self.streaming_response(f'wins_current_fy_{now().isoformat()}.csv')\n",
"self.end_date = models.DateField().to_python(end_str)\n",
"self.end_date = None\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Assign'"
] |
[
"def FUNC_9(VAR_4):...\n",
"return [{'id': tag_id, 'name': MEASURE_TAGS[tag_id]['name']} for tag_id in\n VAR_4]\n"
] | [
"def _hydrate_tags(tag_ids):...\n",
"return [{'id': tag_id, 'name': MEASURE_TAGS[tag_id]['name']} for tag_id in\n tag_ids]\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from __future__ import unicode_literals, print_function, division\n",
"import logging\n",
"import threading\n",
"import time\n",
"import traceback\n",
"import lxml.html\n",
"import os.path\n",
"import spynner\n",
"import selenium.webdriver\n",
"import os\n",
"from veil.utility.path import *\n",... | [
"from __future__ import unicode_literals, print_function, division\n",
"import logging\n",
"import threading\n",
"import time\n",
"import traceback\n",
"import lxml.html\n",
"import os.path\n",
"import spynner\n",
"import selenium.webdriver\n",
"import os\n",
"from veil.utility.path import *\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
] | [
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Condition",
"Expr'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Cond... |
[
"def FUNC_36(self):...\n",
"self.compilation_ko(\n \"\"\"\nif address :is \"From\" \"tim@example.com\" \"tutu\" {\n discard;\n}\n\"\"\")\n"
] | [
"def test_extra_arg(self):...\n",
"self.compilation_ko(\n \"\"\"\nif address :is \"From\" \"tim@example.com\" \"tutu\" {\n discard;\n}\n\"\"\")\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_1(self):...\n",
"VAR_2 = self.connect()\n",
"VAR_3 = 'SELECT description FROM crimes;'\n",
"VAR_2.close()\n",
"cursor.execute(VAR_3)\n",
"return cursor.fetchall()\n"
] | [
"def get_all_inputs(self):...\n",
"connection = self.connect()\n",
"query = 'SELECT description FROM crimes;'\n",
"connection.close()\n",
"cursor.execute(query)\n",
"return cursor.fetchall()\n"
] | [
0,
0,
0,
0,
4,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Return'"
] |
[
"def __getitem__(self, VAR_44):...\n",
""
] | [
"def __getitem__(self, key):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_0(VAR_1, VAR_2=True):...\n",
"if exists(join(VAR_1, '.svn')):\n",
"VAR_24 = CLASS_3\n",
"if exists(join(VAR_1, '.git')):\n",
"return VAR_24.url_from_directory(VAR_1, VAR_2)\n",
"VAR_24 = CLASS_2\n"
] | [
"def url_from_directory(directory, include_commit=True):...\n",
"if exists(join(directory, '.svn')):\n",
"cls = SvnSubproject\n",
"if exists(join(directory, '.git')):\n",
"return cls.url_from_directory(directory, include_commit)\n",
"cls = GitSubproject\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Return'",
"Assign'"
] |
[
"def FUNC_15(self, VAR_15, VAR_16):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14 = 500\n",
"self.handle_exception_exception()\n",
"VAR_13 = {'message': VAR_15.message, 'email': helpers.get_user_email(),\n 'traceDump': traceback.format_exc(), 'status': VAR_14, 'type': VAR_15.\n __class__.__name__}\n",
"... | [
"def handle_exception(self, exception, _):...\n",
"\"\"\"docstring\"\"\"\n",
"status = 500\n",
"self.handle_exception_exception()\n",
"values = {'message': exception.message, 'email': helpers.get_user_email(),\n 'traceDump': traceback.format_exc(), 'status': status, 'type':\n exception.__class__.__nam... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_14(self, VAR_7):...\n",
"return VAR_7 in self._job_status\n"
] | [
"def _job_id_exists(self, job_id):...\n",
"return job_id in self._job_status\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"from google.appengine.ext import db\n",
"import logging\n",
"VAR_0 = ['user', 'editor', 'superuser']\n",
"VAR_9 = db.DateTimeProperty(auto_now_add=True)\n",
"VAR_10 = db.StringProperty(required=True)\n",
"VAR_2 = db.StringProperty()\n",
"VAR_3 = db.StringProperty()\n",
"VAR_1 = db.StringProperty()\n"... | [
"from google.appengine.ext import db\n",
"import logging\n",
"ROLES = ['user', 'editor', 'superuser']\n",
"timestamp = db.DateTimeProperty(auto_now_add=True)\n",
"description = db.StringProperty(required=True)\n",
"email = db.StringProperty()\n",
"user_id = db.StringProperty()\n",
"token = db.StringPr... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"Import'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"import re\n",
"import typing\n",
"from urllib.parse import urlparse\n",
"from django import forms\n",
"from django.core.exceptions import ValidationError\n",
"from django.forms import ModelForm\n",
"from lib.forms import ModelFormWithSubmit\n",
"from projects.project_models import Project\n",
"from... | [
"import re\n",
"import typing\n",
"from urllib.parse import urlparse\n",
"from django import forms\n",
"from django.core.exceptions import ValidationError\n",
"from django.forms import ModelForm\n",
"from lib.forms import ModelFormWithSubmit\n",
"from projects.project_models import Project\n",
"from... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
1
] | [
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Condition",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Functi... |
[
"def FUNC_41(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.reportMatch(p1=2, p2='%')\n"
] | [
"def test_p2_contains_symbol(self):...\n",
"\"\"\"docstring\"\"\"\n",
"tournament.reportMatch(p1=2, p2='%')\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'"
] |
[
"def FUNC_8(self, VAR_26):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_21 = self.resolve_path(VAR_26, os.path.dirname(VAR_26))\n",
"if not VAR_21 or not self.exists(VAR_21):\n",
"VAR_24 = self.getfile(VAR_21)\n",
"if VAR_24[VAR_2] == VAR_12:\n",
"if VAR_24[VAR_2] == VAR_13 and VAR_24[VAR_10]:\n",
"return F... | [
"def file_contents(self, target):...\n",
"\"\"\"docstring\"\"\"\n",
"path = self.resolve_path(target, os.path.dirname(target))\n",
"if not path or not self.exists(path):\n",
"f = self.getfile(path)\n",
"if f[A_TYPE] == T_DIR:\n",
"if f[A_TYPE] == T_FILE and f[A_REALFILE]:\n",
"return open(f[A_REALFILE... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Return'",
"Condition",
"Return'"
] |
[
"def FUNC_21(self, VAR_20, VAR_21, VAR_22):...\n",
"VAR_6 = VAR_21.get_headerbar()\n",
"self.set_titlebar(VAR_6)\n"
] | [
"def on_tab_switch(self, notebook, tab, pagenum):...\n",
"headerbar = tab.get_headerbar()\n",
"self.set_titlebar(headerbar)\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'"
] |
[
"@api_view(['GET'])...\n",
"return FUNC_7(VAR_0, 'ccg')\n"
] | [
"@api_view(['GET'])...\n",
"return _measure_by_org(request, 'ccg')\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def __init__(self, VAR_1, VAR_7, VAR_11, VAR_4=None):...\n",
"GenericRequest.__init__(self, VAR_1, VAR_4)\n",
"self.url = '%stasks/%s/submissions/%s/token' % (self.base_url, VAR_7[1], VAR_11\n )\n",
"self.task = VAR_7\n",
"self.submission_num = VAR_11\n",
"self.data = {}\n"
] | [
"def __init__(self, browser, task, submission_num, base_url=None):...\n",
"GenericRequest.__init__(self, browser, base_url)\n",
"self.url = '%stasks/%s/submissions/%s/token' % (self.base_url, task[1],\n submission_num)\n",
"self.task = task\n",
"self.submission_num = submission_num\n",
"self.data = {}\... | [
0,
0,
5,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"def FUNC_7(self):...\n",
"return self.content\n"
] | [
"def read(self):...\n",
"return self.content\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_9(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.tables = ['`tab' + self.doctype + '`']\n",
"if self.fields:\n",
"for VAR_34 in self.fields:\n",
"if not ('tab' in VAR_34 and '.' in VAR_34\n",
"VAR_32 = VAR_34.split('.')[0]\n",
"if VAR_32.lower().startswith('group_concat('):\n",
"VAR_32 = V... | [
"def extract_tables(self):...\n",
"\"\"\"docstring\"\"\"\n",
"self.tables = ['`tab' + self.doctype + '`']\n",
"if self.fields:\n",
"for f in self.fields:\n",
"if not ('tab' in f and '.' in f) or 'locate(' in f or 'count(' in f:\n",
"table_name = f.split('.')[0]\n",
"if table_name.lower().startswith('g... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"For",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'"
] |
[
"def FUNC_0():...\n",
"return psycopg2.connect(database='tournament', user='postgres')\n"
] | [
"def connect():...\n",
"return psycopg2.connect(database='tournament', user='postgres')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"import sqlite3\n",
"import os\n",
"from server.settings import BASE_DIR\n",
"VAR_0 = os.path.join(BASE_DIR, 'db.sqlite3')\n",
"def FUNC_0(VAR_1):...\n",
"VAR_3 = sqlite3.connect(VAR_0)\n",
"VAR_1 = 'select * from django_migrations;'\n",
"VAR_4 = VAR_3.cursor()\n",
"VAR_4.execute(VAR_1)\n",
"VAR_5... | [
"import sqlite3\n",
"import os\n",
"from server.settings import BASE_DIR\n",
"DB_FILE = os.path.join(BASE_DIR, 'db.sqlite3')\n",
"def sqlite_executor(sql):...\n",
"conn = sqlite3.connect(DB_FILE)\n",
"sql = 'select * from django_migrations;'\n",
"cursor = conn.cursor()\n",
"cursor.execute(sql)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Import'",
"Import'",
"ImportFrom'",
"Assign'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self, VAR_24, VAR_25):...\n",
"VAR_39 = self.metadata('queries', VAR_20=database_name, VAR_22=False) or {}\n",
"VAR_41 = VAR_39.get(VAR_25)\n",
"if VAR_41:\n",
"if not isinstance(VAR_41, dict):\n",
"VAR_41 = {'sql': VAR_41}\n",
"VAR_41['name'] = VAR_25\n",
"return VAR_41\n"
] | [
"def get_canned_query(self, database_name, query_name):...\n",
"queries = self.metadata('queries', database=database_name, fallback=False) or {\n }\n",
"query = queries.get(query_name)\n",
"if query:\n",
"if not isinstance(query, dict):\n",
"query = {'sql': query}\n",
"query['name'] = query_name\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_2(self):...\n",
"VAR_1 = '/api/apps'\n",
"VAR_2 = self.client.post(VAR_1)\n",
"self.assertEqual(VAR_2.status_code, 201)\n",
"VAR_3 = VAR_2.data['id']\n",
"VAR_1 = '/api/apps/{app_id}/builds'.format(**locals())\n",
"VAR_4 = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile': json.\n d... | [
"def test_create_chaos(self):...\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"url = '/api/apps/{app_id}/builds'.format(**locals())\n",
"body = {'image': 'autotest/example', 'sha': 'a' * 40, 'procfile'... | [
0,
0,
5,
0,
0,
0,
0,
5,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'",
... |
[
"def FUNC_10(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.r_handler.current_user is not None:\n",
"self._check_xsrf_cookie()\n",
"VAR_15 = self.r_handler.request.headers.get('Token', None)\n",
"return True\n",
"VAR_16 = self.r_handler.request.headers.get('Email', None)\n",
"if VAR_15 is not None ... | [
"def is_authenticated(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if self.r_handler.current_user is not None:\n",
"self._check_xsrf_cookie()\n",
"token = self.r_handler.request.headers.get('Token', None)\n",
"return True\n",
"email = self.r_handler.request.headers.get('Email', None)\n",
"if token is not... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Expr'",
"Assign'",
"Return'",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Return'",
"Condition",
"Return'",
"Assign'",
"Return'"
] |
[
"def __init__(self, VAR_61=False, VAR_62=False, VAR_63='rate_', *VAR_15, **...\n",
"self.rate_user = VAR_61\n",
"self.rate_ip = VAR_62\n",
"self.prefix = VAR_63\n",
"CLASS_0.__init__(self, *VAR_15, **kw)\n"
] | [
"def __init__(self, rate_user=False, rate_ip=False, prefix='rate_', *a, **kw):...\n",
"self.rate_user = rate_user\n",
"self.rate_ip = rate_ip\n",
"self.prefix = prefix\n",
"Validator.__init__(self, *a, **kw)\n"
] | [
0,
0,
0,
0,
0
] | [
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_2(self):...\n",
"VAR_7 = BokChoyTestSuite('')\n",
"VAR_1 = 'tests'\n",
"self.assertEqual(VAR_7.cmd, self._expected_command(VAR_1=name))\n"
] | [
"def test_default(self):...\n",
"suite = BokChoyTestSuite('')\n",
"name = 'tests'\n",
"self.assertEqual(suite.cmd, self._expected_command(name=name))\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"def FUNC_7(self):...\n",
"return self.content\n"
] | [
"def read(self):...\n",
"return self.content\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_2(self, VAR_0):...\n",
""
] | [
"def delete(self, user_id):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_1(self):...\n",
"return DataDocument.objects.filter(extractedtext__extraction_script=self.pk\n ).count()\n"
] | [
"def get_datadocument_count(self):...\n",
"return DataDocument.objects.filter(extractedtext__extraction_script=self.pk\n ).count()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_11(self, VAR_12='Not Authorized', VAR_13=None):...\n",
"return VAR_12, 401, {'Content-Type': 'text/plain'}\n"
] | [
"def oidc_error(self, message='Not Authorized', code=None):...\n",
"return message, 401, {'Content-Type': 'text/plain'}\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_3(self, VAR_3):...\n",
"VAR_20 = VAR_3.value.upper()\n",
"if VAR_3.type == 'ID':\n",
"if not VAR_20 in self.spdx.licenses:\n",
"if VAR_3.type == 'EXC':\n",
"self.lastid = VAR_20\n",
"if VAR_20 not in self.spdx.exceptions:\n",
"if VAR_3.type != 'WITH':\n",
"if self.lastid not in self.spdx.e... | [
"def validate(self, tok):...\n",
"id = tok.value.upper()\n",
"if tok.type == 'ID':\n",
"if not id in self.spdx.licenses:\n",
"if tok.type == 'EXC':\n",
"self.lastid = id\n",
"if id not in self.spdx.exceptions:\n",
"if tok.type != 'WITH':\n",
"if self.lastid not in self.spdx.exceptions[id]:\n",
"se... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'"
] |
[
"@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 FUNC_1(VAR_4):...\n",
"VAR_14 = VAR_4.request\n",
"VAR_15 = get_localizer(VAR_14)\n",
"def FUNC_6(*VAR_16, **VAR_17):...\n",
"return VAR_15.translate(VAR_1(*VAR_16, **kwargs))\n"
] | [
"def add_localizer_to_request(event):...\n",
"request = event.request\n",
"localizer = get_localizer(request)\n",
"def auto_translate(*args, **kwargs):...\n",
"return localizer.translate(translation_string_factory(*args, **kwargs))\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"FunctionDef'",
"Return'"
] |
[
"def FUNC_10(self, VAR_24):...\n",
"return isinstance(VAR_24, requests_exceptions.ConnectionError)\n"
] | [
"def is_connection_exception(self, exception):...\n",
"return isinstance(exception, requests_exceptions.ConnectionError)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._get_version(self.java)\n"
] | [
"@property...\n",
"\"\"\"docstring\"\"\"\n",
"return self._get_version(self.java)\n"
] | [
0,
0,
0
] | [
"Condition",
"Docstring",
"Return'"
] |
[
"def FUNC_9(self):...\n",
"self.run_test_case(self.scenario.create_app())\n"
] | [
"def test_a_create_app(self):...\n",
"self.run_test_case(self.scenario.create_app())\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_12(VAR_2, VAR_10):...\n",
"VAR_2.cursor.execute('string', (VAR_10,))\n",
"VAR_27 = VAR_2.cursor.fetchone()\n",
"if not VAR_27:\n",
"return VAR_0(*VAR_27)\n"
] | [
"def get_from_id(db, submission_id):...\n",
"db.cursor.execute(\n \"\"\"SELECT id, sheet_id, student_id, time, files_path, deleted FROM submission\n WHERE id = ?\"\"\"\n , (submission_id,))\n",
"row = db.cursor.fetchone()\n",
"if not row:\n",
"return Submission(*row)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Condition",
"Return'"
] |
[
"def FUNC_1(self):...\n",
"db.session.commit()\n"
] | [
"def save(self):...\n",
"db.session.commit()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Expr'"
] |
[
"def FUNC_17(VAR_16):...\n",
"return VAR_19(VAR_16, 'touch')\n"
] | [
"def touch(value):...\n",
"return flag(value, 'touch')\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_10(self):...\n",
"self._tab_after(' ls comp')\n",
"eq_(self.terminal.method_calls, [('write', ('utes ',), {})])\n"
] | [
"def test_command_arg_spaces_before_command(self):...\n",
"self._tab_after(' ls comp')\n",
"eq_(self.terminal.method_calls, [('write', ('utes ',), {})])\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'"
] |
[
"def FUNC_6(VAR_8):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_19 = {}\n",
"for VAR_22 in VAR_8.keys():\n",
"VAR_21 = VAR_8[VAR_22]\n",
"return VAR_19\n",
"if type(VAR_21) == UnicodeType:\n",
"VAR_19[VAR_22] = VAR_21.encode('utf-8')\n",
"if type(VAR_21) == IntType:\n",
"VAR_19[VAR_22] = VAR_21\n",
"... | [
"def row2dict(row):...\n",
"\"\"\"docstring\"\"\"\n",
"d = {}\n",
"for column_name in row.keys():\n",
"v = row[column_name]\n",
"return d\n",
"if type(v) == UnicodeType:\n",
"d[column_name] = v.encode('utf-8')\n",
"if type(v) == IntType:\n",
"d[column_name] = v\n",
"d[column_name] = str(v)\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'"
] |
[
"def FUNC_41(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_32 = list()\n",
"for VAR_14 in self.get_columns_list():\n",
"if not self.is_pk(VAR_14) and not self.is_fk(VAR_14):\n",
"return VAR_32\n",
"VAR_32.append(VAR_14)\n"
] | [
"def get_user_columns_list(self):...\n",
"\"\"\"docstring\"\"\"\n",
"ret_lst = list()\n",
"for col_name in self.get_columns_list():\n",
"if not self.is_pk(col_name) and not self.is_fk(col_name):\n",
"return ret_lst\n",
"ret_lst.append(col_name)\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"For",
"Condition",
"Return'",
"Expr'"
] |
[
"def FUNC_0(self, VAR_2):...\n",
"self.start_exporting()\n",
"self.conn.execute(\n \"INSERT INTO webpages(title, content, url) VALUES ('%s', '%s', '%s')\" %\n (VAR_2['title'], VAR_2['content'], VAR_2['url']))\n",
"self.conn.commit()\n",
"self.finish_exporting()\n"
] | [
"def export_item(self, item):...\n",
"self.start_exporting()\n",
"self.conn.execute(\n \"INSERT INTO webpages(title, content, url) VALUES ('%s', '%s', '%s')\" %\n (item['title'], item['content'], item['url']))\n",
"self.conn.commit()\n",
"self.finish_exporting()\n"
] | [
0,
0,
4,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def FUNC_9(VAR_11):...\n",
"return ray.ObjectID(VAR_11)\n"
] | [
"def binary_to_object_id(binary_object_id):...\n",
"return ray.ObjectID(binary_object_id)\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_10(self):...\n",
"VAR_4 = '/api/apps'\n",
"VAR_5 = self.client.post(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, 201)\n",
"VAR_6 = VAR_5.data['id']\n",
"VAR_4 = '/api/apps/{app_id}/containers'.format(**locals())\n",
"VAR_5 = self.client.get(VAR_4)\n",
"self.assertEqual(VAR_5.status_code, ... | [
"def test_container_scale_errors(self):...\n",
"url = '/api/apps'\n",
"response = self.client.post(url)\n",
"self.assertEqual(response.status_code, 201)\n",
"app_id = response.data['id']\n",
"url = '/api/apps/{app_id}/containers'.format(**locals())\n",
"response = self.client.get(url)\n",
"self.assert... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
... |
[
"def FUNC_5(VAR_6, VAR_4):...\n",
"print('auth_check_password', VAR_6.password_hash, VAR_4)\n",
"return check_password_hash(VAR_6.password_hash, VAR_4)\n"
] | [
"def auth_check_password(user, password):...\n",
"print('auth_check_password', user.password_hash, password)\n",
"return check_password_hash(user.password_hash, password)\n"
] | [
0,
6,
0
] | [
"FunctionDef'",
"Expr'",
"Return'"
] |
[
"def FUNC_18(VAR_29):...\n",
"VAR_30 = [b'WipeManager']\n",
"VAR_30.extend(wzrpc.make_sig_msg(b'WipeManager', b'passthrough', VAR_29))\n",
"VAR_3.send_multipart(VAR_30)\n"
] | [
"def send_passthrough(frames):...\n",
"msg = [b'WipeManager']\n",
"msg.extend(wzrpc.make_sig_msg(b'WipeManager', b'passthrough', frames))\n",
"sig_sock.send_multipart(msg)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Expr'",
"Expr'"
] |
[
"def FUNC_3(self, VAR_2, VAR_7, VAR_8):...\n",
"VAR_1 = self.current_user\n",
"if VAR_7 == 'consent':\n",
"VAR_33 = db.DatasetVersion.select().where(db.DatasetVersion.version == VAR_8\n ).get()\n",
"db.UserConsentLog.create(VAR_1=user, VAR_0=dv)\n"
] | [
"def post(self, dataset, event, target):...\n",
"user = self.current_user\n",
"if event == 'consent':\n",
"dv = db.DatasetVersion.select().where(db.DatasetVersion.version == target).get(\n )\n",
"db.UserConsentLog.create(user=user, dataset_version=dv)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Assign'",
"Expr'"
] |
[
"def FUNC_6(self):...\n",
"self.login()\n",
"while True:\n",
"VAR_29 = random.random()\n",
"VAR_30 = random.choice(self.tasks)\n",
"if VAR_29 < 0.1 and self.submissions_path is not None:\n",
"self.do_step(SubmitRandomRequest(self.browser, VAR_30, VAR_10=self.base_url,\n VAR_11=self.submissions_path))... | [
"def act(self):...\n",
"self.login()\n",
"while True:\n",
"choice = random.random()\n",
"task = random.choice(self.tasks)\n",
"if choice < 0.1 and self.submissions_path is not None:\n",
"self.do_step(SubmitRandomRequest(self.browser, task, base_url=self.base_url,\n submissions_path=self.submissions_p... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Expr'"
] |
[
"def FUNC_2():...\n",
""
] | [
"def main():...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"def FUNC_4(VAR_2, VAR_3=None, VAR_4=None, VAR_5=0, VAR_6=20, VAR_7=None):...\n",
"VAR_11 = []\n",
"if VAR_4:\n",
"if VAR_4.blogger:\n",
"if VAR_3:\n",
"VAR_11.append('t1.blogger=\"%s\"' % frappe.db.escape(VAR_4.blogger))\n",
"if VAR_4.blog_category:\n",
"VAR_11.append('(t1.content like \"%{0}%\" or t... | [
"def get_blog_list(doctype, txt=None, filters=None, limit_start=0,...\n",
"conditions = []\n",
"if filters:\n",
"if filters.blogger:\n",
"if txt:\n",
"conditions.append('t1.blogger=\"%s\"' % frappe.db.escape(filters.blogger))\n",
"if filters.blog_category:\n",
"conditions.append('(t1.content like \"%{... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Condition",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"For",
"Assign'",
"Return'",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'... |
[
"def FUNC_15(self, VAR_7, VAR_10):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_25 = None\n",
"VAR_11 = self.common._safe_hostname(VAR_10['host'])\n",
"VAR_33 = self.common.get_cpg(VAR_7, allowSnap=True)\n",
"VAR_13 = self.common.get_domain(VAR_33)\n",
"VAR_25 = self.common._get_3par_host(VAR_11)\n",
"VAR_1... | [
"def _create_host(self, volume, connector):...\n",
"\"\"\"docstring\"\"\"\n",
"host = None\n",
"hostname = self.common._safe_hostname(connector['host'])\n",
"cpg = self.common.get_cpg(volume, allowSnap=True)\n",
"domain = self.common.get_domain(cpg)\n",
"host = self.common._get_3par_host(hostname)\n",
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'",
"Condition",
"Assign'",
"Expr'",
"Assign'",
"Assign'"
] |
[
"def FUNC_2(self, VAR_1):...\n",
"VAR_2 = self.connect()\n",
"VAR_3 = \"INSERT INTO crimes (description) VALUES('{}');\".format(VAR_1)\n",
"VAR_2.close()\n",
"cursor.execute(VAR_3)\n",
"VAR_2.commit()\n"
] | [
"def add_input(self, data):...\n",
"connection = self.connect()\n",
"query = \"INSERT INTO crimes (description) VALUES('{}');\".format(data)\n",
"connection.close()\n",
"cursor.execute(query)\n",
"connection.commit()\n"
] | [
0,
0,
4,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'"
] |
[
"def __init__(self):...\n",
"self.xsrf_token = None\n",
"self.session = requests.Session()\n"
] | [
"def __init__(self):...\n",
"self.xsrf_token = None\n",
"self.session = requests.Session()\n"
] | [
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'"
] |
[
"def FUNC_5(self):...\n",
"VAR_13 = {'puc': ['2']}\n",
"VAR_14 = self.client.post('/get_data/', VAR_13=data)\n",
"for hnp in [b'ball bearings', b'motorcycle', b'vitamin a&d', b'dish soap']:\n",
"self.assertIn(hnp, VAR_14.content)\n"
] | [
"def test_habits_and_practices_cards(self):...\n",
"data = {'puc': ['2']}\n",
"response = self.client.post('/get_data/', data=data)\n",
"for hnp in [b'ball bearings', b'motorcycle', b'vitamin a&d', b'dish soap']:\n",
"self.assertIn(hnp, response.content)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"For",
"Expr'"
] |
[
"@app.route('/api/images/<type>/<image>/wait_until_ready', methods=['GET'])...\n",
"FUNC_34(VAR_11).lookup(VAR_12, file_required=False).wait_until_ready()\n",
"return {'ready': True}\n"
] | [
"@app.route('/api/images/<type>/<image>/wait_until_ready', methods=['GET'])...\n",
"get_image_database(type).lookup(image, file_required=False).wait_until_ready()\n",
"return {'ready': True}\n"
] | [
0,
0,
0
] | [
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_5(self, *VAR_4, **VAR_5):...\n",
"VAR_11 = self.REQUEST\n",
"VAR_16 = VAR_11.RESPONSE\n",
"VAR_17 = VAR_11.SESSION\n",
"self._zmi_page_request()\n",
"VAR_16.setHeader('Expires', DateTime(VAR_11['ZMI_TIME'] - 10000).toZone(\n 'GMT+1').rfc822())\n",
"VAR_16.setHeader('Cache-Control', 'no-cach... | [
"def zmi_page_request(self, *args, **kwargs):...\n",
"request = self.REQUEST\n",
"RESPONSE = request.RESPONSE\n",
"SESSION = request.SESSION\n",
"self._zmi_page_request()\n",
"RESPONSE.setHeader('Expires', DateTime(request['ZMI_TIME'] - 10000).toZone(\n 'GMT+1').rfc822())\n",
"RESPONSE.setHeader('Cac... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Expr'",
"Condition",
"Expr'",
"Assign'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Expr'",
"For",
"Expr'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"For",
"Con... |
[
"def FUNC_4(VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_20 = enterprise_customer_for_request(VAR_3)\n",
"if not VAR_20:\n",
"return {}\n",
"VAR_21 = configuration_helpers.get_value('PLATFORM_NAME', settings.\n PLATFORM_NAME)\n",
"if VAR_20.branding_configuration.logo:\n",
"VAR_34 = VAR_20.brandi... | [
"def enterprise_sidebar_context(request):...\n",
"\"\"\"docstring\"\"\"\n",
"enterprise_customer = enterprise_customer_for_request(request)\n",
"if not enterprise_customer:\n",
"return {}\n",
"platform_name = configuration_helpers.get_value('PLATFORM_NAME', settings.\n PLATFORM_NAME)\n",
"if enterpri... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Return'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_23(self):...\n",
"return self._email\n"
] | [
"def email(self):...\n",
"return self._email\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"@commands.command(pass_context=True, name='7zip')...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_7 = discord.Embed(VAR_2='Download 7zip', VAR_3=discord.Color(255))\n",
"VAR_7.set_thumbnail(url='http://i.imgur.com/cX1fuf6.png')\n",
"VAR_7.url = 'http://www.7-zip.org/download.html'\n",
"VAR_7.description = (\n ... | [
"@commands.command(pass_context=True, name='7zip')...\n",
"\"\"\"docstring\"\"\"\n",
"embed = discord.Embed(title='Download 7zip', color=discord.Color(255))\n",
"embed.set_thumbnail(url='http://i.imgur.com/cX1fuf6.png')\n",
"embed.url = 'http://www.7-zip.org/download.html'\n",
"embed.description = (\n ... | [
0,
0,
0,
0,
0,
0,
0
] | [
"Condition",
"Docstring",
"Assign'",
"Expr'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@classmethod...\n",
""
] | [
"@classmethod...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def FUNC_21(VAR_11=5):...\n",
"return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in\n range(VAR_11))\n"
] | [
"def genSingleToken(length=5):...\n",
"return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in\n range(length))\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_17(self, VAR_13):...\n",
"VAR_5 = self.found_tags[VAR_13]\n",
"VAR_24 = self.view.window().new_file()\n",
"VAR_24.run_command('insert_snippet', {'contents': \n \"\"\"\nFiles found for tag: %s\n\n\"\"\" % VAR_5})\n",
"for file in self.tagged_files[VAR_5]:\n",
"VAR_42 = file.get_tag('title')[0]... | [
"def list_files(self, selected_tag):...\n",
"tag = self.found_tags[selected_tag]\n",
"new_view = self.view.window().new_file()\n",
"new_view.run_command('insert_snippet', {'contents': \n \"\"\"\nFiles found for tag: %s\n\n\"\"\" % tag})\n",
"for file in self.tagged_files[tag]:\n",
"listing = file.get_t... | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"For",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_2={}, VAR_3=False, VAR_4='campaign-data/db.sqlite3'):...\n",
"if not exists(VAR_4):\n",
"self.campaign = VAR_2\n",
"self.result = {}\n",
"self.file = VAR_4\n",
"self.lock = Lock()\n",
"if VAR_3:\n",
"db.__create_result()\n"
] | [
"def __init__(self, campaign={}, create_result=False, database_file=...\n",
"if not exists(database_file):\n",
"self.campaign = campaign\n",
"self.result = {}\n",
"self.file = database_file\n",
"self.lock = Lock()\n",
"if create_result:\n",
"db.__create_result()\n"
] | [
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Condition",
"Expr'"
] |
[
"from __future__ import absolute_import\n",
"from mock import MagicMock, patch\n",
"from six.moves.urllib_parse import quote_plus\n",
"from flask import url_for, session\n",
"from invenio.testsuite import make_test_suite, run_test_suite\n",
"from invenio.ext.sqlalchemy import db\n",
"from .helpers impor... | [
"from __future__ import absolute_import\n",
"from mock import MagicMock, patch\n",
"from six.moves.urllib_parse import quote_plus\n",
"from flask import url_for, session\n",
"from invenio.testsuite import make_test_suite, run_test_suite\n",
"from invenio.ext.sqlalchemy import db\n",
"from .helpers impor... | [
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"ImportFrom'",
"Expr'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign... |
[
"def FUNC_26(self):...\n",
"return self.user_id\n"
] | [
"def get_id(self):...\n",
"return self.user_id\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_5(VAR_12):...\n",
"\"\"\"docstring\"\"\"\n",
"if isinstance(VAR_12, str):\n",
"return unicoder(VAR_12)\n",
"if isinstance(VAR_12, list):\n",
"VAR_82 = []\n",
"if isinstance(VAR_12, dict):\n",
"for VAR_58 in VAR_12:\n",
"VAR_82 = {}\n",
"return VAR_12\n",
"VAR_82.append(FUNC_5(VAR_58))\... | [
"def decode_factory(text):...\n",
"\"\"\"docstring\"\"\"\n",
"if isinstance(text, str):\n",
"return unicoder(text)\n",
"if isinstance(text, list):\n",
"new_text = []\n",
"if isinstance(text, dict):\n",
"for t in text:\n",
"new_text = {}\n",
"return text\n",
"new_text.append(decode_factory(t))\n"... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Return'",
"Condition",
"Assign'",
"Condition",
"For",
"Assign'",
"Return'",
"Expr'",
"Return'",
"For",
"Assign'",
"Return'"
] |
[
"def FUNC_5(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.run_local:\n",
"if not (self.configuration.san_password or self.configuration.san_private_key):\n",
"if not self.configuration.san_ip:\n"
] | [
"def check_for_setup_error(self):...\n",
"\"\"\"docstring\"\"\"\n",
"if not self.run_local:\n",
"if not (self.configuration.san_password or self.configuration.san_private_key):\n",
"if not self.configuration.san_ip:\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Condition",
"Condition",
"Condition"
] |
[
"@staticmethod...\n",
"return mongo.db.analysis.find_one({'info.id': int(VAR_1)}, sort=[('_id',\n pymongo.DESCENDING)])\n"
] | [
"@staticmethod...\n",
"return mongo.db.analysis.find_one({'info.id': int(task_id)}, sort=[('_id',\n pymongo.DESCENDING)])\n"
] | [
0,
0
] | [
"Condition",
"Return'"
] |
[
"def FUNC_3(self, VAR_4, VAR_5):...\n",
"VAR_9 = 'string'.format(VAR_4, VAR_5)\n",
"VAR_7 = self.__conn.cursor()\n",
"VAR_7.execute(VAR_9)\n",
"VAR_10 = VAR_7.fetchone()\n",
"if VAR_10:\n",
"return Client(VAR_10[0], VAR_10[1], VAR_10[2], VAR_10[3])\n",
"return False\n"
] | [
"def login(self, username, password):...\n",
"select_query = (\n \"\"\"\n SELECT client_id, username, balance, message\n FROM Clients\n WHERE username = '{}' AND password = '{}'\n LIMIT 1\n \"\"\"\n .format(username, password))\n",
"cursor = self.__conn.c... | [
0,
4,
0,
4,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"Assign'",
"Condition",
"Return'",
"Return'"
] |
[
"def FUNC_27(VAR_21):...\n",
"if VAR_21.type != 'response':\n",
"return False\n",
"VAR_33['msg'] = VAR_21\n",
"return VAR_21.request_seq == VAR_13\n"
] | [
"def match(msg):...\n",
"if msg.type != 'response':\n",
"return False\n",
"result['msg'] = msg\n",
"return msg.request_seq == seq\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Return'",
"Assign'",
"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_2(VAR_14, VAR_15=None, VAR_16=None, VAR_17='width=\\\\textwidth'):...\n",
"if not VAR_16:\n",
"VAR_16 = VAR_15[0][0]\n",
"if VAR_14[0]:\n",
"if VAR_14[1]:\n",
"if VAR_14[1]:\n",
"return self.markers[0] % (VAR_14[0][0], VAR_14[0][1], VAR_14[1][0], VAR_14[\n 1][1], VAR_16)\n",
"return self.... | [
"def singleImage(dims, files=None, file=None, implicitDims='width=\\\\textwidth'):...\n",
"if not file:\n",
"file = files[0][0]\n",
"if dims[0]:\n",
"if dims[1]:\n",
"if dims[1]:\n",
"return self.markers[0] % (dims[0][0], dims[0][1], dims[1][0], dims[1][1], file)\n",
"return self.markers[1] % (dims[0]... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Assign'",
"Condition",
"Condition",
"Condition",
"Return'",
"Return'",
"Return'",
"Return'"
] |
[
"def FUNC_0(VAR_2, VAR_3):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_5 = dict(external_id=resp.get('orcid'), external_method='orcid')\n",
"return VAR_5\n"
] | [
"def account_info(remote, resp):...\n",
"\"\"\"docstring\"\"\"\n",
"account_info = dict(external_id=resp.get('orcid'), external_method='orcid')\n",
"return account_info\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Return'"
] |
[
"def FUNC_13(self, VAR_8):...\n",
"logging.info('Rebooting bot: %s', VAR_8)\n",
"VAR_36 = {'cmd': 'restart', 'message': VAR_8}\n",
"self.send_response(VAR_36)\n"
] | [
"def _cmd_restart(self, message):...\n",
"logging.info('Rebooting bot: %s', message)\n",
"out = {'cmd': 'restart', 'message': message}\n",
"self.send_response(out)\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Expr'",
"Assign'",
"Expr'"
] |
[
"def __init__(self, VAR_32, *, VAR_33=0):...\n",
"self.wires = VAR_32\n",
"self.eng = None\n",
"self._state = None\n",
"super().__init__(self.short_name, VAR_33)\n"
] | [
"def __init__(self, wires, *, shots=0):...\n",
"self.wires = wires\n",
"self.eng = None\n",
"self._state = None\n",
"super().__init__(self.short_name, shots)\n"
] | [
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Expr'"
] |
[
"@utils.synchronized('3par', external=True)...\n",
""
] | [
"@utils.synchronized('3par', external=True)...\n",
""
] | [
0,
0
] | [
"Condition",
"Condition"
] |
[
"def __init__(self, VAR_1, VAR_4=None):...\n",
"\"\"\"docstring\"\"\"\n",
"super(CLASS_0, self).__init__(VAR_1, VAR_4)\n",
"VAR_1 = self.bindings\n",
"VAR_1['TEST_APP_COMPONENT_NAME'] = '{app}-{stack}-{detail}'.format(app=\n bindings['TEST_APP'], stack=bindings['TEST_STACK'], detail=bindings[\n 'TEST_... | [
"def __init__(self, bindings, agent=None):...\n",
"\"\"\"docstring\"\"\"\n",
"super(AwsSmokeTestScenario, self).__init__(bindings, agent)\n",
"bindings = self.bindings\n",
"bindings['TEST_APP_COMPONENT_NAME'] = '{app}-{stack}-{detail}'.format(app=\n bindings['TEST_APP'], stack=bindings['TEST_STACK'], det... | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Expr'",
"Assign'",
"Assign'",
"Assign'"
] |
[
"import collections\n",
"import os\n",
"import pytest\n",
"import tempfile\n",
"import unittest\n",
"import reframe as rfm\n",
"import reframe.core.runtime as rt\n",
"import reframe.frontend.dependency as dependency\n",
"import reframe.frontend.executors as executors\n",
"import reframe.frontend.e... | [
"import collections\n",
"import os\n",
"import pytest\n",
"import tempfile\n",
"import unittest\n",
"import reframe as rfm\n",
"import reframe.core.runtime as rt\n",
"import reframe.frontend.dependency as dependency\n",
"import reframe.frontend.executors as executors\n",
"import reframe.frontend.e... | [
0,
0,
0,
0,
0,
0,
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'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Function... |
[
"from __future__ import absolute_import, print_function\n",
"import contextlib\n",
"import json\n",
"import socket\n",
"import sys\n",
"import time\n",
"import threading\n",
"import warnings\n",
"from ptvsd._util import new_hidden_thread, Closeable, ClosedError\n",
"from .message import raw_read_a... | [
"from __future__ import absolute_import, print_function\n",
"import contextlib\n",
"import json\n",
"import socket\n",
"import sys\n",
"import time\n",
"import threading\n",
"import warnings\n",
"from ptvsd._util import new_hidden_thread, Closeable, ClosedError\n",
"from .message import raw_read_a... | [
0,
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'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Assign'",
"Assign'",
"Condition",
"FunctionDef'",
"Assign'",
"For",
"Return'",
"Expr'",
"Condition",
"Ex... |
[
"\"\"\"API endpoints dealing with submissions.\"\"\"\n",
"from tornado.escape import json_encode, to_unicode\n",
"import tornado.web\n",
"import api.submission\n",
"from db.survey import IncorrectQuestionIdError\n",
"from pages.util.base import APIHandler, get_email, get_json_request_body, catch_bare_inte... | [
"\"\"\"API endpoints dealing with submissions.\"\"\"\n",
"from tornado.escape import json_encode, to_unicode\n",
"import tornado.web\n",
"import api.submission\n",
"from db.survey import IncorrectQuestionIdError\n",
"from pages.util.base import APIHandler, get_email, get_json_request_body, catch_bare_inte... | [
0,
5,
0,
0,
0,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"Expr'",
"ImportFrom'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Expr'",
"FunctionDef'",
"Condition",
"Return'",
"FunctionDef'",
"Assign'",
"Assign'",
"Expr'",
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Expr'",
"Expr'",
"FunctionDef'",
"Assig... |
[
"def FUNC_4(self, *VAR_4, **VAR_6):...\n",
"\"\"\"docstring\"\"\"\n",
"for VAR_9 in VAR_4:\n",
"self._set_inoutput_item(VAR_9)\n",
"for VAR_10, VAR_9 in VAR_6.items():\n",
"self._set_inoutput_item(VAR_9, VAR_10=name)\n"
] | [
"def set_input(self, *input, **kwinput):...\n",
"\"\"\"docstring\"\"\"\n",
"for item in input:\n",
"self._set_inoutput_item(item)\n",
"for name, item in kwinput.items():\n",
"self._set_inoutput_item(item, name=name)\n"
] | [
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"For",
"Expr'",
"For",
"Expr'"
] |
[
"def __str__(self):...\n",
"return self.get_name()\n"
] | [
"def __str__(self):...\n",
"return self.get_name()\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_1(VAR_1):...\n",
"return FUNC_0(VAR_1[0])\n"
] | [
"def fix_sort_list(list):...\n",
"return fix_sort(list[0])\n"
] | [
0,
0
] | [
"FunctionDef'",
"Return'"
] |
[
"def FUNC_8(self, VAR_9, VAR_7=False, VAR_10=None):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_29 = self.output if VAR_7 else self.input\n",
"if isinstance(VAR_9, str):\n",
"if isinstance(VAR_9, _IOFile):\n",
"if callable(VAR_9):\n",
"self.dependencies[VAR_9] = VAR_9.rule\n",
"VAR_44 = IOFile(VAR_9, VAR_1... | [
"def _set_inoutput_item(self, item, output=False, name=None):...\n",
"\"\"\"docstring\"\"\"\n",
"inoutput = self.output if output else self.input\n",
"if isinstance(item, str):\n",
"if isinstance(item, _IOFile):\n",
"if callable(item):\n",
"self.dependencies[item] = item.rule\n",
"_item = IOFile(item,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Condition",
"Condition",
"Condition",
"Assign'",
"Assign'",
"Condition",
"Assign'",
"Condition",
"Expr'",
"For",
"Condition",
"Condition",
"Condition",
"Expr'",
"Condition",
"Expr'",
"Condition",
"Condition",
"Expr'",
"Expr'",
"E... |
[
"def __new__(VAR_22, VAR_3):...\n",
"VAR_48 = str.__new__(VAR_22, VAR_3)\n",
"VAR_48._is_function = type(VAR_3).__name__ == 'function'\n",
"VAR_48._file = VAR_3\n",
"VAR_48.rule = None\n",
"VAR_48._regex = None\n",
"return VAR_48\n"
] | [
"def __new__(cls, file):...\n",
"obj = str.__new__(cls, file)\n",
"obj._is_function = type(file).__name__ == 'function'\n",
"obj._file = file\n",
"obj.rule = None\n",
"obj._regex = None\n",
"return obj\n"
] | [
0,
0,
0,
0,
0,
0,
0
] | [
"FunctionDef'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Return'"
] |
[
"def FUNC_7(self):...\n",
"\"\"\"docstring\"\"\"\n",
"VAR_14, VAR_15 = new_log_monitor_log_file()\n",
"VAR_16 = ray.services.start_log_monitor(self.redis_address, self.\n _node_ip_address, VAR_14=stdout_file, VAR_15=stderr_file,\n redis_password=self._ray_params.redis_password)\n",
"assert VAR_13.PROC... | [
"def start_log_monitor(self):...\n",
"\"\"\"docstring\"\"\"\n",
"stdout_file, stderr_file = new_log_monitor_log_file()\n",
"process_info = ray.services.start_log_monitor(self.redis_address, self.\n _node_ip_address, stdout_file=stdout_file, stderr_file=stderr_file,\n redis_password=self._ray_params.redi... | [
0,
0,
0,
6,
0,
0
] | [
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assert'",
"Assign'"
] |
[
"def FUNC_13(self, VAR_13):...\n",
"if VAR_13:\n",
"self._update_backend_status()\n",
"return self.device_stats\n"
] | [
"def get_volume_stats(self, refresh):...\n",
"if refresh:\n",
"self._update_backend_status()\n",
"return self.device_stats\n"
] | [
0,
0,
0,
0
] | [
"FunctionDef'",
"Condition",
"Expr'",
"Return'"
] |
[
"def FUNC_27(self, VAR_15):...\n",
""
] | [
"def add(self, item):...\n",
""
] | [
0,
0
] | [
"FunctionDef'",
"Condition"
] |
[
"from __future__ import absolute_import\n",
"from __future__ import division\n",
"from __future__ import print_function\n",
"import argparse\n",
"import logging\n",
"import os\n",
"import redis\n",
"import time\n",
"import ray.ray_constants as ray_constants\n",
"from ray.services import get_ip_add... | [
"from __future__ import absolute_import\n",
"from __future__ import division\n",
"from __future__ import print_function\n",
"import argparse\n",
"import logging\n",
"import os\n",
"import redis\n",
"import time\n",
"import ray.ray_constants as ray_constants\n",
"from ray.services import get_ip_add... | [
0,
0,
0,
0,
0,
0,
6,
6,
0,
6,
6,
0,
0,
6,
0,
0,
6,
6,
6,
6,
6,
0,
0,
6,
6,
6,
0,
0,
6,
0,
6,
6,
6,
0,
6,
6,
0,
6,
6,
6,
6,
6,
6,
6,
0,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6,
6
] | [
"ImportFrom'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"Import'",
"ImportFrom'",
"ImportFrom'",
"Import'",
"Assign'",
"Expr'",
"FunctionDef'",
"Docstring",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"Assign'",
"FunctionDef'",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.