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
app/services/crud_service.py
palazzem/gello
44
12772951
<reponame>palazzem/gello<filename>app/services/crud_service.py # -*- coding: utf-8 -*- # # Unless explicitly stated otherwise all files in this repository are licensed # under the Apache 2 License. # # This product includes software developed at Datadog # (https://www.datadoghq.com/). # # Copyright 2018 Datadog, Inc. ...
1.828125
2
.circleci/regenerate.py
anandj91/vision
9
12772952
<filename>.circleci/regenerate.py #!/usr/bin/env python import jinja2 import os.path d = os.path.dirname(__file__) env = jinja2.Environment( loader=jinja2.FileSystemLoader(d), lstrip_blocks=True, autoescape=False, ) with open(os.path.join(d, 'config.yml'), 'w') as f: f.write(env.get_template('config.y...
2.21875
2
waves_gateway/service/transaction_service_converter_proxy_impl.py
NeolithEra/WavesGatewayFramework
25
12772953
<reponame>NeolithEra/WavesGatewayFramework """ AssetTransactionServiceConverterProxyImpl """ from typing import Optional, cast from waves_gateway.common import Injectable from waves_gateway.model import Transaction, TransactionAttempt from waves_gateway.service.token import COIN_TRANSACTION_SERVICE, COIN_INTEGER_CONV...
2.0625
2
src/icolos/config_containers/container.py
jharrymoore/Icolos
11
12772954
<gh_stars>10-100 import abc import json import os class ConfContainer(object, metaclass=abc.ABCMeta): @abc.abstractmethod def __init__(self, conf): # get instance of configuration enum and load configuration # parameter "config" can be a string, a path or a dictionary (as long as it holds vali...
3.125
3
vocabulary/models.py
ketzu/klang-api
0
12772955
<reponame>ketzu/klang-api from datetime import datetime, timezone from django.db import models # Create your models here. from users.models import User class Vocable(models.Model): vocab = models.CharField(max_length=200) translation = models.CharField(max_length=200) def __str__(self): return ...
2.65625
3
spacegraphcats/cdbg/label_cdbg.py
mogproject/spacegraphcats
0
12772956
#! /usr/bin/env python """ Build an index that can be used to retrieve individual reads or contigs by cDBG node ID; produce a SQLite database for fast retrieval. Briefly, this script creates a sqlite database with a single table, 'sequences', where a query like this: SELECT DISTINCT sequences.offset FROM sequences...
2.828125
3
RunJobArgo.py
GNUBrinux/pilot
13
12772957
# Class definition: # RunJobMira # [Add description here] # Instances are generated with RunJobFactory via pUtil::getRunJob() # Implemented as a singleton class # http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern # Import relevant python/pilot modules from RunJobHPC import RunJobHPC ...
2.03125
2
LoadHandler.py
Oriolus/GithubLoadScheduler
0
12772958
<reponame>Oriolus/GithubLoadScheduler from EntityLoader import EntityLoader, LoadResult from SimplePageableBehaviour import SimplePageableBehaviour from ObjectQueue import QueueRepository, ObjectHistoryRepository, ObjectQueue, QueueEntry, QueueState, MAX_RETRY_COUNT from uuid import uuid4 from json import dumps from c...
2.171875
2
.archive/rinex_reader.py
jordan-mazur/georinex
66
12772959
<gh_stars>10-100 """ Read navigation and observation rinex files """ from . import Path import logging import numpy as np from datetime import datetime import xarray from io import BytesIO from time import time import re # %% Navigation file def rinexnav(fn, ofn=None): """ Reads RINEX 2.11 NAV files <NAM...
2.953125
3
app1/migrations/0006_flight_squack.py
awzdevelopers/FlightStrips_django
0
12772960
# Generated by Django 2.0.3 on 2020-02-18 03:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app1', '0005_flight_printed'), ] operations = [ migrations.AddField( model_name='flight', name='squack', ...
1.695313
2
staff_management_models/staff_group_payments/class_serializers/staff_worker_payment_group_serializer.py
reimibeta/django-staff-management-models
0
12772961
from rest_flex_fields import FlexFieldsModelSerializer from rest_framework import serializers # from rest_framework_utils.key_related_field import key_related_field from staff_management_models.staff_group_payments.class_models.staff_worker_payment import StaffWorkerPayment, \ StaffWorkerPaymentGroup from staff_man...
1.8125
2
python-algorithm/leetcode/problem_1337.py
isudox/nerd-algorithm
5
12772962
"""1337. The K Weakest Rows in a Matrix https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/ """ import collections from typing import List class Solution: def kWeakestRows(self, mat: List[List[int]], k: int) -> List[int]: def count(nums: List[int]) -> int: cnt = 0 for num...
3.4375
3
proofreader/utils/print_table.py
elifesciences/proofreader-python
1
12772963
<gh_stars>1-10 from collections import defaultdict class PrintTable(object): COLUMN_MARK = '+' COLUMN_SEP = '|' DASH = '-' PADDING = 1 def __init__(self, headers): # type: (List[str]) -> None self.headers = headers self._rows = [] self._col_widths = [] def ad...
3.359375
3
align_to_wig_20180130.py
ethanagbaker/Rend_seq_core_scripts
1
12772964
<filename>align_to_wig_20180130.py ''' Generates pile-up files (reads counts that map along the genome, with position in nucleotides) wig format. Deals with mismatches (from non-template addition from reverse transcription) and possible multiple alignments, with the explicit purpose of correctly taking into account clo...
3.0625
3
Code/Web_app/mail_test.py
gokul-koganti/SRIJAS
1
12772965
<filename>Code/Web_app/mail_test.py from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from socket import gaierror import sys import smtplib import json f = open ('parameters.json', "r") mail_params = json.loads(f.read()) password = mail_params['email_password'] smtp_server = "smtp.gm...
2.890625
3
blog/migrations/0001_initial.py
marcanuy/django-categories-example-app
1
12772966
# Generated by Django 2.2.13 on 2020-08-30 23:18 from django.db import migrations, models import django.db.models.deletion import mptt.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Category', ...
1.742188
2
woke/woke/e_ast_parsing/__init__.py
kevinkanak/woke-readme
7
12772967
<gh_stars>1-10 # TODO: Implement woke/ast_parsing # assignees: michprev, manfm
1.171875
1
FLaREON/__init__.py
sidgurun/FLaREON
0
12772968
import os import os.path #import imp import sys import shutil import urllib import numpy as np from sklearn.ensemble import RandomForestRegressor, ExtraTreesRegressor, GradientBoostingRegressor from sklearn.neighbors import KNeighborsRegressor import pickle #======================================================...
2.578125
3
keybert/_highlight.py
aucan/KeyBERT
0
12772969
from rich.console import Console from rich.highlighter import RegexHighlighter import string class NullHighlighter(RegexHighlighter): base_style = "" highlights = [r""] def clean_text(astr): clean_str = astr.translate(str.maketrans('', '', string.punctuation)) clean_str = ' '.join(clean_str.split())....
2.796875
3
tutorial/courses/serializers.py
MaggieChege/Courses-DRF
0
12772970
from rest_framework import serializers from . import models class ReviewSerializer(serializers.ModelSerializer): class Meta: extra_kwargs = { 'email':{'write_only':True } } fields=('id', 'course', 'name', 'email', 'review', 'rating', ...
2.078125
2
1299.replace-elements-with-greatest-element-on-right-side.py
dely2p/Leetcode
1
12772971
<reponame>dely2p/Leetcode # # @lc app=leetcode id=1299 lang=python3 # # [1299] Replace Elements with Greatest Element on Right Side # # @lc code=start class Solution: def replaceElements(self, arr: List[int]) -> List[int]: index = 0 result = [] for i,v in enumerate(arr): if i+1 ...
3.390625
3
app/api/__init__.py
mortimer2015/simple-flask-web
1
12772972
# -*- coding: UTF-8 -*- __author__ = 'hunter' from flask import Blueprint from app.util.response_util import code_handle from app.util.login_util import login api = Blueprint('api', __name__) api.after_app_request(code_handle) api.before_app_request(login) from . import views, errors
1.765625
2
detective/detectiveProject/server.py
TzvetomirTz/FortWatch
0
12772973
<reponame>TzvetomirTz/FortWatch import flask from ml import model import os from flask import Flask, request from ml import model from werkzeug.utils import secure_filename app = Flask(__name__) @app.route("/check/", methods=['POST']) def checkImage(): imgFile = request.files['image'] imgFilePath = os.path....
2.0625
2
start.py
Victor804/Sky-s-Land
1
12772974
from game_files.character import Character from game_files.menu import Menu from game_files.game import Game menu = Menu() button = menu.main() if (button == "play"): game = Game() game.maps_draw() elif (button == "saves"): menu.saves() elif (button == "options"): menu.options()
2.78125
3
card/card.py
nju161250102/NJUSystem_Server
1
12772975
<gh_stars>1-10 # -*- coding:utf-8 -*- from flask import Blueprint from flask import request from flask import Response import requests import json import datetime from bs4 import BeautifulSoup cardModule = Blueprint('card', __name__) # 登录并从校园卡自助服务系统导入数据 @cardModule.route('/import/', methods=['POST']) def import_data...
2.640625
3
medical_prescription/exam/models/newexam.py
ristovao/2017.2-Receituario-Medico
11
12772976
# Django from django.db import models # Local Django from exam import constants class NewExam(models.Model): exam_description = models.CharField(max_length=constants.DESC_TUSS_MAX_LENGTH)
1.90625
2
cogs/ciphers.py
Whykiller/FrontStreetInformer-Discord-Bot
0
12772977
from assets.variables_and_imports import * """All Cipher classes that en-/decrypt""" class Ciphers(commands.Cog): """Some general ciphers to play around with!""" def __init__(self) -> None: """Initializes the dicts used for encyphering""" self.alphabet_dict = {c: i for i, c in enumerate(str...
3.28125
3
ta2-eval/d3m_ta2s_eval/ta3ta2api/__init__.py
tonyjo/ubc_primitives
0
12772978
import sys, os sys.path.append(os.getcwd()+'/d3m_ta2s_eval/ta3ta2api') import pipeline_pb2 as pipeline__pb2 import primitive_pb2 as primitive__pb2 import problem_pb2 as problem__pb2 import value_pb2 as value__pb2
1.546875
2
visualizer.py
sgillen/sensel-visualizer
0
12772979
<gh_stars>0 #!/usr/bin/env python ########################################################################## # MIT License # # Copyright (c) 2013-2017 Sensel, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy of this # software and associated documentation files (the "Software"), to...
1.09375
1
jtmri/scripts/kidney_depth.py
jthacker/jtmri
1
12772980
import numpy as np def distance_from_region(label_mask, distance_mask=None, scale=1, ord=2): """Find the distance at every point in an image from a set of labeled points. Parameters ========== label_mask : ndarray A mask designating the points to find the distance from. A True value ind...
3.28125
3
mltrain-nips-2017/yang_shi/vqa-mxnet-gluon/VQAtrainIter.py
gopala-kr/ds-notebooks
1
12772981
<reponame>gopala-kr/ds-notebooks import numpy as np import mxnet as mx import bisect class VQAtrainIter(mx.io.DataIter): def __init__(self, img, sentences, answer, batch_size, buckets=None, invalid_label=-1, text_name='text', img_name = 'image', label_name='softmax_label', dtype='float32', layout='...
2.359375
2
Emotif/motif_filtering.py
YichaoOU/Emotif_Alpha
0
12772982
<filename>Emotif/motif_filtering.py from __future__ import division import os import sys import argparse import shutil import re from utils import * import warnings warnings.filterwarnings("ignore") import sys import numpy as np from scipy.io.arff import loadarff as la from sklearn import svm from sklearn ...
2.5
2
673. Number of Longest Increasing Subsequence/main.py
Competitive-Programmers-Community/LeetCode
2
12772983
<filename>673. Number of Longest Increasing Subsequence/main.py class Solution: def findNumberOfLIS(self, nums): """ :type nums: List[int] :rtype: int """ if not nums: return 0 dp = [1 for i in range(len(nums))] c = [1 for i in range(len(nums))] ...
3.328125
3
backend/www/test/auth_test.py
xuantan/viewfinder
645
12772984
#!/usr/bin/env python # # Copyright 2012 Viewfinder Inc. All Rights Reserved. """Account authorization tests for Facebook and Google accounts. """ __authors__ = ['<EMAIL> (<NAME>)', '<EMAIL> (<NAME>)'] import json import mock import os import time import unittest import urllib from copy import deepco...
2.078125
2
brian2/tests/test_morphology.py
moritzaugustin/brian2
0
12772985
from nose.plugins.attrib import attr from numpy.testing.utils import assert_equal, assert_allclose, assert_raises import numpy as np from brian2.spatialneuron import * from brian2.units import um, second @attr('codegen-independent') def test_basicshapes(): morpho = Soma(diameter=30*um) morpho.L = Cylinder(len...
2.15625
2
authlib/__init__.py
jmrafael/Streamlit-Authentication
0
12772986
<reponame>jmrafael/Streamlit-Authentication from .common import const, trace_activity, AppError, DatabaseError from .common.dt_helpers import tnow_iso , tnow_iso_str, dt_from_str, dt_from_ts, dt_to_str from .common.crypto import aes256cbcExtended from .common.cookie_manager import CookieManager
1.101563
1
tests/test_utils.py
ishtiaque06/vh-fst
1
12772987
<filename>tests/test_utils.py from utils import spe_to_fst def run_test_on_strings(input_list, output_list, object): for i in range(len(input_list)): assert "".join(object.step(list(input_list[i]))) == output_list[i] def test_spe_to_fst_a_b_c_d(): alphabet = {'a', 'b', 'c', 'd'} states = {0: '', 1...
2.5
2
PythonExercicios/06-loops-while/ex061.py
mateusmarinho/python3-cursoemvideo
0
12772988
# REFAZENDO O DESAFIO 51 # mostra os 10 primeiros termos de uma PA print('GERADOR DE PA') a1 = int(input('Digite o primeiro termo da PA: ')) r = int(input('Digite a razão da PA: ')) print('Dez primeiros termos da PA:') termo = a1 i = 1 while i <= 10: print('{} '.format(termo), end='') termo += r ...
3.921875
4
capitulo-09/ex35.py
bryan-lima/exercicios-livro-introd-prog-python-3ed
3
12772989
# Utilizando a função os.walk, crie uma página HTML com o nome e tamanho de cada arquivo de um diretório passado e de # seus subdiretórios # Programa 9.10 do livro, página 219 # Programa 9.10 - Árvore de diretórios sendo percorrida # # import os # import sys # # for raiz, diretorios, arquivos in os.walk(sys.argv[1]): ...
3.5
4
project/views/project_views.py
chaitphani/company-emp-proj-auth
0
12772990
<reponame>chaitphani/company-emp-proj-auth<gh_stars>0 from project.models import Project from project.serializers import ProjectSerializer from company.models import Company from rest_framework import viewsets,status from rest_framework.response import Response class ProjectAPI(viewsets.ViewSet): serializer_cla...
2.375
2
app/sources_main/migrations/0027_auto_20190403_0759.py
DOSSIER-dev/DOSSIER-Sources
7
12772991
<reponame>DOSSIER-dev/DOSSIER-Sources # Generated by Django 2.1 on 2019-04-03 07:59 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('sources_main', '0026_auto_20190326_1544'), ] operations = [ migrations.RenameField( model_name='sour...
1.34375
1
2020/12/ship.py
cheshyre/advent-of-code
1
12772992
def rotate(cur_direction, rotation_command): # Assumes there are only R/L 90/180/270 invert_rl = { "R": "L", "L": "R", } if int(rotation_command[1:]) == 270: rotation_command = f"{invert_rl[rotation_command[0]]}90" elif int(rotation_command[1:]) == 180: flip ...
3.359375
3
tests/test_banner_module.py
tate138/Martindale_Automation
0
12772993
<gh_stars>0 from library.page_models.martindale.martindale_module_setup import MartindaleModuleSetup from library.page_models.martindale.martindale_login import MartindaleLogin from library.page_models.martindale.martindale_navigation import MartindaleNavigation from library.selenium_actions import * from library.tools...
2.1875
2
Lists.py
shyed2001/Python_Programming
2
12772994
<gh_stars>1-10 #------------------------------------------------------------------------------- # Name: module2 # Purpose: # # Author: user # # Created: 28/03/2019 # Copyright: (c) user 2019 # Licence: <your licence> #-----------------------------------------------------------------------...
3.71875
4
setup.py
gabrielbdornas/gdlib
0
12772995
<reponame>gabrielbdornas/gdlib from setuptools import setup, find_packages import codecs import os import sys sys.path.insert(0, os.path.abspath('..')) if __name__ == '__main__': # Setting up setup( name='gdlib', version='0.0.1.9001', author='<NAME>', author_email='<EMAIL>', descript...
1.625
2
tests/data_structures/linked_lists/test_linked_lists.py
maurobaraldi/python-algorithms
2
12772996
<reponame>maurobaraldi/python-algorithms #!/usr/bin/env python import unittest from data_structures.linked_lists.linked_lists import Node, LinkedList class TestNode(unittest.TestCase): def test_define_a_node(self): node = Node(1) self.assertIsInstance(node, Node) self.assertEqual(node.da...
4.15625
4
0_ACMSGURU/100 A+B.py
zielman/Codeforces-solutions
0
12772997
<gh_stars>0 # https://codeforces.com/problemsets/acmsguru/problem/99999/100 A, B = map(int, input().split()) print(A+B)
2.859375
3
decoder.py
craigderington/python-socket-server
1
12772998
# .env/bin/python # coding: utf-8 from collections import namedtuple from datetime import datetime def pad_reading(_reading): """ Return a full binary representation of the individual bytes :param _reading: :return: binary """ prefix = 0 for i in range(len(_reading) - 1): prefix ...
3.125
3
projects/tests/analysis-weibel.py
Krissmedt/imprunko
5
12772999
<gh_stars>1-10 import numpy as np import matplotlib.pyplot as plt import h5py import sys, os import matplotlib.ticker as ticker from scipy.stats import mstats from scipy.optimize import curve_fit from combine_files import combine_files, combine_tiles from configSetup import Configuration #---------------------------...
1.859375
2
app/article/migrations/0007_auto_20200419_1210.py
nabechin/article
0
12773000
<filename>app/article/migrations/0007_auto_20200419_1210.py # Generated by Django 3.0.5 on 2020-04-19 12:10 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('article', '0006_auto_20200419_1015'), ] operations = [ ...
1.257813
1
flask_SQLAlchemy_app/db_airline2/create_db.py
pk8742/CS50_flask_tutorials
0
12773001
# app.py # python file to create database from flask import Flask, render_template, request from models import * # our file defined above to define the classes/tables app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = 'postgresql://postgres:pk8742@localhost:5432/airline2' app.config["SQLALCHEMY_TRACK_MODIF...
2.953125
3
scrapyd/db/pgdbadapter.py
c9dong/scrapyd-heroku-postgres
0
12773002
import psycopg2 as pg import urlparse class PgDbAdapter: def __init__(self, db_url): url = urlparse.urlparse(db_url) # Remove query strings. path = url.path[1:] path = path.split('?', 2)[0] args = { 'dbname': path, 'user': url.username, 'password': <PASSWORD>, 'host': url...
2.9375
3
network-config-analyzer/MethodSet.py
np-guard/network-config-analyzer
15
12773003
# # Copyright 2020- IBM Inc. All rights reserved # SPDX-License-Identifier: Apache2.0 # import copy from CanonicalIntervalSet import CanonicalIntervalSet class MethodSet(CanonicalIntervalSet): """ A class for holding a set of HTTP methods """ all_methods_list = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'...
2.640625
3
channels.py
tunelipt/boundarylayer
0
12773004
import math def num_string(x, n=3): return ('{}'.format(x + 10**n))[1:] class ChannelConfig(object): def __init__(self, nchans, chans=None, addref=True, istart=0): self.addref = addref self.istart = istart if chans is None: nchars = math.ceil(math.log10(nchans+is...
3
3
selfdrive/controls/lib/drive_helpers.py
UVA-DSA/OpenPilot0.3.5
1
12773005
from common.numpy_fast import clip def rate_limit(new_value, last_value, dw_step, up_step): return clip(new_value, last_value + dw_step, last_value + up_step) def learn_angle_offset(lateral_control, v_ego, angle_offset, d_poly, y_des, steer_override): # simple integral controller that learns how much steering off...
2.734375
3
seebuoy/ndbc/_request.py
nickc1/seebuoy
5
12773006
<filename>seebuoy/ndbc/_request.py import requests def make_request(url): resp = requests.get(url) if resp.status_code == 200: return resp.text elif resp.status_code == 404: print(f"Dataset not available (404 Error) for url: \n {url}") return None else: raise ValueErro...
2.875
3
methods and decorators/optimization.py
Zoki92/Snippets
0
12773007
<reponame>Zoki92/Snippets """ Check if items are in list """ def has_invalid_fields(fields): for field in fields: if field not in ['foo', 'bar']: return True return False def has_invalid_fields2(fields): return bool(set(fields) - set(['foo', 'bar'])) """ set eliminates duplicates "...
4.21875
4
python_scripts/criaCaracteristicas.py
LeoHSRodrigues/backendTCC
1
12773008
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- """ PyFingerprint Copyright (C) 2015 <NAME> <<EMAIL>> All rights reserved. """ import time from pyfingerprint import PyFingerprint # Inicializando o leitor try: f = PyFingerprint('COM4', 115200, 0xFFFFFFFF, 0x00000000) if (f.verifyPassword...
2.875
3
pythia/seo/sunspotter.py
dpshelio/pythia
0
12773009
import warnings from pathlib import Path import astropy.units as u import matplotlib.pyplot as plt import pandas as pd from astropy.coordinates import SkyCoord from sunpy.map import Map, MapSequence from sunpy.net import Fido from sunpy.net import attrs as a from sunpy.net import hek from sunpy.util import SunpyUserWa...
2.265625
2
hanjatagger/tagger.py
kaniblu/hanja-tagger
13
12773010
<gh_stars>10-100 import difflib from . import hanjaro from . import compat2unified from . import zh2hans def is_chinese_char(c): return (0x4e00 <= c <= 0x9fff or # CJK Unified Ideographs 0x3400 <= c <= 0x4d8f or # CJK Unified Ideographs Extension A 0x20000 <= c <= 0x2a6df or # CJK U...
2.3125
2
lib/graph.py
bendmorris/beaver
2
12773011
<reponame>bendmorris/beaver from types import BeaverException, Variable, Uri, Value, updated_context from statement import Statement from command import Command, PrefixCommand from parser import parse_string, parse_file, parse_stream import sys import urllib2 default = [ PrefixCommand('rdf', Uri('http://ww...
2.328125
2
processes/playout.py
Julian-Theis/AVATAR
7
12773012
<gh_stars>1-10 import os import numpy as np import argparse from pm4py.objects.petri.importer import pnml as pnml_importer from pm4py.algo.simulation.playout.versions import basic_playout as playout from util.playout import readVariantFile, getMaxVariantLength from conf.settings import DATA_PATH WORK_PATH = os.path.a...
2.21875
2
clases/duodecimasegunda.py
PythonCisco/clase
0
12773013
""" """ import turtle class Pluma(): def __init__(self, color, grosor): self.color = color self.grosor = grosor self.posicion = [0, 0] self.previa = self.posicion def mueve(self, x, y): self.previa = self.posicion self.posicion = [x, y] turtle.goto(*se...
3.734375
4
src/airfly/_vendor/airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py
ryanchao2012/airfly
7
12773014
<gh_stars>1-10 # Auto generated by 'inv collect-airflow' from airfly._vendor.airflow.models.baseoperator import BaseOperator class BigQueryToBigQueryOperator(BaseOperator): source_project_dataset_tables: "typing.Union[typing.List[str], str]" destination_project_dataset_table: "str" write_disposition: "str...
1.929688
2
labs/queryset/aggregation.py
DhiaTN/djangolab
7
12773015
from django.db.models import Max, Avg, Sum, F from labs.common.models import Registration def highest_discount(event_id=1): """ >>> SELECT MAX(registration.discount) AS max_discount FROM registration WHERE registration.event_id = event_id """ registrations = Registration.objects.filter(event_...
2.578125
3
day19.py
alexrudy/AoC2018
0
12773016
<filename>day19.py # Hand decompiled day 19 part 2 a,b,c,d,e,f = 1,0,0,0,0,0 c += 2 c *= c c *= 209 b += 2 b *= 22 b += 7 c += b if a == 1: b = 27 b *= 28 b += 29 b *= 30 b *= 14 b *= 32 c += b a = 0 for d in range(1, c+1): if c % d == 0: a += d print(a)
3.234375
3
SEResNet/Res_block.py
Yfyangd/TaiwanTree
0
12773017
<gh_stars>0 from keras.models import Model from keras.layers import * from keras.regularizers import l2 from keras import backend as K from keras.callbacks import EarlyStopping, ModelCheckpoint from keras.utils import to_categorical from keras import layers, Input, models import tensorflow as tf def resnet_bl...
2.484375
2
playlist_compare/app.py
devjeffersonsilveira/playlist-compare
0
12773018
from flask import Flask, request, json from playlist_compare import playlistService, helloService, searchService app = Flask(__name__) @app.route("/") def helloRoute(): data = helloService.hello() return json.jsonify(data) @app.route("/list") def listAll(): token = request.args.get("token") userna...
2.890625
3
profiles_project/profiles_api/views.py
sanskar1991/local-comms
0
12773019
<gh_stars>0 from rest_framework.response import Response from rest_framework import status from rest_framework import viewsets from rest_framework.authentication import TokenAuthentication from rest_framework import filters from rest_framework.authtoken.views import ObtainAuthToken from rest_framework.settings import a...
2.125
2
Project/ConcurrencyControl/RWLock.py
CDDSCLab/DMCL-2018
56
12773020
<reponame>CDDSCLab/DMCL-2018 #-*- coding=utf8 -*- # @Time :2018-11-27 # @Author :ehds import threading import queue class RWLock: """ A simple reader-writer lock Several readers can hold the lock simultaneously, XOR one writer. Write locks have priority over reads to prevent write starvation. wake up writer a...
3.234375
3
DialogXL/utils.py
ahsanMuh/DialogXL
33
12773021
import numpy as np import torch def person_embed(speaker_ids, person_vec): ''' :param speaker_ids: torch.Tensor ( T, B) :param person_vec: numpy array (num_speakers, 100) :return: speaker_vec: torch.Tensor (T, B, D) ''' speaker_vec = [] for t in speaker_ids: speaker_vec.app...
2.703125
3
seimas/migrations/0031_auto_20190103_2313.py
zinaukarenku/zkr-platform
2
12773022
# Generated by Django 2.1.4 on 2019-01-03 23:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('seimas', '0030_auto_20190103_2234'), ] operations = [ migrations.AlterField( model_name='committee', name='slug', ...
1.375
1
vhserverutils/serverutils.py
CermitDFrog/valheimserverutilities
0
12773023
<filename>vhserverutils/serverutils.py #!python3 import shutil from datetime import datetime from os import path as ospath from pathlib import Path class backup(): """Utilities for backing up the server and cleaning the directory.""" def __init__(self): pass def checkDirSize(self, dirpath, size)...
2.9375
3
__init__.py
mattyx17/LenasPostmodernTeam
0
12773024
from GiftTheCode2018.camp_quality_dashboard import create_camper_history_charts
1.09375
1
generate_regex.py
WilliamBurdett/grim_dawn_regex
2
12773025
<gh_stars>1-10 from utils.character_management import add_skills_from_classes, extend_skills from utils.damage_type_parsers import ( check_damage_source, calculate_damage_types, add_elemental, ) from utils.output_messages import retaliation_messages, player_messages, pet_messages, return_char, \ add_bot...
2.421875
2
spider/python/word.py
ferryhang/spider_job
322
12773026
import jieba #分词库 import jieba.analyse import pymongo import redis import os import re import json client = pymongo.MongoClient(host="127.0.0.1", port=27017) db = client['job'] collection = db['position'] data = collection.find({}) text = "" for item in data: text += item['body'] pwd = os.path.sp...
2.640625
3
src/xml-python/Converting_XML_to_HTML.py
sudeep0901/python
0
12773027
from urllib.parse import urlencode, urldefrag, quote, unquote import requests # from requests.urllib3 import urlretrieve import urllib from urllib.request import urlretrieve mydict = { "Name": "<NAME>", "address": "test address", "fav char": "<NAME>" } strUrl = urlencode(mydict) print(strUrl) string =...
3.046875
3
Passphrase Gen Py/pw.py
NicolasFlandrois/My-Mini-Py-Scripts-Training
0
12773028
<filename>Passphrase Gen Py/pw.py<gh_stars>0 #!#!usr/bin/python3 ################################################################################# # MIT License # # Copyright (c) 2019 - <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentati...
1.609375
2
services/anilist/src/player/api/controllers.py
C4T-BuT-S4D/training-17-11-19
1
12773029
<filename>services/anilist/src/player/api/controllers.py import secrets import ujson from sanic.exceptions import abort import storage async def get_current_user(request): if 'user' in request: return request['user'] sess = request.cookies.get('session') if not sess: abort(401) red...
2.15625
2
cloud/src/baseline_cloud/core/json.py
MartinMReed/aws-iot-baseline
1
12773030
import decimal import json import typing from datetime import datetime import baseline_cloud.core.date from baseline_cloud import core class JSONEncoder(json.JSONEncoder): def default(self, o: typing.Any) -> typing.Any: if isinstance(o, datetime): return core.date.format_utc(o) if isi...
2.484375
2
pyziabm/trader2017_r3.py
blakelucey/pyziabm
35
12773031
<reponame>blakelucey/pyziabm import random import numpy as np class ZITrader(object): ''' ZITrader generates quotes (dicts) based on mechanical probabilities. A general base class for specific trader types. Public attributes: quote_collector Public methods: none ''' def __init__(self...
3.03125
3
dataset/util.py
vinay-swamy/gMVP
2
12773032
import os, sys import json from collections import defaultdict import numpy as np import pandas as pd dna_pair = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'} amino_acid_index_table = { 'A': 0, 'B': 20, 'C': 1, 'D': 2, 'E': 3, 'F': 4, 'G': 5, 'H': 6, 'I': 7, 'J': 20, 'K': 8, ...
2.625
3
LedControl.py
looterwar/LightPy
0
12773033
<gh_stars>0 import time from neopixel import * from random import randint # LED strip configuration: LED_COUNT = 62 # Number of LED pixels. LED_PIN = 18 # GPIO pin connected to the pixels (18 uses PWM!). #LED_PIN = 10 # GPIO pin connected to the pixels (10 uses SPI /dev/spide...
3
3
map_reduce_dataproc.py
originalankur/distributed-data-processing-with-python-intro-talk
0
12773034
<filename>map_reduce_dataproc.py import json from mrjob.job import MRJob from mrjob.step import MRStep class MRYelpTopCity(MRJob): """ Find city with most no of restaurants in Yelp dataset. https://www.yelp.com/dataset business.json stores the data of all restaurants in Yelp dataset. In each ind...
3.375
3
face_detection/face_train.py
tiago369/opencv-course
0
12773035
import os import cv2 from matplotlib.pyplot import gray import numpy as np people = ['<NAME>', '<NAME>', '<NAME>', 'Madonna', '<NAME>'] DIR = r'/home/senai/tiago-projects/opencv-course/Resources/Faces/train' haar_cascade = cv2.CascadeClassifier('/home/senai/tiago-projects/opencv-course/face_detection/haar_face.xml') ...
3.296875
3
pyl4c/science.py
arthur-e/pyl4c
1
12773036
''' Specialized scientific functions for biogeophysical variables and L4C model processes. ''' import numpy as np from functools import partial from scipy.ndimage import generic_filter from scipy.linalg import solve_banded from scipy.sparse import dia_matrix from pyl4c import suppress_warnings from pyl4c.data.fixtures...
2.453125
2
src/scipp/plotting/view2d.py
mlund/scipp
0
12773037
# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2022 Scipp contributors (https://github.com/scipp) # @author <NAME> from .view import PlotView from ..core import zeros, scalar import numpy as np from matplotlib.collections import PathCollection class PlotView2d(PlotView): """ View object for 2 dimens...
2.484375
2
osxnotification.py
ianribas/extrator-an
0
12773038
import Foundation import objc import AppKit import sys NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter') NSUserNotification = objc.lookUpClass('NSUserNotification') def notify(title, subtitle, info_text, delay=0, sound=False, userInfo={}): notification = NSUserNotification.alloc().init() ...
2.3125
2
tasks/lgutil/pre_processing_wv/create_bible_ldg.py
HimmelStein/lg-flask
0
12773039
<gh_stars>0 # -*- coding: utf-8 -*- import sys import time import random import os import codecs import re import csv from pprint import pprint from nltk.parse.stanford import StanfordDependencyParser from subprocess import Popen, PIPE util_loc = "/Users/tdong/git/lg-flask/tasks/lgutil" model_en_path = os.path.join(u...
2.171875
2
tests/test_model_components/test_mc_tab_resnet.py
5uperpalo/pytorch-widedeep
0
12773040
<gh_stars>0 import string import numpy as np import torch import pytest from pytorch_widedeep.models import TabResnet colnames = list(string.ascii_lowercase)[:10] embed_cols = [np.random.choice(np.arange(5), 10) for _ in range(5)] cont_cols = [np.random.rand(10) for _ in range(5)] X_tab = torch.from_numpy(np.vstack...
1.867188
2
test/persistence_test.py
aquanauts/tellus
0
12773041
import json import pathlib import datetime as dt from io import StringIO import jsonpickle import pytest from tellus import __version__ from tellus.configuration import TELLUS_GO, TELLUS_INTERNAL from tellus.persistence import ( PickleFilePersistor, TELLUS_SAVE_DIR, PersistenceSetupException, PERSISTO...
1.882813
2
src/test/data/pa3/AdditionalTestCase/UnitTest/IfExpr_else.py
Leo-Enrique-Wu/chocopy_compiler_code_generation
0
12773042
print("then" if (8 > 9) else "else")
2.8125
3
rabi_amp.py
rikyborg/presto-measure
0
12773043
# -*- coding: utf-8 -*- """ Measure Rabi oscillation by changing the amplitude of the control pulse. The control pulse has a sin^2 envelope, while the readout pulse is square. """ import ast import math import os import time import h5py import numpy as np from numpy.typing import ArrayLike from mla_server import set...
2.734375
3
cakechat/utils/env.py
4R7I5T/cakechat
1
12773044
<gh_stars>1-10 import os def _use_gpu_env(): try: use_gpu = os.environ['USE_GPU'] return int(use_gpu) except (KeyError, ValueError): return None def is_dev_env(): try: is_dev = os.environ['IS_DEV'] return bool(int(is_dev)) except (KeyError, ValueError): ...
2.40625
2
ex096.py
igormba/python-exercises
0
12773045
<reponame>igormba/python-exercises<filename>ex096.py '''Faça um programa que tenha uma função chamada área(), que receba as dimensões de um terreno retangular (largura e comprimento) e mostre a área do terreno.''' def linha(): print('=' * 30) def area(): resultado = l * c print('=' * 50) print(f'A áre...
4.21875
4
e_ggp/evolving_gp.py
anonym-4989/e-ggp
1
12773046
<reponame>anonym-4989/e-ggp # Copyright 2021 (c) anonymous-4989 - All Rights Reserved # from gpytorch import means from gpytorch.models import ExactGP from gpytorch.distributions import MultivariateNormal class eGGP(ExactGP): def __init__(self, train_x, train_y, likelihood, kernel): super(eGGP, self)._...
2.46875
2
src/application.py
djFooFoo/aws-lambda-add-article
0
12773047
<gh_stars>0 import os from images import image_service from rss import feed_reader from scraping import scraper def handler(event, context): latest_article_url = feed_reader.get_latest_article_url(os.environ['ARTICLE_RSS_FEED_URL']) article = scraper.get_article(latest_article_url) image_id = image_servi...
2.53125
3
tests/test_forms.py
RobSpectre/Mobile-App-Distribution-with-SMS
2
12773048
<filename>tests/test_forms.py import unittest from werkzeug.datastructures import MultiDict from .context import forms class TestSmsInviteForm(unittest.TestCase): def test_e164(self): test_formats = ['(555) 555 5555', '555.555.5555', '(555)555.5555', '5555555555'] for test_format...
3.09375
3
main.py
Gesporidgers/Logarifmer
0
12773049
import math print('Вас приветствует логарифмер.') print('Выберите тип (1 - Двоичный, 2 - Стандартный десятичный)') a = int(input()) b = float(input('Введите число: ')) if a == 1 : print(math.log(b, 2)) elif a == 2 : print(math.log(b)) else: print('Ошибка!')
3.765625
4
tests/test_install.py
TarzanZhao/alpa
0
12773050
"""Some basic tests to test installation.""" import os import unittest from flax import linen as nn from flax.training.train_state import TrainState import jax import jax.numpy as jnp import numpy as np import optax import ray from alpa import (init, parallelize, grad, ShardParallel, automatic_layer...
2.140625
2