index int64 0 100k | blob_id stringlengths 40 40 | code stringlengths 7 7.27M | steps listlengths 1 1.25k | error bool 2
classes |
|---|---|---|---|---|
5,400 | acb85a16e45472dac61eed4162dc651f67a0e8ca | import settings
#from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
#admin.autodiscover()
# Uncomment the next two lines to enable the admin... | [
"import settings\n#from django.conf import settings\nfrom django.conf.urls import patterns, include, url\nfrom django.contrib import admin\nfrom django.conf.urls.static import static\nfrom django.contrib.staticfiles.urls import staticfiles_urlpatterns\n\n#admin.autodiscover()\n\n# Uncomment the next two lines to en... | false |
5,401 | d472a15d6fa826e50a550996369b00b6c599a1c7 | from .scheduler import Scheduler
MyScheduler = Scheduler()
| [
"from .scheduler import Scheduler\n\nMyScheduler = Scheduler()\n",
"from .scheduler import Scheduler\nMyScheduler = Scheduler()\n",
"<import token>\nMyScheduler = Scheduler()\n",
"<import token>\n<assignment token>\n"
] | false |
5,402 | e44e19dbeb6e1e346ca371ca8730f53ee5b95d47 | from boa3.builtin import public
@public
def Main() -> int:
a = 'just a test'
return len(a)
| [
"from boa3.builtin import public\n\n\n@public\ndef Main() -> int:\n a = 'just a test'\n return len(a)\n",
"from boa3.builtin import public\n\n\n@public\ndef Main() ->int:\n a = 'just a test'\n return len(a)\n",
"<import token>\n\n\n@public\ndef Main() ->int:\n a = 'just a test'\n return len(a)... | false |
5,403 | 3366d1d4ecc4cc9f971dff0c8adfbadc5511cc9e | #print 'g'
class Client:
def __init__(self, mechanize, WEBSERVICE_IP,WEBSERVICE_PORT, FORM_INPUT_PATH, dat , data_id = 'data', rasp_id_id = 'rasp_id',password = 'pass'):
self.WEBSERVICE_PORT = WEBSERVICE_PORT
self.mechanize = mechanize
self.WEBSERVICE_IP = WEBSERVICE_IP
self.FORM_INPUT_P... | [
"#print 'g'\nclass Client:\n def __init__(self, mechanize, WEBSERVICE_IP,WEBSERVICE_PORT, FORM_INPUT_PATH, dat , data_id = 'data', rasp_id_id = 'rasp_id',password = 'pass'):\n self.WEBSERVICE_PORT = WEBSERVICE_PORT\n self.mechanize = mechanize\n self.WEBSERVICE_IP = WEBSERVICE_IP\n self.F... | true |
5,404 | 803283c9dac78c821373fa1025008b04919df72c | from turtle import *
from freegames import vector
def line(start, end):
"Draw line from start to end."
up()
goto(start.x, start.y)
down()
goto(end.x, end.y)
def square(start, end):
"Draw square from start to end."
up()
goto(start.x, start.y)
down()
begin_fill()
... | [
"from turtle import *\r\nfrom freegames import vector\r\n\r\ndef line(start, end):\r\n \"Draw line from start to end.\"\r\n up()\r\n goto(start.x, start.y)\r\n down()\r\n goto(end.x, end.y)\r\n\r\ndef square(start, end):\r\n \"Draw square from start to end.\"\r\n up()\r\n goto(start.x, start... | false |
5,405 | cdc8c8aba384b7b1b5e741ffe4309eaee30aaada | # Generated by Django 3.0.5 on 2020-04-30 06:26
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('products_app', '0003_auto_20200429_0739'),
]
operations = [
migrations.CreateModel(
name='User'... | [
"# Generated by Django 3.0.5 on 2020-04-30 06:26\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('products_app', '0003_auto_20200429_0739'),\n ]\n\n operations = [\n migrations.CreateModel(\n ... | false |
5,406 | b0e4042ac4ed54cafedb9e53244c164527559e39 | rak="hello\n"
n=input()
print(rak * int(n))
| [
"rak=\"hello\\n\"\nn=input()\nprint(rak * int(n)) \n",
"rak = 'hello\\n'\nn = input()\nprint(rak * int(n))\n",
"<assignment token>\nprint(rak * int(n))\n",
"<assignment token>\n<code token>\n"
] | false |
5,407 | 1857d76b8c68c58d2d721de529811a6aeb09fcbb | from fastapi import FastAPI
from app.router.routes import initRoutes
from app.cors.cors import initCors
app = FastAPI(debug=True,title="Recipe API")
initCors(app)
initRoutes(app)
| [
"from fastapi import FastAPI\nfrom app.router.routes import initRoutes\nfrom app.cors.cors import initCors\n\napp = FastAPI(debug=True,title=\"Recipe API\")\ninitCors(app)\ninitRoutes(app)\n",
"from fastapi import FastAPI\nfrom app.router.routes import initRoutes\nfrom app.cors.cors import initCors\napp = FastAPI... | false |
5,408 | f5e60f2d384242b9675e756f67391ea09afcc262 | from customer_service.model.customer import Customer
def get_customer(customer_id, customer_repository):
return customer_repository.fetch_by_id(customer_id)
def create_customer(first_name, surname, customer_repository):
customer = Customer(first_name=first_name, surname=surname)
customer_repository.stor... | [
"from customer_service.model.customer import Customer\n\n\ndef get_customer(customer_id, customer_repository):\n return customer_repository.fetch_by_id(customer_id)\n\n\ndef create_customer(first_name, surname, customer_repository):\n customer = Customer(first_name=first_name, surname=surname)\n customer_r... | false |
5,409 | 76348448a658736627efe8fa6b19c752191966e7 | f=open('poem.txt')
for line in f:
print line,
| [
"f=open('poem.txt')\nfor line in f:\n\tprint line,\n"
] | true |
5,410 | 958d7ec966179d63c6ba0a651e99fff70f0db31a | from collections import defaultdict, deque
import numpy as np
import gym
from chula_rl.policy.base_policy import BasePolicy
from chula_rl.exception import *
from .base_explorer import BaseExplorer
class OneStepExplorerWithTrace(BaseExplorer):
"""one-step explorer but with n-step trace"""
def __init__(self... | [
"from collections import defaultdict, deque\n\nimport numpy as np\n\nimport gym\nfrom chula_rl.policy.base_policy import BasePolicy\nfrom chula_rl.exception import *\n\nfrom .base_explorer import BaseExplorer\n\n\nclass OneStepExplorerWithTrace(BaseExplorer):\n \"\"\"one-step explorer but with n-step trace\"\"\"... | false |
5,411 | 467b919f6953737eedd3f99596df244bd1177575 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
r_data_df = pd.read_csv('./Shootout Data/Shootout_Mac2017.csv')
em_data_df = pd.read_csv('./Shootout Data/Shootout_Emily.csv')
aishah_data_df = pd.read_csv('./Shootout Data/Shootout_Aishah_Mac2011.csv')
agni_data_df = pd.read_csv('./Shootout Data/S... | [
"import pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nr_data_df = pd.read_csv('./Shootout Data/Shootout_Mac2017.csv')\nem_data_df = pd.read_csv('./Shootout Data/Shootout_Emily.csv')\naishah_data_df = pd.read_csv('./Shootout Data/Shootout_Aishah_Mac2011.csv')\nagni_data_df = pd.read_csv('./Sho... | false |
5,412 | 5e06dfb7aac64b5b98b4c0d88a86f038baf44feb | import math
import os
import pathfinder as pf
from constants import X_ROBOT_LENGTH, Y_ROBOT_WIDTH, Y_WALL_TO_EXCHANGE_FAR, \
X_WALL_TO_SWITCH_NEAR
from utilities.functions import GeneratePath
class settings():
order = pf.FIT_HERMITE_QUINTIC
samples = 1000000
period = 0.02
maxVelocity =... | [
"import math\r\nimport os\r\nimport pathfinder as pf\r\nfrom constants import X_ROBOT_LENGTH, Y_ROBOT_WIDTH, Y_WALL_TO_EXCHANGE_FAR, \\\r\n X_WALL_TO_SWITCH_NEAR\r\nfrom utilities.functions import GeneratePath\r\n\r\n\r\nclass settings():\r\n order = pf.FIT_HERMITE_QUINTIC\r\n samples = 1000000\r\n peri... | false |
5,413 | c248d653556ecdf27e56b57930832eb293dfd579 | from ShazamAPI import Shazam
import json
import sys
print("oi")
| [
"from ShazamAPI import Shazam\nimport json\nimport sys\n\nprint(\"oi\")\n",
"from ShazamAPI import Shazam\nimport json\nimport sys\nprint('oi')\n",
"<import token>\nprint('oi')\n",
"<import token>\n<code token>\n"
] | false |
5,414 | 4fb563985bd99599e88676e167ee84a95b018aba | import os
import struct
import sys
import wave
sys.path.insert(0, os.path.dirname(__file__))
C5 = 523
B4b = 466
G4 = 392
E5 = 659
F5 = 698
VOLUME = 12000
notes = [
[VOLUME, C5],
[VOLUME, C5],
[VOLUME, B4b],
[VOLUME, C5],
[0, C5],
[VOLUME, G4],
[0, C5],
[VOLUME, G4],
[VOLUME, C5],
... | [
"import os\nimport struct\nimport sys\nimport wave\n\nsys.path.insert(0, os.path.dirname(__file__))\n\nC5 = 523\nB4b = 466\nG4 = 392\nE5 = 659\nF5 = 698\nVOLUME = 12000\n\nnotes = [\n [VOLUME, C5],\n [VOLUME, C5],\n [VOLUME, B4b],\n [VOLUME, C5],\n [0, C5],\n [VOLUME, G4],\n [0, C5],\n [VOLU... | false |
5,415 | 8c11463e35fb32949abbb163a89f874040a33ad0 | import cv2
import numpy as np
import time
from dronekit import connect, VehicleMode
connection_string = "/dev/ttyACM0"
baud_rate = 115200
print(">>>> Connecting with the UAV <<<<")
vehicle = connect(connection_string, baud=baud_rate, wait_ready=True)
vehicle.wait_ready('autopilot_version')
print('ready')
cap = cv2.V... | [
"import cv2\nimport numpy as np\nimport time \nfrom dronekit import connect, VehicleMode\n\nconnection_string = \"/dev/ttyACM0\"\nbaud_rate = 115200\nprint(\">>>> Connecting with the UAV <<<<\")\nvehicle = connect(connection_string, baud=baud_rate, wait_ready=True)\nvehicle.wait_ready('autopilot_version')\nprint('r... | false |
5,416 | db22e568c86f008c9882181f5c1d88d5bca28570 | import sqlite3 as lite
import sys
con = lite.connect("test.db")
with con:
cur = con.cursor()
cur.execute('''CREATE TABLE Cars(Id INT, Name TEXT, Price INT)''')
cur.execute('''INSERT INTO Cars VALUES(1, 'car1', 10)''')
cur.execute('''INSERT INTO Cars VALUES(2, 'car2', 20)''')
cur.execute('''INSERT INTO C... | [
"import sqlite3 as lite\nimport sys\n\ncon = lite.connect(\"test.db\")\n\nwith con:\n\n cur = con.cursor()\n \n cur.execute('''CREATE TABLE Cars(Id INT, Name TEXT, Price INT)''')\n cur.execute('''INSERT INTO Cars VALUES(1, 'car1', 10)''')\n cur.execute('''INSERT INTO Cars VALUES(2, 'car2', 20)''')\n cur.execu... | false |
5,417 | c6fdb9c405427a3583a59065f77c75c4aa781405 | from flask import Flask, app
from flask_sqlalchemy import SQLAlchemy
db= SQLAlchemy()
DBNAME = 'database.db'
def create_app():
app = Flask(__name__)
app.config['SECRET_KEY'] = 'KARNISINGHSHEKHAWAT'
app.config['SQLALCHEMY_DATABASE_URL'] = f'sqlite:///{DBNAME}'
db.init_app(app)
from .views impo... | [
"from flask import Flask, app\nfrom flask_sqlalchemy import SQLAlchemy\n\n\n\ndb= SQLAlchemy()\nDBNAME = 'database.db'\n\n\ndef create_app():\n app = Flask(__name__)\n app.config['SECRET_KEY'] = 'KARNISINGHSHEKHAWAT'\n app.config['SQLALCHEMY_DATABASE_URL'] = f'sqlite:///{DBNAME}'\n db.init_app(app)\n\n\... | false |
5,418 | 2b88bec388f3872b63d6bfe200e973635bb75054 | from django.shortcuts import render, get_object_or_404, redirect
from django.utils import timezone
from django.core.paginator import Paginator
from .models import post
from django.contrib.auth.decorators import login_required
from .forms import post_fo
from django.db.models import Q
def index(request):
posts_l... | [
"from django.shortcuts import render, get_object_or_404, redirect\nfrom django.utils import timezone\n\nfrom django.core.paginator import Paginator\nfrom .models import post\n\nfrom django.contrib.auth.decorators import login_required\n\nfrom .forms import post_fo\nfrom django.db.models import Q\n\ndef index(reques... | false |
5,419 | 566dab589cdb04332a92138b1a1faf53cd0f58b8 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Dict, NamedTuple, Union, Optional
import codecs
import collections
import enum
import json
import re
import struct
from refinery.lib.structures import StructReader
from refinery.units.formats.office... | [
"#!/usr/bin/env python3\r\n# -*- coding: utf-8 -*-\r\nfrom __future__ import annotations\r\nfrom typing import List, Dict, NamedTuple, Union, Optional\r\n\r\nimport codecs\r\nimport collections\r\nimport enum\r\nimport json\r\nimport re\r\nimport struct\r\n\r\nfrom refinery.lib.structures import StructReader\r\nfro... | false |
5,420 | d2da346e11fa9508cab22a3a2fd3ca57a0a755e6 | # Number Guessing Game
import random
#assign secrectNumber to random number from range 1-10, inclusive of 10
secrectNumber = random.randint (1, 11)
#initialize number or guesses to 1 and call it guess
numGuesses = 1
#prompt user to enter their name and enter their guess
name = int (input("Enter your name: ))
print(... | [
"# Number Guessing Game\nimport random\n#assign secrectNumber to random number from range 1-10, inclusive of 10\nsecrectNumber = random.randint (1, 11)\n#initialize number or guesses to 1 and call it guess\nnumGuesses = 1\n#prompt user to enter their name and enter their guess\nname = int (input(\"Enter your name:... | true |
5,421 | c0b5a0605bdfcb7cb84211d3ad0d24f78f838cdf | import os
import pytest
def get_client():
from apiserver import app, is_caching_enabled
app.config['TESTING'] = True
app.enable_cache(is_caching_enabled())
return app.test_client()
@pytest.fixture
def client():
os.environ['FLASK_ENV'] = 'testing'
yield get_client()
@pytest.fixture
def c... | [
"import os\n\nimport pytest\n\n\ndef get_client():\n from apiserver import app, is_caching_enabled\n\n app.config['TESTING'] = True\n app.enable_cache(is_caching_enabled())\n return app.test_client()\n\n\n@pytest.fixture\ndef client():\n os.environ['FLASK_ENV'] = 'testing'\n\n yield get_client()\n... | false |
5,422 | b76d3b6a4c15833ee2b25fede5923e1fe1dc4dd7 | # stdlib
from typing import Any
# third party
import numpy as np
# syft absolute
import syft as sy
from syft.core.common.uid import UID
from syft.core.node.new.action_object import ActionObject
from syft.core.node.new.action_store import DictActionStore
from syft.core.node.new.context import AuthedServiceContext
from... | [
"# stdlib\nfrom typing import Any\n\n# third party\nimport numpy as np\n\n# syft absolute\nimport syft as sy\nfrom syft.core.common.uid import UID\nfrom syft.core.node.new.action_object import ActionObject\nfrom syft.core.node.new.action_store import DictActionStore\nfrom syft.core.node.new.context import AuthedSer... | false |
5,423 | 8b4590cf2d8c040b6ab31c63baff0d83ab818641 | '''
config -- config manipulator module for share
@author: shimarin
@copyright: 2014 Walbrix Corporation. All rights reserved.
@license: proprietary
'''
import json,argparse
import oscar,groonga
def parser_setup(parser):
parser.add_argument("base_dir")
parser.add_argument("operations", nargs="*")
... | [
"'''\nconfig -- config manipulator module for share\n\n@author: shimarin\n\n@copyright: 2014 Walbrix Corporation. All rights reserved.\n\n@license: proprietary\n'''\n\nimport json,argparse\nimport oscar,groonga\n\ndef parser_setup(parser):\n parser.add_argument(\"base_dir\")\n parser.add_argument(\"op... | true |
5,424 | df00cc501b7b682cc1f4fbc9ae87a27984e6b5ef | class Boundary():
def __init__(self, py5_inst, x1, y1, x2, y2):
self.py5 = py5_inst
self.a = self.py5.create_vector(x1, y1)
self.b = self.py5.create_vector(x2, y2)
def show(self):
self.py5.stroke(255)
self.py5.line(self.a.x, self.a.y, self.b.x, self.b.y)
| [
"class Boundary():\n def __init__(self, py5_inst, x1, y1, x2, y2):\n self.py5 = py5_inst\n self.a = self.py5.create_vector(x1, y1)\n self.b = self.py5.create_vector(x2, y2)\n\n def show(self):\n self.py5.stroke(255)\n self.py5.line(self.a.x, self.a.y, self.b.x, self.b.y)\n ... | false |
5,425 | bbd421d39894af163b56e7104c3b29a45635d5a3 | from math import *
def heron(a, b, c):
tmp = [a, b, c]
tmp.sort()
if tmp[0] + tmp[1] <= tmp[-1]:
raise ValueError ("Warunek trojkata jest nie spelniony")
halfPerimeter = (a + b + c)/2
return sqrt(halfPerimeter * (halfPerimeter - a)*(halfPerimeter-b)*(halfPerimeter-c))
print heron... | [
"from math import *\r\n\r\ndef heron(a, b, c):\r\n tmp = [a, b, c]\r\n tmp.sort()\r\n if tmp[0] + tmp[1] <= tmp[-1]:\r\n raise ValueError (\"Warunek trojkata jest nie spelniony\")\r\n halfPerimeter = (a + b + c)/2\r\n return sqrt(halfPerimeter * (halfPerimeter - a)*(halfPerimeter-b)*(halfPerim... | true |
5,426 | cad881dd29be16de8375b3ce6e4a437562a05097 | files = [
"arria2_ddr3.qip"
]
| [
"files = [\n \"arria2_ddr3.qip\"\n ]\n",
"files = ['arria2_ddr3.qip']\n",
"<assignment token>\n"
] | false |
5,427 | f8d0cc9cb0e5f8adf9077ffb39dd6abedfedaa12 | a = int(input('점수를 입력하세요'))
if a >= 70 :
print:('통과입니다.')
print:('축하합니다.')
else :
print:('불합격입니다.')
print("안녕")
| [
"a = int(input('점수를 입력하세요'))\r\nif a >= 70 :\r\n print:('통과입니다.')\r\n print:('축하합니다.')\r\nelse :\r\n print:('불합격입니다.')\r\nprint(\"안녕\")\r\n",
"a = int(input('점수를 입력하세요'))\nif a >= 70:\n print: '통과입니다.'\n print: '축하합니다.'\nelse:\n print: '불합격입니다.'\nprint('안녕')\n",
"<assignment token>\nif a >= 70... | false |
5,428 | 3bb408f2b2ac63a2555258c05844881ccdfc5057 | import math
import pygame
import numpy as np
from main import Snake, SCREEN_WIDTH, SCREEN_HEIGHT, drawGrid, GRIDSIZE
from random import randint
FOOD_REWARD = 5
DEATH_PENALTY = 10
MOVE_PENALTY = 0.1
LIVES = 5
SQUARE_COLOR = (80,80,80)
SNAKE_HEAD_COLOR = ((0,51,0), (0,0,153), (102,0,102))
SNAKE_COLOR = ((154,205,50), ... | [
"import math\n\nimport pygame\nimport numpy as np\nfrom main import Snake, SCREEN_WIDTH, SCREEN_HEIGHT, drawGrid, GRIDSIZE\nfrom random import randint\n\nFOOD_REWARD = 5\nDEATH_PENALTY = 10\nMOVE_PENALTY = 0.1\nLIVES = 5\n\nSQUARE_COLOR = (80,80,80)\nSNAKE_HEAD_COLOR = ((0,51,0), (0,0,153), (102,0,102))\nSNAKE_COLO... | false |
5,429 | 88e34878cdad908ed4ac30da82355aaa46ed719b | from rest_framework import serializers
from django.contrib import auth
from rest_framework.exceptions import ValidationError
from django.contrib.auth.password_validation import validate_password
from django.utils.translation import gettext as _
from rest_users.utils.api import _build_initial_user
User = auth.get_user_... | [
"from rest_framework import serializers\nfrom django.contrib import auth\nfrom rest_framework.exceptions import ValidationError\nfrom django.contrib.auth.password_validation import validate_password\nfrom django.utils.translation import gettext as _\nfrom rest_users.utils.api import _build_initial_user\n\nUser = au... | false |
5,430 | d3342507cb1966e14380ff28ae12b5c334abd20a | from datetime import *
dd=int(input("enter number day: "))
nn=int(datetime.now().strftime("%w"))+1
# print(dd)
# print(nn)
print((datetime.now().date())+(timedelta(days=dd-nn)))
| [
"from datetime import *\ndd=int(input(\"enter number day: \"))\nnn=int(datetime.now().strftime(\"%w\"))+1\n# print(dd)\n# print(nn)\nprint((datetime.now().date())+(timedelta(days=dd-nn)))\n",
"from datetime import *\ndd = int(input('enter number day: '))\nnn = int(datetime.now().strftime('%w')) + 1\nprint(datetim... | false |
5,431 | 88cc4ae4137cf9c0e9c39874b36f7a2770550f96 | from app.exceptions import UserAlreadyExist, UserDoesNotExist
class Accounts(object):
""" Creates an Account where users can be stored """
def __init__(self):
self.users = {}
def add_user(self, user):
if user.id in self.users:
raise UserAlreadyExist
else:
s... | [
"from app.exceptions import UserAlreadyExist, UserDoesNotExist\n\nclass Accounts(object):\n \"\"\" Creates an Account where users can be stored \"\"\"\n\n def __init__(self):\n self.users = {}\n\n def add_user(self, user):\n if user.id in self.users:\n raise UserAlreadyExist\n ... | false |
5,432 | b90678c8f7ad9b97e13e5603bdf1dc8cb3511ca5 | # PySNMP SMI module. Autogenerated from smidump -f python DOCS-IETF-QOS-MIB
# by libsmi2pysnmp-0.1.3 at Thu May 22 11:57:36 2014,
# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)
# Imports
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integ... | [
"# PySNMP SMI module. Autogenerated from smidump -f python DOCS-IETF-QOS-MIB\n# by libsmi2pysnmp-0.1.3 at Thu May 22 11:57:36 2014,\n# Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0)\n\n# Imports\n\n( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols(\"A... | false |
5,433 | 2908d34165fac272c9571be623855a0613c952f3 | from django.contrib.auth.models import User
from django_filters import (
NumberFilter,
DateTimeFilter,
AllValuesFilter
)
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import permissions
from rest_framework.throttling import ScopedRateThrottle
fr... | [
"from django.contrib.auth.models import User\nfrom django_filters import (\n NumberFilter,\n DateTimeFilter,\n AllValuesFilter\n)\n\nfrom rest_framework.response import Response\nfrom rest_framework.reverse import reverse\nfrom rest_framework import permissions\nfrom rest_framework.throttling import Scoped... | false |
5,434 | db93de33f537eeaf64ca8e2b2b79aba1f592305b | import urllib.request
username = ''
link = r'https://www.instagram.com/' + username
html = urllib.request.urlopen(link)
print(html.read()) | [
"import urllib.request\n\nusername = ''\nlink = r'https://www.instagram.com/' + username\nhtml = urllib.request.urlopen(link)\nprint(html.read())",
"import urllib.request\nusername = ''\nlink = 'https://www.instagram.com/' + username\nhtml = urllib.request.urlopen(link)\nprint(html.read())\n",
"<import token>\n... | false |
5,435 | de9b85c250dea15ff9201054957ebc38017a8c35 | n=7
a=[]
for i in range(1,n+1):
print(i)
if(i<n):
print("+")
a.append(i)
print("= {}".format(sum(a)))
| [
"n=7\na=[]\nfor i in range(1,n+1):\n print(i)\n if(i<n):\n print(\"+\")\n a.append(i)\nprint(\"= {}\".format(sum(a)))\n",
"n = 7\na = []\nfor i in range(1, n + 1):\n print(i)\n if i < n:\n print('+')\n a.append(i)\nprint('= {}'.format(sum(a)))\n",
"<assignment token>\nfor i in ra... | false |
5,436 | b724b04c6303cc9021539ad7df5a198000491029 | # -*- coding: utf-8 -*-
# Project = https://github.com/super-l/search-url.git
# Author = superl
# Blog = www.superl.org QQ:86717375
# Team = Code Security Team(C.S.T) | 铭剑创鼎
import urllib2
import re
import ConfigParser
from lib.filter import *
from lib.getdata import *
from lib.count import *
from lib.status... | [
"# -*- coding: utf-8 -*-\n# Project = https://github.com/super-l/search-url.git\n# Author = superl\n# Blog = www.superl.org QQ:86717375\n# Team = Code Security Team(C.S.T) | 铭剑创鼎\nimport urllib2\nimport re \nimport ConfigParser\n\nfrom lib.filter import *\nfrom lib.getdata import *\nfrom lib.count import *... | false |
5,437 | b51e0ee80a2488197470627821204d1f74cd62a1 | # POST API for Red Alert project - NLP and Metalearning components
# Insikt Intelligence S.L. 2019
import pandas as pd
import pickle
from flask import Flask, render_template, request, jsonify
from utilities import load_data, detect_language
from preprocessing import preprocess, Tagger, remove_stopwords
import json
fro... | [
"# POST API for Red Alert project - NLP and Metalearning components\n# Insikt Intelligence S.L. 2019\n\nimport pandas as pd\nimport pickle\nfrom flask import Flask, render_template, request, jsonify\nfrom utilities import load_data, detect_language\nfrom preprocessing import preprocess, Tagger, remove_stopwords\nim... | false |
5,438 | 5209638ec97a666783c102bec7a2b00991c41a08 | # ----------------------------------------------------------------------------
# Written by Khanh Nguyen Le
# May 4th 2019
# Discord: https://discord.io/skyrst
# ----------------------------------------------------------------------------
import operator
def validInput(x):
if x=="a": return True
elif x=... | [
"# ----------------------------------------------------------------------------\r\n# Written by Khanh Nguyen Le\r\n# May 4th 2019\r\n# Discord: https://discord.io/skyrst\r\n# ----------------------------------------------------------------------------\r\nimport operator\r\ndef validInput(x):\r\n if x==\"a\": ret... | false |
5,439 | d287123acdbabdd5a223e774c89945ab888fcbcc | #os for file system
import os
from sys import platform as _platform
import fnmatch
import inspect
files = 0
lines = 0
extension0 = '.c'
extension1 = '.cpp'
extension2 = '.h'
extension3 = '.hpp'
filename = inspect.getframeinfo(inspect.currentframe()).filename
startPath = os.path.dirname(os.path.abspath(... | [
"#os for file system\nimport os\n\nfrom sys import platform as _platform\n\nimport fnmatch\nimport inspect\n\nfiles = 0\nlines = 0 \n \nextension0 = '.c'\nextension1 = '.cpp'\nextension2 = '.h'\t\nextension3 = '.hpp'\t\n\nfilename = inspect.getframeinfo(inspect.currentframe()).filename\nstartPath = os.path.... | false |
5,440 | 8286407987301ace7af97d6acdcf6299ce3d8525 | from django.db import models
class Book(models.Model):
title = models.TextField(max_length=32, blank=False, null=False)
# from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager
#
#
# class UserAccountManager(BaseUserManager):
# def create_user(self, email, firstname,lastna... | [
"from django.db import models\n\n\nclass Book(models.Model):\n title = models.TextField(max_length=32, blank=False, null=False)\n\n# from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager\n#\n#\n# class UserAccountManager(BaseUserManager):\n# def create_user(self, email, f... | false |
5,441 | b4d31fd05f8a9d66dcfffb55d805ab93d7ff9cdf | #Write a function remove_duplicates that takes in a list and removes elements of the list that are the same.
#For example: remove_duplicates([1,1,2,2])
#should return [1,2].
#Do not modify the list you take as input! Instead, return a new list.
def remove_duplicates(lst_of_items):
new_list=list()
#dict={}
... | [
"#Write a function remove_duplicates that takes in a list and removes elements of the list that are the same.\n\n#For example: remove_duplicates([1,1,2,2])\n#should return [1,2].\n\n#Do not modify the list you take as input! Instead, return a new list.\n\ndef remove_duplicates(lst_of_items):\n\tnew_list=list()\n ... | true |
5,442 | c96a64573fc6cc207ee09be4f4b183d065736ff6 | from collections import deque
'''
Big O
เวลาเรียก queue จะมี2operation 1deque 2enqueue เวลาเอาไปใช้
อยู่ที่การimplementation
โปรแกรมที่ดี 1.ทำงานถูกต้อง 2.ทันใจ 3.ทรัพยากรที่ใช้รันได้ทุกเครื่อง(specคอมกาก)
4.ทำงานได้ตามต้องการ5.ความเสถียรของระบบ 6.Bugs
แพง คือ memory expansive ใช้หน่วยความจำเยอะ
runtime exp... | [
"from collections import deque\r\n'''\r\nBig O \r\nเวลาเรียก queue จะมี2operation 1deque 2enqueue เวลาเอาไปใช้\r\nอยู่ที่การimplementation\r\nโปรแกรมที่ดี 1.ทำงานถูกต้อง 2.ทันใจ 3.ทรัพยากรที่ใช้รันได้ทุกเครื่อง(specคอมกาก)\r\n4.ทำงานได้ตามต้องการ5.ความเสถียรของระบบ 6.Bugs\r\n\r\nแพง คือ memory expansive ใช้หน่วยควา... | false |
5,443 | 5c315a49ead80e8d8ce057bd774f97bce098de59 | import math
import numpy as np
import h5py
import matplotlib.pyplot as plt
import scipy
from PIL import Image
from scipy import ndimage
import tensorflow as tf
from tensorflow.python.framework import ops
from pathlib import Path
from scipy.io import loadmat
from skimage.transform import resize
from sklearn.... | [
"import math\r\nimport numpy as np\r\nimport h5py\r\nimport matplotlib.pyplot as plt\r\nimport scipy\r\nfrom PIL import Image\r\nfrom scipy import ndimage\r\nimport tensorflow as tf\r\nfrom tensorflow.python.framework import ops\r\nfrom pathlib import Path\r\nfrom scipy.io import loadmat\r\nfrom skimage.transform i... | false |
5,444 | b0dbc4e8a2ce41dc9d2040890e3df4d078680fa1 | from collections import deque
def solution(people, limit):
people.sort()
cnt = 0
left_idx = 0
right_idx = len(people)-1
while left_idx <= right_idx:
if people[left_idx] + people[right_idx] <= limit:
cnt += 1
left_idx += 1
right_idx -= 1
else:
... | [
"from collections import deque\n\n\ndef solution(people, limit):\n people.sort()\n cnt = 0\n\n left_idx = 0\n right_idx = len(people)-1\n while left_idx <= right_idx:\n if people[left_idx] + people[right_idx] <= limit:\n cnt += 1\n left_idx += 1\n right_idx -= ... | false |
5,445 | 4e66fe0485d987da590d11c848009b2e1665b3dc | from flask import Blueprint, render_template, flash, redirect, url_for, request, current_app, g, session
from flask_login import current_user
from app import decorators
from app.models import User, Post, Comment, Tag
from slugify import slugify
from app.main.forms import CommentForm, TagForm, ProfileForm, ContactForm
f... | [
"from flask import Blueprint, render_template, flash, redirect, url_for, request, current_app, g, session\nfrom flask_login import current_user\nfrom app import decorators\nfrom app.models import User, Post, Comment, Tag\nfrom slugify import slugify\nfrom app.main.forms import CommentForm, TagForm, ProfileForm, Con... | false |
5,446 | bc5e928305d82c92c10106fe1f69f5979d57e3d2 | import os
from tqdm import tqdm
from system.krl import KRL
from system.utils.format import format_data
from system.oie import OIE
# extract one file
def execute_file(input_fp, output_fp):
oie = OIE()
oie.extract_file(input_fp, output_fp)
# extract one sentence
def execute_sentence():
... | [
"import os\r\n\r\nfrom tqdm import tqdm\r\n\r\nfrom system.krl import KRL\r\nfrom system.utils.format import format_data\r\nfrom system.oie import OIE\r\n\r\n\r\n# extract one file\r\ndef execute_file(input_fp, output_fp):\r\n oie = OIE()\r\n oie.extract_file(input_fp, output_fp)\r\n\r\n\r\n# extract one sent... | false |
5,447 | e1968e0d6146ce7656505eeed8e9f31daa4b558a | from django.contrib import admin
# from django.contrib.admin import AdminSite
# class MyAdminSite(AdminSite):
# site_header = 'Finder Administration'
# admin_site = MyAdminSite(name='Finder Admin')
from finder.models import Database, Column, GpsData, Alarm, System
class ColumnInline(admin.TabularInline):
mo... | [
"from django.contrib import admin\n\n# from django.contrib.admin import AdminSite\n# class MyAdminSite(AdminSite):\n# site_header = 'Finder Administration'\n# admin_site = MyAdminSite(name='Finder Admin')\n\n\nfrom finder.models import Database, Column, GpsData, Alarm, System\n\nclass ColumnInline(admin.Tabular... | false |
5,448 | d3e728bda85d2e72b8e477ab439d4dcffa23d63a | #!/usr/bin/env python
import speech_recognition as sr
from termcolor import colored as color
import apiai
import json
from os import system
import wikipedia as wiki
from time import sleep
import webbrowser as wb
BOLD = "\033[1m" #use to bold the text
END = "\033[0m" #use to close the bold text
CLIENT_ACCESS_TOK... | [
"#!/usr/bin/env python\n\nimport speech_recognition as sr\nfrom termcolor import colored as color\nimport apiai\nimport json\nfrom os import system\nimport wikipedia as wiki\nfrom time import sleep\nimport webbrowser as wb\n\n\nBOLD = \"\\033[1m\" #use to bold the text\nEND = \"\\033[0m\" #use to close the bol... | false |
5,449 | 5b4a196de60a3a30bc571c559fe5f211563b8999 | # -*- coding: utf-8 -*-
# @File : config.py
# @Author: TT
# @Email : tt.jiaqi@gmail.com
# @Date : 2018/12/4
# @Desc : config file
from utils.general import getchromdriver_version
from chromedriver.path import path
import os
import sys
chromedriver = os.path.abspath(os.path.dirname(__file__)) + "\\chromedriver\\"+ g... | [
"# -*- coding: utf-8 -*-\n# @File : config.py\n# @Author: TT\n# @Email : tt.jiaqi@gmail.com\n# @Date : 2018/12/4\n# @Desc : config file\nfrom utils.general import getchromdriver_version\nfrom chromedriver.path import path\nimport os\nimport sys\n\nchromedriver = os.path.abspath(os.path.dirname(__file__)) + \"\\\... | false |
5,450 | aa4226c377368d1ece4e556db9b7fdd0134472c9 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | [
"# ##### BEGIN GPL LICENSE BLOCK #####\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This progra... | false |
5,451 | 00051a4087bfcf2e6826e9afa898830dc59aa5ab | # -*-coding:utf-8-*-
# Author: Scott Larter
import pygame
import pygame.draw
import numpy as np
from agent import *
from tools import *
SCREENSIZE = [1200, 400] # walls.csv
#SCREENSIZE = [1200, 650] # walls2.csv
RESOLUTION = 180
AGENTSNUM = 12
GROUPSNUM = 2
MAXGROUPSIZE = 6
MAXSUBGROUPSIZE = 3
BACKGROUNDCOLOR = [255... | [
"# -*-coding:utf-8-*-\n# Author: Scott Larter\n\nimport pygame\nimport pygame.draw\nimport numpy as np\nfrom agent import *\nfrom tools import *\n\n\nSCREENSIZE = [1200, 400] # walls.csv\n#SCREENSIZE = [1200, 650] # walls2.csv\nRESOLUTION = 180\nAGENTSNUM = 12\nGROUPSNUM = 2\nMAXGROUPSIZE = 6\nMAXSUBGROUPSIZE = 3\n... | false |
5,452 | 519dbe97ce9de30e616d660ef168e686c52b01b5 | #!/usr/bin/env python3
#
# main.py - By Steven Chen Hao Nyeo
# Graphical interface for Socionics Engine
# Created: August 8, 2019
import wx
from cognitive_function import *
from entity import Entity
from function_to_type import Translator
from function_analysis import *
class TypeFrame(wx.Frame):
def __init__(s... | [
"#!/usr/bin/env python3\n#\n# main.py - By Steven Chen Hao Nyeo \n# Graphical interface for Socionics Engine \n# Created: August 8, 2019\n\nimport wx\nfrom cognitive_function import *\nfrom entity import Entity\nfrom function_to_type import Translator\nfrom function_analysis import *\n\nclass TypeFrame(wx.Frame):\n... | false |
5,453 | 81b920ab5417937dc0fc1c9675d393efc6a4d58d | import pandas as pd #@UnusedImport
import matplotlib.pyplot as plt
import matplotlib #@UnusedImport
import numpy as np #@UnusedImport
class Plotter():
def __init__(self):
self.red_hex_code = '#ff0000'
def AlkDMIonStatsSplitPlot(self, df):
PV1_DataSets_lst = df[df['inst'] == 'PV1']['DataSet'].unique()
... | [
"import pandas as pd #@UnusedImport\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib #@UnusedImport\r\nimport numpy as np #@UnusedImport\r\n\r\nclass Plotter():\r\n\tdef __init__(self):\r\n\t\tself.red_hex_code = '#ff0000'\r\n\r\n\tdef AlkDMIonStatsSplitPlot(self, df):\r\n\t\tPV1_DataSets_lst = df[df['inst']... | false |
5,454 | aa952e8f9a1855b5578cb26d6e5aca42605ee585 | # https://leetcode-cn.com/problems/zigzag-conversion/
# 6. Z 字形变换
class Solution:
def convert(self, s: str, numRows: int) -> str:
res = ''
for i in range(numRows):
pass
return res
| [
"# https://leetcode-cn.com/problems/zigzag-conversion/\n# 6. Z 字形变换\n\n\nclass Solution:\n def convert(self, s: str, numRows: int) -> str:\n res = ''\n for i in range(numRows):\n pass\n return res\n",
"class Solution:\n\n def convert(self, s: str, numRows: int) ->str:\n ... | false |
5,455 | 0e47a7d9cd6809886674291d6a535dd18205a012 | #!/usr/bin/env python3
def GetDensity(T, P, config):
return P/(T*config["Flow"]["mixture"]["gasConstant"])
def GetViscosity(T, config):
if (config["Flow"]["mixture"]["viscosityModel"]["type"] == "Constant"):
viscosity = config["Flow"]["mixture"]["viscosityModel"]["Visc"]
elif (config["Flow"]["mixture"]... | [
"#!/usr/bin/env python3\n\ndef GetDensity(T, P, config):\n return P/(T*config[\"Flow\"][\"mixture\"][\"gasConstant\"])\n\ndef GetViscosity(T, config):\n if (config[\"Flow\"][\"mixture\"][\"viscosityModel\"][\"type\"] == \"Constant\"):\n viscosity = config[\"Flow\"][\"mixture\"][\"viscosityModel\"][\"Visc\"... | false |
5,456 | 4379d89c2ada89822acbf523d2e364599f996f8c | import numpy as np
import pandas as pd
import sklearn
import sklearn.preprocessing
import matplotlib.pyplot as plt
import tensorflow as tf
from enum import Enum
from pytalib.indicators import trend
from pytalib.indicators import base
class Cell(Enum):
BasicRNN = 1
BasicLSTM = 2
LSTMCellPeephole = 3
GR... | [
"import numpy as np\nimport pandas as pd\nimport sklearn\nimport sklearn.preprocessing\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\nfrom enum import Enum\nfrom pytalib.indicators import trend\nfrom pytalib.indicators import base\n\n\nclass Cell(Enum):\n BasicRNN = 1\n BasicLSTM = 2\n LSTMCell... | false |
5,457 | 4d82e68faa3102fc2949fd805588504b7d874589 | import os, sys, datetime, pytz, tzlocal, urllib.request, requests, csv, hashlib, json, boto3
uri = 'ftp://ftpcimis.water.ca.gov/pub2/daily/daily107.csv' #Station 107 is Santa Barbara
base_et = 0.15
def main():
try:
tempfile = tempfile_name()
get_datafile(tempfile)
except:
print("Could not retrieve da... | [
"import os, sys, datetime, pytz, tzlocal, urllib.request, requests, csv, hashlib, json, boto3\n\nuri = 'ftp://ftpcimis.water.ca.gov/pub2/daily/daily107.csv' #Station 107 is Santa Barbara\nbase_et = 0.15\n\n\ndef main():\n try:\n tempfile = tempfile_name()\n get_datafile(tempfile)\n except:\n print(\"Coul... | false |
5,458 | 382f7119beba81087c497baf170eb6814c26c03e | """byte - property model module."""
from __future__ import absolute_import, division, print_function
class BaseProperty(object):
"""Base class for properties."""
def get(self, obj):
"""Get property value from object.
:param obj: Item
:type obj: byte.model.Model
"""
ra... | [
"\"\"\"byte - property model module.\"\"\"\nfrom __future__ import absolute_import, division, print_function\n\n\nclass BaseProperty(object):\n \"\"\"Base class for properties.\"\"\"\n\n def get(self, obj):\n \"\"\"Get property value from object.\n\n :param obj: Item\n :type obj: byte.mod... | false |
5,459 | beb9fe8e37a4f342696a90bc624b263e341e4de5 | #!/usr/bin/python
L=['ABC','ABC']
con1=[]
for i in range (0,len(L[1])):
#con.append(L[1][i])
con=[]
for j in range (0, len(L)):
print(L[j][i])
con.append(L[j][i])
con1.append(con)
con2=[]
for k in range (0,len(con1)):
if con1[k].count('A')==2:
con2.append('a')
elif con1[k].count('B')... | [
"#!/usr/bin/python\n\nL=['ABC','ABC']\ncon1=[]\nfor i in range (0,len(L[1])):\n #con.append(L[1][i])\n con=[]\n\n for j in range (0, len(L)):\n print(L[j][i])\n \n con.append(L[j][i])\n con1.append(con)\n\ncon2=[]\n \nfor k in range (0,len(con1)):\n if con1[k].count('A')==2:\n con2.append('a')\n ... | false |
5,460 | 8f14bbab8b2a4bc0758c6b48feb20f8b0e3e348b | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File: software/jetson/fastmot/utils/sot.py
# By: Samuel Duclos
# For: Myself
# Description: This file returns detection results from an image.
from cvlib.object_detection import draw_bbox
class ObjectCenter(object):
def __init__(self, args)... | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# File: software/jetson/fastmot/utils/sot.py\n# By: Samuel Duclos\n# For: Myself\n# Description: This file returns detection results from an image.\n\nfrom cvlib.object_detection import draw_bbox\n\nclass ObjectCenter(object):\n def __in... | false |
5,461 | bb730606c7357eeb605292d5b9c05e8e8a797ea2 | n,k=[int(input()) for _ in range(2)]
ans=1
for _ in range(n):
ans=min(ans*2,ans+k)
print(ans)
| [
"n,k=[int(input()) for _ in range(2)]\nans=1\nfor _ in range(n):\n ans=min(ans*2,ans+k)\nprint(ans)\n\n",
"n, k = [int(input()) for _ in range(2)]\nans = 1\nfor _ in range(n):\n ans = min(ans * 2, ans + k)\nprint(ans)\n",
"<assignment token>\nfor _ in range(n):\n ans = min(ans * 2, ans + k)\nprint(ans)... | false |
5,462 | 4c38d0487f99cdc91cbce50079906f7336e51482 | from platypush.message.response import Response
class CameraResponse(Response):
pass
# vim:sw=4:ts=4:et:
| [
"from platypush.message.response import Response\n\n\nclass CameraResponse(Response):\n pass\n\n\n# vim:sw=4:ts=4:et:\n",
"from platypush.message.response import Response\n\n\nclass CameraResponse(Response):\n pass\n",
"<import token>\n\n\nclass CameraResponse(Response):\n pass\n",
"<import token>\n<... | false |
5,463 | b72bf00d156862c7bddecb396da3752be964ee66 | # SaveIsawQvector
import sys
import os
if os.path.exists("/opt/Mantid/bin"):
sys.path.append("/opt/mantidnightly/bin")
#sys.path.append("/opt/Mantid/bin") # Linux cluster
#sys.path.append('/opt/mantidunstable/bin')
else:
sys.path.append("C:/MantidInstall/bin") # Windows PC
# import ma... | [
"# SaveIsawQvector\r\n\r\nimport sys\nimport os\n\r\nif os.path.exists(\"/opt/Mantid/bin\"):\n sys.path.append(\"/opt/mantidnightly/bin\")\n #sys.path.append(\"/opt/Mantid/bin\") # Linux cluster\n #sys.path.append('/opt/mantidunstable/bin')\nelse:\n sys.path.append(\"C:/MantidInstall/bin\") ... | true |
5,464 | 1599f5e49ec645b6d448e74719e240343077aedd | from django.conf.urls import patterns, include, url
from django.contrib import admin
from metainfo.views import DomainListView
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'metapull.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', DomainListView.as_view()),
url(... | [
"from django.conf.urls import patterns, include, url\nfrom django.contrib import admin\nfrom metainfo.views import DomainListView\n\n\nurlpatterns = patterns('',\n # Examples:\n # url(r'^$', 'metapull.views.home', name='home'),\n # url(r'^blog/', include('blog.urls')),\n url(r'^$', DomainListView.as_vie... | false |
5,465 | 1b09b18926dc95d4c4b3088f45088f12c162ccb3 | # -*- coding: utf-8 -*-
a=float(input('Digite um número:'))
b=(a-(a%1))
c=(a%1)
print('O valor inteiro é %d' %b)
print('O valor decimal é %.6f' %c) | [
"# -*- coding: utf-8 -*-\na=float(input('Digite um número:'))\nb=(a-(a%1))\nc=(a%1)\nprint('O valor inteiro é %d' %b)\nprint('O valor decimal é %.6f' %c)",
"a = float(input('Digite um número:'))\nb = a - a % 1\nc = a % 1\nprint('O valor inteiro é %d' % b)\nprint('O valor decimal é %.6f' % c)\n",
"<assignment to... | false |
5,466 | 9e987e057ee5322765415b84e84ef3c4d2827742 | # Copyright (c) 2008-2016 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the `interpolation` module."""
from __future__ import division
import logging
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_eq... | [
"# Copyright (c) 2008-2016 MetPy Developers.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n\"\"\"Test the `interpolation` module.\"\"\"\n\nfrom __future__ import division\n\nimport logging\n\nimport numpy as np\nfrom numpy.testing import assert_almost_equal, a... | false |
5,467 | cfc0ca0d8528937526f6c42721870f1739a2ae95 | from turtle import Screen
import time
from snake import Snake
from snake_food import Food
from snake_score import Scoreboard
screen = Screen()
screen.setup(width=600,height=600)
screen.bgcolor("black")
screen.title("Snake Game")
screen.tracer(0)
snake = Snake()
food=Food()
score=Scoreboard()
screen.... | [
"from turtle import Screen\r\nimport time\r\nfrom snake import Snake\r\nfrom snake_food import Food\r\nfrom snake_score import Scoreboard\r\n\r\nscreen = Screen()\r\nscreen.setup(width=600,height=600)\r\nscreen.bgcolor(\"black\")\r\nscreen.title(\"Snake Game\")\r\nscreen.tracer(0)\r\n\r\nsnake = Snake()\r\nfood=Fo... | false |
5,468 | 9adf18b3a65bf58dd4c22a6fe026d0dd868533fb | from .models import Stock
from .serializers import StockSerializer
from rest_framework import generics
class StockListCreate(generics.ListCreateAPIView):
queryset = Stock.objects.all()
serializer_class = StockSerializer
| [
"from .models import Stock\nfrom .serializers import StockSerializer\nfrom rest_framework import generics\n\nclass StockListCreate(generics.ListCreateAPIView):\n queryset = Stock.objects.all()\n serializer_class = StockSerializer\n\n",
"from .models import Stock\nfrom .serializers import StockSerializer\nfr... | false |
5,469 | a76a0631c97ba539019790e35136f6fd7573e461 | from google.cloud import pubsub_v1
import os
from flask import Flask, request, jsonify
from google.cloud import pubsub_v1
import os
from gcloud import storage
import json
import datetime
import time
app = Flask(__name__)
os.environ[
"GOOGLE_APPLICATION_CREDENTIALS"] = "/home/vishvesh/Documents/Dal/serverless/api-... | [
"from google.cloud import pubsub_v1\nimport os\nfrom flask import Flask, request, jsonify\nfrom google.cloud import pubsub_v1\nimport os\nfrom gcloud import storage\nimport json\nimport datetime\nimport time\n\napp = Flask(__name__)\n\nos.environ[\n \"GOOGLE_APPLICATION_CREDENTIALS\"] = \"/home/vishvesh/Document... | false |
5,470 | 4cdd5fc15096aac01ad6d97d38ef7397859de18b | import json
import urllib
while True:
# Get input URL
url = raw_input("Enter URL: ")
# Check valid input
if len(url) < 1:
break
# Get data
print("Retrieving", url)
connection = urllib.urlopen(url)
data = connection.read()
print("Retrieved", len(data), "characters")
# P... | [
"import json\nimport urllib\n\nwhile True:\n # Get input URL\n url = raw_input(\"Enter URL: \")\n # Check valid input\n if len(url) < 1:\n break\n\n # Get data\n print(\"Retrieving\", url)\n connection = urllib.urlopen(url)\n data = connection.read()\n print(\"Retrieved\", len(data... | false |
5,471 | 20c081dc47f541a988bccef89b8e51f446c80f58 | # terminal based game in Python
from random import randint
print('Terminal based number guessing game')
while True:
try:
numberOfGames = int(input('Please choose how many games you want to play ---> '))
except:
print('Only numbes accepted')
continue
if (numberOfGames > 0 and numberO... | [
"# terminal based game in Python\nfrom random import randint\n\nprint('Terminal based number guessing game')\nwhile True:\n try:\n numberOfGames = int(input('Please choose how many games you want to play ---> '))\n except:\n print('Only numbes accepted')\n continue\n if (numberOfGames ... | false |
5,472 | 6bde0ce30f33b155cc4c9ce9aa2ea6a6c5a1231d | """Coroutine utilities."""
from decorator import decorator
@decorator
def coroutine(f, *a, **kw):
"""This decorator starts the coroutine for us."""
i = f(*a, **kw)
i.next()
return i
| [
"\"\"\"Coroutine utilities.\"\"\"\n\nfrom decorator import decorator\n\n@decorator\ndef coroutine(f, *a, **kw):\n \"\"\"This decorator starts the coroutine for us.\"\"\"\n i = f(*a, **kw)\n i.next()\n return i\n",
"<docstring token>\nfrom decorator import decorator\n\n\n@decorator\ndef coroutine(f, *a... | false |
5,473 | f1601d3d820b93631f9b1358627a5716016ad135 | import os
def is_admin():
"""
The function ``is_admin`` detects whether the calling process is running
with administrator/superuser privileges. It works cross-platform on
either Windows NT systems or Unix-based systems.
"""
if os.name == 'nt':
try:
# Only Windows users wit... | [
"import os\n\n\ndef is_admin():\n \"\"\"\n The function ``is_admin`` detects whether the calling process is running\n with administrator/superuser privileges. It works cross-platform on \n either Windows NT systems or Unix-based systems.\n \"\"\"\n if os.name == 'nt':\n try:\n # ... | false |
5,474 | 021f224d031477bd305644261ad4d79d9eca98b3 | import pytest
from flaat.issuers import IssuerConfig, is_url
from flaat.test_env import FLAAT_AT, FLAAT_ISS, environment
class TestURLs:
def test_url_1(self):
assert is_url("http://heise.de")
def test_valid_url_http(self):
assert is_url("http://heise.de")
def test_valid_url_https(self):... | [
"import pytest\n\nfrom flaat.issuers import IssuerConfig, is_url\nfrom flaat.test_env import FLAAT_AT, FLAAT_ISS, environment\n\n\nclass TestURLs:\n def test_url_1(self):\n assert is_url(\"http://heise.de\")\n\n def test_valid_url_http(self):\n assert is_url(\"http://heise.de\")\n\n def test_... | false |
5,475 | 0f0adde7241898d2efe7e2b5cc218e42ed7b73d8 | from functools import reduce
from collections import defaultdict
def memory(count: int, start_numbers: list):
numbers = defaultdict(lambda: tuple(2 * [None]), { el: (idx,None ) for idx,el in enumerate(start_numbers) })
last = start_numbers[-1]
for idx in range(len(numbers), count):
last = 0 if None... | [
"from functools import reduce\nfrom collections import defaultdict\n\ndef memory(count: int, start_numbers: list):\n numbers = defaultdict(lambda: tuple(2 * [None]), { el: (idx,None ) for idx,el in enumerate(start_numbers) })\n last = start_numbers[-1]\n for idx in range(len(numbers), count):\n last... | false |
5,476 | b794a4cca3303ac7440e9aad7bc210df62648b51 | from pkg.models.board import Board
class BaseAI:
_board: Board = None
def __init__(self, board=None):
if board is not None:
self.set_board(board)
def set_board(self, board):
self._board = board
def find_move(self, for_player):
pass
| [
"from pkg.models.board import Board\n\n\nclass BaseAI:\n _board: Board = None\n\n def __init__(self, board=None):\n if board is not None:\n self.set_board(board)\n\n def set_board(self, board):\n self._board = board\n\n def find_move(self, for_player):\n pass\n",
"<impo... | false |
5,477 | 957fb1bd34d13b86334da47ac9446e30afd01678 | data = {
'title': 'Dva leteca (gostimo na 2)',
'song': [
'x - - - - - x - - - - -',
'- x - - - x - - - x - -',
'- - x - x - - - x - x -',
'- - - x - - - x - - - x'
],
'bpm': 120,
'timeSignature': '4/4'
}
from prog import BellMusicCreator
exportFile = __file__.replac... | [
"data = {\n 'title': 'Dva leteca (gostimo na 2)',\n 'song': [\n 'x - - - - - x - - - - -',\n '- x - - - x - - - x - -',\n '- - x - x - - - x - x -',\n '- - - x - - - x - - - x'\n ],\n 'bpm': 120,\n 'timeSignature': '4/4'\n}\n\nfrom prog import BellMusicCreator\n\nexportFil... | false |
5,478 | f75e0ddf42cc9797cdf1c4a4477e3d16441af740 | import openpyxl # 适用于xlsx文件
'''
纯文本文件 student.txt为学生信息, 里面的内容(包括花括号)如下所示:
{
"1":["张三",150,120,100],
"2":["李四",90,99,95],
"3":["王五",60,66,68]
}
请将上述内容写到 student.xls 文件中
'''
def read_file():
words = []
with open('15.txt', 'r') as file:
content = file.read()
# print(content)
# print(... | [
"import openpyxl # 适用于xlsx文件\n'''\n纯文本文件 student.txt为学生信息, 里面的内容(包括花括号)如下所示:\n\n{\n\t\"1\":[\"张三\",150,120,100],\n\t\"2\":[\"李四\",90,99,95],\n\t\"3\":[\"王五\",60,66,68]\n}\n请将上述内容写到 student.xls 文件中\n'''\n\n\ndef read_file():\n words = []\n with open('15.txt', 'r') as file:\n content = file.read()\n ... | false |
5,479 | 200552b638d6b1a6879b455837677b82689e0069 |
STATUS_CHOICES = (
(-1, 'Eliminado'),
(0, 'Inactivo'),
(1, 'Activo'),
)
USERTYPES_CHOICES = ()
#-- Activation Request Values
ACTIVATION_CHOICES = (
(1, 'Activacion'),
(2, 'Solicitud Password'),
(3, 'Invitacion'),
)
#-- Activation Status Values
ACTIVATIONSTATUS_CHOICES = (
(-1, 'Expirado... | [
"\n\nSTATUS_CHOICES = (\n (-1, 'Eliminado'),\n (0, 'Inactivo'),\n (1, 'Activo'),\n)\n\nUSERTYPES_CHOICES = ()\n\n#-- Activation Request Values\nACTIVATION_CHOICES = (\n (1, 'Activacion'),\n (2, 'Solicitud Password'),\n (3, 'Invitacion'),\n)\n\n#-- Activation Status Values\nACTIVATIONSTATUS_CHOICES... | false |
5,480 | 2c4f27e7d1bfe6d68fd0836094b9e350946913f6 | from django.db import models
class Survey(models.Model):
"""Survey representation.
"""
name = models.CharField(max_length=255)
description = models.TextField()
start_date = models.DateTimeField()
end_date = models.DateTimeField()
def __str__(self):
return self.name
class Questi... | [
"from django.db import models\n\n\nclass Survey(models.Model):\n \"\"\"Survey representation.\n \"\"\"\n\n name = models.CharField(max_length=255)\n description = models.TextField()\n start_date = models.DateTimeField()\n end_date = models.DateTimeField()\n\n def __str__(self):\n return ... | false |
5,481 | 9ae9fd6da5c3d519d87af699dd4ea9b564a53d79 | import hashlib
hash = 'yzbqklnj'
int = 0
while not hashlib.md5("{}{}".format(hash, int).encode('utf-8')).hexdigest().startswith('000000'):
print("Nope luck for {}{}".format(hash, int))
int += 1
print("Key: {}{}".format(hash, int))
print("Number: {}").format(int) | [
"import hashlib\n\nhash = 'yzbqklnj'\n\nint = 0\n\nwhile not hashlib.md5(\"{}{}\".format(hash, int).encode('utf-8')).hexdigest().startswith('000000'):\n print(\"Nope luck for {}{}\".format(hash, int))\n int += 1\n\nprint(\"Key: {}{}\".format(hash, int))\nprint(\"Number: {}\").format(int)",
"import hashlib\n... | false |
5,482 | 36e7398f576aa1d298a20b4d4a27a7b93e3bd992 | import numpy as np
import matplotlib.pyplot as plt
def sigmoid(X):
""" Applies the logistic function to x, element-wise. """
return 1 / (1 + np.exp(-X))
def x_strich(X):
return np.column_stack((np.ones(len(X)), X))
def feature_scaling(X):
x_mean = np.mean(X, axis=0)
x_std = np.std(X, axis=0)
... | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef sigmoid(X):\n \"\"\" Applies the logistic function to x, element-wise. \"\"\"\n return 1 / (1 + np.exp(-X))\n\n\ndef x_strich(X):\n\n return np.column_stack((np.ones(len(X)), X))\n\n\ndef feature_scaling(X):\n x_mean = np.mean(X, axis=0)\n ... | false |
5,483 | 1c60620814a4aea2573caf99cee87590a8d57c18 | #Write by Jess.S 25/1/2019
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['font.sans-serif'] = ['FangSong'] # 指定默认字体
plt.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题
def draw_point(x,y):
plt.scatter(x, y)
plt.title('点分布图')#显示图表标题
plt.xlabel(... | [
"#Write by Jess.S 25/1/2019\r\n\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nplt.rcParams['font.sans-serif'] = ['FangSong'] # 指定默认字体\r\nplt.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题\r\n\r\ndef draw_point(x,y):\r\n plt.scatter(x, y)\r\n plt.title('点分布图'... | false |
5,484 | dfbbbaf6b5f02c60ca48f7864068d59349c547d1 | """AWS CDK application.
See https://docs.aws.amazon.com/cdk/ for details.
"""
from ias_pmi_cdk_common import PMIApp
from stacks import MainStack
APP_NAME = 'etl-pm-pipeline-be'
# create CDK application
app = PMIApp(APP_NAME)
# add stacks
MainStack(app, app, 'main')
# synthesize application assembly
app.synth(... | [
"\"\"\"AWS CDK application.\n\nSee https://docs.aws.amazon.com/cdk/ for details.\n\n\"\"\"\n\nfrom ias_pmi_cdk_common import PMIApp\n\nfrom stacks import MainStack\n\n\nAPP_NAME = 'etl-pm-pipeline-be'\n\n\n# create CDK application\napp = PMIApp(APP_NAME)\n\n# add stacks\nMainStack(app, app, 'main')\n\n# synthesize ... | false |
5,485 | 89881f3cc6703b3f43f5d2dae87fa943d8a21513 | from random import random, randint, choice
from copy import deepcopy
from math import log
"""
Обертка для функций, которые будут находиться в узлах,
представляющих функции. Его члены – имя функции, сама функция
и количество принимаемых параметров.
"""
class fwrapper:
def __init__(self, function, childcou... | [
"from random import random, randint, choice\r\nfrom copy import deepcopy\r\nfrom math import log\r\n\r\n\"\"\"\r\nОбертка для функций, которые будут находиться в узлах,\r\nпредставляющих функции. Его члены – имя функции, сама функция\r\nи количество принимаемых параметров.\r\n\"\"\"\r\nclass fwrapper:\r\n def __... | false |
5,486 | 2681bd9fe93a4d61214b7c45e5d73097ab73dc07 | import torch as th
from tpp.processes.hawkes.r_terms_recursive_v import get_r_terms
from tpp.utils.test import get_test_events_query
def run_test():
marks = 3
events, query = get_test_events_query(marks=marks)
beta = th.rand([marks, marks])
get_r_terms(events=events, beta=beta)
if __name__ == '__m... | [
"import torch as th\n\nfrom tpp.processes.hawkes.r_terms_recursive_v import get_r_terms\nfrom tpp.utils.test import get_test_events_query\n\n\ndef run_test():\n marks = 3\n events, query = get_test_events_query(marks=marks)\n beta = th.rand([marks, marks])\n\n get_r_terms(events=events, beta=beta)\n\n\n... | false |
5,487 | f46dd5217c8e015546d7fff7ee52569ecc2c8e41 | #8
def matrix(m):
for i in range(len(m)):
for j in range (len(m[0])):
m[i][j]=(m[i][j])**2
a=[[1,2,3],[4,5,6],[8,9,0]]
print('The matrix is ',a)
matrix(a)
print('The updated matrix is ',a)
| [
"#8\ndef matrix(m):\n for i in range(len(m)):\n for j in range (len(m[0])):\n m[i][j]=(m[i][j])**2 \n\na=[[1,2,3],[4,5,6],[8,9,0]]\nprint('The matrix is ',a)\nmatrix(a)\nprint('The updated matrix is ',a)\n\n",
"def matrix(m):\n for i in range(len(m)):\n for j in range(le... | false |
5,488 | 1ac0f5c62ee3cb60d4443b65d429f4f0e6815100 | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.contrib.auth.forms import SetPasswordForm
from . import views
urlpatterns = [
url(regex=r'^(?P<pk>\d+)$', view=views.UserDetailView.as_view(), name='user_detail'),
url(regex=r'^update/(?P<pk>\d+)$', view=views.UserUpd... | [
"from django.conf.urls import url\nfrom django.contrib.auth import views as auth_views\nfrom django.contrib.auth.forms import SetPasswordForm\n\nfrom . import views\n\nurlpatterns = [\n url(regex=r'^(?P<pk>\\d+)$', view=views.UserDetailView.as_view(), name='user_detail'),\n url(regex=r'^update/(?P<pk>\\d+)$', vie... | false |
5,489 | b8a41c56a31acab0181ec364f76010ac12119074 | # PDE:
# add_library('hype')
# processing.py:
from hype.core.util import H
from hype.core.interfaces import HCallback
from hype.extended.behavior import HOscillator
from hype.extended.drawable import HCanvas, HRect
from hype.extended.layout import HGridLayout
from hype.extended.util import HDrawablePool
from random im... | [
"# PDE:\n# add_library('hype')\n# processing.py:\nfrom hype.core.util import H\nfrom hype.core.interfaces import HCallback\nfrom hype.extended.behavior import HOscillator\nfrom hype.extended.drawable import HCanvas, HRect\nfrom hype.extended.layout import HGridLayout\nfrom hype.extended.util import HDrawablePool\n\... | false |
5,490 | 957545649e9bf1eaabe42a1caa627d544e68f108 | """
This file is part of GALE,
Copyright Joe Krall, 2014.
GALE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version... | [
"\"\"\"\n This file is part of GALE,\n Copyright Joe Krall, 2014.\n\n GALE is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) an... | true |
5,491 | 74de0da708c7eb792dea15afb23713d9d71af520 | #!/usr/bin/env python3
# Created by: Khang Le
# Created on: Dec 2019
# This program uses lists and rotation
def rotation(list_of_number, ratating_time):
numbers = list_of_number[0]
numbers = [list_of_number[(i + ratating_time) % len(list_of_number)]
for i, x in enumerate(list_of_number)]
... | [
"#!/usr/bin/env python3\n\n# Created by: Khang Le\n# Created on: Dec 2019\n# This program uses lists and rotation\n\n\ndef rotation(list_of_number, ratating_time):\n\n numbers = list_of_number[0]\n numbers = [list_of_number[(i + ratating_time) % len(list_of_number)]\n for i, x in enumerate(list_... | false |
5,492 | 7b2ca3db44c5f71c2975bd8af701dafca3b3d081 | import math
import numpy as np
class incStat:
def __init__(self, Lambda, isTypeJitter=False): # timestamp is creation time
self.CF1 = 0 # linear sum
self.CF2 = 0 # sum of squares
self.w = 0 # weight
self.isTypeJitter = isTypeJitter
self.Lambda = Lambda # Decay Factor
... | [
"import math\nimport numpy as np\n\n\nclass incStat:\n def __init__(self, Lambda, isTypeJitter=False): # timestamp is creation time\n self.CF1 = 0 # linear sum\n self.CF2 = 0 # sum of squares\n self.w = 0 # weight\n self.isTypeJitter = isTypeJitter\n self.Lambda = Lambda #... | false |
5,493 | e7f511b97f316157a768203afe9f36ea834ebb6c | import requests
import urllib.request
from utilities.read_write_utilities import read_set,write_to_csv
import time
from bs4 import BeautifulSoup
import pickledb
import json
import glob
import csv
drugs = read_set('/Users/sandeep.dey/Downloads/2020-02-06_scrape/drugs')
print(drugs)
output_records = []
# fields = ["equ... | [
"import requests\nimport urllib.request\nfrom utilities.read_write_utilities import read_set,write_to_csv\nimport time\nfrom bs4 import BeautifulSoup\nimport pickledb\nimport json\nimport glob\nimport csv\n\n\ndrugs = read_set('/Users/sandeep.dey/Downloads/2020-02-06_scrape/drugs')\nprint(drugs)\noutput_records = [... | false |
5,494 | 77531233219b76be51aed86536e4d92b8dc5ccad | #!/usr/bin/env python3
# Script qui permet de couper au début ou à la fin d'un fichier audio (.wav)
# un silence ou un passage musical à partir d'un fichier de transcription correspondant.
# Supporte uniquement l'extension audio .wav.
# Supporte les formats de transcriptions suivants :
# - .stm
# - .mlfmanu... | [
"#!/usr/bin/env python3\r\n\r\n# Script qui permet de couper au début ou à la fin d'un fichier audio (.wav)\r\n# un silence ou un passage musical à partir d'un fichier de transcription correspondant.\r\n# Supporte uniquement l'extension audio .wav.\r\n# Supporte les formats de transcriptions suivants :\r\n# - .st... | false |
5,495 | d7b426727e11833b3825baac7b379f5ce44ea491 | def ehcf(a, b):
p1, q1, h1, p2, q2, h2 = 1, 0, a, 0, 1, b
from math import floor
while h2 != 0:
r = floor(h1/h2)
p3 = p1-r*p2
q3 = q1-r*q2
h3 = h1-r*h2
p1,q1,h1,p2,q2,h2 = p2,q2,h2,p3,q3,h3
return (p1, q1, h1)
def findinverse(k, p):
l = ehcf(k,p)[0] % p
return l | [
"def ehcf(a, b):\n p1, q1, h1, p2, q2, h2 = 1, 0, a, 0, 1, b\n from math import floor\n while h2 != 0:\n r = floor(h1/h2)\n p3 = p1-r*p2\n q3 = q1-r*q2\n h3 = h1-r*h2\n p1,q1,h1,p2,q2,h2 = p2,q2,h2,p3,q3,h3\n return (p1, q1, h1)\n\ndef findinverse(k, p):\n l = ehcf(k,p)[0] % p\n return l",
"d... | false |
5,496 | 1c66ccb80383feeee96b3fb492ff63be1a67a796 | import pytest
from django_swagger_utils.drf_server.exceptions import NotFound
from unittest.mock import create_autospec
from content_management_portal.constants.enums import TextType
from content_management_portal.interactors.storages.storage_interface \
import StorageInterface
from content_management_portal.inter... | [
"import pytest\nfrom django_swagger_utils.drf_server.exceptions import NotFound\nfrom unittest.mock import create_autospec\n\nfrom content_management_portal.constants.enums import TextType\nfrom content_management_portal.interactors.storages.storage_interface \\\n import StorageInterface\nfrom content_management... | false |
5,497 | 06992263599fe3290c87ec00c6cb8af3748920c8 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# jan 2014 bbb garden shield attempt
# AKA
'''
Sensors:
analog level sensor, pin AIN0
TMP102 i2c temperature sensor, address 0x48
(if add0 is grounded) or 0x49 (if pulled up)
Outputs:
Analog RGB LED strip
I2C display(?)
Pump Activate/Deactivate (GPIO pin)
Some measurem... | [
"\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# jan 2014 bbb garden shield attempt\n# AKA\n\n'''\nSensors:\nanalog level sensor, pin AIN0\nTMP102 i2c temperature sensor, address 0x48\n(if add0 is grounded) or 0x49 (if pulled up)\n\n\nOutputs:\nAnalog RGB LED strip\nI2C display(?)\nPump Activate/Deactivate (GPI... | true |
5,498 | d081abf3cd9bc323486772b4f6235fbbc9022099 | '''
@mainpage Rat15S Compiler
@section intro_sec Introduction
This will become a Rat15S compiler. Currently working on Lexical Analyzer.
@author Reza Nikoopour
@author Eric Roe
'''
def main():
tokens = Lexer()
if __name__ == '__main__':
sys.path.append('Lib')
from lexicalanalyzer import Lexer
mai... | [
"'''\n@mainpage Rat15S Compiler\n\n@section intro_sec Introduction\nThis will become a Rat15S compiler. Currently working on Lexical Analyzer.\n@author Reza Nikoopour\n@author Eric Roe\n'''\ndef main():\n tokens = Lexer()\n \nif __name__ == '__main__':\n sys.path.append('Lib')\n from lexicalanalyzer im... | false |
5,499 | 2e6bce05c8ba21aa322e306d2cdb8871531d7341 | import random
OPTIONS = ['rock', 'paper', 'scissors']
def get_human_choice():
print('(1) Rock\n(2) Paper\n(3) Scissors')
return OPTIONS[int(input('Enter the number of your choice: ')) - 1]
def get_computer_choice():
return random.choice(OPTIONS)
def print_choices(human_choice, computer_choice):
p... | [
"import random\n\nOPTIONS = ['rock', 'paper', 'scissors']\n\n\ndef get_human_choice():\n print('(1) Rock\\n(2) Paper\\n(3) Scissors')\n return OPTIONS[int(input('Enter the number of your choice: ')) - 1]\n\n\ndef get_computer_choice():\n return random.choice(OPTIONS)\n\n\ndef print_choices(human_choice, co... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.