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
test_accuracy.py
ejmejm/GoHeuristics
1
35900
import glob import os import sys from sgfmill.sgfmill import sgf import global_vars_go as gvg import loader import utils import board3d as go_board import numpy as np kifuPath = "./kifu" num_games = gvg.num_games from_game = gvg.from_test_games lb_size = 250. correct = 0 total = 0 num_lb = int((num_g...
2.109375
2
gpx_split/writer.py
mario-s/gpx_split
0
35901
<filename>gpx_split/writer.py import os import gpxpy import gpxpy.gpx from gpx_split.log_factory import LogFactory class Writer: """ This class will write a track segment into a gpx file. """ def __init__(self, dest_dir): self.dest_dir = dest_dir self.logger = LogFactory.create(__n...
3.5
4
utils/all_utils.py
RaghuprakashH/classification_Asssignment
0
35902
from typing import cast import pandas as pd import os import numpy as np import glob from sklearn.model_selection import train_test_split def prepare_data(random_state,path): new_df = [] path1 = path #path1 = ['C:\CassFlipkratScrappingProject\S1_Dataset','C:\CassFlipkratScrappingProject\S2_Dataset'] ...
2.515625
3
src/isanlp_rst/allennlp_segmenter.py
IINemo/isanlp_rst
1
35903
import os import numpy as np from allennlp.predictors import Predictor from isanlp.annotation_rst import DiscourseUnit from symbol_map import SYMBOL_MAP class AllenNLPSegmenter: def __init__(self, model_dir_path, cuda_device=-1): self._model_path = os.path.join(model_dir_path, 'segmenter_neural', 'model...
2.359375
2
parser/team26/G26/Instrucciones/DDL/use.py
webdev188/tytus
35
35904
<reponame>webdev188/tytus import sys sys.path.append('../G26/Instrucciones') sys.path.append('../G26/Utils') sys.path.append('../G26/Librerias/storageManager') from instruccion import * from Lista import * from TablaSimbolos import * from jsonMode import * class Use(Instruccion): def __init__(self, dbid): ...
2.265625
2
Mundo 3/ex105.py
erickeloi/ExerciciosTreino
0
35905
<reponame>erickeloi/ExerciciosTreino # Exercício Python 105: Analisando e gerando Dicionários # Faça um programa que tenha uma função notas() que pode receber várias notas de alunos # e vai retornar um dicionário com as seguintes informações: # # - Quantidade de notas # - A maior nota # - A menor nota # - A média da tu...
4.0625
4
scraper/storage_spiders/halobuyvn.py
chongiadung/choinho
0
35906
<gh_stars>0 # Auto generated by generator.py. Delete this line if you make modification. from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//div[@class='product-name']/h1", 'price' : "//div[@class='span8']/div[@class='price-box']/p[@class='special-price']/span[...
2.03125
2
sdks/python/apache_beam/io/external/generate_sequence.py
ByteFlinger/beam
0
35907
<reponame>ByteFlinger/beam # # 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...
1.882813
2
config.py
wangyida/voxel-dcgan
1
35908
nz = 512 # noize vector size nsf = 4 # encoded voxel size, scale factor nvx = 32 # output voxel size batch_size = 64 learning_rate = 2e-4 dataset_path_i = "/media/wangyida/D0-P1/database/ShapeNetCore.v2/*/*/*/model_normalized.binvox.thinned" dataset_path_o = "/media/wangyida/D0-P1/database/ShapeNetCore.v2/*/*/*/model_...
1.351563
1
nailgun/nailgun/test/performance/unit/test_node_group_operations.py
prmtl/fuel-web
0
35909
# -*- coding: utf-8 -*- # Copyright 2015 Mirantis, 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 requir...
1.773438
2
db_quick_setup/django/db/backends/sqlite3.py
amezin/django-db-quick-setup
1
35910
<filename>db_quick_setup/django/db/backends/sqlite3.py from .dummy import Backend
1.109375
1
Solutions/0394.decodeString.py
lyhshang/LeetCode-Solutions
0
35911
# -*- coding: utf-8 -*- # author:lyh # datetime:2020/5/28 22:28 """ 394. 字符串解码 给定一个经过编码的字符串,返回它解码后的字符串。 编码规则为: k[encoded_string],表示其中方括号内部的 encoded_string 正好重复 k 次。注意 k 保证为正整数。 你可以认为输入字符串总是有效的;输入字符串中没有额外的空格,且输入的方括号总是符合格式要求的。 此外,你可以认为原始数据不包含数字,所有的数字只表示重复的次数 k ,例如不会出现像 3a 或 2[4] 的输入。 示例: s = "3[a]2[bc]", 返回 "aaabcb...
3.40625
3
odin/utils/iterator.py
rnt-pmi/odin
4
35912
<filename>odin/utils/iterator.py import os import glob import random from PIL import Image from matplotlib import pyplot as plt from ipywidgets import Button, Output, HBox, VBox, Label, BoundedIntText from IPython.display import Javascript, display class ImagesLoader: def __init__(self, images_path, images_extens...
2.78125
3
ahye/lib.py
kopf/ahye
2
35913
import magic import os import random import string from ahye.settings import LOCAL_UPLOADS_DIR def generate_filename(image_data, detect_extension=True): alphanum = string.ascii_letters + string.digits retval = '' while not retval or os.path.exists(os.path.join(LOCAL_UPLOADS_DIR, retval)): retval...
2.921875
3
editUser/lambda_function.py
LUDecomposition/YouTutor-lambda
0
35914
import json import boto3 from elasticsearch import Elasticsearch, RequestsHttpConnection from requests_aws4auth import AWS4Auth from boto3.dynamodb.conditions import Key user_table = 'user-profile' dynamodb = boto3.resource('dynamodb') table = dynamodb.Table(user_table) cognito = boto3.client('cognito-idp') region = '...
2.3125
2
pelicanconf.py
fluxoid-org/cyclismo_pelican
0
35915
<reponame>fluxoid-org/cyclismo_pelican<filename>pelicanconf.py<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals PLUGIN_PATHS = ['plugins'] PLUGINS = ['jinja_filters'] AUTHOR = u'Fluxoid Ltd.' DESCRIPTION = u'Site description' FOOTER_TEXT = u'Copyright &copy; Fluxoid L...
1.398438
1
bloscpack/constants.py
sachk/bloscpack
87
35916
<reponame>sachk/bloscpack #!/usr/bin/env python # -*- coding: utf-8 -*- # vim :set ft=py: import blosc from .compat_util import (OrderedDict, ) # miscellaneous FORMAT_VERSION = 3 MAGIC = b'blpk' EXTENSION = '.blp' # header lengths BLOSC_HEADER_LENGTH = 16 BLOSCPACK_HEADER_LENGTH = 32 ME...
1.546875
2
nn_interpretability/interpretation/deconv/deconv_partial_reconstruction.py
miquelmn/nn_interpretability
41
35917
<filename>nn_interpretability/interpretation/deconv/deconv_partial_reconstruction.py import torch import torch.nn as nn from torch.nn import Module from torchvision import transforms from nn_interpretability.interpretation.deconv.deconv_base import DeconvolutionBase class DeconvolutionPartialReconstruction(Deconvolu...
2.84375
3
test/files/first_spider.py
mawentao007/reading_grab
0
35918
from grab.spider import Spider class FirstSpider(Spider): pass
1.085938
1
vnpy_oracle/__init__.py
noranhe/vnpy_oracle
2
35919
<reponame>noranhe/vnpy_oracle from .oracle_database import database_manager
0.886719
1
irrd/storage/__init__.py
mirceaulinic/irrd
0
35920
<reponame>mirceaulinic/irrd import sqlalchemy as sa import ujson from sqlalchemy.pool import NullPool from irrd.conf import get_setting def get_engine(): return sa.create_engine( get_setting('database_url'), poolclass=NullPool, json_deserializer=ujson.loads, )
2.03125
2
monitor/nagios_check.py
caoghui/python
0
35921
import sys import json import base64 status = sys.argv[1] if status.lower() == "warnig": print('Status is WARN') exit(1) elif status.lower() == 'critical': print('Status is CRITICAL') exit(2) elif status.lower() == 'unknown': print('Status is UNKNOWN') exit(3) else: print('Status is OK') ...
2.875
3
operations_api/v1/modelform/utils.py
Mirantis/python-operations-api
0
35922
import crypt import io import json import logging import re import requests import uuid import yaml from flask import current_app as app from base64 import b64encode from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.backends imp...
2.140625
2
Contest/ABC086/d/main.py
mpses/AtCoder
0
35923
#!/usr/bin/env python3 # 2次元累積和 S の [x1, x2) × [y1, y2) 総和 def ac2(s, x1, x2, y1, y2): return s[x2][y2] - s[x1][y2] - s[x2][y1] + s[x1][y1] import numpy as np _, *d = open(0) n, k = map(int, _.split()) B = np.zeros((2*k, 2*k)) for e in d: *z, c = e.split() x, y = map(int, z) B[x % (2*k)][(y + k * (z ==...
3.6875
4
prepare_data_file_cluster.py
prise-3d/LSTM-noise-detection
2
35924
<filename>prepare_data_file_cluster.py # main imports import numpy as np import pandas as pd import sys, os, argparse import joblib # image processing from PIL import Image from ipfml import utils from ipfml.processing import transform, segmentation, compression # modules and config imports sys.path.insert(0, '') # t...
2.421875
2
applications/CoSimulationApplication/custom_data_structure/pyKratos/TriangleElement.py
lcirrott/Kratos
2
35925
from __future__ import print_function, absolute_import, division # makes these scripts backward compatible with python 2.6 and 2.7 # pyKratos imports from .Element import Element # Other imports import numpy as np class TriangleElement(Element): def __init__(self, elem_id, nodes): super(TriangleElement...
2.359375
2
saleor/graphql/account/dataloaders.py
fairhopeweb/saleor
15,337
35926
from collections import defaultdict from ...account.models import Address, CustomerEvent, User from ..core.dataloaders import DataLoader class AddressByIdLoader(DataLoader): context_key = "address_by_id" def batch_load(self, keys): address_map = Address.objects.in_bulk(keys) return [address_...
2.203125
2
neurox/data/representations.py
qcri/NeuroX
87
35927
<gh_stars>10-100 """Utility functions to manage representations. This module contains functions that will help in managing extracted representations, specifically on sub-word based data. """ import numpy as np from tqdm import tqdm def bpe_get_avg_activations(tokens, activations): """Aggregates activations by av...
2.75
3
src/application/model/matkaroute.py
arpejupe/matkanaattori
0
35928
<reponame>arpejupe/matkanaattori<filename>src/application/model/matkaroute.py # -*- coding: utf-8 -*- from urllib import urlencode from xml.etree import ElementTree from requests import get from datetime import datetime from pytz import timezone matka_api = "http://api.matka.fi/?" matka_api_timezone = timezone("Europ...
2.921875
3
numba/__init__.py
teoliphant/numba
3
35929
import sys try: from . import minivect except ImportError: print >>sys.stderr, "Did you forget to update submodule minivect?" print >>sys.stderr, "Run 'git submodule init' followed by 'git submodule update'" raise from . import _numba_types from ._numba_types import * __all__ = _numba_types.__all__
1.4375
1
Algo and DSA/LeetCode-Solutions-master/Python/maximize-the-confusion-of-an-exam.py
Sourav692/FAANG-Interview-Preparation
3,269
35930
<reponame>Sourav692/FAANG-Interview-Preparation # Time: O(n) # Space: O(1) import collections class Solution(object): def maxConsecutiveAnswers(self, answerKey, k): """ :type answerKey: str :type k: int :rtype: int """ result = max_count = 0 count = collec...
3.046875
3
homeassistant/components/eliqonline/__init__.py
domwillcode/home-assistant
30,023
35931
"""The eliqonline component."""
0.925781
1
model/fiz_contact.py
ol6a/training
0
35932
<reponame>ol6a/training<filename>model/fiz_contact.py class Fiz_contact: def __init__(self, lastname, firstname, middlename, email, telephone, password, confirmpassword): self.lastname=lastname self.firstname=firstname self.middlename=middlename self.email=email self.telephon...
2.484375
2
src/zope/app/authentication/browser/loginform.py
zopefoundation/zope.app.authentication
0
35933
############################################################################## # # Copyright (c) 2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
2.125
2
ncoreparser/constant.py
gszabi15/ncoreparser
10
35934
TORRENTS_PER_PAGE = 25
0.96875
1
src/py/icosahedronlib/LinearSubdivisionFilter.py
lbumbolo/ShapeVariationAnalyzer
5
35935
import vtk import numpy as np class LinearSubdivisionFilter: InputData = None Output = None NumberOfSubdivisions = 1 def SetInputData(self, polydata): self.InputData = polydata def GetOutput(self): return self.Output def SetNumberOfSubdivisions (self, subdivisions): self.NumberOfSubdivisions = subdivis...
2.4375
2
test/test_tpo_data_dt_os_erx_patient_prescriptions_patient_prescription_dto.py
my-workforce/TMB-SDK
0
35936
<reponame>my-workforce/TMB-SDK<filename>test/test_tpo_data_dt_os_erx_patient_prescriptions_patient_prescription_dto.py # coding: utf-8 """ Transaction Management Bus (TMB) API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec ...
1.96875
2
pyhsslms/hsslms.py
russhousley/pyhsslms
0
35937
#!/usr/bin/env python # hsslms.py # # This provides a command line interface for the pyhsslms.py # implementation of HSS/LMS Hash-based Signatures as defined # in RFC 8554. # # # Copyright (c) 2020-2021, Vigil Security, LLC # All rights reserved. # # Redistribution and use, with or without modification, are permitted ...
1.828125
2
emoji/spec_parser.py
capnfabs/emoji-haiku
4
35938
"""Methods for parsing the unicode spec, and retrieving a list of Emoji and Modifiers. Note that the model of 'Emoji' here isn't sufficiently general to represent everything in the spec - a visual / user-facing emoji could be, for example, a super complicated Zero-Width-Join sequence. I wanted to go in favor of ease-o...
3.21875
3
setup.py
aricci10/superpose3d
0
35939
# -*- coding: utf-8 -*- from setuptools import setup setup( name='superpose3d', packages=['superpose3d'], description='Diamond\'s 1988 rotational superposition algorithm (+scale tranforms)', long_description='''Register 3-D point clouds using rotation, translation, and scale transformations. ## Usage ...
3.109375
3
project/server/main/views.py
jkassel/cerebro
0
35940
<reponame>jkassel/cerebro<gh_stars>0 # project/server/main/views.py import os ################# #### imports #### ################# from flask import render_template, Blueprint from project.server import app ################ #### config #### ################ main_blueprint = Blueprint('main', __name__,) ########...
2.0625
2
src/dircifrar/main.py
ctchou/dircifrar
1
35941
<gh_stars>1-10 from .__init__ import ( __pkg_name__, __pkg_version__, __pkg_description__, ) import sys if sys.version_info < (3, 6): sys.stdout.write(f"Sorry, {__pkg_name__} requires Python 3.6 or above\n") sys.exit(1) from .dirconfig import ( init_config, crypt_change_password, cryp...
2.109375
2
jumpscale/packages/threebot_deployer/models/backup_tokens.py
zaibon/js-sdk
13
35942
<filename>jumpscale/packages/threebot_deployer/models/backup_tokens.py from jumpscale.core.base import Base, fields class BackupTokens(Base): tname = fields.String() token = fields.String()
1.3125
1
mlexpt/data/dataload.py
stephenhky/ml-experiment
4
35943
import os import tempfile from glob import glob import json from collections import OrderedDict import numpy as np from .adding_features import adding_no_features def iterate_json_data(filepath, columns_to_keep=None, feature_adder=adding_no_features, ...
2.609375
3
Server/model/account.py
devArtoria/-Awesome-GraphQL-
27
35944
<reponame>devArtoria/-Awesome-GraphQL- from mongoengine import * from datetime import datetime class AccountModel(Document): meta = {'collection': 'account'} id = StringField(required=True, primary_key=True) username = StringField(required=True) password = StringField(required=True) register_on = ...
2.265625
2
users/migrations/0010_auto_20200321_1902.py
jakubzadrozny/hackcrisis
0
35945
<reponame>jakubzadrozny/hackcrisis # Generated by Django 3.0.4 on 2020-03-21 19:02 from django.db import migrations import phonenumber_field.modelfields class Migration(migrations.Migration): dependencies = [ ('users', '0009_auto_20200321_1438'), ] operations = [ migrations.AlterField( ...
1.882813
2
tests/conftest.py
TommasoBelluzzo/PyDTMC
43
35946
# -*- coding: utf-8 -*- ########### # IMPORTS # ########### # Standard from os.path import ( abspath as _os_abspath, dirname as _os_dirname, isfile as _os_isfile, join as _os_join ) from json import ( load as _json_load ) ############# # CONSTANTS # ############# _replacements = [ ('NaN'...
2.234375
2
game-ai-ui/video/video.py
yugendra/game-ai-ui
0
35947
<filename>game-ai-ui/video/video.py import logging import re import os import mimetypes from flask import Response LOG = logging.getLogger(__name__) MB = 1 << 20 BUFF_SIZE = 10 * MB def partial_response(path, start, end=None): LOG.info('Requested: %s, %s', start, end) file_size = os.path.getsize(path) #...
2.578125
3
src/py/PrjRestfulApiService/RestfulApiService.py
PrQiang/aods
2
35948
<gh_stars>1-10 import socketserver, threading from RestfulApiHandler import RestfulApiHandler if __name__ == "__main__": server = socketserver.ThreadingTCPServer(('0.0.0.0', 32002), RestfulApiHandler) t = threading.Thread(target= server.serve_forever, args = ()) t.start()
2.3125
2
studio/urls.py
mrashidov/ColdWaterWebSite
0
35949
from django.conf.urls import include, url from . import views urlpatterns = [ url(r'^task$', views.ShowTask.as_view(), name='show_task'), url(r'^task/add/$', views.AddTask.as_view(),name='add_task'), url(r'^(?P<slug>[\w\-]+)$', views.ShowTask.as_view(), name='show'), ]
1.765625
2
pycryptomkt/client.py
smaass/pycryptomkt
0
35950
import hashlib import hmac import requests import time from functools import reduce class CryptoMKT(object): BASE_URL = 'https://api.cryptomkt.com' API_VERSION = 'v1' ENDPOINT_BALANCE = 'balance' ENDPOINT_BOOK = 'book' ENDPOINT_MARKETS = 'market' ENDPOINT_TICKER = 'ticker' ENDPOINT_TRAD...
2.71875
3
venv/Lib/site-packages/openpyxl/formula/__init__.py
ajayiagbebaku/NFL-Model
26
35951
<reponame>ajayiagbebaku/NFL-Model<gh_stars>10-100 # Copyright (c) 2010-2021 openpyxl from .tokenizer import Tokenizer
1.195313
1
zplane.py
m1ch/pysim
0
35952
# -*- coding: utf-8 -*- """ Combination of http://scipy-central.org/item/52/1/zplane-function and http://www.dsprelated.com/showcode/244.php with my own modifications """ # Copyright (c) 2011 <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General...
2.6875
3
lino_book/projects/igen/__init__.py
lino-framework/lino_book
3
35953
""" igen stands for "invoice generator". The project is currently inactive. """
0.691406
1
code/arc028_1_01.py
KoyanagiHitoshi/AtCoder
3
35954
<gh_stars>1-10 N,A,B=map(int,input().split()) print("Ant" if 0<N%(A+B)<=A else "Bug")
2.859375
3
assembly_examiner.py
jfitz/code-stat
0
35955
import string import math from codestat_token import Token from codestat_tokenizer import Tokenizer from token_builders import ( InvalidTokenBuilder, NullTokenBuilder, WhitespaceTokenBuilder, NewlineTokenBuilder, EscapedStringTokenBuilder, PrefixedStringTokenBuilder, IntegerTokenBuilder, IntegerExponen...
2.140625
2
learning/bs/bs2.py
Nephrin/Tut
2
35956
<filename>learning/bs/bs2.py def main(): with open("number.txt", "r") as file: data = file.read() data = data.split("\n") x = [row.split("\t") for row in data[:5]] print(function(x)) def function(x): sum=0 for el in x[0:]: sum += int(el[0]) return sum if __name__=="__main__": ...
3.46875
3
{{cookiecutter.project_name}}/resources/admin.py
phalt/cookicutter-django-api
16
35957
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from .models import ( BaseModel ) classes = [BaseModel] for c in classes: admin.site.register(c)
1.5
2
moocng/contact/models.py
OpenMOOC/moocng
36
35958
<filename>moocng/contact/models.py # Copyright 2013 UNED # # 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...
1.9375
2
nameko_mongoengine/__init__.py
ketgo/nameko-mongoengine
2
35959
""" MongoEngine dependency provider """ from __future__ import absolute_import from .mongo_engine import MongoEngine __all__ = ["MongoEngine", ] # pragma: no cover
1
1
search_for_similar_images__perceptual_hash__phash/ui/SearchForSimilarSettingsWidget.py
DazEB2/SimplePyScripts
117
35960
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' from PyQt5.QtWidgets import QWidget, QFormLayout, QComboBox, QSpinBox, QCheckBox from PyQt5.QtCore import QSettings, pyqtSignal from common import IMAGE_HASH_ALGO, DEFAULT_IMAGE_HASH_ALGO, DEFAULT_IMAGE_HASH_MAX_SCORE class SearchForSimilarSet...
2.15625
2
app/auth_app/blueprint.py
ganggas95/E-Wisata
0
35961
from flask import Blueprint auth_blueprint = Blueprint( 'auth_blueprint', __name__, template_folder='templates' )
1.40625
1
Python/Topics/Bytes basics/Ord() application/main.py
drtierney/hyperskill-problems
5
35962
a = input() b= input() print(ord(a) + ord(b))
3.09375
3
test.py
ThomDietrich/singletonify-python
3
35963
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2017~2999 - cologler <<EMAIL>> # ---------- # # ---------- from pytest import raises from singletonify import singleton def test_base(): @singleton() class A: pass assert not A._is_init() assert A() is A() assert A._is_init(...
2.59375
3
vika/services/svc_crypto.py
jtprogru/vika
0
35964
<filename>vika/services/svc_crypto.py from coinmarketcapapi import CoinMarketCapAPI, CoinMarketCapAPIError from pycoingecko import CoinGeckoAPI from vika.config import COIN_MARKET_CAP_API_KEY class Crypto: def __init__(self, api_key=None): self.coin_market_cap = CoinMarketCap(api_key=api_key) sel...
2.5625
3
sf2_to_dex.py
rupa/sf2_to_dex
0
35965
<reponame>rupa/sf2_to_dex #!/usr/bin/env python """ cleanup and refactor -> pretty much a rewrite soundfonts are messy, you gotta kind of figure out where the note names and velocities are in sample name. usually the pitch info is wack """ from chunk import Chunk import logging import os import re import struct impor...
2.65625
3
src/slack.py
planetrics/aws-iam-key-rotator
0
35966
<gh_stars>0 import os import json import logging import requests logger = logging.getLogger('slack') logger.setLevel(logging.INFO) def notify(url, account, userName, existingAccessKey, accessKey=None, secretKey=None, instruction=None, deleteAfterDays=None): if accessKey is not None: # New key pair generat...
2.765625
3
src/core/structs.py
lasse-aagren/poezio
0
35967
<reponame>lasse-aagren/poezio """ Module defining structures useful to the core class and related methods """ import collections # http://xmpp.org/extensions/xep-0045.html#errorstatus ERROR_AND_STATUS_CODES = { '401': 'A password is required', '403': 'Permission denied', '404': 'The room doesn’t exist', ...
1.890625
2
easy-todo-backend/module/user/handler.py
hubenchang0515/EasyTodo
0
35968
from flask import Flask, request, jsonify from ..common import app, db, getJson from .model import User from .method import * @app.route("/api/user/register", methods=["POST"]) def register(): json = getJson() username = json['username'] password = json['password'] userId = addUser(username, password) ...
2.984375
3
contrib/bin_wrapper.py
brikkho-net/windmill
61
35969
<gh_stars>10-100 # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (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.mozilla.or...
1.835938
2
tsheets/models/user_permissions_set.py
eturpin/api_python
6
35970
from tsheets.model import Model from datetime import date, datetime class UserPermissionsSet(Model): pass UserPermissionsSet.add_field("admin", bool) UserPermissionsSet.add_field("mobile", bool) UserPermissionsSet.add_field("status_box", bool) UserPermissionsSet.add_field("reports", bool) UserPermissionsSet.add...
1.921875
2
backpack/extensions/secondorder/diag_ggn/conv1d.py
jabader97/backpack
395
35971
<filename>backpack/extensions/secondorder/diag_ggn/conv1d.py from backpack.core.derivatives.conv1d import Conv1DDerivatives from backpack.extensions.secondorder.diag_ggn.convnd import ( BatchDiagGGNConvND, DiagGGNConvND, ) class DiagGGNConv1d(DiagGGNConvND): def __init__(self): super().__init__(de...
2.28125
2
api/scripts/test/test_generate_promoter_terminator.py
IsaacLuo/webexe
0
35972
import subprocess import pytest import os import json def test_call_generate_promoter_terminator(): print('') process_result = subprocess.run(['python', 'generate_promoter_terminator.py', './test/1.gff.json', '500', '200'], \ capture_output=True) assert process_result.returncode == 0 ...
2.390625
2
config/airflow_config_property.py
ranjeettyadav/ranjeettyadav
0
35973
<filename>config/airflow_config_property.py project_dm = 'dmgcp-ingestion-poc' location = 'US' bq_connection_id= 'my_gcp_connection'
1.054688
1
tests/model/template/test_read_include.py
scailfin/flowserv-core
1
35974
<reponame>scailfin/flowserv-core # This file is part of the Reproducible and Reusable Data Analysis Workflow # Server (flowServ). # # Copyright (C) 2019-2021 NYU. # # flowServ is free software; you can redistribute it and/or modify it under the # terms of the MIT License; see LICENSE file for more details. """Unit tes...
2.15625
2
vf.py
polydojo/vf
0
35975
""" VF: Validation Functions (for Python dicts.) Copyright (c) 2020 Polydojo, Inc. SOFTWARE LICENSING ------------------ The software is released "AS IS" under the MIT License, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Kindly see LICENSE.txt for more details. NO TRADEMARK RIGHTS ------------------- The above...
2.4375
2
application/account/forms.py
fgronqvist/votingbooth
0
35976
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, validators from wtforms.fields.html5 import EmailField class RegisterForm(FlaskForm): firstname = StringField(u"Firstname", [validators.Length(min=2, max=256)]) lastname = StringField(u"Lastname", [validators.length(min=2, max=256)...
2.96875
3
setup.py
Bouke/mvvm
3
35977
from setuptools import setup, find_packages version = '0.0.1' setup(name='mvvm', version=version, description='Model-View-ViewModel framework for Python, based on Wx', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended...
1.078125
1
mundo_2/ex037.py
tseiiti/curso_em_video
0
35978
<reponame>tseiiti/curso_em_video<gh_stars>0 from os import system, name system('cls' if name == 'nt' else 'clear') dsc = ('''DESAFIO 037: Escreva um programa que leia um número inteiro qualquer e peça para o usuário escolher qual será a base de conversão: - 1 para binário - 2 para octal - 3 para hexadecimal ''') n = ...
3.40625
3
tables.py
sadaszewski/scimd
0
35979
<reponame>sadaszewski/scimd # # Copyright (C) 2015, <NAME> # <EMAIL> # http://algoholic.eu # # License: 2-clause BSD # from markdown import Extension from markdown.blockprocessors import BlockProcessor from markdown.util import etree import numpy as np from collections import defaultdict import numpy.core.defchararra...
2.515625
3
agronet_be/AgronetApp/views/orderDetailView.py
lauraC4MP0/Prueba-github
1
35980
<reponame>lauraC4MP0/Prueba-github from django.conf import settings from django.db.models.query import QuerySet from rest_framework import views from rest_framework.response import Response from AgronetApp.serializers import orderDetailSerializer from AgronetApp.serializers.orderDetailSerializer import OrderDetailSeria...
2.03125
2
predict.py
kadn/carla-imitation
0
35981
<gh_stars>0 import tensorflow as tf import numpy as np from network import make_network from data_provider import DataProvider from tensorflow.core.protobuf import saver_pb2 import time import os from IPython import embed with tf.Session(config=tf.ConfigProto(log_device_placement=True)) as sess: network = make_...
2.078125
2
App0/migrations/0019_auto_20210118_0317.py
LTSana/lost-empire
0
35982
<filename>App0/migrations/0019_auto_20210118_0317.py # Generated by Django 3.1.5 on 2021-01-18 01:17 from django.db import migrations, models import gdstorage.storage class Migration(migrations.Migration): dependencies = [ ('App0', '0018_auto_20210117_1820'), ] operations = [ migrations...
1.554688
2
baseline/exp3_2d3ds/models/__init__.py
COATZ/ugscnn
0
35983
<filename>baseline/exp3_2d3ds/models/__init__.py from .duc_hdc import * from .fcn8s import * from .fcn8s_sphe import * from .u_net import * from .u_net_sphe import *
1.15625
1
tests/test_dm2-xnat-upload.py
gabiherman/datman
0
35984
<filename>tests/test_dm2-xnat-upload.py import os import unittest import importlib import logging import zipfile from nose.tools import raises from mock import patch, MagicMock import datman import datman.xnat import datman.scanid # Disable all logging for the duration of testing logging.disable(logging.CRITICAL) u...
2.09375
2
digideep/environment/common/vec_env/subproc_vec_env.py
sharif1093/digideep
11
35985
<reponame>sharif1093/digideep """ The MIT License Copyright (c) 2017 OpenAI (http://openai.com) 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 t...
1.773438
2
sni/api/routers/corporation.py
altaris/seat-navy-issue
1
35986
""" Corporation management paths """ from datetime import datetime from typing import Dict, Iterator, List, Optional from fastapi import APIRouter, Depends import pydantic as pdt from sni.esi.scope import EsiScope, esi_scope_set_to_hex from sni.esi.token import tracking_status, TrackingStatus from sni.uac.clearance ...
2.15625
2
LeanIX/__init__.py
JeffGebhart/leanix-python-library
4
35987
import requests import json from .Graph import Graph from .FactSheets import FactSheets from .Users import Users from .Metrics import Metrics from .Polls import Polls class LeanIX: def __init__(self,api_token="",workspaceid="",baseurl="https://us.leanix.net/"): """ Authenticates to LeanIX with the given A...
2.6875
3
python/database.py
pm1997/othello
0
35988
import os import numpy as np from constants import DATABASE_FILE_NAME, PLAYER_ONE, PLAYER_TWO, POSITION_TO_DATABASE from Agents.random import Random from othello import Othello import multiprocessing as mp class Database: def __init__(self): """ load database data and store them in self._db_data ...
2.9375
3
servo/controller.py
MrAI-NDHU/drive_away_pigeons
1
35989
import logging import math import time from typing import Dict, List from servo import Servo class ControllerForPCA9685: def __init__(self, servos: Dict[object, Servo], chs: Dict[object, int], pwm_freq: float, init_angles: Dict[object, float] = None): import Adafruit_PCA9685 as PCA9685 ...
2.65625
3
euler-50.py
TFabijo/euler2
0
35990
<filename>euler-50.py def prastevila_do_n(n): pra = [2,3,5,7] for x in range(8,n+1): d = True for y in range(2,int(x ** 0.5) + 1): if d == False: break elif x % y == 0: d = False if d == True: pra.append(x) ...
3.078125
3
scripts/rpc/cmd_parser.py
5cs/spdk
2,107
35991
<filename>scripts/rpc/cmd_parser.py<gh_stars>1000+ args_global = ['server_addr', 'port', 'timeout', 'verbose', 'dry_run', 'conn_retries', 'is_server', 'rpc_plugin', 'called_rpc_name', 'func', 'client'] def strip_globals(kwargs): for arg in args_global: kwargs.pop(arg, None) def remove_nul...
2.421875
2
neighbor/models.py
ShaviyaVictor/nyumbakumi-
0
35992
from django.db import models from django.utils import timezone from django.contrib.auth.models import User # Create your models here. class Neighbor(models.Model) : n_name = models.CharField(max_length=35) n_location = models.CharField(max_length=35) n_image = models.ImageField(upload_to='n_posts/') n_title...
2.40625
2
MetroX_CircuitPython/ir_sensor/code.py
albinger/Adafruit_Learning_System_Guides
0
35993
<filename>MetroX_CircuitPython/ir_sensor/code.py # SPDX-FileCopyrightText: 2021 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT """ 'ir_sensor.py'. ================================================= control a LED with an IR Remote requires: - adafruit_irremote library """ import adafruit_irremote impo...
2.875
3
pyheos/__init__.py
WebSpider/pyheos
1
35994
<reponame>WebSpider/pyheos from .heos import * __author__ = '<NAME>' __version__ = '20180701'
0.984375
1
samples/CMU_MoCap_Angles.py
jutanke/pak
20
35995
<gh_stars>10-100 import json; from pprint import pprint Settings = json.load(open('settings.txt')) import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np import sys sys.path.insert(0,'../') from pak.datasets.CMU_MoCap import CMU_MoCap import pak.datasets.CMU_MoCap as cmu data = CMU...
2.03125
2
bin/deploy.py
daniarherikurniawan/hillview
1
35996
#!/usr/bin/env python3 """This python program deploys the files needed by the Hillview service on the machines specified in the configuration file.""" # pylint: disable=invalid-name from argparse import ArgumentParser import tempfile import os.path from hillviewCommon import ClusterConfiguration, get_config, get_l...
2.65625
3
nbody/setup.py
libka-b/cython-playground
0
35997
<filename>nbody/setup.py from distutils.core import setup from Cython.Build import cythonize setup(name="nbody", ext_modules=cythonize("nbody.pyx"))
1.273438
1
xv_leak_tools/test_components/firewall/windows/windows_firewall.py
RDTCREW/expressvpn_leak_testing
0
35998
<filename>xv_leak_tools/test_components/firewall/windows/windows_firewall.py from xv_leak_tools.log import L from xv_leak_tools.exception import XVEx from xv_leak_tools.test_components.firewall.firewall import Firewall class WindowsFirewall(Firewall): def __init__(self, device, config): super().__init__(d...
2.171875
2
PythonTutor/session-10/stockprice.py
krishnamanchikalapudi/examples.py
0
35999
import urllib3 from beautifulsoup4 import beautifulsoup4 as bs def get_historical_data(name, number_of_days): data = [] url = "https://finance.yahoo.com/quote/" + name + "/history/" rows = bs(urllib3.urlopen(url).read()).findAll('table')[0].tbody.findAll('tr') for each_row in rows: divs = each_row.findAll('td')...
3.359375
3