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
main.py
NawrasseDahman/Qr-Code-Generator
1
36100
import qrcode # data example data = "www.google.com" # file name file_name = "qrcode.png" # generate qr code img = qrcode.make(data=data) # save generated qr code as img img.save(file_name)
2.953125
3
onecodex/models/helpers.py
onecodex/onecodex
19
36101
<filename>onecodex/models/helpers.py<gh_stars>10-100 import click import inspect import os import requests from onecodex.exceptions import OneCodexException, UnboundObject def as_uri(uuid, base_class): return base_class._resource._schema._uri.rstrip("#") + "/" + uuid def coerce_search_value(search_value, field...
2.1875
2
aoc-2021/day-11/day_11.py
bsamseth/advent-of-code-2018
1
36102
<filename>aoc-2021/day-11/day_11.py from itertools import count, product import numpy as np grid = np.genfromtxt("input.txt", delimiter=1, dtype=int) def propagate_flash(grid, i, j, flash_mask): flash_mask[i, j] = 1 for di, dj in product(range(-1, 2), range(-1, 2)): if 0 <= i + di < grid.shape[0] an...
2.65625
3
notebooks/_solutions/05-spatial-operations-overlays11.py
jorisvandenbossche/DS-python-geospatial
58
36103
# Calculate the intersection of the land use polygons with Muette land_use_muette = land_use.geometry.intersection(muette)
1.4375
1
lib/cbutils/misc.py
civicboom/civicboom
0
36104
""" Low level miscilanious calls """ import UserDict import types import random import datetime import pprint import re import unicodedata import logging log = logging.getLogger(__name__) now_override = None def now(): """ A passthough to get now() We can override this so that automated tests can fake ...
3.09375
3
c_comp/nodes.py
Commodoreprime/Command-Block-Assembly
223
36105
<gh_stars>100-1000 class Node: props = () def __init__(self, **kwargs): for prop in kwargs: if prop not in self.props: raise Exception('Invalid property %r, allowed only: %s' % (prop, self.props)) self.__dict__[prop] = kwargs[pro...
3.203125
3
backend/ReceiptProcessor/data_generator.py
shrey-bansal/ABINBEV
1
36106
<gh_stars>1-10 import os import cv2 from ReceiptGenerator.draw_receipt import create_crnn_sample NUM_OF_TRAINING_IMAGES = 3000 NUM_OF_TEST_IMAGES = 1000 TEXT_TYPES = ['word', 'word_column', 'word_bracket', 'int', 'float', 'price_left', 'price_right', 'percentage'] # TEXT_TYPES = ['word'] with open('./ReceiptProcess...
2.53125
3
src/web/settings.py
iwwxiong/fastapi-box
8
36107
import os from pydantic import BaseSettings class AppSettings(BaseSettings): debug: bool = False time_zone: str = "Asia/Shanghai" logger_level: str = "INFO" logger_formatter: str = "%(asctime)s [%(name)s] %(funcName)s[line:%(lineno)d] %(levelname)-7s: %(message)s" secret_key: str = "1@3$5^7*9)" ...
2.1875
2
layint_api/models/alert_events.py
LayeredInsight/layint_api_python
0
36108
# coding: utf-8 """ Layered Insight Assessment, Compliance, Witness & Control LI Assessment & Compliance performs static vulnerability analysis, license and package compliance. LI Witness provides deep insight and analytics into containerized applications. Control provides dynamic runtime security and analyti...
1.851563
2
htsworkflow/settings/felcat.py
detrout/htsworkflow
0
36109
<reponame>detrout/htsworkflow # configure debugging import os from .local import * DEBUG=True TEMPLATE_DEBUG = True INTERNAL_IPS = ('127.0.0.1',) MIDDLEWARE_CLASSES.extend([ #'debug_toolbar.middleware.DebugToolbarMiddleware', ]) DATABASES = { 'fctracker': { 'ENGINE': 'django.db.backends.sqlite3', ...
1.359375
1
PROJ/LEVY/Barrier_Options/Script_DoubleBarrierOptions.py
mattslezak-shell/PROJ_Option_Pricing_Matlab
0
36110
# Generated with SMOP 0.41-beta try: from smop.libsmop import * except ImportError: raise ImportError('File compiled with `smop3`, please install `smop3` to run it.') from None # Script_DoubleBarrierOptions.m ################################################################## ### DOUBLE BARRIER OPT...
1.648438
2
instances/migrations/0001_initial.py
glzjin/webvirtcloud
1
36111
<filename>instances/migrations/0001_initial.py # Generated by Django 2.2.10 on 2020-01-28 07:01 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('computes', '0001_initial'), ] operations = [ ...
1.671875
2
GEOS_Util/coupled_diagnostics/g5lib/plots.py
GEOS-ESM/GMAO_Shared
1
36112
''' Different utils used by plotters. ''' import mpl_toolkits.basemap as bm import matplotlib.pyplot as pl from matplotlib import colors, cm import scipy as sp # Make spectral plot def my_psd(x): P,f=pl.psd(x); pl.clf() T=2./f; ind= T>=12. pl.plot(T[ind]/12,P[ind]); ax=pl.gca(); ax.set_xscale('lo...
2.625
3
lib/TrainingUtils.py
bo9zbo9z/MachineLearning
0
36113
<filename>lib/TrainingUtils.py """ These are various mehtods that can be used in the training process. Some return values, some display images. Best used in Jupyter Notebooks. """ from __future__ import division, print_function, absolute_import # Use one of these based on the version of skimage loaded from skimage.u...
2.484375
2
setup.py
shamilbi/lyrebird
0
36114
#!/usr/bin/env python """ Lyrebird Voice Changer Simple and powerful voice changer for Linux, written in GTK 3 (c) Charlotte 2020 """ import sys import re from setuptools import setup version_regex = r'__version__ = ["\']([^"\']*)["\']' with open('app/__init__.py', 'r') as f: text = f.read() match = re.search...
1.960938
2
silkpy/symbolic/curve/transform.py
jiaxin1996/silkpy
0
36115
<gh_stars>0 from .curve import ParametricCurve as _ParametricCurve from sympy import Symbol as _Symbol def curve_normalization( other:_ParametricCurve, new_var=_Symbol('s', real=True)): from sympy import S, solveset, Eq from sympy import integrate from silkpy.sympy_utility import norm drdt...
2.3125
2
venv/Lib/site-packages/pyroute2/netlink/rtnl/riprsocket.py
kalymgr/Project-T-Cryptocurrencies
0
36116
<reponame>kalymgr/Project-T-Cryptocurrencies from pyroute2.netlink import rtnl from pyroute2.netlink import NETLINK_ROUTE from pyroute2.netlink.nlsocket import NetlinkSocket from pyroute2.netlink.rtnl.marshal import MarshalRtnl class RawIPRSocketMixin(object): def __init__(self, fileno=None): super(RawIP...
2.125
2
zhixuewang/teacher/urls.py
lihaoze123/zhixuewang-python
22
36117
from zhixuewang.urls import BASE_URL class Url: INFO_URL = f"{BASE_URL}/container/container/student/account/" CHANGE_PASSWORD_URL = f"{BASE_URL}/portalcenter/home/updatePassword/" TEST_URL = f"{BASE_URL}/container/container/teacher/teacherAccountNew" GET_EXAM_URL = f"{BASE_URL}/classreport/class/cl...
2.09375
2
2 semester/PP/9/Code/1.3.py
kurpenok/Labs
0
36118
<filename>2 semester/PP/9/Code/1.3.py sort = lambda array: [sublist for sublist in sorted(array, key=lambda x: x[1])] if __name__ == "__main__": print(sort([ ("English", 88), ("Social", 82), ("Science", 90), ("Math", 97) ]))
3.25
3
users/models.py
jannetasa/haravajarjestelma
0
36119
from django.db import models from django.utils.translation import ugettext_lazy as _ from helusers.models import AbstractUser class User(AbstractUser): is_official = models.BooleanField(verbose_name=_("official"), default=False) class Meta: verbose_name = _("user") verbose_name_plural = _("us...
2.15625
2
src/main/python/tranquilitybase/gcpdac/main/core/terraform/terraform_utils.py
tranquilitybase-io/tb-gcp-dac
2
36120
<reponame>tranquilitybase-io/tb-gcp-dac import time import traceback from python_terraform import Terraform from src.main.python.tranquilitybase.gcpdac.configuration.helpers.eaglehelper import EagleConfigHelper from src.main.python.tranquilitybase.gcpdac.configuration.helpers.envhelper import EnvHelper from src.main.p...
1.90625
2
jsonfile.py
jason0x43/jcalfred
6
36121
<gh_stars>1-10 import logging import json import os.path LOG = logging.getLogger(__name__) class JsonFile(object): def __init__(self, path, default_data=None, ignore_errors=False, header=None): '''Construct a new JsonFile. Parameters ---------- default_data : di...
3.046875
3
twitch.py
blueben/twitchalyze
1
36122
<gh_stars>1-10 """ Twitch API Module. This module implements only those parts of the Twitch API needed for the twitchalyze app to function. It is not a general purpose SDK. This module is written against Version 5 of the Twitch API. """ import json import requests # Read in user configuration with open('.twitchalyz...
2.4375
2
code/formatting.py
MaryumSayeed/TheSwan
0
36123
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd import glob,os,csv,re,math import shutil, time from astropy.io import ascii import matplotlib.pyplot as plt # Load all data files: psdir ='/Users/maryumsayeed/Desktop/HuberNess/mlearning/powerspectrum/' hrdir ='/Users/maryu...
2.359375
2
problems/g2_academic/LangfordBin.py
cprudhom/pycsp3
28
36124
<gh_stars>10-100 """ See <NAME>, <NAME>, <NAME>: Watched Literals for Constraint Propagation in Minion. CP 2006: 182-197 Examples of Execution: python3 LangfordBin.py python3 LangfordBin.py -data=10 """ from pycsp3 import * n = data or 8 # v[i] is the ith value of the Langford's sequence v = VarArray(size=2 * n...
2.546875
3
momentumnet-main/momentumnet/exact_rep_pytorch.py
ZhuFanCheng/Thesis
0
36125
<reponame>ZhuFanCheng/Thesis # Authors: <NAME>, <NAME> # License: MIT """ Original code from Maclaurin, Dougal, <NAME>, and <NAME>. "Gradient-based hyperparameter optimization through reversible learning." International conference on machine learning. PMLR, 2015. """ import numpy as np import torch RADIX_SCALE = 2 *...
2.921875
3
lp_mongodb/loaders/loader.py
TechLaProvence/lp_mongodb
0
36126
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/TechLaProvence/lp_mongodb # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 figarocms <EMAIL> from tornado.concurrent import return_future from lp_mongodb.storages.mongo_sto...
1.789063
2
efficientEigensolvers/Adaptive_PageRank_Algo.py
ICERM-Efficient-Eigensolvers-2020/Implimentation
0
36127
import numpy as np from tabulate import tabulate import matplotlib.pyplot as plt import Page_Rank_Utils as pru def detectedConverged(y,x,epsilon): C = set() N = set() for i in range(len(y)): if abs(y[i] - x[i])/abs(x[i]) < epsilon: C.add(i) else: N.add(i) return...
2.484375
2
demo_random_pixels.py
insolor/micropython-troyka-led-matrix
1
36128
from troyka_led_matrix import TroykaLedMatrix from urandom import getrandbits import time matrix = TroykaLedMatrix() while True: matrix.draw_pixel(getrandbits(3), getrandbits(3)) matrix.clear_pixel(getrandbits(3), getrandbits(3)) time.sleep_ms(50)
2.6875
3
enip_backend/export/bulk.py
vote/enip-backend
2
36129
<gh_stars>1-10 import json import logging from datetime import datetime, timezone from ..enip_common.pg import get_ro_cursor from .run import export_all_states, export_national # Bulk-exports a range of ingests for testing purposes. Prints out a JSON # blob describing the exports. START_TIME = datetime(2020, 10, 15, ...
2.390625
2
src/genie/libs/parser/junos/show_chassis.py
noziwatele/genieparser
0
36130
<gh_stars>0 ''' show_chassis.py Parser for the following show commands: * show chassis fpc detail * show chassis environment routing-engine * show chassis firmware * show chassis firmware no-forwarding ''' # python import re from genie.metaparser import MetaParser from genie.metaparser.util.schemaeng...
2.453125
2
mp_sort/virtenv/lib/python3.6/site-packages/transcrypt/demos/pysteroids_demo/org/theodox/__init__.py
ang-jason/fip_powerx_mini_projects-foxtrot
2,200
36131
import math import itertools class Vector: """ Generic vector operations. """ def _apply(self,op, other): pairwise = None if type(other) is Vector: pairwise = zip(self.vals, other.vals) else: pairwise = zip(self.vals, [other for _ ...
3.4375
3
gae/settings.py
fredsa/instant-tty
1
36132
<reponame>fredsa/instant-tty """Module containing global playground constants and functions.""" import os from google.appengine.api import app_identity from google.appengine.api import backends DEBUG = True COMPUTE_IDLE_INSTANCES_TARGET = 0 COMPUTE_INSTANCE_TTL_MINUTES = 10 COMPUTE_PROJECT_ID = app_identity.get_...
2.109375
2
experiments/ucf101.py
srph25/videoonenet
0
36133
import numpy as np import os os.environ['TF_FORCE_GPU_ALLOW_GROWTH']='true' import datetime from sacred import Experiment from sacred.observers import FileStorageObserver from datasets.ucf101 import UCF101Dataset from algorithms.kerasvideoonenet import KerasVideoOneNet from algorithms.kerasvideoonenet_admm import Keras...
1.6875
2
master/fresh-samples-master/fresh-samples-master/python_samples/create_contact.py
AlexRogalskiy/DevArtifacts
4
36134
## This script requires "requests": http://docs.python-requests.org/ ## To install: pip install requests import requests import json FRESHDESK_ENDPOINT = "http://YOUR_DOMAIN.freshdesk.com" # check if you have configured https, modify accordingly FRESHDESK_KEY = "YOUR_API_TOKEN" user_info = {"user":{"name":"<NAME>", ...
2.734375
3
ordenes/migrations/0003_auto_20200307_0359.py
Omar-Gonzalez/echangarro-demo
0
36135
<reponame>Omar-Gonzalez/echangarro-demo # Generated by Django 2.2.2 on 2020-03-07 03:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ordenes', '0002_auto_20200305_0056'), ] operations = [ migrations.AddField( model_name='...
1.703125
2
fantasyfootball/tiersweekly.py
Robert-F-Mulligan/fantasy-football
1
36136
#tiersweekly.py from fantasyfootball import tiers from fantasyfootball import fantasypros as fp from fantasyfootball import config from fantasyfootball import ffcalculator from fantasyfootball.config import FIGURE_DIR from sklearn.cluster import KMeans from sklearn.mixture import GaussianMixture from matplotlib import...
1.585938
2
makememe/generator/prompts/types/ineffective_solution.py
OthersideAI/makememe_ai
0
36137
<gh_stars>0 from makememe.generator.prompts.prompt import Prompt import datetime from PIL import Image from makememe.generator.design.image_manager import Image_Manager class Ineffective_Solution(Prompt): name = "Ineffective_Solution" description = "the solution was a poor way of doing it" def __init__(s...
3.015625
3
dodo_commands/extra/dodo_standard_commands/decorators/pause.py
mnieber/dodo-commands
8
36138
"""Pauses the execution.""" import time from dodo_commands.framework.decorator_utils import uses_decorator class Decorator: def is_used(self, config, command_name, decorator_name): return uses_decorator(config, command_name, decorator_name) def add_arguments(self, parser): # override parser...
2.8125
3
1313decompressRunLength.py
vkaushik189/ltcode_solutions
0
36139
<gh_stars>0 class Solution: def decompressRLElist(self, nums: List[int]) -> List[int]: de = [] for i in range(0, len(nums), 2): pair = [] pair.append(nums[i]) pair.append(nums[i + 1]) arr = [nums[i + 1]] * nums[i] de += arr return d...
2.953125
3
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/lib/schemas/user.py
thecoderstudio/cookiecutter-pyramid-api
0
36140
from marshmallow import (fields, post_load, Schema, validate, validates, validates_schema, ValidationError) from {{cookiecutter.project_slug}}.lib.hash import compare_plaintext_to_hash, hash_plaintext from {{cookiecutter.project_slug}}.models.user import User, get_user_by_email_address MIN_PA...
2.453125
2
selfbot/types/sub_command.py
TibebeJS/tg-selfbot
1
36141
<gh_stars>1-10 class SubCommand: def __init__(self, command, description="", arguments=[], mutually_exclusive_arguments=[]): self._command = command self._description = description self._arguments = arguments self._mutually_exclusive_arguments = mutually_exclusive_arguments def g...
2.78125
3
src/anaplan_api/Model.py
jeswils-ap/anaplan_transactional_api
0
36142
import logging from typing import List from .AnaplanRequest import AnaplanRequest from .User import User from .ModelDetails import ModelDetails logger = logging.getLogger(__name__) class Model(User): def get_models_url(self) -> AnaplanRequest: """Get list of all Anaplan model for the specified user. :return: O...
2.703125
3
tests/unit/lms/extensions/feature_flags/views/_predicates_test.py
mattdricker/lms
38
36143
<reponame>mattdricker/lms<filename>tests/unit/lms/extensions/feature_flags/views/_predicates_test.py from unittest import mock from lms.extensions.feature_flags.views._predicates import FeatureFlagViewPredicate class TestFeatureFlagsViewPredicate: def test_text(self): assert ( FeatureFlagView...
2.5
2
2015/python/01.py
gcp825/advent_of_code
1
36144
<gh_stars>1-10 def read_file(filepath): with open(filepath,'r') as i: inst = [int(x) for x in i.read().replace(')','-1,').replace('(','1,').strip('\n').strip(',').split(',')] return inst def calculate(inst,floor=0): for i,f in enumerate(inst): floor += f if floor < 0: brea...
3.265625
3
Unit3_StructuredTypes/ps3_hangman.py
myzzdeedee/MITx_6001x
0
36145
# Hangman game # # ----------------------------------- # Helper code # You don't need to understand this helper code, # but you will have to know how to use the functions # (so be sure to read the docstrings!) import random import string WORDLIST_FILENAME = "/Users/deedeebanh/Documents/MITx_6.00.1.x/ProblemSet3/word...
4.125
4
tesa/database_creation/annotation_task.py
clementjumel/master_thesis
2
36146
<reponame>clementjumel/master_thesis<filename>tesa/database_creation/annotation_task.py from database_creation.nyt_article import Article from database_creation.utils import Tuple, Wikipedia, Query, Annotation from numpy import split as np_split from numpy.random import seed, choice from time import time from glob imp...
2.859375
3
main.py
jeffkub/forecast-display
2
36147
#!/usr/bin/python3 import argparse from datetime import datetime import json from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5 import uic import os import sys from weather import Weather BASE_PATH = os.path.dirname(os.path.abspath(__file__)) DISP_SIZE = (640, 384) WHITE = 0xffffffff BLACK = 0xff000...
2.6875
3
commit_grtrans.py
HerculesJack/grtrans
25
36148
<filename>commit_grtrans.py import os from run_grtrans_test_problems import run_test_problems from unit_tests import run_unit_tests passed, max_passed, failed = run_test_problems(save=0) nfailed, ufailed = run_unit_tests() if passed < max_passed or nfailed > 0: print 'ERROR -- grtrans tests failed!' else: # os.chd...
2.375
2
luftdaten/exceptions.py
lrubaszewski/python-luftdaten
5
36149
"""Exceptions for the Luftdaten Wrapper.""" class LuftdatenError(Exception): """General LuftdatenError exception occurred.""" pass class LuftdatenConnectionError(LuftdatenError): """When a connection error is encountered.""" pass class LuftdatenNoDataAvailable(LuftdatenError): """When no dat...
2.125
2
training/191210/123.py
SOOIN-KIM/lab-python
0
36150
from sklearn.metrics import r2_score y_true = [3, -0.5, 2, 7] y_pred = [2.5, 0.0, 2, 8] r2=r2_score(y_true, y_pred) print(r2) y_true = [5,6,7,8] y_pred = [-100,524,-1,3] r2=r2_score(y_true, y_pred) print(r2) r2_
2.546875
3
tests/sedes/test_bitvector_instantiation.py
booleanfunction/py-ssz
22
36151
import pytest from ssz.sedes import Bitvector def test_bitvector_instantiation_bound(): with pytest.raises(ValueError): bit_count = 0 Bitvector(bit_count)
2.09375
2
decrypt.py
angelodpadron/asymmetric-encryption-exercise
0
36152
# Seguridad Informatica # ejercicio de encriptacion # <NAME> (42487) from Crypto.Cipher import AES from Crypto.Random import get_random_bytes with open('key.bin', 'rb') as k: key = k.read() with open('vector.bin', 'rb') as v: init_vector = v.read() cipher = AES.new(key, AES.MODE_CBC, init_ve...
2.890625
3
course/src/service/student_service.py
Cuiqingyao/course-exercise
0
36153
<reponame>Cuiqingyao/course-exercise """ @Time: 2018/5/11 10:57 @Author: qingyaocui """ from course.src.service import admin_service from course.src.models import Student login_stu = None def show_choice(): show = ''' 1.菜单 2.登录 3.注册 4.查看成绩 Q|q.退出系统 ''' print(s...
2.828125
3
src/pickleData.py
pdedumast/CondylesClassification
0
36154
<gh_stars>0 import numpy as np import os from six.moves import cPickle as pickle import neuralnetwork as nn import inputdata # ----------------------------------------------------------------------------- # arser = argparse.ArgumentParser() parser.add_argument('-valid_train', action='store', dest='valid_train', help...
2.078125
2
tests/test_07_left_panel.py
skostya64/Selenium_tasks
0
36155
def test_check_left_panel(app): app.login(username="admin", password="<PASSWORD>") app.main_page.get_menu_items_list() app.main_page.check_all_admin_panel_items()
1.289063
1
pysnmp/ALVARION-SMI.py
agustinhenze/mibs.snmplabs.com
11
36156
<filename>pysnmp/ALVARION-SMI.py # # PySNMP MIB module ALVARION-SMI (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALVARION-SMI # Produced by pysmi-0.3.4 at Mon Apr 29 17:06:07 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python ver...
1.710938
2
setup.py
Sefrwahed/Alfred
5
36157
from setuptools import setup from setuptools import find_packages required_packages = [ 'beautifulsoup4', 'cssselect', 'duckling', 'feedfinder2', 'feedparser', 'idna', 'jieba3k', 'JPype1', 'Logbook', 'lxml', 'newspaper3k', 'nltk', 'Pillow', 'PyQt5', 'python-d...
1.335938
1
openapi_core/schema/schemas/_format.py
gjo/openapi-core
0
36158
from base64 import b64encode, b64decode import binascii from datetime import datetime from uuid import UUID from jsonschema._format import FormatChecker from jsonschema.exceptions import FormatError from six import binary_type, text_type, integer_types DATETIME_HAS_STRICT_RFC3339 = False DATETIME_HAS_ISODATE = False ...
2.421875
2
job-service/tests/test_database.py
anaai/anaai
31
36159
<reponame>anaai/anaai import pytest from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from database import Base, get_session SQLALCHEMY_DATABASE_URL = "sqlite:///./test.db" engine = create_engine( SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False} ) TestingSessionLocal =...
2.03125
2
holobot/extensions/admin/command_rule_manager_interface.py
rexor12/holobot
1
36160
from .models import CommandRule from typing import Optional, Tuple class CommandRuleManagerInterface: async def get_rules_by_server(self, server_id: str, start_offset: int, page_size: int, group: Optional[str] = None, subgroup: Optional[str] = None) -> Tuple[CommandRule, ...]: raise NotImplementedError ...
2.3125
2
authentik/lib/utils/errors.py
BeryJu/passbook
15
36161
<reponame>BeryJu/passbook """error utils""" from traceback import format_tb TRACEBACK_HEADER = "Traceback (most recent call last):\n" def exception_to_string(exc: Exception) -> str: """Convert exception to string stackrace""" # Either use passed original exception or whatever we have return TRACEBACK_HEA...
2.65625
3
atlas/foundations_sdk/src/foundations/helpers/queued.py
DeepLearnI/atlas
296
36162
<gh_stars>100-1000 _QUEUED_JOBS_KEY = 'projects:global:jobs:queued' _ARCHIVED_JOBS_KEY = 'projects:global:jobs:archived' def list_jobs(redis): return {job_id.decode() for job_id in redis.smembers(_QUEUED_JOBS_KEY)} def remove_jobs(redis, job_id_project_mapping): for job_id, project_name in job_id_project_map...
2.328125
2
hypersolver/src/models.py
Juju-botu/diffeqml-research
49
36163
<filename>hypersolver/src/models.py<gh_stars>10-100 # 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 ...
2.171875
2
acictf/Move ZIG/code.py
benhunter/ctf
0
36164
#!/usr/bin/python3 import argparse import socket import base64 import binascii # 'argparse' is a very useful library for building python tools that are easy # to use from the command line. It greatly simplifies the input validation # and "usage" prompts which really help when trying to debug your own code. # parser =...
3.859375
4
even-then-odd.py
Omi0604/DCU-Einstein-
0
36165
<reponame>Omi0604/DCU-Einstein-<gh_stars>0 #!/usr/bin/env python3 a = [] b = [] s = input() while s != "end": n = int(s) if n % 2 == 1: a.append(n) else: print(n) s = input() i = 0 while i < len(a): print(a[i]) i = i + 1
2.84375
3
sensing/slam/laser_slam/script/laser_transfer_old.py
lnexenl/XTDrone
1
36166
<gh_stars>1-10 import rospy from gazebo_msgs.srv import GetModelState from geometry_msgs.msg import PoseStamped, Pose2D from nav_msgs.msg import Odometry from tf2_ros import TransformListener, Buffer import sys vehicle_type = sys.argv[1] vehicle_id = sys.argv[2] laser_slam_type = sys.argv[3] rospy.init_node(vehicle_ty...
2.21875
2
robot-pushing/push_env.py
kvablack/robosuite
0
36167
import itertools import os import shutil import numpy as np import gym from gym import spaces import robosuite from robosuite.controllers import load_controller_config import robosuite.utils.macros as macros import imageio, tqdm from her import HERReplayBuffer from tianshou.data import Batch macros.SIMULATION_TIMES...
2.078125
2
test/weak_agents_tests.py
JakubPetriska/poker-agent-kit
19
36168
import unittest import acpc_python_client as acpc from tools.constants import Action from weak_agents.action_tilted_agent import create_agent_strategy, create_agent_strategy_from_trained_strategy, TiltType from tools.io_util import read_strategy_from_file from evaluation.exploitability import Exploitability from tool...
2.671875
3
insert_default_data.py
daichi-yoshikawa/flask-boilerplate
1
36169
<reponame>daichi-yoshikawa/flask-boilerplate from app import create_app from app.models import db from app.models.role import Role app = create_app() app.app_context().push() DefaultRoles = [ { 'name': 'user', }, { 'name': 'admin', }, ] def insert_default_roles(): try: if Role.query.count() ==...
2.703125
3
15-more-types/mysum.py
SeirousLee/example-code-2e
990
36170
import functools import operator from collections.abc import Iterable from typing import overload, Union, TypeVar T = TypeVar('T') S = TypeVar('S') # <1> @overload def sum(it: Iterable[T]) -> Union[T, int]: ... # <2> @overload def sum(it: Iterable[T], /, start: S) -> Union[T, S]: ... # <3> def sum(it, /, start=0):...
3.046875
3
chess/board.py
quadratic-bit/pygame-chess
3
36171
from __future__ import annotations import math from collections import deque from typing import Optional, Callable import numpy as np import pygame from chess.const import PieceType, PieceColour, Piece, CastlingType, Move, \ PIECE_INDICES, init_zobrist, MoveFlags, GameState from chess.utils import load_image, lo...
2.703125
3
dataset.py
HimanchalChandra/visual-relationship-detection
2
36172
<filename>dataset.py from datasets.vrd import VrdDataset def get_dataset(opt, type, transform): assert opt.dataset in ['vrd', 'visual_genome'] if opt.dataset == 'vrd': dataset = VrdDataset(opt.dataset_path, opt.num_classes, type, transform) # elif opt.dataset == 'activitynet': # training_...
2.328125
2
conanfile.py
danimtb/conan-msys_installer
0
36173
from conans import ConanFile, tools import os class MsysBaseInstallerConan(ConanFile): name = "msys-base_installer" version = "2013072300" license = "http://www.mingw.org/license" url = "http://github.com/danimtb/conan-msys-installer" settings = "os", "compiler" build_policy = "missing" de...
2.078125
2
App/urls.py
python1801aclchemy/AXF
0
36174
<reponame>python1801aclchemy/AXF from flask_restful import Api from App.apis import Hello, Home api = Api() def init_urls(app): api.init_app(app=app) api.add_resource(Hello, "/hello/") api.add_resource(Home, "/home/")
2.53125
3
thermal01/seek_to_csv/ir/simpleVideoCamera.py
De-Risking-Strategies/SensorFusionPublic
0
36175
<filename>thermal01/seek_to_csv/ir/simpleVideoCamera.py import cv2 import numpy as np import numpy as cv #import cv2 as cv from irCamera_SeekMosaic import irCamera_SeekMosaic #from PIL import Image vlcamera = cv2.VideoCapture(0) ircamera = irCamera_SeekMosaic(54339) dsize = (1, 1) #default is no resizing vlret = Fals...
3
3
beerhunter/breweries/models.py
zhukovvlad/beerhunt-project
0
36176
<reponame>zhukovvlad/beerhunt-project import os from uuid import uuid4 from django.db import models from django.urls import reverse from django.utils.timezone import now as timezone_now from autoslug import AutoSlugField from model_utils.models import TimeStampedModel from django_countries.fields import CountryField f...
2.25
2
fluent_contents/tests/testapp/content_plugins.py
vinnyrose/django-fluent-contents
0
36177
<gh_stars>0 from django.utils.safestring import mark_safe from fluent_contents.extensions import ContentPlugin, plugin_pool from fluent_contents.tests.testapp.models import RawHtmlTestItem @plugin_pool.register class RawHtmlTestPlugin(ContentPlugin): """ The most basic "raw HTML" plugin item, for testing. ...
1.828125
2
src/train_DNN/visualize_DNN_few_images.py
StanfordASL/NASA_ULI_Xplane_Simulator
4
36178
<gh_stars>1-10 """ Goal: Visualize images from aircraft camera and load as a pytorch dataloader 0. load images and the corresponding state information in labels.csv 1. test a trained DNN and visualize predictions """ import sys, os import torch import numpy as np import pandas import matplotlib.pyplot as p...
2.875
3
release_type.py
sairam4123/GodotReleaseScriptPython
0
36179
<reponame>sairam4123/GodotReleaseScriptPython<filename>release_type.py<gh_stars>0 from enum import Enum, auto class ReleaseLevel(Enum): alpha = auto() beta = auto() release_candidate = auto() public = auto() @classmethod def has_value(cls, value): return value in cls._value2member_map...
2.578125
3
tests/test_cf_gh_pages_dns_records.py
mondeja/pre-commit-hooks
0
36180
"""Tests for 'cloudflare-gh-pages-dns' hook.""" import contextlib import io import os import pytest from hooks.cf_gh_pages_dns_records import check_cloudflare_gh_pages_dns_records @pytest.mark.skipif( not os.environ.get("CF_API_KEY"), reason=( "Cloudflare user API key defined in 'CF_API_KEY' enviro...
2.265625
2
config.py
rSimulate/Cosmosium
18
36181
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- """config.py: Default configuration.""" # Server: SERVER = 'wsgiref' DOMAIN = 'localhost:7099' HOST = 'localhost' PORT = 7099 # Meta: # Note on making it work in localhost: # * Open a terminal, then do: # - sudo gedit /etc/hosts # * Enter the desired localhost alias for...
2.578125
3
devsupport/check_loggers/check_loggers.py
bradh/jmisb
26
36182
<gh_stars>10-100 import os modules = ['api', 'core'] sourcedirs = [] expectedToHaveNoTest = [ 'api/src/main/java/org/jmisb/api/klv/LdsParser.java', 'api/src/main/java/org/jmisb/api/video/VideoDecodeThread.java', 'api/src/main/java/org/jmisb/api/video/VideoOutput.java', 'api/src/main/java/org/jmisb/api/vid...
2.109375
2
commands/pick.py
DaleNaci/AUC
0
36183
<reponame>DaleNaci/AUC import asyncio import random import discord from discord.ext.commands import Bot from discord.ext import commands from discord import Color, Embed # This command randomly picks between the two non-banned maps. # # !pick [#] [#] # # The two numbers represent the two maps that were not banned fr...
3.078125
3
edx/quiz/unique_values.py
spradeepv/dive-into-python
0
36184
""" Write a Python function that returns a list of keys in aDict that map to integer values that are unique (i.e. values appear exactly once in aDict). The list of keys you return should be sorted in increasing order. (If aDict does not contain any unique values, you should return an empty list.) This function takes i...
3.90625
4
tests/test_svarog.py
dswistowski/svarog
4
36185
<reponame>dswistowski/svarog from dataclasses import dataclass from dataclasses import field from enum import Enum from typing import Any from typing import ClassVar from typing import Literal from typing import Mapping from typing import Optional from typing import Sequence from typing import Union from uuid import UU...
2.578125
3
vaqc/vaqc.py
PennLINC/vaqc
2
36186
<filename>vaqc/vaqc.py<gh_stars>1-10 import base64 import re import os.path as op from io import BytesIO import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import nibabel as nib import numpy as np from pathlib import Path import pandas as pd import nilearn.image as nim from dipy.segment.mask impor...
2.078125
2
apps/workspaces/migrations/0001_initial.py
fylein/fyle-integrations-platform-connector
0
36187
<filename>apps/workspaces/migrations/0001_initial.py # Generated by Django 3.2.8 on 2021-10-11 11:10 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Workspace', ...
1.78125
2
django/test-prefect.py
AllenNeuralDynamics/ephys-framework-tests
0
36188
import os os.environ['PREFECT__LOGGING__LEVEL'] = 'DEBUG' os.environ['DJANGO_ALLOW_ASYNC_UNSAFE'] = 'true' from prefect import flow, task import numpy as np import pandas as pd from django_pandas.io import read_frame import helpers @task def insert_session(session_id): from django_connect import connect con...
1.96875
2
src/db/models/artist_album.py
jsbecerrab/Loka-prueba-backend
0
36189
from sqlalchemy import Column, ForeignKey, Integer, DateTime from sqlalchemy.orm import relationship from ..database import Base class Artist_album(Base): __tablename__ = "artists_albums" id = Column(Integer, primary_key=True, index=True) artist_id = Column(Integer, ForeignKey("artists.id")) album_id...
3.015625
3
join/api/join_controller.py
andrequeiroz2/api-join
0
36190
from flask import request from firebase_admin import auth import requests from join import firebase import ast import time def get_join(): token = request.headers['authorization'] decoded_token = auth.verify_id_token(token) email = decoded_token['firebase']['identities']['email'][0] tags...
2.421875
2
examples/simple_resource.py
pdyba/lambdalizator
3
36191
#!/usr/bin/env python3.8 # coding=utf-8 """ Simple Lambda Handler """ from lbz.dev.server import MyDevServer from lbz.dev.test import Client from lbz.exceptions import LambdaFWException from lbz.resource import Resource from lbz.response import Response from lbz.router import add_route class HelloWorld(Resource): ...
2.25
2
src/python/packages/loudspeakerconfig/createArrayConfigFromSofa.py
s3a-spatialaudio/VISR
17
36192
# -*- coding: utf-8 -*- """ Created on Thu May 3 08:04:22 2018 @author: af5u13 """ import numpy as np import os from .geometry_functions import deg2rad, sph2cart from loudspeakerconfig import createArrayConfigFile def createArrayConfigFromSofa( sofaFile, xmlFile = None, lspLabels = None, twoDSetup = False, virtua...
2.46875
2
blog_app/migrations/0019_auto_20200901_0727.py
Rxavio/django-blog
0
36193
<filename>blog_app/migrations/0019_auto_20200901_0727.py # Generated by Django 3.0.3 on 2020-09-01 05:27 from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('...
1.601563
2
utils.py
avb76/barbershop
0
36194
<reponame>avb76/barbershop<gh_stars>0 from datetime import datetime, date, timedelta def hour_generator(start, end, step=10): while start < end: yield start start = start + timedelta(minutes=step) def create_hour(hour, date=None): if not date: return datetime.strptime(hour, '%H:%M') ...
2.90625
3
display/display/handlers/mailbox/read.py
owlsn/h_crawl
0
36195
from display.handlers.base import BaseHandler class MailboxReadHandler(BaseHandler): def get(self): title = 'MailboxReadHandler' self.render('mailbox/read-mail.html', title = title, **self.render_dict)
2.34375
2
print_service.py
laashub-sua/demo-print
0
36196
<gh_stars>0 import convert_pdf_2_jpg import printer def do_print(file_path): if file_path.endswith('.pdf'): file_path = convert_pdf_2_jpg.do_convert(file_path) printer.do_print(file_path)
3.078125
3
plok/tests/test_blog_views.py
jarnoln/plokkeri
0
36197
# from unittest import skip from django.conf import settings from django.contrib import auth from django.urls import reverse from django.test import TestCase from plok.models import Blog, Article from .ext_test_case import ExtTestCase class BlogList(TestCase): url_name = 'plok:blog_list' def test_reverse_blo...
2.546875
3
pipeline/reach-es-extractor/refparse/utils/__init__.py
wellcometrust/reach
11
36198
<filename>pipeline/reach-es-extractor/refparse/utils/__init__.py from .parse import structure_reference from .fuzzy_match import FuzzyMatcher from .file_manager import FileManager from .serialiser import serialise_matched_reference, serialise_reference from .exact_match import ExactMatcher __all__ = [ structure_re...
1.351563
1
web_site/wx/backends/dj.py
Fixdq/dj-deep
0
36199
# -*- coding: utf-8 -*- """ Created on 2014-5-14 django 帮助函数 @author: skycrab @sns_userinfo def oauth(request): openid = request.openid """ import json import logging import base64 from functools import wraps from django.conf import settings from django.core.cache import cache from django.short...
2.015625
2