id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
260793
<reponame>badouralix/adventofcode-2018 from tool.runners.python import SubmissionPy class BebertSubmission(SubmissionPy): def run(self, s: str): lines = [l.strip() for l in s.splitlines()] for i, line1 in enumerate(lines): for line2 in lines[i+1:]: diff = 0 ...
StarcoderdataPython
3383771
<gh_stars>0 import random import subprocess import os import sys import time import requests from requests.exceptions import HTTPError import wget import webbrowser import urllib.request def Terminal_End(): update() print("1. Type Start To Begin Proces") print("2. Auto Mode") print("3. Typescrippt Mode") print("4...
StarcoderdataPython
3494794
<reponame>WayneLiang/Python-lesson import os import numpy as np import matplotlib.pyplot as plt plt.rcParams['font.sans-serif']=['SimHei'] plt.rcParams['font.family']='sans-serif' plt.rcParams['axes.unicode_minus']=False data_path = './data/bikeshare/' data_filenames = ['2017-q1_trip_history_data.csv', '2017-q2_trip_h...
StarcoderdataPython
6455928
<reponame>EPC-MSU/uRPC import re from os import walk from os.path import join from typing import List, Generator __all__ = ["resources"] def resources(path: str) -> Generator[str, None, None]: for root, dirs, files in walk(path, followlinks=True): filtered_dirs = __filter_files(dirs) dirs.clear()...
StarcoderdataPython
3315615
# Node Class class Node: def __init__(self, data): self.data = data self.next = None # List Class class UnorderedList: def __init__(self): self.head = None # returns true if empty def isEmpty(self): return self.head == None # adds new element to the front of the li...
StarcoderdataPython
6515016
from ..context import get_new_context, _CONTEXT from ..graph import * from ..graph import _seq_to_text_format import pytest import scipy.sparse # keeping things short A = np.asarray C = constant I = input # testing whether operator overloads result in proper type @pytest.mark.parametrize('root_node, expected', [ ...
StarcoderdataPython
3281763
import os def pytest_addoption(parser): parser.addoption('--cpu', action='store_true') def pytest_configure(config): if not config.option.cpu: return os.environ['PATH'] = ':'.join(p for p in os.environ['PATH'].split(':') if 'cuda' not in p) os.environ['CUDA_VERSION'] = '' os.environ['CUD...
StarcoderdataPython
8088100
<filename>fraud_detection_recall-RandomForest.py # coding: utf-8 # In[87]: import pandas as pd from imblearn.over_sampling import SMOTE from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import confusion_matrix from sklearn.model_selection import train_test_split import matplotlib.pyplot as pl...
StarcoderdataPython
6509171
<reponame>radetsky/themis # # Copyright (c) 2017 Cossack Labs Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
StarcoderdataPython
9727923
import ai2thor.controller from ai2thor.server import Event from ai2thor.platform import CloudRendering, Linux64 import pytest import numpy as np import warnings import os import math def fake_linux64_exists(self): if self.platform.name() == "Linux64": return True else: return False @classmet...
StarcoderdataPython
102781
<filename>scripts/moclo_registry.py #!/usr/bin/env python3 # coding: utf-8 """Automatic Icon Genetics sequences annotation pipeline. """ import copy import io import itertools import json import re import os import warnings import sys import bs4 as bs import six import tqdm import requests from Bio.Seq import Seq, tr...
StarcoderdataPython
254513
<gh_stars>1-10 #!../../../.env/bin/python import os import numpy as np import time a = np.array([ [1,0,3], [0,2,1], [0.1,0,0], ]) print a row = 1 col = 2 print a[row][col] assert a[row][col] == 1 expected_max_rows = [0, 1, 0] expected_max_values = [1, 2, 3] print 'expected_max_rows:', expected_max_rows p...
StarcoderdataPython
3432966
import numpy as np import matplotlib.pyplot as plt acc = [93.75] prec = [94.11764706] recall = [92.30769231] spec = [100] MCC = [67.30769231] F1 = [93.2038835] fig, ax = plt.subplots() g = [acc,prec,recall,spec,MCC,F1] y = ["acc","prec","recall","spec","MCC","F1"] first = a...
StarcoderdataPython
180498
import os user_input = input('What is the name of your directory: ') user_input = user_input.replace(" ", "").lower() rootdir = str(user_input) searchstring = input('What word are you trying to find?: ') for subdir, dirs, files in os.walk(rootdir): for file in files: file_location = os.path.join(subdi...
StarcoderdataPython
3545576
<filename>st2common/st2common/config.py # Licensed to the StackStorm, Inc ('StackStorm') 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...
StarcoderdataPython
6549846
<gh_stars>0 """ Implementation of a range of Graph Recurrent Networks. Trying to follow the structure of rnn_cell.py in the mxnet code. """ import mxnet as mx import sockeye.constants as C from sockeye.config import Config import logging logger = logging.getLogger(__name__) #def get_gcn(input_dim: int, output_dim...
StarcoderdataPython
3237516
<reponame>mgthometz/advent-of-code-2021 import sys, collections from grid import gridsource as grid from util import findints Target = collections.namedtuple('Target', 'xmin xmax ymin ymax') def main(): f = open(sys.argv[1] if len(sys.argv) > 1 else 'in') target = Target(*findints(f.read())) result = 0...
StarcoderdataPython
3221696
class Solution(object): def climbStairs(self, n): """ :type n: int :rtype: int """ T = [1,1] for i in xrange(2,n+1): T.append(T[i-1] + T[i-2]) # faster, with 36ms, predefined with 40ms. return T[n] # T[i] is the sum of T[i-1] (plus 1 step to reach e...
StarcoderdataPython
3453839
import os import random import tempfile import uuid import librosa import numpy as np import sys from audiomentations.core.transforms_interface import BaseWaveformTransform from audiomentations.core.utils import ( convert_float_samples_to_int16, ) class Mp3Compression(BaseWaveformTransform): """Compress the...
StarcoderdataPython
1833398
import unittest import time import uuid import logging import emission.core.get_database as edb import emission.analysis.modelling.tour_model.featurization as featurization import emission.analysis.modelling.tour_model.cluster_pipeline as cp import emission.storage.timeseries.abstract_timeseries as esta import emissi...
StarcoderdataPython
6536513
<filename>Predictor_Tfidf/UI_dense_fully_connected.py<gh_stars>10-100 """Use an ANN to find the probability of occurrence of diseases""" import tflearn import numpy as np import tensorflow as tf from sklearn.externals import joblib import os import sys import time lib_path = os.path.abspath(os.path.join('../', 'lib')) ...
StarcoderdataPython
129245
# -*- coding: utf-8 -*- # Copyright (c) 2016-2020 by University of Kassel and Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. import numpy as np import pytest import pandapower as pp import pandapower.shortcircuit as sc @pytest.fixture def w...
StarcoderdataPython
3300230
<filename>pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGLContext/scenegraph/inline.py """VRML97 Inline node""" from vrml.vrml97 import basenodes, nodetypes from vrml import field, protofunctions, fieldtypes from OpenGLContext import context class InlineURLField( fieldtypes.MF...
StarcoderdataPython
4975998
# -*- coding: utf-8 -*- """Serves /swagger endpoint.""" import yaml from pyramid.view import view_config @view_config(route_name='swagger', request_method='GET', renderer='json') def apidocs(request): with open('api-docs/swagger.yaml', 'r') as f: swagger_content = f.read() return yaml.load(swagger_con...
StarcoderdataPython
9675678
from ctypes import c_ubyte, c_ushort from snoboy import memory # how many cycles we've executed ticks = 0 operations = {} def doInstruction(): opcode = memory.read(registers.PC) registers.PC += 1 if opcode in operations: print "Instruction: %s (%x)" % (operations[opcode].__name__, opcode) ...
StarcoderdataPython
9643109
<filename>migration/migration_manager.py #!/usr/bin/python # -*- coding: utf-8 -*- from entity import configuration as config_entity from entity import tag as tag_entity from migration import tags as tag_lists import os import shutil import sqlite3 import sys class MigrationManager: """ Checks current version an...
StarcoderdataPython
4897721
# Generated by Django 4.0.2 on 2022-03-03 12:08 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('instructors', '0008_remove_user_location'), ] operations = [ migrations.AlterField( model_name='location', name='ZIP...
StarcoderdataPython
8036478
from minitf import kernel as K from minitf.autodiff.vjp_maker import def_vjp_maker # Stolen from autograd library def unbroadcast(target, g): while K.rank(g) > K.rank(target): g = K.reduce_sum(g, axis=0) for axis, size in enumerate(K.shape(target)): if size == 1: g = K.reduce_sum(g...
StarcoderdataPython
8007586
import logging import json import math from types import BuiltinMethodType import ftx from execution.exchanges import BaseExchange # import http # http.client.HTTPConnection.debuglevel = 1 logger = logging.getLogger("execution") class FTXExchange(BaseExchange): BUY = LONG = "buy" SELL = SHORT = "sell" ...
StarcoderdataPython
375056
<reponame>hsiboy/seabus # -*- coding: utf-8 -*- from __future__ import absolute_import from folium.folium import Map, initialize_notebook, CircleMarker from folium.map import (FeatureGroup, FitBounds, Icon, LayerControl, Marker, Popup, TileLayer) from folium.features import (ClickForMarker, ...
StarcoderdataPython
5157096
#!/usr/bin/python2 """ 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"); yo...
StarcoderdataPython
329388
<reponame>rohankumardubey/datasette-hashed-urls from datasette.app import Datasette import pytest import sqlite_utils @pytest.fixture def db_files(tmpdir): mutable = str(tmpdir / "this-is-mutable.db") immutable = str(tmpdir / "this-is-immutable.db") rows = [{"id": 1}, {"id": 2}] sqlite_utils.Database(...
StarcoderdataPython
9658835
<gh_stars>1-10 import rest import vcf import json from operator import itemgetter import pprint import requests # Note that this is the current as of v77 with 2 included for backwards compatibility (VEP <= 75) csq_order = ["transcript_ablation", "splice_donor_variant", "splice_acceptor_variant", "stop_gained", "frame...
StarcoderdataPython
188298
<filename>snaps/models.py from django.db import models import datetime as dt # Create your models here. class Location(models.Model): location = models.CharField(max_length=50) def __str__(self): return self.location class Meta: ordering = ['location'] class Category(models.Model): c...
StarcoderdataPython
3356992
""" This is an adaptation of <NAME> implementation of the poisson learning algorithm licensed under the MIT licence. For the original source code see `https://github.com/jwcalder/GraphLearning/blob/master/graphlearning/ssl.py`. """ import sys import logging import numpy as np from scipy import sparse from scipy.spars...
StarcoderdataPython
284438
<reponame>tabulon-ext/dedupsqlfs # -*- coding: utf8 -*- """ Special action to collect all garbage and remove """ __author__ = 'sergey' from time import time from math import floor from dedupsqlfs.my_formats import format_timespan from dedupsqlfs.lib import constants from dedupsqlfs.fuse.subvolume import Subvolume ...
StarcoderdataPython
1623304
<reponame>ottomattas/INFOMAIGT-AGENTS #! /usr/bin/env -S python -u from game import Game from random_agent import RandomAgent from bandit_agent import BanditAgent from neural_network_agent import NNAgent import argparse, time, cProfile import numpy as np import multiprocessing as mp from collections import Co...
StarcoderdataPython
73644
# =============================================================================== # # # # This file has been generated automatically!! Do not change this manually! # # ...
StarcoderdataPython
3351443
#!/usr/bin/env python from numpy import * import sys,os,math,random #cell_vec = 0.05/2.0 #cell_ang = 0.25/2.0 atom_pos = 0.01/2.0 iFile = sys.stdin #iFile = "ideal.in" #try: iFile = open(iFile, 'r') #except: print "Problem opening ",iFile; sys.exit(1) random.seed() for i in range(7): line = iFile.readline() if ...
StarcoderdataPython
9771860
<reponame>Software-Engineering-Bachelor-Project/mycroft import pytz from django.conf import settings from django.test import TestCase from unittest.mock import patch # Import module from backend.video_manager import * class GetClipInfoTest(TestCase): @patch('backend.database_wrapper.create_hash_sum') def se...
StarcoderdataPython
25686
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- file1=open('data/u_Lvoid_20.txt',encoding='utf-8') file2=open('temp2/void.txt','w',encoding='utf-8') count=0 for line in file1: count=count+1 if(line[0]=='R'):# 'line' here is a string line_list=line.split( ) # 'line_list' is a list of sma...
StarcoderdataPython
9627995
<reponame>ZFhuang/DiveIntoDLSketches # coding=utf-8 # 导入自己的函数包d2lzh_pytorch,注意要先将目标包的父路径添加到系统路径中 import sys sys.path.append(r".") from d2lzh_pytorch import layers from d2lzh_pytorch import data_process from d2lzh_pytorch import train import torch import time from torch import nn,optim """ 这一节介绍了串联多个网络的"网络中的网络NiN" ""...
StarcoderdataPython
1909524
<reponame>VEINHORN/pgdocs import argparse import meta import os from command import enrich from profile import profile from command import backup from command import show from command import create def main(): parser = argparse.ArgumentParser(add_help=False) subparsers = parser.add_subparsers(help="commands...
StarcoderdataPython
178367
# Author: <NAME> # Date: 26/06/2018 # Project: TdaToolbox try: from filtration.imports import * except: from imports import * # Time delay embedded procedure # val refers to a 1D time-serie # step corresponds to the time-delay # dimension is the dimension of the time-delay embedding # point_size refers to the dim...
StarcoderdataPython
3486047
from flask import Blueprint, render_template, session,request,jsonify from flask_login import login_required, current_user from . import logger import json from .click import Click from os import environ CLICKHOUSE_NODES = json.loads(environ.get('CLICKHOUSE_NODES')) CLICKHOUSE_USER = environ.get('CLICKHOUSE_USER') C...
StarcoderdataPython
32906
<gh_stars>0 from typing import Literal, TypedDict class ForvoAPIItem(TypedDict): id: int word: str original: str addtime: str hits: int username: str sex: str country: str code: str langname: str pathmp3: str pathogg: str rate: int num_votes: int num_positiv...
StarcoderdataPython
9648756
from setuptools import setup, find_packages setup( name='karmabot', version='1.0.1', description='A Slack bot to track Karma points', author='<NAME>', author_email='<EMAIL>', url='https://github.com/target/karmabot', packages=find_packages(), include_package_data=True, install_requi...
StarcoderdataPython
1753
<filename>PID/PDControl.py #!/usr/bin/env python # -*- coding:utf-8 -*- import random import numpy as np import matplotlib.pyplot as plt class Robot(object): def __init__(self, length=20.0): """ Creates robotand initializes location/orientation to 0, 0, 0. """ self.x = 0.0 self.y ...
StarcoderdataPython
8056960
<reponame>PKUfudawei/cmssw import FWCore.ParameterSet.Config as cms from RecoTracker.TransientTrackingRecHit.tkTransientTrackingRecHitBuilderESProducer_cfi import tkTransientTrackingRecHitBuilderESProducer ttrhbwor = tkTransientTrackingRecHitBuilderESProducer.clone(StripCPE = 'Fake', ...
StarcoderdataPython
11369185
import torch import numpy as np import torch.nn as nn import torch.nn.functional as nf from .GCN import sum_aggregation class APPNP(nn.Module): ''' APPNP: ICLR 2019 Predict then Propagate: Graph Neural Networks Meet Personalized Pagerank https://arxiv.org/pdf/1810.05997.pdf ''' def __init__(se...
StarcoderdataPython
8022004
Anything = 42
StarcoderdataPython
9746398
<filename>Programmers/Lv.1/budget.py def solution(d, budget): answer = 0 for i in sorted(d): budget-=i if(budget<0): break else: answer+=1 return answer
StarcoderdataPython
1735253
# -*- coding: utf-8 -*- import numpy as np def check_images(fusioned, original): assert len(fusioned) == len(original), "Supplied images have different sizes " + \ str(fusioned.shape) + " and " + str(original.shape) if(len(fusioned.shape) == len(original.shape)): estado = 'mtom' if(len(fusi...
StarcoderdataPython
5130509
<filename>kea/utils/test_rising_edge_detector.py from ._rising_edge_detector import rising_edge_detector from kea.test_utils.base_test import ( KeaTestCase, KeaVivadoVHDLTestCase, KeaVivadoVerilogTestCase) import random from myhdl import * class TestRisingEdgeDetectorSimulation(KeaTestCase): def setUp(self...
StarcoderdataPython
3409229
from TwisterControlSurface import TwisterControlSurface def create_instance(c_instance): return TwisterControlSurface(c_instance)
StarcoderdataPython
358984
<reponame>huaweicloud/huaweicloud-sdk-python-v3 # coding: utf-8 import re import six from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class VirtualSpace: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute...
StarcoderdataPython
5130899
from typing import Callable, Any from amino import Either, List, Map, _ from amino.lazy import lazy from amino.func import dispatch from tubbs.formatter.breaker.cond import BreakCond, BreakCondOr, BreakCondAnd, BreakCondSet from tubbs.tatsu.breaker_dsl import (Parser, Expr, OrCond, AndCond, NotCond, Prio, Name, Cond,...
StarcoderdataPython
9437
<reponame>Dridi/blockdiag<filename>src/blockdiag/utils/rst/nodes.py # -*- coding: utf-8 -*- # Copyright 2011 <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.apa...
StarcoderdataPython
4982376
class 붕어빵틀: def __init__(self, 앙꼬): self.앙꼬 = 앙꼬 붕어빵1 = 붕어빵틀("초코맛") 붕어빵2 = 붕어빵틀("딸기맛") print(붕어빵1.앙꼬) print(붕어빵2.앙꼬)
StarcoderdataPython
390413
<filename>notebooks/py_scripts/04-automate-optional.py # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.13.7 # kernelspec: # display_name: 'Python 3.7.9 64-bit (''workflow-calcium-imaging'': conda)...
StarcoderdataPython
6653703
import gym import unittest import numpy as np from connect_four.hashing import TicTacToeHasher from connect_four.transposition import simple_transposition_table class TestSimpleTranspositionTable(unittest.TestCase): def setUp(self) -> None: self.env = gym.make('tic_tac_toe-v0') def test_save_and_re...
StarcoderdataPython
3304849
<filename>leetcode/easy/LoggerRateLimiter.py # Design a logger system that receive stream of messages along with its timestamps, each message should be # printed if and only if it is not printed in the last 10 seconds. # Given a message and a timestamp (in seconds granularity), return true if the message should be pri...
StarcoderdataPython
5040121
from arduino_tweaks import Uno
StarcoderdataPython
5083689
<gh_stars>1-10 #Modificatins by Sur_vivor import html import json import os import psutil import random import time import datetime from typing import Optional, List import re import requests from telegram.error import BadRequest from telegram import Message, Chat, Update, Bot, MessageEntity from telegram import ParseM...
StarcoderdataPython
3509833
<reponame>pveentjer/scylla-stress-orchestrator import os import selectors import subprocess import time from scyllaso.util import run_parallel, log_machine, LogLevel, WorkerThread # Parallel SSH class PSSH: def __init__(self, ip_list, user, ssh_options, ...
StarcoderdataPython
1620595
<filename>user-config.example.py # -*- coding: utf-8 -*- # This is a sample file. You should use generate_user_files.py # to create your user-config.py file. mylang = 'commons' family = 'commons' usernames['commons']['commons'] = 'ExampleUser' password_file = "<PASSWORD>"
StarcoderdataPython
6632251
from boto.s3.key import Key from boto.s3.connection import S3Connection,OrdinaryCallingFormat import re,os,pyDate,Utils; import multiprocessing WL_SP3_BUCKET = 'edu.mbevis.osu.data' ; WL_NAV_BUCKET = 'edu.mbevis.osu.data' ; WL_RES_BUCKET = 'edu.mbevis.osu.resources' ; WL_SOLN_BUCKET= 'edu.mbev...
StarcoderdataPython
3351712
# Copyright 2012 The Swarming 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. import datetime import getpass import hashlib import optparse import os import subprocess import sys ROOT_DIR = os.path.dirname(os.path.absp...
StarcoderdataPython
1783218
"""Compute (all) LCS between two strings with brute force.""" import re import itertools def get_all_subsequences_generator(s): for i in range(1, len(s) + 1): yield from itertools.combinations(s, i) def get_all_subsequences(s): subs = [] for i in range(1, len(s) + 1): subs.extend(list(i...
StarcoderdataPython
1859021
<reponame>koshian2/TPU-Benchmark import pickle, os import numpy as np import matplotlib.pyplot as plt from PIL import Image with open("cifar-100-python/train", "rb") as fp: train = pickle.load(fp, encoding="latin-1") with open("cifar-100-python/test", "rb") as fp: test = pickle.load(fp, encoding="latin...
StarcoderdataPython
6600822
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Sun Jul 24 10:43:31 2016 @author: <NAME> """ def maximum_b_extent(): extent_0249_dict = {'x_min': -0.028, 'x_max': 0.025, 'y_min': -0.043, 'y_max': 0.039, 'z_min': 0.249, 'z_max': 0.249} extent_0302_dict = {'x_...
StarcoderdataPython
9754179
try: from setuptools import setup except ImportError: from distutils.core import setup with open("README.rst", "r") as f: long_description = f.read() setup( name="piece_table", version="0.0.3", description="A Python implementation of the piece table data structure", long_description=long...
StarcoderdataPython
11355391
<reponame>MorrellLAB/Crossing_Over<filename>scripts/data_handling/Plink2Rqtl2.py<gh_stars>1-10 #!/usr/bin/env python3 """This script takes in Plink 1.9 PED and MAP files and an AB genotype lookup table. It reformats data to R/qtl2 required input formats. Script currently outputs in your current working directory. Usag...
StarcoderdataPython
6490788
#std packages from collections import OrderedDict #third-party packages import scipy.constants as sc from PyQt5.QtGui import QIcon, QFont, QDoubleValidator from PyQt5.QtWidgets import (QMainWindow, QWidget, QApplication, QPushButton, QLabel, QAction, QComboBox, QStackedWidget, QDoubleSpin...
StarcoderdataPython
5109204
<gh_stars>0 from c0101_retrieve_ref import retrieve_ref from c0102_timestamp import timestamp_source from c0104_plot_timestamp import plot_timestamp from c0105_find_records import find_records from c0106_record_to_summary import record_to_summary from c0108_save_meta import save_meta from c0109_retrieve_meta impo...
StarcoderdataPython
3394829
import pygame as pg from os import path screen = pg.display.set_mode((512, 512)) img = pg.image.load(path.join(path.join(path.dirname(__file__), 'img'), 'earth001.png')) screen.blit(img, (256, 256)) pg.display.flip() running = True while running: for e in pg.event.get(): if e.type == pg.QUIT: r...
StarcoderdataPython
6670713
<reponame>softwarefactory-project/sf-conf #!/usr/bin/env python3 # 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
3444557
<reponame>in2p3-dp0/qserv-tests<filename>rootfs/scaletests/python/test_dr6-wfd.py #!/usr/bin/env python """ Utility script to benchmark the dr6-wfd database in qserv Author: <NAME> - LAPP """ import os import time import mysql from mysql.connector import Error import sqlparse from optparse import OptionParser import p...
StarcoderdataPython
8134553
import os from typing import Optional def drop_newline(str : str) -> str: if len(str) > 0 and str[-1] == '\n': return str[0:len(str) - 1] return str def load_file(number : int, drop_newlines : Optional[bool]) -> list[str]: path = os.path.dirname(os.path.dirname(__file__)) path = os.path.join(p...
StarcoderdataPython
11253707
<reponame>scottwittenburg/vcs<filename>tests/test_vcs_template_ratio.py import unittest import vcs import numpy class VCSTestRatio(unittest.TestCase): def assertClose(self, my, good): self.assertEqual(numpy.ma.allclose(my, good), 1) def testRatioOne(self): t = vcs.createtemplate() t.r...
StarcoderdataPython
12860737
<reponame>baba-hashimoto/BAT.py<filename>BAT/BAT.py #!/usr/bin/env python2 import glob as glob import os as os import re import shutil as shutil import signal as signal import subprocess as sp import sys as sys from lib import build from lib import scripts from lib import setup from lib import analysis ion_def = [] ...
StarcoderdataPython
3530352
<reponame>Chhekur/codechef-solutions<filename>COOK100B/TRUEDARE.py for _ in range(int(input())): tr = int(input()) tra = [int(x) for x in input().split()] dr = int(input()) dra = [int(x) for x in input().split()] ts = int(input()) tsa = [int(x) for x in input().split()] ds = int(input()) dsa = [int(x) for x in ...
StarcoderdataPython
8140356
<reponame>GenkiOtera/VHS-Extractor<gh_stars>0 from logging import getLogger import os import sys import time import subprocess as sp from PIL.ImageOps import grayscale import pyautogui as gui from .dic import dic class service(): def __init__(self) -> None: self.logger = getLogger(__name__) # 操作...
StarcoderdataPython
106440
<filename>devtools/qcexport/qcexport.py '''Import/Export of QCArchive data ''' from dataclasses import dataclass import typing from qcexport_extra import extra_children_map from sqlalchemy.orm import make_transient, Load from sqlalchemy import inspect from qcfractal.storage_sockets.models import ( AccessLogORM, ...
StarcoderdataPython
1620695
# Copyright (C) 2019 <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, soft...
StarcoderdataPython
4953909
<reponame>shaun95/google-research # coding=utf-8 # Copyright 2022 The Google Research 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...
StarcoderdataPython
1662153
<filename>MXNet2Caffe/find_caffe.py try: import caffe except ImportError: import os, sys curr_path = os.path.abspath(os.path.dirname(__file__)) sys.path.append("/usr/local/caffe/python") import caffe
StarcoderdataPython
1863401
import functools import logging from django.core.urlresolvers import reverse from preserialize.serialize import serialize from restlib2.http import codes from restlib2.params import Parametizer, StrParam, BoolParam, IntParam from avocado.conf import OPTIONAL_DEPS from avocado.models import DataField from avocado.events...
StarcoderdataPython
4805463
<reponame>pkestene/COSMA #!/usr/bin/env python3 import argparse import os import sys import tempfile import subprocess parser = argparse.ArgumentParser() parser.add_argument( 'prefix', type=str, help='Installation prefix for dependencies' ) args = parser.parse_args() if not os.path.is...
StarcoderdataPython
3385950
<reponame>django-doctor/lite-api from django.http.response import JsonResponse from rest_framework import status, permissions from rest_framework.decorators import permission_classes from rest_framework.parsers import JSONParser from rest_framework.views import APIView from api.audit_trail import service as audit_trai...
StarcoderdataPython
11390161
# -*- coding: utf-8 -*- """Classes for managing data to be modelled.""" __authors__ = '<NAME>' __license__ = 'MIT' import numpy as np import theano as th import logging import utils logger = logging.getLogger(__name__) class Dataset(object): """ Basic dataset class. """ def __init__(self, data, n_valid, c...
StarcoderdataPython
11241279
from django.shortcuts import render def crossbee_display_summation(request,input_dict,output_dict,widget): if sum(input_dict['intList']) == input_dict['sum']: check = 'The calculation appears correct.' else: check = 'The calculation appears incorrect!' return render(request, 'visuali...
StarcoderdataPython
4985623
# Generated by Django 3.1.5 on 2021-05-25 19:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0002_auto_20210406_2305'), ] operations = [ migrations.CreateModel( name='Parameter', fiel...
StarcoderdataPython
3537503
#!/usr/bin/python # -*- coding: utf-8 -*- """ A tool to transfer flickr photos to Wikimedia Commons. -group_id: specify group ID of the pool -photoset_id: specify a photoset id -user_id: give the user id of the flickrriper user -start_id: the photo id to start with -end_id: ...
StarcoderdataPython
4936781
<reponame>lukecq1231/nli import cPickle as pkl import os from data_iterator import TextIterator from main import ( build_model, pred_probs, prepare_data, pred_acc, load_params, init_params, init_tparams, ) # MUST MATCH the ids in `dic` in preprocess.py id2label = ["entailment", "neutral", ...
StarcoderdataPython
11385073
<gh_stars>0 import logging import struct import unittest from unittest.case import SkipTest from parameterized import parameterized from stages import Decode, Execute, Fetch, Memory, Writeback from stages import ForwardingUnit, Ram # import mock BASE_ADDR = 0x80000000 FORMAT = '%(message)s' logging.basicConfig(fi...
StarcoderdataPython
3372663
<gh_stars>0 import click from .scrape import scrape from .transform import transform @click.group() @click.option('--yaml-output', type=click.File('a+'), default='euas.yaml') @click.pass_context def cli(ctx, yaml_output): ctx.obj = {'yaml_output': yaml_output} cli.add_command(scrape) cli.add_command(transform)...
StarcoderdataPython
11275218
<filename>mpi_extrapolation/mpi.py # coding=utf-8 # Copyright 2019 The Google Research 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-...
StarcoderdataPython
4915038
from __future__ import print_function import pandas as pd import random import math from scipy.linalg import toeplitz import statsmodels.api as sm from statsmodels.formula.api import ols from datetime import datetime as dt import numpy as np import matplotlib.pyplot as plt from statsmodels.iolib.table import (SimpleTab...
StarcoderdataPython
3225841
import pygame import random from entity import Bullet class Enemy: def __init__(self): # Define sprite variables self.speed_x = 40 self.speed_y = 40 def bindBoard(self, board): self.board = board def fireBullet(self): enemyBullet = Bullet.Bullet('enemy') e...
StarcoderdataPython