code stringlengths 13 6.09M | order_type stringclasses 2
values | original_example dict | step_ids listlengths 1 5 |
|---|---|---|---|
# -*- coding: utf-8 -*-
"""
Modul do zapisu piosenki (wczytywanie ustawien (defs.txt), tworzenie .wav,
"zglasnianie utworu")
"""
print("Laduje modul o nazwie: "+__name__)
import numpy as np
def wczytywanie_ustawien(plik_konfiguracyjny = "defs.txt"):
"""
wczytywanie pl... | normal | {
"blob_id": "8220a6d33cda5861e74d6236757abbc81685a998",
"index": 6369,
"step-1": "<mask token>\n\n\ndef wczytywanie_ustawien(plik_konfiguracyjny='defs.txt'):\n \"\"\" \n wczytywanie pliku z ustawieniami (pliku defs.txt) do slownika\n \n arg:\n str: plik_konfiguracyjny - nazwa pliku konfiguracy... | [
1,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
def json_dump(obj, file_path):
with open(file_path, 'w') as f:
json.dump(obj, f)
<|reserved_special_token_0|>
def get_repo_path(file_path):
if os.path.isfile(file_path):
folder_path = os.path.abspath(os.path.join(file_path, os.pardir))
else:
folder_... | flexible | {
"blob_id": "3788888a17e2598e781803f89cd63ac9c3219f59",
"index": 4341,
"step-1": "<mask token>\n\n\ndef json_dump(obj, file_path):\n with open(file_path, 'w') as f:\n json.dump(obj, f)\n\n\n<mask token>\n\n\ndef get_repo_path(file_path):\n if os.path.isfile(file_path):\n folder_path = os.path... | [
8,
9,
12,
13,
14
] |
import weakref
from enum import Enum
from functools import partial
from typing import TYPE_CHECKING
import inflection
if TYPE_CHECKING:
from stake.client import StakeClient
camelcase = partial(inflection.camelize, uppercase_first_letter=False)
__all__ = ["SideEnum"]
class SideEnum(str, Enum):
BUY = "B"
... | normal | {
"blob_id": "f13ccbfb27788deca0d4f4b58a4e9e8c7e8e0306",
"index": 1644,
"step-1": "<mask token>\n\n\nclass SideEnum(str, Enum):\n BUY = 'B'\n SELL = 'S'\n\n\nclass BaseClient:\n\n def __init__(self, client: 'StakeClient'):\n self._client = weakref.proxy(client)\n",
"step-2": "<mask token>\nif TY... | [
4,
5,
6,
7,
8
] |
# open a converted base to bits file and convert it back to the base sequences
seq2 = ''
with open('chr01.txt') as a:
while 1:
seq = a.read(2)
# print(seq)
seq = seq.replace('00', 'c').replace('01', 'g').replace('10', 'a').replace('11', 't')
seq2 += seq
if not seq:
... | normal | {
"blob_id": "c2f859e0ed0e812768dec04b2b1f9ddd349350f6",
"index": 9780,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nwith open('chr01.txt') as a:\n while 1:\n seq = a.read(2)\n seq = seq.replace('00', 'c').replace('01', 'g').replace('10', 'a'\n ).replace('11', 't')\n s... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
def getfanyiInfo():
vocaben, rev_vocaben = datautil.initialize_vocabulary(os.path.join(
datautil.data_dir, datautil.vocabulary_fileen))
vocab_sizeen = len(vocaben)
vocabch, rev_vocabch = datautil.initialize_vocabulary(os.path.join(
datautil.data_dir, datautil.v... | flexible | {
"blob_id": "b7007778ea9dfac3af8c31d66d32d8157dc0d69b",
"index": 1517,
"step-1": "<mask token>\n\n\ndef getfanyiInfo():\n vocaben, rev_vocaben = datautil.initialize_vocabulary(os.path.join(\n datautil.data_dir, datautil.vocabulary_fileen))\n vocab_sizeen = len(vocaben)\n vocabch, rev_vocabch = da... | [
2,
4,
5,
6,
7
] |
<|reserved_special_token_0|>
class TestVideoMethods(luna.TestBase):
def vlog(self, message):
if VERBOSE_LOG:
print(message)
def setUp(self):
self.vlog('setUp')
if SUPPORT_REGISTER:
for pid in PID_LIST:
self.vlog('register ' + pid)
... | flexible | {
"blob_id": "27e66b2a03bc626d5babd804e736a4652ba030d5",
"index": 8624,
"step-1": "<mask token>\n\n\nclass TestVideoMethods(luna.TestBase):\n\n def vlog(self, message):\n if VERBOSE_LOG:\n print(message)\n\n def setUp(self):\n self.vlog('setUp')\n if SUPPORT_REGISTER:\n ... | [
11,
14,
15,
17,
18
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
def assert_shapes(shape, other):
assert len(shape) == len(other), 'Dimensions are different'
for s, o in zip(shape, other):
if s is not None and o is not None:
assert s == o, 'Shapes {} and {} are not equal'.format(shape, other
... | flexible | {
"blob_id": "337311c3fbb6a8baab7a237d08152f0db9822527",
"index": 2931,
"step-1": "<mask token>\n",
"step-2": "def assert_shapes(shape, other):\n assert len(shape) == len(other), 'Dimensions are different'\n for s, o in zip(shape, other):\n if s is not None and o is not None:\n assert s ... | [
0,
1,
2
] |
import matplotlib.pyplot as plt
import matplotlib
import matplotlib.colors as colors
import matplotlib.cm as cm
def plot_hist(data_list):
plt.hist(data_list, bins=500)
plt.show()
return
def compare_hits_plot(np_array, compare=False):
if compare:
clist = list(np_array[:,2])
minima, maxima = ... | normal | {
"blob_id": "b6adb956aed934451fc21e51663be36d08c5b645",
"index": 2535,
"step-1": "import matplotlib.pyplot as plt\nimport matplotlib\nimport matplotlib.colors as colors\nimport matplotlib.cm as cm\n\ndef plot_hist(data_list):\n plt.hist(data_list, bins=500)\n plt.show()\n return\n\ndef compare_hits_plot(np... | [
0
] |
#!/usr/bin/env python3
import os
from Alfred3 import Items, Tools
def to_absolute_path(filepath):
filepath = os.path.expanduser(filepath)
return os.path.abspath(filepath)
def is_valid_path(path):
abs_path = to_absolute_path(path)
if os.path.exists(abs_path) and os.path.isdir(abs_path):
ret... | normal | {
"blob_id": "1cf573863fca660cc1fec71ab64743e7a2dd74d8",
"index": 1730,
"step-1": "<mask token>\n\n\ndef to_absolute_path(filepath):\n filepath = os.path.expanduser(filepath)\n return os.path.abspath(filepath)\n\n\ndef is_valid_path(path):\n abs_path = to_absolute_path(path)\n if os.path.exists(abs_pa... | [
2,
3,
4,
5,
6
] |
from __future__ import absolute_import, print_function, unicode_literals
import six
from six.moves import zip, filter, map, reduce, input, range
import pathlib
import unittest
import networkx as nx
import multiworm
TEST_ROOT = pathlib.Path(__file__).parent.resolve()
DATA_DIR = TEST_ROOT / 'data'
SYNTH1 = DATA_DIR ... | normal | {
"blob_id": "dfee0407eaed7b1ab96467874bbfe6463865bcb4",
"index": 6238,
"step-1": "<mask token>\n\n\nclass TestExperimentOpen(unittest.TestCase):\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n\n\nclass TestMalformed... | [
18,
19,
24,
27,
29
] |
<|reserved_special_token_0|>
def get_year_progress():
dt = pendulum.now()
percent = year_progress(dt)
year = dt.year
return f'你的 {year} 使用进度:{percent}%\n\n\n{make_progress_string(percent)}'
def year_progress(dt):
year_days = 366 if dt.is_leap_year() else 365
passed_days = dt.timetuple().tm_y... | flexible | {
"blob_id": "f54d0eeffa140af9c16a1fedb8dcd7d06ced29f2",
"index": 2395,
"step-1": "<mask token>\n\n\ndef get_year_progress():\n dt = pendulum.now()\n percent = year_progress(dt)\n year = dt.year\n return f'你的 {year} 使用进度:{percent}%\\n\\n\\n{make_progress_string(percent)}'\n\n\ndef year_progress(dt):\n... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
def test_existing_user_accept_invite_calls_api_and_redirects_to_dashboard(
client, service_one, api_user_active, sample_invite, mock_get_service,
mock_check_invite_token, mock_get_user_by_email,
mock_get_users_by_service, mock_accept_invite, mock_add_user_to_service):
expe... | flexible | {
"blob_id": "0baa133bd9eb8a162a82b23ba4d26cdd34f701c4",
"index": 1507,
"step-1": "<mask token>\n\n\ndef test_existing_user_accept_invite_calls_api_and_redirects_to_dashboard(\n client, service_one, api_user_active, sample_invite, mock_get_service,\n mock_check_invite_token, mock_get_user_by_email,\n moc... | [
8,
10,
11,
12,
13
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def iterative_train_test(X, y, test_size):
"""
Iteratively splits data with stratification.
This function is based on the iterative_train_test_split function from the
skmultilearn.model_selection package, but us... | flexible | {
"blob_id": "c4c068c7b50d1811f224701ad7e95d88f6734230",
"index": 2867,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef iterative_train_test(X, y, test_size):\n \"\"\"\n Iteratively splits data with stratification.\n\n This function is based on the iterative_train_test_split function from ... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
class Food(Turtle):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Food(Turtle):
def __init__(self):
super().__init__()
self.shape('circle')
self.penup()
self.color... | flexible | {
"blob_id": "8adda42dfebd3f394a1026720465824a836c1dd1",
"index": 7997,
"step-1": "<mask token>\n\n\nclass Food(Turtle):\n <mask token>\n <mask token>\n",
"step-2": "<mask token>\n\n\nclass Food(Turtle):\n\n def __init__(self):\n super().__init__()\n self.shape('circle')\n self.pen... | [
1,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
class Example(QWidget):
class A(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setGeometry(300, 300, 300, 220)
self.setWindowTitle('Icon')
self.setWindowIcon(QIcon('w... | flexible | {
"blob_id": "889d465ceeac57a600b2fa3bd26632edcd90a655",
"index": 2911,
"step-1": "<mask token>\n\n\nclass Example(QWidget):\n\n\n class A(QWidget):\n\n def __init__(self):\n super().__init__()\n self.initUI()\n\n def initUI(self):\n self.setGeometry(300, 300, 300... | [
7,
8,
11,
16,
17
] |
from threading import Lock
from typing import Callable, Any
from remote.domain.commandCallback import CommandCallback
from remote.domain.commandStatus import CommandStatus
from remote.service.remoteService import RemoteService
from ui.domain.subroutine.iSubroutineRunner import ISubroutineRunner
class RemoteSubroutin... | normal | {
"blob_id": "75270fb4ed059f134b47b8937717cb7fe05d9499",
"index": 8833,
"step-1": "<mask token>\n\n\nclass RemoteSubroutineRunner(ISubroutineRunner):\n <mask token>\n\n def execute_charge_subroutine(self, callback: CommandCallback) ->None:\n \"\"\"\n\n :raises BlockingIOError: command already ... | [
14,
15,
17,
19,
21
] |
from HiddenLayer import HiddenLayer
from Vector import Vector
import IO
import Loss
import Utils
import Activation
import Backpropagation
import Rate
# As a test, let's simulate the OR-gate with a single perceptron
""" training = []
training.append(Vector(2, arr=[1, 1]))
training.append(Vector(2, arr=[1, 0]))
trainin... | normal | {
"blob_id": "1f86fe72c90c8457715a2f400dae8d355a9a97cf",
"index": 8577,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint('Images & labels read!')\n<mask token>\nfor i, l in zip(images, labels):\n images_flat.append(Vector(Utils.normalize(Utils.flatten_2d(i), 0, 1)))\n labels_oh.append(Utils.oneh... | [
0,
1,
2,
3,
4
] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Thibaut Lapierre <git@epheo.eu>. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | normal | {
"blob_id": "c2c1194ed23adda015b23897888d1a4cc11423d5",
"index": 5074,
"step-1": "<mask token>\n\n\nclass Container(object):\n <mask token>\n\n def __init__(self, svc_cfg, containers_all=None):\n self.cfg = svc_cfg\n self.env = dict(self.cfg)\n args_to_delete = ['priority', 'depends-on... | [
9,
10,
12,
13,
14
] |
from .chair_model import run_chair_simulation, init_omega_t, \
JumpingModel, H_to_L
from .utils import load_hcp_peaks, Condition, average_peak_counts
| normal | {
"blob_id": "9087a7bf42070fdb8639c616fdf7f09ad3903656",
"index": 6755,
"step-1": "<mask token>\n",
"step-2": "from .chair_model import run_chair_simulation, init_omega_t, JumpingModel, H_to_L\nfrom .utils import load_hcp_peaks, Condition, average_peak_counts\n",
"step-3": "from .chair_model import run_chair_... | [
0,
1,
2
] |
import numpy as np
#
#
#
basedir = '/n/regal/pfister_lab/haehn/CREMITEST/'
testA = basedir + 'testA.npz.npy'
testA_targets = basedir + 'testA_targets.npz.npy'
testB = basedir + 'testB.npz.npy'
testB_targets = basedir + 'testB_targets.npz.npy'
testC = basedir + 'testC.npz.npy'
testC_targets = basedir + 'testC_targets... | normal | {
"blob_id": "5cb7af5ded532058db7f5520d48ff418ba856f04",
"index": 6150,
"step-1": "import numpy as np\n\n#\n#\n#\n\nbasedir = '/n/regal/pfister_lab/haehn/CREMITEST/'\n\ntestA = basedir + 'testA.npz.npy'\ntestA_targets = basedir + 'testA_targets.npz.npy'\ntestB = basedir + 'testB.npz.npy'\ntestB_targets = basedir ... | [
0
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print('-' * 10)
print('NY State has:', cities['NY'])
print('OR State has : ', cities['OR'])
print('-' * 10)
print("Michigan's abbreviation is: ", states['Michigan'])
print("Flordia's abreviation is :", states['Flordia'])
print('-... | flexible | {
"blob_id": "1bdc1274cceba994524442c7a0065498a9c1d7bc",
"index": 8919,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint('-' * 10)\nprint('NY State has:', cities['NY'])\nprint('OR State has : ', cities['OR'])\nprint('-' * 10)\nprint(\"Michigan's abbreviation is: \", states['Michigan'])\nprint(\"Flord... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
while n > 0:
arr.append(n)
n -= 1
while len(arr) + len(sub) > 1:
while len(arr) > 1:
arr.pop()
sub.append(arr.pop())
arr = sub[::-1] + arr
sub = []
print(arr[0])
<|reserved_special_token_1|>
... | flexible | {
"blob_id": "d5d31920f7fd4ed2913c5880dba61c2015181be9",
"index": 5760,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nwhile n > 0:\n arr.append(n)\n n -= 1\nwhile len(arr) + len(sub) > 1:\n while len(arr) > 1:\n arr.pop()\n sub.append(arr.pop())\n arr = sub[::-1] + arr\n sub ... | [
0,
1,
2,
3
] |
onfiguration name="test3" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="hori_check" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<opt... | normal | {
"blob_id": "48affa1b823a2543b6bbda615247324f5c249a69",
"index": 5831,
"step-1": "onfiguration name=\"test3\" type=\"PythonConfigurationType\" factoryName=\"Python\" temporary=\"true\">\n <module name=\"hori_check\" />\n <option name=\"INTERPRETER_OPTIONS\" value=\"\" />\n <option name=\"PARENT_EN... | [
0
] |
import asyncio
import logging
import os.path
from serial_asyncio import open_serial_connection
from typing import NewType, cast
# Type annotations and converters
AsciiBytes = NewType('AsciiBytes', bytes)
def to_ascii(s: str) -> AsciiBytes:
if s[-1] != '\n':
s += '\n'
return cast(AsciiBytes, s.encode(... | normal | {
"blob_id": "50b630b762251f8646044b234ac4b82b8e4b645b",
"index": 8460,
"step-1": "<mask token>\n\n\nclass USBHandler:\n <mask token>\n\n def __init__(self):\n self.initialized = False\n self.run_task = None\n self.waiters = {}\n self.queues = {}\n self.logger = logging.ge... | [
3,
7,
8,
9,
10
] |
import pandas as pd
import numpy as np
import matplotlib.pylab as plt
from matplotlib.pylab import rcParams
#from pandas import datetime
#from pandas.tseries.t
from sklearn.preprocessing import MinMaxScaler
#from statsmodels.tsa.seasonal import seasonal_decompose
from pandas import Series
data = pd.read_csv(
r'E:\... | normal | {
"blob_id": "19c0c3156488ce99316ce40f32e84e476b7afdac",
"index": 2754,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nafter_process.head(5)\nafter_process.to_csv(path_or_buf=\n 'E:\\\\Thesis Content\\\\ukdale CSV\\\\Without Noise\\\\Tvday.csv', sep=',',\n index_label='date')\n",
"step-3": "<mask ... | [
0,
1,
2,
3,
4
] |
letters = ['a', 'b', 'c']
def delete_head(letters):
del letters[0]
print letters
print delete_head(letters)
| normal | {
"blob_id": "e0c10dfa4074b0de4d78fc78a6f373074ef4dadd",
"index": 3971,
"step-1": "letters = ['a', 'b', 'c']\ndef delete_head(letters):\n\tdel letters[0]\n\tprint letters\nprint delete_head(letters)\n\n",
"step-2": null,
"step-3": null,
"step-4": null,
"step-5": null,
"step-ids": [
0
]
} | [
0
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print(int(abs(K))) if K.is_integer() else print('IMPOSSIBLE')
<|reserved_special_token_1|>
A, B = map(int, input().split())
K = (B ** 2 - A ** 2) / (2 * A - 2 * B)
print(int(abs(K))) if K.is_integer() else print('IMPOSSIBLE')
| flexible | {
"blob_id": "36a7d3ed28348e56e54ce4bfa937363a64ee718f",
"index": 6981,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(int(abs(K))) if K.is_integer() else print('IMPOSSIBLE')\n",
"step-3": "A, B = map(int, input().split())\nK = (B ** 2 - A ** 2) / (2 * A - 2 * B)\nprint(int(abs(K))) if K.is_intege... | [
0,
1,
2
] |
#!/usr/bin/env python
import os
import sys
import click
import logging
from signal import signal, SIGPIPE, SIG_DFL
from ..helpers.file_helpers import return_filehandle
from ..helpers.sequence_helpers import get_seqio_fastq_record
signal(SIGPIPE, SIG_DFL)
def subset_fastq(fastq, subset):
'''Subset FASTQ file. P... | normal | {
"blob_id": "873a53983e3aeb66bd290450fb9c15a552bd163c",
"index": 4017,
"step-1": "<mask token>\n\n\n@click.command()\n@click.option('--fastq', help='FASTQ file to subset, can be compressed')\n@click.option('--subset', metavar='<INT>', help=\n 'Take every N reads (default:10)', default=10)\n@click.option('--lo... | [
1,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
def auth(role):
from core import admin_view, student_view, teacher_view
def deco(func):
def wrapper(*args, **kwargs):
if role == 'admin':
if admin_view.admin_user == None:
admin_view.login()
... | flexible | {
"blob_id": "e247ffb5b6e4319ff17d0b8ae9f67e10c282c4ff",
"index": 7348,
"step-1": "<mask token>\n",
"step-2": "def auth(role):\n from core import admin_view, student_view, teacher_view\n\n def deco(func):\n\n def wrapper(*args, **kwargs):\n if role == 'admin':\n if admin_v... | [
0,
1,
2
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
if os.path.exists(DATA_DIR):
override = input('Data exist, override (delete and re-parse)? (Y/n): ')
if override.lower() == 'y':
shutil.rmtree(DATA_DIR)
else:
parse = False
os.makedirs(DATA_DIR, exist_o... | flexible | {
"blob_id": "887ae9b7c629be679bf4f5fb4311c31bff605c73",
"index": 8874,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nif os.path.exists(DATA_DIR):\n override = input('Data exist, override (delete and re-parse)? (Y/n): ')\n if override.lower() == 'y':\n shutil.rmtree(DATA_DIR)\n else:\n ... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
def Hello_worlder(x):
a = []
for i in range(x):
a.append('Hello world')
for i in a:
print(i)
<|reserved_special_token_0|>
<|reserved_special_token_1|>
def Hello_worlder(x):
a = []
for i in range(x):
a.append('H... | flexible | {
"blob_id": "4f116f3eec9198a56a047ab42ed8e018ebb794bb",
"index": 3528,
"step-1": "<mask token>\n",
"step-2": "def Hello_worlder(x):\n a = []\n for i in range(x):\n a.append('Hello world')\n for i in a:\n print(i)\n\n\n<mask token>\n",
"step-3": "def Hello_worlder(x):\n a = []\n f... | [
0,
1,
2
] |
import sys
import math
from random import randrange
from utilities import *
from EffectiveThueLemma import *
def getZ(value):
s = str(value)
p10 = 1
if s[0] != '0':
p10 = 10
for i in range(1, len(s)):
if s[i] == '.':
break
p10 *= 10
z = []
first = int(s[0] == '0')
for i in range(first, len(s)):
if s... | normal | {
"blob_id": "2b3a7d0c28d1bf7d4400b0e5558b0527a96af781",
"index": 7658,
"step-1": "<mask token>\n\n\ndef Theorem4_9(n, b, R):\n if R >= n:\n raise ValueError('r* >= n')\n if b < 0 or b >= n:\n raise ValueError('b < 0 or b >= n')\n r, rr = n, b\n s, ss = 1, 0\n t, tt = 0, 1\n if r <... | [
3,
5,
6,
7,
8
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
while True:
if button_a.is_pressed():
music.pitch(400, 500)
<|reserved_special_token_1|>
from microbit import *
import music
while True:
if button_a.is_pressed():
music.pitch(400, 500)
| flexible | {
"blob_id": "356c817e254d8885beb447aa10759fff6a45ca25",
"index": 9454,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nwhile True:\n if button_a.is_pressed():\n music.pitch(400, 500)\n",
"step-3": "from microbit import *\nimport music\nwhile True:\n if button_a.is_pressed():\n music.... | [
0,
1,
2
] |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from keras.models import load_model
from utils import resize_to_fit, clear_chunks, stack_windows
from imutils import paths
import numpy as np
import imutils
import cv2 as cv2
import pickle
from tqdm import tqdm
c1_correct = 0
c2_correct = 0
c3_correct = 0
c4_correct ... | normal | {
"blob_id": "c2ddf31bce4a5f3ae2b0d5455bbc9942f92bff40",
"index": 275,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nwith open(MODEL_LABELS_FILENAME, 'rb') as f:\n lb = pickle.load(f)\n<mask token>\nfor root, dirs, files in os.walk(CAPTCHA_IMAGE_FOLDER):\n for name in tqdm(files, desc='Solving capt... | [
0,
1,
2,
3,
4
] |
import re, glob, os
lst = []
def rename(dir, pattern, titlePattern):
for pathAndFilename in glob.iglob(os.path.join(dir, pattern)):
title, ext = os.path.splitext(os.path.basename(pathAndFilename))
#title = title[22:]
#hexa = []
#hexb = []
hexa = title[:2]
hexb = title... | normal | {
"blob_id": "22aa6042b77c3cfd1f102a0ea22a43223e366d2f",
"index": 1476,
"step-1": "<mask token>\n\n\ndef rename(dir, pattern, titlePattern):\n for pathAndFilename in glob.iglob(os.path.join(dir, pattern)):\n title, ext = os.path.splitext(os.path.basename(pathAndFilename))\n hexa = title[:2]\n ... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def demo(myAPI):
myAPI.setAttr()
video_capture = cv2.VideoCapture(0)
print('Press q to quit: ')
while True:
ret, frame = video_capture.read()
frame = cv2.resize(frame, (320, 240))
key = cv... | flexible | {
"blob_id": "778ef68b5270657f75185b27dc8219b35847afa1",
"index": 5829,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef demo(myAPI):\n myAPI.setAttr()\n video_capture = cv2.VideoCapture(0)\n print('Press q to quit: ')\n while True:\n ret, frame = video_capture.read()\n fra... | [
0,
1,
2,
3,
4
] |
import importlib
class Scrapper:
def get_pos(str_lf, str_rg, text):
left = text.find(str_lf)
right = text.rfind(str_rg)
return left, right
def scrapper(prov):
scrapper = importlib.import_module('scrappers.{}'.format(prov))
return scrapper.scrape()
| normal | {
"blob_id": "67e06b6dddbd3f26295eaff921d1ad4a8b0e5487",
"index": 5580,
"step-1": "<mask token>\n\n\nclass Scrapper:\n <mask token>\n <mask token>\n",
"step-2": "<mask token>\n\n\nclass Scrapper:\n <mask token>\n\n def scrapper(prov):\n scrapper = importlib.import_module('scrappers.{}'.format... | [
1,
2,
3,
4
] |
#!/usr/bin/env python
'''
fix a time and then draw the instant geopotential (contour) from
/gws/nopw/j04/ncas_generic/users/renql/ERA5_subdaily/ERA5_NH_z_1989.nc,
spatial filtered relative vorticity (shaded) from
~/ERA5-1HR-lev/ERA5_VOR850_1hr_1995_DET/ERA5_VOR850_1hr_1995_DET_T63filt.nc
and identified feature poin... | normal | {
"blob_id": "09a468e11651eb60e0805c151bda270e0ebecca9",
"index": 4853,
"step-1": "<mask token>\n\n\ndef calc_frames(new_time):\n old_time = datetime(new_time.year - 1, 11, 30, 23)\n days = (new_time - old_time).days\n sec = (new_time - old_time).seconds\n hours = days * 24 + sec / 3600\n return in... | [
2,
3,
4,
5,
6
] |
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... | normal | {
"blob_id": "cb904408486ad9ea8cc0c8ff2ec393e480309a57",
"index": 2403,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nresult_dir = 'results'\ndata_dir = 'datasets'\ncache_dir = f'{ROOT_PATH}/data/cache'\nrun_dir_ignore = ['results', 'datasets', 'cache']\nuse_treeconnect = False\ntreeconnect_threshold = 1... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
if __name__ == '__main__':
dataset = pd.read_csv('./dataset.csv')
X_train, X_test, y_train, y_test = train_test_split(dataset['text'],
dataset['label'], test_size=0.2, random_state=1, shuffle=True)
baseline_pip... | flexible | {
"blob_id": "f82c961fc1accd362b34a685bac4cc35d98f44ef",
"index": 6371,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nif __name__ == '__main__':\n dataset = pd.read_csv('./dataset.csv')\n X_train, X_test, y_train, y_test = train_test_split(dataset['text'],\n dataset['label'], test_size=0.2, ... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
def test_config(app):
assert app.testing
<|reserved_special_token_1|>
# testa se uma aplicacao em modo de teste esta sendo construida
def test_config(app):
assert app.testing
| flexible | {
"blob_id": "96d7963faf720a3dc0d96b55ad65ee7ac83c1818",
"index": 5798,
"step-1": "<mask token>\n",
"step-2": "def test_config(app):\n assert app.testing\n",
"step-3": "# testa se uma aplicacao em modo de teste esta sendo construida\ndef test_config(app):\n assert app.testing\n",
"step-4": null,
"st... | [
0,
1,
2
] |
class Component:
pass
class Entity:
def __init__(self, id):
self.id = id
self.components = {}
def add_component(self, component):
if type(component) in self.components:
raise Exception("This entity already has a component of that type")
# Since there is only ... | normal | {
"blob_id": "14f7f31fa64799cdc08b1363b945da50841d16b5",
"index": 3020,
"step-1": "<mask token>\n\n\nclass System:\n <mask token>\n\n def bind_manager(self, manager):\n self.manager = manager\n <mask token>\n\n def process(self, entity, deltaTime):\n pass\n <mask token>\n <mask tok... | [
13,
14,
17,
18,
24
] |
#!/usr/bin/env python3
""" Greets the Pep Boys.
"""
for name in "Manny", "Moe", "Jack":
print("Hi ya", name + '!')
| normal | {
"blob_id": "81ff77064a299b4fcd456f341ecb40ba5afe3295",
"index": 1714,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor name in ('Manny', 'Moe', 'Jack'):\n print('Hi ya', name + '!')\n",
"step-3": "#!/usr/bin/env python3\n\"\"\" Greets the Pep Boys.\n\"\"\"\n\nfor name in \"Manny\", \"Moe\", \"Jac... | [
0,
1,
2
] |
# Converts text to speech in different accents. Requires pip3 install gTTS
from gtts import gTTS
import os
language_code = """
Language Code
-------- ----
Afrikaans af
Albanian sq
Arabic ar
Belarusian be
Bulgarian bg
Catalan ca
Chinese Simplified zh-CN
Chinese Traditional zh-T... | normal | {
"blob_id": "545053bc2b7c8687622d747673f2ad37b978014c",
"index": 3403,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(\"We're going to speak anything you type in a different accent\")\n<mask token>\nprint(language_code)\n<mask token>\nmyobj.save('texty.mp3')\nos.system('mpg321 texty.mp3')\n",
"st... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
def calculate(x):
return x * x
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def calculate(x):
return x * x
<|reserved_special_token_0|>
plt.plot(inputs, outputs)
plt.savefig('plot.png')
<|reserved_special_token_1|>
<|reserved_s... | flexible | {
"blob_id": "1b3891565f776064cfcca02fb22ea65853f7e66f",
"index": 3629,
"step-1": "<mask token>\n\n\ndef calculate(x):\n return x * x\n\n\n<mask token>\n",
"step-2": "<mask token>\n\n\ndef calculate(x):\n return x * x\n\n\n<mask token>\nplt.plot(inputs, outputs)\nplt.savefig('plot.png')\n",
"step-3": "<... | [
1,
2,
3,
4,
5
] |
from django.test import TestCase
from student.forms import StudentForm
class ModelTest(TestCase):
def test_expense_form_valid_data(self):
form = StudentForm(data={
'student_id': 500,
'firstName': "Emre",
'lastName': "Tan",
'department': "Panama",
... | normal | {
"blob_id": "6dc7c7de972388f3984a1238a2d62e53c60c622e",
"index": 6252,
"step-1": "<mask token>\n\n\nclass ModelTest(TestCase):\n\n def test_expense_form_valid_data(self):\n form = StudentForm(data={'student_id': 500, 'firstName': 'Emre',\n 'lastName': 'Tan', 'department': 'Panama', 'mathScor... | [
3,
4,
5,
6,
7
] |
import json
import os
from django.conf import settings
from django.db import models
from jsonfield import JSONField
class Word(models.Model):
value = models.CharField(
max_length=50,
verbose_name='Слово'
)
spelling = models.CharField(
max_length=250,
verbose_name='Транскри... | normal | {
"blob_id": "067e0129b1a9084bbcee28d1973504299b89afdb",
"index": 8911,
"step-1": "<mask token>\n\n\nclass Meaning(models.Model):\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n\n def __str__(self):\n if self.value is None:\n return ''\n return self.value[:20]... | [
13,
14,
15,
17,
19
] |
def filtra_acima(wires, origem):
return [wire for wire in wires if wire[0] > origem ]
def filtra_abaixo(wires, destino):
return [wire for wire in wires if wire[1] < destino ]
def calculate(wires):
count = 0
for i in xrange(len(wires)):
wires_acima = filtra_acima(wires, wires[i][0])
wir... | normal | {
"blob_id": "fa8d603fbea287161d31499f96a7fe7e56e8eaa1",
"index": 129,
"step-1": "def filtra_acima(wires, origem):\n return [wire for wire in wires if wire[0] > origem ]\n\ndef filtra_abaixo(wires, destino):\n return [wire for wire in wires if wire[1] < destino ]\n\ndef calculate(wires):\n count = 0\n ... | [
0
] |
<|reserved_special_token_0|>
class LatestBlessedModelStrategy(resolver.ResolverStrategy):
<|reserved_special_token_0|>
def _resolve(self, input_dict: Dict[str, List[types.Artifact]],
model_channel_key: str, model_blessing_channel_key: str):
all_models = input_dict[model_channel_key]
a... | flexible | {
"blob_id": "30df17d636c33d2824aad7d7ef6aae7db83615ec",
"index": 8058,
"step-1": "<mask token>\n\n\nclass LatestBlessedModelStrategy(resolver.ResolverStrategy):\n <mask token>\n\n def _resolve(self, input_dict: Dict[str, List[types.Artifact]],\n model_channel_key: str, model_blessing_channel_key: st... | [
3,
4,
5,
6,
7
] |
# Identify a vowel
class MainInit(object):
def __init__(self):
self.vowel = str(input("Please type the character: \n"))
if len(self.vowel) > 1:
print("Invalid number of character")
else:
Vowel(self.vowel)
class Vowel(object):
def __init__(self, vo... | normal | {
"blob_id": "8d9f4bce998857bcc7bc2fda0b519f370bf957fe",
"index": 1497,
"step-1": "<mask token>\n\n\nclass Vowel(object):\n <mask token>\n\n\n<mask token>\n",
"step-2": "<mask token>\n\n\nclass Vowel(object):\n\n def __init__(self, vowels):\n self.vowels = vowels\n self.list = ['a', 'e', 'i'... | [
1,
2,
3,
5,
6
] |
class Node:
def __init__(self, value):
self.value = value
self.next = None
<|reserved_special_token_0|>
def array_from_linked_list(head):
arr = []
cur = head
while cur:
arr.append(cur.value)
cur = cur.next
return arr
<|reserved_special_token_0|>
<|reserved_sp... | flexible | {
"blob_id": "e1eb86480fa4eadabf05f10cc54ff9daa790438c",
"index": 3935,
"step-1": "class Node:\n\n def __init__(self, value):\n self.value = value\n self.next = None\n\n\n<mask token>\n\n\ndef array_from_linked_list(head):\n arr = []\n cur = head\n while cur:\n arr.append(cur.valu... | [
3,
5,
7,
8,
9
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
class Solution:
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
class Solution:
def findAndReplacePattern(self, words: List[str], pattern: str) ->List[str
]:
def convert(word):
... | flexible | {
"blob_id": "e9ea48dec40e75f2fc73f8dcb3b5b975065cf8af",
"index": 5854,
"step-1": "<mask token>\n",
"step-2": "class Solution:\n <mask token>\n\n\n<mask token>\n",
"step-3": "class Solution:\n\n def findAndReplacePattern(self, words: List[str], pattern: str) ->List[str\n ]:\n\n def convert... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
if __name__ == '__main__':
fs = open('./src/keywords.txt', 'rb')
keywords = fs.read().decode('utf-8').split(',')
fs.close()
def find_features(doc):
words = set(doc)
features = {}
for word i... | flexible | {
"blob_id": "88590aef975f7e473ef964ee0c4004cff7e24b07",
"index": 1049,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nif __name__ == '__main__':\n fs = open('./src/keywords.txt', 'rb')\n keywords = fs.read().decode('utf-8').split(',')\n fs.close()\n\n def find_features(doc):\n words = ... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
class ComplexGrid:
def __init__(self, startFile):
self.weakened = set()
self.infected = set()
self.flagged = set()
posx = 0
with open(startFile, 'r') as fo:
for i, line in enumerate(fo):
line = line.rstrip()
... | flexible | {
"blob_id": "f840624ec11679d576fbb80f8e753c59663a7ee2",
"index": 9168,
"step-1": "<mask token>\n\n\nclass ComplexGrid:\n\n def __init__(self, startFile):\n self.weakened = set()\n self.infected = set()\n self.flagged = set()\n posx = 0\n with open(startFile, 'r') as fo:\n ... | [
6,
7,
11,
13,
14
] |
clear ;
clc;
%-----------------------读入图像-------------------------------------%
markbefore=imread('p203.bmp');
markbefore2=rgb2gray(markbefore);
mark=im2bw(markbefore2);
figure(1);
subplot(2,3,1);
imshow(mark),title('水印图像');
[rm,cm]=size(mark);
cover=imread('pic.bmp');
cover1=imresize(cover,[512... | normal | {
"blob_id": "56d3e59e3e077b1febb834668aba44ce8dba13ae",
"index": 635,
"step-1": "clear ;\nclc;\n \n%-----------------------读入图像-------------------------------------%\nmarkbefore=imread('p203.bmp');\nmarkbefore2=rgb2gray(markbefore);\nmark=im2bw(markbefore2); \nfigure(1); \nsubplot(2,3,1); \nimshow... | [
0
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
ii = [('CookGHP3.py', 2), ('MarrFDI.py', 1), ('GodwWSL2.py', 2), (
'ChanWS.py', 6), ('SadlMLP.py', 1), ('WilbRLW.py', 1), ('AubePRP2.py',
1), ('MartHSI2.py', 1), ('WilbRLW5.py', 1), ('KnowJMM.py', 1), (
'AubePRP.py', 2), ('ChalTPW2.py', 1), ('Cla... | flexible | {
"blob_id": "b80ccee42489aefb2858b8491008b252f6a2b9b7",
"index": 4864,
"step-1": "<mask token>\n",
"step-2": "ii = [('CookGHP3.py', 2), ('MarrFDI.py', 1), ('GodwWSL2.py', 2), (\n 'ChanWS.py', 6), ('SadlMLP.py', 1), ('WilbRLW.py', 1), ('AubePRP2.py', \n 1), ('MartHSI2.py', 1), ('WilbRLW5.py', 1), ('KnowJM... | [
0,
1
] |
from django.http import JsonResponse
from django.shortcuts import render
from phone_number_parser.forms import TextForm
import re
def parse_text(request):
###########################################################################
#
# Parse Text is the lone view for this project. A GET request renders a
... | normal | {
"blob_id": "d27a7ca04e12d50aca5a9f9db199102dbeb4e9f1",
"index": 7678,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef parse_text(request):\n if request.method == 'POST':\n text = request.POST.get('the_text')\n phone_number_list = []\n matches = re.findall(\n '\\... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
class Logistic(object):
<|reserved_special_token_0|>
def __init__(self, *args, **kwargs):
"""
Initializing the model parameter
:param args:
:param kwargs:
X_train,
Y_train,
X_test,
Y_test,
... | flexible | {
"blob_id": "63360ec9693a916375b49d0881008b1d7d4ec953",
"index": 4546,
"step-1": "<mask token>\n\n\nclass Logistic(object):\n <mask token>\n\n def __init__(self, *args, **kwargs):\n \"\"\"\n Initializing the model parameter\n :param args:\n :param kwargs:\n X_train,\n... | [
3,
4,
5,
6,
7
] |
from PenaltyTracker import PenaltyTracker
from DatabaseManager import DatabaseManager
import unittest,os,sys,shutil, filecmp
class TestingPenaltyTracker(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.testPTDatabase = os.path.join( os.getcwd(), "Tests", "test_penalty.db")
cls.testPena... | normal | {
"blob_id": "607d8bc79caa9d767bdb7e77a5db52295d90236f",
"index": 1759,
"step-1": "<mask token>\n\n\nclass TestingPenaltyTracker(unittest.TestCase):\n <mask token>\n\n @classmethod\n def tearDownClass(cls):\n cls.testPenaltyTracker = None\n cls.controlDatabase = None\n os.remove(os.p... | [
3,
5,
6,
7,
8
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
for lab in labels:
print(lab)
<|reserved_special_token_1|>
<|reserved_special_token_0|>
labels = np.load('DataVariationOther/w1_s500/targetTestNP.npy')
for lab in labels:
print(lab)
<|reserved_special_token_1|>
impor... | flexible | {
"blob_id": "a83988e936d9dee4838db61c8eb8ec108f5ecd3f",
"index": 4669,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor lab in labels:\n print(lab)\n",
"step-3": "<mask token>\nlabels = np.load('DataVariationOther/w1_s500/targetTestNP.npy')\nfor lab in labels:\n print(lab)\n",
"step-4": "impo... | [
0,
1,
2,
3
] |
#------------------------------------------------------------------------------
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
import wx
from .wx_control import WXControl
from ...components.image_view import AbstractTkImag... | normal | {
"blob_id": "d4198c2c3706e03ba1bce3e31c5139f01248a184",
"index": 5161,
"step-1": "<mask token>\n\n\nclass wxBitmapWidget(wx.Panel):\n <mask token>\n\n def __init__(self, parent):\n \"\"\" Initialize a wxBitmapWidget.\n\n Parameters\n ----------\n parent : wx.Window\n ... | [
18,
20,
25,
28,
31
] |
#print pathToConnectionsList(['A','C','B','D','E'])
#['EA','CB','AC','BD', 'DE']
#print independantPathPieces()
#print pathToConnectionsList(pathGenerator())
#print geneFormatToPathSegmentsMini(['CD', 'AB', 'BE', 'EC']) #DA
#print independantPathPieces(['EAC', 'CBD', 'ACB', 'BDE', 'DEA'])
#print greedyCrossover(['EC', ... | normal | {
"blob_id": "b4a96d5df56acd545e9919e202c462ee710a0339",
"index": 5339,
"step-1": "#print pathToConnectionsList(['A','C','B','D','E'])\n#['EA','CB','AC','BD', 'DE']\n#print independantPathPieces()\n#print pathToConnectionsList(pathGenerator())\n#print geneFormatToPathSegmentsMini(['CD', 'AB', 'BE', 'EC']) #DA\n#p... | [
0
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.Migration):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.Migration):
dependencies = [(... | flexible | {
"blob_id": "f96a7bef48e7df2899343029a2fae9697125a5b2",
"index": 5203,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass Migration(migrations.Migration):\n <mask token>\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass Migration(migrations.Migration):\n dependencies = [('gestionadmi... | [
0,
1,
2,
3,
4
] |
#!/usr/local/bin/python3.3
'''
http://projecteuler.net/problem=127()
abc-hits
Problem 127
The radical of n, rad(n), is the product of distinct prime factors of n. For example, 504 = 23 × 32 × 7, so rad(504) = 2 × 3 × 7 = 42.
We shall define the triplet of positive integers (a, b, c) to be an abc-hit if:
GCD(a, b) = ... | normal | {
"blob_id": "646f6a0afc3dc129250c26270dda4355b8cea080",
"index": 1003,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef problem127():\n GOAL = 120000\n rad = {}\n for primes in genFactors(GOAL):\n rad[product(primes)] = set(primes), product(set(primes))\n\n def relprime(s, t):\n ... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
message += """
Enter 'quit' to stop entering toppings"""
<|reserved_special_token_0|>
while True:
pizza = input(message1)
topping = input(message)
if topping == 'quit':
break
else:
pizzas[pizza] = ... | flexible | {
"blob_id": "bb3cba9847f2318a5043975e4b659265a7442177",
"index": 6309,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nmessage += \"\"\"\n Enter 'quit' to stop entering toppings\"\"\"\n<mask token>\nwhile True:\n pizza = input(message1)\n topping = input(message)\n if topping == 'quit':\n ... | [
0,
1,
2,
3
] |
def format_amount(a):
return a.replace(',', '').strip().replace('%', '').replace('$', '')
<|reserved_special_token_0|>
<|reserved_special_token_1|>
def format_amount(a):
return a.replace(',', '').strip().replace('%', '').replace('$', '')
def create_json(gdp, coords):
line_list = gdp.split('\n')
c... | flexible | {
"blob_id": "1cbc37655e28ab3082fc31baf119cb2bab96379b",
"index": 3661,
"step-1": "def format_amount(a):\n return a.replace(',', '').strip().replace('%', '').replace('$', '')\n\n\n<mask token>\n",
"step-2": "def format_amount(a):\n return a.replace(',', '').strip().replace('%', '').replace('$', '')\n\n\nd... | [
1,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.Migration):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.Migration):
dependencies = [(... | flexible | {
"blob_id": "321147f2e2d8caf6d9224e2a8969f51ded48baf7",
"index": 8130,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass Migration(migrations.Migration):\n <mask token>\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass Migration(migrations.Migration):\n dependencies = [('Site', '000... | [
0,
1,
2,
3,
4
] |
from django.db import models
from helpers.models import BaseAbstractModel
from Auth.models import Profile
# from Jobs.models import UserJob
from django.db.models.signals import post_save
from django.dispatch import receiver
# Create your models here.
class Notification(BaseAbstractModel):
title = models.CharField(m... | normal | {
"blob_id": "1066f86d3a35e892ca2a7054dfc89fe79f1d32c8",
"index": 7496,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass Notification(BaseAbstractModel):\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass Notification(... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
admin.site.register(TutorialsReview)
admin.site.register(TutorialsReviewComment)
<|reserved_special_token_1|>
from django.contrib import admin
from .models import TutorialsReview, TutorialsReviewComment
admin.site.register(Tuto... | flexible | {
"blob_id": "fea0619263b081f60ed0a4e178ef777a8d5dc988",
"index": 6500,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nadmin.site.register(TutorialsReview)\nadmin.site.register(TutorialsReviewComment)\n",
"step-3": "from django.contrib import admin\nfrom .models import TutorialsReview, TutorialsReviewCo... | [
0,
1,
2
] |
list1 = [('北京大洋路', '红蛋', '散框批发', '120-125', '44', '落', '8车'), ('北京回龙观',
'红蛋', '散框批发', '124', '44', '落', ''), ('北京石门', '红蛋', '散框批发', '124', '44',
'落', '')]
mysql_data = []
import numpy as np
for l in list1:
array = np.array(l)
tolist = array.tolist()
tolist.insert(0, 'ppp')
tolist.append('lll')
... | normal | {
"blob_id": "896d836ede533bad24f4077e5ba964105d96bf7a",
"index": 9485,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor l in list1:\n array = np.array(l)\n tolist = array.tolist()\n tolist.insert(0, 'ppp')\n tolist.append('lll')\n mysql_data.append(tolist)\nprint(mysql_data)\n<mask token... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.encoder = nn.Sequential(nn.Conv2d(1, 6, 5), nn.MaxPool2d(2, 2),
nn.ReLU(True), nn.Conv2d(6, 16, 5), nn.MaxPool2d(2, 2), nn.ReLU
(True))
self.classifier = nn.Sequ... | flexible | {
"blob_id": "70b08b9e8c1510a9be48a4bc1de39c6c85b36eed",
"index": 2426,
"step-1": "<mask token>\n\n\nclass Net(nn.Module):\n\n def __init__(self):\n super(Net, self).__init__()\n self.encoder = nn.Sequential(nn.Conv2d(1, 6, 5), nn.MaxPool2d(2, 2),\n nn.ReLU(True), nn.Conv2d(6, 16, 5), ... | [
5,
6,
7,
8,
10
] |
<|reserved_special_token_0|>
def translate(src, tgt, text):
mname = f'stas/wmt19-{src}-{tgt}'
tokenizer = FSMTTokenizer.from_pretrained(mname)
model = FSMTForConditionalGeneration.from_pretrained(mname)
encoded = tokenizer.encode(text, return_tensors='pt')
output = model.generate(encoded, num_beam... | flexible | {
"blob_id": "7864138459caf469a0148420718b2282598141de",
"index": 6674,
"step-1": "<mask token>\n\n\ndef translate(src, tgt, text):\n mname = f'stas/wmt19-{src}-{tgt}'\n tokenizer = FSMTTokenizer.from_pretrained(mname)\n model = FSMTForConditionalGeneration.from_pretrained(mname)\n encoded = tokenizer... | [
1,
3,
4,
5,
6
] |
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/... | normal | {
"blob_id": "6dbafbcf126c37edb2187eb28c01e2c1125c1c64",
"index": 7134,
"step-1": "<mask token>\n\n\nclass NEURON(NEURONCellTest):\n\n def __init__(self):\n super(NEURON, self).__init__()\n self.path = '../NEURON/granule.hoc'\n self.label = 'granule'\n self.resultsFile = 'results/ce... | [
5,
6,
7,
8,
9
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.Migration):
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
class Migration(migrations.Migration):
dependencies = [(... | flexible | {
"blob_id": "e5bf4518f3834c73c3743d4c711a8d1a4ce3b944",
"index": 6788,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\nclass Migration(migrations.Migration):\n <mask token>\n <mask token>\n",
"step-3": "<mask token>\n\n\nclass Migration(migrations.Migration):\n dependencies = [('lectures', ... | [
0,
1,
2,
3,
4
] |
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression, Lasso, Ridge
from sklearn import tree
import pickle as pk
X = pk.load(file=open('../data/temp/train.pkl', 'rb'))
y = pk.load(file=open('../data/temp/label.pkl', 'rb'))
X_train, X_test, y_train, y_test = train_test_... | normal | {
"blob_id": "539726df0e631c7a8edabf50fd739ee0497e3e97",
"index": 5557,
"step-1": "<mask token>\n\n\ndef train_model(model_name):\n if model_name == 'LinearRegression':\n model = LinearRegression()\n model.fit(X_train, y_train)\n score = model.score(X_test, y_test)\n print(score)\n ... | [
1,
2,
3,
4,
5
] |
from random import random
import numpy as np
class TemperatureSensor:
sensor_type = "temperature"
unit="celsius"
instance_id="283h62gsj"
#initialisation
def __init__(self, average_temperature, temperature_variation, min_temperature, max_temperature):
self.a... | normal | {
"blob_id": "bc890f0f40a7e9c916628d491e473b5ecfa9bb9b",
"index": 740,
"step-1": "<mask token>\n\n\nclass TemperatureSensor:\n <mask token>\n <mask token>\n <mask token>\n\n def __init__(self, average_temperature, temperature_variation,\n min_temperature, max_temperature):\n self.average... | [
5,
7,
8,
9,
10
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
paramiko.util.log_to_file('syslogin.log')
<|reserved_special_token_0|>
t.connect(username=jumpuser, password=jumppass)
<|reserved_special_token_0|>
sftp.put(localpath, remotepath)
sftp.close()
<|reserved_special_token_0|>
ssh.set_... | flexible | {
"blob_id": "64cf6b03fb68be8a23c6e87c8d68d0a42db0eb54",
"index": 6451,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nparamiko.util.log_to_file('syslogin.log')\n<mask token>\nt.connect(username=jumpuser, password=jumppass)\n<mask token>\nsftp.put(localpath, remotepath)\nsftp.close()\n<mask token>\nssh.se... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
class DirectorySearchHandler(BaseHandler):
def initialize(self):
super(DirectorySearchHandler, self).initialize()
<|reserved_special_token_0|>
<|reserved_special_token_0|>
<|reserved_special_token_0|>
def ajax_get(self, uuid, isweb):
print('=' * 20)
... | flexible | {
"blob_id": "72ce7c48c9d1a7bcdbaead12648d03970663a11e",
"index": 3227,
"step-1": "<mask token>\n\n\nclass DirectorySearchHandler(BaseHandler):\n\n def initialize(self):\n super(DirectorySearchHandler, self).initialize()\n <mask token>\n <mask token>\n <mask token>\n\n def ajax_get(self, uui... | [
9,
10,
11,
13,
14
] |
from bs4 import BeautifulSoup
from pprint import pprint
from scraper.sas.sas_models import SASEvent, SASCategory, SASCategoryStage, SASEventStage
from scraper.base_models.models import Event, Category, CategoryStage, EventStage, Participant, Result
from scraper.sas.sas_config import DESTINATION_URL, MTB_EVENT_TYPE, YE... | normal | {
"blob_id": "ecc351cf95254e0bbc5021eff11c500fa0950bd3",
"index": 2653,
"step-1": "<mask token>\n\n\ndef scrape_sas():\n pprint('Scraping Events')\n get_mtb_events()\n pprint('Getting categories and stages')\n for event in db.session.query(SASEvent):\n pprint(event.event_id)\n get_catego... | [
8,
9,
10,
11,
12
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
assert len(kwic.kwic(mystr)) == 3
<|reserved_special_token_1|>
<|reserved_special_token_0|>
mystr = """hello world
my test
apples oranges"""
assert len(kwic.kwic(mystr)) == 3
<|reserved_special_token_1|>
import kwic
mystr = ... | flexible | {
"blob_id": "1f21fdc9a198b31bb0d5bd6dd8f46a1b3b28ec94",
"index": 6773,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nassert len(kwic.kwic(mystr)) == 3\n",
"step-3": "<mask token>\nmystr = \"\"\"hello world\nmy test\napples oranges\"\"\"\nassert len(kwic.kwic(mystr)) == 3\n",
"step-4": "import kwic\n... | [
0,
1,
2,
3,
4
] |
# import tensorflow as tf
# from tensorflow.examples.tutorials.mnist import input_data
# mnist = input_data.read_data_sets('/tmp/data/',one_hot=True)
# def build_CNN_clasifier(x):
# x_image = tf.reshape (x, [-1,28,28,1])
#
# #layer1
# w_conv1 = tf.Variable(tf.truncated_normal(shape = [5,5,1,32],stddev= ... | normal | {
"blob_id": "a336434abc526357db0536955885cf076ee60f59",
"index": 7220,
"step-1": "<mask token>\n\n\ndef conv1d(x, w, p=0, s=1):\n w_rot = np.array(w[::-1])\n x_padded = np.array(x)\n if p > 0:\n zero_pad = np.zeros(shape=p)\n x_padded = np.concatenate([zero_pad, x_padded, zero_pad])\n r... | [
1,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
class Instruction(QWidget):
<|reserved_special_token_0|>
def set_background_instruction(self):
img = QPixmap('../images/background_instruction.jpg')
self.background_instruction.setPixmap(img)
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reser... | flexible | {
"blob_id": "da30cea4cfb1ffccabe708fe15e5a633b06d299f",
"index": 2265,
"step-1": "<mask token>\n\n\nclass Instruction(QWidget):\n <mask token>\n\n def set_background_instruction(self):\n img = QPixmap('../images/background_instruction.jpg')\n self.background_instruction.setPixmap(img)\n <m... | [
2,
3,
4,
5,
6
] |
<|reserved_special_token_0|>
class ycombinatorParser:
<|reserved_special_token_0|>
def getNextPage(pageurl):
response = requests.get(pageurl)
parsed_body = html.fromstring(response.text)
nextpage = parsed_body.xpath('//a[@class="morelink"]')
try:
nexthref = nextpag... | flexible | {
"blob_id": "87c27711c0089ca2c7e5c7d0e9edb51b9d4008d9",
"index": 6717,
"step-1": "<mask token>\n\n\nclass ycombinatorParser:\n <mask token>\n\n def getNextPage(pageurl):\n response = requests.get(pageurl)\n parsed_body = html.fromstring(response.text)\n nextpage = parsed_body.xpath('//... | [
3,
4,
5,
6,
7
] |
#!/usr/bin/env python3
# -*- coding=utf-8 -*-
# description:
# author:jack
# create_time: 2017/12/30
"""
卡片基类
"""
import logging
class BaseCard(object):
def __init__(self, field=[]):
self.data = {}
self.support_set_field = field
def add_cue_words(self, arr):
"""
为卡片添加cue wor... | normal | {
"blob_id": "93e5852df00733c024a59d37699bae58bd893030",
"index": 112,
"step-1": "<mask token>\n\n\nclass BaseCard(object):\n <mask token>\n <mask token>\n <mask token>\n <mask token>\n\n def __getattr__(self, item):\n \"\"\"\n 添加魔术方法\n :param item:\n :return:\n \... | [
2,
3,
4,
7,
9
] |
from flask import Flask, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
import os
# Init app
app = Flask(__name__)
basedir = os.path.abspath(os.path.dirname(__file__))
# Database
app.config['SQLALCHEM_DATABASE_URI'] = 'sqlite///' + \
os.path.join(basedir, 'db.sql... | normal | {
"blob_id": "ccb131171472d0a92d571e94453be97b323b4484",
"index": 7081,
"step-1": "<mask token>\n\n\nclass ProductSchema(ma.Schema):\n\n\n class Meta:\n fields = 'id', 'name', 'description', 'price', 'qty'\n\n\n<mask token>\n",
"step-2": "<mask token>\n\n\nclass Product(db.Model):\n id = db.Column(... | [
1,
3,
4,
5,
7
] |
from joecceasy import Easy
def main():
paths = ['..','.']
absOfEntries = [ i.abs for i in Easy.WalkAnIter(paths) ]
for i in absOfEntries:
print( i )
if __name__=='__main__':
main()
"""
def main(maxEntries = 99):
i = -1
print( "Walker test, Walking cu... | normal | {
"blob_id": "b720a52f1c2e6e6be7c0887cd94441d248382242",
"index": 1836,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef main():\n paths = ['..', '.']\n absOfEntries = [i.abs for i in Easy.WalkAnIter(paths)]\n for i in absOfEntries:\n print(i)\n\n\n<mask token>\n",
"step-3": "<mask... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
@app.route('/verify', methods=['GET', 'POST'])
def verify():
content = request.get_json(silent=True, force=True)
print(content)
if content == None:
return jsonify('No json data is sent.')
sig = content.get('sig')
payload = content.get('payload')
message = p... | flexible | {
"blob_id": "8bae45de54535e7b0788aa12717645ae9f193664",
"index": 8113,
"step-1": "<mask token>\n\n\n@app.route('/verify', methods=['GET', 'POST'])\ndef verify():\n content = request.get_json(silent=True, force=True)\n print(content)\n if content == None:\n return jsonify('No json data is sent.')\... | [
1,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
STOP_WORDS = set(
"""
あそこ
あたり
あちら
あっち
あと
あな
あなた
あれ
いくつ
いつ
いま
いや
いろいろ
うち
おおまか
おまえ
おれ
がい
かく
かたち
かやの
から
がら
きた
くせ
ここ
こっち
こと
ごと
こちら
ごっちゃ
これ
これら
ごろ
さまざま
さらい
さん
しかた
しよう
すか
ずつ
すね
すべて
ぜんぶ
そう
そこ
そちら
そっち
そで
それ
それぞれ
それなり
たくさん
たち
たび
ため
だめ
... | flexible | {
"blob_id": "254afebcc909c805d1e4972a0910eb4451d1e64e",
"index": 8704,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nSTOP_WORDS = set(\n \"\"\"\nあそこ\nあたり\nあちら\nあっち\nあと\nあな\nあなた\nあれ\nいくつ\nいつ\nいま\nいや\nいろいろ\nうち\nおおまか\nおまえ\nおれ\nがい\nかく\nかたち\nかやの\nから\nがら\nきた\nくせ\nここ\nこっち\nこと\nごと\nこちら\nごっちゃ\nこれ\nこれら\nごろ\nさま... | [
0,
1,
2
] |
# csv URL
url = "https://covid19-dashboard.ages.at/data/CovidFallzahlen.csv"
# read csv from URL
import pandas as pd
import geopandas as gpd
import numpy as np
df=pd.read_csv(url,sep=";")
df.to_csv("/var/www/FlaskApp/FlaskApp/data/covid_data.csv",sep=";",index=False)
# transforming timestamps to proper DateTime forma... | normal | {
"blob_id": "516ea681a55255e4c98e7106393180f9ad2e0250",
"index": 8455,
"step-1": "<mask token>\n\n\ndef csv_parser(statement):\n import psycopg2\n return_ls = []\n try:\n connection = psycopg2.connect(user='icu_bot', password=\n '5B2xwP8h4Ln4Y8Xs', host='85.214.150.208', port='5432',\n... | [
1,
2,
3,
4,
5
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def solution(files):
ans = []
for i, file in enumerate(files):
head, number, tail = divide(file)
ans.append((head, number, i))
ans.sort(key=lambda x: [x[0], x[1], x[2]])
answer = []
for h, n, ... | flexible | {
"blob_id": "75837ab778e94693151de1c17b59e12f8b2336d3",
"index": 8341,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef solution(files):\n ans = []\n for i, file in enumerate(files):\n head, number, tail = divide(file)\n ans.append((head, number, i))\n ans.sort(key=lambda x: ... | [
0,
1,
2
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
sys.path.insert(0, os.path.abspath('adjust_schedule_function'))
<|reserved_special_token_1|>
import sys, os
sys.path.insert(0, os.path.abspath('adjust_schedule_function'))
<|reserved_special_token_1|>
import sys, os
sys.pat... | flexible | {
"blob_id": "19126e5041841ab1320730ae82d66c6900cf31bd",
"index": 9145,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nsys.path.insert(0, os.path.abspath('adjust_schedule_function'))\n",
"step-3": "import sys, os\nsys.path.insert(0, os.path.abspath('adjust_schedule_function'))\n",
"step-4": "import sy... | [
0,
1,
2,
3
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def login(username, password):
data = {'login': username, 'pwd': password, 'lang': ''}
r = requests.post('http://dms-pit.htb/seeddms51x/seeddms/op/op.Login.php',
data=data, allow_redirects=False)
if (r.header... | flexible | {
"blob_id": "ae84b449c8919f14954633b14993e6291501bc24",
"index": 1019,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef login(username, password):\n data = {'login': username, 'pwd': password, 'lang': ''}\n r = requests.post('http://dms-pit.htb/seeddms51x/seeddms/op/op.Login.php',\n da... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
finalImg.save('Q2.jpg')
<|reserved_special_token_1|>
<|reserved_special_token_0|>
filename = 'hw0_data/westbrook.jpg'
im = Image.open(filename)
imgs = np.array(im)
imgsDiv2 = np.trunc(imgs / 2)
imgInt = imgsDiv2.astype(np.int)
... | flexible | {
"blob_id": "6e78d1fb2364d334f47fea89b065d859c025ca2f",
"index": 5648,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfinalImg.save('Q2.jpg')\n",
"step-3": "<mask token>\nfilename = 'hw0_data/westbrook.jpg'\nim = Image.open(filename)\nimgs = np.array(im)\nimgsDiv2 = np.trunc(imgs / 2)\nimgInt = imgsDiv... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
print(proto_images_se_list.shape)
print(proto_images_bse_list.shape)
np.save('Data/SE_prototypes.npy', proto_images_se_list)
np.save('Data/BSE_prototypes.npy', proto_images_bse_list)
<|reserved_special_token_1|>
<|reserved_spec... | flexible | {
"blob_id": "af7af5d1048d2b0968e831aad89d5baf30cab608",
"index": 3210,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nprint(proto_images_se_list.shape)\nprint(proto_images_bse_list.shape)\nnp.save('Data/SE_prototypes.npy', proto_images_se_list)\nnp.save('Data/BSE_prototypes.npy', proto_images_bse_list)\n... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def to_string(pessoa):
for linha in pessoa:
print('id: {}\nNome: {}'.format(linha[0], linha[1]))
<|reserved_special_token_0|>
<|reserved_special_token_1|>
<|reserved_special_token_0|>
def to_string(pessoa):
... | flexible | {
"blob_id": "4246773a8da61ff21d5faa8ab8ad2d7e75fafb60",
"index": 3058,
"step-1": "<mask token>\n",
"step-2": "<mask token>\n\n\ndef to_string(pessoa):\n for linha in pessoa:\n print('id: {}\\nNome: {}'.format(linha[0], linha[1]))\n\n\n<mask token>\n",
"step-3": "<mask token>\n\n\ndef to_string(pess... | [
0,
1,
2,
3,
4
] |
from django import forms
from .models import User,Profile
from django.contrib.auth.forms import UserCreationForm
class ProfileForm(forms.ModelForm):
''' Form for the profile '''
class Meta:
model = Profile
exclude = ('user',) ## we will create the user with the signals
class SignUpForm(Use... | normal | {
"blob_id": "7c3569c43d27ba605c0dba420690e18d7f849965",
"index": 7372,
"step-1": "<mask token>\n\n\nclass SignUpForm(UserCreationForm):\n \"\"\" Sign up form fetching form the User creation form\n and the email and password is necessary not the user \"\"\"\n\n\n class Meta:\n model = User\n ... | [
2,
3,
4,
5,
6
] |
import pandas as pd
import glob
import string
import os
ALLOWED_CHARS = string.ascii_letters + "-,. \"()'"
def concat_all_data(path : str = 'Data/*.csv', save_path : str = 'Data/final.csv'):
csvs = glob.glob(path)
li = []
for csv in csvs:
df = pd.read_csv(csv)
li.append(df)
final_... | normal | {
"blob_id": "0a5e30483c1fde10410c442a1ccd1f79bfb329c8",
"index": 8457,
"step-1": "<mask token>\n\n\ndef concat_all_data(path: str='Data/*.csv', save_path: str='Data/final.csv'):\n csvs = glob.glob(path)\n li = []\n for csv in csvs:\n df = pd.read_csv(csv)\n li.append(df)\n final_df = pd... | [
4,
5,
6,
7,
8
] |
#!/usr/bin/python
from setuptools import setup, find_packages
import os
EXTRAS_REQUIRES = dict(
test=[
'pytest>=2.2.4',
'mock>=0.8.0',
'tempdirs>=0.0.8',
],
dev=[
'ipython>=0.13',
],
)
# Tests always depend on all other requirements, except dev
for k,v in EX... | normal | {
"blob_id": "f531af47431055866db72f6a7181580da461853d",
"index": 6780,
"step-1": "<mask token>\n",
"step-2": "<mask token>\nfor k, v in EXTRAS_REQUIRES.iteritems():\n if k == 'test' or k == 'dev':\n continue\n EXTRAS_REQUIRES['test'] += v\n<mask token>\nwith open(path) as fp:\n long_description... | [
0,
1,
2,
3,
4
] |
<|reserved_special_token_0|>
<|reserved_special_token_1|>
'''
8-6. 도시 이름
도시와 국가 이름을 받는 city_country() 함수를 만드세요. 이 함수는 다음과 같은 문자열을 반환해야 합니다.
'Santiago, Chile'
- 최소한 세 개의 도시-국가 쌍으로 함수를 호출하고 반환값을 출력하세요.
Output:
santiago, chile
ushuaia, argentina
longyearbyen, svalbard
'''
| flexible | {
"blob_id": "2d5abcd75dcbeb1baa3f387035bdcc3b7adbfe3f",
"index": 7856,
"step-1": "<mask token>\n",
"step-2": "'''\n8-6. 도시 이름\n도시와 국가 이름을 받는 city_country() 함수를 만드세요. 이 함수는 다음과 같은 문자열을 반환해야 합니다.\n'Santiago, Chile'\n- 최소한 세 개의 도시-국가 쌍으로 함수를 호출하고 반환값을 출력하세요.\n\nOutput:\nsantiago, chile\nushuaia, argentina\nlongye... | [
0,
1
] |
"""Gaussian mixture model, with Stochastic EM algorithm."""
import numpy as np
from sklearn.mixture.gaussian_mixture import _estimate_gaussian_parameters, _compute_precision_cholesky
from Core.gllim import MyGMM
class SEMGaussianMixture(MyGMM):
"""Remarque : on utilise la variable Y pour les observations, au li... | normal | {
"blob_id": "39475626b7e3e0f4c8143b300c002a2eb50cc23a",
"index": 9341,
"step-1": "<mask token>\n\n\nclass SEMGaussianMixture(MyGMM):\n <mask token>\n <mask token>\n\n def _draw_conditionnal_Z(self, Y):\n \"\"\"\n Tire un échantillon de loi Z sachant Y\n\n :param Y: Observations (n_s... | [
8,
9,
10,
11,
12
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.