id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
3209185
<reponame>sevagh/slicqt #! /usr/bin/env python # -*- coding: utf-8 """ Python implementation of Non-Stationary Gabor Transform (NSGT) derived from MATLAB code by NUHAG, University of Vienna, Austria <NAME>, 2011-2016 http://grrrr.org/nsgt """ import numpy as np import torch from tqdm import tqdm import os from warn...
StarcoderdataPython
1759552
<reponame>chrisdavidmills/zamboni from datetime import datetime, timedelta import commonware.log import cronjobs import amo from amo.utils import chunked from devhub.models import ActivityLog log = commonware.log.getLogger('z.cron') @cronjobs.register def mkt_gc(**kw): """Site-wide garbage collections.""" ...
StarcoderdataPython
1726595
from twilio.rest import Client account_sid= "ACa8989bc5de6411f4d157b4466980911a" auth_token = "<PASSWORD>" client = Client(account_sid, auth_token) client.messages.create( to="915-503-4543", from_="+19162521643", body="Frankly, my dear, I don't give a damm." )
StarcoderdataPython
1771926
"""Defines the class represents the scheduler configuration""" from __future__ import unicode_literals from queue.models import DEFAULT_QUEUE_ORDER DEFAULT_NUM_MESSAGE_HANDLERS = 0 DEFAULT_LOGGING_LEVEL = 'INFO' class SchedulerConfiguration(object): """This class represents the scheduler configuration""" d...
StarcoderdataPython
4834704
# # Blink.py -- Blink plugin for Ginga reference viewer # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # from ginga import GingaPlugin from ginga.gw import Widgets class Blink(GingaPlugin.LocalPlugin): def __init__(self, fv, fitsimage): # supe...
StarcoderdataPython
1725380
import os import randomcolor rand_color = randomcolor.RandomColor() hues = ['monochrome'] kiki_num = 0 for i in range(1,9): for hue in hues: os.system("convert all/kikiset-0{}.png -fuzz 50% -fill '{}' -opaque red processed/kiki_{}.png".format(i,'#b7b7b7',kiki_num)) kiki_num += 1
StarcoderdataPython
1734698
<reponame>Pritam055/python-ProblemSolving class TestDataEmptyArray(object): @staticmethod def get_array(): # complete this function return list() class TestDataUniqueValues(object): @staticmethod def get_array(): # complete this function return [5, 2, 8, 3, 1, -6,...
StarcoderdataPython
3370728
<filename>open_publishing/context/bisac_subjects.py from open_publishing.core.enums import BisacCode, VLBCategory from open_publishing.bisac import BisacSubject class BisacSubjects(object): def __init__(self, context): self._ctx = context def load(self, bisac_code=None, ...
StarcoderdataPython
4828529
# -*- coding: utf-8 -*- """ Created on Tue Mar 8 22:22:26 2016 configuration for the echo server. @author: eikes """ address = ('localhost', 12345)
StarcoderdataPython
81480
import json import numbers import fhirpathpy.engine.util as util from fhirpathpy.engine.evaluators import evaluators from fhirpathpy.engine.invocations import invocations def check_integer_param(val): data = util.get_data(val) if int(data) != data: raise Exception("Expected integer, got: " + json.dump...
StarcoderdataPython
21773
<reponame>cauabernardino/cabinet import pathlib import shutil from typing import Dict, List, Union from cabinet.consts import SUPPORTED_FILETYPES def dir_parser(path_to_dir: str) -> Dict[str, Dict[str, str]]: """ Parses the given directory, and returns the path, stem and suffix for files. """ files =...
StarcoderdataPython
3211293
# Original algorithm was published by <NAME> and colleagues as EmptyDrops (Lun, A. et al. Distinguishing cells from empty droplets in droplet-based single-cell RNA sequencing data.) # This implementation is based on the code in cellranger v3.0 by 10x Genomics # Copyright 2018 10X Genomics, Inc. # # Permission is here...
StarcoderdataPython
137642
# -*- coding: utf-8 -*- # # Copyright 2015-2021 BigML # # 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 ...
StarcoderdataPython
1647113
<gh_stars>1-10 import math import torch def get_adam_delta(grads, optimizer): deltas = {} for group in optimizer.param_groups: for n, p in zip(group['names'], group['params']): grad = grads[n] state = optimizer.state[p] exp_avg, exp_avg_sq = state['exp_avg'], state[...
StarcoderdataPython
1666916
<reponame>kissmikijr/hammurabi """ Files preconditions module contains simple preconditions used for checking file existence. """ from pathlib import Path from hammurabi.preconditions.base import Precondition class IsFileExist(Precondition): """ Check if the given file exists. Example usage: .. co...
StarcoderdataPython
3331388
from pathlib import Path from django.db.models.signals import post_save from django.dispatch import receiver from main.models import ContextPhoto, BagPhoto from main.tasks import cp_thumbnail, bp_thumbnail def tn_is_same(cp): """ Filename for thumbnails should be "tn_" followed by the filename for the f...
StarcoderdataPython
1669438
from checks.worker import WorkerCheck from polyaxon.config_settings import SchedulerCeleryTasks class SchedulerCheck(WorkerCheck): WORKER_HEALTH_TASK = SchedulerCeleryTasks.SCHEDULER_HEALTH WORKER_NAME = 'SCHEDULER'
StarcoderdataPython
3264100
<reponame>manuelsousa7/ia-labs<gh_stars>0 class p_anel_ex_6: def __init__(self, n): self.n = n def num(self): return self.n p51 = p_anel_ex_6(0) p52 = p_anel_ex_6(5) p53 = p_anel_ex_6(50) def agente_anel_ex_6(p): n = p.num() if(n == 0): print "esperar" else: prin...
StarcoderdataPython
30697
import dash from dash import Output, Input, dcc from dash import html from tabs import tab1, tab2 # from tab2_callbacks import tab2_out, upload_prediction, render_graph2 import flask server = flask.Flask(__name__) # define flask app.server external_stylesheets = [ { "href": "https://fonts.googleapis.com...
StarcoderdataPython
3381177
# -*- coding: iso-8859-15 -*- import spanishconjugator from spanishconjugator.SpanishConjugator import Conjugator # ------------------------------ Simple Conditional Conditional Tense ------------------------------- # def test_simple_conditional_conditional_yo_ar(): expected = "hablaría" assert Conjugator().c...
StarcoderdataPython
1670347
<filename>data_preparation/data_preparation.py import numpy as np '''This is the ordering assumed in the feature channel''' AX_INDEXES = {'t': 0, 'x': 1, 'y': 2, 'z': 3} def prepare_image_data(fpath): orig_data = np.load(fpath).tolist() images = list() true_z = list() for val in orig_data.iterva...
StarcoderdataPython
1617093
import abc class BaseMod(abc.ABC): def __init__(self): pass @abc.abstractmethod def get_mod_name(self): raise NotImplementedError @abc.abstractmethod def dump_parameters(self) -> str: raise NotImplementedError @abc.abstractmethod def load_parameters(self, ...
StarcoderdataPython
4823860
# -*- encoding: utf-8 -*- ''' Current module: pyrunner.ext.idleshell.diyrun Rough version history: v1.0 Original version to use ******************************************************************** @AUTHOR: Administrator-<NAME>(罗科峰) MAIL: <EMAIL> RCS: rock4.common.dev.idleshell.diyrun...
StarcoderdataPython
92877
<filename>bnpy/allocmodel/topics/HDPTopicUtil.py import numpy as np import OptimizerRhoOmega from bnpy.util import NumericUtil from bnpy.util import digamma, gammaln from bnpy.util.StickBreakUtil import rho2beta from bnpy.util.NumericUtil import calcRlogRdotv_allpairs from bnpy.util.NumericUtil import calcRlogRdotv_sp...
StarcoderdataPython
63517
<reponame>MiracleWong/MoocStudy<filename>python_data_analysis/pandas/demo1.py #!/usr/bin/python #-*- coding:utf8 -*- import pandas as pd b = pd.Series([9,8,7,6],index=['a','b','c','d']) s = pd.Series(25,index=['a','b','c']) d = pd.Series({'a':9, 'b':8, 'c':7}) e = pd.Series({'a':9, 'b':8, 'c':7}, index=['c', 'a', 'b'...
StarcoderdataPython
70922
<reponame>DanSchum/NMTGMinor<gh_stars>1-10 from onmt.modules.GlobalAttention import GlobalAttention from onmt.modules.ImageEncoder import ImageEncoder from onmt.modules.BaseModel import Generator, NMTModel from onmt.modules.StaticDropout import StaticDropout # For flake8 compatibility. __all__ = [GlobalAttention, Imag...
StarcoderdataPython
3274186
""" netvisor.services.sales_payment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2013-2016 by <NAME> | 2019- by <NAME> :license: MIT, see LICENSE for more details. """ from .base import Service from ..requests.sales_payment import SalesPaymentListRequest class SalesPaymentService(Service): def...
StarcoderdataPython
1744720
# Generated by Django 4.0.1 on 2022-01-24 15:20 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('model_location', '0001_initial'), ] operations = [ migrations.CreateModel( ...
StarcoderdataPython
3387066
<reponame>toumorokoshi/surgen<filename>surgen/target/local_target.py from .base import TargetBase class LocalTarget(TargetBase): @property def workspace(self): return self._target
StarcoderdataPython
1783568
<reponame>mattbriggs/edge-modules<filename>scripts/val_ki_dockeraction.py ''' This script will parse and validate the current known issues includes from Azure Stack Hub (6/6/2021). The function runs validates the includes in the repository. 1. Configure the script by updating the global variables. MO...
StarcoderdataPython
1664094
<reponame>Zeing/CaptchaReader<filename>src/Control/CourseSelection.py # -*- coding: UTF-8 -*- ''' Created on Jul 13, 2014 Modified on Aug 28, 2014 @author: <NAME> E-mail: <EMAIL> ''' import urllib import urllib2 import cookielib import datetime from sklearn.externals import joblib import config from Identify import...
StarcoderdataPython
1769608
<reponame>Holstrup/ObjectRecognition<gh_stars>1-10 import math, os from keras.layers import Dense, UpSampling1D from keras.models import Model from keras.optimizers import Adam from keras.preprocessing.image import ImageDataGenerator from keras.applications.resnet50 import ResNet50 DATA_DIR = 'Dataset' TRAIN_DIR = os....
StarcoderdataPython
3246761
from bundestag import abgeordnetenwatch as aw from bundestag import vote_prediction as vp import unittest import pandas as pd from pathlib import Path from fastai.tabular.all import * class TestPredictions(unittest.TestCase): @classmethod def setUpClass(self): path = Path("./abgeordnetenwatch_data") ...
StarcoderdataPython
4815728
<filename>woof_nf/log.py import datetime import pathlib import re from typing import Dict, List, Optional, Tuple, Union # Formatting BOLD = '\u001b[1m' DIM = '\u001b[2m' ITALIC = '\u001b[4m' UNDERLINE = '\u001b[4m' # Colours BLACK = '\u001b[90m' RED = '\u001b[91m' GREEN = '\u...
StarcoderdataPython
116161
""" CSCI-603: Trees (week 10) Author: <NAME> @ RIT CS This is an implementation of a binary tree node. """ class BTNode: """ A binary tree node contains: :slot val: A user defined value :slot left: A left child (BTNode or None) :slot right: A right child (BTNode or None) """ __slots__ ...
StarcoderdataPython
3353045
import pygame import scenes from utils import Colors from ..scene_fade import SceneFade from pygame.locals import BLEND_MULT from .screen_pause import ScreenPause from .screen_options import ScreenOptions from scripts import Keyboard, SoundManager class Pause(SceneFade): def __init__(self, undo=False): su...
StarcoderdataPython
3372249
<gh_stars>1000+ """ Test aptly version """ from lib import BaseTest class VersionTest(BaseTest): """ version should match """ gold_processor = BaseTest.expand_environ runCmd = "aptly version"
StarcoderdataPython
1751715
<gh_stars>0 import sqlite3 from tkinter import * from tkinter import ttk from PIL import ImageTk,Image from tkinter import messagebox import sqlite3 def bookRegister(): bid = bookInfo1.get() title = bookInfo2.get() author = bookInfo3.get() status =selected.get() if bid =="" o...
StarcoderdataPython
3370003
from django.contrib import admin from .models import User from .models import Sender from .models import Message admin.site.register(User) admin.site.register(Sender) admin.site.register(Message)
StarcoderdataPython
4809580
<filename>dl-on-flink-pytorch/python/dl_on_flink_pytorch/flink_ml/pytorch_train_entry.py # Copyright 2022 Deep Learning on Flink 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 # ...
StarcoderdataPython
1724679
<reponame>conradludgate/multiplex from dataclasses import dataclass from typing import List from multiplex.refs import SPLIT class Action: pass class BoxAction: def run(self, box_holder): raise NotImplementedError @dataclass class SetTitle(BoxAction): title: str def run(self, box_holder)...
StarcoderdataPython
4840367
<filename>execution_file.py<gh_stars>0 ''' Execution file for the entire program. Allows users to download new artists or test the trained model on it's knowledge of the artist's lyrics ''' import pickle import spacy import pandas as pd import numpy as np from sklearn.linear_model import LogisticRegression from token_...
StarcoderdataPython
3357778
from rest_framework import serializers from django.conf import settings from .models import User class UserSerializer(serializers.ModelSerializer): registered_at = serializers.DateTimeField(format='%H:%M %d.%m.%Y', read_only=True) avatar = serializers.SerializerMethodField(read_only=True) full_name = se...
StarcoderdataPython
3358659
<reponame>garred/only_fighters """<title>an example of layout usage</title>""" import pygame from pygame.locals import * # the following line is not needed if pgu is installed import sys; sys.path.insert(0, "..") from pgu import layout pygame.font.init() screen = pygame.display.set_mode((320,320),SWSURFACE) bg = (2...
StarcoderdataPython
180472
<reponame>AndryGamingYT/TwitchChannelAnalyzer<gh_stars>0 from datetime import datetime class Channel: __broadcaster_language: str __broadcaster_login: str __display_name: str __game_id: str __game_name: str __id: str __is_live: bool __tags_ids: list[str] __thumbnail_url: str __...
StarcoderdataPython
1781155
import matplotlib.pyplot as plt from reliability.Other_functions import make_right_censored_data from reliability.Nonparametric import KaplanMeier, NelsonAalen, RankAdjustment from reliability.Distributions import Weibull_Distribution dist = Weibull_Distribution(alpha=500, beta=2) plt.figure(figsize=(12, 7)) samples ...
StarcoderdataPython
1687772
import pytest from minus80.Config import cf,Level def test_get_attr(): cf.test = 'a' assert cf.test == 'a' def test_get_item(): level = cf['options'] def test_set_level_attr(): cf.test = Level() cf.test.passed = True assert cf.test.passed def test_get_cloud_creds(): assert cf.gcp.bucket d...
StarcoderdataPython
76540
<gh_stars>1-10 from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from bs4 import BeautifulSoup import time import requests d...
StarcoderdataPython
3316533
from mitmproxy import http from response_recorder import HttpRequest, ResponseRecorder def request(flow: http.HTTPFlow) -> None: """Read the response from the saved file""" try: stub_response = ResponseRecorder.load_response( HttpRequest(method=flow.request.method, url=flow.request.url) ...
StarcoderdataPython
146925
<reponame>bmcculley/mailhide import requests import yaml def load_config(filname="config.yaml"): stream = open(filname, 'r') return yaml.load(stream, Loader=yaml.FullLoader) def verify(private_key, response, client_ip): recaptcha_url = "https://www.recaptcha.net/recaptcha/api/siteverify" payload = {"secret":priva...
StarcoderdataPython
160857
<gh_stars>10-100 # Copyright 2021 Huawei Technologies Co., Ltd # # 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
1676897
<gh_stars>1-10 import logging from cachetools import LRUCache, TTLCache, cached from gw2api import GuildWars2Client from typing import List, Optional from .account import Account from .character import Character from .guild import AnonymousGuild, Guild from .world import World # Available api endpoints: # accoun...
StarcoderdataPython
4810690
# Asignamos de diferentes maneras los strings # Una línea name = '<NAME>' welcome = "Bienvenidos/as" type_name = type(name) type_welcome = type(welcome) # Multilinea multi_line_without_blank_space = '''3737373783 eueueueueueue''' multi_line_with_blank_space = ''' 3737373783 eueueueueueue ''' print("Final")
StarcoderdataPython
1749534
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
StarcoderdataPython
4817556
""" Module: 'requests' on esp32_LoBo MCU: (sysname='esp32_LoBo', nodename='esp32_LoBo', release='3.2.24', version='ESP32_LoBo_v3.2.24 on 2018-09-06', machine='ESP32 board with ESP32') Stubber: 1.0.0 """ def certificate(): pass def debug(): pass def get(): pass def head(): pass def patch(): pass ...
StarcoderdataPython
1654643
""" 使用簡單的前饋神經網路feed-forward neural network來訓練並預測mnist資料集,用我自行產生的csv檔來當做資料來源. see tensorflow-1.6.0/tensorflow/examples/tutorials/mnist/fully_connected_feed.py """ import tensorflow as tf from mnist import mnist_dataset as md from mnist import mnist_core as mnist #from tensorflow.examples.tutorials.mnist import mnist fro...
StarcoderdataPython
153506
<reponame>MikeChurvis/mikechurvis.github.io<filename>api-v2/ContactForm/migrations/0008_alter_contactformentry_message.py # Generated by Django 4.0.4 on 2022-05-25 22:06 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Conta...
StarcoderdataPython
3327379
<gh_stars>1-10 import numpy as np import math """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" The Tweaker class handles various tweaks used when testing and developing. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" class Tweaker: def __init__(self): # Number ...
StarcoderdataPython
3355209
<filename>podrum/config.py ################################################################################ # # # ____ _ # # | _ \ ___ __| |_ __ _ _ _ __ ___ ...
StarcoderdataPython
3249610
# Faça um programa que tenha uma função chamada área(), que receba as dimensões de um terreno retangular # (largura e comprimento) e mostre a área do terreno. def area(largura, comprimento): areaTerreno = largura * comprimento print(f'A área de um terrono {largura}x{comprimento} é de {areaTerreno:.1f}m².') ...
StarcoderdataPython
1704128
<gh_stars>0 age = input("Enter your age ") age = int(age) if age >= 15: print("you can play the game because you are above the 15") else: print("you can't play the game because you are above the 15")
StarcoderdataPython
197947
<reponame>hubo1016/vlcp from vlcp.server.module import Module, publicapi from vlcp.event.runnable import RoutineContainer from vlcp.utils.networkmodel import PhysicalNetworkMap, PhysicalNetwork,\ VXLANEndpointSet from vlcp.config.config import defaultconfig from vlcp.utils.networkplugin import createphysicalnetwork...
StarcoderdataPython
1736649
<reponame>ChenfuShi/HiChIP_peaks<gh_stars>1-10 ######################################### # Author: <NAME> # Email: <EMAIL> ######################################### # to install without copying files # pip install -e . # to create distribution packages python setup.py sdist bdist_wheel # python3 -m twine upload --r...
StarcoderdataPython
1639700
import os import atexit import signal import numpy as np import tensorflow as tf from subprocess import Popen, PIPE from glearn.utils.log import log, log_warning from glearn.utils.path import remove_empty_dirs from glearn.utils import tf_utils SUMMARY_KEY_PREFIX = "_summary_" DEFAULT_EVALUATE_QUERY = "evaluate" DEFAU...
StarcoderdataPython
3267092
import dataclasses import enum import typing from vkmodels.bases.object import ObjectBase @dataclasses.dataclass class State( ObjectBase, ): description: typing.Optional[str] = None state: typing.Optional[int] = None
StarcoderdataPython
1728636
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # # Oliver ######## . # # # . # # # Bonham ######## . # # # . # # # Carter ######## . # # # . # # ################# . # # ############ # ################# . # # # . # # ################# . # # # . # # ################# . # # # . # # # # # # import s...
StarcoderdataPython
3315063
import io import urllib import torch from PIL import Image import matplotlib.pyplot as plt import torchvision.transforms as transforms def load_image_buffer_to_tensor(image_buf, device): """Maps image bytes buffer to tensor Args: image_buf (bytes buffer): The image bytes buffer device (object...
StarcoderdataPython
121878
from datetime import datetime from flask import Blueprint, render_template, redirect, url_for, flash, abort from flask_login import login_required, current_user from app.models import EditableHTML, SiteSetting from .forms import SiteSettingForm, PostForm, CategoryForm, EditCategoryForm, StatusForm import commonmark fro...
StarcoderdataPython
1780314
<gh_stars>0 from subprocess import Popen, DEVNULL, TimeoutExpired import logging import argparse import json import os from os.path import join, exists import shutil import pathlib import tempfile root_dir = os.getcwd() workdir = join(root_dir, ".prep_dev_patch") logger = logging.getLogger("prep_dev_patch") prog_conf...
StarcoderdataPython
3323354
# -*- coding: utf-8 -*- # Morra project: Features for MorphParserNE # # Copyright (C) 2020-present by <NAME> # License: BSD, see LICENSE for details """ If you need MorphParserNE to support your language, add feature-functions for your language here. Then, create parser as: ``MorphParserNE(features='<your lang>')`...
StarcoderdataPython
3265169
<gh_stars>1-10 from Event import PictureEvent, LightEvent, FeedEvent import datetime names = ['Feed','Light','Take picture'] events = [] enabled = True idcounter = 0 today = datetime.datetime.today().date() def createEvent(type): if type == 0: return FeedEvent() elif type == 1: return LightEvent() elif type ...
StarcoderdataPython
1766342
<filename>mapping.py import os import sys f = open("map_clsloc.txt") imagenet = {} for lines in f: splitted = lines.strip().split() imagenet[splitted[0]] = splitted[1] f.close() f = open("wnids.txt") final_indices = {} i = 1 for lines in f: final_indices[int(imagenet[lines.strip()])] = i i+=1 print(final_indices)
StarcoderdataPython
81050
<gh_stars>1-10 # @Time : 2020/11/4 # @Author : <NAME> # @email : <EMAIL> # UPDATE: # @Time : 2021/1/29 # @Author : <NAME> # @Email : <EMAIL> """ textbox.data.dataloader.single_sent_dataloader ################################################ """ import numpy as np import random import math import torch from te...
StarcoderdataPython
114740
<gh_stars>1-10 """Tally tests""" import os import warnings from unittest import TestCase import nose from nose.tools import ( assert_equal, assert_not_equal, assert_raises, raises, assert_almost_equal, assert_true, assert_false, assert_in, ) from pyne.utils import QAWarning warnings....
StarcoderdataPython
11209
from .trainer.models import MultiTaskTagger from .trainer.utils import load_dictionaries,Config from .trainer.tasks.multitask_tagging import MultiTaskTaggingModule from fairseq.data.data_utils import collate_tokens from attacut import tokenize class HoogBERTaEncoder(object): def __init__(self,layer=12,cuda=False...
StarcoderdataPython
3315331
#!/usr/bin/env python from __future__ import print_function import logging LOG_FORMAT = '%(asctime)s %(levelname)s %(pathname)s:%(lineno)s: %(message)s' logging.basicConfig(format=LOG_FORMAT, level=logging.DEBUG) import os import signal import sys import six import threading import time import pprint import psutil i...
StarcoderdataPython
1608001
#!/usr/bin/env python """ setup.py file for WarpX """ import sys import argparse from setuptools import setup argparser = argparse.ArgumentParser(add_help=False) argparser.add_argument('--with-libwarpx', type=str, default=None, help='Install libwarpx with the given value as DIM. This option is only used by the make...
StarcoderdataPython
1684680
#import statements from tkinter import* import time start_time = 0 end_time = 0 total_time = 0 def time_display(seconds): #get the floor value of minutes by dividing value of seconds by 60 minutes = seconds//60 #get the floor value of hours by dividing value of minutes by 60 hours = minutes//60 ...
StarcoderdataPython
3318507
<reponame>wearelumenai/distclus4py<gh_stars>1-10 from distclus import bind from .ffi import lib from .oc import OnlineClust class KMeans(OnlineClust): """Proxy a KMEANS algorithm implemented in native library""" def __init__( self, space='euclid', par=True, init='kmeans_pp', init_descr=None, ...
StarcoderdataPython
1634310
# Generated by Django 3.2.9 on 2021-12-03 16:24 from django.conf import settings import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone def create_levels(apps, schema_editor): Level = apps.get_m...
StarcoderdataPython
4821767
""" Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT Test Case Title : Verify that a rigid body with "Interpolate motion" option selected moves smoothly. """ # fmt: o...
StarcoderdataPython
1750098
<gh_stars>0 # Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Functional tests for ZFS filesystem implementation. These tests require the ability to create a new ZFS storage pool (using ``zpool``) and the ability to interact with that pool (using ``zfs``). Further coverage is provided in :module:`floc...
StarcoderdataPython
1676902
<gh_stars>0 # -*- coding: utf-8 -*- from flask import (Blueprint, current_app, redirect, render_template, request, url_for) from pony.orm import db_session from dashboard import db, service from dashboard.config import config from dashboard.exceptions import (BadDataFormat, PageOutOfRange, ...
StarcoderdataPython
1663351
# coding: utf-8 import os import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web from tornado.options import define, options from tornado.escape import json_decode, json_encode from tornado.concurrent import Future from object_detection.rfcn_detection import rfcn_model_instance from...
StarcoderdataPython
3322117
<gh_stars>1-10 from PIL import Image img1 = Image.open("koala.png") img2 = Image.open("koala2.png") for y in range(1): for x in range(img1.size[0]): pix1 = img1.getpixel((x, y)) pix2 = img2.getpixel((x, y)) if pix1 != pix2: print(pix1[0] - pix2[0], pix1[1] - pix2[1], pix1[2] - ...
StarcoderdataPython
1749797
import sys from B1B0_fuel import Fuel from B1B1_innergas import InnerGas from B1B2_clad import Clad #-------------------------------------------------------------------------------------------------- class FuelRod: #----------------------------------------------------------------------------------------...
StarcoderdataPython
1713242
<filename>tumorstoppy/test/blossom_time_test.py from time import time from tumorstoppy.distances import * t1=time() s1="CASSGATGREKFF" s2="CASSGTTFREKFF" weights=[1]*13 for ii in range(0,10000000): #TMP=sigmoid(np.dot(weights, np.fromiter(blosum62_score(s1,s2),int))) TMP=blosum62_distance([s1], [s2], weights...
StarcoderdataPython
3217125
# Copyright 2016 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
StarcoderdataPython
1634705
import pytest from river.adapters.progression_counter import InMemoryProgressionCounter from river.adapters.topics import InMemoryTopicsManager from river.topicleaner.service import clean pytestmark = pytest.mark.django_db def test_done_batch_is_cleaned(batch_factory, resource_factory): r1, r2 = resource_factor...
StarcoderdataPython
4826485
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
StarcoderdataPython
4826023
<filename>mnist-collection/siamese.py # Copyright (c) 2017 Sony Corporation. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENS...
StarcoderdataPython
90759
import unittest import congressperson from datasources import propublica class TestCongress(unittest.TestCase): def setUp(self): self.cp = congressperson.Congressperson("H001075") def test_get_name(self): self.assertEqual(self.cp.get_name(), "<NAME>") def test_get_recent_votes(self): ...
StarcoderdataPython
3330839
import sys from niveristand import nivs_rt_sequence from niveristand import realtimesequencetools from niveristand.clientapi import BooleanValue, ChannelReference, DoubleValue, I32Value from niveristand.clientapi import RealTimeSequence from niveristand.errors import TranslateError, VeristandError from niveristand.lib...
StarcoderdataPython
1621049
# File: simple_cipher.py # Purpose: Implement a simple shift cipher like Caesar and a more secure substitution cipher # Programmer: <NAME> # Course: Exercism # Date: Monday 26 September 2016, 02:00 AM import random from string import ascii_lowercase letters = ascii_lowercase class Cipher(): ...
StarcoderdataPython
1601415
#!/usr/bin/env python3 with open('20_input.txt', 'r') as f: data = f.read() def get_example(n): examples = { 0: "^WNE$", 1: "^ENWWW(NEEE|SSE(EE|N))$", 2: "^ENNWSWW(NEWS|)SSSEEN(WNSE|)EE(SWEN|)NNN$", 3: "^ESSWWN(E|NNENN(EESS(WNSE|)SSS|WWWSSSSE(SW|NNNE)))$", 4: "^WSSEES...
StarcoderdataPython
4822214
<reponame>ofrik/Seq2Seq from numpy.random import seed seed(1) from tensorflow import set_random_seed set_random_seed(2) import pandas as pd from nltk import word_tokenize from tqdm import tqdm from nltk import FreqDist import re import numpy as np tqdm.pandas() def read_data(): """ Read the english and he...
StarcoderdataPython
3200975
""" davies.math: basic mathematics routines for reduction of survey data This is "slow math", operating on scalar values without vector math (no `numpy` dependency). """ import math __all__ = 'hd', 'vd', 'cartesian_offset', 'angle_delta', \ 'm2ft', 'ft2m' # # Unit Conversions # def m2ft(m): """Conv...
StarcoderdataPython
169860
<gh_stars>0 from django.conf.urls import url, include from rest_framework.routers import DefaultRouter from instanotifier.api.notification import views as notification_views app_name = "api-v1" router = DefaultRouter() router.include_root_view = False router.register( r'rss-search', notification_views.Notif...
StarcoderdataPython
3274397
# -*- coding: utf-8 -*- """Application configuration.""" import os class Config(object): """Base configuration.""" SECRET_KEY = os.environ.get('MALL_SECRET', 'secret-key') # TODO: Change me APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory PROJECT_ROOT = os.path.abspath(os.path....
StarcoderdataPython
71162
def leiaInt(mgn): while True: try: n = int(input(mgn)) except (ValueError, TypeError): print('\033[031mErro: por favor, digite um número interio válido.\033[m') else: return n break def leiaFloat(mgn): while True: try: ...
StarcoderdataPython