id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
4842551 | # Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def reverseBetween(self, head, m, n):
"""
:type head: ListNode
:type m: int
:type n: int
:rtype: ListNode
... | StarcoderdataPython |
116315 | __author__ = 'kunal'
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
data = pd.read_csv('../data/train.csv', header=0)
rows = len(data.axes[0])
data = pd.crosstab(data.Category, data.Resolution)
heat_map = sns.heatmap(data, square=True, linewidths=1, label='tiny')
plt.show()
| StarcoderdataPython |
3291358 | class Output:
def show(self, response):
print('RESPONSE: ', response.text)
| StarcoderdataPython |
126639 | from connection import api_client
username = 'something'
password = '<PASSWORD>'
carrier_id = '12356'
tnas_connection = api_client.TNASConnection(api_client.TNAS_TEST)
tnas_connection.login(username=username, password=password, carrier_id=carrier_id)
| StarcoderdataPython |
1749617 | # Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Test audit RBAC."""
import copy
from os.path import abspath
from os.path import dirname
from os.path import join
from collections import defaultdict
from appengine import base
from ggrc import app # no... | StarcoderdataPython |
1603569 | <filename>leetcode/reporter.py
import prettytable as pt
import time
import traceback
from threading import Timer
def time_limit(interval):
# From: https://blog.csdn.net/Homewm/article/details/92127567
def wraps(func):
def time_out():
raise TimeoutError()
def deco(*args... | StarcoderdataPython |
190697 | from marshmallow import Schema
from marshmallow.fields import Nested, Raw, Str
from document.algorithm.catalog import Algorithm_Catalog_Document
from document.algorithm.instance import Algorithm_Instance_Document
from schema.base import Base_Schema
from schema.validate import In, Unique_List
class Algorithm_Instance... | StarcoderdataPython |
4804449 | <gh_stars>0
# encoding: utf-8
from __future__ import unicode_literals, absolute_import
import os
import json
from .. import common
common.INSTALLED_APPS += (
'corsheaders',
)
common.MIDDLEWARE.insert(0, 'corsheaders.middleware.CorsMiddleware')
CORS_ORIGIN_WHITELIST = json.loads(os.environ.get('CORS_ORIGIN_WHITE... | StarcoderdataPython |
81642 | from traceback import print_exc
from aiogram import types
from aiogram.dispatcher import FSMContext
from loader import dp, bot
from states import Request
from keyboards import create_kb_coustom_main_menu
from utils import get_data_to_show
# from create_request.py
@dp.callback_query_handler(state=Request.operation_ty... | StarcoderdataPython |
1619160 | import unittest
from day16.day16 import Day16
class Day16Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
moves = ['s1', 'x3/4', 'pe/b']
cls.day16 = Day16(','.join(moves), 5)
def test_part_one(self):
self.assertEqual('baedc', self.day16.solve_part_one())
def test_p... | StarcoderdataPython |
125513 | <reponame>Discover304/MMDetection3D-Explainable
# Copyright (c) OpenMMLab. All rights reserved.
from mmdet.models.necks.fpn import FPN
from .second_fpn import SECONDFPN
__all__ = [
'FPN', 'SECONDFPN'
]
| StarcoderdataPython |
1713100 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import opportunities.validators
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('opportunities', '0017_auto_20160223_2301'),
]
operations = [
m... | StarcoderdataPython |
3307175 | # -*- coding:utf-8 -*-
'''
/**
* This is the solution of No.42 problem in the LeetCode,
* the website of the problem is as follow:
* https://leetcode-cn.com/problems/trapping-rain-water/
* <p>
* The description of problem is as follow:
* ============================================================================... | StarcoderdataPython |
3317208 | <filename>testData/wrappers_storage/bio/bismark/bismark/wrapper.py
"""Snakemake wrapper for aligning methylation BS-Seq data using Bismark."""
# https://github.com/FelixKrueger/Bismark/blob/master/bismark
__author__ = "<NAME>"
__copyright__ = "Copyright (c) 2019 JetBrains"
__email__ = "<EMAIL>"
__license__ = "MIT"
im... | StarcoderdataPython |
1714625 | <gh_stars>0
import unittest
from intcode import Intcode
import main
class TestIntCode(unittest.TestCase):
def test_get_modes(self):
compiler = Intcode()
self.assertEqual(compiler.get_mode_parameters(1),[0,0,0])
if __name__ == '__main__':
unittest.main() | StarcoderdataPython |
1765600 | <gh_stars>0
import gym
from simglucose.simulation.env import T1DSimEnv
from simglucose.controller.basal_bolus_ctrller import BBController
from simglucose.sensor.cgm import CGMSensor
from simglucose.actuator.pump import InsulinPump
from simglucose.patient.t1dpatient import T1DPatient
from simglucose.simulation.scenario_... | StarcoderdataPython |
43472 | <reponame>ifigueroap/hdptest
import setuptools
setuptools.setup(
name='hdptest',
version='0.3',
scripts=[],
author="<NAME>",
author_email="<EMAIL>",
description="Mecanismo simple para tests en Jupyter Notebooks",
url="https://github.com/ifigueroap/hdptest",
packages=setuptools.find_pack... | StarcoderdataPython |
118723 | from pybunpro import StudyQueueSchema
class TestStudyQueueSchema(object):
def test_dump(self, study_queue, study_queue_dict):
schema = StudyQueueSchema()
result, errors = schema.dump(study_queue)
assert errors == dict()
assert result == study_queue_dict
def test_load(self, s... | StarcoderdataPython |
144044 | <filename>iclientpy/test/viz/test_abstractmap.py<gh_stars>10-100
from unittest import TestCase, mock
from iclientpy import AbstractMap
class AbstractMapTestCase(TestCase):
def test_compute_bounds(self):
data = [[1, 2, 3], [4, 5, 6]]
lat_key = lambda d: d[0]
lng_key = lambda d: d[1]... | StarcoderdataPython |
3223305 | # The module named xmodule has one function and one dictionary:
def greeting(name):
print("Hello, " + name)
person1 = {
"name": "John",
"age": 36,
"country": "Norway"
} | StarcoderdataPython |
141045 | <filename>svr/services/provider.py
from injector import provider
class ItemsProvider(object):
def __init__(self, items: list = []):
self._items = items
@provider
def get(self, number_of_items: int = 5) -> list:
if not self._items:
return []
if number_of_items > len(se... | StarcoderdataPython |
4833105 | import turtle,random
w = turtle.Screen()
t = turtle.Turtle()
t.color("green")
numNivel = 13
largoRama = 120
angulo = 17
def cambioColor():
colors=['blue' , 'red', 'orange', 'purple']
t.pencolor(random.choice(colors))
def dibujaArbol(largoRama, Nivel):
cambioColor()
width = t.width() ... | StarcoderdataPython |
1754643 | <gh_stars>0
# default_exp core
get_ipython().run_line_magic("load_ext", " autoreload")
get_ipython().run_line_magic("autoreload", " 2")
#hide
from nbdev.showdoc import *
#export
import numpy as np
import numpy.linalg as npla
from typing import Tuple
def npmaxabs(arr: np.ndarray) -> float:
return np.max(np.ab... | StarcoderdataPython |
1701356 | <gh_stars>0
# Generated by Django 2.0.1 on 2018-03-15 16:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(... | StarcoderdataPython |
53282 | import os,sys
from os import walk
path='C:\\Users\\PUJITHA\\AppData\\Local\\Programs\\Python\\Python36\\Timestamps'
dirs=os.listdir(path)
print("list of all the contetnts in the TimeStamps Library ")
print(dirs)
# Adding the directory contents in list data structure
f = []
for (filenames) in walk(path):
... | StarcoderdataPython |
3271074 | <reponame>groboclown/petronia
"""
Helps module-based bootstrap implementations.
"""
from typing import Callable, Optional
from .dispose import setup_dispose_handler
from .listener_set import ListenerSet
from ...base import (
SingletonId,
ComponentId,
EventBus,
)
def create_module_listener_helper(
... | StarcoderdataPython |
1700990 | import json
import pathlib
import re
from copy import deepcopy
"""
Don't remove any functions from here for posterity reasons.
"""
def fix_availability(json_object, new_json_object):
"""
Recursively look for json objects with an availability property that's a string.
Split that property into three new p... | StarcoderdataPython |
168493 | # Forma procedural de criar uma conta
def cria_conta(numero, titular, saldo, limite):
'''
-> Cria uma conta bancária
:param numero: número da conta bancária (string)
:param titular: nome do titular (string)
:param saldo: saldo inicial da conta (float)
:param limite: limite de saldo da conta (flo... | StarcoderdataPython |
3276260 | from citywok_ms.supplier.models import Supplier
from flask_wtf import FlaskForm
from wtforms import HiddenField, StringField, SubmitField, TextAreaField
from wtforms.fields.html5 import EmailField, IntegerField, TelField
from wtforms.validators import Email, InputRequired, Optional, ValidationError
from flask_babel imp... | StarcoderdataPython |
1684784 | # coding=utf-8
# Copyright 2022 The Robustness Metrics 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 required by appli... | StarcoderdataPython |
3201818 | <gh_stars>1-10
from unittest import TestCase
import httpretty
from click.testing import CliRunner
from arcsecond import cli
from arcsecond.api.error import ArcsecondError
from arcsecond.config import config_file_clear_section
from tests.utils import make_successful_login, mock_http_get, mock_http_post
class Dataset... | StarcoderdataPython |
3238524 | <gh_stars>0
import numpy as np
import unittest
import os
from openmdao.api import Problem, IndepVarComp
from openmdao.api import DirectSolver, BoundsEnforceLS, NewtonSolver
from openmdao.utils.assert_utils import assert_rel_error
from pycycle.elements.compressor_map import CompressorMap
from pycycle.maps.axi5 import... | StarcoderdataPython |
3322110 | <reponame>morgulbrut/obike
# coding: utf-8
import requests
import subprocess
import pandas as pd
import time
import random
from pprint import pprint
#import progressbar
from pygeocoder import Geocoder
import numpy as np
from geopandas import GeoDataFrame
from shapely.geometry import Point
date = time.strftime("%Y-%m-... | StarcoderdataPython |
1764582 | import numpy as np
import cv2
EDGES = [
[16, 14],
[14, 12],
[17, 15],
[15, 13],
[12, 13],
[6, 12],
[7, 13],
[6, 7],
[6, 8],
[7, 9],
[8, 10],
[9, 11],
[2, 3],
[1, 2],
[1, 3],
[2, 4],
[3, 5],
[4, 6],
[5, 7]
]
EC = [
(255, 0... | StarcoderdataPython |
133888 | #!/usr/bin/env python
from __future__ import print_function
import numpy as np
def autostring(num, prec=0, zero=False, set_printoptions=False, pp=False, join=False, joinall=False, sep=' '):
"""
Format number (array) with given decimal precision.
Definition
----------
def autostrin... | StarcoderdataPython |
109348 | <reponame>geo7/scientific-visualization-book<filename>code/showcases/text-shadow.py
# ----------------------------------------------------------------------------
# Title: Scientific Visualisation - Python & Matplotlib
# Author: <NAME>
# License: BSD
# ----------------------------------------------------------------... | StarcoderdataPython |
3328878 | ##########################################################################
## Prediction Package Tests
##########################################################################
# to execute tests, run from *project* root. This runs all test packages
# (this one and any other in the /tests folder)
#
# nosetests --ve... | StarcoderdataPython |
3297929 | class SimonSays(object):
"""Represents the the simon says module"""
def __init__(self, bomb):
super(SimonSays, self).__init__()
self.bomb = bomb
self.valid_colors = ['red', 'blue', 'green', 'yellow']
self.light_sequence = []
self.push_sequence = []
if bomb.chec... | StarcoderdataPython |
191253 | b=[9,6,3,2,5,8,7,4,1,0]
def selection_sort(b):
for i in range((len(b))-1):
min = b[i]
for j in range(i + 1, len(b)):
if b[j] < min:
min = b[j]
pos=j
b[pos] = b[i]
b[i]=min
print(b)
selection_sort(b)
pri... | StarcoderdataPython |
1766803 | import sys
import signal
import click
import brownie
import math
from brownie import (
VaultCore,
SperaxTokenL2,
USDsL2,
network,
Contract,
accounts
)
def signal_handler(signal, frame):
sys.exit(0)
def main():
# handle ctrl-C event
signal.signal(signal.SIGINT, signal_handler)
... | StarcoderdataPython |
3360220 | <gh_stars>0
# Imports
import os
import importlib
import numpy as np
import pandas as pd
import rasterio as ro
import geopandas as gpd
import rioxarray as rxr
import shapely.geometry as sg
from glob import glob
from rasterio.merge import merge
#---------------------------------------#
"""DataFrame utilities"""
# Concat... | StarcoderdataPython |
177366 | """
One of the most enjoyable hard questions on Leetcode.
A really hard problem until you break it down into smaller subproblems
"""
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
def maxPathSum(root: TreeNode) -> int:... | StarcoderdataPython |
57379 | from shaape.parser import Parser
import nose
import unittest
from nose.tools import *
class TestParser(unittest.TestCase):
def test_init(self):
parser = Parser()
assert parser != None
assert parser.parsed_data() == []
assert parser.drawable_objects() == []
def test_run(self):
... | StarcoderdataPython |
3302990 | # vim:ts=4:sts=4:sw=4:expandtab
from django.db import models
from satori.core.dbev import Events
from satori.core.models import Entity
@ExportModel
class Printer(Entity):
"""Model. A Printer.
"""
parent_entity = models.OneToOneField(Entity, parent_link=True, related_name='cast_printer')
name ... | StarcoderdataPython |
3358598 | # Generated by Django 3.1.5 on 2021-04-12 15:03
import core.shortcuts
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import functools
class Migration(migrations.Migration):
initial = True
dependencies = [
]
opera... | StarcoderdataPython |
1774003 | from django.contrib.auth.models import User
from django.core.mail import EmailMessage
from api.helper import json_response, json_error_response, json_400_incorrect_use
from api.sms import send_sms
from api.utils import parse_iso, random_letters, random_digits
from customer.sql import get_ranking_results
from employee.... | StarcoderdataPython |
115602 | n=int(input())
l=[]
k=[]
e=[]
for i in range (n):
t=input()
l.append(t)
print(l)
for j in l:
if j not in k:
k.append(j)
print(k)
print(len(k))
for m in range(len(k)):
c=0
for d in l:
if( k[m]==d):
c=c+1
e.append(c)
print(e)
for i in e:
... | StarcoderdataPython |
3347567 | import time
class archivo:
#creación de una clase para guardar los atributos de cada archivo
ubicacion=0
def __init__(self,arch,descr,modo,longitud,datos):
self.arch=arch
self.descr=descr
self.modo=modo
self.datos=datos
self.longitud=len(datos)
#Función... | StarcoderdataPython |
1638471 | <reponame>rcrowther/django-image
from django.test import TestCase
from django.core.management.base import CommandError
from image.management.commands import common
from test_image.models import TestImage, TestReform
# ./manage.py test image.tests.test_commands
class TestCommands(TestCase):
def options(self, path... | StarcoderdataPython |
3338968 | <gh_stars>1-10
from Include.Pattern import *
import math
class SolidPattern(Pattern):
def __init__(self, color: Color):
self.a = color
def pattern_at(self, point: Tuple):
return self.a | StarcoderdataPython |
3361208 | <reponame>Siwick-Research-Group/website<filename>deploy.py
# -*- coding: utf-8 -*-
"""
Script that updates the Siwick Research Group website. Modify the files for the
website in the 'website' folder first. See script help:
>>> python deploy.py --help
You will need to know the Siwick research group's CPM server p... | StarcoderdataPython |
1679684 | <gh_stars>1-10
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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 t... | StarcoderdataPython |
150825 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 8 19:20:13 2018
@author: kejintao
input information:
1. demand patterns (on minutes)
2. demand databases
3. drivers' working schedule (online/offline time)
** All the inputs are obtained from env, thus we do not need to alter parameters here
"""
from path import *
imp... | StarcoderdataPython |
1741028 | <reponame>uvicore/framework
import pytest
import uvicore
from uvicore.support.dumper import dump
from tests.seeders import seed_post8
@pytest.mark.asyncio
async def test_single(app1, client):
# Delete single item by /{id} in url
from app1.models import Post
# Create a temp post we can delete
await se... | StarcoderdataPython |
44412 | import re
from typing import List
from .consts import *
# =================== #
# INTERNALS FUNCTIONS #
# =================== #
def my_re_escape(text):
escape_char = r"[]"
returned_text = ""
for c in text:
if c in escape_char:
returned_text += "\\"
returned_text += c
retur... | StarcoderdataPython |
104394 | <filename>jqfpy/tests/test_get.py
import unittest
class GetTests(unittest.TestCase):
def _makeOne(self, d):
from jqfpy import Getter
return Getter(d)
def test_get(self):
d = {
"person": {
"name": "foo",
"age": 20,
"skills": ... | StarcoderdataPython |
109486 | <filename>grapher_admin/migrations/0044_auto_20180310_1851.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-03-10 18:51
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration)... | StarcoderdataPython |
131899 | <gh_stars>1-10
from __future__ import annotations
from typing import List
from command_line import ComplexCommand, command, subcommand, WorldMode
from api.world_loader import loader
from api.errors import (
FormatError,
FormatLoaderInvalidFormat,
FormatLoaderMismatched,
FormatLoaderNoneMatched,
)
... | StarcoderdataPython |
44171 | # Time: O(1)
# Space: O(n)
from random import randint
class RandomizedSet(object):
def __init__(self):
"""
Initialize your data structure here.
"""
self.__set = []
self.__used = {}
def insert(self, val):
"""
Inserts a value to the set. Returns true i... | StarcoderdataPython |
158831 | <filename>artcase_proj/artcase/urls.py
from django.conf.urls import url
from .models import (
Work,
Creator,
Location,
Image,
Medium,
Category,
Collection,
)
from .views import (
IndexView,
ArtcaseDetailView,
ArtcaseListView,
ArtcaseCreateView,
ArtcaseUpdateView,
Artc... | StarcoderdataPython |
3322215 | <reponame>coloHsq/Netbox_API-Auth_Plugin<filename>auth_api/api/views.py
from django.contrib.auth import authenticate
from rest_framework import parsers, renderers
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.exceptions import AuthenticationFailed
from rest_framework.response import Res... | StarcoderdataPython |
141906 | <filename>cogs/bot.py
# invite : https://discord.com/api/oauth2/authorize?client_id=783979068840083476&permissions=388160&scope=bot
import discord, decimal
from discord.ext import commands
class BotMain(commands.Cog):
"""
Bot's initial commands.
"""
def __init__(self, bot):
self.bot = bot
... | StarcoderdataPython |
3331351 | <reponame>mjcjiang/clickhouse-storage-refactor
#-------------------------------------------------------------------------------
# Author: hjiang
# Email: <EMAIL>
# Time: Thu Nov 18 13:38:51 2021
#-------------------------------------------------------------------------------
from DataPlatForm.configs import *
import Da... | StarcoderdataPython |
2818 | <filename>tensorflow_probability/python/build_defs.bzl
# Copyright 2019 The TensorFlow Probability 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/licen... | StarcoderdataPython |
1741380 | <filename>1 - EstruturaSequencial/ex_12.py
"""
12 -> Tendo como dados de entrada a altura de uma pessoa, construa um algoritmo que calcule
seu peso ideal, usando a seguinte fórmula: (72.7*altura) - 58
"""
while True:
h = input('Digíte sua altura: ')
try:
h = float(h)
peso = 72.7 * h - 58
... | StarcoderdataPython |
1653212 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, DigiThinkIT, Inc. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('AuthorizeNet Request')
class TestAuthorizeNetRequest(unittest.TestCase):
pass
| StarcoderdataPython |
1657209 | <reponame>saidulislam/building-a-saas-app
from flask import (
Blueprint,
flash,
redirect,
request,
url_for,
render_template)
from snakeeyes.blueprints.feedback.forms import FeedbackForm
feedback = Blueprint('feedback', __name__, template_folder='templates')
@feedback.route('/feedback', metho... | StarcoderdataPython |
1783862 | <gh_stars>1-10
#!/usr/local/bin/python3.6
# -*- coding: utf-8 -*-
"""
PubMed-API Unofficial API
[Search|Export|Download] research papers from [pubmed] and export results in csv file.
@author <NAME>
USAGE:
pubmed.py [-h] [-a AUTHOR] [-k [KEYWORDS]] [-o {AND,OR,NOT}]
[-ko {AND,OR,NOT}] [-d DATE] [-f F... | StarcoderdataPython |
3351399 | import logging
import datetime
import geocoder
import telegram
import configparser
from peewee import *
config = configparser.RawConfigParser()
config.read('config.ini')
db = SqliteDatabase(config['main']['DATABASE_PATH'])
logger = logging.getLogger()
class BaseModel(Model):
class Meta:
database = db
d... | StarcoderdataPython |
4803085 | <filename>exe11.py
print('How old are you?', end=' ')
age = input()
print('How tall are you?', end=' ')
height = input()
print('How much do you weigh?', end=' ')
weight = input()
print('So, you are %r old, %r tall and %r heavy.' % (age, height, weight))
# --Output--
# How old are you? 38
# How tall are you? 6'2"
# Ho... | StarcoderdataPython |
3211410 | <reponame>Harsh14901/ProfCourse_review_portal<filename>rate/migrations/0001_initial.py<gh_stars>0
# Generated by Django 3.0.4 on 2020-03-19 13:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
opera... | StarcoderdataPython |
4833482 | """
Running the test code
"""
def sample():
return
| StarcoderdataPython |
3210078 | <filename>feeds/create_workspace_activity_feed_test.py
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | StarcoderdataPython |
3340561 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lice... | StarcoderdataPython |
1648571 | '''
This is a implementation of Quantum State Tomography for Qutrits,
using techniques of following papars.
'Iterative algorithm for reconstruction of entangled states(10.1103/PhysRevA.63.040303)'
'Diluted maximum-likelihood algorithm for quantum tomography(10.1103/PhysRevA.75.042108)'
'Qudit Quantum State Tomography(... | StarcoderdataPython |
3215448 | #app/main.py
#Imports
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn
from app import db, ml, viz, locations, location
#Edit your app's title and description. See [https://fastapi.tiangolo.com/tutorial/metadata/](https://fastapi.tiangolo.com/tutorial/met... | StarcoderdataPython |
1644189 | <reponame>bryan-brancotte/rank-aggregation-with-ties
from django.contrib import admin
class JobAdmin(admin.ModelAdmin):
list_display = ('owner', 'dist', 'norm', 'creation', 'bench', 'identifier', 'task_count', 'status')
list_filter = ('owner', 'dist', 'norm', 'creation', 'bench', 'identifier', 'status')
| StarcoderdataPython |
3333837 | from _struct import *
from _struct import _clearcache
from _struct import __doc__
| StarcoderdataPython |
1730140 | """This program chains together perfectbam, alindel, alindel_plot and misplot to do a complete analysis of an
aligned BAM file"""
import os
import subprocess
import click
@click.command()
@click.version_option()
@click.argument('inbam', type=click.Path(exists=True))
@click.argument('gdb', type=click.Path(exists=True... | StarcoderdataPython |
3327971 | from setuptools import setup, find_packages
requires = []
setup(
name='ovspy',
version='0.1.0b2',
description='Open vSwitch Mnipulation Library',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
url='https://github.com/kamaboko123/ovspy',
author='ka... | StarcoderdataPython |
3385800 | from sightpy import *
# define materials to use
blue_glass = Refractive(n = vec3(1.5 + 4e-8j,1.5 + 4e-8j,1.5 + 0.j)) # n = index of refraction
green_glass = Refractive(n = vec3(1.5 + 4e-8j,1.5 + 0.j,1.5 + 4e-8j))
red_glass = Refractive(n = vec3(1.5 + 0.j,1.5 + 5e-8j,1.5 + 5e-8j))
floor = Glossy(diff_co... | StarcoderdataPython |
3247052 | def build_nn(params):
seq_length, vocabulary_size, layers, embedding_dim, upside_dim, downside_dim, lr, dropout = \
params['seq_length'], params['vocabulary_size'], params['layers'], params['embedding_dim'], params['upside_dim'], params['downside_dim'], params['lr'], params['dropout']
from tensorflow.k... | StarcoderdataPython |
147603 | <gh_stars>0
from abc import (
ABC,
abstractmethod
)
import pytest
from httpx import (
AsyncClient,
Response
)
from starlette.datastructures import URLPath
from starlette.status import HTTP_302_FOUND
from ....base import BaseTestRouteCase
from ....mixins.response_and_client import ResponseAndClient
_... | StarcoderdataPython |
1728379 | <gh_stars>0
# 1. Diagonal Difference
# Write a program that finds the difference between the sums of the square matrix diagonals (absolute value).
N = int(input())
rows = N
cols = N
matrix = []
sum_primary = 0
sum_secondary = 0
counter = -1
for row in range(rows):
matrix.append([int(el) for el in input().split(... | StarcoderdataPython |
3345986 | from importlib import import_module
from framework import create_plugin
qiime = create_plugin("qiime",
"2.0.0-dev",
"QIIME development team",
"Quantitative Insights Into Microbial Ecology")
import_module('qiime_plugin.types')
import_module('qiime_plug... | StarcoderdataPython |
154251 | <gh_stars>0
# Divided OF two number
while True:
a = int(input("Enter The Dividend Number : "))
b = int(input("Enter The Divisor Number : "))
if a > b:
quotient = int(a / b)
print("Quotirnt Number Of :", quotient)
else:
Quotient = int(b / a)
print("Quotirnt Numb... | StarcoderdataPython |
1778936 | <filename>components/micropython/modules/sha2017_backup/appglue.py
import ugfx, esp, badge, deepsleep
def start_app(app, display = True):
if display:
ugfx.clear(ugfx.WHITE)
ugfx.string(0, 0, "Loading...", "PermanentMarker22", ugfx.BLACK)
if app:
ugfx.string(0, 25, "Starting "+a... | StarcoderdataPython |
38059 | <filename>muspinsim/experiment.py<gh_stars>0
"""experiment.py
Classes and functions to perform actual experiments"""
import logging
import numpy as np
import scipy.constants as cnst
from muspinsim.constants import MU_TAU
from muspinsim.utils import get_xy
from muspinsim.mpi import mpi_controller as mpi
from muspinsi... | StarcoderdataPython |
63368 | <gh_stars>1-10
import midi
import math
# note: sensible indexes here range from 0-255
def patch_bytes(length_index):
return 16 * length_index + 1
def patch_samples(length_index):
return patch_bytes(length_index) * 8
def phase_offset(length_index, target_frequency, playback_rate):
patch_delta = patch_samples(lengt... | StarcoderdataPython |
4808107 | <filename>src/components/aliyun_iotx/topic.py
# -*- coding: utf-8-*-
from src.config import profile as device
import logging
_logger = logging.getLogger()
def get_topic_name(topic_name='root', type='publish', is_shadow=False):
"""
返回一个topic自定义的topic类
:param topic_name:
:param type
:param is_shadow... | StarcoderdataPython |
4826612 | import discord
import datetime
from cosmos import exceptions
class ModerationAction(object):
def __init__(self, guild_profile, target, moderator, action_type, reason=None):
self.guild_profile = guild_profile
self.bot = self.guild_profile.plugin.bot
self.target = target
if self.ta... | StarcoderdataPython |
192468 | """Test general note linting."""
import logging
from pathlib import Path
from typing import TypedDict
from unittest.mock import PropertyMock
from click.testing import CliRunner
import pytest
from pytest_mock import MockFixture
from note_clerk import console, linting
from ._utils import inline_header, inline_note, pa... | StarcoderdataPython |
3232298 | <gh_stars>1000+
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup -------------------------------------------------------... | StarcoderdataPython |
3304048 | <filename>striped/common/bulk_data_transport.py
from striped.pythreader import Primitive, PyThread, Task, TaskQueue, synchronized
#import posix_ipc, mmap
import socket, time
import threading
from .dataEncoder import encodeData
from .DataExchange2 import to_bytes, to_str
_BUFSIZE = 10000000
class Forwarder(PyThread)... | StarcoderdataPython |
176224 | # Generated by Django 3.1 on 2021-01-06 15:33
import django.core.validators
import django.db.models.deletion
from django.db import migrations
from django.db import models
import common.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
("footnotes", "0001_initial"),
... | StarcoderdataPython |
196547 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub, actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | StarcoderdataPython |
28049 | <reponame>Arunkumar99/learners
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pupil', '0011_questions_set_id'),
]
operations = [
migrations.CreateModel(
name='... | StarcoderdataPython |
1720696 | <filename>LeetCode/spiral_order.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2018/11/13 21:46
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : <EMAI... | StarcoderdataPython |
3228926 | # coding:utf-8
# -- standard library ---------------------------------------------------------
import json
import unittest
# --Modules to test -----------------------------------------------------------
from VestaService.Report import WorkerReport, TaskReport
class UtilsTests(unittest.TestCase):
def test_Worke... | StarcoderdataPython |
3284848 | <filename>mamka/main.py
from Foundation import NSObject, NSAppleScript, NSTimer
from AppKit import NSApplication, NSApp, NSWorkspace
from Cocoa import NSEvent, NSKeyDownMask
from Quartz import CGWindowListCopyWindowInfo, kCGWindowListOptionOnScreenOnly, kCGNullWindowID
from PyObjCTools import AppHelper
from Quartz.Cor... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.