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
apigee/backups/commands.py
mdelotavo/apigee-cli
5
12767451
import click from apigee import console from apigee.auth import common_auth_options, gen_auth from apigee.backups.backups import Backups # from apigee.cls import OptionEatAll from apigee.prefix import common_prefix_options from apigee.silent import common_silent_options from apigee.verbose import common_verbos...
1.9375
2
dlchord2/parser/chord_parser.py
anime-song/DLChord-2
0
12767452
from dlchord2 import const class ChordParseData(object): def __init__(self, root_text, bass_text, quality_text): self.__root_text = root_text self.__bass_text = bass_text self.__quality_text = quality_text @property def root_text(self): return self.__root_text @proper...
3.140625
3
tests/table_data.py
bws428/ambiance
18
12767453
<gh_stars>10-100 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: <NAME> # ===== LAYER CHANGES ===== # OK --> -5.0e3 # *OK -2500 # *OK --> 0.00e3 # *OK 2000 # *OK --> 11.0e3 # *OK 15000 # *OK --> 20.0e3 # *OK 25000 # *OK --> 32.0e3 # *OK 41_000 # *OK --> 47.0e3 # *OK 50_000 # *OK --> 51.0e3 # *OK 61_000 # *OK...
2.6875
3
src/tryme.py
RandalJBarnes/AkeyaaGIS
0
12767454
<reponame>RandalJBarnes/AkeyaaGIS<filename>src/tryme.py import arcpy import akeyaa __version__ = "02 July 2020" #------------------------------------------------------------------------------- # The constants CWIGDB and CTYGDB are specific paths on the local machine. # These paths must be modified to point to the gd...
1.65625
2
dynadb/migrations/0075_auto_20170125_1954.py
GPCRmd/GPCRmd
3
12767455
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2017-01-25 18:54 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('dynadb', '0074_auto_2017012...
1.695313
2
pytest_unittest_discovery_scenarios/copy_scenario.py
d3r3kk/vscode-python-extras
0
12767456
<filename>pytest_unittest_discovery_scenarios/copy_scenario.py import os import shutil import sys import tarfile NEVER_COPY_DIRNAMES = [ ".pytest_cache", "__pycache__", ".venv-pytest_37", ".venv-pytest_36", ".git", ] def compress_scenario(scenario_name, scenario_folder): tarfile_folder, _ = o...
2.34375
2
python/022_Generate_Parentheses.py
JerryCatLeung/leetcode
0
12767457
# class Solution(object): # def generateParenthesis(self, n): # """ # :type n: int # :rtype: List[str] # """ class Solution(object): def generateParenthesis(self, n): if n == 1: return ['()'] last_list = self.generateParenthesis(n - 1) ...
3.421875
3
docs_Ismail_Geles/benchmark/utils/format.py
isgeles/SMARTS
554
12767458
# MIT License # # Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved. # # 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 th...
2.34375
2
aioairtable/helpers.py
gleb-chipiga/aioairtable
0
12767459
<gh_stars>0 import json from functools import partial from typing import Final __all__ = ('json_dumps', 'get_python_version', 'get_software', 'debug') json_dumps: Final = partial(json.dumps, ensure_ascii=False) def get_python_version() -> str: from sys import version_info as version return f'{version.major}...
2.171875
2
test_script.py
martinagvilas/CompEnv-Ex1
0
12767460
<gh_stars>0 from __future__ import print_function a = 5 b = 2 print("{0} divided by {1} gives".format(a, b), a / b)
2.78125
3
modeling/trans/__init__.py
WenmuZhou/crnn.pytorch
46
12767461
<reponame>WenmuZhou/crnn.pytorch # -*- coding: utf-8 -*- # @Time : 2020/6/17 10:59 # @Author : zhoujun from .TPS import TPS __all__ = ['build_trans'] support_trans = ['TPS', 'None'] def build_trans(trans_name, **kwargs): assert trans_name in support_trans, f'all support head is {support_trans}' if trans...
2.234375
2
twitcher/__init__.py
edwinmosong/twitcher
1
12767462
<filename>twitcher/__init__.py # twitcher project. # <NAME> """ twitcher - A simpleTwitchTV API wrapper. This python package provides ease of use and accessibility to many, if not all, of TwitchTV's features. """ import json import requests import helper import streams __version__ = '0.0.1' BASE_URL = 'https://api....
2.609375
3
mmskeleton/deprecated/datasets/recognition.py
fserracant/mmskeleton
1,347
12767463
import os import numpy as np import json import torch from .utils import skeleton class SkeletonDataset(torch.utils.data.Dataset): """ Feeder for skeleton-based action recognition Arguments: data_path: the path to data folder random_choose: If true, randomly choose a portion of the input seque...
2.609375
3
winton_kafka_streams/processor/_context.py
szczeles/winton-kafka-streams
0
12767464
<filename>winton_kafka_streams/processor/_context.py """ Processor context is the link to kafka from individual processor objects """ import logging import functools from .._error import KafkaStreamsError log = logging.getLogger(__name__) def _raiseIfNullRecord(fn): @functools.wraps(fn) def _inner(*args, ...
2.59375
3
feature_extraction.py
navtejsingh/epilepsypred
1
12767465
<filename>feature_extraction.py """ Extract Features from EEG time series ------------------------------------- Peak in Band (PIB) features are extracted from EEG time series data. Six PIB per minute are calculated. This results in 960 features for 10 minute of EEG recording in 16 channels. ...
2.96875
3
rastervision_pytorch_learner/rastervision/pytorch_learner/learner_pipeline.py
theoway/raster-vision
1,577
12767466
from rastervision.pipeline.pipeline import Pipeline from rastervision.pytorch_learner import LearnerConfig class LearnerPipeline(Pipeline): """Simple Pipeline that is a wrapper around Learner.main() This supports the ability to use the pytorch_learner package to train models using the RV pipeline package...
2.625
3
books/booksdatasource.py
KristinA64/cs257
0
12767467
<gh_stars>0 #!/usr/bin/env python3 ''' booksdatasource.py <NAME>, 21 September 2021 For use in the 'books' assignment at the beginning of Carleton's CS 257 Software Design class, Fall 2021. <NAME> and <NAME>, 2 October 2021 ''' import csv class Author: def __init__(self, surname='', given_nam...
4.28125
4
args/asr_train_arg_parser.py
HikaruHotta/M2M-VC-CycleGAN
5
12767468
<filename>args/asr_train_arg_parser.py """ Arguments for training ASR model. Inherits BaseArgParser. """ from args.train_arg_parser import TrainArgParser class ASRTrainArgParser(TrainArgParser): """ Class which implements an argument parser for args used only in train mode. It inherits BaseArgParser. ...
2.953125
3
migrations/versions/2023b1841f34_initial_revision.py
wlsouza/pydiscordbot
0
12767469
"""initial revision Revision ID: 2023b1841f34 Revises: Create Date: 2021-07-21 18:53:29.086785 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto generate...
1.226563
1
python/fate_arch/common/__init__.py
QuantumA/FATE
715
12767470
<filename>python/fate_arch/common/__init__.py from fate_arch.common._types import FederatedMode, FederatedCommunicationType, EngineType, CoordinationProxyService, \ CoordinationCommunicationProtocol from fate_arch.common._types import BaseType, Party, DTable
1.234375
1
src/zignalz/cli/log_server.py
rscohn2/sensepy
0
12767471
# SPDX-FileCopyrightText: 2020 <NAME> # # SPDX-License-Identifier: MIT import logging logger = logging.getLogger(__name__) def add_parser(subparsers): parser = subparsers.add_parser('log-server', help='Log server') subparsers = parser.add_subparsers(dest='cmd') subparsers.required = True sync_parser...
2.296875
2
src/rpi/stream.py
CI-Warrior/picoastal
0
12767472
<filename>src/rpi/stream.py """ # SCRIPT : stream.py # POURPOSE : Stream the camera to the screen. # AUTHOR : <NAME> # DATE : 14/04/2021 # VERSION : 1.0 """ # system import os from time import sleep # arguments import json import argparse # PiCamera from picamera import PiCamera from picamera.array import P...
3.296875
3
us/tests/test_us.py
Juh10/python-us
346
12767473
<reponame>Juh10/python-us<filename>us/tests/test_us.py from itertools import chain import jellyfish # type: ignore import pytest # type: ignore import pytz import us # attribute def test_attribute(): for state in us.STATES_AND_TERRITORIES: assert state == getattr(us.states, state.abbr) def test_va...
2.53125
3
UI/res.py
YongLiuLab/BrainRadiomicsTools
10
12767474
<reponame>YongLiuLab/BrainRadiomicsTools # -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.11.2) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x9a\xa7\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x0...
1.046875
1
D01/OP-pembagian2.py
shdx8/dtwrhs
0
12767475
print(10/3) print(10//3) print() kue = 16 anak = 4 kuePerAnak = kue // anak print ("Setiap anak akan mendapatkan kue sebanyak ", kuePerAnak)
3.234375
3
examples/tree_pretrain/utils/summary.py
jiakai0419/Curvature-Learning-Framework
86
12767476
<reponame>jiakai0419/Curvature-Learning-Framework # Copyright (C) 2016-2021 Alibaba Group Holding Limited # # 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/licens...
2.3125
2
Aula 06/[Exercicio 07] .py
IsaacPSilva/LetsCode
0
12767477
'''7. Faça uma função que sorteia 10 números aleatórios entre 0 e 100 e retorna o maior entre eles.''' import random def sorteio(): maior = 0 menor = 0 for i in range(10): x = random.randint(0,100) if i==1: menor = x if x<menor: menor = x ...
3.8125
4
ai_semiconductors/tests/test_uncertainty_rfr.py
xiaofx2/ai_semiconductors
4
12767478
import sys import uncertainty_rfr import pandas as pd import numpy as np from sklearn.ensemble import RandomForestRegressor import pandas.api.types as ptypes sys.path.append("../") df_test = pd.read_csv('./xiaofeng_lasso/unittest_dummy.csv', nrows=5) X_test, y_test = uncertainty_rfr.descriptors_outputs(df_test, d_st...
2.8125
3
o_doh.py
Black-Blade/smartfon_no_ads
0
12767479
<reponame>Black-Blade/smartfon_no_ads #!/usr/bin/env python3 #/***************************************************************************//** # @file o_doh.py # # @author Black-Blade # @brief o_doh.py # @date 17.01.2021 # @version 0.0.1 Doxygen style eingebaut und erstellen dieser File # @see ...
1.757813
2
frappe-bench/apps/erpnext/erpnext/accounts/doctype/c_form/c_form.py
Semicheche/foa_frappe_docker
0
12767480
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt from frappe import _ from frappe.model.document import Document class CForm(Document): def validate(self): ...
2.0625
2
stubs.min/Autodesk/Revit/DB/__init___parts/ExportUnit.py
hdm-dt-fb/ironpython-stubs
1
12767481
<gh_stars>1-10 class ExportUnit(Enum,IComparable,IFormattable,IConvertible): """ An enumerated type listing possible target units for CAD Export. enum ExportUnit,values: Centimeter (4),Default (0),Foot (2),Inch (1),Meter (5),Millimeter (3) """ def __eq__(self,*args): """ x.__eq__(y) <==> x==yx.__eq__(...
2.328125
2
art/estimators/classification/query_efficient_bb.py
h3yin/ART-with-amortized-attacks
0
12767482
# MIT License # # Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2018 # # 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 the # r...
1.546875
2
tests/scripts_question_utils_unittest.py
Chad-Ballay/devops-interview-questions
1
12767483
<gh_stars>1-10 import unittest from pathlib import Path from typing import List from scripts.question_utils import get_answered_questions, get_question_list def open_test_case_file(n: int) -> List[bytes]: tests_path = Path(__file__).parent.joinpath() with open(f'{tests_path}/testcases/testcase{n}.md', 'rb') ...
2.84375
3
Exercicies/ex021.py
sthe-eduarda/Curso-de-python
0
12767484
<reponame>sthe-eduarda/Curso-de-python import pygame pygame.init() pygame.mixer.music.load('nome do arquivo') pygame.mix.music.play() pygame.event.wait()
2.515625
3
tests/pytests/functional/netapi/rest_cherrypy/test_out_formats.py
racooper/salt
0
12767485
import pytest from salt.ext.tornado.httpclient import HTTPError @pytest.fixture def app(app): app.wsgi_application.config["global"]["tools.hypermedia_out.on"] = True return app async def test_default_accept(http_client, content_type_map): response = await http_client.fetch("/", method="GET") assert ...
2.09375
2
taller 5/punto 7.py
9juandromero7/controlrepeticion
0
12767486
while True: X, M = map(int, input().split()) if X == 0 and M == 0: break Y = X * M print(Y)
3.359375
3
3.16.py
donghufeng/learn_mxnet
0
12767487
<reponame>donghufeng/learn_mxnet # %% import d2lzh as d2l from mxnet import autograd, init, nd, gluon from mxnet.gluon import data as gdata, loss as gloss, nn import numpy as np import pandas as pd # %% filename = './data/kaggle_house_pred_{}.csv' train_data = pd.read_csv(filename.format('train')) test_data = pd.read_...
2.46875
2
SVMToCoreML/venv/Lib/site-packages/coremltools/proto/DictVectorizer_pb2.py
blueXstar597/HandwritingRecognition
1
12767488
<filename>SVMToCoreML/venv/Lib/site-packages/coremltools/proto/DictVectorizer_pb2.py # Generated by the protocol buffer compiler. DO NOT EDIT! # source: DictVectorizer.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from...
1.429688
1
autodiff/examples/decorators.py
gwtaylor/pyautodiff
59
12767489
from autodiff import function, gradient @function def f(x): return x ** 2 @gradient def g(x): return x ** 2 if __name__ == '__main__': print 'x = 20' print 'f(x) = {0}'.format(f(20.0)) print 'f\'(x) = {0}'.format(g(20.0))
3.359375
3
ciphey/basemods/Decoders/base64_url.py
AlexandruValeanu/Ciphey
9,908
12767490
import base64 from typing import Dict, Optional from ciphey.iface import Config, Decoder, ParamSpec, T, U, registry @registry.register class Base64_url(Decoder[str]): def decode(self, ctext: T) -> Optional[U]: """ Performs Base64 URL decoding """ ctext_padding = ctext + "=" * (4 -...
2.765625
3
tests/test_basics.py
chnlkx/straxen
0
12767491
import numpy as np import straxen import tempfile import os import unittest import shutil import uuid test_run_id_1T = '180423_1021' class TestBasics(unittest.TestCase): @classmethod def setUpClass(cls) -> None: temp_folder = uuid.uuid4().hex # Keep one temp dir because we don't want to down...
2.265625
2
spectrum.py
ttarhan/pixel-audio-visualizer
0
12767492
<reponame>ttarhan/pixel-audio-visualizer import numpy as np from matplotlib import pyplot as plt from scipy import fftpack as fft COLORS = [ (0, 0, 255), (0, 255, 255), (0, 255, 0), (255, 255, 0), (255, 128, 0), (255, 0, 0), (255, 0, 255) ] class AudioSpectrum(object): def __init__(s...
2.625
3
rds/client/python/example_postgres/basic_examples/bytea_select.py
BigMountainTiger/aws-cdk-examples
2
12767493
<gh_stars>1-10 import os import psycopg2 from pprint import pprint CONSTR = 'postgres://postgres:<PASSWORD>@database-<EMAIL>-east-<EMAIL>:5432/StudentDB' def save_to_file(file_id, file_content): # Create the directory if not exists directory = './images/files-from-db/' if not os.path.exists(directory): os...
3.25
3
plugins/coral/src/main.py
ctso/scrypted
0
12767494
from __future__ import annotations from asyncio.events import AbstractEventLoop, TimerHandle from asyncio.futures import Future from typing import Mapping from safe_set_result import safe_set_result import scrypted_sdk import numpy as np import re import tflite_runtime.interpreter as tflite from pycoral.utils.edgetpu i...
1.9375
2
tests/test_utility.py
yahoo/pypirun
2
12767495
import os import shutil import unittest from pypirun import utility class TestUtility(unittest.TestCase): test_key = 'OUROATH_UTILITY' def tearDown(self): try: del os.environ[self.test_key] except KeyError: pass def test__env_bool__default(self): self.ass...
2.75
3
app/utils.py
tradaviahe1982/labman-master
10
12767496
<reponame>tradaviahe1982/labman-master import logging import random import string from multiprocessing import Process from flask import render_template from flask_mail import Message from log4mongo.handlers import MongoHandler from PIL import Image from app import CONFIG, mailer from app.db import get_db def rand_s...
1.9375
2
Lambda/send-telegram-message-2/lambda_function.py
wyutong1997/SmartMedicineDispenser
5
12767497
<reponame>wyutong1997/SmartMedicineDispenser import json import os from botocore.vendored import requests def executeCommand(command:str, chat_id:int, text:str)->str: hyper_url = "http://ec544.hopto.org:7786/" if command == "patients": requests.post(hyper_url + "patients", data={"did": chat_id}).json()...
2.234375
2
dao/control/db/migrate_repo/versions/003_add_port.py
Symantec/dao-control
0
12767498
from sqlalchemy import Column, Table, MetaData, Index import logging from sqlalchemy.dialects.mysql.base import DATETIME from sqlalchemy.dialects.mysql.base import INTEGER from sqlalchemy.dialects.mysql.base import VARCHAR LOG = logging.getLogger(__name__) def upgrade(migrate_engine): meta = MetaData() meta...
2.234375
2
tushare_trader/datayes/idx.py
gorf/tushare-trader
1
12767499
# -*- coding:utf-8 -*- """ 通联数据 Created on 2015/08/24 @author: <NAME> @group : waditu @contact: <EMAIL> """ from io import StringIO import pandas as pd from tushare.util import vars as vs from tushare.util.common import Client from tushare.util import upass as up class Idx(): def __init__(self, client=None)...
2.328125
2
continuous-umps/try_this_first.py
jemisjoky/Continuous-uMPS
0
12767500
import torch # After running `make install` in the torchmps folder, this should work from torchmps import ProbMPS # Dummy parameters for the model and data bond_dim = 13 input_dim = 2 batch_size = 55 sequence_len = 21 complex_params = True # Verify that you can initialize the model my_mps = ProbMPS(sequence_len, inp...
2.984375
3
examples/example_test/main.py
lcopey/node_editor
1
12767501
<reponame>lcopey/node_editor import sys import os import inspect from PyQt5.QtWidgets import * sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..')) from node_editor.node_editor_window import NodeEditorWindow from node_editor.utils import loadStylessheet if __name__ == '__main__': app = QApplicati...
2.203125
2
tests/vtk_ui/test_vtk_ui_handle_interaction.py
scottwittenburg/vcs
11
12767502
""" Tests handle's interactivity. """ import vcs.vtk_ui import vtk_ui_test import decimal class test_vtk_ui_handle_interaction(vtk_ui_test.vtk_ui_test): def setUp(self): super(test_vtk_ui_handle_interaction, self).setUp() self.h = None self.h2 = None def do(self): self.win.Set...
2.46875
2
scrape-twitter-example.py
kemalcanbora/python-examples
1
12767503
#!/usr/bin/python3 # scrape twitter example going to web page for twitter profile # author: <NAME> # date: 2015 06 02 # Note: MUST USE PYTHON 3 from terminal import json import urllib.request, urllib.parse import random from bs4 import BeautifulSoup useragents = ['Mozilla/5.0','Bandicout Broadway 2.4','Carls Crawler ...
3.5625
4
odoo_actions/utils.py
catalyst-cloud/adjutant-odoo
1
12767504
<reponame>catalyst-cloud/adjutant-odoo<filename>odoo_actions/utils.py<gh_stars>1-10 # Copyright (C) 2016 Catalyst IT 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 # # h...
1.875
2
ML/ml.py
slav9n4ik/openhack2020
0
12767505
<filename>ML/ml.py #!/usr/bin/python import sys from random import seed from random import randint from time import sleep #seed(1) print('Argument List:', str(sys.argv)) sleep(15) print('ID:', randint(0, 999999), ", Value: ", randint(0, 999999))
2.34375
2
module_scikit-learn/logistic_regression.py
robert-g-butler/python_reference_guide
1
12767506
''' This script contains examples of Logistic Regression analysis, using the SciKit-Learn library. Logistic regression is useful when trying to classify data between 2 binary groups / labels. For example, a logistic model would be useful to predict if someone has a disease (1) or does not have a disease (0). Logistic...
3.890625
4
editor.py
Commander07/Magnitude
6
12767507
import editor editor.start()
1.054688
1
common/world.py
FrostMiser/Frostica
1
12767508
from models.tile import Tile # TILE REFERENCE # 0 = show covered mountains # 1 = flat snow # 2 = water # 3 = trees # 4 = mountains world = { 'x': 0, 'y': 0, 'tiles': [] } def get_tile_id(x, y): if y < 0 or x < 0: tile_id = -1 else: try: world_y = world['tiles'][y] ...
2.484375
2
Introduction.py
mudgalsaurabh/IEEE-Python_Workshop-2018
3
12767509
<gh_stars>1-10 age = 5+(8%3)-3+(3*10)/2 greetings = "Welcome to IEEE Python Workshop 2018 edition. It's my pleasure to conduct today's workshop for you." name = "<NAME>" major = "mechanical engineering" print(greetings) print("My name is " + name + ".") print("I am " + str(age) + " years old and am majoring in " + maj...
3.453125
3
glsl/sema.py
yoshou/ratchetwrench
0
12767510
<filename>glsl/sema.py #!/usr/bin/env python # -*- coding: utf-8 -*- from ast.node import * from glsl.symtab import SymbolTable, Symbol def register_function_proto(node, sym_table, is_constructor=False): proto = node ty = sym_table.find_type(proto.type.specifier) params = [] for param in proto.params...
2.203125
2
hashes/password-to-ntlm.py
r0kit/Pentesting-Templates
0
12767511
import argparse import hashlib import binascii def run(args): h = hashlib.new('md4', args.password.encode('utf-16le')).digest() print(binascii.hexlify(h).decode('utf-8')) if __name__ == '__main__': parser = argparse.ArgumentParser(description='Make an NTLM hash from a password.') parser.add_argument('...
3.1875
3
pyleecan/Functions/Optimization/tournamentDCD.py
IrakozeFD/pyleecan
95
12767512
<reponame>IrakozeFD/pyleecan from random import sample, choice def choseDCD(indiv_1, indiv_2): """Chose between two individuals Parameters ---------- indiv_1 : individual indiv_2 : individual Returns ------- individual selected """ if indiv_1.cstr_viol == 0 and indiv_2.cstr_...
3.296875
3
lifelib/projects/savings_gallery/plot_option_value.py
fumitoh/lifelib
77
12767513
r""" Monte Carlo vs Black-Scholes-Merton =========================================== Time values of options and guarantees for various in-the-moneyness are calculated using Monte Carlo simulations and the Black-Scholes-Merton pricing formula for European put options. The Black-Scholes-Merton pricing formula for Europ...
3.1875
3
src/codewars/7-kyu/uglify-word/uglify_word.py
nwthomas/code-challenges
1
12767514
""" Summary In this kata, you have to make a function named uglify_word (uglifyWord in Java and Javascript). It accepts a string parameter. What does the uglify_word do? It checks the char in the given string from the front with an iteration, in the iteration it does these steps: There is a flag and it will be starte...
4.4375
4
flask-appointment-calendar/tests/test_models.py
codyhan94/PMA-scheduler
1
12767515
<filename>flask-appointment-calendar/tests/test_models.py # -*- coding: utf-8 -*- from fbone.user import User from tests import TestCase class TestUser(TestCase): def test_get_current_time(self): assert User.query.count() == 2
2.03125
2
lib/pylint/checkers/utils.py
willemneal/Docky
0
12767516
# pylint: disable=W0611 # # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:<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 2 of...
2.046875
2
chapter_4/problem_2.py
misterwilliam/cracking-coding-interview
0
12767517
import unittest class Node(object): def __init__(self, data, children=None): self.data = data if children is None: self.children = [] else: self.children = children def is_connected(a, b): todo = [a] seen = set(todo) while len(todo) > 0: current = todo.pop() # DFS if current ...
3.71875
4
uninas/modules/modules/abstract.py
cogsys-tuebingen/uninas
18
12767518
import types from collections.abc import Iterator import torch import torch.nn as nn from uninas.register import Register from uninas.utils.shape import Shape, ShapeList, ShapeOrList from uninas.utils.args import ArgsInterface from uninas.utils.paths import make_base_dirs from uninas.utils.torch.misc import randomize_p...
2.015625
2
exp_mixture_model/__version__.py
naokimas/exp_mixture_model
2
12767519
# -*- coding: utf-8 -*- __title__ = 'exp_mixture_model' __version__ = '1.0.0' __description__ = 'Maximum likelihood estimation and model selection of EMMs' __copyright__ = 'Copyright (C) 2019 <NAME> and <NAME>' __license__ = 'MIT License' __author__ = '<NAME>, <NAME> and <NAME>' __author_email__ = '<EMAIL>' __url__ = ...
1.085938
1
scratch/get_fisher_new.py
AdriJD/cmb_sst_ksw
0
12767520
import os import numpy as np from sst import Fisher from sst import camb_tools as ct from sst import plot_tools opj = os.path.join def get_cls(cls_path, lmax, A_lens=1): ''' returns ------- cls : array-like Lensed Cls (shape (4,lmax-1) with BB lensing power reduced depending on A_len...
1.976563
2
xdufacool/collect_local.py
fredqi/xdufacool
7
12767521
<gh_stars>1-10 # -*- encoding: utf-8 -*- # collect_local.py --- # # Filename: collect_local.py # Author: <NAME> # Created: 2017-01-03 20:35:44(+0800) # # Last-Updated: 2017-01-08 19:24:52(+0800) [by <NAME>] # Update #: 473 # # Commentary: # # # # Change Log: # # # from __future__ import print_function import re...
2.6875
3
code/HiddenLayer.py
PPeltola/tiralabra
0
12767522
from Vector import Vector from Neuron import Neuron class HiddenLayer: def __init__(self, size, input_size, weights, activation, activation_d, loss, loss_d, bias=1.0): self.size = size #self.input_layer = input_layer self.input_size = input_size #self.output_layer = output_layer ...
3.59375
4
data_aug/aug_utils.py
Animadversio/Foveated_Saccade_SimCLR
14
12767523
<filename>data_aug/aug_utils.py import torch from typing import Tuple, List, Optional from packaging import version torchver = version.parse(torch.__version__) OLD_DIV = torchver < version.parse("1.8.0") def unravel_indices( indices: torch.LongTensor, shape: Tuple[int, ...], ) -> torch.LongTensor: r"""Conver...
2.59375
3
code/python/qppMeasures/sARE.py
Zendelo/QPP-EnhancedEval
3
12767524
<filename>code/python/qppMeasures/sARE.py import numpy as np def sARESingle(qppColRanks, msrDFRanks, mapper): refMsr = mapper(qppColRanks.name) return (np.abs(qppColRanks - msrDFRanks[refMsr])/len(qppColRanks)) def sARE(msrDF, qppDF, rankType, mapper): #convert to ranks msrDFRanks = msrDF.rank(met...
2.640625
3
MNIST-lightning/model.py
dadi-vardhan/Assurance-cases-for-LEC
0
12767525
<reponame>dadi-vardhan/Assurance-cases-for-LEC<gh_stars>0 import torch import numpy as np import pytorch_lightning as pl from torchvision.models import resnet18,mobilenet_v2,vgg16,alexnet import torch.nn.functional as F from torchmetrics.functional.classification.accuracy import accuracy from torchvision.models.squeeze...
2.28125
2
batch_folder/batch_generator.py
Ouwen/registration-magi
3
12767526
<reponame>Ouwen/registration-magi #!/usr/bin/python from medpy.io import load import csv import sys import copy output = open('/output/batch_script.sh', 'w') output.write('#!/bin/bash') filename_dictionary = { 'pre-contrast filepath': 'pre', 'post-contrast filepath': 'post', 'FLAIR filepath': 'FLAIR' } ...
2.390625
2
lib/bridgedb/parse/networkstatus.py
wfn/bridgedb
1
12767527
# -*- coding: utf-8 -*- # # This file is part of BridgeDB, a Tor bridge distribution system. # # :authors: <NAME> 0xA3ADB67A2CDB8B35 <<EMAIL>> # please also see AUTHORS file # :copyright: (c) 2013 Isis Lovecruft # (c) 2007-2013, The Tor Project, Inc. # (c) 2007-2013, all entities withi...
2.28125
2
pymoo/util/nds/tree_based_non_dominated_sort.py
AIasd/pymoo
5
12767528
import weakref import numpy as np class Tree: ''' Implementation of Nary-tree. The source code is modified based on https://github.com/lianemeth/forest/blob/master/forest/NaryTree.py Parameters ---------- key: object key of the node num_branch: int how many branches in e...
2.953125
3
bayesiancoresets/coreset/__init__.py
trevorcampbell/hilbert-coresets
118
12767529
from .hilbert import HilbertCoreset from .sampling import UniformSamplingCoreset from .sparsevi import SparseVICoreset from .bpsvi import BatchPSVICoreset
0.992188
1
gunicorn_config.py
ons-eq-team/eq-questionnaire-runner
0
12767530
import gunicorn import os workers = os.getenv("GUNICORN_WORKERS") worker_class = "gevent" keepalive = os.getenv("GUNICORN_KEEP_ALIVE") bind = "0.0.0.0:5000" gunicorn.SERVER_SOFTWARE = "None"
1.8125
2
ingestion/src/metadata/ingestion/models/json_serializable.py
rongfengliang/OpenMetadata
0
12767531
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not ...
2.265625
2
tests/urls.py
ajbeach2/django-sqs-tasks
0
12767532
from django.conf.urls import include from django.urls import path urlpatterns = [ path("task", include("aws_pubsub.urls")), ]
1.492188
1
cities/urls.py
platypotomus/python-react-travel-app
0
12767533
<gh_stars>0 from django.conf.urls import url from . import views urlpatterns = [ url('api/cities/', views.CityListIndex.as_view(), name="cities_list"), url('api/cities/(?P<pk>\d+)/$', views.CityElementShow.as_view(), name="cities_element") # url(r'^city/$', views.CityListIndex.as_view(), name="cities_list"...
1.828125
2
HydrogenCpx/test.py
EFerriss/Hydrogen_Cpx
0
12767534
# -*- coding: utf-8 -*- """ Created on Thu Apr 07 11:41:07 2016 @author: Ferriss """ from pynams import experiments reload(experiments) experiments.convertH(110.,)
1.507813
2
app/routes.py
hyattdrew11/Built-Budget-API
0
12767535
#! ''' ..%%%%...%%%%%%..%%%%%%..........%%%%%...%%..%%..%%%%%%..%%......%%%%%%. .%%......%%........%%............%%..%%..%%..%%....%%....%%........%%... .%%.%%%..%%%%......%%............%%%%%...%%..%%....%%....%%........%%... .%%..%%..%%........%%............%%..%%..%%..%%....%%....%%........%%... ..%%%%...%%%%%%....%%...
2.015625
2
models/v0/net_definitions_tf.py
isl-org/adaptive-surface-reconstruction
29
12767536
# # Copyright 2022 Intel (Autonomous Agents Lab) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
2.015625
2
QCA4020_SDK/target/sectools/qdn/sectools/common/crypto/functions/utils/openssl.py
r8d8/lastlock
0
12767537
<reponame>r8d8/lastlock<filename>QCA4020_SDK/target/sectools/qdn/sectools/common/crypto/functions/utils/openssl.py # =============================================================================== # # Copyright (c) 2013-2017 Qualcomm Technologies, Inc. # All Rights Reserved. # Confidential and Proprietary - Qualcomm...
1.898438
2
src/modeling/__init__.py
clazaro97chosen/American-Community-Survey-Project
2
12767538
<filename>src/modeling/__init__.py from .model_tryout import * from .prep_or_featureselection import * from .train_and_predict import *
1.085938
1
tests/conftest.py
amagge/flair
3,957
12767539
import pytest from pathlib import Path @pytest.fixture(scope="module") def resources_path(): return Path(__file__).parent / "resources" @pytest.fixture(scope="module") def tasks_base_path(resources_path): return resources_path / "tasks" @pytest.fixture(scope="module") def results_base_path(resources_path)...
2.09375
2
users/migrations/0005_auto_20210609_0406.py
JoyMbugua/arifa
1
12767540
<filename>users/migrations/0005_auto_20210609_0406.py<gh_stars>1-10 # Generated by Django 3.2.4 on 2021-06-09 04:06 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('users', '0004_rename_experince_customuser_experience'), ] operations = [ migrati...
1.484375
1
command_line/fqm_mopac.py
qrefine/qrefine
17
12767541
<reponame>qrefine/qrefine from __future__ import division # LIBTBX_SET_DISPATCHER_NAME qr.fqm_mopac import sys import time import os.path import libtbx import iotbx.pdb import cPickle as pickle from qrefine.fragment import fragments from qrefine.fragment import fragment_extracts from qrefine.fragment import get_qm_file...
1.90625
2
mojito/event/EventGenerator.py
PPACI/mojito
2
12767542
<reponame>PPACI/mojito<filename>mojito/event/EventGenerator.py from abc import ABC, abstractmethod from typing import Any, Dict, List class EventGenerator(ABC): @abstractmethod def generate(self) -> Dict[str, Any]: """ Generate a random event :return: a dict like {property_name: value...
3.078125
3
Network/WireShark.py
Penmast/Chameleon
16
12767543
#from __future__ import print_function import winreg as reg from scapy.all import * import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) ADAPTER_KEY = r'SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}' OpenVpnPath = "C:\\Program Files\\OpenVPN\\bin\\openvpn.exe" ...
2.015625
2
PyFlow/Packages/CFRP/FunctionLibraries/ActionLibrary.py
yiwc/CFRP
0
12767544
from PyFlow.Core.Common import * from PyFlow.Core import FunctionLibraryBase from PyFlow.Core import IMPLEMENT_NODE PIN_ALLOWS_ANYTHING = {PinSpecifires.ENABLED_OPTIONS: PinOptions.AllowAny | PinOptions.ArraySupported | PinOptions.DictSupported} class ActionLibrary(FunctionLibraryBase): '''doc string for DemoLi...
2.40625
2
geo_college/geocode_tests.py
codelucas/antchatter
1
12767545
import os import pickle import codecs import json PARENT_DIR = os.path.dirname(os.path.abspath(__file__)) GEO_FILE = os.path.join(PARENT_DIR, 'college_geocode.txt') geo_dat_prev = str(codecs.open(GEO_FILE, 'r', 'utf8').read()) geo_json = pickle.loads(geo_dat_prev) for geo in geo_json[:10]: print 'loc_range', geo...
2.671875
3
data/test.py
thapashani6/ML-Digit-Detection-
0
12767546
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Tue Mar 26 19:12:37 2019 @author: Shani """ #!/usr/bin/python #!/usr/bin/python from PIL import Image import os, sys path = "D:/thapa/Documents/Rowan/eighth_Semester/ML/Yolo-digit-detector-master/data" dirs = os.listdir( path ) def resize(): for item in dirs: ...
2.765625
3
networks/__init__.py
xinxindefeiyu/S2VD-master_RESID
48
12767547
#!/usr/bin/env python # -*- coding:utf-8 -*- # Power by <NAME> 2020-09-15 13:00:15
1.203125
1
Part_2_intermediate/mod_2/lesson_5/homework_3/shop/product.py
Mikma03/InfoShareacademy_Python_Courses
0
12767548
class Product: def __init__(self, name, category_name, unit_price): self.name = name self.category_name = category_name self.unit_price = unit_price def __str__(self): return f"Nazwa: {self.name} | Kategoria: {self.category_name} | Cena: {self.unit_price} PLN/szt"
3.21875
3
build.py
ledocc/conan-turtle
1
12767549
from cpt.packager import ConanMultiPackager, tools if __name__ == "__main__": builder = ConanMultiPackager( reference="turtle/{}".format( tools.load("version.txt") ) ) builder.add_common_builds() builder.run()
1.554688
2
torchcde/__init__.py
jb-c/torchcde
247
12767550
<reponame>jb-c/torchcde from .interpolation_base import InterpolationBase from .interpolation_cubic import natural_cubic_spline_coeffs, natural_cubic_coeffs, CubicSpline from .interpolation_linear import linear_interpolation_coeffs, LinearInterpolation from .interpolation_hermite_cubic_bdiff import hermite_cubic_coeffi...
0.898438
1