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 |
|---|---|---|---|---|---|---|
demo.py | Ph1lippK/anonymizer | 0 | 37300 | import streamlit as st
st.image(
"https://datascientest.com/wp-content/uploads/2020/10/logo-text-right.png.webp"
)
st.header("Développer et déployer une application de Machine learning en **Streamlit**")
st.info("Webinar du 04/05/2021")
st.markdown("---")
st.markdown(
"""
**Objectifs 🎯**
* Se f... | 3.203125 | 3 |
cogs/weapon_exp_calculator.py | richiekim/GenshinCalc | 0 | 37301 | import discord
import json
import math
from discord.ext import commands
from common_functions import default_embed_template, use_exp_mat
MYSTIC = 10000
FINE = 2000
NORMAL = 400
ASCENSION_MILESTONES = [90, 80, 70, 60, 50, 40, 20]
class WeaponExpCalculator(commands.Cog):
def __init__(self, client):
self._client = c... | 2.625 | 3 |
test/test-sys.py | xupingmao/minipy | 52 | 37302 | <filename>test/test-sys.py
import sys
assert len(sys.argv) == 1 | 1.695313 | 2 |
genthreads/actor.py | f1sty/genthreads | 0 | 37303 | from multiprocessing import Process
class InboxFullError(Exception):
pass
class Actor(Process):
def __init__(self, inbox_size=48):
super(Actor, self).__init__()
self._inbox = list()
self._inbox_size = inbox_size
def send(self, value):
if len(self._inbox) < self._inbox_si... | 2.875 | 3 |
class4/pm.py | patrebert/pynet_cert | 0 | 37304 | <filename>class4/pm.py
#!/usr/bin/env python
"""
Demonstrate use of paramiko to connect to
managed device, send commands, get output
"""
import sys
import paramiko
from getpass import getpass
from time import sleep
ip_addr = '192.168.127.12'
username = 'pyclass'
password = '<PASSWORD>'
password=getpass()
sess=paramiko... | 2.359375 | 2 |
saraki/utility.py | lucmichalski/saraki | 3 | 37305 | import datetime
from cerberus import Validator as _Validator
from sqlalchemy import inspect
from sqlalchemy.orm.collections import InstrumentedList
from sqlalchemy.exc import NoInspectionAvailable
def is_sqla_obj(obj):
"""Checks if an object is a SQLAlchemy model instance."""
try:
inspect(obj)
... | 2.703125 | 3 |
fixture/orm.py | Treshch1/python_traning | 0 | 37306 | from pony.orm import *
from datetime import datetime
from model.group import Group
from model.contact import Contact
import random
class ORMFixture:
db = Database()
class ORMGroup(db.Entity):
_table_ = "group_list"
id = PrimaryKey(int, column="group_id")
name = Optional(str, column="... | 2.375 | 2 |
trustworthiness/util.py | DeFacto/WebCredibility | 10 | 37307 | import collections
import datetime
import logging
import os
import sys
from pathlib import Path
import numpy as np
import pdfkit as pdfkit
from bs4 import BeautifulSoup
from sklearn.metrics import mean_absolute_error, mean_squared_error, confusion_matrix, classification_report, \
accuracy_score
from tldextract imp... | 2.21875 | 2 |
lib/lopy_max31856.py | kurta241/MAX31856 | 1 | 37308 | #!/usr/bin/python
#The MIT License (MIT)
#
#Copyright (c) 2017 <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... | 1.867188 | 2 |
block.py | IgorReshetnyak/Statistics | 0 | 37309 |
"""Blocking analysis
Print running average
Blocking analysis scheme
Running error
takes as input filename to analyze
<NAME> 2017
"""
import math,sys,pickle,os.path,pylab,time
if len(sys.argv)<2 :
print 'No file to analyze'
exit()
datafile=sys.argv[1]
file_name=datafile+''
if os.path.isfile(file_name)==False:
... | 3.09375 | 3 |
test/login_test.py | fausecteam/faustctf-2017-toilet | 0 | 37310 | from util import *
from test import BasicTest
class LoginTest(BasicTest):
def __init__(self, s):
self._name = "Login Test"
self._socket = s
def run_all_tests(self):
self.login_regular()
self.login_overflow()
self.login_twice_same_user()
self.login_twice_differen... | 3.25 | 3 |
paintbyword/utils/dissect.py | alexandonian/paint-by-word | 0 | 37311 | import torch
import re
import copy
import numpy
from torch.utils.data.dataloader import default_collate
from netdissect import nethook, imgviz, tally, unravelconv, upsample
def acts_image(model, dataset,
layer=None, unit=None,
thumbsize=None,
cachedir=None,
... | 1.984375 | 2 |
abct/abct.py | hornc/abctag | 2 | 37312 | from math import floor, log
n = lambda x: (x + 1) % 2 + 1
s = lambda x: floor(log(x + 1, 2))
r = lambda x: x // 2 - n(x) + 1 + n(x) * 2**(s(x) - 1)
pn = lambda p: r(p) + (n(p) == 2) * (r(r(p)) - r(p))
dn = lambda p, d: (d + (n(p) == n(d) == 2) * (n(r(p)) * 2**s(d)) - (n(p) == 1)) // (3 - n(p))
| 2.9375 | 3 |
src/evidently/profile_sections/__init__.py | jenoOvchi/evidently | 0 | 37313 | import warnings
import evidently.model_profile.sections
from evidently.model_profile.sections import *
__path__ = evidently.model_profile.sections.__path__ # type: ignore
warnings.warn("'import evidently.profile_sections' is deprecated, use 'import evidently.model_profile.sections'")
| 1.140625 | 1 |
openEPhys_DACQ/NWBio.py | Barry-lab/SpatialAutoDACQ | 0 | 37314 | <gh_stars>0
# -*- coding: utf-8 -*-
import h5py
import numpy as np
import os
import sys
from openEPhys_DACQ.HelperFunctions import tetrode_channels, channels_tetrode, closest_argmin
from pprint import pprint
from copy import copy
import argparse
import importlib
from tqdm import tqdm
def OpenEphys_SamplingRate():
... | 2.15625 | 2 |
computersimulator/hardware/SimulatedCPU.py | jatgam/Computer-Simulator | 1 | 37315 | <filename>computersimulator/hardware/SimulatedCPU.py
import logging
import sys
from computersimulator.hardware.SimulatedRAM import SimulatedRAM
from computersimulator.hardware.SimulatedDisk import SimulatedDisk
from computersimulator.utils.bitutils import *
import computersimulator.constants as constants
CONST = const... | 2.875 | 3 |
dom/metadata.py | Starwort/domgen | 0 | 37316 | import functools
from .base_classes import Container, Void
class BaseURL(Void):
"""The HTML `<base>` element specifies the base URL to use for *all*
relative URLs in a document. There can be only one `<base>` element in a
document.
"""
__slots__ = ()
tag = "base"
Base = BaseURL
class Ext... | 3.171875 | 3 |
catcher_rl/__main__.py | sohnryang/catcher-rl | 0 | 37317 | <gh_stars>0
"""__main__.py"""
import catcher_rl
catcher_rl.main() | 0.890625 | 1 |
helper/downloader/downloadRequest.py | REX-BOTZ/MegaUploaderbot-1 | 2 | 37318 | # !/usr/bin/env python3
"""Importing"""
# Importing Inbuilt packages
from re import match
from shutil import rmtree
from uuid import uuid4
from os import makedirs
# Importing Credentials & Developer defined modules
from helper.downloader.urlDL import UrlDown
from helper.downloader.tgDL import TgDown
from helper.down... | 2.296875 | 2 |
skyperious/wx_accel.py | tt9133github/Skyperious | 0 | 37319 | # -*- coding: utf-8 -*-
"""
Functionality for binding wx control label shortcut keys to events
automatically. In wx, a button with a label "E&xit" would be displayed as
having the label "Exit" with "x" underlined, indicating a keyboard shortcut,
but wx does not bind these shortcuts automatically, requiring constru... | 2.171875 | 2 |
src/waldur_slurm/migrations/0006_allocationusage_deposit_usage.py | geant-multicloud/MCMS-mastermind | 26 | 37320 | <reponame>geant-multicloud/MCMS-mastermind
# Generated by Django 1.11.7 on 2018-03-05 22:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waldur_slurm', '0005_add_deposit'),
]
operations = [
migrations.AddField(
model_name=... | 1.523438 | 2 |
scripts/error_metrics_parser.py | PoonLab/gromstole | 0 | 37321 | """
from https://github.com/PoonLab/MiCall-Lite, which was forked from
https://github.com/cfe-lab/MiCall.
MiCall is distributed under a dual AGPLv3 license.
"""
import sys
import argparse
from csv import DictWriter
from struct import unpack
import csv
import os
from operator import itemgetter
import sys
import math
... | 2.4375 | 2 |
Image Segmtation on COCO Dataset/keras_segmentation/data_utils/data_loader.py | joykour/COCO-Dataset-2018-Stuff-Segmentation-Challenge | 1 | 37322 |
import numpy as np
import cv2
import glob
import itertools
import os
from tqdm import tqdm
from ..models.config import IMAGE_ORDERING
from .augmentation import augment_seg
import random
random.seed(0)
class_colors = [ ( random.randint(0,255),random.randint(0,255),random.randint(0,255) ) for _ in range(5000) ]
... | 2.21875 | 2 |
tests/tests_basic.py | mehrdad-shokri/fluxcapacitor | 648 | 37323 | import os
import tests
from tests import at_most, compile, savefile
import subprocess
node_present = True
erlang_present = True
if os.system("node -v >/dev/null 2>/dev/null") != 0:
print " [!] ignoring nodejs tests"
node_present = False
if (os.system("erl -version >/dev/null 2>/dev/null") != 0 or
os.sys... | 2.328125 | 2 |
tests/test_root.py | oclyke-dev/blue-heron | 0 | 37324 | <reponame>oclyke-dev/blue-heron
import blue_heron
import pytest
from pathlib import Path
from lxml import etree as ET
from blue_heron import Root, Drawing
@pytest.fixture(scope='module')
def test_board():
with open(Path(__file__).parent/'data/ArtemisDevKit.brd', 'r') as f:
root = ET.parse(f).getroot()
yield ... | 2.078125 | 2 |
scripts/evidence/base.py | Oneledger/protocol | 38 | 37325 | <reponame>Oneledger/protocol
from __future__ import print_function
from sdk.actions import (
ListValidators,
NodeID,
)
from sdk.cmd_call import (
GetNodeCreds,
Account_Add,
Send,
GetNodeKey,
)
from sdk.rpc_call import (
node_0,
node_2,
node_3,
)
validators = ListValidators()
valDi... | 2.125 | 2 |
py-data/plugin.video.arteplussept/problems/api-related/1/correct-usages/get_last7days.py | ualberta-smr/NFBugs | 3 | 37326 | <reponame>ualberta-smr/NFBugs<filename>py-data/plugin.video.arteplussept/problems/api-related/1/correct-usages/get_last7days.py
from xbmcswift2 import Plugin
from xbmcswift2 import actions
import requests
import os
import urllib2
import time
import datetime
def get_last7days():
return flatten([get_day(date) for ... | 2.21875 | 2 |
pharma/utils.py | RishiMenon2004/med-bay | 0 | 37327 | <filename>pharma/utils.py
from .models import Bill, BillUnit
# Getting cart total
def get_total(orders):
total = 0
for order in orders:
total += order.quantity * order.item.price
return total
# Getting total for bill objects
def get_bill_total(bill_units):
total = 0
for unit in bill_unit... | 2.71875 | 3 |
myconnectome/rsfmri/mk_connectome_figures.py | poldrack/myconnectome | 28 | 37328 | # -*- coding: utf-8 -*-
"""
make images for connnectivity adjmtx
also compute within/between hemisphere stats
Created on Sun Jun 21 09:19:06 2015
@author: poldrack
"""
import os
import numpy
import nilearn.plotting
import scipy.stats
from myconnectome.utils.get_parcel_coords import get_parcel_coords
import matplotli... | 2.53125 | 3 |
src/tools/python/shipment_report_3x.py | Justintime50/easypost-tools | 1 | 37329 | # Shipment Details Download script
# Outputs CSV text report for purchased production shipments
#
# Usage:
# python3 ShipmentReport_3x.py "optional API KEY" (if not using env vars)
#
# 0.2 Revised API key display 02 Jan 2020 <EMAIL>
# 0.1 Corrected handling of zero shipments returned 02 Jan 2020 <EMAIL>... | 1.6875 | 2 |
backend/unpp_api/apps/project/views.py | unicef/un-partner-portal | 6 | 37330 | <reponame>unicef/un-partner-portal
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import date
from django.db import transaction
from django.db.models import Q
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.utils import timezone
from rest_fr... | 1.34375 | 1 |
older versions/older_version_1d_calculator.py | vishalbelsare/KramersMoyal | 32 | 37331 | # coding: utf-8
#! /usr/bin/env python
# FrequencyJumpLibrary
import numpy as np
from scipy import stats
import math as math
def KM (y, delta_t=1, Moments = [1,2,4,6,8], bandwidth = 1.5, Lowerbound = False, Upperbound = False, Kernel = 'Epanechnikov'): #Kernel-based Regression
Moments = [0] + Moments
length... | 2.25 | 2 |
snoop/data/management/commands/migratecollections.py | liquidinvestigations/hoover-snoop2 | 0 | 37332 | """Creates and migrates databases and indexes.
"""
from django.core.management.base import BaseCommand
from ... import collections
from ...logs import logging_for_management_command
class Command(BaseCommand):
help = "Create and migrate the collection databases"
def handle(self, *args, **options):
... | 2.09375 | 2 |
pm.py | chandrabhan-singh-98/pmpy | 0 | 37333 | <filename>pm.py
#!/usr/bin/env python3
"""
------------------------------------------------------------------------
A re-write of my original pm shell script in python
pm is a script that is meant to act as a status tracker
for my projects. It will
use VCS integration to provide in-depth information on all proje... | 2.6875 | 3 |
epikjjh/baekjoon/17413.py | 15ers/Solve_Naively | 3 | 37334 | <reponame>15ers/Solve_Naively<gh_stars>1-10
import re
stream = input()
p = re.compile("<?[^<>]+>?")
ans = ""
for elem in p.findall(stream):
if elem[0] == "<":
ans += elem
else:
for e in elem.split():
ans += e[::-1] + " "
ans = ans.rstrip()
print(ans) | 3.203125 | 3 |
day_09/test_solution.py | anguswilliams91/advent-of-code-2022 | 0 | 37335 | <reponame>anguswilliams91/advent-of-code-2022
"""Tests for day 9."""
from day_09.solution import sum_of_low_points, product_of_biggest_basins
_EXAMPLE_INPUT = """2199943210
3987894921
9856789892
8767896789
9899965678
"""
def test_part_one_example_solution_is_recovered():
assert sum_of_low_points(_EXAMPLE_INPUT)... | 2.65625 | 3 |
hubspot/crm/extensions/accounting/models/create_user_account_request_external.py | fakepop/hubspot-api-python | 0 | 37336 | # coding: utf-8
"""
Accounting Extension
These APIs allow you to interact with HubSpot's Accounting Extension. It allows you to: * Specify the URLs that HubSpot will use when making webhook requests to your external accounting system. * Respond to webhook calls made to your external accounting system by HubSp... | 2.171875 | 2 |
03_spider_douyin/action_douyin.py | theThreeKingdom/python-exercises | 0 | 37337 | # -*- coding: utf-8 -*-
# @Time : 2020/4/2 22:55
# @Author : Nixin
# @Email : <EMAIL>
# @File : action_douyin.py
# @Software: PyCharm
from appium import webdriver
from time import sleep
import random
class Action():
def __init__(self):
# 初始化配置,设置Desired Capabilities参数
self.desired_caps =... | 2.78125 | 3 |
data/studio21_generated/interview/1624/starter_code.py | vijaykumawat256/Prompt-Summarization | 0 | 37338 | def sq_cub_rev_prime(n):
| 1.03125 | 1 |
glitter_documents/apps.py | developersociety/django-glitter-documents | 0 | 37339 | <gh_stars>0
# -*- coding: utf-8 -*-
from django.apps import AppConfig
class DocumentsConfig(AppConfig):
name = 'glitter_documents'
label = 'glitter_documents'
verbose_name = 'Documents'
| 1.015625 | 1 |
my_web_project/authentication/forms.py | AlexYankoff/my_web_project | 0 | 37340 | from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from my_web_project.common.forms import BootstrapFormMixin
from my_web_project.main.models import S... | 2.265625 | 2 |
experiments_pu/compute_prediction.py | 6Ulm/unbalanced_gromov_wasserstein | 22 | 37341 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 12 10:58:27 2020
Experiments where one marginal is fixed
"""
import os
import numpy as np
from joblib import Parallel, delayed
import torch
import ot
from unbalancedgw.batch_stable_ugw_solver import log_batch_ugw_sinkhorn
from unbalancedgw._batch_... | 2.171875 | 2 |
source_code/ghc2018.py | nuno-chicoria/GHC_2018 | 0 | 37342 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 1 18:44:04 2018
@author: JavaWizards
"""
import numpy as np
file = "/Users/nuno_chicoria/Downloads/b_should_be_easy.in"
handle = open(file)
R, C, F, N, B, T = handle.readline().split()
rides = []
index = []
for i in range(int(N)):
index.a... | 2.71875 | 3 |
src/code/data-structures/DoublyLinkedList/DoublyLinkedList.py | angshumanHalder/discord-bot | 0 | 37343 | <filename>src/code/data-structures/DoublyLinkedList/DoublyLinkedList.py<gh_stars>0
class DoublyLinkedList:
""" Private Node Class """
class _Node:
def __init__(self, value):
self.value = value
self.next = None
self.prev = None
def __str__(self):
r... | 3.65625 | 4 |
python/cuml/dask/linear_model/base.py | Pandinosaurus/cuml | 1 | 37344 | <gh_stars>1-10
# Copyright (c) 2020, NVIDIA 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 1.835938 | 2 |
utils/plot_part_dat.py | jeremiedecock/botsim | 1 | 37345 | <reponame>jeremiedecock/botsim<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 <NAME> (<EMAIL>)
import numpy as np
import matplotlib.pyplot as plt
import math
import argparse
def parse_part_log_file(filename):
log_data = np.loadtxt(filename)
data_dict = {}
data_dict["t... | 2.578125 | 3 |
t.py | cmsirbu/gencfg | 5 | 37346 | <filename>t.py
#!/usr/bin/env python
"""A script that helps generate router configuration from templates.
"""
import os
import sys
import argparse
import csv
import jinja2
from jinja2 import meta
def get_template_var_list(config_template):
j2_env = jinja2.Environment(loader=jinja2.FileSystemLoader(searchpath='... | 2.921875 | 3 |
examples/perf/rnn/simple_rnn.py | yuhonghong66/minpy | 1,271 | 37347 | <filename>examples/perf/rnn/simple_rnn.py
import sys
sys.path.insert(0, "../../python/")
import mxnet as mx
import numpy as np
from collections import namedtuple
import time
import math
RNNState = namedtuple("RNNState", ["h"])
RNNParam = namedtuple("RNNParam", ["i2h_weight", "i2h_bias",
... | 2.328125 | 2 |
Python/bench_2_1.py | nifty-swift/Nifty-benchmarks | 1 | 37348 | <gh_stars>1-10
import numpy as np
from time import time
def bench_2_1():
trials = 100
elements = 1000000
times = []
for i in range(trials):
start = time()
M = np.random.randint(1,999, size=elements)
t = time()-start
times.append(t)
print 'Python - Benchmark 2.1... | 3.078125 | 3 |
utils/globals.py | Pawel095/RaidenPy | 0 | 37349 | import arcade
from utils.loader import Loader
class keyFlags():
def __init__(self):
self.left = False
self.right = False
self.up = False
self.down = False
self.space = False
TITLE = "Raiden Py"
WINDOW = None
WIDTH = 600
HEIGHT = 600
SCREEN_WIDTH = WIDTH
SCREEN_HEIGHT = ... | 2.59375 | 3 |
tryme.py | haamis/Turku-neural-parser-pipeline | 94 | 37350 | from tnparser.pipeline import read_pipelines, Pipeline
text1="I have a dog! Let's see what I can do with Silo.ai. :) Can I tokenize it? I think so! Heading: This is the heading And here continues a new sentence and there's no dot."
text2="Some other text, to see we can tokenize more stuff without reloading the model..... | 3.1875 | 3 |
scripts/mkuidefaults.py | dyna-mis/Hilabeling | 0 | 37351 | <reponame>dyna-mis/Hilabeling
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
***************************************************************************
mkuidefaults.py
---------------------
Date : June 2013
Copyright : (C) 2013 by <NAME>
Email : jef at... | 1.921875 | 2 |
fake_spectra/rate_network.py | xiaohanzai/fake_spectra | 0 | 37352 | # -*- coding: utf-8 -*-
"""A rate network for neutral hydrogen following
Katz, Weinberg & Hernquist 1996, eq. 28-32."""
import os.path
import math
import numpy as np
import scipy.interpolate as interp
import scipy.optimize
class RateNetwork(object):
"""A rate network for neutral hydrogen following
Katz, Weinbe... | 2.328125 | 2 |
adjuftments/utils/splitwise_auth_tool/splitwise_credentials.py | juftin/adjuftments | 0 | 37353 | #!/usr/bin/env python3
# Author:: <NAME> (mailto:<EMAIL>)
"""
Simple Flask Server to Expose Credentials
"""
from flask import Flask, jsonify, redirect, render_template, request, session, url_for
from splitwise import Splitwise
from adjuftments.config import SplitwiseConfig
app = Flask(__name__)
app.secret_key ... | 3.125 | 3 |
kobert_transformers/utils.py | LoveMeWithoutAll/KoBERT-Transformers | 0 | 37354 | from .tokenization_kobert import KoBertTokenizer
def get_tokenizer(cache_dir=None):
if cache_dir is not None:
return KoBertTokenizer.from_pretrained(cache_dir)
else:
return KoBertTokenizer.from_pretrained('monologg/kobert')
| 2.046875 | 2 |
testtakepicture.py | 1082sqnatc/missionspacelab2019 | 0 | 37355 | <gh_stars>0
from src.takepicture import takePicture
x=1
while x < 10:
takePicture(x)
print("success")
x=x+1 | 2.5 | 2 |
dcracer/config.py | wallarug/dcracer | 0 | 37356 | '''
# Config
'''
import cv2
import numpy as np
import platform
import time
import sys
##
## Open CV Variables
##
# show the debug output for the open cv
DEMO_MODE = True
# set some variables for testing output
FONT = cv2.FONT_HERSHEY_SIMPLEX
# Min and Max Area Sizes
AREA_SIZE_STOP = 30
AREA_SIZE_TURN = 35
AREA_SIZ... | 2.625 | 3 |
escola/tests/selenium_test_case.py | vini84200/medusa2 | 1 | 37357 | # Developed by <NAME>
# Last Modified 13/04/19 16:04.
# Copyright (c) 2019 <NAME> and <NAME>
import pytest
from decouple import config
from django.contrib.auth.models import User
from django.test import LiveServerTestCase, TestCase
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementE... | 2.25 | 2 |
tests/general.py | tkhyn/djangorecipebook | 0 | 37358 | """
General tests that concern all recipes
"""
import os
import sys
from ._base import mock, RecipeTests, test_project
# we use the very simple manage.Recipe to test BaseRecipe functionalities
from djangorecipebook.recipes import manage
class GeneralRecipeTests(RecipeTests):
recipe_class = mana... | 2.265625 | 2 |
zinc/utils/validation.py | PressLabs/zinc | 29 | 37359 | <gh_stars>10-100
import ipaddress
def is_ipv6(ip_addr):
try:
ipaddress.IPv6Address(ip_addr)
return True
except ipaddress.AddressValueError:
return False
| 2.546875 | 3 |
tests/config/evaluation.py | realtwister/LearnedEvolution | 0 | 37360 | <reponame>realtwister/LearnedEvolution<filename>tests/config/evaluation.py
import numpy as np
from collections import namedtuple
Population = namedtuple("Population", ['mean_fitness','mean', 'covariance'])
config = dict(
dimension = 2,
population_size = 100,
algorithm = dict(
mean_function =dict(... | 2.59375 | 3 |
tornado/4_celery_async_sleep.py | dongweiming/speakerdeck | 6 | 37361 | <filename>tornado/4_celery_async_sleep.py<gh_stars>1-10
#!/bin/env python
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.gen
import tornado.httpclient
import tcelery
import sleep_task as tasks
from tornado.options import define, options
define("port", default... | 2.546875 | 3 |
013-Flareon 6 Reloadered/resolve.py | schommi/low-tech | 0 | 37362 | import itertools
secret = [
0x7A, 0x17, 0x08, 0x34, 0x17, 0x31, 0x3B, 0x25, 0x5B, 0x18, 0x2E, 0x3A, 0x15, 0x56, 0x0E, 0x11,
0x3E, 0x0D, 0x11, 0x3B, 0x24, 0x21, 0x31, 0x06, 0x3C, 0x26, 0x7C, 0x3C, 0x0D, 0x24, 0x16, 0x3A,
0x14, 0x79, 0x01, 0x3A, 0x18, 0x5A, 0x58, 0x73, 0x2E, 0x09, 0x00, 0x16, 0x00, 0x49, 0x22, 0x0... | 3.015625 | 3 |
py/cidoc_crm_types/entities/e66_formation.py | minorg/cidoc-crm-types | 0 | 37363 | from .e63_beginning_of_existence import E63BeginningofExistence
from .e7_activity import E7Activity
from dataclasses import dataclass
@dataclass
class E66Formation(E63BeginningofExistence, E7Activity):
"""
Scope note:
This class comprises events that result in the formation of a formal or informal E74 Group of p... | 3.171875 | 3 |
platform/radio/efr32_multiphy_configurator/pro2_chip_configurator/src/si4440_modem_calc/pro2plusapilist.py | lmnotran/gecko_sdk | 82 | 37364 | <filename>platform/radio/efr32_multiphy_configurator/pro2_chip_configurator/src/si4440_modem_calc/pro2plusapilist.py
'''
Created on Apr 4, 2013
@author: sesuskic
'''
from .pro2apilist import Pro2ApiList
from .trueround import trueround
__all__ = ["Pro2PlusApiList"]
class Pro2PlusApiList(Pro2ApiList):
def _add_se... | 2.0625 | 2 |
tests/mockers.py | bastienboutonnet/sheetwork | 9 | 37365 | import pandas
from pandas import Timestamp
EXPECTED_CONFIG = {
"sheet_name": "df_dropper",
"sheet_key": "sample",
"target_schema": "sand",
"target_table": "bb_test_sheetwork",
"columns": [
{"name": "col_a", "datatype": "int"},
{"name": "col_b", "datatype": "varchar"},
{"name... | 2.140625 | 2 |
app/bot/types.py | DramatikMan/mlhl-01-python-bot | 0 | 37366 | <reponame>DramatikMan/mlhl-01-python-bot
from typing import Any
from telegram.ext import CallbackContext, Dispatcher
CCT = CallbackContext[
dict[Any, Any],
dict[Any, Any],
dict[Any, Any]
]
DP = Dispatcher[
CCT,
dict[Any, Any],
dict[Any, Any],
dict[Any, Any]
]
DataRecord = tuple[
int, ... | 2.15625 | 2 |
custom_components/gpodder/config_flow.py | hsolberg/gpodder | 13 | 37367 | <reponame>hsolberg/gpodder<gh_stars>10-100
"""Adds config flow for gPodder."""
from homeassistant import config_entries
import voluptuous as vol
from custom_components.gpodder.const import (
CONF_NAME,
CONF_PASSWORD,
CONF_USERNAME,
CONF_DEVICE,
DEFAULT_NAME,
DOMAIN,
)
class GpodderFlowHandler... | 2.5 | 2 |
openfda/nsde/pipeline.py | FDA/openfda | 388 | 37368 | #!/usr/local/bin/python
'''
Pipeline for converting CSV nsde data to JSON and importing into Elasticsearch.
'''
import glob
import os
from os.path import join, dirname
import luigi
from openfda import common, config, parallel, index_util
from openfda.common import newest_file_timestamp
NSDE_DOWNLOAD = \
'https:/... | 2.421875 | 2 |
mirari/INV/migrations/0003_auto_20190609_1903.py | gcastellan0s/mirariapp | 0 | 37369 | # Generated by Django 2.0.5 on 2019-06-10 00:03
from django.db import migrations, models
import localflavor.mx.models
class Migration(migrations.Migration):
dependencies = [
('INV', '0002_auto_20190608_2204'),
]
operations = [
migrations.AlterField(
model_name='fiscalmx',
... | 1.734375 | 2 |
tests/test_fluids_ecl.py | trhallam/digirock | 0 | 37370 | """Test functions for pem.fluid.ecl module
"""
import pytest
from pytest import approx
import numpy as np
import digirock.fluids.ecl as fluid_ecl
from inspect import getmembers, isfunction
@pytest.fixture
def tol():
return {
"rel": 0.05, # relative testing tolerance in percent
"abs... | 2.265625 | 2 |
anyrun/__init__.py | mwalkowski/anyrun | 18 | 37371 | <gh_stars>10-100
from anyrun.client import AnyRunClient, AnyRunException
__version__ = '0.1'
__all__ = ['AnyRunClient', 'AnyRunException']
| 1.226563 | 1 |
python/sort/BubbleSort.py | smdsbz/homework | 5 | 37372 | #!/usr/bin/python3
'''
BubbleSort.py
by <NAME>
'''
array = []
print("Enter at least two numbers to start bubble-sorting.")
print("(You can end inputing anytime by entering nonnumeric)")
# get numbers
while True:
try:
array.append(float(input(">> ")))
except ValueError: # exit inputing
break
print("\nThe array... | 4.21875 | 4 |
Ex-08.py | gilmartins83/Guanabara-Python | 0 | 37373 | <gh_stars>0
medida = float(input("uma distancai em metros: "))
cm = medida * 100
mm = medida * 1000
dm = medida / 10
dam = medida * 1000000
hm = medida / 100
km = medida * 0.001
ml = medida * 0.000621371
m = medida * 100000
print("A medida de {:.0f}m corresponde a {:.0f} mm \n{:.0f} cm \n{:.0f} dm \n{:.0f} dam \n{:.0f... | 3.84375 | 4 |
src/spaceone/monitoring/info/metric_info.py | jihyungSong/plugin-google-cloud-stackdriver | 1 | 37374 | <reponame>jihyungSong/plugin-google-cloud-stackdriver<filename>src/spaceone/monitoring/info/metric_info.py
import functools
from spaceone.api.monitoring.plugin import metric_pb2
from spaceone.api.core.v1 import plugin_pb2
from spaceone.core.pygrpc.message_type import *
__all__ = ['PluginMetricsResponse', 'PluginMetric... | 2.09375 | 2 |
POP CHECK R0 py36.py | Rigonz/PopDensity_SatelliteNightLight | 0 | 37375 | '''
Created on: see version log.
@author: rigonz
coding: utf-8
IMPORTANT: requires py3.6 (rasterio)
Script that:
1) reads a series of raster files,
2) runs some checks,
3) makes charts showing the results.
The input data corresponds to a region of the world (ESP) and represents
the population density (pop/km2).
Each... | 2.53125 | 3 |
custom_components/hello_world.py | swissglider/homeassistant_custome_components | 0 | 37376 | """
Hello World Component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/developers/development_101/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
# Initialize the logger
_LOGGER = logging.getLogger(__name__)
#... | 2.453125 | 2 |
svsim/compare/sc21_compare/cirq/cirq_multiply_n13.py | yukwangmin/SV-Sim | 0 | 37377 | <filename>svsim/compare/sc21_compare/cirq/cirq_multiply_n13.py
import time
import cirq
import numpy as np
from functools import reduce
q = [cirq.NamedQubit('q' + str(i)) for i in range(13)]
circuit = cirq.Circuit(
cirq.X(q[0]),
cirq.X(q[1]),
cirq.X(q[2]),
cirq.X(q[4]),
cirq.CCX(q[2], q[0], q[5]),
... | 2.265625 | 2 |
Section_7/word_count_repo/src/word_count.py | PacktPublishing/Software-Engineering-with-Python-3.x | 1 | 37378 | from project_utils import dict_to_file, get_word_count
if __name__ == "__main__":
inp_filename = 'sample.txt'
out_filename = 'count.csv'
print("Reading file ", inp_filename)
word_dict = get_word_count(inp_filename)
print("Output from get_word_count is")
print(word_dict)
print("W... | 3.296875 | 3 |
examples/tempy_examples.py | NinoDoko/TemPy | 0 | 37379 | <gh_stars>0
# -*- coding: utf-8 -*-
import json
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def none_handler():
from templates.homepage import page
return page.render()
@app.route('/hello_world')
def hello_world_handler():
from templates.hello_world import page
return pa... | 2.40625 | 2 |
Chapter05/airflow/dags/classification_pipeline_dag.py | arifmudi/Machine-Learning-Engineering-with-Python | 67 | 37380 | <reponame>arifmudi/Machine-Learning-Engineering-with-Python
from datetime import timedelta
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.utils.dates import days_ago
default_args = {
'owner': '<NAME>',
'depends_on_past': False,
'start_date': days_ago(2),
'... | 2.59375 | 3 |
Yank/tests/test_pipeline.py | hannahbrucemacdonald/yank | 0 | 37381 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Test pipeline functions in pipeline.py.
"""
# =================================================================... | 2.21875 | 2 |
a1d05eba1/scripts/entry.py | dorey/a1d05eba1 | 0 | 37382 | import os
import json
import yaml
import argparse
from pyxform import xls2json
from pyxform.builder import create_survey_element_from_dict
from pprint import pprint
from ..content_variations import build_content
from ..utils.form_to_yaml_string import form_to_yaml_string
YAML_FORMAT = 'yml'
JSON_FORMAT = 'json'
XL... | 2.46875 | 2 |
rmp2/rmpgraph/__init__.py | UWRobotLearning/rmp2 | 17 | 37383 | from rmp2.rmpgraph.robotics import RobotRMPGraph | 1.070313 | 1 |
pushmi-pullyu.py | klynch/pushmi-pullyu | 0 | 37384 | <filename>pushmi-pullyu.py
#!/usr/bin/env python3
import argparse
import requests
import json
import os
import base64
from collections import namedtuple
import docker
Registry = namedtuple('Registry', ['name', 'tag_url', 'tag_func'])
REGISTRY_REGISTRY = {
'hub.docker.com': Registry(
name='hub.docker.com',... | 2.34375 | 2 |
src/contactapp/migrations/0001_initial.py | robertsmoto/sodavault | 0 | 37385 | <filename>src/contactapp/migrations/0001_initial.py
# Generated by Django 3.2.3 on 2021-08-23 17:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | 1.898438 | 2 |
examples/kcs.py | WeiZhixiong/ksc-sdk-python | 53 | 37386 | <gh_stars>10-100
# -*- encoding:utf-8 -*-
from kscore.session import get_session
if __name__ == "__main__":
s = get_session()
#确定服务名称以及机房
kcsClient = s.create_client("kcs", "cn-shanghai-3", use_ssl=False)
# 调用DescribeCacheReadonlyNode接口需要传入kcsv2
#kcsv2Client = s.create_client("kcsv2", "cn-shanghai... | 1.8125 | 2 |
dummy_agent.py | aivaslab/marlgrid | 0 | 37387 |
def create_supervised_data(env, agents, num_runs=50):
val = []
# the data threeple
action_history = []
predict_history = []
mental_history = []
character_history = []
episode_history = []
traj_history = []
grids = []
ep_length = env.maxtime
filler = env.get_filler()
obs = env.reset(setting=setting, nu... | 2.15625 | 2 |
src/server/utils.py | Krzem5/Python-School_Website | 0 | 37388 | import builtins
import datetime
import inspect
import threading
import time
import ws
global _c,_pq,_l_ws,_sc
_c={}
_pq=None
_l_ws={}
_sc=None
_tl=threading.Lock()
def _print_q():
global _pq,_l_ws
lt=time.time()
fs=__import__("storage")
fs.set_silent("log.log")
dt=fs.read("log.log")
lc=dt.count(b"\n")
whil... | 2.4375 | 2 |
tests/test_operation.py | InTack2/boip | 0 | 37389 | <reponame>InTack2/boip<filename>tests/test_operation.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import generators
from __future__ import division
import os
import pytest
... | 2.203125 | 2 |
service/models/__init__.py | CottageLabs/lodestone | 0 | 37390 | <gh_stars>0
from service.models.ethesis import Ethesis
from service.models.dataset import Dataset | 1.078125 | 1 |
rmepy/robot_modules/__init__.py | 233a344a455/RobomasterEPlib | 3 | 37391 | from .basic_ctrl import BasicCtrl
from .chassis import Chassis
from .gimbal import Gimbal
from .blaster import Blaster | 0.933594 | 1 |
build.py | MrCoft/EngiMod | 0 | 37392 | import utils
from utils import format
import os
import tempfile
import urllib.request
import shutil
import zipfile
spire_dir = r"D:\Games\Slay the Spire Modded"
mod_dir = os.path.join("cache", "mod")
def build():
# STEP: clone FruityMod
if not os.path.exists(mod_dir):
print("Downloading {}".format("Fr... | 2.578125 | 3 |
src/filtermaker/__init__.py | yukihira1992/filtermaker | 0 | 37393 | from .filters import TextFilter
__version__ = '0.0.1'
__all__ = (
'__version__',
'TextFilter',
)
| 1.039063 | 1 |
projects/migrations/0001_initial.py | louisenje/project-rate | 0 | 37394 | <filename>projects/migrations/0001_initial.py<gh_stars>0
# Generated by Django 3.2.3 on 2021-06-02 07:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swapp... | 1.6875 | 2 |
osbenchmark/builder/downloaders/repositories/repository_url_provider.py | engechas/opensearch-benchmark | 26 | 37395 | <filename>osbenchmark/builder/downloaders/repositories/repository_url_provider.py
from functools import reduce
from osbenchmark.exceptions import SystemSetupError
class RepositoryUrlProvider:
def __init__(self, template_renderer, artifact_variables_provider):
self.template_renderer = template_renderer
... | 2.328125 | 2 |
setup_cares.py | thedrow/pycares | 0 | 37396 |
import errno
import os
import subprocess
import sys
from distutils import log
from distutils.command.build_ext import build_ext
from distutils.errors import DistutilsError
def exec_process(cmdline, silent=True, catch_enoent=True, input=None, **kwargs):
"""Execute a subprocess and returns the returncode, stdout ... | 2.296875 | 2 |
FaceTemplateMatching.py | domjhill/Python-FaceTemplateMatching | 6 | 37397 | <filename>FaceTemplateMatching.py<gh_stars>1-10
import cv2
from threading import Thread
import datetime
import time
import sys
class FPSCounter:
def __init__(self):
self._start = None
self._end = None
self._noFrames = 0
def start(self):
self._start = datetime.datetime.now()
... | 2.484375 | 2 |
src/access.py | zimingd/packer-rstudio | 0 | 37398 | #!/usr/bin/env python3
import jwt
import requests
import base64
import json
import boto3
import time
import functools
import os
from mod_python import apache
region = json.loads(requests.get('http://169.254.169.254/latest/dynamic/instance-identity/document').text)['region']
ssm_parameter_name_env_var = 'SYNAPSE_TOKE... | 2.046875 | 2 |
tests/test_checks_interface.py | ployt0/server_monitor | 0 | 37399 | <gh_stars>0
from checks_interface import deserialise_simple_csv
def test_deserialise_simple_csv():
csv_list = deserialise_simple_csv("yolo,<NAME>,george soros,tilda swinton,None,bill gates")
assert csv_list == ['yolo', 'barrywhite', 'ge<NAME>', 'tilda swinton', None, 'bill gates']
| 2.71875 | 3 |