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
biosignalsnotebooks/build/lib/biosignalsnotebooks/__init__.py
csavur/biosignalsnotebooks
1
15300
<reponame>csavur/biosignalsnotebooks """ OPENSIGNALSFACTORY PACKAGE INITIALISATION FILE (WITH IMPORT STATEMENTS) The main purpose of biosignalsnotebooks package is to support the users of PLUX acquisition devices, such as biosgnalsplux or bitalino, in some processing tasks that can be applied to the acquired electroph...
2.421875
2
Dragon/python/dragon/vm/tensorflow/contrib/learn/datasets/base.py
neopenx/Dragon
212
15301
# Copyright 2016 The TensorFlow 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/licenses/LICENSE-2.0 # # Unless required by applica...
2.265625
2
test/integration/steps/pds.py
NHSDigital/list-reconciliation
4
15302
<reponame>NHSDigital/list-reconciliation<filename>test/integration/steps/pds.py from behave import given @given("we have processed PDS data") def step_impl(context): pass
1.296875
1
iSearch/isearch.py
Twilightgo/iSearch
0
15303
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals import sys import argparse import os import re import sqlite3 import requests import bs4 from termcolor import colored # Python2 compatibility if sys.version_info[0] == 2: reload(sys) sys.setdefaultencoding('utf-8') # Default data...
2.359375
2
models/gcn.py
Louis-udm/Word-Grounded-Graph-Convolutional-Network
0
15304
#!/usr/bin/env python # -*- coding: utf-8 -*- """Title: GCN models Description: The original Graph convolutional network model and GCN layer. Refer to: https://arxiv.org/abs/1609.02907 """ # ======================================= # @author Zhibin.Lu # @email <EMAIL> # ======================================= imp...
2.796875
3
tabledefinition/generate_table_definitions_for_solana.py
blockchain-etl/evmchain-etl-table-definition-cli
1
15305
SOLIDITY_TO_BQ_TYPES = { 'address': 'STRING', } table_description = '' def abi_to_table_definitions_for_solana( abi, dataset_name, contract_name, contract_address=None, include_functions=False ): result = {} for a in abi.get('events') if abi.get('events') else []: ...
2.46875
2
number-guessing-game.py
DataSciPyCodes/Python-Projects
0
15306
#Method-1 guess the number game import random number = random.randint(1,10) guess = 0 count = 0 print("You can exit the game anytime. Just enter 'exit'.") while guess != number and guess != "exit": guess = input("Guess a number between 1 to 10 :- ") if guess == "exit": print("Closing the game...") ...
4.09375
4
docking/dock_and_equilibrate.py
proteneer/timemachine
91
15307
"""Solvates a host, inserts guest(s) into solvated host, equilibrates """ import os import time import tempfile import numpy as np from rdkit import Chem from md import builders, minimizer from fe import pdb_writer, free_energy from ff import Forcefield from ff.handlers.deserialize import deserialize_handlers from t...
2.390625
2
Lessons/source/bases.py
ericanaglik/cs13
0
15308
#!python import string # Hint: Use these string constants to encode/decode hexadecimal digits and more # string.digits is '0123456789' # string.hexdigits is '0123456789abcdefABCDEF' # string.ascii_lowercase is 'abcdefghijklmnopqrstuvwxyz' # string.ascii_uppercase is 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' # string.ascii_letters ...
3.640625
4
ecl/provider_connectivity/v2/address_assignment.py
keiichi-hikita/eclsdk
0
15309
<filename>ecl/provider_connectivity/v2/address_assignment.py # -*- coding: utf-8 -*- from ecl.provider_connectivity import provider_connectivity_service from ecl import resource2 from ecl.network.v2 import network from ecl.network.v2 import subnet import hashlib class AddressAssignment(resource2.Resource): resou...
2.859375
3
tests/test_gifGenerator.py
wmokrogulski/gifGenerator
0
15310
import unittest from unittest import TestCase from src.gifGenerator import GifGenerator class TestGifGenerator(TestCase): def setUp(self) -> None: self.gg = GifGenerator() def test_set_text_position(self): position = (50, 90) self.gg.setTextPosition(position) self.assertEqua...
2.890625
3
PSP/GAME/Python/python/bsddb/test/test_dbshelve.py
TheMindVirus/pspy
7
15311
<reponame>TheMindVirus/pspy<filename>PSP/GAME/Python/python/bsddb/test/test_dbshelve.py """ TestCases for checking dbShelve objects. """ import sys, os, string import tempfile, random from pprint import pprint from types import * import unittest try: # For Pythons w/distutils pybsddb from bsddb3 import db, db...
2.71875
3
lib/pyexcel/pyexcel/sources/file_source_output.py
logice/QQ-Groups-Spider
0
15312
""" pyexcel.sources.file ~~~~~~~~~~~~~~~~~~~ Representation of file sources :copyright: (c) 2015-2016 by Onni Software Ltd. :license: New BSD License """ from pyexcel import params from pyexcel.factory import FileSource from pyexcel.sources.rendererfactory import RendererFactory from...
2.765625
3
setup.py
vmyrgiotis/MDF_DALEC_Grass
0
15313
import pathlib from setuptools import setup, find_packages HERE = pathlib.Path(__file__).parent VERSION = '0.1.0' PACKAGE_NAME = 'MDF_DALEC_GRASS' AUTHOR = '<NAME>' AUTHOR_EMAIL = '<EMAIL>' URL = 'https://github.com/vmyrgiotis/MDF_DALEC_GRASS' LICENSE = 'MIT' DESCRIPTION = 'A Bayesian model-data fusion algorithm for...
1.429688
1
setup.py
guma44/croo
0
15314
import setuptools from croo import croo_args with open('README.md', 'r') as fh: long_description = fh.read() setuptools.setup( name='croo', version=croo_args.__version__, scripts=['bin/croo'], python_requires='>3.4.1', author='<NAME>', author_email='<EMAIL>', description='CRomwell Outp...
1.523438
2
source/estimators/estimator.py
mingweima/rldsge
0
15315
from typing import Dict import numpy as np from ..envs.env import StructuralModel from ..utils.lik_func import * from ..utils.useful_class import ParameterGrid class Estimator(ABC): """An Estimator takes in a (trained) solver and relevant params and outputs estimated structural params """ def __...
2.875
3
Algorithm.Python/OptionDataNullReferenceRegressionAlgorithm.py
BlackBoxAM/Lean
6,580
15316
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Licen...
1.796875
2
examples/sharedlinks/sharedlinks-backend/links/models.py
gcbirzan/django-rest-registration
329
15317
from django.db import models from django.contrib.auth.models import User class Link(models.Model): url = models.URLField() title = models.CharField(max_length=255) reporter = models.ForeignKey( User, on_delete=models.SET_NULL, related_name='reported_links', null=True, ...
2.203125
2
hpc_rll/rl_utils/ppo.py
mingzhang96/DI-hpc
64
15318
<filename>hpc_rll/rl_utils/ppo.py<gh_stars>10-100 import torch import torch.nn.functional as F from typing import Optional from collections import namedtuple import hpc_rl_utils # hpc version only support cuda hpc_ppo_loss = namedtuple('hpc_ppo_loss', ['policy_loss', 'value_loss', 'entropy_loss']) hpc_ppo_info = name...
1.929688
2
src/monitoring_service/metrics.py
netcriptus/raiden-services
13
15319
from prometheus_client import Counter from raiden.utils.typing import TokenAmount from raiden_libs.metrics import ( # noqa: F401, pylint: disable=unused-import ERRORS_LOGGED, EVENTS_EXCEPTIONS_RAISED, EVENTS_PROCESSING_TIME, MESSAGES_EXCEPTIONS_RAISED, MESSAGES_PROCESSING_TIME, REGISTRY, E...
2.21875
2
helper/fetch_funcdata.py
SysSec-KAIST/FirmKit
3
15320
# modified from TikNib/tiknib/ida/fetch_funcdata_v7.5.py import os import sys import string from hashlib import sha1 from collections import defaultdict import time import pprint as pp import idautils import idc import idaapi import ida_pro import ida_nalt import ida_bytes sys.path.append(os.path....
1.828125
2
AwesomeService/coveo-blitz-thrift/src/main/python/awesome/AwesomeService.py
coveord/Blitz-2015
4
15321
<filename>AwesomeService/coveo-blitz-thrift/src/main/python/awesome/AwesomeService.py<gh_stars>1-10 # # Autogenerated by Thrift Compiler (0.9.2) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationExceptio...
2.328125
2
src/org_setup/resources/organizations.py
gilyas/aws-control-tower-org-setup-sample
0
15322
#!/usr/bin/env python # -*- coding: utf-8 -*- """ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: MIT-0 * * 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...
1.9375
2
clint/textui/core.py
mpmman/clint
1,230
15323
<gh_stars>1000+ # -*- coding: utf-8 -*- """ clint.textui.core ~~~~~~~~~~~~~~~~~ Core TextUI functionality for Puts/Indent/Writer. """ from __future__ import absolute_import import sys from contextlib import contextmanager from .formatters import max_width, min_width, _get_max_width_context from .cols import col...
2.484375
2
setup.py
mluciarr/McComplex
0
15324
#!/usr/bin/env python from distutils.core import setup import setuptools setup(name='McComplex', version='1.0', description="""This program reconstructs macrocomplexes of protein-protein and protein-(DNA/RNA) from a list of files of binary interactions of its chains""", author='<NAME>, <NAME>, <NAME>', author_...
1.234375
1
pymitools/girder/metadataPresets.py
chapmanbe/pymitools
0
15325
<filename>pymitools/girder/metadataPresets.py """Metadata presets for commonly used keywords.""" presets = { chest : {"Anatomical Region": {"ID": "0001443", "Name": "chest", "Ontology Acronym": "UBERON", "Ontology Name": "Uber Anatomy Ontology", ...
1.484375
1
data/colors-extractor.py
imlolman/Flat-UI-Colors-Chrome-App
1
15326
<filename>data/colors-extractor.py from bs4 import BeautifulSoup import json source = open('html-source.html', encoding="utf8").read() soup = BeautifulSoup(source, 'html.parser') # Prittified to look and understand the structure of Code # prittified = soup.prettify().encode("utf-8") # open('prettified.html', 'wb').w...
2.9375
3
preprocessing.py
Y-greatigr/Covid19_Model
0
15327
<reponame>Y-greatigr/Covid19_Model # 데이터를 가져온다. # 학습 직전의 데이터를 가공하는 역할을 맡는다. import numpy as np import os import options as opt import datetime from sklearn.model_selection import train_test_split from sklearn.preprocessing import Normalizer import joblib def date_to_number(date): # 글자로 표현된 날짜를 숫자로 바꾼다...
3.03125
3
colorpy/colorpy-0.1.0/illuminants.py
gmweir/QuasiOptics
1
15328
<reponame>gmweir/QuasiOptics ''' illuminants.py - Definitions of some standard illuminants. Description: Illuminants are spectrums, normalized so that Y = 1.0. Spectrums are 2D numpy arrays, with one row for each wavelength, with the first column holding the wavelength in nm, and the second column the intensity. Th...
2.90625
3
tests/unit/test_functions.py
noahsa/scikit-hts
0
15329
import numpy import pandas import hts.hierarchy from hts.functions import ( _create_bl_str_col, get_agg_series, get_hierarchichal_df, to_sum_mat, ) def test_sum_mat_uv(uv_tree): mat, sum_mat_labels = to_sum_mat(uv_tree) assert isinstance(mat, numpy.ndarray) shp = mat.shape assert shp[...
2.6875
3
tests/settings.py
team23/django_t10e
0
15330
import os import warnings warnings.simplefilter('always') test_dir = os.path.dirname(os.path.abspath(__file__)) DATABASES = { 'default': { 'NAME': os.path.join(test_dir, 'db.sqlite'), 'ENGINE': 'django.db.backends.sqlite3', }, } USE_I18N = True USE_L10N = True INSTALLED_APPS = [ 'django....
1.671875
2
medium/380-Insert Delete GetRandom O(1).py
Davidxswang/leetcode
2
15331
""" https://leetcode.com/problems/insert-delete-getrandom-o1/ Implement the RandomizedSet class: bool insert(int val) Inserts an item val into the set if not present. Returns true if the item was not present, false otherwise. bool remove(int val) Removes an item val from the set if present. Returns true if the item w...
3.53125
4
src/main/generic_cpu/test3/generic_cpu.py
cicerone/kosim
2
15332
<filename>src/main/generic_cpu/test3/generic_cpu.py<gh_stars>1-10 #!/usr/bin/env python #============================================================================================== # Copyright (c) 2009 Kotys LLC. Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt o...
2.109375
2
smartools/patches/sheets.py
davocarli/smartools
2
15333
<gh_stars>1-10 import smartsheet # from smartsheet.smartsheet import fresh_operation from .__smartools import SmartoolsObject, access_levels, RequirementError from .typed_list import SmartoolsTypedList smart = smartsheet.Smartsheet("INIT") smart.Sheets class SmartoolsSheets(smartsheet.sheets.Sheets): def smartools(s...
2.390625
2
modules/persons/application/controllers/v1/phone/create_phone_controller.py
eduardolujan/hexagonal_architecture_django
6
15334
<gh_stars>1-10 # -*- coding: utf-8 -*- # Infra from modules.shared.infrastructure.log import LoggerDecorator, PyLoggerService # Application from modules.persons.application.create import PhoneCreator from modules.persons.application.create.command import CreatePhoneCommand # Domain from modules.shared.domain.http imp...
2.28125
2
tests/test_dispatch_sparql_query_model_catalog.py
KnowledgeCaptureAndDiscovery/OBA_sparql
5
15335
import json import logging import unittest from typing import Dict from SPARQLWrapper import JSONLD from obasparql.query_manager import QueryManager, QUERIES_TYPES, QUERY_TYPE_GET_ONE_USER from obasparql.utils import generate_uri from tests.settings import * logger = logging.getLogger('testing') graph_user = generat...
2.296875
2
cogs/ObjectCache.py
Deivedux/Shiramine
6
15336
<reponame>Deivedux/Shiramine import time import json import sqlite3 import os conn = sqlite3.connect('configs/Database.db') c = conn.cursor() start_time = time.time() with open('configs/config.json') as json_data: config = json.load(json_data) server_config_raw = c.execute("SELECT * FROM ServerConfig").fetchall() ...
2.40625
2
Python/valid-palindrome-ii.py
coolryze/LeetCode
2
15337
class Solution: def validPalindrome(self, s): """ :type s: str :rtype: bool """ left = 0 right = len(s)-1 while left < right: if s[left] != s[right]: return self.isPalindrome(s, left, right-1) or self.isPalindrome(s, left+1, right)...
3.640625
4
Afvaldienst/__init__.py
xirixiz/python-afvalwijzer-afvalstoffendienst
1
15338
__author__ = '<NAME> - xirixiz' __author_email__ = '<EMAIL>' __license__ = 'MIT' __maintainer_email__ = '<EMAIL>' __url__ = 'https://github.com/xirixiz/afvaldienst', __version__ = '1.1.4' from .Afvaldienst import Afvaldienst from .AfvaldienstScraper import AfvaldienstScraper
1.101563
1
src/python_lib_for_me/date.py
silverag-corgi/python-lib-for-me
0
15339
<reponame>silverag-corgi/python-lib-for-me ''' 日付モジュール ''' import calendar from datetime import date, datetime, timedelta from typing import Iterator from zoneinfo import ZoneInfo from dateutil.relativedelta import relativedelta def get_first_date_of_this_month(base_date: date) -> date: ''' 今月...
2.984375
3
tpi/main.py
karajan1001/tpi
5
15340
import argparse import logging log = logging.getLogger(__name__) def get_main_parser(): parser = argparse.ArgumentParser(prog="tpi") return parser def main(argv=None): parser = get_main_parser() args = parser.parse_args(argv) log.debug(args)
2.65625
3
catkin_ws/src/easter_egg_hunt/scripts/waypoint_states.py
pdscraml/bunny-hunter
0
15341
<gh_stars>0 #!/usr/bin/env python # Intro to Robotics - EE5900 - Spring 2017 # Final Project # Philip (Team Lead) # Ian # Akhil # # Revision: v1.2 # imports import rospy import smach import smach_ros import time import actionlib from easter_egg_hunt.srv import EnableDisc...
2.078125
2
templates/hello/views.py
cesarau04/python-react-webapp
0
15342
from flask import render_template, Blueprint hello_blueprint = Blueprint('hello', __name__) @hello_blueprint.route('/') @hello_blueprint.route('/hello') def index(): return render_template('index.html')
2.234375
2
project/api/views.py
akxen/pyomo-drf-docker
0
15343
<reponame>akxen/pyomo-drf-docker<filename>project/api/views.py from django.shortcuts import render from django.http import HttpResponse from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from .serializers import ModelDataSerializer from .optimisatio...
2.265625
2
icees_api/features/qgraph_utils.py
xu-hao/ddcr-api
2
15344
"""Query graph utilities.""" import re from bmt import Toolkit BMT = Toolkit() def get_subcategories(category): """Get sub-categories, according to the Biolink model.""" return [ descendant.replace("_", "") for descendant in BMT.get_descendants(category, formatted=True, reflexive=True) ]...
2.625
3
toy-evolve/weno.py
IanHawke/toy-evolve
0
15345
<gh_stars>0 import numpy C_3 = numpy.array([1, 2]) / 3 a_3 = numpy.array([[3, -1], [1, 1]]) / 2 sigma_3 = numpy.array([[[1, 0], [-2, 1]], [[1, 0], [-2, 1]]]) C_5 = numpy.array([1, 6, 3]) / 10 a_5 = numpy.array([[11, -7, 2], [2, 5, -1], [-1, 5, 2]]) / 6 sigma_5 = numpy.array([[[40, 0, 0], [-12...
1.914063
2
tests/test_optimize.py
ricosjp/siml
11
15346
from pathlib import Path import shutil import unittest import numpy as np import siml.optimize as optimize import siml.setting as setting class TestOptimize(unittest.TestCase): def test_generate_dict(self): main_setting = setting.MainSetting.read_settings_yaml( Path('tests/data/deform/optun...
2.34375
2
demo.py
natekspencer/vivintpy
3
15347
<filename>demo.py import asyncio import logging import os import pubnub from vivintpy.account import Account from vivintpy.devices import VivintDevice from vivintpy.devices.camera import MOTION_DETECTED, Camera from vivintpy.exceptions import VivintSkyApiMfaRequiredError pubnub.set_stream_logger(name="pubnub", level...
2.109375
2
qanda/views.py
Fnechz/StakeOverflow-Clone
0
15348
from django.contrib.auth.mixins import LoginRequiredMixin from django.http.response import HttpResponseRedirect, HttpResponseBadRequest from django.urls.base import reverse from django.utils import timezone from django.views.generic import ( CreateView, DayArchiveView, DetailView, RedirectView, Templ...
2.0625
2
incubator/bootstrap_cli/__main__.py
cognitedata/inso-bootstrap-cli
0
15349
# 888 888 # 888 888 # 888 888 # .d8888b 88888b. 8888b. 88888b. .d88b. .d88b. 888 .d88b. .d88b. # d88P" 888 "88b "88b 888 "88b d88P"88b d8P Y8b 888 d88...
1.5625
2
pyhcl/passes/expand_memory.py
raybdzhou/PyChip-py-hcl
0
15350
from typing import List, Dict from pyhcl.ir.low_ir import * from pyhcl.ir.low_prim import * from pyhcl.passes._pass import Pass from pyhcl.passes.utils import get_binary_width DEFAULT_READ_LATENCY = 0 DEFAULT_WRITE_LATENCY = 1 @dataclass class ExpandMemory(Pass): def run(self, c: Circuit): def get_mem_po...
2.390625
2
ClydeLog.py
bnadeau/open-test-jig
0
15351
import logging import time import os BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) format = "%(asctime)s %(levelname)-10s %(message)s" id = time.strftime("%Y%m%d-%H%M%S") #These are the sequences need to get colored ouput RESET_SEQ = "\033[0m" COLOR_SEQ = "\033[1;%dm" BOLD_SEQ = "\033[1m" def for...
2.671875
3
private_market/test.py
sigmoid3/Dapper
974
15352
<reponame>sigmoid3/Dapper<gh_stars>100-1000 from ethereum import tester as t from ethereum import utils def test(): s = t.state() test_company = s.abi_contract('company.se', ADMIN_ACCOUNT=utils.decode_int(t.a0)) order_book = s.abi_contract('orders.se') test_currency = s.abi_contract('currency.se', send...
2.40625
2
meshreg/visualize/samplevis.py
jonashein/handobjectnet_baseline
2
15353
<reponame>jonashein/handobjectnet_baseline<filename>meshreg/visualize/samplevis.py<gh_stars>1-10 import torch import numpy as np from libyana.visutils.viz2d import visualize_joints_2d from meshreg.datasets.queries import BaseQueries, TransQueries from meshreg.visualize import consistdisplay def get_check_none(data, ...
1.835938
2
api_app/api/dependencies/workspaces.py
gauravagrwal/AzureTRE
71
15354
from fastapi import Depends, HTTPException, Path, status from pydantic import UUID4 from api.dependencies.database import get_repository from db.errors import EntityDoesNotExist, ResourceIsNotDeployed from db.repositories.user_resources import UserResourceRepository from db.repositories.workspace_services import Works...
2.078125
2
nnef_tools/conversion/tensorflow/tf_pb_to_tf_py.py
rgiduthuri/NNEF-Tools
0
15355
<filename>nnef_tools/conversion/tensorflow/tf_pb_to_tf_py.py # Copyright (c) 2017 The Khronos Group Inc. # # 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...
1.695313
2
CS1410/p5test.py
Davidjbennett/DavidBennett.github.io
3
15356
import unittest from payroll import * class P2Test(unittest.TestCase): def setUp(self): self.emp = payroll.Employee('12-3456789', 'John', 'Doe', '123 Anystreet', 'Anytown', 'Anystate', '98765') def testHourly(self): rate = 35.5 self.emp.make_hourly(rate) for d in range(10): ...
3.484375
3
EXOSIMS/Completeness/BrownCompleteness.py
dgarrett622/EXOSIMS
0
15357
<reponame>dgarrett622/EXOSIMS # -*- coding: utf-8 -*- import time import numpy as np from scipy import interpolate import astropy.units as u import astropy.constants as const import os, inspect try: import cPickle as pickle except: import pickle import hashlib from EXOSIMS.Prototypes.Completeness im...
2.28125
2
pylsp/plugins/hover.py
nemethf/python-lsp-server
1
15358
# Copyright 2017-2020 Palantir Technologies, Inc. # Copyright 2021- Python Language Server Contributors. import logging from pylsp import hookimpl, _utils log = logging.getLogger(__name__) @hookimpl def pylsp_hover(document, position): code_position = _utils.position_to_jedi_linecolumn(document, position) ...
2.46875
2
LocStat/pipelines/output.py
nhtoshiaki/LocStat
0
15359
# -*- coding: utf-8 -*- import items class TxtFileWriter: """ Write the repository representation in the file. """ def __init__(self, file_path): self.file_path = file_path def __enter__(self): self.file = open(self.file_path, 'w', encoding='utf-8') return self def ...
3.25
3
greensinversion/regularization.py
isuthermography/greensinversion
1
15360
<reponame>isuthermography/greensinversion import numpy as np def apply_tikhonov_regularization(u,s,v,usetikparam,vector): #alpha = usetikparam*np.sqrt(u.shape[0]/v.shape[1]) # Tikhonov parameter interpreted as scaled by sqrt(matrix rows/matrix cols) so that it is directly interpretable as NETD/NESI (noise...
2.46875
2
examples/telebot.py
b3ntuz1/words
0
15361
import flask import telebot import words from dotenv import load_dotenv load_dotenv() app = flask.Flask(__name__) bot = telebot.TeleBot(environ.get("TG_TOKEN"), threaded=False) WEBHOOK_URL_PATH = "/%s/" % (environ.get("TG_TOKEN")) # # Remove webhook, it fails sometimes the set if there is a previous webhook # bot.re...
2.390625
2
lvsfunc/__init__.py
DeadNews/lvsfunc
0
15362
<filename>lvsfunc/__init__.py """ lvsfunc, a collection of VapourSynth functions and wrappers written and/or modified by LightArrowsEXE. If you spot any issues, please do not hesitate to send in a Pull Request or reach out to me on Discord (LightArrowsEXE#0476)! """ # flake8: noqa from . import aa, compa...
1.523438
2
Roman_to_Integer.py
sujitmandal/leetCode
0
15363
<filename>Roman_to_Integer.py<gh_stars>0 roman_dict = { "I" : 1, "V" : 5, "X" : 10, "L" : 50, "C" : 100, "D" : 500, "M" : 1000 } class Solution: def romanToInt(self, s: str) -> int: previous = 0 current = 0 result = 0 for x in s[::-1]: current = roman_dict[x] ...
3.421875
3
utils/warmup.py
hengwei-chan/3D_SBDD
67
15364
<gh_stars>10-100 """ MIT License Copyright (c) 2019 <NAME> 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 rights to use, copy, modify, merge...
1.648438
2
src/ee/deployers.py
marcelotrevisani/ee
5
15365
<filename>src/ee/deployers.py<gh_stars>1-10 import abc import logging from typing import List from ee.models import EnvironmentDefinition logger = logging.getLogger(__name__) class DeploymentBackend(abc.ABC): def run(self, env_def: EnvironmentDefinition, command: List[str]): """ This is the main...
2.8125
3
vb_simulation_pkgs/example_pkgs/pkg_moveit_examples/scripts/node_eg2_predefined_pose.py
ROBODITYA/Eyantra-2021-Vargi-Bots
1
15366
<filename>vb_simulation_pkgs/example_pkgs/pkg_moveit_examples/scripts/node_eg2_predefined_pose.py #! /usr/bin/env python import rospy import sys import copy import moveit_commander import moveit_msgs.msg import geometry_msgs.msg import actionlib class Ur5Moveit: # Constructor def __init__(self, arg_robot_nam...
2.25
2
plugins/pelican_gist/plugin.py
kura/kura.io
13
15367
# -*- coding: utf-8 -*- """ Gist embedding plugin for Pelican ================================= This plugin allows you to embed `Gists`_ into your posts. .. _Gists: https://gist.github.com/ """ from __future__ import unicode_literals import hashlib import logging import os import re import codecs import pygments lo...
2.328125
2
ass1/rsc/ts.py
suryaavala/network
0
15368
import time from socket import * import sys host = sys.argv[1] #port = sys.argv[2] #message = sys.argv[2] sock = socket(AF_INET, SOCK_DGRAM) sock.settimeout(1) sock.bind((str(host),0)) print(sock.getsockname(),sock.getsockname()[1]) port = 5967 for message in 'abcdefghijklmnopqrstuvwxyz': sock.sendto(message.e...
2.8125
3
django/docs/ref/contrib/auth.txt.py
roshanba/mangal
0
15369
<filename>django/docs/ref/contrib/auth.txt.py XXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XXXX XXXXXXXX XXXXXXXX XXX XXXXXXXXX XXXXXXXX XXX XXX XXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXX XXXXXXX XXX XXXX XXXXXXX XX XXX XXXXX XX XXXXX XXXXXXXXXX XX XXX XX XXXXXXXXX XXXXXXXXXXXXXX XXX XXXXXXXXXXXX...
1.484375
1
BIA 660 - Web Analytics/Assignments/Assignment 2/webcounter.py
ParasGarg/Stevens-Computer-Science-Courses-Materials
25
15370
""" A script that reads a file from the web and returns the all the words having frequency in between two words passed """ import re from nltk.corpus import stopwords import requests from operator import itemgetter def run(url, word1, word2): freq = {} # keep the freq of each word in the file freq[word1] = 0...
3.734375
4
dev/archery/archery/integration/util.py
palmerlao/arrow
0
15371
<gh_stars>0 # 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"); y...
1.960938
2
python/src/cmdline/write_struct.py
hgmelectronics/xcpsetup
0
15372
<reponame>hgmelectronics/xcpsetup #!/usr/bin/python3 import argparse import ctypes import json import sys if not '..' in sys.path: sys.path.append('..') from comm import BoardTypes from comm import CANInterface from comm import XCPConnection from util import plugins from util import ctypesdict from util import c...
2.140625
2
doc/python_api/examples/bpy.types.Depsgraph.1.py
rbabari/blender
365
15373
<gh_stars>100-1000 """ Dependency graph: Evaluated ID example ++++++++++++++++++++++++++++++++++++++ This example demonstrates access to the evaluated ID (such as object, material, etc.) state from an original ID. This is needed every time one needs to access state with animation, constraints, and modifiers taken into...
2.46875
2
upgrade-insecure-requests/support/generate.py
Thezone1975/wpt
1
15374
<reponame>Thezone1975/wpt # Usage: execute # $ python support/generate.py # at wpt/upgrade-insecure-requests/. # # Note: Some tests (link-upgrade.sub.https.html and # websocket-upgrade.https.html) are not covered by this generator script. template = '''<!DOCTYPE html> <html> <head> <!-- Generated by wpt/upgrade-insecu...
1.960938
2
model_constructor/mxresnet.py
ayasyrev/model_constructor
3
15375
<reponame>ayasyrev/model_constructor<gh_stars>1-10 from functools import partial from .activations import Mish from .net import Net __all__ = ['mxresnet_parameters', 'mxresnet34', 'mxresnet50'] mxresnet_parameters = {'stem_sizes': [3, 32, 64, 64], 'act_fn': Mish()} mxresnet34 = partial(Net, name='MXResnet32', expa...
1.929688
2
1.undersampling.py
Moons08/TalkingData-Fraud-Detection
1
15376
<filename>1.undersampling.py import os import pandas as pd from imblearn.under_sampling import RandomUnderSampler from contextlib import contextmanager import psutil import time @contextmanager def timer_memory(name): t0 = time.time() yield print( f'Memory: {(psutil.Process(os.getpid()).memory_in...
2.625
3
spydrnet/plugins/namespace_manager/tests/test_edif_namespace.py
ganeshgore/spydrnet
34
15377
<filename>spydrnet/plugins/namespace_manager/tests/test_edif_namespace.py import unittest import spydrnet as sdn class TestEdifNamespace(unittest.TestCase): original_default = None @classmethod def setUpClass(cls) -> None: cls.original_default = sdn.namespace_manager.default sdn.namespace_...
2.5
2
tf_agents/benchmark/distribution_strategy_utils.py
FlorisHoogenboom/agents
16
15378
# coding=utf-8 # Copyright 2018 The TF-Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
1.976563
2
barbarism.py
Matimed/Barbarism
2
15379
<reponame>Matimed/Barbarism import pygame as pg pg.init() from src.main import Main main = Main()
1.421875
1
frappe/patches/v7_0/desktop_icons_hidden_by_admin_as_blocked.py
anandpdoshi/frappe
0
15380
<filename>frappe/patches/v7_0/desktop_icons_hidden_by_admin_as_blocked.py import frappe def execute(): # all icons hidden in standard are "blocked" # this is for the use case where the admin wants to remove icon for everyone # in 7.0, icons may be hidden by default, but still can be shown to the user # e.g. Accou...
1.945313
2
gen_mirror_json.py
Ashwin4RC/api
0
15381
<filename>gen_mirror_json.py #!/usr/bin/env python3 # pylint: disable=missing-docstring,invalid-name,broad-except,cell-var-from-loop import hashlib import json import os import sys from utils import get_date_from_zip, get_metadata_from_zip ALLOWED_BUILDTYPES = ["Alpha", "Beta", "Official", "Gapps"] ALLOWED_VERSIONS...
2.140625
2
button/take_screen.py
PitPietro/gpiozero-pyqt5
0
15382
import os # from signal import pause from gpiozero import Button from datetime import datetime def take_screen(): screen_btn = Button(2) while True: if screen_btn.is_pressed: timestamp = datetime.now() cmd = "scrot -u d 5 $n {}.png".format('screen_' + str(timestamp)) ...
2.984375
3
year2020/day21.py
3schwartz/AdventOfCode
0
15383
<reponame>3schwartz/AdventOfCode<filename>year2020/day21.py<gh_stars>0 import common lines = common.get_lines('day21_data.txt') food_dict = {} all_ingredients = [] for line in lines: ingredients, allergens = line.split(' (contains ') allergens = allergens[:-1].split(', ') ingredients = ingredient...
3.09375
3
src/model_evaluation.py
Littleote/Analisis_de_contrasenyes
0
15384
# -*- coding: utf-8 -*- """ @author: david """ import matplotlib.pyplot as plt import seaborn as sns import numpy as np from sklearn.model_selection import KFold from sklearn.metrics import confusion_matrix, classification_report from sklearn.metrics import PrecisionRecallDisplay, RocCurveDisplay class ModelEvaluatio...
2.625
3
setup.py
zhuzhenping/hf_at_py
130
15385
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/11/20 8:15 # @Author : HaiFeng # @Email : <EMAIL> from setuptools import setup import os this_directory = os.path.abspath(os.path.dirname(__file__)) # 读取文件内容 def read_file(filename): with open(os.path.join(this_directory, filename), encoding='u...
1.882813
2
web_console_v2/api/fedlearner_webconsole/scheduler/transaction.py
chen1i/fedlearner
5
15386
<filename>web_console_v2/api/fedlearner_webconsole/scheduler/transaction.py<gh_stars>1-10 # Copyright 2020 The FedLearner 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 Li...
1.914063
2
src/openeo_grass_gis_driver/models/schema_base.py
marcjansen/openeo-grassgis-driver
7
15387
# -*- coding: utf-8 -*- import json from typing import List, Optional from flask import make_response __author__ = "<NAME>" __copyright__ = "Copyright 2018, <NAME>, mundialis" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" def as_dict_without_nones(o): d = o.__dict__ r = dict() for key in d: ...
2.6875
3
plugins/maya/inventory/action_update_namespace.py
davidlatwe/reveries-config
3
15388
<reponame>davidlatwe/reveries-config<filename>plugins/maya/inventory/action_update_namespace.py import avalon.api class UpdateNamespace(avalon.api.InventoryAction): """Update container imprinted namespace Sometimes artist may import loaded subsets from other scene, which may prefixing an extra namespace...
2.015625
2
src/outpost/django/salt/serializers.py
medunigraz/outpost.django.salt
0
15389
<reponame>medunigraz/outpost.django.salt import logging import gpg from rest_framework import serializers from .conf import settings from . import models logger = logging.getLogger(__name__) class PGPFileField(serializers.Field): def to_representation(self, value): with gpg.Context(armor=True) as c: ...
2.171875
2
demosauruswebapp/demosaurus/link_thesaurus.py
KBNLresearch/Demosaurus
1
15390
<filename>demosauruswebapp/demosaurus/link_thesaurus.py from flask import ( Blueprint, flash, g, redirect, render_template, get_template_attribute, request, url_for, jsonify ) #from ....dataprocessing import # dataprocessin .read_rdf import from demosauruswebapp.demosaurus.db import get_db import pandas as pd from ...
2.375
2
solver.py
IvoryCandy/char-rnn
0
15391
import math import numpy as np import torch from torch import nn from torch.backends import cudnn from torch.utils.data import DataLoader from tqdm import tqdm from model import CharRNN from data import TextDataset, TextConverter class Trainer(object): def __init__(self, args): self.args = args ...
2.34375
2
mayday_control/scripts/motion_control.py
LasseBoerresen/Mayday
2
15392
<reponame>LasseBoerresen/Mayday #!/usr/bin/env python import time import random import math import unittest import numpy as np import pandas as pd import std_msgs from std_msgs.msg import String # from control_msgs.msg import JointControllerState # from gazebo_msgs.msg import LinkStates # import matplotlib.pyplot as p...
2.09375
2
venv/lib/python3.9/site-packages/trio/socket.py
almmello/frozen
3
15393
<reponame>almmello/frozen # This is a public namespace, so we don't want to expose any non-underscored # attributes that aren't actually part of our public API. But it's very # annoying to carefully always use underscored names for module-level # temporaries, imports, etc. when implementing the module. So we put the # ...
1.632813
2
tests/test_encoders.py
alxlampe/d3rlpy
0
15394
import pytest from d3rlpy.models.torch.encoders import PixelEncoder from d3rlpy.models.torch.encoders import PixelEncoderWithAction from d3rlpy.models.torch.encoders import VectorEncoder from d3rlpy.models.torch.encoders import VectorEncoderWithAction from d3rlpy.encoders import create_encoder_factory from d3rlpy.enco...
2.09375
2
cam/03_face_recognition.py
kimtaehoho/osscap2020
0
15395
# -*- coding: utf-8 -*- #import game from glob import glob file1 = glob("01_face_dataset.py") file2 = glob("02_face_training.py") import facedataset import facetrain import cv2 import numpy as np import os from PIL import Image #facedataset.first() #facetrain.second() recognizer = cv2.face.LBPHFaceRecognizer_create() ...
2.703125
3
deprecated/dpr/code/encoder.py
eunaoeh/mrc-level2-nlp-01
1
15396
<reponame>eunaoeh/mrc-level2-nlp-01 from transformers import ( RobertaModel, RobertaPreTrainedModel, BertModel, BertPreTrainedModel, ) class BertEncoder(BertPreTrainedModel): def __init__(self, config): super(BertEncoder, self).__init__(config) self.bert = BertModel(config) ...
2.71875
3
tutorial/calculator/calculator.002.py
UltraStudioLTD/pyTermTk
1
15397
<reponame>UltraStudioLTD/pyTermTk<gh_stars>1-10 #!/usr/bin/env python3 # MIT License # # Copyright (c) 2022 <NAME> <<EMAIL>> # # 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 restric...
2.09375
2
dags/clix_static_visuals_dag.py
CLIxIndia-Dev/clix_dashboard_backend_AF
0
15398
# This DAG is for running python scripts to generate static visualisation data # from syncthing every month end import airflow from airflow import DAG from airflow.operators.bash_operator import BashOperator from airflow.operators.python_operator import PythonOperator from airflow.operators.dummy_operator import Dumm...
2.015625
2
nadl/__init__.py
siAyush/nadl
7
15399
<gh_stars>1-10 from nadl.tensor import Tensor from nadl.parameter import Parameter
1.046875
1