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
OLD/karma_module/text.py
alentoghostflame/StupidAlentoBot
1
8800
<gh_stars>1-10 ADDED_KARMA_TO_MEMBER = "Gave {} karma to {}, their karma is now at {}." REMOVED_KARMA_FROM_MEMBER = "Removed {} karma from {}, their karma is now at {}." LIST_KARMA_OWN = "You currently have {} karma." LIST_KARMA_OBJECT = "\"{}\" currently has {} karma." LIST_KARMA_MEMBER = "{} currently has {} karma."...
1.289063
1
read_delphin_data.py
anssilaukkarinen/mry-cluster2
0
8801
<filename>read_delphin_data.py # -*- coding: utf-8 -*- """ Created on Mon Dec 6 14:51:24 2021 @author: laukkara This script is run first to fetch results data from university's network drive """ import os import pickle input_folder_for_Delphin_data = r'S:\91202_Rakfys_Mallinnus\RAMI\simulations' output_folder = ...
2.671875
3
api/config.py
sumesh-aot/namex
1
8802
"""Config for initializing the namex-api.""" import os from dotenv import find_dotenv, load_dotenv # this will load all the envars from a .env file located in the project root (api) load_dotenv(find_dotenv()) CONFIGURATION = { 'development': 'config.DevConfig', 'testing': 'config.TestConfig', 'production...
2.4375
2
examples/pylab_examples/fancybox_demo2.py
pierre-haessig/matplotlib
16
8803
<reponame>pierre-haessig/matplotlib<gh_stars>10-100 import matplotlib.patches as mpatch import matplotlib.pyplot as plt styles = mpatch.BoxStyle.get_styles() figheight = (len(styles)+.5) fig1 = plt.figure(1, (4/1.5, figheight/1.5)) fontsize = 0.3 * 72 for i, (stylename, styleclass) in enumerate(styles.items()): ...
2.5
2
setup.py
sdu-cfei/modest-py
37
8804
from setuptools import setup setup( name='modestpy', version='0.1', description='FMI-compliant model identification package', url='https://github.com/sdu-cfei/modest-py', keywords='fmi fmu optimization model identification estimation', author='<NAME>, Center for Energy Informatics SDU', aut...
1.125
1
gfworkflow/core.py
andersonbrands/gfworkflow
0
8805
<reponame>andersonbrands/gfworkflow import re import subprocess as sp from typing import Union, List from gfworkflow.exceptions import RunCommandException def run(command: Union[str, List[str]]): completed_process = sp.run(command, stdout=sp.PIPE, stderr=sp.PIPE, universal_newlines=True) if completed_process...
2.125
2
tests/integration/lambdas/lambda_python3.py
jorges119/localstack
31,928
8806
<reponame>jorges119/localstack # simple test function that uses python 3 features (e.g., f-strings) # see https://github.com/localstack/localstack/issues/264 def handler(event, context): # the following line is Python 3.6+ specific msg = f"Successfully processed {event}" # noqa This code is Python 3.6+ only ...
1.820313
2
import_off.py
etiennody/purchoice
0
8807
<reponame>etiennody/purchoice<gh_stars>0 #! usr/bin/python3 # code: utf-8 """Download data from Open Food Facts API.""" import json import requests from src.purchoice.constants import CATEGORY_SELECTED from src.purchoice.purchoice_database import PurchoiceDatabase class ImportOff: """ImportOff class downloads...
2.96875
3
orio/module/loop/cfg.py
zhjp0/Orio
0
8808
''' Created on April 26, 2015 @author: norris ''' import ast, sys, os, traceback from orio.main.util.globals import * from orio.tool.graphlib import graph from orio.module.loop import astvisitors class CFGVertex(graph.Vertex): '''A CFG vertex is a basic block.''' def __init__(self, name, node=None): t...
2.828125
3
cogs rework/server specified/on_message_delete.py
lubnc4261/House-Keeper
0
8809
import discord from discord import Embed @commands.Cog.listener() async def on_message_delete(self, message): channel = "xxxxxxxxxxxxxxxxxxxxx" deleted = Embed( description=f"Message deleted in {message.channel.mention}", color=0x4040EC ).set_author(name=message.author, url=Embed.Empty,...
2.609375
3
test/modules/md/md_env.py
icing/mod_md
320
8810
import copy import inspect import json import logging import pytest import re import os import shutil import subprocess import time from datetime import datetime, timedelta from configparser import ConfigParser, ExtendedInterpolation from typing import Dict, List, Optional from pyhttpd.certs import CertificateSpec f...
2.140625
2
models/create_message_response.py
ajrice6713/bw-messaging-emulator
0
8811
<reponame>ajrice6713/bw-messaging-emulator import datetime import json import random import string from typing import Dict from sms_counter import SMSCounter class CreateMessageResponse: def __init__(self, request): self.id = self.generate_id() self.owner = request['from'] self.applicati...
2.59375
3
python/ccxt/async_support/uex.py
victor95pc/ccxt
1
8812
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange # ----------------------------------------------------------------------------- try...
1.5625
2
Alpha & Beta/wootMath/decimalToBinaryFraction.py
Mdlkxzmcp/various_python
0
8813
def decimal_to_binary_fraction(x=0.5): """ Input: x, a float between 0 and 1 Returns binary representation of x """ p = 0 while ((2 ** p) * x) % 1 != 0: # print('Remainder = ' + str((2**p)*x - int((2**p)*x))) p += 1 num = int(x * (2 ** p)) result = '' if num == 0: ...
4.03125
4
composer/utils/run_directory.py
ajaysaini725/composer
0
8814
<reponame>ajaysaini725/composer # Copyright 2021 MosaicML. All Rights Reserved. import datetime import logging import os import pathlib import time from composer.utils import dist log = logging.getLogger(__name__) _RUN_DIRECTORY_KEY = "COMPOSER_RUN_DIRECTORY" _start_time_str = datetime.datetime.now().isoformat() ...
2.34375
2
newsapp/migrations/0003_news.py
adi112100/newsapp
0
8815
# Generated by Django 3.0.8 on 2020-07-11 08:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('newsapp', '0002_auto_20200711_1124'), ] operations = [ migrations.CreateModel( name='News', fields=[ ...
1.757813
2
src/enum/__init__.py
NazarioJL/faker_enum
5
8816
# -*- coding: utf-8 -*- from enum import Enum from typing import TypeVar, Type, List, Iterable, cast from faker.providers import BaseProvider TEnum = TypeVar("TEnum", bound=Enum) class EnumProvider(BaseProvider): """ A Provider for enums. """ def enum(self, enum_cls: Type[TEnum]) -> TEnum: ...
2.96875
3
tests/performance/bottle/simple_server.py
Varriount/sanic
4,959
8817
# Run with: gunicorn --workers=1 --worker-class=meinheld.gmeinheld.MeinheldWorker -b :8000 simple_server:app import bottle import ujson from bottle import route, run @route("/") def index(): return ujson.dumps({"test": True}) app = bottle.default_app()
1.742188
2
usuarios/views.py
alvarocneto/alura_django
1
8818
<filename>usuarios/views.py from django.shortcuts import redirect from django.shortcuts import render from django.contrib.auth.models import User from django.views.generic.base import View from perfis.models import Perfil from usuarios.forms import RegistrarUsuarioForm class RegistrarUsuarioView(View): template_...
2.09375
2
antolib/AntoCommon.py
srsuper/BOT2020
1
8819
ANTO_VER = '0.1.2'
1.1875
1
cpc_fusion/pkgs/keys/main.py
CPChain/fusion
5
8820
from typing import (Any, Union, Type) # noqa: F401 from ..keys.datatypes import ( LazyBackend, PublicKey, PrivateKey, Signature, ) from eth_keys.exceptions import ( ValidationError, ) from eth_keys.validation import ( validate_message_hash, ) # These must be aliased due to a scoping issue in...
2.421875
2
qiskit/pulse/transforms/canonicalization.py
gadial/qiskit-terra
1
8821
<reponame>gadial/qiskit-terra # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # 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 ...
2.171875
2
tests/test_scraper.py
ananelson/oacensus
0
8822
from oacensus.scraper import Scraper from oacensus.commands import defaults class TestScraper(Scraper): """ Scraper for testing scraper methods. """ aliases = ['testscraper'] def scrape(self): pass def process(self): pass def test_hashcode(): scraper = Scraper.create_inst...
2.59375
3
python/test-deco-1-1.py
li-ma/homework
0
8823
def deco1(func): print("before myfunc() called.") func() print("after myfunc() called.") def myfunc(): print("myfunc() called.") deco1(myfunc)
2.59375
3
lib/jnpr/junos/transport/tty_netconf.py
mmoucka/py-junos-eznc
0
8824
<reponame>mmoucka/py-junos-eznc import re import time from lxml import etree import select import socket import logging import sys from lxml.builder import E from lxml.etree import XMLSyntaxError from datetime import datetime, timedelta from ncclient.operations.rpc import RPCReply, RPCError from ncclient.xml_ import t...
2.140625
2
test/_test_client.py
eydam-prototyping/mp_modbus
2
8825
from pymodbus.client.sync import ModbusTcpClient as ModbusClient import logging FORMAT = ('%(asctime)-15s %(threadName)-15s ' '%(levelname)-8s %(module)-15s:%(lineno)-8s %(message)s') logging.basicConfig(format=FORMAT) log = logging.getLogger() log.setLevel(logging.DEBUG) client = ModbusClient('192.168.178.61...
2.140625
2
tests/selenium/test_about/test_about_page.py
technolotrix/tests
0
8826
import unittest from selenium import webdriver import page class AboutPage(unittest.TestCase): def setUp(self): self.driver = webdriver.Firefox() self.driver.get("http://nicolesmith.nyc") #self.driver.get("http://127.0.0.1:4747/about") self.about_page = page.AboutPage(self.driver) ...
3.15625
3
sdk/python/lib/test/langhost/future_input/__main__.py
pcen/pulumi
12,004
8827
# Copyright 2016-2018, Pulumi Corporation. # # 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 t...
2.6875
3
src/dewloosh/geom/cells/h8.py
dewloosh/dewloosh-geom
2
8828
<filename>src/dewloosh/geom/cells/h8.py # -*- coding: utf-8 -*- from dewloosh.geom.polyhedron import HexaHedron from dewloosh.math.numint import GaussPoints as Gauss from dewloosh.geom.utils import cells_coords from numba import njit, prange import numpy as np from numpy import ndarray __cache = True @njit(nogil=True...
2.1875
2
shopping_cart_test/shoppingcart2.py
Simbadeveloper/studious-octo-waddle.io
0
8829
<reponame>Simbadeveloper/studious-octo-waddle.io class ShoppingCart(object): def __init__(self): self.total = 0 self.items = dict() def add_item(self, item_name, quantity, price): if item_name != None and quantity >= 1: self.items.update({item_name: quantity}) if quantity and price >= 1: ...
3.71875
4
tests/models/pr_test_data.py
heaven00/github-contribution-leaderboard
0
8830
import copy import json from ghcl.models.pull_request import PullRequest class PRData: def __init__(self, data: dict = None): if data is None: with open('./tests/models/empty_pr_data.json') as file: self._data = json.load(file) else: self._data = data ...
2.671875
3
Validation/EventGenerator/python/BasicGenParticleValidation_cfi.py
PKUfudawei/cmssw
2
8831
<gh_stars>1-10 import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer basicGenParticleValidation = DQMEDAnalyzer('BasicGenParticleValidation', hepmcCollection = cms.InputTag("generatorSmeared"), genparticleCollection = cms.InputTag("genParticles",""), genjetsColle...
1.414063
1
k_values_graph.py
leobouts/Skyline_top_k_queries
0
8832
<filename>k_values_graph.py from a_top_k import * from b_top_k import * import time def main(): # test the generator for the top-k input # starting time values_k = [1, 2, 5, 10, 20, 50, 100] times_topk_join_a = [] times_topk_join_b = [] number_of_valid_lines_a = [] number_of_valid_lines_...
2.96875
3
AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_methodattrs.py
CEOALT1/RefindPlusUDK
2,757
8833
<reponame>CEOALT1/RefindPlusUDK<gh_stars>1000+ """Fix bound method attributes (method.im_? -> method.__?__). """ # Author: <NAME> # Local imports from .. import fixer_base from ..fixer_util import Name MAP = { "im_func" : "__func__", "im_self" : "__self__", "im_class" : "__self__.__class__" ...
2
2
models/TextCNN/cnn2d.py
Renovamen/Text-Classification
72
8834
<reponame>Renovamen/Text-Classification<filename>models/TextCNN/cnn2d.py<gh_stars>10-100 import torch import torch.nn as nn import torch.nn.functional as F from typing import List class TextCNN2D(nn.Module): """ Implementation of 2D version of TextCNN proposed in paper [1]. `Here <https://github.com/yoonk...
3.25
3
LEVEL2/다리를지나는트럭/solution.py
seunghwanly/CODING-TEST
0
8835
def solution(bridge_length, weight, truck_weights): answer = 0 # { weight, time } wait = truck_weights[:] bridge = [] passed = 0 currWeight = 0 while True: if passed == len(truck_weights) and len(wait) == 0: return answer answer += 1 # sth needs to be passed ...
3.59375
4
heat/tests/convergence/framework/testutils.py
maestro-hybrid-cloud/heat
0
8836
<gh_stars>0 # # 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 writing, s...
2.015625
2
device_geometry.py
AstroShen/fpga21-scaled-tech
2
8837
"""Holds the device gemoetry parameters (Table 5), taken from Wu et al., >> A Predictive 3-D Source/Drain Resistance Compact Model and the Impact on 7 nm and Scaled FinFets<<, 2020, with interpolation for 4nm. 16nm is taken from PTM HP. """ node_names = [16, 7, 5, 4, 3] GP = [64, 56, 48, 44, 41] FP = [40, 30, 28, 24, ...
1.09375
1
nova/tests/servicegroup/test_zk_driver.py
vmthunder/nova
7
8838
# Copyright (c) AT&T 2012-2013 <NAME> <<EMAIL>> # Copyright 2012 IBM Corp. # # 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 # # ...
1.851563
2
tests/test_misc.py
lordmauve/chopsticks
171
8839
"""Tests for miscellaneous properties, such as debuggability.""" import time from chopsticks.tunnel import Docker from chopsticks.group import Group def test_tunnel_repr(): """Tunnels have a usable repr.""" tun = Docker('py36', image='python:3.6') assert repr(tun) == "Docker('py36')" def test_group_repr...
2.6875
3
Evaluation/PostProcesing.py
AnnonymousRacoon/Quantum-Random-Walks-to-Solve-Diffusion
0
8840
<reponame>AnnonymousRacoon/Quantum-Random-Walks-to-Solve-Diffusion<gh_stars>0 import pandas as pd import re import glob def rebuild_counts_from_csv(path,n_dims, shots): df = pd.read_csv(path) return rebuild_counts_from_dataframe(dataframe=df, n_dims=n_dims, shots=shots) def rebuild_counts_from_dataframe(dat...
2.65625
3
app/wirecard/tasks.py
michel-rodrigues/viggio_backend
0
8841
<gh_stars>0 from sentry_sdk import capture_exception from dateutil.parser import parse from project_configuration.celery import app from orders.models import Charge from request_shoutout.domain.models import Charge as DomainCharge from .models import WirecardTransactionData CROSS_SYSTEMS_STATUS_MAPPING = { 'WAI...
1.90625
2
py/multiple_dispatch_example.py
coalpha/coalpha.github.io
0
8842
<filename>py/multiple_dispatch_example.py from typing import * from multiple_dispatch import multiple_dispatch @overload @multiple_dispatch def add(a: Literal[4, 6, 8], b): raise TypeError("No adding 2, 4, 6, or 8!") @overload @multiple_dispatch def add(a: int, b: str): return f"int + str = {a} + {b}" @overloa...
3.53125
4
dygraph/alexnet/network.py
Sunyingbin/models
0
8843
<gh_stars>0 """ 动态图构建 AlexNet """ import paddle.fluid as fluid import numpy as np class Conv2D(fluid.dygraph.Layer): def __init__(self, name_scope, num_channels, num_filters, filter_size, stride=1, pa...
2.65625
3
turtlegameproject/turtlegame.py
Ayon134/code_for_Kids
0
8844
import turtle import random p1=turtle.Turtle() p1.color("green") p1.shape("turtle") p1.penup() p1.goto(-200,100) p2=p1.clone() p2.color("blue") p2.penup() p2.goto(-200,-100) p1.goto(300,60) p1.pendown() p1.circle(40) p1.penup() p1.goto(-200,100) p2.goto(300,-140) p2.pendown() p2.circle(40) p2.penup() p2.goto(-200,-...
3.890625
4
hivwholeseq/sequencing/check_pipeline.py
neherlab/hivwholeseq
3
8845
#!/usr/bin/env python # vim: fdm=marker ''' author: <NAME> date: 15/06/14 content: Check the status of the pipeline for one or more sequencing samples. ''' # Modules import os import sys from itertools import izip import argparse from Bio import SeqIO from hivwholeseq.utils.generic import getchar from hiv...
2.40625
2
app.py
thliang01/nba-s
0
8846
<gh_stars>0 import streamlit as st import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt # -------------------------------------------------------------- # Import and clean data game_details = pd.read_csv('games_details.csv') # print(game_details.head(5)) game_details.drop(['GAME...
3.296875
3
python/craftassist/voxel_models/geoscorer/geoscorer_util.py
kepolol/craftassist
0
8847
<gh_stars>0 """ Copyright (c) Facebook, Inc. and its affiliates. """ import numpy as np import random from datetime import datetime import sys import argparse import torch import os from inspect import currentframe, getframeinfo GEOSCORER_DIR = os.path.dirname(os.path.realpath(__file__)) CRAFTASSIST_DIR = os.path.joi...
1.898438
2
CryptoAttacks/tests/Block/test_gcm.py
akbarszcz/CryptoAttacks
54
8848
<gh_stars>10-100 #!/usr/bin/python from __future__ import absolute_import, division, print_function import subprocess from builtins import bytes, range from os.path import abspath, dirname from os.path import join as join_path from random import randint from CryptoAttacks.Block.gcm import * from CryptoAttacks.Utils...
2.140625
2
python_clean_architecture/use_cases/orderdata_use_case.py
jfsolarte/python_clean_architecture
0
8849
<gh_stars>0 from python_clean_architecture.shared import use_case as uc from python_clean_architecture.shared import response_object as res class OrderDataGetUseCase(uc.UseCase): def __init__(self, repo): self.repo = repo def execute(self, request_object): #if not request_object: ...
2.296875
2
owscapable/swe/common.py
b-cube/OwsCapable
1
8850
<filename>owscapable/swe/common.py from __future__ import (absolute_import, division, print_function) from owscapable.util import nspath_eval from owscapable.namespaces import Namespaces from owscapable.util import testXMLAttribute, testXMLValue, InfiniteDateTime, NegativeInfiniteDateTime from dateutil import parser ...
2.15625
2
main_fed.py
gao969/scaffold-dgc-clustering
0
8851
#!/usr/bin/env python # -*- coding: utf-8 -*- # Python version: 3.6 import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import copy import numpy as np from torchvision import datasets, transforms import torch import os import torch.distributed as dist from utils.sampling import mnist_iid, mnist_non...
2.15625
2
b_lambda_layer_common_test/integration/infrastructure/function_with_unit_tests.py
gkazla/B.LambdaLayerCommon
0
8852
from aws_cdk.aws_lambda import Function, Code, Runtime from aws_cdk.core import Stack, Duration from b_aws_testing_framework.tools.cdk_testing.testing_stack import TestingStack from b_cfn_lambda_layer.package_version import PackageVersion from b_lambda_layer_common.layer import Layer from b_lambda_layer_common_test.un...
2.203125
2
tests/metarl/tf/baselines/test_baselines.py
neurips2020submission11699/metarl
2
8853
<reponame>neurips2020submission11699/metarl """ This script creates a test that fails when metarl.tf.baselines failed to initialize. """ import tensorflow as tf from metarl.envs import MetaRLEnv from metarl.tf.baselines import ContinuousMLPBaseline from metarl.tf.baselines import GaussianMLPBaseline from tests.fixture...
2.140625
2
api/files/api/app/monthly_report.py
trackit/trackit-legacy
2
8854
<reponame>trackit/trackit-legacy import jinja2 import json from send_email import send_email from app.models import User, MyResourcesAWS, db from app.es.awsdetailedlineitem import AWSDetailedLineitem from sqlalchemy import desc import subprocess import datetime from flask import render_template def monthly_html_templa...
2.28125
2
slow_tests/boot_test.py
rdturnermtl/mlpaper
9
8855
# <NAME> (<EMAIL>) from __future__ import division, print_function from builtins import range import numpy as np import scipy.stats as ss import mlpaper.constants as cc import mlpaper.mlpaper as bt import mlpaper.perf_curves as pc from mlpaper.classification import DEFAULT_NGRID, curve_boot from mlpaper.test_constan...
2.15625
2
TTBenchmark/check_benchmark.py
yuqil725/benchmark_lib
0
8856
def check_difference(): pass def update_benchmark(): pass
0.851563
1
core/test/test_timeseries_study.py
ajmal017/amp
0
8857
from typing import Any, Dict import numpy as np import pandas as pd import core.artificial_signal_generators as sig_gen import core.statistics as stats import core.timeseries_study as tss import helpers.unit_test as hut class TestTimeSeriesDailyStudy(hut.TestCase): def test_usual_case(self) -> None: idx...
2.421875
2
util.py
takat0m0/infoGAN
0
8858
<filename>util.py #! -*- coding:utf-8 -*- import os import sys import cv2 import numpy as np def _resizing(img): #return cv2.resize(img, (256, 256)) return cv2.resize(img, (32, 32)) def _reg(img): return img/127.5 - 1.0 def _re_reg(img): return (img + 1.0) * 127.5 def get_figs(target_dir): ret ...
2.796875
3
myhoodApp/migrations/0002_healthfacilities_hospital_image.py
MutuaFranklin/MyHood
0
8859
<reponame>MutuaFranklin/MyHood # Generated by Django 3.2.7 on 2021-09-23 20:01 import cloudinary.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('myhoodApp', '0001_initial'), ] operations = [ migrations.AddField( model_name='h...
1.804688
2
forecasting_algorithms/Multiple_Timeseries/VAR/var.py
ans682/SafePredict_and_Forecasting
1
8860
# VAR example from statsmodels.tsa.vector_ar.var_model import VAR from random import random # contrived dataset with dependency data = list() for i in range(100): v1 = i + random() v2 = v1 + random() row = [v1, v2] data.append(row) # fit model model = VAR(data) model_fit = model.fit() # make prediction ...
2.984375
3
candidate-scrape.py
jonykarki/hamroscraper
2
8861
<reponame>jonykarki/hamroscraper<filename>candidate-scrape.py import json import urllib.request import MySQLdb db = MySQLdb.connect(host="localhost", # your host, usually localhost user="root", # your username passwd="", # your password db="elec...
3.0625
3
sangita/hindi/lemmatizer.py
ashiscs/sangita
36
8862
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 9 23:28:21 2017 @author: samriddhi """ import re import sangita.hindi.tokenizer as tok import sangita.hindi.corpora.lemmata as lt def numericLemmatizer(instr): lst = type([1,2,3]) tup = type(("Hello", "Hi")) string = type("Hello") ...
3.421875
3
gslib/tests/test_stet_util.py
ttobisawa/gsutil
0
8863
<reponame>ttobisawa/gsutil<filename>gslib/tests/test_stet_util.py # -*- coding: utf-8 -*- # Copyright 2021 Google Inc. 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 # #...
2.015625
2
markdown_editing/tests/test_extension.py
makyo/markdown-editing
0
8864
<reponame>makyo/markdown-editing<gh_stars>0 from markdown import markdown from unittest import TestCase from markdown_editing.extension import EditingExtension class TestExtension(TestCase): def test_substitution(self): source = '~{out with the old}{in with the new}' expected = '<p><span class="...
2.40625
2
apps/siren/test_handlers.py
thomasyi17/diana2
15
8865
""" SIREN/DIANA basic functionality testing framework Requires env vars: - GMAIL_USER - GMAIL_APP_PASSWORD - GMAIL_BASE_NAME -- ie, abc -> <EMAIL> These env vars are set to default: - ORTHANC_PASSWORD - SPLUNK_PASSWORD - SPLUNK_HEC_TOKEN TODO: Move stuff to archive after collected TODO: Write data into daily folder...
1.648438
2
deptree.py
jeking3/boost-deptree
0
8866
<gh_stars>0 # # Copyright (c) 2019 <NAME> # # Use, modification, and distribution are subject to the # Boost Software License, Version 1.0. (See accompanying file # LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) # import json import networkx import re from pathlib import Path class BoostDependency...
2.171875
2
uberbackend.py
adiHusky/uber_backend
0
8867
<reponame>adiHusky/uber_backend from flask import Flask, flash, request, jsonify, render_template, redirect, url_for, g, session, send_from_directory, abort from flask_cors import CORS # from flask import status from datetime import date, datetime, timedelta from calendar import monthrange from dateutil.parser import p...
2.0625
2
sppas/sppas/src/models/acm/htkscripts.py
mirfan899/MTTS
0
8868
<reponame>mirfan899/MTTS """ .. --------------------------------------------------------------------- ___ __ __ __ ___ / | \ | \ | \ / the automatic \__ |__/ |__/ |___| \__ annotation and \ | | | | \ ...
1.75
2
icekit/plugins/map/tests.py
ic-labs/django-icekit
52
8869
from mock import patch from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.contrib.auth import get_user_model from django.core import exceptions from django_dynamic_fixture import G from django_webtest import WebTest from icekit.models import Layout from...
1.875
2
example/example.py
saravanabalagi/imshowtools
4
8870
<gh_stars>1-10 from imshowtools import imshow import cv2 if __name__ == '__main__': image_lenna = cv2.imread("lenna.png") imshow(image_lenna, mode='BGR', window_title="LennaWindow", title="Lenna") image_lenna_bgr = cv2.imread("lenna_bgr.png") imshow(image_lenna, image_lenna_bgr, mode=['BGR', 'RGB'],...
2.671875
3
terminalone/models/concept.py
amehta1/t1-python
24
8871
# -*- coding: utf-8 -*- """Provides concept object.""" from __future__ import absolute_import from .. import t1types from ..entity import Entity class Concept(Entity): """Concept entity.""" collection = 'concepts' resource = 'concept' _relations = { 'advertiser', } _pull = { '...
2.34375
2
videofeed.py
dmeklund/asyncdemo
0
8872
""" Mock up a video feed pipeline """ import asyncio import logging import sys import cv2 logging.basicConfig(format="[%(thread)-5d]%(asctime)s: %(message)s") logger = logging.getLogger('async') logger.setLevel(logging.INFO) async def process_video(filename): cap = cv2.VideoCapture(filename) tasks = list() ...
3.140625
3
parsers/read_lspci_and_glxinfo.py
mikeus9908/peracotta
3
8873
#!/usr/bin/python3 """ Read "lspci -v" and "glxinfo" outputs """ import re from dataclasses import dataclass from InputFileNotFoundError import InputFileNotFoundError @dataclass class VideoCard: type = "graphics-card" manufacturer_brand = "" reseller_brand = "" internal_name = "" model = "" ...
2.984375
3
upload.py
snymainn/tools-
0
8874
<reponame>snymainn/tools-<gh_stars>0 #!/usr/bin/python import sys from loglib import SNYLogger import ftplib import argparse import re import os import calendar import time def read_skipfile(infile, log): skiplines = list() skipfile = open(infile, 'r') for line in skipfile: newline = line.rst...
2.5
2
chapter2/intogen-arrays/src/mrna/mrna_comb_gene_classif.py
chris-zen/phd-thesis
1
8875
#!/usr/bin/env python """ Classify oncodrive gene results and prepare for combination * Configuration parameters: - The ones required by intogen.data.entity.EntityManagerFactory * Input: - oncodrive_ids: The mrna.oncodrive_genes to process * Output: - combinations: The mrna.combination prepared to be calculated ...
2.296875
2
src/FunctionApps/DevOps/tests/test_get_ip.py
CDCgov/prime-public-health-data-infrastructure
3
8876
def test_get_ip_placeholder(): """placeholder so pytest does not fail""" pass
1.226563
1
data/models/svm_benchmark.py
Laurenhut/Machine_Learning_Final
0
8877
<gh_stars>0 #!/usr/bin/env python from sklearn import svm import csv_io def main(): training, target = csv_io.read_data("../Data/train.csv") training = [x[1:] for x in training] target = [float(x) for x in target] test, throwaway = csv_io.read_data("../Data/test.csv") test = [x[1:] for x in test] ...
2.859375
3
configs/utils/config_generator.py
user-wu/SOD_eval_metrics
0
8878
<reponame>user-wu/SOD_eval_metrics<gh_stars>0 # -*- coding: utf-8 -*- from matplotlib import colors # max = 148 _COLOR_Genarator = iter( sorted( [ color for name, color in colors.cnames.items() if name not in ["red", "white"] or not name.startswith("light") or "gray" in...
2.1875
2
core/sms_service.py
kartik1000/jcc-registration-portal
0
8879
<reponame>kartik1000/jcc-registration-portal<filename>core/sms_service.py<gh_stars>0 from urllib.parse import urlencode from decouple import config import hashlib import requests BASE = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" auth_key = config('AUTH_KEY') url = 'http://sms.globehost.com/api/se...
2.421875
2
scripts/fetch_images.py
Protagonistss/sanic-for-v3
0
8880
<reponame>Protagonistss/sanic-for-v3 import sys import os sys.path.append(os.pardir) import random import time import requests from contextlib import closing from help import utils from threading import Thread def get_train_set_path(path: str): create_path = utils.join_root_path(path) return create_path d...
2.1875
2
GeneralStats/example.py
haoruilee/statslibrary
58
8881
import GeneralStats as gs import numpy as np from scipy.stats import skew from scipy.stats import kurtosistest import pandas as pd if __name__ == "__main__": gen=gs.GeneralStats() data=np.array([[1, 1, 2, 2, 3],[2, 2, 3, 3, 5],[1, 4, 3, 3, 3],[2, 4, 5, 5, 3]]) data1=np.array([1,2,3,4,5]) ...
2.6875
3
bootstrap.py
tqchen/yarn-ec2
35
8882
<gh_stars>10-100 #!/usr/bin/env python # encoding: utf-8 """ script to install all the necessary things for working on a linux machine with nothing Installing minimum dependencies """ import sys import os import logging import subprocess import xml.etree.ElementTree as ElementTree import xml.dom.minidom as minidom imp...
1.867188
2
intro/matplotlib/examples/plot_good.py
zmoon/scipy-lecture-notes
2,538
8883
""" A simple, good-looking plot =========================== Demoing some simple features of matplotlib """ import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt fig = plt.figure(figsize=(5, 4), dpi=72) axes = fig.add_axes([0.01, 0.01, .98, 0.98]) X = np.linspace(0, 2, 200) Y = np...
3.703125
4
pfio/_context.py
HiroakiMikami/pfio
24
8884
import os import re from typing import Tuple from pfio._typing import Union from pfio.container import Container from pfio.io import IO, create_fs_handler class FileSystemDriverList(object): def __init__(self): # TODO(tianqi): dynamically create this list # as well as the patterns upon loading th...
2.359375
2
parser/fase2/team19/Analisis_Ascendente/Instrucciones/PLPGSQL/Ifpl.py
Josue-Zea/tytus
35
8885
<filename>parser/fase2/team19/Analisis_Ascendente/Instrucciones/PLPGSQL/Ifpl.py import Analisis_Ascendente.Instrucciones.PLPGSQL.EjecutarFuncion as EjecutarFuncion from Analisis_Ascendente.Instrucciones.PLPGSQL.plasignacion import Plasignacion from Analisis_Ascendente.Instrucciones.instruccion import Instruccion fro...
1.421875
1
epages_client/dataobjects/enum_fetch_operator.py
vilkasgroup/epages_client
3
8886
# -*- coding: utf-8 -*- from __future__ import unicode_literals class FetchOperator(object): '''Defines values for fetch operators''' ADD = 1 REMOVE = 2 REPLACE = 3
1.78125
2
pyhwpscan/hwp_scan.py
orca-eaa5a/dokkaebi_scanner
0
8887
from threading import current_thread from jsbeautifier.javascript.beautifier import remove_redundant_indentation from pyparser.oleparser import OleParser from pyparser.hwp_parser import HwpParser from scan.init_scan import init_hwp5_scan from scan.bindata_scanner import BinData_Scanner from scan.jscript_scanner import...
2.390625
2
tests/core/test_plugins.py
franalgaba/nile
0
8888
""" Tests for plugins in core module. Only unit tests for now. """ from unittest.mock import patch import click from nile.core.plugins import get_installed_plugins, load_plugins, skip_click_exit def test_skip_click_exit(): def dummy_method(a, b): return a + b dummy_result = dummy_method(1, 2) ...
2.421875
2
commands/source.py
Open-Source-eUdeC/UdeCursos-bot
3
8889
async def source(update, context): source_code = "https://github.com/Open-Source-eUdeC/UdeCursos-bot" await context.bot.send_message( chat_id=update.effective_chat.id, text=( "*UdeCursos bot v2.0*\n\n" f"Código fuente: [GitHub]({source_code})" ), parse_mod...
1.742188
2
history/tests.py
MPIB/Lagerregal
24
8890
from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django.test.client import Client from model_mommy import mommy from devices.models import Device from users.models import Lageruser class HistoryTests(TestCase): def setUp(self): self.client = Client() ...
2.265625
2
django_git_info/management/commands/get_git_info.py
spapas/django-git
1
8891
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError from django_git_info import get_git_info class Command(BaseCommand): help = 'Gets git info' #@transaction.commit_manually def handle(self, *args, **options): info = get_git_info() for key in info.ke...
2.1875
2
mevis/_internal/conversion.py
robert-haas/mevis
2
8892
<filename>mevis/_internal/conversion.py from collections.abc import Callable as _Callable import networkx as _nx from opencog.type_constructors import AtomSpace as _AtomSpace from .args import check_arg as _check_arg def convert(data, graph_annotated=True, graph_directed=True, node_label=None, node_colo...
3.0625
3
testData/completion/classMethodCls.py
seandstewart/typical-pycharm-plugin
0
8893
<filename>testData/completion/classMethodCls.py from builtins import * from pydantic import BaseModel class A(BaseModel): abc: str @classmethod def test(cls): return cls.<caret>
2.078125
2
watcher_metering/tests/agent/test_agent.py
b-com/watcher-metering
2
8894
<filename>watcher_metering/tests/agent/test_agent.py<gh_stars>1-10 # -*- encoding: utf-8 -*- # Copyright (c) 2015 b<>com # # 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.apac...
1.859375
2
mmtbx/bulk_solvent/mosaic.py
ndevenish/cctbx_project
0
8895
from __future__ import absolute_import, division, print_function from cctbx.array_family import flex from scitbx import matrix import math from libtbx import adopt_init_args import scitbx.lbfgs from mmtbx.bulk_solvent import kbu_refinery from cctbx import maptbx import mmtbx.masks import boost_adaptbx.boost.python as b...
1.46875
1
mars/tensor/execution/tests/test_base_execute.py
lmatz/mars
1
8896
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding Ltd. # # 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-...
1.804688
2
comix-imagenet/init_paths.py
drumpt/Co-Mixup
86
8897
import sys import matplotlib matplotlib.use('Agg') sys.path.insert(0, 'lib')
1.21875
1
members_abundances_in_out_uncertainties.py
kcotar/Gaia_clusters_potential
0
8898
import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt from glob import glob from astropy.table import Table, join from os import chdir, system from scipy.stats import norm as gauss_norm from sys import argv from getopt import getopt # turn off polyfit ranking warnings import warnin...
2.296875
2
src/python_minifier/transforms/remove_pass.py
donno2048/python-minifier
0
8899
<reponame>donno2048/python-minifier import ast from python_minifier.transforms.suite_transformer import SuiteTransformer class RemovePass(SuiteTransformer): """ Remove Pass keywords from source If a statement is syntactically necessary, use an empty expression instead """ def __call__(self, nod...
2.75
3