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
name_matching/test/test_name_matcher.py
DeNederlandscheBank/name_matching
0
17400
import numpy as np import pandas as pd import os.path as path import abydos.distance as abd import abydos.phonetic as abp import pytest from scipy.sparse import csc_matrix from sklearn.feature_extraction.text import TfidfVectorizer import name_matching.name_matcher as nm @pytest.fixture def name_match(): package...
2.25
2
data/train/python/67ccd647dc5505b2bf0b3f2efbfadce995daded7create_new_default.py
harshp8l/deep-learning-lang-detection
84
17401
''' Created on Dec 21, 2014 @author: Ben ''' def create_new_default(directory: str, dest: dict, param: dict): ''' Creates new default parameter file based on parameter settings ''' with open(directory, 'w') as new_default: new_default.write( '''TARGET DESTINATION = {} SAVE DESTINATION = {}...
3.328125
3
analysis/SiPMPE_reader.py
akira-okumura/isee_sipm
1
17402
import numpy as np import math import ROOT import sys class DistrReader: def __init__(self, dataset): self.stat_error = 0 self.sys_error = 0 self.plambda = 0 self.dataset = str(dataset) self.hist = ROOT.TH1D('','', 100, -0.2, 0.2) self.distr = ROOT.TH1D('','', 64, 0,...
2.328125
2
bad_apps_blog/__init__.py
bkesk/bad-apps-blog
0
17403
""" Bad Apps Blog Author: <NAME> (a.k.a. 7UR7L3) (Initial commit is based on the official Flask tutorial) About: This app began as an (essentially) exact copy of the official Flask tutorial (linke below). It is intented as an opportunity to practice application security, secure design, and secure coding techniques....
3.203125
3
status/urls.py
Khryptooo/infra_api
0
17404
from django.conf.urls import patterns, url from status import views urlpatterns = patterns('', url(r'^ups$', views.ups_status, name='ups_status'), url(r'^tor$', views.tor_status, name='tor_status'), )
1.570313
2
automation/auto_update_image_pr.py
WaqasAhmedLatif/cloud-native-edition
23
17405
import os import json from common import update_json_file, get_logger, exec_cmd from yamlparser import Parser from pathlib import Path logger = get_logger("update-image") # Functions that work to update gluu_versions.json def determine_final_official_and_dev_version(tag_list): """ Determine official version...
2.640625
3
es_reporting_tool/generate_report.py
yugendra/elasticsearch_reporting_tool
0
17406
<gh_stars>0 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet from reportlab.lib.units import inch from reportlab.lib.pagesizes import A3 from reportlab.platypus import Paragraph, SimpleDocTemplate, Table, TableStyle from reportlab.lib.enums import TA_CENTER import datetime ...
2.328125
2
fe/functional.py
proteneer/timemachine
91
17407
<gh_stars>10-100 from jax import config config.update("jax_enable_x64", True) from jax import custom_jvp, numpy as np from timemachine.lib.potentials import SummedPotential def _make_selection_mask(compute_du_dx=False, compute_du_dp=False, compute_du_dl=False, compute_u=False): return (compute_du_dx, compute_d...
1.976563
2
utilityfiles/race.py
IronicNinja/covid19api
1
17408
from bs4 import BeautifulSoup as soup from urllib.request import Request, urlopen from datetime import date import math import openpyxl import pandas as pd fname = 'https://www.governing.com/gov-data/census/state-minority-population-data-estimates.html' req = Request(fname, headers={'User-Agent': 'Mozilla/5.0'}) webpa...
3.328125
3
prioListe/utils.py
FelixTheC/allSales
0
17409
from django.core.exceptions import FieldError from staff.models import Staff import re def get_choices(): # choices in a seperated funtion to change it easier STATUS_CHOICES = ( ('', ''), ('Test', 'Test'), ('Fertig', 'Fertig'), ('Löschen', 'Löschen'), ('Vertrieb', 'Vert...
2.4375
2
app/pydantic_models/phone.py
matiasbavera/fastapi-tortoise-fk-example
0
17410
<reponame>matiasbavera/fastapi-tortoise-fk-example<filename>app/pydantic_models/phone.py from pydantic import BaseModel from app.orm_models.phone import Phone from tortoise.contrib.pydantic import pydantic_model_creator Phone_Pydantic = pydantic_model_creator(Phone, name="Phone") PhoneIn_Pydantic = pydantic_model_cre...
1.835938
2
suls/mealymachine.py
TCatshoek/lstar
2
17411
<reponame>TCatshoek/lstar # Need this to fix types from __future__ import annotations import tempfile import threading from typing import Union, Iterable, Dict, Tuple from suls.sul import SUL from graphviz import Digraph import random from itertools import product class MealyState: def __init__(self, name: str...
2.375
2
app/email.py
DXYyang/shenNeng_gasAnalysis
1
17412
from threading import Thread from flask import current_app,render_template from flask_mail import Message from . import mail def send_async_email(app,msg): with app.app_context(): mail.send(msg) def send_email(to,subject,template,**kwargs): app=current_app._get_current_object() msg=Message(app.con...
2.890625
3
MAIN_FIGURES.py
tortugar/Schott_etal_2022
0
17413
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Oct 10 18:30:46 2021 @author: fearthekraken """ import AS import pwaves import sleepy import pandas as pd #%% ### FIGURE 1C - example EEGs for NREM, IS, and REM ### ppath = '/home/fearthekraken/Documents/Data/photometry' AS.plot_exampl...
2
2
bitmovin/services/filters/__init__.py
camberbridge/bitmovin-python
44
17414
from .filter_service import FilterService
1.085938
1
inspect_population.py
puzis/OverflowPrediction
5
17415
import pickle from copy import deepcopy from graphviz import Digraph from torch.nn import Conv2d, MaxPool2d, ELU, Dropout, BatchNorm2d import pandas as pd from EEGNAS.model_generation.abstract_layers import IdentityLayer, ConvLayer, PoolingLayer, ActivationLayer from EEGNAS.model_generation.custom_modules import Ident...
2.1875
2
implementations/rest/bin/authhandlers.py
djsincla/SplunkModularInputsPythonFramework
3
17416
from requests.auth import AuthBase import hmac import base64 import hashlib import urlparse import urllib #add your custom auth handler class to this module class MyEncryptedCredentialsAuthHAndler(AuthBase): def __init__(self,**args): # setup any auth-related data here #self.username = args['usern...
2.734375
3
sdk/core/azure-core/azure/core/pipeline/policies/authentication_async.py
pjquirk/azure-sdk-for-python
0
17417
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- from azure...
2.03125
2
pbt/population/__init__.py
automl/HPO_for_RL
9
17418
from .trial import Trial, NoTrial from .member import Member from .population import Population __all__ = ['Trial', 'NoTrial', 'Member', 'Population']
1.46875
1
darth/process.py
OOXXXXOO/DARTH
11
17419
<reponame>OOXXXXOO/DARTH<filename>darth/process.py<gh_stars>10-100 import multiprocessing from tqdm import tqdm import os import gdal from .downloader import downloader from .obsclient import bucket from .vector import Vector def Process( VectorDataSource, WgsCord, Class_key, DataSourcesType='Googl...
2.234375
2
setup.py
Willd14469/cj8-patient-panthers
1
17420
import sys from setuptools import setup required_packages = ["boombox", "Pillow", "PyYAML", "rich"] win_packages = ["keyboard"] unix_packages = ["pynput"] WIN = "win32" LINUX = "linux" MACOS = "darwin" if sys.platform == WIN: required_packages += win_packages elif sys.platform in (LINUX, MACOS): required_pa...
1.84375
2
lunch_handler.py
wimo7083/Wheel-Of-Lunch-Slack-Bot
1
17421
from zipcodes import is_valid from random import randint from all_lunch_locs import call_lunch_api default_max = 30 default_range = 20 def random_zip(): # because what matters is good food, not close food. random_zip = 0 # because strings are required for this module while not is_valid(str(random_zip...
3.5625
4
py-insta/__init__.py
ItsTrakos/Py-insta
0
17422
""" # -*- coding: utf-8 -*- __author__ = "Trakos" __email__ = "<EMAIL>" __version__ = 1.0.0" __copyright__ = "Copyright (c) 2019 -2021 <NAME>" # Use of this source code is governed by the MIT license. __license__ = "MIT" Description: py-Insta Is A Python Library Scrape Instagram Data ...
3.109375
3
pyopenproject/business/services/command/membership/create.py
webu/pyopenproject
5
17423
<reponame>webu/pyopenproject from pyopenproject.api_connection.exceptions.request_exception import RequestError from pyopenproject.api_connection.requests.post_request import PostRequest from pyopenproject.business.exception.business_error import BusinessError from pyopenproject.business.services.command.membership.mem...
2.65625
3
lottery/branch/singular_values.py
NogaBar/open_lth
0
17424
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch from lottery.branch import base import models.registry from pruning.mask import Mask from pruning.pruned_model import PrunedModel...
2.0625
2
parser.py
Saevon/DMP-Career-Share
0
17425
#!/usr/bin/env python # -*- coding: UTF-8 -*- from collections import OrderedDict from decimal import Decimal from parser_data import InlineList, DuplicationList from state import State, StateMachine from type_check import is_int, is_float, is_sci_notation from format import format from error import DMPException cl...
2.8125
3
scripts/redact_cli_py/redact/io/blob_reader.py
jhapran/OCR-Form-Tools
412
17426
<filename>scripts/redact_cli_py/redact/io/blob_reader.py # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project # root for license information. from typing import List from pathlib import Path from azure.storage.blob import ContainerClient from re...
2.453125
2
layers/util/mapping_functions.py
meder411/spherical-package
8
17427
import torch import math from .grids import * from .conversions import * # ============================================================================= # Equirectangular mapping functions # ============================================================================= # # Note that there is no concept of padding for ...
2.546875
3
src/lambda_router/routers.py
jpaidoussi/lambda-router
0
17428
import json from typing import Any, Callable, Dict, Optional import attr from .interfaces import Event, Router @attr.s(kw_only=True) class SingleRoute(Router): """ Routes to a single defined route without any conditions. :param route: The single defined route. Only set via ``add_route``. """ ...
2.921875
3
Modules/ego_planner/ego-planner-swarm/src/uav_simulator/Utils/multi_map_server/src/multi_map_server/msg/_VerticalOccupancyGridList.py
473867143/Prometheus
1,217
17429
"""autogenerated by genpy from multi_map_server/VerticalOccupancyGridList.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct class VerticalOccupancyGridList(genpy.Message): _md5sum = "7ef85cc95b82747f51eb01a16bd7c795" _type = "multi_map_server/Verti...
2.375
2
examples/plot_benchmark.py
MrNuggelz/glvq
27
17430
""" ============== GLVQ Benchmark ============== This example shows the differences between the 4 different GLVQ implementations and LMNN. The Image Segmentation dataset is used for training and test. Each plot shows the projection and classification from each implementation. Because Glvq can't project the data on its ...
2.890625
3
8/star2.py
nfitzen/advent-of-code-2020
0
17431
#!/usr/bin/env python3 # SPDX-FileCopyrightText: 2020 <NAME> <https://github.com/nfitzen> # # SPDX-License-Identifier: CC0-1.0 # Jesus Christ this was overengineered to Hell and back. from typing import List, Tuple, Union with open('input.txt') as f: instructions = f.readlines() class Console(): def __init_...
2.859375
3
projects/20151163/api/api.py
universe3306/WebStudio2019
14
17432
<reponame>universe3306/WebStudio2019 from flask import Flask, request, jsonify from flask_restful import Api, Resource from flask_cors import CORS import json, os from models import db, User from UserList import UserList from PicturesList import Picture, PicturesList, Uploader basedir = os.path.dirname(os.path.abspat...
2.40625
2
app.py
sharonytlau/dash-loan-calculator
1
17433
<gh_stars>1-10 # <NAME> - <EMAIL> # <NAME> - <EMAIL> # <editor-fold desc="import modules"> import pandas as pd import numpy as np import json import os import re import dash import dash_table import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc from dash.depend...
2.015625
2
examples/advanced-topics/IIR-FIR/delay_channels.py
qua-platform/qua-libs
21
17434
<reponame>qua-platform/qua-libs import scipy.signal as sig import numpy as np from qm.qua import * import matplotlib.pyplot as plt import warnings from qm.QuantumMachinesManager import ( SimulationConfig, QuantumMachinesManager, LoopbackInterface, ) ntaps = 40 delays = [0, 22, 22.25, 22.35] ...
2.109375
2
listener.py
chrismarget/ios-icmp-channel
1
17435
#!/usr/bin/env python import sys class message(object): def add(self, idx, b): self.message[idx] = b if (b == '\x04') and self.is_complete(): self.print_message() def get_eom_idx(self): for i in sorted(self.message.keys()): if self.message[i] == '\x04': ...
2.703125
3
Integer to Roman.py
HalShaw/Leetcode
1
17436
class Solution(object): def intToRoman(self, num): """ 数字到罗马数字的转换 :type num: int :rtype: str """ dic = ["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"] nums = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]#两个数组,从高到低 res = "" ...
3.25
3
hapiclient/util.py
hbatta/client-python
0
17437
def setopts(defaults, given): """Override default keyword dictionary options. kwargs = setopts(defaults, kwargs) A warning is shown if kwargs contains a key not found in default. """ # Override defaults for key, value in given.items(): if type(given[key]) == dict: setopts(...
2.78125
3
docs/examples/combine-configs/convert.py
Mbompr/fromconfig
19
17438
<filename>docs/examples/combine-configs/convert.py """Convert file format.""" import fire import fromconfig def convert(path_input, path_output): """Convert input into output with load and dump.""" fromconfig.dump(fromconfig.load(path_input), path_output) if __name__ == "__main__": fire.Fire(convert)
2.234375
2
pyfibot/modules/module_rss.py
aapa/pyfibot
0
17439
from __future__ import unicode_literals, print_function, division import feedparser import dataset from twisted.internet.reactor import callLater from threading import Thread import twisted.internet.error import logging logger = logging.getLogger('module_rss') DATABASE = None updater = None botref = None config = {} ...
2.0625
2
main.py
omidsakhi/progressive_introvae
5
17440
<gh_stars>1-10 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os, ops, utils # Standard Imports from absl import flags import absl.logging as _logging # pylint: disable=unused-import import numpy as np import tensorflow as tf from PIL import Image ...
1.882813
2
docs/examples/timer.py
vlcinsky/nameko
3,425
17441
<gh_stars>1000+ from nameko.timer import timer class Service: name ="service" @timer(interval=1) def ping(self): # method executed every second print("pong")
2.578125
3
app/controllers/config/system/slack.py
grepleria/SnitchDNS
152
17442
<reponame>grepleria/SnitchDNS from .. import bp from flask import request, render_template, flash, redirect, url_for from flask_login import current_user, login_required from app.lib.base.provider import Provider from app.lib.base.decorators import admin_required @bp.route('/slack', methods=['GET']) @login_required @...
1.804688
2
setup.py
7AM7/Arabic-dialects-segmenter-with-flask
1
17443
<reponame>7AM7/Arabic-dialects-segmenter-with-flask from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name='FarasaPy3', version='3.0.0', packages=find_packages(exclude=['tests*']), license='MIT', description='Farasa (which m...
1.414063
1
oldversion/crystIT_v0.1.py
GKieslich/crystIT
4
17444
<gh_stars>1-10 import ase from ase.spacegroup import crystal from ase.units import kB,mol,kJ import spglib import pyxtal from pyxtal.symmetry import Group import numpy # arrays import math # log import os.path # isfile, isdir import copy # copy ...
2.15625
2
bin-opcodes-vec/top50opcodes.py
laurencejbelliott/Ensemble_DL_Ransomware_Detector
18
17445
__author__ = "<NAME> - 16600748" from capstone import * import pefile, os # samplePaths = ["testSamples/" + sample for sample in os.listdir("testSamples")] samplePaths = ["../bin-utf8-vec/benignSamples/" + sample for sample in os.listdir("../bin-utf8-vec/benignSamples")] + \ ["../bin-utf8-vec/malwareSamples/" + sampl...
2.28125
2
chat/messaging/apps.py
VsevolodOkhrimenko/enchad
0
17446
from django.apps import AppConfig class MessagingConfig(AppConfig): name = 'chat.messaging' def ready(self): try: import chat.messaging.signals # noqa F401 except ImportError: pass
1.46875
1
tests/test_keepalived2.py
khosrow/lvsm
15
17447
import unittest import os import sys import StringIO path = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../lvsm'))) from lvsm.modules import keepalived class Keepalived(unittest.TestCase): """Tests for the functionality of the keepalive...
2.484375
2
faeAuditor/auditGroupResults/urlsCSV.py
opena11y/fae-auditor
2
17448
""" Copyright 2014-2018 University of Illinois Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
1.773438
2
microcosm_caching/base.py
globality-corp/microcosm-caching
1
17449
<filename>microcosm_caching/base.py """ Cache abstractions for use with API resources. """ from abc import ABC, abstractmethod class CacheBase(ABC): """ A simple key-value cache interface. """ @abstractmethod def get(self, key): pass @abstractmethod def set(self, key, value, ttl...
2.953125
3
randomizer.py
shane1027/PollDaddySlurp
0
17450
<filename>randomizer.py #!/usr/bin/env python2.7 import time from http_request_randomizer.requests.proxy.requestProxy import RequestProxy if __name__ == '__main__': start = time.time() req_proxy = RequestProxy() print "Initialization took: {0} sec".format((time.time() - start)) print "Size : ", len(re...
2.8125
3
examples/nni_data_augmentation/basenet/data.py
petuum/tuun
33
17451
<filename>examples/nni_data_augmentation/basenet/data.py #!/usr/bin/env python """ data.py """ import itertools def loopy_wrapper(gen): while True: for x in gen: yield x class ZipDataloader: def __init__(self, dataloaders): self.dataloaders = dataloaders self._len = l...
2.921875
3
tools_box/_selling/report/sales_representative_scorecard/sales_representative_scorecard.py
maisonarmani/Tools_Box
0
17452
# Copyright (c) 2013, <EMAIL> and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe def execute(filters=None): columns, data = ["Sales Person: Link/Sales Person200", "Item:Link/Item:200","Item Name:Data:200","Qty:Float:200","Amount:Currency:200"], []...
2.09375
2
Google-IT-Automation-with-Python-Professional-Certificate/3-Introduction-to-Git-and-Github/Week-1/disk_usage.py
fengjings/Coursera
0
17453
<reponame>fengjings/Coursera import shutil import sys def check_disk_usage(disk, min_absolute, min_percent): '''return true if there is enough free disk space, else false''' du = shutil.disk_usage(disk) percent_free= 100*du.free/du.total gigabytes_free = du.free/2**30 if percent_free<min_percent or...
4.03125
4
src/utils/tests/test_www.py
nuuuwan/utils
0
17454
"""Test.""" import os import unittest import pytest from utils import www TEST_JSON_URL = os.path.join( 'https://raw.githubusercontent.com', 'nuuuwan/misc-sl-data/master', 'sl_power_station_info.json', ) TEST_TSV_URL = os.path.join( 'https://raw.githubusercontent.com', 'nuuuwan/gig-data/master',...
2.53125
3
src/qrl/core/State.py
scottdonaldau/QRL
1
17455
<filename>src/qrl/core/State.py<gh_stars>1-10 # coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. from typing import Optional from statistics import median import functools from google.protobuf.json_format import Messag...
1.648438
2
data/make_stterror_data/main.py
gcunhase/StackedDeBERT
32
17456
<reponame>gcunhase/StackedDeBERT import os.path from timeit import default_timer as timer import data.make_stterror_data.utils as utils from data.make_stterror_data.handler import HandlerIntent from data.make_stterror_data.parser import snips_parser __author__ = "<NAME>" """ Main module for Snips text -> TTS -> ...
2.203125
2
src/tk_live_model_test.py
KarlWithK/gesture
0
17457
<gh_stars>0 import tkinter as tk from PIL import Image, ImageTk from cv2 import cv2 import numpy as np import mediapipe as mp from keyboard import press_and_release as press from json import load from data_preprocessor import DataGenerator from gestures import GESTURES import tensorflow as tf TARG...
2.578125
3
wykop/api/client.py
selfisekai/wykop-sdk-reborn
0
17458
<filename>wykop/api/client.py import logging from typing import Dict, List from wykop.api.api_const import PAGE_NAMED_ARG, BODY_NAMED_ARG, FILE_POST_NAME from wykop.core.credentials import Credentials from wykop.core.requestor import Requestor log = logging.getLogger(__name__) class WykopAPI: """Wykop API vers...
2.46875
2
brainbox/tests/test_singlecell.py
SebastianBruijns/ibllib
0
17459
<reponame>SebastianBruijns/ibllib from brainbox.singlecell import acorr, calculate_peths import unittest import numpy as np class TestPopulation(unittest.TestCase): def test_acorr_0(self): spike_times = np.array([0, 10, 10, 20]) bin_size = 1 winsize_bins = 2 * 3 + 1 c_expected = n...
2.5
2
test/test_base_metric.py
Spraitazz/metric-learn
547
17460
import pytest import re import unittest import metric_learn import numpy as np from sklearn import clone from test.test_utils import ids_metric_learners, metric_learners, remove_y from metric_learn.sklearn_shims import set_random_state, SKLEARN_AT_LEAST_0_22 def remove_spaces(s): return re.sub(r'\s+', '', s) def ...
2.25
2
examples/geomopt/20-callback.py
QuESt-Calculator/pyscf
501
17461
<reponame>QuESt-Calculator/pyscf #!/usr/bin/env python ''' Optimize molecular geometry within the environment of QM/MM charges. ''' from pyscf import gto, scf from pyscf.geomopt import berny_solver from pyscf.geomopt import geometric_solver mol = gto.M(atom=''' C 0.000000 0.000000 -0.542500 O ...
2.1875
2
Q1_final_project_v2.py
wolhandlerdeb/clustering
0
17462
import numpy as np import pandas as pd import scipy as sc from scipy.stats import randint, norm, multivariate_normal, ortho_group from scipy import linalg from scipy.linalg import subspace_angles, orth from scipy.optimize import fmin import math from statistics import mean import seaborn as sns from sklearn.cluster imp...
2.421875
2
lnbits/extensions/usermanager/models.py
blackcoffeexbt/lnbits-legend
76
17463
<reponame>blackcoffeexbt/lnbits-legend from sqlite3 import Row from fastapi.param_functions import Query from pydantic import BaseModel from typing import Optional class CreateUserData(BaseModel): user_name: str = Query(...) wallet_name: str = Query(...) admin_id: str = Query(...) email: str = Query(...
2.84375
3
Operator.py
zijieli-Jlee/FGN
2
17464
import numba as nb import numpy as np import torch from torch.autograd import Function from Constants import MPS_KERNEL as w from Constants import BASE_RADIUS, ND_RAIUS, GRAD_RADIUS, LAP_RADIUS class DivOp(Function): """Compute the divergence of a given physics value. Implement in terms of pytorch autogra...
2.5
2
pythia/LinearRegression.py
MaudBoucherit/Pythia
0
17465
# LinearRegression.py # March 2018 # # This script builds a Linear regression class to analyse data. # It supports a continuous response and several continuous features. # The class has a constructor building and fitting the model, and # a plotting method for residuals. # # Dependencies: # # Usage: # from pythia.Li...
4.03125
4
src/renault_api/exceptions.py
slater0013/renault-api
44
17466
"""Exceptions for Renault API.""" class RenaultException(Exception): # noqa: N818 """Base exception for Renault API errors.""" pass class NotAuthenticatedException(RenaultException): # noqa: N818 """You are not authenticated, or authentication has expired.""" pass
1.804688
2
algorithms/Grayscale.py
AadityaMunjal/image-processing-algorithms
2
17467
def grayscale(image): for row in range(image.shape[0]): for col in range(image.shape[1]): avg = sum(image[row][col][i] for i in range(3)) // 3 image[row][col] = [avg for _ in range(3)]
3.3125
3
analysis/playing_with_pykalman.py
rafaelvalero/covid_forecast
3
17468
<reponame>rafaelvalero/covid_forecast ''' ============================= EM for Linear-Gaussian Models ============================= This example shows how one may use the EM algorithm to estimate model parameters with a Kalman Filter. The EM algorithm is a meta-algorithm for learning parameters in probabilistic models....
3.734375
4
phyutil/__init__.py
frib-high-level-controls/phyhlc
1
17469
# encoding: UTF-8 """Physics Applications Utility""" __copyright__ = "Copyright (c) 2015, Facility for Rare Isotope Beams" __author__ = "<NAME>" __version__ = "0.0.1" import logging import phylib import machine from machine import * from phylib.libCore import * # configure the root logger logging.basicConfig(forma...
1.25
1
pydyn/explicit_blocks.py
chhokrad/PYPOWER-Dynamics
0
17470
#!python3 # # Copyright (C) 2014-2015 <NAME>. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """ PYPOWER-Dynamics Functions for standard blocks (solves a step) """ import numpy as np # Gain block # yo = p * yi # p is a scalar gain coefficie...
2.703125
3
river/migrations/0012_auto_20191113_1550.py
xuziheng1002/django-river
0
17471
<filename>river/migrations/0012_auto_20191113_1550.py # -*- coding: utf-8 -*- # Generated by Django 1.11.25 on 2019-11-13 21:50 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('river...
1.390625
1
nesta/packages/examples/tests/test_example_package.py
anniyanvr/nesta
13
17472
from collections import namedtuple import pytest from nesta.packages.examples.example_package import some_func @pytest.fixture def mocked_row(): def _mocked_row(*, id, name): Row = namedtuple('Row', ['id', 'name']) return Row(id=id, name=name) return _mocked_row class TestSomeFunc: def...
3.046875
3
test/test_misc.py
mhthies/smarthomeconnect
5
17473
import asyncio import unittest import unittest.mock import shc.misc from test._helper import ExampleSubscribable, ExampleWritable, async_test, ExampleReadable class MiscTests(unittest.TestCase): @async_test async def test_two_way_pipe(self) -> None: pipe = shc.misc.TwoWayPipe(float) pub_lef...
2.5
2
pysatSpaceWeather/instruments/sw_f107.py
JonathonMSmith/pysatSpaceWeather
3
17474
# -*- coding: utf-8 -*- """Supports F10.7 index values. Downloads data from LASP and the SWPC. Properties ---------- platform 'sw' name 'f107' tag - 'historic' LASP F10.7 data (downloads by month, loads by day) - 'prelim' Preliminary SWPC daily solar indices - 'daily' Daily SWPC solar indices (cont...
2.4375
2
user/migrations/0004_auto_20200813_1948.py
VladimirZubavlenko/ikaf42-app
0
17475
# Generated by Django 3.0.5 on 2020-08-13 19:48 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user', '0003_auto_20200813_1943'), ] operations = [ migrations.AlterField( model_name='user', name='emailConfirmToke...
1.421875
1
vfoot/graphics/__init__.py
filipecn/vfoot
0
17476
import glfw import OpenGL.GL as gl import imgui from imgui.integrations.glfw import GlfwRenderer def app(render): imgui.create_context() window = impl_glfw_init() impl = GlfwRenderer(window) while not glfw.window_should_close(window): glfw.poll_events() impl.process_inputs() gl...
2.46875
2
master/rabbitvcs-master/rabbitvcs-master/rabbitvcs/util/_locale.py
AlexRogalskiy/DevArtifacts
4
17477
<gh_stars>1-10 from __future__ import absolute_import import locale import os from rabbitvcs.util.log import Log import rabbitvcs.util.settings import rabbitvcs.util.helper log = Log("rabbitvcs.util.locale") def initialize_locale(): try: settings = rabbitvcs.util.settings.SettingsManager() sane_...
2.53125
3
vectorize_enriched_api.py
mfejzer/tracking_buggy_files
3
17478
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Usage: %(scriptName) <bug_report_file> <data_prefix> """ import json from timeit import default_timer import datetime import numpy as np import pickle import sys from multiprocessing import Pool from operator import itemgetter from scipy import sparse from sklearn.fe...
2.3125
2
interpreter.py
bendmorris/beaver
2
17479
<reponame>bendmorris/beaver import argparse import os import sys from lib.graph import Graph from lib.types import BeaverException, Uri from lib.command import OutCommand import sys reload(sys) sys.setdefaultencoding('utf8') from __init__ import __version__ arg_parser = argparse.ArgumentParser() arg_parser.add_argume...
2.359375
2
euler/28.py
DevStarSJ/algorithmExercise
0
17480
def get_cross_sum(n): start = 1 total = 1 for i in range(1, n): step = i * 2 start = start + step total += start * 4 + step * 6 start = start + step * 3 return total print(get_cross_sum(501))
3.703125
4
titan/react_view_pkg/router/resources.py
mnieber/gen
0
17481
<gh_stars>0 import typing as T from dataclasses import dataclass, field from moonleap import Resource from titan.react_pkg.component import Component class Router(Component): pass @dataclass class RouterConfig(Resource): component: Component url: str params: T.List[str] = field(default_factory=list...
2.125
2
lab-taxi/agent.py
JunShern/deep-reinforcement-learning
0
17482
<reponame>JunShern/deep-reinforcement-learning import numpy as np from collections import defaultdict class Agent: def __init__(self, nA=6): """ Initialize agent. Params ====== - nA: number of actions available to the agent """ self.nA = nA self.actions = l...
3.625
4
visicom_reverse_geocoding.py
zimirrr/visicom_reverse_geocoding
0
17483
<filename>visicom_reverse_geocoding.py # -*- coding: utf-8 -*- """ /*************************************************************************** VisicomReverseGeocoder A QGIS plugin plugin for reverse geocoding from visicom api Generated by Plugin Builder: http://g-sherman.github.io/Q...
1.65625
2
test/module_dir/mymodule/__init__.py
honzajavorek/mkdocs_macros_plugin
0
17484
<reponame>honzajavorek/mkdocs_macros_plugin import os def define_env(env): """ This is the hook for the functions (new form) """ env.variables.cwd = os.getcwd() # use dot notation for adding env.variables.baz = env.variables.fix_url('foo') # Optional: a special function for making r...
2.546875
3
atlas/foundations_contrib/src/foundations_contrib/helpers/shell.py
DeepLearnI/atlas
296
17485
<gh_stars>100-1000 def find_bash(): import os if os.name == 'nt': return _find_windows_bash() return '/bin/bash' def _find_windows_bash(): winreg = _winreg_module() import csv StringIO = _get_string_io() from os.path import dirname sub_key = 'Directory\\shell\\git_shell\\com...
2.484375
2
app/models/user.py
tonyngophd/dronest
13
17486
from .db import db from .userfollower import UserFollower from werkzeug.security import generate_password_hash, check_password_hash from flask_login import UserMixin from sqlalchemy import Table, Column, Integer, ForeignKey, or_ from .directmessage import DirectMessage from .userequipment import UserEquipment from .equ...
2.328125
2
pyflu/update/signals.py
flupke/pyflu
1
17487
<reponame>flupke/pyflu from louie import Signal class update_finished(Signal): """ Sent by :class:`~pyflu.update.qt.UpdateDialogMixin` when an update finished successfully. It receives a single argument, containing the path of the patched files. """ class not_updated(Signal): """ Sent b...
1.976563
2
sentence_transformers/losses/BatchHardTripletLoss.py
zhangxieyang2/sentence-transformers
5
17488
<gh_stars>1-10 import torch from torch import nn, Tensor from typing import Union, Tuple, List, Iterable, Dict from sentence_transformers import util from sentence_transformers.SentenceTransformer import SentenceTransformer class BatchHardTripletLossDistanceFunction: """ This class defines distance functions,...
2.640625
3
wedding/card/route.py
ackneal/wedday
0
17489
<filename>wedding/card/route.py from flask import Flask, Blueprint, request, make_response, jsonify from sqlalchemy.sql.expression import func from google.cloud import storage from .card import Cards from ..functions import valid_param, upload_file from .. import db bp = Blueprint('route', __name__, url_prefix = '/api...
2.6875
3
mudi/utils.py
getzlab/mudi
1
17490
<reponame>getzlab/mudi<gh_stars>1-10 import numpy as np import h5py import scipy import gc import pandas as pd import os import time import pkg_resources import scanpy as sc import scanpy.external as sce import sys import scrublet as scr # --------------------------------- # Scanpy Helpers # ------------------------...
2.203125
2
src/quacks/mypy.py
ariebovenberg/quacks
11
17491
<reponame>ariebovenberg/quacks from typing import Callable, Optional, Type from mypy.nodes import AssignmentStmt, NameExpr, Statement, TempNode, Var from mypy.plugin import ClassDefContext, Plugin READONLY_DECORATOR_NAME = "quacks.readonly" # this logic is mostly derived from the dataclasses plugin def make_stateme...
2.125
2
tests/test_toolbar.py
WilliamMayor/django-mail-panel
0
17492
<gh_stars>0 from .context import * import unittest from mail_panel.panels import MailToolbarPanel class ToolbarSuite(unittest.TestCase): def test_panel(self): """ General 'does it run' test. """ p = MailToolbarPanel(None) assert(p.toolbar is None) def suite(): suite =...
2.46875
2
tests/project/operations/operational_types/test_common_functions.py
anamileva/gridpath
44
17493
# Copyright 2016-2020 Blue Marble Analytics LLC. # # 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 ag...
1.929688
2
top_links.py
judge2020/crossover-viz
0
17494
<reponame>judge2020/crossover-viz from main import extract_data if __name__ == '__main__': top = {} out = extract_data('CrossoverWiki.xml') for name in out: for link in name['links']: w = link['with'] top[w] = top[w] + 1 if w in top else 1 top = dict(reversed(sorted(top....
2.625
3
instance/settings.py
isaacjohnwesley/digfont
2
17495
""" Flask application settings. """ import os DEBUG = True # Output un-merged files in debug mode. #ASSETS_DEBUG = DEBUG SECRET_KEY = os.environ.get('SECRET_KEY', None) MY_VAR = os.environ.get('MY_VAR', None) #: Mongodb settings MONGODB_SETTINGS = {'DB' : 'digfont'} #: CSRF key SECRET_KEY = "dig.font.s3cr3t"
1.875
2
pangram.py
ZorbaTheStrange/pangram
0
17496
<gh_stars>0 #! /usr/bin/python3 ''' panogram.py - this program recongizes pangrams. by zorba ''' import sys def pangram_check(sentence_or_word): ''' checks the user input to see if it is a pangram. ''' letters = set('abcdefghijklmnopqrstuvwxyz') if sentence_or_word.lower() == 'done': z...
4.34375
4
Chapter-4 Sequence/Dictionary.py
jaiswalIT02/pythonprograms
0
17497
# -*- coding: utf-8 -*- """ Created on Sat Oct 10 15:31:57 2020 @author: <NAME> """ dictone = { "bookname": "Recursion Sutras", "subject": "Recursion", "author": "<NAME>" } dicttwo = dict(dictone) print(dicttwo)
3.265625
3
mportal/wsgi_start.py
auyeongwy/mportal
0
17498
<filename>mportal/wsgi_start.py # Copyright 2014 <NAME> # # 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...
1.664063
2
lecture_04/312_plan_motion_ros_artist.py
farzanehesk/COMPAS-II-FS2022
11
17499
import math import time from compas_fab.backends import RosClient from compas.artists import Artist from compas.geometry import Frame with RosClient("localhost") as client: robot = client.load_robot(load_geometry=True) group = robot.main_group_name frame = Frame((0.4, 0.3, 0.05), (-1, 0, 0), (0, 1, 0)) ...
2.421875
2