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
BaseStation/src/rocket_packet/rocket_packet_parser.py
ul-gaul/Avionique_Software
3
12786651
<gh_stars>1-10 import abc from src.rocket_packet.rocket_packet import RocketPacket class RocketPacketParser: __metaclass__ = abc.ABCMeta def __init__(self, version: int, packet_format: str, num_bytes: int): self.version = version self.format = packet_format self.num_bytes = num_bytes...
2.796875
3
test/read_from_url.py
egemenzeytinci/readmrz
0
12786652
<filename>test/read_from_url.py from readmrz import MrzDetector, MrzReader from unittest import TestCase class ReadFromUrlTest(TestCase): BASE = 'https://raw.githubusercontent.com/egemenzeytinci' VALID_URL = f'{BASE}/readmrz/master/images/example.jpg' def test_valid(self): detector = MrzDetector(...
3.0625
3
b2validators/document.py
math-s/b2bit-validators
0
12786653
<reponame>math-s/b2bit-validators import re from b2validators.exceptions import ValidationError def validate_cnpj(value): cnpj = re.sub("[^0-9]", "", value) if len(cnpj) < 14: raise ValidationError("O CNPJ precisa ter 14 dígitos.") expected_cnpj = [int(digit) for digit in cnpj[:12] if digit.isdig...
2.71875
3
examples/basic_shapes.py
abey79/lines
39
12786654
<reponame>abey79/lines<gh_stars>10-100 from lines import Cube, Cylinder, Pyramid, Scene def main(): # Setup the scene scene = Scene() scene.add(Cube(translate=(2, 0, 0))) scene.add(Pyramid()) scene.add(Cylinder(scale=(0.5, 0.5, 1), translate=(-2, 0, 0))) scene.look_at((2, 6, 1.5), (0, 0, 0)) ...
2.921875
3
daemon/wakeserver/network.py
opiopan/wakeserver
1
12786655
<filename>daemon/wakeserver/network.py import os import sys import time import json import socket import subprocess import requests import monitoring MASTER_SERVICE = '_wakeserver._tcp' SLAVE_SERVICE = '_wakeserver_slave._tcp' LISTSERVICE = '/var/www/wakeserver/bin/listservice' HOSTNAME = socket.gethostname() + '.loc...
2.515625
3
36_Valid Sudoku.py
Alvin1994/leetcode-python3-
0
12786656
class Solution: def isValidSudoku(self, board: List[List[str]]) -> bool: if not board or not board[0]: return tmp = [] for r in range(len(board)): for c in range(len(board[0])): if board[r][c] != ".": tmp += [(board[r][c],...
3.5
4
tests/nfs_module_test.py
web-sys1/NFSyndication
0
12786657
<filename>tests/nfs_module_test.py import os, glob import pytest import subprocess import pytest from NFSyndication import init as NFS_init from NFSyndication.core import args # test@ # Change the action associated with your option to action='store' def test_conf(): #We use these conditions to check the statement...
2.09375
2
translate2/numberout.py
sdytkht/se2se
0
12786658
# -*- coding: utf-8 -*- """ Created on Tue Mar 28 00:02:08 2017 @author: kht """ import tensorflow as tf import translate as tl import numpy as np def weight_variable(shape): initial = tf.truncated_normal(shape, stddev=0.1) return tf.Variable(initial) def bias_variable(shape): initial = tf.constant(0.1, ...
2.546875
3
publiapp_api/migrations/0010_auto_20200925_0300.py
KevinPercy/PubliAppAPI
0
12786659
# Generated by Django 3.0.7 on 2020-09-25 03:00 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('publiapp_api', '0009_auto_20200922_0303'), ] operations = [ migrations.CreateModel( name='Ubige...
1.539063
2
ai_covid_19/transformers/nlp.py
nestauk/ai_covid_19
0
12786660
#Various functions and utilities that we use to work with text import re import string from string import punctuation from string import digits import pandas as pd import numpy as np from nltk.corpus import stopwords from sklearn.feature_extraction.text import TfidfVectorizer from gensim import corpora, models from nlt...
3.4375
3
EnlightenGAN/data/unaligned_dataset.py
chenwydj/dynamic_light_unfolding
0
12786661
import torch from torch import nn import os.path import torchvision.transforms as transforms from EnlightenGAN.data.base_dataset import BaseDataset, get_transform from EnlightenGAN.data.image_folder import make_dataset import random from PIL import Image import PIL from pdb import set_trace as st import numpy as np fro...
2.234375
2
wrappers/tensorflow/example5 - denoise.py
NobuoTsukamoto/librealsense
6,457
12786662
<reponame>NobuoTsukamoto/librealsense import pyrealsense2 as rs import numpy as np import cv2 from tensorflow import keras import time, sys # Configure depth and color streams pipeline = rs.pipeline() config = rs.config() config.enable_stream(rs.stream.depth, 848, 480, rs.format.z16, 30) config.enable_stream(rs.stream...
2.453125
2
pydantic_models.py
OmarThinks/flask_encryption_endpoint
0
12786663
<reponame>OmarThinks/flask_encryption_endpoint from pydantic import BaseModel, constr message_constraint = constr(max_length=1000000000000) original_constraint = constr(max_length=1000000) passphrase_constraint = constr(min_length=2, max_length=10000) class DecryptionInputs(BaseModel): message : str passphra...
2.625
3
rebalance.py
hainingpan/inverse_volatility_caculation
3
12786664
from datetime import datetime, date import math import numpy as np import time import sys import requests import re from ortools.linear_solver import pywraplp # if len(sys.argv) == 1: # symbols = ['UPRO', 'TMF'] # else: # symbols = sys.argv[1].split(',') # for i in range(len(symbols)): # ...
2.578125
3
models/admin_control.py
chaoannricardo/NTU_CARDO_Database
1
12786665
<gh_stars>1-10 # -*- coding: utf8 -*- from time import sleep as t_sleep import configuration as conf from models import data_processing, database_management, file_management import pymysql from views import view_CLI def admin_control(): print("【管理員模式】") print("0. 產生主表(請使用專用表格)") command = input("# 請輸入您所需要...
2.328125
2
papers/CS-F-LTR/src/decision_tree_semi.py
mindspore-ai/contrib
2
12786666
<gh_stars>1-10 """[summary] """ import pickle import os import numpy as np from sklearn.tree import DecisionTreeClassifier from utils import evaluation from scipy.stats import mode class DecisionTreeSemi: """[summary] """ def __init__(self, train_relevance_labels, train_features, test_rel...
2.515625
3
pennylane/templates/subroutines/hardware_efficient.py
pearcandy/pennylane
0
12786667
''' hardware_efficient.py This code is distributed under the constitution of GNU-GPL. (c) PearCandy ...
2.296875
2
ex106.py
raphael-abrantes/exercises-python
0
12786668
<filename>ex106.py<gh_stars>0 import sys, os caminho = os.path.dirname(__file__) sys.path.append(caminho[:caminho.find('exs')]) from time import sleep def printlin(txt): print(f'~'*int(len(txt) + 4),flush=False) print(f' {txt} ',flush=False) print(f'~'*int(len(txt) + 4), flush=False) def pyhel...
3.0625
3
paradigm/Selection.py
Paradigm-shift-AI/paradigm-brain
0
12786669
<reponame>Paradigm-shift-AI/paradigm-brain import random import operator class Selection: def __init__(self, preprocessed_question, list_of_questions, token=False): """ list_of_questions: [ questionTypeID: [<question_object>], ] """ self.preprocessed_qu...
3.09375
3
pi7db/tests/csvtest/test.py
shivjeetbhullar/pi7db
4
12786670
<reponame>shivjeetbhullar/pi7db<filename>pi7db/tests/csvtest/test.py import os import pandas as pd class tabledb: def __init__(self,db_name): self.db_name = db_name if not os.path.exists(db_name):os.mkdir(db_name) def create_table(self,**kwargs): if 'name' in kwargs and 'colums' in kwargs and isinstance(...
2.90625
3
ftpclient.py
ryanshim/cpsc558-minimal-ftp
0
12786671
<filename>ftpclient.py """ Simple implementation of a FTP client program used for pedagogical purposes. Current commands supported: get <filename>: retrieve the file specified by filename. put <filename>: send the file to the server specified by filename. cd <path>: change the current working directory to t...
3.859375
4
scripts/modules/tests/test_reweighting.py
andrrizzi/tfep-revisited-2021
7
12786672
#!/usr/bin/env python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Test objects and function in the module reweighting. """ # ===================================================...
2.34375
2
test/test_jump.py
mind-owner/Cyberbrain
2,440
12786673
from cyberbrain import Binding, InitialValue, Symbol def test_jump(tracer, check_golden_file): a = [] b = "b" c = "c" tracer.start() if a: # POP_JUMP_IF_FALSE pass # JUMP_FORWARD else: x = 1 if not a: # POP_JUMP_IF_TRUE x = 2 x = a != b != c # JUMP_IF_FA...
2.578125
3
Python/Essential things/testing.py
honchardev/Fun
0
12786674
<filename>Python/Essential things/testing.py<gh_stars>0 import unittest class TestUM(unittest.TestCase): def setUp(self): """This method executes BEFORE each test""" pass def tearDown(self): """This method executes AFTER each test""" pass """ def setUpClass(cls): ...
3.875
4
src/config.py
muzilli/azure-batch-ffmpeg
0
12786675
<reponame>muzilli/azure-batch-ffmpeg<filename>src/config.py # ------------------------------------------------------------------------- # # THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, # EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES # OF MERCHANTABILITY...
1.445313
1
setup.py
inmagik/django-rest-admin
15
12786676
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import django_rest_admin try: from setuptools import setup except ImportError: from distutils.core import setup version = django_rest_admin.__version__ if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') os.syste...
1.804688
2
screenshooter/__main__.py
guilherme-kenzo/auto-lovelace-screenshooter
0
12786677
from .client import ScreenshotClient import schedule import click from .schedule import run_screenshot_every @click.command() @click.option("--xpath", type=click.STRING, required=True, help="The XPATH of the element to be screenshot.") @click.option("--output-file", type=click.STRING, required=True, help="The path o...
2.8125
3
sardine/lang/parser/objects.py
JavierLuna/sardine
0
12786678
class RepositoryDeclaration: __slots__ = ('name', 'alias') def __init__(self, name: str, alias: str): self.name = name self.alias = alias def __repr__(self): return f"<Repository {self.alias} ('{self.name}')>" class StackDeclaration: __slots__ = ('name', 'repository_name', 'a...
3.140625
3
structural_patterns/flyweight_pattern/app.py
Stihotvor/python3_patterns
0
12786679
class Grade(object): _instances = {} def __new__(cls, percent): percent = max(50, min(99, percent)) letter = 'FDCBA'[(percent - 50) // 10] self = cls._instances.get(letter) if self is None: self = cls._instances[letter] = object.__new__(Grade) self.letter...
3.4375
3
experiments/ukf_baseball.py
VladPodilnyk/Kalman-and-Bayesian-Filters-in-Python
12,315
12786680
<gh_stars>1000+ # -*- coding: utf-8 -*- """ Created on Sun Feb 8 09:55:24 2015 @author: rlabbe """ from math import radians, sin, cos, sqrt, exp, atan2, radians from numpy import array, asarray from numpy.random import randn import numpy as np import math import matplotlib.pyplot as plt from filterpy.kalman import U...
2.9375
3
tests/helpers.py
Pineirin/invenio-theme
7
12786681
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2017-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Pytest helpers.""" from __future__ import absolute_import, print_function impor...
1.734375
2
devspace/commands/render.py
d12y12/DevSpace
0
12786682
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import devspace from devspace.commands import DevSpaceCommand from devspace.exceptions import UsageError from devspace.utils.misc import walk_modules from devspace.servers import DevSpaceServer import inspect def _get_server_from_module(module_name, server_nam...
2.46875
2
scaffold/generators/common.py
CaravelKit/saas-base
189
12786683
<reponame>CaravelKit/saas-base<filename>scaffold/generators/common.py # Functions used all the generators import os # Check if file and path exist, if not, create them. Then rewrite file or add content at the # beginning, commenting the existing part. def create_write_file(file_path, new_content, rewrite = False, co...
2.53125
3
src/authentication/mailchimp/__init__.py
pykulytsky/freelance-service
0
12786684
from authentication.mailchimp.client import AppMailchimp from authentication.mailchimp.http import MailchimpHTTPException from authentication.mailchimp.member import MailchimpMember __all__ = [ AppMailchimp, MailchimpMember, MailchimpHTTPException, ]
1.382813
1
commands/room.py
pariahsoft/Dennis
1
12786685
<gh_stars>1-10 ######################################## ## Adventure Bot "Dennis" ## ## commands/room.py ## ## Copyright 2012-2013 PariahSoft LLC ## ######################################## ## ********** ## Permission is hereby granted, free of charge, to any person obtaining a copy ## o...
1.820313
2
to_html.py
ImportTaste/AIDScrapper
5
12786686
import os import json from pathlib import Path from jinja2 import Environment, FileSystemLoader from aids.app.settings import BASE_DIR class toHtml: def __init__(self): self.env = Environment(loader=FileSystemLoader(BASE_DIR / 'templates')) self.out_path = Path().cwd() self....
2.40625
2
tests/test_utils.py
kirillskor/dedoc
0
12786687
import os def get_full_path(path, file=__file__): dir_path = os.path.dirname(file) return os.path.join(dir_path, path)
2.5625
3
starter.py
osanchez42/Device42_HPSM_Sync
0
12786688
# -*- coding:utf-8 -*- import sys reload(sys) sys.setdefaultencoding('utf8') import imp import csv import StringIO from hpsm import HpsmApi from device42 import Device42Doql conf = imp.load_source('conf', 'conf') device42 = { 'host': conf.d42_host, 'username': conf.d42_username, 'password': <PASSWO...
2.34375
2
advances/lambda.py
tienduy-nguyen/python-learning
0
12786689
# lambda Parameter: Operation(parameter) lambda x: x+1 # Equivalence def plus(x): return x +1 lambda x, y: x*y # Equivalence def mul(x, y): return x*y # Example nums = [[10, 20, 11], [3, 9, 6], [8, 14, 3]] # Sort from the second value in sub array sorted(nums, key=lambda x: x[1], reverse = True) # Ex2: sort...
3.953125
4
aiokraken/rest/tests/strats/st_assets.py
asmodehn/aiokraken
0
12786690
from aiokraken.model.tests.strats.st_asset import AssetStrategy from aiokraken.rest.assets import Assets import hypothesis.strategies as st @st.composite def st_assets(draw): apl = draw(st.lists(elements=AssetStrategy(), max_size=5, unique_by=lambda x: x.restname)) return Assets(assets_as_dict={ap.restname:...
2.34375
2
pyvo/utils/http.py
theresadower/pyvo
29
12786691
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ HTTP utils """ import requests from ..version import version DEFAULT_USER_AGENT = 'python-pyvo/{}'.format(version) def use_session(session): """ Return the session passed in, or create a default session to use for this network request. ...
2.1875
2
canary/tasks/taskflow/driver.py
rackerlabs/canary
5
12786692
# Copyright (c) 2015 Rackspace, 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 wr...
1.59375
2
app.py
roh-kan/summarize-wordpress-blog
0
12786693
from flask import Flask, render_template, flash, request from flask_bootstrap import Bootstrap from flask_wtf import FlaskForm from wtforms import SubmitField from wtforms.fields.html5 import URLField, IntegerField from wtforms.validators import DataRequired, Optional from wtforms.widgets import html5 as h5widgets from...
2.390625
2
tests/test_inutils.py
buteco/inutils
6
12786694
import pytest from inutils import chunkify @pytest.mark.parametrize( "iterable, expected", ( ([1], [[1]]), ([1, 2], [[1, 2]]), ([1, 2, 3], [[1, 2], [3]]), ([1, 2, 3, 4, 5], [[1, 2], [3, 4], [5]]), (range(1, 7), [[1, 2], [3, 4], [5, 6]]), ), ) def test_chunkify_size...
2.453125
2
setup.py
lzrvch/pyspikelib
3
12786695
"""pyspikelib: A set of tools for neuronal spiking data mining""" import os import re import codecs import setuptools here = os.path.abspath(os.path.dirname(__file__)) with open('README.md', 'r') as fh: LONG_DESCRIPTION = fh.read() def read(*parts): with codecs.open(os.path.join(here, *parts), 'r') as fp: ...
2.1875
2
myfuc/__init__.py
kamomehz/waveletCodingCNN
0
12786696
<filename>myfuc/__init__.py from .makeData import * from .makeImg import * from .makeNet import * from .makeWT import * from .makePlot import * from .trainScript import *
1.304688
1
cellwars.py
mfontanini/cellwars-python
0
12786697
<filename>cellwars.py ''' cellwars.py =========== The cellwars python bot package. ''' from enum import Enum import sys # Internal classes start here class InputProcessingException(Exception): pass class CommandType(Enum): INITIALIZE = 0 SPAWN = 1 DIE = 2 SET_CELL_PROPERTIES = 3 CONFLICTING_...
2.84375
3
app/question/translation/question_translation_api_models.py
hmajid2301/banter-bus-management-api
0
12786698
<reponame>hmajid2301/banter-bus-management-api from typing import Optional from pydantic import BaseModel from app.core.models import QuestionGroup class QuestionTranslationIn(BaseModel): content: str class QuestionTranslationOut(BaseModel): question_id: str game_name: str language_code: str r...
2.296875
2
chatbot_tutorial/routing.py
joseseb91/django-chat-bot
0
12786699
<reponame>joseseb91/django-chat-bot from .wsgi import * # add this line to top of your code from channels.auth import AuthMiddlewareStack from channels.routing import ProtocolTypeRouter, URLRouter from django.urls import path from chatbot_tutorial import consumer application = ProtocolTypeRouter({ 'websocket': A...
1.835938
2
platform/hwconf_data/zgm13/modules/BULBPWM_COLOR/BULBPWM_COLOR_behavior.py
lenloe1/v2.7
0
12786700
from . import ExporterModel from . import BULBPWM_COLOR_model from . import RuntimeModel class BULBPWM_COLOR(ExporterModel.Module): def __init__(self, name=None): if not name: name = self.__class__.__name__ super(BULBPWM_COLOR, self).__init__(name, visible=True) self.model = BU...
2.3125
2
TFRegression9.py
neuromorphs/telluride-decoding-toolbox
3
12786701
<reponame>neuromorphs/telluride-decoding-toolbox<filename>TFRegression9.py # -*- coding: utf8 -*- """EEG Regression - Core TensorFlow implementation code. July 2016 March 2017 - update Enea, integrated the queue. """ import gc import math import re import resource import sys import time import matplotlib.pyplot as ...
2.515625
3
custom_components/afvalwijzer/const/const.py
kcleong/homeassistant-config
0
12786702
import logging from datetime import timedelta API = "api" NAME = "afvalwijzer" VERSION = "2021.05.01" ISSUE_URL = "https://github.com/xirixiz/homeassistant-afvalwijzer/issues" SENSOR_PROVIDER_TO_URL = { "afvalwijzer_data_default": [ "https://api.{0}.nl/webservices/appsinput/?apikey=5ef443e778f41c4f75c6945...
2.421875
2
src/dhapi/lib/auth.py
rayleighko/dhlottery-api
4
12786703
import copy import requests class AuthController: _REQ_HEADERS = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36", "Connection": "keep-alive", "Cache-Control": "max-age=0", "sec-ch-ua": '" No...
2.5
2
libtiff/tests/test_tiff_array.py
IanZhao/pylibtiff
4
12786704
import os import atexit from tempfile import mktemp from numpy import * from libtiff import TIFF from libtiff import TIFFfile, TIFFimage def test_simple_slicing(): for planar_config in [1,2]: for compression in [None, 'lzw']: for itype in [uint8, uint16, uint32, uint64, ...
2.453125
2
pcrc/connection/patch.py
YehowahLiu/PCRC
0
12786705
<gh_stars>0 from threading import Lock from typing import Set from redbaron import RedBaron, IfelseblockNode, AssignmentNode, WithNode from pcrc.utils import redbaron_util __patch_lock = Lock() __patched = False def patch_pycraft(): global __patched with __patch_lock: if __patched: return __patched = True...
2.390625
2
pr_flow/gen_route.py
vagrantxiao/dirc_riscv
0
12786706
#!/usr/bin/env python import os import xml.etree.ElementTree class direct_int: def __init__(self, prflow_params): self.prflow_params = prflow_params def gen_routing(self): os.system("rm -rf "+self.prflow_params['dest_dir']) os.system("mkdir "+self.prflow_params['dest_dir']) os.system("cp ./input...
2.4375
2
trs_filer/ga4gh/trs/endpoints/utils.py
zagganas/trs-filer
8
12786707
<filename>trs_filer/ga4gh/trs/endpoints/utils.py<gh_stars>1-10 """Utility functions for endpoint controllers.""" from random import choice import string def generate_id( charset: str = ''.join([string.ascii_letters, string.digits]), length: int = 6, ) -> str: """Generate random string based on allowed se...
2.546875
3
radiobear/Constituents/h2o/h2o_ddb.py
david-deboer/radiobear
3
12786708
import math import os.path from radiobear.constituents import parameters # Some constants T0 = 300.0 # reference temperature in K AMU_H2O = 18.015 R = 8.314462E7 # Set data arrays f0 = [] Ei = [] A = [] GH2 = [] GHe = [] GH2O = [] x_H2 = [] x_He = [] x_H2O = [] def readInputFiles(par)...
2.40625
2
IO_helper.py
begab/mamus
13
12786709
import re import gzip import numpy as np from zipfile import ZipFile def load_corpus(corpus_file, load_tags=False): if corpus_file.endswith('.gz'): corpus = [] with gzip.open(corpus_file, 'r') as f: for line in f: corpus.append(line.decode("utf-8").split()) elif cor...
2.953125
3
application.py
bgalde-dev/dinism
0
12786710
from flask import (Flask, render_template, jsonify, request, redirect) import os import logging # Get the logger logger = logging.getLogger() logger.setLevel(logging.INFO) ################################################# # Flask Setup ################################################# application = Flask(__name__) ...
2.59375
3
big_data/python_tools/big_data_tools/bokeh_tools/line_plot.py
paulhtremblay/big-data
0
12786711
<filename>big_data/python_tools/big_data_tools/bokeh_tools/line_plot.py from bokeh.io import show from bokeh.plotting import figure import datetime import argparse from bokeh.models import NumeralTickFormatter def line_plot(p, x, y, line_width = 2, legend=None): p.line(x,y, line_width =line_width,legend=legend )...
2.828125
3
Project 7 -- Melanoma Cancer Detection with Deep Learning, CNN using TensorFlow/Inception.py
Vauke/Deep-Neural-Networks-HealthCare
2
12786712
<filename>Project 7 -- Melanoma Cancer Detection with Deep Learning, CNN using TensorFlow/Inception.py<gh_stars>1-10 import tensorflow as tf import numpy as np from tensorflow.python.framework import tensor_shape class InceptionV3: bottleneckTensor = None finalTensor = None groundTruthInput = None ...
2.765625
3
DataStructurePython/stack.py
xnth97/Data-Structure-Notes
0
12786713
<reponame>xnth97/Data-Structure-Notes<filename>DataStructurePython/stack.py class Stack: def __init__(self): self.array = [] def is_empty(self): return len(self.array) == 0 def push(self, item): self.array.append(item) def pop(self): if self.is_empty(): ret...
3.421875
3
funcs.py
DhruvPatel01/NotAeroCalc
0
12786714
<reponame>DhruvPatel01/NotAeroCalc univariate_funcs = { 'log', 'exp', 'log10', 'sqrt', 'abs', 'cos', 'sin', 'tan', 'arccos', 'arcsin', 'arctan', }
1.25
1
agsearch/text.py
Viva-Lambda/agsearch-python
0
12786715
# simple text object from typing import List, Dict import os import pdb import re from agsearch.textinfo import TextInfo from agsearch.terminfo import TermInfo from agsearch.utils import DATA_DIR from agsearch.utils import PUNCTUATIONS from greek_accentuation.characters import base from cltk.stop.greek.stops import S...
2.59375
3
migrations/versions/452faf7b38da_.py
alijafer/familyTree
0
12786716
<filename>migrations/versions/452faf7b38da_.py<gh_stars>0 """empty message Revision ID: 452faf7b38da Revises: Create Date: 2020-07-04 00:50:28.003698 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '452faf7b38da' down_revision = None branch_labels = None depen...
1.484375
1
misc/greenlet_workers.py
establishment/django-establishment
1
12786717
import gevent import gevent.queue from establishment.misc.command_processor import BaseProcessor from establishment.misc.threading_helper import ThreadHandler from establishment.funnel.redis_stream import RedisStreamPublisher, RedisStreamSubscriber, RedisQueue, \ redis_response_to_json class GreenletWorker(geven...
2.140625
2
setup.py
downneck/mothership
4
12786718
#!/usr/bin/python import setuptools from setuptools import setup, find_packages install_requires = [ 'cmdln', 'SQLAlchemy == 0.5.5' ] extras_require = { 'ldap' : 'python-ldap', 'postgres' : 'psycopg2' } setup(name='Mothership', author='Gilt SA team', author_email='<EMAIL>', ...
1.226563
1
programming-laboratory-I/1wge/FC.py
MisaelAugusto/computer-science
0
12786719
f = float(raw_input()) c = (f - 32)/1.8 k = c + 273.15 print "Fahrenheit: %.3f F" %f print "Celsius: %.3f C" %c print "Kelvin: %.3f K" %k
3.5625
4
html_export.py
slookin/sparx2web
0
12786720
<reponame>slookin/sparx2web import shutil import traceback from sparx_lib import logger from sparx_lib import open_repository import argparse import yaml config_file = open("config.yaml","r") config = yaml.load(config_file, Loader=yaml.FullLoader) config_file.close() #print(config) #exit(1) parser = argparse.Argumen...
2.234375
2
scrape-twitter.py
Lackshan/crypto-tweet-tracker
1
12786721
<reponame>Lackshan/crypto-tweet-tracker # This will be a script or part of a script from bs4 import BeautifulSoup as soup import requests URL = "https://twitter.com/elonmusk" # 1. Make a request to twritter def request_page(): try: response = requests.get(URL) except Exception as e: print(e) ...
3.453125
3
testproject/urls.py
Camille-cmd/django-rosetta
0
12786722
<filename>testproject/urls.py from django.conf.urls import include, re_path from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns admin.autodiscover() urlpatterns = [ re_path(r'^admin/', admin.site.urls), re_path(r'^rosetta/', include('rosetta.urls')), ] urlpat...
1.890625
2
models/dynamic_memory/memory_retention_vector.py
zankner/DNC
3
12786723
<filename>models/dynamic_memory/memory_retention_vector.py import tensorflow as tf import numpy as np def mem_retention(free_gates, read_weightings): return tf.linalg.matvec(free_gates, read_weightings, transpose_a=True)
2.671875
3
adv_ant/retroNet/urls.py
ayushxx7/retroNet
40
12786724
<reponame>ayushxx7/retroNet<filename>adv_ant/retroNet/urls.py<gh_stars>10-100 from django.urls import path, include, re_path from . import views urlpatterns = [ path("register", views.register, name="register"), path('', include("django.contrib.auth.urls")), re_path(r'^$', views.my_profile, name='profile_t...
1.953125
2
modules/expense_manage/models.py
xuhuiliang-maybe/ace_office
1
12786725
# coding=utf-8 from django.contrib.auth.models import User from django.db import models from modules.dict_table.models import ExpenseType from modules.employee_management.employee_info.models import Employee from modules.project_manage.models import Project APPLY_STATUS_CHOICES = ( ('1', u'待审批'), ('2', u'通过'), ('3',...
2.109375
2
_site/tomat/apps/checkout/models.py
Lisaveta-K/lisaveta-k.github.io
0
12786726
<filename>_site/tomat/apps/checkout/models.py # -*- coding: utf-8 -*- import datetime from django.db import models from users.models import User, Address from products.models import Product from shops.models import Delivery, Shop, Discount from adverts.models import Coupon class OrderItem(models.Model): order ...
2.046875
2
DepthGAN/losses/base_generator_loss.py
sharanramjee/single-image-stereo-depth-estimation
0
12786727
import torch import torch.nn as nn import torch.nn.functional as F from losses.bilinear_sampler import apply_disparity from .ssim import ssim_gauss, ssim_godard class BaseGeneratorLoss(nn.modules.Module): def __init__(self, args): super(BaseGeneratorLoss, self).__init__() self.which_ssim = args.w...
1.765625
2
euler59.py
dchourasia/euler-solutions
0
12786728
<filename>euler59.py<gh_stars>0 ''' Your task has been made easy, as the encryption key consists of three lower case characters. Using p059_cipher.txt (right click and 'Save Link/Target As...'), a file containing the encrypted ASCII codes, and the knowledge that the plain text must contain common English words, decrypt...
3.875
4
StockNest/login/funcs.py
vaibhavantil2/Stock-Price-Forecasting-Using-Artificial-Intelligence
29
12786729
from essentials.views import randomString,getCurrentTime,errorResp from models import authToken,verificationCode from constants import AUTH_EXPIRY_MINS from StockNest.settings import LOGIN_URL from django.http import HttpResponseRedirect,JsonResponse,HttpRequest from django.db.models import Q from school.funcs import i...
2.21875
2
nca47/objects/firewall/fw_addrobj_info.py
WosunOO/nca_xianshu
0
12786730
from nca47.db import api as db_api from nca47.objects import base from nca47.objects import fields as object_fields from nca47.db.sqlalchemy.models.firewall import ADDROBJ class FwAddrObjInfo(base.Nca47Object): VERSION = '1.0' fields = { 'id': object_fields.StringField(), 'name': object_field...
2.359375
2
conta/main/tests/views/test_InformesView.py
osso73/contabilidad
0
12786731
from pytest_django.asserts import assertTemplateUsed from fixtures_views import * class TestInformesView: @pytest.fixture def form_parametros(self, django_app): resp = django_app.get(reverse('main:informes'), user='username') return resp.forms['parametros'] @pytest.fixture def popula...
2.109375
2
vvcontrollers/__init__.py
yarmenti/py_vvcontrollers
0
12786732
__author__ = "<NAME>" __version__ = "0.1.1" """ Helpers to use voila-vuetify template of the Jupyter voila-dashboard project. """ from .application import ApplicationVoilaVuetify from .menu import MenuController from .core import CoreController from .abstract import AbstrController from .dialog import DialogControlle...
1.070313
1
wagtail_unsplash/forms.py
zerolab/wagtail-unsplash
0
12786733
# class UnsplashSearchForm(Form): # query =
1.15625
1
api_config.py
eduardoltorres/the-debug-ducky
0
12786734
import tweepy from logger_config import logger from secrets import * def create_api(): auth = tweepy.OAuthHandler(API_KEY, API_SECRET) auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET) api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True) try: api.verify_creden...
2.703125
3
src/constants.py
ari-bou/symro
0
12786735
# Script Flags # ---------------------------------------------------------------------------------------------------------------------- SPECIAL_COMMAND_MODEL = "MODEL" SPECIAL_COMMAND_ADDITIONAL_MODEL = "ADDITIONAL_MODELS" SPECIAL_COMMAND_INIT_DATA = "INIT_DATA" SPECIAL_COMMAND_SETUP = "SETUP" SPECIAL_COMMAND_NOEVAL = ...
1.5625
2
src/annalist_root/annalist/views/fields/render_ref_image.py
gklyne/annalist
18
12786736
<filename>src/annalist_root/annalist/views/fields/render_ref_image.py from __future__ import unicode_literals from __future__ import absolute_import, division, print_function """ Renderer and value mapper for URI value displayed as an image. """ __author__ = "<NAME> (<EMAIL>)" __copyright__ = "Copyright 2014, ...
2.046875
2
refactorings/increase_field_visibility.py
ashrafizahra81/CodART
1
12786737
<reponame>ashrafizahra81/CodART import logging from refactorings.utils.utils2 import parse_and_walk try: import understand as und except ImportError as e: print(e) from antlr4.TokenStreamRewriter import TokenStreamRewriter from gen.javaLabeled.JavaParserLabeled import JavaParserLabeled from gen.javaLabeled....
2.15625
2
problems/765.py
mengshun/Leetcode
0
12786738
""" 765. 情侣牵手 N 对情侣坐在连续排列的 2N 个座位上,想要牵到对方的手。 计算最少交换座位的次数,以便每对情侣可以并肩坐在一起。 一次交换可选择任意两人,让他们站起来交换座位 """ def minSwapsCouples(row): n = len(row) # 总人数 N = n >> 1 # 情侣对数 # 并查集 parent = list(range(N)) size = [1] * N # 查 def find(x): if x != parent[x]: parent[x] = find(parent...
3.53125
4
python_backend/covidManager/migrations/0001_initial.py
KedarKshatriya/HackOn_Hackathon
0
12786739
# Generated by Django 3.0.2 on 2020-04-13 17:03 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='User', fields=[ ('id', models.AutoField(aut...
1.890625
2
vaquero/pipeline.py
jbn/vaquero
1
12786740
import ast import imp import inspect import types from .invocation_tools import _name_of class PipelineCommand: def __init__(self, name): self._name = name class SkipTo(PipelineCommand): # TODO: Singleton? def __init__(self, resuming_function_name): self.function_name = _name_of(resuming...
2.375
2
conf_site/proposals/tests/test_exporting_submissions.py
pydata/conf_site
13
12786741
<filename>conf_site/proposals/tests/test_exporting_submissions.py from random import randint from conf_site.core.tests.test_csv_view import StaffOnlyCsvViewTestCase from conf_site.proposals.tests.factories import ProposalFactory from conf_site.proposals.views import ExportSubmissionsView class ExportSubmissionsViewT...
2.265625
2
projecto1/aula 16.py
Rachidomar1523/pythonExercicios
0
12786742
<reponame>Rachidomar1523/pythonExercicios #lanche = 'rachid', 'omar', 'mersson', 'govnahica' #print(lanche[-4:4:2]) a = 1, 2, 5,8 b = 7, 9, 3 print(a+b)
3.546875
4
prefect_ds/task_runner.py
AndrewRook/prefect_ds
22
12786743
<filename>prefect_ds/task_runner.py from prefect.core import Edge from prefect.engine.state import State from prefect.engine.task_runner import TaskRunner from typing import Dict, Any class DSTaskRunner(TaskRunner): def run( self, state: State = None, upstream_states: Dict[Edge, State] = N...
2.3125
2
toollib/__init__.py
atpuxiner/toollib
113
12786744
<filename>toollib/__init__.py """ @author axiner @version v1.0.0 @created 2021/12/12 13:14 @abstract This is a tool library. @description @history """ from pathlib import Path here = Path(__file__).absolute().parent __version__ = '2022.05.11'
1.28125
1
settings.py
chenke91/ckPermission
0
12786745
<reponame>chenke91/ckPermission #coding:utf-8 bind = 'unix:/var/run/gunicorn.sock' workers = 4 # you should change this user = 'root' # maybe you like error loglevel = 'debug' errorlog = '-' logfile = '/var/log/gunicorn/debug.log' timeout = 300 secure_scheme_headers = { 'X-SCHEME': 'https', } x_forwarded_for_he...
1.117188
1
tests/test_regression.py
weninc/bitshuffle-1
162
12786746
""" Test that data encoded with earlier versions can still be decoded correctly. """ from __future__ import absolute_import, division, print_function import pathlib import unittest import numpy as np import h5py TEST_DATA_DIR = pathlib.Path(__file__).parent / "data" OUT_FILE_TEMPLATE = "regression_%s.h5" VERSIO...
2.40625
2
tests/test_enhance.py
RaphaelOlivier/pyaudlib
26
12786747
<gh_stars>10-100 """Test enhancement functions.""" from audlib.quickstart import welcome from audlib.sig.window import hamming WELCOME, SR = welcome() HOP = .25 WIND = hamming(SR*.025, HOP, synth=True) def test_SSFEnhancer(): from audlib.enhance import SSFEnhancer enhancer = SSFEnhancer(SR, WIND, HOP, 512) ...
2.421875
2
examples/echo_server.py
nickovs/pypssst
0
12786748
#!/usr/bin/env python import socket from contextlib import closing import pssst import click from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat @click.command() @click.option('-k', '--key-file', help="File co...
2.78125
3
blueprint/py/bp/entity_gen/dates.py
andrey-mishchenko/blueprint-oss
7
12786749
<filename>blueprint/py/bp/entity_gen/dates.py from typing import Tuple from ..entity import Date, Entity, Text from .type_scoring import date_likeness MINIMUM_SCORE = 0.7 def get_dates(entities: Tuple[Entity, ...]) -> Tuple[Date, ...]: """Get date-like entities from the given Entities. Args: entities: Sh...
3.046875
3
tests/test_config.py
isidentical/unimport
147
12786750
<reponame>isidentical/unimport import re from pathlib import Path from unittest import TestCase from unimport import constants as C from unimport import utils from unimport.config import Config, DefaultConfig TEST_DIR = Path(__file__).parent / "configs" pyproject = TEST_DIR / "pyproject.toml" setup_cfg = TEST_DIR / ...
2.578125
3