id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
3203492 | # Generated by Django 3.0.5 on 2020-06-01 22:25
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('billing', '0001_initial'),
('vendors', '0001_initial'),
('carts', '0002_auto_20200601_22... | StarcoderdataPython |
111569 | <reponame>byu-dml/d3m-profiler
import multiprocessing as mp
import pickle as pk
import sys
import numpy as np
import pandas as pd
import sent2vec
_NUM_THREADS = (mp.cpu_count() - 1)
"""
Initializes a Sent2vecModel based on model weights
Returns
-------
tuple(model, emb_size): Tuple(sent2vec.Sent2vecModel, int)
... | StarcoderdataPython |
3306408 | import random
import torch
from test.wcm.helper import TestCase
from turing.wcm.networks import GetInitialSymbol
class TestCrossAttention(TestCase):
def test_single_layer(self):
"""Claim C.7
"""
tx = self.tx
tape = "B(())E"
z = random.choice(tx.states)
u = ... | StarcoderdataPython |
1680383 | import argparse
import os
import pandas as pd
import numpy as np
from tqdm import tqdm
from sklearn.model_selection import train_test_split
tqdm.pandas()
parser = argparse.ArgumentParser()
parse.add_argument("--mimic_dir", help="The directory contaning all the required MIMIC files (ADMISSIONS, PATIENTS, DIAGNOSES_I... | StarcoderdataPython |
1635829 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | StarcoderdataPython |
144633 | from django.apps import AppConfig
class JsonAuthConfig(AppConfig):
name = 'json_auth'
| StarcoderdataPython |
3286927 | <filename>chainer/training/trainer.py
import collections
import os
import six
from chainer import reporter as reporter_module
from chainer.training import extension as extension_module
from chainer.training import trigger as trigger_module
class _ExtensionEntry(object):
def __init__(self, extension, priority, ... | StarcoderdataPython |
2888 | <gh_stars>0
from slackclient import SlackClient
from external import SLACK_API_KEY
class SlackBot:
API_CHAT_MSG = 'chat.postMessage'
BOT_NAME = 'News Bot'
DEFAULT_CHANNEL = 'news_notification'
def __new__(cls, *p, **k):
if '_the_instance' not in cls.__dict__:
cls._the_instance = ... | StarcoderdataPython |
165245 | <reponame>ueg1990/towatchlist<gh_stars>1-10
from threading import Thread
from flask import render_template
from flask.ext.mail import Message
from . import app, mail
PREFIX = '[ToWatchList] '
MAIL_SENDER = 'ToWatchList Admin <{0}>'.format(app.config['MAIL_USERNAME'])
def send_async_email(app, msg):
with app.app_c... | StarcoderdataPython |
150609 | #!/usr/bin/env python
# Copyright 2015 Coursera
#
# 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 |
4820726 | <filename>kivy3/extras/sphere.py
"""
The MIT License (MIT)
Copyright (c) 2020 <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
t... | StarcoderdataPython |
179518 | from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.keys import Keys
import time
from PIL import Image
import os
import pytesseract
#url of the login page
url = 'https:... | StarcoderdataPython |
22228 | <reponame>lambda-mud-cs18/backend
# Generated by Django 2.2.3 on 2019-07-31 17:10
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
... | StarcoderdataPython |
1708186 | <gh_stars>10-100
__author__ = 'efelix'
from rdkit import Chem
from beaker.utils.functional import _apply, _call
from beaker.utils.io import _parseMolData
import beaker.utils.chemical_transformation as ct
import copy
import json
import os.path as path
data_dir = path.abspath(path.join(__file__ , "../../../../data"))
... | StarcoderdataPython |
3303053 | <reponame>plimkilde/DHMQC
from __future__ import print_function
from __future__ import absolute_import
# Copyright (c) 2015-2016, Danish Geodata Agency <<EMAIL>>
# Copyright (c) 2016, Danish Agency for Data Supply and Efficiency <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any
# pu... | StarcoderdataPython |
4825505 | from unittest import TestCase
import geopandas as gpd
import pandas as pd
import shapely.wkt
from cate.ops.data_frame import data_frame_min, data_frame_max, data_frame_query
class TestDataFrameOps(TestCase):
df = pd.DataFrame({'A': [1, 2, 3, 4, 5, 6],
'B': ['a', 'b', 'c', 'x', 'y', 'z'],
... | StarcoderdataPython |
106304 | <filename>projects/fizzbuzz/python/test.py
import pytest
from fizz_buzz import fizz_buzz
def test_fizzbuzz():
fizzbuzz_string5 = ' 1\n2\nfizz\n4\nbuzz\n'
fizzbuzz_string10 = ' 1\n2\nfizz\n4\nbuzz\nfizz\nbazz\n8\nfizz\nbuzz\n'
fizzbuzz_string21 =' 1\n2\nfizz\n4\nbuzz\nfizz\nbazz\n8\nfizz\nbuzz\n11\nfizz\n... | StarcoderdataPython |
1634770 | def run():
from petsc4py import PETSc
from pridge import LSRpetsc
#OptDB = PETSc.Options()
#N = OptDB.getInt('N', 100)
#draw = OptDB.getBool('draw', False)
ddir = '../data/'
# load the "sparse" operator
viewer = PETSc.Viewer().createBinary(ddir +'A_train.dat', 'r')
A_train = PETSc.Mat(P... | StarcoderdataPython |
81442 | # coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from pants.option.custom_types import file_option
from pants.subsystem.subsystem import S... | StarcoderdataPython |
136504 | import aws_cdk as core
import aws_cdk.assertions as assertions
from nomic_bot.nomic_bot_stack import NomicBotStack
# def test_sqs_queue_created():
# app = core.App()
# stack = NomicBotStack(app, "nomic-bot")
# template = assertions.Template.from_stack(stack)
# template.has_resource_properties("AWS::S... | StarcoderdataPython |
1705272 | <reponame>Milo-Goodfellow-Work/GuildsDevelopmentBuild<filename>GroupChat/migrations/0002_auto_20181003_2132.py<gh_stars>0
# Generated by Django 2.0.7 on 2018-10-03 21:32
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('GroupChat', '0001_initial'),
]
ope... | StarcoderdataPython |
88699 | <gh_stars>100-1000
"""Codesign."""
import re
import subprocess
from os import remove
from pathlib import Path, PurePath
from tempfile import gettempdir
def _xxd(blob):
"""XXD"""
result = None
# Note, this requires input passed in via 'stdin', so include 'stdin' for piping input.
_cmd = ['/usr/bin/x... | StarcoderdataPython |
124070 | <gh_stars>0
from clientModbus import ClienteMODBUS
dbpath = "C:\\Users\\<NAME>\\Documents\\GitHub\\EnergyEfficiencyproject\\DB\\database1.db"
c = ClienteMODBUS('127.0.0.1', 502, dbpath=dbpath)
c.atendimento() | StarcoderdataPython |
3297209 | import vivialconnect
from tests.common import BaseTestCase
from tests.common import HTTMock
class MessageTest(BaseTestCase):
def test_create_message(self):
with HTTMock(self.response_content,
body=self.load_fixture('message/message'),
headers={'Content-type': 'ap... | StarcoderdataPython |
1747970 | #! /usr/bin/env python
import numpy as np
from scipy.stats import norm
import logging
from .base import BaseSimulator
from .utils import NumpyDataset
from scipy.special import i0
logger = logging.getLogger(__name__)
class MixtureSphereSimulator(BaseSimulator):
def __init__(self, latent_dim=2, data_dim=3, kappa=... | StarcoderdataPython |
3231123 | <filename>microbenthos/core/__init__.py<gh_stars>1-10
from .domain import SedimentDBLDomain
from .entity import Entity, DomainEntity
from .variable import ModelVariable
from .expression import Expression
from .irradiance import Irradiance, IrradianceChannel
from .microbes import MicrobialGroup
from .process import Proc... | StarcoderdataPython |
1631512 | __version__='1.10.20220211'
| StarcoderdataPython |
106993 | #!/usr/bin/env python
"""Stitch together the same HiRISE color-filter CCDs from an observation to
create a single mosaicked image file.
This program:
- Optionally performs cubenorm processing on each CCD using a training area
that has been selected by the user. Cubenorm processing
is required whenever radiome... | StarcoderdataPython |
1660595 | ## Spectral Response Functions
### Spectral Response functions
#Py6S uses the Wavelength class to handle the wavelength(s) associated with a given channel (a.k.a. waveband). This might be a single scalar value (e.g. a central wavelength) or, if known, possibly the spectral response function of the waveband. The Sentine... | StarcoderdataPython |
82025 | <reponame>allink/woodstock<filename>woodstock/models/salutation.py
from django.contrib import admin
from django.db import models
from django.utils import translation
from django.utils.translation import ugettext_lazy as _
from woodstock import settings
#---------------------------------------------------------------... | StarcoderdataPython |
1776320 | import argparse
import os
import torch
import torch.nn as nn
import torch.utils.data as data
class Configs(object):
@staticmethod
def base_config():
parser = argparse.ArgumentParser()
parser.add_argument("--classifier", type=str, default="vdpwi", choices=["vdpwi", "resnet"])
parser.add... | StarcoderdataPython |
3326473 | import fbuild.config.c as c
# ------------------------------------------------------------------------------
class readline_h(c.Test):
header = c.header_test('readline/readline.h')
| StarcoderdataPython |
90558 | <reponame>nielsvanhooy/genieparser<gh_stars>0
expected_output = {
'tracker_name': {
'tcp-10001': {
'status': 'UP',
'rtt_in_msec': 2,
'probe_id': 2
},
'udp-10001': {
'status': 'UP',
'rtt_in_msec': 1,
'probe_id': 3
... | StarcoderdataPython |
1774568 | <filename>exercises/096.py
"""
Make a program that has a function
called fancytxt, which gets any text
as parameter, and print a message
with adaptative length
"""
def fancytxt(msg):
msg = '* '+msg+' *'
length = len(msg)
print('~'*length)
print(f'{msg}')
print('~'*length)
fancytxt('Hello world!')... | StarcoderdataPython |
4841442 | <reponame>liangyy/ukb_idp_genetic_arch<filename>methods/imagexcan/logistic_regression_gpu.py
import scipy.stats
import torch
import statsmodels.api as sm
import numpy as np
class BatchLogisticSolver:
def __init__(self):
self.info = '''Fit logit(y) ~ x + covariates for every x_i ~ y pair in batch.'''
... | StarcoderdataPython |
1632875 | #!/usr/bin/env python
import rospy
import sys
import math
import time
from std_msgs.msg import Float64
from geometry_msgs.msg import Point
step_len = 0.8
step_base_hei = 1.5
step_hei = 0.2
cycle = 2
adjust_x = 0.4
adjust_z = 0.15
def trot():
rospy.init_node('simple_demo',anonymous=True)
rf_leg = rospy.Publisher('rf/... | StarcoderdataPython |
12390 | <filename>gQuant/plugins/hrp_plugin/greenflow_hrp_plugin/__init__.py<gh_stars>0
"""
////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) NVIDIA Corporation. All rights reserved.
//
// NVIDIA Sample Code
//
// Please refer to the NVIDIA end user license agreement (EULA... | StarcoderdataPython |
1712494 | #-------------------------------------------------------------------------------
# Find the desired root for a function to the requested accuracy using simple
# bisection.
#-------------------------------------------------------------------------------
def bisectFunction(functor, x1, x2, ytarget, xaccuracy):
y1 = f... | StarcoderdataPython |
155831 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
pyaction
~~~~~~~~
PyAction is a module dedicated to eliminate rewriting the same code from
project to project by providing a set of tools according to specific python
fields.
Library hierarchy (this must be set and be followed in any case):
pyaction/
field_name/
... | StarcoderdataPython |
1727957 | stud = ['Ram', 'Vijay', 'Anu', 'Ramesh', 'suja']
for k in stud:
print('Hello: ', k)
print('done') | StarcoderdataPython |
4819166 | <filename>common_python/tests/types/test_extended_dict.py
"""Tests for Extended dict"""
from common_python.types.extended_dict import ExtendedDict
import common_python.constants as cn
import copy
import os
import unittest
IGNORE_TEST = True
TEST_PATH_PCL = os.path.join(cn.TEST_DIR,
"test_extended_dict.pcl")
TES... | StarcoderdataPython |
3204578 | # Generated by Django 3.0.8 on 2020-07-25 02:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('encrypt_decrypt_app', '0015_auto_20200724_1935'),
]
operations = [
migrations.AddField(
model_name='ciphergame',
nam... | StarcoderdataPython |
3387439 | <filename>housing/thirumurugan_housing/doctype/api.py
from __future__ import unicode_literals
import frappe
@frappe.whitelist()
def apikey_generator():
| StarcoderdataPython |
1663827 | """
Error messages from device
"""
MSG = {
'NO_DEF' : 'Command is not valid (not defined) for the device',
'_LOGIC' : 'Access Code is not valid or execution of command is not logical',
'_RANGE' : 'Error if any data value in send sequence is out of range.',
'ERROR1' : 'Sensor is defect or stacked out',
... | StarcoderdataPython |
109959 | <reponame>divyanshupachisia/safety_rl
"""
Please contact the author(s) of this library if you have any questions.
Authors: <NAME> ( <EMAIL> )
This module implements the parent class for the lunar lander environments,
e.g., single lunar lander environment.
"""
import numpy as np
import math
import gym
from gym impo... | StarcoderdataPython |
3215227 | class A(object):
def methodA(self):
return 's'
class B(object):
def getA(self):
return self.funcA()
def funcA(self):
return A()
| StarcoderdataPython |
1628070 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from deep_recommenders.estimator.models.feature_interaction.fm import fm
from deep_recommenders.estimator.models.feature_interaction.fm import FM
from deep_recommenders.estimator.models.feature_interaction.dnn import dnn
| StarcoderdataPython |
45112 | def version():
"""Function takes no aruguments and returns a STR value of the current version of the library. This value should match
the value in the setup.py
:param None
:return str value of the current version of the library
:rtype str
>>> version()
1.0.33
"""
print ('1.0.34') | StarcoderdataPython |
194879 | # -*- coding: utf-8 -*-
import asyncio
import aiohttp
VERSION = 'v1.5.3'
def check_update():
asyncio.ensure_future(_do_check_update())
async def _do_check_update():
try:
async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=10)) as session:
async with session.get('https... | StarcoderdataPython |
185676 | <reponame>zsync/target-classification
import tensorflow as tf
from layers.utils import CustomLayer, IdentityLayer
"""
ref: https://github.com/keras-team/keras-applications/blob/master/keras_applications/mobilenet.py
"""
def _ConvBlock(filters, alpha, kernel=(3, 3), strides=(1, 1)):
filters = int(filters * alpha)... | StarcoderdataPython |
3343240 | <gh_stars>0
import datetime
import os
import requests
import time
import shutil
import sys
from configobj import ConfigObj
from streamrecorder import dvrutils
from streamrecorder import schedule
from streamrecorder import stream
def get_camera_connections():
config = ConfigObj('pytest.cfg')
onvifDir = config... | StarcoderdataPython |
4808095 | #!/usr/bin/python
#
# Usage:
# scripts/upload-assets.py VERSION
#
# where VERSION is a version string like "v1.2.3" or "latest"
#
# Generates static assets for HTML, JS, and CSS.
# Then uploads them to the public bucket.
import argparse
import os
import re
import subprocess
import sys
parser = argparse.ArgumentParser... | StarcoderdataPython |
3339473 | import itertools as it
import re
import string
import os
import hashlib
import cssselect2
from colour import web2hex
from xml.etree import ElementTree
from tinycss2 import serialize as css_serialize
from tinycss2 import parse_stylesheet, parse_declaration_list
from manimlib.constants import ORIGIN, UP, DOWN, LEFT, RI... | StarcoderdataPython |
3303555 | <filename>jude_customization/jude_customization/doctype/atlantic_fluid_configuration/atlantic_fluid_configuration.py
# Copyright (c) 2021, <NAME>, github.com/mymi14ss and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class AtlanticFluidConfig... | StarcoderdataPython |
3352921 | <gh_stars>10-100
import numpy as np
import loadseg
import expdir
DATASETS = ['pascal', 'ade20k', 'opensurfaces', 'dtd']
def get_dataset_index(fn):
for i in range(len(DATASETS)):
if DATASETS[i] in fn:
return i
def load_image_dataset_label_index(directory):
ed = expdir.ExperimentDirector... | StarcoderdataPython |
3207907 | from aiogram import types
from ..loader import dp
from ..utils.helpers import get_message_one_button
from aiogram.dispatcher.filters import Command
from content.models import TelegramUser
from ..keyboards.inline import menu_markup
@dp.message_handler(Command('start'))
async def send_menu(message: types.Message):
... | StarcoderdataPython |
1775296 | class Firstclass:
def setdata(self, value):
self.data = value
def display(self):
print(self.data)
class Secondclass(Firstclass):
def display(self):
print('Current value = "%s"' % self.data)
class Thirdclass(Secondclass):
def __init__(self, value):
self.data = value
... | StarcoderdataPython |
3268941 | import argparse
from pathlib import Path
import cv2
import yaml
import tensorflow as tf
import os
import numpy as np
print(tf.__version__)
parser = argparse.ArgumentParser()
parser.add_argument('--pre', type=str, help='pre processing.')
parser.add_argument('--weight',type=str, required=True, help='directo... | StarcoderdataPython |
6438 | <gh_stars>1-10
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# load dataset into Pandas DataFrame
df = pd.read_csv("D:\Python_programs\ML\Iris Data\KPCA\iris.csv")
#df.to_csv('iris.csv')
from sklearn.preprocessing import StandardScaler
features = ['sepal length', 'sepal width', 'petal length... | StarcoderdataPython |
3386152 | <reponame>arditaabdullahu/arkep
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/', methods=['GET','POST'])
def index():
if request.method == 'GET':
return render_template('index.html')
elif request.method == 'POST':
error = ""
field1 = request.form['field1']
fi... | StarcoderdataPython |
37220 | # Copyright 2018 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Partial response utilities for an Endpoints v1 over webapp2 service.
Grammar of a fields partial response string:
fields: selector [,select... | StarcoderdataPython |
71924 | <filename>tests/test_seedless_procrustes.py
# Copyright (c) Microsoft Corporation and contributors.
# Licensed under the MIT License.
import unittest
import numpy as np
from scipy import stats
from graspologic.align import SignFlips
from graspologic.align import SeedlessProcrustes
class TestSeedlessProcrustes(unitt... | StarcoderdataPython |
1604363 | #!/usr/bin/env python
from eggcellent import egg
import matplotlib.pyplot as plt
plt.scatter([0, 1], [0, 1], marker=None, verts=egg, s=200)
plt.savefig('eggs.png')
| StarcoderdataPython |
1723647 | __all__ = ["data_processor","data_retriever"]
| StarcoderdataPython |
3264476 | # -*- coding: utf-8 -*-
# @File : test_NCFFeatureCreator.py
# @Author : <NAME>
# @Time : 2021/10/29 上午9:36
# @Disc :
from unittest import TestCase
import pandas as pd
import os
from src.FeatureCreator.NCFFeatureCreator import NCFFeatureCreator
from test.config import raw_data_dir, cleaned_data_dir
from src.c... | StarcoderdataPython |
3256291 | <filename>Conversely_Frontend/Server.py
#!/usr/bin/python
import tornado.web
import tornado.ioloop
import os
import ukjp.config
import ukjp.fbactions
import ukjp.database
import thread
import json
import hashlib
class UkJPRequestHandler(tornado.web.RequestHandler):
def set_default_headers(self):
self.add_h... | StarcoderdataPython |
3308136 | from functools import partial
import gc
from multiprocessing import Pool
import sys
import numpy as np
from tqdm import tqdm
from components.spectrum.alignment import pafft
if __name__ == '__main__':
MZS = sys.argv[1]
REFERENCE = sys.argv[2]
SPECTRA = sys.argv[3]
POOL_SIZE = int(sys.argv[4])
DES... | StarcoderdataPython |
28123 | #!/usr/bin/env python3
"""Named tuple example."""
from collections import namedtuple
Car = namedtuple('Car', 'color mileage')
# Our new "Car" class works as expected:
MY_CAR = Car('red', 3812.4)
print(MY_CAR.color)
print(MY_CAR.mileage)
# We get a nice string repr for free:
print(MY_CAR)
try:
MY_CAR.color = 'bl... | StarcoderdataPython |
1663906 | import qdarkstyle
import sys
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from Voicelab.VoicelabWizard.InputTab import InputTab
from Voicelab.VoicelabWizard.OutputTab import OutputTab
from Voicelab.VoicelabWizard.SettingsTab import SettingsTab
from Voicelab.VoicelabWizard.VoicelabC... | StarcoderdataPython |
1659124 | # https://www.geeksforgeeks.org/python-program-for-reverse-a-linked-list/
def reverse_list(head):
prev = None
while head:
curr = head
head = head.next
curr.next = prev
prev = curr
return prev
def reverse_linked_list(ll):
prev = None
curr = ll.head
next = curr.ge... | StarcoderdataPython |
1739564 | # This problem was recently asked by Twitter:
# Given a sorted list with duplicates, and a target number n, find the range in which the number exists
# (represented as a tuple (low, high), both inclusive. If the number does not exist in the list, return (-1, -1)).
def getIndexPositions(listOfElements, element):
... | StarcoderdataPython |
186581 | <reponame>zybbigpy/VaspCZ<filename>sourcecode/VaspNEBKeepInputs.py
import os
def run():
maintain_files = 'ini,fin'.split(',')
files = os.listdir('./')
del_files = []
for file in files:
if file in maintain_files:
pass
else:
del_files.append(file)
ipt = input(f'Thoes files/dir will be kept: {maintain_fil... | StarcoderdataPython |
141247 | add_library('opencv_processing')
src = loadImage("test.jpg")
size(src.width, src.height, P2D)
opencv = OpenCV(this, src)
opencv.findCannyEdges(20, 75)
canny = opencv.getSnapshot()
opencv.loadImage(src)
opencv.findScharrEdges(OpenCV.HORIZONTAL)
scharr = opencv.getSnapshot()
opencv.loadImage(src)
opencv.findSobelEdge... | StarcoderdataPython |
4806632 | from rqrobot.utils.testing import rqrobotTestCase, mock_instrument, mock_bar, mock_tick
from rqrobot.mod.rqrobot_mod_sys_accounts.testing import BenchmarkAccountFixture
class ModSysAccountsBenchmarkAccountTestCase(BenchmarkAccountFixture, rqrobotTestCase):
def __init__(self, *args, **kwargs):
super(ModSys... | StarcoderdataPython |
29462 | <filename>manila/tests/share/drivers/hitachi/hnas/test_driver.py
# Copyright (c) 2015 Hitachi Data Systems, 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 a... | StarcoderdataPython |
3257558 | ## inititalization
name = "SklearncomPYre"
from SklearncomPYre.train_test_acc_time import train_test_acc_time
from SklearncomPYre.split import split
from SklearncomPYre.comparison_viz import comparison_viz
| StarcoderdataPython |
3399309 | import sys
import matplotlib.pyplot as plt
from pypelt.input_parser import InputParser
from pypelt.fuzzy_classes import *
from pypelt.fuzzy_processors import *
from copy import deepcopy
def visualize_system(knowledgebase: FuzzyKB, inputs: dict, rule_stacks: list) -> None:
"""
A function that renders the fuzzy... | StarcoderdataPython |
1753500 | from test_base import TestBase
import re
class brk_test(TestBase):
def __init__(self):
super().__init__("brk", 3)
def test(self, data):
self.assert_ge(len(data), 3)
p1 = "Before alloc,heap pos: (.+)"
p2 = "After alloc,heap pos: (.+)"
p3 = "Alloc again,heap pos: (.+)"
... | StarcoderdataPython |
1725795 | <gh_stars>0
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="style_transfer_snip", # Replace with your own username
version="1.0.0",
author="<NAME>",
author_email="<EMAIL>",
description="GUI for applying Style Transfer models on screensh... | StarcoderdataPython |
66019 | from builtins import range
from datetime import timedelta
import datetime
import math
from operator import itemgetter
import re
import calendar
import pytz
from django.conf import settings
from django.utils import timezone
from django.utils.translation import ugettext
DATE_FORMAT = '%Y-%m-%d'
DATETIME_FORMAT = '%Y-%... | StarcoderdataPython |
1647849 | <reponame>RaotechSistemas/Python
# Conversor de temperaturas
# Convertendo de Celcius para Fahrenheit e Kelvin
c = float(input('Digite uma temperatura em Celcius: ') )
f = c * 9 / 5 + 32
k = c + 273.15
print(f'A temperatura de {c:.2f}° Celcius é igual a {f:.2f}° em Fahrenheit e a {k:.2f}° em Kelvin')
# Convertendo d... | StarcoderdataPython |
3204398 | <filename>ExerciciosPython/Sortear um aluno.py<gh_stars>1-10
# Um professor quer sortear um dos seus quatro alunos para apagar o quadro. Faça um programa que ajude ele, lendo o nome dos alunos e escrevendo na tela o nome do escolhido.
import random
print('Serão sorteados quatro alunos para apagar o quadro...')
a1 = str... | StarcoderdataPython |
1741778 | #! /usr/bin/env python3
"""Create an OTU table for ProPhyle's classification output for NCBI-based indexes
Author: <NAME> <<EMAIL>>
Licence: MIT
"""
import argparse
import enum
import sys
from collections import Counter
# EXTERNAL
from ete3 import Tree, NCBITaxa
desc = """\
Program: prophyle_otu_table
Create an O... | StarcoderdataPython |
63097 | import functools
import json
import re
from collections import Counter
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from statics import STRUCTURE_TYPES
sns.set_style("whitegrid")
plt.rcParams["figure.figsize"] = (18, 12)
plt.rcParams["font.size"] ... | StarcoderdataPython |
1653882 | from setuptools import setup
setup(name='yolov3_tf2',
version='0.1',
url='https://github.com/Caesar2011/yolov3-tf2',
author='<NAME>',
author_email='<EMAIL>',
packages=['yolov3_tf2']) | StarcoderdataPython |
60589 | #!/usr/bin/env python
# Copyright 2017-2018 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | StarcoderdataPython |
100253 | <gh_stars>0
import random
import re
def parse_roll_request(request):
# here, we use a try-except block, b/c it would be easy for the user to send us a bad request
try:
# https://stackoverflow.com/questions/12409894/fast-way-to-split-alpha-and-numeric-chars-in-a-python-string/12411196
tokens = ... | StarcoderdataPython |
1738536 | <reponame>xuericlin/wikum
# -*- coding: utf-8 -*-
# Copyright 2008-2016 <NAME> (<EMAIL>)
# This file is part of wikitools.
# wikitools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the L... | StarcoderdataPython |
57603 | <reponame>askintution/rikai
# Copyright 2022 Rikai Authors
#
# 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 applic... | StarcoderdataPython |
1776323 | '''
notebookutils.py
2012 <NAME>
Arizona State University
A few helpful routines for using IPython notebook.
'''
from IPython.core.pylabtools import print_figure
from IPython.core.display import display, HTML, Math, Latex
from sympy import Matrix, latex
import numpy as np
def limitprec(m, prec=3):
'''Silly fun... | StarcoderdataPython |
162437 | <reponame>vikneswaran20/rn
import click
def validate_range(ctx, param, value):
if value[0] >= value[1]:
raise click.BadParameter('The given lower range should be lesser than upper range')
return value
def validate_precision(ctx, param, value):
if value is not None and value > 10:
raise ... | StarcoderdataPython |
3228748 | <filename>6.00SC/static/unit-1/lecture-7-debugging/lec07.py<gh_stars>1-10
##x = 0.0
##numIters = 100000
##for i in range(numIters):
## x += 0.1
##print x #prints 10000.0, because print automatically rounds
##print repr(x)
##print 10.0*x == numIters
##
##def close(x, y, epsilon = 0.00001):
## return abs(x - y) < e... | StarcoderdataPython |
1697951 | <reponame>minelminel/sirajify
import re
from flask import Flask, Blueprint, render_template, request, url_for, redirect
def create_app(settings=None):
application = Flask(__name__)
application.config['SECRET_KEY'] = 'you-will-never-guess'
if settings:
application.config.update(settings)
applica... | StarcoderdataPython |
3365408 | <gh_stars>0
#!/usr/bin/env python3
# this program checks the config push latency for the pilot.
import check_metrics
from prometheus import Query, Alarm, Prometheus
import sys
import os
import time
import typing
import subprocess
import argparse
cwd = os.getcwd()
path = os.path.abspath(
os.path.join(
os.pa... | StarcoderdataPython |
1605317 | <filename>statistics.py
# -*- coding: utf-8 -*-
import random
import utils
from game_simulator import Game
def evaluate_strategy(strategy, opponent_list, num_eval_game=10):
""" Benchmark player object @strategy to evaluate its probability to win """
win_counts = 0
strategy.reset_statistics()
for i i... | StarcoderdataPython |
3224848 | # Copyright (C) 2013 Nippon Telegraph and Telephone 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | StarcoderdataPython |
4815834 | <filename>2014/MAC0242/Projeto/battle_server.py
import sys, socket
from flask import Flask, request, Response
# Carregando a classe Pokemon
from pokemon.pokemon import Pokemon
# Tarefas comuns para o servidor e o cliente ficaram no módulo battle.py
from battle import validate, simple_duel, make_battle_state, command_l... | StarcoderdataPython |
10792 | #-*- coding: utf-8 -*-
#! /usr/bin/env python
'''
#------------------------------------------------------------
filename: lab4_runTFCurveFitting.py
This is an example for linear regression in tensorflow
Which is a curve fitting example
written by <NAME> @ Aug 2017
#---------------------------------------------... | StarcoderdataPython |
155516 | import tkinter as tk
from tkinter import messagebox
def askquit():
if messagebox.askokcancel("Quit", "J'adore les popups"):
fen1.destroy()
fen1 = tk.Tk()
fen1.title("pranked")
fen1.config(bg="Red")
fen1.geometry("400x100")
Ok = tk.Button(fen1, text='Ok !', command=askquit())
text = tk.Label(fen1, fg='Re... | StarcoderdataPython |
1771251 | import os.path as osp
import random
import mmcv
import numpy as np
from .custom import CustomDataset
from mmcv.parallel import DataContainer as DC
# from pycocotools.bdd import BDD
from .utils import to_tensor, random_scale
from .registry import DATASETS
import os
# TODO: Add test code
# TODO: Confirm Train aug refer... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.