index
int64
0
100k
blob_id
stringlengths
40
40
code
stringlengths
7
7.27M
steps
listlengths
1
1.25k
error
bool
2 classes
7,000
248b9b9d613f71e0130353f0792083b7d3f6ccd6
lista = [x for x in range(11)] ##todo: wazne kwadraty = [i**2 for i in lista] kwadraty = [(i, i**2, i**3) for i in range(-10, 11)] zbior_wyr = {'aa', '1233', '111111'} slownik = {i : len(i)for i in zbior_wyr} print(kwadraty, slownik, sep='\n')
[ "lista = [x for x in range(11)] ##todo: wazne\n\nkwadraty = [i**2 for i in lista]\nkwadraty = [(i, i**2, i**3) for i in range(-10, 11)]\nzbior_wyr = {'aa', '1233', '111111'}\nslownik = {i : len(i)for i in zbior_wyr}\n\nprint(kwadraty, slownik, sep='\\n')", "lista = [x for x in range(11)]\nkwadraty = [(i ** 2) for...
false
7,001
e7d7a002547047a9bcae830be96dd35db80a86e8
from authtools.models import AbstractNamedUser class User(AbstractNamedUser): USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['name']
[ "from authtools.models import AbstractNamedUser\n\n\nclass User(AbstractNamedUser):\n USERNAME_FIELD = 'email'\n REQUIRED_FIELDS = ['name']\n", "<import token>\n\n\nclass User(AbstractNamedUser):\n USERNAME_FIELD = 'email'\n REQUIRED_FIELDS = ['name']\n", "<import token>\n\n\nclass User(AbstractName...
false
7,002
a967b97f090a71f28e33c5ca54cb64db3967aea3
import pandas as pd # 칼럼값으로 추가 - 함수 작성 # 1. cv_diff_value : 종가 일간 변화량 def cv_diff_value(prevalue, postvalue): return postvalue - prevalue # 2. cv_diff_rate : 종가 일간 변화율 def cv_diff_rate(prevalue, postvalue): return (postvalue - prevalue) / prevalue * 100 # 3. cv_maN_value : 종가의 N일 이동평균 def cv_maN_value(cv, ...
[ "import pandas as pd\n\n# 칼럼값으로 추가 - 함수 작성\n# 1. cv_diff_value : 종가 일간 변화량\ndef cv_diff_value(prevalue, postvalue):\n return postvalue - prevalue\n\n\n# 2. cv_diff_rate : 종가 일간 변화율\ndef cv_diff_rate(prevalue, postvalue):\n return (postvalue - prevalue) / prevalue * 100\n\n\n# 3. cv_maN_value : 종가의 N일 이동평균\nde...
false
7,003
2b82d66803ae0a0b03204318975d3c122f34f0cf
import gdal import sys, gc sys.path.append("..") import getopt import redis import time import subprocess import numpy as np from os import listdir, makedirs from os.path import isfile, join, exists from operator import itemgetter from natsort import natsorted from config import DatasetConfig, RasterParams from datase...
[ "import gdal\nimport sys, gc\n\nsys.path.append(\"..\")\nimport getopt\nimport redis\nimport time\nimport subprocess\nimport numpy as np\nfrom os import listdir, makedirs\nfrom os.path import isfile, join, exists\nfrom operator import itemgetter\nfrom natsort import natsorted\nfrom config import DatasetConfig, Rast...
false
7,004
01d545e77c211201332a637a493d27608721aad5
from os import environ as env import json import utils import utils.aws as aws import utils.handlers as handlers def put_record_to_logstream(event: utils.LambdaEvent) -> str: """Put a record of source Lambda execution in LogWatch Logs.""" log_group_name = env["REPORT_LOG_GROUP_NAME"] utils.Log.info("Fet...
[ "from os import environ as env\nimport json\n\nimport utils\nimport utils.aws as aws\nimport utils.handlers as handlers\n\n\ndef put_record_to_logstream(event: utils.LambdaEvent) -> str:\n \"\"\"Put a record of source Lambda execution in LogWatch Logs.\"\"\"\n log_group_name = env[\"REPORT_LOG_GROUP_NAME\"]\n...
false
7,005
c5a2c00d53111d62df413907d4ff4ca5a02d4035
import argparse from time import sleep from threading import Thread from threading import Lock from multiprocessing.connection import Listener from multiprocessing.connection import Client ADDRESS = '127.0.0.1' PORT = 5000 # Threaded function snippet def threaded(fn): def wrapper(*args, **kwargs): thread ...
[ "import argparse\nfrom time import sleep\nfrom threading import Thread\nfrom threading import Lock\nfrom multiprocessing.connection import Listener\nfrom multiprocessing.connection import Client\n\nADDRESS = '127.0.0.1'\nPORT = 5000\n\n# Threaded function snippet\ndef threaded(fn):\n def wrapper(*args, **kwargs)...
false
7,006
80469fd945a21c1bd2b5590047016a4b60880c88
''' Created on May 18, 2010 @author: Abi.Mohammadi & Majid.Vesal ''' from threading import current_thread import copy import time from deltapy.core import DeltaException, Context import deltapy.security.services as security_services import deltapy.security.session.services as session_services import deltapy.unique...
[ "'''\nCreated on May 18, 2010\n\n@author: Abi.Mohammadi & Majid.Vesal\n'''\n\nfrom threading import current_thread\n\nimport copy\nimport time\n\nfrom deltapy.core import DeltaException, Context\n\nimport deltapy.security.services as security_services\nimport deltapy.security.session.services as session_services\ni...
false
7,007
ac46aa6f8f4f01b6f3c48532533b9dd41a8a1c1c
import abc class Connector: """@abc.abstractmethod def connect(self): pass """ @abc.abstractmethod def save(self, item): pass @abc.abstractmethod def load_all(self): pass @abc.abstractmethod def load_by_id(self, i...
[ "import abc\r\n\r\n\r\nclass Connector:\r\n\r\n\r\n \"\"\"@abc.abstractmethod\r\n def connect(self):\r\n pass\r\n \"\"\"\r\n \r\n @abc.abstractmethod\r\n def save(self, item):\r\n pass\r\n \r\n\r\n @abc.abstractmethod\r\n def load_all(self):\r\n pass\r\n \r\n \r...
false
7,008
7d21e76383b80e8a4433fb11cb3b64efee7a6d3b
from angrytux.model.game_objects.obstacle_states.HittedState import HittedState from angrytux.model.game_objects.obstacle_states.ObstacleState import ObstacleState class NewState(ObstacleState): @property def delete(self) -> bool: """ Don't delete this obstacle :return: False ...
[ "from angrytux.model.game_objects.obstacle_states.HittedState import HittedState\n\nfrom angrytux.model.game_objects.obstacle_states.ObstacleState import ObstacleState\n\n\nclass NewState(ObstacleState):\n @property\n def delete(self) -> bool:\n \"\"\"\n Don't delete this obstacle\n :retu...
false
7,009
e7b2e716fbcaf761e119003000bf1b16af57a2b7
import numpy as np import matplotlib.pyplot as plt import csv category = ["Ecological Well-being", "Health & Human Services", "Arts & Culture", "Community Building", "Environment"] arr = np.empty((0, 6), str) moneyGranted = [[0]*5 for _ in range(6)] moneyRequested = [[0]*5 for _ in range(6)] perFull = [[0]*5 f...
[ "import numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport csv\r\n\r\ncategory = [\"Ecological Well-being\", \"Health & Human Services\", \"Arts & Culture\", \"Community Building\", \"Environment\"]\r\narr = np.empty((0, 6), str)\r\nmoneyGranted = [[0]*5 for _ in range(6)]\r\nmoneyRequested = [[0]*5 for _ in ...
false
7,010
ab9d8e36518c4d42f1e29fbc5552078a5a338508
# Example 15-5. Using a BookDict, but not quite as intended >>> from books import BookDict >>> pp = BookDict(title='Programming Pearls', ... authors='Jon Bentley', ... isbn='0201657880', ... pagecount=256) >>> pp {'title': 'Programming Pearls', 'authors': 'Jon Bentley', 'isbn'...
[ "# Example 15-5. Using a BookDict, but not quite as intended\n\n>>> from books import BookDict\n>>> pp = BookDict(title='Programming Pearls',\n... authors='Jon Bentley',\n... isbn='0201657880',\n... pagecount=256)\n>>> pp\n{'title': 'Programming Pearls', 'authors': 'Jon Ben...
true
7,011
7168a8eb401478aa26ee9033262bb5c8fe33f186
# This file imports all files for this module for easy inclusions around the game. from viewController import * from navigationController import * from noticer import * from Images import * from fancyButton import * from constants import * from textObject import * from UIButton import * # from spriteFromRect import ...
[ "\n# This file imports all files for this module for easy inclusions around the game.\n\n\nfrom viewController import *\nfrom navigationController import *\nfrom noticer import *\nfrom Images import *\nfrom fancyButton import *\nfrom constants import *\nfrom textObject import *\nfrom UIButton import *\n# from sprit...
false
7,012
865121e7eb5f9c70adf44d33d21f30c22f13ec56
import numpy as np import torch import torch.nn as nn from torch.nn.functional import interpolate from torchvision.ops.boxes import batched_nms class MTCNN(): def __init__(self, device=None, model=None): if device is None: device = 'cuda' if torch.cuda.is_available() else 'cpu' self.device = device url = '...
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.nn.functional import interpolate\nfrom torchvision.ops.boxes import batched_nms\n\n\nclass MTCNN():\n\tdef __init__(self, device=None, model=None):\n\t\tif device is None:\n\t\t\tdevice = 'cuda' if torch.cuda.is_available() else 'cpu'\n\t\tself.de...
false
7,013
d4621ef378b89490278c09e569f781aef1fcef3f
class WSCommand: handshake_hi='handshake_hi' ping = 'ping' pong = 'pong' http_call = 'http_call' http_return = 'http_return' class WSMessage: def __init__(self, command: str, data: any = None) -> None: self.command = command self.data = data def strData(self) -> str: return se...
[ "\n\nclass WSCommand:\n handshake_hi='handshake_hi'\n ping = 'ping'\n pong = 'pong'\n http_call = 'http_call'\n http_return = 'http_return'\n\n\nclass WSMessage:\n def __init__(self, command: str, data: any = None) -> None:\n \n self.command = command\n self.data = data\n \n\n def strData(self)...
false
7,014
3882aaf94b19967a1d1eff23fa4862ea71de3b38
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sun Jul 8 18:04:13 2018 @author: zhangchi """ class Solution(object): def transpose(self, A): """ :type A: List[List[int]] :rtype: List[List[int]] """ row = len(A[0]) result = [[] for _ in range(row)] ...
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Jul 8 18:04:13 2018\n\n@author: zhangchi\n\"\"\"\n\nclass Solution(object):\n def transpose(self, A):\n \"\"\"\n :type A: List[List[int]]\n :rtype: List[List[int]]\n \"\"\"\n row = len(A[0])\n resu...
true
7,015
43362c564be0dfbc8f246a0589bcebde245ab7b5
import requests save_result = requests.post( 'http://localhost:5000/save', json={'value': 'witam'} ) print(save_result.text) read_result = requests.get('http://localhost:5000/read') print(read_result.text)
[ "import requests\n\nsave_result = requests.post(\n 'http://localhost:5000/save',\n json={'value': 'witam'}\n)\nprint(save_result.text)\n\nread_result = requests.get('http://localhost:5000/read')\nprint(read_result.text)", "import requests\nsave_result = requests.post('http://localhost:5000/save', json={'val...
false
7,016
1cfb0690ebe1d7c6ab93fa6a4bc959b90b991bc8
{ "module_spec": { "module_name": "Spec1" } }
[ "{\n \"module_spec\": {\n \"module_name\": \"Spec1\"\n }\n}\n\n", "{'module_spec': {'module_name': 'Spec1'}}\n", "<code token>\n" ]
false
7,017
8e317d4d8ae8dc3d692d237e7e0abfaf37aecbb6
from .kahfm_batch import KaHFMBatch
[ "from .kahfm_batch import KaHFMBatch", "from .kahfm_batch import KaHFMBatch\n", "<import token>\n" ]
false
7,018
6defbe25fc17e53df2fc4d32886bba1cb141bdfd
import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec from sklearn.preprocessing import normalize def blackbox_function(x, y=None, sim=False): if sim: if y is None: return -x ** 2 + 6 else: return -(x+y) ** 2 + 6 # Reading the magnitude of t...
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import gridspec\nfrom sklearn.preprocessing import normalize\n\ndef blackbox_function(x, y=None, sim=False):\n if sim:\n if y is None:\n return -x ** 2 + 6\n else:\n return -(x+y) ** 2 + 6\n\n # Reading t...
false
7,019
2bc5711839ccbe525551b60211d8cd79ddb7775a
# coding=utf-8 # @FileName: test_json.py # @Author: ZhengQiang # Date: 2020/1/15 5:26 下午 import json a = "{\"ddd\": {{}}}" def boyhook(dic): print('test') if dic['name']: return dic['name'], dic['age'] return dic new_boy = json.loads(a, object_hook=boyhook) print(new_boy)
[ "# coding=utf-8\n# @FileName: test_json.py\n# @Author: ZhengQiang\n# Date: 2020/1/15 5:26 下午\nimport json\na = \"{\\\"ddd\\\": {{}}}\"\n\ndef boyhook(dic):\n print('test')\n if dic['name']:\n return dic['name'], dic['age']\n return dic\n\nnew_boy = json.loads(a, object_hook=boyhook)\nprint(new_boy)"...
false
7,020
2bfdc259bcd5ff058ee8661a14afd8a915b8372b
""".. Ignore pydocstyle D400.""" from rolca.payment.api.views import ( PaymentViewSet, ) routeList = ((r'payment', PaymentViewSet),)
[ "\"\"\".. Ignore pydocstyle D400.\"\"\"\nfrom rolca.payment.api.views import (\n PaymentViewSet,\n)\n\nrouteList = ((r'payment', PaymentViewSet),)\n", "<docstring token>\nfrom rolca.payment.api.views import PaymentViewSet\nrouteList = ('payment', PaymentViewSet),\n", "<docstring token>\n<import token>\nroute...
false
7,021
a1bf4b941b845b43ec640b19a001e290b46c488c
#!/usr/bin/env python # coding: utf-8 # HR Employee Retension Rate, predicting an employee likely to leave or not. # In[ ]: import numpy as np # 数组常用库 import pandas as pd # 读入csv常用库 from patsy import dmatrices # 可根据离散变量自动生成哑变量 from sklearn.linear_model import LogisticRegression # sk-learn库Logistic Regression模型 from skl...
[ "#!/usr/bin/env python\n# coding: utf-8\n# HR Employee Retension Rate, predicting an employee likely to leave or not.\n# In[ ]:\nimport numpy as np # 数组常用库\nimport pandas as pd # 读入csv常用库\nfrom patsy import dmatrices # 可根据离散变量自动生成哑变量\nfrom sklearn.linear_model import LogisticRegression # sk-learn库Logistic Regressio...
false
7,022
96bb865b66e5d9ba62bab210705338f1799cc490
# Generated by Django 3.2.5 on 2021-08-28 12:34 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('userProfile', '0022_auto_20210823_1858'), ] operations = [ migrations.RemoveField( model_name='...
[ "# Generated by Django 3.2.5 on 2021-08-28 12:34\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('userProfile', '0022_auto_20210823_1858'),\n ]\n\n operations = [\n migrations.RemoveField(\n ...
false
7,023
a094207b2cd9a5a4bd409ac8a644268f3808e346
# -*- coding: utf-8 -*- from django.db import models from django.contrib.auth.models import User from django import forms from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User TYPE_ENT = ( ( 'ROOT' , 'ROOT' ), ( 'TIERS', 'TIERS'), ) class EntiteClass(models.Mode...
[ "# -*- coding: utf-8 -*-\n\nfrom django.db import models\n\nfrom django.contrib.auth.models import User\nfrom django import forms\n\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.contrib.auth.models import User\n\nTYPE_ENT = (\n ( 'ROOT' , 'ROOT' ),\n\t( 'TIERS', 'TIERS'),\n\t\t)\n\nclass ...
false
7,024
28ed494939d0928bf3ad4f07f58186374e925426
import numpy as np from random import randint def combinacaoDeEmbralhamento(qtdeLinhas): while True: a = randint(0,qtdeLinhas) b = randint(0,qtdeLinhas) if a == b : continue else: break resp = [[a,b]] return resp def embaralhaMatriz(x): for i in range(qtdeLinhas): print(i) combinacaoDeEmbralha...
[ "import numpy as np\nfrom random import randint\n\ndef combinacaoDeEmbralhamento(qtdeLinhas):\n\twhile True:\n\t\ta = randint(0,qtdeLinhas)\n\t\tb = randint(0,qtdeLinhas)\n\t\tif a == b :\n\t\t\tcontinue\n\t\telse:\n\t\t\tbreak\n\tresp = [[a,b]]\n\treturn resp\n\n\t\n\ndef embaralhaMatriz(x):\n\tfor i in range(qtde...
false
7,025
2749a262bf8da99aa340e878c15a6dba01acc38c
""" 复习 面向对象:考虑问题从对象的角度出发. 抽象:从多个事物中,舍弃个别的/非本质的特征(不重要), 抽出共性的本质(重要的)过程。 三大特征: 封装:将每个变化点单独分解到不同的类中。 例如:老张开车去东北 做法:定义人类,定义车类。 继承:重用现有类的功能和概念,并在此基础上进行扩展。 统一概念 例如:图形管理器,统计圆形/矩形.....面积。 ...
[ "\"\"\"\n 复习\n 面向对象:考虑问题从对象的角度出发.\n 抽象:从多个事物中,舍弃个别的/非本质的特征(不重要),\n 抽出共性的本质(重要的)过程。\n 三大特征:\n 封装:将每个变化点单独分解到不同的类中。\n 例如:老张开车去东北\n 做法:定义人类,定义车类。\n\n 继承:重用现有类的功能和概念,并在此基础上进行扩展。\n 统一概念\n 例如:图形管理器,统计圆...
false
7,026
17db8f7a35004a1f2bd8d098aff39928d20511da
# https://docs.python.org/3/library/math.html # https://metanit.com/python/tutorial/6.2.php # https://habr.com/ru/post/337260/ # https://habr.com/ru/post/112953/ import math num = 8 float_num = 2.5 power = 8 rad = 0.5 grad = 90 n = 16 n10 = 1000 base = 2 print("math.pow:", math.pow(num, power)) # проблема точности ...
[ "# https://docs.python.org/3/library/math.html\n# https://metanit.com/python/tutorial/6.2.php\n# https://habr.com/ru/post/337260/\n# https://habr.com/ru/post/112953/\nimport math\n\n\nnum = 8\nfloat_num = 2.5\npower = 8\nrad = 0.5\ngrad = 90\nn = 16\nn10 = 1000\nbase = 2\n\nprint(\"math.pow:\", math.pow(num, power)...
false
7,027
8dff22249abbae9e30ba1ad423457270e0cd9b20
# Generated by Django 2.1.1 on 2018-09-24 04:59 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('backend', '0001_initial'), ] operations = [ migrations.CreateModel( name='Aro', fie...
[ "# Generated by Django 2.1.1 on 2018-09-24 04:59\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('backend', '0001_initial'),\n ]\n\n operations = [\n migrations.CreateModel(\n name='Ar...
false
7,028
5acbd6002c5e3cfac942d52b788f18c6afa92da2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('examen', '0002_auto_20161122_1836'), ] operations = [ migrations.RemoveField( model_name='actuacionventa', ...
[ "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('examen', '0002_auto_20161122_1836'),\n ]\n\n operations = [\n migrations.RemoveField(\n model_name='act...
false
7,029
55b4448caa73bcb50a15eb46d07328934fce72c8
import os import numpy as np import nibabel as nib def loop_access(n,m,data,tpl): if n >m: return loop_access(n,m+1,data[tpl[m]],tpl) else: return data[tpl[m]] def loop_rec(n,m,mapCoords,dims,data,tple): if n >= m: for x in range(dims[m]): loop_rec(n,m+1,mapCoords,dims,...
[ "import os\nimport numpy as np\nimport nibabel as nib\n\ndef loop_access(n,m,data,tpl):\n if n >m:\n return loop_access(n,m+1,data[tpl[m]],tpl)\n else:\n return data[tpl[m]]\n\ndef loop_rec(n,m,mapCoords,dims,data,tple):\n if n >= m:\n for x in range(dims[m]):\n loop_rec(n,m...
false
7,030
30f030d48368e1b103f926ee7a15b4b75c4459c7
from datetime import timedelta import pandas as pd __all__ = ["FixWindowCutoffStrategy"] class CutoffStrategy: """ Class that holds a CutoffStrategy. This is a measure to prevent leakage Parameters ---------- generate_fn: a function that generates a cutoff time for a given entity. input...
[ "from datetime import timedelta\n\nimport pandas as pd\n\n__all__ = [\"FixWindowCutoffStrategy\"]\n\n\nclass CutoffStrategy:\n \"\"\"\n Class that holds a CutoffStrategy. This is a measure to prevent leakage\n\n Parameters\n ----------\n generate_fn: a function that generates a cutoff time for a give...
false
7,031
ad474f5120ca2a8c81b18071ab364e6d6cf9e653
from typing import List from fastapi import Depends, FastAPI, HTTPException from sqlalchemy.orm import Session from myfirstpython.fastapi import models, crud, schemas from myfirstpython.fastapi.dbconnection import engine, SessionLocal models.Base.metadata.create_all(bind=engine) app = FastAPI() # Dependency def g...
[ "from typing import List\n\nfrom fastapi import Depends, FastAPI, HTTPException\nfrom sqlalchemy.orm import Session\n\nfrom myfirstpython.fastapi import models, crud, schemas\nfrom myfirstpython.fastapi.dbconnection import engine, SessionLocal\n\nmodels.Base.metadata.create_all(bind=engine)\n\napp = FastAPI()\n\n\n...
false
7,032
2064fe029bc7db14505a5b38750e324b55556abb
# Copyright 2022 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "# Copyright 2022 Huawei Technologies Co., Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l...
false
7,033
ddeff852e41b79fb71cea1e4dc71248ddef85d79
import itertools import numpy as np SAMPLER_CACHE = 10000 def cache_gen(source): values = source() while True: for value in values: yield value values = source() class Sampler: """Provides precomputed random samples of various distribution.""" randn_gen = cache_gen(la...
[ "import itertools\n\nimport numpy as np\n\n\nSAMPLER_CACHE = 10000\n\n\ndef cache_gen(source):\n values = source()\n while True:\n for value in values:\n yield value\n values = source()\n\n\nclass Sampler:\n \"\"\"Provides precomputed random samples of various distribution.\"\"\"\n...
false
7,034
02d7022c7d864354379009577d64109601190998
''' Inspection of the network with unlabelled data ''' import numpy as np import matplotlib.pyplot as plt from main import IMG_SIZE, MODEL_NAME, model model.load(MODEL_NAME) ''' COMMENT OUT FOLLOWING AS APPROPRIATE ''' # if you need to create the data: # test_data = process_test_...
[ "'''\r\nInspection of the network with unlabelled data\r\n'''\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom main import IMG_SIZE, MODEL_NAME, model\r\n\r\nmodel.load(MODEL_NAME)\r\n\r\n''' COMMENT OUT FOLLOWING AS APPROPRIATE '''\r\n# if you need to create the data:\r\n...
false
7,035
146aca6c7da17ddccb815638292cbcdda66f28e6
#!/usr/local/bin/python ''' side_on.py Open a 3d trajectory file (x y z) and produce a side-on plot of the y-z plane, with straight line between start and end and a virtual wall superimposed at 10 yards. arg1 = infile arg2 = optional outfile ''' import sys import matplotlib.pyplot as plt infile...
[ "#!/usr/local/bin/python\n\n''' side_on.py\n\n Open a 3d trajectory file (x y z) and produce a side-on plot of the\n y-z plane, with straight line between start and end and a virtual\n wall superimposed at 10 yards.\n\n arg1 = infile\n arg2 = optional outfile\n'''\n\nimport sys\nimport matplotlib.pyp...
true
7,036
6c86b4823756853bb502b34492ac8ad0a75daf7e
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2018-12-19 15:17 from __future__ import absolute_import from __future__ import unicode_literals from django.db import migrations, models from django.db.models import Count from tqdm import tqdm def remove_duplicate_legal_reasons(apps, purpose_slug, source_obje...
[ "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.16 on 2018-12-19 15:17\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nfrom django.db.models import Count\nfrom tqdm import tqdm\n\n\ndef remove_duplicate_legal_reasons(apps, purpose_sl...
false
7,037
e8e52cd0a0685e827ecbc6272657de5158fa0d94
import re ​ print("Кулик Валерія Максимівна\n " "Лабораторна робота №2 \n " "Варіант 10 \n " "Завдання №1. Обчислити формулу") ​ ​ def int_input(text): while True: user_input = input(text) if re.match('^[0-9]{1,}$', user_input): break else: print("По...
[ "import re\n​\nprint(\"Кулик Валерія Максимівна\\n \"\n \"Лабораторна робота №2 \\n \"\n \"Варіант 10 \\n \"\n \"Завдання №1. Обчислити формулу\")\n​\n​\ndef int_input(text):\n while True:\n user_input = input(text)\n if re.match('^[0-9]{1,}$', user_input):\n break\n ...
true
7,038
16302f23edf16e201c3f3e9800dc4a9290ddc29e
from django.conf.urls import url, include from . import views from django.conf import settings from django.conf.urls.static import static app_name = 'stock_main' urlpatterns = [ url(r'^$', views.Stock_main.as_view(), name='stock_main'), ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_RO...
[ "from django.conf.urls import url, include\nfrom . import views\n\nfrom django.conf import settings\nfrom django.conf.urls.static import static\n\napp_name = 'stock_main'\n\nurlpatterns = [\n url(r'^$', views.Stock_main.as_view(), name='stock_main'),\n]\n\nurlpatterns += static(settings.MEDIA_URL, document_root=...
false
7,039
471ce1eeb3293a424de74e25f36b76699a97ec2b
from mrjob.job import MRJob from mrjob.step import MRStep from collections import Counter import csv def read_csvLine(line): # Given a comma delimited string, return fields for row in csv.reader([line]): return row class MRTopVisitorCount(MRJob): # Mapper1: emit page_id, 1 def mapper_coun...
[ "from mrjob.job import MRJob\nfrom mrjob.step import MRStep\nfrom collections import Counter\nimport csv\n\ndef read_csvLine(line):\n # Given a comma delimited string, return fields\n for row in csv.reader([line]):\n return row\n\nclass MRTopVisitorCount(MRJob):\n \n # Mapper1: emit page_id, 1\n ...
false
7,040
83e1c86095de88692d0116f7e32bd485ab381b29
#!/usr/bin/env pypy from __future__ import print_function from __future__ import division import subprocess import random import math import sys import string randmin = int(sys.argv[1]) randmax = int(sys.argv[2]) random.seed(int(sys.argv[3])) n = random.randint(randmin, randmax) print('%d' % n)
[ "#!/usr/bin/env pypy\n\nfrom __future__ import print_function\nfrom __future__ import division\nimport subprocess\nimport random\nimport math\nimport sys\nimport string\n\nrandmin = int(sys.argv[1])\nrandmax = int(sys.argv[2])\nrandom.seed(int(sys.argv[3]))\n\nn = random.randint(randmin, randmax)\n\nprint('%d' % n)...
false
7,041
9905559909f10831373e659cde0f275dc5d71e0d
# Generated by Django 2.1.7 on 2019-03-18 02:25 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('training_area', '0006_remove_event_day'), ] operations = [ migrations.Crea...
[ "# Generated by Django 2.1.7 on 2019-03-18 02:25\n\nfrom django.conf import settings\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('training_area', '0006_remove_event_day'),\n ]\n\n operations = [\n ...
false
7,042
33f766bf12a82e25e36537d9d3b745b2444e1fd7
import turtle def draw_triangle(brad): brad.color("blue", "green") brad.fill(True) brad.forward(300) brad.left(120) brad.forward(300) brad.left(120) brad.forward(300) brad.end_fill() #jdjjdd brad.color("blue", "white") brad.fill(True) brad.left(180) brad.forward(150) ...
[ "import turtle\ndef draw_triangle(brad):\n brad.color(\"blue\", \"green\")\n brad.fill(True)\n\n brad.forward(300)\n brad.left(120)\n brad.forward(300)\n brad.left(120)\n brad.forward(300)\n brad.end_fill()\n#jdjjdd brad.color(\"blue\", \"white\")\n brad.fill(True)\n brad.left(180)\...
false
7,043
82c426836fee0560e917848084af4ca124e74dff
#Homework 09 #Raymond Guevara #018504731 #Algorithm Workbench #Question 1 print("Question 1") height = int(input("Please enter your height: ")) print() #Question 2 print("Question 2") color = input("please enter your favorite color: ") print() #Question 3 print("Question 3") a = -8/3 #Solved for variable "a" usin...
[ "#Homework 09\n#Raymond Guevara\n#018504731\n\n#Algorithm Workbench\n\n#Question 1\nprint(\"Question 1\")\nheight = int(input(\"Please enter your height: \"))\nprint()\n\n#Question 2\nprint(\"Question 2\")\ncolor = input(\"please enter your favorite color: \")\nprint()\n\n#Question 3\nprint(\"Question 3\")\na = -8/...
false
7,044
b935c48210b1965ebb0de78384f279b71fc17d5d
#!/usr/bin/python3 ################################################################################ # Usefull functions to shorten some of my plotting routine ##################### ################################################################################ import matplotlib.pyplot as plt import seaborn as sns i...
[ "#!/usr/bin/python3\n\n\n################################################################################\n# Usefull functions to shorten some of my plotting routine #####################\n################################################################################\n\nimport matplotlib.pyplot as plt\nimport sea...
false
7,045
b9622bede471c76ae36d3f59130d2be113310d4c
def watch(): print("시청하다") watch() print("tv.py의 module 이름은",__name__) #name은 __main__으로 나옴
[ "def watch():\n print(\"시청하다\")\nwatch()\n\nprint(\"tv.py의 module 이름은\",__name__) #name은 __main__으로 나옴", "def watch():\n print('시청하다')\n\n\nwatch()\nprint('tv.py의 module 이름은', __name__)\n", "def watch():\n print('시청하다')\n\n\n<code token>\n", "<function token>\n<code token>\n" ]
false
7,046
948b793359555f98872e0bdbf6db970ed1ff3b83
# Ques1: # To create a program that asks the user to enter their name and their age # and prints out a message addressed to them that tells them the year that # they will turn 100 years old. Additionally, the program asks the user for # another number and prints out that many copies of the previous message on ...
[ "# Ques1:\r\n# To create a program that asks the user to enter their name and their age \r\n# and prints out a message addressed to them that tells them the year that \r\n# they will turn 100 years old. Additionally, the program asks the user for \r\n# another number and prints out that many copies of the previous ...
false
7,047
41350714ce13e3627b9bd56eb934846a99f8e1b3
# -*- coding: utf-8 -*- import socket import os def http_header_parser(request): headers = {} lines = request.split('\n')[1:] for string in lines: first_pos = string.find(":") headers[string[:first_pos]] = string[first_pos + 2:] return headers def create_response(http_code, http_co...
[ "# -*- coding: utf-8 -*-\nimport socket\nimport os\n\n\ndef http_header_parser(request):\n headers = {}\n\n lines = request.split('\\n')[1:]\n for string in lines:\n first_pos = string.find(\":\")\n headers[string[:first_pos]] = string[first_pos + 2:]\n\n return headers\n\n\ndef create_res...
true
7,048
665a868ee71f247a621d82108e545257296e0427
''' Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = "ADOBECODEBANC" T = "ABC" Minimum window is "BANC". Note: If there is no such window in S that covers all characters in T, return the empty string "". If there are multipl...
[ "'''\nGiven a string S and a string T,\nfind the minimum window in S which will contain all the characters in T in complexity O(n).\n\nFor example,\nS = \"ADOBECODEBANC\"\nT = \"ABC\"\nMinimum window is \"BANC\".\n\nNote:\nIf there is no such window in S that covers all characters in T, return the empty string \"\"...
false
7,049
521b90ffb4bace4cbd50d08ed4be278d4f259822
from texttable import Texttable from nexuscli import exception from nexuscli.api import cleanup_policy from nexuscli.cli import constants def cmd_list(nexus_client): """Performs ``nexus3 cleanup_policy list``""" policies = nexus_client.cleanup_policies.list() if len(policies) == 0: return excepti...
[ "from texttable import Texttable\n\nfrom nexuscli import exception\nfrom nexuscli.api import cleanup_policy\nfrom nexuscli.cli import constants\n\n\ndef cmd_list(nexus_client):\n \"\"\"Performs ``nexus3 cleanup_policy list``\"\"\"\n policies = nexus_client.cleanup_policies.list()\n if len(policies) == 0:\n...
false
7,050
f59e61977f7c72ab191aadccbd72d23f831b3a1c
import items import grupo class Conexion: def __init__(self, direccion, destino): self.set_direccion(direccion) self.set_destino(destino) def __repr__(self): return str(self.direccion()) + ' => ' + str(self.destino()) def direccion(self): return self._direccion def se...
[ "import items\nimport grupo\n\nclass Conexion:\n def __init__(self, direccion, destino):\n self.set_direccion(direccion)\n self.set_destino(destino)\n\n def __repr__(self):\n return str(self.direccion()) + ' => ' + str(self.destino())\n\n def direccion(self):\n return self._dire...
false
7,051
f13a2820fe1766354109d1163c7e6fe887cd6f34
import sys, os sys.path.append(os.path.abspath('../models')) from GANSynth import flags as lib_flags from GANSynth import generate_util as gu from GANSynth import model as lib_model from GANSynth import util from GANSynth import train_util import tensorflow as tf import numpy as np import json from models.G...
[ "import sys, os\r\nsys.path.append(os.path.abspath('../models'))\r\n\r\nfrom GANSynth import flags as lib_flags\r\nfrom GANSynth import generate_util as gu\r\nfrom GANSynth import model as lib_model\r\nfrom GANSynth import util\r\nfrom GANSynth import train_util\r\nimport tensorflow as tf\r\nimport numpy as np\r\ni...
false
7,052
e086bebaa166abeea066fe49076f1b007858951f
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun May 17 17:24:39 2020 @author: code """ import sys import keras import cv2 import numpy import matplotlib import skimage print('Python: {}'.format(sys.version)) print('Numpy: {}'.format(numpy.__version__)) print('Keras: {}'.format(keras.__version__)) p...
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun May 17 17:24:39 2020\n\n@author: code\n\"\"\"\n\nimport sys\nimport keras\nimport cv2\nimport numpy\nimport matplotlib\nimport skimage\n\nprint('Python: {}'.format(sys.version))\nprint('Numpy: {}'.format(numpy.__version__))\nprint('Keras: {}'....
false
7,053
09dac7bfe98a15b3e79edcb0d0a53c0ab4d771ca
import os import random import pygame # Class for all the game's obstacles class Obstacle(pygame.sprite.Sprite): # Class constructor def __init__(self, game_params, game_speed): self.obs_type = random.randrange(0, 3) # Becomes a pterodactyl obstacle if (self.obs_type == 0): ...
[ "import os\nimport random\nimport pygame\n\n\n# Class for all the game's obstacles\nclass Obstacle(pygame.sprite.Sprite):\n # Class constructor\n def __init__(self, game_params, game_speed):\n self.obs_type = random.randrange(0, 3)\n # Becomes a pterodactyl obstacle\n if (self.obs_type ==...
false
7,054
4ed5ceb784fb1e3046ab9f10c4b556f2e94274db
import json import requests from pyyoutube import Api def get_data(YOUTUBE_API_KEY, videoId, maxResults, nextPageToken): """ Получение информации со страницы с видео по video id """ YOUTUBE_URI = 'https://www.googleapis.com/youtube/v3/commentThreads?key={KEY}&textFormat=plainText&' + \ ...
[ "import json\n\nimport requests\nfrom pyyoutube import Api\n\n\ndef get_data(YOUTUBE_API_KEY, videoId, maxResults, nextPageToken):\n \"\"\"\n Получение информации со страницы с видео по video id\n \"\"\"\n YOUTUBE_URI = 'https://www.googleapis.com/youtube/v3/commentThreads?key={KEY}&textFormat=plainText...
false
7,055
0b5fb649dc421187820677ce75f3cd0e804c18a3
#! /usr/bin/env python3 __all__ = [ 'FrameCorners', 'CornerStorage', 'build', 'dump', 'load', 'draw', 'without_short_tracks' ] import click import cv2 import numpy as np import pims from _corners import FrameCorners, CornerStorage, StorageImpl from _corners import dump, load, draw, withou...
[ "#! /usr/bin/env python3\n\n__all__ = [\n 'FrameCorners',\n 'CornerStorage',\n 'build',\n 'dump',\n 'load',\n 'draw',\n 'without_short_tracks'\n]\n\nimport click\nimport cv2\nimport numpy as np\nimport pims\n\nfrom _corners import FrameCorners, CornerStorage, StorageImpl\nfrom _corners import d...
false
7,056
c4f39f9212fbe0f591543d143cb8f1721c1f8e1e
""" Schema management for various object types (publisher, dataset etc). Loads the jsonschema and allows callers to validate a dictionary against them. """ import os import json import pubtool.lib.validators as v from jsonschema import validate, validators from jsonschema.exceptions import ValidationError SCHEMA = ...
[ "\"\"\"\nSchema management for various object types (publisher, dataset etc). Loads\nthe jsonschema and allows callers to validate a dictionary against them.\n\"\"\"\nimport os\nimport json\n\nimport pubtool.lib.validators as v\n\nfrom jsonschema import validate, validators\nfrom jsonschema.exceptions import Valid...
false
7,057
b4eb62413fb8069d8f11c34fbfecc742cd79bdb8
import random import matplotlib.pyplot as plt import tensorflow.keras as keras mnist = keras.datasets.mnist # MNIST datasets # Load Data and splitted to train & test sets # x : the handwritten data, y : the number (x_train_data, y_train_data), (x_test_data, y_test_data) = mnist.load_data() print('x_train_d...
[ "import random\r\nimport matplotlib.pyplot as plt\r\nimport tensorflow.keras as keras\r\n\r\nmnist = keras.datasets.mnist # MNIST datasets\r\n\r\n# Load Data and splitted to train & test sets\r\n# x : the handwritten data, y : the number\r\n(x_train_data, y_train_data), (x_test_data, y_test_data) = mnist.load_data(...
false
7,058
502e2d2222863236a42512ffc98c2cc9deaf454f
import os import subprocess import re # import fcntl # path_ffmpeg = path_ffmpeg = r'C:\work\ffmpeg\ffmpeg-3.4.2-win64-static\bin\ffmpeg.exe' dir_ts_files = r'E:\ts' dir_output = r'E:\hb' path_lock = r'C:\work\ffmpeg\encode.lock' def get_work_base(f_base): re_num = re.compile(r'(\d+)\-.+') r = re_num.searc...
[ "\n\nimport os\nimport subprocess\nimport re\n# import fcntl\n\n# path_ffmpeg = \npath_ffmpeg = r'C:\\work\\ffmpeg\\ffmpeg-3.4.2-win64-static\\bin\\ffmpeg.exe'\ndir_ts_files = r'E:\\ts'\ndir_output = r'E:\\hb'\npath_lock = r'C:\\work\\ffmpeg\\encode.lock'\n\ndef get_work_base(f_base):\n re_num = re.compile(r'(\\...
false
7,059
6a609c91122f8b66f57279cff221ee76e7fadb8c
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def splitListToParts(self, root, k): """ :type root: ListNode :type k: int :rtype: List[ListNode] """ if not root: return [None]*k res...
[ "# Definition for singly-linked list.\n# class ListNode(object):\n# def __init__(self, x):\n# self.val = x\n# self.next = None\n\nclass Solution(object):\n\tdef splitListToParts(self, root, k):\n\t\t\"\"\"\n\t\t:type root: ListNode\n\t\t:type k: int\n\t\t:rtype: List[ListNode]\n\t\t\"\"\"\n\t\t...
true
7,060
e4845e5aa949ec523515efc4d7996d647fddabdb
line_numbers = input().split(", ") print("Positive:", ", ".join(list(filter((lambda x: int(x) > -1), line_numbers)))) print("Negative:", ", ".join((list(filter((lambda x: int(x) < 0), line_numbers))))) print("Even:", ", ".join((list(filter((lambda x: int(x) % 2 == 0), line_numbers))))) print("Odd:", ", ".join((list(fil...
[ "line_numbers = input().split(\", \")\nprint(\"Positive:\", \", \".join(list(filter((lambda x: int(x) > -1), line_numbers))))\nprint(\"Negative:\", \", \".join((list(filter((lambda x: int(x) < 0), line_numbers)))))\nprint(\"Even:\", \", \".join((list(filter((lambda x: int(x) % 2 == 0), line_numbers)))))\nprint(\"Od...
false
7,061
e9a929dfef327737b54723579d3c57884fe61057
class Solution: # This would generate all permutations, but that's not what this question asks for # def combo(self, cur, n, ret, arr): # if cur == n: # arr.append(ret) # return # self.combo(cur+1, n, ret + "1", arr) # self.combo(cur+1, n, ret + "0", arr) def c...
[ "class Solution:\n\t# This would generate all permutations, but that's not what this question asks for\n # def combo(self, cur, n, ret, arr):\n # if cur == n:\n # arr.append(ret)\n # return\n # self.combo(cur+1, n, ret + \"1\", arr)\n # self.combo(cur+1, n, ret + \"0\",...
false
7,062
e6b84a2190a84c871e7191ef49fb7ee8b8148c9a
#finding postgresql info import re import subprocess def get_postgre_version(): p = subprocess.Popen("psql --version",stdout=subprocess.PIPE,shell=True) k = re.findall(r'psql\s+\(PostgreSQL\)\s+(.*)',p.stdout.read()) postgre_version = k[0] return postgre_version version=get_postgre_version() print ver...
[ "#finding postgresql info\nimport re\nimport subprocess\ndef get_postgre_version():\n p = subprocess.Popen(\"psql --version\",stdout=subprocess.PIPE,shell=True)\n k = re.findall(r'psql\\s+\\(PostgreSQL\\)\\s+(.*)',p.stdout.read())\n postgre_version = k[0]\n return postgre_version\n\n\nversion=get_postgr...
true
7,063
5ce5fbfa33c241fc316d5e414df01a39bfc9be18
# This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior # * Remove `managed =...
[ "# This is an auto-generated Django model module.\n# You'll have to do the following manually to clean this up:\n# * Rearrange models' order\n# * Make sure each model has one field with primary_key=True\n# * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior\n# * Remove ...
false
7,064
70cda2d6d3928cd8008daf221cd78665a9b05eea
#!/usr/bin/env python #coding:utf-8 """ Author: Wusf --<wushifan221@gmail.com> Purpose: Created: 2016/2/29 """ import os,sys,sqlite3 MyQtLibPath = os.path.abspath("D:\\MyQuantLib\\") sys.path.append(MyQtLibPath) import PCA.PCA_For_Stat_Arb2 as pca import pandas as pd import numpy as np import time def Compu...
[ "#!/usr/bin/env python\n#coding:utf-8\n\"\"\"\n Author: Wusf --<wushifan221@gmail.com>\n Purpose: \n Created: 2016/2/29\n\"\"\"\n\nimport os,sys,sqlite3\nMyQtLibPath = os.path.abspath(\"D:\\\\MyQuantLib\\\\\")\nsys.path.append(MyQtLibPath)\n\nimport PCA.PCA_For_Stat_Arb2 as pca\nimport pandas as pd\nimport nump...
true
7,065
85903f0c6bd4c896379c1357a08ae3bfa19d5415
import logging import random from pyage.core.address import Addressable from pyage.core.agent.agent import AbstractAgent from pyage.core.inject import Inject, InjectOptional logger = logging.getLogger(__name__) class AggregateAgent(Addressable, AbstractAgent): @Inject("aggregated_agents:_AggregateAgent__agents")...
[ "import logging\nimport random\nfrom pyage.core.address import Addressable\nfrom pyage.core.agent.agent import AbstractAgent\nfrom pyage.core.inject import Inject, InjectOptional\n\nlogger = logging.getLogger(__name__)\n\n\nclass AggregateAgent(Addressable, AbstractAgent):\n @Inject(\"aggregated_agents:_Aggregat...
false
7,066
b01ff71792895bb8839e09ae8c4a449405349990
''' Created on Mar 27, 2019 @author: Iulia ''' from Graph import Graph from Controller import * from Iterators.Vertices import * from File import File from Iterators.EdgesIterator import EdgesIterator def test(): tup = File.readInput("file.txt") graph = tup[0] edgeData = tup[1] ctrl = Controller(grap...
[ "'''\nCreated on Mar 27, 2019\n\n@author: Iulia\n'''\n\nfrom Graph import Graph\nfrom Controller import *\nfrom Iterators.Vertices import *\nfrom File import File\nfrom Iterators.EdgesIterator import EdgesIterator\n\ndef test():\n tup = File.readInput(\"file.txt\")\n graph = tup[0]\n edgeData = tup[1]\n ...
false
7,067
30c2d46d6587df3cbc3e83ecb7af787fcd86eb1f
from checkov.common.models.enums import CheckCategories, CheckResult from checkov.terraform.checks.resource.base_resource_negative_value_check import BaseResourceNegativeValueCheck class FunctionAppDisallowCORS(BaseResourceNegativeValueCheck): def __init__(self): name = "Ensure function apps are not acces...
[ "from checkov.common.models.enums import CheckCategories, CheckResult\nfrom checkov.terraform.checks.resource.base_resource_negative_value_check import BaseResourceNegativeValueCheck\n\n\nclass FunctionAppDisallowCORS(BaseResourceNegativeValueCheck):\n def __init__(self):\n name = \"Ensure function apps a...
false
7,068
fab75c5b55d85cef245fa6d7e04f4bf3a35e492c
from pwn import * DEBUG = False if DEBUG: p = process("binary_100") else: p = remote("bamboofox.cs.nctu.edu.tw", 22001) padding = 0x34 - 0xc payload = padding * "A" + p32(0xabcd1234) p.send(payload) p.interactive() p.close()
[ "from pwn import *\n\nDEBUG = False\n\nif DEBUG:\n p = process(\"binary_100\")\nelse:\n p = remote(\"bamboofox.cs.nctu.edu.tw\", 22001)\n\npadding = 0x34 - 0xc\n\npayload = padding * \"A\" + p32(0xabcd1234)\n\np.send(payload)\n\np.interactive()\np.close()\n", "from pwn import *\nDEBUG = False\nif DEBUG:\n ...
false
7,069
96131e3d6c67c0ee4ff7f69d4ffedcbf96470f14
# -*- coding: utf-8 -*- ############################################################################# # # Copyright (C) 2019-Antti Kärki. # Author: Antti Kärki. # # You can modify it under the terms of the GNU AFFERO # GENERAL PUBLIC LICENSE (AGPL v3), Version 3. # # This program is distributed ...
[ "# -*- coding: utf-8 -*-\r\n#############################################################################\r\n#\r\n# Copyright (C) 2019-Antti Kärki.\r\n# Author: Antti Kärki.\r\n#\r\n# You can modify it under the terms of the GNU AFFERO\r\n# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.\r\n#\r\n# This ...
false
7,070
b24ce9ed2df11df4cbf47949915685c09ec7543a
#!/usr/bin/python import sys import os import sqlite3 from matplotlib import pyplot as plt import numpy as np def main(): if len(sys.argv) < 2: print('usage: sqlite_file ...') sys.exit() db_filenames = sys.argv[1:] num_of_dbs = len(db_filenames) conn = sqlite3.connect(":memory:") c...
[ "#!/usr/bin/python\n\nimport sys\nimport os\nimport sqlite3\nfrom matplotlib import pyplot as plt\nimport numpy as np\n\ndef main():\n if len(sys.argv) < 2:\n print('usage: sqlite_file ...')\n sys.exit()\n db_filenames = sys.argv[1:]\n num_of_dbs = len(db_filenames)\n conn = sqlite3.connec...
false
7,071
e79cdd32977eb357c3f6709887b671c50eb1fa45
# boj, 9237 : 이장님 초대, python3 # 그리디 알고리즘 import sys def tree(l): return max([i+j+2 for i,j in enumerate(l)]) N = int(sys.stdin.readline()) t = sorted(list(map(int, sys.stdin.readline().split())), reverse = True) print(tree(t))
[ "# boj, 9237 : 이장님 초대, python3\n# 그리디 알고리즘\nimport sys\n\ndef tree(l):\n return max([i+j+2 for i,j in enumerate(l)])\n\n\nN = int(sys.stdin.readline())\nt = sorted(list(map(int, sys.stdin.readline().split())), reverse = True)\n\nprint(tree(t))", "import sys\n\n\ndef tree(l):\n return max([(i + j + 2) for i,...
false
7,072
8a6028aa477f697946ab75411b667f559e87141c
from aspose.email.storage.pst import * from aspose.email.mapi import MapiCalendar from aspose.email.mapi import MapiRecipientType from aspose.email.mapi import MapiRecipientCollection from aspose.email.mapi import MapiRecipient import datetime as dt from datetime import timedelta import os def run(): dataDir = "Dat...
[ "from aspose.email.storage.pst import *\nfrom aspose.email.mapi import MapiCalendar\nfrom aspose.email.mapi import MapiRecipientType\nfrom aspose.email.mapi import MapiRecipientCollection\nfrom aspose.email.mapi import MapiRecipient\n\nimport datetime as dt\nfrom datetime import timedelta\n\nimport os\n\ndef run():...
false
7,073
5bd7160b6b2e283e221aeb0a6913e6d13511c1db
#!/usr/bin/env python """ Plot EEG data. Usage: plotting.py [options] [<file>] Options: -h --help Show this screen. --version Show version. --center Center the data before plotting --sample-index=N Row index (indexed from one). --transpose Transpose data. --x...
[ "#!/usr/bin/env python\r\n\"\"\"\r\nPlot EEG data.\r\n\r\nUsage:\r\n plotting.py [options] [<file>]\r\n\r\nOptions:\r\n -h --help Show this screen.\r\n --version Show version.\r\n --center Center the data before plotting\r\n --sample-index=N Row index (indexed from one).\r\n --transp...
false
7,074
1d529e2ea5526ddcda0d0da30ed8ed4724002c63
import asyncio import logging import os from async_cron.job import CronJob from async_cron.schedule import Scheduler from sqlalchemy import asc import spider import squid import verifier from db import sess_maker from model import Proxy, STATUS_OK, STATUS_ERROR from server import run_api_server from tool import logge...
[ "import asyncio\nimport logging\nimport os\n\nfrom async_cron.job import CronJob\nfrom async_cron.schedule import Scheduler\nfrom sqlalchemy import asc\n\nimport spider\nimport squid\nimport verifier\nfrom db import sess_maker\nfrom model import Proxy, STATUS_OK, STATUS_ERROR\nfrom server import run_api_server\nfro...
false
7,075
3e7e6d7a0137d91dc7437ff91a39d7f8faad675e
#ERP PROJECT import pyrebase import smtplib config = { "apiKey": "apiKey", "authDomain": "erproject-dd24e-default-rtdb.firebaseapp.com", "databaseURL": "https://erproject-dd24e-default-rtdb.firebaseio.com", "storageBucket": "erproject-dd24e-default-rtdb.appspot.com" } firebase = pyrebase.initialize_app(conf...
[ "#ERP PROJECT\n\n\nimport pyrebase\nimport smtplib\n\nconfig = {\n \"apiKey\": \"apiKey\",\n \"authDomain\": \"erproject-dd24e-default-rtdb.firebaseapp.com\",\n \"databaseURL\": \"https://erproject-dd24e-default-rtdb.firebaseio.com\",\n \"storageBucket\": \"erproject-dd24e-default-rtdb.appspot.com\"\n}\n\nfireb...
false
7,076
9a7c6998e9e486f0497d3684f9c7a422c8e13521
import sys def caesar( plaintext, key ): if int( key ) < 0: return plaintext_ascii = [ ( ord( char ) + int( key ) ) for char in plaintext ] for ascii in plaintext_ascii: if ( ascii < 97 and ascii > 90 ) or ascii > 122: ascii -= 25 ciphertext = ''.join( [ chr( ascii ) for a...
[ "import sys\n\ndef caesar( plaintext, key ):\n if int( key ) < 0:\n return\n\n plaintext_ascii = [ ( ord( char ) + int( key ) ) for char in plaintext ]\n for ascii in plaintext_ascii:\n if ( ascii < 97 and ascii > 90 ) or ascii > 122:\n ascii -= 25\n\n ciphertext = ''.join( [ ch...
false
7,077
c36625dfbd733767b09fcb5505d029ae2b16aa44
# pylint: disable=wrong-import-position,wrong-import-order from gevent import monkey monkey.patch_all() from gevent.pywsgi import WSGIServer from waitlist.app import app http_server = WSGIServer(("0.0.0.0", 5000), app) http_server.serve_forever()
[ "# pylint: disable=wrong-import-position,wrong-import-order\nfrom gevent import monkey\n\nmonkey.patch_all()\n\nfrom gevent.pywsgi import WSGIServer\nfrom waitlist.app import app\n\nhttp_server = WSGIServer((\"0.0.0.0\", 5000), app)\nhttp_server.serve_forever()\n", "from gevent import monkey\nmonkey.patch_all()\n...
false
7,078
70d740a7003ca3f2d2cde039b2fc470ef2165e77
import struct from coapthon import defines from coapthon.utils import byte_len, bit_len, parse_blockwise __author__ = 'Giacomo Tanganelli' __version__ = "2.0" class BlockwiseLayer(object): """ Handles the Blockwise feature. """ def __init__(self, parent): """ Initialize a Blockwise L...
[ "import struct\nfrom coapthon import defines\nfrom coapthon.utils import byte_len, bit_len, parse_blockwise\n\n__author__ = 'Giacomo Tanganelli'\n__version__ = \"2.0\"\n\n\nclass BlockwiseLayer(object):\n \"\"\"\n Handles the Blockwise feature.\n \"\"\"\n\n def __init__(self, parent):\n \"\"\"\n ...
false
7,079
f9f835b24aa8fc77109db9e2d89a3f43bcb4b181
''' Load a variety of relevant physical parameters. All quantities are in atomic units, such that m_e = 1 e = 1 hbar = 1 1/4\pi\epsilon = 1 ''' import numpy as np hbar = 1.0 m_e = 1.0 h22m = hbar**2 / (2*m_e) pi = np.pi eV = 1/27.21138505 eV_Ha = eV nm = 18.89726124565 kB_eV = 8.6173324e-5 kB = kB_e...
[ "''' Load a variety of relevant physical parameters.\n\nAll quantities are in atomic units, such that\n m_e = 1\n e = 1\n hbar = 1\n 1/4\\pi\\epsilon = 1\n'''\n\nimport numpy as np\n\nhbar = 1.0\nm_e = 1.0\nh22m = hbar**2 / (2*m_e)\npi = np.pi\neV = 1/27.21138505\neV_Ha = eV\nnm = 18.89726124565\n\nkB_e...
false
7,080
5e0affbd295d7237784cd8e72926afeda6456500
import numpy as np from collections import Counter import matplotlib.pyplot as plt # 1. sepal length in cm # 2. sepal width in cm # 3. petal length in cm # 4. petal width in cm TrainingData = np.loadtxt("Data2",delimiter = ',',skiprows = 1,dtype = str) class Knn(object): """docstring for data""" def ...
[ "import numpy as np\nfrom collections import Counter\nimport matplotlib.pyplot as plt\n\n\n # 1. sepal length in cm\n # 2. sepal width in cm\n # 3. petal length in cm\n # 4. petal width in cm\nTrainingData = np.loadtxt(\"Data2\",delimiter = ',',skiprows = 1,dtype = str)\n\n\nclass Knn(object):\n\t\"\"\"doc...
false
7,081
ccb131171472d0a92d571e94453be97b323b4484
from flask import Flask, request, jsonify from flask_sqlalchemy import SQLAlchemy from flask_marshmallow import Marshmallow import os # Init app app = Flask(__name__) basedir = os.path.abspath(os.path.dirname(__file__)) # Database app.config['SQLALCHEM_DATABASE_URI'] = 'sqlite///' + \ os.path.join(basedir, 'db.sql...
[ "from flask import Flask, request, jsonify\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_marshmallow import Marshmallow\nimport os\n\n# Init app\napp = Flask(__name__)\nbasedir = os.path.abspath(os.path.dirname(__file__))\n# Database\napp.config['SQLALCHEM_DATABASE_URI'] = 'sqlite///' + \\\n os.path.join(...
false
7,082
e0d7fb8a9799c91dca0ca0827a5149804c9efabb
from quiz.schema.base import Schema from quiz.schema.schemas import UserSchemas class RegisterSchema(Schema): """ 注册 """ _schema = UserSchemas.REG_SCHEMA.value class LoginSchema(Schema): """ 登录 """ _schema = UserSchemas.LOGIN_SCHEMA.value
[ "from quiz.schema.base import Schema\nfrom quiz.schema.schemas import UserSchemas\n\n\nclass RegisterSchema(Schema):\n \"\"\"\n 注册\n \"\"\"\n\n _schema = UserSchemas.REG_SCHEMA.value\n\n\nclass LoginSchema(Schema):\n \"\"\"\n 登录\n \"\"\"\n\n _schema = UserSchemas.LOGIN_SCHEMA.value\n", "fr...
false
7,083
785b54dce76d6906df513a8bde0110ab6fd63357
from unittest import TestCase # auto-test toggled test class to monitor changes to is_palindrome function class Test_is_palindrome(TestCase): def test_is_palindrome(self): from identify_a_palindrome import is_palindrome self.assertTrue(is_palindrome("Asdfdsa")) self.assertTrue(is_palindrome...
[ "from unittest import TestCase\n\n# auto-test toggled test class to monitor changes to is_palindrome function\nclass Test_is_palindrome(TestCase):\n def test_is_palindrome(self):\n from identify_a_palindrome import is_palindrome\n self.assertTrue(is_palindrome(\"Asdfdsa\"))\n self.assertTrue...
false
7,084
a667c4cb0a30ee67fe982bb96ece6bb75f25f110
import pygame from pygame.locals import * pygame.init() ttt = pygame.display.set_mode((300,325)) #loome mänguakna pygame.display.set_caption = ("Trips-Traps-Trull") võitja = None def init_tabel(ttt): taust = pygame.Surface(ttt.get_size()) taust = taust.convert() taust.fill((250,250,250)) #tõm...
[ "import pygame\n\nfrom pygame.locals import *\n\npygame.init()\nttt = pygame.display.set_mode((300,325)) #loome mänguakna\npygame.display.set_caption = (\"Trips-Traps-Trull\")\n\nvõitja = None\n\n\n\ndef init_tabel(ttt):\n taust = pygame.Surface(ttt.get_size())\n taust = taust.convert()\n taust.fill((250,2...
false
7,085
85fc2fc0a404c20b1f0806412424192ea4a50a9b
import pygame import random from lb_juego import* #Dimensiones de la pantalla ALTO=400 ANCHO=600 #lista de colores basicos ROJO=(255,0,0) SALMON=(240,99,99) BLANCO=(255,255,255) NEGRO=(0,0,0) AZUL=(59,131,189) VERDE=(0,255,0) if __name__=='__main__': #Inicializacion de la aplicacion en pygame pygame.init() ...
[ "import pygame\nimport random\nfrom lb_juego import*\n\n#Dimensiones de la pantalla\nALTO=400\nANCHO=600\n#lista de colores basicos\nROJO=(255,0,0)\nSALMON=(240,99,99)\nBLANCO=(255,255,255)\nNEGRO=(0,0,0)\nAZUL=(59,131,189)\nVERDE=(0,255,0)\n\nif __name__=='__main__':\n #Inicializacion de la aplicacion en pygame...
false
7,086
e1f003b6a687e5654a1ee6c595e789ced02cd6c3
from pptx import Presentation import csv prs = Presentation() slide_layout = prs.slide_layouts[1] slide = prs.slides.add_slide(slide_layout) shapes = slide.shapes title_shape = shapes.title body_shape = shapes.placeholders[1] title_shape.text = "Tekst" tf = body_shape.text_frame tf.text = "Zawartość tekst frame" wi...
[ "from pptx import Presentation\nimport csv\n\nprs = Presentation()\nslide_layout = prs.slide_layouts[1]\nslide = prs.slides.add_slide(slide_layout)\nshapes = slide.shapes\n\ntitle_shape = shapes.title\n\nbody_shape = shapes.placeholders[1]\ntitle_shape.text = \"Tekst\"\n\ntf = body_shape.text_frame\ntf.text = \"Zaw...
false
7,087
4556febd5fddf390f370a8e24871eacf08d34c9f
#!/usr/bin/env python3 import sys import os import math import tempfile import zlib import lzma import struct import bitstruct # a swf file unpacker and analyzer # majority of information taken from https://www.adobe.com/devnet/swf.html (version 19) # some additional information taken from https://github.com/cla...
[ "#!/usr/bin/env python3\n\n\nimport sys\nimport os\nimport math\n\nimport tempfile\n\nimport zlib\nimport lzma\nimport struct\nimport bitstruct\n\n\n\n# a swf file unpacker and analyzer\n# majority of information taken from https://www.adobe.com/devnet/swf.html (version 19)\n# some additional information taken from...
false
7,088
05badb45c2249dc52b72a46779a8e619cd8a3ca9
import numpy as np import matplotlib.pyplot as plt import scipy.stats as stats XZ_MESH = np.meshgrid( np.linspace(0, 1, 100), np.linspace(0.5, 1, 100) ) XZ_GRID = np.append( XZ_MESH[0].reshape(-1, 1), XZ_MESH[1].reshape(-1, 1), 1 ) QI_MESH = np.meshgrid( np.linspace(0, 1, 100), np.linspace(0, 1, 100) ) Q...
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\n\n\nXZ_MESH = np.meshgrid(\n np.linspace(0, 1, 100), np.linspace(0.5, 1, 100)\n)\nXZ_GRID = np.append(\n XZ_MESH[0].reshape(-1, 1), XZ_MESH[1].reshape(-1, 1), 1\n)\n\nQI_MESH = np.meshgrid(\n np.linspace(0, 1, 100), np.linsp...
false
7,089
227a56c970a74d515ab694d2c0924885e2209cfe
# # @lc app=leetcode id=67 lang=python3 # # [67] Add Binary # # https://leetcode.com/problems/add-binary/description/ # # algorithms # Easy (46.70%) # Likes: 2566 # Dislikes: 331 # Total Accepted: 572.1K # Total Submissions: 1.2M # Testcase Example: '"11"\n"1"' # # Given two binary strings a and b, return their ...
[ "#\n# @lc app=leetcode id=67 lang=python3\n#\n# [67] Add Binary\n#\n# https://leetcode.com/problems/add-binary/description/\n#\n# algorithms\n# Easy (46.70%)\n# Likes: 2566\n# Dislikes: 331\n# Total Accepted: 572.1K\n# Total Submissions: 1.2M\n# Testcase Example: '\"11\"\\n\"1\"'\n#\n# Given two binary strin...
false
7,090
80454a3935f0d42b5535440fc316af1b5598d8a1
Desafios: 1: Crie um script python que leia o nome de uma pessoa e mostre uma mensagem de boas-vindas de acordo com o valor digitado. Script: Desafio 01: 1: Crie um script python que leia o nome de uma pessoa e mostre uma mensagem de boas-vindas de acordo com o valor digitado.""" nome=input('Qual é o seu nome?') print...
[ "Desafios:\n1: Crie um script python que leia o nome de uma pessoa e mostre uma mensagem de boas-vindas de acordo com o valor digitado.\n\nScript:\nDesafio 01:\n1: Crie um script python que leia o nome de uma pessoa\ne mostre uma mensagem de boas-vindas de acordo com o valor digitado.\"\"\"\nnome=input('Qual é o se...
true
7,091
44dbb7587530fac9e538dfe31c7df15b1a016251
#from graph import * #ex = open('ex_K.py', 'r') #ex.read() import ex_K ex = ex_K print "digraph K {" print (str(ex.K)) print "}"
[ "#from graph import *\r\n#ex = open('ex_K.py', 'r')\r\n#ex.read()\r\nimport ex_K\r\nex = ex_K\r\n\r\nprint \"digraph K {\"\r\nprint (str(ex.K))\r\nprint \"}\"\r\n" ]
true
7,092
806124926008078e592141d80d08ccfbb3046dbf
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ============================================================================== # Created By : Karl Thompson # Created Date: Mon March 25 17:34:00 CDT 2019 # ============================================================================== """nasdaq_itch_vwap - Genera...
[ "#!/usr/bin/env python3\r\n# -*- coding: utf-8 -*-\r\n# ==============================================================================\r\n# Created By : Karl Thompson\r\n# Created Date: Mon March 25 17:34:00 CDT 2019\r\n# ==============================================================================\r\n\"\"\"nasda...
false
7,093
4d1ea6522a01603f0159a1f27da70b65c4f387cb
from dbmanager import DbManager from message import Message def list_returner(f): def wrapper(*args, **kwargs): result = f(*args, **kwargs) if result: return result else: return [dict()] return wrapper class Messenger: def __init__(self, messages_count=20)...
[ "from dbmanager import DbManager\nfrom message import Message\n\n\ndef list_returner(f):\n def wrapper(*args, **kwargs):\n result = f(*args, **kwargs)\n if result:\n return result\n else:\n return [dict()]\n return wrapper\n\n\nclass Messenger:\n def __init__(self...
false
7,094
045ad27f46c2090ed39a49144c3aa17093b0d9c7
#-*- coding:utf-8 -*- """ Django settings for hehotel project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path....
[ "#-*- coding:utf-8 -*-\n\"\"\"\nDjango settings for hehotel project.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.7/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.7/ref/settings/\n\"\"\"\n\n# Build paths inside the proje...
false
7,095
ece20c8c8fae2225cbac3552e254314b7116057c
import numpy #Matrixmultiplikation #Matrixinvertierung #nicht p inv #selbst invertierbar machen import math import operator
[ "import numpy\n#Matrixmultiplikation\n#Matrixinvertierung\n#nicht p inv\n#selbst invertierbar machen\n\nimport math\nimport operator", "import numpy\nimport math\nimport operator\n", "<import token>\n" ]
false
7,096
2f6e5ed4e2d52190551dec2ac18441b8355699b5
import random import matplotlib.pyplot as plt import numpy as np from sklearn.datasets import fetch_mldata from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler, LabelBinarizer from ann.act import relu, softmax_with_xentropy from ann.loss import xentropy_with_softmax fr...
[ "import random\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn.datasets import fetch_mldata\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler, LabelBinarizer\n\nfrom ann.act import relu, softmax_with_xentropy\nfrom ann.loss import xentropy_w...
false
7,097
bc3e94c3fb8e563f62fcf0ca628d4aa73c668612
from telegram.ext import Dispatcher,CommandHandler,CallbackQueryHandler import random from telegram import InlineKeyboardMarkup, InlineKeyboardButton gifGOODBOAT = 'https://media3.giphy.com/media/3oz8xRQiRlaS1XwnPW/giphy.gif' gifBADBOAT = 'https://media1.giphy.com/media/l2Je3n9VXC8z3baTe/giphy.gif' gifGOODMAN = 'https...
[ "from telegram.ext import Dispatcher,CommandHandler,CallbackQueryHandler\nimport random\nfrom telegram import InlineKeyboardMarkup, InlineKeyboardButton\n\ngifGOODBOAT = 'https://media3.giphy.com/media/3oz8xRQiRlaS1XwnPW/giphy.gif'\ngifBADBOAT = 'https://media1.giphy.com/media/l2Je3n9VXC8z3baTe/giphy.gif'\ngifGOODM...
false
7,098
0004e90622f8b13ec7ce0c1f49e8c8df7ea07269
def merge_the_tools(string, k): if(len(string)%k != 0): exit() else: L = [] for i in range(0, len(string), k): L.append(''.join(list(dict.fromkeys(string[i:i+k])))) print('\n'.join(L)) if __name__ == '__main__': string, k = input(), int(input()) merge_the_to...
[ "def merge_the_tools(string, k):\n if(len(string)%k != 0):\n exit()\n else:\n L = []\n for i in range(0, len(string), k):\n L.append(''.join(list(dict.fromkeys(string[i:i+k]))))\n print('\\n'.join(L))\n\nif __name__ == '__main__':\n\n string, k = input(), int(input())...
false
7,099
1f7147c914eee37776c0418575e93e3d36ee3aa5
import os import json basedir = os.path.abspath(os.path.dirname(__file__)) # CHECK IF PRODUCTION CONFIG EXISTS if os.path.exists('/etc/config.json'): with open('/etc/config.json') as config_file: config = json.load(config_file) else: with open('dev_config.json') as config_file: config = json.l...
[ "import os\nimport json\n\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\n# CHECK IF PRODUCTION CONFIG EXISTS\nif os.path.exists('/etc/config.json'):\n with open('/etc/config.json') as config_file:\n config = json.load(config_file)\nelse:\n with open('dev_config.json') as config_file:\n ...
false