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 |
|---|---|---|---|---|---|---|
manage.py | LimaGuilherme/flask-boilerplate | 0 | 12772751 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
import sys
from app import initialize
manager = Manager(initialize.web_app)
def register_migrate(manager):
from app import models
migrate = Migrate(initialize.web_app, models.db... | 2.09375 | 2 |
tests/generators/finality/main.py | jmyllyla/eth2.0-specs | 1 | 12772752 | from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators
from eth2spec.phase0 import spec as spec_phase0
from eth2spec.altair import spec as spec_altair
from eth2spec.merge import spec as spec_merge
from eth2spec.test.helpers.constants import PHASE0, ALTAIR, MERGE
specs = (spec_phase0, spec_altai... | 1.648438 | 2 |
keras-yolo3-Traffic Sign/detect.py | qqww12345/001_AI_project | 0 | 12772753 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'detect.ui'
#
# Created by: PyQt5 UI code generator 5.12
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow... | 1.851563 | 2 |
model_search/phoenix.py | LinqCod/model_search | 0 | 12772754 | <filename>model_search/phoenix.py
# Copyright 2020 Google LLC
#
# 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 applic... | 1.796875 | 2 |
test/test_authentication.py | zaclochhead/flask_calendar | 0 | 12772755 | import pytest
from flask_calendar.authentication import Authentication
EXISTING_USERNAME = "a_username"
CORRECT_PASSWORD = "<PASSWORD>"
@pytest.fixture
def authentication() -> Authentication:
return Authentication(
data_folder="test/fixtures", password_salt="<PASSWORD>", failed_login_delay_base=0)
... | 3.078125 | 3 |
calculate.py | cu-swe4s-fall-2019/version-control-shla9937 | 0 | 12772756 | import argparse
import math_lib as ml
parser = argparse.ArgumentParser(description='do math')
parser.add_argument('first_number', type=int, help='First Number')
parser.add_argument('second_number', type=int, help='Second Number')
args = parser.parse_args()
if __name__ == '__main__':
print(ml.add(args.first_number... | 3.078125 | 3 |
gehomesdk/erd/values/oven/erd_closed_loop_cooking_devices_status.py | willhayslett/gehome | 17 | 12772757 | #WIP
import enum
#0x5771
#0x5772
#0x5773
#0x5774
#0x5775
#0x5776
#0x5777
class ErdCloseLoopCookingDevicesStatus:
class CookingDeviceType(enum.Enum):
DEFAULT = "Default"
HESTANT_CUE_PAN = "HestanCuePan"
HESTANT_CUE_POT = "HestanCuePot"
PARAGON_SENSOR = "Paragon"
POPUP_SENSO... | 2.546875 | 3 |
pymetabolism/tests/test_parsers.py | Midnighter/pymetabolism | 1 | 12772758 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=============
Parsers Tests
=============
:Authors:
<NAME>
<NAME>
:Date:
2011-04-10
:Copyright:
Copyright(c) 2011 Jacobs University of Bremen. All rights reserved.
:File:
test_parsers.py
"""
import os
import nose.tools as nt
from ..miscellaneou... | 2.3125 | 2 |
cell.py | DFrye333/DynamicMaze | 0 | 12772759 | <reponame>DFrye333/DynamicMaze
'''
Module: cell
Author: <NAME>
Description: Contains the Cell class.
'''
from utility import Direction
class Cell:
'''
Class: Cell
Description: Represents an individual cell in a maze.
'''
# The print character for a visited cell.
VISITED_STRING = " "
# The print character for ... | 3.390625 | 3 |
rects.py | prakharchoudhary/faceCV | 3 | 12772760 | import cv2
import numpy as np
import utils
def outlineRect(image, rect, color):
"""used to draw a rectangle"""
if rect is None:
return
X, y, w, h = [int(i) for i in rect]
cv2.rectangle(image, (X, y), (X + w, y + h), color)
def copyRect(src, dst, srcRect, dstRect, mask=None,
inte... | 3.453125 | 3 |
tests/unit/drivers/core/test_core_cisco_iosxr_driver.py | carlmontanari/ssh2net | 10 | 12772761 | import pytest
from ssh2net.core.cisco_iosxr.driver import IOSXRDriver, PRIVS
from tests.unit.drivers.base_driver_unit_tests import BaseDriverUnitTest
class TestIOSXR(BaseDriverUnitTest):
def setup_method(self):
self.privs = PRIVS
self.driver = IOSXRDriver()
def test__determine_current_priv_e... | 2.203125 | 2 |
ipawac_assistant/assistant-modules/linphoneCalling.py | shreyashag/ipawac_assistant | 0 | 12772762 | <gh_stars>0
# -*- coding: utf-8-*-
import re
WORDS = ["CALL"]
def handle(text, mic, profile, linphone):
"""
Reports the current time based on the user's timezone.
Arguments:
text -- user-input, typically transcribed speech
mic -- used to interact with the user (for both input an... | 3.171875 | 3 |
tools/import_wikihow_elasticsearch.py | bigabig/wikihow-qa | 6 | 12772763 | import json,sys,io,os
from argparse import ArgumentParser
from elasticsearch import Elasticsearch
from argparse import ArgumentParser
def main():
parser = ArgumentParser()
parser.add_argument("-d", "--data", dest="data", help="path to dataset", metavar="DATA")
parser.add_argument("-i", "--index", dest="index", help... | 2.9375 | 3 |
stanCode_Projects/my_photoshop/stanCodoshop.py | juneyochen/sc-projects | 0 | 12772764 | """
SC101 - Assignment3
Adapted from <NAME>'s Ghost assignment by
<NAME>.
-----------------------------------------------
This code helps users combine the photos to get a best photo.
"""
import os
import sys
from simpleimage import SimpleImage
def get_pixel_dist(pixel, red, green, blue):
"""
Returns the sq... | 4.1875 | 4 |
clean_architecture_basic_classes/basic_domain/basic_entity.py | aberriel/clean_architecture_basic_classes | 0 | 12772765 | from clean_architecture_basic_classes.basic_domain.basic_value import \
BasicValue
from marshmallow import Schema, fields
from uuid import uuid4
def missing_id():
return str(uuid4())
class BasicEntity(BasicValue):
def __init__(self, entity_id=None):
self.entity_id = entity_id or str(uuid4())
... | 2.71875 | 3 |
pyvoxel/node.py | zx013/pyvoxel | 0 | 12772766 | <reponame>zx013/pyvoxel
# -*- coding: utf-8 -*-
from pyvoxel.log import Log
# 类中attr属性改变时触发on_attr事件,同时同步改变关联的值
class Node(object):
def __new__(cls): # 不用在子类中调用super初始化
cls._trigger = {}
cls._reflex = {}
cls.parent = None
cls.children = []
print('node new')
return ... | 2.4375 | 2 |
openchroma/utils.py | alvii147/OpenChroma | 0 | 12772767 | <gh_stars>0
import numpy as np
def is_array_like(arr):
'''
Check if object is array-like.
Parameters
----------
arr : any
Object to be tested.
Returns
-------
arr_like : bool
Indicates whether given object is array-like.
'''
arr_like = isinstance(arr, (list, ... | 3.453125 | 3 |
python/wrappergen.py | ju6ge/rbdl-orb | 12 | 12772768 | <filename>python/wrappergen.py<gh_stars>10-100
#!/usr/bin/python
import sys, re, os
def usage(arg0):
print ("Usage: {} <input.template.pyx> <output.pyx>".format(arg0))
sys.exit(-1)
wrapper_command_strings = {
"ClassDefinitions" : """cdef class _%PARENT%_%MEMBER%_%TYPE%_VectorWrapper:
cdef crbdl.%... | 2.09375 | 2 |
regression-tests/exampletests/cumsum_doc_test.py | lewisc/spark-tk | 34 | 12772769 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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 require... | 2.8125 | 3 |
tests/mock/MockGuild.py | ephreal/rollbot | 2 | 12772770 | # -*- coding: utf-8 -*-
"""
This software is licensed under the License (MIT) located at
https://github.com/ephreal/rollbot/Licence
Please see the license for any restrictions or rights granted to you by the
License.
"""
# A mock guild object for testing
class MockGuild():
def __init__(self, name=None, text_chan... | 1.773438 | 2 |
Aula 12 - Condições Aninhadas/desafio040.py | josue-rosa/Python---Curso-em-Video | 3 | 12772771 | <reponame>josue-rosa/Python---Curso-em-Video
"""
Programa que leia duas notas de um aluno e calcule sua média,
mostrando uma mensagem no final, de acordo com a média atingida.
- media abaixo de 5.0:
reprovado
- media entre 5.0 e 6.9:
recuperação
- media 7.0 ou superior:
aprovado
"""
nota1 = float(input('Informe a p... | 3.78125 | 4 |
src/utils/helpers.py | PanyalaSainathReddy/authorization | 0 | 12772772 | <reponame>PanyalaSainathReddy/authorization<gh_stars>0
def get_first_matching_attr(obj, *attrs, default=None):
for attr in attrs:
if hasattr(obj, attr):
return getattr(obj, attr)
return default
def get_error_message(exc) -> str:
if hasattr(exc, 'message_dict'):
return exc.mess... | 2.34375 | 2 |
file_manager/migrations/0039_auto_20211021_1551.py | xiaofengxie128/Proteomic-Data-Manager | 0 | 12772773 | # Generated by Django 3.2.7 on 2021-10-21 21:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('file_manager', '0038_auto_20211021_1513'),
]
operations ... | 1.5625 | 2 |
setup.py | david-lindner/idrl | 9 | 12772774 | <filename>setup.py
import setuptools
setuptools.setup(
name="active-reward-learning",
author="<NAME>"
version="0.1dev",
description="",
long_description=open("README.md").read(),
classifiers=[
"Environment :: Console",
"Intended Audience :: Science/Research",
"Operating ... | 1.265625 | 1 |
python/tests/test_TermSim_write_read_Resnik_CC.py | paulbible/ggtk | 2 | 12772775 | <filename>python/tests/test_TermSim_write_read_Resnik_CC.py<gh_stars>1-10
#/*=============================================================================
#Copyright (c) 2016 <NAME>
#
#Distributed under the Boost Software License, Version 1.0. (See accompanying
#file LICENSE_1_0.txt or copy at http://www.boost.org/LICE... | 2.203125 | 2 |
mediapipe/calculators/tensorflow/tensorflow_inference_calculator_pb2.py | mengfu188/simple-mediapipe | 5 | 12772776 | <reponame>mengfu188/simple-mediapipe<gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/calculators/tensorflow/tensorflow_inference_calculator.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
fr... | 1.375 | 1 |
binvox_gen.py | wangyida/voxel-dcgan | 1 | 12772777 | <gh_stars>1-10
import glob
import os
import subprocess
import sys
'''
voxsize = 32
paths = glob.glob("/media/wangyida/D0-P1/database/ShapeNetCore.v2/*/*/*/*.obj")
print("number of data:", len(paths))
with open(os.devnull, 'w') as devnull:
for i, path in enumerate(paths):
cmd = "binvox -d {0} -cb -e {1}".fo... | 2.234375 | 2 |
pycacher/batcher.py | garindra/pycacher | 1 | 12772778 | class Batcher(object):
"""
Batcher enables developers to batch multiple retrieval requests.
Example usage #1::
from pycacher import Cacher
cacher = Cacher()
batcher = cacher.create_batcher()
batcher.add('testkey')
batcher.add('testkey1')
batcher.add('test... | 3.625 | 4 |
venv/Lib/site-packages/pyrogram/errors/exceptions/bad_request_400.py | iamgeorgiy/heroku-userbot | 0 | 12772779 | <filename>venv/Lib/site-packages/pyrogram/errors/exceptions/bad_request_400.py
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2020 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the ... | 2.703125 | 3 |
savu/plugins/loaders/utils/my_safe_constructor.py | nghia-vo/Savu | 0 | 12772780 | from yaml.constructor import SafeConstructor
# Create custom safe constructor class that inherits from SafeConstructor
class MySafeConstructor(SafeConstructor):
# Create new method handle boolean logic
def add_bool(self, node):
return self.construct_scalar(node)
# Inject the above boolean logic into ... | 2.703125 | 3 |
lazy/api/timez.py | trisongz/lazycls | 2 | 12772781 | from __future__ import annotations
import time
from datetime import datetime, timezone
from lazy.models.timez import TimeCls
from .config import TimeZoneConfigz
from .base_imports import *
def _require_pytz():
pytz = Lib.import_lib('pytz')
Lib.reload_module(pytz)
def _require_dateparser():
dateparser = ... | 2.5625 | 3 |
main.py | Israel7777/plant_disease_experements | 26 | 12772782 | <reponame>Israel7777/plant_disease_experements
import os
import argparse
import subprocess
import numpy as np
from PIL import Image
from tensorflow.python.keras.models import load_model
from tensorflow.python.keras.preprocessing import image
from tensorflow.python.keras.applications.inception_v3 import preprocess_inp... | 2.265625 | 2 |
tools/finto-skos-to-marc/finto-skos-to-marc.py | NatLibFi/Finto-data | 14 | 12772783 | #!/usr/bin/env python3
# coding=utf-8
from rdflib import Graph, Namespace, URIRef, BNode, Literal, RDF
from rdflib.namespace import SKOS, XSD, OWL, DC
from rdflib.namespace import DCTERMS as DCT
from SPARQLWrapper import SPARQLWrapper, SPARQLExceptions
import socket
import time
from pymarc import Record, Field, XMLWri... | 1.867188 | 2 |
Turnauswertung-py3/common/urls.py | naechtner/turn-events | 0 | 12772784 | from django.conf.urls import url
from common import views
urlpatterns = [
url(r'^$', views.index, name='home'),
url(r'^disciplines/?$', views.disciplines_index, name='disciplines.index'),
url(r'^disciplines/new$',
views.DisciplineCreateView.as_view(), name='disciplines.new'),
url(r'^disciplin... | 1.882813 | 2 |
scripts/utils.py | akx/mapnificent_generator | 6 | 12772785 | <reponame>akx/mapnificent_generator
import errno
import re
import os
import yaml
NON_WORD_RE = re.compile('[^\w-]')
def slugify(s):
return NON_WORD_RE.sub('-', s)
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(path):
... | 2.515625 | 3 |
onto/domain_model.py | billyrrr/onto | 1 | 12772786 | <gh_stars>1-10
from onto.primary_object import PrimaryObject
class DomainModel(PrimaryObject):
"""
Domain model is intended for handling business logic.
"""
@classmethod
def _datastore(cls):
from onto.context import Context as CTX
return CTX.db
| 2.28125 | 2 |
setup.py | drivet/pylint-server | 17 | 12772787 | """
pylint-server
----
A small Flask application to keep keep track of pylint reports and ratings
on a per-repository basis.
"""
from setuptools import setup
setup(
name='pylint-server',
version='0.1',
url='https://github.com/drivet/pylint-server/',
license='MIT',
author='<NAME>',
author_emai... | 1.460938 | 1 |
vyperlogix/__init__.py | raychorn/chrome_gui | 1 | 12772788 | __copyright__ = """\
(c). Copyright 2008-2020, Vyper Logix Corp., All Rights Reserved.
Published under Creative Commons License
(http://creativecommons.org/licenses/by-nc/3.0/)
restricted to non-commercial educational use only.,
http://www.VyperLogix.com for details
THE AUTHOR VYPER LOGIX CORP DISCLAIMS ALL WARRA... | 2.21875 | 2 |
ckanext/dalrrd_emc_dcpr/cli/utils.py | ricardogsilva/ckanext-dalrrd-emc-dcpr | 0 | 12772789 | import enum
import logging
import typing
import click
from ckan import model
from ckan.logic import NotFound
from ckan.lib import jinja_extensions
from ckan.plugins import toolkit
from flask_babel import gettext as flask_ugettext, ngettext as flask_ungettext
from jinja2 import Environment
logger = logging.getLogger(_... | 1.976563 | 2 |
nextdl/postprocessor/execafterdownload.py | devenu85/nextdl | 1 | 12772790 | """
MIT License
Copyright (c) 2021 nextdl
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... | 2 | 2 |
sqlalchemy_imageattach/store.py | jpmn/sqlalchemy-imageattach | 83 | 12772791 | """:mod:`sqlalchemy_imageattach.store` --- Image storage backend interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module declares a common interface for physically agnostic storage
backends. Whatever a way to implement a storage, it needs only common
operations of the interfac... | 2.796875 | 3 |
costprediction/predict.py | Guillaume-Docquier/python-azure-func-tutorial | 1 | 12772792 | import tensorflow as tf
import numpy as np
import os
SCRIPT_PATH = os.path.abspath(__file__)
SCRIPT_DIR = os.path.dirname(SCRIPT_PATH)
MODEL_PATH = os.path.join(SCRIPT_DIR, "model/model.h5")
MODEL = None
INPUT_SIZE = 7 * 12
OUTPUT_SIZE = 1
def _load_model():
"""
Load the TensorFlow model if it is not loaded... | 2.734375 | 3 |
angr_seek.py | ucsb-seclab/hacrs-input-generator | 3 | 12772793 | import json
import re
import sys
import angr
import IPython
import os
import logging
import time
import simuvex
import select
from angr.exploration_techniques import ExecuteAddressGoal
from config import *
#base_dir = KUBERNETES_BASE_DIR
base_dir = DESKTOP_BASE_DIR
def heardEnter():
i,o,e = select.select([sys.... | 2.015625 | 2 |
ogkeeper.py | paulober/OGKeeper | 0 | 12772794 | #!/usr/bin/python3
import json
import os
import shutil
import sys
import time
def main(config_file="/etc/ogkeeper/config.json"):
with open(config_file, 'r') as f:
content = ''.join(f.readlines())
config = json.loads(content)
time.sleep(int(config["countdownInMinutesNotFloatingpoint"])*60)
fo... | 2.421875 | 2 |
Scripts/patser_list_parallel.py | colinwalshbrown/CWB_utils | 0 | 12772795 | <gh_stars>0
#!/usr/bin/env python
import sys
import re
import patser_tools
import xgrid_tools
CHUNKSIZE=10000
class seq_scanner():
def __init__(self,
seqs=None,
matrices=None):
self.seqs=seqs
self.matrices=matrices
self.results=None
self.header=No... | 2.6875 | 3 |
layers.py | anish9/Deblur-Network | 6 | 12772796 | import os
import cv2
import numpy as np
from tensorflow.keras.layers import *
import tensorflow as tf
from tensorflow.keras.layers import add
from tensorflow.keras.models import Model
import tensorflow.keras.backend as K
from tensorflow.keras.preprocessing.image import load_img,img_to_array
from tensorflow.keras.optimi... | 2.796875 | 3 |
metadata/resources/xrt.py | bmampaey/SDA | 0 | 12772797 | # Generated by command write_metadata_files version 1
from metadata.models import Xrt
from .base_metadata import BaseMetadataResource
__all__ = ['XrtResource']
class XrtResource(BaseMetadataResource):
'''RESTful resource for model Xrt'''
class Meta(BaseMetadataResource.Meta):
abstract = False
queryset = Xrt.... | 2 | 2 |
lambda_module.py | sernst/HelloLambda | 0 | 12772798 | <gh_stars>0
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
import os
import sys
#*******************************************************************************
# Initialize the python environment by adding the nec... | 2.65625 | 3 |
homeassistant/components/webostv/trigger.py | MrDelik/core | 30,023 | 12772799 | """webOS Smart TV trigger dispatcher."""
from __future__ import annotations
from typing import cast
from homeassistant.components.automation import (
AutomationActionType,
AutomationTriggerInfo,
)
from homeassistant.const import CONF_PLATFORM
from homeassistant.core import CALLBACK_TYPE, HomeAssistant
from ho... | 2.1875 | 2 |
ares/inference/FitGlobal21cm.py | eklem1/ares | 0 | 12772800 | """
ModelFit.py
Author: <NAME>
Affiliation: University of Colorado at Boulder
Created on: Mon May 12 14:01:29 MDT 2014
Description:
"""
import signal
import numpy as np
from ..util.PrintInfo import print_fit
from ..util.Pickling import write_pickle_file
from ..physics.Constants import nu_0_mhz
import gc, os, sys,... | 2.0625 | 2 |
abaqus_inside.py | rodrigo1392/abaqus_macros | 4 | 12772801 | """Functions to manage Abaqus objects and actions internally.
Intended to be used by the Abaqus CAE Python interpreter.
Developed by <NAME>.
https://github.com/rodrigo1392
"""
from abaqus import *
from abaqusConstants import *
from driverUtils import *
import odbAccess
# Flexibilize for Abaqus viewer
try:
from c... | 2.359375 | 2 |
dnt_handle/Main.py | mybluedog24/dragonnest_skill_simulator | 0 | 12772802 | <gh_stars>0
import os
from OutputForSim import*
from OutputCSV import*
from FileIO import*
from OutputJS import*
def upate(dnt_list, class_list, exclusive_skills, json_str_dict, class_dict, uistring, skilltreetable, jobtable, playerleveltable, weapondict, folderCSV,folderDNT,folderJSON,folderSKILLJS):
''''''
... | 2.78125 | 3 |
vows/pil_engine_vows.py | kilinger/thumbor | 0 | 12772803 | <filename>vows/pil_engine_vows.py<gh_stars>0
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com <EMAIL>
from pyvows import Vows, expect
ctx = V... | 2.09375 | 2 |
publications/leveraging_domain_knowledge/2_false_merge_detection/evaluate/copy_and_crop.py | constantinpape/cluster_tools | 28 | 12772804 | <gh_stars>10-100
#! /bin/python
import os
import sys
import json
import luigi
import z5py
import cluster_tools.utils.function_utils as fu
from cluster_tools.cluster_tasks import SlurmTask, LocalTask, LSFTask
#
# Validation measure Tasks
#
class CopyAndCropBase(luigi.Task):
""" CopyAndCrop base class
"""
... | 1.945313 | 2 |
ascension/profiler.py | drekels/ascension | 0 | 12772805 | from util import Singleton
import datetime as dt
import logging
import pyglet
from ascension.settings import AscensionConf
LOG = logging.getLogger(__name__)
SLOW_FRAME_MESSAGE = (
"Last execution of '{profiler_label}' lasted {time_passed}, which is over the target "
"{target_time} by {time_over}!"
)
REPORT_... | 2.453125 | 2 |
samples/through_put_test/receiver.py | LuigiVanin/ZigBee-Test-Tool | 2 | 12772806 | <gh_stars>1-10
from digi.xbee.devices import ZigBeeDevice
from zigbee_tool.core.tests.throughput import throughput_receiver
PORT_RECEIVER = "/dev/ttyUSB1"
BAUD_RATE = 115200
device_receiver = ZigBeeDevice(PORT_RECEIVER, BAUD_RATE)
try:
device_receiver.open()
print(device_receiver.get_node_id())
throu... | 2.46875 | 2 |
golomb.py | damian1996/Information-Coding | 0 | 12772807 | import math as m
def is_power_of_2(num):
return num != 0 and ((num & (num - 1)) == 0)
def code(num, mod):
unary = num // mod
reminder = num % mod
code = '1' * unary + '0'
print(code)
if is_power_of_2(mod):
bits_needed = int(m.log(mod, 2))
add_bits = bin(reminder)[2:]
add_b... | 3.640625 | 4 |
nova/tests/api/openstack/test_versions.py | armaan/nova | 0 | 12772808 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack 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... | 1.28125 | 1 |
src/Instructions/beq.py | martydill/PyCIL | 3 | 12772809 | <filename>src/Instructions/beq.py<gh_stars>1-10
# beq.py
# The CIL beq instruction
# Copyright 2010 <NAME> - see LICENSE for details
from Instruction import Instruction
import unittest
from Instructions.ldc import ldc
from Instructions.Instruction import register
from Variable import Variable
class beq(Instruction):
... | 2.484375 | 2 |
env.example.py | linnil1/sync-ytchat-to-discord | 2 | 12772810 | DISCORD_TOKEN="<PASSWORD>"
| 1.054688 | 1 |
fah_xchem/analysis/structures.py | choderalab/fah-xchem | 3 | 12772811 | """
Tools for extracting snapshots and structures from core22 FAH trajectories.
Limitations:
* The reference structure (`natoms_reference`) must share the same atom ordering as the first `natoms_reference` atoms of the trajectory.
For now, this means that the SpruceTK prepared structure (`Mpro-x10789_0_bound-protein... | 2.0625 | 2 |
casl_parser.py | Secret-Plans/CaSL | 0 | 12772812 | import json
class Parser:
"""A parser for converting a set of tokens into an abstract syntax tree.
"""
def __init__(self, statement_defs : dict, types : list, settings : dict):
"""Initializes the parser with a set of pre-defined statements and types
Arguments:
statemen... | 3.953125 | 4 |
spreukbot/generator.py | mivdnber/spreukbot | 1 | 12772813 | <gh_stars>1-10
from collections import defaultdict
import random
import difflib
import io
import textwrap
import urllib.parse
import logging
import requests
from PIL import Image, ImageDraw, ImageFont
import click
import spreukbot.rendering as rendering
import spreukbot.facebook as facebook
import spreukbot.config as... | 2.703125 | 3 |
plot.py | scivision/ascii2hdf5-examples | 0 | 12772814 | <reponame>scivision/ascii2hdf5-examples
"""
plot HDF5 proprietary data converted by ascii2hdf5.py
"""
from pathlib import Path
import xarray
import argparse
import numpy as np
from matplotlib.pyplot import subplots, show
from matplotlib.colors import LogNorm
def plot(dat: xarray.DataArray):
if dat.ndim != 3:
... | 2.8125 | 3 |
1303.py | liuwenxiang1981/lwx | 0 | 12772815 | <reponame>liuwenxiang1981/lwx<filename>1303.py
import requests
# def get_imageNet_data(path):
headers = {
'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
}
response = requests.get('http://www.image-net.org/api/text/imagenet... | 2.796875 | 3 |
tests/unit/lib/aquilon/worker/commands/test_compile_hostname.py | ned21/aquilon | 7 | 12772816 | <reponame>ned21/aquilon
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2019 Contributor
#
# 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 ... | 2.0625 | 2 |
spacy_dbpedia_spotlight/util.py | oroszgy/spacy-dbpedia-spotlight | 51 | 12772817 | <reponame>oroszgy/spacy-dbpedia-spotlight
try: # Python 3.8
import importlib.metadata as importlib_metadata
except ImportError:
import importlib_metadata # noqa: F401
pkg_meta = importlib_metadata.metadata(__name__.split(".")[0]) | 1.65625 | 2 |
TMB/scrape.py | clayton-rossiter/TakeMyBins | 0 | 12772818 | <reponame>clayton-rossiter/TakeMyBins
from bs4 import BeautifulSoup
from bs4.element import Tag
import requests
from TMB.result import ScrapeResult
class Scraper:
URL:str = r"https://www.adur-worthing.gov.uk/bin-day/?brlu-selected-address=100061879527&return-url=%2Fbin-day%2F"
def scrape(self) -> list[Scrap... | 3.5 | 4 |
IPython/kernel/blocking/client.py | pyarnold/ipython | 1 | 12772819 | """Implements a fully blocking kernel client.
Useful for test suites and blocking terminal interfaces.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# th... | 1.757813 | 2 |
pyfilter/src/filters/all_match_filter.py | zkscpqm/pyfilter | 0 | 12772820 | from typing import Text, List, Set
from pyfilter.src.filters import _BaseFilter
from pyfilter.src.filter_context import FilterContext
class _AllMatchFilter(_BaseFilter):
def __init__(self, keywords: List[Text]):
super().__init__(keywords)
def filter(self, input_string, ctx):
"""
Run ... | 2.984375 | 3 |
mindspore/python/mindspore/scipy/utils_const.py | AK391/mindspore | 0 | 12772821 | <gh_stars>0
# Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 1.929688 | 2 |
src/settings/_sqlite.py | Freonius/tranquillity | 0 | 12772822 | <filename>src/settings/_sqlite.py
from typing import Union, Dict
from sqlite3 import connect, Connection, Cursor, ProgrammingError
from .__interface import ISettings
class Sqlite(ISettings):
_connection: Connection
_key_col: str
_val_col: str
_tbl: str
_db_file: str
# pylint: disable=too-many... | 2.875 | 3 |
chalmers/commands/add.py | Anaconda-Platform/chalmers | 11 | 12772823 | <reponame>Anaconda-Platform/chalmers
'''
Add a program without running it
eg:
chalmers add --name server1 -- python /path/to/myserver.py
or:
chalmers add --name server1 -c "python /path/to/myserver.py"
Note that this does not run the program by default. To run your program,
run `chalmers start NAME` or use t... | 2.796875 | 3 |
spea2/algorithm/individual.py | togulcan/SPEA2-ICoptimizer | 4 | 12772824 | <reponame>togulcan/SPEA2-ICoptimizer
from .fitness import Fitness
class Individual:
TARGETS = {}
CONSTRAINTS = {}
constraint_operations = []
constraint_constants = []
def __init__(self, circuit, N):
self.circuit = circuit
self.fitness = Fitness(N)
self.arch_fitness = Fitne... | 2.671875 | 3 |
model.py | lFatality/tensorflow2caffe | 115 | 12772825 | <reponame>lFatality/tensorflow2caffe
from tflearn import input_data, conv_2d, max_pool_2d, fully_connected, dropout, Momentum, regression, DNN
#model of vgg-19
def vgg_net_19(width, height):
network = input_data(shape=[None, height, width, 3], name='input')
network = conv_2d(network, 64, 3, activation = 'relu'... | 2.53125 | 3 |
docs/snippets/ov_python_exclusives.py | kurylo/openvino | 1,127 | 12772826 | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
#! [auto_compilation]
import openvino.runtime as ov
compiled_model = ov.compile_model("model.xml")
#! [auto_compilation]
#! [properties_example]
core = ov.Core()
input_a = ov.opset8.parameter([8])
res = ov.opset8.a... | 1.976563 | 2 |
src/ext/glbinding/codegeneration/scripts/gen_extensions.py | carl-221b/gen_planete | 18 | 12772827 | <filename>src/ext/glbinding/codegeneration/scripts/gen_extensions.py<gh_stars>10-100
from binding import *
from context import Context
def genExtensionContexts(extensions):
extensionContexts = []
for extension in extensions:
commandContexts = Context.listContext([{"identifier": functionBID(c), "name":... | 1.953125 | 2 |
amphi-4.py | helionjf/TelloEduSwarmSearch | 0 | 12772828 | from fly_tello import FlyTello
my_tellos = list()
'''
// scenario specifique amphi MPG
// position initiale : 1 2 3 4 (tous les drones à 12h)
// Séparés de 1 m
// TO DO : à terminer
'''
#
# MAIN FLIGHT CONTROL LOGIC
#
# Define the Tello's we're using, in the order we want them numbered
my_tellos.append('0TQDG2KEDB4... | 2.984375 | 3 |
source/setup.py | hytalo-bassi/aeternah | 1 | 12772829 | from importlib import import_module, invalidate_caches
from inspect import getmembers, isfunction
from aiogram import Dispatcher, Bot
from os.path import abspath
from ujson import loads
from os import environ
import logging
logging.basicConfig(level=logging.INFO, filename=".log", filemode="w+")
_langs = loads(open('so... | 2.125 | 2 |
kingfisher_scrapy/spiders/kenya_makueni.py | open-contracting/kingfisher-collect | 7 | 12772830 | <reponame>open-contracting/kingfisher-collect<gh_stars>1-10
from kingfisher_scrapy.base_spider import SimpleSpider
from kingfisher_scrapy.util import handle_http_error, parameters
class KenyaMakueni(SimpleSpider):
"""
Domain
Makueni County
Swagger API documentation
https://opencontracting.maku... | 2.5 | 2 |
GamesKeeper/models/guild.py | ThatGuyJustin/GamesKeeper | 0 | 12772831 | from GamesKeeper.db import BaseModel
from peewee import (BigIntegerField, IntegerField, TextField, BooleanField,
DoesNotExist)
from playhouse.postgres_ext import BinaryJSONField, ArrayField
@BaseModel.register
class Guild(BaseModel):
guild_id = BigIntegerField(primary_key=True)
owner_id = ... | 2.25 | 2 |
mrs_plugin/tests/unit/test_core.py | mike-lischke/mysql-shell-plugins | 11 | 12772832 | <reponame>mike-lischke/mysql-shell-plugins<filename>mrs_plugin/tests/unit/test_core.py
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Softwa... | 1.78125 | 2 |
dynamics_learning/networks/baseline/planet_baseline.py | wuphilipp/replay-overshooting | 0 | 12772833 | <reponame>wuphilipp/replay-overshooting
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from typing import Any, List, Optional, Tuple, overload
import torch
from fannypack.nn import resblocks
from fannypack.utils import Buddy
from torch import nn as nn
from dynamics_learning.data.data... | 2.421875 | 2 |
colour/utilities/__init__.py | jchwei/colour | 0 | 12772834 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .data_structures import Lookup, Structure, CaseInsensitiveMapping
from .common import (
handle_numpy_errors, ignore_numpy_errors, raise_numpy_errors,
print_numpy_errors, warn_numpy_errors, ignore_python_warnings, batch,
disable_multiproce... | 1.65625 | 2 |
telnyx-python/telnyx/aio/api_resources/list_object.py | team-telnyx/telnyx-2fa | 0 | 12772835 | <reponame>team-telnyx/telnyx-2fa
from telnyx import util
from telnyx.six.moves.urllib.parse import quote_plus
from telnyx.telnyx_object import TelnyxObject
class ListObject(TelnyxObject):
async def list(self, **params):
return await self.request("get", self["url"], params)
@classmethod
def empty_... | 2.609375 | 3 |
recitations/01_apache_kafka/producer.py | DerekHJH/seai | 1 | 12772836 | <filename>recitations/01_apache_kafka/producer.py
from time import sleep
from json import dumps
from kafka import KafkaProducer
# Create a producer to write data to kafka
producer = KafkaProducer(bootstrap_servers=['localhost:9092'],
value_serializer=lambda x: dumps(x).encode('utf-8'))
# Writ... | 2.609375 | 3 |
invenio_app_rdm/records_ui/views/deposits.py | ntarocco/invenio-app-rdm | 0 | 12772837 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019-2021 CERN.
# Copyright (C) 2019-2021 Northwestern University.
# Copyright (C) 2021 <NAME>.
#
# Invenio App RDM is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Routes for record-rel... | 1.71875 | 2 |
scripts/alt_evaluation/flair_vs_litbank_gs.py | therosko/Thesis-NER-in-English-novels | 0 | 12772838 | <gh_stars>0
########################################################################################################################
# This script reads in the Litbank gold standard and compairs it to the Flair output files
# The data used here consists of only the 12 overlapping novels with their respecive overlapping... | 2.421875 | 2 |
api/urls.py | volCommunity/vol-django | 5 | 12772839 | <filename>api/urls.py
from django.conf.urls import url, include
from django.views.generic.base import RedirectView
from rest_framework import routers
from rest_framework.schemas import get_schema_view
from rest_framework_swagger.renderers import OpenAPIRenderer, SwaggerUIRenderer
from . import views
schema_view = ge... | 2.125 | 2 |
paths_procedures/show_shortest_path_dialog.py | jamiecook/AequilibraE | 0 | 12772840 | <reponame>jamiecook/AequilibraE
"""
-----------------------------------------------------------------------------------------------------------
Package: AequilibraE
Name: Shortest path computation
Purpose: Dialog for computing and displaying shortest paths based on clicks on the map
Original Author: ... | 2.140625 | 2 |
main.py | PTYin/ESRT | 0 | 12772841 | <filename>main.py
"""Training and testing the hierarchical embedding model for personalized product search
See the following paper for more information on the hierarchical embedding model.
* <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. 2017. Learning a Hierarchical Embedding Model for Personalized ProductSearch. In Pr... | 2.5625 | 3 |
services/storage/close_uploader.py | samle-appsbroker/acquire | 21 | 12772842 | <filename>services/storage/close_uploader.py
from Acquire.Storage import DriveInfo
def run(args):
"""Close the uploader for a file - this stops new chunks being uploaded"""
drive_uid = str(args["drive_uid"])
file_uid = str(args["file_uid"])
secret = str(args["secret"])
drive = DriveInfo(drive_u... | 2.59375 | 3 |
dinette/migrations/0001_initial.py | agiliq/Dinette | 17 | 12772843 | <filename>dinette/migrations/0001_initial.py
from south.db import db
from django.db import models
from dinette.models import *
class Migration:
def forwards(self, orm):
# Adding model 'DinetteUserProfile'
db.create_table('dinette_dinetteuserprofile', (
('id', orm['dinette... | 2.078125 | 2 |
examples/docs_snippets/docs_snippets/overview/configuration/configured_solid_example.py | AndersonReyes/dagster | 0 | 12772844 | <gh_stars>0
from dagster import Field, configured, solid
@solid(
config_schema={'iterations': int, 'word': Field(str, is_required=False, default_value='hello')}
)
def example_solid(context):
for _ in range(context.solid_config['iterations']):
context.log.info(context.solid_config['word'])
# returns ... | 2.34375 | 2 |
mlxtend/mlxtend/evaluate/permutation.py | WhiteWolf21/fp-growth | 0 | 12772845 | # <NAME> 2014-2020
# mlxtend Machine Learning Library Extensions
#
# Nonparametric Permutation Test
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
import numpy as np
from itertools import combinations
from math import factorial
try:
from nose.tools import nottest
except ImportError:
# Use a no-op decorat... | 3.265625 | 3 |
samples/aci-epg-reports-in-yaml.py | richardstrnad/acitoolkit | 351 | 12772846 | #!/usr/bin/env python
"""
Simple application that logs on to the APIC and displays all
EPGs.
"""
import socket
import yaml
import sys
from acitoolkit import Credentials, Session, Tenant, AppProfile, EPG, Endpoint
def main():
"""
Main show EPGs routine
:return: None
"""
# Login to APIC
descrip... | 2.546875 | 3 |
hello.py | blackswanburst/mikemccllstr-python-minecraft | 3 | 12772847 | <reponame>blackswanburst/mikemccllstr-python-minecraft<filename>hello.py
import mcpi.minecraft as minecraft
import mcpi.block as block
world = minecraft.Minecraft.create()
[x,y,z] = world.player.getPos()
world.postToChat( "Position is: %d %d %d" % (x,y,z) )
world.player.setPos( 0, 64, 0 )
| 2.71875 | 3 |
examples/org-website/map_sample.py | tonytheonlypony/hazelcast-python-client | 98 | 12772848 | <reponame>tonytheonlypony/hazelcast-python-client<gh_stars>10-100
import hazelcast
# Start the Hazelcast Client and connect to an already running Hazelcast Cluster on 127.0.0.1
client = hazelcast.HazelcastClient()
# Get the Distributed Map from Cluster.
my_map = client.get_map("my-distributed-map").blocking()
# Standa... | 2.734375 | 3 |
tests/test_write.py | sphh/RPLCD | 231 | 12772849 | <reponame>sphh/RPLCD
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import pytest
from RPLCD.gpio import CharLCD
from RPLCD.common import LCD_SETDDRAMADDR
def test_write_simple(mocker, charlcd_kwargs):
"""
Write "HelloWorld" to the display.
"""... | 2.46875 | 2 |
visualizer/equityparser.py | mrhewitt/genotick-cs | 0 | 12772850 | <reponame>mrhewitt/genotick-cs
#from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
import pandas as pd
class EquityParser:
def __init__(self, profit_file, multiplier):
self.pnl = pd.read_csv(profit_file,header=None,names=['date','cummulative','pertrade'],index_col=0,parse_dates=T... | 3.015625 | 3 |