text stringlengths 232 16.3k | domain stringclasses 1
value | difficulty stringclasses 3
values | meta dict |
|---|---|---|---|
<|fim_prefix|># repo: meldafrawi/longhorn-tests path: /engine/validation-test/storagetest/core/test_longhorn_basic.py
from common_fixtures import * # NOQA
import websocket as ws
import base64
import pytest
VOLUME_DRIVER = "rancher-longhorn"
STACK_NAME_PREFIX = "volume-"
CONTROLLER = "controller"
REPLICA = "replica... | code_fim | hard | {
"lang": "python",
"repo": "meldafrawi/longhorn-tests",
"path": "/engine/validation-test/storagetest/core/test_longhorn_basic.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> # review utc's
url(r"^review/all/$", review.UTCReview.as_view(), name="review_all"),
url(r"^review/yourall/$", review.UTCYourReview.as_view(), name="review_your_all"),
url(r"^review/utc/(?P<pk>\d+)/$", review.UTCInstances.as_view(), name="review_utc"),
url(r"^review/frequency/$", revie... | code_fim | hard | {
"lang": "python",
"repo": "randlet/qatrackplus-ci",
"path": "/qatrack/qa/urls.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: randlet/qatrackplus-ci path: /qatrack/qa/urls.py
from django.conf.urls import include, url
from tastypie.api import Api
import qatrack.qa.views.admin
from qatrack.qa import api
from .views import admin, backup, base, charts, perform, review
v1_api = Api(api_name="v1")
resources = [
api.Tes... | code_fim | hard | {
"lang": "python",
"repo": "randlet/qatrackplus-ci",
"path": "/qatrack/qa/urls.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: MartinXPN/EPE-DARTS path: /epe_darts/architect.py
""" Architect controls architecture of cell by computing gradients of alphas """
import torch
class Architect:
""" Compute gradients of alphas """
def __init__(self, net, v_net, w_momentum, w_weight_decay,
normal_none_... | code_fim | hard | {
"lang": "python",
"repo": "MartinXPN/EPE-DARTS",
"path": "/epe_darts/architect.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> def compute_hessian(self, dw, trn_X, trn_y, epsilon: float = 0.01):
"""
dw = dw` { L_val(w`, alpha) }
w+ = w + eps * dw
w- = w - eps * dw
hessian = (dalpha { L_trn(w+, alpha) } - dalpha { L_trn(w-, alpha) }) / (2*eps)
eps = 0.01 / ||dw||
"""
... | code_fim | hard | {
"lang": "python",
"repo": "MartinXPN/EPE-DARTS",
"path": "/epe_darts/architect.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>for item in tqdm(a):
myobj = {'matrix': item, 'type': 'v1'}
x = requests.post(url, data = myobj)<|fim_prefix|># repo: covidmulator/EpidemicEnv path: /test.py
import requests
import json
import tqdm
with open('./result.json', 'r') as f:
a = json.load(f)
<|fim_middle|>url = 'http://13.59.81.160:300... | code_fim | easy | {
"lang": "python",
"repo": "covidmulator/EpidemicEnv",
"path": "/test.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: covidmulator/EpidemicEnv path: /test.py
import requests
import json
import tqdm
<|fim_suffix|>url = 'http://13.59.81.160:3000/api/matrix'
for item in tqdm(a):
myobj = {'matrix': item, 'type': 'v1'}
x = requests.post(url, data = myobj)<|fim_middle|>with open('./result.json', 'r') as f:
a =... | code_fim | easy | {
"lang": "python",
"repo": "covidmulator/EpidemicEnv",
"path": "/test.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: AlexAznar/python-route53 path: /tests/utils.py
import route53
try:
from .credentials import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
except ImportError:
AWS_ACCESS_KEY_ID = None
AWS_SECRET_ACCESS_KEY = None
<|fim_suffix|> return route53.connect(
aws_access_key_id=AWS_ACCES... | code_fim | medium | {
"lang": "python",
"repo": "AlexAznar/python-route53",
"path": "/tests/utils.py",
"mode": "psm",
"license": "Python-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> """
All unit tests go through here for Route53Connection objects.
:rtype: Route53Connection
"""
return route53.connect(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
**kwargs
)<|fim_prefix|># repo: AlexAznar/python-route... | code_fim | easy | {
"lang": "python",
"repo": "AlexAznar/python-route53",
"path": "/tests/utils.py",
"mode": "spm",
"license": "Python-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: RAVIKANT-YADAV/AI-based-Digital-Voice.-assistance path: /takeCommand.py
import speech_recognition as sr
import speak_Function as sf
#import check_exetion_time as check_time
#import numba
def TakeCommand():
r = sr.Recognizer()
with sr.Microphone() as source:
print("\nLi... | code_fim | hard | {
"lang": "python",
"repo": "RAVIKANT-YADAV/AI-based-Digital-Voice.-assistance",
"path": "/takeCommand.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> try:
print("Recognizing....")
query = r.recognize_google(audio,language='en-in')
print(f"User said :{query}\n")
except Exception as e:
print(e)
print ("Sorry! I'm not understand Please say Again ........")
sf.speak ("Sorry... | code_fim | hard | {
"lang": "python",
"repo": "RAVIKANT-YADAV/AI-based-Digital-Voice.-assistance",
"path": "/takeCommand.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>mypath = '.'
files = [f for f in listdir(mypath) if isfile(join(mypath, f)) and f.find("test_") == 0]
files.sort()
res_final = True
for f_ in files:
if f_ not in exclude_set:
res = os.system("pytest " + f_ + " --no-cov "
"--doctest-modules --junitxml=junit/test-result... | code_fim | medium | {
"lang": "python",
"repo": "onnx/tensorflow-onnx",
"path": "/tests/keras2onnx_applications/nightly_build/run_all.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: onnx/tensorflow-onnx path: /tests/keras2onnx_applications/nightly_build/run_all.py
# SPDX-License-Identifier: Apache-2.0
import os
from os import listdir
from os.path import isfile, join
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--exclude')
args = parser.parse_args... | code_fim | hard | {
"lang": "python",
"repo": "onnx/tensorflow-onnx",
"path": "/tests/keras2onnx_applications/nightly_build/run_all.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: whguswls58/Regression_Project path: /etc/oilprice.py
import os
import time
import numpy as np
import pandas as pd
from datetime import datetime
if not any([s=='result' for s in os.listdir('.')]):
os.mkdir('result')
if not any([s=='img' for s in os.listdir('.')]):
os.mkdir('img')
d... | code_fim | hard | {
"lang": "python",
"repo": "whguswls58/Regression_Project",
"path": "/etc/oilprice.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|># 출력
now = datetime.now().strftime('%Y%m%d%H%M%S')
with pd.ExcelWriter('result/oil_price_{}.xlsx'.format(now), 'xlsxwriter') as writer:
oil_price_du.to_excel(writer, '두바이유', index=False)
oil_price_brent.to_excel(writer, '브렌트유', index=False)
oil_price_wti.to_excel(writer, 'WTI', index=False)<|f... | code_fim | hard | {
"lang": "python",
"repo": "whguswls58/Regression_Project",
"path": "/etc/oilprice.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: BlueGreenMagick/sync-excel-with-anki path: /openpyxl/worksheet/tests/test_controls.py
from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
import pytest
from openpyxl.xml.functions import fromstring, tostring
from openpyxl.tests.helper import compare_xml
from openpyxl.drawi... | code_fim | hard | {
"lang": "python",
"repo": "BlueGreenMagick/sync-excel-with-anki",
"path": "/openpyxl/worksheet/tests/test_controls.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def test_from_xml(self, ControlProperty):
src = """
<controlPr
xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
autoLine="0">
<anchor moveWithCells="1">
<from>
<xdr:col>4</xdr:col>
<xdr:colOff>704... | code_fim | hard | {
"lang": "python",
"repo": "BlueGreenMagick/sync-excel-with-anki",
"path": "/openpyxl/worksheet/tests/test_controls.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: TheLazzziest/django-rest-framework-sso path: /rest_framework_sso/tokens.py
from django.conf import settings
from django.utils.module_loading import import_string
from rest_framework_simplejwt.exceptions import TokenError
from rest_framework_simplejwt.tokens import AccessToken, RefreshToken, Black... | code_fim | hard | {
"lang": "python",
"repo": "TheLazzziest/django-rest-framework-sso",
"path": "/rest_framework_sso/tokens.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
@property
def access_token(self):
"""
Returns an access token created from this refresh token. Copies all
claims present in this refresh token to the new access token except
those claims listed in the `no_copy_claims` attribute.
"""
access = import... | code_fim | hard | {
"lang": "python",
"repo": "TheLazzziest/django-rest-framework-sso",
"path": "/rest_framework_sso/tokens.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>class SSOAccessToken(AccessToken):
"""
SSO access token with additional claims:
"""
def set_issuer(self, claim=ISSUER):
"""
Set the issuer server of the payload
:param claim:
:return:
"""
if api_settings.ISSUER is not None:
self.... | code_fim | hard | {
"lang": "python",
"repo": "TheLazzziest/django-rest-framework-sso",
"path": "/rest_framework_sso/tokens.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> '''
Step through the input file swapping each byte with its neighbor
'''
def _fuzz(self):
"""swap bytes of input_file_path and write output to output_file_path"""
# we can calculate which bytes to swap based on the number of tries
# we've made on this seed... | code_fim | medium | {
"lang": "python",
"repo": "CERTCC/certfuzz",
"path": "/src/certfuzz/fuzzers/swap.py",
"mode": "spm",
"license": "LicenseRef-scancode-warranty-disclaimer",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: CERTCC/certfuzz path: /src/certfuzz/fuzzers/swap.py
"""This fuzzer module iterates through an input file, swapping neighboring
bytes.
"""
import logging
from certfuzz.fuzzers.fuzzer_base import MinimizableFuzzer
from certfuzz.fuzzers.errors import FuzzerExhaustedError
logger = logging... | code_fim | medium | {
"lang": "python",
"repo": "CERTCC/certfuzz",
"path": "/src/certfuzz/fuzzers/swap.py",
"mode": "psm",
"license": "LicenseRef-scancode-warranty-disclaimer",
"source": "the-stack-v2"
} |
<|fim_suffix|> if b >= len(self.input):
raise FuzzerExhaustedError('Iteration exceeds seed file length')
logger.debug('%s - swap bytes %d <-> %d', self.sf.basename, a, b)
self.input[b], self.input[a] = self.input[a], self.input[b]
self.output = self.input
_fuzzer_clas... | code_fim | hard | {
"lang": "python",
"repo": "CERTCC/certfuzz",
"path": "/src/certfuzz/fuzzers/swap.py",
"mode": "spm",
"license": "LicenseRef-scancode-warranty-disclaimer",
"source": "the-stack-v2"
} |
<|fim_suffix|>bba("", "y") → "yy"
# makeAbba("Bo", "Ya") → "BoYaYaBo"
# makeAbba("Ya", "Ya") → "YaYaYaYa"
#
#######################################################################################################################<|fim_prefix|># repo: sagarnikam123/learnNPractice path: /codingBat/python/string1/makeA... | code_fim | hard | {
"lang": "python",
"repo": "sagarnikam123/learnNPractice",
"path": "/codingBat/python/string1/makeAbba.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: sagarnikam123/learnNPractice path: /codingBat/python/string1/makeAbba.py
#######################################################################################################################
#
# makeAbba
#
# Given two strings, a and b, return the result of putting them together in<|fim_su... | code_fim | hard | {
"lang": "python",
"repo": "sagarnikam123/learnNPractice",
"path": "/codingBat/python/string1/makeAbba.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: dtienq/crawl-shop path: /examples/service/Schedule.py
import schedule
from .ShopeeCrawler import ShopeeCrawler
from .LazadaCrawler import LazadaCrawler
from ..base.base import session_factory
class Schedule:
<|fim_suffix|> print('Xóa dữ liệu trước khi quét')
ShopeeCrawler.craw(... | code_fim | medium | {
"lang": "python",
"repo": "dtienq/crawl-shop",
"path": "/examples/service/Schedule.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> ShopeeCrawler.craw()
LazadaCrawler.craw()<|fim_prefix|># repo: dtienq/crawl-shop path: /examples/service/Schedule.py
import schedule
from .ShopeeCrawler import ShopeeCrawler
from .LazadaCrawler import LazadaCrawler
from ..base.base import session_factory
class Schedule:
<|fim_middle|> ... | code_fim | hard | {
"lang": "python",
"repo": "dtienq/crawl-shop",
"path": "/examples/service/Schedule.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> print('Xóa dữ liệu trước khi quét')
ShopeeCrawler.craw()
LazadaCrawler.craw()<|fim_prefix|># repo: dtienq/crawl-shop path: /examples/service/Schedule.py
import schedule
from .ShopeeCrawler import ShopeeCrawler
from .LazadaCrawler import LazadaCrawler
from ..base.base import sess... | code_fim | medium | {
"lang": "python",
"repo": "dtienq/crawl-shop",
"path": "/examples/service/Schedule.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|># Fit the model
model.fit(X_train, y_train, validation_data=(X_test,y_test), epochs=650, batch_size=10000, class_weight=class_weights, callbacks=[earlyStopping])
model.evaluate(X_test, y_test)[1]*100
y_pred = model.predict_classes(X_train)
conf_mat = confusion_matrix(y_true=y_train, y_pred=y_pred)
print(... | code_fim | hard | {
"lang": "python",
"repo": "mrezaim/spn-classifier",
"path": "/src/NN-Deeplearning-keras.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>#Filter selected features
sel_f= np.array([ True, True, True, True, True, True, True, False, True,
True, False, True, True, True, False, True, True, False,
True, False, True, True, True, True, True, True, True,
False, True, False, False, True, True, True, Tru... | code_fim | hard | {
"lang": "python",
"repo": "mrezaim/spn-classifier",
"path": "/src/NN-Deeplearning-keras.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: mrezaim/spn-classifier path: /src/NN-Deeplearning-keras.py
'''
This program is a part of data prediction for Kaggle Santander Bank challenge
This code is for Neural network technique, it gets train on train set and predict on test set and outputs the CSV file for submit to Kaggle.
This code has ... | code_fim | hard | {
"lang": "python",
"repo": "mrezaim/spn-classifier",
"path": "/src/NN-Deeplearning-keras.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> # binarize the frame and highlight lane lines
binarized_img = binarize(undistorted_img)
# perspective transform to obtain bird's eye view
birdeye_img, matrix, inversed_matrix = birdeye(binarized_img, visualise=False)
# 2 order polynomial curve fit onto lane lines found
if proces... | code_fim | hard | {
"lang": "python",
"repo": "juncaofish/CarND-Advanced-Lane-Lines",
"path": "/main.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>if __name__ == '__main__':
# step 1: calibrate the camera
mtx, dist = calibrate('camera_cal')
mode = "video"
processed_frames = 0
line_lt, line_rt = Line(buffer_len=10), Line(buffer_len=10)
if mode == "image":
for test_img in glob.glob('test_images/*.jpg'):
im... | code_fim | medium | {
"lang": "python",
"repo": "juncaofish/CarND-Advanced-Lane-Lines",
"path": "/main.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: juncaofish/CarND-Advanced-Lane-Lines path: /main.py
import cv2
import glob
import numpy as np
from moviepy.editor import VideoFileClip
import matplotlib.image as mpimg
from utils import calibrate, undistort, binarize, birdeye, plt
from line_utils import Line, offset_from_lane_center, find_lane_b... | code_fim | hard | {
"lang": "python",
"repo": "juncaofish/CarND-Advanced-Lane-Lines",
"path": "/main.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>if __name__ == '__main__':
start = time()
solu = first_fib_with_n_digits(1000)
elapse = time() - start
print('Solution: {}'.format(solu))
print('Solution found in {:.8f}s'.format(elapse))<|fim_prefix|># repo: jcbrockschmidt/project_euler path: /p025/solution.py
#!/usr/bin/env python3
... | code_fim | hard | {
"lang": "python",
"repo": "jcbrockschmidt/project_euler",
"path": "/p025/solution.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: jcbrockschmidt/project_euler path: /p025/solution.py
#!/usr/bin/env python3
from math import log10
from time import time
<|fim_suffix|>if __name__ == '__main__':
start = time()
solu = first_fib_with_n_digits(1000)
elapse = time() - start
print('Solution: {}'.format(solu))
pr... | code_fim | hard | {
"lang": "python",
"repo": "jcbrockschmidt/project_euler",
"path": "/p025/solution.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: coveooss/json-schema-for-humans path: /tests/generate_test.py
"Additional Properties of any type are allowed.",
"Each additional property must conform to the following schema",
]
# badge for the first sub type with additionalProperties: false
badges = soup.find_all("span", c... | code_fim | hard | {
"lang": "python",
"repo": "coveooss/json-schema-for-humans",
"path": "/tests/generate_test.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>def test_with_default() -> None:
"""Test rendering of default values"""
soup = generate_case("with_default")
tests.html_schema_doc_asserts.assert_default_values(soup, ['"Linux"', '["white", "blue"]', "2"])
def test_deprecated_in_description() -> None:
"""Test finding whether a property ... | code_fim | hard | {
"lang": "python",
"repo": "coveooss/json-schema-for-humans",
"path": "/tests/generate_test.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: coveooss/json-schema-for-humans path: /tests/generate_test.py
a_doc_asserts.assert_descriptions(
soup,
[
"Exact address",
"Exact address",
"Delivery info depending on the delivery type",
"The delivery is a gift, no prices displayed",... | code_fim | hard | {
"lang": "python",
"repo": "coveooss/json-schema-for-humans",
"path": "/tests/generate_test.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> G = mycielski_graph(1)
assert_true(is_isomorphic(G, nx.empty_graph(1)))
G = mycielski_graph(2)
assert_true(is_isomorphic(G, nx.path_graph(2)))
G = mycielski_graph(3)
assert_true(is_isomorphic(G, cycle_graph(5)))
G = mycielski_graph(4)
assert_... | code_fim | hard | {
"lang": "python",
"repo": "holzschu/Carnets",
"path": "/Library/lib/python3.7/site-packages/networkx/generators/tests/test_mycielski.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> def test_construction(self):
G = nx.path_graph(2)
M = mycielskian(G)
assert_true(is_isomorphic(M, cycle_graph(5)))
def test_size(self):
G = nx.path_graph(2)
M = mycielskian(G, 2)
assert_equal(len(M), 11)
assert_equal(M.size(), 20)
def t... | code_fim | hard | {
"lang": "python",
"repo": "holzschu/Carnets",
"path": "/Library/lib/python3.7/site-packages/networkx/generators/tests/test_mycielski.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: holzschu/Carnets path: /Library/lib/python3.7/site-packages/networkx/generators/tests/test_mycielski.py
# test_mycielski.py - unit tests for the mycielski module
#
# Copyright 2010, 2011, 2012, 2013, 2014, 2015 NetworkX developers.
#
# This file is part of NetworkX.
#
# NetworkX is distributed un... | code_fim | medium | {
"lang": "python",
"repo": "holzschu/Carnets",
"path": "/Library/lib/python3.7/site-packages/networkx/generators/tests/test_mycielski.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> return x / options.tr
def ntr2time(x):
return x * options.tr
thrline = np.ones(time.shape) * options.thr
fig = plt.figure(figsize=figsize, dpi=dpi)
subplot = fig.add_subplot(211)
subplot.set_title('trigger and time')
subplot.set_ylim([-0.2, options.thr * 10])
... | code_fim | medium | {
"lang": "python",
"repo": "PeerHerholz/phys2bids",
"path": "/phys2bids/viz.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> def ntr2time(x):
return x * options.tr
thrline = np.ones(time.shape) * options.thr
fig = plt.figure(figsize=figsize, dpi=dpi)
subplot = fig.add_subplot(211)
subplot.set_title('trigger and time')
subplot.set_ylim([-0.2, options.thr * 10])
subplot.plot(time, trigger, '-'... | code_fim | medium | {
"lang": "python",
"repo": "PeerHerholz/phys2bids",
"path": "/phys2bids/viz.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: PeerHerholz/phys2bids path: /phys2bids/viz.py
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
SET_DPI = 100
FIGSIZE = (18, 10)
def plot_channel(table, channel, filename, figsize=FIGSIZE, dpi=SET_DPI):
plt.figure(figsize=figsize, dpi=dpi)
plt.title(channel)
... | code_fim | medium | {
"lang": "python",
"repo": "PeerHerholz/phys2bids",
"path": "/phys2bids/viz.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> return data.meta.id
def create( self, data, **kw ):
model = self.Meta.model( **data )
result = model.save()
pulse = model.build_pulse()
pulse.save()
return model
class Catalog_list( serializers.Serializer ):
pk = serializers.CharField( source='met... | code_fim | medium | {
"lang": "python",
"repo": "dem4ply/quetzalcoatl",
"path": "/catalog/serializers.py",
"mode": "spm",
"license": "WTFPL",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: dem4ply/quetzalcoatl path: /catalog/serializers.py
from chibi.snippet.dict import replace_keys
from .models import (
Catalog as Catalog_model,
Catalog_pulse as Catalog_pulse_model,
)
from chibi_django.serializers_fields import (
parametrise_hyperlink_identity_field
)
from rest_framewo... | code_fim | medium | {
"lang": "python",
"repo": "dem4ply/quetzalcoatl",
"path": "/catalog/serializers.py",
"mode": "psm",
"license": "WTFPL",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def create_cli_parser():
"""Create a parser to deal with command line switches.
"""
parser = argparse.ArgumentParser()
parser.add_argument('json_file', action='store',
type=str, help=('Outlier per threshold file. This file '
... | code_fim | hard | {
"lang": "python",
"repo": "softdevteam/warmup_experiment",
"path": "/bin/plot_outliers_by_threshold",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: softdevteam/warmup_experiment path: /bin/plot_outliers_by_threshold
#!/usr/bin/env python2.7
"""
Plot the effect of passing different values of -w to mark_outliers_in_json.
MUST be run after calculate_outliers_by_threshold.
"""
import argparse
import bz2
import json
import math
import matplotli... | code_fim | hard | {
"lang": "python",
"repo": "softdevteam/warmup_experiment",
"path": "/bin/plot_outliers_by_threshold",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> """
:param list_path:
:return:
"""
avatar_list = []
with open(list_path) as fin:
avatar_list = fin.readlines()
avatar_list = list(map(lambda x: x.split(' '), avatar_list))
return avatar_list<|fim_prefix|># repo: youbigfather/CreateGirlsMoe path: /src/statistics/dataset/utils.py
__aut... | code_fim | hard | {
"lang": "python",
"repo": "youbigfather/CreateGirlsMoe",
"path": "/src/statistics/dataset/utils.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: youbigfather/CreateGirlsMoe path: /src/statistics/dataset/utils.py
__author__ = 'Wendong Xu'
import os
import re
def get_image_path(raw_input_dir: str) -> list:
"""
get image path and id from root resource path.
:return: a list contains all images' path.
"""
result = []
for root, di... | code_fim | medium | {
"lang": "python",
"repo": "youbigfather/CreateGirlsMoe",
"path": "/src/statistics/dataset/utils.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def build_interface(iface, iface_type, enable, **settings):
'''
Build an interface script for a network interface.
CLI Example:
.. code-block:: bash
salt '*' ip.build_interface eth0 eth <settings>
'''
if iface_type != 'eth':
raise salt.exceptions.CommandExecutionE... | code_fim | hard | {
"lang": "python",
"repo": "thatch45/salt",
"path": "/salt/modules/nilrt_ip.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> CLI Example:
.. code-block:: bash
salt '*' ip.set_static_all interface-label address netmask gateway nameservers
'''
service = _interface_to_service(interface)
if not service:
raise salt.exceptions.CommandExecutionError('Invalid interface name: {0}'.format(interface))... | code_fim | hard | {
"lang": "python",
"repo": "thatch45/salt",
"path": "/salt/modules/nilrt_ip.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: thatch45/salt path: /salt/modules/nilrt_ip.py
portError:
HAS_PYCONNMAN = False
try:
import dbus
HAS_DBUS = True
except ImportError:
HAS_DBUS = False
log = logging.getLogger(__name__)
# Define the module's virtual name
__virtualname__ = 'ip'
SERVICE_PATH = '/net/connman/service/... | code_fim | hard | {
"lang": "python",
"repo": "thatch45/salt",
"path": "/salt/modules/nilrt_ip.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: sohonetlabs/dvbcss-synctiming path: /src/analyse.py
#!/usr/bin/env python
#
# Copyright 2015 British Broadcasting Corporation
#
# 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 Lice... | code_fim | hard | {
"lang": "python",
"repo": "sohonetlabs/dvbcss-synctiming",
"path": "/src/analyse.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> :param expected: list of expected times in units of sync time line clock
:param observed: list of tuples of (detected centre flash/pulse time, err bounds), in units of sync time line clock
:returns (index, timeDifferences): A tuple containing the index in the expected
timings correspo... | code_fim | hard | {
"lang": "python",
"repo": "sohonetlabs/dvbcss-synctiming",
"path": "/src/analyse.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: shnlmn/Rhino-Grasshopper-Scripts path: /IronPythonStubs/release/stubs.min/System/ComponentModel/__init___parts/PropertyChangedEventArgs.py
class PropertyChangedEventArgs(EventArgs):
"""
Provides data for the System.ComponentModel.INotifyPropertyChanged.PropertyChanged event.
<|fim_suffix|> ... | code_fim | medium | {
"lang": "python",
"repo": "shnlmn/Rhino-Grasshopper-Scripts",
"path": "/IronPythonStubs/release/stubs.min/System/ComponentModel/__init___parts/PropertyChangedEventArgs.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
Get: PropertyName(self: PropertyChangedEventArgs) -> str
"""<|fim_prefix|># repo: shnlmn/Rhino-Grasshopper-Scripts path: /IronPythonStubs/release/stubs.min/System/ComponentModel/__init___parts/PropertyChangedEventArgs.py
class PropertyChangedEventArgs(EventArgs):
"""
Provides data for the System.Co... | code_fim | medium | {
"lang": "python",
"repo": "shnlmn/Rhino-Grasshopper-Scripts",
"path": "/IronPythonStubs/release/stubs.min/System/ComponentModel/__init___parts/PropertyChangedEventArgs.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
Get: PropertyName(self: PropertyChangedEventArgs) -> str
"""<|fim_prefix|># repo: shnlmn/Rhino-Grasshopper-Scripts path: /IronPythonStubs/release/stubs.min/System/ComponentModel/__init___parts/PropertyChangedEventArgs.py
class PropertyChangedEventArgs(EventArgs):
"""
Provides data for the System.C... | code_fim | medium | {
"lang": "python",
"repo": "shnlmn/Rhino-Grasshopper-Scripts",
"path": "/IronPythonStubs/release/stubs.min/System/ComponentModel/__init___parts/PropertyChangedEventArgs.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
class Article(models.Model):
STATUS_SET = (
(0, "草稿"),
(1, "公开"),
)
title = models.CharField(max_length=128)
body = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
status = models.... | code_fim | medium | {
"lang": "python",
"repo": "sniperyen/MyDjango",
"path": "/restfulapi/models.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: sniperyen/MyDjango path: /restfulapi/models.py
# coding=utf-8
from django.db import models
class User(models.Model):
name = models.CharField(max_length=32)
mail = models.EmailField()
class Meta:
db_table = 'user'
<|fim_suffix|> STATUS_SET = (
(0, "草稿"),
... | code_fim | medium | {
"lang": "python",
"repo": "sniperyen/MyDjango",
"path": "/restfulapi/models.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: block42-blockchain-company/terra-node-telegram-bot path: /bot/constants/constants.py
import os
from constants.env_variables import DEBUG, LCD_ENDPOINT, NETWORK, NODE_IP
VALIDATORS_ENDPOINT = 'http://localhost:8000/validators.json' if DEBUG else f'{LCD_ENDPOINT}staking/validators'
NODE_STATUS_EN... | code_fim | medium | {
"lang": "python",
"repo": "block42-blockchain-company/terra-node-telegram-bot",
"path": "/bot/constants/constants.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>NODE_STATUSES = ["Unbonded", "Unbonding", "Bonded"]
JOB_INTERVAL_IN_SECONDS = 15
SENTRY_JOB_INTERVAL_IN_SECONDS = 30<|fim_prefix|># repo: block42-blockchain-company/terra-node-telegram-bot path: /bot/constants/constants.py
import os
from constants.env_variables import DEBUG, LCD_ENDPOINT, NETWORK, NODE... | code_fim | medium | {
"lang": "python",
"repo": "block42-blockchain-company/terra-node-telegram-bot",
"path": "/bot/constants/constants.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>x00\x00\x7f\x80\xff\xc1\x81\xc3\x01\x86\x03\x0c\x06\x18\x0c\x30\x30\x7f\xe0\xff\x81\x83\x83\x03\x06\x03\x0c\x06\x18\x06\x30\x0c\x60\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x00\x1f\x81\xff\x86\x06\x30\x00\xc0\x03\x00\x0e\x00\x1f\x00\x3f\xc0\x0f\x80\x07\x00\x0c\x00\x30\x00\xcc\x0e\x3f\xf8\x... | code_fim | hard | {
"lang": "python",
"repo": "elsafikhaled/SSD1963-TFT-Library-for-PyBoard",
"path": "/fonts/dejavu14.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>0\x00'\
b'\x03\x33\x33\x33\x33\x33\x33\x33\x33\x00\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x3c\x3c\x3f\xef\xe3\xc7\x87\x38\x38\x33\x03\x03\x30\x30\x33\x03\x03\x30\x30\x33\x03\x03\x30\x30\x33\x03\x03\x30\x30\x33\x03\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
... | code_fim | hard | {
"lang": "python",
"repo": "elsafikhaled/SSD1963-TFT-Library-for-PyBoard",
"path": "/fonts/dejavu14.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: elsafikhaled/SSD1963-TFT-Library-for-PyBoard path: /fonts/dejavu14.py
# Code generated by cfonts_to_trans_py.py
import TFTfont
_dejavu14 = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\xc... | code_fim | hard | {
"lang": "python",
"repo": "elsafikhaled/SSD1963-TFT-Library-for-PyBoard",
"path": "/fonts/dejavu14.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>.orders import (active_orders, cancel_all_active_orders,
cancel_all_session_orders, cancel_order,
get_trades_for_crypto, order, order_market, order_status)<|fim_prefix|># repo: jmfernandes/robin_stocks path: /robin_stocks/gemini/__init__.py
from .account import (... | code_fim | hard | {
"lang": "python",
"repo": "jmfernandes/robin_stocks",
"path": "/robin_stocks/gemini/__init__.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: jmfernandes/robin_stocks path: /robin_stocks/gemini/__init__.py
from .account import (check_available_balances, check_notional_balances,
check_transfers, get_account_detail,
get_approved_addresses, get_deposit_address<|fim_suffix|>.orders import (active... | code_fim | hard | {
"lang": "python",
"repo": "jmfernandes/robin_stocks",
"path": "/robin_stocks/gemini/__init__.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> See :meth:`~moe.optimal_learning.python.python_version.gaussian_process.GaussianProcess.compute_grad_cholesky_variance_of_points` for more details.
:param points_to_sample: num_to_sample points (in dim dimensions) being sampled from the GP
:type points_to_sample: array of float64 ... | code_fim | hard | {
"lang": "python",
"repo": "KukumavMozolo/MOE",
"path": "/moe/optimal_learning/python/python_version/integrated_gaussian_process.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: KukumavMozolo/MOE path: /moe/optimal_learning/python/python_version/integrated_gaussian_process.py
return marginal_mean_mat
def _build_integrated_term_maxtrix(self, covariance, points_sampled):
_hyperparameters = covariance.get_hyperparameters()
n = points_sampled.shape[0... | code_fim | hard | {
"lang": "python",
"repo": "KukumavMozolo/MOE",
"path": "/moe/optimal_learning/python/python_version/integrated_gaussian_process.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> """ Create a new template object.
This method will create a new template if necessary, add the
specialization, and store the template in the globals and the
template map. If a template already exists in the template map
but not in the globals, it indicates an error and an exception
... | code_fim | hard | {
"lang": "python",
"repo": "MatthieuDartiailh/enaml",
"path": "/enaml/core/compiler_helpers.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: MatthieuDartiailh/enaml path: /enaml/core/compiler_helpers.py
e, final=False)
elif kind == 'attr':
new = d_(Instance(store_type), final=False)
else:
raise RuntimeError("invalid kind '%s'" % kind)
if member is not None:
new.set_index(member.index)
new.c... | code_fim | hard | {
"lang": "python",
"repo": "MatthieuDartiailh/enaml",
"path": "/enaml/core/compiler_helpers.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> Parameters
----------
klass : type
The resolved declarative class for the node.
identifier : str
The local string identifier to associate with instances.
scope_key : object
The key for the local scope in the local storage maps.
store_locals : bool
... | code_fim | hard | {
"lang": "python",
"repo": "MatthieuDartiailh/enaml",
"path": "/enaml/core/compiler_helpers.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: crazybull44/fundscraper path: /fund/db.py
# -*- coding: utf-8 -*-
from pymongo import MongoClient
<|fim_suffix|> return database
DB = establish_connection()<|fim_middle|>from scrapy.conf import settings
def establish_connection():
connection = MongoClient(settings.get('MONGO', {})['hos... | code_fim | medium | {
"lang": "python",
"repo": "crazybull44/fundscraper",
"path": "/fund/db.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>def establish_connection():
connection = MongoClient(settings.get('MONGO', {})['host'])
database = connection[settings.get('MONGO', {})['database']]
return database
DB = establish_connection()<|fim_prefix|># repo: crazybull44/fundscraper path: /fund/db.py
# -*- coding: utf-8 -*-
from pymon... | code_fim | easy | {
"lang": "python",
"repo": "crazybull44/fundscraper",
"path": "/fund/db.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: lcopey/awake path: /main.py
import pyautogui
pyautogui.FAILSAFE = False
from pynput import keyboard
import time
import random
from datetime import datetime
<|fim_suffix|>running = True
if __name__ == '__main__':
print('press esc touch to escape')
listener = keyboard.Listener(on_press=on... | code_fim | medium | {
"lang": "python",
"repo": "lcopey/awake",
"path": "/main.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
running = True
if __name__ == '__main__':
print('press esc touch to escape')
listener = keyboard.Listener(on_press=on_press)
listener.start()
while running:
time.sleep(0.01)
x, y = random.randint(0, 10) - 5, random.randint(0, 10) - 5
pyautogui.moveRel(x, y)
... | code_fim | medium | {
"lang": "python",
"repo": "lcopey/awake",
"path": "/main.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: PuneethaPai/Genetic-Algorith path: /test/dna_test.py
import string
import unittest
from src.dna import DNA
from src.nucleotides import Nucleotides
class DNA_Test(unittest.TestCase):
nucleotides = Nucleotides(set(string.printable))
def test_dna_with_same_structure_are_equal(self):
... | code_fim | medium | {
"lang": "python",
"repo": "PuneethaPai/Genetic-Algorith",
"path": "/test/dna_test.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> dna = DNA("asdfghjkzxcvbnm")
mutated_dna = dna.mutate(20, self.nucleotides)
self.assertNotEqual(dna, mutated_dna)
self.assertEqual(len(dna.structure), len(mutated_dna.structure))
def test_dna_crossover(self):
dna1 = DNA("asdfghjkl")
dna2 = DNA("qwertyui... | code_fim | medium | {
"lang": "python",
"repo": "PuneethaPai/Genetic-Algorith",
"path": "/test/dna_test.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: anhaidgroup/py_entitymatching path: /py_entitymatching/dask/dask_rule_based_blocker.py
tadata('path_to_csv_dir/table_B.csv', key='id')
>>> block_f = em.get_features_for_blocking(A, B)
>>> rule = ['name_name_lev(ltuple, rtuple) > 3']
>>> rb.add_rule(... | code_fim | hard | {
"lang": "python",
"repo": "anhaidgroup/py_entitymatching",
"path": "/py_entitymatching/dask/dask_rule_based_blocker.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> rtable (DataFrame): The right input table.
l_output_attrs (list): A list of attribute names from the left
table to be included in the
output candidate set (defaults to None).
... | code_fim | hard | {
"lang": "python",
"repo": "anhaidgroup/py_entitymatching",
"path": "/py_entitymatching/dask/dask_rule_based_blocker.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: anhaidgroup/py_entitymatching path: /py_entitymatching/dask/dask_rule_based_blocker.py
l_key, r_key,
l_output_attrs_1,
... | code_fim | hard | {
"lang": "python",
"repo": "anhaidgroup/py_entitymatching",
"path": "/py_entitymatching/dask/dask_rule_based_blocker.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: eWaterCycle/ewatercycle path: /tests/src/config/test_config.py
from pathlib import Path, PosixPath
from textwrap import dedent
import pytest
from pydantic import ValidationError
from ewatercycle import CFG
from ewatercycle.config import Configuration
def test_config_object():
"""Test that... | code_fim | hard | {
"lang": "python",
"repo": "eWaterCycle/ewatercycle",
"path": "/tests/src/config/test_config.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>def test_dump_to_yaml():
config = Configuration()
content = config.dump_to_yaml()
expected = dedent(
"""\
apptainer_dir: .
container_engine: docker
grdc_location: .
output_dir: .
parameter_sets: {}
parameterset_dir: .
"""
)
... | code_fim | hard | {
"lang": "python",
"repo": "eWaterCycle/ewatercycle",
"path": "/tests/src/config/test_config.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def test_sender_fails(settings):
value = log_sender.LogSender(settings).fails
assert value is not None
def test_sender_queue(settings):
value = log_sender.LogSender(settings).queue
assert value is not None<|fim_prefix|># repo: conrad-strughold/GamestonkTerminal path: /tests/openbb_term... | code_fim | medium | {
"lang": "python",
"repo": "conrad-strughold/GamestonkTerminal",
"path": "/tests/openbb_terminal/core/log/collection/test_log_sender.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> log_sender.QueueItem(tmp_path).__str__()
def test_sender_settings(settings):
value = log_sender.LogSender(settings).settings
assert value is not None
def test_sender_fails(settings):
value = log_sender.LogSender(settings).fails
assert value is not None
def test_sender_queue(setti... | code_fim | easy | {
"lang": "python",
"repo": "conrad-strughold/GamestonkTerminal",
"path": "/tests/openbb_terminal/core/log/collection/test_log_sender.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: conrad-strughold/GamestonkTerminal path: /tests/openbb_terminal/core/log/collection/test_log_sender.py
from openbb_terminal.core.log.collection import log_sender
<|fim_suffix|> value = log_sender.LogSender(settings).settings
assert value is not None
def test_sender_fails(settings):
... | code_fim | medium | {
"lang": "python",
"repo": "conrad-strughold/GamestonkTerminal",
"path": "/tests/openbb_terminal/core/log/collection/test_log_sender.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: olgam4/GLO-3013_Pain path: /baseStation/src/ui/domain/subroutine/updateDirectionsSubroutine.py
import tkinter as tk
from tkinter import ttk, messagebox
from remote.domain.commandCallback import CommandCallback
from remote.domain.commandStatus import CommandStatus
from ui.domain.subroutine.iSubro... | code_fim | hard | {
"lang": "python",
"repo": "olgam4/GLO-3013_Pain",
"path": "/baseStation/src/ui/domain/subroutine/updateDirectionsSubroutine.py",
"mode": "psm",
"license": "WTFPL",
"source": "the-stack-v2"
} |
<|fim_suffix|> self._title = ttk.Label(self, text="Update Directions")
self._button = ttk.Button(self, text="Go!", command=self._button_click)
self._progress = ttk.Progressbar(self, mode='indeterminate')
def draw(self) -> None:
self.config(borderwidth=2, relief='groove', padding='2p'... | code_fim | hard | {
"lang": "python",
"repo": "olgam4/GLO-3013_Pain",
"path": "/baseStation/src/ui/domain/subroutine/updateDirectionsSubroutine.py",
"mode": "spm",
"license": "WTFPL",
"source": "the-stack-v2"
} |
<|fim_suffix|> _STROBE.__init__(self)
self.name = "STROBES"
self.specie = 'verbs'
self.basic = "strobe"
self.jsondata = {}<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/verbs/_strobes.py
from xai.brain.wordbase.verbs._strobe import _STROBE
#calss header
class _STROBES(_STROBE, ):
<|fim_middle... | code_fim | easy | {
"lang": "python",
"repo": "cash2one/xai",
"path": "/xai/brain/wordbase/verbs/_strobes.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/verbs/_strobes.py
from xai.brain.wordbase.verbs._strobe import _STROBE
#calss header
class _STROBES(_STROBE, ):
<|fim_suffix|> _STROBE.__init__(self)
self.name = "STROBES"
self.specie = 'verbs'
self.basic = "strobe"
self.jsondata = {}<|fim_middle... | code_fim | easy | {
"lang": "python",
"repo": "cash2one/xai",
"path": "/xai/brain/wordbase/verbs/_strobes.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
ax1 = plt.subplot2grid((1,1), (0,0),projection='3d')
ax1.scatter(outliers[comb_columns[0]],outliers[comb_columns[1]],outliers[comb_columns[2]],c='r',marker='*')
ax1.scatter(normals[comb_columns[0]],normals[comb_columns[1]],normals[comb_columns[2]],c='b',marker='o')
ax1... | code_fim | hard | {
"lang": "python",
"repo": "zanton123/HaSAPPy",
"path": "/program/LOF.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: zanton123/HaSAPPy path: /program/LOF.py
import numpy as np
import pandas as pd
from sklearn.neighbors import NearestNeighbors
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import matplotlib.patches as mPatch
from matplotlib.legend_handler import HandlerLine2D
import iter... | code_fim | hard | {
"lang": "python",
"repo": "zanton123/HaSAPPy",
"path": "/program/LOF.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> #Finally we draw the histogram of scores
fig=plt.figure(dpi=80, facecolor='w', edgecolor='k')
ax2 = plt.subplot2grid((1,1), (0,0))
ax2.hist(mergedData['Score'],bins=100,facecolor='cornflowerblue')
ax2.set_xlabel('LOF Score')
ax2.set_ylabel('Frequency')
ax2.set_ti... | code_fim | hard | {
"lang": "python",
"repo": "zanton123/HaSAPPy",
"path": "/program/LOF.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ShubhankarKG/VCS_learnings path: /vcs/VCSRepository.py
import os
import configparser
from .utils import repo_file
class VCSRepository(object):
"""A VCS Repository"""
worktree = None
vcsdir = None
conf = None
def __init__(self, path, force=False):
self.worktree = pat... | code_fim | hard | {
"lang": "python",
"repo": "ShubhankarKG/VCS_learnings",
"path": "/vcs/VCSRepository.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> # if mkdir:
# os.makedirs(path)
# return path
# else:
# return None
# def repo_default_config(self):
# ret = configparser.ConfigParser()
# ret.add_section("core")
# ret.set("core", "repositoryformatversion", "0")
# r... | code_fim | hard | {
"lang": "python",
"repo": "ShubhankarKG/VCS_learnings",
"path": "/vcs/VCSRepository.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: TwilioDevEd/lead-alerts-flask path: /lead_alerts/services/twilio_service.py
from lead_alerts import app
from twilio.rest import Client
class TwilioService:
<|fim_suffix|> # Find these values at https://twilio.com/user/account
account_sid = app.config['TWILIO_ACCOUNT_SID']
... | code_fim | hard | {
"lang": "python",
"repo": "TwilioDevEd/lead-alerts-flask",
"path": "/lead_alerts/services/twilio_service.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> def send_message(self, message):
agent_phone_number = app.config['AGENT_PHONE_NUMBER']
twilio_phone_number = app.config['TWILIO_PHONE_NUMBER']
self.client.messages.create(to=agent_phone_number,
from_=twilio_phone_number,
... | code_fim | hard | {
"lang": "python",
"repo": "TwilioDevEd/lead-alerts-flask",
"path": "/lead_alerts/services/twilio_service.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: naojsoft/qplan path: /qplan/util/calcpos.py
ef distance(self, tgt1, tgt2, time_start):
c1 = self.calc(tgt1, time_start)
c2 = self.calc(tgt2, time_start)
d_alt = c1.alt_deg - c2.alt_deg
d_az = c1.az_deg - c2.az_deg
return (d_alt, d_az)
def _set_site_da... | code_fim | hard | {
"lang": "python",
"repo": "naojsoft/qplan",
"path": "/qplan/util/calcpos.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> def morning_twilight_12(self, date=None):
"""Returns morning 12 degree (nautical) twilight in observer's time.
"""
self.site.horizon = self.horizon12
self._set_site_date(date)
r_date = self.site.next_rising(self.sun)
r_date = self.date_to_local(r_date.da... | code_fim | hard | {
"lang": "python",
"repo": "naojsoft/qplan",
"path": "/qplan/util/calcpos.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.