id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
5036032 | <reponame>AurelienLourot/charm-helpers
import textwrap
import uuid
import charmhelpers.contrib.network.ovs.ovn as ovn
import tests.utils as test_utils
CLUSTER_STATUS = textwrap.dedent("""
0ea6
Name: OVN_Northbound
Cluster ID: f6a3 (f6a36e77-97bf-4740-b46a-705cbe4fef45)
Server ID: 0ea6 (0ea6e785-c2bb... | StarcoderdataPython |
1877045 | #!/usr/bin/env python3
'''
unflatten sequences into a fasta file
'''
import sys
#provide usage information
if sys.argv[1] in ['-h','-H','--help','-?']:
print("Usage: unflatten_fasta.py <input_filename>")
print("results are printed to stdout")
exit()
input_file = sys.argv[1]
max_per_line = 80
with open(... | StarcoderdataPython |
1911446 | <gh_stars>1-10
import time
import numpy as np
import torch
from .deep.feature_extractor import Extractor
from .sort.detection import Detection
from .sort.nn_matching import NearestNeighborDistanceMetric
from .sort.preprocessing import non_max_suppression
from .sort.tracker import Tracker
__all__ = ['DeepSort']
cla... | StarcoderdataPython |
5016273 | <gh_stars>100-1000
"""
Join benchmark with precomputed predictions.
"""
import sys
import argparse
import os
import numpy
import collections
import pandas
import tqdm
import mhcflurry
from mhcflurry.downloads import get_path
parser = argparse.ArgumentParser(usage=__doc__)
parser.add_argument(
"benchmark")
parse... | StarcoderdataPython |
5062444 | from waitress import serve
from api.app import APIService
from api.config import load_config_file
cfg = load_config_file()
api_app = APIService(cfg)
serve(api_app, listen="*:8000")
| StarcoderdataPython |
6611165 | <filename>maybrain/algorithms/normalisation.py<gh_stars>1-10
"""
Module for normalisation of the graphs representing the brain and respective measures
"""
import numbers
import sys
from random import shuffle
import networkx as nx
import numpy as np
from maybrain import constants as ct
class RandomGenerationError(Ex... | StarcoderdataPython |
8009368 | from flask import Flask, render_template, Response, request, redirect, url_for, send_from_directory, session, g
from flask_socketio import SocketIO, send, emit
from flask_sslify import SSLify
from datetime import datetime
app = Flask(__name__, static_url_path='/templates', static_folder='static')
#sslify = SSLify(app,... | StarcoderdataPython |
161737 | <gh_stars>1-10
from dataclasses import dataclass
from types import ModuleType
from venusian import Scanner
from wired import ServiceRegistry
from zope.interface import Interface, implementer
class IScanner(Interface):
""" A decorator scanner """
def scan(target: ModuleType) -> None:
""" Look in a mo... | StarcoderdataPython |
5155976 | #!/usr/bin/env python
########################################
### C-Learning 小テスト設定項目
### (必要に応じて編集してください)
common_setting='''
"合格点数","0"
"制限時間","0"
"公開予定日時(年/月/日 時:分)",""
"締切予定日時(年/月/日 時:分)",""
"選択肢の表示方法","3"
"選択肢の並び順","0"
"点数の公開","1"
"解説の公開","1"
"正解の公開","1"
"小テストの全体的な解説","お疲れ様でした.不正解があっても前向きに捉えましょう.効果的な復習のチャンスです!"
... | StarcoderdataPython |
3539520 | # Copyright (c) 2021, NVIDIA 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/LICENSE-2.0
#
# Unless required by appli... | StarcoderdataPython |
9654369 | # -*- coding: utf-8 -*-
from datetime import date
import re
import itertools
from .overlays import OverlayedText
from .matchers import mf
from .util import w, words, starts_with, rx_int, rx_int_extra, Rng
def month_names(rxmatch):
for i, m in enumerate(MONTH_NAMES_LONG):
if starts_with(m, rxmatch.group... | StarcoderdataPython |
3201534 | <reponame>cvdlab/lar-cc
""" Arrangements with non-contractible cells """
from larlib import *
V,[VV,EV,FV,CV] = larCuboids([1,1,1],True)
cube1 = Struct([(V,FV,EV)],"cube1")
cube2 = Struct([t(.25,.25,-1),s(.5,.5,3),(V,FV,EV)],"cube2")
V,FV,EV = struct2lar(Struct([cube1,cube2]))
VIEW(STRUCT(MKPOLS((V,FV,EV))))
"""
V,CV,... | StarcoderdataPython |
184810 | import logging
import os
import csv
import codecs
from decimal import Decimal as D
import nose
from . import pygrowup
from six.moves import zip
class WHOResult(object):
def __init__(self, indicator, values):
self.indicator = indicator
columns = 'id,region,GENDER,agemons,WEIGHT,_HEIGHT,measure,oe... | StarcoderdataPython |
4919252 | <reponame>TIBHannover/formula_gan
import numpy as np
import imageio
import os
import torch
import random
from torch.utils.data import DataLoader
from mlio.pipeline import (
Dataset,
Pipeline,
MapDataset,
MsgPackPipeline,
SequencePipeline,
ConcatShufflePipeline,
MergePipeline,
ImagePip... | StarcoderdataPython |
3556200 | #!/usr/bin/env python
"""Schema samples for integration tests."""
import mongoengine as db
from mongoengine_goodjson import (
Document, EmbeddedDocument, FollowReferenceField
)
class Address(EmbeddedDocument):
"""Test schema."""
street = db.StringField()
city = db.StringField()
state = db.Strin... | StarcoderdataPython |
1726530 | import pandas
import numpy as np
import matplotlib.pyplot as plt
import csv
import scipy.signal
filename = ('ExerciseClassifier.csv')
names = ['xacc', 'yacc', 'zacc']
data = pandas.read_csv(filename, names=names)
##print(data.shape)
##plt.plot(data)
readdata = csv.read... | StarcoderdataPython |
1602237 | <reponame>iliaskaras/housing-units<gh_stars>0
from typing import Optional, List
from fastapi import HTTPException
from application.housing_units.models import HousingUnit
from application.housing_units.repositories import HousingUnitsRepository
from application.infrastructure.error.errors import InvalidArgumentError
... | StarcoderdataPython |
371013 | <filename>dashboard/admin.py
from django.contrib import admin
from .models import Author
admin.site.register(Author)
# made by <NAME>
# Facebook : facebook.com/yeariha.farsin
# Github : github.com/yeazin
# website : yeazin.github.io
| StarcoderdataPython |
9698573 | <reponame>hacklabr/django-rest-pandas
import unittest
from rest_framework.test import APITestCase
from tests.testapp.models import MultiTimeSeries
from tests.testapp.serializers import NotUnstackableSerializer
from rest_pandas.test import parse_csv
from django.core.exceptions import ImproperlyConfigured
import os
from ... | StarcoderdataPython |
1937928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 CenturyLink
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
module: clc_publicip
short_description: A... | StarcoderdataPython |
9734298 | from cloudendure2 import CloudendureSDK
import json
import os
import logging
# Turn on Logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
def configurator(event, context):
# Get the API key from the env vars and initiate the cloudendure sdk
user_api_token = os.environ['userApiToken']
cli... | StarcoderdataPython |
1921891 | <filename>ansible_project/myansible/webansi/models.py<gh_stars>1-10
from django.db import models
class HostGroup(models.Model):
groupname = models.CharField(max_length=50, unique=True, null=False)
def __str__(self):
return '组: %s' % self.groupname
class Host(models.Model):
hostname = models.CharF... | StarcoderdataPython |
3452341 | <gh_stars>0
from collections import Counter, defaultdict
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.metrics import f1_score
from sklearn.svm import LinearSVC
from sklearn.naive_bayes import MultinomialNB
def mnb_word(train, eval, alpha):
# Vectorize training set
v... | StarcoderdataPython |
3232806 | <gh_stars>1-10
import numpy as np
import scipy as sp
import logging
import warnings
from pysnptools.standardizer import Standardizer
class Beta(Standardizer):
'''
A :class:`.Standardizer` to beta standardize SNP data.
See :class:`.Standardizer` for more information about standardization.
**Construct... | StarcoderdataPython |
4917538 | <filename>SORChooser.py
#Programmer: <NAME>
#Purpose: To create a GUI using Matplotlib for choosing surfaces of revolution
import numpy as np
import matplotlib.pyplot as plt
from PolyMesh import *
from sys import argv, exit
##A few example surfaces of revolution
def getBullet(N, NSteps):
X = np.zeros((N, 2))
X... | StarcoderdataPython |
5018899 | <reponame>BioinfUD/K-mersCL<filename>src/utils/read_conversion.py
import numpy as np
import sys
from numpy import ndarray
import os
BASE_TO_INT = {
"A" : 0,
"C" : 1,
"G" : 2,
"T" : 3
}
INT_TO_BASE = {v: k for k,v in BASE_TO_INT.iteritems()}
def base_to_int(b):
return BASE_TO_INT.get(b, 99)
def ... | StarcoderdataPython |
236045 | class AbstractStemmer:
pass
class PorterStemmer(AbstractStemmer):
"""
A Stemmer class
tutorial from: https://medium.com/analytics-vidhya/building-a-stemmer-492e9a128e84
"""
consonants = "bcdfghjklmnpqrstwxz"
special_case = "y"
vowels = "aeiou"
def _divide_into_groups(self, word):
... | StarcoderdataPython |
3205972 | # -*- coding: utf-8 -*-
import logging
from flask import Flask
from raven.contrib.flask import Sentry
import config.config as cf
from flask_bootstrap import Bootstrap
from flask_moment import Moment
app = Flask(__name__)
# app.config.from_object('config')
app.config.from_pyfile('../config/config.py')
sentry = Sentry... | StarcoderdataPython |
1716758 | from typing import List
class Solution:
def kthDistinct(self, arr: List[str], k: int) -> str:
count_dict = dict()
len_arr: int = len(arr)
count: int = 0
for i in range(len_arr):
count_dict[arr[i]] = 0
for i in range(len_arr):
count_dict[arr[i]] += ... | StarcoderdataPython |
8051345 | <gh_stars>0
import hashlib
import gzip
import json
def compute_sha256(unicode_text):
m = hashlib.sha256()
m.update(unicode_text.encode('utf-8'))
return m.hexdigest()
def read_gzipped_metadata(meta_filename):
raw_bytes = gzip.GzipFile(meta_filename, mode='rb').read()
raw_text = raw_bytes.decode('ut... | StarcoderdataPython |
91524 | <filename>pidcmes_calibration.py<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pidcmes_calibration.py
author : <NAME>
date : 07.01.2011
version : 1.0.0
maturity : 4 - beta
pidcmes = raspberry PI Direct Current MEaSurement
This program measures the interruption latency time of the Raspberry PI used an... | StarcoderdataPython |
3451365 | class Tag:
AND = 256
BASIC = 257
BEGIN = 258
BREAK = 259
DEFINE = 260
DO = 261
ELSE = 262
END = 263
EQ = 264
FALSE = 265
GE = 266
ID = 267
IF = 268
INDEX = 269
LE = 270
MINUS = 271
NE = 272
... | StarcoderdataPython |
1770169 | # Import all the fixtures.
# noinspection PyUnresolvedReferences
from b_cfn_api_v2_test.integration.fixtures import *
from b_cfn_api_v2_test.integration.infra_create import inf_create
from b_cfn_api_v2_test.integration.infra_destroy import inf_destroy
def pytest_sessionstart(session):
inf_create()
def pytest_se... | StarcoderdataPython |
3368080 | <filename>explosion.py
from livewires import games, color
import pygame
class Explosion(games.Animation):
""" animated explosion """
#seria obrazków animacji
anim_frames = ['textures\\explosion1.png',
'textures\\explosion2.png',
'textures\\explosion3.png'... | StarcoderdataPython |
188885 | import mathutils
import numpy as np
from src.main.Provider import Provider
from src.utility.BlenderUtility import get_bounds
class Attribute(Provider):
"""
Returns a value that is the result of selecting entities using getter.Entity Provider, getting the list of
values of selected entities' attributes/cu... | StarcoderdataPython |
12812451 | # -*- coding: utf-8 -*-
"""
routerinfo
~~~~~~
A module to convert multiple router IP address aliases to a single router IP address.
:author: <NAME>
:copyright: Northeastern University © 2018.
:license: Custom BSD, see LICENSE for more details.
:email: <EMAIL>
"""
| StarcoderdataPython |
6502442 | from typing import List
from src.interpreter.expression import Expression
def j(block: List, codebase):
return "j" * max(min(Expression(block[1], codebase), 250), 1)
| StarcoderdataPython |
8028515 | <gh_stars>1-10
from ..baseClasses.collection import Collection
from ..generalObjects.constraint import Constraint
catConstraintTypeDict = {
"catCstTypeReference":0,
"catCstTypeDistance":1,
"catCstTypeOn":2,
"catCstTypeConcentricity":3,
"catCstTypeTangency":4,
"catCstTypeLength":5,
"catCstType... | StarcoderdataPython |
1245 | from .lit_explorer import *
from .pdf_wrangling import *
| StarcoderdataPython |
6479291 | <filename>egs/librispeech/asr/simple_v1/model.py<gh_stars>0
from torch import Tensor
from torch import nn
class Model(nn.Module):
"""
Args:
num_features (int, optional): Number of input features (Default: ``40``).
num_classes (int, optional): Number of output classes (Default: ``364``)
"""... | StarcoderdataPython |
6486923 | import numpy as np
import pandas as pd
class AWSSpotPrice(Source):
PRODUCES = ["provisioner_resource_spot_prices"]
def __init__ (self, *args, **kwargs):
pass
def produces(self): return PRODUCES
# The DataBlock given to the source is t=0
def acquire(self, DataBlock):
resource_list... | StarcoderdataPython |
11265243 | <reponame>tuttelikz/farabi<filename>docs/source/handbook/pyplots/binary_step.py<gh_stars>10-100
from activfuncs import plot, x
import numpy as np
binary_step = np.vectorize(lambda x: 1 if x > 0 else 0, otypes=[np.float])
plot(binary_step, yaxis=(-0.4, 1.4))
| StarcoderdataPython |
5127911 | <filename>rlattack/__init__.py<gh_stars>0
# The __init__.py file used to be a required part of a package (old, pre-3.3 "regular package", not newer 3.3+
# "namespace package").
#
#
# Python defines two types of packages, regular packages and namespace packages. Regular packages are traditional
# packages as they... | StarcoderdataPython |
8031523 | <filename>src/cogs/vector.py
import discord
from discord.ext import commands
import sympy
import axiomathbf
from utility.math_parser import convert, parse_eq
class Vector(commands.Cog):
"""
Contains various linear algebra tools
"""
def __init__(self, bot):
self.bot = bot
self.file_loc... | StarcoderdataPython |
268804 | <filename>flows/layers/base/spectral.py
import torch
import torch.nn.functional as F
class SpectralNormConv(object):
# Invariant before and after each forward call:
# u = normalize(W @ v)
# NB: At initialization, this invariant is not enforced
_version = 1
# At version 1:
# made `W` not... | StarcoderdataPython |
6516981 | <filename>Labs/CorrelationCovariance/solutions.py
import numpy as np
from matplotlib import pyplot as plt
def shiftByMean(A):
'''
Shift the columns of the input array by their respective means.
Inputs:
A -- an (m,n) array
Return:
a (m,n) array whose columns are the mean-shifted counterp... | StarcoderdataPython |
11264301 | <reponame>FJ-NaokiMatsumura/spack<gh_stars>10-100
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from spack.pkg.builtin.boost import Boost
class To... | StarcoderdataPython |
6597192 | """Tests for alpacka.agents.stochastic_mcts."""
import asyncio
import functools
from unittest import mock
import numpy as np
import pytest
from alpacka import agents
from alpacka import envs
from alpacka import testing
class TabularNewLeafRater(agents.stochastic_mcts.NewLeafRater):
"""Rates new leaves based on... | StarcoderdataPython |
11284343 | <reponame>rinikerlab/mdfptools<gh_stars>10-100
import numpy as np
from mdfptools.Composer import Solution42BitsComposer, WaterComposer, LiquidComposer
import mdtraj as md
import parmed
traj = md.load("./data/water_gmx_example_1.xtc", top = "./data/water_gmx_example_1.gro")
print(traj)
pd = parmed.load_file("./data/wat... | StarcoderdataPython |
3326354 | <gh_stars>1-10
#
# Copyright (c) 2017 <NAME> <<EMAIL>>
#
# See the file LICENSE for your rights.
#
"""
Calculate verification scores and metrics. These are not saved to the database, but in a json file.
"""
import numpy as np
from thetae import MissingDataError
from thetae.db import readDaily
from datetime import dat... | StarcoderdataPython |
8027614 | <reponame>AndriiOshtuk/files_sort_out
import os
import pathlib
import pytest
from click.testing import CliRunner
from unittest.mock import patch
from faker import Faker
import src.files_sort_out.files_sort_out as app
def create_files(path: pathlib.Path, images=False):
fake = Faker()
total_files = 5
imag... | StarcoderdataPython |
9739387 | <filename>create_and_store_instances.py<gh_stars>0
import random
import numpy as np
import time
import pickle
from instance_mcnf import generate_instance
# Here you choose the setting of the instances
nb_repetitions = 100
nb_unique_exp = 10
# Size of the graph : controls the number of nodes and arcs
size_list = [10... | StarcoderdataPython |
5036751 | <filename>xavier/lib/emokit/__init__.py<gh_stars>1-10
# -*- coding: utf-8 -*-
__all__ = ['battery', 'decrypter', 'sensors', 'emotiv', 'packet', 'util', 'reader']
"""
emokit - emotiv epoc reverse engineering
~~~~~~~~~~~~~~~
:copyright: Copyright (c) 2010-2012, <NAME>, <NAME>/Nonpolynomial Labs, Copyright 2013 <NAME>
... | StarcoderdataPython |
244980 | # coding: utf-8
sequence = map(int, raw_input().split())
N = len(sequence)
dp = [1] * (N+1)
ans = 0
for i in xrange(N):
dp[i] = 1
for j in xrange(i):
if (sequence[j] < sequence[i] and dp[i] <= dp[j]):
dp[i] = dp[j] + 1
if (ans < dp[i]):
ans = dp[i]
print ans
| StarcoderdataPython |
1927487 | from abc import ABCMeta, abstractmethod
class LatencyMeasurement(metaclass=ABCMeta):
"""
Measure latency params
"""
@abstractmethod
def add_duration(self, identifier, duration):
pass
@abstractmethod
def get_avg_latency(self):
pass
class EMALatencyMeasurementForEachClient... | StarcoderdataPython |
5107015 | # coding=utf-8
class Solution:
"""
回文数字判断
"""
@staticmethod
def is_palindrome(x: int) -> bool:
"""
Time: O(n), Space: O(1)
:param x:
:return:
"""
if x < 0:
return False
s = str(x)
left, right = 0, len(s) - 1
while... | StarcoderdataPython |
3344221 | <filename>Actividades/AC06/AC06.py
from datetime import datetime as dt
def set_id():
n = 0
while True:
yield "#" + str(n) + "M"
n += 1
def popular(numero):
return list((filter(lambda pelicula: pelicula.rating > numero, peliculas)))
def with_genres(numero):
return list((filter(lambd... | StarcoderdataPython |
8104624 | <reponame>jaryeonge/ingest-system-py<filename>src/main.py
from fastapi import FastAPI, Depends
import sys
sys.path.insert(0, '/src')
from routers import security_router, config_router, process_router, since_router, test_router
from routers.security_router import request_filter
app = FastAPI()
app.include_router(secu... | StarcoderdataPython |
11248647 | <gh_stars>1-10
# Import required libraries
import numpy as np
import pandas as pd
import re
import pickle
# Load any variation of tweet embeddings created from Spacy, BERT and ELMo the state-of-the-art NLP models
# and assign it to X
pickle_in = open("Spacy_train.pickle","rb") # May use other variants ... | StarcoderdataPython |
140156 | from .pagination import Page, PageQuery
| StarcoderdataPython |
9619022 | # -*- coding: utf-8 -*-
path = 'ode_libs/'
def build(NAME):
import subprocess,os
print './'+path+'build_lib.sh',NAME
os.chdir(path)
subprocess.call(['./build_lib.sh',NAME])
os.chdir("../")
#os.system('./build.sh '+NAME+'~')
def parse(NAME,VARIABLES,PARAMETROS,FORMULA,INPUTS):
imp... | StarcoderdataPython |
27777 | <reponame>dnguyen0304/room-list-watcher<gh_stars>0
# -*- coding: utf-8 -*-
from roomlistwatcher.common import utility
class Topic(utility.AutomatedEnum):
ROOM_FOUND = ()
| StarcoderdataPython |
11335117 | <reponame>jiksaa/odoons
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="odoons-jiksaa",
version="0.0.5",
author="Jiksaa <<NAME>>",
description="Odoo addons management tool",
long_description=long_description,
long_description_conten... | StarcoderdataPython |
12839346 | <reponame>kodomomo/dsm-payments-util
import pymysql
from booth_info import booths
from generate_random_id import generate_random_id, generate_easy_password
from generate_random_password import generate_random_password
from sqls import *
pay_database = {
'port': 3306,
}
pay_connection = pymysql.connect... | StarcoderdataPython |
6699843 | <filename>04_database/read_db.py
import mysql.connector
# connection string
cnx = mysql.connector.connect(user='root',
password='<PASSWORD>',
host = '127.0.0.1',
database = 'Farm',
auth_plugin = 'mysql_native_password')
# query block
cursor = cnx.cursor()
query = ("INSERT INTO `Customers` VALUES ('b... | StarcoderdataPython |
5159645 | <gh_stars>1-10
'''
Created on 15/09/2014
:author: alfred
'''
from dirty_models.models import BaseModel
from dirty_models.fields import BlobField
from performance.dynamicmodel import create_dict
class FakeDynModel(BaseModel):
fake_data = BlobField()
class BlobFieldPerformance:
def __init__(self, depth=5, c... | StarcoderdataPython |
1994146 | <filename>modules/dbnd/src/dbnd/_core/tracking/backends/channels/tracking_disabled_channel.py
import logging
from dbnd._core.tracking.backends.channels.abstract_channel import TrackingChannel
from dbnd._core.tracking.backends.channels.marshmallow_mixin import MarshmallowMixin
logger = logging.getLogger(__name__)
c... | StarcoderdataPython |
1945664 |
##
## Module & Package Import
##
import json
import os
import datetime
import statistics
import plotly
import plotly.plotly as py
import plotly.graph_objs as go
from flask import Flask, Blueprint, request, render_template, jsonify, flash, redirect
from dotenv import load_dotenv
import gspread
from gspread.excepti... | StarcoderdataPython |
12857905 | #!/usr/bin/env python3
import smtplib
import time
import configparser
config = configparser.ConfigParser()
config.read('/home/pi/Development/Python/InverterMQTT/emailcredentials.conf')
email = config['credentials']['email']
password = config['credentials']['password']
to_email = config['credentials']['to_email']
# ... | StarcoderdataPython |
3485972 | import FWCore.ParameterSet.Config as cms
# Energy scale correction for Island Endcap SuperClusters
correctedIslandEndcapSuperClusters = cms.EDProducer("EgammaSCCorrectionMaker",
corectedSuperClusterCollection = cms.string(''),
sigmaElectronicNoise = cms.double(0.15),
superClusterAlgo = cms.string('Island')... | StarcoderdataPython |
210534 | """CreateCommerceProductAttributeTable Migration."""
from masoniteorm.migrations import Migration
class CreateCommerceProductAttributeTable(Migration):
def up(self):
"""
Run the migrations.
"""
with self.schema.create("commerce_product_attributes") as table:
table.incr... | StarcoderdataPython |
5191787 | # Copyright 2019 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 law or agreed to... | StarcoderdataPython |
121373 | <filename>pymysqlreplication/constants/UNSIGNED.py
UNSIGNED_CHAR_COLUMN = 251
UNSIGNED_CHAR_LENGTH = 1
UNSIGNED_INT24_COLUMN = 253
UNSIGNED_INT24_LENGTH = 3
UNSIGNED_INT64_COLUMN = 254
UNSIGNED_INT64_LENGTH = 8
UNSIGNED_SHORT_COLUMN = 252
UNSIGNED_SHORT_LENGTH = 2
| StarcoderdataPython |
3371677 | <filename>extract_melspectrograms.py
#
# step1_extract_melspectrograms.py
#
# Load detection labels, extract audio for detection and non-detection regions,
# compute and save spectrograms.
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#
#%% Imports
import pandas as pd... | StarcoderdataPython |
3509672 | #
# vcr.py
# - Configures the environment for running the Viral Assembly (viral_assembly_pipeline.py) and VIGOR (VIGOR3.pl) pipelines (creating directory structure and installs software).
#
from __future__ import print_function
import os.path, re, mmap
from fabric.api import cd, env, hide, local, run, settings, sudo... | StarcoderdataPython |
6437645 | from collections import namedtuple, defaultdict
from leaderboard.model import Rank, PlayerRank
Score = namedtuple('Score', 'pseudo kills')
Match = namedtuple('Match', 'scores')
def compute_ranking(match):
def player_by_kills():
result = defaultdict(list)
for score in match.scores:
re... | StarcoderdataPython |
3547497 | import os
import cv2
import numpy as np
import time
from torch.multiprocessing import Pool
from utils.nms_wrapper import nms
from utils.timer import Timer
from configs.CC import Config
import argparse
from layers.functions import Detect, PriorBox
from peleenet import build_net
from data import BaseTransform, VOC_CLASSE... | StarcoderdataPython |
9729979 | <reponame>Bpowers4/data-science-at-the-command-line
#!/usr/bin/env python
from sys import stdin, stdout
while True:
line = stdin.readline()
if not line:
break
stdout.write("%d\n" % int(line)**2)
stdout.flush()
| StarcoderdataPython |
3408008 |
from js9 import j
import socket
import time
# import urllib.request, urllib.parse, urllib.error
try:
import urllib.request
import urllib.parse
import urllib.error
except BaseException:
import urllib.parse as urllib
JSConfigFactory = j.tools.configmanager.base_class_configs
JSConfigClient = j.tools.c... | StarcoderdataPython |
29114 | class Solution:
def shortestSuperstring(self, A: List[str]) -> str:
| StarcoderdataPython |
5073325 | <reponame>samuelbaltanas/face-pose-dataset<filename>face_pose_dataset/estimation/base/__init__.py
from face_pose_dataset.estimation.base.fsanet import *
from face_pose_dataset.estimation.base.ddfa import *
from face_pose_dataset.estimation.base.hopenet import *
| StarcoderdataPython |
3415729 | import cv2
import numpy as np
def find_direction(low_pre, col_pre, low_now, col_now):
if low_now - low_pre == 1 and col_now - col_pre == 0:
return 'right'
if low_now - low_pre == 1 and col_now - col_pre == -1:
return 'upper_right'
if low_now - low_pre == 0 and col_now - col_pre == -1:
... | StarcoderdataPython |
1606015 | <reponame>HDembinski/particle
#!/usr/bin/env python
# Copyright (c) 2018-2020, <NAME> and <NAME>.
#
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
# or https://github.com/scikit-hep/particle for details.
from __future__ import absolute_import
from __future__ import print_function
import o... | StarcoderdataPython |
5087605 | from random import choice
__author__ = "<NAME> DJANGO"
__license__ = "MIT License"
__version__ = "1.0.0"
class Possibility:
"""
This module functions returns head or tail, rock or paper or scissors,
dice or roll. It depends on what you want.
Usage:
dice_roll(numbers of dice)
... | StarcoderdataPython |
158280 | from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
from subprocess import check_call
with open("README.md", "r") as fh:
long_description = fh.read()
with open('./requirements.txt', 'r') as f:
requirements = []
for line ... | StarcoderdataPython |
9729894 | <filename>var/spack/repos/builtin/packages/perl-mce/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PerlMce(PerlPackage):
"""MC... | StarcoderdataPython |
5172586 | def LI(): return list(map(int, input().split()))
def I(): return int(input())
import sys
sys.setrecursionlimit(10 ** 9)
# 単位元が存在 (0) かつ 結合則が成り立つ → Segment Tree!
# 参考: https://qiita.com/takayg1/items/c811bd07c21923d7ec69
# 単位元 と 結合法則 (交換則は成り立たなくてOK) が必要! それらがあれば O(N)→O(log N) にできる.)
class SegTree:
"""
init(i... | StarcoderdataPython |
4826891 | # -*- coding: utf-8 -*-
import sys
import os.path
import tkinter as tk
from tkinter import ttk, messagebox
from tkinter.filedialog import asksaveasfilename
from tkinter.filedialog import askopenfilename
from thonny.misc_utils import eqfn, running_on_mac_os
from thonny.codeview import CodeView
from thonny.globals impor... | StarcoderdataPython |
3515105 | # -*- coding: utf-8 -*-
# By: LawlietJH
# Version: 1.0.3
import os, sys, json
import requests
from bs4 import BeautifulSoup
reload(sys)
sys.setdefaultencoding('utf-8')
def getCPs(municipio):
req = None
cont = 0
page = 'https://micodigopostal.org/' + municipio
try:
req = requests.get(page)
except requ... | StarcoderdataPython |
3502586 | <gh_stars>1-10
#$Id$
from books.model.PageContext import PageContext
class ItemList:
"""This class is used to create object for Items list."""
def __init__(self):
"""Initialize parameters for Items list."""
self.items = []
self.page_context = PageContext()
def set_items(self, item... | StarcoderdataPython |
1612709 | from grakn.client import Client, GraknError
| StarcoderdataPython |
9603584 | <reponame>PedroLuisBernardos/INM5151
# __init__.py
# défini le blueprint du core de l'application
from flask import Blueprint
bp = Blueprint('entrees', __name__)
from app.entrees import routes | StarcoderdataPython |
318327 | <gh_stars>0
from django.db import models
class RenovationExperience(models.Model):
name = models.CharField(max_length=50)
class Meta:
ordering = ["name"]
def __str__(self):
return self.name
class TenantExperience(models.Model):
name = models.CharField(max_length=50)
class Meta:
... | StarcoderdataPython |
5010750 | """
Subpackage ``exlib`` contains external libraries self contained in VIP:
DS9 bindings (stripped-down version of RO.DS9 python package by <NAME>)
and and IUWT from https://github.com/ratt-ru/PyMORESANE/
"""
from ds9 import *
from iuwt import *
__all__ = []
| StarcoderdataPython |
4872274 | <filename>JumpscaleLibs/clients/digitalocean/DigitalOceanFactory.py
from Jumpscale import j
from .DigitalOcean import DigitalOcean
skip = j.baseclasses.testtools._skip
skip = j.baseclasses.testtools._skip
class DigitalOceanFactory(j.baseclasses.object_config_collection_testtools, j.baseclasses.testtools):
__j... | StarcoderdataPython |
6556573 | <reponame>stuarteberg/tensorstore
# Copyright 2020 The TensorStore Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | StarcoderdataPython |
11391216 | # ===================================================================================================
# Training: 1 drone
# ===================================================================================================
# records for each episode
time_steps = [] # number of time steps in total
epsilons = [] # epsi... | StarcoderdataPython |
4929392 | <filename>rezka.py
# -*- coding: utf-8 -*-
from requests import Session
from bs4 import BeautifulSoup
from urllib3 import disable_warnings
from urllib.parse import urlparse
from time import time
from re import match, IGNORECASE
disable_warnings()
base_url = 'http://rezkery.com/'
def get_session() -> Session:
... | StarcoderdataPython |
11264941 | <reponame>dbrandenburg/python-oreilley-certification
#!/usr/bin/env python3
#class Coconut():
#
# """A class to provide the weight of a coconut."""
#
# def __init__(self, coconut_type = None):
# allowed_coconut_types = {'South Asian': 3,
# 'Middle Eastern': 2.5,
# ... | StarcoderdataPython |
6405442 | # -*- coding: utf-8 -*-
"""
Copyright 2017-2018 <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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.