id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
9674298
def cat_name_collection_two(): cat_name_collections = [] counter = 1 cat_name = "" while cat_name != "stop": cat_name = input(f'Enter the name of cat {counter} ') cat_name_collections.append(cat_name) counter += 1 cat_name_collections.pop() return cat_name_coll...
StarcoderdataPython
9745877
from nmigen import * from nmigen.build import * # connect to PMOD1A (loopbacks are on B) snes_pmod = [ Resource("snes", 0, # inputs from snes Subsignal("latch", Pins("4", dir="i", conn=("pmod", 0)), Attrs(IO_STANDARD="SB_LVCMOS33")), Subsignal("p1clk", Pins("2", dir="i", conn=("...
StarcoderdataPython
4917017
def solution(s): result = [0, 0] while True: result[0] += 1 result[1] += s.count("0") s = bin(s.count("1"))[2:] if s == "1": break return result
StarcoderdataPython
214707
<gh_stars>1-10 import logging from .utils import colorize class ColorizingStreamHandler(logging.StreamHandler): def __init__(self): super().__init__() self.level_map = { # LEVEL: (background, foreground, bold/normal/underscore) logging.DEBUG: (None, 'blue', 'normal'), ...
StarcoderdataPython
4861496
<reponame>jashwanth9/Expert-recommendation-system<filename>code/splitTrainData.py trainData = [] with open('../train_data/train_norm.txt', 'r') as f1: for line in f1: line = line.rstrip('\n') sp = line.split() trainData.append((sp[0], sp[1], float(sp[2]))) folds = 8 i = 3 N = len(trainData) td = trainData[:(i)*...
StarcoderdataPython
8029932
from . import torch
StarcoderdataPython
4904881
import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') def test_terraform_binary_exists(host): assert host.file('/usr/local/bin/terraform').exists def test_terraform_binary_file(host): asse...
StarcoderdataPython
5029484
<reponame>xUndero/noc # -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Settings for "sa" module # --------------------------------------------------------------------- # Copyright (C) 2007-2010 The NOC Project # See LICENSE for details # ---------------------------------...
StarcoderdataPython
11253157
import base64 from django.utils.translation import ugettext as _ from django.conf import settings from ..models import SocialAuthProvider from base.oauth1base import Oauth1Base class TwitterSocialConnect(Oauth1Base): name = 'Twitter' # required by all twitter provider consumer_key = settings.TWITTER_CONSU...
StarcoderdataPython
6447299
apikey="<--put your NCBI key here-->" ncbo_key="<--put your NCBO key here-->"
StarcoderdataPython
5130364
import pika import uuid import datetime import os import json import time # pip install pika def GetMessagePayload(message='\n\t - Hello Dotnet From Python - Standard Headers Works!\n', sendExitMessage=False): message = { 'MessagePayload': message, 'TellMeToExit': sendExitMessage } return ...
StarcoderdataPython
4903502
<reponame>quinnabrvau/Keras_2_CMSIS #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 8 16:54:29 2018 @author: quinn """ from copy import deepcopy import numpy as np def activation_map(_act): act = _act.lower() if 'tanh' == act: return 'tanh' elif 'hard_sigmoid' == act or 'sig...
StarcoderdataPython
229297
from os.path import dirname, abspath from os import system, environ sim_path = dirname(dirname(dirname(dirname(abspath(__file__))))) scene_path = sim_path + '/Simulation/scene/' import sys sys.path.append(sim_path) from Simulation.src.camera import Camera from Simulation.src.env import Env from Simulation.src.franka im...
StarcoderdataPython
5082499
<gh_stars>0 # -*-coding:UTF-8-*- import uuid import os class Handle(object): def __init__(self, cli, volume_path): self.cli = cli self.volume_path = volume_path def __call__(self, code): name = uuid.uuid4() path = '{}{}.py'.format(self.volume_path, name) with open(pat...
StarcoderdataPython
230463
<reponame>jcsumlin/Peribot """Deop Secret Santa table Revision ID: 4077902180f3 Revises: <KEY> Create Date: 2021-03-13 23:14:19.739043 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '4077902180f3' down_revision = '<KEY>' branch_labels = None depends_on = None ...
StarcoderdataPython
11298450
<filename>python/simutils.py """ Utility functions for convolutional neural movement model """ import os import glob import numpy as np from tqdm import tqdm import matplotlib.pyplot as plt import multiprocessing import pandas as pd import PIL import torch import torch.nn as nn import torch.nn.functional as F import to...
StarcoderdataPython
3461434
<reponame>jnthn/intellij-community class Base: def method(self, **kwargs): """ :key foo: foo :key bar: bar :key baz: """ class Sub(Base): def met<the_ref>hod(self, *, foo, bar): super().method(foo=foo, bar=bar)
StarcoderdataPython
287270
import unittest import hotspots.fragment_hotspot_maps as fhm from ccdc_development.grid import Grid class Test_BuildLocation(unittest.TestCase): def setUp(self): self.apolar = Grid.from_file("input_files/apolar.grd") indices = (123, 106, 100) i = 0 locations = [] ...
StarcoderdataPython
9788579
""" Strategies for values of various data types. """ # The classes in this file ahve a single public method by design. # pylint: disable=too-few-public-methods import logging import math import hypothesis.strategies as hy_st from . import basestrategies as base_st __all__ = ["PrimitiveStrategy", "BooleanStrategy", "N...
StarcoderdataPython
6602971
<reponame>senavs/pdfto from flask_restplus import Api import settings from apis.pdfto import api as api_1 api = Api(doc=settings.SWAGGER_DOC, title=settings.SWAGGER_TITLE, description=settings.SWAGGER_DESCRIPTION, contact=settings.SWAGGER_CONTACT, contact_url=settings.SWAGGER_C...
StarcoderdataPython
1663747
<reponame>pawelulita/BingAds-Python-SDK __author__ = 'Bing Ads SDK Team' __email__ = '<EMAIL>' from .bulk_label import * from .bulk_label_associations import *
StarcoderdataPython
12415
<gh_stars>0 import copy from pathlib import Path from typing import Dict, Union, List from collections import defaultdict import numpy as np from typeguard import typechecked from zsvision.zs_utils import memcache, concat_features from utils.util import memory_summary from base.base_dataset import BaseDataset class...
StarcoderdataPython
3362318
""" This module contains bounding box classes. A Bounding Box allows you to calculate the overall bounds of a point cloud - but does not store the point cloud itself, it simply expands to match the outer most limits of the point cloud data. There are three Bounding Box classes: Bounds: This is an N-Dimensional boundi...
StarcoderdataPython
5043768
<filename>renamer/plugins/tv.py import string import urllib try: import pymeta from pymeta.grammar import OMeta from pymeta.runtime import ParseError pymeta # Ssssh, Pyflakes. except ImportError: pymeta = None from twisted.internet import reactor from twisted.web.client import Agent from renamer ...
StarcoderdataPython
9692008
<reponame>Kyomotoi/HibiAPI import asyncio from typing import Callable, Coroutine, NoReturn, Optional from api.pixiv import ( EndpointsType, IllustType, PixivAPI, PixivConstants, PixivEndpoints, RankingDate, RankingType, SearchDurationType, SearchModeType, SearchSortType, ) from ...
StarcoderdataPython
9786562
<filename>lib/visual_envs.py import numpy as np import random import itertools import scipy.ndimage import scipy.misc import matplotlib.pyplot as plt from numpy.random import rand from scipy.ndimage import gaussian_filter class gameOb(): def __init__(self,coordinates,size,color,reward,name): self.x = coor...
StarcoderdataPython
49199
<reponame>Nayef211/data # Copyright (c) Facebook, Inc. and its affiliates. import warnings from collections import OrderedDict from torch.utils.data import IterDataPipe, functional_datapipe @functional_datapipe("zip_by_key") class KeyZipperIterDataPipe(IterDataPipe): r""":class:`KeyZipperIterDataPipe`. Iter...
StarcoderdataPython
272583
# # delta.py: public Python interface for delta components # # Subversion is a tool for revision control. # See http://subversion.tigris.org for more information. # ###################################################################### # # Copyright (c) 2000-2004 CollabNet. All rights reserved. # # This software is li...
StarcoderdataPython
1882133
import setuptools with open('README_PYPI.md', 'r') as fh: long_description = fh.read() with open('requirements.txt', 'r') as req_file: requirements = [line[:-1] for line in req_file if len(line) > 1] setuptools.setup( name="nn-toolbox", version="0.1.4", author="<NAME>", author_email="<EMAIL...
StarcoderdataPython
3213331
from revelation.isa import decode from revelation.instruction import Instruction import opcode_factory import pytest @pytest.mark.parametrize('name,instr', [('add32', opcode_factory.add32(rd=0, rn=0, rm=0)), ('add16', opcode_factory.add16(rd=0, rn=0, rm=...
StarcoderdataPython
11253768
<filename>aws_support.py from datetime import datetime import os import urllib.request from urllib.request import Request import ftplib import time import sys import daemon from apscheduler.schedulers.blocking import BlockingScheduler import RPi.GPIO as gpio import routines.config as config import routines.helpers as...
StarcoderdataPython
11678
<reponame>sommersoft/Adafruit_CircuitPython_CircuitPlayground """If you're using Mu, this example will plot the light levels from the light sensor (located next to the eye) on your Circuit Playground. Try shining a flashlight on your Circuit Playground, or covering the light sensor to see the plot increase and decrease...
StarcoderdataPython
134717
# =============================================================================== # # # # This file has been generated automatically!! Do not change this manually! # # ...
StarcoderdataPython
4847500
""" -- if number of paths=1 and channels per path=64 -> same architecture as ResNet, no parameter saving -- if number of paths=8 and channels per path=8 -> around half the number of parameters -- if number of paths=32 and channels per path=2 -> biggest parameter saving the more paths, the more saving """
StarcoderdataPython
8185307
import FWCore.ParameterSet.Config as cms eventUserData = cms.EDProducer( 'EventUserData', vertexCollection=cms.InputTag('offlineSlimmedPrimaryVertices'), electronCollection=cms.InputTag("goodElectrons"), muonCollection=cms.InputTag("goodMuons"), jetCollection=cms.InputTag("goodJets"), bJetColle...
StarcoderdataPython
6400252
# flake8: noqa # %% import pprint from router import run_skills as skill import random SEED = 31415 random.seed(SEED) # request_utters = ["t1", "top", "year", "ok", "talk about", "yes", "yes"] # request_utters = ["t1", "top", "year", "ok", "talk about"] request_utters = [ "hi", "top of week", "yes", "...
StarcoderdataPython
238603
<filename>PartA_Hub/sw-part-a.py # Copyright 2012 <NAME> # # 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 ...
StarcoderdataPython
8165956
from selenium import webdriver from time import sleep import sys import os from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC ...
StarcoderdataPython
8025522
import requests import json import urllib from . import __version__ API_URL = 'http://172.16.42.1:1471/api/' class API(object): def __init__(self, apiToken, url = None): super(API, self).__init__(); self.apiToken = apiToken self.url = url if url else API_URL self.userAgent = 'Pynap...
StarcoderdataPython
1624623
from pprint import pprint import pickle with open('data_in/vocab_ko_NER.pkl', 'rb') as f: vocab = pickle.load(f) print("len(vocab): ", len(vocab)) print(vocab)
StarcoderdataPython
184266
""" Tests related to datastore """ import json import unittest import pathlib import requests from run import run_storage_app_process from settings import DATASTORE_APP_ADDRESS from modules.common import build_url class TestingDatastore(unittest.TestCase): """ Tests related to datastore. """ datapat...
StarcoderdataPython
4969724
from .adv_utils import * from .clip_utils import * from .dist_utils import *
StarcoderdataPython
1777540
# Copyright 2021 <NAME> # # 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 to in writing,...
StarcoderdataPython
1864515
from typing import List, Any import altair as alt import arviz as az import pandas as pd import xarray as xr from sklearn.preprocessing import LabelEncoder from bayes_window import models, BayesWindow from bayes_window import utils from bayes_window import visualization from bayes_window.fitting import fit_numpyro fr...
StarcoderdataPython
117398
<filename>Asap-3.8.4/Projects/NanoparticleMC/queuemultipleamc.py #!/usr/bin/env python import os import sys import time import subprocess import numpy as np smc_file = sys.argv[1] id_digits = 6 v0 = 1 n = 2 name = 'AuO_Amc' outdir = smc_file.split('.smc')[0]+"_amc_gas" #string to split is e.g. t4000s500000a300_smc_e...
StarcoderdataPython
6475700
from NeuralNetwork import NeuralNetwork import random import numpy as np training_data = [ {"inputs": np.array([[1], [1]]), "answer": np.array([[0]])}, {"inputs": np.array([[0], [1]]), "answer": np.array([[1]])}, {"inputs": np.array([[1], [0]]), "answer": np.array([[1]])}, {"inputs": np.array([[0], [0...
StarcoderdataPython
55703
""" make_prefixsums.py For generating prefix sums dataset for the DeepThinking project. <NAME> and <NAME> July 2021 """ import collections as col import torch def binary(x, bits): mask = 2**torch.arange(bits) return x.unsqueeze(-1).bitwise_and(mask).ne(0).long() def get_target(inputs): ...
StarcoderdataPython
11382681
<filename>test_models.py import os from peewee import * import shutil import unittest from models import db, Site, User from models import create_dummy_user, create_dummy_site import utilities #################################################### # Utilities #################################################### d...
StarcoderdataPython
68901
<filename>Utils/Data/Features/Generated/EngagerFeature/EngagerKnowTweetLanguage.py from Utils.Data.DatasetUtils import is_test_or_val_set, get_train_set_id_from_test_or_val_set from Utils.Data.Features.Generated.TweetFeature.IsEngagementType import * from Utils.Data.Features.MappedFeatures import * class EngagerFeatu...
StarcoderdataPython
8073954
class Arvore: def __init__(self, valor): self.valor = valor; self.esquerda = None; self.direita = None; def __str__(self): return "{",str(valor),"}" ############# Metodos de Busca ############# def pesquisar(no, valor): if no == None: return 0 else: if valor == no....
StarcoderdataPython
19306
<reponame>mcdale/django-material<filename>project/migrations/0002_auto_20180801_1907.py # Generated by Django 2.0.8 on 2018-08-01 19:07 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('project', '0001_initial'), ] ...
StarcoderdataPython
11334497
<gh_stars>0 # Implement an algorithm to determine if a string has all unique characters. # What if you cannot use additional data structures? def is_unique(text): if text == "": return True map = dict({}) for c in text: if map.get(c) is None: map[c] = 1 else: ...
StarcoderdataPython
6513348
<reponame>fineans/Vython<filename>app/Main/SYS/AffectionOperators.py from rply.token import BaseBox import sys from Main.Errors import error, errors class AffectionOperator(BaseBox): def __init__(self, var, right): self.right = right self.var = var self.kind = var.kind class SumAffector(...
StarcoderdataPython
3283223
<reponame>StealthHydra179/sack<gh_stars>0 import enum import sys class Lexer: def __init__(self, input): self.source = input + '\n' # Source code to lex as a string. Append a newline to simplify lexing/parsing the last token/statement. self.curChar = '' # Current character in the string. ...
StarcoderdataPython
3309524
from django.urls import path,include from rest_framework.routers import DefaultRouter from assignmentsApi.views import PendingAssignmentsView from assignmentsApi.views import CompletedAssignmentsView from assignmentsApi.views import SubmissionsView router=DefaultRouter() router.register('pending',PendingAssignmentsVi...
StarcoderdataPython
6575172
#!/usr/bin/env python from __future__ import print_function import argparse, json, os, sys, yaml parser = argparse.ArgumentParser(description='Keeps project files in sync by converting project.yaml to project.mml.') parser.add_argument('--check', dest='check', help='write generated JSON to stdout instead to project.m...
StarcoderdataPython
3532871
import os import oriskami import warnings from oriskami.test.helper import (OriskamiTestCase) class OriskamiAPIResourcesTests(OriskamiTestCase): def test_event_review_retrieve(self): response = oriskami.EventReview.retrieve("1") reviews = response.data self.assertEqual(str(reviews[0].revie...
StarcoderdataPython
9734023
<gh_stars>1-10 from django.db import models from django.contrib.auth.models import AbstractUser # Create your models here. class Users(AbstractUser): premium_account = models.BooleanField(default=False,verbose_name="premium account") deleted = models.BooleanField(default=False,verbose_name="deleted") ver...
StarcoderdataPython
3433889
''' Enhanced File History - Provides more consistent behavior than wxFileHistory ''' class FileHistoryTracker(): def __init__(self): self._history = [] def addFileToHistory(self, fileName:str): self._history.append(fileName) def removeFileFromHistory(self, index:int): ...
StarcoderdataPython
1788622
<gh_stars>1-10 #!/usr/bin/env python3 with open("weatherAUS-sorted.csv", 'r') as f, open("weatherAUS.csv", 'w') as out: header = f.readline() out.write(header) dicts = [{} for i in range(len(header.split(',')))] for line in f: row = line.split(',') for i in range(len(row)): ...
StarcoderdataPython
81642
from traceback import print_exc from aiogram import types from aiogram.dispatcher import FSMContext from loader import dp, bot from states import Request from keyboards import create_kb_coustom_main_menu from utils import get_data_to_show # from create_request.py @dp.callback_query_handler(state=Request.operation_ty...
StarcoderdataPython
12813189
from __future__ import annotations from typing import Tuple, NoReturn from ...base import BaseEstimator import numpy as np from ...metrics import weighted_misclassification_error from itertools import product EPSILON = 1.0 class DecisionStump(BaseEstimator): """ A decision stump classifier for {-1,1} labels ...
StarcoderdataPython
6474206
#!/usr/bin/env python3 # -*- coding: utf-8 -*- '''Data visualisation this script reads data samples from PicoScope and displays data as effective voltage, history display and xy plot Usage: ./runPhyPiDAQ.py [<PhyPiConf_file>.daq] [Interval] ''' from __future__ import print_function, division, unicode...
StarcoderdataPython
296431
<filename>Task/Test-a-function/Python/test-a-function.py def is_palindrome(s): ''' >>> is_palindrome('') True >>> is_palindrome('a') True >>> is_palindrome('aa') True >>> is_palindrome('baa') False >>> is_palindrome('baab') True ...
StarcoderdataPython
11201465
# these tests can be run from the command line via # python manage.py test tests/views --pattern="*.py" --settings="tests.test_settings"
StarcoderdataPython
3202197
<filename>willie/modules/minecraft_logins.py<gh_stars>0 # coding=utf8 """minecraft_logins.py - Willie module to watch for users to go online/offline on a minecraft server Currently gets its data from minecraft dynmap, a bukkit plugin, but bukkit's future is uncertain, so it won't be a good source of info for very long...
StarcoderdataPython
3255517
<filename>imagetrac_docker/taskmanager/forms.py from django import forms from django.forms import ModelForm, DateInput from .models import InboxEntry from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit class PrdInboxForm(ModelForm): class Meta: model = InboxEntry fiel...
StarcoderdataPython
1793961
<reponame>velocist/TS4CheatsInfo # uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\statistics\continuous_statistic_tracker.py # Compiled at: 2020-01-1...
StarcoderdataPython
5197820
import api.bm as models import logging import time from django.conf import settings from django.db import transaction from .exceptions import IndeedException from .fetch.indeed import Indeed from .fetch.upwork import Upwork class ProcessIndeed: def __init__(self): self.site = models.Site.objects.get(code...
StarcoderdataPython
3390525
<gh_stars>1-10 from enum import Enum class EVENT_TYPE(Enum): LIVE_READING = "live_reading" class MODULE_TYPE(Enum): RPI = "rpi" DHT22 = "dht22" DS18B20 = "ds18b20" BME680 = "bme680" RELAY = "relay" class METRIC_TYPE(Enum): TEMPERATURE = "temperature" HUMIDITY = "humidity" PRESS...
StarcoderdataPython
11210927
from pytest import mark, raises from py61850.types.times import Quality, Timestamp class TestQuality: test_data = { id: ['min', 'max', 'generic'], 'attr': [(False, False, False, 0), (True, True, True, 24), (False, False, True, 7)], bytes: [b'\x00', b'\xF8', b'\x27'], } test_erro...
StarcoderdataPython
6538186
<reponame>fossabot/passbook<gh_stars>0 """passbook oauth_client admin""" from passbook.lib.admin import admin_autoregister admin_autoregister("passbook_sources_oauth")
StarcoderdataPython
6519550
<reponame>TorchSpatiotemporal/tsl import os import numpy as np import pandas as pd from tsl import logger from tsl.ops.similarities import gaussian_kernel from tsl.utils import download_url, extract_zip from .prototypes import PandasDataset class PemsBay(PandasDataset): """A benchmark dataset for traffic foreca...
StarcoderdataPython
3531
"""Classes to represent Packet Filter's queueing schedulers and statistics.""" import pf._struct from pf._base import PFObject from pf.constants import * from pf._utils import rate2str __all__ = ["ServiceCurve", "FlowQueue", "PFQueue", "PFQueueStats"] class ServiceCurve(PFObject): ...
StarcoderdataPython
5124533
Release 3.5.2 (in development) ============================== Dependencies ------------ Incompatible changes -------------------- Deprecated ---------- Features added -------------- Bugs fixed ---------- Testing -------- Release 3.5.1 (released Feb 16, 2021) ===================================== Bugs fixed ----...
StarcoderdataPython
3347060
#!/usr/bin/python """ Filter the results of munki's MANAGED_INSTALL_REPORT.plist to these items: 'EndTime', 'StartTime', 'ManifestName', 'ManagedInstallVersion' 'Errors', 'Warnings', 'RunType' """ import plistlib import sys import os import CoreFoundation DEBUG = False # Path to the default munki install dir default...
StarcoderdataPython
8165150
<reponame>rayanht/UK-Biobank-Visualisation import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, MATCH, Output from src.dash_app import app from src.graph_data import get_inst_names_options from .variable_selection import get_dropdown_id as get_var_dropdown_id de...
StarcoderdataPython
9733778
import bisect import fnmatch import os from os.path import isdir, isfile, join, basename, splitext from django.conf import settings # Use the built-in version of scandir/walk if possible, otherwise # use the scandir module version try: from os import scandir, walk except ImportError: from scandir import scandi...
StarcoderdataPython
3568866
import time from tqdm import tqdm from multiprocessing import Value class InsufficientComputingCapacityException(Exception): pass class MockModel(): def __init__(self, epochs=60, epoch_time_seconds=1, insufficient_computing=False): self.epochs = epochs self.epoch_time_seconds = epoch_time_se...
StarcoderdataPython
11244851
<gh_stars>1-10 import ast from html.parser import HTMLParser import re import textwrap from collagraph import Component SUFFIX = "cgx" DIRECTIVE_PREFIX = "v-" DIRECTIVE_BIND = f"{DIRECTIVE_PREFIX}bind" DIRECTIVE_IF = f"{DIRECTIVE_PREFIX}if" DIRECTIVE_ELSE_IF = f"{DIRECTIVE_PREFIX}else-if" DIRECTIVE_ELSE = f"{DIRECTI...
StarcoderdataPython
3445684
<filename>paradrop/daemon/paradrop/core/config/resource.py from paradrop.core.chute.chute_storage import ChuteStorage from paradrop.lib.misc import resopt def computeResourceAllocation(chutes): service_names = [] service_cpu_fractions = [] allocation = {} for chute in chutes: if not chute.isRu...
StarcoderdataPython
3560662
#!/usr/bin/env python3 # Preprocessing for a maven module before instrumenting and running # Import libLF import os import sys import re sys.path.append('{}/lib'.format(os.environ['REGEX_GENERALIZABILITY_PROJECT_ROOT'])) import libLF import argparse import subprocess import sys import json import traceback import xml...
StarcoderdataPython
1646614
<filename>energenie/Devices/__init__.py # -*- coding: utf-8 -*- from .. import OnAir # from .. import Registry import os import importlib import inspect import time from collections import defaultdict, Counter from energenie.Handlers import HandlerRegistry from uuid import uuid4 import logging class Device(): _ma...
StarcoderdataPython
3399918
<filename>Algorithms/To Lower Case/solution.py class Solution: def toLowerCase(self, s: str) -> str: return s.lower() # Time Complexity = O(1)
StarcoderdataPython
135076
<reponame>topknopp/timeframe import setuptools import timeframe with open("README.md", "r", encoding="utf-8") as f: long_description = f.read() PACKAGES = setuptools.find_packages(include=("timeframe",)) setuptools.setup( name=timeframe.__name__, version=timeframe.__version__, author=timeframe.__auth...
StarcoderdataPython
164278
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat May 29 18:13:24 2021 @author: tae-jun_yoon """ import numpy as np from scipy.signal import savgol_filter from scipy.optimize import newton from PyOECP import References def ListReferences(): AvailableReferences = dir(References) for EachRefer...
StarcoderdataPython
9660311
# Generated by the protocol buffer compiler. DO NOT EDIT! # sources: inference/dataplane.proto # plugin: python-betterproto from dataclasses import dataclass from typing import Dict, List, Optional import betterproto import grpclib from betterproto.grpc.grpclib_server import ServiceBase @dataclass(eq=False, repr=Fa...
StarcoderdataPython
1871115
import numpy as np from skimage.feature import blob_dog, blob_log, blob_doh from skimage.color import rgb2gray from sklearn.preprocessing import scale ## Blog on LST calculation done using R.[alot of the code below is inspired from this and also the github repo] #1.) https://www.gis-blog.com/calculation-of-land-surfac...
StarcoderdataPython
1875583
<reponame>iotile/iotile_cloud from django.urls import path from .views import * app_name = 'streamnote' urlpatterns = [ path('<slug:slug>/', StreamNoteListView.as_view(), name='list'), path('<slug:slug>/add/', StreamNoteCreateView.as_view(), name='add'), path('<int:pk>/attachment/upload/', StreamNoteS3Fi...
StarcoderdataPython
4992220
#!/usr/bin/python # -*- coding: utf-8 -*- """ Asssess the performance of the storage management for SEAREV smoothing based on P_grid statistics <NAME> — July 2013 """ from __future__ import division, print_function, unicode_literals import numpy as np import matplotlib.pyplot as plt from searev_data import load, sea...
StarcoderdataPython
11299936
from FMERepositoryUtility.FMEServerJob import FMEServerJob class FMERepositoryFind(FMEServerJob): def do_fmw_job(self, repo, fmw): pass # repo_name = repo["name"] # fmw_name = fmw["name"] # full_name = "%s\\%s" % (repo_name, fmw_name) # if self.job_config["fmw_filter"]["on...
StarcoderdataPython
1700185
import numpy n,m=map(int,input().split()) a=numpy.zeros((n,m),int) for i in range(n): a[i]=numpy.array(input().split()) print(numpy.max(numpy.min(a,axis=1)))
StarcoderdataPython
3569361
<reponame>danielkitachewsky/reviewder<gh_stars>0 #! /usr/bin/python from collections import defaultdict import os import re TOKEN_RE = re.compile("{%([a-zA-Z_][a-zA-Z0-9_]*)(\.[a-zA-Z0-9_\.]+)?%}") class RenderingError(Exception): """Generic error raised during rendering of templates.""" class Token(object): ...
StarcoderdataPython
3268534
<reponame>singhb2020/QDB # QDB # <NAME> # ------------------ Importing Libraries ------------------ # import imp import kivy from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.image import Image from kivy.uix.button import Button from kivy.uix.label import Label from kivy.uix.widget import...
StarcoderdataPython
3297070
<gh_stars>1-10 from kivy.uix.label import Label from kivy.clock import Clock from kivy.lang import Builder from kivy.core.window import Window from kivy.properties import NumericProperty TOAST_KV=''' <_Toast@Label>: size_hint: (None, None) halign: 'center' valign: 'middle' color: (1.0, 1.0, 1.0, self._...
StarcoderdataPython
9732655
# ****************************************************************************** # Copyright 2017-2018 Intel 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.apa...
StarcoderdataPython
3383460
<filename>Realtime.py from time import time from Reminders import create_request,do_send_botmessage,get_users from Messenger import cleanspaces import configparser import requests from Apirate import thresh,Lograte import re import urllib.request import json import asyncio import websockets config = configparser.Con...
StarcoderdataPython
1664136
<reponame>fricciardi/datetime2 import setuptools from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'DESCRIPTION.rst')) as f: long_description = f.read() # TODO: All setup arguments need to be revised, also check for those t...
StarcoderdataPython
5117173
import torch import torch.nn as nn import torch.nn.functional as F class CompTransTTSLoss(nn.Module): """ CompTransTTS Loss """ def __init__(self, preprocess_config, model_config, train_config): super(CompTransTTSLoss, self).__init__() self.pitch_feature_level = preprocess_config["p...
StarcoderdataPython
3303399
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. import numpy import numba import time from MiniFramework.ConvWeightsBias import * from MiniFramework.ConvLayer import * def conv_4d(x, weights, bias, out_h, out_w, stri...
StarcoderdataPython