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
symbench_athens_client/tests/models/test_pipelines.py
valtron/symbench-athens-client
0
18700
class TestPipelines: pass
1.078125
1
applications/trilinos_application/python_scripts/PressureMultiLevelSolver.py
AndreaVoltan/MyKratos7.0
2
18701
<filename>applications/trilinos_application/python_scripts/PressureMultiLevelSolver.py from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7 from KratosMultiphysics import * from KratosMultiphysics.TrilinosApplication import * def Multile...
2.03125
2
Hood/views.py
Gakur/NeiApp
0
18702
<reponame>Gakur/NeiApp<filename>Hood/views.py from django.shortcuts import render, redirect, get_object_or_404 from django.http import HttpResponse ,HttpResponseRedirect, Http404 from django.urls import reverse from django.contrib.auth.forms import UserCreationForm from .models import * from .forms import UserRegister...
2.25
2
ckanext-hdx_package/ckanext/hdx_package/tests/test_metadata_fields.py
OCHA-DAP/hdx-ckan
58
18703
<gh_stars>10-100 ''' Created on May 16, 2014 @author: alexandru-m-g ''' import json import webtest import logging import ckan.plugins as p import ckan.lib.create_test_data as ctd import ckan.lib.search as search import ckan.model as model import ckan.logic as logic import ckan.lib.helpers as h import ckan.tests.le...
1.546875
2
inject.py
edouardpoitras/process_injection_example
4
18704
import sys import psutil from pyinjector import inject if len(sys.argv) != 3: print("Usage: python inject.py <process-name> <shared-library>") exit() _, process_name, shared_library = sys.argv for process in psutil.process_iter(): if process.name() == process_name: print(f"Found {process_name} - ...
2.640625
3
infer.py
yanivbl6/deep-griffinlim-iteration
0
18705
<gh_stars>0 # noinspection PyUnresolvedReferences ##import matlab.engine import os import shutil from argparse import ArgumentError, ArgumentParser from torch.utils.data import DataLoader from dataset import ComplexSpecDataset from hparams1 import hp from train import Trainer from pathlib import Path from os impor...
1.828125
2
Disc_train.py
avinsit123/kpgen_GAN
1
18706
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 1 15:10:45 2019 @author: r17935avinash """ ################################ IMPORT LIBRARIES ############################################################### import torch import numpy as np import pykp.io import torch.nn as nn from utils.statistics...
1.679688
2
VQ3D/camera_pose_estimation/get_median_intrinsics.py
emulhall/episodic-memory
27
18707
import os import sys import json import argparse import numpy as np sys.path.append('Camera_Intrinsics_API/') from get_camera_intrinsics import CameraIntrinsicsHelper if __name__=='__main__': parser = argparse.ArgumentParser() parser.add_argument( "--input_dir", type=str, default='dat...
2.59375
3
Dataset/Leetcode/valid/78/455.py
kkcookies99/UAST
0
18708
class Solution: def __init__(self): self.result = [] def XXX(self, nums): return self.helper(nums, 0, []) def helper(self, nums, index, temp): if index == len(nums): self.result.append(temp) return self.result.append(temp) for i in range(ind...
3.171875
3
IDS/IDS/urls.py
YashwantChauhan/SDL
2
18709
<gh_stars>1-10 """IDS URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') ...
2.40625
2
setup.py
preetmishra/nooz
7
18710
import codecs import os from setuptools import find_packages, setup def long_description(): if not (os.path.isfile('README.md') and os.access('README.md', os.R_OK)): return '' with codecs.open('README.md', encoding='utf8') as f: return f.read() linting_deps = [ 'mypy==0.761', 'pycod...
1.59375
2
deeplodocus/callbacks/saver.py
amelgrenier/deeplodocus
0
18711
from decimal import Decimal import torch from torch.nn import Module import os from deeplodocus.utils.notification import Notification from deeplodocus.utils.flags.save import * from deeplodocus.utils.flags.event import * from deeplodocus.utils.flags.notif import * from deeplodocus.utils.flags.ext import DEEP...
1.992188
2
mridc/collections/reconstruction/models/cascadenet/ccnn_block.py
jerke123/mridc
0
18712
<reponame>jerke123/mridc # coding=utf-8 __author__ = "<NAME>" import torch from mridc.collections.common.parts.fft import fft2c, ifft2c from mridc.collections.common.parts.utils import complex_conj, complex_mul class CascadeNetBlock(torch.nn.Module): """ Model block for CascadeNet & Convolution Recurrent Ne...
2.40625
2
main.py
BL-Lac149597870/drugVQA
0
18713
<filename>main.py ''' Author: QHGG Date: 2021-02-27 13:42:43 LastEditTime: 2021-03-01 23:26:38 LastEditors: QHGG Description: FilePath: /drugVQA/main.py ''' import torch from sklearn import metrics import warnings warnings.filterwarnings("ignore") torch.cuda.set_device(0) print('cuda size == 1') from trainAndTest impo...
2.234375
2
networkx/algorithms/tests/test_cuts.py
jebogaert/networkx
2
18714
<filename>networkx/algorithms/tests/test_cuts.py """Unit tests for the :mod:`networkx.algorithms.cuts` module.""" import networkx as nx class TestCutSize: """Unit tests for the :func:`~networkx.cut_size` function.""" def test_symmetric(self): """Tests that the cut size is symmetric.""" G = ...
3
3
src/utility.py
bbookman/demand
0
18715
<reponame>bbookman/demand import sys, re, pdb from bs4 import BeautifulSoup as beautiful from datetime import datetime import requests, logging import timeout_decorator, pandas as pd import socket, urllib3 def read_input_file(): #todo - what if argument is not there or invalid? print_and_log('Reading input fi...
3.46875
3
section_11_(api)/dicts_and_lists.py
hlcooll/python_lessons
425
18716
<filename>section_11_(api)/dicts_and_lists.py # Dictionaries and lists, together # Loading from https://raw.githubusercontent.com/shannonturner/education-compliance-reports/master/investigations.json investigations = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "t...
3.828125
4
stickers/__init__.py
secretisdead/stickers
0
18717
<gh_stars>0 import uuid import time import re from ipaddress import ip_address from enum import Enum from datetime import datetime, timezone from sqlalchemy import Table, Column, PrimaryKeyConstraint, LargeBinary as sqla_binary, Float from sqlalchemy import Integer, String, MetaData, distinct from sqlalchemy.dialects....
2.0625
2
include/MPE3.py
jhgalino/MPv2
0
18718
def differentiate(fxn: str) -> str: if fxn == "x": return "1" dividedFxn = getFirstLevel(fxn) coeffOrTrig: str = dividedFxn[0] exponent: str = dividedFxn[2] insideParentheses: str = dividedFxn[1] if coeffOrTrig.isalpha(): ans = computeTrig(coeffOrTrig, insideParentheses) ...
3.578125
4
obsolete_object_wise_scoring_ben.py
agk2000/catalyst_project
0
18719
<gh_stars>0 import sys from mrs_utils import misc_utils, vis_utils from mrs_utils import eval_utils import os from skimage import io import numpy as np import matplotlib.pyplot as plt # Creat object scorer class osc = eval_utils.ObjectScorer(min_th=0.5, link_r=20, eps=2) # Define the source data_dir = '/scratch/sr36...
2.265625
2
compare.py
dreamersnme/future
86
18720
<gh_stars>10-100 # --------------------------- IMPORT LIBRARIES ------------------------- import numpy as np import pandas as pd import matplotlib.pyplot as plt from datetime import datetime import data_preprocessing as dp from sklearn.preprocessing import MinMaxScaler import keras from keras.models import Sequential ...
2.203125
2
veinmind-backdoor/register.py
Jqqzzz/veinmind-tools
364
18721
class register: plugin_dict = {} plugin_name = [] @classmethod def register(cls, plugin_name): def wrapper(plugin): cls.plugin_dict[plugin_name] = plugin return plugin return wrapper
2.5625
3
Desafio horario atual/__init__.py
pinheirogus/Curso-Python-Udemy
1
18722
# num1 = input("Digite um número inteiro: ") # # # try: # # if num1.isnumeric() : # num1 = int(num1) # if (num1 % 2) == 0 : # print("Você digitou um número par.") # elif (num1 % 2) != 0: # print("Você digitou um número ímpar.") # else: # print("Voc...
4.15625
4
05/b_average.py
koshin117/python-learning
1
18723
#B def average(As :list) -> float: return float(sum(As)/len(As)) def main(): # input As = list(map(int, input().split())) # compute # output print(average(As)) if __name__ == '__main__': main()
3.71875
4
tests/test_js.py
tinachou28/dataIO-project
7
18724
<reponame>tinachou28/dataIO-project # !/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys import warnings import pytest from pytest import approx import os from os.path import join from datetime import datetime from dataIO import py23 from dataIO import js from dataIO import...
2.03125
2
remerkleable/complex.py
hwwhww/remerkleable
1
18725
from typing import NamedTuple, cast, List as PyList, Dict, Any, BinaryIO, Optional, TypeVar, Type, Protocol, \ runtime_checkable from types import GeneratorType from textwrap import indent from collections.abc import Sequence as ColSequence from itertools import chain import io from remerkleable.core import View, B...
2.171875
2
cave/com.raytheon.viz.gfe/python/autotest/RoutineLevel4_1_TestScript.py
srcarter3/awips2
0
18726
<filename>cave/com.raytheon.viz.gfe/python/autotest/RoutineLevel4_1_TestScript.py # # # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data...
1.734375
2
AutoPano/Phase2/Code/Test_files/TrainUnsup.py
akathpal/ComputerVision-CMSC733
1
18727
<gh_stars>1-10 #!/usr/bin/env python """ CMSC733 Spring 2019: Classical and Deep Learning Approaches for Geometric Computer Vision Project 1: MyAutoPano: Phase 2 Starter Code Author(s): <NAME> (<EMAIL>) PhD Candidate in Computer Science, University of Maryland, College Park Abhishek Kathpal University of Maryland,C...
2.28125
2
Lista 2/Exercicio 14.py
GiovannaPazello/Projetos-em-Python
0
18728
'''Faça um programa que gere números aleatórios entre 0 e 50 até o número 32 ser gerado. Quando isso ocorrer, informar: a. A soma de todos os números gerados b. A quantidade de números gerados que é impar c. O menor número gerado''' import random x = random.randint(0,50) cont = 32 somaNumeros = 0 qqntImpares = 0 meno...
3.984375
4
mavsim_python/chap4/wind_simulation.py
eyler94/mavsim_template_files
0
18729
<gh_stars>0 """ Class to determine wind velocity at any given moment, calculates a steady wind speed and uses a stochastic process to represent wind gusts. (Follows section 4.4 in uav book) """ import sys sys.path.append('..') import numpy as np class wind_simulation: def __init__(self, Ts): # steady state...
3.515625
4
dx/geometric_brownian_motion.py
yehuihe/dx
0
18730
<reponame>yehuihe/dx """Simulation Class -- Geometric Brownian Motion """ # Author: <NAME> <<EMAIL>> # License: Apache-2.0 License import numpy as np from .sn_random_numbers import sn_random_numbers from .simulation_class import SimulationClass class GeometricBrownianMotion(SimulationClass): """Class to genera...
3.203125
3
yibai-sms-python-sdk-1.0.0/yibai/api/Yibai.py
100sms/yibai-python-sdk
0
18731
# encoding=utf8 import HttpUtils class YibaiApiError(Exception): def __init__(self, code, message): super(YibaiApiError, self).__init__(message) self.code = code class YibaiClient(object): def __init__(self, server_url, apikey): self.serverUrl = server_url self...
2.0625
2
setup.py
nattster/lettuce_webdriver
24
18732
<filename>setup.py __version__ = '0.3.5' import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() setup(name='lettuce_webdriver', version=__version__, ...
1.359375
1
project4/network/migrations/0005_remove_post_likers.py
mjs375/cs50_Network
0
18733
# Generated by Django 3.1.3 on 2020-11-15 16:01 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('network', '0004_auto_20201111_2224'), ] operations = [ migrations.RemoveField( model_name='post', name='likers', ), ...
1.367188
1
Commands/interested.py
hanss314/TheBrainOfTWOWCentral
0
18734
from Config._const import PREFIX HELP = { "COOLDOWN": 3, "MAIN": "Toggles whether or not you have the `Interested in the Bot` role", "FORMAT": "", "CHANNEL": 0, "USAGE": f"""Using `{PREFIX}interested` will add the `Interested in the Bot` to you, or remove it if you already have it.""".replace("\n", "").replace(...
2.71875
3
gen_newsletter.py
pnijjar/google-calendar-rss
1
18735
#!/usr/bin/env python3 from gcal_helpers import helpers helpers.write_transformation("newsletter")
1.3125
1
qiskit/pulse/instructions/delay.py
gadial/qiskit-terra
1
18736
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
3.390625
3
users/urls.py
mahmutcankurt/DjangoBlogSite
3
18737
<gh_stars>1-10 from django.conf.urls import url from .views import signupView, activate, account_activation_sent, user_login, user_logout, user_edit_profile, user_change_password urlpatterns = [ url(r'^register/$', signupView, name='register'), url(r'^account_activation_sent/$', account_activation_sent, name='...
1.609375
2
mosasaurus/chromaticlc/mptest.py
zkbt/mosasaurus
2
18738
<reponame>zkbt/mosasaurus import TransmissionSpectrum import multiprocessing obs = 'wasp94_140805.obs' ncpu = multiprocessing.cpu_count() def fastfit(i): t = TransmissionSpectrum.TransmissionSpectrum(obs) t.speak('starting fit for bin {0}'.format(i)) t.bins[i].fit(plot=False, slow=False, interactive=False,...
2.296875
2
semeval_filter.py
krzysztoffiok/twitter_sentiment_to_usnavy
2
18739
<reponame>krzysztoffiok/twitter_sentiment_to_usnavy<gh_stars>1-10 import pandas as pd import numpy as np import datatable as dt import re """ Basic pre-processing of Twitter text from SemEval2017 data set. """ # replace repeating characters so that only 2 repeats remain def repoo(x): repeat_regexp = re.compile(r'...
3
3
tutorials/rhythm/plot_SlidingWindowMatching.py
bcmartinb/neurodsp
154
18740
""" Sliding Window Matching ======================= Find recurring patterns in neural signals using Sliding Window Matching. This tutorial primarily covers the :func:`~.sliding_window_matching` function. """ ################################################################################################### # Overvie...
3.265625
3
forge/auth/backends.py
django-forge/forge
3
18741
<reponame>django-forge/forge from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend UserModel = get_user_model() class EmailModelBackend(ModelBackend): def authenticate(self, request, username=None, password=<PASSWORD>, **kwargs): if username is None: ...
2.75
3
Macro/WorkFeature/Utils/WF_curve.py
myao9494/FreeCAD_Factory
0
18742
<reponame>myao9494/FreeCAD_Factory<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Tue Mar 1 06:59:10 2016 @author: laurent """ from __future__ import division from math import factorial # Pascal's triangle p_t = [ [1], # n=0 [1,1], # n=1 [1,2,1], # n=2 ...
3.21875
3
LeetCode/z_arrange.py
Max-PJB/python-learning2
0
18743
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ------------------------------------------------- @ Author : pengj @ date : 2018/11/1 19:03 @ IDE : PyCharm @ GitHub : https://github.com/JackyPJB @ Contact : <EMAIL> ---------------------------------...
3.609375
4
old/INSTADOWNLOAD.py
Nibba2018/INSTADOWNLOAD
1
18744
<gh_stars>1-10 import sys from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import QApplication,QDialog from PyQt5.uic import loadUi import requests import urllib.request from selenium import webdriver class INSTADOWNLOAD(QDialog): def __init__(self): super(INSTADOWNLOAD,self).__init__() ...
2.546875
3
ved/migrations/0010_auto_20180303_1353.py
mjovanc/tidlundsved
1
18745
# Generated by Django 2.0.2 on 2018-03-03 13:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ved', '0009_auto_20180302_1839'), ] operations = [ migrations.AlterField( model_name='order', name='firewood_choice'...
1.65625
2
examples/plot_kde_2d.py
awesome-archive/arviz
2
18746
<filename>examples/plot_kde_2d.py<gh_stars>1-10 """ 2d KDE ====== _thumb: .1, .8 """ import arviz as az import numpy as np az.style.use('arviz-darkgrid') az.plot_kde(np.random.rand(100), np.random.rand(100))
2.21875
2
debug/read_depth_from_exr_file.py
ccj5351/hmr_rgbd
0
18747
<gh_stars>0 # !/usr/bin/env python3 # -*-coding:utf-8-*- # @file: read_depth_from_exr_file.py # @brief: # @author: <NAME>, <EMAIL>, <EMAIL> # @version: 0.0.1 # @creation date: 10-06-2019 # @last modified: Mon 10 Jun 2019 06:18:44 PM EDT import cv2 dep = cv2.imread("0.exr",-1) # "-1" means any depth or channel;
1.929688
2
azplugins/test-py/test_analyze_group_velocity.py
mphoward/azplugins
10
18748
<filename>azplugins/test-py/test_analyze_group_velocity.py # Copyright (c) 2018-2020, <NAME> # Copyright (c) 2021-2022, Auburn University # This file is part of the azplugins project, released under the Modified BSD License. import hoomd from hoomd import md hoomd.context.initialize() try: from hoomd import azplug...
2.125
2
tests/test_settings.py
jpadilla/apistar
1
18749
from apistar import App, Route, TestClient from apistar.settings import Setting, Settings def get_settings(settings: Settings): return settings def get_setting(ABC: Setting): return {'ABC': ABC} routes = [ Route('/settings/', 'GET', get_settings), Route('/setting/', 'GET', get_setting), ] setting...
2.59375
3
api/views/reminder_views.py
OlegKlimenko/Plamber
13
18750
# -*- coding: utf-8 -*- from django.shortcuts import get_object_or_404 from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from ..serializers.request_serializers import GetReminderRequest, UpdateReminderRequest from ..utils import invalid_data...
2.140625
2
anaf/documents/migrations/0001_initial.py
tovmeod/anaf
2
18751
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import anaf.documents.models import anaf.documents.files class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ] operations = [ migrations.CreateModel( ...
1.84375
2
mbpo/models/utils.py
anyboby/ConstrainedMBPO
5
18752
from __future__ import division from __future__ import print_function from __future__ import absolute_import import tensorflow as tf import numpy as np EPS = 1e-10 def get_required_argument(dotmap, key, message, default=None): val = dotmap.get(key, default) if val is default: raise ValueError(message)...
2.515625
3
ext/generate-models.py
gerhardtdatsomor/pytest-nunit
0
18753
<gh_stars>0 """ A script for generating attrs-models from an XSD. Built especially for this model. But feel-free to reuse elsewhere. Licensed under MIT. Written by <NAME>. """ import logging import xmlschema import xmlschema.qnames try: import black import click except ImportError: print("Install black...
2.375
2
OrderService/Order/migrations/0003_order_payment_details.py
surajkendhey/Kart
0
18754
# Generated by Django 3.1.2 on 2020-10-18 09:41 from django.db import migrations import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('Order', '0002_auto_20201018_1503'), ] operations = [ migrations.AddField( model_name='order', name='...
1.554688
2
src/deepproblog/examples/Forth/Sort/sort.py
vossenwout/gtadeepproblog
54
18755
<reponame>vossenwout/gtadeepproblog import torch from deepproblog.dataset import DataLoader, QueryDataset from deepproblog.engines import ExactEngine from deepproblog.evaluate import get_confusion_matrix from deepproblog.examples.Forth import EncodeModule from deepproblog.model import Model from deepproblog.network im...
2.21875
2
adapters/base_adapter.py
juangallostra/moonboard
0
18756
from models.problem import Problem class BaseProblemAdapter(): """ Map problem data to a Python object that the renderer can use. """ def map_problem(self, problem_data) -> Problem: """ Given the raw data of a problem, convert it to a Problem object and return it. :pa...
3.09375
3
meteo_inversion_matrix.py
yandex-research/classification-measures
6
18757
<filename>meteo_inversion_matrix.py from glob import glob from collections import defaultdict, Counter import sys import math import numpy as np import random random.seed(42) EPS = 1e-5 if len(sys.argv)<2 or sys.argv[1] not in ('10m', '2h'): use_fcs = list(range(12)) elif sys.argv[1] == '10m': use_fcs = (0,)...
2.15625
2
terrain_following/src/image_processor.py
ZhiangChen/ros_vision
0
18758
#!/usr/bin/env python """ <NAME> Nov 2019 """ import rospy from sensor_msgs.msg import Image from sensor_msgs.msg import Imu from cv_bridge import CvBridge, CvBridgeError import numpy as np import cv2 class Image_Processor(object): def __init__(self): rospy.Subscriber("/r200/depth/image_raw", Image, self....
2.6875
3
lab_4/start.py
AnastasiaZheleznyakova/2020-2-level-labs
0
18759
<gh_stars>0 if __name__ == '__main__': pass RESULT = 1 # DO NOT REMOVE NEXT LINE - KEEP IT INTENTIONALLY LAST assert RESULT == 1, ''
1.179688
1
testtarget.py
epopisces/template_api_wrapper
0
18760
class ToolNameAPI: thing = 'thing' toolname_tool = 'example' tln = ToolNameAPI() the_repo = "reponame" author = "authorname" profile = "authorprofile"
1.601563
2
learning/__init__.py
aleisalem/Maat
4
18761
__all__ = ["feature_extraction", "hmm_learner", "scikit_learners", "string_kernel"]
1.023438
1
Metrics/reporter.py
augdomingues/SPEX
0
18762
from os.path import join from math import ceil import numpy as np import seaborn as sns import matplotlib.pyplot as plt plt.rcParams["font.size"] = 14 plt.rcParams["figure.figsize"] = [15, 8] class reporter: def __init__(self, name, folder, counts, interactive=True): plt.subplot(221) plt.title(...
2.21875
2
contrib/translate_test.py
csilvers/kake
0
18763
"""Tests the translate_* files.""" from __future__ import absolute_import import cPickle import os import shutil from shared.testutil import testsize from third_party import polib from kake import compile_all_pot from kake import compile_small_mo from kake import translate_handlebars from kake import translate_java...
2.109375
2
backend/backend/urls.py
lucasrafaldini/SpaceXLaunches
1
18764
from django.conf.urls import url from django.urls import include urlpatterns = [url("api/", include("api.urls"))]
1.5625
2
primitives_ubc/regCCFS/__init__.py
tonyjo/ubc_primitives
0
18765
from .ccfsReg import CanonicalCorrelationForestsRegressionPrimitive __all__ = ['CanonicalCorrelationForestsRegressionPrimitive'] from pkgutil import extend_path __path__ = extend_path(__path__, __name__) # type: ignore
1.132813
1
bprof/profile.py
joelfrederico/bprof
0
18766
class BaseFunction: def __init__(self, name, n_calls, internal_ns): self._name = name self._n_calls = n_calls self._internal_ns = internal_ns @property def name(self): return self._name @property def n_calls(self): return self._n_calls @property def...
3.421875
3
src/compas/numerical/dr/dr_numpy.py
arpastrana/compas
0
18767
from __future__ import absolute_import from __future__ import division from __future__ import print_function from numpy import array from numpy import isnan from numpy import isinf from numpy import ones from numpy import zeros from scipy.linalg import norm from scipy.sparse import diags from compas.numerical import ...
2.21875
2
getColorFromNumber.py
clean-code-craft-tcq-1/modular-python-preetikadyan
0
18768
from main import * def get_color_from_pair_number(pair_number): zero_based_pair_number = pair_number - 1 major_index = zero_based_pair_number // len(MINOR_COLORS) if major_index >= len(MAJOR_COLORS): raise Exception('Major index out of range') minor_index = zero_based_pair_number % len(MINOR_COLORS) if mi...
3.34375
3
raspy/io/pwm_channel.py
cyrusbuilt/RasPy
0
18769
<gh_stars>0 """The PWM channel to use.""" CHANNEL0 = 0 """Channel zero.""" CHANNEL1 = 1 """Channel one."""
1.132813
1
xls/dslx/interpreter/concrete_type_helpers.py
hafixo/xls
0
18770
# Lint as: python3 # # Copyright 2020 The XLS 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 required by applicable law...
2.171875
2
ABC/131/a.py
fumiyanll23/AtCoder
0
18771
<filename>ABC/131/a.py S = str(input()) if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]: print("Bad") else: print("Good")
3.609375
4
model_neu/optimized/hyperutils.py
lelange/cu-ssp
0
18772
<gh_stars>0 from bson import json_util import json import os import numpy as np import tensorflow as tf from keras.layers.core import K #import keras.backend as K import time import pandas as pd import multiprocessing # from keras.preprocessing import text, sequence from keras.preprocessing.text import Tokenizer from ...
2.15625
2
spark_application/transformations/__init__.py
ketanvatsalya/pyspark_project_template
0
18773
<reponame>ketanvatsalya/pyspark_project_template """ Package to hold the Transformation Classes """ from . import base from . import spend_per_department
1.03125
1
test_service.py
jgawrilo/qcr_ci
1
18774
<filename>test_service.py import requests import json headers = {'Content-Type': 'application/json'} data = json.load(open("./test_input2.json")) url = "http://localhost:5001/api/impact" response = requests.post(url,data=json.dumps({"data":data}),headers=headers) print json.dumps(response.json(),indent=2)
3.109375
3
PSBChart_support.py
georgepruitt/PSBChart
1
18775
<reponame>georgepruitt/PSBChart<filename>PSBChart_support.py #! /usr/bin/env python # # Support module generated by PAGE version 4.10 # In conjunction with Tcl version 8.6 # Jan 12, 2018 04:09:34 PM import turtle from turtle import TurtleScreen, RawTurtle, TK from tkinter.filedialog import askopenfilename ...
2.390625
2
test/low_use_test/test_reporter.py
KeithWhitley/LUAU
1
18776
<gh_stars>1-10 import unittest import boto3 from moto import mock_dynamodb2, mock_ec2 from low_use.reporter import LowUseReporter from util.aws import EC2Wrapper, DynamoWrapper import os class TestLowUseReporter(unittest.TestCase): @mock_dynamodb2 @mock_ec2 def setUp(self): self.session = boto3.Se...
2.125
2
splot/tests/test_viz_libpysal_mpl.py
renanxcortes/splot
0
18777
from libpysal.weights.contiguity import Queen import libpysal from libpysal import examples import matplotlib.pyplot as plt import geopandas as gpd from splot.libpysal import plot_spatial_weights def test_plot_spatial_weights(): # get data gdf = gpd.read_file(examples.get_path('43MUE250GC_SIR.shp')) gdf.h...
2.78125
3
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/tests/test_ir.py
BadDevCode/lumberyard
1,738
18778
<reponame>BadDevCode/lumberyard from __future__ import print_function import numba.unittest_support as unittest from numba import compiler, ir, objmode import numpy as np class TestIR(unittest.TestCase): def test_IRScope(self): filename = "<?>" top = ir.Scope(parent=None, loc=ir.Loc(filename=fil...
2.578125
3
pyannote/audio/applications/base.py
Ruslanmlnkv/pyannote-audio
2
18779
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2017 CNRS # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation ...
1.5
2
cogs/games/checkers.py
itsVale/Vale.py
14
18780
<filename>cogs/games/checkers.py import itertools import random import re import discord from more_itertools import chunked, pairwise, sliced, spy from .base import Status, TwoPlayerGameCog, TwoPlayerSession from utils.misc import emoji_url BLACK, WHITE = False, True PIECES = BK_PIECE, WH_PIECE = 'bw' KINGS = BK_KI...
2.609375
3
setup.py
Fohlen/yente
0
18781
from setuptools import setup, find_packages with open("README.md") as f: long_description = f.read() setup( name="yente", version="1.3.5", url="https://opensanctions.org/docs/api/", long_description=long_description, long_description_content_type="text/markdown", license="MIT", author...
1.40625
1
python-pulseaudio-master/setup.py
rrbutani/SoundAndColor
0
18782
<gh_stars>0 #!/usr/bin/env python from distutils.core import setup setup(name='libpulseaudio', version='1.1', description='simple libpulseaudio bindings', author='Valodim', author_email='<EMAIL>', license='LGPL', url='http://github.com/valodim/python-pulseaudio', packages=['p...
1.15625
1
vectorization.py
creadal/articles-classifier
0
18783
<reponame>creadal/articles-classifier<filename>vectorization.py import codecs import numpy as np import random categories = ['science', 'style', 'culture', 'life', 'economics', 'business', 'travel', 'forces', 'media', 'sport'] dict_file = codecs.open('processed/dictionary.txt', 'r', 'utf_8_sig') dictionary = [] for ...
2.78125
3
data/spca/preprocess.py
energydatalab/mrs
0
18784
# Built-in import os from glob import glob # Libs import numpy as np from tqdm import tqdm from natsort import natsorted # Own modules from data import data_utils from mrs_utils import misc_utils, process_block # Settings DS_NAME = 'spca' def get_images(data_dir, valid_percent=0.5, split=False): rgb_files = na...
2.078125
2
tests/test_json_util.py
okutane/yandex-taxi-testsuite
128
18785
import dateutil import pytest from testsuite.plugins import mockserver from testsuite.utils import json_util NOW = dateutil.parser.parse('2019-09-19-13:04:00.000000') MOCKSERVER_INFO = mockserver.MockserverInfo( 'localhost', 123, 'http://localhost:123/', None, ) MOCKSERVER_SSL_INFO = mockserver.MockserverInfo( ...
2.390625
2
Level/__init__.py
PyRectangle/GreyRectangle
3
18786
from Level.Render import Render from Level.Data import Data from Constants import * import os class Level: def __init__(self, folder, main): self.main = main self.name = folder self.folder = LEVEL_PATH + "/" + folder self.dataFiles = [] files = os.listdir(self.folder) ...
2.71875
3
preparedstatement.py
shgysk8zer0/pyutils
0
18787
import sqlite3 class PreparedStatement: __cursor = None __sql = '' __params = {} def __init__(self, con: sqlite3.Connection, sql: str): self.__cursor = con.cursor() self.__sql = sql self.__params = {} def __str__(self) -> str: return self.__sql def __getitem__(...
3.1875
3
python/communitymanager/lib/basicauthpolicy.py
OpenCIOC/communityrepo
2
18788
<reponame>OpenCIOC/communityrepo<gh_stars>1-10 # From the Pyramid Cookbook: # http://pyramid-cookbook.readthedocs.org/en/latest/auth/basic.html import binascii import base64 from paste.httpheaders import AUTHORIZATION from paste.httpheaders import WWW_AUTHENTICATE from pyramid.security import Everyone from pyramid.s...
2.546875
3
eventsourcing/examples/searchabletimestamps/postgres.py
ParikhKadam/eventsourcing
107
18789
<reponame>ParikhKadam/eventsourcing from datetime import datetime from typing import Any, List, Optional, Sequence, Tuple, cast from uuid import UUID from eventsourcing.domain import Aggregate from eventsourcing.examples.searchabletimestamps.persistence import ( SearchableTimestampsRecorder, ) from eventsourcing.p...
2.46875
2
complete/01 - 10/Problem6/main.py
this-jacob/project-euler
0
18790
def main(): squareSum = 0 #(1 + 2)^2 square of the sums sumSquare = 0 #1^2 + 2^2 sum of the squares for i in range(1, 101): sumSquare += i ** 2 squareSum += i squareSum = squareSum ** 2 print(str(squareSum - sumSquare)) if __name__ == '__main__': main()
3.53125
4
Sudoko.py
abirbhattacharya82/Sudoko-Solver
1
18791
<filename>Sudoko.py def find_space(board): for i in range(0,9): for j in range(0,9): if board[i][j]==0: return (i,j) return None def check(board,num,r,c): for i in range(0,9): if board[r][i]==num and c!=i: return False for i in range(0,9)...
3.953125
4
gbkfit_web/utility/display_names.py
ADACS-Australia/ADACS-GBKFIT
0
18792
<filename>gbkfit_web/utility/display_names.py """ Distributed under the MIT License. See LICENSE.txt for more info. """ # VARIABLES of this file must be unique from django_hpc_job_controller.client.scheduler.status import JobStatus # Dictionary to map names and corresponding display names (for UI) DISPLAY_NAME_MAP =...
2.125
2
heap/heap.py
xyycha/data-struct
4
18793
<reponame>xyycha/data-struct<filename>heap/heap.py # -*- encoding: utf-8 -*- import random from graphviz import Digraph class HeapNode(object): def __init__(self, value, info): self.value = value self.info = info class Heap(object): def __init__(self, cap): self.cap = cap se...
3.03125
3
python/federatedml/param/encrypted_mode_calculation_param.py
QuantumA/FATE
1
18794
<reponame>QuantumA/FATE #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE Authors. All Rights Reserved. # # 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 # # h...
2.265625
2
optimization/solution.py
silx-kit/silx-training
7
18795
"""Solution of the exercises of Optimization of compute bound Python code""" import math import cmath import numpy as np import numexpr as ne import numba as nb # Needed here since it is used as global variables # Maximum strain at surface e0 = 0.01 # Width of the strain profile below the surface w = 5.0 # Python: C...
2.890625
3
examples/SSTDemoWeightedClauses_Interpret.py
jivitesh-sharma/Drop-Clause-Interpretable-TM
0
18796
<reponame>jivitesh-sharma/Drop-Clause-Interpretable-TM import re import string import nltk from nltk.tokenize import word_tokenize from string import punctuation from nltk.corpus import stopwords nltk.download('punkt') nltk.download('stopwords') import pandas as pd from nltk.stem import PorterStemmer from ...
2.703125
3
adbc/zql/builders/core.py
aleontiev/apg
2
18797
<filename>adbc/zql/builders/core.py from adbc.zql.validator import Validator class Builder(Validator): INDENT = 4 IDENTIFIER_SPLIT_CHARACTER = '.' WHITESPACE_CHARACTER = ' ' WILDCARD_CHARACTER = '*' QUOTE_CHARACTERS = {'"', "'", '`'} RAW_QUOTE_CHARACTER = '`' COMMANDS = { 'select',...
2.359375
2
setup.py
InTheMorning/python-bme280
0
18798
from setuptools import setup setup(name='bme280', version='1.0.0', packages=['bme280'], install_requires=['smbus2'], python_requires='>=2.7', url='https://dev.mycrobase.de/gitea/cn/python-bme280', author='<NAME>', description='A python library for accessing the BME280 combin...
1.289063
1
List/learnlist.py
shahasifbashir/LearnPython
0
18799
# A simple list myList = [10,20,4,5,6,2,9,10,2,3,34,14] #print the whole list print("The List is {}".format(myList)) # printing elemts of the list one by one print("printing elemts of the list one by one") for elements in myList: print(elements) print("") #printing elements that are greater than 10 only prin...
4.25
4