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 |
|---|---|---|---|---|---|---|
rantlib/core_application/auth.py | AlgoRythm-Dylan/qtpy-rant | 1 | 46100 | <filename>rantlib/core_application/auth.py
from rantlib.core_application.storage import write_data_file, read_data_file, STD_PATH_AUTH
from rantlib.devrant.devrant import Auth
class AuthService:
def __init__(self):
self.users = []
self.current_session_key = None
def read_data_file(self):
... | 2.625 | 3 |
python/01_Retrieve_network_data.py | martinfleis/seashore-streets | 0 | 46101 | <gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# # Extract street networks from OpenStreetMap
#
# Computational notebook 01 for Climate adaptation plans in the context of coastal settlements: the case of Portugal.
#
# Date: 27/06/2020
#
# ---
#
# Input data contains manually digitised building footprints stored... | 2.578125 | 3 |
ids/server.py | Xzh0u/AttackScenarioDetector | 0 | 46102 | from utils import load_data
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
import math
import os
import time
from datetime import datetime
from py.predict import Predictor
from py.predict import ttypes
from thrift.transport import TSocket
from thrift.transport import TTransport
from... | 2.25 | 2 |
accounts/urls.py | j-windsor/cs3240-f15-team21-v2 | 0 | 46103 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^register/$', views.register, name='register'),
url(r'^login/$', views.user_login, name='login'),
url(r'^logout/$', views.user_logout, name='logout'),
url(r'^groups/$', views.groups, name='groups'),
url(r'^sitemanager/$', v... | 1.804688 | 2 |
src/parse_settings.py | ChillerDragon-backup/TeeworldsEconMod | 5 | 46104 | <gh_stars>1-10
#!/usr/bin/env python3
"""Module for parsing tem setting files"""
from base.rcon import echo
import base.settings
class TemParseError(Exception):
"""Tem Parser Exception"""
def __init__(self, value):
Exception.__init__(self)
self.value = value
def __str__(self):
retu... | 2.875 | 3 |
main.py | RickleAndMortimer/LongToeNailIdentifier | 0 | 46105 | from flask import Flask
from flask import render_template
from flask import Flask, flash, request, redirect, url_for
from werkzeug.utils import secure_filename
import os
import numpy as np
import tensorflow as tf
import PIL
from tensorflow import keras
#backend instantiation
app = Flask(__name__)
app.config['UPLOAD_F... | 2.421875 | 2 |
scripts/disabled_tests/tests/test_exclude_parser.py | SarveshLimaye/aqa-tests | 0 | 46106 | <gh_stars>0
import json
import os
from unittest import TestCase
from exclude_parser import transform_platform, parse_all_files
platform_map = {
"linux-aarch64": "aarch64_linux",
"linux-ppc64le": "ppc64le_linux",
"linux-arm": "arm_linux",
"linux-s390x": "s390x_linux",
"linux-x64": "x86-64_linux",
... | 2.5 | 2 |
tests/conftest.py | SunsetWolf/qlib | 1 | 46107 | <reponame>SunsetWolf/qlib
import os
import sys
"""Ignore RL tests on non-linux platform."""
collect_ignore = []
if sys.platform != "linux":
for root, dirs, files in os.walk("rl"):
for file in files:
collect_ignore.append(os.path.join(root, file))
| 2.078125 | 2 |
idangr_core.py | IMULMUL/IDAngr | 237 | 46108 | <gh_stars>100-1000
######################################################
# Author: <NAME> <<EMAIL>> #
# License: BSD 2-Clause #
######################################################
import idangr
print
print "################### IDAngr ###################"
print " usage: idangr.init(is... | 1.601563 | 2 |
erikagnvall-python3/day12.py | joelfak/advent_of_code_2019 | 9 | 46109 | import math
import os.path
from dataclasses import dataclass
from itertools import combinations
@dataclass
class Moon:
x: int
y: int
z: int
dx: int = 0
dy: int = 0
dz: int = 0
def _parse_moons(lines):
moons = []
for line in lines:
parts = line.replace('<', '').replace('>', ''... | 3.015625 | 3 |
team_app/sitemaps.py | dcopm999/initpy | 0 | 46110 | from django.contrib.sitemaps import Sitemap
from django.shortcuts import reverse
class StaticViewSitemap(Sitemap):
changefreq = "weekly"
priority = 0.5
def items(self):
return ['team_app:index']
def location(self, item):
return reverse(item)
| 1.789063 | 2 |
Exemples cours 5/pointOBJ.py | geocot/coursPython | 0 | 46111 | class Point:
"Classe Point géographique contenant une position"
def __init__(self,x,y):
self._x=x
self._y=y
def getx(self):
return self._x
def gety(self):
return self._y
def setx(self, x):
self._x = x
def sety(self, y):
self._y = y
... | 3.5625 | 4 |
cubelang/parser.py | poletaevvlad/CubeLang | 1 | 46112 | from typing import Iterator, Dict
from string import whitespace
from .actions import Turn, Action, Rotate
from .orientation import Side
SIDE_LETTERS: Dict[str, Side] = {
"L": Side.LEFT,
"R": Side.RIGHT,
"F": Side.FRONT,
"B": Side.BACK,
"U": Side.TOP,
"D": Side.BOTTOM
}
ROTATE_LETTERS: Dict[s... | 3.515625 | 4 |
fabfile.py | zzz123-tech/zhanzhenblog | 0 | 46113 | <gh_stars>0
from fabric import task
from invoke import Responder
from _credentials import github_username, github_password
def _get_github_auth_responders():
"""
返回 GitHub 用户名密码自动填充器
"""
username_responder = Responder(
pattern="Username for 'https://github.com':",
... | 2.171875 | 2 |
pebble_helpers/views/mixins/auth.py | scott-w/view-helpers | 1 | 46114 | <reponame>scott-w/view-helpers<filename>pebble_helpers/views/mixins/auth.py
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.shortcuts import redirect, resolve_url
from django.utils.http import is_safe_url
from django.contrib.auth.decorators import login_required
def a... | 2.28125 | 2 |
user/migrations/0009_user_website.py | kthaisse/website | 1 | 46115 | <reponame>kthaisse/website
# Generated by Django 2.2.10 on 2020-04-04 17:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("user", "0008_user_picture_restrictions")]
operations = [
migrations.AddField(
model_name="user",
name... | 1.75 | 2 |
hive/controllers/api/users.py | evilinc-dev/hive | 1 | 46116 | <gh_stars>1-10
from flask import Blueprint, jsonify
route = Blueprint("users", __name__, url_prefix='/api') | 1.734375 | 2 |
library/lib_study/159_debug_trace.py | gottaegbert/penter | 13 | 46117 | # python -m trace --count -C . somefile.py
# https://docs.python.org/zh-cn/3/library/trace.html
# python 用trace调试编译 python -m trace --trace 159_debug_trace.py
def main():
print("xxxxx")
main()
# import sys
# import trace
# # create a Trace object, telling it what to ignore, and whether to
# # do tracing or line... | 3.015625 | 3 |
wcd/wcc.py | brunofauth/wcd | 0 | 46118 | import asyncio as aio
import argparse as ap
import sys
import os
from pathlib import Path
from typing import Optional
from .cfg import get_cfg
from .event import ConnectionMode, DaemonEvent
def get_args() -> ap.Namespace:
parser = ap.ArgumentParser(description="Send commands to a wcd instance, through a unix s... | 2.453125 | 2 |
python-pong/main.py | emobileingenieria/youtube | 176 | 46119 | import pygame
from pygame.locals import *
from paddle import Paddle
from ball import Ball
from inputs import handle_events, handle_input
from constants import SCREEN_WIDTH, SCREEN_HEIGHT, WHITE, RED
ball = None
left_paddle = None
right_paddle = None
pygame.init()
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN... | 3.34375 | 3 |
tvrenamer/service.py | shad7/tvrenamer | 1 | 46120 | import logging
import logging.config
import logging.handlers
import os
import sys
from oslo_config import cfg
import six
from six import moves
import tvrenamer
from tvrenamer import options
from tvrenamer import services
logging.getLogger().addHandler(logging.NullHandler())
DEFAULT_LIBRARY_LOG_LEVEL = {'stevedore':... | 2.046875 | 2 |
binary_for_search.py | jorgeMorfinezM/binary_search_algorithms | 0 | 46121 | <filename>binary_for_search.py
# -*- coding: utf-8 -*-
"""
Algoritmo de busqueda binaria usando el ciclo while
escrito en Python.
Este metodo funciona con cadenas y numeros por igual, ya
que el lenguaje trata a las cadenas lexicograficamente;
comparando sus valores en el codigo ASCII
"""
def binary_search(list_data... | 4.125 | 4 |
ressources/migrations/0005_auto_20200804_2357.py | rollanda21/Genetic-algorithm-for-time-table-generation | 0 | 46122 | # Generated by Django 3.0.3 on 2020-08-04 22:57
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ressources', '0004_auto_20200731_1630'),
]
operations = [
migrations.AlterModelOptions(
name='meetingtime',
options={'orderi... | 1.40625 | 1 |
bandoleers/__init__.py | ibnpaul/bandoleers | 0 | 46123 | <reponame>ibnpaul/bandoleers<filename>bandoleers/__init__.py
version_info = (3, 1, 0)
__version__ = '.'.join(str(s) for s in version_info)
| 1.265625 | 1 |
src/TypeChecker.py | leveryd/PlayWithCompiler | 8 | 46124 | # coding:utf-8
"""
类型检查:
1. 检查赋值是否正确
2. 变量初始化;
3. 表达式里的一些运算,比如加减乘除,是否类型匹配;
4. 返回值的类型; [这个还没有做]
"""
from dist.PlayScriptListener import PlayScriptListener
from dist.PlayScriptParser import PlayScriptParser
from src.DataStructures import *
class TypeChecker(PlayScriptListener):
def __init__(self, ast_tree):
... | 2.640625 | 3 |
Script/Clients/discord.py | AIDRI/Clash-Of-Clans-Discord-Bot | 0 | 46125 | import discord
from Script.clash_info import Bot
from Script.Const_variables.import_const import Login
intents = discord.Intents.default()
intents.members = True
Clash_info = Bot(intents=intents)
main_bot = 1
if main_bot:
Token = Login["discord"]["token"]
Clash_info.default_prefix = "/"
Clash_info.id = 7... | 2.265625 | 2 |
BivariateShapley/shapley_value_functions.py | anonymous29387491/iclr2022 | 2 | 46126 | import torch
import torch.nn.functional as F
from utils_shapley import *
class eval_Syn0():
def __init__(self,c=5, **kwargs):
self.c = c
self.j = None
self.i = None
def init_baseline(self,x=np.ones((1,3)), c = 5,j = None, i = None, fixed_present = True, baseline_value =... | 2.203125 | 2 |
realsense2_camera/scripts/importRosbag/messageTypes/geometry_msgs_TwistStamped.py | seasony-org/realsense-ros | 1 | 46127 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Copyright (C) 2019 Event-driven Perception for Robotics
Authors: <NAME>
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, o... | 2.171875 | 2 |
src/main.py | Merk0ff/PicRandomFromImgur | 0 | 46128 | import urllib.request
import random
import time
import os
from bs4 import BeautifulSoup
chars = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3... | 2.96875 | 3 |
setup.py | mvantellingen/python-ideal | 0 | 46129 | #!/usr/bin/env python
import os
import sys
import ideal
from setuptools import setup, find_packages
def read_file(name):
return open(os.path.join(os.path.dirname(__file__), name)).read()
readme = read_file('README.rst')
changes = read_file('CHANGES.rst')
install_requires = [
'requests>=1.2... | 1.367188 | 1 |
archive/migrations/0007_auto_20190715_0559.py | emawind84/rrwebtv | 0 | 46130 | <filename>archive/migrations/0007_auto_20190715_0559.py
# Generated by Django 2.0.13 on 2019-07-15 05:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('archive', '0006_performance_featured'),
]
operations = [
migrations.RenameField(
... | 1.453125 | 1 |
base100/base100/base_81-90.py | cwenao/python_web_learn | 0 | 46131 | <filename>base100/base100/base_81-90.py
#81. 题目:809*??=800*??+9*??+1 其中??代表的两位数,8*??的结果为两位数,9*??的结果为3位数。求??代表的两位数,及809*??后的结果。
#
#82 题目:八进制转换为十进制
def convert8to10(n):
lenN = len(str(n))
sumN = 0
for i in range(lenN):
sumN += 8 ** i * int(str(n)[lenN-1-i])
print('this is the 8 to 10 : %d' %... | 3.734375 | 4 |
Week1/main.py | EricCharnesky/CIS2001-Winter2022 | 3 | 46132 | import random
value_a = int(input("enter the first number"))
value_b = int(input("enter the second number"))
value_c = int(input("enter the third number"))
print(value_b + value_a + value_c)
list_of_numbers = []
for number in range(100):
list_of_numbers.append(random.randint(1,100)) # inclusive of both values
... | 4.0625 | 4 |
exercicios/ex034.py | mrcbnu/python-_exercicios | 0 | 46133 | ###########################################
# EXERCICIO 034 #
###########################################
'''ESCREVA UM PROGRAMA QUE PERGUNTE O SALARIO
DE UM FUNCIONARIO E CALCULE O VALOR DE SEU
AUMENTO: PARA SALARIO SUPERIORES A R$1250,00
CALCULE AUMENTO DE 10 %, PARA SALARIOS MENORES
OU IGUA... | 3.984375 | 4 |
train.py | Unique-Divine/Neural-Networks-for-Gravitational-Lens-Modeling | 0 | 46134 | ############### OPTIMIZER:
learning_rate = 1e-6
train_step = tf.train.AdamOptimizer(learning_rate).minimize(
MeanSquareCost, var_list=train_pars)
##########################
num_batch_samples = 50
num_iterations = 1
min_eval_cost = 0.06
X = np.zeros((cycle_batch_size, numpix_side*numpix_side), dtype='float32')... | 2.015625 | 2 |
instructors/course-2015/errors_and_introspection/project/primesieve1.py | mgadagin/PythonClass | 46 | 46135 | <filename>instructors/course-2015/errors_and_introspection/project/primesieve1.py
"""
Sieve of Erasmus - Prime Sieve
Goal: Find the first n primes
What we know:
For a given integer, take every integer between 1 and itself.
Test itself modulo that integer. If results is zero, then it is nonprime.
If none ... | 4.15625 | 4 |
events/migrations/0003_event_color.py | jjorissen52/golf_site2 | 0 | 46136 | <reponame>jjorissen52/golf_site2
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-11-04 03:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0002_auto_20171103_2212'),
]
operations ... | 1.742188 | 2 |
algorithms/aiAlgorithms/cnn/cnn_facial_recognition.py | bigfoolliu/liu_aistuff | 1 | 46137 | <reponame>bigfoolliu/liu_aistuff<filename>algorithms/aiAlgorithms/cnn/cnn_facial_recognition.py<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
# TODO: not finished.
"""
fer2013.csv文件内容
- emotion,pixels,Usage
- pixels为48*48的像素值
"""
import string, os, sys
import numpy as np
import mat... | 2.75 | 3 |
lib/file_tools.py | apimetre/MetreAppUI_v0.25 | 0 | 46138 | <filename>lib/file_tools.py
import os
import json
import textwrap
CONSOLE_WIDTH = 140
INDENT_STR = ' '
def print_wrap(text, indent_str, len):
lines = textwrap.wrap(text, width=len, subsequent_indent=indent_str)
for line in lines:
print(line)
def dir(filename_search_term):
return [s for s in... | 2.9375 | 3 |
importall/finder.py | markrofail/importall | 0 | 46139 | <gh_stars>0
import sys
from pathlib import Path
from typing import Generator, Optional, Set
def find_importable_names(
path: Path, prefix: str, exclude: Set[str]
) -> Generator[str, None, None]:
patterns = [f"**/*.py"]
if sys.platform == "win32":
patterns.append(f"**/*.dll")
else:
# ma... | 2.34375 | 2 |
src/ngs_te_mapper2/utility.py | bergmanlab/ngs_te_mapper2 | 7 | 46140 | <reponame>bergmanlab/ngs_te_mapper2
#!/usr/bin/env python3
import sys
import os
import subprocess
import logging
import re
from Bio import SeqIO
import math
from datetime import datetime, timedelta
from statistics import mean
import pysam
"""
This script provides utility functions that are used by ngs_te_mapper progr... | 2.4375 | 2 |
gameParameters.py | VerdantFox/TowerDefense | 6 | 46141 | import pygame
# https://stackoverflow.com/questions/28005641
# /how-to-add-a-background-image-into-pygame
class Background:
"""Creates background as image_image file"""
def __init__(self, image_file, location=(0, 0)):
self.image = pygame.image.load(image_file)
self.rect = self.image.get_rect()... | 3.484375 | 3 |
server/auto.py | adeept/Adeept_PiCar-A_OpenCV | 0 | 46142 | <filename>server/auto.py
#!/usr/bin/evn python
# File name : auto.py
# Description : By detecting the distance through Ultrasonic,controlling the RPi car move to the four directons:the front,back,left and right,thus the car achieves automatic avoidance.
# Website : www.adeept.com
# E-mail : <EMAIL>
# Autho... | 3.359375 | 3 |
pavo_cristatus/tests/interactions_tests/test_non_annotated_project_loader_interaction.py | MATTHEWFRAZER/pavo_cristatus | 0 | 46143 | <reponame>MATTHEWFRAZER/pavo_cristatus<filename>pavo_cristatus/tests/interactions_tests/test_non_annotated_project_loader_interaction.py
import os
from pavo_cristatus.interactions.non_annotated_project_loader_interaction.non_annotated_project_loader_interaction import interact
from pavo_cristatus.interactions.pavo_cri... | 2.234375 | 2 |
book_env/Lib/site-packages/pandas_datareader/tests/test_base.py | als0052/Hands-On-Data-Analysis-with-Pandas | 1 | 46144 | import pytest
import requests
import pandas_datareader.base as base
class TestBaseReader(object):
def test_requests_not_monkey_patched(self):
assert not hasattr(requests.Session(), 'stor')
def test_valid_retry_count(self):
with pytest.raises(ValueError):
base._BaseReader([], retr... | 2.34375 | 2 |
streamalert/scheduled_queries/config/services.py | Meliairon/streamalert | 0 | 46145 | <gh_stars>0
"""
Copyright 2017-present, Airbnb Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | 1.171875 | 1 |
Lesson_3/List.py | mirdinemris/Python_lesson_2 | 0 | 46146 | <filename>Lesson_3/List.py
# Тип данных - список (List)
# Инициализация (генераторы)
list_temp = [] # Пустой список
print(type(list_temp))
list_temp = [1.2, 123, 'Volvo', [1,2,3,]]
for el in list_temp:
print(el, type(el))
# инициализация с помощью команды - list
list_str = list('Volvo')
print(list_str)
... | 4.53125 | 5 |
run.py | ITJoker233/RaspberryPiWebSDK | 4 | 46147 | <filename>run.py
import uvicorn
from datetime import datetime
from typing import List, Optional
from fastapi import FastAPI
from fastapi.encoders import jsonable_encoder
from fastapi.responses import JSONResponse
from pydantic import BaseModel, EmailStr
app = FastAPI()
_version_ = '1.0.0'
class baseReque... | 2.71875 | 3 |
hs_access_control/tests/test_group_public.py | tommac7/hydroshare | 178 | 46148 | from django.test import TestCase
from django.contrib.auth.models import Group
from hs_access_control.models import PrivilegeCodes
from hs_core import hydroshare
from hs_core.testing import MockIRODSTestCaseMixin
from hs_access_control.tests.utilities import global_reset, is_equal_to_as_set
class T09GroupPublic(Moc... | 2.078125 | 2 |
python/show_spec.py | nox-410/MusicAndMathClassProject | 0 | 46149 | import sys
import numpy as np
from PIL import Image
def spec_to_png(in_path, out_path):
specgram = np.load(in_path) # (channels, bins, frames)
specgram = specgram[0]
specgram = np.log2(specgram)
specgram = specgram.sum(1)[:, np.newaxis]
specgram = np.repeat(specgram, 128, axis=1)
smax, smin =... | 2.875 | 3 |
server/src/weaverbird/backends/pandas_executor/steps/unpivot.py | JeremyJacquemont/weaverbird | 54 | 46150 | from pandas import DataFrame
from weaverbird.backends.pandas_executor.types import DomainRetriever, PipelineExecutor
from weaverbird.pipeline.steps import UnpivotStep
def execute_unpivot(
step: UnpivotStep,
df: DataFrame,
domain_retriever: DomainRetriever = None,
execute_pipeline: PipelineExecutor = ... | 2.5625 | 3 |
python/partitionLabels.py | l0latgithub/codediary | 0 | 46151 | <filename>python/partitionLabels.py
class Solution:
def partitionLabels(self, S: str) -> List[int]:
"""
A string S of lowercase English letters is given. We want to
partition this string into as many parts as possible so that
each letter appears in at most one part, and retu... | 4.03125 | 4 |
dwitter/feed/urls.py | yonatan/dwitter | 0 | 46152 | <gh_stars>0
from django.conf.urls import url
from . import views
from .views import HotDweetFeed, NewDweetFeed, RandomDweetFeed
from .views import TopWeekDweetFeed, TopMonthDweetFeed, TopYearDweetFeed, TopAllDweetFeed
from .views import NewHashtagFeed, TopHashtagFeed
urlpatterns = [
url(r'^test/', HotDweetFeed.as_... | 2.09375 | 2 |
EDA_T-20WorldCup.py | Saurabh2509/T-20_World_Cup_EDA | 0 | 46153 | #!/usr/bin/env python
# coding: utf-8
# ## Exploratory_Data_Analysis
# In[4]:
Image("E:\DataScience\Data_Center\T_20_World_cup_data\ICC_Men's_T20_World_Cup_2021.png")
# In[1]:
pwd
# In[2]:
import os
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('darkgrid')
import plotly.express as px
... | 2.53125 | 3 |
flask-api/api/models/rating.py | reciprep/reciprep-dev | 0 | 46154 | import uuid
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.dialects.postgresql import ARRAY
from api import app, db, bcrypt
from api.models.user import User
from api.models.recipe import Recipe
class Rating(db.Model):
__tablename__ = ... | 2.375 | 2 |
CH14/RBM_01.py | PacktPublishing/Artificial-Intelligence-By-Example-Second-Edition | 33 | 46155 | #Cognitive NPL (Natural Language Processing)
#Copyright 2020 <NAME> MIT License. READ LICENSE.
#Personality Profiling with a Restricted Botzmannm Machine (RBM)
import numpy as np
from random import randint
class RBM:
def __init__(self, num_visible, num_hidden):
self.num_hidden = num_hidden
self.nu... | 3.109375 | 3 |
clrs/_src/baselines.py | fpjnijweide/clrs | 1 | 46156 | <reponame>fpjnijweide/clrs
# Copyright 2021 DeepMind Technologies Limited. 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-... | 1.765625 | 2 |
eisenmann-backend/product/views/product_entry_view.py | RubenRodrigo/Eisenmann-Inventory | 0 | 46157 | # DRF
from rest_framework import viewsets
# Models
from product.models.product_entry import ProductEntry
# Serializers
from product.serializers.product_entry_serializer import ProductEntrySerializer
class ProductEntryViewSet(viewsets.ModelViewSet):
queryset = ProductEntry.objects.all()
serializer_class = Pr... | 1.8125 | 2 |
app/views.py | fisle/netflask | 17 | 46158 | <filename>app/views.py<gh_stars>10-100
# -*- coding: utf-8 -*-
from flask import render_template, flash, redirect, url_for, session, request, g, send_from_directory, send_file, Response, abort, safe_join, make_response
from flask.ext.login import login_user, logout_user, current_user, login_required
from sqlalchemy imp... | 2.1875 | 2 |
tests/test_pep585_integration.py | loyada/typed-py | 14 | 46159 | <reponame>loyada/typed-py
import typing
import sys
from typing import List
from pytest import raises, mark
from typedpy import (
Array,
Deserializer,
Integer,
SerializableField,
Serializer,
String,
Structure,
)
@mark.skipif(sys.version_info < (3, 9), reason="requires python3.9 or higher")... | 2.34375 | 2 |
src/ortec/scientific/benchmarks/loadbuilding/common/Requirements.py | ORTECScientificBenchmarks/ortec-scientific-benchmarks-loadbuilding | 4 | 46160 | <reponame>ORTECScientificBenchmarks/ortec-scientific-benchmarks-loadbuilding<filename>src/ortec/scientific/benchmarks/loadbuilding/common/Requirements.py<gh_stars>1-10
from .utils import flatten
import pkgutil
import os
import importlib
class Requirements(object):
def __init__(self):
self.warnings =... | 2.375 | 2 |
visualize/example/__init__.py | rentainhe/visualization | 169 | 46161 | from .grid_attention_example import run_grid_attention_example
from .region_attention_example import run_region_attention_example | 0.976563 | 1 |
vvxme/menu/simulate_key_events_submenu.py | eupubs/vvxme | 2 | 46162 | <reponame>eupubs/vvxme
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import keyboard
from vvxme import menu
import time
import sys
# In[ ]:
def simulate_key_events_submenu(dev, pdmssp=False):
"""
Method - Simulate Key Events Menu
INPUTS: dev as object
OUTPUT: none
"""
loop = True
... | 3.015625 | 3 |
Task2E.py | anirudhbhalekar/Part1A-FWS-97 | 2 | 46163 | from distutils.command.build import build
from floodsystem.utils import sorted_by_key
from floodsystem.stationdata import build_station_list
from floodsystem.plot import plot_water_levels
import datetime
from floodsystem.stationdata import update_water_levels
from floodsystem.datafetcher import fetch_measure_levels
fr... | 2.59375 | 3 |
dataset/clean_label_cifar10.py | ZhenyuZhangUSTC/loss-landscape | 4 | 46164 | <gh_stars>1-10
from PIL import Image
from torch.utils import data
from torchvision import transforms
from torchvision.datasets import CIFAR10
import numpy as np
import torch
import random
from dataset.pgd_attack import PgdAttack
class CleanLabelPoisonedCIFAR10(data.Dataset):
def __init__(self, root,
... | 2.4375 | 2 |
syslog_monitoring/DNSHealthCheck/__init__.py | haihuynh-bluecat/syslog_mon | 1 | 46165 | # Copyright 2019 BlueCat Networks (USA) Inc. and its affiliates
#
# 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 b... | 1.820313 | 2 |
Desafios/AULA/2.1 Boliche com Tio Rubs.py | evertonROY/Python | 0 | 46166 | '''
a = qtd pistas 1
b = qtd pessoas por pistas 9
c = qtd alunos 4
'''
A, B, C = [int(x) for x in input().split()]
if (A*B) > C:
print("S")
else:
print("N")
| 3.484375 | 3 |
Testes Basicos/built_in_functions.py | gustavoLuuD/estudos_python | 0 | 46167 | value = 74.55
value2 = 74.3
value4 = -100
print(f"O valor 1 é {round(value)} e o valor 2 {round(value2)}")
print(f"O valor 1 também é {int(value)}")
print(f"O valor absoluto de {value4} é {abs(value4)}")
print(3//2) | 3.484375 | 3 |
src/comexio_http/tag.py | sanderd17/comexio-http-api | 0 | 46168 | <gh_stars>0
from .auth import Auth
class Tag:
"""
Abstract Comexio tag,
Address is a dictionary that defines the data point in one of the following formats:
{
ext: "IO-Server",
io: "Q1",
}
{
marker: "M1"
}
{
onewire: "OT1"
}
"""
def __init__(self, address: dic... | 3.09375 | 3 |
src/typeconvert/ufunc.py | jolsten/float-interpreter | 1 | 46169 | from typeconvert.types.onescomp import ufunc as onescomp
from typeconvert.types.twoscomp import ufunc as twoscomp
from typeconvert.types.milstd1750a32 import ufunc as milstd1750a32
from typeconvert.types.milstd1750a48 import ufunc as milstd1750a48
from typeconvert.types.ti32 import ufunc as ti32
from typeconve... | 1.164063 | 1 |
.templates_py/PipelineModule.py | lnilya/sammie | 2 | 46170 | <gh_stars>1-10
from src.sammie.py.modules.ModuleBase import ModuleBase
class __NAME__Keys:
"""Convenience class to access the keys as named entities rather than in an array"""
inSomeInputKey: str
outSomeOutputKey: str
def __init__(self, inputs, outputs):
self.inSomeInputKey = inputs[0]
... | 2.53125 | 3 |
examples/ipcount/ipcount.py | ZEMUSHKA/pydoop | 1 | 46171 | <filename>examples/ipcount/ipcount.py
# BEGIN_COPYRIGHT
#
# Copyright 2009-2014 CRS4.
#
# 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
#
# ... | 2.1875 | 2 |
xii/assembler/ufl_utils.py | MiroK/fenics_ii | 10 | 46172 | <gh_stars>1-10
from dolfin.function.argument import Argument
from ufl.core.terminal import Terminal
import dolfin as df
def topological_dim(thing):
'''Extract topological dimension of thing's cell'''
domain = thing.ufl_domain() # None with e.g. Constants
return -1 if domain is None else domain.ufl_cell(... | 2.8125 | 3 |
stockengine/stock.py | fernandoleira/stockengine | 0 | 46173 | import requests
import selectolax.parser as sp
ALPHA_API_KEY = "<KEY>"
NAME_FILTER = {
ord(" "): "_",
ord("."): "",
ord("("): "",
ord(")"): "",
ord("'"): "",
}
class Stock:
def __init__(self, symbol):
self.symbol = symbol.upper()
def profile(self):
prof = dict()
ur... | 2.921875 | 3 |
hiquant/indicator/cci.py | floatinghotpot/hiquant | 7 | 46174 | # -*- coding: utf-8 -*-
from .basic import CROSS, NON_ZERO, MAD
from .ma import SMA
from ..core.indicator_signal import register_signal_indicator
# Commodity Channel Index, by <NAME>, 1980s
# --------------------------------------------
def CCI(close, high, low, length = 14, c = None):
c = float(c) if c and c > 0... | 2.375 | 2 |
src/python/mp_init.py | xupingmao/minipy | 52 | 46175 | <reponame>xupingmao/minipy
# -*- coding:utf-8 -*-
# @author xupingmao
# @since 2016
# @modified 2020/10/20 01:14:39
"""Minipy初始化, 这里_import函数还没准备好,无法调用"""
def add_builtin(name, func):
__builtins__[name] = func
# string methods.
def ljust(self, num):
num = int(num)
if len(self) >= num: return self
res... | 2.921875 | 3 |
src/chapter8/project2_b.py | group3BSE1/BSE-2021 | 0 | 46176 | global file_object
global min_country
global max_country
def open_file():
global file_object
while True:
# repeatedly prompting for a file name until if its valid
file_name = input('Enter the file name: ')
# checking if file can be opened
try:
file_objec... | 3.9375 | 4 |
tools_predictors/train_predictor_rl.py | auroua/SSNENAS | 2 | 46177 | <gh_stars>1-10
import argparse
import os
import sys
sys.path.append(os.getcwd())
from nas_lib.trainer.trainer import NASBenchTrainer
from nas_lib.data import data
import tensorflow as tf
from nas_lib.utils.comm import set_random_seed, setup_logger
import time
import pickle
from configs import darts_converted_data_path
... | 1.953125 | 2 |
OldCode/Object-oriented Version/multilayer (1).py | JGridleyMLDL/TrustforSecurity | 0 | 46178 | <reponame>JGridleyMLDL/TrustforSecurity<filename>OldCode/Object-oriented Version/multilayer (1).py
import json
import numpy
from dataclasses import dataclass
from collections import defaultdict
### Default Values ###
gamma = 0.5
initialPrecision = 0.8
initialRecall = 0.8
initialAccuracy = 0.8
### Data Classes ###
@... | 2.296875 | 2 |
events/urls/my.py | Ben-Peters/lnldb | 0 | 46179 | <filename>events/urls/my.py
from django.conf.urls import include, url
from django.contrib.auth.decorators import login_required
from .. import views
app_name = 'lnldb'
# prefix: /my/
urlpatterns = [
url(r'^workorders/$', views.my.mywo, name="workorders"),
url(r'^workorders/attach/(?P<id>[0-9]+)/$', views.flo... | 2.09375 | 2 |
flaskr_carved_rock/models/user.py | ron4u1998/flaskr-carved-rock | 0 | 46180 | from uuid import uuid4
from sqlalchemy.orm import validates
from werkzeug.security import check_password_hash, generate_password_hash
from flaskr_carved_rock.login import login_manager
from flaskr_carved_rock.sqla import sqla
from flask_login import UserMixin
class User(UserMixin, sqla.Model):
id = sqla.Column(s... | 2.75 | 3 |
python/compute_bayes_factors.py | CardiacModelling/PyHillFit | 9 | 46181 | import doseresponse as dr
import numpy as np
from glob import glob
import itertools as it
import os
import argparse
import sys
import multiprocessing as mp
def compute_log_py_approxn(temp):
print temp
drug,channel,chain_file,images_dir = dr.nonhierarchical_chain_file_and_figs_dir(m, top_drug, top_channel, tem... | 2.28125 | 2 |
losses/msloss.py | hiimmuc/Speaker-verification | 2 | 46182 | <filename>losses/msloss.py<gh_stars>1-10
# Copyright (c) Malong Technologies Co., Ltd.
# All rights reserved.
#
# Contact: <EMAIL>
#
# This source code is licensed under the LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
import torch.nn.functional as F
class LossFunction(n... | 1.898438 | 2 |
nb/nbexp_bilibili.py | xsthunder/rss-reborn | 2 | 46183 |
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: ./bilibili.ipynb
from nbexp_personal import sendEmail
def itemgetter(*args):
g = operator.itemgetter(*args)
def f(*args2):
return dict(... | 2.28125 | 2 |
genomel/slurm/postgres/metrics.py | uc-cdis/cwl | 1 | 46184 | <reponame>uc-cdis/cwl
'''update postgres metrics'''
import postgres.mixins
import postgres.utils
class GenomelIndividualMetrics(postgres.mixins.IndMetricsTypeMixin, postgres.utils.Base):
__tablename__ = 'genomel_individual_workflow_metrics'
def add_metrics(engine, table, data):
""" add provided metrics to da... | 1.851563 | 2 |
pyspider_GZ.py | Anantuo/pySpider | 5 | 46185 | from pyspider.libs.base_handler import *
from my import My
import os
from bs4 import BeautifulSoup
'''广州'''
class Handler(My):
name = "GZ"
@every(minutes=24 * 60)
def on_start(self):
self.crawl('http://www.upo.gov.cn/WebApi/SzskgkApi.aspx?do=list&lb=004&area=all&page=1',
fetch_type='j... | 2.78125 | 3 |
sleekxmpp/thirdparty/__init__.py | EnerNOC/smallfoot-sleekxmpp | 0 | 46186 | <reponame>EnerNOC/smallfoot-sleekxmpp
try:
from collections import OrderedDict
except:
from sleekxmpp.thirdparty.ordereddict import OrderedDict | 1.21875 | 1 |
slackchatbakery/views/arguments/notification.py | The-Politico/django-politico-slackchat-2018-midterms-bakery | 0 | 46187 | from .base import BaseArgument
class Notification(BaseArgument):
name = "slackchatbakery-notification"
arg = "notification"
path = "stubs/notification/"
| 1.414063 | 1 |
setup.py | pjamesjoyce/lcopt_cv | 3 | 46188 | <reponame>pjamesjoyce/lcopt_cv<gh_stars>1-10
'''
To create the wheel run - python setup.py bdist_wheel
'''
from setuptools import setup
import os
pkg_name = 'lcopt_cv'
pkg_version = '0.1.3'
packages = []
root_dir = os.path.dirname(__file__)
if root_dir:
os.chdir(root_dir)
for dirpath, dirnames, filenames in os.... | 1.742188 | 2 |
notebooks/tests/test_mandelbrot_incorrect_test.py | cvdavis3/python-training | 0 | 46189 | import numpy as np
from mandlebrot import mandelbrot
def test_mandelbrot_incorrect_test():
x = np.linspace(-1.5, -2.0, 10)
y = np.linspace(-1.25, 1.25, 10)
output = mandelbrot(x, y, 100, False)
assert np.all(output == 0.0) | 2.984375 | 3 |
avalanche/models/generator.py | lipovsek/avalanche | 0 | 46190 | <reponame>lipovsek/avalanche<filename>avalanche/models/generator.py
################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the... | 2.3125 | 2 |
python/destinations/Hello-Panda/quix_function.py | SteveQuixDemo/quix-library | 7 | 46191 | <gh_stars>1-10
from quixstreaming import ParameterData
class QuixFunction:
# Callback triggered for each new parameter data.
def on_parameter_data_handler(self, data: ParameterData):
df = data.to_panda_frame()
print(df.to_string())
| 2.453125 | 2 |
admins/urls.py | Sult/evehub | 0 | 46192 | from django.conf.urls import patterns, url
from admins import views
urlpatterns = patterns(
'',
# Control panels
url(r'^admin/overview/$', views.overview, name='admin_overview'),
)
| 1.484375 | 1 |
nustar_planning/io.py | bwgref/nustar_jupiter | 0 | 46193 |
def download_tle(outdir='./'):
"""Download the NuSTAR TLE archive.
Parameters
----------
outdir: Optional desired output location. Defaults to the working directory.
Returns
----------
Returns the filename that you've downloaded.
Notes
---------
"""... | 3.625 | 4 |
minder_utils/configurations/__init__.py | minder-utils/minder_utils_light | 0 | 46194 | import os
from pathlib import Path
from minder_utils.util.util import reformat_path
import yaml
p = Path(os.path.join(os.path.dirname(__file__), 'confidential'))
if not p.exists():
os.mkdir(reformat_path(p))
data_path = os.path.join(os.path.dirname(__file__), 'confidential', 'data_path.txt')
token_path = os.path.... | 2.390625 | 2 |
todo.py | Pickwell15/to-do-list | 1 | 46195 | <filename>todo.py<gh_stars>1-10
"""
OBJECTS
---------------
PUBLIC | ToDo
MODULES
---------------
EXTERNAL | dataclasses -> dataclass
"""
from dataclasses import dataclass
@dataclass(frozen=True, order=True)
class ToDo:
title: str
body: str
| 2.078125 | 2 |
cogs/birthday.py | reline/nolanbot | 2 | 46196 | <reponame>reline/nolanbot
import discord
import asyncio
import json
import datetime
from datetime import date
from discord.ext import commands, tasks
bd_names = {}
users_to_celebrate = []
def add_person(person_name, date):
with open('birthdays.json', 'r') as f:
bd_names = json.load(f)
print(bd_names... | 2.75 | 3 |
aliyun-python-sdk-cms/aliyunsdkcms/__init__.py | bricklayer-Liu/aliyun-openapi-python-sdk | 1 | 46197 | __version__ = '7.0.15' | 1.039063 | 1 |
dueros/directive/VideoPlayer/VideoStop.py | ayxue/BaiduSaxoOpenAPI | 0 | 46198 | <reponame>ayxue/BaiduSaxoOpenAPI
#!/usr/bin/env python3
# -*- encoding=utf-8 -*-
# description:
# author:jack
# create_time: 2018/7/13
"""
desc:pass
"""
from dueros.directive.BaseDirective import BaseDirective
from dueros.directive.AudioPlayer.PlayBehaviorEnum import PlayBehaviorEnum
from dueros.Utils import Uti... | 1.507813 | 2 |
src/domo.py | iFabio2/domo | 0 | 46199 | <reponame>iFabio2/domo
#!/usr/bin/python
import sys, time
from domo import DomoApp, DomoLog
#main object creation
myapp = DomoApp.DomoApp()
#try:
if 1 == 1:
'''first thing we do is to create the main object
which in turn will create the rest of the objects'''
DomoLog.log('INFO', 'main', 'starting threa... | 2.8125 | 3 |