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 |
|---|---|---|---|---|---|---|
adaequare_gsp/helpers/schema/gstr_2a.py | mohsinalimat/adaequare_gsp | 0 | 49400 | import frappe
from datetime import datetime
from adaequare_gsp.helpers.schema.states import number_state_mapping
from adaequare_gsp.helpers.schema.gstr_2b import (
GST_CATEGORY,
NOTE_TYPE,
YES_NO,
)
def update_period(date):
date = datetime.strptime(date, "%b-%y").strftime("%m%Y")
return date
DAT... | 1.882813 | 2 |
layer_quantize/train.py | ratansingh98/tf_quantization | 2 | 49401 | import tempfile
import tensorflow as tf
import tensorflow_model_optimization as tfmot
from tensorflow.keras.models import load_model
import os
from tensorflow import keras
import time
def evaluate_model(interpreter):
input_index = interpreter.get_input_details()[0]["index"]
output_index = interpreter.get_output_de... | 2.828125 | 3 |
test/codec_implementations/__init__.py | G-AshwinKumar/experiment-notebook | 0 | 49402 | <gh_stars>0
import pkgutil as _pkgutil
import enb.icompression
# Dynamically updated by inspection of modules found
__all__ = []
all_codec_classes = []
all_lossless_codec_classes = []
all_lossy_codec_classes = []
for loader, module_name, is_pkg in _pkgutil.walk_packages(__path__):
if not module_name.startswith("... | 2.046875 | 2 |
python/agent.py | tbvanderwoude/research-project | 3 | 49403 | from __future__ import annotations
import copy
from typing import Optional
from mapfmclient import MarkedLocation
from python.coord import Coord, UncalculatedCoord
class Agent:
def __init__(self, location: Coord, color: int, accumulated_cost: Optional[int]):
self.location = location
self.accumu... | 3.046875 | 3 |
Efficiency Test/arcadameVM_dictionaries.py | bernardotc/Arcadame | 0 | 49404 | <reponame>bernardotc/Arcadame
# -----------------------------------------------------------------------------
# <NAME> A00813175
# <NAME> A00617060
# arcadame.py
#
# Virtual Machine for the languange Arcadame
# -----------------------------------------------------------------------------
import xml.etree.E... | 2.078125 | 2 |
database.py | premkarat/expensify_bot | 2 | 49405 | import sqlalchemy as sq
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
engine = create_engine('sqlite:///tmp/expense.db',
connect_args={"check_same_thread": False},
... | 2.609375 | 3 |
web/web/urls.py | danieltrt/UnchartIt_UI | 2 | 49406 | """web URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/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')
Class-based vie... | 2.6875 | 3 |
dh_abstracts/app/abstracts/forms.py | dSHARP-CMU/dhweb_app | 3 | 49407 | from django import forms
from dal import forward
from dal.autocomplete import ModelSelect2, ModelSelect2Multiple
from django.forms import formset_factory, inlineformset_factory, modelformset_factory
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, ButtonHolder, Submit
from .... | 2.328125 | 2 |
legacy/scripts/srd_functions.py | pvkraju80/leo | 99 | 49408 | <gh_stars>10-100
#
# Module with functions for
# Gruenbichler and Longstaff (1996) model
#
# (c) Dr. <NAME>
# Listed Volatility and Variance Derivatives
#
import math
import numpy as np
import scipy.stats as scs
def futures_price(v0, kappa, theta, zeta, T):
''' Futures pricing formula in GL96 model.
Paramete... | 2.828125 | 3 |
spydrnet/tests/test_verilog_to_edif.py | ganeshgore/spydrnet | 34 | 49409 | import unittest
class TestVerilogToEdif(unittest.TestCase):
pass | 0.9375 | 1 |
qnarre/prep/tokens/perceiver.py | quantapix/qnarre.com | 0 | 49410 | <filename>qnarre/prep/tokens/perceiver.py<gh_stars>0
# Copyright 2022 Quantapix 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
#
# http://www.apache.org/lic... | 1.695313 | 2 |
20180715/FeatureSelection/FeatureSelection.py | fengjiaxin/Home_Credit_Default_Risk | 26 | 49411 | <filename>20180715/FeatureSelection/FeatureSelection.py
# coding:utf-8
import os
import re
import sys
import tqdm
import numpy as np
import pandas as pd
from category_encoders import TargetEncoder
def filter_nan_feature(feature):
"""
:param feature: feature pd.Series
:return:
"""
return (np.sum(f... | 2.71875 | 3 |
{{cookiecutter.project_slug}}/tests/unit/{{cookiecutter.project_slug}}/graphql/resolvers/test_query.py | Maximilien-R/cookiecutter-tartiflette-aiohttp | 3 | 49412 | from unittest.mock import Mock
import pytest
from {{cookiecutter.project_slug}}.graphql.resolvers import resolve_query_hello
@pytest.mark.asyncio
async def test_resolve_query_hello():
result = await resolve_query_hello(
None, {"name": "{{cookiecutter.author_name}}"}, {}, Mock()
)
assert result =... | 2.234375 | 2 |
mease_elabftw/logger.py | ssciwr/mease-elabftw | 0 | 49413 | <reponame>ssciwr/mease-elabftw<filename>mease_elabftw/logger.py
import logging
import os
import time
# By default no log will be written.
log_level = logging.DEBUG
logger = logging.getLogger("mease-elabftw")
logger.setLevel(logging.CRITICAL)
# this is the default log-file path
output_file = os.path.join("mease_elabf... | 2.671875 | 3 |
bin/collect.py | nw-engineer/collectiontools | 1 | 49414 | import sys
import requests
from bs4 import BeautifulSoup
from urllib import request
args = sys.argv[1]
url = args
response = request.urlopen(url)
soup = BeautifulSoup(response, features = "html.parser")
response.close()
print(soup.title.text)
print(soup.pre.text)
| 3.171875 | 3 |
app/validation.py | chrieke/vector-validator | 11 | 49415 | <filename>app/validation.py
from typing import List, Union
from geopandas import GeoDataFrame
class Vector:
"""
Class handling the checks and geometry validation.
"""
def __init__(
self,
df: GeoDataFrame,
fixable_valid=None,
all_valid=None,
is_single_ring=None... | 3.203125 | 3 |
boaapi/status.py | boalang/api-python | 3 | 49416 | from enum import Enum
class CompilerStatus(Enum):
WAITING = 1
RUNNING = 2
FINISHED = 3
ERROR = 4
class ExecutionStatus(Enum):
WAITING = 1
RUNNING = 2
FINISHED = 3
ERROR = 4
| 2.78125 | 3 |
src/cfgparse.py | user12986714/SpamSoup | 0 | 49417 | <reponame>user12986714/SpamSoup<filename>src/cfgparse.py
# coding=utf-8
import json
import decorator
import verinfo
def resolve_path(base, path):
""" Resolve (some) relative path. """
if path[0] == "/":
# Absolute path
return path
return base + path
def depth_first_parser(data_base, rou... | 2.28125 | 2 |
settings_window.py | Lewak/PracaMagisterska | 0 | 49418 | #dada
from dearpygui import core, simple
from generic_window import GenericWindow
from tensor_flow_interface import TensorFlowInterface
from tensor_flow_interface import ModelDataContainer
from import_window import ImportWindow
from output_visualisation_window import OutputVisualisationWindow
from better_visualizer imp... | 2.328125 | 2 |
word_segmentation.py | yuhsiangfu/news-analysis | 0 | 49419 | <reponame>yuhsiangfu/news-analysis<gh_stars>0
# import modular
import collections
import jieba
import json
import os
import os.path
import sys
# define variables
DIRNAME_NEWS = "news\\"
DIRNAME_WORDS = "words\\"
FILENAME_STOP_WORDS = "stopwords_all.txt"
FILENAME_USER_DICT = "userdict_all.txt"
NON_BMP_MA... | 2.515625 | 3 |
data/vqa.py | BUAAw-ML/KE-OPT | 0 | 49420 | <gh_stars>0
"""
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
VQA dataset
"""
import torch
from torch.nn.utils.rnn import pad_sequence
from toolz.sandbox import unzip
from .data import TxtVideoAudioDataset, TxtMapper
import json
import os
import string
punctuation = string.punctuation
from pyt... | 2.328125 | 2 |
source/keeper/storage/streams.py | rob-smallshire/keeper | 1 | 49421 | import io
class WriteOnlyStream:
"""A write-only wrapper around a stream.
Closing this stream does not close the underlying stream.
"""
def __init__(self, raw, name=None):
self._raw = raw
self._name = name
def close(self):
self._raw = None
def __enter__(self):
... | 3.4375 | 3 |
main/python/model/Base.py | ShangxuanWu/MT_python | 0 | 49422 | <gh_stars>0
# <NAME> @ Myraid of Things
# 31 Jun 2017
# add path for root ('tf_code/') directory if not in sys.path
import sys, os
root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
if root_path not in sys.path
sys.path.append(root_path)
from main.python.util... | 2.0625 | 2 |
src/integration-tests/expecteds/py/duplicate-names.py | shanejonas/transpiler | 5 | 49423 | from typing import NewType
from typing import Union
from typing import List
from typing import Tuple
from typing import TypedDict
from typing import Optional
Baz = NewType("Baz", bool)
Foo = NewType("Foo", str)
"""array of strings is all...
"""
UnorderedSetOfFooz1UBFn8B = NewType("UnorderedSetOfFooz1UBFn8B", List[Foo... | 2.953125 | 3 |
Software/__init__.py | justins0923/zephyrus-iaq | 1 | 49424 | Software/
Config/
GUI/
IAQ_GUI.py
HAT/
IAQ_DAC43608.py
IAQ_Mux.py
Sensors/
IAQ_Sensor.py
IAQ_MqGas.py
third_party/
bme680-python
IAQ_AnalogPortController.py
IAQ_Exceptions.py
IAQ_FileHandler.py
IAQ_Logger.py
| 1.015625 | 1 |
tst/lyap/verifier/test_Z3Verifier.py | oxford-oxcav/fossil | 1 | 49425 | # Copyright (c) 2021, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from src.lyap.verifier.z3verifier import Z3Verifier
from functools import partial
fr... | 2 | 2 |
repoxplorer/controllers/tags.py | Priya-100/repoxplorer | 107 | 49426 | # Copyright 2017, <NAME>
# Copyright 2017, Red Hat
#
# 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 la... | 1.953125 | 2 |
config/includes.chroot/etc/skel/.weechat/python/weeget.py | ddarksmith/S0lar0S | 0 | 49427 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2012 <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#... | 1.742188 | 2 |
output/models/nist_data/atomic/non_positive_integer/schema_instance/nistschema_sv_iv_atomic_non_positive_integer_pattern_1_xsd/__init__.py | tefra/xsdata-w3c-tests | 1 | 49428 | from output.models.nist_data.atomic.non_positive_integer.schema_instance.nistschema_sv_iv_atomic_non_positive_integer_pattern_1_xsd.nistschema_sv_iv_atomic_non_positive_integer_pattern_1 import NistschemaSvIvAtomicNonPositiveIntegerPattern1
__all__ = [
"NistschemaSvIvAtomicNonPositiveIntegerPattern1",
]
| 1.15625 | 1 |
vizMetrics.py | binocularity/vizMetrics | 0 | 49429 | #
#
# vizMetrics - an interactive toolset for calculating visualization metrics
#
#
#
import os
from kivy.app import App
from kivy.uix.tabbedpanel import TabbedPanel
from kivy.lang import Builder
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import StringProperty
f... | 2.5 | 2 |
gen_from_config.py | aftermisak/LuaAdapter_AutoGeneration | 0 | 49430 | #coding=utf8
import sys
import json
codes_fmt = '''
auto ns = LuaAdapterEnvironment::getInstance().getNamespace("%s");
ns->begin();
{
ns->registerClass("%s", typeid(%s));
auto cls = ns->getClass("%s");
cls->begin();
%s//extends
%s//constructors
%s//destructor
%s//nonmember variables
%s//member vari... | 2.34375 | 2 |
IMUGrabberPython/imugrabber/tests/fong_tests.py | maxlem/AVRCpp | 0 | 49431 | '''
Created on 2009-08-11
@author: malem303
'''
import unittest
from imugrabber.algorithms import fong_accelero, utils, statistics
from imugrabber.algorithms import io
import os
import scipy as sp
from numpy import testing
class FongTests(unittest.TestCase):
def setUp(self):
self.misalignments... | 2.1875 | 2 |
discord_key_bot/colours.py | gadogttas/discord-key-bot | 1 | 49432 | from enum import IntEnum, unique
@unique
class Colours(IntEnum):
DEFAULT = 0
AQUA = 1752220
GREEN = 3066993
BLUE = 3447003
PURPLE = 10181046
GOLD = 15844367
ORANGE = 15105570
RED = 15158332
GREY = 9807270
DARKER_GREY = 8359053
NAVY = 3426654
DARK_AQUA = 1146986
DARK... | 2.9375 | 3 |
twtinsights.py | iamvineeth23/twtinsights | 0 | 49433 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 1 18:25:21 2020
@author: vinnie
"""
import tweepy
from collections import defaultdict
import pandas as pd
import argparse
import os
from stats import tweet_analyzer
from wordanalysis import WordsAnalysis
from keys import (
api_key,
api_se... | 3.015625 | 3 |
pcdet/models/dense_heads/__init__.py | ocNflag/point2seq | 21 | 49434 | from .anchor_head_multi import AnchorHeadMulti
from .anchor_head_single import AnchorHeadSingle
from .anchor_head_template import AnchorHeadTemplate
from .point_head_box import PointHeadBox
from .point_head_simple import PointHeadSimple
from .point_intra_part_head import PointIntraPartOffsetHead
from .anchor_head_seg i... | 1.414063 | 1 |
morph_approach_v0.6.py | rivernuthead/DoD_analysis | 0 | 49435 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 15 09:44:30 2021
@author: erri
"""
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap, BoundaryNorm
#############################################################################################... | 1.945313 | 2 |
examples/example_flow.py | Shchusia/orchestrator | 1 | 49436 | <reponame>Shchusia/orchestrator
"""
ExampleFlow
"""
from orchestrator_service import Block
from orchestrator_service import Flow, FlowBlock, FlowBuilder
from orchestrator_service import Message, MessageCustom
class StepFirst(Block):
"""
first block
"""
name_block = 'first'
name_queue ... | 2.71875 | 3 |
tests/factories/input/types/float_input.py | TheLabbingProject/django_analyses | 1 | 49437 | <reponame>TheLabbingProject/django_analyses
from factory import SubFactory
from factory.django import DjangoModelFactory
from factory.faker import Faker
class FloatInputFactory(DjangoModelFactory):
run = SubFactory("tests.factories.run.RunFactory")
definition = SubFactory(
"tests.factories.input.defin... | 2.265625 | 2 |
tests/supply-test.py | perpetualCreations/bandage | 1 | 49438 | """unit test for bandage.Supply"""
import bandage
supplier = bandage.Supply(
"https://github.com/perpetualCreations/bandage/releases/tag/BANDAGE",
"F://bandage//tests//test_target//VERSION")
print(supplier.realize())
print(supplier.pre_collect_dump())
print(supplier.version_gap)
| 1.9375 | 2 |
desktop/core/ext-py/greenlet-0.3.1/tests/test_weakref.py | digideskio/hortonworks-sandbox | 19 | 49439 | <filename>desktop/core/ext-py/greenlet-0.3.1/tests/test_weakref.py
import gc
import greenlet
import weakref
import unittest
class WeakRefTests(unittest.TestCase):
def test_dead_weakref(self):
def _dead_greenlet():
g = greenlet.greenlet(lambda:None)
g.switch()
return g
... | 2.3125 | 2 |
unit6/spiders/p5_downloader_middleware_handson/p5_downloader_middleware_handson/settings.py | nulearn3296/scrapy-training | 182 | 49440 | BOT_NAME = 'p5_downloader_middleware_handson'
SPIDER_MODULES = ['p5_downloader_middleware_handson.spiders']
NEWSPIDER_MODULE = 'p5_downloader_middleware_handson.spiders'
ROBOTSTXT_OBEY = True
DOWNLOADER_MIDDLEWARES = {
'p5_downloader_middleware_handson.middlewares.SeleniumDownloaderMiddleware': 543,
}
SELENIUM_E... | 1.210938 | 1 |
utils/functions.py | rvhonorato/gdock | 5 | 49441 | <reponame>rvhonorato/gdock<gh_stars>1-10
import shlex
import tempfile
import subprocess # nosec
import os
import logging
import secrets
import ast
import numpy
import sys
import configparser
from pathlib import Path
from utils.files import get_full_path
ga_log = logging.getLogger('ga_log')
etc_folder = get_full_path... | 2.140625 | 2 |
BendersDecomposition/cplex.py | prameshk/Discrete-Optimization | 4 | 49442 | <filename>BendersDecomposition/cplex.py
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 30 22:26:17 2020
@author: <NAME>
"""
import numpy as np
import time
def generateFacilityLocationData(C, F):
# Unbounded ray instance seed 159
np.random.seed(15645)
p = np.random.randint(1000, size=(C, F))
f = np.ra... | 2.828125 | 3 |
triangle.py | StephanieSunshine/py-pascals-triangle | 0 | 49443 | #!/usr/bin/env python3
# Pascals triangle
# 2022 <NAME> -- MIT License
import colorama
from colorama import Fore
from colorama import Style
C = "A "
SEED = 3
ITERATIONS = 49
SCREEN_WIDTH = 160
class TNode:
value = SEED
parent_left = None
parent_right = None
def __init__(self, left = None, right = N... | 3.28125 | 3 |
tests/unit_tests/test_parser_pin.py | mobiusklein/mokapot | 14 | 49444 | """Test that parsing Percolator input files works correctly"""
import pytest
import mokapot
import pandas as pd
@pytest.fixture
def std_pin(tmp_path):
"""Create a standard pin file"""
out_file = tmp_path / "std_pin"
with open(str(out_file), "w+") as pin:
dat = (
"sPeCid\tLaBel\tpepTide... | 2.765625 | 3 |
test.py | ostcar/file_merge | 1 | 49445 | <reponame>ostcar/file_merge<filename>test.py
import unittest
import fake_filesystem
import file_merge.inode
# Do not print anything.
file_merge.utils.VERBOSE_LEVEL = 0
# Create a fake file system and some fake objects
filesystem = fake_filesystem.FakeFilesystem()
os = fake_filesystem.FakeOsModule(filesystem)
open = ... | 2.546875 | 3 |
tests/core/middleware/test_token_authentication.py | D0rs4n/api | 0 | 49446 | <reponame>D0rs4n/api<gh_stars>0
import itertools
import json
import typing
from unittest.mock import Mock, patch
import pytest
from hypothesis import assume, given
from hypothesis.strategies import text
from starlette.authentication import AuthCredentials, AuthenticationError, SimpleUser
from starlette.responses impor... | 2.40625 | 2 |
testing_dns.py | bcklexisnexis/dba_automations | 0 | 49447 | <reponame>bcklexisnexis/dba_automations
import socket
import argparse
def get_ip(dn):
"""
Returns first ip address that corresponds
to domain name.
"""
try:
data = socket.gethostbyname(dn)
ip = repr(data)
return ip
except Exception:
return False
def get_ipx(d... | 3.015625 | 3 |
track_vehicles.py | StoicLobster/Udacity-SelfDrivingCar-T1P5 | 0 | 49448 | <reponame>StoicLobster/Udacity-SelfDrivingCar-T1P5<gh_stars>0
## Import
import numpy as np
import cv2
from skimage.feature import hog
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import pickle
from scipy.ndimage.measurements import label
import time
import glob
from sklearn import svm, grid_search
f... | 2.4375 | 2 |
authentication/urls.py | shuoO-24/QA-Community | 0 | 49449 | <filename>authentication/urls.py
from django.urls import include, path
# auth_views 是 django.contrib.auth.views 模块
from django.contrib.auth import views as auth_views
from .views import UserSignupView
# 这个变量用于增加路由的命名空间,当前端使用 {% url %} 设置路由时
# 可以写成这样:{% url 'authentication:signup' %}
# 意为 authentication 命名空间下 name 为 ... | 2.140625 | 2 |
script_napari.py | plotly/dash-3d-viz | 2 | 49450 | import napari
from nilearn import image
from skimage import segmentation
img = image.image.load_img('assets/BraTS19_2013_10_1_flair.nii').get_data()
viewer = napari.view_image(img)
pix = segmentation.slic(img, n_segments=10000, compactness=0.002, multichannel=False,
)
pix_boundaries = segmenta... | 2.09375 | 2 |
sudkampPython/turingMachAlgs.py | thundergolfer/sudkamp-langs-machines-python | 8 | 49451 | import turingMachines
def recursiveSimulationOfNDTM( ndtm, w,
configurations,
constant, s_n ):
raise NotImplementedError
| 1.84375 | 2 |
syllabus/utils/schedulestarter.py | sayamindu/course-starter | 0 | 49452 | #!/usr/bin/env python
import argparse
import csv
import datetime
import dateutil.relativedelta as relativedelta
import dateutil.rrule as rrule
def parse_args():
parser = argparse.ArgumentParser(description='Generates an empty class schedule CSV file')
parser.add_argument('-s', '--startdate',
type=dat... | 3.265625 | 3 |
ws4py/_asyncio_compat.py | diveyez/WebSocket-for-Python | 733 | 49453 | """Provide compatibility over different versions of asyncio."""
import asyncio
if hasattr(asyncio, "async"):
# Compatibility for Python 3.3 and older
ensure_future = getattr(asyncio, "async")
else:
ensure_future = asyncio.ensure_future | 2.5625 | 3 |
grasshopper/__init__.py | kmarburger/livestock3d | 1 | 49454 | <filename>grasshopper/__init__.py
from . templates import *
from . ssh import * | 1.125 | 1 |
beproductive/pomodoro.py | JohannesStutz/beproductive | 2 | 49455 | <reponame>JohannesStutz/beproductive
# AUTOGENERATED! DO NOT EDIT! File to edit: 02_pomodoro.ipynb (unless otherwise specified).
__all__ = ['WORK_TIME', 'BREAK_TIME', 'POMODOROS', 'pomodoro']
# Cell
from time import sleep
from .blocker import *
import sys
WORK_TIME = 25 # minutes
BREAK_TIME = 5 # minutes
... | 3.125 | 3 |
learnign/2.py | xiaoxin12/pythonlearn | 0 | 49456 | # 题目:企业发放的奖金根据利润提成。
# 利润(I)低于或等于10万元时,奖金可提10%;
# 利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.5%;
# 20万到40万之间时,高于20万元的部分,可提成5%
# 40万到60万之间时高于40万元的部分,可提成3%;
# 60万到100万之间时,高于60万元的部分,可提成1.5%,
# 高于100万元时,超过100万元的部分按1%提成,
# 从键盘输入当月利润I,求应发放奖金总数?
# !/usr/bin/python
# _*_ coding:UTF-8 _*_
li = ""
arr = [100000, 200000, 40... | 3.28125 | 3 |
AmexTest.py | n1cfury/ViolentPython | 0 | 49457 | #!/usr/bin/env python
import re
def banner():
print "[***] Amex finder p 176 [***]"
def findCreditCard(pkt):
americaRE = re.findall("3[47][0-9][13]".raw)
if americaRE:
print "[+] Found American Express Card: "+americaRE[0]
def main():
tests = []
tests.append("I would like to buy 1337 copies of that dvd")
test... | 3.25 | 3 |
lab07/filterWord.py | NickStucchi/CSC221 | 0 | 49458 | #!/usr/bin/env python3
# <NAME>
# 03/23/2017
# Filter out words and replace with dashes
def replaceWord(sentence, word):
wordList = sentence.split()
newSentence = []
for w in wordList:
if w == word:
newSentence.append("-" * len(word))
else:
newSentence.append(w)
... | 4.34375 | 4 |
analysis/export.py | sunlightlabs/regulations-scraper | 13 | 49459 | #!/usr/bin/env python
import sys
import os
import csv
import time
import multiprocessing
from Queue import Empty
from datetime import datetime
from collections import namedtuple
from pymongo import Connection
import StringIO
pid = os.getpid()
import_start = time.time()
print '[%s] Loading trie...' % pid
from oxtail.... | 2.15625 | 2 |
popmon/version.py | SCarozza/popmon | 0 | 49460 | <gh_stars>0
"""THIS FILE IS AUTO-GENERATED BY SETUP.PY."""
name = "popmon"
version = "0.3.12"
full_version = "0.3.12"
release = True
| 0.921875 | 1 |
CTK/Radio.py | pigmej/CTK | 1 | 49461 | # CTK: Cherokee Toolkit
#
# Authors:
# <NAME>
# <NAME>
#
# Copyright (C) 2010-2011 <NAME>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Software Foundation.
#
# This program is distributed... | 2.15625 | 2 |
altair_recipes/stripplot.py | piccolbo/altair_recipes | 89 | 49462 | <reponame>piccolbo/altair_recipes
"""Generate stripplots."""
from .common import multivariate_preprocess
from .signatures import multivariate_recipe, opacity, color
import altair as alt
from autosig import autosig, Signature
@autosig(
multivariate_recipe
+ Signature(color=color(default=None, position=3), opac... | 2.765625 | 3 |
mypackage/colorprint.py | Myrmechrislee/ColorPrint | 0 | 49463 | def colorprint(text, color, bgcolor, *options):
import os
bef = "\x1B["
bg = bef + bgcolorcode(bgcolor)
cc = bef + colorcode(color)
styles = optioncode(*options)
end = bef + "0m"
os.system("echo \"" + styles + bg + cc + text + end + "\"")
def optioncode(*options):
option = ""
allop... | 3.140625 | 3 |
keep_alive.py | LeoATX/blackjack-bot | 0 | 49464 | import flask
import threading
app = flask.Flask('main.py')
@app.route('/')
def index():
return flask.render_template("index.html")
t = threading.Thread(target=app.run())
t.start()
| 2.40625 | 2 |
rpi-clock.py | ericfitz/lcars-pi-clock | 2 | 49465 | <reponame>ericfitz/lcars-pi-clock<gh_stars>1-10
#!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
import os
import logging
import calendar
logging.basicConfig(level=logging.DEBUG)
basepath = os.path.dirname(os.path.realpath(__file__))
logging.debug("base path: %s", basepath)
picdir = os.path.join(basepath, 'pic')
... | 2.484375 | 2 |
reports/urls.py | LCOGT/globalskypartners | 0 | 49466 | from django.urls import path, include
from .views import ReportCreate, ReportList, ImpactCreate, ReportEdit, \
ReportDetail, ReportAddImpact, DeleteImpact, ReportSubmit, FinalReport
from .plots import meta_plot
urlpatterns = [
path('impact/', ImpactCreate.as_view(), name='report-impact'),
path('create/',... | 1.835938 | 2 |
learning_to_adapt/utils/lda.py | ondrejklejch/learning_to_adapt | 18 | 49467 | import numpy as np
def load_lda(path):
rows = []
with open(path, 'r') as f:
for line in f:
line = line.strip(" []\n")
if line:
rows.append(np.fromstring(line, dtype=np.float32, sep=' '))
matrix = np.array(rows).T
return matrix[:-1], matrix[-1]
| 2.65625 | 3 |
pyarcher/record.py | kylecribbs/pyarcher | 3 | 49468 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""User module."""
from pyarcher.base import ArcherBase
class Record(ArcherBase):
"""[summary].
Args:
Archer ([type]): [description]
Returns:
[type]: [description]
"""
_metadata: dict = None
_values: list = None
d... | 2.171875 | 2 |
survol/sources_types/com/registered_type_lib/com_registered_type_lib_versions.py | AugustinMascarelli/survol | 0 | 49469 | <reponame>AugustinMascarelli/survol
#!/usr/bin/env python
"""
Versions of registered COM type libraries
"""
import os
import sys
import lib_util
import lib_common
from lib_properties import pc
import win32con
import win32api
import lib_com_type_lib
Usable = lib_util.UsableWindows
def Main():
cgiEnv = lib_common.... | 1.851563 | 2 |
pretrain.py | ku21fan/STR-Fewer-Labels | 105 | 49470 | <reponame>ku21fan/STR-Fewer-Labels<gh_stars>100-1000
import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from tqdm import tqdm
f... | 2.09375 | 2 |
activitysim/examples/scan_examples_for_errors.py | mxndrwgrdnr/activitysim | 85 | 49471 | # This script looks for errors in the examples creates by `create_run_all_examples.py`
import argparse
import glob
parser = argparse.ArgumentParser()
parser.add_argument(
'working_dir',
type=str,
metavar='PATH',
help='path to examples working directory',
)
args = parser.parse_args()
files_with_error... | 2.75 | 3 |
lifegame.py | maysrp/lifegame | 0 | 49472 | <filename>lifegame.py<gh_stars>0
# from machine import I2C,Pin
# from ssd1306 import SSD1306_I2C#I2C的oled选该方法
# i2c=I2C(0,sda=Pin(0), scl=Pin(1), freq=400000)
# oled = SSD1306_I2C(128, 64, i2c) #你的OLED分辨率,使用I2C
# import ujson as json
# oled.fill(1) #清空屏幕
# oled.show()
# oled.fill(0)
# oled.show()
import jso... | 2.28125 | 2 |
glue_jupyter/widgets/tests/test_linked_dropdown.py | pkgw/glue-jupyter | 0 | 49473 | <filename>glue_jupyter/widgets/tests/test_linked_dropdown.py<gh_stars>0
from glue.core.state_objects import State
from glue.core.data_combo_helper import ComponentIDComboHelper
from glue.external.echo import SelectionCallbackProperty
from ..linked_dropdown import LinkedDropdown, LinkedDropdownMaterial
class DummySta... | 2.171875 | 2 |
CNN/CNN_Baseline.py | waljan/pT1-Gland-Graph-Dataset | 1 | 49474 | #!/usr/bin/python
from __future__ import absolute_import
import torch
import torch.nn as nn
from torchvision import transforms
from torchvision.models import vgg16_bn
from torch.utils.data import Dataset, DataLoader
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
import os
from statistics impor... | 2.375 | 2 |
src/testing/acceptance/test_firewall.py | cloudsigma/pycloudsigma | 13 | 49475 | import unittest
from nose.plugins.attrib import attr
from testing.utils import DumpResponse
import cloudsigma.resource as resource
@attr('acceptance_test')
class FirewallPolicyTest(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
self.client = resource.FirewallPolicy()
... | 2.3125 | 2 |
djangocms_newsletter/testsettings.py | nephila/djangocms-newsletter | 0 | 49476 | <filename>djangocms_newsletter/testsettings.py
"""Settings for testing emencia.django.newsletter"""
SITE_ID = 1
USE_I18N = False
ROOT_URLCONF = 'emencia.django.newsletter.urls'
DATABASES = {'default': {'NAME': 'newsletter_tests.db',
'ENGINE': 'django.db.backends.sqlite3'}}
INSTALLED_APPS =... | 1.3125 | 1 |
647_palindromic_substrings.py | ericness/leetcode | 0 | 49477 | #
# @lc app=leetcode id=647 lang=python3
#
# [647] Palindromic Substrings
#
# @lc code=start
class Solution:
def countSubstrings(self, s: str) -> int:
"""Find number of palindromic strings in s
Args:
s (str): String to analyze
Returns:
int: Count of palindromes
... | 3.75 | 4 |
btc_address_dump/wif_util.py | 0xMars/btc-address-dump | 1 | 49478 | <reponame>0xMars/btc-address-dump
import binascii
import hashlib
import base58
from typing import Union
def scrub_input(hex_str_or_bytes: Union[str, bytes]) -> bytes:
if isinstance(hex_str_or_bytes, str):
hex_str_or_bytes = binascii.unhexlify(hex_str_or_bytes)
return hex_str_or_bytes
# wallet import... | 2.609375 | 3 |
4. RPA Challenge - Json Parsing/libraries/MyLibrary.py | antusystem/Uipath-Challenges-with-Robocorp | 1 | 49479 | <gh_stars>1-10
from robot.api import logger
class MyLibrary:
"""Give this library a proper name and document it."""
def example_python_keyword(self):
logger.info("This is Python!")
def Tipo(self, var):
print("La variable es: ", var)
print("El tipo de la variable es: ", type(var))... | 2.671875 | 3 |
rdp/__init__.py | emulbreh/rdp | 0 | 49480 | from rdp.grammar import Grammar, GrammarBuilder, ignore
from rdp.symbols import Terminal, repeat, Regexp, Optional, Lookahead
from rdp.symbols import epsilon, flatten, drop, keep
from rdp.parser import Parser
from rdp.exceptions import ParseError, LeftRecursion, InvalidGrammar, TokenizeError
| 1.382813 | 1 |
MyExtenstion.extension/Gaochao.tab/Gaochao.panel/Wall_Modify.pulldown/Wall_CurtainWall_Test.pushbutton/script.py | gaochaowyq/MyPyRevitExtentision | 0 | 49481 | <reponame>gaochaowyq/MyPyRevitExtentision<filename>MyExtenstion.extension/Gaochao.tab/Gaochao.panel/Wall_Modify.pulldown/Wall_CurtainWall_Test.pushbutton/script.py
# -*- coding: utf-8 -*-
__doc__="更具曲面与垂直线创建结构"
import System
from System.Collections.Generic import List, Dictionary,IList
import sys
import clr
import os
... | 2.09375 | 2 |
sem1/lab3_3/lsm.py | NetherQuartz/NumericalMethodsLabs | 1 | 49482 | """ЛР 3.3, <NAME>, М8О-303Б-18"""
import numpy as np
import fire # CLI
import matplotlib.pyplot as plt
from sem1.lab1_1.gauss import lu_decomposition, lu_solve
def f(coeffs, x):
"""Вычисление значения полинома с коэффициентами coeffs"""
return sum([x ** i * c for i, c in enumerate(coeffs)])
def sum_squar... | 3.0625 | 3 |
batterym/plotter.py | evanjt/batterym | 30 | 49483 | <reponame>evanjt/batterym<filename>batterym/plotter.py
#!/usr/bin/python
import log
import config
import unittest
import datetime
from history import History
from future import Future
from chart import Chart
def extract_plot_data(history, future):
future.calculate_plot_data()
xoffset = future.remaining_time(... | 2.359375 | 2 |
check-in/weekly/Smallest-Value-of-the-Rearranged-Number-(Medium).py | huandrew99/LeetCode | 36 | 49484 | <filename>check-in/weekly/Smallest-Value-of-the-Rearranged-Number-(Medium).py
"""
LC 6001
Return the rearranged number with minimal value.
Note that the sign of the number does not change after rearranging the digits.
Example 1:
Input: num = 310
Output: 103
Explanation: The possible arrangements for t... | 3.921875 | 4 |
scripts/intensity_exploratory.py | dougmvieira/options-microstructure | 4 | 49485 | from argparse import ArgumentParser
from itertools import starmap
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from fyne import blackscholes, heston
from matplotlib.patches import Patch
from scipy.stats import gaussian_kde
import settings
from align_settings import STARTTIME, ENDTIME
from ut... | 2.171875 | 2 |
cinder/volume/drivers/violin/vxg/vshare/igroup.py | rlucio/cinder-violin-driver-icehouse | 0 | 49486 | <gh_stars>0
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Violin Memory, 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 Licen... | 2.109375 | 2 |
gtimer/local/merge.py | astooke/gtimer | 8 | 49487 | <reponame>astooke/gtimer
"""
Merging data from a new times instances into the receiving instance
(e.g. when they correspond to the same code segments.).
"""
from __future__ import absolute_import
from gtimer.util import iteritems
#
# Function to expose elsewhere in the package.
#
def merge_times(rcvr, new):
r... | 2.421875 | 2 |
TWT/apps/challenges/views/__init__.py | avibn/twtcodejam.net | 0 | 49488 | from .home import HomeView
from .logout import LogoutView
from .new import NewChallengeView
from .view import DetailView
from .test import TestView
from .end import EndView
from .start import StartView
from .stop_team import StopTeams
from .start_submission import StartSubmission
from .stop_submission import StopSubmis... | 1.640625 | 2 |
tests/test_tokenizer.py | cd109/scrappybara | 0 | 49489 | <reponame>cd109/scrappybara
import unittest
from scrappybara.preprocessing.tokenizer import Tokenizer
_TOKENIZE = Tokenizer()
class TestTokenizer(unittest.TestCase):
# BLOCKS
# -------------------------------------------------------------------------->
def test_indirect_speech_blocks(self):
se... | 2.921875 | 3 |
Download_test_data.py | yanhaidong1/TEmarker | 2 | 49490 | <reponame>yanhaidong1/TEmarker
#!/usr/bin/env python
##this script will download the testing data for step 1,2,3
##Also download the testing data for step 0
##BUILT-IN MODULES
import argparse
import sys
import os
import subprocess
from distutils.spawn import find_executable
##SCRIPTS
def get_parsed_args():
parse... | 2.78125 | 3 |
blog/migrations/0003_remove_comment_approved_comment.py | noodleslove/django_blog | 0 | 49491 | <filename>blog/migrations/0003_remove_comment_approved_comment.py
# Generated by Django 3.0.5 on 2020-05-02 01:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_comment'),
]
operations = [
migrations.RemoveField(
model... | 1.25 | 1 |
python/tests/test_Board.py | klenium/tetris | 2 | 49492 | import unittest
import tests.helpers.util as util
from tetris.logic.board.Board import Board
from tetris.logic.tetromino.Tetromino import Tetromino
from tetris.util.containers import Dimension
class BoardTest(unittest.TestCase):
def setUp(self):
self.board = Board(Dimension(5, 4))
def test_new_board_... | 2.90625 | 3 |
evaluation_framework/constants.py | mozjay0619/ml-evaluation-framework | 0 | 49493 |
EF_UUID_NAME = "__specialEF__float32_UUID"
EF_ORDERBY_NAME = "__specialEF__int32_dayDiff"
EF_PREDICTION_NAME = "__specialEF__float32_predictions"
EF_DUMMY_GROUP_COLUMN_NAME = "__specialEF__dummy_group"
HMF_MEMMAP_MAP_NAME = "__specialHMF__memmapMap"
HMF_GROUPBY_NAME = "__specialHMF__groupByNumericEncoder"
| 1.023438 | 1 |
sampyl/tests/test_samplers.py | wilsonify/sampyl | 308 | 49494 | <gh_stars>100-1000
from ..core import np
from ..exceptions import *
from .logps import *
import sampyl as smp
import pytest
#TODO: Make tests to check correctness of samplers
np_source = np.__package__
n_samples = 100
def test_logp_with_grad():
logp = poisson_with_grad
start = {'lam1':1., 'lam2': 1.}
nu... | 2.25 | 2 |
Bots/Python/Consumers/CodeFirst/WaterfallHostBot/dialogs/sso/sso_signin_dialog.py | gabog/BotFramework-FunctionalTests | 28 | 49495 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from botbuilder.dialogs import (
ComponentDialog,
WaterfallDialog,
WaterfallStepContext,
OAuthPrompt,
OAuthPromptSettings,
)
class SsoSignInDialog(ComponentDialog):
def __init__(self, connection_name... | 2.140625 | 2 |
src/products/api/serializers.py | bchuey/justapair | 0 | 49496 | <filename>src/products/api/serializers.py
from rest_framework import serializers
from products.models import Jean, Brand, Size, Style, Color
class BrandModelSerializer(serializers.ModelSerializer):
class Meta:
model = Brand
fields = [
'id',
'name',
]
class ... | 2.40625 | 2 |
singlecellmultiomics/utils/iteration.py | zztin/SingleCellMultiOmics | 17 | 49497 | <filename>singlecellmultiomics/utils/iteration.py
from more_itertools import consecutive_groups
# https://stackoverflow.com/questions/2154249/identify-groups-of-continuous-numbers-in-a-list
def find_ranges(iterable):
"""Yield range of consecutive numbers."""
for group in consecutive_groups(iterable):
... | 3.390625 | 3 |
Analytics/utils/constants.py | fga-eps-mds/2021-1-PUMA | 3 | 49498 | SERVICES = [
'UserService',
'ProjectService',
'NotifyService',
'AlocateService',
'ApiGateway',
'Frontend'
]
METRICS = [
'files',
'functions',
'complexity',
'coverage',
'ncloc',
'comment_lines_density',
'duplicated_lines_density',
'security_rating',
'tests',
... | 1.101563 | 1 |
instamarket/server_settings.py | hosseinmoghimi/instamarket | 3 | 49499 |
from pathlib import Path
import os
import dj_database_url
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
DEBUG = False
ALLOWED_HOSTS = ['khafonline.com','www.khafonline.com']
MYSQL=True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'OPTIONS': {
... | 1.734375 | 2 |