index
int64
0
100k
blob_id
stringlengths
40
40
code
stringlengths
7
7.27M
steps
listlengths
1
1.25k
error
bool
2 classes
3,500
4f7b689c06383673b510092932b051c644306b84
# -*- coding:utf-8 -*- from odoo import api, fields, _, models Type_employee = [('j', 'Journalier'), ('m', 'Mensuel')] class HrCnpsSettings(models.Model): _name = "hr.cnps.setting" _description = "settings of CNPS" name = fields.Char("Libellé", required=True) active = fields.Boolean("Ac...
[ "# -*- coding:utf-8 -*-\r\n\r\n\r\nfrom odoo import api, fields, _, models\r\n\r\nType_employee = [('j', 'Journalier'), ('m', 'Mensuel')]\r\n\r\nclass HrCnpsSettings(models.Model):\r\n _name = \"hr.cnps.setting\"\r\n _description = \"settings of CNPS\"\r\n\r\n name = fields.Char(\"Libellé\", required=True)...
false
3,501
f0f4573808253ca4bff808104afa9f350d305a9c
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
[ "# ----------------------------------------------------------------------\n# Numenta Platform for Intelligent Computing (NuPIC)\n# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement\n# with Numenta, Inc., for a separate license for this software code, the\n# following terms and conditions apply:\n#\n# ...
true
3,502
610610e7e49fc98927a4894efe62686e26e0cb83
from pythonforandroid.recipe import CompiledComponentsPythonRecipe from multiprocessing import cpu_count from os.path import join class NumpyRecipe(CompiledComponentsPythonRecipe): version = '1.18.1' url = 'https://pypi.python.org/packages/source/n/numpy/numpy-{version}.zip' site_packages_name = 'numpy' ...
[ "from pythonforandroid.recipe import CompiledComponentsPythonRecipe\nfrom multiprocessing import cpu_count\nfrom os.path import join\n\n\nclass NumpyRecipe(CompiledComponentsPythonRecipe):\n\n version = '1.18.1'\n url = 'https://pypi.python.org/packages/source/n/numpy/numpy-{version}.zip'\n site_packages_n...
false
3,503
600b49c7884f8b6e3960549702a52deb20089f5a
import time import os from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from app.wechat_subscription.object_page.home_page import HomePage from conf.decorator import teststep, teststeps from conf.base_page import BasePage from selenium.webdriver...
[ "import time\nimport os\n\n\nfrom selenium.webdriver.support.wait import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\nfrom app.wechat_subscription.object_page.home_page import HomePage\nfrom conf.decorator import teststep, teststeps\nfrom conf.base_page import BasePage\nfrom sele...
false
3,504
b0bc55ab05d49605e2f42ea036f8405727c468d2
import pandas from sklearn.externals import joblib import TrainTestProcesser from sklearn.ensemble import RandomForestClassifier from Select_OF_File import get_subdir import matplotlib.pyplot as mp import sklearn.model_selection as ms from sklearn.metrics import confusion_matrix from sklearn.metrics import classificati...
[ "import pandas\nfrom sklearn.externals import joblib\nimport TrainTestProcesser\nfrom sklearn.ensemble import RandomForestClassifier\nfrom Select_OF_File import get_subdir\nimport matplotlib.pyplot as mp\nimport sklearn.model_selection as ms\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.metrics import...
false
3,505
8f971ee3b98691a887ee0632afd613bbf4f19aa0
import pytest from homeworks.homework6.oop_2 import ( DeadLineError, Homework, HomeworkResult, Student, Teacher, ) def test_creating_objects(): teacher = Teacher("Daniil", "Shadrin") student = Student("Roman", "Petrov") homework = teacher.create_homework("Learn OOP", 1) homework_r...
[ "import pytest\n\nfrom homeworks.homework6.oop_2 import (\n DeadLineError,\n Homework,\n HomeworkResult,\n Student,\n Teacher,\n)\n\n\ndef test_creating_objects():\n teacher = Teacher(\"Daniil\", \"Shadrin\")\n student = Student(\"Roman\", \"Petrov\")\n homework = teacher.create_homework(\"L...
false
3,506
bc32518e5e37d4055f1bf5115953948a2bb24ba6
import sys from reportlab.graphics.barcode import code39 from reportlab.lib.pagesizes import letter from reportlab.lib.units import mm from reportlab.pdfgen import canvas from parseAccessionNumbers import parseFile def main(): if len(sys.argv) <= 1: print "No filepath argument passed." return ...
[ "import sys\nfrom reportlab.graphics.barcode import code39\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.lib.units import mm\nfrom reportlab.pdfgen import canvas\nfrom parseAccessionNumbers import parseFile\n\n\ndef main():\n if len(sys.argv) <= 1:\n print \"No filepath argument passed.\"\n ...
true
3,507
c199b2f87b7a4ac820001dab13f24fdd287a1575
# https://py.checkio.org/blog/design-patterns-part-1/ class ImageOpener(object): @staticmethod def open(filename): raise NotImplementedError() class PNGImageOpener(ImageOpener): @staticmethod def open(filename): print('PNG: open with Paint') class JPEGImageOpener(ImageOpener): @...
[ "# https://py.checkio.org/blog/design-patterns-part-1/\n\nclass ImageOpener(object):\n @staticmethod\n def open(filename):\n raise NotImplementedError()\n\n\nclass PNGImageOpener(ImageOpener):\n @staticmethod\n def open(filename):\n print('PNG: open with Paint')\n\n\nclass JPEGImageOpener(...
false
3,508
c54a046ebde1be94ec87061b4fba9e22bf0f4d0a
from e19_pizza import * print("\n----------导入模块中的所有函数----------") # 由于导入了每个函数,可通过名称来调用每个函数,无需使用句点表示法 make_pizza(16, 'pepperoni') make_pizza(12, 'mushrooms', 'green peppers', 'extra cheese') # 注意: # 使用并非自己编写的大型模块时,最好不要采用这种导入方法,如果模块中 # 有函数的名称与你的项目中使用的名称相同,可能导致意想不到的结果。 # Python可能遇到多个名称相同的函数或变量,进而覆盖函数,而不是分别导 # 入所有...
[ "from e19_pizza import *\n\nprint(\"\\n----------导入模块中的所有函数----------\")\n# 由于导入了每个函数,可通过名称来调用每个函数,无需使用句点表示法\n\nmake_pizza(16, 'pepperoni')\nmake_pizza(12, 'mushrooms', 'green peppers', 'extra cheese')\n\n# 注意:\n# 使用并非自己编写的大型模块时,最好不要采用这种导入方法,如果模块中\n# 有函数的名称与你的项目中使用的名称相同,可能导致意想不到的结果。\n# Python可能遇到多个名称相同的函数或变量,进...
false
3,509
3f86227afd60be560ac3d4ce2bee1f6cf74a744d
from flask_admin.contrib.sqla import ModelView from flask_admin import Admin from flask import abort import flask_login import logging from .models import User, sendUserMail, db as userdb from .box_models import Box, Image, db as boxdb from .box_queue import BoxQueue logger = logging.getLogger('labboxmain') class Au...
[ "from flask_admin.contrib.sqla import ModelView\nfrom flask_admin import Admin\nfrom flask import abort\nimport flask_login\nimport logging\nfrom .models import User, sendUserMail, db as userdb\nfrom .box_models import Box, Image, db as boxdb\nfrom .box_queue import BoxQueue\n\nlogger = logging.getLogger('labboxmai...
false
3,510
5f00cd446b219203c401799ba7b6205c7f1f8e9f
# -*- coding: utf-8 -*- from numpy import * def loadDataSet(fileName, delim = '\t'): fr = open(fileName) stringArr = [line.strip().split(delim) for line in fr.readlines()] datArr = [map(float,line) for line in stringArr] return mat(datArr) def pca(dataMat, topNfeat = 9999999): meanVals = mean(dat...
[ "# -*- coding: utf-8 -*-\n\nfrom numpy import *\n\ndef loadDataSet(fileName, delim = '\\t'):\n fr = open(fileName)\n stringArr = [line.strip().split(delim) for line in fr.readlines()]\n datArr = [map(float,line) for line in stringArr]\n return mat(datArr)\n\ndef pca(dataMat, topNfeat = 9999999):\n me...
false
3,511
79522db1316e4a25ab5a598ee035cf9b9a9a9411
import torch from torch import nn from torch.nn import functional as F import torchvision import math from torchvision.models.resnet import Bottleneck from dataset import load_image, load_text, ALPHABET, MAX_LEN class ResNetFeatures(nn.Module): def __init__(self, pretrained=True): super().__init__() ...
[ "import torch\nfrom torch import nn\nfrom torch.nn import functional as F\nimport torchvision\nimport math\nfrom torchvision.models.resnet import Bottleneck\nfrom dataset import load_image, load_text, ALPHABET, MAX_LEN\n\n\nclass ResNetFeatures(nn.Module):\n def __init__(self, pretrained=True):\n super()....
false
3,512
7301a521586049ebb5e8e49b604cc96e3acc1fe9
import os, pygame import sys from os import path from random import choice WIDTH = 1000 HEIGHT = 800 FPS = 60 BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) YELLOW = (255, 255, 0) GRAY80 = (204, 204, 204) GRAY = (26, 26, 26) screen = pygame.disp...
[ "import os, pygame\r\nimport sys\r\nfrom os import path\r\nfrom random import choice\r\n\r\nWIDTH = 1000\r\nHEIGHT = 800\r\nFPS = 60\r\n\r\nBLACK = (0, 0, 0)\r\nWHITE = (255, 255, 255)\r\nRED = (255, 0, 0)\r\nGREEN = (0, 255, 0)\r\nBLUE = (0, 0, 255)\r\nYELLOW = (255, 255, 0)\r\nGRAY80 = (204, 204, 204)\r\nGRAY = (...
false
3,513
aed6e1966d9e4ce7250ae3cacaf8854cab4b590c
from nltk.tokenize import RegexpTokenizer token = RegexpTokenizer(r'\w+') from nltk.corpus import stopwords # with open('microsoft.txt','r+',encoding="utf-8") as file: # text = file.read() # text = ''' # Huawei Technologies founder and CEO Ren Zhengfei said on Thursday the Chinese company is willing to license its...
[ "from nltk.tokenize import RegexpTokenizer\ntoken = RegexpTokenizer(r'\\w+')\nfrom nltk.corpus import stopwords\n\n# with open('microsoft.txt','r+',encoding=\"utf-8\") as file:\n# text = file.read()\n# text = '''\n# Huawei Technologies founder and CEO Ren Zhengfei said on Thursday the Chinese company is willing...
false
3,514
6c98be473bf4cd458ea8a801f8b1197c9d8a07b3
import serial import time import struct # Assign Arduino's serial port address # Windows example # usbport = 'COM3' # Linux example # usbport = '/dev/ttyUSB0' # MacOSX example # usbport = '/dev/tty.usbserial-FTALLOK2' # basically just see what ports are open - >>> ls /dev/tty* # Set up s...
[ "import serial\r\nimport time\r\nimport struct\r\n# Assign Arduino's serial port address\r\n# Windows example\r\n# usbport = 'COM3'\r\n# Linux example\r\n# usbport = '/dev/ttyUSB0'\r\n# MacOSX example\r\n# usbport = '/dev/tty.usbserial-FTALLOK2'\r\n# basically just see what ports are open - >>> l...
false
3,515
93b12d1e936331c81522790f3f45faa3383d249e
#!/usr/bin/env python # ------------------------------------------------------------------------------------------------------% # Created by "Thieu Nguyen" at 19:47, 08/04/2020 % # ...
[ "#!/usr/bin/env python\n# ------------------------------------------------------------------------------------------------------%\n# Created by \"Thieu Nguyen\" at 19:47, 08/04/2020 %\n# ...
false
3,516
01153a695b4744465b706acb4c417217c5e3cefd
from django.db import models import os from uuid import uuid4 class Card_profile(models.Model): def path_and_rename(self, filename): upload_to = 'uploads' ext = filename.split('.')[-1] filename = '{}.{}'.format(uuid4().hex, ext) return os.path.join(upload_to, filename) MALE ...
[ "from django.db import models\nimport os\nfrom uuid import uuid4\n\n\nclass Card_profile(models.Model):\n\n def path_and_rename(self, filename):\n upload_to = 'uploads'\n ext = filename.split('.')[-1]\n filename = '{}.{}'.format(uuid4().hex, ext)\n\n return os.path.join(upload_to, fil...
false
3,517
56b8b9884b8500ff70f59058484c4a351b709311
import sys def ReadFile(array, fileName): with open(fileName, 'r') as f: if f.readline().rstrip() != 'MS': print("prosze podac macierz sasiedztwa") for i in f: el = list(map(int, i.rstrip().split())) if len(el) > 1: array.append(el) def Prim(mat...
[ "import sys\n\ndef ReadFile(array, fileName):\n with open(fileName, 'r') as f:\n if f.readline().rstrip() != 'MS':\n print(\"prosze podac macierz sasiedztwa\")\n for i in f:\n el = list(map(int, i.rstrip().split()))\n if len(el) > 1:\n array.append(el...
false
3,518
ae5dfa7fa6a0d7349d6ae29aeac819903facb48f
import sys import os import unittest from wireless.trex_wireless_manager import APMode from wireless.trex_wireless_manager_private import * class APInfoTest(unittest.TestCase): """Tests methods for the APInfo class.""" def test_init_correct(self): """Test the __init__ method when parameters are corr...
[ "import sys\nimport os\nimport unittest\n\nfrom wireless.trex_wireless_manager import APMode\nfrom wireless.trex_wireless_manager_private import *\n\n\nclass APInfoTest(unittest.TestCase):\n \"\"\"Tests methods for the APInfo class.\"\"\"\n\n def test_init_correct(self):\n \"\"\"Test the __init__ metho...
false
3,519
2060f57cfd910a308d60ad35ebbbf9ffd5678b9c
# coding: utf-8 import pandas as pd import os import numpy as np import json as json import mysql.connector as sqlcnt import datetime as dt import requests from mysql.connector.constants import SQLMode import os import glob import re import warnings warnings.filterwarnings("ignore") from pathlib import Path # In[...
[ "\n# coding: utf-8\n\n\nimport pandas as pd\nimport os\nimport numpy as np\nimport json as json\nimport mysql.connector as sqlcnt\nimport datetime as dt\nimport requests\nfrom mysql.connector.constants import SQLMode\nimport os\nimport glob\nimport re\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nfrom pa...
false
3,520
fb0dcb641dfb379751264dc0b18007f5d058d379
import numpy as np import matplotlib.pyplot as plt def cos_Taylor2(x, n): s = 0 a = 1 for i in range(0, n+1): s = s+a a = -a*x**2 / ((2*i+1)*(2*i+2)) return s, abs(a) vcos = np.vectorize(cos_Taylor2) def cos_two_terms(x): s = 0 a = 1 s = s+a a = -a*x**2 / ((2*0+1)*(2*...
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef cos_Taylor2(x, n):\n s = 0\n a = 1\n for i in range(0, n+1):\n s = s+a\n a = -a*x**2 / ((2*i+1)*(2*i+2))\n return s, abs(a)\nvcos = np.vectorize(cos_Taylor2)\n\n\ndef cos_two_terms(x):\n s = 0\n a = 1\n s = s+a\n a =...
false
3,521
0e7d4b73cedf961677e6b9ea5303cdb3a5afa788
#!/usr/bin/env python3 import fileinput mem = [int(n.strip()) for n in next(fileinput.input()).split()] size = len(mem) states = set() states.add('.'.join(str(n) for n in mem)) part2 = None steps = 0 while True: i = mem.index(max(mem)) x = mem[i] mem[i] = 0 while x > 0: i += 1 mem[i ...
[ "#!/usr/bin/env python3\n\nimport fileinput\n\nmem = [int(n.strip()) for n in next(fileinput.input()).split()]\nsize = len(mem)\n\nstates = set()\nstates.add('.'.join(str(n) for n in mem))\npart2 = None\nsteps = 0\n\nwhile True:\n i = mem.index(max(mem))\n x = mem[i]\n mem[i] = 0\n while x > 0:\n ...
false
3,522
a4f4137b9310ebc68515b9cae841051eda1f0360
import random consonants = [ 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z' ] vowels = [ 'a', 'e',' i', 'o', 'u' ] def make_word(user_input): word = "" for letter in user_input: letter = letter.lower() if letter...
[ "import random\n\n\nconsonants = [\n 'b', 'c', 'd', 'f', 'g',\n 'h', 'j', 'k', 'l', 'm',\n 'n', 'p', 'q', 'r', 's',\n 't', 'v', 'w', 'x', 'y',\n 'z'\n]\nvowels = [\n 'a', 'e',' i', 'o', 'u'\n]\n\ndef make_word(user_input):\n word = \"\"\n\n for letter in user_input:\n letter = letter....
false
3,523
2e2de50a7d366ca1a98d29b33ed157a1e8445ada
# (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative works of this code must retain this...
[ "# (C) Copyright IBM 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or derivative works of this code must ...
false
3,524
48311ee17a3f2eca8db32d7672f540fa45a7a900
#!/usr/bin/env python from LCClass import LightCurve import matplotlib.pyplot as plt import niutils def main(): lc1821 = LightCurve("PSR_B1821-24/PSR_B1821-24_combined.evt") lc0218 = LightCurve("PSR_J0218+4232/PSR_J0218+4232_combined.evt") fig, ax = plt.subplots(2, 1, figsize=(8, 8)) ax[0], _ = lc18...
[ "#!/usr/bin/env python\n\nfrom LCClass import LightCurve\nimport matplotlib.pyplot as plt\nimport niutils\n\ndef main():\n lc1821 = LightCurve(\"PSR_B1821-24/PSR_B1821-24_combined.evt\")\n lc0218 = LightCurve(\"PSR_J0218+4232/PSR_J0218+4232_combined.evt\")\n\n fig, ax = plt.subplots(2, 1, figsize=(8, 8))\n...
false
3,525
426a8fb6d1adf5d4577d299083ce047c919dda67
''' EXERCICIO: Faça um programa que leia quantidade de pessoas que serão convidadas para uma festa. O programa irá perguntar o nome de todas as pessoas e colcar num lista de convidados. Após isso deve imprimir todos os nomes da lista ''' ''' qtd = int(input("Quantas pessoas vão ser convidadas?")) lista_pe...
[ "'''\n EXERCICIO: Faça um programa que leia quantidade de pessoas que serão convidadas para uma festa.\n O programa irá perguntar o nome de todas as pessoas e colcar num lista de convidados.\n Após isso deve imprimir todos os nomes da lista\n'''\n\n'''\nqtd = int(input(\"Quantas pessoas vão ser convidadas?...
false
3,526
e59404149c739a40316ca16ab767cbc48aa9b685
# -*- coding: utf-8 -*- import scrapy from selenium import webdriver import datetime class GoldpriceSpider(scrapy.Spider): name = 'goldprice' allowed_domains = ['g-banker.com'] start_urls = ['https://g-banker.com/'] def __init__(self): self.browser = webdriver.PhantomJS() self.price =...
[ "# -*- coding: utf-8 -*-\n\nimport scrapy\nfrom selenium import webdriver\nimport datetime\n\nclass GoldpriceSpider(scrapy.Spider):\n name = 'goldprice'\n allowed_domains = ['g-banker.com']\n start_urls = ['https://g-banker.com/']\n\n def __init__(self):\n self.browser = webdriver.PhantomJS()\n ...
false
3,527
ba78a1e29736c4f109a0efc6f5b9993994661058
''' Created on June 24, 2019 @author: Andrew Habib ''' import json import jsonref import sys from jsonsubschema.api import isSubschema def main(): assert len( sys.argv) == 3, "jsonsubschema cli takes exactly two arguments lhs_schema and rhs_schema" s1_file = sys.argv[1] s2_file = sys.argv[2] ...
[ "'''\nCreated on June 24, 2019\n@author: Andrew Habib\n'''\n\nimport json\nimport jsonref\nimport sys\n\nfrom jsonsubschema.api import isSubschema\n\n\ndef main():\n\n assert len(\n sys.argv) == 3, \"jsonsubschema cli takes exactly two arguments lhs_schema and rhs_schema\"\n\n s1_file = sys.argv[1]\n ...
false
3,528
4f116f3eec9198a56a047ab42ed8e018ebb794bb
def Hello_worlder(x): a=[] for i in range(x): a.append('Hello world') for i in a: print(i) Hello_worlder(10)
[ "def Hello_worlder(x):\r\n a=[]\r\n for i in range(x):\r\n a.append('Hello world')\r\n for i in a:\r\n print(i)\r\nHello_worlder(10)\r\n\t", "def Hello_worlder(x):\n a = []\n for i in range(x):\n a.append('Hello world')\n for i in a:\n print(i)\n\n\nHello_worlder(10)\...
false
3,529
f33190df35a6b0b91c4dd2d6a58291451d06e29a
# -*- coding: utf-8 -*- import scrapy import json, time, sys, random, re, pyssdb from scrapy.utils.project import get_project_settings from spider.items import GoodsSalesItem goods_list = [] '''获取店铺内产品信息''' class PddMallGoodsSpider(scrapy.Spider): name = 'pdd_mall_goods' mall_id_hash = 'pdd_mall_id_ha...
[ "# -*- coding: utf-8 -*-\r\nimport scrapy\r\nimport json, time, sys, random, re, pyssdb\r\n\r\nfrom scrapy.utils.project import get_project_settings\r\n\r\nfrom spider.items import GoodsSalesItem\r\n\r\ngoods_list = []\r\n'''获取店铺内产品信息'''\r\nclass PddMallGoodsSpider(scrapy.Spider):\r\n\tname = 'pdd_mall_goods'\r\n\t...
false
3,530
d84a7e16471c604283c81412653e037ecdb19102
import os bind = '0.0.0.0:8000' workers = os.environ['GET_KEYS_ACCOUNTS_WORKERS']
[ "import os\n\nbind = '0.0.0.0:8000'\nworkers = os.environ['GET_KEYS_ACCOUNTS_WORKERS']\n", "import os\nbind = '0.0.0.0:8000'\nworkers = os.environ['GET_KEYS_ACCOUNTS_WORKERS']\n", "<import token>\nbind = '0.0.0.0:8000'\nworkers = os.environ['GET_KEYS_ACCOUNTS_WORKERS']\n", "<import token>\n<assignment token>\...
false
3,531
076b852010ddcea69a294f9f2a653bb2fa2f2676
# -*- coding: utf-8 -*- """ Created on Sat Jul 1 10:18:11 2017 @author: Duong """ import pandas as pd import matplotlib.pyplot as plt import psycopg2 from pandas.core.frame import DataFrame # DBS verbinden database = psycopg2.connect(database="TeamYellow_election", user="student", password="pas...
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sat Jul 1 10:18:11 2017\r\n\r\n@author: Duong\r\n\"\"\"\r\n\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport psycopg2\r\nfrom pandas.core.frame import DataFrame\r\n\r\n\r\n\r\n\r\n\r\n# DBS verbinden\r\ndatabase = psycopg2.connect(database=\"TeamY...
false
3,532
005ea8a1e75447b2b1c030a645bde5d0cdc8fb53
t3 = float(input('Digite um numero: ')) print('o dobro deste numero é', t3 * 2) print('O triplo deste numero é', t3 * 3) print('E a raiz quadrada deste numero é', t3**(1/2))
[ "t3 = float(input('Digite um numero: '))\n\nprint('o dobro deste numero é', t3 * 2)\nprint('O triplo deste numero é', t3 * 3)\nprint('E a raiz quadrada deste numero é', t3**(1/2))", "t3 = float(input('Digite um numero: '))\nprint('o dobro deste numero é', t3 * 2)\nprint('O triplo deste numero é', t3 * 3)\nprint('...
false
3,533
fc0c8deb3a5a57934c9e707911c352af55100c3c
print(sum([int(d) for d in str(pow(2,1000))]))
[ "print(sum([int(d) for d in str(pow(2,1000))]))\n", "print(sum([int(d) for d in str(pow(2, 1000))]))\n", "<code token>\n" ]
false
3,534
f566c42674728f1874d89b15102627c3b404c9a0
#!/usr/bin/env python3 import sys import cksm from pathlib import Path VIRTUAL_TO_ROM = 0x800ff000 def patch_rom(rom_path, payload_path, c_code_path, entry_code_path, out_path): rom = list(Path(rom_path).read_bytes()) payload = list(Path(payload_path).read_bytes()) c_code = list(Path(c_code_path).read_b...
[ "#!/usr/bin/env python3\n\nimport sys\n\nimport cksm\nfrom pathlib import Path\n\nVIRTUAL_TO_ROM = 0x800ff000\n\ndef patch_rom(rom_path, payload_path, c_code_path, entry_code_path, out_path):\n rom = list(Path(rom_path).read_bytes())\n payload = list(Path(payload_path).read_bytes())\n c_code = list(Path(c_...
false
3,535
82f8bfd95fea3025bed2b4583c20526b0bd5484f
from flask import Flask, abort, url_for, render_template, request app = Flask(__name__) @app.route('/') def index(): return render_template('login.html') # #redirect demo # @app.route('/login', methods=['POST', 'GET']) # def login(): # if request.method == 'POST' and request.form['username'] == 'admin': # ...
[ "from flask import Flask, abort, url_for, render_template, request\napp = Flask(__name__)\n\n@app.route('/')\ndef index():\n return render_template('login.html')\n\n# #redirect demo\n# @app.route('/login', methods=['POST', 'GET'])\n# def login():\n# if request.method == 'POST' and request.form['username'] ==...
false
3,536
028c2193e180ccdbfdcc51e5d061904ea1d6164e
#!/usr/bin/python import errno import fuse import stat import time #from multiprocessing import Queue from functools import wraps from processfs.svcmanager import Manager import processfs.svcmanager as svcmanager fuse.fuse_python_api = (0, 2) _vfiles = ['stdin', 'stdout', 'stderr', 'cmdline', 'control', 'status'] ...
[ "#!/usr/bin/python\n\nimport errno\nimport fuse\nimport stat\nimport time\n#from multiprocessing import Queue\nfrom functools import wraps\n\nfrom processfs.svcmanager import Manager\nimport processfs.svcmanager as svcmanager\n\nfuse.fuse_python_api = (0, 2)\n\n_vfiles = ['stdin', 'stdout', 'stderr', 'cmdline', 'co...
true
3,537
430b5ca7212983743cadc36a2ada987bb721174a
import numpy as np import sympy as sp from copy import copy from typing import Any, get_type_hints, Dict from inspect import getclosurevars, getsource, getargs import ast from ast import parse, get_source_segment from .numpy import NumPy from .torch import torch_defs defines = {} defines.update(torch_defs) def che...
[ "import numpy as np\nimport sympy as sp\nfrom copy import copy\nfrom typing import Any, get_type_hints, Dict\nfrom inspect import getclosurevars, getsource, getargs\nimport ast\nfrom ast import parse, get_source_segment\n\nfrom .numpy import NumPy\nfrom .torch import torch_defs\n\n\ndefines = {}\ndefines.update(tor...
false
3,538
22b8ecfecc0e76d758f14dea865a426db56c6343
import json import unittest from pathlib import Path from deepdiff import DeepDiff from electricitymap.contrib import config CONFIG_DIR = Path(__file__).parent.parent.joinpath("config").resolve() class ConfigTestcase(unittest.TestCase): def test_generate_zone_neighbours_two_countries(self): exchanges =...
[ "import json\nimport unittest\nfrom pathlib import Path\n\nfrom deepdiff import DeepDiff\n\nfrom electricitymap.contrib import config\n\nCONFIG_DIR = Path(__file__).parent.parent.joinpath(\"config\").resolve()\n\n\nclass ConfigTestcase(unittest.TestCase):\n def test_generate_zone_neighbours_two_countries(self):\...
false
3,539
ac14e88810b848dbf4ff32ea99fd274cd0285e1c
""" Codewars kata: Evaluate mathematical expression. https://www.codewars.com/kata/52a78825cdfc2cfc87000005/train/python """ ####################################################################################################################### # # Import # ###########################################################...
[ "\"\"\" Codewars kata: Evaluate mathematical expression. https://www.codewars.com/kata/52a78825cdfc2cfc87000005/train/python \"\"\"\n\n#######################################################################################################################\n#\n# Import\n#\n##########################################...
false
3,540
fdf6c28e65b50c52550a95c2d991b1eb3ec53a2f
""" @file @brief One class which visits a syntax tree. """ import inspect import ast from textwrap import dedent import numpy from scipy.spatial.distance import squareform, pdist from .node_visitor_translator import CodeNodeVisitor def py_make_float_array(cst, op_version=None): """ Creates an array with a sin...
[ "\"\"\"\n@file\n@brief One class which visits a syntax tree.\n\"\"\"\nimport inspect\nimport ast\nfrom textwrap import dedent\nimport numpy\nfrom scipy.spatial.distance import squareform, pdist\nfrom .node_visitor_translator import CodeNodeVisitor\n\n\ndef py_make_float_array(cst, op_version=None):\n \"\"\"\n ...
false
3,541
cef6b5ef2082dc5910806550d9a9c96357752baf
from unittest import TestCase, main as unittest_main, mock from app import app from bson.objectid import ObjectId ''' dummy data to use in testing create, update, and delete routes (U and D not yet made) Inspiration taken from Playlister tutorial. ''' sample_offer_id = ObjectId('5349b4ddd2781d08c09890f4') sample_offer...
[ "from unittest import TestCase, main as unittest_main, mock\nfrom app import app\nfrom bson.objectid import ObjectId\n\n'''\ndummy data to use in testing create, update, and delete routes\n(U and D not yet made)\nInspiration taken from Playlister tutorial.\n'''\nsample_offer_id = ObjectId('5349b4ddd2781d08c09890f4'...
false
3,542
67904f3a29b0288a24e702f9c3ee001ebc279748
class ListNode: def __init__(self, val: int, next=None): self.val = val self.next = next def reverseKGroup(head: ListNode, k: int) -> ListNode: prev, cur, rs, successor = None, head, head, None def reverseK(node: ListNode, count: int) -> ListNode: nonlocal successor nonloc...
[ "class ListNode:\n def __init__(self, val: int, next=None):\n self.val = val\n self.next = next\n\n\ndef reverseKGroup(head: ListNode, k: int) -> ListNode:\n prev, cur, rs, successor = None, head, head, None\n\n def reverseK(node: ListNode, count: int) -> ListNode:\n nonlocal successor...
false
3,543
1810fee40ff8a99871ecc1d024f6794a68ee54e8
from marshmallow import fields from server.common.database import Media from server.common.schema.ref import ma class MediaSchema(ma.SQLAlchemyAutoSchema): class Meta: model = Media fields = ('id', 'name', 'mimetype', 'extension', 'owner', '_links') dump_only = ('id', 'owner', '_links') ...
[ "from marshmallow import fields\n\nfrom server.common.database import Media\nfrom server.common.schema.ref import ma\n\n\nclass MediaSchema(ma.SQLAlchemyAutoSchema):\n class Meta:\n model = Media\n fields = ('id', 'name', 'mimetype', 'extension', 'owner', '_links')\n dump_only = ('id', 'owne...
false
3,544
49c3c3b8c4b097f520456736e31ac306a9f73ac7
class Virus: def __init__(self, _name, _age, _malignancy): self.name = _name self.age = _age self.malignancy = _malignancy def set_name(self, _name): self.name = _name def set_age(self, _age): self.age = _age def set_malignancy(self, _malignancy): ...
[ "\nclass Virus:\n def __init__(self, _name, _age, _malignancy):\n self.name = _name\n self.age = _age\n self.malignancy = _malignancy\n\n def set_name(self, _name):\n self.name = _name\n \n def set_age(self, _age):\n self.age = _age\n\n def set_malignancy(self, _mal...
false
3,545
aec5280869a780bbd93ef24b659d9959f7b81426
import imp from django.shortcuts import render # ***************** API **************** from django.views.decorators.csrf import csrf_exempt from rest_framework.parsers import JSONParser,FileUploadParser,MultiPartParser,FormParser from .models import * from django.http import Http404 from .serializers import * from re...
[ "import imp\nfrom django.shortcuts import render\n\n# ***************** API ****************\nfrom django.views.decorators.csrf import csrf_exempt\nfrom rest_framework.parsers import JSONParser,FileUploadParser,MultiPartParser,FormParser\nfrom .models import *\nfrom django.http import Http404\nfrom .serializers imp...
false
3,546
7b35a7f28c11be15fe2ac8d6eae4067ac5379f3e
def test(a): """ This function return square of number """ return (a**2) print(test(2)) help(test) test.__doc__
[ "def test(a):\r\n \"\"\"\r\n This function return square of number\r\n \"\"\"\r\n return (a**2)\r\n\r\nprint(test(2))\r\n\r\nhelp(test)\r\n\r\ntest.__doc__\r\n", "def test(a):\n \"\"\"\n This function return square of number\n \"\"\"\n return a ** 2\n\n\nprint(test(2))\nhelp(test)\ntest.__...
false
3,547
f66f82c5c2842fc4fcae2251d4a16a9850230041
# Create your views here. from django.http import HttpResponse, HttpResponseRedirect from django.template import Context, loader from django.db import transaction from django.db.models import Q from maximus.models import Mercenary, Team, TeamMember, Tournament, TournamentTeam, TournamentMatchup, Matchup, MatchupStatis...
[ "# Create your views here.\nfrom django.http import HttpResponse, HttpResponseRedirect\nfrom django.template import Context, loader\nfrom django.db import transaction\nfrom django.db.models import Q\n\nfrom maximus.models import Mercenary, Team, TeamMember, Tournament, TournamentTeam, TournamentMatchup, Matchup, Ma...
false
3,548
16a95573c4fccc10bdc5e37b307d0c85714b328c
import PyInstaller.__main__ import os import shutil # Paths basePath = os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir)) srcPath = os.path.join(basePath, 'src') outPath = os.path.join(basePath, 'out') workPath = os.path.join(outPath, 'work') # Bundle PyInstaller.__main__.run([ '--clean', ...
[ "import PyInstaller.__main__\nimport os\nimport shutil\n\n# Paths\nbasePath = os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))\nsrcPath = os.path.join(basePath, 'src')\noutPath = os.path.join(basePath, 'out')\nworkPath = os.path.join(outPath, 'work')\n\n# Bundle\nPyInstaller.__main__.run([\...
false
3,549
f6cebf6ec848a06f81c4e1f584ebb83f4d9ff47c
# -*- coding: utf-8 -*- ''' Created on Dec 22, 2014 @author: Alan Tai ''' from handlers.handler_webapp2_extra_auth import BaseHandler from models.models_porn_info import WebLinkRoot, WebLinkPornTemp, WebLinkPorn,\ Tag from dictionaries.dict_key_value_pairs import KeyValuePairsGeneral from bs4 import BeautifulSoup ...
[ "# -*- coding: utf-8 -*-\n'''\nCreated on Dec 22, 2014\n\n@author: Alan Tai\n'''\nfrom handlers.handler_webapp2_extra_auth import BaseHandler\nfrom models.models_porn_info import WebLinkRoot, WebLinkPornTemp, WebLinkPorn,\\\n Tag\nfrom dictionaries.dict_key_value_pairs import KeyValuePairsGeneral\nfrom bs4 impor...
true
3,550
b33af7aff0f3fde6499d5e24fc036d5bd74b6e47
rom diseas import Disease from parse import analyzing from config import FILE_NAME from random import randint if __name__ == '__main__': """ Main module that runs the program. """ def working_with_user(disea): print('Choose what you want to know about that disease:\naverage_value(will return th...
[ "rom diseas import Disease\nfrom parse import analyzing\nfrom config import FILE_NAME\nfrom random import randint\n\nif __name__ == '__main__':\n \"\"\"\n Main module that runs the program.\n \"\"\"\n def working_with_user(disea):\n print('Choose what you want to know about that disease:\\naverag...
true
3,551
a19b4928c9423dae6c60f39dbc5af0673b433c8e
from flask_opencv_streamer.streamer import Streamer import cv2 import numpy as np MASK = np.array([ [0, 1, 0], [1, -4, 1], [0, 1, 0] ]) port = 3030 require_login = False streamer = Streamer(port, require_login) video_capture = cv2.VideoCapture('http://149.43.156.105/mjpg/video.mjpg') whi...
[ "from flask_opencv_streamer.streamer import Streamer\r\nimport cv2\r\nimport numpy as np\r\n\r\nMASK = np.array([\r\n [0, 1, 0],\r\n [1, -4, 1],\r\n [0, 1, 0]\r\n])\r\n\r\nport = 3030\r\nrequire_login = False\r\nstreamer = Streamer(port, require_login)\r\n\r\nvideo_capture = cv2.VideoCapture('http://149.43...
false
3,552
d32496c9bce86f455b24cd9c6dc263aee1bf82af
import requests from bs4 import BeautifulSoup import json import geojson import re import time _apiKey = "SNgeI1tCT-oihjeZDGi6WqcM0a9QAttLhKTecPaaETQ" def Geocode(address, apiKey): URL = 'https://geocode.search.hereapi.com/v1/geocode' # Параметры запроса params = { 'q': address, 'apiKey':...
[ "import requests\nfrom bs4 import BeautifulSoup\nimport json\nimport geojson\nimport re\nimport time\n\n_apiKey = \"SNgeI1tCT-oihjeZDGi6WqcM0a9QAttLhKTecPaaETQ\"\n\ndef Geocode(address, apiKey):\n URL = 'https://geocode.search.hereapi.com/v1/geocode'\n\n # Параметры запроса\n params = {\n 'q': addre...
false
3,553
ab27780b19db6854855af51eea063f07d9eb7302
import datetime import subprocess from time import sleep from flask import render_template, redirect, request, url_for, flash, abort from dirkules import app, db, scheduler, app_version import dirkules.manager.serviceManager as servMan import dirkules.manager.driveManager as driveMan import dirkules.manager.cleaning as...
[ "import datetime\nimport subprocess\nfrom time import sleep\nfrom flask import render_template, redirect, request, url_for, flash, abort\nfrom dirkules import app, db, scheduler, app_version\nimport dirkules.manager.serviceManager as servMan\nimport dirkules.manager.driveManager as driveMan\nimport dirkules.manager...
false
3,554
64a590d31be98f7639034662b2a322e5572cc1ae
# coding=utf-8 # flake8:noqa from .string_helper import ( camelize, uncamelize, camelize_for_dict_key, camelize_for_dict_key_in_list, uncamelize_for_dict_key, uncamelize_for_dict_key_in_list ) from .datetime_helper import datetime_format from .class_helper import override from .paginate import paginate2di...
[ "# coding=utf-8\n# flake8:noqa\n\nfrom .string_helper import (\n camelize, uncamelize,\n camelize_for_dict_key, camelize_for_dict_key_in_list,\n uncamelize_for_dict_key, uncamelize_for_dict_key_in_list\n)\nfrom .datetime_helper import datetime_format\nfrom .class_helper import override\n\nfrom .paginate im...
false
3,555
30d75aafd9612ac02557b947fc4e3c2f7322a7fd
import math getal1 = 5 getal2 = 7 getal3 = 8 getal4 = -4 getal5 = 2 print(getal1*getal2+getal3) print(getal1*(getal2+getal3)) print(getal2+getal3/getal1) print((getal2+getal3)/getal1) print(getal2+getal3%getal1) print(abs(getal4*getal1)) print(pow(getal3,getal5)) print(round(getal5/getal2,2)) print(...
[ "import math\r\n\r\ngetal1 = 5\r\ngetal2 = 7\r\ngetal3 = 8\r\ngetal4 = -4\r\ngetal5 = 2\r\n\r\nprint(getal1*getal2+getal3)\r\nprint(getal1*(getal2+getal3))\r\nprint(getal2+getal3/getal1)\r\nprint((getal2+getal3)/getal1)\r\nprint(getal2+getal3%getal1)\r\n\r\nprint(abs(getal4*getal1))\r\nprint(pow(getal3,getal5))\r\n...
false
3,556
0aa419b0045914b066fbec457c918d83276f2583
from matplotlib import pyplot as plt from read_and_calculate_speed import get_info_from_mongodb plt.rcParams['font.sans-serif'] = ['SimHei'] plt.rcParams['font.family'] = 'sans-serif' def mat_line(speed_time_info, interface, direction, last_time): # 调节图形大小,宽,高 fig = plt.figure(figsize=(6, 6)) # 一共一行,每行一图...
[ "from matplotlib import pyplot as plt\nfrom read_and_calculate_speed import get_info_from_mongodb\n\nplt.rcParams['font.sans-serif'] = ['SimHei']\nplt.rcParams['font.family'] = 'sans-serif'\n\n\ndef mat_line(speed_time_info, interface, direction, last_time):\n # 调节图形大小,宽,高\n fig = plt.figure(figsize=(6, 6))\n...
false
3,557
9c277030ef384d60e62c2c48e38a1271a43826d6
__author__ = 'dongdaqing' import threading,time class MyThread(threading.Thread): def __init__(self, name=None): threading.Thread.__init__(self) self.name = name def run(self): print time.strftime('%Y-%m-%d %H-%M-%S',time.localtime()) print self.name def test(): for i in r...
[ "__author__ = 'dongdaqing'\n\nimport threading,time\nclass MyThread(threading.Thread):\n def __init__(self, name=None):\n threading.Thread.__init__(self)\n self.name = name\n\n def run(self):\n print time.strftime('%Y-%m-%d %H-%M-%S',time.localtime())\n print self.name\n\ndef test(...
true
3,558
f49b80d0b8b42bafc787a36d0a8be98ab7fa53e7
from turtle import Turtle class Paddle(Turtle): def __init__(self, x_position, y_position): super().__init__() self.shape('square') self.shapesize(stretch_wid=5, stretch_len=1) self.penup() self.color("white") self.goto(x=x_position, y=y_position) self.speed...
[ "from turtle import Turtle\n\n\nclass Paddle(Turtle):\n def __init__(self, x_position, y_position):\n super().__init__()\n self.shape('square')\n self.shapesize(stretch_wid=5, stretch_len=1)\n self.penup()\n self.color(\"white\")\n self.goto(x=x_position, y=y_position)\n...
false
3,559
7bc2a02d85c3b1a2b7ed61dc7567d1097b63d658
from setuptools import setup, find_packages setup( name='testspace-python', version='', packages=find_packages(include=['testspace', 'testspace.*']), url='', license="MIT license", author="Jeffrey Schultz", author_email='jeffs@s2technologies.com', description="Module for interacting wit...
[ "from setuptools import setup, find_packages\n\nsetup(\n name='testspace-python',\n version='',\n packages=find_packages(include=['testspace', 'testspace.*']),\n url='',\n license=\"MIT license\",\n author=\"Jeffrey Schultz\",\n author_email='jeffs@s2technologies.com',\n description=\"Module...
false
3,560
3b7839347f24d39904d29d40e688a5dfd63534d7
import numpy as np import tensorflow as tf from tfrecords_handler.moving_window.tfrecord_mean_reader import TFRecordReader from configs.global_configs import training_data_configs class StackingModelTester: def __init__(self, **kwargs): self.__use_bias = kwargs["use_bias"] self.__use_peepholes = ...
[ "import numpy as np\nimport tensorflow as tf\nfrom tfrecords_handler.moving_window.tfrecord_mean_reader import TFRecordReader\nfrom configs.global_configs import training_data_configs\n\n\nclass StackingModelTester:\n\n def __init__(self, **kwargs):\n self.__use_bias = kwargs[\"use_bias\"]\n self._...
false
3,561
2d5993489ff3120d980d29edbb53422110a5c039
''' Написати програму, що визначає, яка з двох точок знаходиться ближче до початку координат. ''' import re re_number = re.compile("^[-+]?\d+\.?\d*$") def validator(pattern,promt): text=input(promt) while not bool(pattern.match(text)): text = input(promt) return text def number_validator(promt)...
[ "'''\nНаписати програму, що визначає, яка з двох\nточок знаходиться ближче до початку координат.\n'''\n\nimport re\n\nre_number = re.compile(\"^[-+]?\\d+\\.?\\d*$\")\n\ndef validator(pattern,promt):\n text=input(promt)\n while not bool(pattern.match(text)):\n text = input(promt)\n return text\n\n\nd...
false
3,562
4942b20a8e4f58c52b82800fb4c59db169cd8048
#!/usr/bin/env python # encoding=utf-8 import MySQLdb import re # 打开数据库连接 db = MySQLdb.connect(host='wonderfulloffline.mysql.rds.aliyuncs.com',port=3306,user='wonderfull_ai',password='868wxRHrPaTKkjvC', db='wonderfull_ai_online', charset='utf8' ) def load_stop_word(): stop_word=set() with open("data...
[ "#!/usr/bin/env python\r\n# encoding=utf-8\r\nimport MySQLdb\r\nimport re\r\n\r\n# 打开数据库连接\r\ndb = MySQLdb.connect(host='wonderfulloffline.mysql.rds.aliyuncs.com',port=3306,user='wonderfull_ai',password='868wxRHrPaTKkjvC', db='wonderfull_ai_online', charset='utf8' )\r\n\r\ndef load_stop_word():\r\n stop_word=set...
false
3,563
d60690892eddda656c11470aacd1fdc9d07a721a
# CIS 117 Python Programming - Lab 10 # Bryce DesBrisay def middle(string): characters = list(string) length = len(characters) middleNum = round((length + .5) / 2) if length % 2 == 0: return characters[middleNum - 1] + characters[middleNum] else: return characters[middleNum - 1] de...
[ "# CIS 117 Python Programming - Lab 10\n# Bryce DesBrisay\n\ndef middle(string):\n characters = list(string)\n length = len(characters)\n middleNum = round((length + .5) / 2)\n if length % 2 == 0:\n return characters[middleNum - 1] + characters[middleNum]\n else:\n return characters[mid...
false
3,564
4032503bba8a1dd273015d503f52b6ea2d932d1d
from pprint import pprint from collections import Counter from copy import deepcopy class Sudoku(): def __init__(self, grid): ''' Initializes the grid ''' self.grid = grid self.sub_grid = self.create_sub_grid(self.grid) def create_sub_grid(self, ...
[ "\r\n\r\n\r\nfrom pprint import pprint\r\nfrom collections import Counter\r\nfrom copy import deepcopy\r\n\r\n\r\nclass Sudoku():\r\n def __init__(self, grid):\r\n '''\r\n Initializes the grid\r\n '''\r\n self.grid = grid\r\n self.sub_grid = self.create_sub_grid(self.grid)\...
false
3,565
e828c2792d508ba41c5dca3f4a255eee2611c333
Max = 100010 a = [0 for i in range(Max)] p = [] for i in range(2,Max): if a[i ] == 0: p.append(i) j = i * i while j < Max: a[j ] = 1 j = j + i cnt,j = 0,1 n = int(input()) while p[j] <= n : if p[j ] - p[j-1] == 2: cnt = cnt + 1 j = j + 1 print(cnt)
[ "Max = 100010\na = [0 for i in range(Max)]\np = []\nfor i in range(2,Max):\n if a[i ] == 0:\n p.append(i)\n j = i * i \n while j < Max:\n a[j ] = 1\n j = j + i\n\ncnt,j = 0,1\nn = int(input())\nwhile p[j] <= n :\n if p[j ] - p[j-1] == 2: cnt = cnt + 1\n j = j + 1\...
false
3,566
5c4c893caa19e58491e641420261bb70e7202cf0
#!/usr/bin/python # -*- coding: utf-8 -*- import os # Describes where to search for the config file if no location is specified DEFAULT_CONFIG_LOCATION = "config.json" DEFAULT_CONFIG = { "project": None, "fixed_model_name": None, "config": DEFAULT_CONFIG_LOCATION, "data": None, "emulate": None...
[ "#!/usr/bin/python \n# -*- coding: utf-8 -*-\n\nimport os\n\n# Describes where to search for the config file if no location is specified\n\nDEFAULT_CONFIG_LOCATION = \"config.json\"\n\nDEFAULT_CONFIG = {\n \"project\": None,\n \"fixed_model_name\": None,\n \"config\": DEFAULT_CONFIG_LOCATION,\n \"data\...
false
3,567
d8a09f9952856da69120fae6221636dd5bd8c93e
# python examples/mnist_rnn.py --bsz 128 --bsz-eval 256 import sys from argparse import ArgumentParser import pytorch_lightning as pl import torch.nn as nn import torch.optim as optim from loguru import logger from slp.config.config_parser import make_cli_parser, parse_config from slp.data.collators import SequenceCl...
[ "# python examples/mnist_rnn.py --bsz 128 --bsz-eval 256\n\nimport sys\nfrom argparse import ArgumentParser\n\nimport pytorch_lightning as pl\nimport torch.nn as nn\nimport torch.optim as optim\nfrom loguru import logger\nfrom slp.config.config_parser import make_cli_parser, parse_config\nfrom slp.data.collators im...
false
3,568
27edc753ebb9d60715a2ffa25d77e69ef363d010
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import minimize from scipy.stats import chisquare, chi2, binom, poisson def f_1(x, a): return (1 / (x + 5)) * np.sin(a * x) def f_2(x, a): return np.sin(a * x) + 1 def f_3(x, a): return np.sin(a * (x ** 2)) def f_4(x, a): ret...
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.optimize import minimize\nfrom scipy.stats import chisquare, chi2, binom, poisson\n\n\ndef f_1(x, a):\n return (1 / (x + 5)) * np.sin(a * x)\n\n\ndef f_2(x, a):\n return np.sin(a * x) + 1\n\n\ndef f_3(x, a):\n return np.sin(a * (x ** 2))\n\n\...
false
3,569
ee489c2e313a96671db79398218f8604f7ae1bf3
# -*- coding: utf-8 -*- # BSD 3-Clause License # # Copyright (c) 2017 # All rights reserved. # Copyright 2022 Huawei Technologies Co., Ltd # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source ...
[ "# -*- coding: utf-8 -*-\n# BSD 3-Clause License\n#\n# Copyright (c) 2017\n# All rights reserved.\n# Copyright 2022 Huawei Technologies Co., Ltd\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistribut...
false
3,570
53127de883fb5da3214d13904664566269becba6
# 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 in writing, software # distributed under t...
[ "# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distr...
false
3,571
dc27781d0c3129d11aa98a5889aea0383b5a49d6
from django.db import models from django.contrib.auth.models import User class CustomUser(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='custom_user') def get_current_score(self): acc = 0 for score in self.user_scores.all(): acc += score.p...
[ "from django.db import models\nfrom django.contrib.auth.models import User\n\n\nclass CustomUser(models.Model):\n user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='custom_user')\n\n def get_current_score(self):\n acc = 0\n for score in self.user_scores.all():\n ...
false
3,572
32869a88bb59d47281249b6ebe2357328beb0359
#!/usr/bin/env python def question(): print("02. 「パトカー」+「タクシー」=「パタトクカシーー」") print("「パトカー」+「タクシー」の文字を先頭から交互に連結して文字列「パタトクカシーー」を得よ.") def main(): str1 = "パトカー" str2 = "タクシー" print(''.join([x[0] + x[1] for x in zip(str1, str2)])) if __name__ == '__main__': question() main()
[ "#!/usr/bin/env python\n\ndef question():\n print(\"02. 「パトカー」+「タクシー」=「パタトクカシーー」\")\n print(\"「パトカー」+「タクシー」の文字を先頭から交互に連結して文字列「パタトクカシーー」を得よ.\")\n\ndef main():\n str1 = \"パトカー\"\n str2 = \"タクシー\"\n print(''.join([x[0] + x[1] for x in zip(str1, str2)]))\n\nif __name__ == '__main__':\n question()\n ...
false
3,573
e75bee4e014aa369131c3e200ce874a8840b5690
from GRAFICA_BRESENHAMS import Bresenhams def main(): x = int(input('INGRESA VALOR PARA X: \n')) y = int(input('INGRESA VALOR PARA Y: \n')) x1 = int(input('INGRESA VALOR PARA X1: \n')) y1 = int(input('INGRESA VALOR PARA Y1: \n')) Bresenhams(x,y,x1,y1) if __name__=='__main__': main()
[ "from GRAFICA_BRESENHAMS import Bresenhams\r\ndef main():\r\n x = int(input('INGRESA VALOR PARA X: \\n'))\r\n y = int(input('INGRESA VALOR PARA Y: \\n'))\r\n x1 = int(input('INGRESA VALOR PARA X1: \\n'))\r\n y1 = int(input('INGRESA VALOR PARA Y1: \\n'))\r\n Bresenhams(x,y,x1,y1)\r\n\r\nif __name__==...
false
3,574
ff99b5fd168d7987e488d7f6d0455619e988f15a
import numpy as np import math import activations class FC_layer(): def __init__(self, input_size, output_size, weight_init_range, activation, debug): self.type = "FC" self.activation_name = activation self.shape = (input_size, output_size) self.activation = activations.get_activati...
[ "import numpy as np\nimport math\nimport activations\n\nclass FC_layer():\n def __init__(self, input_size, output_size, weight_init_range, activation, debug):\n self.type = \"FC\"\n self.activation_name = activation\n self.shape = (input_size, output_size)\n self.activation = activati...
false
3,575
17cd6746e58a7f33bc239c1420d51c6810ed02d8
from turtle import * import time import random colormode(255) class Ball(Turtle): def __init__(self, x,y,dx,dy,r): Turtle.__init__(self) self.pu() self.goto(x,y) self.dx = dx self.dy = dy self.r = r self.shape("circle") self.shapesize(r/10) r ...
[ "from turtle import *\nimport time\nimport random\ncolormode(255)\n\nclass Ball(Turtle):\n def __init__(self, x,y,dx,dy,r):\n Turtle.__init__(self)\n self.pu()\n self.goto(x,y)\n self.dx = dx\n self.dy = dy\n self.r = r\n self.shape(\"circle\")\n self.shape...
false
3,576
c14673b56cb31efb5d79859dd0f6f3c6806e1056
import main.Tools class EnigmaRotor: def __init__(self, entrata, uscita, rotore_succ=None, flag=True): self.entrata=entrata.copy() self.uscita=uscita.copy() self.numeroSpostamenti=0 self.flag=flag self.rotore_succ=rotore_succ #Imposta il rotore sull'elemento specificat...
[ "import main.Tools\n\nclass EnigmaRotor:\n\n def __init__(self, entrata, uscita, rotore_succ=None, flag=True):\n self.entrata=entrata.copy()\n self.uscita=uscita.copy()\n self.numeroSpostamenti=0\n self.flag=flag\n self.rotore_succ=rotore_succ\n\n #Imposta il rotore sull'ele...
false
3,577
bd5f298027f82edf5451f5297d577005674de4c3
import time import random import math people = [('Seymour', 'BOS'), ('Franny', 'DAL'), ('Zooey', 'CAK'), ('Walt', 'MIA'), ('Buddy', 'ORD'), ('Les', 'OMA')] destination = 'LGA' flights = dict() for line in file('schedule.txt'): origin, dest, depart, arrive, price...
[ "import time\nimport random\nimport math\n\npeople = [('Seymour', 'BOS'),\n ('Franny', 'DAL'),\n ('Zooey', 'CAK'),\n ('Walt', 'MIA'),\n ('Buddy', 'ORD'),\n ('Les', 'OMA')]\n\ndestination = 'LGA'\n\nflights = dict()\n\nfor line in file('schedule.txt'):\n origin, dest, ...
true
3,578
6e3aa677985d7bd91bfbbd2078665206839bac63
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import paramiko import commands def ip_check(): """ Parses attributes for given hosts, then checks if hosts are up and then calls path_check function with working hosts. """ hosts = [] valid_hosts = [] for item in sys.argv...
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport paramiko\nimport commands\n\n\ndef ip_check():\n \"\"\"\n Parses attributes for given hosts,\n then checks if hosts are up\n and then calls path_check function with working hosts.\n \"\"\"\n hosts = []\n valid_hosts = ...
false
3,579
c385fe2af9aebc9c4a42d4db5a341fcedeec3898
from django.shortcuts import render # Create your views here. from django.shortcuts import redirect from django.contrib.auth.mixins import LoginRequiredMixin from django.http import Http404, HttpResponseForbidden from django.shortcuts import render from django.urls import reverse from django.views.generic.edit import ...
[ "from django.shortcuts import render\n\n# Create your views here.\nfrom django.shortcuts import redirect\nfrom django.contrib.auth.mixins import LoginRequiredMixin\nfrom django.http import Http404, HttpResponseForbidden\nfrom django.shortcuts import render\nfrom django.urls import reverse\nfrom django.views.generic...
false
3,580
0577c274672bac333500535f21f568ade62100c7
# *Using Min & Max Exercise def extremes(nums): return (max(nums), min(nums))
[ "\n# *Using Min & Max Exercise\ndef extremes(nums):\n return (max(nums), min(nums))\n", "def extremes(nums):\n return max(nums), min(nums)\n", "<function token>\n" ]
false
3,581
fe0d6cc03512d54d2d8722551e3f2a7c1bf43997
#!/opt/Python/2.7.3/bin/python import sys from collections import defaultdict import numpy as np import re import os import argparse from Bio import SeqIO def usage(): test="name" message=''' python CircosConf.py --input circos.config --output pipe.conf ''' print message def fasta_id(fastafile): ...
[ "#!/opt/Python/2.7.3/bin/python\nimport sys\nfrom collections import defaultdict\nimport numpy as np\nimport re\nimport os\nimport argparse\nfrom Bio import SeqIO\n\ndef usage():\n test=\"name\"\n message='''\npython CircosConf.py --input circos.config --output pipe.conf\n\n '''\n print message\n\ndef f...
true
3,582
7a4044acaa191509c96e09dcd48e5b951ef7a711
# put your python code here time_one = abs(int(input())) time_two = abs(int(input())) time_three = abs(int(input())) time_four = abs(int(input())) time_five = abs(int(input())) time_six = abs(int(input())) HOUR = 3600 # 3600 seconds in an hour MINUTE = 60 # 60 seconds in a minute input_one = time_one * HOUR + time...
[ "# put your python code here\ntime_one = abs(int(input()))\ntime_two = abs(int(input()))\ntime_three = abs(int(input()))\n\ntime_four = abs(int(input()))\ntime_five = abs(int(input()))\ntime_six = abs(int(input()))\n\nHOUR = 3600 # 3600 seconds in an hour\nMINUTE = 60 # 60 seconds in a minute\n\ninput_one = time_...
false
3,583
91cf1f4cf34ac9723be4863e81149c703adca27a
import sys sys.path.append("..") # Adds higher directory to python modules path. from utils import npm_decorator # num_node = 3 @ npm_decorator(3) def scenario(): """ 1. Check each peer's genesis block 2. Generate new blocks on each peer 2.1. 2 blocks on peer #1 2.2. 4 blocks on peer #2 ...
[ "import sys\nsys.path.append(\"..\") # Adds higher directory to python modules path.\n\nfrom utils import npm_decorator\n\n\n# num_node = 3\n@ npm_decorator(3)\ndef scenario():\n \"\"\"\n 1. Check each peer's genesis block\n 2. Generate new blocks on each peer\n 2.1. 2 blocks on peer #1\n 2....
false
3,584
9e98a361ef20049cba488b86ad06eb92b3d29d11
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isBalanced(self, root: TreeNode) -> bool: self.mem = dict() if root is None: ...
[ "# Definition for a binary tree node.\n# class TreeNode:\n# def __init__(self, val=0, left=None, right=None):\n# self.val = val\n# self.left = left\n# self.right = right\nclass Solution:\n def isBalanced(self, root: TreeNode) -> bool:\n self.mem = dict()\n if root is Non...
false
3,585
1073845131afb2446ca68ee10092eeb00feef800
# uncompyle6 version 3.2.3 # Python bytecode 3.6 (3379) # Decompiled from: Python 2.7.5 (default, Jul 13 2018, 13:06:57) # [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] # Embedded file name: ./authx/migrations/0001_initial.py # Compiled at: 2018-08-23 19:33:14 # Size of source mod 2**32: 2715 bytes from __future__ import un...
[ "# uncompyle6 version 3.2.3\n# Python bytecode 3.6 (3379)\n# Decompiled from: Python 2.7.5 (default, Jul 13 2018, 13:06:57) \n# [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]\n# Embedded file name: ./authx/migrations/0001_initial.py\n# Compiled at: 2018-08-23 19:33:14\n# Size of source mod 2**32: 2715 bytes\nfrom __future...
false
3,586
8d3f8872a3d5c4351551dc2d46839763d28ebd70
# For better usage on ddp import torch from pytorch_lightning.metrics import Metric import cv2 import numpy as np import skimage import torch.tensor as Tensor class SegMetric(Metric): def __init__(self, iou_thr, prob_thr, img_size, dist_sync_on_step=False): super().__init__(dist_sync_on_step=dist_sync_on...
[ "# For better usage on ddp\n\nimport torch\nfrom pytorch_lightning.metrics import Metric\nimport cv2\nimport numpy as np\nimport skimage\nimport torch.tensor as Tensor\n\n\nclass SegMetric(Metric):\n def __init__(self, iou_thr, prob_thr, img_size, dist_sync_on_step=False):\n super().__init__(dist_sync_on_...
false
3,587
fd45657083942dee13f9939ce2a4b71ba3f67397
# -*- coding: utf-8 -*- # @Time : 2022-03-09 21:51 # @Author : 袁肖瀚 # @FileName: WDCNN-DANN.py # @Software: PyCharm import torch import numpy as np import torch.nn as nn import argparse from model import WDCNN1 from torch.nn.init import xavier_uniform_ import torch.utils.data as Data import matplotlib.py...
[ "# -*- coding: utf-8 -*-\r\n# @Time : 2022-03-09 21:51\r\n# @Author : 袁肖瀚\r\n# @FileName: WDCNN-DANN.py\r\n# @Software: PyCharm\r\nimport torch\r\nimport numpy as np\r\nimport torch.nn as nn\r\nimport argparse\r\nfrom model import WDCNN1\r\nfrom torch.nn.init import xavier_uniform_\r\nimport torch.utils.data as...
false
3,588
97c97f18d1b93dc54538a0df7badafd961fdcb9c
from manimlib.imports import * class A_Scroller(Scene): CONFIG={ "camera_config":{"background_color":"#FFFFFF"} } def construct(self): text_1 = Text("3493", color="#DC3832") text_2 = Text("3646", color="#221F20").shift(2*RIGHT) text_3 = Text("4182", color="#2566AD").shift(4*RIGHT) text_4 = Te...
[ "from manimlib.imports import *\n\nclass A_Scroller(Scene):\n CONFIG={\n \"camera_config\":{\"background_color\":\"#FFFFFF\"}\n }\n def construct(self):\n text_1 = Text(\"3493\", color=\"#DC3832\")\n text_2 = Text(\"3646\", color=\"#221F20\").shift(2*RIGHT)\n text_3 = Text(\"4182\", color=\"#2566AD\"...
false
3,589
bb847480e7e4508fbfb5e7873c4ed390943e2fcf
#import os import queue as q #Считываем ввод file = open('input.txt', 'r') inp = '' for i in file: for j in i: if (j != '\n'): inp += j else: inp += ' ' inp += ' ' #print(inp) file.close() #Записываем все пути в двумерный массив tmp = '' #Переменная для хранения текущего ...
[ "#import os\nimport queue as q\n\n#Считываем ввод\nfile = open('input.txt', 'r')\n\ninp = ''\nfor i in file:\n for j in i:\n if (j != '\\n'):\n inp += j\n else:\n inp += ' '\ninp += ' '\n#print(inp)\n\nfile.close()\n\n#Записываем все пути в двумерный массив\ntmp = '' #Переменн...
false
3,590
daeb11000978d14a05ea62113dcf6e30d6a98b15
# Enunciado: faça um programa que leia um ano qualquer e mostre se ele é BISEXTO. ano = int(input('\nInforme o ano: ')) ano1 = ano % 4 ano2 = ano % 100 if ano1 == 0 and ano2 != 0: print('\nO ano de {} é Bissexto !!'.format(ano)) else: print('\nO ano de {} não foi Bissexto !!'.format(ano))
[ "# Enunciado: faça um programa que leia um ano qualquer e mostre se ele é BISEXTO.\n\nano = int(input('\\nInforme o ano: '))\n\nano1 = ano % 4\nano2 = ano % 100\n\nif ano1 == 0 and ano2 != 0:\n print('\\nO ano de {} é Bissexto !!'.format(ano))\nelse:\n print('\\nO ano de {} não foi Bissexto !!'.format(ano))\n...
false
3,591
3ecc9ce82d9c902958a4da51ce7ee3c39b064b2b
import datetime from django.views.generic import DetailView, ListView from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponseRedirect, Http404 from django.shortcuts import get_list_or_404, render_to_response, get_object_or_404 from django.template import RequestContext from django.co...
[ "import datetime\nfrom django.views.generic import DetailView, ListView\n\nfrom django.core.exceptions import ObjectDoesNotExist\nfrom django.http import HttpResponseRedirect, Http404\nfrom django.shortcuts import get_list_or_404, render_to_response, get_object_or_404\nfrom django.template import RequestContext\nfr...
false
3,592
64b4deaad548a38ba646423d33fc6a985483a042
######################################## __author__ = "Abdelrahman Eldesokey" __license__ = "GNU GPLv3" __version__ = "0.1" __maintainer__ = "Abdelrahman Eldesokey" __email__ = "abdo.eldesokey@gmail.com" ######################################## import torch import torch.nn.functional as F import torch.nn as nn from to...
[ "########################################\n__author__ = \"Abdelrahman Eldesokey\"\n__license__ = \"GNU GPLv3\"\n__version__ = \"0.1\"\n__maintainer__ = \"Abdelrahman Eldesokey\"\n__email__ = \"abdo.eldesokey@gmail.com\"\n########################################\n\nimport torch\nimport torch.nn.functional as F\nimpo...
false
3,593
9af2b94c6eef47dad0348a5437593cc8561a7deb
import numpy numpy.random.seed(1) M = 20 N = 100 import numpy as np x = np.random.randn(N, 2) w = np.random.randn(M, 2) f = np.einsum('ik,jk->ij', w, x) y = f + 0.1*np.random.randn(M, N) D = 10 from bayespy.nodes import GaussianARD, Gamma, SumMultiply X = GaussianARD(0, 1, plates=(1,N), shape=(D,)) alpha = Gamma(1e-5, ...
[ "import numpy\nnumpy.random.seed(1)\nM = 20\nN = 100\nimport numpy as np\nx = np.random.randn(N, 2)\nw = np.random.randn(M, 2)\nf = np.einsum('ik,jk->ij', w, x)\ny = f + 0.1*np.random.randn(M, N)\nD = 10\nfrom bayespy.nodes import GaussianARD, Gamma, SumMultiply\nX = GaussianARD(0, 1, plates=(1,N), shape=(D,))\nalp...
false
3,594
2fbf312e1f8388008bb9ab9ba0ee4ccee1a8beae
# -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2018-04-12 12:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cstasker', '0001_initial'), ] operations = [ migrations.AlterField( ...
[ "# -*- coding: utf-8 -*-\n# Generated by Django 1.11.8 on 2018-04-12 12:37\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('cstasker', '0001_initial'),\n ]\n\n operations = [\n migrations....
false
3,595
d60810ea0b19cc9163ce526e6a5a54da9c8b3f68
############################################################################### # Copyright (c) 2017-2020 Koren Lev (Cisco Systems), # # Yaron Yogev (Cisco Systems), Ilia Abashin (Cisco Systems) and others # # # ...
[ "###############################################################################\n# Copyright (c) 2017-2020 Koren Lev (Cisco Systems), #\n# Yaron Yogev (Cisco Systems), Ilia Abashin (Cisco Systems) and others #\n# ...
false
3,596
36fce3837e0341d94ff6099a06be8cf757a1cfa9
from pyspark import SparkContext, SparkConf conf = SparkConf().setAppName("same_host").setMaster("local") sc = SparkContext(conf=conf) julyFirstLogs = sc.textFile("/Users/iamsuman/src/iamsuman/myspark/mypyspark/data/nasa_19950701.tsv") augFirstLogs = sc.textFile("/Users/iamsuman/src/iamsuman/myspark/mypyspark/data/na...
[ "from pyspark import SparkContext, SparkConf\n\nconf = SparkConf().setAppName(\"same_host\").setMaster(\"local\")\nsc = SparkContext(conf=conf)\n\njulyFirstLogs = sc.textFile(\"/Users/iamsuman/src/iamsuman/myspark/mypyspark/data/nasa_19950701.tsv\")\naugFirstLogs = sc.textFile(\"/Users/iamsuman/src/iamsuman/myspark...
false
3,597
7b01e81c3e31e0a315ee01f36bf1b1f7384a9d10
from tracking.centroidtracker import CentroidTracker from tracking.trackableobject import TrackableObject import tensornets as nets import cv2 import numpy as np import time import dlib import tensorflow.compat.v1 as tf import os # For 'disable_v2_behavior' see https://github.com/theislab/scgen/issues/14 tf.disable_v2...
[ "from tracking.centroidtracker import CentroidTracker\nfrom tracking.trackableobject import TrackableObject\nimport tensornets as nets\nimport cv2\nimport numpy as np\nimport time\nimport dlib\nimport tensorflow.compat.v1 as tf\nimport os\n\n# For 'disable_v2_behavior' see https://github.com/theislab/scgen/issues/1...
false
3,598
bafb6c09ecd0017428441e109733ebcb189863ad
operation = input('operation type: ').lower() num1 = input("First number: ") num2 = input("First number: ") try: num1, num2 = float(num1), float(num2) if operation == 'add': result = num1 + num2 print(result) elif operation == 'subtract': result = num1 - num2 print(result) ...
[ "operation = input('operation type: ').lower()\nnum1 = input(\"First number: \")\nnum2 = input(\"First number: \")\n\ntry:\n num1, num2 = float(num1), float(num2)\n if operation == 'add':\n result = num1 + num2\n print(result)\n elif operation == 'subtract':\n result = num1 - num2\n ...
false
3,599
628e625be86053988cbaa3ddfe55f0538136e24d
################## #Drawing Generic Rest of Board/ ################## def drawBoard(canvas,data): canvas.create_rectangle(10,10,data.width-10,data.height-10, fill = "dark green") canvas.create_rectangle(187, 160, 200, 550, fill = "white") canvas.create_rectangle(187, 160, 561, 173, fill = "white") can...
[ "##################\n#Drawing Generic Rest of Board/\n##################\ndef drawBoard(canvas,data): \n canvas.create_rectangle(10,10,data.width-10,data.height-10, fill = \"dark green\")\n canvas.create_rectangle(187, 160, 200, 550, fill = \"white\") \n canvas.create_rectangle(187, 160, 561, 173, fill = \...
false