lines
listlengths
1
444
raw_lines
listlengths
1
444
label
listlengths
1
444
type
listlengths
1
444
[ "@data(*VAR_3)...\n", "VAR_12 = get_street_number(VAR_1)\n", "self.assertEqual(VAR_4, VAR_12)\n" ]
[ "@data(*address_test_data)...\n", "output_string = get_street_number(input_string)\n", "self.assertEqual(desired_string1, output_string)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Assign'", "Expr'" ]
[ "def FUNC_1(self):...\n", "\"\"\"docstring\"\"\"\n", "if self.eng is not None:\n", "self.eng = None\n", "self.state = None\n" ]
[ "def reset(self):...\n", "\"\"\"docstring\"\"\"\n", "if self.eng is not None:\n", "self.eng = None\n", "self.state = None\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Assign'" ]
[ "def FUNC_1(self, VAR_2):...\n", "VAR_1 = self.current_user\n", "VAR_2 = db.get_dataset(VAR_2)\n", "VAR_15 = db.DatasetVersion.select(db.DatasetVersion.version, db.\n DatasetVersion.available_from).where(db.DatasetVersion.dataset == VAR_2)\n", "logging.info('ListDatasetVersions')\n", "VAR_16 = []\n", ...
[ "def get(self, dataset):...\n", "user = self.current_user\n", "dataset = db.get_dataset(dataset)\n", "versions = db.DatasetVersion.select(db.DatasetVersion.version, db.\n DatasetVersion.available_from).where(db.DatasetVersion.dataset == dataset)\n", "logging.info('ListDatasetVersions')\n", "data = []\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "For", "Assign'", "Expr'", "Assign'", "Condition", "Condition", "Condition", "Assign'", "Assign'", "Expr'", "Assign'" ]
[ "async def FUNC_2(self) ->None:...\n", "VAR_1 = self.get_body_argument('lexer')\n", "VAR_5 = self.get_body_argument('code')\n", "VAR_6 = self.get_body_argument('expiry')\n", "if not VAR_5:\n", "VAR_0.info('APINew.post: a paste was submitted without content')\n", "if VAR_1 not in utility.list_languages()...
[ "async def post(self) ->None:...\n", "lexer = self.get_body_argument('lexer')\n", "raw = self.get_body_argument('code')\n", "expiry = self.get_body_argument('expiry')\n", "if not raw:\n", "log.info('APINew.post: a paste was submitted without content')\n", "if lexer not in utility.list_languages():\n", ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "AsyncFunctionDef'", "Assign'", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Condition", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_45(VAR_25, VAR_39):...\n", "if self.parentfield:\n", "return '{} #{}: {}: {}'.format(_('Row'), self.idx, _(VAR_25.label), VAR_39)\n", "return '{}: {}'.format(_(VAR_25.label), VAR_39)\n" ]
[ "def get_msg(df, docname):...\n", "if self.parentfield:\n", "return '{} #{}: {}: {}'.format(_('Row'), self.idx, _(df.label), docname)\n", "return '{}: {}'.format(_(df.label), docname)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_1(VAR_1=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = 'df -i'\n", "if VAR_1 is not None:\n", "VAR_4 = VAR_4 + ' -' + VAR_1\n", "VAR_2 = {}\n", "VAR_3 = __salt__['cmd.run'](VAR_4).splitlines()\n", "for line in VAR_3:\n", "if line.startswith('Filesystem'):\n", "return VAR_2\n", "VAR_...
[ "def inodeusage(args=None):...\n", "\"\"\"docstring\"\"\"\n", "cmd = 'df -i'\n", "if args is not None:\n", "cmd = cmd + ' -' + args\n", "ret = {}\n", "out = __salt__['cmd.run'](cmd).splitlines()\n", "for line in out:\n", "if line.startswith('Filesystem'):\n", "return ret\n", "comps = line.split(...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "For", "Condition", "Return'", "Assign'", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_6():...\n", "if not request.method in VAR_0:\n", "return True\n", "if not request.environ.get('AUTH_TYPE') == 'cookie':\n", "return True\n", "if config.get('skip_authentication'):\n", "return True\n", "if request.environ.get('HTTP_REFERER'):\n", "VAR_7 = urlparse(request.environ.get('HTTP_...
[ "def check():...\n", "if not request.method in methods:\n", "return True\n", "if not request.environ.get('AUTH_TYPE') == 'cookie':\n", "return True\n", "if config.get('skip_authentication'):\n", "return True\n", "if request.environ.get('HTTP_REFERER'):\n", "ref_url = urlparse(request.environ.get('HT...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 5, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Return'", "Condition", "Return'", "Condition", "Assign'", "Condition", "Assign'", "Return'", "Return'", "Condition", "AugAssign'", "Condition", "Condition", "Return'" ]
[ "@VAR_0.route('/search', methods=['POST'])...\n", "VAR_10 = request.form.get('search')\n", "return redirect('/%s' % VAR_10)\n" ]
[ "@app.route('/search', methods=['POST'])...\n", "search = request.form.get('search')\n", "return redirect('/%s' % search)\n" ]
[ 0, 0, 4 ]
[ "Condition", "Assign'", "Return'" ]
[ "def FUNC_11(VAR_34):...\n", "if VAR_34.startswith('!'):\n", "return VAR_34[1:]\n", "return VAR_34.format(VAR_11=url, VAR_36=dest.name)\n" ]
[ "def formatCommand(e):...\n", "if e.startswith('!'):\n", "return e[1:]\n", "return e.format(url=url, dest=dest.name)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def __init__(self, VAR_1, VAR_5, VAR_4=None):...\n", "GenericRequest.__init__(self, VAR_1, VAR_4)\n", "self.url = '%stasks/%s/description' % (self.base_url, VAR_5)\n", "self.task_id = VAR_5\n" ]
[ "def __init__(self, browser, task_id, base_url=None):...\n", "GenericRequest.__init__(self, browser, base_url)\n", "self.url = '%stasks/%s/description' % (self.base_url, task_id)\n", "self.task_id = task_id\n" ]
[ 0, 0, 5, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'" ]
[ "def FUNC_2(VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "if not FUNC_1(VAR_1):\n", "VAR_1.run_command('move_to', {'to': 'eof'})\n", "VAR_1.run_command('insert_snippet', {'contents': '\\n\\n' + VAR_4()})\n", "VAR_1.run_command('move_to', {'to': 'bof'})\n" ]
[ "def add_separator(view):...\n", "\"\"\"docstring\"\"\"\n", "if not has_meta(view):\n", "view.run_command('move_to', {'to': 'eof'})\n", "view.run_command('insert_snippet', {'contents': '\\n\\n' + meta_separator()})\n", "view.run_command('move_to', {'to': 'bof'})\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(self, *VAR_4, **VAR_5):...\n", "return self.manage_menu(VAR_4, VAR_5)\n" ]
[ "def zmi_manage_menu(self, *args, **kwargs):...\n", "return self.manage_menu(args, kwargs)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def __init__(self):...\n", "self.conn = MySQLdb.connect(*self.dsn)\n", "self.cur = self.conn.cursor()\n" ]
[ "def __init__(self):...\n", "self.conn = MySQLdb.connect(*self.dsn)\n", "self.cur = self.conn.cursor()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'" ]
[ "def FUNC_9(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = self.agent.type_to_payload(\n 'registerInstancesWithGoogleLoadBalancerDescription', {\n 'loadBalancerNames': [self.__use_lb_name], 'instanceIds': self.\n use_instance_names[:2], 'region': self.bindings['TEST_GCE_REGION'],\n 'credentials'...
[ "def register_load_balancer_instances(self):...\n", "\"\"\"docstring\"\"\"\n", "payload = self.agent.type_to_payload(\n 'registerInstancesWithGoogleLoadBalancerDescription', {\n 'loadBalancerNames': [self.__use_lb_name], 'instanceIds': self.\n use_instance_names[:2], 'region': self.bindings['TEST_GCE_R...
[ 0, 0, 0, 0, 1, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Expr'", "Return'" ]
[ "def __repr__(self):...\n", "return self.get_name()\n" ]
[ "def __repr__(self):...\n", "return self.get_name()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(self):...\n", "VAR_2 = self.get_user()\n", "if VAR_2:\n", "VAR_5 = VAR_2.user_id\n", "VAR_5 = None\n", "return VAR_5\n" ]
[ "def get_user_id(self):...\n", "user = self.get_user()\n", "if user:\n", "user_id = user.user_id\n", "user_id = None\n", "return user_id\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Assign'", "Return'" ]
[ "@utils.synchronized('3par', external=True)...\n", "\"\"\"docstring\"\"\"\n", "self.common.client_login()\n", "VAR_20 = self._create_host(VAR_6, VAR_9)\n", "VAR_21 = self.common.create_vlun(VAR_6, VAR_20)\n", "VAR_22 = self.common.get_ports()\n", "self.common.client_logout()\n", "VAR_23 = {'driver_vol...
[ "@utils.synchronized('3par', external=True)...\n", "\"\"\"docstring\"\"\"\n", "self.common.client_login()\n", "host = self._create_host(volume, connector)\n", "vlun = self.common.create_vlun(volume, host)\n", "ports = self.common.get_ports()\n", "self.common.client_logout()\n", "info = {'driver_volume...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "def FUNC_7(self):...\n", "return self.content\n" ]
[ "def read(self):...\n", "return self.content\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@api_post...\n", "VAR_7 = VAR_3.pop('submit_id', None)\n", "VAR_0.submit(VAR_7=submit_id, config=body)\n", "return JsonResponse({'status': True, 'submit_id': VAR_7}, encoder=JsonSerialize\n )\n" ]
[ "@api_post...\n", "submit_id = body.pop('submit_id', None)\n", "submit_manager.submit(submit_id=submit_id, config=body)\n", "return JsonResponse({'status': True, 'submit_id': submit_id}, encoder=\n JsonSerialize)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_15(self):...\n", "self.run_test_case(self.scenario.enable_server_group())\n" ]
[ "def test_f_enable_server_group(self):...\n", "self.run_test_case(self.scenario.enable_server_group())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@defer.inlineCallbacks...\n", "if self._mode.is_single_user:\n", "VAR_61 = CLASS_0(VAR_19, self._tmp_dir.name)\n", "yield VAR_61.start()\n", "self.accounts[VAR_19] = VAR_61\n" ]
[ "@defer.inlineCallbacks...\n", "if self._mode.is_single_user:\n", "account = AppTestAccount(account_name, self._tmp_dir.name)\n", "yield account.start()\n", "self.accounts[account_name] = account\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Assign'", "Expr'", "Assign'" ]
[ "def FUNC_3(self, VAR_9):...\n", "for VAR_10 in VAR_9:\n", "self.analyze_scene(VAR_10)\n" ]
[ "def analyze_scenes(self, chunk):...\n", "for scene in chunk:\n", "self.analyze_scene(scene)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'" ]
[ "def FUNC_4(self, VAR_7):...\n", "\"\"\"docstring\"\"\"\n", "VAR_12 = VAR_7.get('lang', 'en')\n", "if VAR_12 == 'cn':\n", "VAR_18 = 'https://www.zhihu.com/api/v3/oauth/captcha?lang=cn'\n", "VAR_18 = 'https://www.zhihu.com/api/v3/oauth/captcha?lang=en'\n", "VAR_10 = self.session.get(VAR_18, VAR_7=headers...
[ "def _get_captcha(self, headers):...\n", "\"\"\"docstring\"\"\"\n", "lang = headers.get('lang', 'en')\n", "if lang == 'cn':\n", "api = 'https://www.zhihu.com/api/v3/oauth/captcha?lang=cn'\n", "api = 'https://www.zhihu.com/api/v3/oauth/captcha?lang=en'\n", "resp = self.session.get(api, headers=headers)\n...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Expr'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'" ]
[ "def __init__(self, VAR_1, VAR_2, VAR_3, VAR_4=None):...\n", "self.logger = VAR_4 or logging.getLogger('ContentInstaller')\n", "VAR_12, VAR_13, VAR_14 = self._sanity_check_path(VAR_1, VAR_2, VAR_3)\n", "self.src_path = VAR_12\n", "self.dst_path = VAR_13\n", "self.www_root = VAR_14\n" ]
[ "def __init__(self, src_path, dst_path, www_root, logger=None):...\n", "self.logger = logger or logging.getLogger('ContentInstaller')\n", "_src, _dst, _www = self._sanity_check_path(src_path, dst_path, www_root)\n", "self.src_path = _src\n", "self.dst_path = _dst\n", "self.www_root = _www\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_14(self, VAR_11, VAR_12):...\n", "self.common._cli_run('createhost -iscsi -add %s %s' % (VAR_11, VAR_12), None)\n" ]
[ "def _modify_3par_iscsi_host(self, hostname, iscsi_iqn):...\n", "self.common._cli_run('createhost -iscsi -add %s %s' % (hostname, iscsi_iqn),\n None)\n" ]
[ 0, 2 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_1(self):...\n", "self.assertTrue({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n limit_page_length=None))\n" ]
[ "def test_basic(self):...\n", "self.assertTrue({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n limit_page_length=None))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_0(self):...\n", "self.assertTrue(self.client.login(username='autotest', password='password'))\n" ]
[ "def setUp(self):...\n", "self.assertTrue(self.client.login(username='autotest', password='password'))\n" ]
[ 0, 5 ]
[ "FunctionDef'", "Expr'" ]
[ "def __iter__(self):...\n", "return iter(self._flattened)\n" ]
[ "def __iter__(self):...\n", "return iter(self._flattened)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_8(self, VAR_2, VAR_3, VAR_4, VAR_7={}):...\n", "self.write(VAR_2, VAR_3, VAR_4, {'state': 'pending'}, VAR_7=context)\n", "return True\n" ]
[ "def set_pending(self, cr, uid, ids, context={}):...\n", "self.write(cr, uid, ids, {'state': 'pending'}, context=context)\n", "return True\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "from django.utils import timezone\n", "from django.db.models import Avg, Count, Min, Max, Sum\n", "def FUNC_0(VAR_0):...\n", "from pages.models import Post\n", "VAR_1 = Post.objects.filter(published_date__lte=timezone.now())\n", "VAR_2 = Post.objects.values('subject').annotate(newest_published_date=Max(\...
[ "from django.utils import timezone\n", "from django.db.models import Avg, Count, Min, Max, Sum\n", "def navbarmain(request):...\n", "from pages.models import Post\n", "navbarMain = Post.objects.filter(published_date__lte=timezone.now())\n", "pb = Post.objects.values('subject').annotate(newest_published_da...
[ 0, 0, 0, 0, 4, 4, 4, 4 ]
[ "ImportFrom'", "ImportFrom'", "FunctionDef'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_2(VAR_0, VAR_6=None):...\n", "VAR_0 = VAR_0.groupby('matched_id').matched_id.count().as_matrix()\n", "VAR_0 = VAR_0.astype(int)\n", "VAR_26 = list(VAR_0).count(1)\n", "VAR_27 = np.delete(VAR_0, np.argwhere(VAR_0 == 1))\n", "if VAR_26 == len(VAR_0):\n", "VAR_30 = pd.DataFrame({'contacts': [VAR_...
[ "def get_contact_dist(data, bins=None):...\n", "data = data.groupby('matched_id').matched_id.count().as_matrix()\n", "data = data.astype(int)\n", "one_contact = list(data).count(1)\n", "rest = np.delete(data, np.argwhere(data == 1))\n", "if one_contact == len(data):\n", "df_hist = pd.DataFrame({'contact...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Return'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def __init__(self, VAR_5, VAR_3):...\n", "self.smart_list = VAR_5\n", "self.object = VAR_3\n" ]
[ "def __init__(self, smart_list, object):...\n", "self.smart_list = smart_list\n", "self.object = object\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'" ]
[ "def FUNC_3(VAR_10=None, VAR_4=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = VAR_10 or []\n", "VAR_4 = VAR_4 or []\n", "VAR_13 = hashlib.md5(str(time.time())).hexdigest()\n", "VAR_14 = []\n", "for VAR_18, VAR_9 in VAR_10:\n", "VAR_18 = FUNC_2(VAR_18)\n", "for VAR_18, VAR_19, VAR_9 in VAR_4:\n",...
[ "def EncodeMultipartFormData(fields=None, files=None):...\n", "\"\"\"docstring\"\"\"\n", "fields = fields or []\n", "files = files or []\n", "boundary = hashlib.md5(str(time.time())).hexdigest()\n", "body_list = []\n", "for key, value in fields:\n", "key = _ConvertToAscii(key)\n", "for key, filename...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "For", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "AugAssign'", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'", "Expr'", "Expr'", "Expr'", "...
[ "def FUNC_0(self):...\n", "" ]
[ "def get(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "from django.http import HttpRequest, HttpResponseRedirect\n", "from ..models import GroupReservation, ArticleRequested, Article, ArticleGroup, SubReservation\n", "from .magic import get_current_user\n", "import json\n", "import datetime\n", "RESERVATION_CONSTRUCTION_COOKIE_KEY: str = (\n 'org.technikr...
[ "from django.http import HttpRequest, HttpResponseRedirect\n", "from ..models import GroupReservation, ArticleRequested, Article, ArticleGroup, SubReservation\n", "from .magic import get_current_user\n", "import json\n", "import datetime\n", "RESERVATION_CONSTRUCTION_COOKIE_KEY: str = (\n 'org.technikr...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Import'", "AnnAssign'", "AnnAssign'", "FunctionDef'", "AnnAssign'", "FunctionDef'", "AnnAssign'", "Condition", "Assign'", "Assign'", "Condition", "Return'", "AnnAssign'", "Assign'", "Condition", "Return'", "Condition", ...
[ "def __init__(self, VAR_7, VAR_71=20, **VAR_16):...\n", "self.num = VAR_71\n", "CLASS_0.__init__(self, VAR_7=param, **kw)\n" ]
[ "def __init__(self, param, num=20, **kw):...\n", "self.num = num\n", "Validator.__init__(self, param=param, **kw)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'" ]
[ "def FUNC_0(self, VAR_2, VAR_3, VAR_4):...\n", "if not VAR_4:\n", "return\n", "if validate_hash(VAR_4):\n", "if validate_url(VAR_4):\n", "VAR_21 = VirusTotalAPI().hash_fetch(VAR_4)\n", "VAR_2['errors'].append('Error retrieving file hash: %s' % e)\n", "VAR_18 = Files.create(VAR_3, VAR_4, VAR_21)\n", ...
[ "def _handle_string(self, submit, tmppath, line):...\n", "if not line:\n", "return\n", "if validate_hash(line):\n", "if validate_url(line):\n", "filedata = VirusTotalAPI().hash_fetch(line)\n", "submit['errors'].append('Error retrieving file hash: %s' % e)\n", "filepath = Files.create(tmppath, line, fi...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Condition", "Condition", "Assign'", "Expr'", "Assign'", "Expr'", "Expr'", "Return'", "Expr'", "Return'", "Return'" ]
[ "@VAR_13.whitelist()...\n", "if isinstance(VAR_4, string_types):\n", "VAR_4 = json.loads(VAR_4)\n", "VAR_9 = VAR_13.get_meta(VAR_1)\n", "if VAR_0:\n", "FUNC_0(VAR_0)\n", "if not VAR_0:\n", "VAR_0 = 'name'\n", "VAR_14 = VAR_13.get_hooks().standard_queries or {}\n", "if VAR_3 and VAR_3.split()[0].lo...
[ "@frappe.whitelist()...\n", "if isinstance(filters, string_types):\n", "filters = json.loads(filters)\n", "meta = frappe.get_meta(doctype)\n", "if searchfield:\n", "sanitize_searchfield(searchfield)\n", "if not searchfield:\n", "searchfield = 'name'\n", "standard_queries = frappe.get_hooks().standar...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "For", "Condition", "Condit...
[ "def FUNC_8(self):...\n", "" ]
[ "def describe(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_1():...\n", "return [webapp2.Route('/internal/cron/ereporter2/cleanup', CLASS_6),\n webapp2.Route('/internal/cron/ereporter2/mail', CLASS_5)]\n" ]
[ "def get_backend_routes():...\n", "return [webapp2.Route('/internal/cron/ereporter2/cleanup',\n CronEreporter2Cleanup), webapp2.Route('/internal/cron/ereporter2/mail',\n CronEreporter2Mail)]\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "from dataclasses import dataclass\n", "from typing import Dict\n", "import exifread\n", "from exifread.classes import IfdTag\n", "from geopy.geocoders import Nominatim\n", "from photogpsbot import bot, log, db, User\n", "\"\"\"\n Coordinates have invalid format\n \"\"\"\n", "\"\"\"\n There i...
[ "from dataclasses import dataclass\n", "from typing import Dict\n", "import exifread\n", "from exifread.classes import IfdTag\n", "from geopy.geocoders import Nominatim\n", "from photogpsbot import bot, log, db, User\n", "\"\"\"\n Coordinates have invalid format\n \"\"\"\n", "\"\"\"\n There i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "AnnAssign'", "AnnAssign'", "AnnAssign'", "AnnAssign'", "AnnAssign'", "AnnAssign'", "AnnAssign'", "AnnAssign'", "Expr'", "AnnAssign'", "AnnAssi...
[ "def FUNC_16(self, VAR_17):...\n", "if not path.exists(VAR_17):\n", "return None\n", "VAR_50 = sqlite3.connect(VAR_17)\n", "return None\n", "VAR_51 = {}\n", "for VAR_59 in VAR_50.execute('SELECT * FROM desc;').fetchall():\n", "VAR_51[VAR_59[0]] = VAR_59[1]\n", "return VAR_51\n" ]
[ "def get_database_desc(self, db_file):...\n", "if not path.exists(db_file):\n", "return None\n", "db = sqlite3.connect(db_file)\n", "return None\n", "desc = {}\n", "for row in db.execute('SELECT * FROM desc;').fetchall():\n", "desc[row[0]] = row[1]\n", "return desc\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Assign'", "Return'", "Assign'", "For", "Assign'", "Return'" ]
[ "def FUNC_3(self, VAR_4):...\n", "if isinstance(VAR_4, datetime.datetime) or isinstance(VAR_4, datetime.date):\n", "return localize(VAR_4)\n", "return VAR_4\n" ]
[ "def format(self, value):...\n", "if isinstance(value, datetime.datetime) or isinstance(value, datetime.date):\n", "return localize(value)\n", "return value\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_10(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_24 = self.scripts['install']\n", "if VAR_24.exists:\n", "if VAR_24.contains('ynh_install_app_dependencies'):\n", "for VAR_18 in ['upgrade', 'restore']:\n", "if VAR_24.contains('yunohost service add'):\n", "if self.scripts[VAR_18].exists and no...
[ "def check_helper_consistency(self):...\n", "\"\"\"docstring\"\"\"\n", "install_script = self.scripts['install']\n", "if install_script.exists:\n", "if install_script.contains('ynh_install_app_dependencies'):\n", "for name in ['upgrade', 'restore']:\n", "if install_script.contains('yunohost service add'...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Condition", "For", "Condition", "Condition", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_23(self, VAR_12=False):...\n", "if self.DiagnosticsForCurrentFileReady():\n", "VAR_22 = self._latest_file_parse_request.Response()\n", "return []\n", "self._latest_file_parse_request = None\n", "if VAR_12:\n", "return vimsupport.ConvertDiagnosticsToQfList(VAR_22)\n", "return VAR_22\n" ]
[ "def GetDiagnosticsFromStoredRequest(self, qflist_format=False):...\n", "if self.DiagnosticsForCurrentFileReady():\n", "diagnostics = self._latest_file_parse_request.Response()\n", "return []\n", "self._latest_file_parse_request = None\n", "if qflist_format:\n", "return vimsupport.ConvertDiagnosticsToQf...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'", "Assign'", "Condition", "Return'", "Return'" ]
[ "def FUNC_16(self):...\n", "self.assertEqual(self.driver._get_space_in_gb('123.0GB'), 123.0)\n", "self.assertEqual(self.driver._get_space_in_gb('123.0TB'), 123.0 * 1024)\n", "self.assertEqual(self.driver._get_space_in_gb('1024.0MB'), 1.0)\n" ]
[ "def test_get_space_in_gb(self):...\n", "self.assertEqual(self.driver._get_space_in_gb('123.0GB'), 123.0)\n", "self.assertEqual(self.driver._get_space_in_gb('123.0TB'), 123.0 * 1024)\n", "self.assertEqual(self.driver._get_space_in_gb('1024.0MB'), 1.0)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_16(self):...\n", "return self.username\n" ]
[ "def returnUsername(self):...\n", "return self.username\n" ]
[ 0, 4 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_4(self, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = '/api/keys'\n", "VAR_5 = {'id': 'mykey@box.local', 'public': VAR_3}\n", "VAR_6 = self.client.post(VAR_4, json.dumps(VAR_5), content_type=\n 'application/json')\n", "self.assertEqual(VAR_6.status_code, 201)\n", "VAR_6 = self.client.p...
[ "def _check_duplicate_key(self, pubkey):...\n", "\"\"\"docstring\"\"\"\n", "url = '/api/keys'\n", "body = {'id': 'mykey@box.local', 'public': pubkey}\n", "response = self.client.post(url, json.dumps(body), content_type=\n 'application/json')\n", "self.assertEqual(response.status_code, 201)\n", "respo...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "from odoo import tools\n", "from odoo import api, fields, models\n", "VAR_0 = 'qc.problem.report'\n", "VAR_1 = 'Problem Tracking Report'\n", "VAR_2 = False\n", "VAR_3 = 'date'\n", "VAR_4 = 'date desc'\n", "VAR_5 = fields.Char('Name', readonly=True)\n", "VAR_6 = fields.Datetime('Helpdesk Create Date...
[ "from odoo import tools\n", "from odoo import api, fields, models\n", "_name = 'qc.problem.report'\n", "_description = 'Problem Tracking Report'\n", "_auto = False\n", "_rec_name = 'date'\n", "_order = 'date desc'\n", "name = fields.Char('Name', readonly=True)\n", "date = fields.Datetime('Helpdesk C...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Return'" ]
[ "@VAR_19.route('/test')...\n", "return 'OK'\n" ]
[ "@test_views.route('/test')...\n", "return 'OK'\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_1(self):...\n", "super(CLASS_1, self).setUp()\n", "VAR_12 = patch('pavelib.utils.test.suites.bokchoy_suite.sh')\n", "self._mock_sh = VAR_12.start()\n", "self.addCleanup(VAR_12.stop)\n" ]
[ "def setUp(self):...\n", "super(TestPaverPa11yCrawlerCmd, self).setUp()\n", "mock_sh = patch('pavelib.utils.test.suites.bokchoy_suite.sh')\n", "self._mock_sh = mock_sh.start()\n", "self.addCleanup(mock_sh.stop)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_21(VAR_21):...\n", "\"\"\"docstring\"\"\"\n", "return json.load(VAR_0)\n", "VAR_0.seek(0)\n", "import yaml\n", "return yaml.load(VAR_0)\n" ]
[ "def _load_configfile(configpath):...\n", "\"\"\"docstring\"\"\"\n", "return json.load(f)\n", "f.seek(0)\n", "import yaml\n", "return yaml.load(f)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'", "Expr'", "Import'", "Return'" ]
[ "def FUNC_4():...\n", "VAR_33 = FUNC_3(VAR_21=parent, VAR_22=child, VAR_23=\n ExtractedChemicalFormSet, VAR_24=ExtractedChemicalForm)\n", "return CLASS_16, VAR_33\n" ]
[ "def one():...\n", "ChemicalFormSet = make_formset(parent_model=parent, model=child, formset=\n ExtractedChemicalFormSet, form=ExtractedChemicalForm)\n", "return ExtractedTextForm, ChemicalFormSet\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "@utils.synchronized('3par', external=True)...\n", "\"\"\"docstring\"\"\"\n", "self.common.client_login()\n", "VAR_23 = self.common.create_volume_from_snapshot(VAR_7, VAR_9)\n", "self.common.client_logout()\n", "return {'metadata': VAR_23}\n" ]
[ "@utils.synchronized('3par', external=True)...\n", "\"\"\"docstring\"\"\"\n", "self.common.client_login()\n", "metadata = self.common.create_volume_from_snapshot(volume, snapshot)\n", "self.common.client_logout()\n", "return {'metadata': metadata}\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_42(self):...\n", "VAR_32 = list()\n", "for VAR_14 in self.get_columns_list():\n", "if not self.is_relation(VAR_14):\n", "return VAR_32\n", "VAR_38 = self.get_property_first_col(VAR_14).name\n", "VAR_32.append(VAR_14)\n", "if not self.is_pk(VAR_38) and not self.is_fk(VAR_38) and not self.is_i...
[ "def get_search_columns_list(self):...\n", "ret_lst = list()\n", "for col_name in self.get_columns_list():\n", "if not self.is_relation(col_name):\n", "return ret_lst\n", "tmp_prop = self.get_property_first_col(col_name).name\n", "ret_lst.append(col_name)\n", "if not self.is_pk(tmp_prop) and not self....
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "For", "Condition", "Return'", "Assign'", "Expr'", "Condition", "Expr'" ]
[ "def __setattr__(self, VAR_10, VAR_11):...\n", "if self.__dict__.get(VAR_10):\n", "self.__dict__[VAR_10] = VAR_11\n" ]
[ "def __setattr__(self, name, value):...\n", "if self.__dict__.get(name):\n", "self.__dict__[name] = value\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'" ]
[ "def FUNC_11(self, VAR_14=None, VAR_15=False, VAR_16=False, VAR_17=1, VAR_18...\n", "self.global_resources = dict() if VAR_52 is None else VAR_52\n", "self.global_resources['_cores'] = VAR_17\n", "self.global_resources['_nodes'] = VAR_18\n", "def FUNC_2(VAR_87):...\n", "return map(self._rules.__getitem__,...
[ "def execute(self, targets=None, dryrun=False, touch=False, cores=1, nodes=1,...\n", "self.global_resources = dict() if resources is None else resources\n", "self.global_resources['_cores'] = cores\n", "self.global_resources['_nodes'] = nodes\n", "def rules(items):...\n", "return map(self._rules.__getitem...
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Return'" ]
[ "def FUNC_18(self, VAR_25, VAR_27):...\n", "VAR_20 = request_mock(VAR_25=path, method='PUT', VAR_27=body, VAR_28={\n 'Content-Type': ['application/json']})\n", "return self._render(VAR_20)\n" ]
[ "def put(self, path, body):...\n", "request = request_mock(path=path, method='PUT', body=body, headers={\n 'Content-Type': ['application/json']})\n", "return self._render(request)\n" ]
[ 0, 5, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def __eq__(self, VAR_25):...\n", "VAR_0 = VAR_25._file if isinstance(VAR_25, CLASS_0) else VAR_25\n", "return self._file == VAR_0\n" ]
[ "def __eq__(self, other):...\n", "f = other._file if isinstance(other, _IOFile) else other\n", "return self._file == f\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_0(self, VAR_2, VAR_3, VAR_4, VAR_5):...\n", "\"\"\"docstring\"\"\"\n", "VAR_6 = []\n", "VAR_7 = self.pool.get('ir.model.data')\n", "VAR_8 = self.pool.get('res.users').browse(VAR_2, VAR_3, VAR_3).company_id.id\n", "VAR_9 = self.pool.get('account.bank.statement')\n", "VAR_10 = self.pool.get('ir....
[ "def open_statement(self, cr, uid, ids, context):...\n", "\"\"\"docstring\"\"\"\n", "list_statement = []\n", "mod_obj = self.pool.get('ir.model.data')\n", "company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id\n", "statement_obj = self.pool.get('account.bank.statement')\n", "sequenc...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", ...
[ "def FUNC_33(VAR_32):...\n", "" ]
[ "def _iter(item):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_9(VAR_12):...\n", "if os.path.isfile(VAR_12):\n", "VAR_41 = f.read()\n", "return None\n", "return VAR_41\n" ]
[ "def read_file_contents(local_filepath):...\n", "if os.path.isfile(local_filepath):\n", "data = f.read()\n", "return None\n", "return data\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'", "Return'" ]
[ "def FUNC_28(self, VAR_15):...\n", "" ]
[ "def edit(self, item):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_0(VAR_0, VAR_1):...\n", "VAR_3 = os.path.dirname(os.path.abspath(__file__))\n", "VAR_4 = Environment(loader=FileSystemLoader(UTILS_DIR))\n", "return VAR_4.get_template('templates/eb/config.yml').render(APPLICATION_NAME\n =application_name, DEFAULT_REGION=default_region)\n" ]
[ "def make_eb_config(application_name, default_region):...\n", "UTILS_DIR = os.path.dirname(os.path.abspath(__file__))\n", "j2_env = Environment(loader=FileSystemLoader(UTILS_DIR))\n", "return j2_env.get_template('templates/eb/config.yml').render(APPLICATION_NAME\n =application_name, DEFAULT_REGION=default_...
[ 0, 0, 3, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_6(self, VAR_40):...\n", "if VAR_40 and len(VAR_40) > 500:\n", "VAR_101.errors.add(errors.DESC_TOO_LONG)\n", "return unkeep_space(VAR_40 or '')\n" ]
[ "def run(self, description):...\n", "if description and len(description) > 500:\n", "c.errors.add(errors.DESC_TOO_LONG)\n", "return unkeep_space(description or '')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'", "Return'" ]
[ "def FUNC_4(self):...\n", "VAR_2 = CLASS_1.construct_testscript_command('test_interactive_program.py')\n", "self.assertEqual(p.stdout.readline(), 'test_program X\\n')\n", "self.assertEqual(p.stdout.readline(), 'Type in a number:\\n')\n", "p.stdin.write('33\\n')\n", "p.stdin.flush()\n", "self.assertEqual...
[ "def test_run_interactive_shell_command(self):...\n", "command = RunShellCommandTest.construct_testscript_command(\n 'test_interactive_program.py')\n", "self.assertEqual(p.stdout.readline(), 'test_program X\\n')\n", "self.assertEqual(p.stdout.readline(), 'Type in a number:\\n')\n", "p.stdin.write('33\\n'...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_9(self, VAR_19):...\n", "for VAR_14 in VAR_19:\n", "f.write(VAR_14 + '\\n')\n", "VAR_3.debug('Created %s' % self.output_file)\n" ]
[ "def write_lines(self, lines):...\n", "for line in lines:\n", "f.write(line + '\\n')\n", "LOG.debug('Created %s' % self.output_file)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'", "Expr'" ]
[ "def FUNC_8(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = self.bindings\n", "VAR_15 = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n", "VAR_12 = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider':\n 'aws', 'type': 'destroyServerGroup', 'serverGroupNam...
[ "def delete_server_group(self):...\n", "\"\"\"docstring\"\"\"\n", "bindings = self.bindings\n", "group_name = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings[\n 'TEST_STACK'])\n", "payload = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider':\n 'aws', 'type': 'destroyServerGr...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Return'" ]
[ "def __init__(self, VAR_15, VAR_16, VAR_17):...\n", "\"\"\"docstring\"\"\"\n", "self._name = 'Netatmo {} {}'.format(VAR_16, VAR_5[VAR_17][0])\n", "self.netatmo_data = VAR_15\n", "self.module_name = VAR_16\n", "self.type = VAR_17\n", "self._state = None\n", "self._device_class = VAR_5[self.type][3]\n",...
[ "def __init__(self, netatmo_data, module_name, sensor_type):...\n", "\"\"\"docstring\"\"\"\n", "self._name = 'Netatmo {} {}'.format(module_name, SENSOR_TYPES[sensor_type][0])\n", "self.netatmo_data = netatmo_data\n", "self.module_name = module_name\n", "self.type = sensor_type\n", "self._state = None\n"...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "@VAR_0.route('/<productId>/reviews/<userId>', methods=['PUT'])...\n", "VAR_18 = FUNC_6()\n", "ProductsRepository.add_product_review(VAR_6, VAR_7, VAR_18)\n", "return 'Duplicate'\n", "return 'Ok'\n" ]
[ "@products.route('/<productId>/reviews/<userId>', methods=['PUT'])...\n", "review = get_review()\n", "ProductsRepository.add_product_review(productId, userId, review)\n", "return 'Duplicate'\n", "return 'Ok'\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Expr'", "Return'", "Return'" ]
[ "def FUNC_22(VAR_30, VAR_3):...\n", "if not isinstance(VAR_30, _IOFile):\n", "return IOFile(VAR_30, VAR_16=self)\n", "return VAR_30.apply_wildcards(VAR_3, fill_missing=f in self.dynamic_input,\n fail_dynamic=self.dynamic_output)\n" ]
[ "def concretize_iofile(f, wildcards):...\n", "if not isinstance(f, _IOFile):\n", "return IOFile(f, rule=self)\n", "return f.apply_wildcards(wildcards, fill_missing=f in self.dynamic_input,\n fail_dynamic=self.dynamic_output)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Return'", "Return'" ]
[ "def FUNC_20(VAR_18, VAR_20, VAR_10, VAR_26, VAR_27, VAR_28):...\n", "VAR_48 = VAR_20, VAR_4[VAR_20]['name']\n", "VAR_34 = FUNC_1(VAR_10)\n", "VAR_49 = SubmitUserTestRequest(VAR_34, VAR_48, base_url=CWS_BASE_URL,\n VAR_26=submission_format, VAR_27=filenames)\n", "VAR_49.execute()\n", "VAR_31 = VAR_49.g...
[ "def cws_submit_user_test(contest_id, task_id, user_id, submission_format,...\n", "task = task_id, created_tasks[task_id]['name']\n", "browser = get_cws_browser(user_id)\n", "sr = SubmitUserTestRequest(browser, task, base_url=CWS_BASE_URL,\n submission_format=submission_format, filenames=filenames)\n", "...
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Return'" ]
[ "def FUNC_8(VAR_0):...\n", "VAR_24, VAR_25 = os.path.split(VAR_0)\n", "return VAR_25 or os.path.basename(VAR_24)\n" ]
[ "def path_leaf(path):...\n", "head, tail = os.path.split(path)\n", "return tail or os.path.basename(head)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_41(self):...\n", "for VAR_40 in self._names:\n", "yield VAR_40, getattr(self, VAR_40)\n" ]
[ "def items(self):...\n", "for name in self._names:\n", "yield name, getattr(self, name)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'" ]
[ "def FUNC_0():...\n", "if VAR_8 is None:\n", "VAR_8 = Browser()\n", "return VAR_8\n", "VAR_53 = AWSLoginRequest(VAR_8, VAR_5['username'], VAR_5['password'],\n base_url=AWS_BASE_URL)\n", "VAR_8.login(VAR_53)\n" ]
[ "def get_aws_browser():...\n", "if aws_browser is None:\n", "aws_browser = Browser()\n", "return aws_browser\n", "lr = AWSLoginRequest(aws_browser, admin_info['username'], admin_info[\n 'password'], base_url=AWS_BASE_URL)\n", "aws_browser.login(lr)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Return'", "Assign'", "Expr'" ]
[ "def FUNC_36(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_11 = 'TRUNCATE TABLE players;'\n", "tools.query(VAR_11)\n", "self.assertEqual(FUNC_5(VAR_1='Double Quarder', VAR_2='Playland'), 0)\n", "VAR_11 = 'SELECT * FROM matches ORDER BY id LIMIT 1'\n", "VAR_13 = tools.query(VAR_11)\n", "VAR_14 = VAR_13...
[ "def test_p1_not_valid(self):...\n", "\"\"\"docstring\"\"\"\n", "q = 'TRUNCATE TABLE players;'\n", "tools.query(q)\n", "self.assertEqual(dummy_player(player_name='Double Quarder', country=\n 'Playland'), 0)\n", "q = 'SELECT * FROM matches ORDER BY id LIMIT 1'\n", "p = tools.query(q)\n", "i1 = p[0][...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_5(VAR_4, *VAR_5, **VAR_6):...\n", "" ]
[ "def dummy_handler(remote, *args, **kargs):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "@FUNC_0...\n", "VAR_12 = await get_session(VAR_3)\n", "if 'uname' not in VAR_12:\n", "return VAR_4\n", "return 'string' % VAR_12['uname']\n" ]
[ "@handle_html...\n", "session = await get_session(request)\n", "if 'uname' not in session:\n", "return base\n", "return \"\"\"<b>You're already logged in as <i>%s</i>!</b>\n<form action='/login' method='post'><input type='submit' name='action' value='logout'/></form>\"\"\" % session[\n 'uname']\n" ]
[ 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Condition", "Return'", "Return'" ]
[ "def __init__(self, VAR_24):...\n", "self.redirections = VAR_24\n", "self.stack = None\n" ]
[ "def __init__(self, redirections):...\n", "self.redirections = redirections\n", "self.stack = None\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'" ]
[ "def FUNC_6(self):...\n", "VAR_21 = self.agent.type_to_payload('deleteGoogleHttpLoadBalancerDescription',\n {'loadBalancerName': self.__use_http_lb_name, 'credentials': self.\n bindings['GCE_CREDENTIALS']})\n", "VAR_20 = gcp.GceContractBuilder(self.gce_observer)\n", "VAR_20.new_clause_builder('Health Ch...
[ "def delete_http_load_balancer(self):...\n", "payload = self.agent.type_to_payload('deleteGoogleHttpLoadBalancerDescription',\n {'loadBalancerName': self.__use_http_lb_name, 'credentials': self.\n bindings['GCE_CREDENTIALS']})\n", "builder = gcp.GceContractBuilder(self.gce_observer)\n", "builder.new_cla...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "def __init__(self, VAR_10, VAR_11={}):...\n", "self._leap_provider = VAR_10\n", "self._credentials = VAR_11.copy()\n" ]
[ "def __init__(self, leap_provider, credentials={}):...\n", "self._leap_provider = leap_provider\n", "self._credentials = credentials.copy()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'" ]
[ "def FUNC_8(self, VAR_18, VAR_11):...\n", "VAR_24 = [self.key_name]\n", "VAR_25 = self.lhs\n", "while isinstance(VAR_25, CLASS_2):\n", "VAR_24.insert(0, VAR_25.key_name)\n", "VAR_26, VAR_27 = VAR_18.compile(VAR_25)\n", "VAR_25 = VAR_25.lhs\n", "if len(VAR_24) > 1:\n", "return '(%s %s %%s)' % (VAR_26...
[ "def as_sql(self, compiler, connection):...\n", "key_transforms = [self.key_name]\n", "previous = self.lhs\n", "while isinstance(previous, KeyTransform):\n", "key_transforms.insert(0, previous.key_name)\n", "lhs, params = compiler.compile(previous)\n", "previous = previous.lhs\n", "if len(key_transfor...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4 ]
[ "FunctionDef'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Condition", "Return'", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_9(VAR_10):...\n", "\"\"\"docstring\"\"\"\n", "VAR_42 = []\n", "for field in ['arrayjoin', 'groupby', 'orderby', 'selected_columns']:\n", "if field in VAR_10:\n", "if 'conditions' in VAR_10:\n", "VAR_42.extend(FUNC_0(VAR_10[field]))\n", "VAR_67 = list(chain(*[([c] if FUNC_8(c) else c) for c i...
[ "def all_referenced_columns(body):...\n", "\"\"\"docstring\"\"\"\n", "col_exprs = []\n", "for field in ['arrayjoin', 'groupby', 'orderby', 'selected_columns']:\n", "if field in body:\n", "if 'conditions' in body:\n", "col_exprs.extend(to_list(body[field]))\n", "flat_conditions = list(chain(*[([c] if i...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Condition", "Condition", "Expr'", "Assign'", "Condition", "Expr'", "Expr'", "Return'" ]
[ "def FUNC_39(VAR_101):...\n", "VAR_101.shellcmd = VAR_81\n", "return VAR_101\n" ]
[ "def decorate(ruleinfo):...\n", "ruleinfo.shellcmd = cmd\n", "return ruleinfo\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_8(self):...\n", "self.create_temp_file()\n", "if self.body is not None:\n", "self.write_body_to_temp_file()\n", "self.open_temp_file()\n", "VAR_19 = self.get_temp_file_data()\n", "if VAR_19 != self.body:\n", "self.body = VAR_19\n", "self.remove_temp_file()\n", "VAR_3 = ('UPDATE jdk_entri...
[ "def edit_entry(self):...\n", "self.create_temp_file()\n", "if self.body is not None:\n", "self.write_body_to_temp_file()\n", "self.open_temp_file()\n", "body_new = self.get_temp_file_data()\n", "if body_new != self.body:\n", "self.body = body_new\n", "self.remove_temp_file()\n", "sql = ('UPDATE j...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Condition", "Expr'", "Expr'", "Assign'", "Condition", "Assign'", "Expr'", "Assign'", "Return'", "Expr'", "Expr'" ]
[ "def FUNC_10(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_35 = len(self._target_roots)\n", "self.run_tracker.pantsd_stats.set_target_root_size(VAR_35)\n", "return VAR_35\n" ]
[ "def _set_target_root_count_in_runtracker(self):...\n", "\"\"\"docstring\"\"\"\n", "target_count = len(self._target_roots)\n", "self.run_tracker.pantsd_stats.set_target_root_size(target_count)\n", "return target_count\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_3(self, VAR_2, VAR_9):...\n", "VAR_2 = db.get_dataset(VAR_2)\n", "VAR_1 = db.User.select().where(db.User.email == VAR_9).get()\n", "db.UserAccessLog.create(VAR_1=user, VAR_2=dataset, action='access_revoked')\n" ]
[ "def post(self, dataset, email):...\n", "dataset = db.get_dataset(dataset)\n", "user = db.User.select().where(db.User.email == email).get()\n", "db.UserAccessLog.create(user=user, dataset=dataset, action='access_revoked')\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_8(self, VAR_9, VAR_10=None, VAR_11=None):...\n", "get_and_check_project(VAR_9, VAR_11)\n", "VAR_28 = self.queryset.get(VAR_10=pk, VAR_1=project_pk)\n", "VAR_26 = CLASS_1(VAR_28)\n", "return Response(VAR_26.data)\n" ]
[ "def retrieve(self, request, pk=None, project_pk=None):...\n", "get_and_check_project(request, project_pk)\n", "task = self.queryset.get(pk=pk, project=project_pk)\n", "serializer = TaskSerializer(task)\n", "return Response(serializer.data)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_39(VAR_101):...\n", "VAR_101.params = VAR_71, VAR_72\n", "return VAR_101\n" ]
[ "def decorate(ruleinfo):...\n", "ruleinfo.params = params, kwparams\n", "return ruleinfo\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_9(self):...\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.HTTPError('url', 400, 'error message',\n None, None))\n", "self._mox.ReplayAll()\n", "self.assertIsNone(url_helper.UrlOpen('url', max_tries=10))\n", "self._mox.VerifyAll...
[ "def testUrlOpenHTTPErrorNoRetry(self):...\n", "url_helper.urllib2.urlopen(mox.IgnoreArg(), mox.IgnoreArg(), timeout=mox.\n IgnoreArg()).AndRaise(urllib2.HTTPError('url', 400, 'error message',\n None, None))\n", "self._mox.ReplayAll()\n", "self.assertIsNone(url_helper.UrlOpen('url', max_tries=10))\n", ...
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "import unittest\n", "from ... import create_app\n", "VAR_0 = FUNC_0('config.TestConfig')\n", "\"\"\"A base test case.\"\"\"\n", "def FUNC_0(self):...\n", "VAR_0.config.from_object('config.TestConfig')\n", "return VAR_0\n" ]
[ "import unittest\n", "from ... import create_app\n", "app = create_app('config.TestConfig')\n", "\"\"\"A base test case.\"\"\"\n", "def create_app(self):...\n", "app.config.from_object('config.TestConfig')\n", "return app\n" ]
[ 4, 4, 4, 4, 0, 4, 4 ]
[ "Import'", "ImportFrom'", "Assign'", "Expr'", "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_18(self, VAR_3):...\n", "print('ERROR: database connection is down (error: {0})'.format(VAR_3.value))\n", "return DeadConnectionDetector.startReconnecting(self, VAR_3)\n" ]
[ "def startReconnecting(self, f):...\n", "print('ERROR: database connection is down (error: {0})'.format(f.value))\n", "return DeadConnectionDetector.startReconnecting(self, f)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Return'" ]
[ "def FUNC_0(VAR_6):...\n", "@wraps(VAR_6)...\n", "if 'logged_in' in VAR_10:\n", "return VAR_6(*VAR_8, **kwargs)\n", "flash('Unauthorized, Please login', 'danger')\n", "return redirect(url_for('login'))\n" ]
[ "def is_logged_in(f):...\n", "@wraps(f)...\n", "if 'logged_in' in session:\n", "return f(*args, **kwargs)\n", "flash('Unauthorized, Please login', 'danger')\n", "return redirect(url_for('login'))\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Condition", "Return'", "Expr'", "Return'" ]
[ "def FUNC_2(VAR_3):...\n", "return VAR_3 if VAR_3 and VAR_4.match(VAR_3) else None\n" ]
[ "def chkpass(x):...\n", "return x if x and pass_rx.match(x) else None\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(self, VAR_4=None, VAR_5=None, VAR_6=True):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_6 and self.load_cookies():\n", "if self.check_login():\n", "VAR_7 = self.session.headers.copy()\n", "return True\n", "VAR_7.update({'authorization': 'oauth c3cef7c66a1843f8b3a9e6a1e3160e20',\n 'X-Xsrftoke...
[ "def login(self, username=None, password=None, load_cookies=True):...\n", "\"\"\"docstring\"\"\"\n", "if load_cookies and self.load_cookies():\n", "if self.check_login():\n", "headers = self.session.headers.copy()\n", "return True\n", "headers.update({'authorization': 'oauth c3cef7c66a1843f8b3a9e6a1e316...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Condition", "Assign'", "Return'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Return'", "Return'" ]
[ "def FUNC_12(self):...\n", "\"\"\"docstring\"\"\"\n", "return self.to_bytes().decode('ascii')\n" ]
[ "def to_str(self):...\n", "\"\"\"docstring\"\"\"\n", "return self.to_bytes().decode('ascii')\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "from flask import render_template, redirect, url_for, request, flash, abort, Markup, send_from_directory\n", "from app import app, fbdb\n", "from .forms import ProcessingForm, FILE_MAP\n", "from . import utils\n", "from shutil import copyfile, rmtree\n", "import os\n", "import tempfile\n", "import re...
[ "from flask import render_template, redirect, url_for, request, flash, abort, Markup, send_from_directory\n", "from app import app, fbdb\n", "from .forms import ProcessingForm, FILE_MAP\n", "from . import utils\n", "from shutil import copyfile, rmtree\n", "import os\n", "import tempfile\n", "import re...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Import'", "Import'", "Import'", "Condition", "Return'" ]
[ "def FUNC_39(VAR_101):...\n", "VAR_101.version = VAR_78\n", "return VAR_101\n" ]
[ "def decorate(ruleinfo):...\n", "ruleinfo.version = version\n", "return ruleinfo\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_6(self, VAR_64):...\n", "VAR_90 = VAR_64.split(',')\n", "return Thing._by_fullname(VAR_90, data=True, return_dict=False)\n" ]
[ "def run(self, id_str):...\n", "tids = id_str.split(',')\n", "return Thing._by_fullname(tids, data=True, return_dict=False)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_5(self):...\n", "" ]
[ "def _check_children_depth(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]