index int64 0 100k | blob_id stringlengths 40 40 | code stringlengths 7 7.27M | steps listlengths 1 1.25k | error bool 2
classes |
|---|---|---|---|---|
7,100 | d17081ef94df1e14308128341d040559edb81805 | #This file was created by Tate Hagan
from RootGUI import RootGUI
root = RootGUI()
root.mainloop() | [
"#This file was created by Tate Hagan\r\n\r\nfrom RootGUI import RootGUI\r\n\r\nroot = RootGUI()\r\nroot.mainloop()",
"from RootGUI import RootGUI\nroot = RootGUI()\nroot.mainloop()\n",
"<import token>\nroot = RootGUI()\nroot.mainloop()\n",
"<import token>\n<assignment token>\nroot.mainloop()\n",
"<import t... | false |
7,101 | f07b95a3b18aecf6cadaa8398c9158a7cd10aeeb | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 4 12:14:16 2020
@author: mdevasish
"""
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression,Lasso,Ridge
from sklearn.metrics import mean_squared_error,mean_absolute_error
from sklearn.model_selection import train_test_split
import job... | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Oct 4 12:14:16 2020\n\n@author: mdevasish\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.linear_model import LinearRegression,Lasso,Ridge\nfrom sklearn.metrics import mean_squared_error,mean_absolute_error\nfrom sklearn.model_selection import train... | false |
7,102 | d9bf58dc76d4e8d7146fac3bb2bdfb538ebf78a5 | '''import pyttsx3
#engine = pyttsx3.init()
#Conficuraรงรฃo das vozes
#voices = engine.getProperty('voices')
#engine.setProperty('voice', voices[2].id)
engine=pyttsx3.init()
voices=engine.getProperty('voices')
engine.setProperty('voice',voices[3].id)
#Falar texto
engine.say('Olรก meu nome รฉ Jarvis. Sou uma inteligรชnci... | [
"'''import pyttsx3\n\n#engine = pyttsx3.init()\n\n#Conficuraรงรฃo das vozes\n#voices = engine.getProperty('voices')\n#engine.setProperty('voice', voices[2].id)\n\nengine=pyttsx3.init()\n\nvoices=engine.getProperty('voices')\nengine.setProperty('voice',voices[3].id)\n\n#Falar texto\nengine.say('Olรก meu nome รฉ Jarvis. ... | false |
7,103 | 87f8cc65cf7d0ea932de79a6daf5b29ad387ec6f | # Generated by Selenium IDE
import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWa... | [
"# Generated by Selenium IDE\nimport pytest\nimport time\nimport json\nfrom selenium import webdriver\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.common.action_chains import ActionChains\nfrom selenium.webdriver.support import expected_conditions\nfrom selenium.webdriver.support.wait impor... | false |
7,104 | 94b3fa700d7da0ca913adeb0ad5324d1fec0be50 | import os
import pandas as pd
import numpy as np
from dataloader import *
from keras.optimizers import Adam, SGD
from mylib.models.misc import set_gpu_usage
set_gpu_usage()
from mylib.models import densesharp, metrics, losses
from keras.callbacks import ModelCheckpoint, CSVLogger, TensorBoard, EarlyStopping, ReduceL... | [
"import os\nimport pandas as pd\nimport numpy as np\n\nfrom dataloader import *\nfrom keras.optimizers import Adam, SGD\nfrom mylib.models.misc import set_gpu_usage\n\nset_gpu_usage()\n\nfrom mylib.models import densesharp, metrics, losses\nfrom keras.callbacks import ModelCheckpoint, CSVLogger, TensorBoard, EarlyS... | false |
7,105 | 0158141832423b567f252e38640e384cdf340f8b | # question 1d
# points: 6
import sys
import numpy as np
from astropy.stats import kuiper
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import handin2 as nur
def main():
seed = 8912312
np.random.seed(8912312)
u = 0
sigma = 1
cdf = nur.gaussian_cdf
num_samples = np.lo... | [
"# question 1d\n# points: 6\n\nimport sys\n\nimport numpy as np\nfrom astropy.stats import kuiper\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\n\nimport handin2 as nur\n\ndef main():\n seed = 8912312\n np.random.seed(8912312)\n u = 0\n sigma = 1\n cdf = nur.gaussian_cd... | false |
7,106 | b11210e73b403bc7a9ee24a53201ab2366ec1808 | class item():
def __init__(self,iname,itq,iup):
self.iname = iname
self.itq = itq
self.iup = iup
class store():
def __init__(self,dic):
self.dic = dic
def add(self,iname,itq,iup):
i = item(iname,itq,iup)
self.dic[iname]=[itq,iup]
def cal... | [
"class item():\r\n def __init__(self,iname,itq,iup):\r\n self.iname = iname\r\n self.itq = itq\r\n self.iup = iup\r\n\r\nclass store():\r\n def __init__(self,dic):\r\n self.dic = dic\r\n\r\n def add(self,iname,itq,iup):\r\n i = item(iname,itq,iup)\r\n self.dic[inam... | false |
7,107 | 418798369578e80ecbf82da802b23dc6ca922569 | import pickle
import select
import socket
import sys
from threading import Thread
from typing import Dict, Tuple
import pygame
from pygame.locals import *
import c
from models import *
class Game:
location: list[int, int] = [c.WIDTH / 2, c.HEIGHT / 2]
velocity: list[int, int] = [0, 0]
current_player: Pl... | [
"import pickle\nimport select\nimport socket\nimport sys\nfrom threading import Thread\nfrom typing import Dict, Tuple\n\nimport pygame\nfrom pygame.locals import *\n\nimport c\nfrom models import *\n\n\nclass Game:\n location: list[int, int] = [c.WIDTH / 2, c.HEIGHT / 2]\n velocity: list[int, int] = [0, 0]\n... | false |
7,108 | dbda5df7dff3f8acc320ffe7b9c7c279ebed2cc2 | import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE','mkrandom.settings')
import django
django.setup()
from main.models import Character, Vehicle, Tire, Glider
char_names = [
'Mario',
'Luigi',
'Peach',
'Daisy',
'Rosalina',
'Mario Tanooki',
'Peach cat',
'Yoshi',
'Yoshi (LBlue)',
... | [
"import os\nos.environ.setdefault('DJANGO_SETTINGS_MODULE','mkrandom.settings')\n\nimport django\ndjango.setup()\nfrom main.models import Character, Vehicle, Tire, Glider\nchar_names = [\n 'Mario',\n 'Luigi',\n 'Peach',\n 'Daisy',\n 'Rosalina',\n 'Mario Tanooki',\n 'Peach cat',\n 'Yoshi',\n ... | false |
7,109 | 22b697790516e1160ac501a58ad93ef5b579414a | from django.contrib.auth.decorators import permission_required
from django.db import models
from students.models import Student
# Create your models here.
class Fine(models.Model):
amount = models.DecimalField(max_digits=8, decimal_places=2, null=True, default=0)
student = models.OneToOneField(Student, on_de... | [
"from django.contrib.auth.decorators import permission_required\nfrom django.db import models\nfrom students.models import Student\n\n\n# Create your models here.\n\nclass Fine(models.Model):\n amount = models.DecimalField(max_digits=8, decimal_places=2, null=True, default=0)\n student = models.OneToOneField(... | false |
7,110 | 88e34ee5cd5af7d3b04321c4aa4fc815f926add1 | # A program to display and find the sum of a list of numbers using for loop
list=[10,20,30,40,50]
sum=0;
for i in list:
print(i)
sum=sum+i
print('sum =',sum) | [
"# A program to display and find the sum of a list of numbers using for loop\r\n\r\nlist=[10,20,30,40,50]\r\nsum=0;\r\n\r\nfor i in list:\r\n\tprint(i)\r\n\tsum=sum+i\r\nprint('sum =',sum)\t",
"list = [10, 20, 30, 40, 50]\nsum = 0\nfor i in list:\n print(i)\n sum = sum + i\nprint('sum =', sum)\n",
"<assig... | false |
7,111 | 497203be99643e2bb0087977f292f4ed890f9ead | import requests
import sqlite3
url = 'http://dummy.restapiexample.com/api/v1/employees'
r = requests.get(url)
packages_json = r.json()
# Create the employee database if it does not exist
db = sqlite3.connect('employee.sqlite')
#create the table
db.execute("CREATE TABLE IF NOT EXISTS employee (id INTEGER P... | [
"import requests\r\nimport sqlite3\r\n\r\nurl = 'http://dummy.restapiexample.com/api/v1/employees'\r\n\r\nr = requests.get(url)\r\npackages_json = r.json()\r\n\r\n# Create the employee database if it does not exist\r\ndb = sqlite3.connect('employee.sqlite')\r\n#create the table\r\ndb.execute(\"CREATE TABLE IF NOT E... | false |
7,112 | 31996699bec6507d941eb8a7aaacffbd6248d79c | # coding: utf-8
import re
import numpy as np
from sklearn.manifold import TSNE
import word2vec
from matplotlib import pyplot as plt
from adjustText import adjust_text
import nltk
'''
word2vec.word2phrase('all.txt', 'phrases.txt', verbose=True)
word2vec.word2vec('phrases.txt', 'text.bin', size=100, verbose=True)
word2ve... | [
"# coding: utf-8\nimport re\nimport numpy as np\nfrom sklearn.manifold import TSNE\nimport word2vec\nfrom matplotlib import pyplot as plt\nfrom adjustText import adjust_text\nimport nltk\n'''\nword2vec.word2phrase('all.txt', 'phrases.txt', verbose=True)\nword2vec.word2vec('phrases.txt', 'text.bin', size=100, verbos... | false |
7,113 | 7801676df91a7ded6f123113acc62f3955dfe6cb | providers = {
'provider-1': {
'name': 'provider-1',
'roles': ['licensor', 'producer'],
'description': 'This is a full description of the provider',
'url': 'https://www.provider.com'
},
'provider-2': {
'name': 'provider-2',
'roles': ['licensor'],
'descr... | [
"providers = {\n 'provider-1': {\n 'name': 'provider-1',\n 'roles': ['licensor', 'producer'],\n 'description': 'This is a full description of the provider',\n 'url': 'https://www.provider.com'\n },\n 'provider-2': {\n 'name': 'provider-2',\n 'roles': ['licensor'],\... | false |
7,114 | d3f42f329246164cdb6113df3da0eb2d3203b2a9 | import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
expansion = 1
def __init__(self, in_planes, planes, stride=1):
super(BasicBlock, self).__init__()
self.conv1 = nn.Conv2d(in_planes, planes,
kernel_size=3, stride=stri... | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass BasicBlock(nn.Module):\n expansion = 1\n\n def __init__(self, in_planes, planes, stride=1):\n super(BasicBlock, self).__init__()\n self.conv1 = nn.Conv2d(in_planes, planes,\n kernel_siz... | false |
7,115 | 7bac3b224586f8c42a104123432a7321a1251369 | function handler(event, context, callback){
var
AWS = require("aws-sdk"),
DDB = new AWS.DynamoDB({
apiVersion: "2012-08-10",
region: "us-east-1"
}),
city_str = event.city_str.toUpperCase(),
data = {
city_str: city_str,
... | [
"function handler(event, context, callback){\r\n var \r\n AWS = require(\"aws-sdk\"),\r\n DDB = new AWS.DynamoDB({\r\n apiVersion: \"2012-08-10\",\r\n region: \"us-east-1\"\r\n }),\r\n \r\n city_str = event.city_str.toUpperCase(),\r\n data = {\r\n ... | true |
7,116 | d7240703bc4cf9b566e7b50a536c83497cd8c6d7 | from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+mysqldb://sql3354595:7Haz6Ng1fm@sql3.freemysqlhosting.net/sql3354595'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SECRET_KEY'] = 'mysecret'
db = S... | [
"from flask import Flask, render_template\nfrom flask_sqlalchemy import SQLAlchemy\n\napp = Flask(__name__)\n\napp.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+mysqldb://sql3354595:7Haz6Ng1fm@sql3.freemysqlhosting.net/sql3354595'\napp.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False\napp.config['SECRET_KEY'] = 'mysec... | false |
7,117 | 3b29912788fa4cc76f34f52da7728e934ee96637 | include('f469-disco/manifest_f469.py')
freeze('src') | [
"include('f469-disco/manifest_f469.py')\nfreeze('src')",
"include('f469-disco/manifest_f469.py')\nfreeze('src')\n",
"<code token>\n"
] | false |
7,118 | f2292d1816699392663bdbf7a06c334de3b2022c | # ------------------------------------#
# Title: Mailroom Part 1
# Dev: SChang
# Date: Feb 2nd, 2019
# ChangeLog: (Who, When, What)
# SChang,02/02/2019, Created Script
# ------------------------------------#
import os
import sys
import math
donor_list = {"William Gates": [1010, 2020, 3030],
... | [
"# ------------------------------------#\n# Title: Mailroom Part 1\n# Dev: SChang\n# Date: Feb 2nd, 2019\n# ChangeLog: (Who, When, What)\n# SChang,02/02/2019, Created Script\n# ------------------------------------#\nimport os\nimport sys\nimport math\n\ndonor_list = {\"William Gates\": [1010, 2020, 30... | false |
7,119 | 2e5dbd84eb1f9cc09602df8ef8d7bdd30e1b2f26 | #encoding=utf-8
import json
import os
def get_Userid(path):
path_Divided = path.split('\\')
#print(path_Divided)
get_id= path_Divided[6].split('.')
get_id = get_id[0]
#print(get_id)
return get_id
def compose_Json_Path_ToRead(path_json_source,get_id):
json_path_to_read = path... | [
"#encoding=utf-8\r\n\r\nimport json\r\nimport os\r\n\r\ndef get_Userid(path):\r\n path_Divided = path.split('\\\\')\r\n #print(path_Divided)\r\n get_id= path_Divided[6].split('.')\r\n get_id = get_id[0]\r\n #print(get_id)\r\n return get_id\r\n\r\ndef compose_Json_Path_ToRead(path_json_source,get_i... | false |
7,120 | 45856b4c5cbf1d3b414ad769135b2d974bc0a22b | # -*- coding: utf-8 -*-
"""
Copyright (C) 2015, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import unittest
import logging
from cameo.spiderForCROWDCUBE import SpiderForCROWDCUBE
"""
ๆธฌ่ฉฆ ๆๅ CROWDCUBE
"""
class SpiderForCRO... | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCopyright (C) 2015, MuChu Hsu\nContributed by Muchu Hsu (muchu1983@gmail.com)\nThis file is part of BSD license\n\n<https://opensource.org/licenses/BSD-3-Clause>\n\"\"\"\nimport unittest\nimport logging\nfrom cameo.spiderForCROWDCUBE import SpiderForCROWDCUBE\n\"\"\"\nๆธฌ่ฉฆ ๆๅ CROWDCU... | false |
7,121 | f9cc9348d36c131aa3d34e4f78f67b008a1b565a | # coding: utf-8
"""
__author__: onur koc
"""
import numpy as np
import matplotlib.pyplot as plt
from mpldatacursor import datacursor
#optional to annotate any clicked point
# ------------
# Input values
# ------------
gamma = 23
# Specific weight of the rock mass [kN/mยณ]
H = 270
# Overburden [m]
nu ... | [
"# coding: utf-8\r\n\"\"\"\r\n__author__: onur koc\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom mpldatacursor import datacursor \r\n#optional to annotate any clicked point\r\n\r\n# ------------\r\n# Input values\r\n# ------------\r\ngamma = 23\r\n# Specific weight of the rock mass ... | false |
7,122 | a610ccf4fe154ee12de9212a10958fda2000b425 | import numpy as np
from scipy.linalg import solve
from matplotlib import pylab as plt
def f(x):
return (np.sin(x / 5) * np.exp(x / 10) + 5 * np.exp(-x / 2))
xx = np.arange(1, 15, 0.1)
yy = f(xx)
# 1 ััะตะฟะตะฝั
x = np.array([1,15])
y = f(x)
A = np.array([[1,1], [1,15]])
w = solve(A, y)
y1 = w[0] +... | [
"import numpy as np\r\nfrom scipy.linalg import solve\r\nfrom matplotlib import pylab as plt\r\n\r\ndef f(x):\r\n return (np.sin(x / 5) * np.exp(x / 10) + 5 * np.exp(-x / 2))\r\n\r\nxx = np.arange(1, 15, 0.1)\r\nyy = f(xx)\r\n\r\n# 1 ััะตะฟะตะฝั\r\nx = np.array([1,15])\r\ny = f(x)\r\n\r\nA = np.array([[1,1], [1,15]]... | false |
7,123 | d52b6dda7111aefb7f9a7b10ad606cda615389d9 | import time
class Solution(object):
def __init__(self):
self.n = None
self.memory = dict()
def dfs(self, bottom, energy):
# optimize for memory, save search time for duplicate results
if (bottom,energy) in self.memory:
return self.memory[(bottom,energy)]
... | [
"import time\nclass Solution(object):\n def __init__(self):\n self.n = None\n self.memory = dict()\n \n def dfs(self, bottom, energy):\n # optimize for memory, save search time for duplicate results\n if (bottom,energy) in self.memory:\n return self.memory[(bottom,ene... | false |
7,124 | 12c3fe8a3ca1e660eeb90b16eca17eddd47e5de7 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-10-28 17:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('KYusers', '0017_caprofile_regs'),
]
operations = [
migrations.AddField(
... | [
"# -*- coding: utf-8 -*-\n# Generated by Django 1.9.8 on 2016-10-28 17:08\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('KYusers', '0017_caprofile_regs'),\n ]\n\n operations = [\n migrat... | false |
7,125 | c9d25460022bb86c821600dfaed17baa70531c9f | from django.test import TestCase, Client
from django.contrib.auth.models import User
from blog.factories import BlogPostFactory, TagFactory
from blog.models import BlogPost
from faker import Factory
faker = Factory.create()
class ServicesTests(TestCase):
def setUp(self):
self.tag = TagFactory()
... | [
"from django.test import TestCase, Client\nfrom django.contrib.auth.models import User\nfrom blog.factories import BlogPostFactory, TagFactory\nfrom blog.models import BlogPost\n\nfrom faker import Factory\n\nfaker = Factory.create()\n\n\nclass ServicesTests(TestCase):\n def setUp(self):\n self.tag = TagF... | false |
7,126 | 46194829fc54c2f3e51febde572e05bcff261fb2 | # line_count.py
import sys
count = 0
for line in sys.stdin:
count += 1
# print goes to sys.stdout
print count | [
"# line_count.py\nimport sys\ncount = 0\nfor line in sys.stdin:\n\tcount += 1\n# print goes to sys.stdout\nprint count"
] | true |
7,127 | 1a710916461644a0676a3bd84926aeabb2aa3f71 | # coding: utf-8
def init_list():
print("=== init_list ===")
l = list()
print(l)
l2 = []
print(l2)
l3 = list((1, 2))
print(l3)
l4 = [1, 2]
print(l4)
def insert_append_and_extend_list():
print("=== insert_append_and_extend_list ===")
l = ['e', 'h']
l.insert(-1, 'g')
... | [
"# coding: utf-8\n\n\ndef init_list():\n print(\"=== init_list ===\")\n l = list()\n print(l)\n l2 = []\n print(l2)\n l3 = list((1, 2))\n print(l3)\n l4 = [1, 2]\n print(l4)\n\n\ndef insert_append_and_extend_list():\n print(\"=== insert_append_and_extend_list ===\")\n l = ['e', 'h']... | false |
7,128 | 7d43b20ebee2f4cd509bbd896c9e6ae8b2c4b354 | #!/usr/bin/env python3
import torch
import torch.nn as nn
import torch.nn.functional as F
import pytorch_lightning as pl
import torchmetrics
class BaselineModule(pl.LightningModule):
def __init__(self, input_size, num_classes=4, lr=3e-4):
super().__init__()
self.backbone = nn.Sequential( # CBR-Ti... | [
"#!/usr/bin/env python3\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport pytorch_lightning as pl\nimport torchmetrics\n\nclass BaselineModule(pl.LightningModule):\n def __init__(self, input_size, num_classes=4, lr=3e-4):\n super().__init__()\n\n self.backbone = nn.Seq... | false |
7,129 | 0b05b027e3c3147aa2b9c35a0bdc33633ba6e658 | #!/usr/bin/env python3
"""Shannon entropy and P affinities"""
import numpy as np
def HP(Di, beta):
"""
Function that calculates shannon entropy
"""
P = np.exp(-Di * beta)
sumP = np.sum(P)
Pi = P / sumP
Hi = -np.sum(Pi * np.log2(Pi))
return (Hi, Pi)
| [
"#!/usr/bin/env python3\n\"\"\"Shannon entropy and P affinities\"\"\"\n\nimport numpy as np\n\n\ndef HP(Di, beta):\n \"\"\"\n Function that calculates shannon entropy\n \"\"\"\n P = np.exp(-Di * beta)\n sumP = np.sum(P)\n Pi = P / sumP\n Hi = -np.sum(Pi * np.log2(Pi))\n return (Hi, Pi)\n",
... | false |
7,130 | bb173d8869039f8bbd3e35529cf2d99b26d2b8ff | #!/usr/bin/env python3
import argparse
from speaker.main import run
def parse_args():
parser = argparse.ArgumentParser(description='Network speaker device.')
parser.add_argument('-d', '--debug', action='store_true',
help='enable debugging messages')
parser.add_argument('--host', t... | [
"#!/usr/bin/env python3\n\nimport argparse\nfrom speaker.main import run\n\n\ndef parse_args():\n parser = argparse.ArgumentParser(description='Network speaker device.')\n parser.add_argument('-d', '--debug', action='store_true',\n help='enable debugging messages')\n parser.add_argum... | false |
7,131 | 27976e9f7fbe030910b3595ea1a13e0e505183e5 | #!/software/python-2.7-2014q3-el6-x86_64/bin/python
import SNANA_Reader as simread
import REAL_Reader as dataread
#import astropy.cosmology as cosmo
import traceback
import scipy
import scipy.stats as stats
import numpy as np
import matplotlib.pyplot as plt
plt.switch_backend('Agg')
#import Cosmology
import scipy.stats... | [
"#!/software/python-2.7-2014q3-el6-x86_64/bin/python\nimport SNANA_Reader as simread\nimport REAL_Reader as dataread\n#import astropy.cosmology as cosmo\nimport traceback\nimport scipy\nimport scipy.stats as stats\nimport numpy as np\nimport matplotlib.pyplot as plt\nplt.switch_backend('Agg')\n#import Cosmology\nim... | true |
7,132 | b6a0a49e05fbc0ac7673d6c9e8ca4d263c8bb5cd | # Generated by Django 2.2.17 on 2020-12-05 07:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='identification',
name='id_card_img',... | [
"# Generated by Django 2.2.17 on 2020-12-05 07:43\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('service', '0001_initial'),\n ]\n\n operations = [\n migrations.AlterField(\n model_name='identification',\n ... | false |
7,133 | a444e215b64b3a2d7f736e38227b68c1a1b952a0 | import os
import platform
import _winreg
def gid(x):
find=x
winreg = _winreg
REG_PATH1 = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
REG_PATH2 = r"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
registry_key = winreg.OpenKey( winreg.HKEY_LOCAL_MACHINE, REG_PATH1, 0, win... | [
"import os\nimport platform\nimport _winreg\n\n\ndef gid(x):\n find=x\n winreg = _winreg\n REG_PATH1 = r\"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\"\n REG_PATH2 = r\"SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\"\n registry_key = winreg.OpenKey( winreg.HKEY_LOCA... | true |
7,134 | 6dbafbcf126c37edb2187eb28c01e2c1125c1c64 | import sys, os; sys.path.insert(0,'..'); sys.path.insert(0,'../NEURON');
from tests.cells.NEURONCellTest import NEURONCellTest
from tests.cells.NeuroMLCellTest import NeuroMLCellTest
class NEURON(NEURONCellTest):
def __init__(self):
super(NEURON, self).__init__()
self.path = "../NEURON/... | [
"import sys, os; sys.path.insert(0,'..'); sys.path.insert(0,'../NEURON');\r\nfrom tests.cells.NEURONCellTest import NEURONCellTest\r\nfrom tests.cells.NeuroMLCellTest import NeuroMLCellTest\r\n\r\nclass NEURON(NEURONCellTest):\r\n\r\n def __init__(self):\r\n super(NEURON, self).__init__()\r\n\r\n ... | false |
7,135 | 3727c4413cd69305c8ee8d02f4532629da7d25de | def twenty():
pass | [
"def twenty():\n\tpass",
"def twenty():\n pass\n",
"<function token>\n"
] | false |
7,136 | 10e1756dc1d6c7b6b7e3569de78e9fa4cdfb0d7e | #-*- coding: UTF-8 -*-
import re
import time
import sys
import command.server.handle_utility as Utility
from ee.common import logger
from ee.common import xavier as Xavier1
sys.path.append('/opt/seeing/app/')
from b31_bp import xavier1 as Xavier2
global agv
agv=sys.argv[1]
Xavier=Xavier1
xavier_module = {"tcp:7801":Xa... | [
"#-*- coding: UTF-8 -*-\nimport re\nimport time\nimport sys\nimport command.server.handle_utility as Utility\nfrom ee.common import logger\nfrom ee.common import xavier as Xavier1\nsys.path.append('/opt/seeing/app/')\nfrom b31_bp import xavier1 as Xavier2\n\nglobal agv\nagv=sys.argv[1]\nXavier=Xavier1\nxavier_modul... | false |
7,137 | 3344eb5b3e5b5eaee7b08d0991be732dae62c7fc | import io
from PIL import Image
def bytes_from_file(path, size, quality=15):
img = Image.open(path)
img = img.resize(size)
img_byte_arr = io.BytesIO()
img.save(img_byte_arr, format="JPEG", quality=quality)
return img_byte_arr.getvalue()
| [
"import io\nfrom PIL import Image\n\ndef bytes_from_file(path, size, quality=15):\n img = Image.open(path)\n img = img.resize(size)\n\n img_byte_arr = io.BytesIO()\n img.save(img_byte_arr, format=\"JPEG\", quality=quality)\n return img_byte_arr.getvalue()\n",
"import io\nfrom PIL import Image\n\n\n... | false |
7,138 | 721e014bc5bf53a39556e31f281b77b90508cf12 | # -*- Python -*-
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# California Institute of Technology
# (C) 2008 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
... | [
"# -*- Python -*-\n#\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n#\n# California Institute of Technology\n# (C) 2008 All Rights Reserved\n#\n# {LicenseText}\n#\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | false |
7,139 | 3d3b77630d275f830daf9f6e0d50a77ef624521e | # Midterm Review Class!
'''
This is a Multi line comment:
'''
# Break and Continue
# for i in range(10):
# if i == 5:
# continue
# print(i)
# Prints 0-4, 6-9
# # Structure
# Some MCQ
# Some T/F
# Some short answer
# # Lists
# Append
# remove
# del
# ... | [
"# Midterm Review Class!\n\n'''\nThis is a Multi line comment:\n'''\n\n# Break and Continue\n # for i in range(10):\n # if i == 5:\n # continue\n # print(i)\n # Prints 0-4, 6-9\n\n# # Structure\n # Some MCQ\n # Some T/F\n # Some short answer\n\n# # Lists\n# Append\n# ... | false |
7,140 | d5f66d92371838c703abbf80e2b78717cdd4a4fb | from django.shortcuts import render
from django.http import HttpResponse
# from appTwo.models import User
from appTwo.forms import NewUserForm
# Create your views here.
# def index(request):
# return HttpResponse("<em>My Second Project</em>")
def welcome(request):
# welcomedict={'welcome_insert':'Go to /user... | [
"from django.shortcuts import render\nfrom django.http import HttpResponse\n# from appTwo.models import User\nfrom appTwo.forms import NewUserForm\n# Create your views here.\n\n\n# def index(request):\n# return HttpResponse(\"<em>My Second Project</em>\")\n\ndef welcome(request):\n # welcomedict={'welcome_in... | false |
7,141 | c0524301a79788aa34a039fc46799021fb45362c | import random
from common.ast import *
from mutate.mutate_ctrl import *
def _check_parent_type(node, nodes, types):
par = node
while(nodes[par] != None):
par = nodes[par]
if type(par) in types:
return True
return False
def mutate_operator(root, nodes, path):
candidates = [... | [
"import random\n\nfrom common.ast import *\nfrom mutate.mutate_ctrl import *\n\ndef _check_parent_type(node, nodes, types):\n par = node\n while(nodes[par] != None):\n par = nodes[par]\n if type(par) in types:\n return True\n return False\n\ndef mutate_operator(root, nodes, path):\... | false |
7,142 | 0ae626df5a471af77f7361bb765b46b861ee8a2c | # terrascript/spotinst/__init__.py
import terrascript
class spotinst(terrascript.Provider):
pass | [
"# terrascript/spotinst/__init__.py\n\nimport terrascript\n\nclass spotinst(terrascript.Provider):\n pass",
"import terrascript\n\n\nclass spotinst(terrascript.Provider):\n pass\n",
"<import token>\n\n\nclass spotinst(terrascript.Provider):\n pass\n",
"<import token>\n<class token>\n"
] | false |
7,143 | cc097b4d2a5a521a0adb83ca1b58470b4ce84f39 | '''
Copyright
Jelen forrรกskรณd a Budapesti Mลฑszaki รฉs Gazdasรกgtudomรกnyi Egyetemen tartott
"Deep Learning a gyakorlatban Python รฉs LUA alapon" tantรกrgy segรฉdanyagakรฉnt kรฉszรผlt.
A tantรกrgy honlapja: http://smartlab.tmit.bme.hu/oktatas-deep-learning
Deep Learning kutatรกs: http://smartlab.tmit.bme.hu/deep-learning
A forr... | [
"'''\nCopyright\n\nJelen forrรกskรณd a Budapesti Mลฑszaki รฉs Gazdasรกgtudomรกnyi Egyetemen tartott\n\"Deep Learning a gyakorlatban Python รฉs LUA alapon\" tantรกrgy segรฉdanyagakรฉnt kรฉszรผlt.\n\nA tantรกrgy honlapja: http://smartlab.tmit.bme.hu/oktatas-deep-learning\nDeep Learning kutatรกs: http://smartlab.tmit.bme.hu/deep-le... | false |
7,144 | 899cdb5cbdbd0a57af76a5044d54e1fe2a497847 | '''
Created on Jan 19, 2014
@author: felix
'''
import sys
from PyPDF2 import PdfFileReader
from pytagcloud import create_tag_image, make_tags, LAYOUT_HORIZONTAL
from pytagcloud.lang.counter import get_tag_counts
def main():
for i in range(0, len(sys.argv)):
if (sys.argv[i] == '-f'):
try:
... | [
"'''\nCreated on Jan 19, 2014\n\n@author: felix\n'''\nimport sys\nfrom PyPDF2 import PdfFileReader\nfrom pytagcloud import create_tag_image, make_tags, LAYOUT_HORIZONTAL\nfrom pytagcloud.lang.counter import get_tag_counts\n\ndef main():\n for i in range(0, len(sys.argv)):\n if (sys.argv[i] == '-f'):\n ... | true |
7,145 | eb3a32c17d8e5e9f717e813d5612d077c8feac48 | import sys
import time
from cli.utils import get_container_runtime, get_containers, run_shell_cmd
runtime = get_container_runtime()
def rm(ids):
cmd = f'{runtime} rm {" ".join(ids)}'
sys.stdout.write(f'{cmd}\n')
run_shell_cmd(cmd)
def stop(ids):
cmd = f'{runtime} stop {" ".join(ids)}'
sys.stdout... | [
"import sys\nimport time\nfrom cli.utils import get_container_runtime, get_containers, run_shell_cmd\n\nruntime = get_container_runtime()\n\ndef rm(ids):\n cmd = f'{runtime} rm {\" \".join(ids)}'\n sys.stdout.write(f'{cmd}\\n')\n run_shell_cmd(cmd)\n\n\ndef stop(ids):\n cmd = f'{runtime} stop {\" \".joi... | false |
7,146 | de24b341102f5979cc48b22c3a07d42915b6dd18 | from .tokening import sign_profile_tokens, validate_token_record, \
get_profile_from_tokens
from .zone_file import create_zone_file
from .legacy import is_profile_legacy_format, get_person_from_legacy_format
| [
"from .tokening import sign_profile_tokens, validate_token_record, \\\n get_profile_from_tokens\nfrom .zone_file import create_zone_file\nfrom .legacy import is_profile_legacy_format, get_person_from_legacy_format \n",
"from .tokening import sign_profile_tokens, validate_token_record, get_profile_from_tokens\n... | false |
7,147 | b46f19708e9e2a1be2bbd001ca6341ee7468a60d | #!/usr/bin/env python
# coding:utf-8
"""
200. ๅฒๅฑฟๆฐ้
้พๅบฆ
ไธญ็ญ
็ปๅฎไธไธช็ฑ '1'๏ผ้ๅฐ๏ผๅ '0'๏ผๆฐด๏ผ็ปๆ็็ไบ็ปด็ฝๆ ผ๏ผ่ฎก็ฎๅฒๅฑฟ็ๆฐ้ใไธไธชๅฒ่ขซๆฐดๅ
ๅด๏ผๅนถไธๅฎๆฏ้่ฟๆฐดๅนณๆนๅๆๅ็ดๆนๅไธ็ธ้ป็้ๅฐ่ฟๆฅ่ๆ็ใไฝ ๅฏไปฅๅ่ฎพ็ฝๆ ผ็ๅไธช่พนๅ่ขซๆฐดๅ
ๅดใ
็คบไพ 1:
่พๅ
ฅ:
11110
11010
11000
00000
่พๅบ: 1
็คบไพ 2:
่พๅ
ฅ:
11000
11000
00100
00011
่พๅบ: 3
"""
# ===============================================================================... | [
"#!/usr/bin/env python\n# coding:utf-8\n\n\"\"\"\n200. ๅฒๅฑฟๆฐ้\n้พๅบฆ\nไธญ็ญ\n\n็ปๅฎไธไธช็ฑ '1'๏ผ้ๅฐ๏ผๅ '0'๏ผๆฐด๏ผ็ปๆ็็ไบ็ปด็ฝๆ ผ๏ผ่ฎก็ฎๅฒๅฑฟ็ๆฐ้ใไธไธชๅฒ่ขซๆฐดๅ
ๅด๏ผๅนถไธๅฎๆฏ้่ฟๆฐดๅนณๆนๅๆๅ็ดๆนๅไธ็ธ้ป็้ๅฐ่ฟๆฅ่ๆ็ใไฝ ๅฏไปฅๅ่ฎพ็ฝๆ ผ็ๅไธช่พนๅ่ขซๆฐดๅ
ๅดใ\n\n็คบไพ 1:\n\n่พๅ
ฅ:\n11110\n11010\n11000\n00000\n\n่พๅบ: 1\n็คบไพ 2:\n\n่พๅ
ฅ:\n11000\n11000\n00100\n00011\n\n่พๅบ: 3\n\"\"\"\n# =======================================... | false |
7,148 | f1e335d0187aeb78d857bc523eb33221fd2e7e6d |
def most_expensive_item(products):
return max(products.items(), key=lambda p: p[1])[0]
| [
"\ndef most_expensive_item(products):\n return max(products.items(), key=lambda p: p[1])[0]\n\n",
"def most_expensive_item(products):\n return max(products.items(), key=lambda p: p[1])[0]\n",
"<function token>\n"
] | false |
7,149 | e2671911894871c32ad933fde8e05c913a4cc942 | from django.urls import path
from . import views
from .views import propertyForRent, propertyForSale, PropertyDetailView
app_name = "core"
urlpatterns = [
path("", views.index, name="home"),
path("property_for_rent/", views.propertyForRent, name="property_rent"),
path("property_for_sale/", views.propertyF... | [
"from django.urls import path\nfrom . import views\nfrom .views import propertyForRent, propertyForSale, PropertyDetailView\n\napp_name = \"core\"\n\nurlpatterns = [\n path(\"\", views.index, name=\"home\"),\n path(\"property_for_rent/\", views.propertyForRent, name=\"property_rent\"),\n path(\"property_fo... | false |
7,150 | 09ea684cfb6f0a521d3bdadf977d9385636bdc83 | from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
path('', views.PostList.as_view(), name='blog_index'),
path('<slug:slug>/', views.post_detail, name='post_detail'),
path('tag/<slug:slug>/', views.TagIndexView.as_vi... | [
"from django.urls import path\nfrom django.conf import settings\nfrom django.conf.urls.static import static\n\nfrom . import views\n\nurlpatterns = [\n path('', views.PostList.as_view(), name='blog_index'),\n path('<slug:slug>/', views.post_detail, name='post_detail'),\n path('tag/<slug:slug>/', views.TagI... | false |
7,151 | 81f75498afcca31e38ea7856c81c291af3ef6673 | import urllib2
import csv
from bs4 import BeautifulSoup
url = {
"Home ": 'https://www.moneycontrol.com/',
# "Market": 'https://www.moneycontrol.com/stocksmarketsindia/',
# "Mf Home": 'https://www.moneycontrol.com/mutualfundindia/'
}
def get_last_element_timestamp(url):
conn = urllib2.urlopen(url)
html ... | [
"import urllib2\nimport csv\nfrom bs4 import BeautifulSoup\nurl = {\n \"Home \": 'https://www.moneycontrol.com/',\n# \"Market\": 'https://www.moneycontrol.com/stocksmarketsindia/',\n# \"Mf Home\": 'https://www.moneycontrol.com/mutualfundindia/'\n}\ndef get_last_element_timestamp(url):\n conn = urllib2.ur... | false |
7,152 | 3c2873add66172a5ed038949c31d514dcd5f26b3 | # -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, thi... | [
"# -*-coding:utf-8 -*\n\n# Copyright (c) 2011-2015, Intel Corporation\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification,\n# are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyrigh... | true |
7,153 | 62857a015087500fec534ba1297d42a33ae61927 | import testr
import testg
import time
def run():
parser = testg.OptionParser(description='Autonomous grasp and manipulation planning example.')
parser.add_option('--scene',
action="store",type='string',dest='scene',default='/home/user/experiment/data/lab1.env.xml',
h... | [
"import testr\nimport testg\nimport time\n\ndef run():\n parser = testg.OptionParser(description='Autonomous grasp and manipulation planning example.')\n parser.add_option('--scene',\n action=\"store\",type='string',dest='scene',default='/home/user/experiment/data/lab1.env.xml',\n ... | false |
7,154 | 6b731e329eec3947a17ef8ee8280f2ddf980c81c | print("Praktikum Programa Komputer ")
print("Exercise 7.21")
print("")
print("===========================")
print("Nama : Ivanindra Rizky P")
print("NIM : I0320054")
print("")
print("===========================")
print("")
import random
a = [23, 45, 98, 36]
print('a = ', a)
print('random 1')
print('choice ... | [
"print(\"Praktikum Programa Komputer \")\r\nprint(\"Exercise 7.21\")\r\nprint(\"\")\r\nprint(\"===========================\")\r\nprint(\"Nama : Ivanindra Rizky P\")\r\nprint(\"NIM : I0320054\")\r\nprint(\"\")\r\nprint(\"===========================\")\r\nprint(\"\")\r\nimport random\r\na = [23, 45, 98, 36]\r\nprint(... | false |
7,155 | 49492ad1a1734be02ebefb77095fd560a7a7efd8 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import airflow
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.operators import BashOperator, DummyOperator
from datetime import datetime, timedelta
# -----------------------------------------------------... | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport logging\nimport airflow\n\nfrom airflow import DAG\nfrom airflow.operators.python_operator import PythonOperator\nfrom airflow.operators import BashOperator, DummyOperator\n\nfrom datetime import datetime, timedelta\n\n\n# -----------------------------------... | false |
7,156 | c2d8e34ab0b449a971c920fc86f259f093f16cc5 | import sys, os
sys.path.append(os.pardir) # ่ฆชใใฃใฌใฏใใชใฎใใกใคใซใใคใณใใผใใใใใใฎ่จญๅฎ
import numpy as np
from dataset.mnist import load_mnist
from controller import Controller
# ใใผใฟใฎ่ชญใฟ่พผใฟ
(x_train, t_train), (x_test, t_test) = load_mnist(normalize=True, one_hot_label=True)
# instance
controller = Controller()
# accuracy
trycount = ... | [
"import sys, os\nsys.path.append(os.pardir) # ่ฆชใใฃใฌใฏใใชใฎใใกใคใซใใคใณใใผใใใใใใฎ่จญๅฎ\nimport numpy as np\nfrom dataset.mnist import load_mnist\nfrom controller import Controller\n\n# ใใผใฟใฎ่ชญใฟ่พผใฟ\n(x_train, t_train), (x_test, t_test) = load_mnist(normalize=True, one_hot_label=True)\n\n# instance\ncontroller = Controller()\n\n# acc... | false |
7,157 | d3a22cad850e895950ce322aac393b31758a2237 | def SimpleSymbols(str):
if str[0].isalpha() and str[-1].isalpha():
return "false"
for i in range(0, len(str)):
if str[i].isalpha():
if str[i-1] == '+' and str[i+1] == '+':
return "true"
return "false"
# keep this function call here
# to see how to enter arguments in Python scrol... | [
"def SimpleSymbols(str): \n if str[0].isalpha() and str[-1].isalpha():\n return \"false\"\n for i in range(0, len(str)):\n if str[i].isalpha():\n if str[i-1] == '+' and str[i+1] == '+':\n return \"true\"\n return \"false\"\n \n \n# keep this function call here \n# to see how to enter arg... | true |
7,158 | 634c826d30b22c6061531c514914e9ca62b21605 | for row in range(7):
for col in range(5):
if (col == 0) or (row % 3 == 0):
print("*", end=" ")
else:
print(" ", end=" ")
print()
| [
"for row in range(7):\r\n for col in range(5):\r\n if (col == 0) or (row % 3 == 0):\r\n print(\"*\", end=\" \")\r\n else:\r\n print(\" \", end=\" \")\r\n print()\r\n",
"for row in range(7):\n for col in range(5):\n if col == 0 or row % 3 == 0:\n print... | false |
7,159 | 41e642c4acb212470577ef43908a1dcf2e0f5730 | import glob
from collections import defaultdict
from stylalto.datasets.extractor import read_alto_for_training, extract_images_from_bbox_dict_for_training, split_dataset
data = defaultdict(list)
images = {}
for xml_path in glob.glob("./input/**/*.xml", recursive=True):
current, image = read_alto_for_training(xml_... | [
"import glob\nfrom collections import defaultdict\nfrom stylalto.datasets.extractor import read_alto_for_training, extract_images_from_bbox_dict_for_training, split_dataset\n\n\ndata = defaultdict(list)\nimages = {}\nfor xml_path in glob.glob(\"./input/**/*.xml\", recursive=True):\n current, image = read_alto_fo... | false |
7,160 | e4b49faaad648c6e85274abb18f994083a74013d | import numpy as np
catogory = np.array([50,30,40,20])
data = np.array([
[20,50,10,15,20],
[30,40,20,65,35],
[75,30,42,70,45],
[40,25,35,22,55]])
print(catogory)
print(data)
print(catogory.dot(data))
print(data.T.dot(catogory))
| [
"import numpy as np\n\ncatogory = np.array([50,30,40,20])\n\ndata = np.array([\n[20,50,10,15,20],\n[30,40,20,65,35],\n[75,30,42,70,45],\n[40,25,35,22,55]])\n\nprint(catogory)\nprint(data)\nprint(catogory.dot(data))\nprint(data.T.dot(catogory))\n",
"import numpy as np\ncatogory = np.array([50, 30, 40, 20])\ndata =... | false |
7,161 | 45f9d5ac0fa7d9259c1d53b92c030559f3bfda89 | #-*- coding: utf8 -*-
#Programa: 04-palindromo
#Objetivo:Un Numero Palindromo es aquel numero que se lee igual, de izquierda a derecha y viceversa
#El palindromo mas grande que se pued obtener por el producto de dos numeos de dos digitos
# es: 9009 que es igual a 91x99.
#Encuentre el pali... | [
"#-*- coding: utf8 -*-\n#Programa: 04-palindromo\n#Objetivo:Un Numero Palindromo es aquel numero que se lee igual, de izquierda a derecha y viceversa\n #El palindromo mas grande que se pued obtener por el producto de dos numeos de dos digitos \n # es: 9009 que es igual a 91x99.\n #Encuent... | false |
7,162 | badbfdbdeb8b4fd40b1c44bf7dcff6457a0c8795 | def get_value(li, row, column):
if row < 0 or column < 0:
return 0
try:
return li[row][column]
except IndexError:
return 0
n = int(input())
results = {}
for asdf in range(n):
table = []
title, rows, columns = input().split()
rows = int(rows)
columns =... | [
"def get_value(li, row, column):\r\n if row < 0 or column < 0:\r\n return 0\r\n try:\r\n return li[row][column]\r\n except IndexError:\r\n return 0\r\n\r\n\r\nn = int(input())\r\nresults = {}\r\nfor asdf in range(n):\r\n table = []\r\n title, rows, columns = input().split()\r\n ... | false |
7,163 | 2df2cccc22aba2104ab15820e13d304addf83f63 | """slack_utils.py: slack-specific utilities"""
from os import path
import pprint
HERE = path.abspath(path.dirname(__file__))
PP = pprint.PrettyPrinter(indent=2)
def parse_slack_message_object(message_obj):
"""parse user_name/channel_name out of slack controller
Notes:
`slackbot.message`.keys(): [type... | [
"\"\"\"slack_utils.py: slack-specific utilities\"\"\"\nfrom os import path\nimport pprint\n\nHERE = path.abspath(path.dirname(__file__))\nPP = pprint.PrettyPrinter(indent=2)\n\ndef parse_slack_message_object(message_obj):\n \"\"\"parse user_name/channel_name out of slack controller\n\n Notes:\n `slackb... | false |
7,164 | 845d04312abc0e64a7810b52bbee333d2bdf3dfb | from torch import Tensor
from torch.autograd import Variable
from torch.optim import Adam
from maac.utils.misc import hard_update, onehot_from_logits
from maac.utils.policies import DiscretePolicy
class AttentionAgent(object):
"""
General class for Attention agents (policy, target policy)
"""
def __i... | [
"from torch import Tensor\nfrom torch.autograd import Variable\nfrom torch.optim import Adam\nfrom maac.utils.misc import hard_update, onehot_from_logits\nfrom maac.utils.policies import DiscretePolicy\n\n\nclass AttentionAgent(object):\n \"\"\"\n General class for Attention agents (policy, target policy)\n ... | false |
7,165 | 397d9b1030a1ec08d04d2101f65a83547495b861 | import numpy as np
import cv2
import os
from moviepy.editor import *
N = 1
# Initiate SIFT detector
sift = cv2.xfeatures2d.SIFT_create()
# count file number in folder frames
list = os.listdir('./frames')
number_files = len(list)
# array to store similarity of 2 consecutive frames
similarity = []
boundaries = []
ke... | [
"import numpy as np\nimport cv2\nimport os\nfrom moviepy.editor import *\n\nN = 1\n# Initiate SIFT detector\nsift = cv2.xfeatures2d.SIFT_create()\n\n# count file number in folder frames\nlist = os.listdir('./frames')\nnumber_files = len(list)\n\n# array to store similarity of 2 consecutive frames\nsimilarity = []\n... | false |
7,166 | 55252fc78c67e48c64e777e4c3a713c898312b81 | import pyenttec, math, time
global port
MAX = 60
panels = [408, 401, 404, 16]
def render():
port.render()
def setColor(panel, color):
if panels[panel]:
port.set_channel(panels[panel] - 1, color[0])
port.set_channel(panels[panel], color[1])
port.set_channel(panels[panel] + 1, color[2... | [
"import pyenttec, math, time\n\nglobal port\n\nMAX = 60\n\npanels = [408, 401, 404, 16]\n\ndef render():\n port.render()\n\ndef setColor(panel, color):\n if panels[panel]:\n port.set_channel(panels[panel] - 1, color[0])\n port.set_channel(panels[panel], color[1])\n port.set_channel(panels... | false |
7,167 | 0ac9e757fa827b311487169d0dc822951ce8c4bb | #!/usr/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
evaluate-gbvi.py
Evaluate the GBVI model on hydration free energies of small molec... | [
"#!/usr/bin/env python\n\n#=============================================================================================\n# MODULE DOCSTRING\n#=============================================================================================\n\n\"\"\"\nevaluate-gbvi.py\n\nEvaluate the GBVI model on hydration free energi... | true |
7,168 | 7e328992392a4ff2b0e23920a8907e38f63fcff0 | from django.contrib import admin
from .models import Game, Scrap
admin.site.register(Game)
admin.site.register(Scrap)
| [
"from django.contrib import admin\n\nfrom .models import Game, Scrap\n\nadmin.site.register(Game)\nadmin.site.register(Scrap)\n",
"from django.contrib import admin\nfrom .models import Game, Scrap\nadmin.site.register(Game)\nadmin.site.register(Scrap)\n",
"<import token>\nadmin.site.register(Game)\nadmin.site.r... | false |
7,169 | acd6197e60cf59ffcaa33bb50a60a03592bb3559 | #! /usr/bin/python3
from scapy.all import *
import sys
ip=IP(src=sys.argv[1], dst=sys.argv[2])
syn_packet = TCP(sport=52255, dport=1237, flags="S", seq=100, options=[('MSS',689),('WScale',1)])
synack_packet = sr1(ip/syn_packet)
my_ack = synack_packet.seq+1
ack_packet = TCP(sport=52255, dport=1237, flags="A", seq=101,... | [
"#! /usr/bin/python3\n\nfrom scapy.all import *\nimport sys\n\nip=IP(src=sys.argv[1], dst=sys.argv[2])\nsyn_packet = TCP(sport=52255, dport=1237, flags=\"S\", seq=100, options=[('MSS',689),('WScale',1)])\nsynack_packet = sr1(ip/syn_packet)\nmy_ack = synack_packet.seq+1\nack_packet = TCP(sport=52255, dport=1237, fla... | false |
7,170 | 3941f283893c259033d7fb3be83c8071433064ba | from output.models.nist_data.list_pkg.nmtokens.schema_instance.nistschema_sv_iv_list_nmtokens_min_length_5_xsd.nistschema_sv_iv_list_nmtokens_min_length_5 import NistschemaSvIvListNmtokensMinLength5
obj = NistschemaSvIvListNmtokensMinLength5(
value=[
"f",
"D",
"T",
"a",
"b"... | [
"from output.models.nist_data.list_pkg.nmtokens.schema_instance.nistschema_sv_iv_list_nmtokens_min_length_5_xsd.nistschema_sv_iv_list_nmtokens_min_length_5 import NistschemaSvIvListNmtokensMinLength5\n\n\nobj = NistschemaSvIvListNmtokensMinLength5(\n value=[\n \"f\",\n \"D\",\n \"T\",\n ... | false |
7,171 | 7700e3c4061f0e81a1dea8fa8b27a0380fc26e71 | #!/usr/bin/env python
#
# Copyright (C) University College London, 2007-2012, all rights reserved.
#
# This file is part of HemeLB and is CONFIDENTIAL. You may not work
# with, install, use, duplicate, modify, redistribute or share this
# file, or any part thereof, other than as allowed by any agreement
# specifical... | [
"#!/usr/bin/env python\n# \n# Copyright (C) University College London, 2007-2012, all rights reserved.\n# \n# This file is part of HemeLB and is CONFIDENTIAL. You may not work \n# with, install, use, duplicate, modify, redistribute or share this\n# file, or any part thereof, other than as allowed by any agreement\n... | false |
7,172 | a6365104125725f11010c35eb0781c941de803f8 | import pandas
import evaluation
import sys
sys.path.append('D:\\libs\\xgboost\\wrapper')
import xgboost as xgb
# Read training data
folder = '../data/'
train = pandas.read_csv(folder + 'training.csv', index_col='id')
# Define features to drop from train data
# variables_to_drop = ['mass', 'production', 'min_ANNmuon'... | [
"import pandas\nimport evaluation\nimport sys\n\nsys.path.append('D:\\\\libs\\\\xgboost\\\\wrapper')\nimport xgboost as xgb\n\n# Read training data\nfolder = '../data/'\ntrain = pandas.read_csv(folder + 'training.csv', index_col='id')\n\n# Define features to drop from train data\n# variables_to_drop = ['mass', 'pro... | true |
7,173 | 8419aee5dbc64b51f3c0f364716aad1630f00fe9 | import sys, os, json
sys.path.append(os.path.join(os.path.dirname(__file__), "requests"))
import requests
def findNonPrefixes(prefix, array):
result = []
prefixLength = len(prefix)
for string in array:
if string[0:prefixLength] != prefix:
result.append(string)
return result
def run ():
r = requests.post("... | [
"import sys, os, json\nsys.path.append(os.path.join(os.path.dirname(__file__), \"requests\"))\nimport requests \n\ndef findNonPrefixes(prefix, array):\n\tresult = []\n\tprefixLength = len(prefix)\n\tfor string in array:\n\t\tif string[0:prefixLength] != prefix: \n\t\t\tresult.append(string)\n\treturn result\n\ndef ... | false |
7,174 | ae8add3adc336c9404cd2aeab4aff81c94c8884e | from django.contrib.auth.forms import UserChangeForm
from django.contrib.auth.models import User
from django import forms
class editForm(forms.ModelForm):
username = forms.CharField(max_length=100, widget= forms.TextInput(attrs={'class': 'form-control'}))
first_name = forms.CharField(max_length=100, widget= fo... | [
"from django.contrib.auth.forms import UserChangeForm\nfrom django.contrib.auth.models import User\nfrom django import forms\n\nclass editForm(forms.ModelForm):\n username = forms.CharField(max_length=100, widget= forms.TextInput(attrs={'class': 'form-control'}))\n first_name = forms.CharField(max_length=100,... | false |
7,175 | 892f90edbd8bd54841b815a6bc29d136c5e84a38 | # This defines a new interface, called MyClosedInterface
# which is closed (does not allow new members to be added).
# "eci" is the schema id for this extension.
{"fs": { "eci": {
"info": {
"name": "Example closed Interface extension",
"version": "1.0",
"date": "Sept. 22, 2016",
"author": "Jeff Teete... | [
"# This defines a new interface, called MyClosedInterface\n# which is closed (does not allow new members to be added).\n\n# \"eci\" is the schema id for this extension.\n\n{\"fs\": { \"eci\": {\n\n\"info\": {\n \"name\": \"Example closed Interface extension\",\n \"version\": \"1.0\",\n \"date\": \"Sept. 22... | false |
7,176 | 3f2221f5f3a699020dd5986acb793e3083976dff | import subprocess
import datetime
def ping_address(host,n):
ping = subprocess.Popen(
["ping","-c",str(n),host],
stdout = subprocess.PIPE,
stderr = subprocess.PIPE)
out,error = ping.communicate()
return out, error
def ping_address_windows(host,n):
ping = subprocess.Popen(
["... | [
"import subprocess\nimport datetime\n\ndef ping_address(host,n):\n ping = subprocess.Popen(\n [\"ping\",\"-c\",str(n),host],\n stdout = subprocess.PIPE,\n stderr = subprocess.PIPE)\n out,error = ping.communicate()\n return out, error\n\ndef ping_address_windows(host,n):\n ping = subpro... | false |
7,177 | 6027836b1b5d3cb8b842b1a1b77f5c9777269896 | """
ะ ะผะฐััะธะฒะต ัะปััะฐะนะฝัั
ัะตะปัั
ัะธัะตะป ะฟะพะผะตะฝััั ะผะตััะฐะผะธ ะผะธะฝะธะผะฐะปัะฝัะน ะธ ะผะฐะบัะธะผะฐะปัะฝัะน ัะปะตะผะตะฝัั.
"""
import random
SIZE = 10
MIN_ITEM = -100
MAX_ITEM = 100
array = [random.randint(MIN_ITEM, MAX_ITEM) for _ in range(SIZE)]
print('ะะฐััะธะฒ ัะปััะฐะนะฝัั
ัะธัะตะป:\n', array)
min_el = array[0]
max_el = array[0]
max_el_inx = 0
min_... | [
"\"\"\"\n ะ ะผะฐััะธะฒะต ัะปััะฐะนะฝัั
ัะตะปัั
ัะธัะตะป ะฟะพะผะตะฝััั ะผะตััะฐะผะธ ะผะธะฝะธะผะฐะปัะฝัะน ะธ ะผะฐะบัะธะผะฐะปัะฝัะน ัะปะตะผะตะฝัั.\n\"\"\"\n\n\nimport random\n\nSIZE = 10\nMIN_ITEM = -100\nMAX_ITEM = 100\narray = [random.randint(MIN_ITEM, MAX_ITEM) for _ in range(SIZE)]\nprint('ะะฐััะธะฒ ัะปััะฐะนะฝัั
ัะธัะตะป:\\n', array)\n\nmin_el = array[0]\nmax_el = ar... | false |
7,178 | 962a9781e4f2ad787dd695896b6455c9b336603a | from core import Postgresdb
db = Postgresdb()
print(db) | [
"from core import Postgresdb\ndb = Postgresdb()\nprint(db)",
"from core import Postgresdb\ndb = Postgresdb()\nprint(db)\n",
"<import token>\ndb = Postgresdb()\nprint(db)\n",
"<import token>\n<assignment token>\nprint(db)\n",
"<import token>\n<assignment token>\n<code token>\n"
] | false |
7,179 | 03677f02473019fcc6a40d91569a85be78ca0a87 | #!/usr/bin/env python3
from datetime import datetime
import re
import sys
MONTHS_REGEXP = ('Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec|'
'January|February|March|April|June|July|August|September|October|November|December')
re_entry_begin = re.compile(r'(?P<version>[\d.]+)[ :]*\(?(?P<date>\d\d\d\d... | [
"#!/usr/bin/env python3\nfrom datetime import datetime\nimport re\nimport sys\n\nMONTHS_REGEXP = ('Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec|'\n 'January|February|March|April|June|July|August|September|October|November|December')\n\nre_entry_begin = re.compile(r'(?P<version>[\\d.]+)[ :]*\\(?(?... | false |
7,180 | 1330addd53c6187a41dfea6957bf47aaecca1135 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-27 21:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields
class Migration(migrations.Migration):
dependencies = [
('regions', '0002_auto_2... | [
"# -*- coding: utf-8 -*-\n# Generated by Django 1.11.6 on 2017-10-27 21:59\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\nimport phonenumber_field.modelfields\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('regio... | false |
7,181 | 5f2427c077d460d109f5a3e94b93f72c090f036d | # -*- coding: utf-8 -*-
# python >= 3.7
# supported xmanager version <5.1, 5.1, 5.2, 6
import os
import argparse
import configparser
import unicodedata
from win32api import GetComputerName, GetUserName
from win32security import LookupAccountName, ConvertSidToStringSid
from base64 import b64encode, b64decode
from Cryp... | [
"# -*- coding: utf-8 -*-\n# python >= 3.7\n# supported xmanager version <5.1, 5.1, 5.2, 6\n\nimport os\nimport argparse\nimport configparser\nimport unicodedata\n\nfrom win32api import GetComputerName, GetUserName\nfrom win32security import LookupAccountName, ConvertSidToStringSid\nfrom base64 import b64encode, b64... | false |
7,182 | 82f86284dddf48bf2c65ddf55eb6d7a372306373 | #Import dependencies
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import string
import operator
from sklearn.feature_extraction.text import CountVectorizer
import pickle
import nltk
from nltk.corpus import stopwords
#nltk.download('stopwords')
from nltk.tokenize import wo... | [
"#Import dependencies\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport string\nimport operator\nfrom sklearn.feature_extraction.text import CountVectorizer\nimport pickle\nimport nltk\nfrom nltk.corpus import stopwords\n#nltk.download('stopwords')\nfrom nltk.t... | false |
7,183 | cb1e73d172314c8d3d31f6e49fa67582375c0c58 | #!/usr/bin/env python3
# coding:utf-8
# ๆน่ฟๅฐ็บข็
class Ball:
def __init__(self, canvas, paddle, color):
self.canvas = canvas
self.paddle = paddle
self.id = canvas.create_oval(10, 10, 25, 25, fill=color)
self.canvas.move(self.id, 245, 100)
starts = [-3, -2, -1, 1, 2, 3]
... | [
"#!/usr/bin/env python3\n# coding:utf-8\n\n# ๆน่ฟๅฐ็บข็\nclass Ball:\n def __init__(self, canvas, paddle, color):\n self.canvas = canvas\n self.paddle = paddle\n self.id = canvas.create_oval(10, 10, 25, 25, fill=color)\n self.canvas.move(self.id, 245, 100)\n starts = [-3, -2, -1, 1,... | false |
7,184 | 222948fb0a991bb6d7faa186c7442a303b88290b | from django.contrib import admin
from apps.cart.models import *
# Register your models here.
class CartAdmin(admin.ModelAdmin):
list_display = ('user_id', 'goods_id', 'goods_num')
search_fields = ('user_id', 'goods_id', 'goods_num')
list_filter = ['user_id', 'goods_id', 'goods_num']
admin.sit... | [
"from django.contrib import admin\r\nfrom apps.cart.models import *\r\n\r\n\r\n# Register your models here.\r\nclass CartAdmin(admin.ModelAdmin):\r\n list_display = ('user_id', 'goods_id', 'goods_num')\r\n search_fields = ('user_id', 'goods_id', 'goods_num')\r\n list_filter = ['user_id', 'goods_id', 'goods... | false |
7,185 | 9a02bd0bc14494db033c032003aa5baea111ea8c | import random
import Manhattan_segmental_dist
# Greedy
# s: dictionary of points
# k: number of medoids
# returns
# k medoids from sample set s
def greedy(s, k):
# print("Hello Word!")
m_1 = random.choice(list(s.keys()))
medoids = {m_1: s[m_1]}
dimensions = list(range(len(s[m_1])))
s.pop(m_1... | [
"import random\nimport Manhattan_segmental_dist\n\n\n# Greedy\n# s: dictionary of points\n# k: number of medoids\n# returns\n# k medoids from sample set s\ndef greedy(s, k):\n # print(\"Hello Word!\")\n m_1 = random.choice(list(s.keys()))\n medoids = {m_1: s[m_1]}\n dimensions = list(range(len(s[m... | false |
7,186 | 1f8040776a55d6fe52b64c714d4003469460e454 | # ์ฌ์ฌ๋ฌธ์ 22
# ํ์ค ์
๋ ฅ์ผ๋ก ์ ์ ๋ ๊ฐ๊ฐ ์
๋ ฅ๋ฉ๋๋ค(์ฒซ ๋ฒ์งธ ์
๋ ฅ ๊ฐ์ ๋ฒ์๋ 1~20, ๋ ๋ฒ์งธ ์
๋ ฅ ๊ฐ์ ๋ฒ์๋ 10~30์ด๋ฉฐ ์ฒซ ๋ฒ์งธ ์
๋ ฅ ๊ฐ์ ๋ ๋ฒ์งธ ์
๋ ฅ ๊ฐ๋ณด๋ค ํญ์ ์์ต๋๋ค).
# ์ฒซ ๋ฒ์งธ ์ ์๋ถํฐ ๋ ๋ฒ์งธ ์ ์๊น์ง๋ฅผ ์ง์๋ก ํ๋ 2์ ๊ฑฐ๋ญ์ ๊ณฑ ๋ฆฌ์คํธ๋ฅผ ์ถ๋ ฅํ๋ ํ๋ก๊ทธ๋จ์ ๋ง๋์ธ์
# (input์์ ์๋ด ๋ฌธ์์ด์ ์ถ๋ ฅํ์ง ์์์ผ ํฉ๋๋ค). ๋จ, ๋ฆฌ์คํธ์ ๋ ๋ฒ์งธ ์์์ ๋ค์์ ๋ ๋ฒ์งธ ์์๋ ์ญ์ ํ ๋ค ์ถ๋ ฅํ์ธ์. ์ถ๋ ฅ ๊ฒฐ๊ณผ๋ ๋ฆฌ์คํธ ํํ๋ผ์ผ ํฉ๋๋ค.
start, stop = list(map(int, input().split()))
1 10
... | [
"# ์ฌ์ฌ๋ฌธ์ 22\n# ํ์ค ์
๋ ฅ์ผ๋ก ์ ์ ๋ ๊ฐ๊ฐ ์
๋ ฅ๋ฉ๋๋ค(์ฒซ ๋ฒ์งธ ์
๋ ฅ ๊ฐ์ ๋ฒ์๋ 1~20, ๋ ๋ฒ์งธ ์
๋ ฅ ๊ฐ์ ๋ฒ์๋ 10~30์ด๋ฉฐ ์ฒซ ๋ฒ์งธ ์
๋ ฅ ๊ฐ์ ๋ ๋ฒ์งธ ์
๋ ฅ ๊ฐ๋ณด๋ค ํญ์ ์์ต๋๋ค).\n# ์ฒซ ๋ฒ์งธ ์ ์๋ถํฐ ๋ ๋ฒ์งธ ์ ์๊น์ง๋ฅผ ์ง์๋ก ํ๋ 2์ ๊ฑฐ๋ญ์ ๊ณฑ ๋ฆฌ์คํธ๋ฅผ ์ถ๋ ฅํ๋ ํ๋ก๊ทธ๋จ์ ๋ง๋์ธ์\n# (input์์ ์๋ด ๋ฌธ์์ด์ ์ถ๋ ฅํ์ง ์์์ผ ํฉ๋๋ค). ๋จ, ๋ฆฌ์คํธ์ ๋ ๋ฒ์งธ ์์์ ๋ค์์ ๋ ๋ฒ์งธ ์์๋ ์ญ์ ํ ๋ค ์ถ๋ ฅํ์ธ์. ์ถ๋ ฅ ๊ฒฐ๊ณผ๋ ๋ฆฌ์คํธ ํํ๋ผ์ผ ํฉ๋๋ค.\n\nstart, stop = list(map(int, input().split... | true |
7,187 | d4a4ea67a06107ad7ea18bb21fb1ec9e74ccd7c1 | #!/usr/bin/env python
import sys
import subprocess
import mystem
def run(args, fin=sys.stdin, fout=sys.stdout, ferr=sys.stderr, input_data=None):
'''\
Generic wrapper for MyStem
'''
mystem_path = mystem.util.find_mystem()
# make utf-8 a default encoding
if '-e' not in args:
args.exten... | [
"#!/usr/bin/env python\nimport sys\nimport subprocess\n\nimport mystem\n\ndef run(args, fin=sys.stdin, fout=sys.stdout, ferr=sys.stderr, input_data=None):\n '''\\\n Generic wrapper for MyStem\n '''\n mystem_path = mystem.util.find_mystem()\n\n # make utf-8 a default encoding\n if '-e' not in args:... | false |
7,188 | 84febcc599aa97858ded3b6f803b6b76960878d4 | from itertools import takewhile
import numpy as np
from .rrt import TreeNode
from .trajectory.linear import get_default_limits, solve_linear
from .trajectory.retime import spline_duration
from .utils import argmin, negate, circular_difference, UNBOUNDED_LIMITS, get_distance, get_delta
ASYMETRIC = True
def asymmetr... | [
"from itertools import takewhile\n\nimport numpy as np\n\nfrom .rrt import TreeNode\nfrom .trajectory.linear import get_default_limits, solve_linear\nfrom .trajectory.retime import spline_duration\nfrom .utils import argmin, negate, circular_difference, UNBOUNDED_LIMITS, get_distance, get_delta\n\nASYMETRIC = True\... | false |
7,189 | f19e853af675c16dfbb911bf2b756de0f1e3f2f8 | #!/usr/bin/python
import os
from base_exploit import *
from reporter import *
from netfw import *
import sys
class remote_shell(base_exploit):
id = EXPLOIT_ID_REMOTE_SHELL
def exploit(self, ip, port):
# Create a connection to requested destination
s = socket(AF_INET, SOCK_DGRAM)
s.con... | [
"#!/usr/bin/python\n\nimport os\nfrom base_exploit import *\nfrom reporter import *\nfrom netfw import *\nimport sys\n\nclass remote_shell(base_exploit):\n id = EXPLOIT_ID_REMOTE_SHELL\n\n def exploit(self, ip, port):\n # Create a connection to requested destination\n s = socket(AF_INET, SOCK_DG... | true |
7,190 | 014509170b98a38838859d3ca48c74ca6be0bd46 | #encoding:utf-8
class Employee():
def __int__(self,name,sex,salary):
self.name = name
self.sex = sex
self.salary = salary
def give_raise(self):
222 | [
"#encoding:utf-8\nclass Employee():\n def __int__(self,name,sex,salary):\n self.name = name\n self.sex = sex\n self.salary = salary\n def give_raise(self):\n 222"
] | true |
7,191 | 061c287d5f0a5feeeaedc80eea6b3fc4ff02286e | import logging
from typing import Dict
import numpy as np
from meshkit import Mesh
from rendkit.materials import DepthMaterial
from vispy import gloo, app
from vispy.gloo import gl
logger = logging.getLogger(__name__)
class Renderable:
def __init__(self,
material_name: str,
at... | [
"import logging\nfrom typing import Dict\n\nimport numpy as np\n\nfrom meshkit import Mesh\nfrom rendkit.materials import DepthMaterial\nfrom vispy import gloo, app\nfrom vispy.gloo import gl\n\nlogger = logging.getLogger(__name__)\n\n\nclass Renderable:\n def __init__(self,\n material_name: str,... | false |
7,192 | 34c91d273648ae72731fba7f5519a4920d77c0c3 | include ("RecExRecoTest/RecExRecoTest_RTT_common.py")
from BTagging.BTaggingFlags import BTaggingFlags
BTaggingFlags.Active=False
# main jobOption
include ("RecExCommon/rdotoesdnotrigger.py")
include ("RecExRecoTest/RecExRecoTest_RTT_common_postOptions.py")
| [
"include (\"RecExRecoTest/RecExRecoTest_RTT_common.py\")\n\n\nfrom BTagging.BTaggingFlags import BTaggingFlags\nBTaggingFlags.Active=False\n\n# main jobOption\ninclude (\"RecExCommon/rdotoesdnotrigger.py\")\n\n\ninclude (\"RecExRecoTest/RecExRecoTest_RTT_common_postOptions.py\")\n\n\n",
"include('RecExRecoTest/Re... | false |
7,193 | f0f9541eba29b4488c429c889f3b346d53d0239d | import json
data = '{"var1": "harry", "var2":56}'
parsed = json.loads(data)
print(parsed['var1'])
# data2 = {"channel_name": "Chill_Out",
# "Cars": ["BMW", "Audi a8", "ferrari"],
# "fridge": ("loki", "Aalu", "pasta"),
# "isbad": False
# }
# jscomp = json.dumps(data2)
# print(jscomp)
| [
"import json\n\ndata = '{\"var1\": \"harry\", \"var2\":56}'\n\nparsed = json.loads(data)\nprint(parsed['var1'])\n\n# data2 = {\"channel_name\": \"Chill_Out\",\n# \"Cars\": [\"BMW\", \"Audi a8\", \"ferrari\"],\n# \"fridge\": (\"loki\", \"Aalu\", \"pasta\"),\n# \"isbad\": False\n# }\n# jsco... | false |
7,194 | 9a60449aa13bc5e7e413d0e47a1972d93ccfe69f | a=input().split(' ')
A=int(a[0])
B=int(a[1])
X=int(a[2])
if A<=X and A+B>=X:
print('YES')
else:
print('NO') | [
"a=input().split(' ')\nA=int(a[0])\nB=int(a[1])\nX=int(a[2])\nif A<=X and A+B>=X:\n print('YES')\nelse:\n print('NO')",
"a = input().split(' ')\nA = int(a[0])\nB = int(a[1])\nX = int(a[2])\nif A <= X and A + B >= X:\n print('YES')\nelse:\n print('NO')\n",
"<assignment token>\nif A <= X and A + B >= X:\n... | false |
7,195 | bb5bea4ea100950b59fb2b168b75dec349938aac | import numpy as np
import cv2
import myrustlib
def detect_lines_hough(img):
lines = cv2.HoughLinesP(
cv2.bitwise_not(opening),
rho = 1,
theta = np.pi / 2,
threshold=50,
minLineLength=120,
maxLineGap=10
)
return [line[0] for line in lines] # weird HoughLinesP ... | [
"import numpy as np\nimport cv2\nimport myrustlib\n\ndef detect_lines_hough(img):\n lines = cv2.HoughLinesP(\n cv2.bitwise_not(opening),\n rho = 1,\n theta = np.pi / 2,\n threshold=50,\n minLineLength=120,\n maxLineGap=10\n )\n return [line[0] for line in lines] # ... | false |
7,196 | 4e9674ea46bdf930d1e99bcda56eaa300c84deef | from nbt import nbt
from matplotlib import pyplot
class Banana(object):
id = 10
def srange(x1, xDoors, spaces):
"""
a counting thing that i dunno what does.
"""
for a in xrange(x1, x1 + xDoors):
yield a
for a in xrange(x1 + xDoors + spaces, x1 + spaces + xDoors * 2):
yield a
... | [
"from nbt import nbt\nfrom matplotlib import pyplot\n\nclass Banana(object):\n id = 10\n\n\ndef srange(x1, xDoors, spaces):\n \"\"\"\n a counting thing that i dunno what does.\n \"\"\"\n for a in xrange(x1, x1 + xDoors):\n yield a\n for a in xrange(x1 + xDoors + spaces, x1 + spaces + xDoors... | false |
7,197 | 2898506b9fd5b112f93a1ff6b010848244c398bd | from collections import deque
class Queue:
def __init__(self):
self.container = deque()
def enqueue(self, data):
self.container.appendleft(data)
def dequeue(self):
return self.container.pop()
def is_empty(self):
return len(self.container) == 0
def size(self):
... | [
"from collections import deque\n\nclass Queue:\n def __init__(self):\n self.container = deque()\n\n def enqueue(self, data):\n self.container.appendleft(data)\n\n def dequeue(self):\n return self.container.pop()\n\n def is_empty(self):\n return len(self.container) == 0\n\n ... | false |
7,198 | 3c7237e5770dd5552c327dbf53451a2889ea8c6b | import torch
import typing
__all__ = ['NoOp']
class Null(torch.optim.Optimizer):
def __init__(self,
parameters: typing.Iterator[torch.nn.Parameter],
):
super(Null, self).__init__(parameters, {"lr": 0.0, "eps": 1e-8})
def step(self, closure=None):
if closure is not None:
closure()
return N... | [
"import torch\nimport typing\n\n__all__ = ['NoOp']\n\nclass Null(torch.optim.Optimizer):\n def __init__(self,\n parameters: typing.Iterator[torch.nn.Parameter],\n ):\n super(Null, self).__init__(parameters, {\"lr\": 0.0, \"eps\": 1e-8})\n\n def step(self, closure=None):\n if closure is not None:\n ... | false |
7,199 | 146db68fb84569b914fa741457c595108088dc63 | from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
from scipy.misc import imread
import os
import numpy as np
files = [ "oracle.PNG",
"SQL.jpg" ]
def plotImage(f):
folder = "C:/temp/"
im = imread(os.path.join(folder, f)).astype(np.float32) / 255
plt.im... | [
"from matplotlib.backends.backend_pdf import PdfPages\r\nimport matplotlib.pyplot as plt\r\nfrom scipy.misc import imread\r\nimport os\r\nimport numpy as np\r\n\r\nfiles = [ \"oracle.PNG\",\r\n \"SQL.jpg\" ]\r\ndef plotImage(f):\r\n folder = \"C:/temp/\"\r\n im = imread(os.path.join(folder, f)).astyp... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.