index
int64
0
100k
blob_id
stringlengths
40
40
code
stringlengths
7
7.27M
steps
listlengths
1
1.25k
error
bool
2 classes
5,900
33b6a4c76079ed698809b29772abb59a34831472
from django.db import models from django.utils import timezone from django.contrib.auth.models import User, Group # Create your models here. def default_expiration(): return timezone.now() + timezone.timedelta(days=10) class Category(models.Model): name = models.CharField(max_length=200) description = ...
[ "from django.db import models\nfrom django.utils import timezone\nfrom django.contrib.auth.models import User, Group\n\n# Create your models here.\n\n\ndef default_expiration():\n return timezone.now() + timezone.timedelta(days=10)\n\n\nclass Category(models.Model):\n name = models.CharField(max_length=200)\n...
false
5,901
3fdb29797894737edae37ad7890e14cb9ce705e8
import pygame naytto = pygame.display.set_mode((740, 500)) pygame.display.set_caption("Piirtäminen") x = 100 y = 300 def main(): while True: tapahtuma = pygame.event.poll() if tapahtuma.type == pygame.QUIT: break naytto.fill((0, 0, 0)) pygame.draw.line(naytto, (0, 0, ...
[ "import pygame\n\nnaytto = pygame.display.set_mode((740, 500))\npygame.display.set_caption(\"Piirtäminen\")\n\nx = 100\ny = 300\n\ndef main():\n while True:\n tapahtuma = pygame.event.poll()\n if tapahtuma.type == pygame.QUIT:\n break\n\n naytto.fill((0, 0, 0))\n pygame.dra...
false
5,902
42021b762737a2eb21866ba029ece4ac120152cd
class Solution(object): def countSmaller(self, nums): """ :type nums: List[int] :rtype: List[int] naive -- o(n^2) """ ## StefanPochmann solution #2 def countSmaller(self, nums): def sort(enum): half = len(enum) / 2 if half: left = sort(enum...
[ "class Solution(object):\n def countSmaller(self, nums):\n \"\"\"\n :type nums: List[int]\n :rtype: List[int]\n naive -- o(n^2)\n \"\"\"\n\n## StefanPochmann solution #2\ndef countSmaller(self, nums):\n def sort(enum):\n half = len(enum) / 2\n if half:\n ...
false
5,903
ff924b803a875d3f6201baa2c1251a6c5b8cde61
from django.http import request from restapp.ExcelSheet import * '''ApiHomeDict={} class LoadDict(): e = ExcelSheetAll() ApiHomeDict = e.apiHomeDict() print ApiHomeDict class ReturnApi: def returnDict(self): return ApiHomeDict''' '''if "ApiDictionary" in request.session: print...
[ "from django.http import request\r\nfrom restapp.ExcelSheet import *\r\n\r\n\r\n'''ApiHomeDict={}\r\nclass LoadDict():\r\n e = ExcelSheetAll()\r\n ApiHomeDict = e.apiHomeDict()\r\n print ApiHomeDict\r\nclass ReturnApi:\r\n def returnDict(self):\r\n return ApiHomeDict'''\r\n'''if \"ApiDictionary\"...
false
5,904
9247896850e5282265cd08240f6f505e675ce5f0
n = int(input()) num = list(map(int, input().split())) plus_cnt = 0 div_max = 0 for i in num: div = 0 while i > 0: if i % 2 == 0: i //= 2 div += 1 else: i -= 1 plus_cnt += 1 div_max = max(div_max, div) print(plus_cnt + div_max)
[ "n = int(input())\n\nnum = list(map(int, input().split()))\n\nplus_cnt = 0\ndiv_max = 0\n\nfor i in num:\n div = 0\n while i > 0:\n if i % 2 == 0:\n i //= 2\n div += 1\n else:\n i -= 1\n plus_cnt += 1\n div_max = max(div_max, div)\nprint(plus_cnt + ...
false
5,905
aff439361716c35e5f492680a55e7470b4ee0c42
from numpy import empty import pickle from dataset import Dataset from image import Image f = open("./digitdata/trainingimages", "r") reader = f.readlines() labels = open("./digitdata/traininglabels", "r") lreader = labels.readlines() trainImageList = [] j = 0 i = 0 while(j < len(reader)): image_array = empty([...
[ "from numpy import empty\nimport pickle\nfrom dataset import Dataset\nfrom image import Image\n\nf = open(\"./digitdata/trainingimages\", \"r\")\nreader = f.readlines()\n\nlabels = open(\"./digitdata/traininglabels\", \"r\")\nlreader = labels.readlines()\n\ntrainImageList = []\n\nj = 0\ni = 0\nwhile(j < len(reader)...
false
5,906
b4b80e40d12486881e37dd7ddeeef9c76417ebd9
def add(a, b): print "ADDING %d + %d" % (a, b) return a + b def subtract(a, b): print "SUBTRACTING %d - %d" %(a, b) return a - b def multipy(a, b): print "MULTIPLYING %d * %d" % (a, b) return a * b def divide(a, b): print "DIVIDING %d / %d" % (a, b) return a / b print "Let's do some...
[ "def add(a, b):\n print \"ADDING %d + %d\" % (a, b)\n return a + b\n\ndef subtract(a, b):\n print \"SUBTRACTING %d - %d\" %(a, b)\n return a - b\n\ndef multipy(a, b):\n print \"MULTIPLYING %d * %d\" % (a, b)\n return a * b\n\ndef divide(a, b):\n print \"DIVIDING %d / %d\" % (a, b)\n return a...
true
5,907
7f9046582ff03d1c72d191a8f78c911cbc8a0650
#!/usr/bin/env python """ Power calculation based for admixture mapping. @ref: Design and Analysis of admixture mapping studies, (2004). @Author: wavefancy@gmail.com Usage: PowerCalculation.py -r aratio -n nhap PowerCalculation.py -h | --help | -v | --version | -f | --format Not...
[ "#!/usr/bin/env python\n\n\"\"\"\n\n Power calculation based for admixture mapping.\n @ref: Design and Analysis of admixture mapping studies, (2004).\n\n @Author: wavefancy@gmail.com\n\n Usage:\n PowerCalculation.py -r aratio -n nhap\n PowerCalculation.py -h | --help | -v | --version | -f ...
false
5,908
a6c45ab3df0a692cd625d8203e1152e942a4cd6c
# DISCLAIMER # The "Math" code was taken from http://depado.markdownblog.com/2015-09-29-mistune-parser-syntax-highlighter-mathjax-support-and-centered-images # The HighlightRenderer code was taken from https://github.com/rupeshk/MarkdownHighlighter # MarkdownHighlighter is a simple syntax highlighter for Markdown syn...
[ "# DISCLAIMER\n# The \"Math\" code was taken from http://depado.markdownblog.com/2015-09-29-mistune-parser-syntax-highlighter-mathjax-support-and-centered-images\n# The HighlightRenderer code was taken from https://github.com/rupeshk/MarkdownHighlighter\n\n\n# MarkdownHighlighter is a simple syntax highlighter for ...
false
5,909
603a73a7cc0487fcabb527ebc21d44cb95817ecb
def checkRaiz(): a = int(input("Informe o primeiro coeficiente: ")) b = int(input("Informe o segundo coeficiente: ")) c = int(input("Informe o terceiro coeficiente: ")) delta = (b*b) - (4*a*c) if (delta < 0): print("Não tem raiz real") elif (delta == 0): print("Existe uma raiz...
[ "\ndef checkRaiz():\n a = int(input(\"Informe o primeiro coeficiente: \"))\n b = int(input(\"Informe o segundo coeficiente: \"))\n c = int(input(\"Informe o terceiro coeficiente: \"))\n\n delta = (b*b) - (4*a*c)\n\n if (delta < 0):\n print(\"Não tem raiz real\")\n elif (delta == 0):\n ...
false
5,910
0dc556336cee9e5f41c036c6fcf6da950216693c
from twindb_backup.copy.binlog_copy import BinlogCopy from twindb_backup.status.binlog_status import BinlogStatus def test_get_latest_backup(raw_binlog_status): instance = BinlogStatus(raw_binlog_status) assert instance.get_latest_backup() == BinlogCopy( host='master1', name='mysqlbin005.bin',...
[ "from twindb_backup.copy.binlog_copy import BinlogCopy\nfrom twindb_backup.status.binlog_status import BinlogStatus\n\n\ndef test_get_latest_backup(raw_binlog_status):\n instance = BinlogStatus(raw_binlog_status)\n assert instance.get_latest_backup() == BinlogCopy(\n host='master1',\n name='mysq...
false
5,911
9dd5db441044c808274493f16a912d1b65a6c28b
print("Leer 10 números enteros, almacenarlos en un vector y determinar en qué posiciones se encuentran los números con mas de 3 dígitos") count=1 lista=[] while count<11: numero=int(input('Introduzca su %d numero:' %(count))) lista.append(numero) count=count+1 listanueva=[] s= ',' f...
[ "print(\"Leer 10 números enteros, almacenarlos en un vector y determinar en qué posiciones se encuentran los números con mas de 3 dígitos\")\r\n\r\n\r\ncount=1\r\nlista=[]\r\nwhile count<11: \r\n numero=int(input('Introduzca su %d numero:' %(count)))\r\n lista.append(numero)\r\n count=count+1\r\nli...
false
5,912
1cba7889370cc7de47bb5cd1eaeadfece056e68a
#Problem available at: https://www.hackerrank.com/challenges/weather-observation-station-6/problem SELECT DISTINCT CITY from STATION where substr(CITY,1,1) in ('a','e','i','o','u');
[ "#Problem available at: https://www.hackerrank.com/challenges/weather-observation-station-6/problem\nSELECT DISTINCT CITY from STATION where substr(CITY,1,1) in ('a','e','i','o','u');" ]
true
5,913
731110b02c8a09dc84042a99c14eef990ae33cd2
""" Have the function CharlietheDog(strArr) read the array of strings stored in strArr which will be a 4x4 matrix of the characters 'C', 'H', 'F', 'O', where C represents Charlie the dog, H represents its home, F represents dog food, and O represents and empty space in the grid. Your goal is to figure out the least...
[ "\"\"\"\nHave the function CharlietheDog(strArr) read the array of strings stored in strArr which \nwill be a 4x4 matrix of the characters 'C', 'H', 'F', 'O', where C represents Charlie the dog,\n H represents its home, F represents dog food, and O represents and empty space in the grid. \n Your goal is to figure o...
false
5,914
9feb24da78113310509664fa9efcf5f399be5335
# Import smtplib for the actual sending function import smtplib # Import the email modules we'll need from email.message import EmailMessage # Open the plain text file whose name is in textfile for reading. with open("testfile.txt") as fp: # Create a text/plain message msg = EmailMessage() msg.set_content...
[ "# Import smtplib for the actual sending function\nimport smtplib\n\n# Import the email modules we'll need\nfrom email.message import EmailMessage\n\n# Open the plain text file whose name is in textfile for reading.\nwith open(\"testfile.txt\") as fp:\n # Create a text/plain message\n msg = EmailMessage()\n ...
false
5,915
dcb57ecf2c72b8ac816bb06986d80544ff97c669
from http import HTTPStatus from ninja import Router mock_post_router = Router() @mock_post_router.get( "/mock_posts", url_name="mock_post_list", summary="전체 mock post의 list를 반환한다", response={200: None}, ) def retrieve_all_mock_posts(request): return HTTPStatus.OK
[ "from http import HTTPStatus\n\nfrom ninja import Router\n\nmock_post_router = Router()\n\n\n@mock_post_router.get(\n \"/mock_posts\",\n url_name=\"mock_post_list\",\n summary=\"전체 mock post의 list를 반환한다\",\n response={200: None},\n)\ndef retrieve_all_mock_posts(request):\n return HTTPStatus.OK\n", ...
false
5,916
d30e5e24dd06a4846fdde3c9fcac0a5dac55ad0d
import sys import os from django.conf import settings BASE_DIR=os.path.dirname(__file__) settings.configure( DEBUG=True, SECRET_KEY='ki==706e99f0ps9w5s*!kx%1^=5jq_k1c&4r@#e&ng9=xlm5_', ROOT_URLCONF='sitebuilder.urls', MIDDLEWARE_CLASSES=(), INSTALLED_APPS=( 'django.contrib.staticfiles', 'django.contrib.webd...
[ "import sys\nimport os\n\nfrom django.conf import settings\n\nBASE_DIR=os.path.dirname(__file__)\n\nsettings.configure(\n\tDEBUG=True,\n\tSECRET_KEY='ki==706e99f0ps9w5s*!kx%1^=5jq_k1c&4r@#e&ng9=xlm5_',\n\tROOT_URLCONF='sitebuilder.urls',\n\tMIDDLEWARE_CLASSES=(),\n\tINSTALLED_APPS=(\n\t\t'django.contrib.staticfiles...
false
5,917
b318f5d443dbf8e4442707839649149e75653295
#!/usr/bin/python import socket import sys host = '10.211.55.5' port = 69 try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) except: print "socket() failed" sys.exit(1) filename = "Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7...
[ "#!/usr/bin/python \nimport socket \nimport sys\n\nhost = '10.211.55.5' \nport = 69\ntry:\n s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) \nexcept:\n print \"socket() failed\" \n sys.exit(1)\nfilename = \"Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad...
true
5,918
7cc9d445d712d485eaebd090d2485dac0c38b3fb
# file /home/hep/ss4314/cmtuser/Gauss_v45r10p1/Gen/DecFiles/options/16303437.py generated: Wed, 25 Jan 2017 15:25:22 # # Event Type: 16303437 # # ASCII decay Descriptor: [Xi_b- -> (rho- -> pi- pi0) K- p+]cc # from Configurables import Generation Generation().EventType = 16303437 Generation().SampleGenerationTool = "Si...
[ "# file /home/hep/ss4314/cmtuser/Gauss_v45r10p1/Gen/DecFiles/options/16303437.py generated: Wed, 25 Jan 2017 15:25:22\n#\n# Event Type: 16303437\n#\n# ASCII decay Descriptor: [Xi_b- -> (rho- -> pi- pi0) K- p+]cc\n#\nfrom Configurables import Generation\nGeneration().EventType = 16303437\nGeneration().SampleGenerat...
false
5,919
8e26a6b50539fa5f498aa2079a2625214e5b4d03
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
false
5,920
ffb6379f2f2611fd8aa73f3a3c15fed4550d348f
############################################################################## # # Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved. # Yoshinori Okuji <yo@nexedi.com> # Christophe Dumez <christophe@nexedi.com> # # WARNING: This program as such is intended to be ...
[ "##############################################################################\n#\n# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.\n# Yoshinori Okuji <yo@nexedi.com>\n# Christophe Dumez <christophe@nexedi.com>\n#\n# WARNING: This program as such is inte...
false
5,921
08e5e8515528eae400a59bfc0c58b8d7b4affd7e
# coding: utf-8 ## ROC for CLEF-IP2010 patents ####### ROC for clef-ip2010 patents # In[ ]: def vectorize_corpus(corpus,tokenizer,vocabulary,max_ngram_size): # tokenize text from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from...
[ "\n# coding: utf-8\n\n## ROC for CLEF-IP2010 patents\n\n####### ROC for clef-ip2010 patents\n\n# In[ ]:\n\ndef vectorize_corpus(corpus,tokenizer,vocabulary,max_ngram_size):\n # tokenize text\n from sklearn.feature_extraction.text import CountVectorizer\n from sklearn.feature_extraction.text import TfidfTra...
true
5,922
fcc12b26308e3031de7e8fcf4ad43ec92279d400
__author__ = 'jamjiang' class Person: def __init__(self, name): self.name = name def sayHi(self): print 'hi!, I am', self.name david = Person('David') david.sayHi() Person('leo').sayHi()
[ "__author__ = 'jamjiang'\nclass Person:\n def __init__(self, name):\n self.name = name\n def sayHi(self):\n print 'hi!, I am', self.name\n\ndavid = Person('David')\ndavid.sayHi()\n\nPerson('leo').sayHi()\n\n" ]
true
5,923
1298c2abae519a5365cc0d9d406196db987eb219
from collections import defaultdict def k_most_frequent(arr:list, k:int): ''' ''' counts = defaultdict(int) for n in nums: counts[n] += 1 counts = [(k,v) for k,v in counts.items()] ordered = list(reversed(sorted(counts, key=lambda d: d[1]))) return [o[0] for o in ordered[:k]] num...
[ "\nfrom collections import defaultdict\n\ndef k_most_frequent(arr:list, k:int):\n ''' '''\n counts = defaultdict(int)\n for n in nums:\n counts[n] += 1\n \n counts = [(k,v) for k,v in counts.items()]\n ordered = list(reversed(sorted(counts, key=lambda d: d[1])))\n return [o[0] for o in o...
false
5,924
0eaba8f570772de864f52168a597b47a4150d015
# -*- coding:utf-8 -*- from common import * import itertools def iteration_spider(): max_errors = 5 num_errors = 0 for page in itertools.count(1): url = 'http://example.webscraping.com/view/-{}'.format(page) html = download(url) if html is None: num_errors += 1 if num_errors == max_errors: break ...
[ "# -*- coding:utf-8 -*-\n\nfrom common import *\nimport itertools\n\ndef iteration_spider():\n\tmax_errors = 5\n\tnum_errors = 0\n\tfor page in itertools.count(1):\n\t\turl = 'http://example.webscraping.com/view/-{}'.format(page)\n\t\thtml = download(url)\n\t\tif html is None:\n\t\t\tnum_errors += 1\n\t\t\tif num_e...
false
5,925
649c0c0f170b50fe51f5eaf11908e968f66625c9
import os import shutil def flatCopyWithExt(srcDir, dstDir, ext): if not os.path.exists(dstDir): os.makedirs(dstDir) for basename in os.listdir(srcDir): if basename.endswith(ext): pathname = os.path.join(srcDir, basename) if os.path.isfile(pathname): shutil.copy2(pathname, dstDir) def move...
[ "import os\r\nimport shutil\r\n\r\ndef flatCopyWithExt(srcDir, dstDir, ext):\r\n\tif not os.path.exists(dstDir):\r\n\t\tos.makedirs(dstDir)\r\n\tfor basename in os.listdir(srcDir):\r\n\t\tif basename.endswith(ext):\r\n\t\t\tpathname = os.path.join(srcDir, basename)\r\n\t\t\tif os.path.isfile(pathname):\r\n\t\t\t\ts...
false
5,926
9d0727970c760a9a8123c5c07359ba5c538cea3c
# CS 5010 Project # Team Metro # Test the data cleaning import unittest from cleaning_data import dfClean # import the dataframe we created after cleaning the data class DataTypesTestCase(unittest.TestCase): # we will test that each column has the correct data type # note that there is a strange occurenc...
[ "# CS 5010 Project \n\n# Team Metro\n\n# Test the data cleaning\n\nimport unittest\nfrom cleaning_data import dfClean # import the dataframe we created after cleaning the data\n\n\nclass DataTypesTestCase(unittest.TestCase):\n\n # we will test that each column has the correct data type\n # note that there is ...
false
5,927
7636925982434b12307383ba7b01f931f7ea6e24
from mininet.cli import CLI from mininet.term import makeTerms from mininet.util import irange from log import log from utils import (UITextStyle, display) from dijkstra import (get_routing_decision, get_route_cost) # Check if route directly connects two switches def isDirect(route): return (len(route) == 2) # ...
[ "\nfrom mininet.cli import CLI\nfrom mininet.term import makeTerms\nfrom mininet.util import irange\n\nfrom log import log\nfrom utils import (UITextStyle, display)\n\nfrom dijkstra import (get_routing_decision, get_route_cost)\n\n# Check if route directly connects two switches\ndef isDirect(route):\n return (le...
false
5,928
cfea7848dfb41c913e5d8fec2f0f4f8afaaa09f3
import sys reload(sys) sys.setdefaultencoding('utf-8') import xml.etree.ElementTree as ET tree = ET.parse('iliad1.xml') root = tree.getroot() file = open('iliad1_clean.txt','w') for l in root.iter('l'): file.write(''.join(l.itertext()) + "\n") file.close()
[ "import sys\nreload(sys)\nsys.setdefaultencoding('utf-8')\n\nimport xml.etree.ElementTree as ET\ntree = ET.parse('iliad1.xml')\nroot = tree.getroot()\n\nfile = open('iliad1_clean.txt','w')\nfor l in root.iter('l'):\n\tfile.write(''.join(l.itertext()) + \"\\n\")\nfile.close()", "import sys\nreload(sys)\nsys.setdef...
false
5,929
08c3155a5fbf6c94f5885c12cfc7c917313ae9c7
from abc import ABCMeta, abstractmethod, ABC from domain.models.network_information import NetworkInformation class AbstractTensorboardExportService(ABC): __metaclass__ = ABCMeta @abstractmethod def save_tensorboard(self, network_info: NetworkInformation) -> None: raise NotImplementedError
[ "from abc import ABCMeta, abstractmethod, ABC\n\nfrom domain.models.network_information import NetworkInformation\n\n\nclass AbstractTensorboardExportService(ABC):\n __metaclass__ = ABCMeta\n\n @abstractmethod\n def save_tensorboard(self, network_info: NetworkInformation) -> None: raise NotImplementedError...
false
5,930
2678aac08104a580e866984bc4cf4adf8cb8ac5c
from __future__ import division, print_function, unicode_literals import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) from pyglet.gl import * from pyglet.window import key from cocos.actions import * from cocos.director import director from cocos.layer import Layer from cocos.scene...
[ "from __future__ import division, print_function, unicode_literals\n\nimport sys\nimport os\nsys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))\n\nfrom pyglet.gl import *\nfrom pyglet.window import key\n\nfrom cocos.actions import *\nfrom cocos.director import director\nfrom cocos.layer import Layer\...
false
5,931
f19056222be713c1556817d852af14d04483c9a3
i = 0 num = '' while len(num) < 1e6: i += 1 num += str(i) prod = 1 for i in xrange(0, 7): prod *= int(num[10 ** i - 1]) print prod
[ "i = 0\nnum = ''\n\nwhile len(num) < 1e6:\n i += 1\n num += str(i)\n\nprod = 1\nfor i in xrange(0, 7):\n prod *= int(num[10 ** i - 1])\n\nprint prod\n" ]
true
5,932
b3c22b4a453aa55da980b090df2749ff9f1066e6
#game that has a timer and you need to stop the timer #with 0 at the end. import simplegui #necessary global variables #time for the timer time = 0 #the display for the timer(string form) watch = '' #tries and correct presses tries = 0 correct = 0 #changes time to watch(number to string of form A:B...
[ "#game that has a timer and you need to stop the timer\r\n#with 0 at the end.\r\n\r\nimport simplegui\r\n\r\n#necessary global variables\r\n\r\n#time for the timer\r\ntime = 0\r\n#the display for the timer(string form)\r\nwatch = ''\r\n#tries and correct presses\r\ntries = 0\r\ncorrect = 0\r\n\r\n\r\n#changes time ...
false
5,933
f4519fa82ffc6bf945c7bb36d3761a708a06f641
import os from flask import Flask, jsonify, request, abort, make_response from flask_sqlalchemy import SQLAlchemy from .models import User from .config import app_config app = Flask(__name__) app.config.from_object(app_config[os.getenv('FLASK_ENV', 'production')]) db = SQLAlchemy(app) @app.route('/api/v1/users/<i...
[ "import os\n\nfrom flask import Flask, jsonify, request, abort, make_response\nfrom flask_sqlalchemy import SQLAlchemy\n\nfrom .models import User\nfrom .config import app_config\n\n\napp = Flask(__name__)\napp.config.from_object(app_config[os.getenv('FLASK_ENV', 'production')])\ndb = SQLAlchemy(app)\n\n\n@app.rout...
false
5,934
f3aaa6ae7a9a57946bdb035a4d52e84541c1a292
import turtle from turtle import color import random screen = turtle.Screen() screen.setup(width=500, height=400) colours = ["red", "pink", "blue", "purple", "black", "green"] y_pos = [100, 60, 20, -20, -60, -100] user_bet = screen.textinput(title="Make your bet", prompt="Which turtle will ...
[ "import turtle\nfrom turtle import color\nimport random\n\nscreen = turtle.Screen()\nscreen.setup(width=500, height=400)\ncolours = [\"red\", \"pink\", \"blue\", \"purple\", \"black\", \"green\"]\ny_pos = [100, 60, 20, -20, -60, -100]\nuser_bet = screen.textinput(title=\"Make your bet\",\n ...
false
5,935
cc81e13bba0ea0186966bce7f5aac05bb106e971
import sys import os def my_add(a, b): return a + b
[ "import sys\nimport os\n\ndef my_add(a, b):\n return a + b\n", "import sys\nimport os\n\n\ndef my_add(a, b):\n return a + b\n", "<import token>\n\n\ndef my_add(a, b):\n return a + b\n", "<import token>\n<function token>\n" ]
false
5,936
d0991d8ea47379a0c1de836b5d215c99166ad049
import sys sys.path.append('../') import constants as cnst import os os.environ['PYTHONHASHSEED'] = '2' import tqdm from model.stg2_generator import StyledGenerator import numpy as np from my_utils.visualize_flame_overlay import OverLayViz from my_utils.flm_dynamic_fit_overlay import camera_ringnetpp from my_utils.gene...
[ "import sys\nsys.path.append('../')\nimport constants as cnst\nimport os\nos.environ['PYTHONHASHSEED'] = '2'\nimport tqdm\nfrom model.stg2_generator import StyledGenerator\nimport numpy as np\nfrom my_utils.visualize_flame_overlay import OverLayViz\nfrom my_utils.flm_dynamic_fit_overlay import camera_ringnetpp\nfro...
false
5,937
337309da79ce9d90010fef5c171b6b344e6dc63f
"""Test Spotify module""" from spoetify.spotify import Spotify from nose.tools import assert_equal def test_search_track(): sp = Spotify() t = sp.search_track("avocado") assert_equal(t.id, "1UyzA43l3OIcJ6jd3hh3ac")
[ "\"\"\"Test Spotify module\"\"\"\nfrom spoetify.spotify import Spotify\nfrom nose.tools import assert_equal\n\n\ndef test_search_track():\n sp = Spotify()\n t = sp.search_track(\"avocado\")\n assert_equal(t.id, \"1UyzA43l3OIcJ6jd3hh3ac\")\n", "<docstring token>\nfrom spoetify.spotify import Spotify\nfrom...
false
5,938
006e1088e72201fab7eebd1409c025b5dba69403
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str ...
[ "# Definition for a binary tree node.\n# class TreeNode(object):\n# def __init__(self, x):\n# self.val = x\n# self.left = None\n# self.right = None\n\nclass Codec:\n\n def serialize(self, root):\n \"\"\"Encodes a tree to a single string.\n \n :type root: TreeNode\...
false
5,939
7d1ca15129b1bf6b713e1d5eda4436d4a8539ad1
import numpy as np class nearest(svm): name="MLLKM2" def __init__(self): svm.__init__(self) def fit(self,x,y): self.x=x self.y=y def predict(self,x): diff=np.subtract(x,self.x) distance=np.linalg.norm(diff,axis=1) dmin= np.argmin( distance ) ...
[ "import numpy as np\n\nclass nearest(svm):\n name=\"MLLKM2\"\n def __init__(self):\n svm.__init__(self)\n\n def fit(self,x,y):\n self.x=x\n self.y=y\n \n def predict(self,x):\n diff=np.subtract(x,self.x)\n distance=np.linalg.norm(diff,axis=1)\n dmin= np.a...
false
5,940
4dac8e7e695c473cb73ceaf3887373bcc0a08aff
# from datetime import datetime from datetime import datetime, time, timedelta # today = datetime.now() # previous_day = today - timedelta(days=1) # previous_day = previous_day.strftime("%Y%m%d") # print(today) # print(previous_day) print(datetime.strptime("2013-1-25", '%Y-%m-%d').strftime('%Y-%m-%d 00:00:00')) # def...
[ "# from datetime import datetime\nfrom datetime import datetime, time, timedelta\n# today = datetime.now()\n# previous_day = today - timedelta(days=1)\n# previous_day = previous_day.strftime(\"%Y%m%d\")\n# print(today)\n# print(previous_day)\n\nprint(datetime.strptime(\"2013-1-25\", '%Y-%m-%d').strftime('%Y-%m-%d 0...
false
5,941
2a500968cf6786440c0d4240430433db90d1fc2f
n = int(input()) p = [220000] + list(map(int, input().split())) cnt = 0 m = 220000 for i in range(1, n+1): now = p[i] m = min(m, now) if now == m: cnt += 1 print(cnt)
[ "n = int(input())\np = [220000] + list(map(int, input().split()))\n\ncnt = 0\nm = 220000\nfor i in range(1, n+1):\n now = p[i]\n m = min(m, now)\n if now == m:\n cnt += 1\nprint(cnt)", "n = int(input())\np = [220000] + list(map(int, input().split()))\ncnt = 0\nm = 220000\nfor i in range(1, n + 1):...
false
5,942
29c1a989365408bf5c3d6196f7afc969be63df85
def patternCount(dnaText, pattern): count = 0 for i in range(0, len(dnaText) - len(pattern)): word = dnaText[i:i+len(pattern)] if (word == pattern): count = count + 1 return count def freqWordProblem(text, k): countWords = [] for i in range(0, len(text) - k): pa...
[ "\ndef patternCount(dnaText, pattern):\n count = 0\n for i in range(0, len(dnaText) - len(pattern)):\n word = dnaText[i:i+len(pattern)]\n if (word == pattern):\n count = count + 1\n return count\n\ndef freqWordProblem(text, k):\n countWords = []\n for i in range(0, len(text) ...
false
5,943
88343b9c5cac3510e8cea75ac5b11f517ddc164b
from __future__ import absolute_import from __future__ import division from __future__ import print_function from keras.layers import Dense, Input from keras.layers import Conv2D, Flatten, Lambda from keras.layers import Reshape, Conv2DTranspose from keras.models import Model from keras.losses import mse, binary_cross...
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom keras.layers import Dense, Input\nfrom keras.layers import Conv2D, Flatten, Lambda\nfrom keras.layers import Reshape, Conv2DTranspose\nfrom keras.models import Model\nfrom keras.losses import mse,...
false
5,944
87e17eb6fa91be09ac9afa43c4e58054faa77477
# Generated by Django 3.1.2 on 2020-10-29 06:04 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
[ "# Generated by Django 3.1.2 on 2020-10-29 06:04\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 initial = True\n\n dependencies = [\n migrations.swappable_dependency(settings.AUTH_USER_MODEL...
false
5,945
90ae6fe37cea2c07d8308498c62460c10ca46846
# -*- coding: utf-8 -*- """ Created on Wed Oct 4 20:55:22 2017 @author: Ivan """ # ----------- # User Instructions # # Modify the test() function to include two new test cases: # 1) four of a kind (fk) vs. full house (fh) returns fk. # 2) full house (fh) vs. full house (fh) returns fh. # # Since the program is stil...
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Oct 4 20:55:22 2017\n\n@author: Ivan\n\"\"\"\n\n# -----------\n# User Instructions\n# \n# Modify the test() function to include two new test cases:\n# 1) four of a kind (fk) vs. full house (fh) returns fk.\n# 2) full house (fh) vs. full house (fh) returns fh.\n#\n# ...
true
5,946
4318c99b3de9bb9c44eed57525c9ccbe82a17276
#!/usr/bin/python # # Script written by Legoktm, 2011 # Released into the Public Domain on November, 16, 2011 # This product comes with no warranty of any sort. # Enjoy! # from commands import getoutput def notify(string, program=False): if not program: command = 'growlnotify Python -m "%s"' %string else: command...
[ "#!/usr/bin/python\n#\n# Script written by Legoktm, 2011\n# Released into the Public Domain on November, 16, 2011\n# This product comes with no warranty of any sort.\n# Enjoy!\n#\nfrom commands import getoutput\ndef notify(string, program=False):\n\tif not program:\n\t\tcommand = 'growlnotify Python -m \"%s\"' %str...
true
5,947
9e02b1a90d61de6d794dd350b50417a2f7260df6
from django import forms from django.contrib.auth.models import User from .models import TblPublish , TblSnippetTopics, TblSnippetData, TblLearnTopics, TblLearnData, TblBlog, TblBlogComments,TblLearnDataComments, TblBlogGvp, TblLearnDataGvp,TblSnippetDataGvp, TblHome, TblAbout, TblQueries from django.contrib.auth.forms...
[ "from django import forms\nfrom django.contrib.auth.models import User\nfrom .models import TblPublish , TblSnippetTopics, TblSnippetData, TblLearnTopics, TblLearnData, TblBlog, TblBlogComments,TblLearnDataComments, TblBlogGvp, TblLearnDataGvp,TblSnippetDataGvp, TblHome, TblAbout, TblQueries\nfrom django.contrib.au...
false
5,948
fa880adcb9f009ffc206de59e8284ac6350fef4c
from django.db import models #from ingredients.models import * class Unit(models.Model): short_name = models.CharField(max_length=20) full_name = models.CharField(max_length=255, null=True) weight_in_grams = models.FloatField(default=1.0) def __str__(self): return f"{self.short_name}"
[ "from django.db import models\n#from ingredients.models import *\n\nclass Unit(models.Model):\n short_name = models.CharField(max_length=20)\n full_name = models.CharField(max_length=255, null=True)\n weight_in_grams = models.FloatField(default=1.0) \n\n def __str__(self):\n return f\"{self.sh...
false
5,949
9527743802a0bb680ab3dcf325c0f7749a51afc6
i = 100 while i >= 100: print(i) i -= 1 print(i)
[ "i = 100\nwhile i >= 100:\n print(i)\ni -= 1\nprint(i)\n\n", "i = 100\nwhile i >= 100:\n print(i)\ni -= 1\nprint(i)\n", "<assignment token>\nwhile i >= 100:\n print(i)\ni -= 1\nprint(i)\n", "<assignment token>\n<code token>\n" ]
false
5,950
6111c9730c556ab3ab95f7685ffa135a2bbeb2ca
from __future__ import with_statement from fabric.api import * from fabric.colors import * from fabric.utils import puts from fabric.context_managers import shell_env env.hosts = ['git@tweetset.com'] def deploy(): "deploys the project to the server" with prefix('source /srv/django-envs/tweetset/bin/activate')...
[ "from __future__ import with_statement\nfrom fabric.api import *\nfrom fabric.colors import *\nfrom fabric.utils import puts\nfrom fabric.context_managers import shell_env\n\nenv.hosts = ['git@tweetset.com']\n\ndef deploy():\n \"deploys the project to the server\"\n with prefix('source /srv/django-envs/tweets...
false
5,951
2075e7e05882524c295c8542ca7aefae2cf3e0fc
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the storage format CLI arguments helper.""" import argparse import unittest from plaso.cli import tools from plaso.cli.helpers import storage_format from plaso.lib import errors from tests.cli import test_lib as cli_test_lib class StorageFormatArgumentsHe...
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"Tests for the storage format CLI arguments helper.\"\"\"\n\nimport argparse\nimport unittest\n\nfrom plaso.cli import tools\nfrom plaso.cli.helpers import storage_format\nfrom plaso.lib import errors\n\nfrom tests.cli import test_lib as cli_test_lib\n\n\nclass...
false
5,952
83bac8176caafc5551089c4bef5c1f38e1e8d4da
# block-comments.py ''' Block comments generally apply to some (or all) code that follows them, and are indented to the same level as that code. Each line of a block comment starts with a # and a single space (unless it is indented text inside the comment). Paragraphs inside a block comment are separated by a line con...
[ "# block-comments.py\n'''\nBlock comments generally apply to some (or all) code that follows them, and are\nindented to the same level as that code. Each line of a block comment starts\nwith a # and a single space (unless it is indented text inside the comment).\n\nParagraphs inside a block comment are separated by...
false
5,953
679ca76212b90261683d59899c1189280b6b6e8c
#!/user/bin/env python3 -tt """ https://adventofcode.com/2017/day/7 """ import sys import re # Global variables task="d-7" infile=task + ".input" with open('input/' + infile) as file: input = file.read() file.close() class Node: parent = None children = None weight_sum = 0 def __init__(self, na...
[ "#!/user/bin/env python3 -tt\n\n\"\"\"\nhttps://adventofcode.com/2017/day/7\n\"\"\"\nimport sys\nimport re\n\n# Global variables\ntask=\"d-7\"\ninfile=task + \".input\"\n\nwith open('input/' + infile) as file:\n input = file.read()\nfile.close()\n\nclass Node:\n parent = None\n children = None\n weight_...
false
5,954
7747cbb1a1ed191b616b0d1bcfd51cdea05067f5
from bs4 import BeautifulSoup import re class Rules: def __init__(self): self.ruleCollection = { "1" : self.rule1, "2" : self.rule2, "3" : self.rule3, "4" : self.rule4, "5" : self.rule5, "6" : self.rule6, "7" : self.rule7, "8" : self.r...
[ "from bs4 import BeautifulSoup\nimport re\n\nclass Rules:\n def __init__(self):\n self.ruleCollection = {\n \"1\" : self.rule1,\n \"2\" : self.rule2,\n \"3\" : self.rule3,\n \"4\" : self.rule4,\n \"5\" : self.rule5,\n \"6\" : self.rule6,\n \"7\" : se...
false
5,955
e26fa69ea1f0bee82b4108ac5a541a6175645728
import numpy as np import cPickle from features import create_features, PROJECT from parse import load_data from dict_vectorizer import DictVectorizer videos, users, reviews = load_data() orig_X = np.array([(x['date'], x['text'], x['user']) for x in reviews]) feats = create_features(orig_X, None) v = DictVectorizer(s...
[ "import numpy as np\nimport cPickle\n\nfrom features import create_features, PROJECT\nfrom parse import load_data\nfrom dict_vectorizer import DictVectorizer\n\nvideos, users, reviews = load_data()\norig_X = np.array([(x['date'], x['text'], x['user']) for x in reviews])\nfeats = create_features(orig_X, None)\nv = D...
false
5,956
459dd9302f7100ad02119cc94b735b19287f21e5
import tensorflow as tf import numpy as np import time import os from sklearn.metrics import roc_curve import matplotlib.pyplot as plt from src.model import get_args from src.funcs import linear from src.youtubeface import load_ytf_data from src.lfw import load_lfw_data from src.facescrub import load_fs_data from src...
[ "import tensorflow as tf\nimport numpy as np\nimport time\nimport os\nfrom sklearn.metrics import roc_curve\nimport matplotlib.pyplot as plt\n\n\nfrom src.model import get_args\nfrom src.funcs import linear\nfrom src.youtubeface import load_ytf_data\nfrom src.lfw import load_lfw_data\nfrom src.facescrub import load...
false
5,957
3770e59c5bd6837a0fb812f80c6549024e06a9e4
''' Functional tests for the Write Stream ''' from behave import given, when, then from OSC import OSCClient, OSCMessage, OSCServer @given('I want to send an integer') def step_impl (context): pass @given('I want to send a float') def step_impl (context): pass @given('I want to send two integers with one ...
[ "'''\n Functional tests for the Write Stream\n'''\nfrom behave import given, when, then\nfrom OSC import OSCClient, OSCMessage, OSCServer\n\n@given('I want to send an integer')\ndef step_impl (context):\n pass\n\n@given('I want to send a float')\ndef step_impl (context):\n pass\n\n@given('I want to send two...
false
5,958
2343a9d3e253b5a0347b5890a5d7b9c3be777669
import tkinter import csv import datetime import time root = tkinter.Tk() root.title("Attendance") root.geometry("+450+250") ts = time.time() date = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d') fileName = "Attendance/Attendance_"+date+".csv" # open file with open(fileName, newline="") as file: reader ...
[ "import tkinter\nimport csv\nimport datetime\nimport time\n\nroot = tkinter.Tk()\nroot.title(\"Attendance\")\nroot.geometry(\"+450+250\")\n\nts = time.time()\ndate = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d')\nfileName = \"Attendance/Attendance_\"+date+\".csv\"\n# open file\nwith open(fileName, newlin...
false
5,959
ae998fb17b8d6f4f5c8871a0ebe86a039501ec99
# -*- coding: utf-8 -*- __all__ = "corner" import logging import numpy as np from corner.core import corner_impl try: from corner.arviz_corner import arviz_corner except ImportError: arviz_corner = None def corner( data, bins=20, *, # Original corner parameters range=None, axes_sc...
[ "# -*- coding: utf-8 -*-\n\n__all__ = \"corner\"\n\nimport logging\n\nimport numpy as np\n\nfrom corner.core import corner_impl\n\ntry:\n from corner.arviz_corner import arviz_corner\nexcept ImportError:\n arviz_corner = None\n\n\ndef corner(\n data,\n bins=20,\n *,\n # Original corner parameters\...
false
5,960
9586dc118be4388491770d823a38e8068e3b91cb
from django.contrib import admin from .models import Contactus,ContactusAdmin,Company,CompanyAdmin,Products,ProductsAdmin,Brands,BrandsAdmin # Register your models here. admin.site.register(Contactus,ContactusAdmin), admin.site.register(Company,CompanyAdmin), admin.site.register(Products,ProductsAdmin), admin.site.reg...
[ "from django.contrib import admin\nfrom .models import Contactus,ContactusAdmin,Company,CompanyAdmin,Products,ProductsAdmin,Brands,BrandsAdmin\n# Register your models here.\n\nadmin.site.register(Contactus,ContactusAdmin),\nadmin.site.register(Company,CompanyAdmin),\nadmin.site.register(Products,ProductsAdmin),\nad...
false
5,961
6623ac194e380c9554d72a1b20bf860b958dda97
from django.http import HttpResponse from django.shortcuts import render from .models import game def index(request): all_games = game.objects.all() context = { 'all_games' : all_games } return render(request,'game/index.html',context) def gameview(response): return HttpResponse("<h1>Ludo ...
[ "from django.http import HttpResponse\nfrom django.shortcuts import render\nfrom .models import game\n\ndef index(request):\n all_games = game.objects.all()\n context = {\n 'all_games' : all_games\n }\n return render(request,'game/index.html',context)\n\ndef gameview(response):\n return HttpRe...
false
5,962
ce263424b856c07e04bd66cda7ebda646583b1fe
S=input() T=int(input()) B=abs(S.count('L')-S.count('R'))+abs(S.count('U')-S.count('D')) print(B+S.count('?') if T==1 else max(B-S.count('?'),(B-S.count('?'))%2))
[ "S=input()\r\nT=int(input())\r\nB=abs(S.count('L')-S.count('R'))+abs(S.count('U')-S.count('D'))\r\nprint(B+S.count('?') if T==1 else max(B-S.count('?'),(B-S.count('?'))%2))", "S = input()\nT = int(input())\nB = abs(S.count('L') - S.count('R')) + abs(S.count('U') - S.count('D'))\nprint(B + S.count('?') if T == 1 e...
false
5,963
719f7b7b2d8df037583263588e93d884ab3820fe
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd gp = pd.read_csv('graph6.csv') N=gp['Starting-node'].max() M=gp['Ending-node'].max() N=max(N,M) gp=gp.sort_values(by='Cost') gp=gp.reset_index() gp=gp.reset_index() gp['tree label']=gp['level_0'] index=gp['index'].max() gp.drop('index',axis...
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport pandas as pd\n\ngp = pd.read_csv('graph6.csv')\n\n\nN=gp['Starting-node'].max()\nM=gp['Ending-node'].max()\nN=max(N,M)\n\n \n\ngp=gp.sort_values(by='Cost')\ngp=gp.reset_index()\ngp=gp.reset_index()\ngp['tree label']=gp['level_0']\nindex=gp['index']....
false
5,964
596f7dfacc931f5e756c71b8622f4001df19934b
from rest_framework import serializers from plan.models import RoughRequirement, DetailedRequirement from plan.models import OfferingCourse, FieldOfStudy, IndicatorFactor from plan.models import BasisTemplate class SimpleOfferingCourseSerializer(serializers.ModelSerializer): class Meta: model = OfferingCou...
[ "from rest_framework import serializers\nfrom plan.models import RoughRequirement, DetailedRequirement\nfrom plan.models import OfferingCourse, FieldOfStudy, IndicatorFactor\nfrom plan.models import BasisTemplate\n\nclass SimpleOfferingCourseSerializer(serializers.ModelSerializer):\n class Meta:\n model =...
false
5,965
cc1a1491ffbcf470705aeea079faac290dbaa25e
# this is the example code from the t0p-level README..d from spatialmath import SE3 import roboticstoolbox as rtb import swift robot = rtb.models.DH.Panda() print(robot) T = robot.fkine(robot.qz) print(T) # IK T = SE3(0.7, 0.2, 0.1) * SE3.OA([0, 1, 0], [0, 0, -1]) sol = robot.ikine_LMS(T) # solve IK, ignore additio...
[ "# this is the example code from the t0p-level README..d\nfrom spatialmath import SE3\nimport roboticstoolbox as rtb\nimport swift\n\nrobot = rtb.models.DH.Panda()\nprint(robot)\nT = robot.fkine(robot.qz)\nprint(T)\n\n# IK\n\nT = SE3(0.7, 0.2, 0.1) * SE3.OA([0, 1, 0], [0, 0, -1])\nsol = robot.ikine_LMS(T) # solve ...
false
5,966
7aa426723f5311b5abec4a7ace9d3ec1e5e31d9a
''' 这部分理解参考: https://www.bilibili.com/video/BV1QA411H7tK?from=search&seid=17305042509580602672 图文代码地址: https://blog.csdn.net/qq_30758629/article/details/112527763 ''' import threading import time data=0 lock=threading.Lock() #创建一个锁对象 def func(): global data print("%s is acquire lock..\n" %threading.curr...
[ "'''\n\n这部分理解参考:\n\nhttps://www.bilibili.com/video/BV1QA411H7tK?from=search&seid=17305042509580602672\n\n图文代码地址: https://blog.csdn.net/qq_30758629/article/details/112527763\n\n'''\n\nimport threading\nimport time\n\ndata=0\nlock=threading.Lock() #创建一个锁对象\n\ndef func():\n global data\n print(\"%s is acquire l...
false
5,967
8cf6a9243182a4f6b68199a8967e06790396dc10
#THIS IS PYTHON3 import tkinter as tk from tkinter import * from PIL import ImageTk from PIL import Image #to handle non-gif image formats import cv2 import numpy as np from statistics import mode import time import random import predict as ml def calcSuccess(predictedCounter, randAssault): vidLabel.pack_forge...
[ "#THIS IS PYTHON3\nimport tkinter as tk\nfrom tkinter import *\nfrom PIL import ImageTk\nfrom PIL import Image #to handle non-gif image formats\n\nimport cv2\nimport numpy as np\nfrom statistics import mode\n\nimport time\n\nimport random\n\nimport predict as ml\n\ndef calcSuccess(predictedCounter, randAssault):\n ...
false
5,968
48e3259698788904e000eb15b5443067b0c3e791
#alds13c from collections import deque d_stack=deque() res_stack=deque() s = input() for i in range(len(s)): #print(d_stack,res_stack) if s[i]=="\\": d_stack.append(i) elif s[i]=="/": if len(d_stack)==0: continue left = d_stack.pop() area = i-left #res_s...
[ "#alds13c\nfrom collections import deque\n\nd_stack=deque()\nres_stack=deque()\ns = input()\n\nfor i in range(len(s)):\n #print(d_stack,res_stack)\n if s[i]==\"\\\\\":\n d_stack.append(i)\n elif s[i]==\"/\":\n if len(d_stack)==0:\n continue\n left = d_stack.pop()\n ar...
false
5,969
436cc06778bf9ac9e04a897f4a4db90c595d943c
# load the dependencies from airflow import DAG from datetime import date, timedelta, datetime # default_args are the default arguments applied to the DAG and all inherited tasks DAG_DEFAULT_ARGS = { 'owner': 'airflow', 'depends_on_past': False, 'retries': 1, 'retry_delay': timedelta(minutes=1) } with DAG('twitte...
[ "# load the dependencies\nfrom airflow import DAG\nfrom datetime import date, timedelta, datetime\n\n# default_args are the default arguments applied to the DAG and all inherited tasks\nDAG_DEFAULT_ARGS = {\n\t'owner': 'airflow',\n\t'depends_on_past': False,\n\t'retries': 1,\n\t'retry_delay': timedelta(minutes=1)\n...
false
5,970
cfa0937f1c49b52283c562d9ab1cb0542e71b990
import matplotlib.pyplot as plt from partisan_symmetry_noplot import partisan_symmetry for k in range(1,100): a=[] for i in range(1,100): a.append([]) for j in range(1,100): a[i-1].append(partisan_symmetry([5*i/100,.20,5*j/100],1000,False)) plt.imshow(a) plt.colorbar() p...
[ "import matplotlib.pyplot as plt\nfrom partisan_symmetry_noplot import partisan_symmetry\nfor k in range(1,100):\n a=[]\n for i in range(1,100):\n a.append([])\n for j in range(1,100):\n a[i-1].append(partisan_symmetry([5*i/100,.20,5*j/100],1000,False))\n\n plt.imshow(a)\n plt.c...
false
5,971
aa47b7c74b9b6b8a7f014de4bd58236edeba485d
import os class User(object): def __init__(self, meta): meta.update({ 'groups': meta.get('groups', []) + [meta['username']] }) self.meta = meta @property def username(self): return self.meta['username'] @property def groups(self): return self....
[ "import os\n\n\nclass User(object):\n\n def __init__(self, meta):\n meta.update({\n 'groups': meta.get('groups', []) + [meta['username']]\n })\n self.meta = meta\n\n @property\n def username(self):\n return self.meta['username']\n\n @property\n def groups(self):...
false
5,972
cdd929ee041c485d2a6c1149ea1b1ced92d7b7ab
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-08-03 02:31 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Creat...
[ "# -*- coding: utf-8 -*-\n# Generated by Django 1.9.2 on 2016-08-03 02:31\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n initial = True\n\n dependencies = [\n ]\n\n operations = [\n ...
false
5,973
41294c803cf42611fa003f21b74a49dd5576a8e8
# Copyright (c) 2020, Galois, Inc. # # All Rights Reserved # # This material is based upon work supported by the Defense Advanced Research # Projects Agency (DARPA) under Contract No. FA8750-20-C-0203. # # Any opinions, findings and conclusions or recommendations expressed in this # material are those of the author(s) ...
[ "# Copyright (c) 2020, Galois, Inc.\n#\n# All Rights Reserved\n#\n# This material is based upon work supported by the Defense Advanced Research\n# Projects Agency (DARPA) under Contract No. FA8750-20-C-0203.\n#\n# Any opinions, findings and conclusions or recommendations expressed in this\n# material are those of t...
false
5,974
661d82adc7d0746635fb57abf6d0e70ee615ada4
# -*- coding: utf-8 -*- file1 = raw_input("Enter the path of your first file: ") file2 = raw_input("Enter the path of your second file: ") Basex = open(file1).read().split() Basey = open(file2).read().split() if Basex != Basey: print("The files are different!") else: print("The files are the same!")
[ "# -*- coding: utf-8 -*-\nfile1 = raw_input(\"Enter the path of your first file: \")\nfile2 = raw_input(\"Enter the path of your second file: \")\nBasex = open(file1).read().split()\nBasey = open(file2).read().split()\nif Basex != Basey:\n print(\"The files are different!\")\nelse:\n print(\"The files are the...
false
5,975
efe5921afb160b7b5a953cdd0c2f90f64b5f34c9
""" Make sure overwriting read-only files works as expected (via win-tool). """ import TestGyp import filecmp import os import stat import sys if sys.platform == 'win32': test = TestGyp.TestGyp(formats=['ninja']) os.makedirs('subdir') read_only_files = ['read-only-file', 'subdir/A', 'subdir/B', 'subd...
[ "\n\n\n\n\n\n\"\"\"\nMake sure overwriting read-only files works as expected (via win-tool).\n\"\"\"\n\nimport TestGyp\n\nimport filecmp\nimport os\nimport stat\nimport sys\n\nif sys.platform == 'win32':\n test = TestGyp.TestGyp(formats=['ninja'])\n\n \n os.makedirs('subdir')\n read_only_files = ['read-only-fil...
false
5,976
e1ecc08f66e094841647f72b78bcd29ed8d32668
import requests import json l = list() with open ( "token.txt", "r") as f: token = f.read() # создаем заголовок, содержащий наш токен headers = {"X-Xapp-Token" : token} with open('dataset_24476_4.txt', 'r') as id: for line in id: address = "https://api.artsy.net/api/artists/" +...
[ "import requests\nimport json\n\nl = list()\n\nwith open ( \"token.txt\", \"r\") as f:\n\n token = f.read()\n\n # создаем заголовок, содержащий наш токен\n headers = {\"X-Xapp-Token\" : token}\n\n with open('dataset_24476_4.txt', 'r') as id:\n\n for line in id:\n address = \"https://ap...
false
5,977
cc6f02f9e1633fa15b97af5f926e083a65a8336e
# Problem 20: Factorial digit sum def factorial(num): sum = 1 while num != 0: sum *= num num -= 1 return sum def sum_digits(num): sum = 0 while num != 0: sum += num % 10 num //= 10 return sum print(sum_digits(factorial(100)))
[ "# Problem 20: Factorial digit sum\n\ndef factorial(num):\n sum = 1\n while num != 0:\n sum *= num\n num -= 1\n return sum\n\ndef sum_digits(num):\n sum = 0\n while num != 0:\n sum += num % 10\n num //= 10\n return sum\n\nprint(sum_digits(factorial(100)))", "def fact...
false
5,978
30a57197e3156023ac9a7c4a5218bfe825e143d9
# Fix a method's vtable calls + reference making #@author simo #@category iOS.kernel #@keybinding R #@toolbar logos/refs.png #@description Resolve references for better CFG # -*- coding: utf-8 -*- """ script which does the following: - adds references to virtual method calls - Identifies methods belong to a specific ...
[ "# Fix a method's vtable calls + reference making\n\n#@author simo\n#@category iOS.kernel\n#@keybinding R\n#@toolbar logos/refs.png\n#@description Resolve references for better CFG\n# -*- coding: utf-8 -*-\n\n\"\"\"\nscript which does the following:\n- adds references to virtual method calls\n- Identifies methods b...
false
5,979
021cbd1bd22f9ec48db2e52b2a98be169bbfdbbd
# -*- coding: utf-8 -*- # @Author: huerke # @Date: 2016-09-03 10:55:54 # @Last Modified by: huerke # @Last Modified time: 2016-09-03 15:54:50 from flask import render_template from . import main @main.app_errorhandler(404) def page_not_found(e): return render_template('404.html'), 404 @main.app_errorhandler...
[ "# -*- coding: utf-8 -*-\n# @Author: huerke\n# @Date: 2016-09-03 10:55:54\n# @Last Modified by: huerke\n# @Last Modified time: 2016-09-03 15:54:50\nfrom flask import render_template\nfrom . import main\n\n\n@main.app_errorhandler(404)\ndef page_not_found(e):\n return render_template('404.html'), 404\n\n\n@ma...
false
5,980
603d7df0639def2b620cca2299077674e35a74b2
from wrapper import SeleniumWrapper from selenium.webdriver.common.by import By class PageDetector: def __init__(self, driver): self.selenium = SeleniumWrapper(driver) def detect(self): if self.selenium.wait_for_presence(locator=(By.ID, "teams-app-bar"), timeout=30): if sel...
[ "from wrapper import SeleniumWrapper\nfrom selenium.webdriver.common.by import By\n\n\n\nclass PageDetector:\n\n def __init__(self, driver):\n self.selenium = SeleniumWrapper(driver)\n \n\n def detect(self):\n if self.selenium.wait_for_presence(locator=(By.ID, \"teams-app-bar\"), timeout=30):...
false
5,981
3b5141a86948df6632612f6c9d7fc0089acc60aa
#!/usr/bin/env python # -*- coding: utf-8 -*- import random class Role: """ 角色类 卧底 平民 """ def __init__(self,key_word="",role_id = 0): self.key_word = key_word self.role_id = role_id #平民-0;卧底-1; class User(Role): """ 用户类 玩家 """ def __init__(self,id,role_i...
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport random\n\n\nclass Role:\n\n \"\"\"\n 角色类\n 卧底\n 平民\n \"\"\"\n def __init__(self,key_word=\"\",role_id = 0):\n self.key_word = key_word\n self.role_id = role_id #平民-0;卧底-1;\n\nclass User(Role):\n \"\"\"\n 用户类\n 玩家\n ...
false
5,982
c414e5d3934f741540fb5721a529b48f95e17016
# -*- coding: utf-8 -*- import sqlalchemy as sa import ujson from aiohttp import web, WSMsgType from .db import TLE from .log import logger from .utils import parse_sa_filter, parse_sa_order, check_sa_column, get_sa_column async def query(request): filters = [] if 'filters' not in request.query: rai...
[ "# -*- coding: utf-8 -*-\n\nimport sqlalchemy as sa\nimport ujson\nfrom aiohttp import web, WSMsgType\n\nfrom .db import TLE\nfrom .log import logger\nfrom .utils import parse_sa_filter, parse_sa_order, check_sa_column, get_sa_column\n\n\nasync def query(request):\n filters = []\n if 'filters' not in request....
false
5,983
705bc651e7d12769bcf5994168fe6685a6bae05d
#!/usr/bin/env python import sys import requests import numpy as np import astropy.table as at if __name__=='__main__': targets = at.Table.read('targets_LCO2018A_002.txt', format='ascii') headers={'Authorization': 'Token {}'.format(sys.argv[1])} for x in targets['targetname']: obs = requests.get('h...
[ "#!/usr/bin/env python\nimport sys\nimport requests\nimport numpy as np\nimport astropy.table as at\n\nif __name__=='__main__':\n targets = at.Table.read('targets_LCO2018A_002.txt', format='ascii')\n headers={'Authorization': 'Token {}'.format(sys.argv[1])}\n for x in targets['targetname']:\n obs = ...
false
5,984
86c053b7d4c752182965755ad5b6ba6937ce6f86
import unittest from dispatcher.task import * from mock import * class TestTask(unittest.TestCase): def test_init(self): task_attr = ['filename=C:\\Users\\kcheng\\PycharmProjects\\first_project\\dummy_task2.py', 'frequency=1D', 'time=09:45', 'description=invalid time'] task = T...
[ "import unittest\nfrom dispatcher.task import *\nfrom mock import *\n\nclass TestTask(unittest.TestCase):\n def test_init(self):\n task_attr = ['filename=C:\\\\Users\\\\kcheng\\\\PycharmProjects\\\\first_project\\\\dummy_task2.py',\n 'frequency=1D', 'time=09:45', 'description=invalid t...
false
5,985
963e736fd4a942fb1c51e1e0a357ad6be48aed9a
#Una empresa les paga a sus empleados con base en las horas trabajadas en la semana. #Realice un algoritmo para determinar el sueldo semanal de N trabajadores #y, además, calcule cuánto pagó la empresa por los N empleados. base = int(input("Dinero por hora trabajada: ")) emp = int(input("Dime el nº de empleados...
[ "\r\n#Una empresa les paga a sus empleados con base en las horas trabajadas en la semana.\r\n#Realice un algoritmo para determinar el sueldo semanal de N trabajadores\r\n#y, además, calcule cuánto pagó la empresa por los N empleados.\r\n\r\nbase = int(input(\"Dinero por hora trabajada: \"))\r\nemp = int(input(\"Dim...
true
5,986
ca25739583d3b7ff449fbd2f56a96631981c815d
# -*- coding: utf-8 -*- import sys from os import path try: import DMP except ImportError: sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) from DMP.modeling.vectorMaker import VectorMaker from DMP.modeling.variables import KEY_TOTAL, KEY_TRAIN, KEY_VALID, KEY_TEST from DMP.dataset.dataHan...
[ "# -*- coding: utf-8 -*-\n\nimport sys\nfrom os import path\n\ntry:\n import DMP\nexcept ImportError:\n sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))\n\nfrom DMP.modeling.vectorMaker import VectorMaker\nfrom DMP.modeling.variables import KEY_TOTAL, KEY_TRAIN, KEY_VALID, KEY_TEST\nfrom DM...
false
5,987
635b02e03578d44f13530bd57ab1a99987d4909d
# -*- coding: utf-8 -*- """ Created on Wed May 16 10:17:32 2018 @author: pearseb """ #%% imporst import os import numpy as np import netCDF4 as nc import matplotlib.pyplot as plt import matplotlib.cm as cm import cmocean.cm as cmo import seaborn as sb sb.set(style='ticks') import mpl_toolkits.basemap as bm import p...
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed May 16 10:17:32 2018\n\n@author: pearseb\n\"\"\"\n\n#%% imporst\n \nimport os\nimport numpy as np\nimport netCDF4 as nc\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport cmocean.cm as cmo\nimport seaborn as sb\nsb.set(style='ticks')\nimport mpl_too...
false
5,988
40ee790f4272c05c1619eb7b2cc66a8b57bbe8a8
# -*- coding: utf-8 -*- from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ class StaffApp(CMSApp): name = _('Staff') urls = ['blog.urls', ] app_name = 'staff' apphook_pool.register(StaffApp)
[ "# -*- coding: utf-8 -*-\r\n\r\nfrom cms.app_base import CMSApp\r\nfrom cms.apphook_pool import apphook_pool\r\nfrom django.utils.translation import ugettext_lazy as _\r\n\r\n\r\nclass StaffApp(CMSApp):\r\n name = _('Staff')\r\n urls = ['blog.urls', ]\r\n app_name = 'staff'\r\n\r\n\r\napphook_pool.register...
false
5,989
4abcca52095a169b71d2527ce52b8367534c42a4
# -*- python -*- # ex: set syntax=python: # vim: set syntax=python: import os import re from collections import defaultdict, namedtuple from enum import Enum from pathlib import Path import buildbot.www.authz.endpointmatchers as ems from buildbot.changes.filter import ChangeFilter from buildbot.changes.gitpoller impo...
[ "# -*- python -*-\n# ex: set syntax=python:\n# vim: set syntax=python:\n\nimport os\nimport re\nfrom collections import defaultdict, namedtuple\nfrom enum import Enum\nfrom pathlib import Path\n\nimport buildbot.www.authz.endpointmatchers as ems\nfrom buildbot.changes.filter import ChangeFilter\nfrom buildbot.chang...
false
5,990
1ad40ef3aa7c81b6eee4fe0b98bcdd2f1110ef8d
#!/usr/bin/env python # On CI, you can pass the logging and the password of dockerhub through # the environment variables DOCKER_USERNAME and DOCKER_PASSWORD import getpass import os import subprocess import sys from builtins import input SCRIPT_DIR = os.path.realpath(os.path.join(__file__, '..')) ROOT_DIR = os.path...
[ "#!/usr/bin/env python\n# On CI, you can pass the logging and the password of dockerhub through\n# the environment variables DOCKER_USERNAME and DOCKER_PASSWORD\n\nimport getpass\nimport os\nimport subprocess\nimport sys\n\nfrom builtins import input\n\nSCRIPT_DIR = os.path.realpath(os.path.join(__file__, '..'))\nR...
false
5,991
2c2ad4b6e8c5055afa3dfb3b540a44bda65fa004
""" A web-page. """ import re import pkg_resources from .components import Link, Javascript, inject class Page: """A web-page presenting container. Args: favicon (str): The file name for the favorite icon displayed in a browser tab(default=None) title (str): The page title, disp...
[ "\"\"\"\nA web-page.\n\"\"\"\n\nimport re\nimport pkg_resources\n\nfrom .components import Link, Javascript, inject\n\n\nclass Page:\n \"\"\"A web-page presenting container.\n\n Args:\n favicon (str): The file name for the favorite icon displayed in a\n browser tab(default=None)\n tit...
false
5,992
652918e09a3506869c939be39b71a06467459f8a
import configparser # CONFIG config = configparser.ConfigParser() config.read('dwh.cfg') # DROP TABLES drop_schema="DROP SCHEMA IF EXISTS sparkifydb;" set_search_path="SET SEARCH_PATH to sparkifydb;" staging_events_table_drop = "DROP TABLE IF EXISTS staging_events;" staging_songs_table_drop = "DROP TABLE IF EXISTS s...
[ "import configparser\n\n\n# CONFIG\nconfig = configparser.ConfigParser()\nconfig.read('dwh.cfg')\n\n# DROP TABLES\ndrop_schema=\"DROP SCHEMA IF EXISTS sparkifydb;\"\nset_search_path=\"SET SEARCH_PATH to sparkifydb;\"\nstaging_events_table_drop = \"DROP TABLE IF EXISTS staging_events;\"\nstaging_songs_table_drop = \...
false
5,993
c0e1c0c4545777a669fac19900239ab9baade242
""" Physical units and dimensions """ from sympy import * from sympy.core.basic import Atom from sympy.core.methods import ArithMeths, RelMeths class Unit(Atom, RelMeths, ArithMeths): is_positive = True # make (m**2)**Rational(1,2) --> m is_commutative = True def __init__(self, name, a...
[ "\"\"\"\r\nPhysical units and dimensions\r\n\r\n\"\"\"\r\n\r\nfrom sympy import *\r\nfrom sympy.core.basic import Atom\r\nfrom sympy.core.methods import ArithMeths, RelMeths\r\n\r\n\r\nclass Unit(Atom, RelMeths, ArithMeths):\r\n is_positive = True # make (m**2)**Rational(1,2) --> m\r\n is_commutative = Tru...
false
5,994
414fa4021b21cea0dc49380aebfe67f0204f0574
def multiplica(): one = int(input('1º: ')) two = int(input('2º: ')) print('a multiplicação é: ', one*two) def soma(): one = int(input('1º: ')) two = int(input('2º: ')) print('a soma é: ', one+two) def subtra(): one = int(input('1º: ')) two = int(input('2º: ')) ...
[ "def multiplica():\r\n one = int(input('1º: '))\r\n two = int(input('2º: '))\r\n\r\n print('a multiplicação é: ', one*two)\r\n\r\ndef soma():\r\n one = int(input('1º: '))\r\n two = int(input('2º: '))\r\n\r\n print('a soma é: ', one+two)\r\n \r\ndef subtra():\r\n one = int(input('1º: '))\r\n ...
false
5,995
54a6405e3447d488aa4fca88159ccaac2506df2c
#!/usr/bin/env python import serial from action import Action import math comm = serial.Serial("/dev/ttyACM3", 115200, timeout=1) #comm = None robot = Action(comm) from flask import Flask from flask import send_from_directory import os static_dir = os.path.join(os.getcwd(), "ControlApp") print "serving from " + sta...
[ "#!/usr/bin/env python\n\nimport serial\nfrom action import Action\nimport math\n\ncomm = serial.Serial(\"/dev/ttyACM3\", 115200, timeout=1)\n#comm = None\nrobot = Action(comm)\n\nfrom flask import Flask\nfrom flask import send_from_directory\nimport os\n\nstatic_dir = os.path.join(os.getcwd(), \"ControlApp\")\npri...
true
5,996
0bc53130a4248178f4c3fabbae7d2546f0d5b8fd
from __future__ import unicode_literals from django.db import models from django.utils import timezone # Create your models here. class Article(models.Model): title = models.CharField(max_length=200) author = models.CharField(max_length=100, default='admin') content = models.TextField(max_length=5000) ...
[ "from __future__ import unicode_literals\nfrom django.db import models\nfrom django.utils import timezone\n\n# Create your models here.\n\n\n\nclass Article(models.Model):\n title = models.CharField(max_length=200)\n author = models.CharField(max_length=100, default='admin')\n content = models.TextField(ma...
false
5,997
327e9dcba49419b8a8c320940e333765c1d9b980
# Standard Library Imports # Third Party Imports from kivy.clock import Clock from kivy.properties import StringProperty from kivy.uix.screenmanager import Screen, ScreenManager from kivy.uix.widget import Widget # Local Imports from client.source.ui.kv_widgets import ModalPopupButton, SubmissionPopup, FailedSubmissi...
[ "# Standard Library Imports\n\n# Third Party Imports\nfrom kivy.clock import Clock\nfrom kivy.properties import StringProperty\nfrom kivy.uix.screenmanager import Screen, ScreenManager\nfrom kivy.uix.widget import Widget\n\n# Local Imports\nfrom client.source.ui.kv_widgets import ModalPopupButton, SubmissionPopup, ...
false
5,998
dc6cbf43424a31f1aefde8bd71b6f1b7ecf8166b
vect = [0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 5.723585101952381, 0.0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0, 0.0, 0.0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0, 0.0, 0.0, 0.0, 0, 0....
[ "vect = [0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 5.723585101952381, 0.0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0, 0.0, 0.0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0, 0.0, 0.0, 0.0, ...
false
5,999
5b8322761975ebec76d1dccd0290c0fb1da404e5
# 문제 설명 # 길이가 같은 두 1차원 정수 배열 a, b가 매개변수로 주어집니다. a와 b의 내적을 return 하도록 solution 함수를 완성해주세요. # 이때, a와 b의 내적은 a[0]*b[0] + a[1]*b[1] + ... + a[n-1]*b[n-1] 입니다. (n은 a, b의 길이) # 제한사항 # a, b의 길이는 1 이상 1,000 이하입니다. # a, b의 모든 수는 -1,000 이상 1,000 이하입니다. # 입출력 예 # a b result # [1,2,3,4] [-3,-1,0,2] 3 # [-1,0,1] [1,0,-1] -2 # 입출력...
[ "# 문제 설명\n# 길이가 같은 두 1차원 정수 배열 a, b가 매개변수로 주어집니다. a와 b의 내적을 return 하도록 solution 함수를 완성해주세요.\n\n# 이때, a와 b의 내적은 a[0]*b[0] + a[1]*b[1] + ... + a[n-1]*b[n-1] 입니다. (n은 a, b의 길이)\n\n# 제한사항\n# a, b의 길이는 1 이상 1,000 이하입니다.\n# a, b의 모든 수는 -1,000 이상 1,000 이하입니다.\n# 입출력 예\n# a\tb\tresult\n# [1,2,3,4]\t[-3,-1,0,2]\t3\n# [-1,0,...
false