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 |
|---|---|---|---|---|---|---|
pennylane/transforms/hamiltonian_expand.py | rmoyard/pennylane | 0 | 12776651 | <reponame>rmoyard/pennylane
# Copyright 2018-2021 Xanadu Quantum Technologies 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/LICENSE-2.0
# Unless r... | 2.46875 | 2 |
Tests/Environments/Connect4/test_createMirroredStateAndPolicy.py | ikaroszhang96/Convex-AlphaZero | 0 | 12776652 | from Main.Environments.Connect4 import Constants, Utils
from Tests.Environments.Connect4 import testCasesRawEvaluate
from unittest import TestCase
import numpy as np
class TestCreateMirroredStateAndPolicy(TestCase):
def testMirrorState(self):
AMOUNT_OF_TESTS_PER_CASE = 10
for case in te... | 2.390625 | 2 |
Server/Sock_Conn.py | vinaysb/DroidStreamDeck | 1 | 12776653 | from PyQt5.QtCore import QThread, pyqtSignal
import settings
import socket
import Hotkey_Press
class Sock_Conn(QThread):
closeDiag = pyqtSignal()
def __init__(self):
QThread.__init__(self)
def __del__(self):
self.wait()
def run(self):
s = socket.socket(socket... | 2.5625 | 3 |
catalog/urls.py | edwildson/djangosecommerce | 1 | 12776654 | <reponame>edwildson/djangosecommerce
from django.conf.urls import url, include
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.product_list, name='product_list'),
url(r'^(?P<slug>[\w_-]+)$', views.category, name='category'),
url(r'^produto/(?P<slug>[\w_-]+)$', views.... | 1.789063 | 2 |
graph4nlp/pytorch/test/seq_decoder/graph2seq/src/g2s_v2/core/utils/constants.py | stjordanis/graph4nlp | 18 | 12776655 | """
Module to handle universal/general constants used across files.
"""
################################################################################
# Constants #
################################################################################
# GENERAL CONSTANTS:
VERY_SMALL_NUMBER = 1e-31
INF = 1e20
_PAD_TOKEN... | 1.875 | 2 |
tests/test_catch_server.py | kiwicom/pytest-catch-server | 5 | 12776656 | def test_catch_server__get(testdir):
testdir.makepyfile(
"""
import urllib.request
def test_get(catch_server):
url = "http://{cs.host}:{cs.port}/get_it".format(cs=catch_server)
request = urllib.request.Request(url, method="GET")
with urllib.request.urlop... | 2.71875 | 3 |
tests/unit_tests/sql_parse_tests.py | mis-esta/superset | 1 | 12776657 | # 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 u... | 1.960938 | 2 |
step0/changes/updateByLine.py | funderburkjim/boesp-prep | 0 | 12776658 | """updateByLine.py Begun Apr 10, 2014
This program is intended to be rather general.
The 'changein' file consists of a sequence of line pairs:
nn old old-text
nn new new-text
nn is the line number (starting at 1) in the input vcp file.
'old' and 'new' are fixed.
old-text should be identical to the text of line ... | 2.984375 | 3 |
ox_mon/common/__init__.py | emin63/ox_mon | 0 | 12776659 | """Package with toosl common to various areas of ox_mon
"""
| 1.03125 | 1 |
Python/CCC - Roll the Dice.py | RobinNash/Solutions-to-Competition-Problems | 0 | 12776660 | <reponame>RobinNash/Solutions-to-Competition-Problems<filename>Python/CCC - Roll the Dice.py
# Roll the Dice #
# November 17, 2018
# By <NAME>
n = int(input())
m = int(input())
if n > 10:
n = 9
if m > 10:
m = 9
ways = 0
for n in range (1,n+1):
for m in range(1,m+1):
if n + m == 10:... | 3.640625 | 4 |
source/code/elm327/358-turn-signal.py | wosk/nissan-leaf-obd-manual | 4 | 12776661 | <reponame>wosk/nissan-leaf-obd-manual
#!/usr/bin/env python
"""358 turn signal
Query the turn signal status of a Nissan Leaf using an ELM327 compatible diagnostic
tool.
Tested on the following vehicles:
* AZE0
"""
import serial
elm = serial.Serial("/dev/ttyUSB0", 38400, timeout=5)
elm.write(b"ATZ\r") # reset al... | 2.671875 | 3 |
snake/constants.py | ajutras/plexsnake | 0 | 12776662 | <filename>snake/constants.py
from enum import Enum
from typing import Type, Union
from plexapi.library import MovieSection, MusicSection, PhotoSection, ShowSection
SECTION_TYPE = Union[Type[MovieSection], Type[MusicSection], Type[PhotoSection], Type[ShowSection]]
VIDEO_EXTENSIONS = ["mkv", "mp4", "avi", "mpeg", "fl... | 2.453125 | 2 |
satdetect/viz/VizUtil.py | michaelchughes/satdetect | 3 | 12776663 | '''
VizUtil.py
Utilities for displaying satellite images,
with (optional) bound-box annotations
'''
import numpy as np
from matplotlib import pylab
import os
import skimage.color
def imshow(Im, block=False, figID=1):
figH = pylab.figure(num=figID)
figH.clf()
pylab.imshow(Im)
pylab.draw()
pylab.show(block=bl... | 2.5 | 2 |
ex075b.py | wtomalves/exerciciopython | 1 | 12776664 | <filename>ex075b.py
núm = (int(input('Digite um número: ')), \
int(input('Digite outro número: ')), \
int(input('Digite mais um número: ')),\
int(input('Digite o último número: ')))
print(f'Você digitou os valores {núm}')
print(f'O valor 9 apareceu {núm.count(9)} vezes!')
if 3 in núm:
... | 4.28125 | 4 |
tests/test_d12f.py | doismellburning/django12factor | 70 | 12776665 | from __future__ import absolute_import
import django12factor
import unittest
import django
from .env import env
d12f = django12factor.factorise
def debugenv(**kwargs):
return env(DEBUG="true", **kwargs)
class TestD12F(unittest.TestCase):
def test_object_no_secret_key_prod(self):
with env(DEBUG="... | 2.34375 | 2 |
build_tools/fix_info_plist.py | im-hjk/coffeegrindsize | 44 | 12776666 | <reponame>im-hjk/coffeegrindsize<gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-#
###############################################################################
#
# fix_info_plist.py: Support script for coffeegrindsize Mac executable build
#
###############################################################... | 2.140625 | 2 |
module/caffe/module.py | dividiti/ck-caffe | 212 | 12776667 | #
# Collective Knowledge (caffe CK front-end)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: cTuning foundation, <EMAIL>, http://cTuning.org
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal data)
ck=N... | 2 | 2 |
multiscale/toolkits/cw_ssim.py | uw-loci/multiscale_imaging | 1 | 12776668 | <filename>multiscale/toolkits/cw_ssim.py
# -*- coding: utf-8 -*-
"""
Complex-wavelet structural similarity metric
Created on Tue Mar 20 10:50:24 2018
@author: mpinkert
"""
import multiscale.bulk_img_processing as blk
import os
from PIL import Image
from ssim.ssimlib import SSIM
import csv
def compare_ssim(one_path... | 2.390625 | 2 |
convert.py | CTCSU/anaylyse_file_structure | 0 | 12776669 | import re
from node import Node
last_result = {'line':'','level':0}
def convertStringListToNode(str_list, rex_list, current_level=0, node=Node()):
while len(str_list) > 0:
line = str_list[0]
line_level = getLineLevel(line, rex_list)
if (line_level > current_level):
ch... | 3.125 | 3 |
curso/aula_29.py | ealgarve/GUI-Python | 0 | 12776670 | Carros = ['HRV', 'Polo', 'Jetta', 'Palio', 'Fusca']
itCarros = iter(Carros)
while itCarros:
try:
print(next(itCarros))
except StopIteration:
print('Fim da Lista.')
break | 3.8125 | 4 |
laLiga.py | mlavador/Practica1TD | 0 | 12776671 | <reponame>mlavador/Practica1TD
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox import options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.firefox.options im... | 2.859375 | 3 |
narwhal/plotting/colors.py | njwilson23/narwhal | 10 | 12776672 | <reponame>njwilson23/narwhal
def default_colors(n):
n = max(n, 8)
clist = ["#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e", "#e6ab02",
"#a6761d", "#666666"]
return clist[:n]
| 2.40625 | 2 |
libraries/instagram/api.py | cca/libraries_wagtail | 9 | 12776673 | <filename>libraries/instagram/api.py<gh_stars>1-10
import logging
import re
import requests
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.validators import URLValidator
from .models import InstagramOAuthToken
# these functions will be used inside management scri... | 2.609375 | 3 |
examples/utility_scripts/make_h5sig.py | bendichter/api-python | 32 | 12776674 | <filename>examples/utility_scripts/make_h5sig.py<gh_stars>10-100
# This script runs utility 'nwb.h5diffsig' to generate a text summary of
# hdf5 (nwb) file contents which can be used to compare one hdf5 to another.
import sys
import glob
import os, fnmatch
from subprocess import check_output
from sys import version_i... | 3.140625 | 3 |
habitrac/habits/migrations/0002_auto_20210224_2212.py | IgnisDa/habitrac | 0 | 12776675 | <gh_stars>0
# Generated by Django 3.1 on 2021-02-24 16:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('habits', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='dailyhabit',
name='name_slug',... | 1.851563 | 2 |
tests/units/test_rotated_files.py | IOTs-Projects/fiware-skuld | 1 | 12776676 | # -*- coding: utf-8 -*-
# Copyright 2015-2016 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FIWARE project.
#
# 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:
#
# htt... | 2.328125 | 2 |
fibonacci.py | haverfordcs/105lab2-marisleysisdelacruz16 | 0 | 12776677 | def nth_fibonacci_using_recursion(n):
if n < 0:
raise ValueError("n should be a positive number or zero")
else:
if n == 1:
return 0
elif n == 2:
return 1
else:
return nth_fibonacci_using_recursion(n - 2) + nth_fibonacci_using_recursion(n - 1)
... | 4.34375 | 4 |
Machine_Learning/svm.py | AndrewQuijano/ML_Module | 0 | 12776678 | <reponame>AndrewQuijano/ML_Module
from sklearn import svm
from sklearn.model_selection import GridSearchCV, RandomizedSearchCV
from joblib import dump
import time
import numpy as np
from .misc import plot_grid_search
def get_svm(train_x, train_y, n_fold=10, slow=False):
start_time = time.time()
best_svm = tun... | 2.84375 | 3 |
03Friclass.py | Ayon134/code_for_Kids | 0 | 12776679 | <filename>03Friclass.py<gh_stars>0
'''
import turtle
wn = turtle.Screen()
color=["orange","blue","red"]
t = turtle.Turtle()
t.goto(100,100)
t.forward(100)
t.fd(100)
t.shapesize(1,5,10)
'''
import turtle
t=turtle.Turtle()
turtle.bgcolor("#CD853F")
#t.shapesize(1,5,5)
t.fillcolor("red")
#t.shape("triangle")
t.pen(... | 3.375 | 3 |
mangle-infra-agent/Faults/helper/FaultHelper.py | vmaligireddy/mangle | 0 | 12776680 | <reponame>vmaligireddy/mangle
'''
Created on Jan 5, 2021
@author: jayasankarr
'''
import logging
import os
import subprocess
log = logging.getLogger("python_agent")
def add_standard_sub_directories_to_path():
if os.path.isdir("/sbin"):
os.environ["PATH"] += os.pathsep + "/sbin"
if os.... | 2.078125 | 2 |
zeex/core/views/actions/analyze.py | zbarge/dbtrix | 10 | 12776681 | <filename>zeex/core/views/actions/analyze.py
"""
MIT License
Copyright (c) 2016 <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... | 1.632813 | 2 |
app/views/reports.py | jubbp/maker-hub | 4 | 12776682 | <filename>app/views/reports.py
import fastapi
from fastapi_chameleon import template
from starlette.requests import Request
from app.viewmodels.reports.overview_viewmodel import OverviewViewModel
router = fastapi.APIRouter()
@router.get("/reports")
@template()
async def overview(request: Request):
vm = Overview... | 2.203125 | 2 |
pdf/trade_price.py | byegates/ark | 3 | 12776683 | <filename>pdf/trade_price.py
import tabula
import pandas as pd
import numpy as np
ip_dir = 'docs/'
op_dir = 'csv/'
files = {
"ARK_Trades_asof_20200521.pdf",
"ARK_Trades_asof_20201111.pdf",
}
floats = ['price', 'low', 'high', 'close']
keys = ['date', 'action', 'symbol']
cols0 = keys + floats
cols1 = cols... | 2.578125 | 3 |
pycgnat/translator/direct.py | williamabreu/routeros-cgnat | 3 | 12776684 | <filename>pycgnat/translator/direct.py
from collections import OrderedDict
from ipaddress import IPv4Address, IPv4Network
from pycgnat.utils.vlsm import split_subnet
def cgnat_direct(
private_net: IPv4Network, public_net: IPv4Network, private_ip: IPv4Address
) -> OrderedDict:
"""Calculate the public IP and p... | 2.703125 | 3 |
projects/authorization.py | catami/catami | 1 | 12776685 | <reponame>catami/catami
import logging
from django.contrib.auth.models import Group, User
from django.db import transaction
from django.dispatch import receiver
import guardian
from guardian.models import UserObjectPermission
from guardian.shortcuts import assign_perm, remove_perm, get_users_with_perms, get_perms
from ... | 2.109375 | 2 |
Dijkstra's_Shortest_Path/Python/paveldedik/dijkstra.py | Mynogs/Algorithm-Implementations | 1,184 | 12776686 | <reponame>Mynogs/Algorithm-Implementations
def initialize(G, s):
"""Initialize graph G and vertex s."""
V, E = G
d = {v: float('inf') for v in V}
p = {v: None for v in V}
d[s] = 0
return d, p
def dijkstra(G, w, s):
"""Dijkstra's algorithm for shortest-path search."""
d, p = initialize(... | 3.875 | 4 |
integration-test/tests/test_integration_test.py | chatchai-hub/tmkms-light | 11 | 12776687 | from integration_test import __version__
import os
import subprocess
import urllib.request
import json
import time
from pathlib import Path
def test_basic():
tm = os.getenv('TENDERMINT')
tmhome = os.getenv('TMHOME')
tmkms = os.getenv('TMKMS')
kmsconfig = os.getenv('TMKMSCONFIG')
tmkms_proc = subpro... | 2.21875 | 2 |
tests/test_excel.py | hacklabr/django-rest-pandas | 1,097 | 12776688 | <gh_stars>1000+
from rest_framework.test import APITestCase
from tests.testapp.models import TimeSeries
from wq.io import load_file
class ExcelTestCase(APITestCase):
def setUp(self):
data = (
('2014-01-01', 0.5),
('2014-01-02', 0.4),
('2014-01-03', 0.6),
('2... | 2.375 | 2 |
main.py | diegossl/Compiler | 0 | 12776689 | <filename>main.py
from src.compiler import Compiler
compiler = Compiler()
compiler.run() | 1.40625 | 1 |
setup.py | orgito/1forge-client | 0 | 12776690 | # pylint: disable=C0111
from setuptools import setup
with open("README.md", "r") as fh:
README = fh.read()
setup(
name='oneforge',
version='0.1.0',
description='1Forge REST API wrapper',
long_description=README,
long_description_content_type='text/markdown',
author='<NAME>',
author_ema... | 1.351563 | 1 |
src/config.py | stupiding/insightface | 0 | 12776691 | <reponame>stupiding/insightface<filename>src/config.py
import numpy as np
import os
from easydict import EasyDict as edict
config = edict()
config.bn_mom = 0.9
config.workspace = 256
config.emb_size = 512
config.ckpt_embedding = True
config.net_se = 0
config.net_act = 'prelu'
config.net_unit = 3
config.net_input = 1
... | 1.875 | 2 |
dsio/dashboard/kibana.py | ufoioio/datastream.io | 897 | 12776692 | <filename>dsio/dashboard/kibana.py<gh_stars>100-1000
import elasticsearch
from kibana_dashboard_api import Visualization, Dashboard
from kibana_dashboard_api import VisualizationsManager, DashboardsManager
from ..exceptions import KibanaConfigNotFoundError
def generate_dashboard(es_conn, sensor_names, index_name, t... | 2.5625 | 3 |
backend/billparser/importers/statuses.py | Congress-Dev/congress-dev | 9 | 12776693 | <reponame>Congress-Dev/congress-dev
import os
from billparser.status_parser import parse_archive
url_format = "https://www.govinfo.gov/bulkdata/BILLSTATUS/{congress}/{prefix}/BILLSTATUS-{congress}-{prefix}.zip"
congresses = [116]
def download_path(url: str):
os.makedirs("statuses", exist_ok=True)
output_name... | 3.078125 | 3 |
uranium_quantum/circuit_exporter/cirq-exporter.py | radumarg/uranium_quantum | 0 | 12776694 | <reponame>radumarg/uranium_quantum
import importlib
BaseExporter = importlib.import_module("uranium_quantum.circuit_exporter.base-exporter")
class Exporter(BaseExporter.BaseExporter):
def _define_import_code_section(self):
return f"\
import cirq\n\
import numpy as np\n\
\n\
q = [cirq.NamedQubit('q' + str... | 2.453125 | 2 |
fortnite_api/cosmetics.py | Fortnite-API/py-wrapper | 20 | 12776695 | import math
from datetime import datetime
from fortnite_api.enums import BrCosmeticType, BrCosmeticRarity
class NewBrCosmetics:
def __init__(self, data):
self.build = data.get('build')
self.previous_build = data.get('previousBuild')
self.hash = data.get('hash')
try:
s... | 2.859375 | 3 |
test/imgkit_test.py | guilhermef/imgkit | 0 | 12776696 | <filename>test/imgkit_test.py<gh_stars>0
# -*- coding: utf-8 -*-
import os
import io
import sys
import codecs
import unittest
import tempfile
import aiounittest
# Prepend ../ to PYTHONPATH so that we can import IMGKIT form there.
TEST_ROOT = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.realpa... | 2.484375 | 2 |
tests/trac/test-trac-0132.py | eLBati/pyxb | 123 | 12776697 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import sys
import pyxb
import unittest
class TestTrac0132 (unittest.TestCase):
message = 'bad character \u2620'
def testDecode (self):
... | 2.546875 | 3 |
lib/pics.py | MuffinAmor/nellie | 1 | 12776698 | <gh_stars>1-10
import json
import os
import sys
def create():
if not os.path.isfile('pics'):
try:
os.mkdir('pics')
except:
pass
def add_pic(token, name, author_id: str, time: str, datas):
try:
create()
if not os.path.isfile("pics/{}.jso... | 2.671875 | 3 |
server/plugins/gatekeeper/gatekeeper.py | nathandarnell/sal | 215 | 12776699 | <gh_stars>100-1000
from django.db.models import Q
import sal.plugin
TITLES = {
'ok': 'Machines with Gatekeeper enabled',
'alert': 'Machines without Gatekeeper enabled',
'unknown': 'Machines with unknown Gatekeeper status'}
PLUGIN_Q = Q(pluginscriptsubmission__plugin='Gatekeeper')
SCRIPT_Q = Q(pluginscrip... | 2.015625 | 2 |
comicolorization/extensions/__init__.py | DwangoMediaVillage/Comicolorization | 122 | 12776700 | <gh_stars>100-1000
from .save_images import SaveGeneratedImageExtension, SaveRawImageExtension
| 1.09375 | 1 |
omnikinverter/models.py | klaasnicolaas/python-omnikinverter | 5 | 12776701 | <gh_stars>1-10
"""Models for Omnik Inverter."""
from __future__ import annotations
import json
import re
from dataclasses import dataclass
from typing import Any
from .exceptions import OmnikInverterWrongSourceError, OmnikInverterWrongValuesError
@dataclass
class Inverter:
"""Object representing an Inverter res... | 2.8125 | 3 |
bumblebee_status/util/algorithm.py | rosalogia/bumblebee-status | 1,089 | 12776702 | import copy
def merge(target, *args):
"""Merges arbitrary data - copied from http://blog.impressiver.com/post/31434674390/deep-merge-multiple-python-dicts
:param target: the data structure to fill
:param args: a list of data structures to merge into target
:return: target, with all data in args merg... | 3.359375 | 3 |
blitz_api/migrations/0014_model_translation.py | Jerome-Celle/Blitz-API | 3 | 12776703 | <gh_stars>1-10
# Generated by Django 2.0.2 on 2018-10-26 01:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blitz_api', '0013_historicalacademicfield_historicalacademiclevel_historicalactiontoken_historicaldomain_historicalorg'),
]
operation... | 1.65625 | 2 |
src/build/lib/binance_f/model/openinterest.py | Han1018/Cryptocurrency-Automated-Trading | 13 | 12776704 | <reponame>Han1018/Cryptocurrency-Automated-Trading
class OpenInterest:
def __init__(self):
self.symbol = ""
self.openInterest = 0.0
@staticmethod
def json_parse(json_data):
result = OpenInterest()
result.symbol = json_data.get_string("symbol")
result.openInter... | 3.171875 | 3 |
player.py | tterava/PokerTrainingFramework | 5 | 12776705 | '''
Created on Jan 26, 2017
@author: tommi
'''
from enum import Enum
from handeval import pcg_brand
class Action(Enum):
CHECKFOLD = 1
CHECKCALL = 2
BETRAISE = 3
class Street(Enum):
PREFLOP = 0
FLOP = 3
TURN = 4
RIVER = 5
SHOWDOWN = 6
class PlayerState:
ST... | 3.171875 | 3 |
drv/rpg/west_end.py | pelegm/drv | 1 | 12776706 | """
.. west_end.py
"""
## Framework
import drv.game.base
## Sugar
ndk = drv.game.base.ndk
def test(skill, target):
""" Return a random variable which rolls a *skill* d6 dice, sums it, and
checks whether it is at least *target*. """
dice = ndk(skill, 6)
tst = (dice + skill) >= target
tst.name("d6... | 2.890625 | 3 |
src/usecases/update/update_engagement.py | lokaimoma/BLOGG | 13 | 12776707 | from typing import Callable
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from src.domain_logic.engagement_domain import EngagementDomain
from src.model import get_database_session
from src.model.engagement import Engagement
async def update_engagement(engagement_domain: EngagementDo... | 2.359375 | 2 |
api/kubeops_api/migrations/0021_merge_20190923_0906.py | 240325184/KubeOperator | 3 | 12776708 | <reponame>240325184/KubeOperator
# Generated by Django 2.1.2 on 2019-09-23 09:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('kubeops_api', '0019_deployexecution_params'),
('kubeops_api', '0020_auto_20190920_0946'),
]
operations = [
]
| 0.859375 | 1 |
takeoff/tests/generators/web/web_project_generator_test.py | themarceloribeiro/takeoff-py | 0 | 12776709 | from unittest import TestCase
from unittest.mock import MagicMock
from unittest.mock import patch
from takeoff import *
import os
class WebProjectGeneratorTest(TestCase):
def setUp(self):
os.system('rm -rf test_dist/blog')
self.g = WebProjectGenerator('blog', [])
self.real_system_call = se... | 2.453125 | 2 |
laa_court_data_api_app/models/hearing_events/hearing_events_result.py | ministryofjustice/laa-court-data-api | 1 | 12776710 | <reponame>ministryofjustice/laa-court-data-api<gh_stars>1-10
from typing import Optional
from uuid import UUID
from pydantic import BaseModel
from laa_court_data_api_app.models.hearing_events.hearing_event.result.hearing_event import HearingEvent
class HearingEventsResult(BaseModel):
hearing_id: Optional[UUID] ... | 2.21875 | 2 |
tofawiki/domain/wikidata_translator.py | Nintendofan885/tofawiki | 0 | 12776711 | <filename>tofawiki/domain/wikidata_translator.py
import re
import sys
import pywikibot
from pywikibot import ItemPage
from SPARQLWrapper import JSON, SPARQLWrapper
class WikidataTranslator:
def __init__(self, repo, cache=None):
self.repo = repo
self.cache = cache
self.endpoint_url = "http... | 2.671875 | 3 |
pytorch_layers/config.py | shuohan/pytorch-layers | 0 | 12776712 | # -*- coding: utf-8 -*-
"""Configurations and Enums"""
from enum import Enum
from singleton_config import Config as _Config
class ActivMode(str, Enum):
"""Enum of the activation names."""
RELU = 'relu'
LEAKY_RELU = 'leaky_relu'
class NormMode(str, Enum):
"""Enum of the normalization names."""
B... | 2.546875 | 3 |
datastructures/doubly_linked_list/doubly_linked_list.py | abhishekmulay/ds-algo-study | 0 | 12776713 | <gh_stars>0
class Node(object):
def __init__(self, data, next, prev):
self.data = data
self.next = next
self.previous = prev
def get_data(self):
return self.data
def set_data(self, data):
self.data = data
def get_next(self):
return self.next
def se... | 3.921875 | 4 |
metacells/pipeline/clean.py | orenbenkiki/metacells | 0 | 12776714 | <gh_stars>0
"""
Clean
-----
Raw single-cell RNA sequencing data is notoriously noisy and "dirty". The pipeline steps here
performs initial analysis of the data and extract just the "clean" data for actually computing the
metacells. The steps provided here are expected to be generically useful, but as always specific
d... | 2.40625 | 2 |
tests/utils/require.py | AmyYH/phantoscope | 0 | 12776715 | import time
from functools import wraps
from operators.operator import register_operators, delete_operators, operator_detail
from pipeline.pipeline import create_pipeline, delete_pipeline
from application.application import new_application, delete_application
def pre_operator(name="pytest_op_1", type="encoder",
... | 2.265625 | 2 |
polling_stations/apps/data_importers/management/commands/import_tewkesbury.py | smsmith97/UK-Polling-Stations | 29 | 12776716 | from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "TEW"
addresses_name = (
"2021-04-07T14:05:20.464410/Democracy_Club__06May2021_Tewkesbury Borough.tsv"
)
stations_name = (
"2021-04-07T14:05... | 2.703125 | 3 |
aoc/day17/__init__.py | scorphus/advent-of-code-2020 | 9 | 12776717 | <filename>aoc/day17/__init__.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of Advent of Code 2020
# https://github.com/scorphus/advent-of-code-2020
# Licensed under the BSD-3-Clause license:
# https://opensource.org/licenses/BSD-3-Clause
# Copyright (c) 2020, <NAME> <<EMAIL>>
import itertools
... | 3.40625 | 3 |
libs/yowsup/yowsup/yowsup/demos/contacts/__init__.py | akshitpradhan/TomHack | 22 | 12776718 | from .stack import YowsupSyncStack
| 1.023438 | 1 |
python_scripts/layer_utils.py | rwilliams01/isogeometric_application | 0 | 12776719 | <reponame>rwilliams01/isogeometric_application
import math
from KratosMultiphysics import *
from KratosMultiphysics.StructuralApplication import *
from KratosMultiphysics.DiscontinuitiesApplication import *
from KratosMultiphysics.IsogeometricApplication import *
#
# Collapse each layer in Layers; every layer maintain... | 2.328125 | 2 |
2020/13/solution1.py | frenzymadness/aoc | 2 | 12776720 | with open("input.txt") as input_file:
time = int(input_file.readline().strip())
busses = input_file.readline().strip().split(",")
def departures(bus):
multiplier = 0
while True:
multiplier += 1
yield multiplier * bus
def next_after(bus, time):
for departure in departures(bus):
... | 3.609375 | 4 |
test_wsgi.py | MLGB3/buildout.mlgb | 0 | 12776721 | <gh_stars>0
import sys
def application(environ, start_response):
status = '200 OK'
output = ''
output += 'sys.version = %s\n' % repr(sys.version)
output += 'sys.prefix = %s\n' % repr(sys.prefix)
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(le... | 2.25 | 2 |
diff_ana.py | shun60s/glottal-source-spectrum | 2 | 12776722 | #coding:utf-8
# return candidate position set of one pitch duration near center of the frame
# by differential change point and threshold from bottom line.
# return 0 if there is no.
#
# 中心付近の1ピッチ分の候補インデックス[sp,ep]を返す。
# 候補が無いときは零を返す。
#
# 微分の変化点と閾値により候補を選出する。
import numpy as np
import matplotlib.pyplot as ... | 2.578125 | 3 |
plugins/example/models.py | collingreen/yaib_ludumdare | 1 | 12776723 | <reponame>collingreen/yaib_ludumdare
from sqlalchemy import Table, Column, String, Integer
from modules.persistence import Base, getModelBase
"""
Specify custom database tables for your plugins by creating classes here that
subclass Base and the custom ModelBase and include sqlalchemy fields. See the
sqlalchemy docs... | 2.53125 | 3 |
class9/ex4/mytest/world.py | patrebert/pynet_cert | 0 | 12776724 | def func3():
print "world.py func3"
class MyClass:
def __init__(self,arg1, arg2, arg3):
self.arg1 = arg1
self.arg2 = arg2
self.arg3 = arg3
def hello(self):
print "hello"
print " %s %s %s" %(self.arg1,self.arg2,self.arg3)
def not_hello(self):
print "no... | 3.796875 | 4 |
leetcode/lessons/linked_list/092_reverse_between/__init__.py | wangkuntian/leetcode | 0 | 12776725 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__project__ = 'leetcode'
__file__ = '__init__.py'
__author__ = 'king'
__time__ = '2019/11/18 16:54'
_ooOoo_
o8888888o
88" . "88
(| -_- |)
... | 2.359375 | 2 |
tests/CallejeroTestCase.py | santiagocastellano/normalizador-amba-Python3 | 4 | 12776726 | # coding: UTF-8
import unittest
from usig_normalizador_amba.Callejero import Callejero
from usig_normalizador_amba.Partido import Partido
from usig_normalizador_amba.Calle import Calle
from tests.test_commons import cargarCallejeroEstatico
class CallejeroTestCase(unittest.TestCase):
p = Partido('jose_c_paz', '... | 2.578125 | 3 |
SoundServer_test.py | yoyoberenguer/SoundServer | 0 | 12776727 |
try:
import pygame
except ImportError:
raise ImportError("\n<pygame> library is missing on your system."
"\nTry: \n C:\\pip install pygame on a window command prompt.")
from SoundServer import *
if __name__ == "__main__":
pygame.mixer.init()
sound1 = pygame.mixer.Sound('Ala... | 2.8125 | 3 |
neurolib/models/multimodel/builder/aln.py | FabianKamp/neurolib | 0 | 12776728 | <reponame>FabianKamp/neurolib
import logging
import os
from copy import deepcopy
import numba
import numpy as np
import symengine as se
from h5py import File
from jitcdde import input as system_input
from ....utils.stimulus import OrnsteinUhlenbeckProcess
from ..builder.base.constants import EXC, INH, LAMBDA_SPEED
fr... | 1.859375 | 2 |
1080.py | Juniorr452/URI-Online-Judge | 0 | 12776729 | # -*- coding: utf-8 -*-
maior = -1
index_maior = -1
for i in range(1, 101):
n = int(input())
if n > maior:
maior = n
index_maior = i
print(maior)
print(index_maior)
| 3.625 | 4 |
synapse/tests/test_lookup_iso3166.py | larrycameron80/synapse | 0 | 12776730 | <filename>synapse/tests/test_lookup_iso3166.py
from synapse.tests.common import *
import synapse.lookup.iso3166 as s_l_country
class CountryLookTest(SynTest):
def test_lookup_countries(self):
self.eq(s_l_country.country2iso.get('united states of america'), 'us')
self.eq(s_l_country.country2iso.g... | 2.03125 | 2 |
Task_6_Website_Testing/seleniumscript/demoscript.py | shwetathikekar/Sparks_Foundation_Task_6 | 0 | 12776731 | <gh_stars>0
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
import time
driver = webdriver.Chrome(ChromeDriverManager().ins... | 3 | 3 |
mqttclient.py | pallebh/rflink2mqtt | 0 | 12776732 | import paho.mqtt.client as mqttw
class MqttClient :
def __init__( self , address = "localhost", port = 1883 , id_ = "" , subscribe = "" , message = None ) :
self.address = address
self.port = port
self.subscribe = subscribe
self.message = message
self.client = mqttw.Clie... | 2.828125 | 3 |
Lab_02/gcd_fsm.py | SadequrRahman/advance-SoC | 0 | 12776733 | #
# Copyright (C) 2019 <NAME> <<EMAIL>>
#
# This file is part of Advance SoC Design Lab Soultion.
#
# SoC Design Lab Soultion can not be copied and/or distributed without the express
# permission of <NAME>
#
# File: gcd_fsm.py
# This is a pymtl gcd gloden algo. implementation.
#
# Inputs:
# a -> f... | 2.203125 | 2 |
day5/day5.py | zLuke2000/aoc-2020 | 0 | 12776734 | <reponame>zLuke2000/aoc-2020
import os
""" PARTE COMUNE """
f = open((os.path.dirname(__file__) + '\day5_input'), 'r')
inputNum = []
temp = f.read()
temp = temp.split("\n")
f.close()
""" PARTE UNO """
seatID = []
for i in temp:
seatX = [0,127]
seatY = [0,7]
seatXY = [0,0]
currentChar = 0
for index... | 2.734375 | 3 |
backups/urls.py | TheEdu/python-mysql-backups-django-admin | 0 | 12776735 | <filename>backups/urls.py<gh_stars>0
from django.urls import path
from . import views
app_name = 'backups'
urlpatterns = [
path('', views.index, name='index'),
path('task/<int:task_id>/command', views.get_task_command, name='command'),
]
| 1.734375 | 2 |
dags/testDevice.py | brendasanchezs/Capstonev2 | 0 | 12776736 | import airflow
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.contrib.hooks.aws_hook import AwsHook
from airflow.hooks.postgres_hook import PostgresHook
from airflow.operators.postgres_operator import PostgresOperator
from datetime import datetime, timedelta
import pan... | 2.296875 | 2 |
aligner/default.py | BryceGo/Natural_Language_Class | 0 | 12776737 | #!/usr/bin/env python
import optparse, sys, os, logging
from collections import defaultdict
optparser = optparse.OptionParser()
optparser.add_option("-d", "--datadir", dest="datadir", default="data", help="data directory (default=data)")
optparser.add_option("-p", "--prefix", dest="fileprefix", default="hansards", he... | 2.421875 | 2 |
miraw.py | jadrian/mipy | 0 | 12776738 | <gh_stars>0
"""Functions for dealing with raw medical imaging datasets.
This module is particularly focused on working with diffusion-weighted images
and derived images, which are typically 4-D (3 for space, plus one dimension for
arbitrary sample vectors). Its default metadata format, "size_info", is a hacky
thing c... | 2.171875 | 2 |
CursoEmVideo-Python3-Mundo1/desafio014.py | martinsnathalia/Python | 0 | 12776739 | <gh_stars>0
# Escreva um programa que converta uma temperatura digitando em graus Celsius e converta para graus Fahrenheit.
t = float(input('Digite a temperatura em °C: '))
print('A temperatura {}ºC equivale a {}°F'.format(t,((( 9 / 5 ) * t) + 32)))
| 4.1875 | 4 |
starkplot/utils/subplots/corner.py | nstarman/starkplot | 2 | 12776740 | <reponame>nstarman/starkplot<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
#
# TITLE : functions for shaped subplots grids
# PROJECT : starkplot
#
# ---------------------------------------------------------------------------... | 2.328125 | 2 |
dbaas/drivers/factory.py | jaeko44/python_dbaas | 0 | 12776741 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.utils.translation import ugettext_lazy as _
import re
__all__ = ['DriverFactory']
class DriverFactory(object):
@classmethod
def is_driver_available(cls, name):
try:
cls.get_driver_class(name)
... | 2.234375 | 2 |
packages/pyright-internal/src/tests/samples/assignment7.py | lipovsek/pytea | 0 | 12776742 | # This sample tests a particularly difficult set of dependent
# assignments that involve tuple packing and unpacking.
# pyright: strict
v1 = ""
v3 = ""
v2, _ = v1, v3
v4 = v2
for _ in range(1):
v1 = v4
v2, v3 = v1, ""
| 2.40625 | 2 |
tests/test_mysql_connection_pool.py | maypimentel/mysql_connection_pool | 0 | 12776743 | <gh_stars>0
import pytest
from mysql_connection_pool import MysqlPool
from mysql.connector import MySQLConnection
from mysql.connector.errors import PoolError
class TestMysqlConnectionPool:
def setup_method(self, method):
self.pool = MysqlPool(pool_size=2, pool_max_size=2)
def test_cnx_type(self):
... | 2.421875 | 2 |
python_temel_project.py | kazimanilaydin/python_temel_project | 0 | 12776744 | """
1- Bir listeyi düzleştiren (flatten) fonksiyon yazın. Elemanları birden çok katmanlı listelerden ([[3],2] gibi) oluşabileceği gibi, non-scalar verilerden de oluşabilir. Örnek olarak:
input: [[1,'a',['cat'],2],[[[3]],'dog'],4,5]
output: [1,'a','cat',2,3,'dog',4,5]
2- Verilen listenin içindeki elemanları tersine d... | 4.09375 | 4 |
Desafios/des001.py | vitormrts/ExerciciosPython | 1 | 12776745 | <reponame>vitormrts/ExerciciosPython
nome = input('\033[1;31mOlá! Qual é o seu nome? ')
n1 = int(input(f'\033[1;31mMuito prazer, {nome}!\n\033[34mPor favor, poderia digitar um número? '))
n2 = int(input('\033[34mCerto! Digite outro número: '))
print('\033[32mHm... Deixe-me pensar...\033[m')
s = n1+n2
print('.')
print('... | 3.296875 | 3 |
models/CC_LCM.py | Fang-Lansheng/C-3-Framework | 0 | 12776746 | import torch
import torch.nn as nn
import torch.nn.functional as F
import pdb
from config import cfg
from misc.utils import *
if cfg.DATASET == 'SHHB':
from datasets.SHHB.setting import cfg_data
elif cfg.DATASET == 'SHHA':
from datasets.SHHA.setting import cfg_data
elif cfg.DATASET == 'UCSD':
from datasets... | 2.078125 | 2 |
Code/Regression.py | Kaamraan19064/Analysis-And-Prediction-of-Delhi-Climate-using-ML | 0 | 12776747 | import numpy as np
from sklearn.ensemble import ExtraTreesRegressor, RandomForestRegressor
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn import preprocessing, svm
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn ... | 2.671875 | 3 |
invenio_rdm_records/records/__init__.py | kprzerwa/invenio-rdm-records | 0 | 12776748 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Data access layer."""
from .api import BibliographicDraft, BibliographicRecord
__all__ = (
"Bibliogra... | 1.140625 | 1 |
examples/xml_parsing/parser.py | abhiabhi94/learn-python | 0 | 12776749 | <filename>examples/xml_parsing/parser.py
import xml.etree.ElementTree as ET
tree = ET.parse('data.xml')
| 1.984375 | 2 |
compiler/dna/components/DNABattleCell.py | AnonymousDeveloper65535/libpandadna | 36 | 12776750 | <filename>compiler/dna/components/DNABattleCell.py
class DNABattleCell:
COMPONENT_CODE = 21
def __init__(self, width, height, pos):
self.width = width
self.height = height
self.pos = pos
def setWidth(self, width):
self.width = width
def setHeight(self, height):
... | 2.34375 | 2 |