max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
assignment1/q2_neural.py | gyubokLee/CS224 | 125 | 12770851 | <reponame>gyubokLee/CS224
import numpy as np
import random
from q1_softmax import softmax
from q2_sigmoid import sigmoid, sigmoid_grad
from q2_gradcheck import gradcheck_naive
def affine_forward(x, w, b):
"""
Computes the forward pass for an affine (fully-connected) layer.
The input x has shape (N, d_1, ... | 3.40625 | 3 |
functions/loginAoxiang.py | Steve-Xyh/AutoAoxiang | 7 | 12770852 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
import getpass
from bs4 import BeautifulSoup
from . import formatString
from .getInfo import remove_cache
def login(user='', passwd='', url_login='https://uis.nwpu.edu.cn/cas/login', keyword='Log In Successful'):
'''
使用POST方法登录
#### Paramete... | 2.75 | 3 |
settings.py | khaledboka/point_to_line | 0 | 12770853 | <reponame>khaledboka/point_to_line
# this file is excuted from cartoview.app_manager.settings using exec_file
import os
import point_to_line
app_folder = os.path.dirname(point_to_line.__file__)
| 1.445313 | 1 |
LeetCode/Problems/31_next_permutation.py | hooyao/LeetCode-Py3 | 0 | 12770854 | <filename>LeetCode/Problems/31_next_permutation.py
import sys
class Solution:
def nextPermutation(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
last_val = nums[-1]
for i in reversed(range(len(nums) - 1)... | 3.828125 | 4 |
ElevatorBot_old/functions/dataLoading.py | LukasSchmid97/destinyBloodoakStats | 3 | 12770855 | <reponame>LukasSchmid97/destinyBloodoakStats
import asyncio
from datetime import datetime
from ElevatorBot.database.database import (
get_connection_pool,
lookupDiscordID,
insertPgcrActivities,
getPgcrActivity,
insertPgcrActivitiesUsersStats,
insertPgcrActivitiesUsersStatsWeapons,
getFailTo... | 2.75 | 3 |
Leader.py | Jubas/index-cost-sim | 1 | 12770856 | #imports
import Cluster
import math
class Leader():
def __init__(self, i, height, leader=None):
# represents local level id
self.identity = i
# Leader of this leader (if any)
self.leader = leader
# height of this leader in the tiers
self.height = heigh... | 3.15625 | 3 |
examples/cli.py | b3cch4/hug | 1 | 12770857 | <gh_stars>1-10
"""A basic cli client written with hug"""
import hug
@hug.cli(version="1.0.0")
def cli(name: '<NAME>', age: hug.types.number):
"""Says happy birthday to a user"""
return "Happy {age} Birthday {name}!\n".format(**locals())
if __name__ == '__main__':
cli.interface.cli()
| 2.375 | 2 |
setup.py | tclarke/ricecomp-cfitsio-python | 2 | 12770858 | from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
setup(
name="ricecomp-cfitsio",
version="1.0",
description="Rice compression and decompression for Python.",
long_description="Rice comression and decompression using the routines in the cfitsi... | 1.523438 | 2 |
discern/mmd/mmd.py | imsb-uke/discern | 0 | 12770859 | <filename>discern/mmd/mmd.py
"""Module to select the mmd loss function."""
import logging
from typing import Tuple
import numpy as np
_LOGGER = logging.getLogger(__name__)
try: # pragma: no cover
from discern.mmd._mmd import _mmd_loop as _mmd_loop_c
USE_C_IMPLEMENTATION = True
except (ImportError, ModuleNo... | 2.421875 | 2 |
solver.py | ishaanshah/Eight_solver | 0 | 12770860 | <reponame>ishaanshah/Eight_solver
# This is a program that solves the 8 puzzle using the a* algorithm
# Game logic and design by arnisritins. https://github.com/arnisritins/15-Puzzle.
import copy
import time
from collections import deque
from operator import attrgetter
from selenium import webdriver
from selenium.comm... | 3.453125 | 3 |
scratch_2.py | ddsanchezc/PythonSourceCode | 0 | 12770861 | <filename>scratch_2.py<gh_stars>0
temp=int(input("Ingrese la temperatura"))
print("f° c°")
for temp in range(0,temp,2):
print(temp," ",int((temp-32)*5/9))
| 3.953125 | 4 |
baselines/a2c/a2c.py | andrewgough94/baselines | 0 | 12770862 | import os
import os.path as osp
import gym
import time
import datetime
import joblib
import logging
import numpy as np
import tensorflow as tf
from baselines import logger
from baselines.common import set_global_seeds, explained_variance
from baselines.common.vec_env.subproc_vec_env import SubprocVecEnv
from baselines... | 1.960938 | 2 |
backend/modules/event_manager.py | miversen33/ProjectPsittacosaurus | 9 | 12770863 | <gh_stars>1-10
import time
CALLBACK_EXPIRED_EVENT = 'Listener Expired'
CALLBACK_REGISTERED_EVENT = 'New Listener Registered'
ALL_EVENTS = '*'
GLOBAL_EVENTS = [
ALL_EVENTS,
CALLBACK_EXPIRED_EVENT,
CALLBACK_REGISTERED_EVENT,
]
__callbacks = {}
def emit(event: str, *args, **kwargs) -> None:
'''
Fir... | 2.875 | 3 |
app/app.py | tlsrio/ml | 0 | 12770864 | <gh_stars>0
from flask import Flask, request, json
import pipelines
from scrapers.scrapeContent import getContent, htmlToText
from scrapers.fetchArticles import fetchArticles
app = Flask(__name__)
@app.route("/api/")
def connected():
return "Connected"
@app.route("/api/summarize", methods=["POST"])
def summari... | 2.671875 | 3 |
biosteam/units/_multi_effect_evaporator.py | tylerhuntington222/biosteam | 0 | 12770865 | # -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020, <NAME> <<EMAIL>>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details.
"""
"""
import numpy as np... | 1.804688 | 2 |
bank/src/deposit_app/views/__init__.py | yuramorozov01/bank_system | 0 | 12770866 | from deposit_app.views.deposit_contract import DepositContractViewSet
from deposit_app.views.deposit_type import DepositTypeViewSet
| 1.101563 | 1 |
Pandas-dataframe/code.py | Sufi737/ga-learner-dsmp-repo | 2 | 12770867 | <filename>Pandas-dataframe/code.py
# --------------
# Import packages
import numpy as np
import pandas as pd
from scipy.stats import mode
bank = pd.read_csv(path,sep=',')
# code starts here
categorical_var = bank.select_dtypes(include = 'object')
print(categorical_var)
numerical_var = bank.select_dtypes(include = ... | 3.3125 | 3 |
tests/lemmatizer/test_lemmatizer.py | zavliju/nlp-id | 46 | 12770868 | <reponame>zavliju/nlp-id
from nlp_id.lemmatizer import Lemmatizer
def test_lemmatizer():
"""
test for Lemmatizer
"""
lemmatizer = Lemmatizer()
text = 'Saya sedang mencoba'
expected_result = 'saya sedang coba'
assert lemmatizer.lemmatize(text) == expected_result
| 2.703125 | 3 |
school_management_app/StudentViews.py | iamtomc/SchoolManagementSystem-Mandakh | 6 | 12770869 | import datetime
from django.contrib import messages
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.views.decorators.csrf import csrf_exempt
from django.core.files.storage import FileSystemStorage
from school_management_app.mod... | 1.875 | 2 |
linedrive/__init__.py | PoorBillionaire/linedrive | 0 | 12770870 | <filename>linedrive/__init__.py
from . import utils
from . import constants
from .websocket import GamecastWebsocket
| 1.101563 | 1 |
homecontrol/modules/esphome/entities.py | lennart-k/HomeControl | 7 | 12770871 | """HomeControl representation of ESPHome entities"""
from typing import TYPE_CHECKING, Any, Dict, Tuple
import voluptuous as vol
from homecontrol.dependencies.entity_types import Item
from homecontrol.dependencies.state_proxy import StateDef, StateProxy
from homecontrol.modules.switch.module import Switch
if TYPE_CH... | 2.5 | 2 |
ScottiePippen/grids.py | iancze/ScottiePippen | 1 | 12770872 | <reponame>iancze/ScottiePippen<filename>ScottiePippen/grids.py<gh_stars>1-10
import numpy as np
from scipy.interpolate import interp1d
from astropy.io import ascii
import ScottiePippen as SP
class IndexInterpolator:
'''
Object to return fractional distance between grid points of a single grid variable.
:... | 2.90625 | 3 |
original-paas/copy_to_container/www/spdpaas/src/app/features/commonUse/inMemoryDBHandle.py | yishan1331/docker-practice | 0 | 12770873 | # -*- coding: utf-8 -*-
#module description
"""
==============================================================================
created :
Last update: 03/31/2021
Developer: <NAME>
Lite Version 2 @Yishan08212019
API Version 1.0
Filename: inMemoryDBHandle.py
Description: 連接redis api
Total = 8 APIs
================... | 1.382813 | 1 |
example/development.py | cclauss/django-authority | 2 | 12770874 |
from example.settings import *
DEBUG=True
TEMPLATE_DEBUG=DEBUG
| 1.195313 | 1 |
main/class/attributes/attributes.py | catalinprescure/python-pages | 0 | 12770875 | <filename>main/class/attributes/attributes.py
# Class attributes ...
#
# Use dot to assign values to a class instance
class Point:
""" a 2D point """
p = Point()
p.x = 1
p.y = 2
assert p.x == 1
assert p.y == 2 | 3.25 | 3 |
mbio/server/endpoint.py | iluxonchik/mercedes-benz-io-challenge-2018-sinfo | 2 | 12770876 | <gh_stars>1-10
"""API endpoints."""
class Endpoint(object):
API_PREFIX = '/api/'
VEHICLES = API_PREFIX + 'vehicles/' # ?dealer=AAA?model=XXX?fuel=YYY?transmission=ZZZ
DEALERS_CLOSEST_LIST = API_PREFIX + 'dealers/' # ?dealer=AAA?model=XXX?fuel=YYY?transmission=ZZZ?latitude=LLL?longitude=OOO
DEALER_CLO... | 1.78125 | 2 |
tests/_test_google_student.py | ianchen-tw/invisible-hand | 2 | 12770877 | <gh_stars>1-10
from unittest.mock import patch
import pygsheets
import pytest
from hand.errors import ERR_REQUIRE_NO_SPACE, ERR_UNIQUE_STUDENT_ID
from hand.utils.google_student import Gstudents, pygsheetInteractor
# TODO:
# test if pygsheet work as supposed
class TestInteractor:
"""Test Interactor work properl... | 2.3125 | 2 |
visualize_vae.py | RohanCK/StyleTransfer | 0 | 12770878 | <reponame>RohanCK/StyleTransfer
import argparse
import matplotlib.pyplot as plt
import os
import torch
import torchvision.transforms as transforms
from PIL import Image
from torch.utils.data import DataLoader
from torchvision.datasets import ImageFolder
from utils.hyperparameters import DIM_LATENT, NORMALIZE_... | 2.265625 | 2 |
src/scripts/themis/job_runner/read_request_queues.py | anku94/themis_tritonsort | 11 | 12770879 | <gh_stars>10-100
#!/usr/bin/env python
import os, sys, argparse, redis, json
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir)))
import utils
def readable_read_request(read_request):
json_req = json.loads(read_request)
req_type = js... | 2.578125 | 3 |
setup.py | wfscheper/epdb | 63 | 12770880 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright (c) SAS Institute, Inc.
#
# 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 r... | 1.273438 | 1 |
pybtooth/media_player.py | elParaguayo/pybtooth | 2 | 12770881 | import dbus
from .base import BluetoothBase
from .constants import *
class BluetoothMediaPlayer(BluetoothBase):
TRACK_TYPES = {"Title": str,
"Artist": str,
"Album": str,
"Genre": str,
"NumberOfTracks": int,
"TrackNumbe... | 2.546875 | 3 |
rl_agent/pomm_network.py | AntonPotapchuk/playground | 0 | 12770882 | import tensorflow as tf
from keras import Model
from keras.layers import Convolution2D, BatchNormalization, Activation, Add, Dense
from keras.models import load_model
from tensorforce.core.networks import Network
from keras.engine import Input
class PommNetwork(Network):
def tf_apply(self, x, internals, up... | 2.59375 | 3 |
tests/unit/test_ext/test_pendulum.py | monoflo/bloop | 63 | 12770883 | <reponame>monoflo/bloop
from datetime import datetime
import pendulum
import pytest
import pytz
from bloop.ext.pendulum import DateTime, Timestamp
from bloop.types import FIXED_ISO8601_FORMAT
now = datetime.now(pytz.utc).replace(microsecond=0)
now_eastern = datetime.now(pytz.timezone("US/Eastern"))
now_iso8601 = no... | 2.1875 | 2 |
overhead/clicks.py | crossflag/trackActivity | 1 | 12770884 | import cv2
import sys
import numpy as np
import pyperclip as ppc
from tkinter import filedialog
from tkinter import *
def record_click(event,x,y,flags,param):
global mouseX,mouseY
if event == cv2.EVENT_LBUTTONDBLCLK:
mouseX,mouseY = x,y
point = "[" + str(mouseX) + ", " + str(mouseY) + "]"
cv2.d... | 2.859375 | 3 |
frontend/upload.py | davezen1/calc | 0 | 12770885 | from django import forms
class UploadWidget(forms.widgets.FileInput):
'''
This widget represents an upload widget that the user can
easily drag-and-drop files into.
It is tightly coupled to upload.js.
'''
def __init__(self, attrs=None, degraded=False,
accept=(".xlsx", ".xls"... | 2.390625 | 2 |
tests/memory/test_data.py | cjpit/selpi | 5 | 12770886 | <gh_stars>1-10
from binascii import Error
from exception import NotFoundException, OutOfBoundsException, ValidationException
from unittest import TestCase
from unittest.mock import Mock
from memory import Range, Data
from unittest_data_provider import data_provider
from exception import NotFoundException, ValidationExc... | 3 | 3 |
hur_tracker.py | Unidata/HurricaneTracker | 11 | 12770887 | <reponame>Unidata/HurricaneTracker
# -*- coding: utf-8 -*-
from StringIO import StringIO
import urllib2
import gzip
from pandas import Series, DataFrame
import numpy as np
from mpl_toolkits.basemap import Basemap
from collections import OrderedDict
from IPython.display import clear_output
from IPython.html import widge... | 2.484375 | 2 |
URY/pipelines.py | oDallas/URY | 0 | 12770888 | # -*- coding: utf-8 -*-
import os
from textwrap import fill
def wrap(text):
filled = fill(str(text[1]), width=120, initial_indent='# ' + text[0] + ': ', subsequent_indent='# ')
return '\n' + filled + '\n'
class ToPython(object):
def process_item(self, item, spider):
if spider.path:
... | 2.875 | 3 |
ch22-直方图/hist-normalized-numpy-2.py | makelove/OpenCV-Python-Tutorial | 2,875 | 12770889 | <filename>ch22-直方图/hist-normalized-numpy-2.py
# -*-coding:utf8-*-#
__author__ = 'play4fun'
"""
create time:15-10-24 下午5:26
"""
import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('../data/contrast75.png', 0)
# flatten() 将数组变成一维
hist, bins = np.histogram(img.flatten(), 256, [0, 256])
# ... | 2.71875 | 3 |
credentials-test.py | VictorKMaina/password-vault | 0 | 12770890 | from credentials import Credential
import unittest
class TestCredentials(unittest.TestCase):
"""
Class for testing credentials methods and behaviours
"""
def setUp(self):
"""
Create new instance of credential
"""
self.new_credential = Credential("Instagram", "victormaina... | 3.546875 | 4 |
asgard/http/client.py | ThalesSathler/asgard-api | 1 | 12770891 | from typing import Optional, Union
from aiohttp import ClientSession, ClientTimeout # type: ignore
from asgard import conf
default_http_client_timeout = ClientTimeout(
total=conf.ASGARD_HTTP_CLIENT_TOTAL_TIMEOUT,
connect=conf.ASGARD_HTTP_CLIENT_CONNECT_TIMEOUT,
)
class _HttpClient:
_session: Optional[... | 2.21875 | 2 |
lib/aquilon/worker/commands/publish.py | ned21/aquilon | 7 | 12770892 | <filename>lib/aquilon/worker/commands/publish.py
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2010-2018 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... | 1.984375 | 2 |
mp_server/_socket/server_socket.py | hopelife/mp_server | 0 | 12770893 | ## https://nowonbun.tistory.com/668
# 소켓을 사용하기 위해서는 socket을 import해야 한다.
import socket, threading
# binder함수는 서버에서 accept가 되면 생성되는 socket 인스턴스를 통해 client로 부터 데이터를 받으면 echo형태로 재송신하는 메소드이다.
def binder(client_socket, addr):
# 커넥션이 되면 접속 주소가 나온다.
print('Connected by', addr)
try:
# 접속 상태에서는 클라이언트로 부터 받을... | 2.71875 | 3 |
misago/misago/users/models/__init__.py | vascoalramos/misago-deployment | 2 | 12770894 | <gh_stars>1-10
from .rank import Rank
from .online import Online
from .user import AnonymousUser, User, UsernameChange
from .activityranking import ActivityRanking
from .avatar import Avatar
from .audittrail import AuditTrail
from .avatargallery import AvatarGallery
from .ban import Ban, BanCache
from .datadownload imp... | 1.109375 | 1 |
tests/test_protein.py | leoisl/hypothesis-bio | 0 | 12770895 | <reponame>leoisl/hypothesis-bio
from hypothesis import given
from .minimal import minimal
from hypothesis_bio import protein
@given(protein())
def test_protein_type(seq):
assert type(seq) == str
def test_smallest_example():
assert minimal(protein()) == ""
def test_smallest_example_3_letter_abbrv():
a... | 2.96875 | 3 |
rnn_net.py | AuCson/SEDST | 23 | 12770896 | <reponame>AuCson/SEDST
import torch
from torch import nn
import torch.nn.functional as F
import numpy as np
import math
from config import global_config as cfg
def cuda_(var, aux=None):
if not aux:
return var.cuda() if cfg.cuda else var
elif aux != 'cpu' and aux >= 0 and cfg.cuda:
return var.c... | 2.171875 | 2 |
flask_test/app/flaskr_tests.py | nwiizo/joke | 1 | 12770897 | import os
import flaskr
import unittest
import tempfile
class FlaskrTestCase(unittest.TestCase):
def setUp(self):
self.db_fd, flaskr.DATABASE = tempfile.mkstemp()
self.app = flaskr.app.test_client()
flaskr.init_db()
def tearDown(self):
os.close(self.db_fd)
os.unlink(fl... | 2.296875 | 2 |
src/software/thunderscope/thunderscope.py | jonl112/Software | 0 | 12770898 | import os
import signal
import argparse
import platform
# PyQt5 doesn't play nicely with i3 and Ubuntu 18, PyQt6 is much more stable
# Unfortunately, PyQt6 doesn't install on Ubuntu 18. Thankfully both
# libraries are interchangeable, and we just need to swap them in this
# one spot, and pyqtgraph will pick up on it... | 1.882813 | 2 |
main.py | balast/MartingaleBetSytemExpectedOutcomes | 2 | 12770899 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
pW = 0.48
pL = 1-pW
b_max = 500 #max bet ($)
def total_losses(b0, f, num_losses):
sum=0
for i in range(0, num_losses):
sum += f**i
return b0*sum
def net_winnings(b0, f, num_games):... | 3.046875 | 3 |
pyaud/exceptions.py | jshwi/pyaud | 2 | 12770900 | """
pyaud.exceptions
================
Exceptions for use within the module.
All exceptions made public for if they need to be reraised or excepted.
Exceptions are already built into the architecture but can be used in
new plugins as well.
"""
from typing import Optional as _Optional
class AuditError(Exception):
... | 2.859375 | 3 |
fingerExercises/fingerExercises-01/01.2-finger.while-exercise-02.py | sodaPhix/MITx-6.00.1x | 1 | 12770901 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 6 20:34:16 2019
@author: sodatab
MITx: 6.00.1x
"""
"""
01.2-Finger While Exercise 02
----------------------------
2. Convert the following into code that uses a while loop.
prints Hello!
prints 10
prints 8
prints 6
prints 4
prints 2
"""
"""Answ... | 4.25 | 4 |
manim.py | sailist/manim | 2 | 12770902 | <filename>manim.py<gh_stars>1-10
#!/usr/bin/env python
import manimlib
if __name__ == "__main__":
manimlib.main()
else:
manimlib.stream_starter.start_livestream()
| 1.359375 | 1 |
Huawei/ceshi/T2.py | zephyrus9/NewCoder | 0 | 12770903 | <reponame>zephyrus9/NewCoder
# -*-coding: utf-8 -*-
# Author:
"""题目描述
给出一组正整数,你从第一个数向最后一个数方向跳跃,每次至少跳跃1格,每个数的值表示你从这个位置可以跳跃的最大长度。计算如何以最少的跳跃次数跳到最后一个数。
输入描述:
第一行表示有多少个数n
第二行开始依次是1到n个数,一个数一行
输出描述:
输出一行,表示最少跳跃的次数。"""
import sys
n = input().strip()
nums = []
for i in range(int(n)):
nums.append(input())
print(nums)
sma... | 3.234375 | 3 |
python-watcher-2.0.0/watcher/tests/common/test_ironic_helper.py | scottwedge/OpenStack-Stein | 0 | 12770904 | # -*- encoding: utf-8 -*-
# Copyright (c) 2017 ZTE Corporation
#
# Authors:<NAME> <<EMAIL>>
# 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
#
# U... | 1.914063 | 2 |
mud/events/changeprop.py | erwanaubry/alamud_IUT_Escape | 0 | 12770905 | <reponame>erwanaubry/alamud_IUT_Escape<filename>mud/events/changeprop.py
# -*- coding: utf-8 -*-
# Copyright (C) 2014 <NAME>, IUT d'Orléans
#==============================================================================
from .event import Event2
class ChangePropEvent(Event2):
NAME = "change-prop"
def get_eve... | 2.0625 | 2 |
Abstract/GameEngine.py | BoogyWinterfell/friday-fun | 0 | 12770906 | import abc
from typing import List, Dict
from Abstract.GameAction import GameAction
from Abstract.EngineGameInfo import EngineGameInfo
class GameEngine(metaclass=abc.ABCMeta):
@abc.abstractmethod
def resolve_actions(self, actions: Dict[str, List[GameAction]], game_state: EngineGameInfo):
pass
| 2.859375 | 3 |
setup.py | movermeyer/circonus | 3 | 12770907 | <filename>setup.py
#!/usr/bin/env python
from setuptools import find_packages, setup
import codecs
with codecs.open("README.rst", "r", "utf-8") as f:
readme = f.read()
with codecs.open("HISTORY.rst", "r", "utf-8") as f:
history = f.read()
setup(
name="circonus",
version="0.0.22",
description="I... | 1.421875 | 1 |
platform/core/polyaxon/db/models/searches.py | hackerwins/polyaxon | 0 | 12770908 | from django.conf import settings
from django.contrib.postgres.fields import JSONField
from django.db import models
from constants import content_types
from db.models.abstract.diff import DiffModel
from db.models.abstract.nameable import NameableModel
class Search(DiffModel, NameableModel):
"""A saved search quer... | 2.140625 | 2 |
covid/serializers.py | YueZhao2019/covid-information-system-backend | 0 | 12770909 | from rest_framework import serializers
from covid.models import Covid
class CovidSerializer(serializers.ModelSerializer):
class Meta:
model = Covid
fields = '__all__'
| 1.8125 | 2 |
Chambers_Jess/Assignments/stars_part1.py | webguru001/Python-Django-Web | 5 | 12770910 | def draw_stars(list):
for value in list:
print "*" * value
| 2.6875 | 3 |
game/puzzle.py | tcdude/pyweek28 | 0 | 12770911 | <reponame>tcdude/pyweek28
"""
The 3 ring-puzzle to input the final code.
"""
__copyright__ = """
MIT License
Copyright (c) 2019 tcdude
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 res... | 2.046875 | 2 |
app/tests/conftest.py | ravewillow6383/model_relationships | 0 | 12770912 | <filename>app/tests/conftest.py
import pytest
from app import create_app, db
from config import Config
from app.models import Creature, Winged_Creature
class TestConfig(Config):
SQLALCHEMY_DATABASE_URI = 'sqlite://'
@pytest.fixture()
def client():
app = create_app(TestConfig)
app_contex... | 2.359375 | 2 |
explorerscript/source_map.py | End45/ExplorerScript | 0 | 12770913 | # MIT License
#
# Copyright (c) 2020-2021 Parakoopa and the SkyTemple Contributors
#
# 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... | 1.648438 | 2 |
vmware_nsxlib/tests/unit/v3/test_cluster_management.py | salv-orlando/vmware-nsxlib | 0 | 12770914 | # Copyright 2019 VMware, 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 a... | 1.867188 | 2 |
dedicated_Resnet50.py | SuperbTUM/Glaucoma-Screening-with-DENet | 0 | 12770915 | import torch
import torch.nn as nn
import torchvision.models as models
class ResNet50_Mod(nn.Module):
def __init__(self, input_size=640):
super().__init__()
resnet50 = models.resnet50(pretrained=True)
self.resnet = nn.Sequential(*(list(resnet50.children())[:-2]))
self.avepool = nn.... | 2.984375 | 3 |
app/views/alekseyl/active_record/__init__.py | iu5team/rms | 0 | 12770916 | from task import Task
from employee import Employee
| 1 | 1 |
python/lesson_1/binary_gap.py | fdietzsc/codility-tests | 0 | 12770917 | def solution(N):
b_rep = '{:b}'.format(N)
counter = 0
res = 0
prev_val = 0
count = False
for val in b_rep:
val = int(val)
if val - prev_val == -1:
count = True
counter += 1
if val - prev_val == 0 and count:
counter += 1
if val -... | 2.671875 | 3 |
5.Operators/0.arithetic_operator.py | Tazri/Python | 0 | 12770918 | x = 30;
y = 3;
## addition
print("x + y : ",x + y);
## we can use + for concatenate string
print("Hello, " + "World!");
## Subtraction
print("x - y : ",x - y);
## Division
print("x / y : ",x / y);
## here division operator always return float type number
## Multiplication
print("x * y : ",x*y);
# we can use * oper... | 4.46875 | 4 |
apps/core/app_forms.py | AlcindoSchleder/icity-hotspot | 1 | 12770919 | # -*- coding: utf-8 -*-
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from .models import CoreUser
class UserLoginForm(forms.ModelForm):
password = forms.HiddenInput(attrs={'value': '<PASSWORD>'})
username = forms.EmailInput(
attrs... | 2.5625 | 3 |
wasm-js-bridge/gen-bridge.py | nokotan/WasmTools | 0 | 12770920 | #!/usr/bin/python3
import extractWasmExport
import extractComments
from io import StringIO
import json as JsonUtil
import sys
class FunctionDefinition:
def __init__(self, item):
self.parameters = item["params"]
self.returnType = item["returnTypes"][0] if len(item["returnTypes"]) > 0 else "void"
... | 2.46875 | 2 |
bert2tf/excepts.py | xiongma/bert2tf | 7 | 12770921 | class YAMLEmptyError(Exception):
"""The yaml configs file is empty, nothing to read from there."""
class BadInputs(Exception):
"""Bad inputs"""
class PeaFailToStart(SystemError):
"""When pea is failed to started"""
class GRPCServerError(Exception):
"""Can not connect to the grpc gateway"""
class... | 2.21875 | 2 |
test/test_loss_functions_keras.py | maxsch3/pk-triplet | 1 | 12770922 | import tensorflow as tf
import importlib
import pytest
from triplet_tools import triplet_batch_semihard_loss, triplet_batch_priming_loss, triplet_batch_hard_loss
try:
import keras
except ImportError:
pass
@pytest.mark.skipif(importlib.util.find_spec("keras") is None,
reason='Keras is not ... | 2.25 | 2 |
apps/node_man/serializers/iam.py | ZhuoZhuoCrayon/bk-nodeman | 31 | 12770923 | <gh_stars>10-100
# _*_ coding: utf-8 _*_
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 TH<NAME>, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in c... | 1.804688 | 2 |
PREP_CAOM/gui/config_generator.py | spacetelescope/MAST_HLSP | 1 | 12770924 | """
..module:: crawl_dictionary
:synopsis: This module is designed to add a given parameter to a provided
dictionary under a designated parent. It searches for the parent
recursively in order to examine all possible levels of nested dictionaries.
If the parent is found, the parameter is added to the d... | 3.078125 | 3 |
modules/commands/rmActivity.py | devspacemx/centinela | 0 | 12770925 | from common import activities, prefix
from discord.ext import commands
class RemoveActivity(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name="rm-activity")
@commands.is_owner()
async def remove_activity(ctx):
activity = ctx.message.content[(
le... | 2.6875 | 3 |
train.py | bolajixi/Flower_Classifier | 1 | 12770926 | <filename>train.py
import argparse
import time
from collections import OrderedDict
import torch
import torch.nn.functional as F
from torch import nn, optim
from torchvision import datasets, models, transforms
from utils import parse_gpu_arg, save_checkpoint
def parse_args():
parser = argparse.ArgumentParser(desc... | 2.640625 | 3 |
generate_script.py | mwestera/iterated-char-rnn | 0 | 12770927 | import sys
"""
To run, e.g.:
python generate_script.py 20 config.ini
Prints script for 20 runs with random hyperparameters according to config.ini
"""
if __name__ == '__main__':
# Read command line args
if len(sys.argv) == 1:
print('Argument missing: requested number of runs.')
quit()
... | 2.828125 | 3 |
SQLLite/sqllite_example.py | mariobot/python_sql | 0 | 12770928 | <reponame>mariobot/python_sql
import sqlite3
from sqlite3 import Error
def create_connection(path):
connection = None
try:
connection = sqlite3.connect(path)
print("You are connecto to SQL Lite database")
except Error as e:
print(f"Error {e} when try to coonect SQL Lite database")
... | 3.53125 | 4 |
sdk/python/pulumi_azure/redis/cache.py | suresh198526/pulumi-azure | 0 | 12770929 | <reponame>suresh198526/pulumi-azure
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequ... | 1.257813 | 1 |
src/passari/museumplus/fields.py | finnish-heritage-agency/passari | 1 | 12770930 | import datetime
import json
from lxml.etree import Element, fromstring, tostring
from passari.config import CONFIG, MUSEUMPLUS_URL
from passari.museumplus.settings import ZETCOM_NS
from passari.utils import retrieve_xml
async def get_object_field(session, object_id: int, name: str):
"""
Get the value of a s... | 2.21875 | 2 |
Extract&Translate.py | CNLarrylai/MB2-ML-trasnaltion | 0 | 12770931 | import re
from bs4 import *
import requests
import random
import json
from hashlib import md5
# 设置翻译API的账号和密码 BAIDU Setup your APIid and Appkey acquired from baidu API
appid = ''
appkey = ''
# 设置从A语音翻译到B语言,其他语言码查看 If you need more language code refer to:`https://api.fanyi.baidu.com/doc/21`
from_lang = 'en'
to_lang =... | 2.6875 | 3 |
threading/2_Manual_threading.py | BenedictusAryo/python_threading | 1 | 12770932 | # 2 Using Manual threading in python
# Import Threading & Time
import threading
import time
# Start counting
start = time.perf_counter()
# Create simple function that sleep in 1 second
def do_something():
print('Sleeping 1 second..')
time.sleep(1)
print('Done Sleeping..')
# Create threading, start and... | 3.59375 | 4 |
youwol_utils/utils.py | youwol/py-youwol | 0 | 12770933 | import asyncio
import base64
import itertools
import json
import os
from enum import Enum
from pydantic import BaseModel
from pathlib import Path, PosixPath
from typing import Union, List, cast, Mapping, Callable, Iterable, Any
import aiohttp
from fastapi import HTTPException
from starlette.requests import Request
f... | 2.078125 | 2 |
gpw_opcje_db.py | memfagor/gpw_opcje_db | 0 | 12770934 | #!/usr/bin/env python3
import logging
import sqlite3
import os
from json import load
from urllib.request import urlopen
from bs4 import BeautifulSoup
from re import compile
from datetime import date, datetime
def GetScriptPath():
return '/'.join(os.path.abspath(__file__).split('/')[:-1])
def GetConfig(path, fn... | 2.546875 | 3 |
sync_my_tasks/command.py | wilrnh/sync-my-tasks | 2 | 12770935 | """sync-my-tasks.
Usage:
sync-my-tasks (--from-asana --asana-workspace=<name> [--asana-token-file PATH]) (--to-mstodo)
sync-my-tasks (-h | --help)
sync-my-tasks --version
Options:
-h --help Show this screen.
--version Show version.
--from-asana Pul... | 2.359375 | 2 |
projects/anosql/src/python/anosql/adapters/sqlite3.py | arrdem/source | 4 | 12770936 | <gh_stars>1-10
"""
A driver object implementing support for SQLite3
"""
from contextlib import contextmanager
import logging
import re
import sqlite3
log = logging.getLogger(__name__)
class SQLite3DriverAdapter(object):
@staticmethod
def process_sql(_query_name, _op_type, sql):
"""Munge queries.
... | 2.9375 | 3 |
semseg/models/decoder.py | hzhupku/SemiSeg-AEL | 45 | 12770937 | import torch
import torch.nn as nn
from torch.nn import functional as F
from .base import get_syncbn
from .base import ASPP
class dec_deeplabv3(nn.Module):
def __init__(self, in_planes, num_classes=19, inner_planes=256, sync_bn=False, dilations=(12, 24, 36)):
super(dec_deeplabv3, self).__init__()
... | 2.296875 | 2 |
daisy/model/point/MFRecommender.py | paulagd/GCE | 1 | 12770938 | <gh_stars>1-10
import os
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from IPython import embed
from daisy.model.GCE.gce import GCE
class PointMF(nn.Module):
def __init__(self,
user_num,
max_dim,
factors=100,
optimize... | 2.34375 | 2 |
bot/utils/gif_maker.py | christianbernasconi96/clothing_recommendation | 0 | 12770939 | import cv2
import numpy as np
from skimage.segmentation import slic
from skimage import color
from skimage.measure import regionprops
from PIL import Image, ImageDraw
import moviepy.editor as mp
import random
import os
class GifMaker():
def to_mosaic_gif(self, img_path, n_segments = 150, segments_per_frame = 3):
... | 2.515625 | 3 |
home/admin.py | technicaldwiti/Project-Certificate | 0 | 12770940 | from django.contrib import admin
from .models import Student
# Register your models here.
class StudentModelAdmin(admin.ModelAdmin):
list_display = ["__str__"]
class Meta:
model = Student
admin.site.register(Student,StudentModelAdmin) | 2 | 2 |
libs/core/cornflow_core/shared/__init__.py | ggsdc/corn | 2 | 12770941 | <reponame>ggsdc/corn
"""
Exposes the objects and functions of the module
"""
from .utils import db, bcrypt
from .validators import (
check_email_pattern,
check_password_pattern,
validate_and_continue,
)
| 1.46875 | 1 |
src/pyfma/__init__.py | Vutshi/pyfma | 0 | 12770942 | from _pyfma import fma
from .__about__ import __version__
__all__ = ["__version__", "fma"]
| 0.984375 | 1 |
music_genre_classifier/__main__.py | ryansingman/music-genre-classifier | 0 | 12770943 | from typing import List
from typing import Tuple
import numpy as np
import yaml
from music_genre_classifier import dataset
from music_genre_classifier import models
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(prog="Music Genre Classifier")
parser.add_argument("classifie... | 2.65625 | 3 |
EstruturaDeRepeticao/exercicio33.py | Nicolas-Wursthorn/exercicios-python-brasil | 0 | 12770944 | <reponame>Nicolas-Wursthorn/exercicios-python-brasil<gh_stars>0
# Os números primos possuem várias aplicações dentro da Computação, por exemplo na Criptografia. Um número primo é aquele que é divisível apenas por um e por ele mesmo. Faça um programa que peça um número inteiro e determine se ele é ou não um número primo... | 4.15625 | 4 |
gui.py | markry11/lyrics-finder | 0 | 12770945 | <filename>gui.py
import tkinter as tk
from readonly_text import ReadonlyText
_font_size = 12
_bg_color='#ffff64'
_fg_color='#000000'
_font = ("Segoe UI", _font_size)
class _Args:
title = ''
artist = ''
class Gui:
def __init__(self, height, width, title):
root = tk.Tk()
root.wm_attributes(... | 2.9375 | 3 |
nlp/2020-10-07/ex06.py | kogepanh/class-numeric | 0 | 12770946 | import MeCab
# text = "昨日の天気は晴れでした。"
text = input()
mecab = MeCab.Tagger()
parses = mecab.parse(text)
parse = parses.split('\n')
for par in parse:
p = par.split(',')
if p[0] == "EOS":
break
print(p[0], "\t", p[-3])
| 3.28125 | 3 |
src/game.py | shrick/shricktris | 0 | 12770947 | # game.py
import pygame
from field import GameField
from preview import Preview
from brick import Brick
from figure import generate_randomized_figures as FigureFactory
from control import Control
from score import Score
import colors
GAME_TITLE = "Shricktris"
START_FPS = 12
START_GAME_STEPOVER = 8
SCREEN_RESOLUTION ... | 2.703125 | 3 |
misc.py | MeIsNoob05/videoplayer | 0 | 12770948 | <gh_stars>0
from youtubesearchpython import VideosSearch
import pafy
#Pafy
def url_stream(url: str):
video = pafy.new(url)
videos = video.getbest().url
return videos
# Youtube
def youtube(query: str):
search = VideosSearch(query, limit = 1).result()
thumb = search["result"][0]["thumbnails"][0]["u... | 3.40625 | 3 |
tools/package-routine.py | Hivemapper/magma | 0 | 12770949 | #!/usr/bin/env python3
""" package-routine.py - package up a single routine into a distributable package
See 'package-routine.web' for how to use multiple files together
Example:
$ ./tools/package-routine.py dgesv
$ ./tools/package-routine.py dgesv
$ ./tools/package-routine.py -h
"""
## imports (all std)
import ar... | 2.515625 | 3 |
renderer.py | aymenmir1/ndf-1 | 3 | 12770950 | # conda activate pymesh
import math
import numpy as np
import trimesh
import cv2
import os
import configs.config_loader as cfg_loader
import NDF_combine as NDF
def str2bool(inp):
return inp.lower() in 'true'
class Renderer():
def __init__(self):
self.get_args()
self.create_plane_points_from... | 2.828125 | 3 |