id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
3388316 | import hashlib
import io
import unittest
import numpy as np
import pandas as pd
from evt.dataset import Dataset
from evt.estimators.gpdmle import GPDMLE
from evt.methods.peaks_over_threshold import PeaksOverThreshold
import matplotlib.pyplot as plt
class TestGPDMLE(unittest.TestCase):
def setUp(self) -> None:
... | StarcoderdataPython |
1713338 | <filename>reviews/Bokeh/sliders.py
# start bokeh app
# # bokeh serve sliders.py
import numpy as np
from bokeh.io import curdoc
from bokeh.layouts import row, widgetbox
from bokeh.models import ColumnDataSource
from bokeh.models.widgets import Slider, TextInput
from bokeh.plotting import figure
# Set up data
N = 20... | StarcoderdataPython |
3226454 | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 30 13:05:14 2014
@author: stevo
"""
from __future__ import print_function
import logging
import sys
import os
import cPickle
import numpy as np
from scipy.sparse import dok_matrix
from scipy.io import mmwrite, mmread
import text_entail.dictionary as td
import text_entai... | StarcoderdataPython |
81575 | <gh_stars>0
import os
import re
import sys
from typing import (
List,
Optional,
Tuple,
)
import alembic.config
from alembic.config import Config
from alembic.runtime.migration import MigrationContext
from alembic.script import ScriptDirectory
from sqlalchemy import create_engine
from sqlalchemy.engine impo... | StarcoderdataPython |
60191 | <gh_stars>0
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matlablib import *
plt.ion()
tic()
fname_1=r"70dB-2sec.csv"
fname_2=r'70dB-5sec.csv'
pd1=pd.read_csv(fname_1)
pd2=pd.read_csv(fname_2)
print('loaded')
toc()
y1 = pd1.RL1_1310
y2 = pd2.RL1_1310
x1 = np.linspace(1, len(y1), len(y1))... | StarcoderdataPython |
3295868 | from fs_data import FSData
if __name__=="__main__":
# RL
alhpa = 0.1
gamma = 0.99
epsilon = 0.01
# BSO
flip = 5
max_chance = 3
bees_number = 10
maxIterations = 10
locIterations = 10
# Test type
typeOfAlgo = 1
nbr_exec = 1
dataset = "Iris"
data_loc_path... | StarcoderdataPython |
3261451 | <filename>tensorflow_tts/utils/griffin_lim.py
# -*- coding: utf-8 -*-
# Copyright 2020 <NAME> (@dathudeptrai)
#
# 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/lic... | StarcoderdataPython |
1607689 | import rover
class Planet:
def __init__(self, width, height):
self.width = width
self.height = height
self.obstacles = set()
def createRover(self, x, y, orientation):
return rover.Rover(x, y, orientation, self)
def wrap_x(self, x):
return x % self.width
def w... | StarcoderdataPython |
3312427 | <filename>tests/test_compatibility_patch.py
from django.test import SimpleTestCase
from bootstrap_datepicker_plus._compatibility import BaseRenderer
from bootstrap_datepicker_plus._helpers import get_base_input
class CustomCompatibleDatePickerInput(get_base_input(True)):
template_name = "myapp/custom_input/date-... | StarcoderdataPython |
1663235 | # -*- coding: utf-8 -*-
from common.base_test import BaseTest
import lemoncheesecake.api as lcc
from lemoncheesecake.matching import check_that, equal_to
SUITE = {
"description": "Testing correct work of contract with 'eth_accuracy:True'"
}
@lcc.disabled()
@lcc.prop("main", "type")
@lcc.tags("scenarios", "eth_... | StarcoderdataPython |
33921 | import itertools
import pytest
from iterators.invalid_iter import InvalidIter
def _grouper_to_keys(grouper):
return [g[0] for g in grouper]
def _grouper_to_groups(grouper):
return [list(g[1]) for g in grouper]
@pytest.mark.parametrize("keyfunc, data, expected_keys", [
(lambda x: x, [], []),
(lambd... | StarcoderdataPython |
72644 | <reponame>AustEcon/bitcoinX<filename>tests/test_packing.py
from io import BytesIO
import pytest
from bitcoinx.packing import *
from struct import error as struct_error
pack_cases = [
('pack_le_int32', -258, b'\xfe\xfe\xff\xff'),
('pack_le_int32', 258, b'\x02\x01\x00\x00'),
('pack_le_int64', -234568427572... | StarcoderdataPython |
1673538 | import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import *
from PyQt5.QtWebEngineWidgets import *
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.browser = QWebEngineView()
self.browser.setUrl(QUrl... | StarcoderdataPython |
1728160 | <filename>spark_auto_mapper_fhir/value_sets/implant_status.py<gh_stars>1-10
from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTex... | StarcoderdataPython |
3233656 | <filename>pomodoro_system/foundation/models/__init__.py<gh_stars>0
__all__ = ["db", "User", "UserDateFrameDefinitionModel"]
from foundation.models.user import User, UserDateFrameDefinitionModel, db
| StarcoderdataPython |
4801265 | <reponame>TueVJ/PyGuEx
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import numpy as np
from benders_stochastic_master import Benders_Master
sns.set_style('ticks')
m = Benders_Master()
m.model.Params.OutputFlag = False
m.optimize()
rtdf = pd.DataFrame({g: {m.data.demand_rt[s]: m.submodel... | StarcoderdataPython |
1636978 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
class OutputPublisher:
"""
A base class for pages displaying output in the JS application
"""
name = None
button_label = None
description = None
order = float('inf')
@classmethod
def publish(cls, conf, repo, benchmarks... | StarcoderdataPython |
24900 | class Solution:
def XXX(self, nums: List[int]) -> List[List[int]]:
final = list()
# ----------------------------------------------------
if len(nums)==1:
return [[],nums]
if len(nums)==0:
return []
# ----------------------------------------------------... | StarcoderdataPython |
1693351 |
"""Test dplaapi.handlers.v2"""
import pytest
import requests
import json
import os
import boto3
import secrets
from starlette.testclient import TestClient
from starlette.exceptions import HTTPException
from starlette.responses import Response
from starlette.requests import Request
from starlette.background import Bac... | StarcoderdataPython |
36902 | """
Author: <NAME>
Test simulation functionality
"""
print("Test")
| StarcoderdataPython |
88624 | <filename>analyze_simulation_length.py
""" Analyze simulation output - mass change, runoff, etc. """
# Built-in libraries
#from collections import OrderedDict
#import datetime
#import glob
import os
#import pickle
# External libraries
#import cartopy
#import matplotlib as mpl
#import matplotlib.pyplot as plt
#from mat... | StarcoderdataPython |
1715628 | <filename>sign_in/forms.py
from django import forms
from .models import Profile
from django.contrib.auth.models import User
class Register(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())
class Meta:
model = User
fields = ("username", "password", "email")
hel... | StarcoderdataPython |
1785280 | """
The MIT License (MIT)
Copyright (c) 2015 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish... | StarcoderdataPython |
1653101 | <filename>python-dev/a115_buggy_image_lh/a116_buggy_image_lh.py
# a116_buggy_image.py
import turtle as trtl
x = trtl.Turtle()
x.pensize(40)
x.circle(20)
w = 6
y = 70
z = 380 / w
x.pensize(5)
n = 0
while (n < w):
x.goto(0,0)
x.setheading(z*n)
x.forward(y)
n = n + 1
x.hideturtle()
wn = trtl.Screen()
wn.mainloo... | StarcoderdataPython |
1681205 | <filename>templates.py<gh_stars>1-10
JAVA_FILE = """{header}
package {package};
{imports}
@Deprecated
public class {class_name} {{
{class_content}
static {{
{static_content}
}}
}}
"""
JAVA_HEADER = """/*
* {header}
*/
"""
MATERIAL_PROPERTIES_CLASS = \
"""static final ImmutableMap<Material, PropertyDefs> M... | StarcoderdataPython |
3388451 | import os
import datetime
from time import strftime
from hashlib import md5
import uuid
from django.utils.translation import ugettext_lazy as _
from django.core.files.base import ContentFile
def guid_generator(user_id=None, length=32):
if user_id:
guid_base = "%s" % (user_id)
guid_encode = guid_ba... | StarcoderdataPython |
3275812 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Collection of types used across multiple objects and functions.
"""
from io import BufferedIOBase
from pathlib import Path
from typing import Any, NamedTuple, Union
import dask.array as da
import numpy as np
# Imaging Data Types
SixDArray = np.ndarray # In order ST... | StarcoderdataPython |
1734364 | <filename>scripts/bulk_detectfigures.py
"""Run figure detection on a batch of PDFs.
See ``DetectFigures_Bulk.py --help`` for more information.
"""
import logging
import os
import click
import shutil
from deepfigures import settings
from scripts import build, execute, detectfigures
# Same module as in detectfigures.... | StarcoderdataPython |
59719 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from projects.models import Project
# @python_2_unicode_compatible
# class LineFollowerStage(models.Model):
# order = models.PositiveSmallIntegerField(verbose_name=_("... | StarcoderdataPython |
78758 | import os
from easydict import EasyDict as edict
import torch
import torch.utils.model_zoo as model_zoo
#from torchvision.models.resnet import model_urls
from common_pytorch.base_modules.deconv_head import DeconvHead
from common_pytorch.base_modules.resnet import resnet_spec, ResnetBackbone
from common_pytorch.base_m... | StarcoderdataPython |
1625416 | <gh_stars>1-10
# MINLP written by GAMS Convert at 04/21/18 13:51:11
#
# Equation counts
# Total E G L N X C B
# 2 1 0 1 0 0 0 0
#
# Variable counts
# x b i s1s ... | StarcoderdataPython |
3339216 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os.path
import numpy as np
import pandas as pd
from extract_features import convert
from tqdm import tqdm
from tsfresh import extract_features
from sklearn.linear_model import Lasso
from sklearn.feature_selection import RFE
from tsfresh.utilities.dataf... | StarcoderdataPython |
130606 | <gh_stars>1-10
from json import dumps as toJS, loads as fromJS
import re
class Index(object):
def __init__(self, name, chartOrParent):
self._name = name
if isinstance(chartOrParent, Index):
self._parent = chartOrParent
self._chart = self._parent._chart
else:
self._parent = None
self._chart = chartOr... | StarcoderdataPython |
1616536 | # Generated by Django 2.2.5 on 2020-04-09 13:23
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('studies', '0035_auto_20200409_1258'),
]
operations = [
migrations.RemoveField(
model_name='expressiondata',
name='species',
... | StarcoderdataPython |
1667312 | <gh_stars>1-10
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))))
import waf
# ref : https://cloud.kt.com/portal/openapi-guide/computing_enterprise-Server-server_api_make
# Zone parameter : Mandatory
# 1) KR-CA : KOR-Central A ... | StarcoderdataPython |
1645025 | <filename>problemtools/languages.py<gh_stars>10-100
"""
This module contains functionality for reading and using configuration
of programming languages.
"""
import fnmatch
import re
import string
from . import config
class LanguageConfigError(Exception):
"""Exception class for errors in language configuration."""... | StarcoderdataPython |
1777691 | <gh_stars>0
#!/usr/bin/env python
from distutils.core import setup
setup(name='sitemap_gen',
version='3',
description='Sitemap Generator',
license='BSD',
author='lusob',
author_email='<EMAIL>',
url='https://github.com/lusob/sitemap_gen'
platforms = ['POSIX', 'Windows'],
... | StarcoderdataPython |
3214685 | import pytest
import mock
def test_pibrella_red_light_on(GPIO, atexit):
import pibrella
pibrella.light.red.on()
pibrella.light.red.off()
assert GPIO.output.has_calls((
mock.call(pibrella.PB_PIN_LIGHT_RED, True),
mock.call(pibrella.PB_PIN_LIGHT_RED, False)
)) | StarcoderdataPython |
4818453 | from mpkg.common import Soft
from mpkg.utils import Search
class Package(Soft):
ID = 'wget'
def _prepare(self):
data = self.data
data.bin = ['wget.exe']
links = {'32bit': 'https://eternallybored.org/misc/wget/releases/wget-{ver}-win32.zip',
'64bit': 'https://eternally... | StarcoderdataPython |
3392945 | import argparse
import time
import gc
import os
import numpy as np
import torch
from torch.utils.data import DataLoader
from models.models import GroupIM
from utils.user_utils import TrainUserDataset, EvalUserDataset
from utils.group_utils import TrainGroupDataset, EvalGroupDataset
from eval.evaluate import evaluate_u... | StarcoderdataPython |
1628411 | import os
import uuid as uuid_module
import weakref
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import pymongo
import bson
except ImportError:
# mongo dependency is optional
pymongo = None
import logging
l = logging.getLogger("ana.datalayer")
class DataLayer(object):... | StarcoderdataPython |
3324498 | <filename>vanilla_GAN/bento_predictor.py
import bentoml
from bentoml.adapters import JsonInput
from bentoml.frameworks.tensorflow import TensorflowSavedModelArtifact
import tensorflow as tf
import importlib.util
import numpy as np
from PIL import Image
@bentoml.env(infer_pip_packages=True)
@bentoml.artifacts([Tensor... | StarcoderdataPython |
3310090 | #!/usr/bin/python
from parsers.baseparser import BaseParser
from parsers.common.evos import parse_unit, parse_evo, parse_item
class EvoParser(BaseParser):
"""Parser for evolution data.
Expects 'unit', 'evo', 'items' and 'dict' in the raw data.
"""
required_data = ['unit', 'evo', 'items', 'dict']
... | StarcoderdataPython |
3274168 | <reponame>dirk-attraktor/pyHtmlGui
from pyhtmlgui import PyHtmlGui, PyHtmlView, Observable
class App(Observable):
pass
class DummyView(PyHtmlView):
TEMPLATE_STR = '''Edit me at runtime and save file, the frontend will update after a few seconds when filesystem changes are detected'''
class AppView(PyHtmlView... | StarcoderdataPython |
3219109 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
this_directory = path.abspath(path.dirname(__file__))
setup(
name='aiogram_dialog',
description='Mini-framework for dialogs on top of aiogram',
version='0.9.1',
url='https://github.com/ti... | StarcoderdataPython |
36672 | <reponame>Shelnutt2/TileDB-Py
from __future__ import absolute_import
try:
import pandas as pd
import pandas._testing as tm
import_failed = False
except ImportError:
import_failed = True
import unittest, os
import warnings
import string, random, copy
import numpy as np
from numpy.testing import assert... | StarcoderdataPython |
4813833 | <gh_stars>10-100
from dataclasses import dataclass
from datetime import timedelta
import librosa
import numpy as np
from omegaconf import MISSING
from vad.data_models.audio_data import AudioData
@dataclass
class SilenceRemoverConfig:
silence_threshold_db: float = MISSING
class SilenceRemover:
config: Sile... | StarcoderdataPython |
1798834 | <reponame>dashawn888/jmeter_api
import logging
from typing import List, Optional, Union
from xml.etree.ElementTree import Element
from jmeter_api.basics.config.elements import BasicConfig
from jmeter_api.basics.utils import Renderable, FileEncoding, tree_to_str
class Header(Renderable):
TEMPLATE = 'header.... | StarcoderdataPython |
7851 | import re
from pkg_resources import parse_requirements
import pathlib
from setuptools import find_packages, setup
README_FILE = 'README.md'
REQUIREMENTS_FILE = 'requirements.txt'
VERSION_FILE = 'mtg/_version.py'
VERSION_REGEXP = r'^__version__ = \'(\d+\.\d+\.\d+)\''
r = re.search(VERSION_REGEXP, open(VERSION_FILE).r... | StarcoderdataPython |
166387 | import collections
import os
import tempfile
import pytest # noqa
import anwesende.utils.excel as aue
the_3by3_file = "anwesende/utils/tests/data/3by3.xlsx"
def test_read_excel_as_columnsdict():
cd = aue.read_excel_as_columnsdict(the_3by3_file)
assert set(cd.keys()) == set(["A-str", "B-int", "C-str"])
... | StarcoderdataPython |
1736342 | import os
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
from slicer.util import VTKObservationMixin
# from Resources import HomeResourcesResources
class Home(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https://github.com/Slicer/Slicer/b... | StarcoderdataPython |
1798295 | <filename>src/1019.py
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def nextLargerNodes(self, head: ListNode) -> List[int]:
stack = []
n = 0
cur = head
while cur:
... | StarcoderdataPython |
3314886 | import nextcord
from nextcord import Interaction
from emojis import CHECK
from error_messages import MISSING_PERMISSIONS
from colors import RES, YW
class GitHubButtonView(nextcord.ui.View):
"""Function necessary to add link button to help command embed"""
def __init__(self):
super().__init__(timeout=... | StarcoderdataPython |
33787 | <filename>src/opendr/perception/activity_recognition/datasets/utils/transforms.py
# Copyright 2020-2021 OpenDR Project
#
# 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.apach... | StarcoderdataPython |
1637823 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from app import logging
from app.remote.redis import Redis
from app.fortnite.news import news as parse_news
import logging
import asyncio
def news(client, message):
try:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
news_file, news_ha... | StarcoderdataPython |
1750727 | '''create charts showing results of valgbr.py
INVOCATION
python chart06.py FEATURESGROUP-HPS-LOCALITY --data
python chart06.py FEATURESGROUP-HPS-global [--test] [--subset] [--norwalk] [--all]
python chart06.py FEATURESGROUP-HPS-city [--test] [--subset] [--norwalk] [--all] [--trace]
where
FEATURESGROUP is one o... | StarcoderdataPython |
3223187 | # File: digitalguardianarc_connector.py
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
#
import sys
import requests
import json
import phantom.app as phantom
from datetime import datetime
from bs4 import BeautifulSoup
from phantom.base_connector import BaseConnector
from phantom.action... | StarcoderdataPython |
176023 | def makeStringList(stringListFileName):
# Make a list of Strings from a file
stringListFile = open(stringListFileName)
stringList = []
for line in stringListFile:
# Iterate through the lines of the file and add each line to the list
stringList.append(line.strip())
stringListFile.close()
return stringList
def... | StarcoderdataPython |
3365483 | <reponame>flo443/AIX360<filename>aix360/algorithms/TracInF/TIF_utils.py
from transformers import BertTokenizer, RobertaTokenizer
import json
import torch
from collections import Counter
from tqdm import trange
import numpy as np
debug = False
class DatasetReader():
def __init__(self, max_len, BERT_name):
... | StarcoderdataPython |
84178 | """
Entradas
Chelines-->int-->CA
Dracmas-->int-->DG
Pesetas-->int-->P
salidas
CA-->int-->P
DG-->int-->FrancoFrances
P-->int-->Dolares
P-->int-->LirasItalianas
"""
#entrada
CA=int(input("Ingrese la cantidad de Chelines Austriacos a cambiar: "))
DG=int(input("Ingrese la cantidad de Dracmas Griegos a cambiar: "))
P=int(in... | StarcoderdataPython |
1750206 | <reponame>iHamburg/FZQuant
#!/usr/bin/env python
# coding: utf8
from pymongo import MongoClient
from pyquant.config import mongodb as config
import pandas as pd
import json
import pydash
conn = MongoClient(config['host'], config['port'])
db = conn.fzquant
def insert_data(col_name, df):
"""
插入数据
TODO: ... | StarcoderdataPython |
7538 | <gh_stars>100-1000
import os.path as osp
# Root directory of project
ROOT_DIR = osp.abspath(osp.join(osp.dirname(__file__), '..', '..'))
# Path to data dir
_DATA_DIR = osp.abspath(osp.join(ROOT_DIR, 'data'))
# Required dataset entry keys
_IM_DIR = 'image_directory'
_ANN_FN = 'annotation_file'
# Available datasets
C... | StarcoderdataPython |
189557 | import numpy as np
''' DATA
NAME WEIGHT GROWTH GENDER
Alice 133 65 F
Bob 160 72 M
Charlie 152 70 M
Diana 120 60 F
NAME WEIGHT(Minus 135) GROWTH(Minus 66) GENDER(1 - F, 0 - M)
Alice ... | StarcoderdataPython |
4800782 | import os
import yaml
# import copy
import testinfra.utils.ansible_runner
import requests
from ansible.inventory.manager import InventoryManager
from ansible.vars.manager import VariableManager
from ansible.parsing.dataloader import DataLoader
ansible_runner = testinfra.utils.ansible_runner.AnsibleRunner(
os.env... | StarcoderdataPython |
140059 | <filename>Leetcode/Sorting,_Binary_Search/2_-_Medium/220._Contains_Duplicate_III.py
class Solution:
def containsNearbyAlmostDuplicate(self, nums: List[int], k: int, t: int) -> bool:
tup = [(ind, i) for ind, i in enumerate(nums)]
tup.sort(key=lambda x: x[1])
for i in range(len(tup)):
... | StarcoderdataPython |
3323335 | <reponame>pkiage/credit-risk-modelling-tool
import streamlit as st
from sklearn.metrics import classification_report, roc_curve
import numpy as np
import plotly.express as px
import pandas as pd
from numpy import argmax
from visualization.metrics import streamlit_2columns_metrics_df, streamlit_2columns_metrics_p... | StarcoderdataPython |
1769145 | import os, sys
parentPath = os.path.abspath("../")
if parentPath not in sys.path:
sys.path.insert(0, parentPath)
import json
from collections import namedtuple
from asciimatics.widgets import *
from gui.utils.utils import ColorTheme, getColor, getAttr
from gui.utils.widget import CustomLabel
UP_BAR = 'up'
DOWN_BAR =... | StarcoderdataPython |
3385298 | from lib.utils.base_utils import read_pickle
import numpy as np
def read_anns(ann_files):
anns = []
for ann_file in ann_files:
anns += read_pickle(ann_file)
return anns
def read_pose(rot_path, tra_path):
rot = np.loadtxt(rot_path, skiprows=1)
tra = np.loadtxt(tra_path, skiprows=1) / 100.
... | StarcoderdataPython |
1700092 | import json
import datetime as dt
from utils import process_img as pi
from utils import log
f = open("tests.txt", "w")
def test_ocr():
with open('data/test_ocr.json') as json_file:
imgs = json.load(json_file)
for row in imgs:
img = pi.read_image(row['img'])
phone_time, r... | StarcoderdataPython |
3215532 | <reponame>Vandivier/research-dissertation-case-for-alt-ed
from scipy import stats
import statsmodels.api as sm
import analysis_1_vars_and_regression as analysis
skewed = analysis.getData()
deskewed = analysis.getDeskewedData()
left_of_skew = analysis.getLowHirabilityGroup()
print('\n')
print("skewed data skew test:"... | StarcoderdataPython |
1765390 | <gh_stars>0
"""
@package myWave provides functionality for reading and writing WAV files
@copyright GNU Public License
@author written 2009-2011 by <NAME> (www.christian-herbst.org)
@author Supported by the SOMACCA advanced ERC grant, University of Vienna,
Dept. of Cognitive Biology
@note
This program is free soft... | StarcoderdataPython |
3371348 | import sys
from types import SimpleNamespace
from typing import Callable
# noinspection PyPackageRequirements
import pytest as pytest
from jinja2 import TemplateNotFound
from markupsafe import Markup
from fixtures import registered_extension, starlette_render_partial
import jinja_partials
def test_render_empty(regi... | StarcoderdataPython |
136361 | import bs4
import flask
import flask_cors
import json
import pyrebase
import requests
import traceback
from lib import TranscriptParser
app = flask.Flask(__name__)
firebase = pyrebase.initialize_app({
'apiKey': '<KEY>',
'authDomain': 'canigraduate-43286.firebaseapp.com',
'databaseURL': 'https://canigraduat... | StarcoderdataPython |
3238742 | # -*- coding: utf-8 -*-
# edge realization
class Edge(object):
# create edge from source key to target key with props
def __init__(self, source, target, weight = 0):
self.source = source
self.target = target
self.weight = weight
def __eq__(self, other):
if isinstance(other... | StarcoderdataPython |
3380861 | <filename>pytorch_lightning/callbacks/__init__.py
from pytorch_lightning.callbacks.base import Callback
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
from pytorch_lightning.callbacks.gpu_stats_monitor import GPUStatsMonitor
from pytorch_lightning.callbacks.gradient_accumulation_scheduler import G... | StarcoderdataPython |
3396287 | <filename>upsert/ansi_ident.py
import codecs
import upsert
class AnsiIdent:
# http://stackoverflow.com/questions/6514274/how-do-you-escape-strings-for-sqlite-table-column-names-in-python
@upsert.memoize
def quote_ident(self, str):
encodable = str.encode("utf-8", "strict").decode("utf-8")
nu... | StarcoderdataPython |
4832065 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
from typing import NamedTuple, List, Callable, Any
class Struct(metaclass=ABCMeta):
__slots__ = []
def __eq__(self, other) -> bool:
assert type(self) == type(other)
res = True
for item in self.__s... | StarcoderdataPython |
1646688 | <reponame>old-pinky/AioPaperScroll-SDK
from setuptools import setup, find_packages
setup(
name='aiopaperscroll',
version='1.0.0',
packages=find_packages(),
install_requires=[
'loguru',
'asyncio',
'aiohttp'],
url='https://github.com/old-pinky/AioPaperScroll-SDK'
)
| StarcoderdataPython |
4833104 | <reponame>idlewan/FrameworkBenchmarks
import helper
from helper import Command
def start(args, logfile, errfile):
db_host = "DB_HOST={0}".format(args.database_host or 'localhost')
start_server = db_host + " rvm jruby-1.7.8 do bundle exec torqbox -b 0.0.0.0 -E production"
commands = [
Command("rvm jruby-1.7.... | StarcoderdataPython |
3349337 | <filename>substrabac/substrapp/tests/tests_model.py<gh_stars>0
import os
import shutil
import tempfile
from checksumdir import dirhash
from django.test import TestCase, override_settings
from substrapp.models import Objective, DataManager, DataSample, Algo, Model
from substrapp.utils import get_hash
from .common imp... | StarcoderdataPython |
180195 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-12-01 08:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tracks', '0011_auto_20161129_1442'),
]
operations = [
migrations.AlterField... | StarcoderdataPython |
1667300 | <gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# CUPyDO configuration file
# Agard445 wing
# <NAME> & <NAME>
def test(cupydo, tol):
res = cupydo.algorithm.errValue
import numpy as np
from cupydo.testing import *
# Read results from data
cl = cupydo.algorithm.FluidSolver.coreSolver.... | StarcoderdataPython |
1770132 | <reponame>amakaroff82/node-facenet<filename>src/python3/facenet_bridge.py
"""
facenet-bridge
"""
import base64
import errno
import json
import os
from pathlib import PurePath
from typing import (
Any,
List,
Tuple,
)
import tensorflow as tf # type: ignore
import numpy as np # type: ignore
impo... | StarcoderdataPython |
64302 | #
# Copyright (c) 2016, SUSE LLC All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the follow... | StarcoderdataPython |
1712204 | from time import time
from random import sample
from math import log
from joblib import Parallel, delayed
from .data_structures import Proofs, Features, Rankings
# thm1, thm2 -- theorems with features; we measure similarity between them
# dict_features_dict_features_numbers -- info about in how many theorems differen... | StarcoderdataPython |
3274360 | # coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online # noqa: E501
OpenAPI spec version: 0.8.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class GetCharactersCharacterIdAgentsResearch200Ok(object):
... | StarcoderdataPython |
4821840 | """add friendships table
Revision ID: 6f74c797dbd0
Revises: <PASSWORD>
Create Date: 2017-10-16 14:24:33.050913
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
import datetime
utc_now ... | StarcoderdataPython |
84434 | # =============================================================================
# PROJECT CHRONO - http://projectchrono.org
#
# Copyright (c) 2014 projectchrono.org
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file at the top level of the distr... | StarcoderdataPython |
378 | # Generated by Django 4.0.1 on 2022-04-07 01:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('model_api', '0004_remove_order_created_remove_order_id_and_more'),
]
operations = [
migrations.RemoveField(
model_name='order',
... | StarcoderdataPython |
1623402 | <filename>lnbits/wallets/void.py
from typing import Optional
from .base import InvoiceResponse, PaymentResponse, PaymentStatus, Wallet, Unsupported
class VoidWallet(Wallet):
def create_invoice(
self, amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None
) -> InvoiceRespons... | StarcoderdataPython |
1715120 | from config import config
C=config()
from parse_rest.connection import register
register(C['APPLICATION_ID'], C['REST_API_KEY'], master_key=C['MASTER_KEY'])
from parse_rest.datatypes import Object
class ip(Object):
pass
import urllib2
def getIP():
try:
response = urllib2.urlopen('http://dynu... | StarcoderdataPython |
4814225 | # -*- coding: cp1252 -*-
import string
import time
import sys
import re
'''content=open("detail.txt","r")
content=content.read()
content=str.lower(content)
#print(" "+content)'''
query='what is', 'define', 'about', 'definition', 'who is'
val='price of', 'the price of', 'the prise of', 'prise of', 'the cost of', 'cost o... | StarcoderdataPython |
3392123 | """Leetcode 7. Reverse Integer
Easy
URL: https://leetcode.com/problems/reverse-integer/description/
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
click to show spoilers.
Note:
The input is assumed to be a 32-bit signed integer.
Your function should return 0 when the r... | StarcoderdataPython |
4842321 | <gh_stars>1-10
#!/usr/bin/env python3
import graph
| StarcoderdataPython |
3278946 | <reponame>DonaldMcC/kite_ros2<gh_stars>0
#!/usr/bin/env python
# this gets the barangle from the arduino board
import rospy
from std_msgs.msg import Int16
from kite_funcs import getangle
from mainclasses import calcbarangle, inferangle
barangle = 0
resistance = 200
mockresistance = 200
mockangle = 0
def callback(dat... | StarcoderdataPython |
3327716 | import unittest
class DictNested(dict):
"""
Naive dictionary extension to work with deeply nested keys.
Class provides methods to get values and dictionaries from deeply nested
dictionary and set/reset/delete values in nested dictionary.
"""
def check_input(self, path):
if isinstance(s... | StarcoderdataPython |
183104 | <filename>bin/list_rc_log.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import datetime
import os
import pytz
import sys
import re
sys.path.append(os.path.join(sys.path[0], "../", "lib"))
import stable_email # noqa: E402
def get_number(s):
match = re.search('(\d+)', s)
if match:
... | StarcoderdataPython |
4835316 | from typing import List
import os
import shutil
def get_msg_name(size: int, unit: str) -> str:
return f"Stamped{size}{unit}.msg"
def get_msg_content(byte_size: int) -> List[str]:
content = ["", ""]
content[0] = "performance_test_msgs/PerformanceHeader header\n"
content[1] = "byte[" + str(byte_size) + ... | StarcoderdataPython |
1770479 | <reponame>chrisconley/python-data-structures
"""
LinkedList implementation from Section 1.3 pgs 150
"""
class Queue:
def __init__(self):
self._first = None
self._last = None
self._size = 0
def enqueue(self, item):
if self.size >= 1:
# the old last is replaced with ... | StarcoderdataPython |
1777514 | from django.db import models
from django.core.exceptions import ValidationError
from CadetApp.models import Cadet
# Create your models here.
class Meeting(models.Model):
TERM_CHOICES = [
(1, 'Term 1'),
(2, 'Term 2'),
(3, 'Term 3'),
(4, 'Term 4'),
]
term = models.IntegerFiel... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.