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
amnesia/modules/account/resources.py
silenius/amnesia
4
29500
# -*- coding: utf-8 -*- # pylint: disable=E1101 import logging import os import operator from binascii import hexlify from pyramid.security import DENY_ALL from pyramid.security import Everyone from pyramid.security import Allow from pyramid.settings import asbool from pyramid_mailer.message import Message from s...
1.929688
2
unused/more_num.py
monadius/FPTaylor
21
29501
import math import sys from fractions import Fraction from random import uniform, randint import decimal as dec def log10_floor(f): b, k = 1, -1 while b <= f: b *= 10 k += 1 return k def log10_ceil(f): b, k = 1, 0 while b < f: b *= 10 k += 1 return k def log10_...
3.46875
3
setup.py
Vanderbeck/example_pkg
0
29502
import setuptools with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="example-pkg-vanderbeck", # Replace with your own username version="0.0.1", author="<NAME>", author_email="<EMAIL>", description="A small example package", long_descri...
1.625
2
wiki-parse/node.py
mvwicky/wiki-parse
0
29503
<reponame>mvwicky/wiki-parse import os import random import sys import time from typing import ClassVar, List from urllib.parse import urlsplit import attr from bs4 import BeautifulSoup import requests # Epsilon value EPS = sys.float_info.epsilon def req(url, verbose=False): """Make a request, sleeping for a r...
3.015625
3
setup.py
shubhamjain/quick-grayscale
14
29504
<filename>setup.py """ This is a setup.py script generated by py2applet Usage: python setup.py py2app """ from setuptools import setup APP = ["quick-gray.py"] APP_NAME = "QuickGrayscale" DATA_FILES = ["status-bar-logo.png", "status-bar-logo--dark.png"] OPTIONS = { "iconfile":"./assets/gq.icns", "plist":...
2.0625
2
src/unsupervised_class3/test_stochastic_tensor.py
JouniVatanen/NLP-and-Deep-Learning
1
29505
<reponame>JouniVatanen/NLP-and-Deep-Learning<gh_stars>1-10 # https://deeplearningcourses.com/c/deep-learning-gans-and-variational-autoencoders # https://www.udemy.com/deep-learning-gans-and-variational-autoencoders # a simple script to see what StochasticTensor outputs from __future__ import print_function, division f...
2.8125
3
osu/apiV1.py
LostPy/osu-api.py
1
29506
""" Description: A Python module to use easily the osu!api V1. Author: LostPy License: MIT Date: 2021-01-11 """ import requests as req import json from . import from_json base_url ='https://osu.ppy.sh/api' urls = { 'beatmaps': base_url + '/get_beatmaps?', 'user': base_url + '/get_user?', 'scores': base_url + '/get...
2.75
3
apps/show_plots.py
avdmitry/convnet
293
29507
import glob import matplotlib.pyplot as plt import numpy as np import sys plt.ion() data_files = list(glob.glob(sys.argv[1]+'/mnist_net_*_train.log')) valid_data_files = list(glob.glob(sys.argv[1]+'/mnist_net_*_valid.log')) for fname in data_files: data = np.loadtxt(fname).reshape(-1, 3) name = fname.split('/')[...
2.640625
3
props/graph_representation/proposition.py
kshabahang/props
0
29508
from props.dependency_tree.definitions import subject_dependencies, ARG_LABEL,\ object_dependencies, SOURCE_LABEL, domain_label, POSSESSED_LABEL,\ POSSESSOR_LABEL class Proposition: def __init__(self,pred,args,outputType): self.pred = pred self.args = args self.outputType = ou...
2.46875
2
hello.py
olibob/pyflasktuto
0
29509
<filename>hello.py from flask import Flask, request, render_template, session, redirect, url_for, flash from flask_script import Manager, Shell from flask_bootstrap import Bootstrap from flask_moment import Moment from flask_wtf import FlaskForm from wtforms import StringField, SubmitField from wtforms.validators impor...
2.4375
2
tap/tests/test_result.py
cans/tappy-pkg
0
29510
<reponame>cans/tappy-pkg<filename>tap/tests/test_result.py<gh_stars>0 # Copyright (c) 2015, <NAME> import os import unittest from tap.runner import TAPTestResult class FakeTestCase(unittest.TestCase): def runTest(self): pass def __call__(self, result): pass class TestTAPTestResult(unitte...
2.609375
3
1068.py
destinationunknown/CSES
2
29511
# Weird Algorithm # Consider an algorithm that takes as input a positive integer n. If n is even, the algorithm divides it by two, and if n is odd, the algorithm multiplies it by three and adds one. The algorithm repeats this, until n is one. n = int(input()) print(n, end=" ") while n != 1: if n % 2 == 0: ...
4.21875
4
benchmark.py
ceshine/small-file-benchmark
0
29512
<filename>benchmark.py<gh_stars>0 """Simple Benchmark of Reading Small Files From Disk Usage: benchmark.py (-h | --help) benchmark.py init COUNT benchmark.py (create|test) (flat|two_level|four_level|memmap) [--size=<size>] Arguments: COUNT The number of files to be created. Supports scientific notation ...
2.890625
3
openpype/hosts/hiero/plugins/publish/integrate_version_up_workfile.py
jonclothcat/OpenPype
87
29513
<filename>openpype/hosts/hiero/plugins/publish/integrate_version_up_workfile.py<gh_stars>10-100 from pyblish import api import openpype.api as pype class IntegrateVersionUpWorkfile(api.ContextPlugin): """Save as new workfile version""" order = api.IntegratorOrder + 10.1 label = "Version-up Workfile" ...
2.140625
2
bots/oauthbot.py
Git-Good-Team/zoomapi
0
29514
<gh_stars>0 import sys, os filename = os.path.join(os.path.dirname(__file__), '..') sys.path.insert(1, filename) from zoomapi import OAuthZoomClient import json from configparser import ConfigParser from pyngrok import ngrok parser = ConfigParser() parser.read("bots/bot.ini") client_id = parser.get("OAuth", "client_i...
2.359375
2
gist_set.py
devnoname120/gist-alfred
113
29515
#!/usr/bin/python # encoding: utf-8 from collections import Counter from gist import create_workflow from pprint import pprint as pp import sys import workflow from workflow import Workflow, web from workflow.background import run_in_background, is_running def main(wf): arg = wf.args[0] wf.add_item(u"Set tok...
1.71875
2
class_12/strategies/fixed_trade_price_strategy.py
taoranalex/course_codes
121
29516
<filename>class_12/strategies/fixed_trade_price_strategy.py from howtrader.app.cta_strategy import ( CtaTemplate, StopOrder, TickData, BarData, TradeData, OrderData, BarGenerator, ArrayManager ) from howtrader.trader.constant import Interval from datetime import datetime from howtrader....
2.8125
3
3429.py
ssd352/quera-solutions
1
29517
T = int(input()) if T > 100: print('Steam') elif T < 0: print('Ice') else: print('Water')
3.609375
4
settings_template.py
WHOIGit/wip-comms-ifcb-imagedb
0
29518
PSQL_CONNECTION_PARAMS = { 'dbname': 'ifcb', 'user': '******', 'password': '******', 'host': '/var/run/postgresql/' } DATA_DIR = '/mnt/ifcb'
1.132813
1
src/trainer.py
tpimentelms/neural-transducer
0
29519
import argparse import glob import os import random import re from dataclasses import dataclass from functools import partial from math import ceil from typing import List, Optional import numpy as np import torch from torch.optim.lr_scheduler import ReduceLROnPlateau from tqdm import tqdm import util tqdm.monitor_i...
2.015625
2
tools/opencv.py
michaelpdu/pytorch-CycleGAN-and-pix2pix
0
29520
import cv2 import argparse import numpy as np def gray2bgr565(input_file, output_file): img = np.fromfile(input_file, dtype=np.uint16) img = img.reshape(480, 640) # img = cv2.imread(input_file, cv2.IMREAD_ANYDEPTH) ratio = np.amax(img) / 256 img8 = (img / ratio).astype('uint8') img8 = cv2.cvtCo...
3.296875
3
UMS/views.py
rawheel/Django-User-Management-System
2
29521
<reponame>rawheel/Django-User-Management-System<gh_stars>1-10 from django.shortcuts import render,redirect from .forms import UserForm,RoleForm,RightsForm from .models import UserTable,UserRole,UserRights def show_users(request): if request.method == "GET": users = list(UserTable.objects.values_list('user_n...
2.359375
2
game/entities/ship.py
alucardzom/pyxeltron
1
29522
from engine.entities.base import BaseEntity class Ship(BaseEntity): WIDTH = 8 HEIGHT = 8
1.875
2
scripts/ilqr/iLQR.py
leoking99-BIT/Constrained_ILQR
42
29523
import math import numpy as np import matplotlib.pyplot as plt import scipy.integrate as integrate import pdb import sys from ilqr.vehicle_model import Model from ilqr.local_planner import LocalPlanner from ilqr.constraints import Constraints class iLQR(): def __init__(self, args, obstacle_bb, verbose=False): ...
2.296875
2
src/engines/train/__init__.py
cr3ux53c/DenseNet-Tensorflow2
60
29524
<reponame>cr3ux53c/DenseNet-Tensorflow2 from .train import train
1.007813
1
genie_core/services/KeyBoardService.py
JereMIbq1995/genie-core
0
29525
class KeyBoardService(): def __init__(self): pass def is_key_pressed(self, *keys): pass def is_key_released(self, *key): pass
2.0625
2
tordatahub/tests/create_topics.py
jasonz93/python-tordatahub
0
29526
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Ap...
1.945313
2
config.py
didim99/FlaskLearning
0
29527
<reponame>didim99/FlaskLearning import os from dotenv import load_dotenv basedir = os.path.abspath(os.path.dirname(__file__)) load_dotenv(os.path.join(basedir, '.env')) class Config(object): SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess' VKAPI = { 'v': '5.122', 'client_i...
2.28125
2
index_builder/topic_model.py
Klamann/search-index-builder
0
29528
import argparse import itertools import json import logging import os import pickle import time import warnings from collections import Counter, defaultdict from typing import Dict, Any, List, Iterable, Tuple, Set warnings.filterwarnings(action='ignore', category=UserWarning, module='gensim') import langdetect import...
2.15625
2
python/misc/switcharoo.py
christopher-burke/warmups
0
29529
<filename>python/misc/switcharoo.py #!/usr/bin/env python3 """Switcharoo. Create a function that takes a string and returns a new string with its first and last characters swapped, except under three conditions: If the length of the string is less than two, return "Incompatible.". If the argument is not a string, re...
4.375
4
external/unbound/libunbound/python/examples/async-lookup.py
simplixcurrency/simplix
1,751
29530
<reponame>simplixcurrency/simplix #!/usr/bin/python ''' async-lookup.py : This example shows how to use asynchronous lookups Authors: <NAME> (vasicek AT fit.vutbr.cz) <NAME> (xvavru00 AT stud.fit.vutbr.cz) Copyright (c) 2008. All rights reserved. This software is open source. Redistribution and use...
1.867188
2
1/one.py
TheFrederick-git/adventofcode2021
0
29531
"""1/1 adventofcode""" with open("input.txt", "r", encoding="UTF-8") as i_file: data = list(map(int, i_file.read().splitlines())) values = ["i" if data[i] > data[i - 1] else "d" for i in range(1, len(data))] print(values.count("i"))
3.328125
3
fcsgg/modeling/backbone/resnet.py
liuhengyue/fcsgg
9
29532
<reponame>liuhengyue/fcsgg """ Simple ResNet FPN that only outputs p2. Modified from https://github.com/HRNet/Higher-HRNet-Human-Pose-Estimation/blob/master/lib/models/pose_higher_hrnet.py """ __author__ = "<NAME>" __copyright__ = "Copyright (c) 2021 Futurewei Inc." __credits__ = [] __license__ = "MIT License" __versi...
1.984375
2
musicdb/__init__.py
ieuan-jones/musicdb
0
29533
<gh_stars>0 import os from flask import Flask def create_app(): app = Flask(__name__, instance_relative_config=True) from . import catalogue app.register_blueprint(catalogue.bp) return app
1.765625
2
backfill/save_to_gcs.py
grollins/quandl-gcp-pipeline
0
29534
from google.cloud import storage GCS_CLIENT = storage.Client() GCS_BUCKET = GCS_CLIENT.get_bucket('senpai-io.appspot.com') path = 'quandl-stage/backfill_data_jan2015_mar2018.csv' blob = GCS_BUCKET.blob(path) blob.upload_from_filename(filename='data_jan2015_mar2018.csv')
2.03125
2
CMS/test/mocks/search_mocks.py
office-for-students/wagtail-CMS
4
29535
<reponame>office-for-students/wagtail-CMS<gh_stars>1-10 import json from requests.models import Response from http import HTTPStatus from CMS.test.mocks.search_mocks_content import content class SearchMocks: @classmethod def get_search_response_content(cls): return content; @classmethod ...
2.34375
2
code/hw2/performance.py
edrebin/NLP-Course
9
29536
import numpy as np from spacy.pipeline.sentencizer import Sentencizer from glob import glob from spacy.lang.en import English def metrics(a, b): from sklearn.metrics import f1_score, recall_score, precision_score, accuracy_score return (accuracy_score(a, b), recall_score(a, b), precisi...
2.609375
3
phonebook02/contact.py
pgThiago/saving-in-txt-python
1
29537
<gh_stars>1-10 from os import path from operator import itemgetter from time import sleep class Contact: '''def __init__(self, name = ' ', phone = ' ', birthday = ' '): self.name = name self.phone = phone self.birthday = birthday''' def check_if_txt_exists(self): '''Checks if t...
3.3125
3
src/vpnchooser/__init__.py
cbrand/vpnchooser
0
29538
# -*- encoding: utf-8 -*- from .applicaton import app, api from . import resources
1.09375
1
scripts/pughpore/passagetime-simple.py
jhwnkim/nanopores
8
29539
<reponame>jhwnkim/nanopores<filename>scripts/pughpore/passagetime-simple.py # -*- coding: utf-8 -*- from __future__ import unicode_literals # (c) 2017 <NAME> # TODO: obtain rD from actual simulation from nanopores import fields, kT, eta, qq, savefigs from numpy import exp, pi, sqrt, linspace, diff, array, dot L = 46e...
2.265625
2
IMU_algorithms/record_data.py
nesl/UnderwaterSensorTag
0
29540
from modules.mpulib import computeheading, attitudefromCompassGravity, RP_calculate, MadgwickQuaternionUpdate, Euler2Quat, quaternion_to_euler_angle, MPU9250_computeEuler import socket, traceback import csv import struct import sys, time, string, pygame import pygame import pygame.draw import pygame.time import numpy ...
1.820313
2
rest_api/views/doc_users.py
AktanKasymaliev/django_MyDentKg_backend
0
29541
from rest_framework import generics from rest_framework import response from rest_framework.permissions import AllowAny, IsAuthenticated from rest_framework.views import APIView from rest_api.serializers.doc_serializers import (DoctorRegisterSerializer, DoctorUsersSerializer, DoctorLoginSerializer, Doct...
2.015625
2
examples/plots/plot_quaternion_integrate.py
Mateus224/pytransform3d-1
0
29542
<reponame>Mateus224/pytransform3d-1 """ ====================== Quaternion Integration ====================== Integrate angular velocities to a sequence of quaternions. """ import numpy as np import matplotlib.pyplot as plt from pytransform3d.rotations import quaternion_integrate, matrix_from_quaternion, plot_basis a...
3.265625
3
8kyu/Beginner Series #2 Clock.py
walkgo/codewars_tasks
0
29543
<reponame>walkgo/codewars_tasks def past(h, m, s): h_ms = h * 3600000 m_ms = m * 60000 s_ms = s * 1000 return h_ms + m_ms + s_ms # Best Practices def past(h, m, s): return (3600*h + 60*m + s) * 1000
2.65625
3
examples/experimental/gmsh_api_test.py
Karl-Eriksson/calfem-python
54
29544
<reponame>Karl-Eriksson/calfem-python<filename>examples/experimental/gmsh_api_test.py import gmsh import sys import numpy as np import calfem.mesh as cfm import calfem.vis_mpl as cfv if __name__ == "__main__": gmsh.initialize(sys.argv) gmsh.model.add("t1") gmsh.model.geo.add_point(0.0, 0.0, 0.0) gmsh...
2.015625
2
bandera.py
lauralardies/recursividad
0
29545
# En este problema vamos a resolver el problema de la bandera de Dijkstra. # Tenemos una fila de fichas que cada una puede ser de un único color: roja, verde o azul. Están colocadas en un orden cualquiera # y tenemos que ordenarlas de manera que quede, de izquierda a derecha, los colores ordenados primero en rojo, lue...
3.9375
4
tests/test_placeholder.py
symonk/stashie-cli
0
29546
<reponame>symonk/stashie-cli def test_placeholder(): ...
0.949219
1
src/tests/test_download.py
dschon/rcp2
10
29547
<filename>src/tests/test_download.py<gh_stars>1-10 import pytest import responses from src.data import download def declare_action(fname, action, pooch): """Declare the download action taken. This function helps us know if ``src.data.download.fetch`` downloaded a missing file, fetched an available fi...
2.59375
3
what.py
manastech/de-bee
1
29548
from google.appengine.ext import webapp from wsgiref.handlers import CGIHandler from model import Membership from model import Group from model import Transaction class WhatHandler(webapp.RequestHandler): def get(self): page = self.request.get('p'); if page is None or page == '': page = 1 else:...
2.078125
2
semana_02/desafios/python-6/main.py
alexaldr/AceleraDev-Python
0
29549
from abc import ABCMeta, abstractmethod class Department: def __init__(self, name, code): self.name = name self.code = code class Employee(metaclass=ABCMeta): def __init__(self, code, name, salary, department): self.code = code self.name = name self.salary = salary ...
3.859375
4
train.py
JackwithWilshere/FashionAI-
5
29550
import torch import torch.nn as nn import torch.optim as optim import torchvision.transforms as transforms import os from torch.autograd import Variable import argparse import numpy as np from torch.optim.lr_scheduler import * from model.resnet import resnet101 from data_pre.FashionAI import fashion pa...
2.109375
2
Salami/Player.py
markjoshua12/game-jam-2020
15
29551
import arcade import math import LevelGenerator import Textures import Sounds from Constants import TILE_SIZE, ROOM_WIDTH, ROOM_HEIGHT from Mob import Mob from Projectile import Projectile class Player(Mob): def __init__(self, x, y, keyboard): self.keyboard = keyboard self.movespeed = 2.5 ...
2.640625
3
app/main/forms/direct_award_forms.py
pocketstefan/digitalmarketplace-buyer-frontend
0
29552
<reponame>pocketstefan/digitalmarketplace-buyer-frontend<gh_stars>0 from flask_wtf import FlaskForm from wtforms.validators import DataRequired, Length, NumberRange, InputRequired, ValidationError from dmutils.forms.fields import ( DMBooleanField, DMDateField, DMPoundsField, DMStripWhitespaceStringFie...
2.671875
3
dotstrings/parser.py
nickromano/dotstrings
0
29553
<gh_stars>0 #!/usr/bin/env python3 """Utilities for dealing with .strings files""" import re from typing import List, Match, Optional, TextIO, Tuple, Union from dotstrings.dot_strings_entry import DotStringsEntry _ENTRY_REGEX = r'^"(.+)"\s?=\s?"(.*)";$' _ENTRY_PATTERN = re.compile(_ENTRY_REGEX) _NS_ENTRY_REGEX = ...
3.109375
3
source/timeseries/single/linear.py
supercoder3000/py_tensorflow_experiments
0
29554
import tensorflow as tf from data_types.training_result import TrainingResult from data_types.training_set import TrainingSet from timeseries.build import compile_and_fit from timeseries.window_generator import WindowGenerator def evaluate_linear( training_set: TrainingSet ) -> TrainingResult: ## LINEAR ...
2.765625
3
apps/sso/utils/email.py
g10f/sso
3
29555
<filename>apps/sso/utils/email.py<gh_stars>1-10 from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.mail import get_connection from django...
2.015625
2
examples/paper/synthetic.py
wesselb/gpar
49
29556
import matplotlib.pyplot as plt import numpy as np from gpar.regression import GPARRegressor from wbml.experiment import WorkingDirectory import wbml.plot if __name__ == "__main__": wd = WorkingDirectory("_experiments", "synthetic", seed=1) # Create toy data set. n = 200 x = np.linspace(0, 1, n) n...
2.671875
3
code/js/interactive_ecoli_data.py
cremerlab/ribosomal_allocation
0
29557
#%% import numpy as np import pandas as pd import bokeh.plotting import bokeh.io import bokeh.models import growth.model import growth.viz const = growth.model.load_constants() colors, palette = growth.viz.bokeh_style() mapper = growth.viz.load_markercolors() bokeh.io.output_file('../../figures/interactive/interac...
2.46875
2
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/util/monitoring.py
osoco/better-ways-of-thinking-about-software
3
29558
<gh_stars>1-10 """Helper methods for monitoring of events.""" from edx_django_utils.monitoring import set_custom_attribute, set_custom_attributes_for_course_key def monitor_import_failure(course_key, import_step, message=None, exception=None): """ Helper method to add custom parameters to for import failures....
2.546875
3
Unidad3/H.hv6_toy/bin/quast-4.6.3/quast_libs/genome_analyzer.py
Melcatus/TallerBioinf
0
29559
<reponame>Melcatus/TallerBioinf<gh_stars>0 ############################################################################ # Copyright (c) 2015-2017 Saint Petersburg State University # Copyright (c) 2011-2015 Saint Petersburg Academic University # All Rights Reserved # See file LICENSE for details. #######################...
2.4375
2
app/auth/forms.py
blazejosojca/flask_blog
0
29560
from flask_wtf import FlaskForm from flask_wtf.file import FileAllowed, FileField from flask_babel import lazy_gettext as _l from wtforms import StringField, TextAreaField, SubmitField, PasswordField, BooleanField from wtforms.validators import DataRequired, Email, ValidationError, Length, EqualTo from app.models impo...
2.84375
3
pointmap.py
quillford/twitchslam
1
29561
from helpers import poseRt from frame import Frame import time import numpy as np import g2o import json LOCAL_WINDOW = 20 #LOCAL_WINDOW = None class Point(object): # A Point is a 3-D point in the world # Each Point is observed in multiple Frames def __init__(self, mapp, loc, color, tid=None): self.pt = np...
2.453125
2
day-02/python/part2.py
kayew/aoc-2020
0
29562
#!/usr/bin/env python3 import sys file = open(sys.argv[1], "r") total = 0 for line in file: letterMatch = 0 param = line.split() passIndex = [int(x) for x in param[0].split('-')] targetLetter = param[1][0] password = param[2] if password[passIndex[0]-1] == targetLetter: letterMatch +...
3.40625
3
handler.py
chiragjn/torchserve-t5-translation
3
29563
<filename>handler.py<gh_stars>1-10 import torch import os import logging import json from abc import ABC from ts.torch_handler.base_handler import BaseHandler from transformers import T5Tokenizer, T5ForConditionalGeneration logger = logging.getLogger(__name__) class TransformersSeqGeneration(BaseHandler, ABC): _...
2.078125
2
api/pub/sensor/sensor.py
rtaft/pi-sensor-dashboard
0
29564
<reponame>rtaft/pi-sensor-dashboard<filename>api/pub/sensor/sensor.py import flask from flask import request import flask_restful as restful from marshmallow import Schema, fields, validate from api.helpers import success, created from api.exceptions import NotFound #from api.restful import API #@API.route('/sensors'...
2.484375
2
homework/week8/models.py
enigmacodemaster/Project_Of_Mask_Real_Time_Detection
0
29565
from __future__ import division import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import numpy as np from utils.parse_config import * from utils.utils import build_targets, to_cpu, non_max_suppression import matplotlib.pyplot as plt import matplotlib.patches as pa...
2.265625
2
ggtools/gg/__init__.py
richannan/GGTOOLS
22
29566
''' ggtools gg subpackage This subpackage defines the following functions: # ====================== fitting function ==================== # func - Define a linear function f(x) = a0 + a1/T*x to be fitted, where a0 and a1 are parameters for inter # ====================== estinate lovebums =================== # love...
2.21875
2
django_core_models/locations/urls.py
ajaniv/django-core-models
0
29567
""" .. module:: django_core_models.locations.urls :synopsis: django_core_models locations application urls module django_core_models *locations* application urls module. """ from __future__ import absolute_import from django.conf.urls import url from . import views urlpatterns = [ url(r'^addresses/$', ...
2.125
2
dataloader/Dataset.py
mvemoon/TextClassificationBenchmark
576
29568
# -*- coding: utf-8 -*- import os,urllib class Dataset(object): def __init__(self,opt=None): if opt is not None: self.setup(opt) self.http_proxy= opt.__dict__.get("proxy","null") else: self.name="demo" self.dirname="demo" self.http_proxy="...
2.671875
3
scrapy/arxiv1.py
SaeedPourjafar/ws_2021
0
29569
<reponame>SaeedPourjafar/ws_2021<filename>scrapy/arxiv1.py # Please note that since the number of topics in computer science are exactly 40 and it's less than 100 # therefore we applied the limit on the second file (arxiv2.py) which has somewhere around 700-800 outputs # To run this file please put it in the spider...
3.1875
3
pdm/pep517/_vendor/toml/ordered.py
linw1995/pdm-pep517
4
29570
<reponame>linw1995/pdm-pep517 from collections import OrderedDict from pdm.pep517._vendor.toml import TomlEncoder from pdm.pep517._vendor.toml import TomlDecoder class TomlOrderedDecoder(TomlDecoder): def __init__(self): super(self.__class__, self).__init__(_dict=OrderedDict) class TomlOrderedEncoder(T...
2.265625
2
easyHTTP/client/api.py
hxgz/easyHTTP
0
29571
# coding:utf-8 from urllib.parse import urlencode, urljoin from .client import Client class API(Client): HOST = None PATH = None TIMEOUT = 30 @classmethod def _build_url(cls, path_args=None, params=None): url = urljoin(cls.HOST, cls.PATH) if path_args: url = url.form...
2.703125
3
ingredient_parser/__init__.py
johnwmillr/RecipesAPI
0
29572
__author__ = 'sheraz' __all__ = ['parse','normalize'] from ingredient_parser.en import parse
1.046875
1
RL_practise/MCTS/AlphaZero/board.py
xiaoyangzai/DeepReinforcementLearning
0
29573
<reponame>xiaoyangzai/DeepReinforcementLearning<filename>RL_practise/MCTS/AlphaZero/board.py #!/usr/bin/python from __future__ import print_function import numpy as np import os from human_player import human_player import time class Board(object): """board for game""" def __init__(self,**kwargs): se...
3.71875
4
tests/validation_tool/test_validation_helper.py
zhuyulin27/amazon-emr-on-eks-custom-image-cli
17
29574
import unittest import io from unittest import mock from tests.lib.utils import INSPECT from custom_image_cli.validation_tool import validation_helper from custom_image_cli.validation_tool.validation_models.validation_models import \ ImageDetail, ImageManifest, EmrRelease class TestValidationHelper(unittest.TestC...
2.375
2
other/stanford_ner_tagger.py
gauthamkrishna-g/Real-Time-Sentiment-Analyzer-of-Twitter-Trends
6
29575
# -*- coding: utf-8 -*- import nltk import os import numpy as np import matplotlib.pyplot as plt from matplotlib import style #from nltk import pos_tag from nltk.tag import StanfordNERTagger from nltk.tokenize import word_tokenize style.use('fivethirtyeight') # Process text raw_text = open("news_article.txt").read...
2.953125
3
mak/libs/pyxx/cxx/grammar/expression/primary/requires/__init__.py
motor-dev/Motor
4
29576
from . import general from . import simple from . import type from . import compound from . import nested
1.132813
1
02_Beyond_Fundamentals/02_01.py
AnmolTomer/lynda_programming_foundations
0
29577
# Iteration: Repeat the same procedure until it reaches a end point. # Specify the data to iterate over,what to do to data at every step, and we need to specify when our loop should stop. # Infinite Loop: Bug that may occur when ending condition speicified incorrectly or not specified. spices = [ 'salt', 'pepp...
4
4
dsed/migrate/build.py
flowmatters/dsed-py
0
29578
<reponame>flowmatters/dsed-py import os import json from functools import reduce import numpy as np import pandas as pd import geopandas as gpd from dsed.ow import DynamicSednetCatchment, FINE_SEDIMENT, COARSE_SEDIMENT from dsed.const import * import openwater.nodes as node_types from openwater.examples import from_...
2.078125
2
scripts/gen_app_yaml.py
MatthewWilkes/mw4068-packaging
0
29579
<gh_stars>0 #! /usr/bin/env python2.5 # Copyright 2009 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
2.375
2
task_list_dev/__main__.py
HenriqueLR/task-list-dev
0
29580
<filename>task_list_dev/__main__.py # coding: utf-8 print(__import__('task_list_dev').tools.get_list())
1.164063
1
CodingBat/Python/Warmup-1 > not_string.py
JLJTECH/TutorialTesting
0
29581
#Warmup-1 > not_string def not_string(str): if str.startswith('not'): return str else: return "not " + str
3.25
3
gputools/transforms/transformations.py
jni/gputools
0
29582
<reponame>jni/gputools<filename>gputools/transforms/transformations.py """ scaling images """ from __future__ import print_function, unicode_literals, absolute_import, division import logging logger = logging.getLogger(__name__) import os import numpy as np import warnings from gputools import OCLArray, OCLImage, O...
2.125
2
index.py
genesis331/fdk-object-detection
0
29583
import streamlit as st from streamlit import caching import os import torch from src.core.detect import Detector from src.core.utils import utils from PIL import Image import cv2 st.title('1stDayKit Object Detection') st.write('1stDayKit is a high-level Deep Learning toolkit for solving generic tasks.') uploaded_file...
3.125
3
src/connections/_sqlalchemy.py
Freonius/tranquillity
0
29584
from sqlalchemy.engine import Engine, Connection from .__interface import IConnection class Sql(IConnection): pass
1.507813
2
custom_components/meross_lan/merossclient/__init__.py
gelokatil/meross_lan
0
29585
"""An Http API Client to interact with meross devices""" from email import header import logging from types import MappingProxyType from typing import List, MappingView, Optional, Dict, Any, Callable, Union from enum import Enum from uuid import uuid4 from hashlib import md5 from time import time from json import ( ...
2.046875
2
modulo 2/d037/conversao.py
rafa-evangelista/PYTHON
0
29586
<reponame>rafa-evangelista/PYTHON<gh_stars>0 num = int(input('Digite um número: ')) print('''Qual será a base de conversão do número {} [1] para "binário" [2] para "octal" [3] para "hexadecimal"'''.format(num)) num1 = int(input('Escolha uma opção: ')) if num1 == 1: print('Você escolheu converter o número {} para b...
4.09375
4
python/matplotlib/contour_from_hist2d_sigmas.py
jeremiedecock/snippets
23
29587
<filename>python/matplotlib/contour_from_hist2d_sigmas.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Plot contours from an 2D histogram showing the standard deviation """ import numpy as np import matplotlib.pyplot as plt # Build datas ############### x, y = np.random.normal(size=(2, 1000000)) xbins = np.l...
3.625
4
tests/conftest.py
Peter-Metz/taxdata
0
29588
import os import json import pytest import pandas as pd # TODO: revise the following constants when using new or revised CPS/PUF data CPS_START_YEAR = 2014 PUF_START_YEAR = 2011 PUF_COUNT = 248591 LAST_YEAR = 2027 @pytest.fixture(scope='session') def test_path(): return os.path.abspath(os.path.dirname(__file__)...
1.929688
2
tests/snappi/pfcwd/files/pfcwd_runtime_traffic_helper.py
xwjiang2021/sonic-mgmt
2
29589
<filename>tests/snappi/pfcwd/files/pfcwd_runtime_traffic_helper.py import time import logging from tests.common.helpers.assertions import pytest_assert from tests.common.snappi.snappi_helpers import get_dut_port_id from tests.common.snappi.common_helpers import start_pfcwd, stop_pfcwd from tests.common.snappi.port imp...
2.125
2
sixx/plugins/utils/converters.py
TildeBeta/6X
2
29590
from math import sqrt import re from curious.commands import Context from curious.commands.exc import ConversionFailedError from typing import Tuple colour_pattern = re.compile(r'(#|0x)?([A-Za-z0-9]{1,6})') RGB = Tuple[int, int, int] class Colour: """ A class that represents a colour. """ def __ini...
3.625
4
tests/plugins/tool/docformatter_tool_plugin/valid_package/wrong.py
kogut/statick
54
29591
''' Docstring with single quotes instead of double quotes. ''' my_str = "not an int"
1.476563
1
src/tester.py
OompahLoompah/LinodeAPI-Client
0
29592
from client import linodeClient import os linode = linodeClient(os.getcwd() + '/../.config') userInput = raw_input("What do you want to do?\n") if userInput == 'create': print(linode.createLinode('3', '1')) if userInput == 'destroy': userInput = raw_input("What do you want to destroy?\n") response = lin...
2.515625
3
base/migrations/0002_auto_20210622_1947.py
francofgp/Syndeo
3
29593
<gh_stars>1-10 # Generated by Django 3.2.2 on 2021-06-22 22:47 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('base', '0001_initial'), ] operations = [ migrations.CreateM...
1.734375
2
selection_sort.py
Wajktor13/Sorting_algorithms
0
29594
def selection_sort(input_list): for i in range(len(input_list)): min_index = i for k in range(i, len(input_list)): if input_list[k] < input_list[min_index]: min_index = k input_list[i], input_list[min_index] = input_list[min_index], input_list[i] return inpu...
3.59375
4
prefs.py
synap5e/pandora-station-to-spotify
1
29595
username = '<EMAIL>' password = '<PASSWORD>' # larger = less change of delays if you skip a lot # smaller = more responsive to ups/downs queue_size = 2
1.070313
1
src/scs_core/data/histogram.py
seoss/scs_core
0
29596
""" Created on 9 Aug 2016 @author: <NAME> (<EMAIL>) """ import _csv import sys # -------------------------------------------------------------------------------------------------------------------- class Histogram(object): """ classdocs """ __HEADER_BIN = ".bin" __HEADER_COUNT = ".count" ...
2.71875
3
source/0A_write_cgi_v1.4.py
SpencerEricksen/PCBA_downloads_oxphos
0
29597
<gh_stars>0 # script to read-in CID list and write out cgi XML files # for molecule downloads from pubchem using PUG REST # usage: 1_write_cgi_PUG_v1.4.py pcba-aid411_activities.csv import pandas as pd import sys def dump_cgi_xml( outfile, cid_list, AID, AID_chunk ): '''write out a cgi xml file for fetching'...
2.765625
3
src/pymor/analyticalproblems/instationary.py
mahgadalla/pymor
1
29598
<filename>src/pymor/analyticalproblems/instationary.py<gh_stars>1-10 # -*- coding: utf-8 -*- # This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2017 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from ...
2.8125
3
pituophis/cli.py
dotcomboom/Pituophis
30
29599
import importlib import sys import pituophis # check if the user is running the script with the correct number of arguments if len(sys.argv) < 2: # if not, print the usage print('usage: pituophis [command] cd [options]') print('Commands:') print(' serve [options]') print(' fetch [url] [options]')...
3.203125
3