id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
8028315
<gh_stars>10-100 import torch import numpy as np class MedianImageMeter(object): def __init__(self, bit_depth, im_shape, device='cpu'): self.bit_depth = bit_depth self.im_shape = list(im_shape) self.device = device if bit_depth == 8: self.dtype = np.uint8 elif bi...
StarcoderdataPython
6658403
""" Contains tests for the fields included in selenium_yaml.fields """ from selenium_yaml import fields from selenium_yaml import exceptions import pytest import os class FieldTestMixin: """ Contains common methods for testing field validation successs or failure """ def is_successful_validation(s...
StarcoderdataPython
9708914
import csv from urllib.request import Request, urlopen import dateutil.parser import re from sys import argv from bs4 import BeautifulSoup import scrape_util default_sale, base_url, prefix = scrape_util.get_market(argv) base_url += 'index.cfm' report_path = ['?show=10&mid=7', '?show=10&mid=8'] strip_char = ';,.# \n\t'...
StarcoderdataPython
3420968
# -*- coding: utf-8 -*- import tensorflow as tf def fixed_dropout(xs, keep_prob, noise_shape, seed=None): """ Apply dropout with same mask over all inputs Args: xs: list of tensors keep_prob: noise_shape: seed: Returns: list of dropped inputs """ with ...
StarcoderdataPython
8125329
<filename>leetcode/0024/answer.py<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2021/12/6 12:17 # @Author : weihuchao class ListNode(object): def __init__(self, val=0, next=None): self.val = val self.next = next class Solution(object): def swapPairs(self, head): ...
StarcoderdataPython
200957
<reponame>Chemscribbler/Netrunner import requests import csv import json root_address = "https://netrunnerdb.com/api/2.0/" # For pulling from next rotation (AKA Mumbad-Gateway) valid_codes = [ "sansan", "honor-and-profit", "order-and-chaos", "data-and-destiny", "mumbad", "flashpoint", "red...
StarcoderdataPython
1824890
<reponame>stefets/mpyg321 import pexpect import sys from threading import Thread from pexpect import exceptions import time mpg_outs = [ { "mpg_code": "@P 0", "action": "music_stop", "description": """For mpg123, it corresponds to any stop For mpg312 it corresponds ...
StarcoderdataPython
9769738
import mayaUtils from selection import Selection #import vertexColorUtils
StarcoderdataPython
11213863
from django.apps import AppConfig class JssConfig(AppConfig): name = 'jss'
StarcoderdataPython
8042308
<filename>Curso_de_Python/Mundo_01/Aula_08/Exercicios/ex016.py # Corrigido # Bloco de importação from math import trunc print('Exercício 016') print() # Bloco de entrada num = float(input('Informe um número real: ')) # Bloco de cálculo inteiro = trunc(num) # Bloco de saída print('A porção inteira de {} é igual a {}...
StarcoderdataPython
5127778
class Solution: def longestValidParentheses(self, s: str) -> int: left=0 tag=[] ready=[] i=0 for t in s: if t=='(': left+=1 ready.append(i)#坐标 tag.append('1') i+=1 elif t==')': ...
StarcoderdataPython
4861693
<gh_stars>0 from django.conf.urls.defaults import patterns, include, url from django.views.generic.base import TemplateView from django.contrib import admin admin.autodiscover() import settings urlpatterns = patterns('', url(r'^$', TemplateView.as_view(template_name="homepage.html"), name="home"), url(r'^a...
StarcoderdataPython
3566779
from __future__ import division, print_function, unicode_literals import os from os import listdir import json import sys import random import cv2 import pickle import numpy as np seed = 13 random.seed(seed) np.random.seed(seed) sys.path.insert(0, "..") from utils import Timer from recognition.constants import ( HEIG...
StarcoderdataPython
5189185
<reponame>celestialteapot/nnc import gym import numpy as np import torch from torch import nn from torchdiffeq import odeint def get_a_conv(in_channel, out_channel): """ Generate a convolutional layer based on the torch.nn.Conv2d class :param in_channel: the number of input channels :param out_channe...
StarcoderdataPython
3587814
<reponame>friedforfun/DocumentTracking import pytest from unittest.mock import patch, mock_open from DocuTrace.Analysis.DataCollector import DataCollector, ReadingData mock_file_content = '{"visitor_uuid": "745409913574d4c6", "env_doc_id": "130705172251-3a2a725b2bbd5aa3f2af810acf0aeabb", "visitor_country": "MX", "even...
StarcoderdataPython
8098629
from setuptools import setup, find_packages setup(name='coconut', version='0.0.1', url='https://github.com/imzeki/coconut', license='MIT', author='<NAME>', author_email='<EMAIL>', description='Coconut is a module for simplifying simple things and chunk them down into even s...
StarcoderdataPython
4826280
#!/usr/bin/env python3 """exfi.io.read_bed.py: BED importer""" import logging import pandas as pd from exfi.io.bed import BED3_COLS, BED3_DTYPES def read_bed3(filename): """Read a BED file and return the BED3 dataframe.""" logging.info('Reading BED3 from disk') bed3 = pd.read_csv( filepath_or_...
StarcoderdataPython
6415221
import logging logger = logging.getLogger(__name__) def parameterized(dec): """ Meta decorator. Decorate a decorator that accepts the decorated function as first argument, and then other arguments with this decorator, to be able to pass it arguments. Source: http://stackoverflow.com/a/261516...
StarcoderdataPython
5061289
<reponame>jcapriot/simpeg from .code_utils import * deprecate_module("codeutils", "code_utils", "0.15.0")
StarcoderdataPython
6507594
<reponame>MalikKeio/valkyrie-anatomia-script JP = 0 EN = 1 STATUS = -1 TRANSLATED = 1 INPROGRESS = 2 NOSTORY = 3 CHAPTERS = { 1: ["戦乙女の目覚め", "The Awakening of the Battle Maiden", TRANSLATED], 2: ["魂の律動:剣を振る理由", "Spiritual Concentration: What to Wield the Sword For", INPROGRESS], 3: ["魂の律動:禁じられた歌声", "Spirit...
StarcoderdataPython
5065028
from tempfile import NamedTemporaryFile from typing import List from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule class EcoindexSpider(CrawlSpider): name = "EcoindexSpider" custom_settings = {"LOG_ENABLED": False} rules = (Rule(LinkExtractor(), callback="parse_i...
StarcoderdataPython
5030239
<gh_stars>0 # Part of Escala. # Written by <NAME>. from sys import argv as ARGS # Constants that make up a complete SQL script. SQL_SCRIPT = "add_skills.sql" INSERT_NODE = ( "INSERT INTO skillNodes VALUES" " ('{0}', {1}, '{2}', '{3}', {4}, {5}, {6}, {7});\n" ) INSERT_EDGE = "INSERT INTO skillEdges VALUES ('{0...
StarcoderdataPython
5186539
''' Lucky numbers are subset of integers. Rather than going into much theory, let us see the process of arriving at lucky numbers, Take the set of integers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,…… First, delete every second number, we get following reduced set. 1, 3, 5, 7, 9, 11, 13, 15, 17,...
StarcoderdataPython
306709
# log21.Levels.py # CodeWriter21 import logging as _logging __all__ = ['CRITICAL', 'FATAL', 'ERROR', 'WARNING', 'WARN', 'INFO', 'DEBUG', 'NOTSET'] CRITICAL = _logging.CRITICAL FATAL = CRITICAL ERROR = _logging.ERROR WARNING = _logging.WARNING WARN = WARNING INFO = _logging.INFO DEBUG = _logging.DEBUG NOTSET = _loggi...
StarcoderdataPython
5197685
# coding:utf-8 from LxMaBasic import maBscCfg class KeyframeOp(maBscCfg.MaUtility): def __init__(self, rootStr): self._rootStr = rootStr
StarcoderdataPython
5140097
from mdal import Datasource, MDAL_DataLocation ds = Datasource("data/tuflowfv/withMaxes/trap_steady_05_3D.nc") mesh = ds.load() group = mesh.groups[1] a, b, c = group.volumetric(0) ds2 = Datasource("test_vol.ply") mesh2 = ds2.add_mesh() mesh2.vertices = mesh.vertices mesh2.faces = mesh.faces print(f"Vertex Count :{m...
StarcoderdataPython
5081403
<reponame>fpsantosx/DesenWeb<filename>SomarNumeros.py<gh_stars>0 def soma(n1, n2, n3): return n1+n2+n3 print(soma(5,6,7))
StarcoderdataPython
229775
from nose.plugins.skip import SkipTest from nose.tools import raises, assert_equal, assert_is, assert_list_equal from slivka.server.forms.fields import IntegerField, ValidationError, \ IntegerArrayField class TestValue: def setup(self): self.field = IntegerField("name") def test_int(self): ...
StarcoderdataPython
3408185
<filename>pythonocc/lib/OCC/RWStepRepr.py # This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.10 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (3,0,0): new_instanc...
StarcoderdataPython
11224887
import os import re from typing import Dict, List Index = Dict[str, Dict[int, List[str]]] def index(in_path: str) -> Index: workload_index: Index = {} for test in os.listdir(in_path): workload = get_workload(test) clients = get_client_count(test) technique = get_technique(test) ...
StarcoderdataPython
11223526
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np import astropy.units as u from .. import data class TestOHFluorescenceSA88: def test_linear_interpolation(self, monkeypatch): monkeypatch.setattr(data, 'scipy', None) model = data.OHFluorescenceSA88('...
StarcoderdataPython
302576
"""Packaging logic for betamax.""" import os import re import sys import setuptools packages = setuptools.find_packages( "src", exclude=["tests", "tests.integration"], ) requires = ["requests >= 2.0"] __version__ = "" with open("src/betamax/__init__.py", "r") as fd: reg = re.compile(r"__version__ = [\'']...
StarcoderdataPython
5062795
"""mutes""" from twitter.core import UserData class Mutes: """mutes""" def __init__(self, twitter): self.twitter = twitter def users_ids(self, params): """Hello""" url = "/".join(["mutes", "users", "ids"]) result = self.twitter.get(url, params=params) result.data = r...
StarcoderdataPython
1826873
import json class Debug_JSON(): def __init__(self, settings, device): self.config = settings self.device = device def get_debug_json(self, base_url): debugjson = { "base_url": base_url, "total channels": self.device.channels.get_station_total()...
StarcoderdataPython
6516727
<reponame>dukagjinramosaj1/python_exercises #1 - Import the data #2 - Clean the data #3 - Split the data: Training set and Test set. #4 - Create a Model #5 - Check the Output #6 - Improve
StarcoderdataPython
11204374
#This example shows the effects of some of the different PSD parameters import numpy as np import matplotlib.pyplot as plt dt = np.pi / 100. fs = 1. / dt t = np.arange(0, 8, dt) y = 10. * np.sin(2 * np.pi * 4 * t) + 5. * np.sin(2 * np.pi * 4.25 * t) y = y + np.random.randn(*t.shape) #Plot the raw time series fig = pl...
StarcoderdataPython
6632150
#!/usr/bin/env python3 import pytest import schemathesis def pytest_addoption(parser): parser.addoption( "--local-url", action="store", default="http://127.0.0.1:8053/api/v0" ) parser.addoption( "--compare-url", action="store", default="https://guild.koios.rest/api/v0" ) parser.add...
StarcoderdataPython
5134282
import os from flask import Flask from flask.ext import restful from flask import make_response from json import dumps from hiphack import app def output_json(obj, code, headers=None): resp = make_response(dumps(obj), code) resp.headers.extend(headers or {}) return resp DEFAULT_REPRESENTATIONS = {'applica...
StarcoderdataPython
6659736
<reponame>cybertraining-dsc/test<filename>azure_cli.py from cloudmesh.common.Shell import Shell from textwrap import dedent from pprint import pprint class Provider(object): def __init__(self): self.debug = True def login(self): print("\nconnecting to azure...\n") r = Shell.live("az login") r = Shell.execu...
StarcoderdataPython
4976139
<filename>custom/onse/tasks.py import sys from concurrent.futures import ThreadPoolExecutor, as_completed from datetime import date, datetime from time import sleep from typing import Iterable, List, Optional, Tuple, Union from urllib.error import HTTPError import attr from celery.schedules import crontab from celery...
StarcoderdataPython
1951939
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2020, <NAME> & QuatroPe # License: BSD-3-Clause # Full Text: https://github.com/quatrope/djmpl/blob/master/LICENSE # ============================================================================= # DOCS # ==================================================...
StarcoderdataPython
1849666
<reponame>agilescientific/bruges<gh_stars>1-10 """ :copyright: 2015 Agile Geoscience :license: Apache 2.0 """ from .energy import energy from .discontinuity import discontinuity from .discontinuity import similarity from .dipsteer import dipsteer from .spectrogram import spectrogram from .spectraldecomp import spec...
StarcoderdataPython
9739540
<reponame>YEZHIAN1996/pythonstudy from PIL import Image image = Image.open('')
StarcoderdataPython
1727313
import os import pickle import time from functools import partial from typing import List, Optional, Dict, Tuple, Any, Callable import jax import jax.numpy as jnp import numpy as np import wandb from jax import jit, value_and_grad from jax.experimental.optimizers import adam, sgd from jax.tree_util import tree_leaves ...
StarcoderdataPython
1669801
from django.contrib import admin from ldap_login.models import * class UsersInline(admin.TabularInline): model = user; extra = 1; class userAdmin(admin.ModelAdmin): search_fields = ['username','fullname']; class groupAdmin(admin.ModelAdmin): inlines = [UsersInline]; admin.site.register(group); admin.si...
StarcoderdataPython
11351465
# Take a list of WARC files, containing video/mp4 content, extract one image from each. import argparse import base64 import hashlib import tempfile import os import sys from warcio.archiveiterator import ArchiveIterator from gluish.utils import shellout if __name__ == "__main__": parser = argparse.ArgumentParse...
StarcoderdataPython
8152731
<filename>cleanup_config.toml.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Lexicographically sort the nicknames in config.toml Dependencies: Python 3.4+ The toml package (python -m pip install toml) Example: Dry run in default location python cleanup_config.toml.py --dry-run Example: Overwrite config....
StarcoderdataPython
11319601
<filename>src/constants.py from typing import Final from options import FrameType DEBUG: bool = False FFMPEG_COMMAND: Final = 'ffmpeg -y -f concat -safe 0 -i {path_listfile} -i {path_audio} -c:v libx264 -c:a copy -vf fps={framerate},format=yuv420p -shortest -hide_banner {path_output}' FFMPEG_LOG_FILE: Final = "./ffm...
StarcoderdataPython
1984528
<filename>flaskee/core/environment.py """ The Flaskee is an Open Source project for Microservices. Develop By <NAME> | https://nadeengamage.com | <EMAIL> """ DEBUG = True SECRET_KEY = 'super-secret-key' SQLALCHEMY_TRACK_MODIFICATIONS=False SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:root@127.0.0.1:3306/flaskee' ...
StarcoderdataPython
6530388
# -*- coding: utf-8 -*- import os from . import CleoTestCase from cleo.terminal import Terminal class TerminalTest(CleoTestCase): def test_dimensions(self): os.environ['COLUMNS'] = '100' os.environ['LINES'] = '50' terminal = Terminal() self.assertEqual(100, terminal.width) ...
StarcoderdataPython
9747666
<gh_stars>1-10 import numpy as np import six import tensorflow as tf import tensorflow.keras.initializers as tfki import tensorflow.keras.layers as tfkl from tensorflow.python.keras.utils.generic_utils import serialize_keras_object, deserialize_keras_object from tensorflow.python.ops import variables as tf_variables f...
StarcoderdataPython
9770595
<gh_stars>1-10 DATACASH = 'SystemPay' VERSION = '0.0.1'
StarcoderdataPython
215915
from app.api.v2.managers.base_api_manager import BaseApiManager from app.objects.c_adversary import Adversary class AdversaryApiManager(BaseApiManager): def __init__(self, data_svc, file_svc): super().__init__(data_svc=data_svc, file_svc=file_svc) async def verify_adversary(self, adversary: Adversary...
StarcoderdataPython
4952911
<gh_stars>0 # -*- coding: utf-8 -*- """ # @file name : fusion_img.py # @author : JLChen # @date : 2020-03-11 # @brief : portrait数据集做前景 , coco数据集做背景 """ import numpy as np import os import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(BASE_DIR, '..')) import matpl...
StarcoderdataPython
122657
<reponame>gwangyi/pygritia """Pavement for Pygritia""" import shlex import sys import paver.doctools # pylint: disable=unused-import import paver.virtual # pylint: disable=unused-import from paver.easy import * # pylint: disable=unused-wildcard-import,wildcard-import from paver.options import Bunch from paver.path i...
StarcoderdataPython
11333273
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """classify.py Code to classify primer sets by predicted specificity (c) The James Hutton Institute 2018 Author: <NAME> Contact: <EMAIL> <NAME>, Information and Computing Sciences, James Hutton Institute, Errol Road, Invergowrie, Dundee, DD2 5DA, Scotland, UK The MIT ...
StarcoderdataPython
5059359
# Generated by Django 2.0.7 on 2018-08-19 14:41 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('notifications', '0001_initial'), ] operations = [ migrations.AlterModelOptions...
StarcoderdataPython
5182106
<reponame>jperez999/systems-1 # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # not...
StarcoderdataPython
1704066
import json from lambda_assistant.handlers.event_handler import EventHandler from lambda_assistant.errors import LambdaError, InternalServerError from lambda_assistant.response.headers import CORSHeaders from lambda_assistant.types import APIGatewayProxyResult def buildResponse(statusCode, headers: dict, body:...
StarcoderdataPython
6407951
# Generated by Django 2.2.7 on 2019-11-22 00:21 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('products', '0001_initial'), ] operations = [ migrations.CreateModel( name='...
StarcoderdataPython
226564
import inspect from copy import deepcopy from inspect import Parameter, Signature from typing import ( Any, Callable, Dict, Final, Mapping, Tuple, get_args, get_origin, ) from pydantic.tools import schema_of # FIXME: name and key seem to be the same??! _PACKAGE_NAME: Final = "ofs" # _...
StarcoderdataPython
9780241
<gh_stars>0 from flask import render_template,request,redirect,url_for,abort from . import main from flask_login import login_required,current_user from ..models import User,Pitch,Comment,Upvote,Downvote from .forms import UpdateProfile,PitchForm,CommentForm from .. import db import datetime @main.route('/') def index...
StarcoderdataPython
8181099
from pymodbus.interfaces import IModbusFramer import struct # Unit ID, Function Code BYTE_ORDER = '>' FRAME_HEADER = 'BB' # Transaction Id, Protocol ID, Length, Unit ID, Function Code SOCKET_FRAME_HEADER = BYTE_ORDER + 'HHH' + FRAME_HEADER # Function Code TLS_FRAME_HEADER = BYTE_ORDER + 'B' class ModbusFramer(IModb...
StarcoderdataPython
6655460
import mmcv import torch from copy import deepcopy from mmcv.parallel import collate, scatter from mmcv.runner import load_checkpoint from os import path as osp from mmdet3d.core import Box3DMode, show_result from mmdet3d.core.bbox import get_box_type from mmdet3d.datasets.pipelines import Compose from mmdet3d.models ...
StarcoderdataPython
3341977
<filename>Machine Learning Scientist with Python Track/11. Model Validation in Python/ch4_exercises.py # Exercise_1 #1 # Review the parameters of rfr print(rfr.get_params()) #2 # Review the parameters of rfr print(rfr.get_params()) # Maximum Depth max_depth = [4, 8, 12] # Minimum samples for a split min_samples_spli...
StarcoderdataPython
8038452
<gh_stars>0 class Solution: def deleteNode(self, node): node.val = node.next.val node.next = node.next.next
StarcoderdataPython
11278589
import pathlib def cache(string): with open(pathlib.Path() / "tests" / "test_bot" / ".cache", "a") as cache: cache.write(f"{string}\n")
StarcoderdataPython
9787465
import random print('this is a dice rolling simulator'.upper()) x = 'y' while x == 'y': number = random.randint(1, 6) if number == 1: print("---------") print('| |') print('| 0 |') print('| |') print("---------") elif number == 2: ...
StarcoderdataPython
4824885
<reponame>andocoyote/AndoEconAPIs<filename>MaximumRevenue/__init__.py from ..Common import Calculations as calc import json import logging import sympy import azure.functions as func def main(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') symbol...
StarcoderdataPython
9744397
from __future__ import absolute_import import os from celery import Celery from django.conf import settings os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'example.settings') app = Celery('example', broker=settings.BROKER_URL) app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
StarcoderdataPython
9635684
from django.urls import path from .views import CreateUser, Me, get_csrf, login_set_cookie, login_view, logout_view app_name = 'user' urlpatterns = [ path('login_set_cookie', login_set_cookie, name='login_set_cookie'), path('get_csrf', get_csrf, name='get_csrf'), path('login', login_view, name='login'), ...
StarcoderdataPython
8023624
<filename>src/django_globals/__init__.py import threading globals = threading.local()
StarcoderdataPython
146001
# -*- coding: utf-8 -*- # # Copyright 2018-2020 Data61, CSIRO # # 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 applicabl...
StarcoderdataPython
9724877
<reponame>Crashillo/CatAtom2Osm import os from qgis.core import QgsFeature, QgsField, QgsFields from qgis.PyQt.QtCore import QVariant from catatom2osm.geo.geometry import Geometry from catatom2osm.geo.layer.base import BaseLayer from catatom2osm.geo.types import WKBPoint class DebugWriter: """A QgsVectorFileWri...
StarcoderdataPython
1632613
import json import os import threading from os.path import exists, join from typing import List, Optional, Callable, Dict from entity import Item, from_dict from tool4log import logger from tool4time import now_str def load_data(filename): with open(filename, "r", encoding="utf8") as f: return json.load(...
StarcoderdataPython
5092649
<filename>csv2json.py import csv, json, sys csvFilePath = sys.argv[1] jsonFilePath = sys.argv[2] data = {} with open(csvFilePath) as csvFile: csvReader = csv.DictReader(csvFile) for rows in csvReader: id_ = rows['id'] data[id_] = rows with open(jsonFilePath, 'w') as jsonFile: jsonFile.wri...
StarcoderdataPython
3485642
""" Test query of case recorder file. """ import glob import os.path import unittest from math import isnan from openmdao.main.api import Assembly, Component, VariableTree, set_as_top from openmdao.main.datatypes.api import Array, Float, VarTree from openmdao.lib.casehandlers.api import CaseDataset, \ ...
StarcoderdataPython
6623623
<reponame>hvnobug/stock # -*-coding=utf-8-*- __author__ = 'Rocky' ''' http://30daydo.com Contact: <EMAIL> ''' ''' 记录每天的盈亏情况 完成度100% ''' import pandas as pd import os import tushare as ts import datetime def getCodeFromExcel(filename): #从excel表中获取代码, 并且补充前面几位000 #获取股票数目 df=pd.read_excel(filename) code_l...
StarcoderdataPython
328882
######################################################################### # # # Grupo Developers # # # # GNU Gen...
StarcoderdataPython
3353183
import math import pickle import torch from torch.utils import data from tensorfn import load_arg_config from tqdm import tqdm import lmdb from torch_imputer import best_alignment from config import CTCASR from dataset import ASRDataset, collate_data from model import Transformer from evaluate import ctc_decode de...
StarcoderdataPython
153330
<reponame>alex4acre/ab-python<filename>main.py #!/usr/bin/env python3 # MIT License # # Copyright (c) 2021 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, inclu...
StarcoderdataPython
106723
import os import json from pathlib import Path import pem from Crypto.PublicKey import RSA from jupyterhub.handlers import BaseHandler from illumidesk.authenticators.utils import LTIUtils from illumidesk.lti13.auth import get_jwk from tornado import web from urllib.parse import urlencode from urllib.parse import ...
StarcoderdataPython
93287
<reponame>Xeratec/crazyflie-stepStabilizer #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # vicon_wrapper.py # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # Copyright (C) 2021 ETH Zurich # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. ...
StarcoderdataPython
3594622
<reponame>bluesky0960/AlgorithmTest<filename>AlgorithmTest/BOJ_STEP_PYTHON/Step2/BOJ14681.py #https://www.acmicpc.net/problem/14681 x = int(input()) y = int(input()) if(x>0 and y>0) : print(1) elif(x>0 and y<0): print(4) elif(x<0 and y<0): print(3) else: print(2)
StarcoderdataPython
8077701
# coding: utf-8 from apiclient.discovery import build from apiclient.http import MediaIoBaseDownload from httplib2 import Http from oauth2client import file, client, tools import io,os from re import match store = file.Storage('token.json') creds = store.get() service = build(serviceName='drive', version='v3', htt...
StarcoderdataPython
204931
# -*- coding: utf-8 -*- """ Pipe Catalogue Data - Single Steel Pipe by LOGSTOR Created on Mon Nov 2 20:14:25 2020 @author: <NAME>, PhD References: [1] LOGSTOR, Product Catalogue Version 2018.12. https://www.logstor.com/media/6115/product-catalogue-uk-201812.pdf """ def LayerDiameters(DN,IS): ...
StarcoderdataPython
1831965
from trainerhost.trainerhostSlack import TrainerHost if __name__ == "__main__": trainer_host = TrainerHost()
StarcoderdataPython
3309316
class RingBuffer: def __init__(self, capacity): self.capacity = capacity self.list = [] self.to_be_popped = 0 # Keeps track of the oldest index def append(self, item): if len(self.list) < self.capacity: self.list.append(item) else: self.list.pop...
StarcoderdataPython
8135211
<filename>mne/tests/test_event.py import os import os.path as op from numpy.testing import assert_array_almost_equal import mne fname = op.join(op.dirname(__file__), '..', 'fiff', 'tests', 'data', 'test-eve.fif') def test_io_cov(): """Test IO for noise covariance matrices """ events = ...
StarcoderdataPython
293683
## ========================================================= ## nsl/go/utils.py ## --------------------------------------------------------- import sys import os from nsl.go.__about__ import __version__ from nsl.go import gotypes ## ========================================================= ## Version ## ------------...
StarcoderdataPython
4817963
<gh_stars>1-10 # # 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");...
StarcoderdataPython
6703959
<reponame>bopopescu/webrtc-streaming-node #!/usr/bin/env python # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant ...
StarcoderdataPython
11291448
<gh_stars>0 import logging from natcap.invest.ui import inputs, model from natcap.invest import pollination, MODEL_METADATA LOGGER = logging.getLogger(__name__) class Pollination(model.InVESTModel): def __init__(self): model.InVESTModel.__init__( self, label=MODEL_METADATA['polli...
StarcoderdataPython
60060
from django.contrib import admin from .models import Profile # Register your models here. class ProfileAdmin(admin.ModelAdmin): class Meta: fields = '__all__' admin.site.register(Profile, ProfileAdmin)
StarcoderdataPython
11313708
# No unittest
StarcoderdataPython
11262189
<gh_stars>0 from django.conf.urls import url from . import views urlpatterns = [ url(r'^apps/$', views.apps_list,name="apps_list"), url(r'^apps/model/$', views.apps_model,name="apps_model"), url(r'^apps/run/$', views.ansible_run,name="ansible_run"), url(r'^apps/log/$', views.ansible_log,name="a...
StarcoderdataPython
4862021
import soundfile as sf import sounddevice as sd from scipy.io.wavfile import write def record_voice(): """This function records your voice and saves the output as .wav file.""" fs = 44100 # Sample rate seconds = 3 # Duration of recording # sd.default.device = "Built-in Audio" # Speakers full name h...
StarcoderdataPython
3406046
from __future__ import unicode_literals from django.apps import AppConfig class CeleryExampleConfig(AppConfig): name = 'celery_example'
StarcoderdataPython
5076646
<filename>cap_5/exercicios/5.1.py<gh_stars>1-10 # Testes Condicionais: Escreva uma série de testes condicionais. Exiba uma frase que descreva o teste e o resultado prevsito para cada um. Seu código deverá # ser semelhante a: Crie pelo menos 10 testes. Tenha no mínimo 5 testes avaliados como True e outros cinco avaliado...
StarcoderdataPython
11341002
"""Longer tests for simplifier module """ # pylint: disable=relative-import import unittest import os from sspam import simplifier from templates import SimplifierTest class TestSimplifierLong(SimplifierTest): """ Longer tests for simplifier module. """ def test_long_basics(self): 'Long bas...
StarcoderdataPython