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
UI/MenuBar/SetupMenu.py
Luk-kar/Show_Similar_Images
0
41400
import os import sys import tkinter as tk from configparser import ConfigParser from tkinter import filedialog # for Python 3 from tkinter import messagebox from config.Dialogs import Dialogs from UI.helpers.open_folder import open_folder # https://stackoverflow.com/questions/31170616/how-to-access-a-method-in-one-...
2.765625
3
helper.py
prachir1501/NeuralDater
64
41401
<reponame>prachir1501/NeuralDater<filename>helper.py<gh_stars>10-100 import numpy as np, sys, unicodedata, requests, os, random, pdb, requests, json, gensim import matplotlib.pyplot as plt, uuid, time, argparse, pickle, operator import logging, logging.config, itertools, pathlib import scipy.sparse as sp from collecti...
2.515625
3
pywick/models/segmentation/testnets/drnet/__init__.py
achaiah/pywick
408
41402
from .drnet import DRNet
1.039063
1
Solutions/problem11.py
WalrusCow/euler
0
41403
<filename>Solutions/problem11.py # Project Euler Problem 11 # Created on: 2012-06-14 # Created by: <NAME> # Return the minimum number that can be present in # a solution set of four numbers def getMin(cap, min): k = 99 * 99 * 99 for i in range(min, 99): if i * k > cap: return i ...
3.125
3
Python/pyworkout/files/ex18.py
honchardev/Fun
0
41404
<filename>Python/pyworkout/files/ex18.py<gh_stars>0 def get_final_line( filepath: str ) -> str: with open(filepath) as fs_r: for line in fs_r: pass return line def get_final_line__readlines( filepath: str ) -> str: with open(filepath) as fs_r: return fs_r.readlines(...
3.484375
3
frontend-python/test/test_uart.py
kazooiebombchu/spc-player
31
41405
<filename>frontend-python/test/test_uart.py<gh_stars>10-100 import time from test.serial_test_case import SerialTestCase from uart import Uart from exceptions import SpcExpection class UartTestCase(SerialTestCase): def setUp(self): super().setUp() Uart.reset(self.serial) def test_reset(self...
2.984375
3
gunnery/account/backend.py
dholdaway/gunnery
0
41406
<gh_stars>0 from django.contrib.auth.models import check_password from django.contrib.auth import get_user_model _user = get_user_model() class EmailAuthBackend(object): """ Email Authentication Backend Allows a user to sign in using an email/password pair rather than a username/password pair. ...
2.640625
3
tsim/serialization/network.py
eduardomezencio/tsim
2
41407
"""Network serialization configuration.""" from __future__ import annotations from functools import partialmethod from itertools import chain from tsim.core.entity import EntityRef from tsim.core.network.intersection import ConflictPoint, Curve, Intersection from tsim.core.network.lane import Lane, LaneSegment from ...
2.171875
2
egs/icfhr2014kws/src/plot_xml_submission.py
lquirosd/PyLaia
3
41408
<filename>egs/icfhr2014kws/src/plot_xml_submission.py #!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import math import os.path import random import xml.sax from PIL import Image, ImageDraw def get_text(): try:...
2.609375
3
tests/_test_paramiko.py
weka-io/plumbum
1
41409
<reponame>weka-io/plumbum from plumbum.paramiko_machine import ParamikoMachine as PM from plumbum import local local.env.path.append("c:\\progra~1\\git\\bin") from plumbum.cmd import ls, grep m=PM("192.168.1.143") mls=m["ls"] mgrep=m["grep"] #(mls | mgrep["b"])() (mls | grep["\\."])() (ls | mgrep["\\."])()
1.507813
2
spiders/zhihu_spider.py
sunhailin-Leo/TeamLeoX_BlogsCrawler
0
41410
import time from typing import Dict, List, Optional from urllib.parse import urlencode from requests.utils import dict_from_cookiejar from requests_toolbelt import MultipartEncoder from utils.encrypt_utils import md5_str from utils.logger_utils import LogManager from utils.str_utils import check_is_json from captcha....
2.09375
2
tilapia/lib/basic/bip32.py
huazhouwang/python_multichain_wallet
2
41411
from typing import List, Optional BIP32_PRIME = 0x80000000 UINT32_MAX = (1 << 32) - 1 def decode_bip44_path(path: str) -> List[int]: def _parse_node(node: str) -> Optional[int]: if not node or node == "m" or node == "M": return None is_hardened = node.endswith("'") or node.endswith("h...
2.984375
3
pitronically/blog/migrations/0002_auto_20190719_1436.py
the16thpythonist/pitronically
0
41412
<reponame>the16thpythonist/pitronically # Generated by Django 2.1.8 on 2019-07-19 14:36 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import filer.fields.image import taggit.managers class Migration(migrations.Migration): initial = True dependenc...
1.773438
2
rest_slack/app_settings.py
jordaneremieff/django-rest-slack
1
41413
<reponame>jordaneremieff/django-rest-slack<gh_stars>1-10 import os from django.conf import settings SLACK_CLIENT_ID = getattr(settings, 'SLACK_CLIENT_ID', os.environ.get('SLACK_CLIENT_ID')) SLACK_CLIENT_SECRET = getattr(settings, 'SLACK_CLIENT_SECRET', os.environ.get('SLACK_CLIENT_SECRET')) SLACK_VERIFICATION_T...
1.796875
2
komax_app/migrations/0002_komax_group_of_square.py
UsernameForGerman/PrettlNKKomax
0
41414
# Generated by Django 2.2.7 on 2020-02-14 10:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('komax_app', '0001_initial'), ] operations = [ migrations.AddField( model_name='komax', name='group_of_square', ...
1.679688
2
src/logos.py
NitikaGupta16/logohunter
128
41415
<filename>src/logos.py import cv2 import numpy as np import os from PIL import Image from timeit import default_timer as timer import utils from utils import contents_of_bbox, features_from_image from similarity import load_brands_compute_cutoffs, similar_matches, similarity_cutoff, draw_matches def detect_logo(yolo...
3
3
doc/ext/local.py
bneradt/libswoc
4
41416
<reponame>bneradt/libswoc from docutils import nodes from docutils.parsers import rst from sphinx.domains import Domain import os.path # This is a place to hang git file references. class SWOCDomain(Domain): """ Solid Wall Of Code. """ name = 'swoc' label = 'SWOC' data_version = 1 def make_gi...
2.234375
2
testreport/views.py
mikiec84/badger-api
0
41417
from django.views.generic import TemplateView import logging log = logging.getLogger(__name__) class Base(TemplateView): template_name = 'base.html'
1.65625
2
BS01-flask-bootstrap-table-demo/app/models.py
AngelLiang/Flask-Demos
3
41418
<gh_stars>1-10 from sqlalchemy_mptt.mixins import BaseNestedSets from .extensions import db class Tree(db.Model, BaseNestedSets): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(64)) # parent_id = db.Column(db.Integer, db.ForeignKey('tree.id')) # parent = db.relationship('Tree...
2.546875
3
python/source/weather.py
oltv00/knowledge
0
41419
import pyowm token = '88983f82566dea8294a9d3e3fb479918' language = 'ru' owm = pyowm.OWM(API_key = token, language = language) def city_temp(): city = input('Введите название города: ') try: observation = owm.weather_at_place(city) except pyowm.exceptions.api_response_error.NotFoundError: p...
3.046875
3
main.py
jxk20/nlb-python
0
41420
DESCRIPTION = """ This script will look at all the csvs in 'inputs' Gets all 'to-read' books Outputs their availability into 'outputs' """ import argparse import os import logging logger = logging.Logger("Main Logger") from pathlib import Path from dotenv import load_dotenv from nlbsg import Client from nlbsg.catalo...
2.796875
3
pythonProject/ex012.py
aknowxd/python_cursoemvideo_1
0
41421
price = float(input("Digite o preco do produto: ")) discount = (5/100) * price total = price - discount print("O valor com desconto eh: {:.2f}".format(total))
3.703125
4
accounts/migrations/0004_auto_20210202_0653.py
MattatPath/Path-backend
0
41422
# Generated by Django 2.2.12 on 2021-02-02 06:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0003_auto_20210202_0503'), ] operations = [ migrations.AddField( model_name='account', name='email', ...
1.757813
2
misvm/misssvm.py
lvkd84/misvm
0
41423
""" Implements MissSVM """ from __future__ import print_function, division import numpy as np import scipy.sparse as sp from random import uniform import inspect from misvm.quadprog import IterativeQP, Objective from misvm.util import BagSplitter, spdiag, slices from misvm.kernel import by_name as kernel_by_name from m...
2.375
2
vehicle_counter.py
tzechiop/Traffic-Counter-Image-Analysis
0
41424
# -*- coding: utf-8 -*- """ Created on Mon Oct 3 21:28:05 2016 @author: thasegawa """ import logging # ============================================================================ class VehicleCounter(object): def __init__(self, shape, divider): self.log = logging.getLogger("vehicle_counter") ...
2.78125
3
examples/muffin/app.py
javdrher/umongo
0
41425
import json import datetime import muffin from bson import ObjectId from aiohttp.web import json_response from motor.motor_asyncio import AsyncIOMotorClient from functools import partial from umongo import Instance, Document, fields, ValidationError, set_gettext from umongo.marshmallow_bonus import SchemaFromUmongo i...
2.1875
2
bluebed/dhs_example.py
eivindgl/bluebed
0
41426
from bluebed import download from bluebed import storage import xmlrpc.client def connect(): url = "http://deepblue.mpi-inf.mpg.de/xmlrpc" user_key = "anonymous_key" server = xmlrpc.client.Server(url, allow_none=True, encoding='UTF-8') return user_key, server def get_t_cell_dhs(server, user_key): ...
2.328125
2
modules/utils/model.py
GurovRoman/pythonNGramModel
0
41427
<gh_stars>0 import pickle from collections import defaultdict, Counter from numpy.random import choice class Model: def __init__(self, **kwargs): """ Model(n=2, min_n=1) Implements the n-gram model. Supports variable length occurrences Parameters -...
3.296875
3
app/views/book_views.py
lfernandez55/flask_full_directory
0
41428
# Copyright 2014 SolidBuilds.com. All rights reserved # # Authors: <NAME> <<EMAIL>> from flask import Blueprint, redirect, render_template from flask import request, url_for from flask_user import current_user, login_required, roles_required from app import db from app.models.user_models import UserProfileForm boo...
2.46875
2
flux/trapezoidal.py
AaronDJohnson/fbtpoint
1
41429
import numpy as np def trapezoidal_rule(f, a, b, tol=1e-8): """ The trapezoidal rule is known to be very accurate for oscillatory integrals integrated over their period. See papers on spectral integration (it's just the composite trapezoidal rule....) TODO (aaron): f is memoized to get the alrea...
3.015625
3
custom-actions/actions/sql_query.py
AnthonyGigerich/conciergerie-test
0
41430
<filename>custom-actions/actions/sql_query.py import sqlite3 from datetime import datetime database = "../rasa.db" # Parameter: Database pointer, sql command, and the data used for the command # Function: Run the sql command def run_sql_command(cursor, sql_command, data): try: if data is not None: ...
2.828125
3
example_problems/tutorial/triangle/bots/feasible_path_bot.py
romeorizzi/TAlight
3
41431
<reponame>romeorizzi/TAlight<gh_stars>1-10 #!/usr/bin/python from sys import stderr, exit, argv import random usage=f"""I am an efficient (linear time) bot that provides a feasible path for every instance (in an infinite loop).""" while True: directions = ["L","R"] instance = input() n = len(instance) ...
3
3
shop/orders/repository.py
n400/faunadb-shop
2
41432
from faunadb import query as q from shop.fauna.client import FaunaClient def get_orders(secret, after=None, before=None, size=5): client = FaunaClient(secret=secret) return client.query( q.map_( lambda ref: q.get(ref), q.paginate(q.documents(q.collection('orders')), size=size, ...
2.203125
2
spacy_loggers/util.py
snosrap/spacy-loggers
2
41433
<filename>spacy_loggers/util.py """ Configuration utilities copied from spacy.util. """ from typing import Dict, Any, Iterator, Tuple, List def walk_dict( node: Dict[str, Any], parent: List[str] = [] ) -> Iterator[Tuple[List[str], Any]]: """Walk a dict and yield the path and values of the leaves.""" for k...
2.625
3
fun_IntegralScale.py
Tmizu0719/FFB_HISTORY
0
41434
""" January 13th 2020 Author T.Mizumoto """ #! python 3 # ver.x1.00 # Integral-Scale_function.py - this program calculate integral-scale and correlation. import numpy as np from scipy.integrate import simps from scipy.stats import pearsonr import pandas as pd # index_basepoint = 0 (defult) def fun_Cros...
3.46875
3
Alfred.alfredpreferences/workflows/user.workflow.73C16A76-E7DC-4A21-AE3B-32FD533AB1FF/src/action.py
Puritanic/Dotfiles
34
41435
#!/usr/bin/python # encoding: utf-8 import sys from subprocess import call from workflow import Workflow, notify from args import * def main(wf): args = wf.args actions = { START_ARG: start_action, STOP_ARG: stop_action, BREAK_ARG: break_action } action = args[0] actions[...
2.46875
2
opsrest/custom/basecontroller.py
chinhtle/ops-restd
0
41436
# Copyright (C) 2015-2016 Hewlett Packard Enterprise Development LP # # 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 ...
1.773438
2
daluke/api/fetch_model.py
peleiden/daluke
10
41437
<gh_stars>1-10 from __future__ import annotations import enum import os import pathlib from typing import Optional import wget import torch import numpy as np from transformers import AutoConfig from daluke.serialize import load_from_archive from daluke.model import DaLUKE, get_ent_embed_size from daluke.ner.model im...
2.15625
2
main.py
cpwasthere/Module09
0
41438
<filename>main.py # ------------------------------------------------------------------------ # Title: Assignment 09 # Description: Working with Modules # ChangeLog (Who,When,What): # ChrisPerry,12/2/19, Created started script # ChrisPerry,12/6/19, Edits # ChrisPerry,12/7/19, Final Edits to complete Assignment 9 # ----...
2.8125
3
RecoLocalCalo/Configuration/python/ecalLocalRecoSequenceCosmics_cff.py
Purva-Chaudhari/cmssw
852
41439
<reponame>Purva-Chaudhari/cmssw import FWCore.ParameterSet.Config as cms # Calo geometry service model # # removed by tommaso # #ECAL conditions # include "CalibCalorimetry/EcalTrivialCondModules/data/EcalTrivialCondRetriever.cfi" # #TPG condition needed by ecalRecHit producer if TT recovery is ON from RecoLocalCalo....
1.289063
1
recurrent_neural_networks/hopfield_network.py
sgalella/RecurrentNeuralNetworks
0
41440
import numpy as np import matplotlib.pyplot as plt from utils import get_state_vowel class HopfieldNetwork: """ Creates a Hopfield Network. """ def __init__(self, patterns): """ Initializes the network. Args: patterns (np.array): Group of states to be memorized by ...
3.25
3
src/calcExpectedDiff.py
marioevz/eth_tools
4
41441
<filename>src/calcExpectedDiff.py #!/usr/bin/env python import sys import json import os def print_usage(): print('{} <Parent difficulty> <Parent Uncle Count> <Parent Timestamp> <Timestamp> <Block> <Fork>'.format(sys.argv[0])) if len(sys.argv) == 2 and sys.argv[1] == '-h': print_usage() sys.exit() elif le...
2.5625
3
calculadora/calculos.py
VitorSorriso/calculadora-python
1
41442
def soma(n1, n2): return n1 + n2 def subtracao(n1,n2): return n1 - n2 def multiplicacao(n1, n2): return n1 * n2 def divisao(n1, n2): return n1 / n2
3.296875
3
graph_rl/envs/flatten_wrapper.py
nicoguertler/graphrl
1
41443
<filename>graph_rl/envs/flatten_wrapper.py from gym import Wrapper from ..spaces import space_from_gym_space class FlattenWrapper(Wrapper): """Flattens observation and action space.""" def __init__(self, env): super().__init__(env) self._action_space = space_from_gym_space(env.action_space) ...
2.640625
3
_playground/in_progress/sand.py
the-deep/DEEPL
6
41444
import nltk txt = nltk.data.load('/Users/ewanog/Dropbox/Work/ACAPS/nlp/text.txt') print(txt)
2.109375
2
photoapp/tests.py
johnmwangi/Gallery_jpG
0
41445
from django.test import TestCase from .models import * # Create your tests here. class ImageTest(TestCase): # # def class instance setup for the project # def setUp(self): # self.nairobi = Location(name='nairobi') # self.nairobi.save() # # self.nature = Category(name='nature') ...
2.796875
3
onnxruntime/test/python/quantization/test_op_relu.py
jamill/onnxruntime
669
41446
#!/usr/bin/env python # coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -----------------------------------------------...
2.21875
2
main.py
devanshuDesai/SenseHAR
0
41447
from model import * from dataloader import * from utils import * from torch.utils.tensorboard import SummaryWriter import torch.optim as optim import time import gc from tqdm import tqdm import matplotlib.pyplot as plt import torch.nn as nn import numpy as np import warnings as wn wn.filterwarnings('ignore') #load eit...
2.078125
2
src/kgmk/io/writing/__init__.py
kagemeka/python
0
41448
from .df_writer import ( DFWriter, )
1.09375
1
src/apps/domains/location/urls.py
antiline/jun2
0
41449
<filename>src/apps/domains/location/urls.py<gh_stars>0 from django.urls import path from apps.domains.location.views import GpxShareFileView, GpxShareView, LocationIndexView, GpxView, GpxFileView app_name = 'apps.domains.location' urlpatterns = [ path('', LocationIndexView.as_view(), name='index'), path('gpx...
1.90625
2
swap_user/__init__.py
artinnok/django-swap-user
0
41450
""" ________ ___ __ ________ ________ ___ ___ ________ _______ ________ |\ ____\|\ \ |\ \|\ __ \|\ __ \ |\ \|\ \|\ ____\|\ ___ \ |\ __ \ \ \ \___|\ \ \ \ \ \ \ \|\ \ \ \|\ \ \ \ \\\ \ \ \___|\ \ __/|\ \ \|\ \ \ \_____ \ \ \ __\ \ \ \ __ \ \ ...
2.03125
2
tools/visualize-sawtooth-label.py
dev0x13/globus-plasma
0
41451
<filename>tools/visualize-sawtooth-label.py<gh_stars>0 #!/usr/bin/python3.6 import numpy as np import csv import argparse import matplotlib.pyplot as plt import sys import os #################################### # Sawtooth crash labels visualizer # #################################### if __name__ == "__main__": ...
2.234375
2
tests/config/test_structure.py
gcollard/lightbus
178
41452
<filename>tests/config/test_structure.py import pytest from lightbus.config.structure import make_transport_selector_structure, ApiConfig, RootConfig pytestmark = pytest.mark.unit def test_make_transport_config_structure(): EventTransportSelector = make_transport_selector_structure("event") assert "redis" i...
2.46875
2
main.py
DataBiosphere/bond
2
41453
import logging import logging.config import os import flask import google.cloud.logging import yaml from flask_cors import CORS from google.auth.credentials import AnonymousCredentials from google.cloud import ndb from bond_app import routes from bond_app.json_exception_handler import JsonExceptionHandler from bond_a...
2.078125
2
mathics/builtin/files_io/__init__.py
skirpichev/Mathics
1,920
41454
<filename>mathics/builtin/files_io/__init__.py """ Input/Output, Files, and Filesystem """ from mathics.version import __version__ # noqa used in loading to check consistency.
0.890625
1
bokeh-app/main.py
cvalencia09/bokeh
0
41455
<filename>bokeh-app/main.py import pandas as pd import numpy as np from bokeh.io import curdoc from bokeh.layouts import layout from bokeh.models import (Button, CategoricalColorMapper, ColumnDataSource, HoverTool, Label, SingleIntervalTicker, Slider) from bokeh.palettes import Spectral6 from ...
2.6875
3
tests/unit/conftest.py
stefanhoelzl/synopse
1
41456
import pytest from synopse.core.component import Component @pytest.fixture def create_component_class(): def wrapper(**attributes): return type("ComponentToTest", (Component,), attributes) return wrapper
1.992188
2
Desafios/des059.py
joseangelooliveira-br/Python3
0
41457
<reponame>joseangelooliveira-br/Python3 from time import sleep n1 = int(input('Primeiro valor:')) n2 = int(input('Segundo valor:')) opcao = 0 while opcao != 5: print(''' [1] somar [2] Multiplicar [3] Maior [4] Novos números [5] Sair do programa.''') opcao = int(input('Qual é a sua opção? '))...
3.90625
4
maskrcnn_benchmark/layers/nv_decode.py
DeLightCMU/MAL
13
41458
<filename>maskrcnn_benchmark/layers/nv_decode.py from maskrcnn_benchmark import _C nv_decode = _C.nv_decode
1.070313
1
SimGeneral/MixingModule/python/pileupVtxDigitizer_cfi.py
ckamtsikis/cmssw
852
41459
import FWCore.ParameterSet.Config as cms pileupVtxDigitizer = cms.PSet( accumulatorType = cms.string("PileupVertexAccumulator"), hitsProducer = cms.string('generator'), vtxTag = cms.InputTag("generatorSmeared"), vtxFallbackTag = cms.InputTag("generator"), makeDigiSimLinks = cms.untracked.bool(False...
1.75
2
tests/util/answers.py
selectel/python-selvpcclient
7
41460
<filename>tests/util/answers.py from tests.util.params import LOGO_BASE64 PROJECTS_LIST = { 'projects': [{ "id": "15c578ea47a5466db2aeb57dc8443676", "name": "pr1", "url": "http://11111.selvpc.ru", "enabled": True, "theme": { "color": "", "logo": "", ...
2.015625
2
basisnet/personalization/centralized_so_nwp/stackoverflow_basis_models.py
xxdreck/google-research
23,901
41461
<reponame>xxdreck/google-research<filename>basisnet/personalization/centralized_so_nwp/stackoverflow_basis_models.py<gh_stars>1000+ # coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the L...
2.1875
2
self_supervised_learning.py
monaj07/pytorch_semseg
0
41462
<reponame>monaj07/pytorch_semseg """ This is the code for Self-Supervised Learning. The goal is to learn image feature maps using video data. The idea is to assign the frames within each video a unique class label, and perform a classification. """ import sys import torch import visdom import argparse import numpy as ...
2.65625
3
Prim&Kruskal.py
FusionPower/Prim-Kruskal-Visualizer
0
41463
# -*- coding: utf-8 -*- import pygame import heapq as pq import random def explore(u,vis,adj,q): for v,w in adj[u]: if not vis[v]: pq.heappush(q,[w,u,v]) def prim(adj,return_edj=0): tree=[[] for i in range(len(adj))] tree_edj=[] if not adj: return -1 ...
3.15625
3
src/couplib/constants.py
DKosenkov/PyFREC
0
41464
<reponame>DKosenkov/PyFREC<gh_stars>0 import math #------------------------------------------------------------------------------- # Conversion factors ATOB = 1.889725989 #Angstrom to Bohr Conversion BTOA = 1.0/ATOB HartreeToKCal = 627.509 HartreeToCM1 = 219474.629232 HartreeToeV = 27.211215 eVToHa...
1.945313
2
datasets.py
artemisart/transformer-lm
0
41465
import os import csv import numpy as np from pathlib import Path from tqdm import tqdm from sklearn.utils import shuffle from sklearn.model_selection import train_test_split seed = 3535999445 def imdb(path=Path("data/aclImdb/")): import pickle try: return pickle.load((path / "train-test.p").open("r...
2.6875
3
miyu_bot/commands/cogs/utility.py
sigonasr2/miyu-bot
0
41466
import logging import textwrap from discord.ext import commands from miyu_bot.bot.bot import D4DJBot from miyu_bot.commands.common.fuzzy_matching import romanize, FuzzyMatcher class Utility(commands.Cog): bot: D4DJBot def __init__(self, bot): self.bot = bot self.logger = logging.getLogger(_...
2.078125
2
lib/solutions/CHK/checkout_solution.py
DPNT-Sourcecode/CHK-zdtm01
0
41467
<filename>lib/solutions/CHK/checkout_solution.py # noinspection PyUnusedLocal # skus = unicode string price_table = { 'A': {'Price': 50, 'Offers': ['3A', 130]}, 'B': {'Price': 30, 'Offers': ['2b', 45]}, 'C': {'Price': 20, 'Offers': []}, 'D': {'Price': 15, 'Offers': []}...
3.03125
3
opensearch/models/behavior_fields.py
Timandes/opensearch-python
0
41468
<reponame>Timandes/opensearch-python<filename>opensearch/models/behavior_fields.py # coding: utf-8 """ Copyright 2019 Alibaba Group Holding Limited 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 ...
1.890625
2
tests/test_molecule.py
zig1000/schem
0
41469
<filename>tests/test_molecule.py #!/usr/bin/env python # -*- coding: utf-8 -*- from pathlib import Path import pickle from timeit import Timer import unittest import sys # Insert the parent directory to sys path so schem is accessible even if it's not available system-wide sys.path.insert(1, str(Path(__file__).parent...
2.46875
2
Discussion/migrations/0003_auto_20180906_1441.py
Arianxx/ShareForum
39
41470
<gh_stars>10-100 # Generated by Django 2.0.5 on 2018-09-06 06:41 from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('Discussion', '0002_auto_20180613_1819'),...
1.5625
2
folks/go.py
hugosenari/folks
1
41471
import gi import ctypes as pyc from ctypes import pythonapi from gi.repository import GObject as GO pyc.cdll.LoadLibrary('libgobject-2.0.so') lego = pyc.CDLL('libgobject-2.0.so') lego.g_type_name.restype = pyc.c_char_p lego.g_type_name.argtypes = (pyc.c_ulonglong,) pythonapi.PyCapsule_GetName.restype = pyc.c_char_p pyt...
2.078125
2
ambry/cli/test.py
kball/ambry
1
41472
<reponame>kball/ambry """ Copyright (c) 2013 Clarinova. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ from ..cli import prt,fatal def test_parser(cmd): import argparse test_p = cmd.add_parser('test', help='Test and debugging') test_p...
1.84375
2
dataset/semi.py
lanyinemt2/ST-PlusPlus
73
41473
from dataset.transform import crop, hflip, normalize, resize, blur, cutout import math import os from PIL import Image import random from torch.utils.data import Dataset from torchvision import transforms class SemiDataset(Dataset): def __init__(self, name, root, mode, size, labeled_id_path=None, unlabeled_id_pa...
2.859375
3
solve.py
Phyxius/z3ncoder
9
41474
<filename>solve.py #!/usr/bin/env python from z3 import * import argparse def solve(b): s = Solver() bad_chars = [ 0x20, 0x80, 0x0A, 0x0D, 0x2F, 0x3A, 0x3F ] x, y, z = BitVecs('x y z', 32) variables = [x, y, z] for var in variables: for k in range(0, 32, 8): s.add(Extract(k+7,...
2.875
3
analyzer/apisan/check/condition.py
oslab-swrc/apisan
58
41475
<gh_stars>10-100 # SPDX-License-Identifier: MIT #!/usr/bin/env python3 from .checker import Checker, Context from ..lib import utils, rank_utils from ..lib.rank_utils import ( is_alloc, is_dealloc, is_lock, is_unlock ) from ..parse.explorer import is_call from ..parse.symbol import IDSymbol class CondChecker(Check...
2.140625
2
venv/Lib/site-packages/pyo/examples/17-osc/02-receive-streams.py
mintzer/pupillometry-rf-back
0
41476
""" Receiving Open Sound Control messages as audio streams **02-receive-streams.py** This script shows a granulation process controlled by OSC messages coming from another program (run the next example, *03-send-streams.py*, to get values coming in). """ from pyo import * s = Server().boot() # The sound table to g...
2.71875
3
pybald/core/controllers.py
boswellgathu/pybald
7
41477
#!/usr/bin/env python # encoding: utf-8 from six import with_metaclass from functools import wraps from webob import Request, Response, exc import re from pybald.util import camel_to_underscore from routes import redirect_to from pybald import context import json import random import uuid import logging console = log...
2.265625
2
recommendation/views.py
Nabeel965/AgriTechies
0
41478
<reponame>Nabeel965/AgriTechies from django.http import HttpResponse from django.shortcuts import render import joblib import pandas as pd import numpy as np from .models import crop_data from .recommender import CropDataForm model = joblib.load('model.pkl') xl_file = pd.ExcelFile('Features - Rev02.xlsx') storage_df=x...
2.625
3
bloxone/oph_management/oph_rename.py
frankhecker/infoblox-public
1
41479
<reponame>frankhecker/infoblox-public #!/usr/bin/python3 """oph_rename: rename a BloxOne on-prem host.""" # Import the required Python modules. import argparse import sys import os import json import bloxone # BloxOne constants. B1_OVA_HOST_TYPE = '3' B1_CONTAINER_HOST_TYPE = '5' B1_SUPPORTED_HOST_TYPES = [ B1...
2.5625
3
hackerrank/euler007/euler007_2.py
jcpince/algorithms
0
41480
<filename>hackerrank/euler007/euler007_2.py #!/bin/python3 import time from math import sqrt count3 = 0 count5 = 0 count7 = 0 def get_prime(primes, N): global count3, count5, count7 if N < len(primes): return primes[N-1] candidate = primes[-1] while len(primes) != N: candidate += 2 ...
3.671875
4
emencia_paste_djangocms_3/django_buildout/project/mods_available/filebrowser/__init__.py
emencia/emencia_paste_djangocms_3
1
41481
""" Add `Django Filebrowser`_ to your project so you can use a centralized interface to manage the uploaded files to be used with other components (`cms`_, `zinnia`_, etc.). The version used is a special version called *no grappelli* that can be used outside of the *django-grapelli* environment. Filebrowser manage fi...
1.203125
1
allauth/socialaccount/providers/apple/views.py
321core/django-allauth
0
41482
import json import requests from datetime import timedelta from django.http import HttpResponseRedirect from django.utils import timezone from django.utils.http import urlencode from django.views.decorators.csrf import csrf_exempt import jwt from allauth.socialaccount.models import SocialApp, SocialToken from allaut...
2.25
2
core/models.py
GuiSilva11/sospet
0
41483
<gh_stars>0 from django.db import models from django.contrib.auth.models import User from django import dj_database_url # Create your models here. class Pet(models.Model): city = models.CharField(max_length=100) description = models.TextField() phone = models.CharField(max_length=11, null=True) e...
2.3125
2
8KYU/first_non_consecutive.py
yaznasivasai/python_codewars
4
41484
def first_non_consecutive(arr: list) -> int: ''' This function returns the first element of an array that is not consecutive. ''' if len(arr) < 2: return None non_consecutive = [] for i in range(len(arr) - 1): if arr[i+1] - arr[i] != 1: non_consecutive.append(arr[i+1]) if...
3.96875
4
yolo/yolo_v3.py
ToddZhouFeng/YOLOv3_TensorFlow2
0
41485
#修改为 yolo-fastest #修改 ResidualBlock, 从原来的 ->1x1->3x3-> 变为 ->1x1->3x3->1x1-> #修改 make_residual_block, 增加前面的卷积层 import tensorflow as tf class DarkNetConv2D(tf.keras.layers.Layer): def __init__(self, filters, kernel_size, strides, activation="leaky", groups=1): super(DarkNetConv2D, self).__init__() ...
3.265625
3
builder/dummyCrystalConfig.py
jcamstan3370/MachineLearningPerovskites
6
41486
<filename>builder/dummyCrystalConfig.py<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: Jared """ # LATTICE VARIATION lattice_mul = 20 #how many lattice variations to perform lattice_variation_percent = 10 keep_aspect = False # COMPOSITION VARIATION # upper limit to sim num lattice_comp_num ...
1.875
2
bitey/cpu/pin.py
jgerrish/bitey
0
41487
<gh_stars>0 from dataclasses import dataclass from enum import Enum class State(Enum): "State of a pin, can either be LOW or HIGH" LOW = 1 HIGH = 2 @dataclass class Pin: """ Physical pins on the microprocessor. Most of the code in this project is higher-level, ignoring things like clock-...
3.78125
4
example/try1.py
sano-jin/go-in-ocaml
1
41488
try: print('enter try statement') raise Exception() print('exit try statement') except Exception as inst: print(inst.__class__.__name__)
2.8125
3
sme_uniforme_apps/custom_user/urls.py
prefeiturasp/SME-PortalUniforme-BackEnd
0
41489
<reponame>prefeiturasp/SME-PortalUniforme-BackEnd from django.urls import include, path from rest_framework import routers from .api.viewsets.usuario_viewset import UsuarioViewset router = routers.DefaultRouter() router.register("usuarios", UsuarioViewset, "Usuários") urlpatterns = [ path('', include(router.url...
1.789063
2
Driver/models.py
Anne56njeri/Carpool
1
41490
from django.db import models from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from django.db.models.signals import post_save from django.dispatch import receiver # Create your models here. ''' we create a profile class that will help us save information on whether the...
2.40625
2
taskmanager/src/modules/events/infrastructure/persistence/models/event_model.py
alice-biometrics/petisco-task-manager
1
41491
<gh_stars>1-10 from petisco.persistence.persistence import Persistence from sqlalchemy import Column, Integer, String, JSON Base = Persistence.get_base("taskmanager") class EventModel(Base): __tablename__ = "Event" id = Column("id", Integer, primary_key=True) event_id = Column("event_id", String(36)) ...
2.59375
3
Literature-backend/utils/authorization.py
czl0325/Literature-python3
7
41492
import functools from flask import g, request from lib.jwt_utils import verify_jwt def LoginRequired(view_func): @functools.wraps(view_func) def check_auth(*args, **kwargs): g.user_id = None auth = request.headers.get('token') payload = verify_jwt(auth) if payload: ...
2.375
2
backend/emailer.py
amm042/Flower
3
41493
import os import subprocess import smtplib from email.mime.text import MIMEText from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart EMAIL_HTML_START = '<html><head></head><body><p>' EMAIL_HTML_END = '</p></body></html>' """ Send Email with attachments and text attachments should be ...
2.828125
3
inf.py
ultrasound1372/RFXPy
0
41494
<gh_stars>0 #! /usr/bin/env python3 # -*- Coding: UTF-8 -*- # infinity test case # The port seems to differ from the original code here # the original code will madly clip this string # while this code seems to ignore the infinity and just produces a normal wave # unsure of which behavior is desireable at this ti...
1.882813
2
src/CountDistinctSlices.py
ShanRB/Codility-Lessons-Solution
0
41495
def solution(M, A): # write your code in Python 3.6 seen = [0] * (M + 1) count = 0 i,j = 0,0 while(i < len(A) and j < len(A)): if seen[A[j]]: seen[A[i]] = 0 i += 1 else: seen[A[j]] = 1 count += j - i + 1 j += 1 if co...
2.90625
3
tests/test_generators.py
fsoubelet/PyHEADTAIL
0
41496
''' @date: 31/03/2015 @author: <NAME> Tests for generator ''' import unittest import numpy as np import scipy.constants as constants from PyHEADTAIL.trackers.longitudinal_tracking import RFSystems import PyHEADTAIL.particles.generators as gf from PyHEADTAIL.general.printers import SilentPrinter class TestParticle...
2.5
2
Python/longest-turbulent-subarray.py
RideGreg/LeetCode
1
41497
# Time: O(n) # Space: O(1) # 978 # A subarray A[i], A[i+1], ..., A[j] of A is said to be turbulent if and only if: # - For i <= k < j, A[k] > A[k+1] when k is odd, and A[k] < A[k+1] when k is even; # - OR, for i <= k < j, A[k] > A[k+1] when k is even, and A[k] < A[k+1] when k is odd. # That is, the subarray is turbu...
3.625
4
lib/datasets/mot_info.py
liuqk3/GSM
3
41498
from lib.utils.misc import detect_os MOT_info = { "readme": "The sequences in MOT16 and MOT17 are the same, while the sequences in 2DMOT2015 are " "not all the same with those in MOT17. To handle this, we filter 2DMOT2015 dataset, " "i.e. those sequences that are contained in MOT17 will...
1.71875
2
src/dama/data/web.py
elaeon/ML
4
41499
<filename>src/dama/data/web.py import tqdm class HttpDataset(object): def __init__(self, url, sess=None): self.url = url self.sess = sess def download(self, filepath, chunksize): response = self.sess.get(self.url) with open(filepath, "wb") as f: for chunk in tqdm.tq...
2.953125
3