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 |
|---|---|---|---|---|---|---|
GNN/Social-LSTM/visual.py | geneprophet/VGAE | 0 | 46600 | import numpy as np
import matplotlib.pyplot as plt
import pickle
from scipy.stats import multivariate_normal
def draw_heatmap(mux, muy, sx, sy, rho, plt = None, bound = 0.1):
x, y = np.meshgrid(np.linspace(mux - bound, mux + bound, 200),
np.linspace(muy - bound, muy + bound, 200))
m... | 2.4375 | 2 |
vocano/core.py | B05901022/VOCANO | 30 | 46601 | <filename>vocano/core.py
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 21 00:14:04 2020
@author: <NAME>
"""
import os
import torch
import numpy as np
import importlib
import pretty_midi
import platform
import scipy.io.wavfile as wavfile
from apex import amp
from pathlib import Path
from tqdm import tqdm
from google... | 1.9375 | 2 |
migrations/versions/7b5e889e7328_add_canceled_at_for_operations.py | cloud-gov/domain-broker | 5 | 46602 | <reponame>cloud-gov/domain-broker
"""add canceled_at for operations
Revision ID: 7b5e889e7328
Revises: <KEY>
Create Date: 2020-06-19 23:33:37.838852
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
# revision identifiers, used by Alembic.
revision = "7b5e889e7328"
down_revision = "<KEY>"
b... | 0.976563 | 1 |
ReferentialGym/datasets/MineRL_dataset.py | Near32/ReferentialGameGym | 19 | 46603 | <filename>ReferentialGym/datasets/MineRL_dataset.py<gh_stars>10-100
from typing import Dict, List, Tuple
import os
import numpy as np
import random
from tqdm import tqdm
import torch
import minerl
from PIL import Image
from .dataset import Dataset, shuffle
class MineRLDataset(Dataset):
def __init__(self, kwar... | 2.546875 | 3 |
backend/app/app/api/api_v1/endpoints/warehouse.py | totalhack/zillion-web | 3 | 46604 | <reponame>totalhack/zillion-web<filename>backend/app/app/api/api_v1/endpoints/warehouse.py<gh_stars>1-10
from typing import Any, Dict
from fastapi import APIRouter, Depends, Response
from marshmallow.exceptions import ValidationError
from tlbx import st, pp, get_string_format_args, json
from zillion.core import Invali... | 2.078125 | 2 |
lib/cli_commands/validate_classifier.py | antonsuba/ids-test-environment-sdn | 1 | 46605 | <reponame>antonsuba/ids-test-environment-sdn<gh_stars>1-10
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import yaml
import inspect
from importlib import import_module
DIRNAME = os.path.dirname(os.path.abspath(inspect.stack()[0][1]))
CONFIG = os.path.join(DIRNAME, '../../config/config.yml')
with open... | 2.328125 | 2 |
sumy/constants.py | gsandeep1241/TextSummarizer | 0 | 46606 | <reponame>gsandeep1241/TextSummarizer
PATH = '../DUC_data/DUC2006/duc2006_docs/'
GtPath = '../DUC_data/DUC2006/NISTeval/ROUGE/peers/'
googlePath = '../../../../../GoogleNews-vectors-negative300.bin' | 1.007813 | 1 |
demo/classification/fast_neural_network/mnist.py | DanielMorales9/LinearRegression | 0 | 46607 | from classification import FastNeuralNetwork
import os
import scipy.io as scio
from random import random
from numpy import mean, zeros, reshape, ceil
from numpy.random import shuffle, rand
from chart import NNChart
nnc = NNChart()
path = os.path.dirname(os.path.abspath(__file__))
data = scio.loadmat(path+"/data/data1... | 2.765625 | 3 |
src/desc_data.py | centre-for-humanities-computing/NDHL-AHM20 | 0 | 46608 | #!/home/knielbo/virtenvs/ndhl/bin/python
"""
Describe feature distributions of (meta)data
@author: <EMAIL>
"""
import os
import matplotlib.pyplot as plt
from util import load_pcl
from datetime import datetime
def main():
fname = os.path.join("..", "dat", "target.pcl")
db = load_pcl(fname)
metadata = db["m... | 2.375 | 2 |
beep/tests/test_maccor_to_biologic_mb.py | willpowelson/beep | 1 | 46609 | # Copyright [2020] [Toyota Research Institute]
#
# 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 agre... | 2.015625 | 2 |
python base/mail.py | umaremdy/reishy | 0 | 46610 | from flask_mail import Mail, Message
from flask import Flask
app =Flask(__name__)
app.config['MAIL_SERVER']='smtp.gmail.com'
app.config['MAIL_PORT'] = 465
app.config['MAIL_USERNAME'] = '<EMAIL>'
app.config['MAIL_PASSWORD'] = '<PASSWORD>%'
app.config['MAIL_USE_TLS'] = False
app.config['MAIL_USE_SSL'] = True
mail = M... | 2.59375 | 3 |
tests/graph/utils.py | kvh/basis | 11 | 46611 | <filename>tests/graph/utils.py<gh_stars>10-100
import textwrap
from pathlib import Path
from dataclasses import dataclass, asdict
from typing import Any, Union, List, Dict, Collection, Set, Tuple
from basis.graph.builder import graph_manifest_from_yaml, GraphManifest
from basis.configuration.path import GraphEdge, Nod... | 2.09375 | 2 |
tests/test_checkout_caching.py | HumanCellAtlas/data-store | 46 | 46612 | <reponame>HumanCellAtlas/data-store
#!/usr/bin/env python
# coding: utf-8
import os
import sys
import unittest
import tempfile
import time
from google.cloud import storage
from unittest import mock
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # noqa
sys.path.insert(0, pkg_root) # noqa
f... | 1.789063 | 2 |
implementations/tesla/bin/responsehandlers.py | djsincla/SplunkModularInputsPythonFramework | 3 | 46613 | <reponame>djsincla/SplunkModularInputsPythonFramework
#add your custom response handler class to this module
import json
import datetime
#the default handler , does nothing , just passes the raw output directly to STDOUT
class DefaultResponseHandler:
def __init__(self, **args):
pass
def __... | 2.609375 | 3 |
python3/berrymq/adapter/fileobserver.py | shibukawa/berrymq | 0 | 46614 | from .. import berrymq
import os
import glob
import time
import threading
class FileObserver(object):
def __init__(self, target_dir, id_name, interval=5):
self.id_name = id_name
self.target_dir = target_dir
self.interval = interval
self.fileinfo = self._get_fileinfo()
self.t... | 2.703125 | 3 |
hoi3tools/config.py | jDan735/hoi3tools | 0 | 46615 | <reponame>jDan735/hoi3tools
dirpath = "I:\\games\\HoI3 Remastered\\history\\provinces"
| 0.949219 | 1 |
mac/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/reservations/flags.py | bopopescu/cndw | 0 | 46616 | <reponame>bopopescu/cndw<gh_stars>0
# -*- coding: utf-8 -*- #
# Copyright 2019 Google 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.org/li... | 2.125 | 2 |
lor_deckcodes/__init__.py | Rafalonso/LoRDeckCodesPython | 16 | 46617 | name = "lor_deckcodes"
from lor_deckcodes.models import LoRDeck, CardCodeAndCount
| 1.09375 | 1 |
examples/server.py | munisisazade/redis-pub-sub | 2 | 46618 | import os
from redisrpc import RedisRPC
# Add REDIS_URI application enviroment
os.environ.setdefault("REDIS_URI", "redis://:PpkJfHHNph9X5hB5@localhost:6379/0")
rpc = RedisRPC("channel_name") # rename what you want
# event lists
def calc_square(response): # `response` is a sender data
power_of_number = respon... | 2.59375 | 3 |
LeetCode/MaximumPointsYouCanObtainFromCards.py | SelvorWhim/competitive | 0 | 46619 | """
ranges from taking the first k to taking the last k, so try all the combinations, shifting one numbr at a time
"""
class Solution:
def maxScore(self, cardPoints: List[int], k: int) -> int:
max_score = curr_score = sum(cardPoints[:k])
for i in range(1, k+1):
curr_score += cardPoints[... | 2.953125 | 3 |
scripts/hw-diags.py | 2Shirt/WizardK | 0 | 46620 | <reponame>2Shirt/WizardK<filename>scripts/hw-diags.py
#!/usr/bin/env python3
"""WizardKit: Hardware Diagnostics"""
# pylint: disable=invalid-name
# vim: sts=2 sw=2 ts=2
from docopt import docopt
import wk
if __name__ == '__main__':
try:
docopt(wk.hw.diags.DOCSTRING)
except SystemExit:
print('')
wk.s... | 2.1875 | 2 |
slot/w/wand.py | mattkw/dl | 0 | 46621 | import slot
from slot import *
class wand5b2p2(WeaponBase):
ele = ['all']
wt = 'wand'
att = 470
s3 = {
"dmg" : 4*2.44 ,
"sp" : 8757 ,
"startup" : 0.1 ,
"recovery" : 1.9 ,
}
class wand4b1(WeaponBase):
ele = ['flame','wind','shadow'... | 2.40625 | 2 |
ai2business/datasets/sample_generator.py | SimonBOai/ai2business | 0 | 46622 | """Generates sample list of KPIs"""
from ai2business.datasets.data import database
class SampleGenerators:
"""Sample Generators allows to generate key word list.
!!! example
The module `sample_generator.py` contains functions, which allows generating a list of
keywords with and without acrony... | 3.3125 | 3 |
tests/server_generator/test_bottle_server_generator.py | mikaeilorfanian/client_server_generator | 0 | 46623 | import requests
from server_generator.server_generator import MagicRouter
from tests.utils import start_test_bottle_app
class HelloNameURLHandler(MagicRouter):
route_name = 'hello_name'
def handler(self):
return 'hello {}'.format(self.name)
def test_setup():
route = HelloNameURLHandler()
s... | 2.578125 | 3 |
process_mimic.py | miggymigz/mimic-lstm | 0 | 46624 | <gh_stars>0
from functools import reduce
from operator import add
import concurrent.futures
import csv
import fire
import math
import numpy as np
import os
import pandas as pd
import pickle
import re
## Utilities ##
def map_dict(elem, dictionary):
if elem in dictionary:
return dictionary[elem]
else:... | 2.234375 | 2 |
boss/code/GPy_wrappers/GPy_tree_kernel.py | henrymoss/BOSS | 16 | 46625 | from GPy.kern import Kern
from GPy.core.parameterization import Param
import numpy as np
import sys
from paramz.transformations import Logexp
from ..kernels.tree.C_tree_kernel import wrapper_raw_SubsetTreeKernel
class SubsetTreeKernel(Kern):
"""
The SST kernel by Moschitti(2006), with two hyperparameters (la... | 2.296875 | 2 |
identityholder.py | BenNordick/HiLoop | 1 | 46626 | <filename>identityholder.py<gh_stars>1-10
class IdentityHolder:
"""
Wraps an object so that it can be quickly compared by object identity rather than value.
Also provides a total order based on object address.
This is frequently useful for sets representing cycles: set value equality is O(n) but object... | 3.390625 | 3 |
make_json.py | DewMaple/head_box | 0 | 46627 | # A tool for hand labelling images
# Generates an IDL file
# pass in the directory where you store your images and a filename, then select the points on the images
# every time you hit next a line is generated
# the clear button removes are selected points on the current image
# when all files in the directory are proc... | 3.234375 | 3 |
EN4/analysis.py | jvdoorn/EN | 0 | 46628 | import matplotlib.pyplot as plt
import numpy as np
from scipy.io import wavfile
from common import balance, file_name, view, correction
# Read the audio file
rate, audio = wavfile.read(file_name)
audio = balance(audio)
count = audio.shape[0] # Number of data points
length = count / rate # Length of the recording (... | 3.078125 | 3 |
tests/station_test.py | RobMackie/CheckMeIn | 1 | 46629 | import CPtest
class StationTest(CPtest.CPTest):
def test_station(self):
self.getPage("/station/")
self.assertStatus('200 OK')
def test_scanned_success(self):
self.getPage("/station/scanned?barcode=100090")
self.assertStatus('303 See Other')
def test_scanned_success2(self)... | 2.484375 | 2 |
dlex/tf/instance_v1.py | dvtrung/dl-torch | 0 | 46630 | <filename>dlex/tf/instance_v1.py
import logging
import os
import random
from collections import OrderedDict, namedtuple
from datetime import datetime
import tensorflow.compat.v1 as tf
from dlex import FrameworkBackend, TrainingProgress
from dlex.configs import Params
from dlex.datasets.tf import Dataset
from dlex.tf.m... | 1.96875 | 2 |
moto/instance_metadata/models.py | chiemerieezechukwu/moto | 0 | 46631 | from moto.core import BaseBackend
class InstanceMetadataBackend(BaseBackend):
pass
instance_metadata_backend = InstanceMetadataBackend()
| 1.4375 | 1 |
uniqueOccurrences.py | hazardinho/LeetcodeSolutions | 1 | 46632 | <reponame>hazardinho/LeetcodeSolutions<filename>uniqueOccurrences.py
def uniqueOccurrences(self, arr: List[int]) -> bool:
m = {}
for i in arr:
if i in m:
m[i] += 1
else:
m[i] = 1
return len(m.values()) == len(set(m.values())) | 3.1875 | 3 |
bonfire_led_pwm_tb.py | bonfireprocessor/bonfire-pwm | 0 | 46633 | <reponame>bonfireprocessor/bonfire-pwm
from myhdl import *
from bonfire_led_pwm import bonfire_led_pwm
#from bonfire_led_pwm4 import bonfire_led_pwm4
from wishbone_bundle import *
from ClkDriver import *
numChannels=4
values=(2,0x00205070,0x00ffffff,0x00000000,0x00deadbe)
@block
def led_pwm_tb():
wb_bus = Wishb... | 2.171875 | 2 |
setup.py | andypbarrett/Sunlight_under_seaice | 3 | 46634 | from setuptools import setup
setup(
# Needed to silence warnings (and to be a worthwhile package)
name='sunderseaice',
url='',
author='<NAME>',
author_email='<EMAIL>',
# Needed to actually package something
packages=setuptools.find_packages(),
# Needed for dependencies
install_requi... | 1.1875 | 1 |
pages/views.py | Ben-Peters/lnldb | 0 | 46635 | <reponame>Ben-Peters/lnldb<gh_stars>0
import datetime
from django.shortcuts import get_object_or_404, render
from django.utils import timezone
from django.views.decorators.http import require_GET
from events.models import BaseEvent
from pages.models import Page
from processors import navs
def page(request, slug):
... | 2.171875 | 2 |
src/poliastro/tests/test_examples.py | aOrionis/poliastro | 1 | 46636 | <gh_stars>1-10
# This line tests all the statements so far
from poliastro import examples # flake8: noqa
| 1.109375 | 1 |
src/dx/share/scraper/crawl.py | lmmx/dx | 0 | 46637 | from .parse_topics import topics
from .url_utils import base_url
from .time_utils import StopWatch
from .soup_processor import soup_from_response
from .soup_structure import AMSBookInfoPage
from sys import stderr
from time import sleep
__all__ = ["crawl"]
def crawl(book_GET_func, initialise_at=1, volumes=None, sort=T... | 2.71875 | 3 |
project/experiments/exp_035_fight_smp_benchmark/src/gym_envs/smp_envs.py | liusida/thesis-bodies | 0 | 46638 | <filename>project/experiments/exp_035_fight_smp_benchmark/src/gym_envs/smp_envs.py
class SMPRobot():
pass | 0.886719 | 1 |
alipay/aop/api/domain/DishRecommend.py | articuly/alipay-sdk-python-all | 0 | 46639 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class DishRecommend(object):
def __init__(self):
self._buy_posibility = None
self._dish_id = None
self._dish_name = None
self._dish_num = None
self... | 2.625 | 3 |
app/schemas/Recipe.py | koyokakijakarta/foodrecipe | 2 | 46640 | <filename>app/schemas/Recipe.py
from app import ma
from app.models import Recipe as RecipeModels
from app.schemas.Response import ResponseSchema
from marshmallow import validate, ValidationError, EXCLUDE, post_load
def validate_image(image):
allowed_extensions = ['png', 'jpg', 'jpeg', 'gif']
if "." not in ima... | 2.3125 | 2 |
exec/evaluateSupervisedLearningNoPhysicsNoTerminal/2wolves1sheep/trainWolvesTwoCenterControlMultiTrees/generateCenterControlTrajectoryByCondition.py | ningtangla/trainCentrolControl | 0 | 46641 | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..','..'))
import numpy as np
import pickle
import random
import json
from collections import OrderedDict
import itertools as it
from src.neuralNetwork.policyValueResNet import GenerateModel, Train, saveVariables, sampleData, Approximat... | 1.773438 | 2 |
estrutura-de-decisao/exercicio06.py | diegolinkk/exercicios-python-brasil | 0 | 46642 | #Faça um Programa que leia três números e mostre o maior deles.
a = int(input("Digite o primeiro número: "))
b = int(input("Digite o segundo número: "))
c = int(input("DIgite o terceiro número: "))
primeiro = a
segundo = b
terceiro = c
if terceiro > segundo:
terceiro,segundo = segundo,terceiro
if segundo > pri... | 3.90625 | 4 |
python3/hamming_distance.py | joshiaj7/CodingChallenges | 1 | 46643 | # leetcode
class Solution:
def hammingDistance(self, x: int, y: int) -> int:
ans = 0
xor = bin(x^y)[2:]
for l in xor:
if l == '1':
ans += 1
return ans | 3.4375 | 3 |
hello.py | NateLovallo/megafun | 0 | 46644 | <filename>hello.py<gh_stars>0
print 'hello you'
| 1.054688 | 1 |
warden/csv_routes/routes.py | pathtoknowhere/warden | 27 | 46645 | <gh_stars>10-100
import csv
import hashlib
import logging
import secrets
import os
import pandas as pd
from datetime import datetime
import dateutil.parser as parser
from flask import (Blueprint, flash, redirect, render_template, request,
send_file, url_for, current_app)
from flask_login import cur... | 2.296875 | 2 |
fred_crawler.py | Tyromancer/economics.py | 0 | 46646 | # Usage:
# Find and download fred series data
# then find the specific data on yyyy-mm-dd
import requests # used for downloading text files from FRED
import os # used for removing temporary text files
# Usage : download series data in the form of text file and extract data on given date
# param:
# se... | 3.9375 | 4 |
CS116/a06-j4mai/a06-j4mai/a06q4.py | JohnMai1994/CS116-2018_Winter_Term | 0 | 46647 | ##===============================================
## <NAME> (20557203)
## CS 116 Winter 2018
## Assignment 06, Question 4
##===============================================
import check
# Question 4 - part a
# max_height(desc) consumes a Str, desc, and returns the maximum height reached
# max_height: Str -> Nat
# ... | 3.796875 | 4 |
paleomix/nodes/bedtools.py | jfy133/paleomix | 0 | 46648 | <filename>paleomix/nodes/bedtools.py<gh_stars>0
#!/usr/bin/python
#
# Copyright (c) 2012 <NAME> <<EMAIL>>
#
# 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 with... | 1.820313 | 2 |
hrsalespipes/api_integrations/migrations/0001_initial.py | hanztura/hrsalespipes | 3 | 46649 | <reponame>hanztura/hrsalespipes
# Generated by Django 2.2.10 on 2020-04-30 07:25
from django.db import migrations, models
import django_extensions.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Lin... | 1.734375 | 2 |
examples/how_to/per_round_max_channel.py | haoxusci/starfish | 164 | 46650 | <reponame>haoxusci/starfish<filename>examples/how_to/per_round_max_channel.py
"""
.. _howto_perroundmaxchannel:
Decoding Spots with :py:class:`.PerRoundMaxChannel`
===================================================
:py:class:`.PerRoundMaxChannel` is a :py:class:`.DecodeSpotsAlgorithm` that picks the channel with
max... | 2.453125 | 2 |
aitools/proofs/builtin_provers.py | OneManEquipe/thinkerino | 1 | 46651 | <filename>aitools/proofs/builtin_provers.py<gh_stars>1-10
import logging
from aitools.logic.core import Expression, Variable, LogicObject
from aitools.logic.language import Language
from aitools.logic.unification import Substitution
from aitools.logic.utils import VariableSource
from aitools.proofs.components import H... | 2.046875 | 2 |
Python/sum_prime.py | kennethsequeira/Hello-world | 1,428 | 46652 | <reponame>kennethsequeira/Hello-world<filename>Python/sum_prime.py<gh_stars>1000+
'''
Write a function sumprimes(l) that takes as input a list of integers l and retuns the sum of all the prime numbers in l.
Here are some examples to show how your function should work.
>>> sumprimes([3,3,1,13])
19
'''
def sumprim... | 4.15625 | 4 |
note37/attr_test2.py | icexmoon/python-learning-notes | 0 | 46653 | import abc
from typing import ValuesView
class AttributeProxy:
def __init__(self, name) -> None:
self.name = name
def __get__(self, instance, owner):
return instance.__dict__[self.name]
def __set__(self, instance, value):
instance.__dict__[self.name] = value
class ValidatableAt... | 3.609375 | 4 |
installer.py | erick-dsnk/Electric | 0 | 46654 | <filename>installer.py
######################################################################
# OFFICIAL ELECTRIC INSTALLER #
######################################################################
import os
os.system('pip install tqdm')
os.system('pip install requests')
os.system(... | 2.390625 | 2 |
MSTs/PrimsLazy.py | ketansahils/Algorithms_One | 0 | 46655 | <gh_stars>0
import sys, os
sys.path.insert(0, os.path.abspath('..'))
from WeekX.Queue import Queue
from MinPQ import MinPQ
from WEdge import WEdge
from EdgeWeightedGraph import EdgeWeightedGraph
class PrimsLazy(object):
def __init__(self,G):
self.mst = Queue()
self.minPQ = MinPQ()
self.marked = [False] * G._V
... | 2.609375 | 3 |
packages/model_options.py | jphuart/swatplus-automatic-workflow | 8 | 46656 | '''
date : 31/03/2020
description : this module keeps information on print
objects used by editor
author : <NAME>
contact : <EMAIL>
licence : MIT 2020
'''
print_obj_lookup = {
"basin_wb" : "1",
"basin_nb" : "2",
"basin_ls" : "3",
"basin_pw" : "4",
"basin_aqu" : "5... | 1.554688 | 2 |
examples/cursor.py | Dextroz/virustotal-python | 15 | 46657 | <filename>examples/cursor.py
"""
The examples in this file are for virustotal-python version >=0.1.0
Use a cursor from the VirusTotal API JSON response to retrieve more results.
Documentation:
* v3 documentation - https://developers.virustotal.com/reference/collections
"""
from virustotal_python import Virustota... | 3.359375 | 3 |
cryptongo.py | manu9812/MongoDB | 0 | 46658 | import pymongo
import requests
from collections import OrderedDict
from hashlib import sha512
API_URL = 'https://api.coinmarketcap.com/v2/ticker/'
API_URL_START = 'https://api.coinmarketcap.com/v2/ticker/?start={}'
API_URL_LISTINGS = 'https://api.coinmarketcap.com/v2/listings/'
def get_db_connection(uri):
"""
... | 2.90625 | 3 |
zutils/cf_conventions.py | iosonobert/zutils | 0 | 46659 | ## KEPT FOR BACK COMPAT
from .pyMOS import *
for i in np.arange(0, 10):
print('cf_conventions deprecated, use pyMOS instead.') | 1.6875 | 2 |
danmaku_robot/settings.py | elfgzp/bili_danmaku_robot | 3 | 46660 | # -*- coding: utf-8 -*-
__author__ = 'gzp'
from danmaku_robot.models import RobotSettings
class Settings(object):
_settings = dict([
('room_id', 'int'),
('cookie', 'str'),
('question_prefix', 'str'),
('answer_prefix', 'str'),
('confidence', 'float'),
('question_rob... | 2.453125 | 2 |
src/Python/Widgets/OrientationMarkerWidget1.py | ajpmaclean/vtk-examples | 81 | 46661 | #!/usr/bin/env python
# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkFiltersSources import vtkSuperquadricSource
from vtkmodules.vtkIOXML impo... | 1.898438 | 2 |
set.py | mghelton/snmp_research | 0 | 46662 | <filename>set.py
from pysnmp.hlapi import *
g = setCmd(SnmpEngine(),
CommunityData('public'),
UdpTransportTarget(('192.168.61.6', 161)),
ContextData(),
ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysName', 0),'test'))
gen = next(g)
print(gen[3])
| 1.890625 | 2 |
custom_components/ryobi_gdo3/cover.py | Madj42/ryobi_gdo2 | 6 | 46663 | <reponame>Madj42/ryobi_gdo2
"""
Ryobi platform for the cover component.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/cover.ryobi_gdo/
"""
import logging
import time
import voluptuous as vol
from datetime import timedelta
import homeassistant.helpers.confi... | 1.992188 | 2 |
subs/data.py | Alimo1029/Alimo1029-s-Blog | 0 | 46664 | <filename>subs/data.py
# 数据库操作
# 导入模块
import pymysql
# 初始化函数
def _init():
# 连接数据库
db = pymysql.connect(
host='localhost',
port=3306,
user='Blog',
passwd='<PASSWORD>',
db='alimo1029-blog',
charset='utf8'
)
# 创建游标
cursor = db.cur... | 3.53125 | 4 |
wt/pygardena/rest_api.py | geeak/wt.pygardena | 0 | 46665 | <filename>wt/pygardena/rest_api.py
import requests
from urllib.parse import urljoin
class RestAPI(requests.Session):
"""
Encapsulates all REST calls to the Gardena API.
"""
# The base URL for all Gardena requests. Change this if you want to fire the requests against other services
base_url = "... | 3.09375 | 3 |
django-todos/todosite/todosapp/urls.py | rockchalkwushock/pdx-code-labs | 0 | 46666 | from django.urls import path
from . import views
app_name = 'todos'
urlpatterns = [
path('', views.index, name="index"),
path('add', views.add, name="add"),
path('complete', views.complete, name="complete"),
path('delete', views.delete, name="delete")
]
| 1.757813 | 2 |
specs2/specs2.bzl | ittaym/rules_scala | 2 | 46667 | load("//scala:scala_cross_version.bzl",
"scala_mvn_artifact",
)
def specs2_version():
return "3.8.8"
def specs2_repositories():
native.maven_jar(
name = "io_bazel_rules_scala_org_specs2_specs2_core",
artifact = scala_mvn_artifact("org.specs2:specs2-core:" + specs2_version()),
sha1 = "495bed0... | 1.640625 | 2 |
Dataset/Leetcode/train/46/364.py | kkcookies99/UAST | 0 | 46668 | <reponame>kkcookies99/UAST
class Solution:
def XXX(self, nums: List[int]) -> List[List[int]]:
l = len(nums)
if l <= 1:
return [nums]
total = 1
for i in range(2, l + 1):
total *= i
res = [[] for _ in range(total)]
div = total
for i in ra... | 3.03125 | 3 |
graphite_feeder/handler/appliance/handler.py | majamassarini/automate-graphite-feeder | 0 | 46669 | <reponame>majamassarini/automate-graphite-feeder
import logging
from graphite_feeder.handler.graph import Graph
from graphite_feeder.handler.appliance.registry import Registry
from graphite_feeder.handler.event.registry import mapper
class Handler(Graph, metaclass=Registry):
COLOR_LIST = "{},{},{},{},{},{},{}".... | 2.1875 | 2 |
bin/run_percolation.py | twesterhout/percolation | 0 | 46670 | <filename>bin/run_percolation.py
#!/usr/bin/env python3
#
# Copyright <NAME> (c) 2018
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the abo... | 1.945313 | 2 |
tests/test_rectangle.py | trejsu/shaper | 0 | 46671 | <filename>tests/test_rectangle.py<gh_stars>0
import numpy as np
import pytest
from shapes.shape import Quadrangle
def test_from_normalized_params():
normalized = [1, 0.2866666666666667, 0.85, 0.32666666666666666, 0.65, 0.013333333333333334, 0.8,
-0.02, 1, 2, 3, 0.5]
w = 100
h = 150
... | 2.34375 | 2 |
common_utils/file_utils.py | CroP-BioDiv/zcitools | 0 | 46672 | <filename>common_utils/file_utils.py
import os
import errno
import sys
import shutil
import csv
import yaml
import json
from zipfile import ZipFile, ZIP_DEFLATED
yaml.Dumper.ignore_aliases = lambda *args: True
# Settings
settings_defaults = dict(
ps_viewer='evince',
image_viewer='gpicview',
email=None,
... | 2.40625 | 2 |
modules/vacations/vacations/builders.py | vasyukvv42/metabot | 0 | 46673 | from datetime import date
from decimal import Decimal
from typing import List, Dict, Iterable, Optional
from vacations.config import (
APPROVE_BUTTON_ACTION_ID,
DENY_BUTTON_ACTION_ID,
DATEPICKER_START_ACTION_ID,
DATEPICKER_END_ACTION_ID,
REASON_INPUT_ACTION_ID,
REQUEST_VIEW_ID,
LEAVE_TYPES,... | 2.34375 | 2 |
Proyecto_Global_Hitss_RF_v1/Funciones/Obtener_hora_actual.py | marlonsale08/Marlon | 0 | 46674 | from datetime import datetime
def greetingTime():
current_hour = datetime.now().hour
if current_hour < 12:
return "Buenos días"
elif 12 <= current_hour < 18:
return "Buenas tardes"
else:
return "Buenas noches" | 3.734375 | 4 |
Algorithms/Merge Sort/LinkedListMergeSort.py | TeacherManoj0131/HacktoberFest2020-Contributions | 256 | 46675 | #Program for merge sort in linked list
class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def append(self, new_value):
new_node = Node(new_value)
if self.head is None:
self.head = new_node
return
curr_node = self.head
... | 4.375 | 4 |
FinHelper/dialogwin/transaction_window.py | felipepo/FinancialHelper---PyQT | 0 | 46676 | <reponame>felipepo/FinancialHelper---PyQT
from PySide2 import QtCore, QtGui, QtWidgets
from decimal import Decimal
from ..utilities import funs
from . import category_window
class Create(QtWidgets.QDialog):
def __init__(self, parent,debitOptions,creditOptions,CAToptions, transData={}):
super().__init__(par... | 2.59375 | 3 |
training_v1_backup/training/pytorchLearning/logrTorch.py | prasoonpatidar/multiagentRL-resource-sharing | 0 | 46677 | '''
0) Setup Data
1) Design Model (input_size, output_size, forward_pass)
2) Construct Loss, Optimizer
3) Training Loop
- forward pass
- gradients
- update weights
'''
import torch
import torch as th
import torch.nn as nn
import numpy as np
# Data process
from sklearn import datasets
from sklearn.preproces... | 3.328125 | 3 |
backend/api/serializers.py | Kovszasz/MYG | 0 | 46678 | from rest_framework import serializers
from .models import *
import backend.settings.dev as settings
from rest_framework.validators import UniqueValidator
import jwt
from rest_framework_jwt.utils import jwt_payload_handler
class ProfilePicSerializer(serializers.ModelSerializer):
class Meta:
model = MygUse... | 2.125 | 2 |
SuperficiesRevolucion/SuperficiesRevolucion.py | ranea/Bachelor-Projects | 0 | 46679 | #!/usr/bin/env python
# Superficies de revolucion
import OpenGL
OpenGL.ERROR_ON_COPY = True
from OpenGL.GL import *
from OpenGL.GLU import gluOrtho2D
from OpenGL.GLUT import *
import sys, time
from sympy.core.sympify import sympify
from sympy import *
from OpenGL.constants import GLfloat
from OpenGL.GL.ARB.multisampl... | 2.171875 | 2 |
sdk/cwl/tests/test_submit.py | tomclegg/arvados | 0 | 46680 | <reponame>tomclegg/arvados
import copy
import cStringIO
import functools
import hashlib
import json
import logging
import mock
import sys
import unittest
import arvados
import arvados.collection
import arvados_cwl
import arvados_cwl.runner
import arvados.keep
from .matcher import JsonDiffMatcher
from .mock_discovery ... | 2 | 2 |
api/DirLoad.py | BhasherBEL/LittleFather | 5 | 46681 | <filename>api/DirLoad.py
#!/usr/local/bin/python
# coding: utf-8
from api.Error import raise_error, ErrorLevel
import os
import importlib
import importlib.util
def load_for_dir(path: str, output_class: classmethod, required_vars: list = None, optional_vars: list = None, required_funcs: list = None, optional_funcs: ... | 2.65625 | 3 |
tests/routes/v1/test_datasets.py | NASA-IMPACT/covid-api | 14 | 46682 | """Test /v1/datasets endpoints"""
import json
from unittest.mock import patch
import boto3
import botocore
from moto import mock_s3
from covid_api.core.config import INDICATOR_BUCKET
DATASET_METADATA_FILENAME = "dev-dataset-metadata.json"
DATASET_METADATA_GENERATOR_FUNCTION_NAME = "dev-dataset-metadata-generator"
... | 1.875 | 2 |
classes.py | ploggingdev/python_learn | 10 | 46683 | <reponame>ploggingdev/python_learn
import copy
class Point:
"""A class to represent a point"""
details = "Represent points"
def __init__(self,x=0,y=0):
self.x=x
self.y=y
def __str__(self):
return "x={} y={}".format(self.x,self.y)
def get_sum(self):
"""Return ... | 4.46875 | 4 |
dusty/systems/docker/testing_image.py | gamechanger/dusty | 421 | 46684 | <filename>dusty/systems/docker/testing_image.py<gh_stars>100-1000
from __future__ import absolute_import
import docker
from ...compiler.compose import container_code_path, get_volume_mounts
from ...compiler.spec_assembler import get_expanded_libs_specs
from ...log import log_to_client
from ...command_file import dusty... | 2.015625 | 2 |
cog/constants.py | William-Hill/COG | 0 | 46685 | '''
CoG application-level constants.
'''
SECTION_DEFAULT = 'DEFAULT'
SECTION_ESGF = 'ESGF'
SECTION_EMAIL = 'EMAIL'
SECTION_GLOBUS = 'GLOBUS'
SECTION_PID = 'PID'
# note: use lower case
VALID_MIME_TYPES = { '.bmp': ['image/bmp', 'image/x-windows-bmp'],
'.csv': ['text/plain'],
... | 1.320313 | 1 |
ios_code_generator/models/__init__.py | banxi1988/iOSCodeGenerator | 34 | 46686 | <filename>ios_code_generator/models/__init__.py<gh_stars>10-100
# -*- coding: utf-8 -*-
__author__ = 'banxi'
from .core import *
def _auto_import_models():
import os
import importlib
searchpath = os.path.dirname(__file__)
exclude_modules = ['__init__', 'core']
for filename in os.listdir(searchpat... | 1.890625 | 2 |
AUTOENCODERS/DataPreparing/KIBANAPreprocessor.py | pawelptak/AI-Anomaly-Detection | 1 | 46687 | <filename>AUTOENCODERS/DataPreparing/KIBANAPreprocessor.py<gh_stars>1-10
import enum
from sklearn.preprocessing import StandardScaler, LabelEncoder, MinMaxScaler, OneHotEncoder
import numpy as np
import pandas as pd
import tqdm
from datetime import datetime
"""
Class for Preprocessing The Data
"""
class KIBANAPrepro... | 2.703125 | 3 |
netrino/views/orders.py | HieronymusCrouse/netrino | 2 | 46688 | <filename>netrino/views/orders.py
# -*- coding: utf-8 -*-
# Copyright (c) 2019 <NAME>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above co... | 1.421875 | 1 |
rayvision_api/exception.py | loonghao/rayvision_api | 0 | 46689 | """The exception for the rayvision api."""
class RayvisionError(Exception):
"""Raise RayvisionError if something wrong."""
def __init__(self, error_code, error, *args, **kwargs):
"""Initialize error message, inherited Exception.
Args:
error_code (int): Error status code.
... | 2.78125 | 3 |
sync_comments_articles.py | chucknado/ZMT | 1 | 46690 | import arrow
from helpers import read_data, write_data, get_settings, package_comment
import api
settings = get_settings()
sync_dates = read_data('sync_dates')
last_sync = arrow.get(sync_dates['comments'])
article_map = read_data('article_map')
comment_map = read_data('comment_map')
comment_article_map = read_data('... | 2.53125 | 3 |
src/bayesian_changepoint_detection/online_changepoint_detection.py | YAU1YAN/Bayesian_HD_sparse_changepoint_online_detection | 1 | 46691 | <reponame>YAU1YAN/Bayesian_HD_sparse_changepoint_online_detection<filename>src/bayesian_changepoint_detection/online_changepoint_detection.py
from __future__ import division
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
from math import log, pow
def online_changepoint_detection(data, hazar... | 2.5 | 2 |
Nessus.py | ucstone/Nessus-Tranlator | 26 | 46692 | # coding: utf-8
# !/usr/bin/env python3
import csv
import os, os.path
import sys
import argparse
from WriteExcel import Excel
from log import debug, info, error
from baidu_traslate import *
class Nessus(object):
"""处理Nessus扫描结果"""
def __init__(self, csv_name):
self.csv_name = csv_name
self.... | 2.546875 | 3 |
Char4 A2C/A2C-CartPole-v0.py | rh01/Deep-reinforcement-learning-with-pytorch | 0 | 46693 | <gh_stars>0
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import matplotlib.pyplot as plt
import numpy as np
import math
import random
import os
import gym
import warnings
warnings.filterwarnings('ignore')
# Hyper Parameters
STATE_DIM = 4
ACTION_DIM = 2
STEP = 2... | 2.515625 | 3 |
filters.py | kaniblu/enwiki-mysql | 2 | 46694 | <reponame>kaniblu/enwiki-mysql
# encoding: utf-8
from __future__ import unicode_literals
import re
import string
import six
import gensim
class WikiBodyFilter(object):
"""Generic wikipedia article filter
Strips off illegal characters and markups. Borrows some basic logic from
gensim utils.
"""
... | 2.6875 | 3 |
SysReview/mainapp/tests.py | Alistair401/WAD | 1 | 46695 | from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.core.urlresolvers import reverse
from mainapp.forms import CreateReviewForm
from mainapp.models import Researcher, Review, Paper, Query
from django.contrib.auth.models import User
# tests for ... | 2.546875 | 3 |
examples/dir.py | dmytrostriletskyi/design-kit | 107 | 46696 | <gh_stars>100-1000
from accessify import accessify, private
@accessify
class Car:
@private
def start_engine(self):
return 'Engine sound.'
if __name__ == '__main__':
car = Car()
assert 'start_engine' not in dir(car)
| 2.59375 | 3 |
webDe/settings.py | dannybombastic/Cockfight | 0 | 46697 | """
Django settings for webDe project.
Generated by 'django-admin startproject' using Django 2.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
from... | 1.773438 | 2 |
rstfinder/rst_eval.py | aoifecahill/discourse-parsing | 75 | 46698 | <filename>rstfinder/rst_eval.py
#!/usr/bin/env python
"""
Script to evaluate the RST parser.
:author: <NAME>
:author: <NAME>
:organization: ETS
"""
import argparse
import json
import logging
from collections import Counter
from operator import itemgetter
from nltk.tree import ParentedTree
from .collapse_rst_labels... | 2.703125 | 3 |
Projeto_Capitulo/randomQuizGenerator.py | alexcarlos06/Automatize_Tarefas_Ma-antes | 0 | 46699 | #! python3
# randomQUizGenerator.py - Cria provas com perguntas e respostas em ordem aleatória
# juntamente com os gabaritos contendo as respostas.
import random
captals = {'Acre (AC)': 'Rio Branco', 'Alagoas (AL)': 'Maceió', 'Amapá (AP)': 'Macapá', 'Amazonas (AM)': 'Manaus',
'Bahia (BA)': 'Salvador', 'Cea... | 2.84375 | 3 |