id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
3321340 | import os
a=321321
b=52132
c=str(format(100*b/a,".1f"))+"%"
print(c) | StarcoderdataPython |
1650265 | <reponame>mRcfps/wessup
import os
import logging
import time
from abc import ABC, abstractmethod
from collections import defaultdict
from pathlib import Path
import torch
import numpy as np
from tqdm import tqdm
from utils import underline, record
from utils.history import HistoryTracker
class BaseConfig:
"""A ... | StarcoderdataPython |
41857 | import click
from vlc_helper import vlcstart_precise
@click.command()
@click.argument('filename', nargs=1, default='')
@click.argument('starttime', nargs=1, default='')
@click.argument('stoptime', nargs=1, default='')
def main(filename, starttime, stoptime):
"""Start filename at specific start time (and/or end at... | StarcoderdataPython |
3384040 | # coding=utf-8
import click
import os
import io
import sys
import pybee
from pybee.path import working_dir
current_dir = os.path.abspath(os.getcwd())
script_dir = os.path.abspath(os.path.dirname(__file__))
#default_build_dir = os.path.join(script_dir, 'build')
default_build_dir = os.path.expanduser('~/manjaro-linux... | StarcoderdataPython |
3374745 | from pyvista import examples
dataset = examples.download_frog() # doctest:+SKIP
#
# See :ref:`volume_rendering_example` for an example using
| StarcoderdataPython |
4805226 | <reponame>eadwinCode/django-ninja
from ninja.security import APIKeyCookie
class CookieKey(APIKeyCookie):
def authenticate(self, request, key):
if key == "supersecret":
return key
cookie_key = CookieKey()
@api.get("/cookiekey", auth=cookie_key)
def apikey(request):
return f"Token = {req... | StarcoderdataPython |
4817497 | from .cart_pole import CartPole
from .beam_rider import BeamRider
from .cart_pole_frames import CartPoleFrames
from .space_invaders import SpaceInvaders
from .space_invaders_ram import SpaceInvadersRam
from .frozenlake import FrozenLake
from .environment import Environment
| StarcoderdataPython |
22611 | import argparse, os
import lib.config as config
import lib.utils as utils
def count_present_and_missing(cls, directory, metadata):
"""
Count present and missing videos for a class based on metadata.
:param cls: The class. If None, count all videos (used for testing videos - no classes).
:param direc... | StarcoderdataPython |
178462 | #
# From Ippsec YouTube video of HTB Arkham
#
# https://youtu.be/krC5j1Ab44I
#
from base64 import b64decode, b64encode
from hashlib import sha1
import pyDes, hmac
import requests
from cmd import Cmd
URL = "http://10.10.10.130:8080/userSubscribe.faces"
# Adding Cmd to get terminal functionality
class Terminal(Cmd)... | StarcoderdataPython |
1768016 | <gh_stars>1-10
import os
import time
import json
import zipfile
import StringIO
import datetime
import traceback
import requests
from collections import OrderedDict, defaultdict
from sqlalchemy import distinct, func, or_, not_
from sqlalchemy.orm import joinedload
from flask import Blueprint, make_response, render_t... | StarcoderdataPython |
143737 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from . import get_logger
from .tracklist import TracklistManager
from .episode import Episode
from .history import History
from .podcast import PodcastManager
def generate_podcasts():
try:
get_logger().info("Getting episode information from get_iplayer histor... | StarcoderdataPython |
3218214 | import unittest
from user import User
from credentials import Credentials
class TestLocker(unittest.TestCase):
"""
Test class that defines test cases for the contact class behaviours.
Args:
unittest.TestCase: TestCase class that helps in creating test cases
"""
def setUp(self):
''... | StarcoderdataPython |
3364546 | <gh_stars>1-10
#!/usr/bin/env python3
from olctools.accessoryFunctions.accessoryFunctions import make_path, filer, GenObject, MetadataObject, relative_symlink
from glob import glob
import os
__author__ = 'adamkoziol'
class ObjectCreation(object):
def createobject(self):
# Grab any .fastq files in the path... | StarcoderdataPython |
84238 | <filename>deploy/examples/basic/basic.py
#!/usr/bin/env/python
import os
import time
from datetime import datetime
import boto3
from botocore.client import Config
minio_url = os.environ["MINIO_URL"]
minio_secure = os.environ["MINIO_SECURE"]
minio_access_key = os.environ["MINIO_ACCESS_KEY"]
minio_secret_key = os.envir... | StarcoderdataPython |
1750170 | <filename>adaptation_methods/adapt_BNC.py
from adaptation_methods.base_model import BaseEncoderClass, TrainerTraceLog
import mxnet as mx
from mxnet import nd, gluon, autograd
class BNC(BaseEncoderClass):
# BatchNorm Classifier (BNC)
# source-free unsupervised domain adaptation method
# trains on source do... | StarcoderdataPython |
3260121 | from uuid import uuid4
from datetime import datetime
from db_helper.connector import connect, close
from db_helper.models import User, Message, MESSAGE_STATUS
from trace import trace_info
from helpers import set_json
def active_user_list(scope):
connect()
user_list = []
valid_info = User.sele... | StarcoderdataPython |
1610687 | <reponame>ChenJiR/MyPyUnittest<gh_stars>0
import json
from .case_drive import case_drive
from .case_drive_config import *
from .my_testcase import my_testcase
from ..env_config import *
from ..helper import *
try:
import xlrd
except BaseException as e:
print(e)
print('检测到未安装xlrd模块,现在开始安装......')
try:
... | StarcoderdataPython |
1605558 | <reponame>mjoppich/tabula-muris<filename>00_data_ingest/dowload_han_data.py
import urllib.request
import os
with open("han_data/han_metadata.csv") as fin:
for line in fin:
aline = line.strip().split(",")
gsm = aline[0]
if gsm == None or not gsm.startswith("GSM"):
continue
... | StarcoderdataPython |
1752693 | <reponame>Trevol/keras-retinanet
import os
import sys
from keras_retinanet.bin.convert_model import main as convertModel
os.environ["CUDA_VISIBLE_DEVICES"] = ""
def main():
args = [
'./snapshots/resnet50_csv_07.h5', # model_in
'resnet50_random_shapes_07_ellipses.h5' # model_out
]
conver... | StarcoderdataPython |
1677605 | <filename>doxy2swig.py<gh_stars>0
#!/usr/bin/env python
"""doxy2swig.py [options] index.xml output.i
Doxygen XML to SWIG docstring converter (improved version).
Converts Doxygen generated XML files into a file containing docstrings
for use by SWIG.
index.xml is your doxygen generated XML file and output.i is where t... | StarcoderdataPython |
1699475 | <gh_stars>10-100
from django.conf import settings
from django.conf.urls.defaults import url, include, patterns, handler404, handler500
from django.contrib import admin
from complaints.views import ComplaintsApp
from sillywalks import views
admin.autodiscover()
urlpatterns = patterns('',
url('^$', 'django.views.g... | StarcoderdataPython |
28331 | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo, Length
from app.models import User
from flask import request
class CreateChallengeForm(FlaskForm):
name = StringField('... | StarcoderdataPython |
1684160 | <filename>games/necrowar/game.py<gh_stars>1-10
# Game: Send hordes of the undead at your opponent while defending yourself against theirs to win.
# DO NOT MODIFY THIS FILE
# Never try to directly create an instance of this class, or modify its member variables.
# Instead, you should only be reading its variables and c... | StarcoderdataPython |
3328063 | <reponame>BatedUrGonnaDie/salty_bot
#! /usr/bin/env python3.7
import modules.apis.api_base as api
class NewbsAPI(api.API):
def __init__(self, headers=None, cookies=None):
super(NewbsAPI, self).__init__("https://leagueofnewbs.com/api", headers=headers, cookies=cookies)
def add_textutil(self, channel... | StarcoderdataPython |
43004 | <gh_stars>0
from setuptools import setup
setup(
name='InterWorkshop',
version='1.0.0.dev1',
packages=['gmad', 'workshop'],
url='doctor-internet.dev',
license='MIT',
author='<NAME>',
author_email='<EMAIL>',
description='A Python binding for the Steam Workshop API',
install_requires=[... | StarcoderdataPython |
167072 | <gh_stars>10-100
# pylint: disable=redefined-outer-name, unused-argument
import itertools
import operator
import numpy as np
import pytest
import buzzard as buzz
from buzzard.test.tools import assert_tiles_eq
from buzzard.test import make_tile_set
def is_invalid(tup):
w, h, pox, poy = tup
return (
p... | StarcoderdataPython |
3245334 | <filename>Lib/lib2to3/tests/test_pytree.py
#!/usr/bin/env python2.5
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Unit tests for pytree.py.
NOTE: Please *don't* add doc strings to individual test methods!
In verbose mode, printing of the module, class and metho... | StarcoderdataPython |
3243590 | <gh_stars>0
import socket
import threading
WEBROOT = "webroot"
def handle_client(c, addr):
print(addr, "connected.")
with c:
request = c.recv(1024)
# Parse HTTP headers
headers = request.split(b"\r\n")
file = headers[0].split()[1].decode()
# Load file content
... | StarcoderdataPython |
3346744 | <reponame>Grace-Amondi/SODO<filename>pavement.py
# -*- coding: utf-8 -*-
# This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7014 (FEB 2012)
import os
import sys
import time
from p... | StarcoderdataPython |
152451 | <gh_stars>0
import sys
from check import *
# from for_dev import *
import getpass
import os
print("Booting program...")
print()
# check internet connection
print("Checking internet connection...")
connection = check_internet()
if connection == True:
print("Connection complete!")
else:
print("Connection failed... | StarcoderdataPython |
3223940 | from __future__ import absolute_import
from __future__ import print_function
import math
from psi4.driver.qcdb.physconst import *
from psi4.driver.qcdb.cov_radii import *
"""
This code is primarily written by <NAME>
"""
#TODO: implement penalty scores in bond algorithm
#TODO: enable radicals/charged species to have b... | StarcoderdataPython |
1634425 | from __future__ import unicode_literals
import base64
import uuid
from datetime import timedelta
import logging
from django.db import models
# from django.db.models import Q
from django.contrib.auth import get_user_model
from django.core import urlresolvers, signing
from django.core.exceptions import ValidationError
... | StarcoderdataPython |
153439 | import tensorflow as tf
from wacky_rl import losses
from itertools import count
class SoftValueLoss(losses.WackyLoss):
_ids = count(0)
def __init__(self, logger=None):
super().__init__()
self.logger = logger
self.id = next(self._ids)
def __call__(self, prediction, log_probs, q):
... | StarcoderdataPython |
3376036 | '''
Created on May 22, 2015
@author: hsorby
'''
ELEMENT_OUTLINE_GRAPHIC_NAME = 'element_outline'
IMAGE_PLANE_GRAPHIC_NAME = 'image_plane'
| StarcoderdataPython |
1632110 | <gh_stars>10-100
"""
Recipes available to data with tags ['GNIRS', 'CAL', 'DARK'].
Default is "makeProcessedFlat".
"""
recipe_tags = {'GNIRS', 'CAL', 'DARK'}
from geminidr.gnirs.recipes.sq.recipes_DARK import makeProcessedDark
_default = makeProcessedDark
| StarcoderdataPython |
3259460 | import hashlib
from DAL.DAL_CreateAccount import DAL_CreateAccount
class BUS_CreateAccount():
def __init__(self):
self.dalCreateAccount = DAL_CreateAccount()
def loadData(self):
dataEmplHaveNotAcc = self.dalCreateAccount.selectEmployeeHaveNotAccount()
dataEmpHaveAcc = self.dalCreateAcc... | StarcoderdataPython |
3323614 | from sklearn.svm import LinearSVC
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
import importlib
import ObjectDetection as od
importlib.reload(od)
import ObjectDetection as od
import importlib
importlib.reload(od)
import numpy a... | StarcoderdataPython |
1600221 | <filename>1skupina/repCreep/rCreep.py
# Amplitudni test
# Definicije potrebne za analizo parametrov
import csv
import numpy as np
from lmfit import minimize, Parameters, fit_report
def podatki(filename,stVrst):
# INITIALIZE LISTS
time = []
shear = []
strain = []
comp = []
# READ FROM CSV FIL... | StarcoderdataPython |
143168 | def extractLasciviousImouto(item):
"""
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'].replace('-', '.'))
if not (chp or vol) or 'preview' in item['title'].lower():
return None
if 'The Beast of the 17th District' in item['tags'] or 'the beast of the 17th district' in item['title'].l... | StarcoderdataPython |
3280343 | <reponame>gandhi56/swift<gh_stars>1000+
from .Child import Child
from .Node import Node # noqa: I201
AVAILABILITY_NODES = [
# availability-spec-list -> availability-entry availability-spec-list?
Node('AvailabilitySpecList', kind='SyntaxCollection',
element='AvailabilityArgument'),
# Wrapper for ... | StarcoderdataPython |
1664037 | <gh_stars>0
# -*- coding:utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from shopkit.payment import PaymentProvider, PaymentType
class SimplePaymentProvider(PaymentProvider):
typ = 'simple_payment'
name = _('Simple cash payment.')
def __init__(self, *args, **kwargs):
super(Simp... | StarcoderdataPython |
1732589 | <gh_stars>10-100
"""Third Reality button devices."""
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import Basic, LevelControl, MultistateInput, OnOff, Ota
from zhaquirks import CustomCluster, PowerConfigurationCluster
from zhaquirks.const import (
COMMAND,
... | StarcoderdataPython |
4800465 | from typing import Union
import pymysql
__all__ = (
'mysql'
)
mysql_passwd = False
mysql: pymysql = None
mysql_constants: pymysql.constants = None
try:
import pymysql as mysql
from pymysql import constants as mysql_constants
except ImportError:
try:
import MySQLdb as mysql
mysql_pas... | StarcoderdataPython |
3394207 | <gh_stars>1-10
from sema.common import get
import os
import lxml.etree as ET
def create_setting_file(path):
"""Returns 200: Successful,
701: Selected file is a .setting file
702: Selected file is a .setting.xml file"""
if os.path.isfile(path + '.setting'):
return 701
if os.path.isfi... | StarcoderdataPython |
3372344 | from hks_pylib.errors import HKSPylibError
class LoggerError(HKSPylibError):
"The exception is raised by failures in logger module."
class LogConfigError(LoggerError):
"The exception is raised by failures related to LogConfig elements."
| StarcoderdataPython |
1651216 | <filename>videos/views.py
from django.shortcuts import redirect, render
import os
from PIL import Image
from io import BytesIO
from django.core.files.base import ContentFile
from gallery.utils import generate_caption, generate_tags, correct_spell_and_meaning
from .models import Video, ExtractedFrame, FrameTag, FrameC... | StarcoderdataPython |
54966 | import urllib2
import gzip
import re
import sys
from StringIO import StringIO
from bs4 import BeautifulSoup
__author__ = 'cheyulin'
def loadData(url):
request = urllib2.Request(url)
request.add_header('Accept-encoding', 'gzip')
response = urllib2.urlopen(request)
print response.info().get('Content-En... | StarcoderdataPython |
3306297 | #
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: BSD-3-Clause
#
import logging
import pkg_resources
from typing import List, Dict, Optional, Tuple, Union, TYPE_CHECKING
from copy import deepcopy
import torch
import numpy as np
from art.estimators.object_detection.object_detector import ObjectDet... | StarcoderdataPython |
93562 | <filename>autodiff/__init__.py
from .tensor import Tensor | StarcoderdataPython |
1645536 | <gh_stars>0
import cv2
video = cv2.VideoCapture(0)
classificadorFace = cv2.CascadeClassifier('cascades\\haarcascade_frontalface_default.xml')
while True:
conectado, frame = video.read()
#print(conectado)
#print(frame)
frameCinza = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
facesDetectadas... | StarcoderdataPython |
3363551 | from cadence.cadence_types import TimeoutType
class IllegalStateException(BaseException):
pass
class IllegalArgumentException(BaseException):
pass
class WorkflowTypeNotFound(Exception):
pass
class NonDeterministicWorkflowException(BaseException):
pass
class ActivityTaskFailedException(Exceptio... | StarcoderdataPython |
1604917 | <filename>diploshic/makeFeatureVecsForChrArmFromVcfDiploid.py
import os
import allel
import h5py
import numpy as np
import sys
import time
from diploshic.fvTools import *
if not len(sys.argv) in [13, 15]:
sys.exit(
"usage:\npython makeFeatureVecsForChrArmFromVcfDiploid.py vcfFileName chrArm chrLen targetPo... | StarcoderdataPython |
1665918 | <filename>app/branches/admin.py
from django.contrib import admin
from .models import Clinic, Specialization
admin.site.register(Clinic)
admin.site.register(Specialization) | StarcoderdataPython |
1699385 | from C4_Factory_Pattern.Ex2_PizzaStore_SimpleFactory.PizzaStore.PizzaStore import PizzaStore
from C4_Factory_Pattern.Ex2_PizzaStore_SimpleFactory.SimpleFactory.SimplePizzaFactory import SimplePizzaFactory
if __name__ == '__main__':
# A simple factory object will handle of different Pizza class creation
factor... | StarcoderdataPython |
3218380 | # -*- coding: utf-8 -*-
"""
Created on Jun 16 22:39:34 2016
@author: AnkitSingh
"""
from Imagehandler import Imagehandler
import yaml
import glob
import os
def App():
with open('config.yml', 'r') as ymlfile:
cfg = yaml.load(ymlfile)
IOPlaces = cfg['Main']
input = IOPlaces['Input']
output = ... | StarcoderdataPython |
4821994 | <gh_stars>0
import pygame
import math
import random
import time
class Zombie():
def __init__(self, game, ent_id, x, y):
self.game = game
self.ent_id = ent_id
self.x = x
self.y = y
self.v = 0.5
self.vx=0
self.vy=0
self.radius=15
self.contact_ra... | StarcoderdataPython |
3246729 | #! /usr/bin/python3
import os
import sys
import re
from datetime import datetime
from pathlib import PurePosixPath
import alfred
import babel.dates
grep_pattern = re.compile(r'^(.*?):\d+:\d+:(.*)')
archive_file_pattern = re.compile(r'^\d+')
text_todo_pattern = re.compile(r'#todo: ')
class Item(dict):
def __init... | StarcoderdataPython |
1738704 | <reponame>amrout/lichess_python_SDK
from typing import TYPE_CHECKING
from lichess_client.abstract_endpoints.abstract_messaging import AbstractMessaging
from lichess_client.utils.enums import RequestMethods
from lichess_client.utils.hrefs import MESSAGES_SEND
if TYPE_CHECKING:
from lichess_client.clients.base_clie... | StarcoderdataPython |
3368964 | #!env/bin/python
"""
Item models.
"""
from .item import Item
from .item_image import ItemImage
| StarcoderdataPython |
184411 | <reponame>rx294/Sherlock
# CAR_2013_05_004: Execution with AT
# In order to gain persistence, privilege escalation, or remote execution, an
# adversary may use the Windows built-in command AT (at.exe) to schedule a
# command to be run at a specified time, date, and even host. This method has
# been used by adversaries... | StarcoderdataPython |
166845 | import pytest
from application import create_app
@pytest.fixture()
def testapp(request):
app = create_app()
client = app.test_client()
def teardown():
pass
request.addfinalizer(teardown)
return client
| StarcoderdataPython |
4839957 | #!/usr/bin/python3
# Link a python source tree into a single self-executing zip archive.
# The zip can also be extracted and run manually.
#
# Distributed under a BSD license.
# Copyright (c) 2012-2014 <NAME>
import io
import compileall
import imp
import importlib
import marshal
import optparse
import os
import shuti... | StarcoderdataPython |
3354013 | <filename>pywinautofiles/examples/mspaint.py<gh_stars>0
# GUI Application automation and testing library
# Copyright (C) 2006 <NAME>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; eith... | StarcoderdataPython |
37065 | <gh_stars>1-10
#!/usr/bin/env python3
# Move and rename fastq files downloaded from FGF's FTP site.
#
# Usage:
#
# python3 arrange-fastq.py indir outdir
#
# indir - Highly nested directory structure from downloading data
# outdir - New output directory (created if does not exist)
#
# Ex:
#
# python3 arrange-fastq.py f... | StarcoderdataPython |
18959 | class Solution(object):
def isUgly(self, num):
"""
:type num: int
:rtype: bool
"""
if num <= 0:
return False
for x in [2,3,5]:
while(num % x ==0):
num /= x
return num==1 | StarcoderdataPython |
3240301 | <reponame>qiaozhijian/vLPD-Net
import os
import pickle
import sys
import numpy as np
import pandas as pd
from sklearn.neighbors import KDTree
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.abspath(os.path.join(BASE_DIR, "..")))
from tqdm import tqdm
from glob i... | StarcoderdataPython |
1701767 | #!/usr/bin/env python
from time import time
from base64 import b32encode, b32decode, b16decode
from hashlib import sha1
from struct import pack, unpack
import argparse
import datetime, calendar
# When provided with a Tor hidden service 'service_id', this script should output
# the predicted desc_id's which will be use... | StarcoderdataPython |
1791708 | <gh_stars>1-10
#!/usr/bin/env python
#
# Copyright 2019 DFKI GmbH.
#
# 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 use, cop... | StarcoderdataPython |
3379612 | <reponame>gcambara/cape
import math
from typing import Optional, Union
from einops import rearrange, repeat
import torch
from torch import nn
from torch import Tensor
class CAPE1d(nn.Module):
def __init__(self, d_model: int, max_global_shift: float = 0.0, max_local_shift: float = 0.0,
max_global_s... | StarcoderdataPython |
1714540 | <gh_stars>1-10
import os
import numpy as np
import pandas as pd
import seaborn as sn
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras.utils import to_categorical
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
from tensorflow.keras.preproces... | StarcoderdataPython |
141820 | from subject import *
from data_structure import *
import json as js
import networkx as nx
from graphviz import Digraph as dg
from draw_graph import *
from sys import exit, argv
from main import write_all_data_for_major
dataStructure = Data_structure()
graph = dataStructure.getGraph()
data = dataStructure... | StarcoderdataPython |
176476 | # Generated by Django 2.1.13 on 2020-10-08 20:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('clubs', '0006_club_slug_unique'),
migrations.swappable_depende... | StarcoderdataPython |
4838339 | # CF custom module.
"""
Utilities for transforming data.
"""
from copy import deepcopy
from itertools import filterfalse
def clean_data_extra(value, pattern):
if 'extra' in value:
value = deepcopy(value) # Preserve original data, might be used by other extractors.
value['extra'] = clean_lines(v... | StarcoderdataPython |
3306552 | from __future__ import division,print_function
__author__ = '<NAME> <<EMAIL>>'
"""
A module for convenient access to Kepler stellar table
"""
import pandas as pd
import numpy as np
import os,os.path
from . import koiutils as ku
from .cfg import KEPUTILS
STELLARFILE = os.path.join(KEPUTILS, 'keplerstellar_q17.csv')... | StarcoderdataPython |
1690845 | import requests
from bs4 import BeautifulSoup, SoupStrainer
import sys
from PyQt5 import QtWidgets, QtGui, QtCore
from PIL import Image
from PIL.ImageQt import ImageQt
from io import BytesIO
import platform
worldometers_url = "https://www.worldometers.info"
main_url = "https://www.worldometers.info/coronavirus/"
heade... | StarcoderdataPython |
3329688 | <reponame>htdt/diqn<filename>train.py<gh_stars>1-10
import sys
import torch
import yaml
from tqdm import trange
from core.exploration import DecayingEpsilon
from common.find_checkpoint import find_checkpoint
from common.logger import Logger
from iqn.runner import EnvRunner
from from_config import get_agent, get_buffer,... | StarcoderdataPython |
51452 | # coding=utf-8
# Copyright (c) DIRECT Contributors
from dataclasses import dataclass
from direct.config.defaults import ModelConfig
@dataclass
class EndToEndVarNetConfig(ModelConfig):
num_layers: int = 8
regularizer_num_filters: int = 18
regularizer_num_pull_layers: int = 4
regularizer_dropout: float... | StarcoderdataPython |
4833099 | from .region import *
from fractions import Fraction
from numpy import inf
RESULTS = {"ExistsViolated": -2, "CenterViolated": -2, "AllViolated": -1,
"Unknown": 0, "ExistsBoth": 0,
"AllSat": 1, "CenterSat": 2, "ExistsSat": 2}
class Parser():
def __init__(self):
self.regions = []
... | StarcoderdataPython |
3314407 | casa = float(input('Valor da casa: '))
salario = float(input('Salário do comprador: '))
anos = int(input('Quantos anos de financiamento? '))
prest = casa / (anos * 12)
print('Para pagar uma casa de R${:.2f} em {} anos, a prestação será R${:.2f}.'.format(casa, anos, prest))
if prest > 0.3 * salario:
print('Emprés... | StarcoderdataPython |
1776407 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_dynrbac import DynRBAC
from flask_dynrbac.domain_model_generator import DomainModelGenerator
from flask_dynrbac.api import generate_rbac_api
try:
from db_setups import *
except ImportError:
from .db_setups import *
@pytest.fixture
de... | StarcoderdataPython |
3301484 | <filename>env/MiniWorld.py
# -*- coding:utf-8 -*-
# Time : 2021/02/28 16:33
# Author: <NAME>
from env.simulators.game import Game
from env.obs_interfaces.observation import *
import numpy as np
import json
from utils.discrete import Discrete
from utils.box import Box
import gym
import gym_miniworld
class MiniWorld... | StarcoderdataPython |
3361714 | <filename>dfvfs/file_io/encoded_stream_io.py
# -*- coding: utf-8 -*-
"""The encoded stream file-like object implementation."""
import os
from dfvfs.encoding import manager as encoding_manager
from dfvfs.file_io import file_io
from dfvfs.lib import errors
from dfvfs.resolver import resolver
class EncodedStream(file_... | StarcoderdataPython |
72304 | <gh_stars>0
from PyInquirer import prompt
from utils.terminal import print_title
questions = [
{
'type': 'list',
'name': 'scope',
'message': 'Quelle élection supprimer ?',
'choices': [
{'name': 'Supprimer tous les utilisateurs', 'value': 'delete_users'},
{'name': 'Supprimer toutes les ele... | StarcoderdataPython |
1609960 | <reponame>shubhamrauniyar/angela<gh_stars>10-100
algorithm='pg'
env_class='Gym'
model_class='SingleHiddenLayer'
environment = {
'name': 'LunarLander-v2',
}
model = {
'state_size': 8,
'action_size': 4,
'fc_units': 32
}
agent = {
'lr': 0.005
}
train = {
'n_episodes': 5000,
'max_t': 2000,
... | StarcoderdataPython |
1732193 | """new study info data points
Revision ID: 9afbd55082a0
Revises: <KEY>
Create Date: 2021-09-17 10:31:05.094062
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
op.add_col... | StarcoderdataPython |
3216923 | <reponame>sumitb/mcoc-v3<filename>mcoc/cdt_core/mcoc_math.py
from ..abc import MixinMeta
class McocMath(MixinMeta):
@staticmethod
def from_flat(flat, ch_rating):
denom = 5 * ch_rating + 1500 + flat
return round(100 * flat / denom, 2)
@staticmethod
def to_flat(per, ch_rating):
... | StarcoderdataPython |
1733043 | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | StarcoderdataPython |
1679516 | import json
from discord.ext.commands import Bot
version = 'v0.1.0'
bot = Bot(command_prefix="~/", self_bot=True)
with open('data/config.json', 'r') as file:
info = json.loads(file.read())
user_token = info['user_token']
bot.load_extension('cogs.catch')
bot.load_extension('cogs.utils')
@bot.event
async de... | StarcoderdataPython |
192591 | <reponame>rishan92/DACBench
from dacbench.envs.luby import LubyEnv, luby_gen
from dacbench.envs.sigmoid import SigmoidEnv
from dacbench.envs.fast_downward import FastDownwardEnv
from dacbench.envs.cma_es import CMAESEnv
from dacbench.envs.modea import ModeaEnv
__all__ = [
"LubyEnv",
"luby_gen",
"SigmoidEnv... | StarcoderdataPython |
147602 | <reponame>drunkwater/leetcode<filename>medium/python/c0089_166_fraction-to-recurring-decimal/00_leetcode_0089.py<gh_stars>0
# DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#166. Fraction to Recurring De... | StarcoderdataPython |
3290796 | import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('parkings', '0017_region'),
]
operations = [
migrations.RemoveField(
model_name='parkingarea',
name='region', ),
migrations.Ad... | StarcoderdataPython |
1749264 | <gh_stars>0
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | StarcoderdataPython |
1624880 | <filename>bokbok/__init__.py
__license__ = """
Copyright 2012 DISQUS
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 la... | StarcoderdataPython |
1768161 | <gh_stars>0
from django.contrib import admin
from django import forms
from .models import Artist
from categories.models import Category
# Register your models here.
class ArtistForm(forms.ModelForm):
categories_str = forms.CharField(label='Category', required=False)
aliases_str = forms.CharField(label='Aliase... | StarcoderdataPython |
1710562 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created on 2017-03-2
# Project: Handler
import os
import time
import json
import redis
import string
import codecs
import datetime
import traceback
from django.conf import settings
from django.utils.encoding import smart_unicode
from libs.database.mongod... | StarcoderdataPython |
1670498 | <reponame>mhitzem/SIMPL
# Pipeline :
# This pipeline is designed to test the Copy Object filter
import simpl
import simplpy
import simpl_helpers as sh
import simpl_test_dirs as sd
def copy_object_test():
# Create Data Container Array using simpl directly
dca = simpl.DataContainerArray()
# Create a Data ... | StarcoderdataPython |
3297475 | <filename>malib/algorithm/maddpg/trainer.py
from malib.algorithm.common.trainer import Trainer
from malib.utils.episode import EpisodeKey
from .loss import MADDPGLoss
class MADDPGTrainer(Trainer):
def __init__(self, tid):
super(MADDPGTrainer, self).__init__(tid)
self._loss = MADDPGLoss()
def ... | StarcoderdataPython |
70870 | <reponame>nistefan/cmssw
import FWCore.ParameterSet.Config as cms
#from RecoTauTag.RecoTau.PFRecoTauQualityCuts_cfi import *
from RecoTauTag.RecoTau.TauDiscriminatorTools import requireLeadTrack
caloRecoTauDiscriminationByInvMass = cms.EDProducer("CaloRecoTauDiscriminationByInvMass",
CaloTauProducer = cms.Inp... | StarcoderdataPython |
3384472 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
#
# TITLE :
# AUTHOR :
# PROJECT :
#
# ----------------------------------------------------------------------------
# Docstring
"""**DOCSTRING**.
description
Routine Listings
----------------
plotRotcurve
plotK... | StarcoderdataPython |
3311857 | import os
import numpy as np
import pandas as pd
from analysis.correlations import clean_corr_data, combine_corr_matrix
from utils.save_data import write_csv
from visualize.all_tasks import save_plot
import seaborn as sns
import matplotlib.pyplot as plt
def corr_analysis_choice(data_trial, data_subject, path_plots,... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.