id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
6459110 | <filename>yandex-contest/training-backend/b.py
class Row:
def __init__(self, seats):
self.seats = seats
self.taken = None
self.side = None
def take(self, number, side, place):
if side == 'right':
seats = {'D', 'E', 'F'}
else:
seats = {'A', 'B', 'C... | StarcoderdataPython |
6685751 | from datetime import datetime
from enum import Enum
from typing import List, Optional
from pydantic import Field
from opennem.api.schema import ApiBase
from opennem.core.dispatch_type import DispatchType
from opennem.schema.network import NetworkNEM, NetworkSchema
from opennem.schema.opennem import OpennemBaseDataSch... | StarcoderdataPython |
5033342 | import glob
import itertools
import multiprocessing
import os
import shutil
import subprocess
import sys
import time
from parsable import parsable
import pomagma.atlas
import pomagma.cartographer
import pomagma.surveyor
import pomagma.theorist
import pomagma.util
from pomagma.util import DB, suggest_region_sizes
par... | StarcoderdataPython |
126732 | import sqlite3
conn = sqlite3.connect('northwind_small.sqlite3')
curs = conn.cursor()
# Question 1
q1 = curs.execute("""
SELECT ProductName, UnitPrice FROM Product
ORDER BY UnitPrice DESC
LIMIT 10;
""").fetchall()
print("The ten most expensive items (per unite price) in the database are: ", q1)
# Question 2
q2 = cur... | StarcoderdataPython |
1936040 | <reponame>uleague/universityleague-match-stats
"""
This module is mainly for dataclasses.
"""
from dataclasses import dataclass
from typing import List, Sequence, TypedDict, Dict, Union
from .exceptions import TournamentError
@dataclass
class MatchPlayer(TypedDict):
account_id: int
active_plus_subscription:... | StarcoderdataPython |
399410 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | StarcoderdataPython |
4932313 | <reponame>likeand/ml<filename>samples/logistic_regression.py
# -*- coding: utf-8 -*-
# @Date : 2020/5/24
# @Author: Luokun
# @Email : <EMAIL>
import sys
from os.path import dirname, abspath
import numpy as np
import matplotlib.pyplot as plt
sys.path.append(dirname(dirname(abspath(__file__))))
def test_logistic_re... | StarcoderdataPython |
6645473 | """
Greetings Chatbot
Author: <NAME>
Date: 09-14-20
"""
# This "bot" takes in the value of the users name using input(),
# Then responds with "Nice to meet you, {name}"
# Print function
# print("Hi, what's your name?")
# name = input()
# print("Nice to meet you",name)
# Concatenation
# print("Hi, wh... | StarcoderdataPython |
4938700 | <gh_stars>0
import logging
import os
import yaml
from galaxy.tools import GALAXY_LIB_TOOLS_UNVERSIONED
from galaxy.jobs import JobDestination
log = logging.getLogger(__name__)
CONTAINER_RULE_MAPPER_FILE = os.path.join(
os.path.dirname(__file__), 'container-mapper-rules.yml')
def _load_container_mappings():
... | StarcoderdataPython |
63496 | <filename>main.py
from model import unet
from keras.callbacks import ModelCheckpoint
from data import trainGenerator, geneTrainNpy,testGenerator,saveResult
# os.environ["CUDA_VISIBLE_DEVICES"] = "0"
data_gen_args = dict(rotation_range=0.2,
width_shift_range=0.05,
height_shift... | StarcoderdataPython |
6429600 |
#Importe de bibliotecas
from tkinter import *
from tkinter import ttk
from typing import ValuesView
#Declaração da janela
janela=Tk()
janela.title("Calculadora Tkinter - Matemática - IMC")
janela.geometry("510x500")
#Declaração das abas
aba=ttk.Notebook(janela)
aba.place(x=20,y=20, width=470, height=460)
#Variavel par... | StarcoderdataPython |
223291 | <reponame>ChoiZ/simple-python-scheduler
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
from random import shuffle
tracks_path = "/home/user/tracks_folder/"
separation_artist = 10
separation_title = 10
playlist_path = '/home/user/playlist_folder/playlist.m3u'
playlist_size = len(os.listdir(tracks_... | StarcoderdataPython |
5158137 | """Exercise doctests for all of our modules."""
from doctest import testmod
import pkgutil
import importlib
import zero_ex
def test_all_doctests():
"""Gather zero_ex.* modules and doctest them."""
for (_, modname, _) in pkgutil.walk_packages(
path=zero_ex.__path__, prefix="zero_ex."
):
m... | StarcoderdataPython |
11303279 | <reponame>waingram/code-embeddings<gh_stars>1-10
from setuptools import setup
setup(
name='code_embeddings',
version='',
packages=['code_embeddings'],
url='',
license='BSD-3-Clause',
author='<NAME>, <NAME>',
author_email='<EMAIL>, <EMAIL>',
description=''
)
| StarcoderdataPython |
3589418 | <filename>test/__init__.py<gh_stars>0
import sys
import unittest
from .common import * # noqa: F401, F403
if __name__ == '__main__':
unittest.main(argv=sys.argv)
| StarcoderdataPython |
134565 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | StarcoderdataPython |
3584838 | <gh_stars>0
def quickSort(list):
left = []
center = []
right = []
if len(list) > 1:
pivot = list[0]
for i in list:
if i < pivot:
left.append(i)
elif i == pivot:
center.append(i)
elif i > pivot:
right.appe... | StarcoderdataPython |
11205262 | <reponame>drunkwater/leetcode
# DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#330. Patching Array
#Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that... | StarcoderdataPython |
12806883 | import pandas as pd
import numpy as np
import re
## Different than what was expected, creating a unique for for every DF column
## performed a slower execution than having different fors for each DF column
def cleanInvalidDFEntries(id_key,stamp,actor_column,verb_column,object_column):
day = [] # Check which day ... | StarcoderdataPython |
5128713 | <reponame>lhalb/cura_g-code_converter
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def clear_data(path, start="M107", end='M82', cut=None):
"""
:param path: Pfad zur G-Code-Datei
:param start: Teilstring, der den Beginn der Daten markiert (wird übersprungen)
:param end: ... | StarcoderdataPython |
5007467 | __author__ = '<NAME> <<EMAIL>>'
__version__ = '1.0'
| StarcoderdataPython |
9799895 | #Test code 2. Extra code.
import cv2
import numpy as np
from pyzbar.pyzbar import decode
import time
import RPi.GPIO as GPIO
#Servo X axis
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT)
pwm= GPIO.PWM(7, 50)
obj = False
faceCascade = cv2.CascadeClassifier("/home/pi/Resources12/haarcascade_frontalface_default.xml")
c... | StarcoderdataPython |
1963462 | <filename>src/gripit/edgelib/curv_disc.py
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import cv2 as cv2
import numpy as np
import gripit... | StarcoderdataPython |
4905664 | import time
from typing import Any, Dict
from uuid import uuid4
import boto3
class StepFunctionsRunner:
def __init__(self, endpoint_url: str):
self.endpoint_url: str = endpoint_url
def run(self, definition: str, input_string: str) -> Dict[str, Any]:
sfn_client = boto3.client("stepfunctions",... | StarcoderdataPython |
6437369 |
import pygame
from pygame.sprite import Group, Sprite
from pygame.font import Font
from pygame.locals import *
import code
import os #for getting the path to current directory
import time #for getting the current time and date
import math #for doing some computation
#pygame
fr... | StarcoderdataPython |
4900012 | import cv2
face_cascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
img = cv2.imread("resize_new.jpg")
gray_img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray_img,
scaleFactor = 1.1,
minNeighbors = 5)
for x, y, w, h in faces:
img = cv2.rectangle(img, (x,y),(x+w... | StarcoderdataPython |
8115925 | <reponame>IshanManchanda/project-euler<gh_stars>0
def main():
primes = [2]
x = 3
while primes[-1] <= 2e6:
for p in primes:
if x % p == 0:
break
if p * p > x:
primes.append(x)
break
x += 1
print(sum(primes[:-1]))
main()
| StarcoderdataPython |
75867 | <reponame>marinakolova/Python-Courses
numbers = [int(n) for n in input().split(' ')]
n = len(numbers)
for i in range(n):
for j in range(0, n - i - 1):
if numbers[j] > numbers[j + 1]:
numbers[j], numbers[j + 1] = numbers[j + 1], numbers[j]
print(' '.join([str(n) for n in numbers])) | StarcoderdataPython |
5094197 | <gh_stars>1-10
from horus import resources
from pyramid.decorator import reify
from pyramid.interfaces import ILocation
from zope.interface import implementer
from h import api, models
@implementer(ILocation)
class BaseResource(resources.BaseFactory):
"""Base Resource class from which all resources are derived... | StarcoderdataPython |
3365995 | """
Contains the OSU4k class.
"""
import azcam
class OSU4k(object):
"""
Class definition of OSU4k customized commands.
These methods are called remotely through the command server with syntax such as:
osu4k.test 1.0 "some_text".
"""
def __init__(self):
"""
Creates osu4k tool.... | StarcoderdataPython |
11213706 | '''
Excel_4 main function
-Getting Rows & Columns from Sheet info Part 2
'''
from excel_source import *
work_book = openpyxl.load_workbook('excel_docs/example.xlsx')
work_book_sheet = work_book.active
print(next(work_book_sheet.columns))
# Updated solution aquired from:
# https://stackoverflow.com/questions/426... | StarcoderdataPython |
230339 | <gh_stars>0
################################################################
# File: __main__.py
# Title: MANGAdownloader
# Author: ASL97/ASL <<EMAIL>>
# Version: 4
# Notes : DON'T EMAIL ME UNLESS YOU NEED TO
# TODO: *blank*
################################################################
import threading
import scrape... | StarcoderdataPython |
6705459 | from math import sqrt
def is_square(n):
return n > 0 and sqrt(n).is_integer()
print(is_square(16))
print(is_square(15))
print(is_square(4))
| StarcoderdataPython |
3556197 | from typing import Optional
from pydantic import BaseModel
class TmpltBase(BaseModel):
filename: Optional[str] = None
class Tmplt(TmpltBase):
content: str
| StarcoderdataPython |
6459463 | from flasgger import Swagger
from flask import Flask
from maestro_api.db.mongo import init_db
from maestro_api.api_routes import init_api_routes
from maestro_api.frontend_routes import init_frontend_routes
from maestro_api.auth_routes import init_auth_routes
from maestro_api.monitoring import init_monitoring_routes
... | StarcoderdataPython |
162718 | # -*- coding: utf-8 -*-
import re
import os
from django.conf import settings
from django.shortcuts import redirect
from django.db.models import Q
from datetime import datetime, timedelta
from djobberbase.conf import settings as djobberbase_settings
def normalize_query(query_string,
findterms=re.co... | StarcoderdataPython |
1680392 | from __future__ import absolute_import, division, print_function
from collections import Iterable, defaultdict, deque
from functools import reduce
import numbers
import operator
import numpy as np
import scipy.sparse
try: # Windows compatibility
int = long
except NameError:
pass
class COO(object):
""... | StarcoderdataPython |
6450883 | <filename>bench/qensorbench/ordering_algo.py<gh_stars>10-100
import qtree
import networkx as nx
import sys
import glob
import numpy as np
from pathlib import Path
from qtensor import QtreeQAOAComposer
from qtensor.optimisation.Optimizer import OrderingOptimizer, TamakiOptimizer
from qtensor.optimisation.TensorNet impo... | StarcoderdataPython |
9793522 | <reponame>thornwishstalon/probable-liftoff-machine
from common.credentials import Config
from module.liftoff_module import LiftoffModule
from module.subscriber import SubscriberList
from common.event import EVENT_POST_TRIP_END, EventFactory, EVENT_PRE_TRIP_START, EVENT_POWER_UPDATE, \
EVENT_POWER_TRACK_DONE
import ... | StarcoderdataPython |
4868536 | # Generated by Django 3.0.6 on 2020-05-23 17:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20200523_2006'),
]
operations = [
migrations.RenameField(
model_name='school',
old_name='head',
... | StarcoderdataPython |
9691399 | import pygame
from pygame import mixer
import os
import random
import csv
mixer.init()
pygame.init()
SCREEN_WIDTH = 800
SCREEN_HEIGHT = int(SCREEN_WIDTH*0.8)
SCREEN = pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT))
pygame.display.set_caption('HALLOWEEN GAME')
#SET FRAME RATE
clock = pygame.tim... | StarcoderdataPython |
6608025 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="krinn", # Replace with your own username
version="0.0.1",
author="<NAME>",
author_email="<EMAIL>",
description="This module helps in getting the price or title of a product",
long_desc... | StarcoderdataPython |
1825522 | # -*- coding: utf-8 -*-
"""Command-line output
Contains most functions, classes, etc. to handle the output of data.
"""
from __future__ import print_function, unicode_literals
from __future__ import absolute_import
from __future__ import division
from abc import ABCMeta, abstractmethod, abstractproperty
from collecti... | StarcoderdataPython |
4876964 | from django.shortcuts import render
from rest_framework import status
from rest_framework.permissions import AllowAny
from rest_framework.viewsets import ModelViewSet
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.parsers import FileUploadParser
from .models im... | StarcoderdataPython |
118293 | # Copyright 2018--2022 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | StarcoderdataPython |
3402073 | <reponame>zcong1993/django<filename>start/apps/images/serializers.py
from rest_framework import serializers
from .models import Image
from .fields import ChoiceField
from .constants import Gender
class ImageSerializer(serializers.ModelSerializer):
id = serializers.IntegerField(read_only=True)
gender = ChoiceF... | StarcoderdataPython |
4915464 | """
embedeval
~~~~~~~~~
NLP Embedding Evaluation Tool
:copyright: (c) 2019 by <NAME> <<EMAIL>>
:license: MIT, see LICENSE for more details.
"""
from typing import List, Tuple
from pathlib import Path
import numpy as np
from gensim.models import KeyedVectors
from embedeval.embedding import WordEmbedding
from embede... | StarcoderdataPython |
3373582 | """
Simple Calculator
=================
Write a program to take two integers as input and output their sum.
Sample Input:
2
8
Sample Output:
10
"""
x, y = int(input()), int(input())
print(x + y) | StarcoderdataPython |
5073285 | <gh_stars>10-100
from collections import defaultdict
import numpy as np
import torch
from torchvision import datasets
from torchvision.datasets.vision import VisionDataset
from code.util.general import make_valid_from_train
# Reference: https://github.com/optimass/Maximally_Interfered_Retrieval/blob/master/data.py
... | StarcoderdataPython |
341829 | import factory
from factory import fuzzy
from factory.django import DjangoModelFactory
from . import models
class ProductFactory(DjangoModelFactory):
name = fuzzy.FuzzyText()
unit_price = fuzzy.FuzzyDecimal(1, 200)
class Meta:
model = models.Product
class MyLineItemFactory(DjangoModelFactory):... | StarcoderdataPython |
4812749 | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Vendor: Alentis
# OS: NetPing
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ----------------------------------------------... | StarcoderdataPython |
5003934 | <reponame>joe28965/cuorabot<filename>cuorabot_bringup/launch/bringup_launch.py
# 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 requ... | StarcoderdataPython |
3564308 | <reponame>AntoineDao/specklepy
from specklepy.logging.exceptions import SpeckleException
from specklepy.api.models import User
import pytest
@pytest.mark.run(order=1)
class TestUser:
def test_user_get_self(self, client, user_dict):
fetched_user = client.user.get()
assert isinstance(fetched_user, ... | StarcoderdataPython |
9798635 | from polyaxon.config_manager import config
POLYAXON_K8S_APP_NAME = config.get_string('POLYAXON_K8S_APP_NAME')
POLYAXON_K8S_API_HOST = config.get_string('POLYAXON_K8S_API_HOST')
POLYAXON_K8S_API_PORT = config.get_int('POLYAXON_K8S_API_PORT')
POLYAXON_K8S_APP_CONFIG_NAME = config.get_string('POLYAXON_K8S_APP_CONFIG_NAME... | StarcoderdataPython |
3212700 | # type: ignore
import ast
import functools
import re
from copy import deepcopy
from inspect import stack
from pathlib import Path
import executing
import mat2py.config
from mat2py.common.backends import numpy as np
from mat2py.common.logger import logger
from mat2py.common.utils import Singleton
from .array import M... | StarcoderdataPython |
11360097 | <reponame>ckamtsikis/cmssw<filename>RecoLocalTracker/SiStripClusterizer/python/test/testClusterizer_cfg.py
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.add_(cms.Service( "MessageLogger"))
process.source = cms.Source( "EmptySource" )
process.maxEvents = cms.untracked.PSet( input = ... | StarcoderdataPython |
1680089 | <gh_stars>1-10
"""Module to provide logic for the model evaluation"""
import gc
import json
import pickle
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow.keras.models import load_model
from tensorflow.keras.layers.experimental.preprocessing import TextVectorization
from melidatachall19... | StarcoderdataPython |
1825388 | from django.contrib.gis.db import models
class FederativeUnit(models.Model):
name = models.CharField(max_length=40, blank=True)
short = models.CharField(max_length=2)
country = models.CharField(max_length=40, default='Brazil')
def __str__(self):
return '{} ({})'.format(self.name or self.short... | StarcoderdataPython |
1677781 | <gh_stars>1-10
from optparse import OptionParser
from pronounLSTM import PronounLSTM
import pickle, utils, os, time, sys
import utils
# This code is partially based on:
# BIST parser by <NAME> and <NAME>: https://github.com/elikip/bist-parser
# uuparser by <NAME> et al.: https://github.com/UppsalaNLP/uuparser
if _... | StarcoderdataPython |
11337512 | <gh_stars>0
"""
python对XML的解析
常见的XML编程接口有DOM和SAX,这两种接口处理XML文件的方式不同,当然使用场合也不同。
python有三种方法解析XML,SAX,DOM,以及ElementTree:
1.SAX (simple API for XML )
python 标准库包含SAX解析器,SAX用事件驱动模型,通过在解析XML的过程中触发一个个的事件并调用用户定义的回调函数来处理XML文件。
2.DOM(Document Object Model)
将XML数据在内存中解析成一个树,通过对树的操作来操作XML。
""" | StarcoderdataPython |
1855055 | <reponame>gruunday/useradm
# --------------------------------------------------------------------------- #
# MODULE DESCRIPTION #
# --------------------------------------------------------------------------- #
"""RedBrick Error Module; contains RedBrick exception... | StarcoderdataPython |
1772004 | <filename>blog/models/maintext.py
from django.contrib.auth.models import User
from django.db import models
from django.urls import reverse
class MainText(models.Model):
TEXT_TYPE_CHOICES = (
('Draft', 'Draft'),
('Main Page', 'Main'),
('Footer', 'Footer'),
('Base Title', 'Base Title... | StarcoderdataPython |
4954439 | import datetime
import json
import Queue
import re
import redis
import socket
import threading
import time
UDP_IP = "0.0.0.0"
UDP_PORT = 8225
class StatsReceiver(object):
TEMPERATURE_RE = re.compile(r"^.*-t\d$")
POWER_READING_RE = re.compile(r"^E\d+")
PIR_RE = re.compile(r"^.*pir$")
SWITCH_RE = re.co... | StarcoderdataPython |
8050801 | """
Setup of Traffic Camera Streaming Pipeline
Author: <NAME>
"""
from setuptools import setup
setup(name='tcp',
version='0.1.dev0',
description='Pipeline to extract trajectories from traffic camera streams',
author='<NAME>',
author_email='<EMAIL>',
package_dir = {'': 'src'},
packag... | StarcoderdataPython |
9606339 | <reponame>chzhan/reinforcement-learning-algorithms<gh_stars>1-10
from baselines.common.cmd_util import make_atari_env
from baselines.common.vec_env.vec_frame_stack import VecFrameStack
from arguments import get_args
from a2c_agent import a2c_agent
from baselines import logger
if __name__ == '__main__':
args = get_... | StarcoderdataPython |
1652640 | from .unknown import Unknown
| StarcoderdataPython |
5110119 | class Solution(object):
def find_diff(self, str1, str2):
if str1 is None or str2 is None:
raise TypeError("str1 or str2 cannot be None")
long_str = str1 if len(str1) > len(str2) else str2
short_str = str2 if len(str1) > len(str2) else str1
for i in range(len(short_str)):... | StarcoderdataPython |
399562 | <filename>avalares/__init__.py
from .utils import to_numpy, to_pandas
from .parser import parse
| StarcoderdataPython |
1909543 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 21 15:53:34 2019
@author: leeh43
"""
import os
import nibabel.cmdline.ls
import nibabel as nib
#import cv2
nifti_deeplesion = os.path.join('/nfs/masi/leeh43/DeepLesion/Images_nifti/'
+ '000001_03_01_058-118.nii.gz'... | StarcoderdataPython |
1919257 | import pandas as pd
import datetime
import subprocess
import localModuleForMinpou
#----
def atting_program(row):
recorder_for_minpou_command_line = 'python '+localModuleForMinpou.RECORDER_FOR_MINPOU+' "{0}" "{1}" "{2}" "{3}" "{4}" "{5}" "{6}"'.format(
row.station_id,
int((row.air_time + datetime.timedelta... | StarcoderdataPython |
3224168 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Makes sure files have the right permissions.
Some developers have broken SCM configurations that flip the executable
permission... | StarcoderdataPython |
45297 | # Copyright (c) 2017 <NAME> <<EMAIL>>
# 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 notice, this
# list of conditions and t... | StarcoderdataPython |
3578573 | <filename>todo_project/todo/views.py
# Function based view
import json
from django.http import HttpResponse
from django.shortcuts import render
from django.shortcuts import get_object_or_404
from django.shortcuts import render_to_response
from django.core.urlresolvers import reverse
from django.http import HttpRespons... | StarcoderdataPython |
1774376 | # Code is generated: DO NOT EDIT
# Copyright 2019 Machine Zone, Inc. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from kubespec import context
from kubespec import types
from kubespec.k8s import base
from kubespec.k8s import resource
from ... | StarcoderdataPython |
6402897 | <reponame>fossabot/tujian_python<filename>setup.py
# -*- coding: utf-8 -*-
import setuptools
with open("README.md", "r", encoding='UTF-8') as fh:
long_description = fh.read()
setuptools.setup(
name="PyTujian",
version="0.1.25",
author="gggxbbb",
author_email="<EMAIL>",
description="A simlpe t... | StarcoderdataPython |
4975912 | import numpy as np
def make_obarray(klass, dtype):
class Obarray(np.ndarray):
def __new__(cls, obj):
A = np.array(obj,dtype=np.object)
N = np.empty(shape=A.shape, dtype=dtype)
for idx in np.ndindex(A.shape):
for name, type in dtype:
N[n... | StarcoderdataPython |
12864047 | <filename>cpdb/popup/factories.py
import factory
from faker import Faker
from popup.models import Popup
fake = Faker()
class PopupFactory(factory.django.DjangoModelFactory):
class Meta:
model = Popup
name = factory.LazyFunction(lambda: fake.word())
page = factory.LazyFunction(lambda: fake.word(... | StarcoderdataPython |
3568580 | # =============================================================================
# Author: <NAME> - https://github.com/mjenrungrot/
# FileName: 10500.py
# Description: UVa Online Judge - 10500
# =============================================================================
def f(boards, x, y, nn)... | StarcoderdataPython |
3458668 | <gh_stars>10-100
from build.management.commands.build_release_notes import Command as BuildReleaseNotes
class Command(BuildReleaseNotes):
pass | StarcoderdataPython |
209961 | <reponame>jpkarlsberg/readux
from django.contrib import admin
from readux.collection.models import CollectionImage
class CollectionImageAdmin(admin.ModelAdmin):
list_display = ('collection_label', 'cover', 'cover_thumbnail',
'banner', 'banner_thumbnail')
admin.site.register(CollectionImage, ... | StarcoderdataPython |
256395 | from django.apps import AppConfig
class SportsquadsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'sportSquads'
| StarcoderdataPython |
91043 | from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from rango.models import Category, Page
from rango.forms import CategoryForm, PageForm
from rango.forms import UserForm, UserProfileForm
from django.core.urlresolvers import reverse
from django.contrib.auth import authenticat... | StarcoderdataPython |
277611 | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
class Tests:
look_modification_creation = (
"Look Modification Entity successfully created",
... | StarcoderdataPython |
8133505 | <reponame>RomaLash/async_dns<gh_stars>0
import urllib.parse
from async_dns import types
from ..util import ConnectionHandle
class Response:
def __init__(self, status, message, headers, data, url):
self.status = status
self.message = message
self.headers = headers
self.data = data
... | StarcoderdataPython |
9738727 | <reponame>pbloem/gated-rgcn<gh_stars>1-10
from time import time
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.patches import Circle, Wedge, Polygon, Ellipse, Rectangle
from matplotlib.collections import PatchCollection
from matplotlib.axes import Axes
import os, errno, random,... | StarcoderdataPython |
6602760 | <reponame>pallav1991/Optimus
from pyspark.sql import functions as F
from optimus.helpers.functions import parse_columns
from optimus.helpers.checkit import is_dataframe, is_int
class OutlierDetector:
"""
Outlier detection for pyspark data frames.
"""
@staticmethod
def iqr(df, columns):
""... | StarcoderdataPython |
1978373 | <reponame>filhodomauro/bt_integration
#! /usr/bin/env python
import httplib2
import jamal_google_auth as gauth
from googleapiclient import discovery
def add_row(sheet_id, range, values):
credentials = gauth.get_credentials()
service = discovery.build('sheets', 'v4', credentials=credentials)
rangeName = ran... | StarcoderdataPython |
8109660 | <reponame>deepcoder42/python-lib
#!/usr/bin/python
# Classification (U)
"""Program: normalize.py
Description: Unit testing of normalize in gen_libs.py.
Usage:
test/unit/gen_libs/normalize.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info... | StarcoderdataPython |
121854 | <gh_stars>0
"""Component for the Somfy MyLink device supporting the Synergy API."""
CONF_ENTITY_CONFIG = "entity_config"
CONF_SYSTEM_ID = "system_id"
CONF_REVERSE = "reverse"
CONF_DEFAULT_REVERSE = "default_reverse"
DEFAULT_CONF_DEFAULT_REVERSE = False
DATA_SOMFY_MYLINK = "somfy_mylink_data"
MYLINK_STATUS = "mylink_st... | StarcoderdataPython |
11316410 | <gh_stars>0
from turtle import Turtle
ALIGNMENT = "center"
FONT = ("Courier", 14, "normal")
class Score(Turtle):
def __init__(self):
super().__init__()
self.color("white")
self.speed("fastest")
self.penup()
self.ht()
self.goto(0, 280)
self.cur... | StarcoderdataPython |
3579148 | import pytest
from ray.util.ml_utils.checkpoint_manager import (
_CheckpointManager,
CheckpointStorage,
CheckpointStrategy,
_TrackedCheckpoint,
)
def test_unlimited_persistent_checkpoints():
cpm = _CheckpointManager(checkpoint_strategy=CheckpointStrategy(num_to_keep=None))
for i in range(10):... | StarcoderdataPython |
11259227 | from selenium.webdriver.firefox.options import Options
from selenium import webdriver
import time
import os
import requests
from unipd_login import *
import argparse
def main(dep, course, index_video):
dep_name = dep.upper()
course_name = course
video_tag = "Kaltura Video Resource"
download_dir = os... | StarcoderdataPython |
236317 | <filename>homeassistant/components/google_assistant/helpers.py
"""Helper classes for Google Assistant integration."""
from homeassistant.core import Context
class SmartHomeError(Exception):
"""Google Assistant Smart Home errors.
https://developers.google.com/actions/smarthome/create-app#error_responses
"... | StarcoderdataPython |
9720341 | <reponame>alijasim/frappe
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest, frappe
from frappe.utils import getdate, formatdate, get_last_day
from frappe.utils.dateutils import get_period_ending, get_period
from... | StarcoderdataPython |
163786 | """
Code that goes along with the Airflow located at:
http://airflow.readthedocs.org/en/latest/tutorial.html
"""
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from taxi import get_taxi_data, transform_taxi_data, load_taxi_da... | StarcoderdataPython |
3267421 | <filename>scenes/__init__.py
from .game import GameScene
from .inventory import InventoryScene
from .main_menu import MainMenuScene
from .character_creation import CharacterCreationScene | StarcoderdataPython |
1660527 | <filename>mellplayer/mell_logger.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
MellPlayer logger
Created on 2017-03-06
@author: Mellcap
'''
import os
import logging
from mellplayer.directory import BASE_DIRECTORY
LOG_FILE = os.path.join(BASE_DIRECTORY, 'mell_logger.log')
# create logger
mell_logger = log... | StarcoderdataPython |
312127 | <gh_stars>1000+
class BlockTerminationNotice(Exception):
pass
class IncorrectLocationException(Exception):
pass
class SootMethodNotLoadedException(Exception):
pass
class SootFieldNotLoadedException(Exception):
pass
| StarcoderdataPython |
8052119 | <reponame>tl-hbk/boa<gh_stars>0
from glob import glob
import os
from pathlib import Path
from math import log
from mamba.mamba_api import transmute as mamba_transmute
from joblib import Parallel, delayed
from rich.console import Console
console = Console()
unit_list = list(zip(["bytes", "kB", "MB", "GB", "TB", "PB"]... | StarcoderdataPython |
6661531 | <gh_stars>10-100
from ballclient.service.clientteam import ClientPlayer, ClientTeam
from ballclient.util import logger
import random
"""
TODO 追击敌人时,多只鲲一起协作
2. 鲲原地打转问题
3. 增加一个可视区域,Privilege 尽量保证可视区域最大
4. 己方不能重叠
- 计算权重时,不考虑方向了
- 权重的计算公式
weight funciton (x-1)^3-x+2 or y= 4.25-5.04 x + 1.75 x^2
"""
class Strategy():
... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.