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 |
|---|---|---|---|---|---|---|
src/__init__.py | molsonkiko/json_tabularize | 0 | 12787051 | <reponame>molsonkiko/json_tabularize
'''
An unusually powerful algorithm for converting JSON into a tabular format, which is defined as an array of flat (all scalar values) objects.
Every algorithm I've seen for making JSON into a table can't fully normalize very deeply nested JSON, but instead produces partially norm... | 2.390625 | 2 |
proj/fpga/ultra96/crowd_estimation/python/crowd_counter.py | timebe00/Mercenary | 3 | 12787052 | <filename>proj/fpga/ultra96/crowd_estimation/python/crowd_counter.py<gh_stars>1-10
# In[1]:
import cv2
import imutils
from imutils.object_detection import non_max_suppression
import numpy as np
import requests
import time
import base64
from matplotlib import pyplot as plt
from IPython.display import clear_output
# In[... | 2.546875 | 3 |
examples/how_to/start_parameterized_build.py | pingod/python-jenkins_api | 556 | 12787053 | """
Start a Parameterized Build
"""
from __future__ import print_function
from jenkinsapi.jenkins import Jenkins
jenkins = Jenkins('http://localhost:8080')
params = {'VERSION': '1.2.3', 'PYTHON_VER': '2.7'}
# This will start the job in non-blocking manner
jenkins.build_job('foo', params)
# This will start the job... | 3.046875 | 3 |
nip24/vatentity.py | nip24pl/nip24-python-client | 0 | 12787054 | #
# -*- coding: utf-8 -*-
#
# Copyright 2015-2020 NETCAT (www.netcat.pl)
#
# 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 ... | 2.3125 | 2 |
projectautoobj.py | byronwongdev/project-opencv | 0 | 12787055 | <reponame>byronwongdev/project-opencv
"""
working in progress
"""
import cv2
import numpy as np
frameWidth = 1280
frameHeight = 720
cap = cv2.VideoCapture(1)
cap.set(3, frameWidth)
cap.set(4, frameHeight)
cap.set(10,150)
def empty(a):
pass
def hsv_to_rgb(h, s, v):
if s == 0.0: return (v, v, v)
i = int(h... | 2.9375 | 3 |
tony-modulebasedpgm.py | tonythott/tonnewcode | 0 | 12787056 | <filename>tony-modulebasedpgm.py
age = int(input("Enter your age : "))
print (age)
nextyrage = age + 1
print ("Next year age will be : ",nextyrage)
price = 1.21997
print ("Price per liter %.2f" %(price))
| 3.5625 | 4 |
alembic/versions/73340f5f1adf_change_schedules_repeat_cycle_column.py | Tharlaw/petsrus | 0 | 12787057 | """change_schedules_repeat_cycle_column
Revision ID: 73340f5f1adf
Revises: acf23daeb12b
Create Date: 2020-08-23 12:09:49.948494
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "73340f5f1adf"
down_revision = "<KEY>"
branch_labels = None
depends_on = None
def up... | 1.53125 | 2 |
vision/common/bounding_box.py | MissouriMRR/SUAS-2022 | 6 | 12787058 | <reponame>MissouriMRR/SUAS-2022<gh_stars>1-10
"""
Bounding box objects represent an area in an image and
are used to convey information between flight and vision processes.
"""
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
class ObjectType(Enum):
"""
Type of o... | 3.40625 | 3 |
calibration-tools/wiringpi_setpwm.py | mrwunderbar666/rpi-vumonitor-python | 2 | 12787059 | <gh_stars>1-10
#!/usr/bin/python
"""
== VU Meter Calibration Toolkit ==
==== Pulse Width Modulation and WiringPi GPIO Library ====
Hardware PWM
Manually set the PWM Value and calibrate your output!
Requires:
- Wiring Pi
MIT License
"""
from __future__ import division
import wiringpi
import time
""" Configure... | 3.28125 | 3 |
src/openprocurement/tender/openeu/procedure/models/document.py | ProzorroUKR/openprocurement.api | 10 | 12787060 | from openprocurement.tender.openua.procedure.models.document import (
PostDocument as BasePostDocument,
PatchDocument as BasePatchDocument,
Document as BaseDocument,
)
from schematics.types import StringType
class PostDocument(BasePostDocument):
language = StringType(required=True, choices=["uk", "en"... | 2.265625 | 2 |
covid-survive-master/player.py | brunouni/HealthPub | 0 | 12787061 | import pygame
class Player(pygame.sprite.Sprite):
def __init__(self, *groups):
super().__init__(*groups)
self.image = pygame.image.load("img/baixo1.png")
self.image = pygame.transform.scale(self.image, [45, 45])
self.rect = pygame.Rect(540, 360, 45, 45)
self.spee... | 3.0625 | 3 |
src/pyf/aggregator/plugins/version.py | collective/pyf.aggregator | 0 | 12787062 | from pkg_resources import parse_version
def process_version(identifier, data):
# parse version to test against:
data["version_raw"] = data["version"]
try:
version = parse_version(data["version"])
except TypeError:
return
try:
parts = version.base_version.split(".")
... | 2.578125 | 3 |
recipes/Python/546543_simple_way_create_change_your_registry/recipe-546543.py | tdiprima/code | 2,023 | 12787063 | #IN THE NAME OF ALLAH
#Nike Name: Pcrlth0n
#(C) 2008
#a simple way to create and change your registry on windows
import win32api
def new_key():
reg1 = open('C:\\reg1.reg', 'w')
reg1.write("""REGEDIT4\n[HKEY_CURRENT_USER\\Example""")
reg1.close()
win32api.WinExec('reg import C:\\reg1.reg', 0)
def new_s... | 3.0625 | 3 |
openminer/entry/__init__.py | zhd785576549/openminer | 0 | 12787064 | <filename>openminer/entry/__init__.py
from openminer.core.commands import execute_from_command
def main():
execute_from_command()
| 1.328125 | 1 |
msi/lgbm_msi.py | jeonghyukpark/msi_highlow | 0 | 12787065 | <reponame>jeonghyukpark/msi_highlow<gh_stars>0
import pandas as pd
import numpy as np
import lightgbm as lgb
import pickle5 as pickle
import scipy
from sklearn import metrics
from sklearn.preprocessing import StandardScaler
def mean_confidence_interval(data, confidence=0.95):
a = 1.0 * np.array(data)
n = len... | 2.125 | 2 |
infrastructor/data/SqlBuilder.py | ahmetcagriakca/ImageProcessingApi | 0 | 12787066 | <reponame>ahmetcagriakca/ImageProcessingApi
class SqlBuilder:
def __init__(self):
pass
def build(self):
pass
class DefaultInsertSqlBuilder(SqlBuilder):
def __init__(self, table_name, length):
self.table_name = table_name
self.length = length
def build(self... | 2.75 | 3 |
src/son/package/tests/test_integ_Packager.py | dang03/son-cli | 4 | 12787067 | # Copyright (c) 2015 SONATA-NFV, UBIWHERE
# 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 required by app... | 1.726563 | 2 |
backend/animal_config.py | PH-P-H/flask-object-detection | 0 | 12787068 | category_index = {1: 'brown_bear',
2: 'cattle',
3: 'deer',
4: 'dog',
5: 'horse',
6: 'lynx',
7: 'mule',
8: 'pig',
9:'raccoon',
10: 'sheep',
11: 'tiger'} | 1.429688 | 1 |
deploy-kanboard.py | r4jeshwar/python-kanboard-deploy | 0 | 12787069 | #!/usr/bin/env python3
import subprocess as sp
def system_update():
sp.call(["sudo", "apt-get","update"])
sp.call(["sudo", "apt", "upgrade", "-y"])
def install_apache_php():
sp.call(["sudo", "apt", "install", "-y", "apache2", "libapache2-mod-php", "php-cli", "php-mbstring", "php-sqlite3", "php-opcache",... | 2.078125 | 2 |
Back/ecoreleve_server/utils/thesaurusLoad.py | NaturalSolutions/ecoReleve-Data | 15 | 12787070 | from sqlalchemy import select
from ..core import Base
thesaurusDictTraduction = {}
invertedThesaurusDict = {'en': {}, 'fr': {}}
userOAuthDict = {}
def loadThesaurusTrad(config):
session = config.registry.dbmaker()
thesTable = Base.metadata.tables['ERDThesaurusTerm']
query = select(thesTable.c)
res... | 2.328125 | 2 |
last_seen/migrations/0001_initial.py | Jafte/jasn.ru | 0 | 12787071 | <reponame>Jafte/jasn.ru
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-13 00:15
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
... | 1.757813 | 2 |
main.py | pzmarzly/ancs4linux | 120 | 12787072 | <filename>main.py
#!/usr/bin/env python3
# https://developer.apple.com/library/archive/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Introduction/Introduction.html
import sys
import signal
import argparse
import time
from Hci import Hci
from Handler import DefaultHandler
parser = ar... | 2.65625 | 3 |
stackable/contrib/config/conf_model_l10n.py | productaize/stackable | 1 | 12787073 | <filename>stackable/contrib/config/conf_model_l10n.py
'''
Created on Jan 13, 2015
@author: patrick
'''
from stackable.stackable import StackableSettings
class Config_ModelTranslation(object):
# http://django-modeltranslation.readthedocs.org/en/latest/installation.html#setup
USE_I18N = True
MODELTRANSLATI... | 1.90625 | 2 |
python/plotly/die_visual.py | letitgone/python-crash-course | 0 | 12787074 | # @Author ZhangGJ
# @Date 2021/01/13 21:59
from plotly import offline
from plotly.graph_objs import Bar, Layout
from die import Die
die = Die()
# 掷几次骰子并将结果存储在一个列表中
results = []
for roll_num in range(1000):
result = die.roll()
results.append(result)
# 分析结果
frequencies = []
for value in range(1, die.num_sides ... | 2.8125 | 3 |
opencorpora/converters.py | OpenCorpora/opencorpora-tools | 3 | 12787075 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import sys
import logging
from opencorpora import reader
from opencorpora.reader import CorpusReader
from russian_tagsets import converters
from pymorphy2.opencorpora_dict.parse import parse_opencorpora_xml
class UDConverter(object):
"""
Tries to ... | 2.296875 | 2 |
SingleCORE/Canny Edge Algorithm/PrewittEdgeDetector.py | RjPatil27/ACA-Project | 0 | 12787076 | import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
# Open the image
img = np.array(Image.open('house.jpg')).astype(np.uint8)
# Apply gray scale
gray_img = np.round(0.299 * img[:, :, 0] +
0.587 * img[:, :, 1] +
0.114 * img[:, :, 2]).astype(np.uint... | 3.21875 | 3 |
scripts/grab.py | scanon/kb_ModelIndexer | 0 | 12787077 | <gh_stars>0
from Workspace.WorkspaceClient import Workspace
import json
import os
def grab(upa, file):
if not os.path.exists(file):
d = ws.get_objects2({'objects': [{'ref': upa}]})
with open(file, 'w') as f:
f.write(json.dumps(d, indent=4))
ws = Workspace('https://ci.kbase.us/service... | 2.421875 | 2 |
rcsb/utils/chem/ChemCompSearchWrapper.py | rcsb/py-rcsb_utils_chem | 0 | 12787078 | ##
# File: ChemCompSearchWrapper.py
# Author: jdw
# Date: 9-Mar-2020
# Version: 0.001
#
# Updates:
#
##
"""
Wrapper for chemical component search operations.
"""
__docformat__ = "restructuredtext en"
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__license__ = "Apache 2.0"
import copy
import logging
import platfo... | 1.757813 | 2 |
source/client/lib/tcp_client.py | nsubiron/mess-engine | 1 | 12787079 | <filename>source/client/lib/tcp_client.py
import logging
import socket
import struct
from contextlib import contextmanager
from util import to_hex_str
class TCPClient(object):
def __init__(self, host, port, timeout):
self._host = host
self._port = port
self._timeout = timeout
sel... | 2.765625 | 3 |
kinto_algolia/indexer.py | Kinto/kinto-algolia | 0 | 12787080 | import logging
from copy import deepcopy
from contextlib import contextmanager
from algoliasearch.http.verb import Verb
from algoliasearch.search_client import SearchClient
from algoliasearch.exceptions import AlgoliaException
from pyramid.exceptions import ConfigurationError
logger = logging.getLogger(__name__)
c... | 2.0625 | 2 |
stationery/migrations/0005_auto_20210713_1022.py | shaxpakistan/e-stationery | 1 | 12787081 | # Generated by Django 3.1.4 on 2021-07-13 07:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stationery', '0004_auto_20210710_0307'),
]
operations = [
migrations.DeleteModel(
name='Document',
),
migrations... | 1.664063 | 2 |
parkinglot/admin.py | Amankori2307/Park-Here | 0 | 12787082 | <filename>parkinglot/admin.py
from django.contrib import admin
from .models import User, ParkingLot, Charges, Parking, Transaction
# Register your models here.
admin.site.register(User)
admin.site.register(ParkingLot)
admin.site.register(Charges)
admin.site.register(Parking)
admin.site.register(Transaction) | 1.5 | 2 |
raiutils/raiutils/models/model_utils.py | imatiach-msft/responsible-ai-toolbox | 0 | 12787083 | <gh_stars>0
# Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
class SKLearn(object):
"""Provide scikit-learn related constants."""
EXAMPLES = 'examples'
LABELS = 'labels'
PREDICT = 'predict'
PREDICTIONS = 'predictions'
PREDICT_PROBA = 'predict_proba'
def is_classifier(... | 2.84375 | 3 |
django_socio_grpc/tests/test_authentication.py | socotecio/django-socio-grpc | 13 | 12787084 | import json
import logging
import mock
from django.test import TestCase, override_settings
from grpc._cython.cygrpc import _Metadatum
from django_socio_grpc.services import Service
from django_socio_grpc.settings import grpc_settings
from .utils import FakeContext
logger = logging.getLogger()
class FakeAuthentica... | 2.0625 | 2 |
models/gitm/python/plot_data_2d.py | hkershaw-brown/feature-preprocess | 65 | 12787085 | <gh_stars>10-100
#plot difference
al = 0.5 #transparency
#vi,va = 0,max(VtecED[:,:,-1].flatten()) #specify zlim and colorlimits
vi, va = 0., 20.
#levels = np.arange(vi,va)
f = open('map.txt', 'r'); elev = np.array(map(int, f.read().split())).reshape((360, 180)).T; f.close() #load the Earth map
for ti in range(len(tcomm... | 2.34375 | 2 |
legodb/indev.py | andrejacobs/learn-openfaas | 0 | 12787086 | <reponame>andrejacobs/learn-openfaas
from legodb.handler import handle
import os
from pprint import pprint
class Event:
def __init__(self):
self.body = None
self.headers = None
self.method = 'GET'
self.query = None
self.path = '/legosets'
class Context:
def __init__(se... | 2.578125 | 3 |
Aulas/aula7_part1.py | CamilaContrucci/DIO_Python | 0 | 12787087 | # Função é tudo que retorna ao valor, método é o que não retorna.No Python o método é chamado de definição.
def soma(a, b):
return a + b
print(soma(1, 2))
print(soma(3, 4))
def subtracao(a, b):
return a - b
print(soma(5, 3))
# Ensinando a fazer criando a classe
class Calculadora:
def __init__(self, num... | 4.21875 | 4 |
survol/sources_types/CIM_DataFile/elftools_parse_classes.py | AugustinMascarelli/survol | 0 | 12787088 | <filename>survol/sources_types/CIM_DataFile/elftools_parse_classes.py
#!/usr/bin/env python
"""
Classes in ELF files
"""
import os
import sys
import lib_elf
import lib_util
import lib_common
from lib_properties import pc
Usable = lib_util.UsableLinuxBinary
def Main():
paramkeyMaxDepth = "Maximum depth"
cgiEnv =... | 2.15625 | 2 |
bin/fusearchd.py | larroy/fusearch | 1 | 12787089 | #!/usr/bin/env python3
"""Fusearch daemon"""
import argparse
import os
import signal
import sys
import logging
import textract
import functools
import progressbar
import tempfile
import pickle
import io
from fusearch.index import Index
from fusearch.model import Document
from fusearch.tokenizer import get_tokenizer, ... | 2.171875 | 2 |
src/apps/authentication/backends.py | snicoper/snicoper.com | 2 | 12787090 | <reponame>snicoper/snicoper.com<gh_stars>1-10
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.db.models import Q
from . import settings as auth_settings
UserModel = get_user_model()
class EmailOrUsernameModelBackend(ModelBackend):
def authenticat... | 2.40625 | 2 |
mmvec/multimodal.py | mortonjt/deep-mae | 68 | 12787091 | <gh_stars>10-100
import os
import time
from tqdm import tqdm
import numpy as np
import tensorflow as tf
from tensorflow.contrib.distributions import Multinomial, Normal
import datetime
class MMvec(object):
def __init__(self, u_mean=0, u_scale=1, v_mean=0, v_scale=1,
batch_size=50, latent_dim=3,
... | 2.421875 | 2 |
nenupy/crosslet/__init__.py | AlanLoh/nenupy | 4 | 12787092 | <gh_stars>1-10
#! /usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. inheritance-diagram:: nenupy.crosslet.xstdata nenupy.crosslet.tvdata
:parts: 3
.. inheritance-diagram:: nenupy.crosslet.imageprod
:parts: 3
"""
from .uvw import UVW
from .imageprod import NearField, NenuFarTV
from .crosslet ... | 1.171875 | 1 |
apps/account/migrations/0008_merge_20211016_0545.py | mobius-labs/app | 1 | 12787093 | <reponame>mobius-labs/app
# Generated by Django 3.2.6 on 2021-10-16 05:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('account', '0006_user_business_card_theme'),
('account', '0007_alter_user_email'),
]
operations = [
]
| 1.15625 | 1 |
vesc_driver/src/tm_heading.py | Taek-16/vesc_study | 1 | 12787094 | #!/usr/bin/env python
import rospy
from pyproj import Proj, transform
import numpy as np
from math import cos, sin, pi
from geometry_msgs.msg import Pose
from std_msgs.msg import Float64
from sensor_msgs.msg import NavSatFix
from ublox_msgs.msg import NavPVT
#Projection definition
#UTM-K
proj_UTMK = Proj(init='epsg:51... | 2.5 | 2 |
tests/test_wfs_USDASSURGO.py | tilmanb/OWSLib | 0 | 12787095 | # Test ability of OWSLib.wfs to interact with USDA SSURGO WFS 1.0.0 web service
# Contact e-mail: <EMAIL>
import unittest
from owslib.wfs import WebFeatureService
class USDASSURGOWFSTestCase(unittest.TestCase):
def runTest(self):
minX = -76.766960
minY = 39.283611
maxX = -76.684120
... | 2.5 | 2 |
Exercise 09/exercise_code/util/__init__.py | CornellLenard/Deep-Learning-Course-Exercises | 0 | 12787096 | <reponame>CornellLenard/Deep-Learning-Course-Exercises
"""Util functions"""
from .vis_utils import show_all_keypoints
from .save_model import save_model
| 1.125 | 1 |
29.py | zseen/practicepython-exercises | 0 | 12787097 | from enum import Enum
class Game(object):
class WinState(Enum):
FIRST_WINS = "First player wins"
SECOND_WINS = "Second player wins"
NOBODY_WINS = "Nobody wins"
def __init__(self, size):
self.size = size
self.numFields = self.size ** 2
self.board = None
... | 3.78125 | 4 |
tests/test_show.py | dmkskn/isle | 0 | 12787098 | import inspect
from itertools import islice
import pytest
import isle.show
from isle import Show
def test_get_latest():
show = isle.show.get_latest()
assert isinstance(show, Show)
def test_get_popular():
shows = isle.show.get_popular()
assert inspect.isgenerator(shows)
show = next(shows)
a... | 2.15625 | 2 |
examples/operators_plot/example_tnorm_plot.py | mmunar97/discrete-fuzzy-operators | 0 | 12787099 | import numpy
from discrete_fuzzy_operators.base.operators.binary_operators.fuzzy_discrete_binary_operator import \
FuzzyDiscreteBinaryOperator
from discrete_fuzzy_operators.builtin_operators.discrete.tnorms import TnormExamples
if __name__ == "__main__":
# EXAMPLE: Plot of some known t-norms.
lukasiewicz... | 2.140625 | 2 |
GetInfo.py | XarisA/nethack | 0 | 12787100 | <filename>GetInfo.py
#!/usr/bin/env python
import os
from socket import *
import dns.resolver
import dns.reversename
# TODO Pass arguments from terminal
def reach_host(hostname,arguments='-c 1'):
# Pinging the host
print ('[+] Pinging ' + hostname)
if os.system("ping " + arguments + ' '+ hostname) == 0:
... | 3.53125 | 4 |
aptfimleapparser/utils/create_testinput_h5.py | nomad-coe/nomad-parser-aptfim-leap | 0 | 12787101 | <reponame>nomad-coe/nomad-parser-aptfim-leap
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 3 15:26:33 2021
@author: kuehbach
a much more covering example with metadata for atom probe microscopy experiments which matches the fields discussed with the
International Field Emission Society's Atom ... | 1.976563 | 2 |
pyarc/qcba/transforms/prune_literals.py | jirifilip/CBA | 19 | 12787102 | <reponame>jirifilip/CBA<gh_stars>10-100
import pandas
import numpy as np
from ..data_structures import QuantitativeDataFrame, Interval
class RuleLiteralPruner:
def __init__(self, quantitative_dataframe):
self.__dataframe = quantitative_dataframe
def transform(self, rules):
... | 2.484375 | 2 |
algorithms/larrys-array.py | gajubadge11/HackerRank-1 | 340 | 12787103 | #!/bin/python3
import sys
def rotate(A, pos):
A[pos], A[pos+1], A[pos+2] = A[pos+1], A[pos+2], A[pos]
def larrysArray(A):
for _ in range(len(A)):
for ind in range(1, len(A) - 1):
a, b, c = A[ind-1], A[ind], A[ind+1]
#print("ind = {} A = {} B = {} C = {}".format(ind, a, b, c))
... | 3.65625 | 4 |
tests/checker/test_master.py | siccegge/ctf-gameserver | 0 | 12787104 | import datetime
from unittest.mock import patch
from ctf_gameserver.checker.master import MasterLoop
from ctf_gameserver.checker.metrics import DummyQueue
from ctf_gameserver.lib.checkresult import CheckResult
from ctf_gameserver.lib.database import transaction_cursor
from ctf_gameserver.lib.test_util import DatabaseT... | 2.265625 | 2 |
run_test_sequence.py | MichaMucha/evolving-classifier | 0 | 12787105 | <filename>run_test_sequence.py
__author__ = 'michalmucha'
import csv
from datetime import datetime
from EVABCD import Classifier, SequenceOfActions, Action
# TEST_DATA_FILENAME = 'long_test_sequence2.csv'
TEST_DATA_FILENAME = 'testcase/sequence-1.csv'
USERS = 60
SEQUENCE_LENGTH = 25
SUBSEQUENCE_LENGTH = 4
PROMPT = ... | 2.765625 | 3 |
moona/http/request_headers.py | katunilya/mona | 2 | 12787106 | <gh_stars>1-10
from logging.handlers import HTTPHandler
from pymon import Future
from moona.http.context import HTTPContext
from moona.http.handlers import HTTPFunc, handler, skip
def has_header(name: str) -> HTTPHandler:
"""Processes next `HTTPFunc` only when request has passed header.
Args:
name ... | 2.515625 | 3 |
tests/unit/logs/metadata_engine/entity_id/test_me_id.py | dt-be/dynatrace-aws-log-forwarder | 0 | 12787107 | <reponame>dt-be/dynatrace-aws-log-forwarder
# Copyright 2021 Dynatrace 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
#
# U... | 1.765625 | 2 |
publications/admin_views/import_bibtex.py | christianglodt/django-publications | 0 | 12787108 | __license__ = 'MIT License <http://www.opensource.org/licenses/mit-license.php>'
__author__ = '<NAME> <<EMAIL>>'
__docformat__ = 'epytext'
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.admin.views.decorators import staff_member_required
from django.contr... | 1.867188 | 2 |
manila/scheduler/weighers/host_affinity.py | kpawar89/manila | 159 | 12787109 | # Copyright 2019 NetApp, Inc.
# 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 required by ... | 1.96875 | 2 |
setup.py | Flowdalic/nattka | 7 | 12787110 | #!/usr/bin/env python
# (c) 2020 <NAME>
# 2-clause BSD license
from setuptools import setup
from nattka import __version__
setup(
name='nattka',
version=__version__,
description='A New Arch Tester Toolkit (open source replacement '
'for stable-bot)',
author='<NAME>',
author_emai... | 1.140625 | 1 |
paper_plots/savgol.py | amanchokshi/mwa-satellites | 1 | 12787111 | """
SAVGOL INTERP.
--------------
"""
import argparse
from pathlib import Path
import matplotlib
import numpy as np
from embers.rf_tools.align_data import savgol_interp
from embers.rf_tools.colormaps import spectral
from matplotlib import pyplot as plt
matplotlib.use("Agg")
_spec, _ = spectral()
parser = argparse.A... | 2.203125 | 2 |
optimum/onnxruntime/preprocessors/passes/fully_connected.py | techthiyanes/optimum | 414 | 12787112 | <reponame>techthiyanes/optimum
# Copyright 2022 The HuggingFace Team. 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.15625 | 2 |
spockbot/plugins/core/auth.py | SpockBotMC/SpockBot | 171 | 12787113 | """
Provides authorization functions for Mojang's login and session servers
"""
import hashlib
import json
# This is for python2 compatibility
try:
import urllib.request as request
from urllib.error import URLError
except ImportError:
import urllib2 as request
from urllib2 import URLError
import loggin... | 2.703125 | 3 |
src/ti_dbscan/dbscan.py | rafal0502/ti-dbscan | 0 | 12787114 | <gh_stars>0
import numpy
def basicDBSCAN(D, eps, MinPts):
"""
Clustering dataset 'D' using DBSCAN algorithm.
This implementation takes a dataset 'D' (a list
of vectors), a threshold distance 'eps', and req-
uired number of points 'MinPts'.
It returning label -1 (noise), cluster... | 3.46875 | 3 |
spock/addons/s3/__init__.py | gbmarc1/spock | 58 | 12787115 | # -*- coding: utf-8 -*-
# Copyright FMR LLC <<EMAIL>>
# SPDX-License-Identifier: Apache-2.0
"""
Spock is a framework that helps manage complex parameter configurations for Python applications
Please refer to the documentation provided in the README.md
"""
from spock.addons.s3.configs import S3Config, S3DownloadConf... | 1.578125 | 2 |
pyhubtel_sms/exceptions.py | idadzie/pyhubtel-sms | 0 | 12787116 | <gh_stars>0
# -*- coding: utf-8 -*-
def _explain_response(response):
reasons = {
400: {
3: "The message body was too long.",
4: "The message is not routable on the Hubtel gateway.",
6: "The message content was rejected or is invalid.",
7: "One or more parame... | 2.5625 | 3 |
make_plot.py | jelena-markovic/compare-selection | 0 | 12787117 | <reponame>jelena-markovic/compare-selection
import os, glob
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from utils import summarize
from statistics import FDR_summary
def feature_plot(param, power, color='r', label='foo', ylim=None, horiz=None):
ax = plt.gca()
... | 2.21875 | 2 |
relay/api/fields.py | weilbith/relay | 0 | 12787118 | <filename>relay/api/fields.py
import hexbytes
from eth_utils import is_address, to_checksum_address
from marshmallow import fields
from webargs import ValidationError
from relay.network_graph.payment_path import FeePayer
class Address(fields.Field):
def _serialize(self, value, attr, obj, **kwargs):
retur... | 2.40625 | 2 |
exam/migrations/0005_alter_marks_marks_mx_alter_marks_marks_ob.py | HarshNarayanJha/School-Management-Project | 2 | 12787119 | # Generated by Django 4.0.1 on 2022-03-15 04:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exam', '0004_remove_exam_name_exam_exam_name_alter_exam_cls_and_more'),
]
operations = [
migrations.AlterField(
model_name='mark... | 1.5 | 2 |
test/unit/test_xlwtwrapper.py | muchu1983/104_mops | 0 | 12787120 | """
Copyright (C) 2015, <NAME>
Contributed by <NAME> (<EMAIL>)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import unittest
import logging
import time
from mops.xlwtwrapper import XlwtWrapper
"""
測試 excel 寫入
"""
class XlwtWrapperTest(unittest.TestCase):
#準備
def setUp(s... | 2.21875 | 2 |
labs/model-test/test_2_practice.py | ioanabirsan/python | 0 | 12787121 | # Sa se scrie o functie cu numele problema1 ce returneaza o lista ordonata crescator ce contine toate cuvintele
# din sirul de caractere s dat ca parametru. Un cuvant este format din: litere mici si mari, cifre si
# caracterul underscore '_'.
import re
import os
import urllib
from urllib import request
import hashlib
... | 3.234375 | 3 |
v1/music/views/album.py | lawiz22/PLOUC-Backend-master | 0 | 12787122 | from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from v1.filters.albums.album import album_filter
from v1.music.models.album import Album
from v1.music.serializers.album import AlbumSerializer, AlbumSer... | 2.21875 | 2 |
yfinance/version.py | le-minhphuc/yfinance | 3 | 12787123 | <filename>yfinance/version.py<gh_stars>1-10
version = "0.1.63"
| 1.0625 | 1 |
buffers/__init__.py | MCPS-team/onboard | 0 | 12787124 | from .interface import SensorsData, PotholeEvent, PotholeEventHistory
from .sensors_buffer import SensorsBuffer
from .frame_buffer import FrameBuffer
from .swapper import Swapper | 1.0625 | 1 |
matroids/construct/nulity_function.py | PotassiumIodide/matroid-theory-in-python | 2 | 12787125 | from typing import Callable, TypeVar
from matroids.core.set_operator import powset
from matroids.construct import independent_sets
T = TypeVar('T')
def from_independent_matroid(matroid: tuple[set[T], list[set[T]]]) -> Callable[[set[T]], int]:
"""Construct a nulity function from a matroid defined by independen... | 2.890625 | 3 |
addons/account/tests/test_transfer_wizard.py | SHIVJITH/Odoo_Machine_Test | 0 | 12787126 | # -*- coding: utf-8 -*-
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged, Form
import time
@tagged('post_install', '-at_install')
class TestTransferWizard(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super(... | 1.867188 | 2 |
osrsmath/general/player.py | Palfore/OSRSmath | 5 | 12787127 | <gh_stars>1-10
from typing import Dict, List
class Player:
def __init__(self, levels: Dict[str, int]):
self.levels = levels
| 2.890625 | 3 |
dns_shark/errors/dns_zero_counter_error.py | jmiiller/dns_shark | 3 | 12787128 | from dns_shark.errors.dns_shark_error import DNSSharkError
class DNSZeroCounterError(DNSSharkError):
"""
An error that occurs when the resolver counter is set to 0. Indicates that either an abnormally long resolution
occurred or the resolver is in an infinite loop.
"""
| 2.203125 | 2 |
python/paddle/incubate/complex/tensor_op_patch.py | joey12300/Paddle | 2 | 12787129 | # Copyright (c) 2020 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 required by ap... | 1.835938 | 2 |
tests/unit/metrics_tests/test_object_keypoint_similarity.py | Joeper214/blueoil | 248 | 12787130 | <filename>tests/unit/metrics_tests/test_object_keypoint_similarity.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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 obta... | 2.328125 | 2 |
minecraft_py/game.py | plave0/petnica-oop-ex | 2 | 12787131 | from world import World
from player import Player
import mc_objects as mco
class Game:
def __init__(self) -> None:
self.world = World(20, 20)
self.player = Player(self.world)
print("Game started.")
def play(self):
stone_block = mco.Block(mco.Blocks.Stone)
pick = mco... | 2.859375 | 3 |
tests/test_extractor.py | SiggiGue/sigfeat | 8 | 12787132 | <filename>tests/test_extractor.py
import pytest
from sigfeat.base import Feature
from sigfeat.extractor import Extractor
from sigfeat.source.array import ArraySource
from sigfeat.sink import DefaultDictSink
class A(Feature):
_started = False
def on_start(self, *args):
self._started = True
def p... | 2.125 | 2 |
Q37/sol.py | shivamT95/projecteuler | 0 | 12787133 | <filename>Q37/sol.py
import math
def is_prime(n):
if n == 1:
return False
if n % 2 == 0 and n > 2:
return False
return all(n % i for i in range(3, int(math.sqrt(n))+1,2))
def check(n):
tn = n
tp = 1
while(n != 0):
if(is_prime(n) == False):
return False
n = n//10
tp = tp*10
while(tn !=... | 3.671875 | 4 |
Project Code 1.0/Power of soldiers/power_of_soldiers.py | mishrakeshav/Competitive-Programming | 2 | 12787134 | <reponame>mishrakeshav/Competitive-Programming
import math
from collections import deque
class Vertex:
def __init__(self, val):
self.val = val
self.connections = dict()
self.visited = False
self.previous = None
def setVisited(self, visited):
self.visited = visited
... | 3.609375 | 4 |
api/resources/data/building/room.py | PiWatcher/pci-backend | 0 | 12787135 | <gh_stars>0
from datetime import *
from flask import jsonify, request
from flask_restful import Resource
from api.services.MongoManagerService import MongoManagerService as mms
from api.services.LoginAuthenticationService import LoginAuthenticationService as las
class ApiDataBuildingRoomLive(Resource):
def get(se... | 2.734375 | 3 |
Chapter06/src/features.py | jvstinian/Python-Reinforcement-Learning-Projects | 114 | 12787136 | import numpy as np
from config import GOPARAMETERS
def stone_features(board_state):
# 16 planes, where every other plane represents the stones of a particular color
# which means we track the stones of the last 8 moves.
features = np.zeros([16, GOPARAMETERS.N, GOPARAMETERS.N], dtype=np.uint8)
num_del... | 2.59375 | 3 |
tests/test_dnf.py | Quansight-Labs/python-moa | 22 | 12787137 | <filename>tests/test_dnf.py
import copy
import pytest
from moa import ast, dnf, testing
def test_add_indexing_node():
tree = ast.Node((ast.NodeSymbol.ARRAY,), (2, 3), ('A',), ())
symbol_table = {'A': ast.SymbolNode(ast.NodeSymbol.ARRAY, (2, 3), None, (1, 2, 3, 4, 5, 6))}
expected_tree = ast.Node((ast.N... | 2.25 | 2 |
python/python/collections/queue_with_stacks.py | othonreyes/code_problems | 0 | 12787138 | <reponame>othonreyes/code_problems
class Queue:
def __init__(self):
stack1 = []
stack2 = []
def add(self, n):
if len(self.stack2) > 0:
self.empty(self.stack2, self.stack1)
self.stack1.append(n)
def remove(self):
if len(self.stack1) > 0:
self.... | 3.828125 | 4 |
preprocessing.py | shreyagummadi/Traffic-Sign-Detection-and-Recognition | 0 | 12787139 | <filename>preprocessing.py
import cv2
import numpy as np
def preprocess(img):
# img = cv2.fastNlMeansDenoisingColored(img)
R = img[:,:,2]
R = cv2.medianBlur(R,5)
G = img[:,:,1]
G = cv2.medianBlur(G,5)
B = img[:,:,0]
B = cv2.medianBlur(B,5)
im = np.zeros((600,600))
R = cv2... | 2.75 | 3 |
Utils/py/naoth/naoth/utils/_debug.py | BerlinUnited/NaoTH | 15 | 12787140 | import sys
import struct
import asyncio
import threading
import functools
from concurrent.futures import Future
from .. import pb
__all__ = ['DebugProxy', 'DebugCommand', 'AgentController']
class DebugProxy(threading.Thread):
"""
Debugging class, creating a connection between RobotControl and the Nao (naoth... | 2.703125 | 3 |
python/subtitles/subtitlesview.py | chirimenmonster/wotmods-subtitles | 0 | 12787141 | <reponame>chirimenmonster/wotmods-subtitles
# -*- coding: utf-8 -*-
import logging
import BigWorld
import GUI
from gui.Scaleform.framework import ViewSettings, ViewTypes, ScopeTemplates
from gui.Scaleform.framework.entities.View import View
from modsettings import MOD_NAME
for name in [ 'gui.Scalform.framework.enti... | 2.015625 | 2 |
elf2dol.py | stblr/mkw-sp | 24 | 12787142 | #!/usr/bin/env python3
from argparse import ArgumentParser
from elftools.elf.constants import P_FLAGS
from elftools.elf.elffile import ELFFile
import io
def segment_is_text(segment):
return segment['p_flags'] & P_FLAGS.PF_X == P_FLAGS.PF_X
def segment_is_data(segment):
return not segment_is_text(segment) a... | 2.609375 | 3 |
django/views/list_modules.py | Kh4n/django-exploit | 1 | 12787143 | import importlib
from pprint import pprint
import ast
def get_imports_from_file(file_name):
with open(file_name, "r") as source:
tree = ast.parse(source.read())
analyzer = Analyzer()
analyzer.visit(tree)
imports = analyzer.report()
ret = []
for i in imports:
print(i)
t... | 2.625 | 3 |
_unittests/ut_automation_students/test_repository_little_aspect.py | mohamedelkansouli/Ensae_py | 0 | 12787144 | """
@brief test log(time=2s)
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
... | 2.546875 | 3 |
lambo/acquisitions/monte_carlo.py | samuelstanton/lambo | 10 | 12787145 | from numpy import array, copy, concatenate
from torch import Tensor
from botorch.acquisition.multi_objective.monte_carlo import (
qExpectedHypervolumeImprovement, qNoisyExpectedHypervolumeImprovement
)
from botorch.posteriors import GPyTorchPosterior, Posterior, DeterministicPosterior
from gpytorch.distributions im... | 1.882813 | 2 |
tessia/server/auth/ldap.py | tessia-project/tessia | 5 | 12787146 | <filename>tessia/server/auth/ldap.py
# Copyright 2016, 2017 IBM Corp.
#
# 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 ... | 1.59375 | 2 |
blog_site/terminal_blog/app.py | jesh-anand/PythonMasterClass | 0 | 12787147 | from blog_site.common.database import Database
from blog_site.terminal_blog.model.menu import Menu
__author__ = '<NAME>'
Database.initialize()
menu = Menu()
menu.run_menu()
| 1.53125 | 2 |
Pass/views.py | franklinwagbara/Brookstone-Pastoral-Management-System | 0 | 12787148 | from django.shortcuts import render, redirect
from StudentManager.functions import viewStudents
from StudentManager.models import Students, Allowed, CurrentSeason, Seasons, CheckIn, Pointers
import concurrent.futures
import threading
from django.utils import timezone
import datetime
from Manager.functions import increm... | 1.976563 | 2 |
set4/ctr_bitflipping.py | adbforlife/cryptopals | 0 | 12787149 | import sys
sys.path.append('/Users/ADB/Desktop/ /cryptopals')
from cryptotools import *
key = generate_key()
def enc_oracle(m):
m = b''.join(m.split(b';'))
m = b''.join(m.split(b'='))
prefix = b'comment1=cooking%20MCs;userdata='
suffix = b';comment2=%20like%20a%20pound%20of%20bacon'
plaintext = prefix + m + suff... | 2.515625 | 3 |
AutoEncoders/denoising_AE/main.py | imhgchoi/pytorch_implementations | 3 | 12787150 | from AutoEncoder.denoising_AE.denoising_ae import DAE
from AutoEncoder.denoising_AE.data import Data
from AutoEncoder.denoising_AE.learner import Learner
from AutoEncoder.denoising_AE.visualizer import Visualizer
if __name__ == '__main__':
DATA_DIR = 'D:/rawDataFiles/digit_train.csv'
LEARNING_RATE = ... | 2.3125 | 2 |