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 |
|---|---|---|---|---|---|---|
pylint/examples/with_issues/example.py | strangeworks/cloud-builders-community | 0 | 25900 | <filename>pylint/examples/with_issues/example.py
#!/usr/bin/env python3
print("useless script")
| 1.265625 | 1 |
src/labelpair2csv.py | hanshiyi/GeneFusion | 0 | 25901 | import sys
import csv
import glob
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("lp_files", help="The label pair need to be converted")
parser.add_argument("dir2pubmed", help="The directory to the place for pubmed articles")
parser.add_argument('out_path', help="The path to store finaltraining ... | 2.75 | 3 |
dayu_widgets/radio_button.py | ZSD-tim/dayu_widgets | 157 | 25902 | <reponame>ZSD-tim/dayu_widgets
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###################################################################
# Author: <NAME>
# Date : 2019.2
# Email : <EMAIL>
###################################################################
"""
MRadioButton
"""
from dayu_widgets.mixin import cur... | 2.21875 | 2 |
NeoML/Python/neoml/Dnn/RepeatSequence.py | ndrewl/neoml | 0 | 25903 | """ Copyright (c) 2017-2020 ABBYY Production 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 applicable law or agreed to in wr... | 2.84375 | 3 |
main_train.py | telenordigital/yawn | 1 | 25904 | #! /usr/bin/env python
# Copyright 2018 The Yawn Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 2.296875 | 2 |
main.py | arjunds7/Python-Scripting-Morse-Code-Converter | 0 | 25905 | <gh_stars>0
# A Text to Morse Code Converter Project
# Notes:
# This Morse code make use of the basic morse code charts which contains 26 alphabets and 10 numerals
# No special characters are currently involved. But can be added in the '.txt ' file based on the requirement.
MORSE_CODE_CHART = "script_texts.txt"... | 4.28125 | 4 |
framework/CodeInterfaces/PHISICS/DecayParser.py | milljm/raven | 0 | 25906 | """
Created on June 19th, 2017
@author: rouxpn
"""
from __future__ import division, print_function, unicode_literals, absolute_import
import warnings
warnings.simplefilter('default', DeprecationWarning)
import os
import re
from decimal import Decimal
class DecayParser():
"""
Parses the PHISICS xml decay file an... | 2.40625 | 2 |
pkg/unival_tree.py | macchid/dcp-python | 0 | 25907 |
class Node:
def __init__(self, val, left=None, right=None):
self.val = val
self.left = left
self.right = right
def count_univals(node):
if node.right is None and node.left is None:
return node.val, True, 1
l_val, l_is_unival, l_univals = count_univals(node.left)
r_val... | 3.90625 | 4 |
Parsers/GFF.py | mahajrod/MAVR | 10 | 25908 | <gh_stars>1-10
#!/usr/bin/env python
from RouToolPa.Parsers.Abstract import Record, Metadata, Collection
class MetadataGFF(Metadata):
# TODO: rewrite for general case
pass
class RecordGFF(Record):
def __init__(self, chrom, source, type, start, end, score, strand, quality, attributes):
self.chr... | 3.0625 | 3 |
test/integration/ggrc/models/test_control_assessment.py | mikecb/ggrc-core | 0 | 25909 | <reponame>mikecb/ggrc-core<filename>test/integration/ggrc/models/test_control_assessment.py
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: <EMAIL>
# Maintained By: <EMAIL>
from ggrc import db
fr... | 2.140625 | 2 |
prettyqt/core/variantanimation.py | phil65/PrettyQt | 7 | 25910 | <reponame>phil65/PrettyQt<gh_stars>1-10
from __future__ import annotations
from typing import Callable, Iterator
from prettyqt import core
from prettyqt.qt import QtCore
from prettyqt.utils import types
QtCore.QVariantAnimation.__bases__ = (core.AbstractAnimation,)
class VariantAnimation(QtCore.QVariantAnimation)... | 2.234375 | 2 |
tests/Endpoint_unit_test.py | dr3dd589/django-DefectDojo | 2 | 25911 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import Select
import unittest
import re
import sys
import os
# first thing first. We have to create product, just to make sure there is atleast 1 product available
# to assign endpoints to when crea... | 2.5625 | 3 |
src/optopus/__init__.py | hindman/optopus | 2 | 25912 | <reponame>hindman/optopus<gh_stars>1-10
from .parser import Parser, Result
from .version import __version__
| 1 | 1 |
psana/psana/graphqt/CMWDBMain.py | slac-lcls/pdsdata2 | 0 | 25913 |
"""
Class :py:class:`CMWDBMain` is a QWidget for calibman
===========================================================
Usage ::
See test_CMWDBMain() at the end
See:
- :class:`CMWDBMain`
- :class:`CMWMainTabs`
- :class:`CMConfigParameters`
- `graphqt documentation <https://lcls-psana.github.io/grap... | 2 | 2 |
localstack/plugin/entrypoint.py | Madajevas/localstack | 13 | 25914 | import inspect
from collections import defaultdict
from typing import Dict, List, NamedTuple
from .core import PluginFinder, PluginSpec
from .discovery import PackagePathPluginFinder
class EntryPoint(NamedTuple):
name: str
value: str
group: str
EntryPointDict = Dict[str, List[str]]
def discover_entry... | 2.640625 | 3 |
rgw/v2/lib/s3/lifecycle.py | viduship/ceph-qe-scripts | 6 | 25915 | <reponame>viduship/ceph-qe-scripts
# lifecycle config parameters explanation:
# https://boto3.readthedocs.io/en/latest/reference/services/s3.html#S3.Client.put_bucket_lifecycle_configuration
import os
import sys
sys.path.append(os.path.abspath(os.path.join(__file__, "../../../")))
import logging
log = logging.getLogg... | 2.03125 | 2 |
ddu_dirty_mnist/dirty_mnist.py | BlackHC/ddu_dirty_mnist | 3 | 25916 | # AUTOGENERATED! DO NOT EDIT! File to edit: 01_dataloader.ipynb (unless otherwise specified).
__all__ = ['MNIST_NORMALIZATION', 'AmbiguousMNIST', 'FastMNIST', 'DirtyMNIST']
# Cell
import os
from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Union
from urllib.error import URLError
import torch
from t... | 2.546875 | 3 |
python/qipkg/actions/build.py | vbarbaresi/qibuild | 0 | 25917 | <gh_stars>0
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the COPYING file.
""" Build all the projects of the given pml file
"""
import qibuild.parsers
import qipkg.parsers
def configure_parser(parser):
"""Con... | 1.453125 | 1 |
qrandom/driver/raw_driver.py | lastmeta/qrandom | 0 | 25918 | #!/usr/bin/python
# TrueRNG Read - Simple Example
# <NAME>
# 8/21/2016
#
# Requires Python 2.7, pyserial
# On Linux - may need to be root or set /dev/tty port permissions to 666
#
# Python 2.7.xx is available here: https://www.python.org/
# Install Pyserial package with: python -m pip install pyserial
import serial... | 3.078125 | 3 |
cygraphblas/lib/monoid/ss.py | eriknw/cygraphblas | 3 | 25919 | <filename>cygraphblas/lib/monoid/ss.py
from cygraphblas_ss.lib.monoid import *
| 0.878906 | 1 |
specviz/plugins/unit_change/__init__.py | ibusko/specviz | 0 | 25920 | from .unit_change_dialog import UnitChangeDialog
| 1.109375 | 1 |
charts.py | lancelote/flask-tutorial-demo | 8 | 25921 | from io import BytesIO
import matplotlib.pyplot as plt
from user_database import data, MONTHS, get_city_temperature, get_city_humidity, CITIES
def get_main_image():
"""Rendering the scatter chart"""
yearly_temp = []
yearly_hum = []
for city in data:
yearly_temp.append(sum(get_city_temperature... | 3.03125 | 3 |
calculator.py | Nynir/CalcPy | 1 | 25922 | <reponame>Nynir/CalcPy
import tkinter as tk
from tkinter import ttk
from functools import partial
DEBUG = True
global darkTheme
darkTheme = True
class calculator(ttk.Frame):
def __init__(self, parent):
ttk.Frame.__init__(self)
global allowed
allowed = { "=", "+", "-", "/", "%", "*" } #Doesnt support ^
glo... | 3.09375 | 3 |
src/cuda_ai/mean.py | TRex22/dave-A-2048-AI | 0 | 25923 | <filename>src/cuda_ai/mean.py
# -*- coding: utf-8 -*-
"""
Created on Sun May 21 15:35:38 2017
@author: Liron
"""
import numpy as np
np.set_printoptions(threshold=np.nan)
data = np.genfromtxt("cuda_times.csv", delimiter=",", usecols=(0,1), max_rows=97, skip_header=96+96+96)
print data[0]
print data[data.shape[0]-1]
... | 2.8125 | 3 |
src/MemeEngine/meme_generator.py | svd-007/Meme-Generator | 1 | 25924 | """Represent a class to generate a meme."""
from PIL import Image, ImageDraw, ImageFont
from os import makedirs
from random import randint
from textwrap import fill
class MemeGenerator:
"""
A class to generate a meme.
The following responsibilities are defined under this class:
- Loading of an image... | 4.09375 | 4 |
rotait/workload.py | stevecshanks/rota-it | 0 | 25925 | <filename>rotait/workload.py
from collections import Counter
class Workload:
def __init__(self, tasks):
self.per_person = Counter(task.assignee for task in tasks)
def assign(self, task, person):
task.assignee = person
self.per_person[person] += 1
return task
def assigned... | 3.0625 | 3 |
onsset/updated_summaries.py | AndreasSahlberg/onsset-Ethiopia | 0 | 25926 | <reponame>AndreasSahlberg/onsset-Ethiopia
"""
This script produces the summary analysis required to provide input data for the OSeMOSYS soft-link
"""
SET_TOTAL_ENERGY_PER_CELL = "TotalEnergyPerCell"
SET_ELEC_FINAL_CODE = "FinalElecCode"
SET_ELEC_CURRENT = 'ElecStart'
SET_POP = 'Pop'
SET_NEW_CONNECTIONS = 'NewConnectio... | 2.53125 | 3 |
2021/python/day-14.py | tadhg-ohiggins/advent-of-code | 1 | 25927 | <filename>2021/python/day-14.py
from collections import Counter
from functools import cache, partial, reduce
from math import prod
import pdb
import aoc
import networkx as nx
from toolz import keyfilter, sliding_window
from aoc import Point, adjacent_transforms, generate_bounded_coords
from tadhg_utils import (
lc... | 2.09375 | 2 |
mmrelay.py | AlexandrVLopatin/mmrelay | 0 | 25928 | <filename>mmrelay.py<gh_stars>0
#!/usr/bin/env python3
import json
import sys
import asyncio
import aiohttp
from aiohttp.resolver import AsyncResolver
import requests
import websockets
MM_URL = 'http://127.0.0.1:8065/api/v4'
MM_WSURL = 'ws://127.0.0.1:8065/api/v4/websocket'
MM_LOGIN = '<EMAIL>'
MM_PASSWORD = '<PASSW... | 2.640625 | 3 |
legacy/ABC_110/D1.py | mo-mo-666/AtCoder | 0 | 25929 | <reponame>mo-mo-666/AtCoder
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: mo-mo-
#
# Created: 23/09/2018
# Copyright: (c) mo-mo- 2018
# Licence: <your licence>
#------------------------------------------------------... | 3.046875 | 3 |
UVa 11332 - Summing Digits/sample/main.py | tadvi/uva | 1 | 25930 | <gh_stars>1-10
import sys
sys.stdin = open('input.txt')
while True:
N = int(input())
if not N:
break
strN = str(N)
while len(strN) > 1:
N = sum(int(i) for i in strN)
strN = str(N)
print strN
| 3.03125 | 3 |
backend/app/api/users.py | vacuumlabs/cowork-reservation | 0 | 25931 | import json
from flask import jsonify, request, make_response, render_template
from flask.blueprints import Blueprint
from app.daos import tenant_dao
from app.firebase_utils import *
from app.services import user_service
from app.user_dao import user_dao
users_bp = Blueprint("users_bp", __name__)
@users_bp.... | 2.34375 | 2 |
test_credentials.py | kuya-ui/Password-Locker | 0 | 25932 | <reponame>kuya-ui/Password-Locker<filename>test_credentials.py
import unittest
from credentials import Credential
class TestCredential(unittest.TestCase):
"""
Test class that defines test cases for the credential class behaviours,
the arguments help in creating test cases.
"""
def setUp(self):
... | 3.015625 | 3 |
awslambda/python_requirements/_python_project.py | ITProKyle/runway-hook-awslambda | 1 | 25933 | <filename>awslambda/python_requirements/_python_project.py
"""Python project."""
from __future__ import annotations
import logging
import shutil
from typing import TYPE_CHECKING, ClassVar, Optional, Set, Tuple
from runway.compat import cached_property
from typing_extensions import Literal
from ..base_classes import ... | 2.390625 | 2 |
instrbuilder/examples/oscilloscope.py | nopeppermint/instrbuilder | 5 | 25934 | <filename>instrbuilder/examples/oscilloscope.py
# <NAME>
# 05/2018
# <EMAIL>
# University of St. Thomas
from instrbuilder.instrument_opening import open_by_name
import time
KEYSIGHT = False
RIGOL = True
if KEYSIGHT:
osc = open_by_name(name='msox_scope') # name within the configuration file (config.yaml)
osc.set(... | 2.21875 | 2 |
setup.py | pcaro/django-redator | 1 | 25935 | #/usr/bin/env python
import codecs
import os
import sys
from setuptools import setup, find_packages
if 'publish' in sys.argv:
os.system('python setup.py sdist upload')
sys.exit()
read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
# Dynamically calculate the version based on redator.VERSIO... | 1.679688 | 2 |
desktop/core/ext-py/docutils-0.14/test/test_parsers/test_parser.py | kokosing/hue | 5,079 | 25936 | <filename>desktop/core/ext-py/docutils-0.14/test/test_parsers/test_parser.py
#! /usr/bin/env python
# $Id: test_parser.py 7463 2012-06-22 19:49:51Z milde $
# Author: <NAME> <strank(AT)strank(DOT)info>
# Copyright: This module has been placed in the public domain.
"""
Tests for basic functionality of parser classes.
"... | 2.453125 | 2 |
aloha/aloha_object.py | TDHTTTT/MadGraph_Windows | 0 | 25937 | <reponame>TDHTTTT/MadGraph_Windows
################################################################################
#
# Copyright (c) 2010 The MadGraph5_aMC@NLO Development team and Contributors
#
# This file is a part of the MadGraph5_aMC@NLO project, an application which
# automatically generates Feynman diagrams an... | 1.640625 | 2 |
sp_experiment/define_instructions.py | sappelhoff/sp_psychopy | 1 | 25938 | <gh_stars>1-10
"""Functions that either provide an instruction flow or a string to display."""
import os
import os.path as op
import numpy as np
import pandas as pd
import sp_experiment
from sp_experiment.utils import get_final_choice_outcomes
from sp_experiment.define_settings import (txt_color,
... | 3.03125 | 3 |
bareml/machinelearning/supervised/perceptron.py | shotahorii/ml-from-scratch | 3 | 25939 | <filename>bareml/machinelearning/supervised/perceptron.py<gh_stars>1-10
"""
Perceptron.
A simple implementation of Perceptron classifier algorithm
described in Bishop(2006).
Author: <NAME> <<EMAIL>>
Test: tests/test_perceptron.py
References:
C.M. Bishop (2006). Pattern Recognition and Machine Learning. Springer. 192... | 3.671875 | 4 |
src/service/picture_rc.py | NoOneXXX/magic-wormhole-client | 0 | 25940 | <filename>src/service/picture_rc.py
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x6c\x19\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d... | 1.40625 | 1 |
dags/hello_world_dag.py | garanin-se/airflow | 0 | 25941 | <filename>dags/hello_world_dag.py
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
args = {
'owner': 'garanin',
'start_date': datetime(2018, 11, 1),
'provide_context': True} # настройки дага, которые перадаем каждому дагу через дефол... | 2.390625 | 2 |
nudging/evaluate_outcome.py | UtrechtUniversity/nudging | 1 | 25942 | """Evaluate outcome (+CATE) of datasets"""
from scipy.stats import spearmanr
import numpy as np
def safe_spearmanr(arr_a, arr_b):
"Compute the spearman-R correlation, but 0 if all equal"
if np.all(arr_a[0] == arr_a) or np.all(arr_b[0] == arr_b):
return 0
return spearmanr(arr_a, arr_b).correlation... | 3.046875 | 3 |
htdocs/json/goes.py | trentford/iem | 0 | 25943 | <filename>htdocs/json/goes.py
#!/usr/bin/env python
"""
Return JSON metadata for GOES Imagery
"""
import cgi
import json
import os
import glob
import datetime
from pyiem.util import ssw
BIRDS = ['EAST', 'WEST']
PRODUCTS = ['WV', 'VIS', 'IR']
def parse_time(text):
"""
Convert ISO something into a datetime
... | 2.8125 | 3 |
js/jquery_scrolltofixed/__init__.py | davidjb/js.jquery_scrolltofixed | 1 | 25944 | <gh_stars>1-10
from fanstatic import Library, Resource
library = Library('scrolltofixed', 'resources')
scrolltofixed = Resource(library, 'jquery-scrolltofixed.js',
minified='jquery-scrolltofixed-min.js')
| 1.765625 | 2 |
python/ray/serve/scripts.py | dsctt/ray | 1 | 25945 | <reponame>dsctt/ray
#!/usr/bin/env python
import json
import os
import click
import ray
from ray.serve.api import Deployment
from ray.serve.config import DeploymentMode
from ray._private.utils import import_attr
from ray import serve
from ray.serve.constants import (
DEFAULT_CHECKPOINT_PATH,
DEFAULT_HTTP_HOST... | 2.171875 | 2 |
Alpha & Beta/Algorithms/wootwoot.py | Mdlkxzmcp/various_python | 0 | 25946 | def naive(a, b):
c = 0
while a > 0:
c = c + b
a = a - 1
return c
def russian(a, b):
"""
The Russian Peasant Algorithm:
Multiply one integer by the other integer.
Input: a, b: integers
Returns: a*b
"""
c = 0
while a > 0:
if a % 2 == 1:
... | 3.984375 | 4 |
tuples.py | sumon-dey/PythonConcepts | 6 | 25947 | # Python Tuples
# Ordered, Immutable collection of items which allows Duplicate Members
# We can put the data, which will not change throughout the program, in a Tuple
# Tuples can be called as "Immutable Python Lists" or "Constant Python Lists"
employeeTuple = ("Sam", "Sam" "Mike", "John", "Harry", "Tom", "Sean", "Ju... | 4.5625 | 5 |
dht22_sensor.py | mikrogravitation/humiditemp5000 | 0 | 25948 | import dht
class DHT22Sensor:
provides = ["temperature", "humidity"]
def __init__(self, port):
self._sensor = dht.DHT22(port)
def readout(self):
self._sensor.measure()
return {"temperature": self._sensor.temperature(), "humidity": self._sensor.humidity()}
| 2.890625 | 3 |
oauth_api/tests/test_authorization_code.py | anobi/django-oauth-api | 0 | 25949 | <gh_stars>0
from datetime import timedelta
from django.contrib.auth import get_user_model
from django.utils import timezone
from oauthlib.oauth2 import (InvalidClientIdError, MissingClientIdError,
InvalidRedirectURIError, MismatchingRedirectURIError)
from rest_framework import status
fr... | 2.28125 | 2 |
example/sockeye/source/sockeye/decoder.py | rah9eu/p3 | 22 | 25950 | <reponame>rah9eu/p3<filename>example/sockeye/source/sockeye/decoder.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
... | 1.921875 | 2 |
dev-language/python/DataWhale/plane_sprite.py | marxlee/dev-record-doc | 0 | 25951 | <reponame>marxlee/dev-record-doc
import random
import pygame
# 刷新帧率
FRAME_PER_SEC = 60
# 屏幕属性
SCREEN_RECT = pygame.Rect(0, 0, 480, 700)
# 创建敌军事件
CREATE_ENEMY_EVENT = pygame.USEREVENT
# 创建英雄发射子弹事件
HERO_FIRE_EVENT = pygame.USEREVENT + 1
class GameSprite(pygame.sprite.Sprite):
"""飞机大战游戏精灵"""
def __init__(self... | 3.03125 | 3 |
stPlus/__init__.py | qiaochen/stPlus | 7 | 25952 | #!/usr/bin/env python
"""
# Authors: <NAME>, <NAME>, <NAME>
# Created Time : Sat 28 Nov 2020 08:31:29 PM CST
# File Name: utils.py
# Description: stPlus: reference-based enhancement of spatial transcriptomics
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
from .model import *
| 0.945313 | 1 |
PJ/11_liste_registri.py | vedgar/ip | 5 | 25953 | """Virtualna mašina za rad s listama; kolokvij 31. siječnja 2011. (Puljić).
9 registara (L1 do L9) koji drže liste cijelih brojeva (počinju od prazne),
2 naredbe (ubacivanje i izbacivanje elementa po indeksu),
3 upita (duljina i praznost liste, dohvaćanje elementa po indeksu)."""
from vepar import *
class T(... | 3.046875 | 3 |
devops-console/apps/applications/migrations/0002_auto_20190130_1757.py | lilinghell/devops | 4 | 25954 | <reponame>lilinghell/devops<gh_stars>1-10
# Generated by Django 2.1.5 on 2019-01-30 09:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('applications', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='rep... | 1.757813 | 2 |
trinity/components/builtin/upnp/events.py | onyb/trinity | 0 | 25955 | from dataclasses import dataclass
from lahja import BaseEvent
@dataclass
class NewUPnPMapping(BaseEvent):
ip: str
| 1.585938 | 2 |
autobreadcrumbs/resolver.py | MtzwOsk/autobreadcrumbs | 0 | 25956 | # -*- coding: utf-8 -*-
"""
Breadcrumb resolving
====================
"""
try:
from django.core.urlresolvers import Resolver404, get_resolver
except ImportError:
from django.urls import Resolver404, get_resolver
from autobreadcrumbs.registry import breadcrumbs_registry
class BreadcrumbRessource(object):
... | 2.46875 | 2 |
wrappers/SpellbookWrapper.py | WouterGlorieux/BitcoinSpellbook-v0.2 | 0 | 25957 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from BlockDataWrapper import BlockDataWrapper
from BlockInputsWrapper import BlockInputsWrapper
from BlockLinkerWrapper import BlockLinkerWrapper
from BlockRandomWrapper import BlockRandomWrapper
from BlockVoterWrapper import BlockVoterWrapper
from BlockForwardWrapper imp... | 2.484375 | 2 |
tests/test_encode.py | gruber-sciencelab/SMEAGOL | 0 | 25958 | <reponame>gruber-sciencelab/SMEAGOL
from smeagol.encode import *
import os
import pytest
script_dir = os.path.dirname(__file__)
rel_path = "data"
data_path = os.path.join(script_dir, rel_path)
def test_integer_encode():
record = SeqRecord(Seq('ACGTNWSMKRYBDHVZ'), id='id', name='name')
result = integer_encode... | 2.546875 | 3 |
tflite/BuiltinOperator.py | erezinman/tflite-flatbuffer-explorer | 0 | 25959 | <gh_stars>0
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
class BuiltinOperator(object):
ADD = 0
AVERAGE_POOL_2D = 1
CONCATENATION = 2
CONV_2D = 3
DEPTHWISE_CONV_2D = 4
EMBEDDING_LOOKUP = 7
FULLY_CONNECTED = 9
HASHTABLE_LOOKUP = 10
L2_NORM... | 1.726563 | 2 |
StegoEncrypt.py | ExaByt3s/hack_scripts | 3 | 25960 | #!/usr/bin/python
__author__ = 'kilroy'
# (c) 2014, WasHere Consulting, Inc.
# Written for Infinite Skills
# need pycrypto package
from Crypto.Cipher import AES
# need PIL and stepic packages
import Image, stepic
import binascii
# key has to be 16, 24 or 32 bytes long
cryptObj = AES.new("This is my key42", AES.MODE... | 3.1875 | 3 |
lib/extensions/navigation_buttons_delayed_popup/startup.py | neurodiverseEsoteric/nimbus | 3 | 25961 | self.toolBar.widgetForAction(self.backAction).setPopupMode(QToolButton.DelayedPopup)
self.toolBar.widgetForAction(self.forwardAction).setPopupMode(QToolButton.DelayedPopup)
self.toolBar.widgetForAction(self.upAction).setPopupMode(QToolButton.DelayedPopup)
| 1.625 | 2 |
parser/team27/G-27/execution/symbol/table.py | Lenin201/tytus | 1 | 25962 | class Table(object):
def __init__(self, name):
self.name = name
self.columns = []
def createColumn(self, column):
self.columns.append(column)
def readColumn(self, name):
for value in self.columns:
if value.name == name:
return value
... | 3.375 | 3 |
frameioclient/config.py | Frameio/python-frameio-client | 33 | 25963 | <reponame>Frameio/python-frameio-client
class Config:
api_host = "https://api.frame.io"
default_page_size = 50
default_concurrency = 5
| 1.1875 | 1 |
source/rttov_test/profile-datasets-py/div83/073.py | bucricket/projectMAScorrection | 0 | 25964 | """
Profile ../profile-datasets-py/div83/073.py
file automaticaly created by prof_gen.py script
"""
self["ID"] = "../profile-datasets-py/div83/073.py"
self["Q"] = numpy.array([ 1.956946, 2.801132, 4.230252, 5.419981, 6.087733,
6.419039, 6.547807, 6.548787, 6.504738, 6.4... | 1.703125 | 2 |
conf.py | jwustrack/climon | 3 | 25965 | <reponame>jwustrack/climon<gh_stars>1-10
'''
>>> c = Conf('climon.conf.test')
>>> list(c.iter_ids('sensor'))
['sine', 'web']
>>> list(c.iter_ids('toggle'))
['fake']
>>> c.get_element('sensor', 'sine') # doctest: +ELLIPSIS
<function sine.<locals>.sine_sensor at ...>
>>> c.get_element('toggle', 'fake') # doctest: +ELLI... | 2.296875 | 2 |
talosblockchain/talosdht/test/protocol_test.py | chunchuan-wang/droplet-engine | 10 | 25966 | #© 2017-2020, ETH Zurich, D-INFK, <EMAIL>
import random
import unittest
from kademlia.node import Node
from kademlia.utils import digest
from talosdht.protocolsecurity import generate_secret_key
from talosdht.talosprotocol import TalosSKademliaProtocol
from talosvc.talosclient.restapiclient import TalosVCRestClient
... | 2.078125 | 2 |
tmp_mail/__init__.py | KMikeeU/temp-mail | 2 | 25967 | <filename>tmp_mail/__init__.py
import requests
from bs4 import BeautifulSoup
import re
import time
import _thread
class Client():
base = "https://temp-mail.org/en"
def __init__(self, address: str = None):
self.address = address
self.session = requests.Session()
realisticBrowser = {
"User-Agent": "Mozilla/... | 2.609375 | 3 |
ros/genpy/src/genpy/msg/__init__.py | numberen/apollo-platform | 742 | 25968 | <reponame>numberen/apollo-platform
from ._TestFillEmbedTime import *
from ._TestFillSimple import *
from ._TestManyFields import *
from ._TestMsgArray import *
from ._TestPrimitiveArray import *
from ._TestString import *
| 0.984375 | 1 |
code/chapter_04/listing_04_11.py | guinslym/python_earth_science_book | 80 | 25969 | # Introductory examples
name = 'Maurizio'
surname = 'Petrelli'
print('-------------------------------------------------')
print('My name is {}'.format(name))
print('-------------------------------------------------')
print('My name is {} and my surname is {}'.format(name, surname))
print('------------------------------... | 4.625 | 5 |
gamestonk_terminal/etf/financedatabase_view.py | i2infinity/GamestonkTerminal | 1 | 25970 | """Finance Database view"""
__docformat__ = "numpy"
import os
import pandas as pd
from tabulate import tabulate
from gamestonk_terminal import feature_flags as gtff
from gamestonk_terminal.etf import financedatabase_model
from gamestonk_terminal.helper_funcs import export_data
def display_etf_by_name(
name: str,... | 3.09375 | 3 |
socialnetworks/moves/views.py | gGonz/django-socialnetworks | 5 | 25971 | <filename>socialnetworks/moves/views.py<gh_stars>1-10
from .clients import MovesAppClient
from .settings import SETUP_URL_NAME
from ..core import views
class MovesAppDialogRedirect(views.OAuthDialogRedirectView):
"""
View that handles the redirects for the Moves app authorization dialog.
"""
client_cl... | 1.90625 | 2 |
train.py | JiazeWang/Luna16 | 0 | 25972 | import random
import torch
import numpy as np
import time
import os
from model.net import Net
from model.loss import Loss
from torch.autograd import Variable
import itertools
import pandas as pd
from main.dataset import LunaDataSet
from torch.utils.data import DataLoader
from configs import VAL_PCT, TOTAL_EPOCHS, DEFA... | 2.234375 | 2 |
models/treebased/data/data_generator.py | ziyoujiyi/PaddleRec | 2,739 | 25973 | <gh_stars>1000+
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | 2.078125 | 2 |
api/runtime/lambda_function.py | alexpulver/aws-cdk-project-structure-python-simple | 6 | 25974 | import json
from typing import Any, Dict
import requests
def lambda_handler(event: Dict[str, Any], context: Dict[str, Any]) -> Dict[str, Any]:
print(f"request: {json.dumps(event)}")
uuid_message = get_uuid_message()
return {
"statusCode": 200,
"headers": {"Content-Type": "text/plain"},
... | 2.65625 | 3 |
dwi/tools/histogram.py | jupito/dwilib | 9 | 25975 | #!/usr/bin/python3
"""Plot histograms of images. Possible nans and infinities are ignored."""
import argparse
from collections import OrderedDict
import logging
import numpy as np
import pylab as pl
from scipy import interpolate
import dwi.files
import dwi.util
def parse_args():
"""Parse command-line argument... | 2.484375 | 2 |
app/core/models.py | 108806/drf_adv_test | 0 | 25976 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Creates and saves a new user"""
if not email: raise ValueError('No valid email provided')
... | 2.84375 | 3 |
paleocirc/circolari.py | xFranciB/PaleoCirc | 7 | 25977 | <reponame>xFranciB/PaleoCirc
import requests
import bs4
import pdf2image
import os
import glob
import json
import platform
if platform.system() == 'Windows':
import win32com.client #pywin32
class Circolari:
def __init__(self, archiveDir=None):
self.__pageTemplate__ = 'https://www.itispa... | 2.78125 | 3 |
cuisine/interface/recipe_io.py | j3kstrum/recipe-tweaker | 0 | 25978 | from data.recipe import Recipe
from data import RecipeGroup
from typing import List
class RecipeIO:
"""
Controls saving and loading of recipes from the filesystem.
"""
@staticmethod
def save(recipe: Recipe) -> bool:
raise NotImplementedError()
@staticmethod
def save_completed(rec... | 2.921875 | 3 |
Inventationery/apps/SalesOrder/models.py | alexharmenta/Inventationery | 0 | 25979 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Alex
# @Date: 2015-11-16 19:15:59
# @Last Modified by: Alex
# @Last Modified time: 2015-12-28 22:28:23
from django.db import models
from Inventationery.core.models import TimeStampedModel
from Inventationery.apps.Customer.models import CustomerModel
from Inve... | 2.046875 | 2 |
bookorbooks/account/migrations/0003_alter_customuser_identity_number.py | talhakoylu/SummerInternshipBackend | 1 | 25980 | <reponame>talhakoylu/SummerInternshipBackend<gh_stars>1-10
# Generated by Django 3.2.5 on 2021-07-13 09:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0002_auto_20210712_1851'),
]
operations = [
migrations.AlterField(
... | 1.460938 | 1 |
Code/Python/ImageProcessing/StereoDepth/featureMatchStereo.py | Nailim/shuttler | 0 | 25981 | # for new opencv
#import os,sys
#os.chdir(os.path.expanduser('~/opencv-2.4.6.1/lib'))
#sys.path.append(os.path.expanduser('~/opencv-2.4.6.1/lib/python2.7/dist-packages'))
# before starting
#export PYTHONPATH=~/opencv-2.4.6.1/lib/python2.7/dist-packages
import os
#import cv
import cv2
import math
import argparse
impor... | 2.625 | 3 |
parser.py | alexkyllo/pycc | 0 | 25982 | <gh_stars>0
from lexer import (
TokenKeyword,
TokenOpenBrace,
TokenCloseBrace,
TokenOpenParen,
TokenCloseParen,
TokenSemicolon,
TokenAssignmentOperator,
TokenAdditionOperator,
TokenMultiplicationOperator,
TokenIncrementOperator,
TokenEqualityOperator,
TokenInequalityOpera... | 3.015625 | 3 |
official/benchmark/unet3d_benchmark.py | gitlost-murali/models | 2 | 25983 | # Lint as: python3
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 1.796875 | 2 |
pysge/utils.py | shane-breeze/pysge | 0 | 25984 | try:
import subprocess32 as sp
except ModuleNotFoundError:
import subprocess as sp
import shlex
def run_command(cmd):
p = sp.run(shlex.split(cmd), stdout=sp.PIPE, stderr=sp.PIPE)
return p.stdout, p.stderr
| 1.992188 | 2 |
src/pygerber/API2D.py | Argmaster/pygerber | 3 | 25985 | # -*- coding: utf-8 -*-
from typing import Any, Dict
from PIL import Image
from pygerber.parser.pillow.parser import DEFAULT_COLOR_SET_GREEN, ColorSet
from .parser.pillow.api import PillowProjectSpec, _render_file
def render_from_spec(spec: Dict[str, Any]) -> Image.Image:
"""Render 2D image from specfile alik... | 2.5625 | 3 |
job-orchestrator/tests/transformers/test_model_paths.py | anaai/anaai | 31 | 25986 | from transformers import model_paths
def test_candy_model():
assert model_paths.CANDY_FAST_NEURAL_TRANSFER_MODEL == "models/candy.t7"
def test_feathers_model():
assert model_paths.FEATHERS_FAST_NEURAL_TRANSFER_MODEL == "models/feathers.t7"
def test_mosaic_model():
assert model_paths.MOSAIC_FAST_NEURAL_TRANSFER... | 2 | 2 |
Omr.py | marlingod/Computer-Vision | 0 | 25987 | <reponame>marlingod/Computer-Vision
from imutils.perspective import four_point_transform
from imutils import contours
import numpy as np
import argparse
import imutils
import cv2
import matplotlib as plt
import os
from itertools import groupby
def angleCos(p0, p1, p2):
d1, d2 = (p0-p1).astype('float'), (p2-p1).a... | 2.28125 | 2 |
tests/test_inchi.py | ginkgobioworks/pychemy | 3 | 25988 | <filename>tests/test_inchi.py
from __future__ import print_function
import unittest
import six
from pychemy.inchi import InChI
class InchiTest(unittest.TestCase):
def test_unicode_inchi(self):
inchi_str = six.u('InChI=1S/C14H18O8/c1-20-9-4-7(5-15)2-3-8(9)21-14-13(19)12(18)11(17)10(6-16)22-14/h2-5,10-14,16-19H... | 2.609375 | 3 |
artap/individual.py | artap-framework/artap | 5 | 25989 | from abc import *
from collections.abc import Iterable
from enum import Enum
class Individual(metaclass=ABCMeta):
""" Collects information about one point in design space. """
class State(Enum):
EMPTY = 0
IN_PROGRESS = 1
EVALUATED = 2
FAILED = 3
@classmethod
def to_st... | 3.234375 | 3 |
taskhawk/backends/exceptions.py | pdeblanc/taskhawk-python | 0 | 25990 | class PartialFailure(Exception):
"""
Error indicating either send_messages or delete_messages API call failed partially
"""
def __init__(self, result, *args):
self.success_count = len(result['Successful'])
self.failure_count = len(result['Failed'])
self.result = result
s... | 2.328125 | 2 |
blox/duplicates_query__1_0/b_duplicates_query.py | mpi-sws-rse/datablox | 0 | 25991 | <gh_stars>0
from block import *
from logging import ERROR, WARN, INFO, DEBUG
class duplicates_query(Block):
def on_load(self, config):
self.add_port("query", Port.QUERY, Port.UNNAMED, [])
self.log(INFO, "Duplicate-query block loaded")
def do_task(self):
yield
log = Log()
res = self.query("quer... | 2.390625 | 2 |
nodepool/tests/test_shade_integration.py | Juniper/nodepool | 0 | 25992 | <gh_stars>0
# Copyright (C) 2015 Hewlett-Packard Development Company, L.P.
#
# 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 requi... | 1.78125 | 2 |
src/pybbox/bboxApiURL.py | BrunoMalard/pybbox | 0 | 25993 | <reponame>BrunoMalard/pybbox<gh_stars>0
from .bboxConstant import BboxConstant
import netaddr as net
import socket
class BboxAPIUrl:
"""
Used to handle API url
"""
API_PREFIX = "api/v1"
def __init__(self, api_class, api_method, ip=BboxConstant.DEFAULT_LOCAL_IP):
"""
:param api_cla... | 2.984375 | 3 |
experimental_code/integratedAltAz/keplerianToCartesianOrbital.py | rex-mcall/EST_Internship_2021 | 0 | 25994 | from tletools import TLE
import matplotlib.pyplot as plt
import numpy as np
import math
from math import *
import sys
import datetime as dt
import tleToKeplerianElements as ttke
# uses TLE to return the current distance of the satellite to the focus
def distanceToCentralBody(tle, curr_trueA):
lan, argp, inc, ecc,... | 2.875 | 3 |
duovoice.py | dreamingdust/Duolingo | 0 | 25995 | <reponame>dreamingdust/Duolingo
import re
import json
import random
from duorequest import DuoRequest
class DuoVoice():
def __init__(self, session, langData):
self._lang_data = langData
self._user_session = session
self._tts_voices = None
self._cloudfront_server_url = None
... | 2.515625 | 3 |
vlab_onefs_api/lib/worker/tasks.py | willnx/vlab_onefs | 1 | 25996 | <filename>vlab_onefs_api/lib/worker/tasks.py<gh_stars>1-10
# -*- coding: UTF-8 -*-
"""
Entry point logic for available backend worker tasks
"""
from celery import Celery
from vlab_api_common import get_task_logger
from vlab_onefs_api.lib import const
from vlab_onefs_api.lib.worker import vmware, setup_onefs
app = Cel... | 2.0625 | 2 |
HIN&PairWise/create_dict.py | feast-research/PPGCN | 15 | 25997 | <reponame>feast-research/PPGCN<gh_stars>10-100
# coding: utf-8
# In[1]:
import json
import os
import time
def events_dict(events, num_files):
for i in range(num_files):
events['event'+str(i+1000000)] = ['event'+str(i+1000000)]
with open('events.json', 'w') as json_file:
json.dump(events, js... | 2.5625 | 3 |
azure-keyvault/azure/keyvault/key_vault_authentication.py | azuresdkci1x/azure-sdk-for-python-1722 | 1 | 25998 | <gh_stars>1-10
#---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#------------------------------------------------------... | 2.390625 | 2 |
circumcircle.py | mas250/Python3 | 1 | 25999 | <gh_stars>1-10
from math import sqrt
side_a = 4
side_b = 6
side_c = 3
semiperimiter = (side_a + side_b + side_c)/2
diameter = (side_a* side_b* side_c)/ 2*sqrt(semiperimiter * (semiperimiter - side_a) * (semiperimiter - side_b) * (semiperimiter - side_c))
print ('The radius of a circle with sides of length 4, 6 an... | 3.90625 | 4 |