id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
29401 | <reponame>pulse2percept/pulse2percept
"""Utilities to download and import datasets.
* **Dataset loaders** can be used to load small datasets that come
pre-packaged with the pulse2percept software.
* **Dataset fetchers** can be used to download larger datasets from a given
URL and directly import them into puls... | StarcoderdataPython |
1632265 | from django.shortcuts import get_object_or_404
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from members.permissions import IsAnnotationApprover, IsProjectAdmin
from ..models import Example
from ..serializers import Approv... | StarcoderdataPython |
3203467 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
***************************************************************************
OtbChoiceWidget.py
------------------
Date : June 2017
Copyright : (C) 2017 by CS Systemes d'Information (CS SI)
Email : <EMAIL> dot <EMAIL> a... | StarcoderdataPython |
1748542 | # -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
# License: BSD 3 clause
"""
Detect mRNAs spots in the smFISH images.
"""
import os
import argparse
from utils import check_directories, initialize_script, end_script
from loader import get_fov_names
import bigfish.stack as stack
import bigfish.detection as detection... | StarcoderdataPython |
20084 | <filename>iris/src/iris/main.py
from matplotlib import pyplot as plt
import matplotlib.lines as lines
from statistics import mode, StatisticsError
from csv import QUOTE_ALL
import pandas as pd
import pathlib
import json
from iris import logger
from iris import config
from iris import classifier
from iris.he... | StarcoderdataPython |
3302777 | import colorsys
import svgpathtools
def generate_color(hue, saturation=1.0, value=1.0):
rgb = colorsys.hsv_to_rgb(hue, saturation, value)
return "rgb({},{},{})".format(*[int(x * 255) for x in rgb])
def visualize_pen_transits(paths, svg_file):
# We will construct a new image by storing (path, attribute)... | StarcoderdataPython |
147216 | <filename>Lib/site-packages/wx-2.8-msw-unicode/wx/lib/rpcMixin.py<gh_stars>10-100
#
# This was modified from rpcMixin.py distributed with wxPython
#
#----------------------------------------------------------------------
# Name: rpcMixin
# Version: 0.2.0
# Purpose: provides xmlrpc server functionality f... | StarcoderdataPython |
3244713 | from output.models.nist_data.list_pkg.token.schema_instance.nistschema_sv_iv_list_token_min_length_3_xsd.nistschema_sv_iv_list_token_min_length_3 import NistschemaSvIvListTokenMinLength3
__all__ = [
"NistschemaSvIvListTokenMinLength3",
]
| StarcoderdataPython |
1677755 | <reponame>etcher-be/igit<gh_stars>1-10
import os
import datetime
import requests_mock
from IGitt.GitLab import GitLabOAuthToken
from IGitt.GitLab.GitLabComment import GitLabComment
from IGitt.Interfaces.Comment import CommentType
from tests import IGittTestCase
class GitLabCommentTest(IGittTestCase):
def setU... | StarcoderdataPython |
1734599 |
import sys
sys.path.insert(0,'../../notebooks')
import convert_notebooks
all_notebooks = ['geoclaw_test1_index.ipynb',
'MakeInputFiles_test1.ipynb',
'RunGeoclaw_test1.ipynb']
run_notebooks = True
convert_notebooks.make_html(all_notebooks,run_notebooks)
| StarcoderdataPython |
3362638 | from dataclasses import dataclass
from paralleldomain.model.annotation.common import Annotation
@dataclass
class MaterialProperties2D(Annotation):
"""
Not Implemented yet!
"""
...
| StarcoderdataPython |
184924 | import re
g = input()
k = r'([a-zA-Z0-9])\1+'
print(re.search(k, g).groups()[0] if re.search(k, g) else -1)
| StarcoderdataPython |
1700738 | # Python Object Oriented Programming by <NAME> course example
# Creating immutable data classes
from dataclasses import dataclass
@dataclass(frozen=True) # "The "frozen" parameter makes the class immutable
class ImmutableClass:
value1: str = "Value 1"
value2: int = 0
def somefunc(self, newval):
... | StarcoderdataPython |
1718427 | <gh_stars>0
import traceback
from pyignite import Client
from pyignite.utils import is_hinted
from pyignite.exceptions import ReconnectError
import grpc
from ..extensions.context_vars import fabric_service, fabric_execution
from ..protocol import FabricService, FabricExecution, TaskCollection
from .connection import es... | StarcoderdataPython |
3267644 | # Copyright 2015 Brocade Communications System, Inc.
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | StarcoderdataPython |
4819050 | # -*- coding: utf-8 -*-
"""
Created on Sat May 2 16:44:07 2020
@author: rodri
"""
import pandas as pd
credito = pd.read_csv("Credit.csv")
# Pego as colunas separadas
dt=credito.iloc[:,[1,4,7]].values
from sklearn.preprocessing import StandardScaler, MinMaxScaler
# Faremos a padronização através do Z-score
sc ... | StarcoderdataPython |
4805579 | from Game import *
from Backpropagation import *
import pickle
import numpy as np
print("Imports completed. Starting...")
sim_file = open("simulations", "r")
simulations = pickle.load(sim_file)
print("Simulations loaded.")
def direction_to_vector(dir):
if dir == Direction.UP:
return np.arr... | StarcoderdataPython |
3269007 | <reponame>Brenner87/UsefulConfigsAndInfo
import datetime
import logging
import os
import re
import shutil
import time
import zipfile
from pathlib import PurePath, Path
import yaml
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s",
handle... | StarcoderdataPython |
1751430 | import logging
import invitations.views
from allauth.account.views import EmailView, LoginView, LogoutView
from allauth.account.views import PasswordChangeView as BasePasswordChangeView
from allauth.account.views import SignupView as BaseSignupView
from allauth.socialaccount.views import ConnectionsView as BaseConnect... | StarcoderdataPython |
3241746 | <filename>python/qisrc/test/test_groups.py<gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" QiBuild """
from __future__ import absolute_import
from __fu... | StarcoderdataPython |
77691 | import os
import cv2
import sys
import math
import pyprind
import torch
import numpy as np
import torch.tensor as Tensor
# import torch.nn.functional as F
import torchvision.transforms as transforms
import dl_modules.dataset as ds
epsilon = 0.008
def enhance_images(folder: str, denoise_strength: int,
... | StarcoderdataPython |
4836050 | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from lmfit import Model, Parameters, minimize, report_fit
from scipy.optimize import curve_fit
from scipy import stats
from utilities.statistical_tests import r_squared_calculator
from GEN_Utils import FileHandling... | StarcoderdataPython |
1681837 | from collections import MutableMapping
from past.builtins import basestring
from .registers import *
class CacheWrap(MutableMapping, object):
'''
A class designed to immitate the contents it holds with a capability to reload,
rebuild, destroy, or save it's contents without disrupting any reference... | StarcoderdataPython |
3318216 | import base64
import sys
import warnings
from typing import (
AbstractSet,
Any,
Callable,
Dict,
List,
Mapping,
MutableSequence,
Optional,
Set,
TYPE_CHECKING,
Tuple,
Type,
Union,
cast,
)
try:
import orjson as json
except ImportError: # pragma: no cover
im... | StarcoderdataPython |
1617077 | <reponame>language-ml/InformationRetrival
import os
import fnmatch
def recursive_glob(treeroot, pattern):
'''
:param treeroot: the path to the directory
:param pattern: the pattern of files
:return:
'''
results = []
for base, dirs, files in os.walk(treeroot):
good_files = fnmatch.f... | StarcoderdataPython |
1799597 |
from django import forms
import models
# PUBLISHED_CHOICES = (
# ("private", "Private Photo"),
# ("shared", "Shared Photo"),
# ("public", "Public Photo")
# )
class CreatePhotoForm(forms.ModelForm):
class Meta:
model = models.Photo
fields = ['title', 'description', 'published... | StarcoderdataPython |
1718234 | <gh_stars>0
# Generated by Django 3.0.8 on 2020-07-22 22:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('circles', '0003_invitation'),
]
operations = [
migrations.AlterField(
model_name='invitation',
name='use... | StarcoderdataPython |
46767 | <filename>custom_imports/importer/simple_finder.py<gh_stars>0
from dataclasses import dataclass, field
from types import ModuleType
from typing import Callable, Iterable, Optional, TypeVar
from custom_imports.importer.types import Finder
from custom_imports.utils import field_required
__all__ = ["SimpleFinder"]
LT =... | StarcoderdataPython |
3302970 | from __future__ import print_function
import unittest
import numpy as np
from SimPEG.data import Data
from SimPEG.potential_fields import gravity, magnetics
from SimPEG.electromagnetics.static import resistivity as dc
from SimPEG.utils.io_utils import (
write_grav3d_ubc,
read_grav3d_ubc,
write_gg3d_ubc,
... | StarcoderdataPython |
3323078 | <filename>django-demo/src/for_django_3-0/myapp/admin.py
from django.apps import apps
from django.contrib import admin
for model in apps.get_app_config('myapp').get_models():
admin.site.register(model)
| StarcoderdataPython |
1605581 | <reponame>PatGrow/OpenWeedLocator
import numpy as np
from time import strftime
import cv2
import os
def image_sample(image, centresList, saveDir, sideLength=200):
"""
Generates and saves random image crop around a target centre
:param image: input image to collect snapshot from
:param centresList: list... | StarcoderdataPython |
182690 | import solution
def test_solve():
cases = (
(('2 3', '0', '1 0'), 'Yes'),
(('2 3', '1 0', '1 1'), 'Yes'),
(('2 4', '1 0', '1 2'), 'No'),
(('4 6', '2 0 1', '0'), 'Yes'),
(('4 6', '1 0', '0'), 'No'),
)
for test, ans in cases:
n, m = [int(x) for x in test[0].sp... | StarcoderdataPython |
1770870 | import functools
def decorate(func):
def wrapper():
'''
add print
:return:
'''
print("www.51reboot.com")
func()
print("2014.08 51reboot start")
# return wrapper
return functools.wraps(func)(wrapper)
@decorate
def f1():
'''
logic f1
:... | StarcoderdataPython |
3203960 | <reponame>steveryb/super-auto-pets-ai<gh_stars>0
from sap.pet_impl import *
from sap.battle import Battle
from test_helpers import dummy_pet, TestRandom, DummyPlayer
import logging
class TestPetImplBattle:
def test_solo_mosquito(self):
b = Battle(
[Mosquito.spawn()], [dummy_pet(toughness=1)]
... | StarcoderdataPython |
171582 | <filename>tests/Object/test_rotatingObjects.py<gh_stars>0
import unittest
import src.Runtime.GeometryRuntime as GeometryRuntime
import src.UsefulFunctions as UsefulFunctions
from src.FrameModel.Object import Object
class TestRotatingObjects(unittest.TestCase):
def test_rotating_line_90_degrees(self):
obj... | StarcoderdataPython |
134734 | <gh_stars>1-10
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import numbers
import argparse
from tensorflow.python.platform import tf_logging as logging
def group_lasso_regularizer(scale, scope=None):
if is... | StarcoderdataPython |
3369441 | <filename>Class/Entity/Character/Fireman.py<gh_stars>0
from Class.Entity.Character.Character import Character, pygame
from Class.Entity.Projectile.RoundedProj import RoundedProj
from Functions.Controls.Mouse.mouse_pressed import mouse_pressed
class Fireman(Character):
def __init__(self, _w, _h, _m, _g, _hea... | StarcoderdataPython |
3256363 | import os
from options.test_options import TestOptions
from models import create_model
from util.util import tensor2labelim, tensor2confidencemap
from models.sne_model import SNE
import torchvision.transforms as transforms
import torch
import numpy as np
import cv2
import copy
import tqdm
import glob
class dataset():... | StarcoderdataPython |
3355101 | <reponame>modelop/fastscore-sdk
from .Slot import Slot
| StarcoderdataPython |
3205981 | <reponame>kazewong/nrpytutorial
# This module sets up an initial data function meant to
# be called in a pointwise manner at all gridpoints.
# Author: <NAME>
# zachetie **at** gmail **dot* com
from outputC import *
def ADM_ID_function_string(gammaCartDD,KCartDD,alphaCart,betaCartU,BCartU):
returnstring =... | StarcoderdataPython |
1715878 | from django.db import models
# Create your models here.
class Meeting(models.Model):
id = models.SmallAutoField(primary_key=True)
channel = models.TextField()
meeting_title = models.TextField(null=True,blank=True)
meeting_subject = models.TextField(null=True,blank=True)
start_time = models.TimeFie... | StarcoderdataPython |
1778690 | <filename>Golf_Lineups.py
from pydfs_lineup_optimizer import Site, Sport, get_optimizer, CSVLineupExporter
from pydfs_lineup_optimizer.context import OptimizationContext
from pydfs_lineup_optimizer import db_writer, PlayersGroup, Stack
from azure.cosmos import exceptions, CosmosClient, PartitionKey
import json
FileNa... | StarcoderdataPython |
3882 | # In[42]:
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt
# In[43]:
# describe the model
def deriv(y, t, N, beta, gamma, delta):
S, E, I, R = y
dSdt = -beta * S * I / N # S(t) – susceptible (de som är mottagliga för infektion).
dEdt = beta * S * I / N - gamma * ... | StarcoderdataPython |
1702920 | <reponame>openstack/freezer-api<gh_stars>10-100
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | StarcoderdataPython |
3396601 | import torch
import torchvision
import torch.nn.functional as F
# import os
# dirname = os.path.dirname(__file__)
# filename = os.path.join(dirname, 'relative/path/to/file/you/want')
def test_manual_data():
from pathlib import Path
import requests
DATA_PATH = Path("data")
PATH = DATA_PATH / "mnist"
... | StarcoderdataPython |
1665621 | import ConfigParser
class ConfigReader(object):
DEFAULT_SLEEP_TIME = 5
DEFAULT_EMAIL_SUBJECT = "API has changed "
RECEIVERS_DELIMITER = ","
def __init__(self):
self.config = ConfigParser.ConfigParser()
self.config.read("config.ini")
def read_sleep_time(self): #seconds
if self.config.has_option('time', '... | StarcoderdataPython |
3305665 | from typing import Any
import pytest
import libcnb
from tests.conftest import mock_layers
def test_get(mock_layers):
# WHEN
layer: libcnb.Layer = mock_layers.get("DNE")
# THEN
assert layer.name == "DNE"
assert layer.metadata_file.stem == "DNE"
assert layer.metadata == {}
assert layer.exe... | StarcoderdataPython |
192693 | from google.cloud import bigquery
client = bigquery.Client(project='gce-testailua')
query = "select item_id from `gce-testailua.endpoint_test.items` where item_id=%s;" % (id)
dataset = client.dataset('endpoint_test')
table = dataset.table(name='items')
job = client.run_async_query('my-job', query)
job.destination = ta... | StarcoderdataPython |
1639931 | <filename>day2/ex19_more_version.py
#!usr/bin/env python
from pprint import pprint
def get_file(file_name):
with open(file_name) as f:
return f.read().splitlines()
def print_serial(file_output):
sn = 'Processor board ID'
for line in file_output:
if sn in line:
# print line
... | StarcoderdataPython |
185298 | try:
from common import *
except:
from DAPPER.common import *
def simulate(setup,desc='Truth & Obs'):
"""Generate synthetic truth and observations."""
f,h,chrono,X0 = setup.f, setup.h, setup.t, setup.X0
# Init
xx = zeros((chrono.K+1,f.m))
xx[0] = X0.sample(1)
yy = zeros((chrono.KObs+1,h.m))
... | StarcoderdataPython |
89622 | from typing import Optional
from app import db
from app.models import JoinToken, Team
def team_by_join_token(join_token_str: str) -> Optional[Team]:
"""
Returns the team associated with a given join token.
:param join_token_str: The join token to search over
:return: Returns a Team if the join token ... | StarcoderdataPython |
3356153 | <reponame>chengzhongkai/floranet
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet import reactor
from mock_reactor import reactorCall
return_value = None
@inlineCallbacks
def find(*args, **kwargs):
"""Mock relationship find.
Returns:
return_value.
"""
yie... | StarcoderdataPython |
3391698 | <filename>methods.py
from skimage import io, filters, measure, color, exposure, morphology, feature, img_as_float, img_as_uint, draw
from scipy import ndimage as ndi
import pandas as pd
import numpy as np
import os
import sys
import math
import matplotlib
# matplotlib.use('Qt5Agg')
matplotlib.use('Agg')
from matplotlib... | StarcoderdataPython |
1741819 | <gh_stars>10-100
from .widgets.structure import ImageCard, CardColumns, Container
scripts = [
"https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.4/js/tether.min.js",
"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.3/js/bootstrap.min.js"
]
stylesheets = [
"https://cdnjs.cloudflare.com/ajax/libs/teth... | StarcoderdataPython |
1746479 | <reponame>KevinMusgrave/pytorch-adapt<filename>src/pytorch_adapt/validators/class_cluster_validator.py
import numpy as np
import torch
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.metrics import adjusted_mutual_info_score
from ..utils import common_functions as c_f
from . impor... | StarcoderdataPython |
137821 | <gh_stars>0
#!/usr/bin/env python
import os
os.environ['FLASK_CONFIG'] = 'test'
import mock
import unittest
from etcd import EtcdKeyNotFound
import jwt
import requests
from microflack_common.auth import generate_token
from microflack_common.test import FlackTestCase
from app import app
class TokenTests(FlackTestC... | StarcoderdataPython |
171298 | import requests
import rdflib
from whyis import nanopub
import datetime
import pytz
import dateutil.parser
from dateutil.tz import tzlocal
from werkzeug.datastructures import FileStorage
from werkzeug.http import http_date
from setlr import FileLikeFromIter
import re
import os
from requests_testadapter import Resp
impo... | StarcoderdataPython |
1649204 | import scipy as sp
import numpy as np
import shutil
import matplotlib.pyplot as plt
import time
import progressbar
import qt
fac = sp.math.factorial
Hz = 1.
kHz = 1e3
MHz = 1e6
GHz = 1e9
s = 1.
ms = 1e-3
us = 1e-6
ns = 1e-9
ps = 1e-12
DEFAULT_SAMPLE_RATE_AWG_UHFLI = 1.8e9
DEFAULT_SAMPLE_RATE_S... | StarcoderdataPython |
167618 | from PyQt5.QtGui import QFont
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget, QFrame, QLabel, QGridLayout, QPushButton, QDoubleSpinBox, QHBoxLayout, QVBoxLayout
from EGGS_labrad.clients.Widgets import Lockswitch, TextChangingButton, QCustomGroupBox
class RF_gui(QFrame):
def __init__(self):
... | StarcoderdataPython |
199950 | <filename>sympy/solvers/__init__.py
"""A module for solving all kinds of equations.
Examples
--------
>>> from sympy.solvers import solve
>>> from sympy.abc import x
>>> solve(x**5+5*x**4+10*x**3+10*x**2+5*x+1,x)
[-1]
"""
from solvers import solve, solve_linear_system, solve_linear_system_LU, \... | StarcoderdataPython |
3309503 | #__all__ = ["webcam", "NoGUI", "face_detection", "process", "amplify_color", "graph_plot"]
#from .webcam import Webcam
#from .NoGUI import run_video
| StarcoderdataPython |
4804472 | # Copyright 2020 DeepMind Technologies Limited.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | StarcoderdataPython |
3315684 | import numpy as np
import pandas as pd
import pytest
import warnings
from xeofs.models._array_transformer import _ArrayTransformer
from xeofs.pandas._dataframe_transformer import _DataFrameTransformer
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
warnings.filterwarnings("ignore", message="nump... | StarcoderdataPython |
3328865 | #%%
import pandas as pd
import numpy as np
from matchbook.apiclient import APIClient
api = APIClient('DOG2018', '07C18125')
def get_client():
if not api.session_token:
api.login()
return api
# %%
| StarcoderdataPython |
1659359 | <gh_stars>0
class Solution:
def XXX(self, nums: List[int], target: int) -> List[int]:
for i in nums:
for j in nums:
if i+j == target:
return [nums.index(i),nums.index(j)]
break
| StarcoderdataPython |
1611727 | from flask import Flask, jsonify, request
from flask_cors import CORS
import operationsAPI, getPredictionData
import pandas as pd
import numpy as np
import tensorflow as tf
from keras.models import load_model
import datetime
#This file contains all the api information
#initalizes the tensorflow graph (needed for tf t... | StarcoderdataPython |
3269572 | <gh_stars>10-100
from sparse_dot_mkl.sparse_dot import (dot_product_mkl, dot_product_transpose_mkl, get_version_string, gram_matrix_mkl,
sparse_qr_solve_mkl, set_debug_mode)
| StarcoderdataPython |
1776417 | import re
import sys
import getopt
from extractors import *
from lpIO import *
from converters import *
"""
Author
<NAME> (https://github.com/Leajian)
Program name
Linear Problem Parser (lpp)
Version
2.2
"""
def main(argv):
# Initialize varibales.
inputFile = ''
outp... | StarcoderdataPython |
4817803 | <gh_stars>0
#!/usr/bin/env python
# Copyright (c) 2016 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2017-2018 SUSE LLC
#
# 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
#
# http... | StarcoderdataPython |
113026 | <reponame>amir9480/instagram-hide-all<filename>instagram-hide-all.py
from instagram_private_api import Client
from instagram_private_api.http import ClientCookieJar
from instagram_private_api.compat import compat_pickle
import json
import os
import getpass
import sys
import warnings
import time
api = None
def list_di... | StarcoderdataPython |
1616678 | <filename>ConvertDataToDB.py
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 19 15:19:49 2016
@author: dahoiv
"""
# pylint: disable= line-too-long
from __future__ import print_function
import glob
import os
import shutil
import sqlite3
import pyexcel_xlsx
from openpyxl import load_workbook
import util
# DATA_PATH_LIS... | StarcoderdataPython |
4827813 | <reponame>MihanixA/ydb-python-sdk
# -*- coding: utf-8 -*-
class BaseRequestSettings(object):
__slots__ = ('trace_id', 'request_type', 'timeout', 'cancel_after', 'operation_timeout')
def __init__(self):
"""
Request settings to be used for RPC execution
"""
self.trace_id = None
... | StarcoderdataPython |
88547 | from dal.deleter import Deleter
class ImageDataDeleter(Deleter):
####################################################################################################################
# Public methods.
##########################################################################################################... | StarcoderdataPython |
1766071 | <gh_stars>0
"""
win_pct
A module to calculate actual and expected winning percentages
from boysworld.com data
Created by <NAME> in Winter 2022
"""
import pandas as pd
# GLOBAL VARIABLES
_ROUND_TO = 3
def calculate_actual_win_pct(school, games):
"""
A function to calculate the winning percentage as
# g... | StarcoderdataPython |
186872 | from pyclts.transcriptionsystem import TranscriptionSystem # noqa: F401
from pyclts.transcriptiondata import TranscriptionData # noqa: F401
from pyclts.soundclasses import SoundClasses # noqa: F401
from pyclts import api
__version__ = '1.3.1.dev0'
| StarcoderdataPython |
3230199 | import pytest
import responses
@pytest.fixture(autouse=True)
def mocked_responses():
responses.start()
yield
responses.stop()
responses.reset()
| StarcoderdataPython |
1690919 | from .input_provider import InputProvider
class AuthenticationProvider:
def __init__(self, input_provider):
self.input_provider = input_provider
def request_authentication_parameters(self, authentication_params):
username = self.input_provider.get_input("Username: ")
password = self.in... | StarcoderdataPython |
3245027 | <filename>policy/signals.py
from .models import DcPolicy
from django.db.models.signals import post_save
from django.dispatch import receiver
@receiver(post_save, sender=DcPolicy)
def update_policy_state_history(sender, instance, **kwargs):
instance.histories.get_or_create(state = instance.state)
| StarcoderdataPython |
4808233 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" setup file for DyBM. """
__author__ = "<NAME>"
__version__ = "3.2"
__date__ = "December 22, 2016"
__copyright__ = "(C) Copyright IBM Corp. 2016"
from setuptools import setup, find_packages
import sys
import os
setup(
name = "pydybm",
version = "3.2.1",
a... | StarcoderdataPython |
9558 | <filename>locan/data/hulls/__init__.py
"""
Hull objects of localization data.
Submodules:
-----------
.. autosummary::
:toctree: ./
hull
alpha_shape
"""
from locan.data.hulls.alpha_shape import *
from locan.data.hulls.hull import *
__all__ = []
__all__.extend(hull.__all__)
__all__.extend(alpha_shape.__al... | StarcoderdataPython |
1631284 | <filename>src/transforms/gauss_noise.py<gh_stars>1-10
"""
Add Gaussian Noise to signal
__author__: <NAME>
"""
import numpy as np
import matplotlib.pyplot as plt
import os.path
import os
import pandas as pd
from typing import Iterable, List, Optional, Tuple
from scipy import signal
from functional import gauss_noise
... | StarcoderdataPython |
124720 | from .pyct_icp import * | StarcoderdataPython |
1661440 | <filename>args.py
import argparse
from configs import *
# parser used to read argument
parser = argparse.ArgumentParser(description='xxxxx')
# ==================================
# Universal
# ==================================
parser.add_argument(
'--seed', type=int, default=UNIVERSAL_SEED)
... | StarcoderdataPython |
3367015 | import flask
import os
import logging
from logging import Formatter
from flask import Flask, current_app
from flask_bcrypt import Bcrypt
from logging.handlers import RotatingFileHandler
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from multiprocessing import Lock
from wer... | StarcoderdataPython |
3359746 | from __future__ import unicode_literals
import re
from django.db import models
from django.dispatch import receiver
# fs = FTPStorage()
VOICE_PROPERTIES = (
('intelligibility', 'Intelligibility'),
('naturalness', 'Naturalness'),
('overall', 'Overall')
)
QUESTION_TYPE = (
(1, 'DRT'),
(2, 'MRT')... | StarcoderdataPython |
112481 | """Bonus DAG that uses a few Keywords to perform ETL using python operators."""
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
import pandas as pd
from datetime import datetime, timedelta
from io import StringIO
import requests
import boto3
"""Enter the API Key and AWS Credential... | StarcoderdataPython |
141056 | class InvalidQNameError(RuntimeError):
def __init__(self, qname):
message = "Invalid qname: " + qname
super(InvalidQNameError, self).__init__(message)
| StarcoderdataPython |
3225322 | from astropy import units as u, constants as const
import numpy as np
from ..nuclear import nuclear_binding_energy, nuclear_reaction_energy, mass_energy
from plasmapy.utils.pytest_helpers import run_test, run_test_equivalent_calls
from plasmapy.atomic.exceptions import AtomicError, InvalidParticleError
import pytest
... | StarcoderdataPython |
3379328 | from __future__ import print_function, division
import pandas as pd
import numpy as np
from copy import deepcopy
from os.path import join, isdir, isfile, dirname, abspath
from os import listdir, getcwd
import re
from sys import stdout, getfilesystemencoding
from nilmtk.datastore import Key
from nilmtk.timeframe import ... | StarcoderdataPython |
193510 | <gh_stars>1-10
from django.dispatch import Signal, receiver
from security.config import settings
input_request_started = Signal()
input_request_finished = Signal()
input_request_error = Signal()
output_request_started = Signal()
output_request_finished = Signal()
output_request_error = Signal()
command_started = S... | StarcoderdataPython |
3257665 | <gh_stars>0
#!/usr/bin/env python
import sys,os
home = os.environ['NEMO_HOME']
setup = os.environ['NEMO_SETUP']
sys.path.append(os.path.join(home,'scripts'))
from nemo import Makefile
flags = dict(
PP_N_NODES = 8,
PP_KERNEL_DGFV_QMIN = 3,
PP_KERNEL_DGFV_QMAX = 3,
PP_... | StarcoderdataPython |
3298682 | <gh_stars>0
""" Dynamically include a page.
"""
import unittest
from wheezy.template.engine import Engine
from wheezy.template.ext.core import CoreExtension
from wheezy.template.loader import DictLoader
page_a = "a"
page_b = "b"
page_c = """
@require(name)
@include('page_' + name)
"""
pages = {"page_a": page_a, "p... | StarcoderdataPython |
1758760 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import os
import sys
import json
import tempfile
import filecmp
# Generated document is included in existing page, so
# start at heading of depth 1 (equivalent to markdown h2.)
START_DEPTH = 1
class MinimalRstGenera... | StarcoderdataPython |
1779049 | """Tables: Distributed object K/V-store."""
from .base import Collection, CollectionT
from .manager import TableManager, TableManagerT
from .table import Table, TableT
__all__ = [
'Collection',
'CollectionT',
'TableManager',
'TableManagerT',
'Table',
'TableT',
]
| StarcoderdataPython |
190462 | # Copyright 2018 IBM 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | StarcoderdataPython |
1762961 | from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.flood import stations_highest_rel_level
from floodsystem.plot import plot_water_level_with_fit
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.analysis import polyfit
import datetime
import matplotlib
... | StarcoderdataPython |
3267711 | <filename>rbac/views/group_views.py
# -*- coding: utf-8 -*-
"""
"""
import logging
from django.http.response import JsonResponse
from django.db import transaction
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.conf import settings
from django.contrib.auth.models import Group, Us... | StarcoderdataPython |
45559 | <reponame>wpreimes/io_utils<filename>tests/test_grid/test_continent_cells.py
# -*- coding: utf-8 -*-
from io_utils.grid.grid_functions import read_cells_for_continent
def test_read_cells_for_continent():
try:
read_cells_for_continent('notexistingname')
except ValueError:
assert True
else:
... | StarcoderdataPython |
84076 | import unittest
import decimal
import os
import datetime
import hashlib
from nose.plugins.attrib import attr
from eactivities import EActivities
from eactivities.parsers.documentation import InventoryParser, RiskAssessmentParser, KeyListsParser
import eactivities.parsers.finances as finance_parsers
# l... | StarcoderdataPython |
1742286 | <filename>tests/schema/test_checker.py<gh_stars>0
import pytest
from align.schema.checker import Z3Checker, SolutionNotFoundError
@pytest.fixture
def checker():
return Z3Checker()
def test_single_bbox_checking(checker):
b1 = checker.bbox_vars('M1')
checker.append(b1.llx < b1.urx)
checker.solve()
... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.