id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
1600210
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'plantillas_interfaces/interfaz_registro_datos.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except A...
StarcoderdataPython
3343181
from struct import pack, unpack from abc import ABC, abstractmethod class RadarData(ABC): """ Abstract radar data type stored in pbs stream """ @classmethod @abstractmethod def from_proto(cls, data_pb): pass class ProtoStreamReader(object): """ This class streams data stored...
StarcoderdataPython
5013513
from collections.abc import Callable from bolinette.blnt.commands import Argument class Command: def __init__(self, name: str, func: Callable, path: str = None, summary: str = None, args: list[Argument] = None, run_init: bool = False): self.name = name self.func = func se...
StarcoderdataPython
3561814
<gh_stars>0 import requests if len(prompt) == 1: print('rget: usage: rget <url|--help> [arg]') elif len(prompt) == 2: if prompt[1] == "--help": print(""" rget - Make simple HTTP requests ---------- args: url - The url to get --help - Disp...
StarcoderdataPython
188122
#!/usr/bin/env python3 """Setup script for Redwall""" import codecs import os import re from setuptools import find_packages, setup def get_long_description(): """Reads the main README.rst to get the program's long description""" with codecs.open("README.rst", "r", "utf-8") as f_readme: return f_read...
StarcoderdataPython
4841340
<reponame>adeogliari/GeekUniversity_Python """ 3) Leia um número real. Se o número for positivo imprima a raiz quadrada. Do contrário, imprima o número ao quadrado. """ import math n1 = float(input('Digite um número: \n')) if n1 > 0: print(f'A raiz quadrada de {n1} é {math.sqrt(n1)}') elif n1 == 0: print('Voc...
StarcoderdataPython
6477418
import pytest from SupportLibraries.driver_factory import DriverFactory @pytest.fixture(scope="session") def get_driver(request, browser, platform, environment): df = DriverFactory(browser, platform, environment) driver = df.get_driver_instance() session = request.node for item in session.items: ...
StarcoderdataPython
3597186
from django.db import models from opendata.catalog.models import UrlType, UpdateFrequency from opendata.requests.models import Category, City, County from opendata.fields_info import FIELDS, HELP class Suggestion(models.Model): AGENCY_TYPES = ( ('state', 'Statewide'), ('county', 'County Agency'),...
StarcoderdataPython
52589
<gh_stars>0 # 04. Forum Topics line = input() forum_dict = {} # def unique(sequence): # seen = set() # return [x for x in sequence if not(x in seen or seen.add(x))] while not line == "filter": words = line.split(" -> ") topic = words[0] hashtags = words[1].split(", ") if topic not in forum_di...
StarcoderdataPython
66690
import json import os from contextlib import ExitStack from collections import defaultdict os.makedirs("workdata/icc", exist_ok=True) files = defaultdict(dict) with open("workdata/clausified.json", "r") as f: with ExitStack() as stack: for ds in ["eca", "emotion-stimulus", "reman", "gne", "electoral_tweet...
StarcoderdataPython
3450689
<reponame>Kukuster/SSrehub # standard library from subprocess import run, PIPE from typing import Dict, List, TypedDict import os import shutil RUN_CMD_ONFAIL_EXITCODE = 22 class CMD_RETURN: ec: int stdout: str stderr: str def run_cmd(cmd: List[str]): """A wrapper around subprocess.run that nicely ...
StarcoderdataPython
1618544
from abaqusConstants import * from .Load import Load from ..Region.Region import Region class InertiaRelief(Load): """The InertiaRelief object defines an inertia relief load. The InertiaRelief object is derived from the Load object. Attributes ---------- name: str A String specifying the...
StarcoderdataPython
5075608
""" <NAME>, University of Warwick, March 2018 Extraction and handling of routing info """ from urlparse import urlparse import re from copy import deepcopy import match_heuristics as mh class simple_node: """ Tree node for a given route Contains the endpoint name, full route, and details such as decorators Also ...
StarcoderdataPython
6421865
<filename>dev_tests/test_multi_nnls.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import logging import time # Set matplotlib backend to 'Agg' (compatible when X11 is not running # e.g., on a cluster). Note that the backend can only be set BEFORE # matplotlib is used or even submodules are imported! imp...
StarcoderdataPython
3318490
<reponame>touilleWoman/N-puzzle<filename>srcs/generator.py #!/usr/bin/env python import sys import argparse import random def make_puzzle(s, solvable, iterations): def swap_empty(p): idx = p.index(0) poss = [] if idx % s > 0: poss.append(idx - 1) if idx % s < s - 1: ...
StarcoderdataPython
5110087
print('=' * 12 + 'Desafio 33' + '=' * 12) a = float(input('Digite o número 1: ')) b = float(input('Digite o número 2: ')) c = float(input('Digite o número 3: ')) maior = 0 menor = 0 if a >= b and a >= c: maior = a if b >= a and b >= c: maior = b if c >= a and c >= b: maior = c if a <= b and a <= c: meno...
StarcoderdataPython
273167
<reponame>Horta/limix-qep import os import sys from setuptools import setup from setuptools import find_packages def setup_package(): src_path = os.path.dirname(os.path.abspath(sys.argv[0])) old_path = os.getcwd() os.chdir(src_path) sys.path.insert(0, src_path) needs_pytest = {'pytest', 'test', '...
StarcoderdataPython
11272032
a=int(input("enter a number")) if a<10: print("Entered Number is below 10") elif a>10 and a<20: print("Entered Number between 10 and 20") elif a>20: print("Entered number is above 20") else : print("No Number")
StarcoderdataPython
11254288
<filename>scripts/prepare_data.py import os import argparse import pickle import torch import torch.nn.functional as F import kaldi_io def main(): parser = argparse.ArgumentParser("Configuration for data preparation") parser.add_argument("--feat_scp", type=str, help="Path to the VoxCeleb features generated by the...
StarcoderdataPython
137035
<reponame>onetop21/MLAppDeploy from typing import Tuple, List from mlad.cli import context def init(address) -> context.Context: ctx = context.add('default', address, allow_duplicate=True) context.use('default') return ctx def set(*args) -> None: return context.set('default', *args) def get() -> ...
StarcoderdataPython
229105
import numpy as np from sklearn import clone from sklearn.base import ( BaseEstimator, TransformerMixin, MetaEstimatorMixin, ) from sklearn.utils.validation import ( check_is_fitted, check_X_y, FLOAT_DTYPES, ) class EstimatorTransformer(TransformerMixin, MetaEstimatorMixin, BaseEstimator): ...
StarcoderdataPython
6628036
""" Code to facilitate delayed archiving of FITS files in the images directory """ import os import time import queue import atexit import shutil from contextlib import suppress from threading import Thread from astropy import units as u from panoptes.utils import get_quantity_value from panoptes.utils.time import cur...
StarcoderdataPython
5140702
<gh_stars>0 # Generated by Django 2.2.13 on 2021-02-08 04:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('huntserver', '0072_auto_20201103_1539'), ] operations = [ migrations.AddField( model_name='puzzle', nam...
StarcoderdataPython
6483192
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-03-30 10:57 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('pigeon', '0003_auto_20160328_0809'), ] operations = [ migrations.RemoveField( ...
StarcoderdataPython
6588725
class InvalidCredentials(Exception): pass class NotFoundError(Exception): pass class ServerAuthError(Exception): pass class InternalServerError(Exception): pass
StarcoderdataPython
11359179
<filename>Baixando videos do Youtube/app.py from pytube import YouTube link = input("Digite o link do vídeo que seja baixar: "); path = input("Digite o diretório que seja salvar o vídeo: "); yt = YouTube(link) print("Título: ", yt.title); print("Número de views: ", yt.views); print("Tamanho do vídeo: ", yt.length, "s...
StarcoderdataPython
6614042
<filename>debile/utils/aget.py # Copyright (c) 2012-2013 <NAME> <<EMAIL>> # # 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, including without limitation # the rights to u...
StarcoderdataPython
216310
<gh_stars>1-10 import os from subprocess import Popen import sys import logging logging.basicConfig(level=logging.DEBUG) log = logging.getLogger(os.path.basename(__file__)) def get_blast_file(qfasta, sfasta, out_dir=None): """ >>> get_blast_file("/tmp/a.fasta", "b.fasta") 'a_vs_b.blast' >>> get_blast_...
StarcoderdataPython
4926324
<reponame>benhawk1/447-Project---Submit-System # -*- coding: utf-8 -*- """ Created on Fri Oct 9 21:33:09 2020 @author: benhawk1 """ import pandas as pd import hashlib # Tool for hashing given passwords for a specified user in the userbase csv file def encode(password, row, df): salt = b'1\xcc\xf09V\x1b\xed\xf5...
StarcoderdataPython
6406888
import os import unittest import requests_mock from datahub_emails import api class TestStatusPage(unittest.TestCase): @requests_mock.mock() def test_on_incident_returns_none_if_comonent_not_exists(self, m): m.get('https://api.statuspage.io/v1/pages/test/components', json={}) res = api.on_in...
StarcoderdataPython
12837252
<reponame>CiscoDevNet/ydk-py<filename>ietf/ydk/models/ietf/iana_if_type.py<gh_stars>100-1000 """ iana_if_type This YANG module defines YANG identities for IANA\-registered interface types. This YANG module is maintained by IANA and reflects the 'ifType definitions' registry. The latest revision of this YANG module ...
StarcoderdataPython
1629476
import unittest """ 1 / \ 2 3 / \ 4 5 """ #DFS PostOrder 4 5 2 3 1 (Left-Right-Root) def is_balancedRecurive(tree_root): def postorder(node): if node is None: return postorder(node.left) postorder(node.right) print(node.value, end=' ') postorder...
StarcoderdataPython
6659158
from django import template register = template.Library() @register.filter def chat_with(obj, user): return obj.chat_with(user)
StarcoderdataPython
1944149
from tkinter import Tk, Canvas, Message, Label, Entry, Button, StringVar from tkinter.messagebox import showinfo from lib_interaction import * lborder = 16 tborder = 16 entry_col = 130 button_col = 320 font = "roboto-mono 12" arr_sym_tuple = ('BackSpace', 'space', 'minus') step_sym_tuple = ('BackSpace') def rotat...
StarcoderdataPython
3376682
from random import random class Synapse: def __init__(self, from_neuron, to_neuron): self.from_neuron = from_neuron self.to_neuron = to_neuron self.weight = random()
StarcoderdataPython
1676904
<gh_stars>0 from collections import defaultdict from pycocotools.coco import COCO from pycocoevalcap.eval import COCOEvalCap import json from json import encoder encoder.FLOAT_REPR = lambda o: format(o, '.3f') import random from scipy.io import loadmat import pandas as pd def load_pascal_triplets(filepath='experim...
StarcoderdataPython
6401518
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: proto/grid/messages/success_resp_message.proto """Generated protocol buffer code.""" # third party from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from googl...
StarcoderdataPython
3429073
# TODO: someday: I think these should probably be refactored to be in an external file; yaml, maybe? SAMPLE_ID_SELECTOR = 'samples.sample_id' def get_sample_id_filter(sample_name): return {SAMPLE_ID_SELECTOR: sample_name} def get_any_of_sample_ids_filter(sample_names_list): return {SAMPLE_ID_SELECTOR: {'$i...
StarcoderdataPython
6497579
print('This is created from home!')
StarcoderdataPython
4934124
import os from datetime import datetime from whotracksme.website.utils import print_progress from whotracksme.website.templates import render_template, get_template def parse_blogpost(filepath): with open(filepath) as r: text = r.read() meta, body = text.split('+++') title, subtitle, author, post...
StarcoderdataPython
9694839
<reponame>aloknnikhil/orion-server import socket import time import statsd class MetricsClient(object): """ Abstractions over statsd metrics emissions. """ def __init__(self, addr, prefix): """ Create a client instance. :param addr: IPv4 address of the statsd server. ...
StarcoderdataPython
12838596
import numpy as np import matplotlib.pyplot as pl yearInSec = 365.0*24.0*3600.0 solarMassPerYear = 1.99e33 / yearInSec RStar = 4e13 TStar = 2330.0 MStar = 0.8 * 1.99e33 R0 = 1.2 * RStar Rc = 5 * RStar Rw = 20.0 * RStar vexp = 14.5 * 1e5 vturb = 1.0 MLoss = 2e-5 * solarMassPerYear G = 6.67259e-8 k = 1.381e-16 mg = 2.3 ...
StarcoderdataPython
9718500
"""test query operations""" import pytest from aiodb import Model, Field from aiodb.model.query import QueryTable from aiodb.model.query import _find_foreign_key_reference from aiodb.model.query import _find_primary_key_reference from aiodb.model.query import _pair class A(Model): # pylint: disable=invalid-name ...
StarcoderdataPython
8012900
<reponame>MuhammadAlzamily/MyKivyApp<filename>pregnancy-app/pregnancy_app.py from kivymd.app import MDApp from kivymd.uix.screen import Screen from kivy.lang.builder import Builder from kivy.uix.screenmanager import ScreenManager, Screen from kivymd.uix.label import MDLabel from kivymd.uix.button import MDFillRoun...
StarcoderdataPython
4936626
# Copyright 2020 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
StarcoderdataPython
6595754
#!/usr/bin/env python3 import math # Move the triple quotes downward to uncover each segment of code """ # The 'for' loop is one of the most common loop constructs you will use # Note the indentation of the print(i) statement # Code 'inside' loops must be indented # Note that Python starts counting from 0 not 1 fo...
StarcoderdataPython
1831935
from django.contrib.sitemaps import Sitemap from blog.models import Post from django.urls import reverse class PostSitemap(Sitemap): changefreq = "weekly" priority = 0.9 def items(self): return Post.objects.all() def lastmod(self, obj): return obj.date_posted # def location() Dj...
StarcoderdataPython
6552880
#! /bin/env python3 # -*- coding: utf-8 -*- ################################################################################ # # This file is part of PYJUNK. # # Copyright © 2021 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentat...
StarcoderdataPython
11239245
import numpy as np import matplotlib.pyplot as plt import cv2 # With jupyter notebook uncomment below line # %matplotlib inline # This plots figures inside the notebook def point_operation(img, K, L): """ Applies point operation to given grayscale image """ img = np.asarray(img, dtype=np.float) ...
StarcoderdataPython
5054627
<gh_stars>1-10 """This module tests the real component.py, just mocking the client""" import pytest import conftest import time import suricate.services import suricate.component from suricate.configuration import config from suricate.errors import CannotGetComponentError COMP_NAME = 'TestNamespace/Positioner00' CON...
StarcoderdataPython
9627350
<gh_stars>0 #!/usr/bin/env python3 import datetime import pathlib import sys from typing import List, Optional import orjson import pydantic import us from vaccine_feed_ingest_schema import location from vaccine_feed_ingest.utils.log import getLogger logger = getLogger(__file__) SOURCE_NAME = "getmyvax_org" LOCAT...
StarcoderdataPython
91219
<filename>test/test.py from pinnacle import pinnacle import pytest import pathlib import os PATH = pathlib.Path(os.path.abspath(os.path.dirname(__file__))) def test_gen_dir_name(): import secrets import string ALPHABET = string.ascii_letters + string.digits new_dir = ''.join(secrets.choice(ALPHABET) fo...
StarcoderdataPython
1753906
from __future__ import absolute_import, division, print_function from builtins import super, range, zip, round, map import logging import os from glob import glob import argparse logger = logging.getLogger(__name__) def main(): '''This module is designed for cleaning log files that might accumulate in the valida...
StarcoderdataPython
1920139
from handlers.uploading import upload_handler def test_upload_handler(): # test the upload handler a = upload_handler("test.py") assert a.status == True
StarcoderdataPython
1955230
import argparse parser = argparse.ArgumentParser(description='Unaligned > aligned raw.') parser.add_argument('directory', type=str) args = parser.parse_args() print(args.directory) try: import HTPA32x32d except: raise Exception("Can't import HTPA32x32d") HTPA32x32d.dataset.VERBOSE = True import os raw_dir = arg...
StarcoderdataPython
1702483
<filename>mlplaygrounds/datasets/tests/test_trainers.py from unittest import TestCase import pandas as pd from mlplaygrounds.datasets.trainers.base import Trainer, FeatureTypeError class TestTrainer(TestCase): def setUp(self): self.X = [ {'x_one': 1, 'x_two': 4, 'x_three': 1, 'val': 5}, ...
StarcoderdataPython
12854179
#!/bin/python # coding=utf-8 import schedule import time from subprocess import call # Referências: # https://pypi.org/project/schedule/ # https://stackoverflow.com/questions/373335/how-do-i-get-a-cron-like-scheduler-in-python # https://www.geeksforgeeks.org/python-schedule-library/ def postgres_backup_00_h(): ...
StarcoderdataPython
5067483
<gh_stars>10-100 import functools import inspect from typing import Any, Callable, List, Literal, cast, get_args from koreanbots.typing import CORO def strict_literal(argument_names: List[str]) -> Callable[[CORO], CORO]: def decorator(f: CORO) -> CORO: @functools.wraps(f) async def decorated_func...
StarcoderdataPython
66742
import asyncio import collections import hashlib import json import os import sys import time from collections import OrderedDict from datetime import datetime from functools import reduce from pathlib import Path from urllib.parse import quote_plus import aiohttp import nexussdk as nxs import pandas as pd import prog...
StarcoderdataPython
5001814
import datetime import os import shutil import sys import arrow import pytest import virtool.utils @pytest.fixture def fake_dir(tmpdir): file_1 = tmpdir.join("hello.txt") file_2 = tmpdir.join("world.txt") file_1.write("hello world") file_2.write("this is a test file") return tmpdir @pytest.f...
StarcoderdataPython
4907789
import bpy class ahs_maincurve_volume_down(bpy.types.Operator): bl_idname = 'object.ahs_maincurve_volume_down' bl_label = "Remove Taper/Bevel" bl_description = "Remove Taper/Bevel from selected Curve" bl_options = {'REGISTER', 'UNDO'} @classmethod def poll(cls, context): try: ...
StarcoderdataPython
9700579
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-07-25 05:30 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('farms', '0001_initial'), ] operations = [ ...
StarcoderdataPython
3529228
<filename>codesync/auth/handler.py import shelve import socket import subprocess import time from threading import Thread import requests from codesync.auth.server import start_server from codesync.constants import CACHE_FILE_PATH from codesync.settings import IS_DEV class AuthServerHandler(object): @staticmet...
StarcoderdataPython
12861604
<filename>pygears_vivado/vivmod.py<gh_stars>1-10 import os from pygears.hdl.sv import SVModuleInst from .ip_resolver import IPResolver class SVVivModuleInst(SVModuleInst): def __init__(self, node, lang=None): resolver = IPResolver(node) super().__init__(node, resolver.lang, resolver) @propert...
StarcoderdataPython
4880779
<reponame>DanielDaCosta/dwh-redshift import boto3 from botocore.exceptions import ClientError import logging import json import configparser config = configparser.ConfigParser() config.read('dwh.cfg') DWH_CLUSTER_TYPE = config.get("DWH","DWH_CLUSTER_TYPE") DWH_NUM_NODES = config.get("DWH","DWH_NUM_NODES"...
StarcoderdataPython
4823611
from random import randint from bomb import Bomb class User: DEFAULT_BOMB_CLASS = Bomb START_POINTS = 0 START_LIFE = 3 def __init__(self, board, life, points, bomb_class): self._set_up_user(board) self.step = 1 self.points = points self.life = life self.bomb_...
StarcoderdataPython
11216454
<reponame>loads/loads-broker from string import Template from tornado.web import StaticFileHandler class GrafanaHandler(StaticFileHandler): """Grafana page handler""" def __init__(self, application, request, **kw): super(GrafanaHandler, self).__init__(application, request, **kw) self.broker =...
StarcoderdataPython
5074880
<filename>testitems/apps.py from django.apps import AppConfig class TestitemsConfig(AppConfig): name = 'testitems'
StarcoderdataPython
8015283
# -*- coding: utf-8 -*- """Keithley.py: A pyVISA wrapper for Keithley devices __author__ = "<NAME>" __copyright__ = "Copyright 2016, <NAME>" __license__ = "MIT" __email__ = "<EMAIL>" """ import visa class M2308(): def __init__(self, address=16): self._instr = visa.ResourceManager().ope...
StarcoderdataPython
1994299
<gh_stars>1-10 """ This module search for GUI controls by sending TAB button events and comparing the image with the original. .. note:: It does not work if the GUI changes during the scan. (e.g. blinking cursor) """ import logging from time import sleep from PIL import ImageChops, ImageFilter, ImageStat ...
StarcoderdataPython
73237
import json import requests url = 'http://localhost:5000' def test(document_name: str, output_name: str, _type: str, data: dict): data = { 'data': data, 'template_name': document_name, 'filename': output_name, 'type': _type, } r = requests.post(url+'/publipost', json=dat...
StarcoderdataPython
34249
<reponame>Odin-SMR/odin-api import attr from typing import List, Any, Dict, Union import datetime as dt from enum import Enum, unique, auto from dateutil.relativedelta import relativedelta import numpy as np # type: ignore DATEFMT = "%Y-%m-%dT%H:%M:%SZ" COMMON_FILE_HEADER_DATA = { "creator_name": '<NAME>', ...
StarcoderdataPython
3433161
<reponame>Iamlegend-Imani/airbnb-plotly-dash-app ''' Used for creating marks for the input bathroom slider in prediction.py ''' bathroom_marks = { 0: '0', 0.5: '0.5', 1: '1', 1.5: '1.5', 2: '2', 2.5: '2.5', 3: '3', 3.5: '3.5', 4: '4', 4.5: '4.5', 5: '5', 5.5: '5.5', ...
StarcoderdataPython
157804
from gamechangerml.src.search.sent_transformer.finetune import STFinetuner from gamechangerml.configs.config import EmbedderConfig from gamechangerml.api.utils.pathselect import get_model_paths from gamechangerml.api.utils.logger import logger import argparse import os from datetime import datetime model_path_dict = g...
StarcoderdataPython
3218764
<reponame>shareablee/XlsxWriter ############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, <NAME>, <EMAIL> # import unittest from ...compatibility import StringIO from ...worksheet import Worksheet class TestWritePageSetup(unittest.TestCase...
StarcoderdataPython
8084179
<reponame>orctom/hao # -*- coding: utf-8 -*- import functools import os import socket import traceback import typing import yaml from . import paths, singleton ENV = os.environ.get("env") HOSTNAME = socket.gethostname() class Config(object, metaclass=singleton.Multiton): def __init__(self, config_name='config'...
StarcoderdataPython
6644047
<filename>hashtable_module.py #!/usr/bin/env python3 # shebang for linux """ simple hashtable hashtable implementation using trivial hash function data is stored as a dictionary of key value pairs REFFERENCE: - https://en.wikipedia.org/wiki/Hash_function#Hash_function_algorithms """ # import std lib import sys impo...
StarcoderdataPython
8047550
#!/usr/bin/python # Copyright: (c) 2019, DellEMC from ansible.module_utils.basic import AnsibleModule from ansible.module_utils import dellemc_ansible_utils as utils import logging __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'suppo...
StarcoderdataPython
230052
''' Import all modules in this package ''' from .credits_screen import * from .end_screen import * from .pause_screen import * from .start_screen import * from .game_screen import *
StarcoderdataPython
9680082
import argparse import os import glob import random import re import librosa import pandas as pd from tqdm import tqdm SPACES_PATTERN = re.compile('[\t\r\n\s0-9]+') PUNCTUATION = re.compile('[!"#$%&\'()*+,-./:;<=>?@\]\[\\^_`{|}~]') def get_duration(filename): audio, sr = librosa.load(filename) return libros...
StarcoderdataPython
288717
<filename>hoverpy/__init__.py from .hp import * from .decorators import *
StarcoderdataPython
1694146
from ensemble.component.vehicle import Vehicle from ensemble.handler.symuvia.stream import SimulatorRequest # TODO: Check constructor alternatives req = SimulatorRequest() v1 = Vehicle(req, vehid=0)
StarcoderdataPython
6616370
# Generated by Django 3.2.5 on 2021-07-09 03:30 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('registration', '0004_auto_20210709_0303'), ] operations = [ migrations.AddField( model_name='person', ...
StarcoderdataPython
5196284
class Solution: #accepted def reverseVowels(self, s): """ :type s: str :rtype: str """ vowels = ['a','e', 'i','o', 'u'] vwls = [] for ch in s: if ch.lower() in vowels: vwls.append(ch) vwls = vwls[::-1] j = 0 ...
StarcoderdataPython
1843087
import enum class Status(enum.Enum): """Status of the game. 0 : Not accepted 1 : Accepted (default) 2 : Archived (default) 3 : Deleted """ not_accepted = 0 accepted = 1 archived = 2 deleted = 3 class Presentation(enum.Enum): """ 0 : Display ...
StarcoderdataPython
58284
<reponame>Harshvartak/TSEC-Codestorm<gh_stars>1-10 from django import forms from .models import * from django.forms import ModelForm from django.contrib.auth import get_user_model from crispy_forms.layout import Layout, Field, ButtonHolder, Submit from crispy_forms.helper import FormHelper from django.contrib.aut...
StarcoderdataPython
12854535
<reponame>Zhang-SJ930104/ymir import os from mir.scm.cmd import CmdScm from mir.tools.code import MirCode from mir.tools.errors import MirRuntimeError def Scm(root_dir: str, scm_executable: str = None) -> CmdScm: """Returns SCM instance that corresponds to a repo at the specified path. Args: ...
StarcoderdataPython
4950128
import string import rsa import base64 from urllib.parse import quote_plus, unquote SIGN_TYPE = "SHA-256" def order_data(payload): lst = [] for key, value in payload.items(): lst.append("{}={}".format(key, value)) lst.sort() order_payload = "&".join(lst) return order_payload def remove...
StarcoderdataPython
11370141
<reponame>KhronosGroup/COLLADA-CTS # Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights...
StarcoderdataPython
12850271
<gh_stars>0 def proceso(num, suma=0): numero = [] for i in str(num): exp = int(i) ** len(str(num)) numero.append(exp) if len(numero) == len(str(num)): total = sum(numero) return num, total numero.clear() entrada = input() datos = [] for i in range(int(entrada)): ...
StarcoderdataPython
6676178
import os import json import random import numpy as np import pytest import warnings from pybullet_planning import INF from pybullet_planning import load_pybullet, connect, wait_for_user, LockRenderer, has_gui, WorldSaver, HideOutput, \ reset_simulation, disconnect from pybullet_planning import interpolate_poses, ...
StarcoderdataPython
199153
amount = 20 num=1 def setup(): size(640, 640) stroke(0, 150, 255, 100) def draw(): global num, amount fill(0, 40) rect(-1, -1, width+1, height+1) maxX = map(mouseX, 0, width, 1, 250) translate(width/2, height/2) for i in range(0,360,amount): x = sin(radians(i+num)) * maxX ...
StarcoderdataPython
3254191
<filename>apps/linux/vim/plugins/ultisnips/snippets_snippets.py from talon import Context ctx = Context() ctx.matches = r""" tag: user.vim_ultisnips mode: user.snippets mode: command and code.language: snippets """ # spoken name -> snippet name ultisnips_snippets = { "snippet": "usnip", "visual": "vis", } pri...
StarcoderdataPython
391593
from collections import Counter import json import os.path as osp import time import torch import numpy as np from mmal.data_utils import CustomDataset from mmal.dist_utils import gather from mmal.uncertainty_utils import calculate_entropy_np, get_unique_indices import mmcv from mmcv.runner import get_dist_info from ...
StarcoderdataPython
8073378
<filename>weave/setup.py #!/usr/bin/env python from __future__ import absolute_import, print_function from os.path import join def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('weave',parent_package,top_path) config.add_data_di...
StarcoderdataPython
5120151
<gh_stars>100-1000 # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
StarcoderdataPython
4988995
<filename>AttentiveChrome/models.py from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from pdb import set_trace as stop def batch_product(iput, mat2): result = None for i in range(iput.size()[0]): op = torch.mm(iput[i], mat2) op = op.u...
StarcoderdataPython
1687434
import sys import dask.dataframe as dd from handling_data.handling_data import HandlingData from automl.mltrons_automl import MltronsAutoml ddf = dd.read_csv("titanic.csv") target_variable = 'Survived' problem_type = 'Classification' h = HandlingData(ddf, target_variable, problem_type) train_pool, test_pool, order_o...
StarcoderdataPython
9775046
from django.test import TestCase from app.numbercalc import add_number, subtract_number class AddTest(TestCase): def test_add_number(self): """this function will test the add_number function and will add 2 numbers""" self.assertEqual(add_number(5, 5), 10) def test_subtract_number(sel...
StarcoderdataPython
9789607
<filename>tests/unit_tests/data_steward/cdr_cleaner/cleaning_rules/update_family_history_qa_codes_test.py import unittest import constants.cdr_cleaner.clean_cdr as cdr_consts from cdr_cleaner.cleaning_rules import update_family_history_qa_codes as family_history class UpdateFamilyHistory(unittest.TestCase): @cl...
StarcoderdataPython