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 |
|---|---|---|---|---|---|---|
checkio/Scientific Expedition/Morse Clock/test_morse_clock.py | KenMercusLai/checkio | 39 | 12781451 | <gh_stars>10-100
import unittest
from morse_clock import checkio, to_binary
def test_to_binary():
assert to_binary('0') == '0000'
assert to_binary('1') == '0001'
assert to_binary('2') == '0010'
assert to_binary('3') == '0011'
assert to_binary('4') == '0100'
assert to_binary('5') == '0101'
... | 2.921875 | 3 |
Ejercicios/Diccionarios y sus metodos.py | dannieldev/Fundamentos-de-Python | 0 | 12781452 | dicionario = {
"redes_sociales":['Twitter','Facebook','LinkedIn'],
3:"Tres",
"Hola":"Mundo",
"eli":"elininame"
}
print (dicionario)
print (dicionario.pop(3))
del(dicionario["eli"])
print (dicionario)
dicionario.clear()
print (dicionario)
dicionario["clave_nueva"] = "Valor"
print... | 3.390625 | 3 |
EX.py/EX0010.py | Allen-Lee-Junior/ex-em-python | 1 | 12781453 | <filename>EX.py/EX0010.py
real = float(input('Quanto dinheiro voce tem na carteira?:'))
Dolar = real / 5.34
Renminbi = real / 0.81
Eurofrançes = real / 6.35
EuroPortugal = real / 6.35
Libras = real / 7.13
peso = real / 15.17
print('com {} RS$ voce compra US${:.2f}'.format(real, Dolar, ))
print('com {} RS$ voce compra 人... | 3.875 | 4 |
security/contrib/debug_toolbar_log/middleware.py | jsilhan/django-security | 0 | 12781454 | <reponame>jsilhan/django-security
from django.conf import settings as django_settings
from debug_toolbar.toolbar import DebugToolbar
from security.config import settings
from .models import DebugToolbarData
class DebugToolbarLogMiddleware:
def __init__(self, get_response=None):
self.get_response = get... | 2 | 2 |
hummingbot/connector/exchange/huobi/huobi_api_order_book_data_source.py | BGTCapital/hummingbot | 3,027 | 12781455 | #!/usr/bin/env python
import asyncio
import logging
import hummingbot.connector.exchange.huobi.huobi_constants as CONSTANTS
from collections import defaultdict
from typing import (
Any,
Dict,
List,
Optional,
)
from hummingbot.connector.exchange.huobi.huobi_order_book import HuobiOrderBook
from hum... | 1.671875 | 2 |
varifier/__main__.py | leoisl/varifier | 0 | 12781456 | #!/usr/bin/env python3
import argparse
import logging
import varifier
def main(args=None):
parser = argparse.ArgumentParser(
prog="varifier",
usage="varifier <command> <options>",
description="varifier: variant call adjudication",
)
parser.add_argument("--version", action="versio... | 2.515625 | 3 |
random_tweet.py | michaelbutler/random-tweet | 6 | 12781457 | <reponame>michaelbutler/random-tweet<gh_stars>1-10
import sys
from random_tweet.random_tweet_lib import get_random_tweet, format_tweet
def load_credentials(filepath: str) -> dict:
"""
Load a file containing key and secret credentials, separated by a line break (\n)
Returns a dict with the corresponding c... | 3.640625 | 4 |
python/pyabc/__init__.py | MarbleHE/ABC | 6 | 12781458 | <reponame>MarbleHE/ABC<gh_stars>1-10
from .ABCContext import ABCContext
from .ABCProgram import ABCProgram
from .ABCTypes import * | 1.21875 | 1 |
account/migrations/0002_account_statut.py | Rizvane95140/Educollab | 0 | 12781459 | # Generated by Django 3.0.2 on 2020-01-13 19:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='account',
name='statut',
fi... | 1.9375 | 2 |
tests/core/endpoints/test_eth_get_transaction_by_blockhash_and_index.py | cducrest/eth-tester-rpc | 3 | 12781460 | <filename>tests/core/endpoints/test_eth_get_transaction_by_blockhash_and_index.py
def test_eth_getTransactionByBlockHashAndIndex_for_unknown_hash(rpc_client):
result = rpc_client(
method="eth_getTransactionByBlockHashAndIndex",
params=["0x0000000000000000000000000000000000000000000000000000000000000... | 2.0625 | 2 |
decharges/parametre/tests/test_models.py | Brndan/decharges-sudeducation | 0 | 12781461 | import pytest
from decharges.parametre.models import ParametresDApplication
pytestmark = pytest.mark.django_db
def test_instanciate_parameters():
params = ParametresDApplication.objects.create()
assert f"{params}" == "Paramètres de l'application"
| 2.140625 | 2 |
src/my_project/easy_problems/from51to100/binary_tree_preorder_traversal.py | ivan1016017/LeetCodeAlgorithmProblems | 0 | 12781462 | <reponame>ivan1016017/LeetCodeAlgorithmProblems
from typing import List
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def __init__(self):
self.temp = []
... | 3.890625 | 4 |
adminmgr/media/code/python/red2/BD_204_219_1354_reducer.py | IamMayankThakur/test-bigdata | 9 | 12781463 | <reponame>IamMayankThakur/test-bigdata
#!/usr/bin/python3
import csv
from operator import itemgetter
import sys
runvery={}
final={}
for line in sys.stdin:
line = line.strip()
line_val = line.split("\t")
key, val = line_val[0], line_val[1]
keysplit=key.split(",")
bbpair=keysplit[0]+","+keysplit[1]
... | 2.90625 | 3 |
chem/ftlib/finetune/gtot.py | youjibiying/-GTOT-Tuning | 1 | 12781464 | import numpy as np
import torch
import torch.nn as nn
# Adapted from https://github.com/gpeyre/SinkhornAutoDiff
# Adapted from https://github.com/gpeyre/SinkhornAutoDiff/blob/master/sinkhorn_pointcloud.py
class GTOT(nn.Module):
r"""
GTOT implementation.
"""
def __init__(self, eps=0.1, thresh=0.1,... | 2.234375 | 2 |
smlogging.py | nooneisperfect/ReadYourMAPFile | 0 | 12781465 | <gh_stars>0
# -*- coding: utf-8 -*-
INFO = 1
ERROR = 2
DEBUG = 4
#loglevel = DEBUG | INFO | ERROR
loglevel = ERROR
def log(level, *args):
if (loglevel & level) != 0:
print (" ".join(map(str, args)))
| 2.90625 | 3 |
services/storage/src/simcore_service_storage/s3.py | colinRawlings/osparc-simcore | 25 | 12781466 | <reponame>colinRawlings/osparc-simcore
""" Module to access s3 service
"""
import logging
from typing import Dict
from aiohttp import web
from tenacity import before_sleep_log, retry, stop_after_attempt, wait_fixed
from .constants import APP_CONFIG_KEY, APP_S3_KEY
from .s3wrapper.s3_client import MinioClientWrapper
... | 1.921875 | 2 |
zeroae/goblet/chalice/__init__.py | andrew-mcgrath/zeroae-goblet | 1 | 12781467 | """The Chalice Blueprint and Configuration for the Goblin framework."""
from .blueprint import bp
from ..config import configure
__all__ = ["bp", "configure"]
| 1.0625 | 1 |
release/stubs.min/System/Windows/Forms/__init___parts/AutoCompleteMode.py | tranconbv/ironpython-stubs | 0 | 12781468 | class AutoCompleteMode(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies the mode for the automatic completion feature used in the System.Windows.Forms.ComboBox and System.Windows.Forms.TextBox controls.
enum AutoCompleteMode,values: Append (2),None (0),Suggest (1),SuggestAppend (3)
"""
def Inst... | 2.03125 | 2 |
code/run/remote-server/admin_views.py | xianggenb/Android-Studio-Health-Monitor-App | 0 | 12781469 | from admin_app_config import db
from models import (User, HazardSummary, HazardLocation)
from views.home_view import HomeView
from views.login_view import LoginView
from views.logout_view import LogoutView
from views.user_view import UserView
from views.mobile_view import (MobileLoginView, MobileView)
from views.user_d... | 1.851563 | 2 |
BlogNews/BlogNews/pipelines.py | c727657851/ScrapyPratice | 0 | 12781470 | <reponame>c727657851/ScrapyPratice
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from itemadapter import ItemAdapter
from twiste... | 2.5 | 2 |
multi_channel_RI.py | salesforce/RIRL | 0 | 12781471 | <filename>multi_channel_RI.py
#
# Copyright (c) 2022, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
import numpy as np
import torch
import torch.nn as nn
from torch.dis... | 2.609375 | 3 |
site-packages/oslo_utils/tests/test_fixture.py | hariza17/freezer_libraries | 0 | 12781472 | <reponame>hariza17/freezer_libraries
# Copyright 2015 OpenStack Foundation
# 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/l... | 2.046875 | 2 |
GmailBot.py | umaimagit/EverydayTasksAutomation | 0 | 12781473 | <reponame>umaimagit/EverydayTasksAutomation
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 27 16:16:27 2019
@author: Umaima
"""
# Gmail automation with selenium
from selenium import webdriver
#from selenium.webdriver.common.keys import Keys
import time
class GmailBot:
def __init__(self, email, password):
... | 3.03125 | 3 |
mntnr_hardware/__init__.py | wryfi/mntnr_hardware | 0 | 12781474 | <reponame>wryfi/mntnr_hardware
from enumfields import Enum
class RackOrientation(Enum):
FRONT = 1
REAR = 2
class Labels:
FRONT = 'Front-facing'
REAR = 'Rear-facing'
class SwitchSpeed(Enum):
TEN = 10
ONE_HUNDRED = 100
GIGABIT = 1000
TEN_GIGABIT = 10000
FORTY_GIGABIT =... | 2.625 | 3 |
practice.py | betweak-ml/machinelearning1 | 0 | 12781475 | <reponame>betweak-ml/machinelearning1
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Author: 'Tweakers'
# '<EMAIL>'
#
# Created on 17/07/2019
import tensorflow as tf
tf.gradients() | 1.5625 | 2 |
Benchmarking/Config/create_benchmark_job.py | CipiOrhei/eecvf | 1 | 12781476 | <reponame>CipiOrhei/eecvf
import glob
import os
import shutil
import config_main
from Benchmarking.CM_Benchmark.basic_benchmark.fom import run_CM_benchmark_FOM, run_CM_benchmark_SFOM
from Benchmarking.CM_Benchmark.basic_benchmark.psnr import run_CM_benchmark_PSNR
from Benchmarking.CM_Benchmark.basic_benchmark.IoU impo... | 2.203125 | 2 |
Snippets/code-gym-1/the_letter_is.py | ursaMaj0r/python-csc-125 | 0 | 12781477 | <filename>Snippets/code-gym-1/the_letter_is.py
# input
input_word = input("Enter a word: ")
# response
for letter in input_word:
print("The letter is {}.".format(letter))
| 3.921875 | 4 |
Src/WorkItemEventProcessor.Tests/Dsl/tfs/loadparentwi.py | rfennell/TfsAlertsDsl | 0 | 12781478 | <filename>Src/WorkItemEventProcessor.Tests/Dsl/tfs/loadparentwi.py
wi = GetWorkItem(99)
parentwi = GetParentWorkItem(wi)
if parentwi == None:
print("Work item '" + str(wi.Id) + "' has no parent")
else:
print("Work item '" + str(wi.Id) + "' has a parent '" + str(parentwi.Id) + "' with the title '" + parentwi.Ti... | 2.296875 | 2 |
main.py | itsdaniele/graphtrans | 0 | 12781479 | <reponame>itsdaniele/graphtrans<gh_stars>0
import os
import random
from datetime import datetime
import configargparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import wandb
from loguru import logger
from ogb.graphproppred import Evaluator, PygGra... | 2.09375 | 2 |
plugin/keypair.py | angry-tony/mist-cloudify-plugin | 6 | 12781480 | import os
from plugin import connection
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.decorators import operation
# TODO Are methods like `_get_path_to_key_file()` necessary, since we do not
# save keys on the local filesystem?
@operation
def creation_validation(**_):
... | 2.421875 | 2 |
src/interface/__init__.py | ARTIEROCKS/artie-emotional-webservice | 0 | 12781481 | <filename>src/interface/__init__.py<gh_stars>0
from .emotional_interface import EmotionalInterface | 1.179688 | 1 |
total_process.py | shingiyeon/cs474 | 0 | 12781482 | <filename>total_process.py
import methods
import decoder
import postprocessing
import nltk
if __name__ == "__main__":
# nltk.download()
#methods.preprocessing("./data/temp/")
decoder.predict()
postprocessing.postprocessing("./")
| 1.8125 | 2 |
troposphere_mate/associate/apigw.py | tsuttsu305/troposphere_mate-project | 10 | 12781483 | <reponame>tsuttsu305/troposphere_mate-project
# -*- coding: utf-8 -*-
from troposphere_mate import Ref, GetAtt, Sub
from troposphere_mate import awslambda, apigateway
from ..core.associate_linker import Linker, x_depends_on_y, LinkerApi as LinkerApi_
from ..core.metadata import (
TROPOSPHERE_METADATA_FIELD_NAME,
... | 1.890625 | 2 |
modeltasks/eval.py | AshivDhondea/DFTS_compat_v1 | 3 | 12781484 | import numpy as np
import sys
from collections import Counter
class CFeval(object):
"""Classification evaluator class"""
def __init__(self, metrics, reshapeDims, classes):
"""
# Arguments
metrics: dictionary of metrics to be evaluated, currently supports only classification accuracy
reshapeDims: list of th... | 2.859375 | 3 |
loopchain/baseservice/rest_service.py | JINWOO-J/loopchain | 1 | 12781485 | <reponame>JINWOO-J/loopchain<filename>loopchain/baseservice/rest_service.py
# Copyright 2018 ICON Foundation
#
# 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/lice... | 1.765625 | 2 |
Project_2/connect4/TD_learning/connect4.py | ElchinValiyev/GameAI | 0 | 12781486 | <reponame>ElchinValiyev/GameAI
import matplotlib.pyplot as plt
import numpy as np
import random
BOARDWIDTH = 7
BOARDHEIGHT = 6
EMPTY = 0
def make_autopct(values):
def my_autopct(pct):
if pct == 0:
return ""
else:
return '{p:.2f}% '.format(p=pct)
return my_autopct
de... | 3.609375 | 4 |
pyntcontrib/__init__.py | rags/pynt-contrib | 5 | 12781487 | import contextlib
import os
from subprocess import check_call, CalledProcessError
import sys
from pynt import task
__license__ = "MIT License"
__contact__ = "http://rags.github.com/pynt-contrib/"
@contextlib.contextmanager
def safe_cd(path):
"""
Changes to a directory, yields, and changes back.
Additional... | 2.875 | 3 |
koku/sources/test/test_kafka_listener.py | Vasyka/koku | 2 | 12781488 | <reponame>Vasyka/koku<filename>koku/sources/test/test_kafka_listener.py
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Test the Sources Kafka Listener handler."""
import queue
from random import choice
from unittest.mock import patch
from uuid import uuid4
import requests_mock
from django.d... | 1.578125 | 2 |
images.py | ahrnbom/guts | 0 | 12781489 | """
Copyright (C) 2022 <NAME>
Released under MIT License. See the file LICENSE for details.
Module for some classes that describe sequences of images.
If your custom dataset stores images in some other way,
create a subclass of ImageSequence and use it.
"""
from typing import List
import numpy ... | 2.96875 | 3 |
python/shellchain.py | sharmavins23/Shellchain | 0 | 12781490 | from time import time
import hashlib
import json
from urllib.parse import urlparse
import requests
# Class definition of our shellchain (Blockchain-like) object
class Shellchain:
def __init__(self): # constructor
self.current_transactions = []
self.chain = []
self.rivers = set()
... | 3.234375 | 3 |
LineByLineEqualEvaluator.py | revygabor/HWTester | 0 | 12781491 | <reponame>revygabor/HWTester
import Evaluator
class LineByLineEqualEvaluator(Evaluator.Evaluator):
def __init__(self, details):
pass
def evaluate(self, input, target_output, output, log):
if output != target_output:
output_lines = output.split("\n")
target_output_lines ... | 2.78125 | 3 |
acora/__init__.py | scoder/acora | 209 | 12781492 | """\
Acora - a multi-keyword search engine based on Aho-Corasick trees.
Usage::
>>> from acora import AcoraBuilder
Collect some keywords::
>>> builder = AcoraBuilder('ab', 'bc', 'de')
>>> builder.add('a', 'b')
Generate the Acora search engine::
>>> ac = builder.build()
Search a string for all occ... | 2.609375 | 3 |
python/01/led_pwm_hw.py | matsujirushi/raspi_parts_kouryaku | 6 | 12781493 | <filename>python/01/led_pwm_hw.py
import sys
import pigpio
LED_PIN = 12
LED_PWM_FREQUENCY = 8000
pwm_duty = float(sys.argv[1])
pi = pigpio.pi()
pi.set_mode(LED_PIN, pigpio.OUTPUT)
pi.hardware_PWM(LED_PIN, int(LED_PWM_FREQUENCY), int(pwm_duty * 1e6))
| 3.046875 | 3 |
src/app.py | arashshams/dsci532-group3 | 0 | 12781494 | import os
import dash
import dash_html_components as html
import dash_core_components as dcc
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
import altair as alt
import geopandas as gpd
import pandas as pd
from datetime import datetime, date
import json
import plotly.express as px... | 2.75 | 3 |
config/api_router.py | sonlinux/itez | 0 | 12781495 | <gh_stars>0
from django.conf import settings
from rest_framework.routers import DefaultRouter, SimpleRouter
from itez.users.api.views import UserViewSet
from itez.beneficiary.api.views import (
ProvinceAPIView,
DistrictAPIView,
ServiceAreaAPIView,
WorkDetailAPIView
)
if settings.DEBUG:
router = De... | 1.765625 | 2 |
iss/south_migrations/0002_auto__del_countrycode.py | rerb/iss | 0 | 12781496 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'CountryCode'
db.delete_table('iss_countrycode')
d... | 2.171875 | 2 |
tests/__init__.py | MassDynamics/protein-inference | 4 | 12781497 |
import sys, os
path = os.path.dirname(__file__)
path = os.path.join(path, '..', 'protein_inference')
if path not in sys.path:
sys.path.append(path) | 2.359375 | 2 |
tests/test_optimization.py | nachovizzo/pyLiDAR-SLAM | 0 | 12781498 | <filename>tests/test_optimization.py
import unittest
import torch
from pylidar_slam.common.optimization import PointToPlaneCost, GaussNewton
from pylidar_slam.common.pose import Pose
class MyTestCase(unittest.TestCase):
def test_gauss_newton(self):
tgt_points = torch.randn(2, 100, 3, dtype=torch.float64)... | 2.3125 | 2 |
indico_toolkit/association/__init__.py | IndicoDataSolutions/Indico-Solutions-Toolkit | 6 | 12781499 | from .line_items import LineItems
from .extracted_tokens import ExtractedTokens
from .split_merged_values import split_prediction_into_many
from .positioning import Positioning
| 0.992188 | 1 |
daraja_api/utils.py | jakhax/python_daraja_api | 4 | 12781500 | <filename>daraja_api/utils.py<gh_stars>1-10
import phonenumbers
from daraja_api.conf import AbstractConfig
from daraja_api.exceptions import DarajaException
def format_phone_number(phone_number:str, format='E164'):
try:
phone_number = phonenumbers.parse(phone_number,"KE")
if... | 2.71875 | 3 |
py_hardway/ex7_s.py | missulmer/Pythonstudy | 0 | 12781501 | <reponame>missulmer/Pythonstudy
# study drills
# the next three lines print the quoted strings.
# where the %s appears it prints the variable defined in short quotes defined at the
# end of the line
print "Mary had a little lamb."
print "Its fleece was white as %s." 'snow'
print "And everywhere that Mary went."
# wh... | 4.15625 | 4 |
GDSII_Library.py | UUhy/PythonGDSII | 6 | 12781502 | #!/usr/bin/env ipython
import numpy as np
import re
import datetime as dt
import copy
from GDSII import GDSII
from GDSII_Structure import GDSII_Structure
class GDSII_Library(GDSII):
'''
GDSII_Library class : subclass of GDSII
GDSII Stream file format release 6.0
Library record
The librar... | 2.5 | 2 |
introduction_frechette/models.py | Charlotte-exp/Multichannel-Games | 0 | 12781503 | <filename>introduction_frechette/models.py
from otree.api import (
models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer,
Currency as c, currency_range
)
import itertools
author = 'Charlotte'
doc = """
The instructions and consent for the control treatment.
I decided to have t... | 2.546875 | 3 |
q3/q3/drivers/driverBase.py | virtimus/makaronLab | 2 | 12781504 | <reponame>virtimus/makaronLab
class Q3DriverBase:
def __init__(self,_self,parent,impl):
self._object = impl
self._impl = impl
self._parent = parent
self._self = _self
#@deprecated - use self
def s(self):
return self._self
def self(self):
return self._s... | 2.328125 | 2 |
python_code/data_scraping.py | brschneidE3/LegalNetworks | 2 | 12781505 |
"""
ADD A DESCRIPTION OF WHAT THIS FILE IS FOR
"""
__author__ = 'brsch'
import helper_functions
import os
import time
import json
proj_cwd = os.path.dirname(os.getcwd())
data_dir = proj_cwd + r'/data'
# Unchanging courtlistener API info
site_dict_url = 'https://www.courtlistener.com/api/rest/v3/'
site_dict = helpe... | 2.859375 | 3 |
parser/team01/analizador_sintactico.py | susanliss/tytus | 0 | 12781506 | <gh_stars>0
import ply.yacc as yacc
import tempfile
from analizador_lexico import tokens
from analizador_lexico import analizador
from Nodo import *
from expresiones import *
from instrucciones import *
from graphviz import *
# Asociación de operadores y precedencia
# precedence = (
# ('left','MAS'),
# ('l... | 2.578125 | 3 |
htsohm/bin/cube_pore_sweep_setup.py | mas828/htsohm | 2 | 12781507 | <filename>htsohm/bin/cube_pore_sweep_setup.py
#!/usr/bin/env python3
import click
import numpy as np
from sqlalchemy.orm import joinedload
from htsohm import load_config_file, db
from htsohm.db import Material
@click.command()
@click.argument('config-path', type=click.Path())
def sweep_setup(config_path):
config... | 2.125 | 2 |
bazelrio/dependencies/wpilib/2022_1_1/deps.bzl | noamzaks/bazelrio | 5 | 12781508 | <filename>bazelrio/dependencies/wpilib/2022_1_1/deps.bzl
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazelrio//:deps_utils.bzl", "cc... | 1.1875 | 1 |
restler/decorators.py | agostodev/restler | 1 | 12781509 | <gh_stars>1-10
from restler import UnsupportedTypeError
def unsupported(type_):
"""
Mark types for that aren't supported
:param type_: Model type
:return: a handler that raises and UnsupportedTypeError for that type
"""
def handler(obj):
raise UnsupportedTypeError(type_)
return han... | 2.515625 | 3 |
mllearn/alg_adapt/mlknn.py | Lxinyuelxy/multi-label-learn | 4 | 12781510 | <filename>mllearn/alg_adapt/mlknn.py
import copy
import numpy as np
from sklearn.neighbors import NearestNeighbors
class MLKNN:
def __init__(self, k = 6):
self.k = k
def fit(self, X, y):
self.X = X
self.y = y
self.m = X.shape[0]
self.label_count = y.shape[1]
se... | 3.171875 | 3 |
for_interfaces.py | cybermetabolism/devoji-to-gitcoin-bounty-oracle | 0 | 12781511 | html_code = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jekyll ui</title>
</head>
<body>
<h2>emoji language gitcoin bounty</h2>
<p>Please enter the emoji code here: </p>
<input type="button" value="🐛" id="button1"/>
<input type="button" value="🌟" id="button2"/>
<input... | 2.25 | 2 |
emf/emf_funks.py | markmbaum/emf | 1 | 12781512 | from . import os, np, pd
from . import emf_class
def _path_manage(filename_if_needed, extension, **kwargs):
"""This function takes a path string through the kwarg 'path' and
returns a path string with a file name at it's end, to save a file
at that location. If the path string is a directory (ends with a ... | 3.40625 | 3 |
pyrobud/custom_modules/debug.py | x0x8x/pyrobud | 0 | 12781513 | from re import compile, MULTILINE
import telethon as tg
from pyrobud.util.bluscream import UserStr, telegram_uid_regex
from .. import command, module
class DebugModuleAddon(module.Module):
name = "Debug Extensions"
@command.desc("Dump all the data of a message to your cloud")
@command.alias... | 2.21875 | 2 |
screen_reader.py | vivek-kumar9696/Quickdraw_LOGO_Detection | 0 | 12781514 |
# coding: utf-8
# In[ ]:
import cv2
from keras.models import load_model
import numpy as np
from collections import deque
from keras.preprocessing import image
import keras
import os
# In[ ]:
model1 = load_model('mob_logo_model.h5')
val = ['Adidas','Apple','BMW','Citroen','Fedex','HP','Mcdonalds','Nike','none'... | 2.828125 | 3 |
BaseType/Const.py | dimiroul/BacktestFramePublic | 0 | 12781515 | <filename>BaseType/Const.py
import pandas
import os
class const(object):
"""
const(object):用于保存回测框架使用的各种常量的类
"""
def __init__(self):
self.constants = dict()
def __getitem__(self, item):
if item not in self.constants:
raise RuntimeError("const {:s} not defined".format(... | 2.75 | 3 |
tests/model_test.py | gaganchhabra/appkernel | 156 | 12781516 | import json
from decimal import Decimal
from pymongo import MongoClient
from appkernel import PropertyRequiredException
from appkernel.configuration import config
from appkernel.repository import mongo_type_converter_to_dict, mongo_type_converter_from_dict
from .utils import *
import pytest
from jsonschema import valid... | 2.296875 | 2 |
mailchimp_marketing_asyncio/models/gallery_folder.py | john-parton/mailchimp-asyncio | 0 | 12781517 | <filename>mailchimp_marketing_asyncio/models/gallery_folder.py
# coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: <EMAIL>
Generated by: https://github... | 2.015625 | 2 |
tests/test_processing_rt.py | jdowlingmedley/pyomeca | 0 | 12781518 | from itertools import permutations
import numpy as np
import pytest
from pyomeca import Angles, Rototrans, Markers
SEQ = (
["".join(p) for i in range(1, 4) for p in permutations("xyz", i)]
+ ["zyzz"]
+ ["zxz"]
)
SEQ = [s for s in SEQ if s not in ["yxz"]]
EPSILON = 1e-12
ANGLES = Angles(np.random.rand(4, ... | 2.234375 | 2 |
applications/popart/bert/tests/unit/tensorflow/transformer_position_encoding_test.py | xihuaiwen/chinese_bert | 0 | 12781519 | <filename>applications/popart/bert/tests/unit/tensorflow/transformer_position_encoding_test.py
# Copyright 2019 Graphcore Ltd.
import math
import pytest
import numpy as np
import tensorflow as tf
import popart
from bert_model import BertConfig, Bert
# Extracted from the official Transformer repo:
# https://github.com/... | 2.171875 | 2 |
vision/tests/unit/test_helpers.py | DaveCheez/google-cloud-python | 2 | 12781520 | <filename>vision/tests/unit/test_helpers.py
# Copyright 2017, Google LLC 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.... | 2.390625 | 2 |
screen-pass/models.py | jmatune/screen-pass | 0 | 12781521 | <filename>screen-pass/models.py
import numpy as np
import pandas as pd
from keras.layers import Conv2D, Dense, Dropout | 1.414063 | 1 |
messages/GetUserIdMessage.py | zadjii/nebula | 2 | 12781522 | # last generated 2016-10-14 13:51:52.122000
from messages import BaseMessage
from msg_codes import GET_USER_ID as GET_USER_ID
__author__ = 'Mike'
class GetUserIdMessage(BaseMessage):
def __init__(self, username=None):
super(GetUserIdMessage, self).__init__()
self.type = GET_USER_ID
self.us... | 2.46875 | 2 |
users/models.py | thiagoferreiraw/mixapp | 4 | 12781523 | from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from events.models import Category, Language, City
import uuid
class UserCategory(models.Model):
user_id = models.ForeignKey(User)
category_id = models.F... | 2.21875 | 2 |
basicprograms/StudentDetails.py | poojavaibhavsahu/Pooja_Python | 0 | 12781524 | <reponame>poojavaibhavsahu/Pooja_Python
stuname="pooja"
rollno=102
age=25
marks=98.7
print("Student nameis:",stuname,"\n","student roll no is",rollno,"\n",
"student age is",age,"\n","student marks is",marks) | 2.984375 | 3 |
Curso em video/005.py | wandersoncamp/python | 0 | 12781525 | <reponame>wandersoncamp/python
n=int(input("Informe um numero: "))
print("Analisando o valor", n, ", seu antecessor é", n-1, ", e seu sucessor é", n+1)
| 3.703125 | 4 |
pedigree/woah2.py | careforsometeasir/workexperience2018 | 0 | 12781526 | <reponame>careforsometeasir/workexperience2018<filename>pedigree/woah2.py
# By <NAME> 2018
import csv
# CSV module is used for various delimiter separated files
# ~~ the comments following PEP8 - comments should start with '# ' - are actual comments
# the rest is code that's been commented out ~~
# Here's t... | 3.828125 | 4 |
openpipe/utils/action_loader.py | OpenPipe/openpipe | 2 | 12781527 | <gh_stars>1-10
"""
This module provides action load and instantiation functions
"""
import traceback
import re
import sys
from sys import stderr
from os import getenv, getcwd
from os.path import splitext, join, dirname, expanduser, abspath
from importlib import import_module
from glob import glob
from wasabi import Tra... | 2.390625 | 2 |
dataset/prepare_SIG17.py | Susmit-A/FSHDR | 6 | 12781528 | import shutil, os, glob
src = 'train'
dst = 'SIG17/train'
if not os.path.exists('SIG17'):
os.mkdir('SIG17')
os.mkdir(dst)
elif not os.path.exists(dst):
os.mkdir(dst)
count = 1
for s in glob.glob(src + '/*'):
d = dst + '/{:03d}'.format(count)
if not os.path.exists(d):
os.mkdir(d... | 2.5 | 2 |
emka_trans/accounts/forms.py | mmamica/ERP-system | 0 | 12781529 | <reponame>mmamica/ERP-system
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserChangeForm
from accounts.models import UserProfileInfo
from django.contrib.auth.forms import UserChangeForm
from django.contrib.auth import authenticate
import requests
from admin_... | 2.078125 | 2 |
col and pos.py | 01ritvik/whatsapp-chatbox | 0 | 12781530 | import pyautogui as pt
from time import sleep
while True:
posXY = pt.position()
print(posXY, pt.pixel(posXY[0],posXY[1]))
sleep(1)
if posXY[0] == 0:
break
# this program will tell axis of the cursor
# program will end if x-axis = 0
| 2.90625 | 3 |
zim_to_md.py | xuyuan/zim_to | 0 | 12781531 | '''
command for zim custom tool: python path/to/zim_to_md.py -T %T -f %f -D %D
* Markdown format: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
'''
import argparse
import pyperclip
from zim.formats import get_parser, StubLinker
from zim.formats.markdown import Dumper as TextDumper
class Dumper(... | 3.03125 | 3 |
simplecv/core/config.py | Bobholamovic/SimpleCV | 44 | 12781532 | <reponame>Bobholamovic/SimpleCV
from ast import literal_eval
import warnings
class AttrDict(dict):
def __init__(self, **kwargs):
super(AttrDict, self).__init__(**kwargs)
self.update(kwargs)
@staticmethod
def from_dict(dict):
ad = AttrDict()
ad.update(dict)
return a... | 2.765625 | 3 |
modelling/scripts/percentdiscrep_marconvert_splitintozones.py | bcgov-c/wally | 0 | 12781533 | <reponame>bcgov-c/wally<filename>modelling/scripts/percentdiscrep_marconvert_splitintozones.py
import pandas as pd
import csv
# import data
df = pd.read_csv("../data/2_scrape_results/watersheds_quantiles_out_7_16_2021.csv")
# 20 percent discrepancy
indexNames = df[((df['drainage_area'] / df['drainage_area_gross']) - ... | 2.546875 | 3 |
setup.py | TommyStarK/apyml | 1 | 12781534 | # -*- coding: utf-8 -*-
from setuptools import find_packages
from cx_Freeze import setup, Executable
import apyml
install_requires = [
'cx_Freeze'
'pandas'
]
setup(
name='apyml',
version=apyml.__version__,
packages=find_packages(),
author=apyml.__author__,
author_email='<EMAIL>',
... | 1.460938 | 1 |
neon_utils/skills/common_message_skill.py | NeonMariia/neon-skill-utils | 0 | 12781535 | <reponame>NeonMariia/neon-skill-utils
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework
# All trademark and other rights reserved by their respective owners
# Copyright 2008-2022 Neongecko.com Inc.
# Contributors: <NAME>, <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <NAME>
# BSD-3 License
#... | 0.894531 | 1 |
study/vanilla/models.py | NunoEdgarGFlowHub/wavetorch | 470 | 12781536 | import torch
import torch.nn as nn
from torch.nn import functional as F
class CustomRNN(nn.Module):
def __init__(self, input_size, output_size, hidden_size, batch_first=True, W_scale=1e-1, f_hidden=None):
super(CustomRNN, self).__init__()
self.input_size = input_size
self.output_size = out... | 2.546875 | 3 |
src/larval_gonad/plotting/literature.py | jfear/larval_gonad | 1 | 12781537 | <reponame>jfear/larval_gonad
from typing import List
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import seaborn as sns
from larval_gonad.io import feather_to_cluster_matrix
from larval_gonad.plotting.common import get_fbgn2symbol
from larval_gonad.plotti... | 2.4375 | 2 |
views/frames/join_room_wait_frame.py | MrKelisi/battle-python | 0 | 12781538 | import time
from tkinter import *
from model.battle import ClientBattle
class JoinRoomWaitFrame(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.label = Label(self, font=("Helvetica", 18))
self.label.pack(side="top", pady=20)
self.players = Listbox(self)
... | 2.90625 | 3 |
code/test/test_compress.py | hackffm/actioncam | 4 | 12781539 | import helper_test
from configuration import Configuration
from local_services import Compress
from helper import Helper
configuration = Configuration('actioncam', path=helper_test.config_path())
helper = Helper(configuration.config)
helper.state_set_start()
debug = True
compress = Compress(configuration, helper, deb... | 2.609375 | 3 |
third-party/casadi/experimental/sailboat.py | dbdxnuliba/mit-biomimetics_Cheetah | 8 | 12781540 | #
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 <NAME>, <NAME>, <NAME>,
# <NAME>. All rights reserved.
# Copyright (C) 2011-2014 <NAME>
#
# CasADi is free software; you can redistribute it and/or
# ... | 2.078125 | 2 |
p731_my_calendar_ii.py | feigaochn/leetcode | 0 | 12781541 | <reponame>feigaochn/leetcode<filename>p731_my_calendar_ii.py
#!/usr/bin/env python
# coding: utf-8
class MyCalendarTwo:
def __init__(self):
self.events = []
def book(self, start, end):
"""
:type start: int
:type end: int
:rtype: bool
"""
events = self.... | 3.859375 | 4 |
tests/test_fixtures.py | khusrokarim/ward | 0 | 12781542 | <reponame>khusrokarim/ward
from ward import expect, fixture, test
from ward.fixtures import Fixture, FixtureCache
@fixture
def exception_raising_fixture():
def i_raise_an_exception():
raise ZeroDivisionError()
return Fixture(fn=i_raise_an_exception)
@test("FixtureCache.cache_fixture can store and r... | 2.421875 | 2 |
binance_trading_bot/owl.py | virtueistheonlygood/trading-analysis-bot | 1 | 12781543 | from binance_trading_bot import utilities, visual, indicator
import matplotlib.pyplot as plt
plt.style.use('classic')
from matplotlib.ticker import FormatStrFormatter
import matplotlib.patches as mpatches
import math
def volume_spread_analysis(client, market,
NUM_PRICE_STEP, TIME_FRAME_STEP... | 2.46875 | 2 |
Python/zzz_training_challenge/Python_Challenge/solutions/ch03_recursion/solutions/ex02_digits.py | Kreijeck/learning | 0 | 12781544 | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by <NAME>
def count_digits(value):
if value < 0:
raise ValueError("value must be >= 0")
# rekursiver Abbruch
if value < 10:
return 1
# rekursiver Abstieg
return count_digits(value // 10) + 1
def count_digits_... | 3.90625 | 4 |
Projects/Online Workouts/w3resource/Basic - Part-I/program-77.py | ivenpoker/Python-Projects | 1 | 12781545 | <reponame>ivenpoker/Python-Projects<gh_stars>1-10
# !/usr/bin/env python3
#######################################################################################
# #
# Program purpose: Test whether system is big-endian platform ... | 2.546875 | 3 |
Crawler/src/crawl/crawler.py | cam626/RPEye-Link-Analysis | 2 | 12781546 | <filename>Crawler/src/crawl/crawler.py
""" This script the function to crawl links.
Good test cases & their behaviors:
https://.com -- crawl_link returns an error -- none of the excepts catch this
https://rpi.edu.com -- takes a long time to respond
"""
import urllib.request
from urllib.error import URLError, HTTP... | 3.625 | 4 |
back_end/test/b64_decode.py | Wizard-J/Jsite | 0 | 12781547 | <reponame>Wizard-J/Jsite<gh_stars>0
import base64
path = "E:\\project\\JSite\\front_end\\src\\statics\\img\\sidebar-bg.jpg"
with open(path,"rb") as f:
img = f.read()
# print(base64.b64encode(img))
encoded = base64.b64encode(img)
with open("./sidebar-bg-b64","wb") as coded:
coded.write(encod... | 1.984375 | 2 |
python/code_challenges/fizz_buzz_tree/fizz_buzz_tree/fizz_buzz_tree.py | HishamKhalil1990/data-structures-and-algorithms | 0 | 12781548 | <filename>python/code_challenges/fizz_buzz_tree/fizz_buzz_tree/fizz_buzz_tree.py
from .tree import BinaryTree,Queue,EmptyTreeException,Tree_Node
def Fizz_Buzz_Tree(Binary_tree):
def fuzz_buzz(value):
if value % 3 == 0 and value % 5 == 0:
return 'FizzBuzz'
elif value % 3 == 0:
... | 3.765625 | 4 |
JChipClient.py | mbuckaway/CrossMgr | 1 | 12781549 | #!/usr/bin/env python
#------------------------------------------------------------------------------
# JChipClient.py: JChip simulator program for testing JChip interface and CrossMgr.
#
# Copyright (C) <NAME>, 2012.
import os
import time
import xlwt
import socket
import random
import operator
import datetime
#-----... | 2.4375 | 2 |
blockchain/settings.py | sdediego/blockchain-api-client | 2 | 12781550 | #!/usr/bin/env python
# encoding: utf-8
# Settings for Blockchain API project
# Configure Blockchain API resources
RESOURCES = {
'charts': 'BlockchainAPIChart',
'stats': 'BlockchainAPIStatistics',
'pools': 'BlockchainAPIPool',
}
# Blockchain Charts
CHARTS = [
# Bitcoin stats
'total-bitcoins',
... | 1.382813 | 1 |