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 |
|---|---|---|---|---|---|---|
scripts/processing/shared_processing_functions.py | andreasfloros/Project-EMILY | 0 | 12783251 | <reponame>andreasfloros/Project-EMILY
from imports import *
'''The following functions are used by both the streamlined and non-streamlined versions of the pipeline'''
def print_processing_selections(app):
# get input values from user, note that window_size and window_stride are now in samples
processing_me... | 2.546875 | 3 |
pyscreenshot/plugins/xwd.py | ponty/pyscreenshot | 416 | 12783252 | import logging
from easyprocess import EasyProcess
from pyscreenshot.plugins.backend import CBackend
from pyscreenshot.tempexport import RunProgError, read_func_img
from pyscreenshot.util import extract_version
log = logging.getLogger(__name__)
PROGRAM = "xwd"
# wikipedia: https://en.wikipedia.org/wiki/Xwd
# ... | 2.25 | 2 |
core/meta/method.py | ponyatov/metaLpy | 0 | 12783253 | <gh_stars>0
## @file
from core.active import *
from .meta import *
## @ingroup meta
class Method(Meta, Fn):
pass
| 1.164063 | 1 |
lv1/matrix.py | mrbartrns/programmers-algorithm | 0 | 12783254 | <reponame>mrbartrns/programmers-algorithm<filename>lv1/matrix.py<gh_stars>0
def solution(arr1, arr2):
answer = []
for i in range(len(arr1)):
temp = []
for j in range(len(arr1[0])):
tot = 0
tot = arr1[i][j] + arr2[i][j]
temp.append(tot)
answer.append(te... | 3.71875 | 4 |
checkov/version.py | acdha/checkov | 0 | 12783255 | version = '1.0.290'
| 1.101563 | 1 |
third_party/Sparkle/Sparkle_custom.gyp | leiferikb/bitpop-private | 1 | 12783256 | <gh_stars>1-10
# Copyright (c) 2011 House of Life Property ltd.
# Copyright (c) 2011 Crystalnix <<EMAIL>>
{
'conditions': [
['OS=="mac"', {
'targets': [
{
'target_name': 'Sparkle',
'type': 'shared_library',
'dependencies': [
'relaunch_tool',
],
... | 1.070313 | 1 |
dsaii/forms.py | khushi0205/DSAII | 0 | 12783257 | from django import forms
from .models import Comments
class CommentForm(forms.ModelForm):
class Meta:
model = Comments
fields = ('name', 'body')
widgets = {
'name': forms.TextInput(attrs={'class' : 'form-control'}),
'body' : forms.Textarea(attrs={'class': 'form-cont... | 2.28125 | 2 |
helpers/allocation.py | hugombarreto/credibility_allocation | 0 | 12783258 | # -*- coding: utf-8 -*-
from collections import defaultdict
from os import listdir, path
from helpers.file_name import FileName
class Allocation(object):
def __init__(self, data_path):
files = sorted(listdir(data_path))
files = filter(lambda x: x[-4:] == '.csv', files)
alloc_files = filt... | 2.84375 | 3 |
Python3/Listas/ListaEx3.py | arthursiq5/programacao-progressiva | 0 | 12783259 | <filename>Python3/Listas/ListaEx3.py
numeros = list(range(5))
print(numeros)
| 3.140625 | 3 |
nevergrad/optimization/test_special.py | risto-trajanov/nevergrad | 3,217 | 12783260 | <reponame>risto-trajanov/nevergrad
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import time
import collections
import typing as tp
import pytest
import numpy... | 2.125 | 2 |
fastreid/modeling/losses/triplet_loss.py | weleen/MGH.pytorch | 4 | 12783261 | <filename>fastreid/modeling/losses/triplet_loss.py
# encoding: utf-8
"""
@author: liaoxingyu
@contact: <EMAIL>
"""
import torch
import torch.nn.functional as F
from fastreid.utils import comm, euclidean_dist
def softmax_weights(dist, mask):
max_v = torch.max(dist * mask, dim=1, keepdim=True)[0]
diff = dist... | 2.03125 | 2 |
src/examples/run_all.py | RaedanWulfe/oddimorf | 0 | 12783262 | #!/usr/bin/python3.8
# -*- coding: utf-8 -*-
"""
Runs all example scripts.
"""
import os
import subprocess
from flask import Flask, request
from flask_restful import Resource, Api
from subprocess import PIPE
python_command = "python"
processes = []
supervisor = None
supervisor_url = 'http://localhost:8070'
dirs = [
... | 2.296875 | 2 |
collector/query_sky_and_obsy_conditions.py | d33psky/rolloffroof | 4 | 12783263 | #!/usr/bin/env python3
import datetime
import json
from pathlib import Path
import requests
import MySQLdb
db = MySQLdb.connect(
host="lxc-rrd",
port=3306,
user='sens',
passwd='<PASSWORD>',
db="observatory1")
db_cursor = db.cursor()
def check_db(minutes):
sql = """
SELECT sensors_id
... | 2.796875 | 3 |
UserProfile/models.py | Hudeh/Hubmart | 0 | 12783264 | from django.db import models
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser
# from safedelete.models import SafeDeleteModel
# from safedelete.models import SOFT_DELETE_CASCADE
# from safedelete.managers import SafeDeleteAllManager
class UserManager(BaseUserManager):
def create_user(self, ... | 2.453125 | 2 |
Easy/350. Intersection of Two Arrays II/solution (2).py | czs108/LeetCode-Solutions | 3 | 12783265 | <gh_stars>1-10
# 350. Intersection of Two Arrays II
# Runtime: 48 ms, faster than 67.57% of Python3 online submissions for Intersection of Two Arrays II.
# Memory Usage: 14.1 MB, less than 99.75% of Python3 online submissions for Intersection of Two Arrays II.
class Solution:
def intersect(self, nums1: list[int... | 3.546875 | 4 |
pyfos/utils/layer2/lldp_global_tlv_add.py | brocade/pyfos | 44 | 12783266 | <filename>pyfos/utils/layer2/lldp_global_tlv_add.py
#!/usr/bin/env python3
# Copyright © 2019 Broadcom. All rights reserved.
# The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | 1.664063 | 2 |
main_evaluate.py | ehoogeboom/convolution_exponential_and_sylvester | 21 | 12783267 | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import time
import numpy as np
import torch
import torch.utils.data
from optimization.training import evaluate, plot_samples
from utils.load_data import load_dataset
from os.path import join
parser = argparse.ArgumentParser(description='P... | 2.171875 | 2 |
cryptomonsters/mining/views.py | kryptokardz/cryptocards | 1 | 12783268 | <filename>cryptomonsters/mining/views.py
"""Base views for cryptomonsters."""
import json
from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.shortcuts import render
from django.views.generic imp... | 2.390625 | 2 |
pysql/main_c.py | Devansh3712/PySQL | 12 | 12783269 | <gh_stars>10-100
"""
MIT License
Copyright (c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge... | 1.6875 | 2 |
UNIVESPalgortimo_1/testeparagit.py | joaorobsonR/algoritmo1 | 0 | 12783270 | def tabuada(n):
for i in range(0, 11):
res = n * i
print(n ,'x', i, '=', res)
tabuada(5)
| 3.390625 | 3 |
DOS_DOG/flow_dump.py | Network-Hub/Dos_Dog | 0 | 12783271 | # encoding: utf-8
import queue
from flow_detector import *
# 定义一个字典用来记录每个流已经嗅探到的数据包个数
flow_recorder = {}
# 定义一个队列用来缓存数据包
q = queue.Queue()
def put_pkt_to_queue(pkts):
for pkt in pkts:
q.put(pkt)
def get_pkt_id(pkt):
if pkt.haslayer('IP'):
src_ip = pkt["IP"].src
dst... | 2.765625 | 3 |
didyoumean-discordpy/main.py | daima3629/didyoumean-discordpy | 1 | 12783272 | from discord.ext import commands
import difflib
from .message_generator import DefaultMessageGenerator, MessageGenerator
from typing import Optional, Mapping, Set, List
class DidYouMean(commands.Cog):
"""
Core class of this library.
Attributes
----------
bot
The bot object.
... | 2.421875 | 2 |
hypernets/core/trial.py | lyhue1991/Hypernets | 3 | 12783273 | <filename>hypernets/core/trial.py
# -*- coding:utf-8 -*-
"""
"""
import datetime
import os
import pickle
import shutil
from collections import OrderedDict
import pandas as pd
from hypernets.utils.common import isnotebook, to_repr
from ..core.searcher import OptimizeDirection
class Trial():
def __init__(self, s... | 2.140625 | 2 |
ST7735fb.py | boochow/FBConsole | 35 | 12783274 | # ST7735S driver wrapper for FBConsole
# ST7735 driver: https://github.com/boochow/MicroPython-ST7735
# FBConsole: https://github.com/boochow/FBConsole
class TFTfb(object):
def __init__(self, tft, font):
self.height = 160
self.width = 128
self.tft = tft
self.font = font
tft.... | 2.390625 | 2 |
demo/ner/money/money.py | zhengxin2016/corpus | 0 | 12783275 | #!/usr/bin/env python3
import os,sys
import re
class Money():
def __init__(self):
self.resource_path = 'resource'
self.money_set = set()
self.digital_set = set()
self.get_money()
self.mon_r = self.get_money_r()
def get_money(self):
with open(self.resource_path+'... | 3.484375 | 3 |
cowsay/lib/cows/kitty.py | Ovlic/cowsay_py | 0 | 12783276 | def Kitty(thoughts, eyes, eye, tongue):
return f"""
{thoughts}
{thoughts}
("\`-' '-/") .___..--' ' "\`-._
\` {eye}_ {eye} ) \`-. ( ) .\`-.__. \`)
(_Y_.) ' ._ ) \`._\` ; \`\` -. .-'
_.. \`--'_..-_/ /--' _ .' ,4
( i l ),-'' ( l i),' ( ( ! .-'
""" | 2.671875 | 3 |
tests/test_adfgvx.py | SF-11/hist-crypt | 0 | 12783277 | <reponame>SF-11/hist-crypt<gh_stars>0
import ciphers.adfgvx
alpha_5x5 = [
["b", "t", "a", "l", "p"],
["d", "h", "o", "z", "k"],
["q", "f", "v", "s", "n"],
["g", "ij", "c", "u", "x"],
["m", "r", "e", "w", "y"]
]
alpha_6x6 = [
["n", "a", "1", "c", "3", "h"],
["8", "t", "b", "2", "o", "m"],
... | 2.609375 | 3 |
bfro/bfro_weather_join.py | timothyrenner/bfro_sightings_data | 7 | 12783278 | import click
import json
import csv
from toolz import get, get_in
@click.command()
@click.argument('report_file', type=click.File('r'))
@click.argument('weather_file', type=click.File('r'))
@click.argument('weather_join_file', type=click.File('w'))
def main(report_file, weather_file, weather_join_file):
weather... | 3.328125 | 3 |
alethioclock/config.py | A-Somma/alethioclock | 0 | 12783279 | <filename>alethioclock/config.py
#firebase service account
SERVICE_ACCOUNT_PATH = '../.firebase/service-account.json'
SERVICE_ADDRESS = '532'
STATUSES = ['AUTOMATIC', 'HOME', 'LOST', 'UNKOWN'] | 1.046875 | 1 |
src/waldur_openstack/openstack_tenant/tests/test_snapshots.py | geant-multicloud/MCMS-mastermind | 26 | 12783280 | <gh_stars>10-100
from ddt import data, ddt
from rest_framework import status, test
from waldur_openstack.openstack_tenant import models
from . import factories, fixtures
@ddt
class SnapshotRestoreTest(test.APITransactionTestCase):
def setUp(self):
self.fixture = fixtures.OpenStackTenantFixture()
de... | 1.992188 | 2 |
notebooks/myfuncts.py | bradleysawler/blog | 0 | 12783281 | <reponame>bradleysawler/blog<filename>notebooks/myfuncts.py
import pandas as pd
import numpy as np
import re
from fractions import Fraction
# import plot libraries
import seaborn as sns
sns.set_palette('Set2')
import matplotlib.pyplot as plt
# list number of files
import os, os.path
from pathlib import ... | 2.921875 | 3 |
scrapy_compose/cmdline.py | Sphynx-HenryAY/scrapy-compose | 0 | 12783282 | import sys
import optparse
from inspect import isclass
from scrapy.cmdline import (
_run_print_help,
_run_command,
_print_commands,
_print_unknown_command
)
class EntryPoint:
name = "scrapy-compose"
from scrapy.commands import ScrapyCommand as BaseCommand
_action = None
_cmd = None
_cmds = None
_parser ... | 2.21875 | 2 |
src/position.py | hideraldus13/loro | 0 | 12783283 | <reponame>hideraldus13/loro<gh_stars>0
import pyautogui
import time
for i in range(10):
print(pyautogui.position())
time.sleep(0.5)
| 2.15625 | 2 |
test/svid/jwtsvid/test_jwt_svid.py | LaudateCorpus1/py-spiffe | 5 | 12783284 | import pytest
import datetime
from calendar import timegm
import jwt
from cryptography.hazmat.primitives.asymmetric import rsa, ec
from cryptography.hazmat.backends import default_backend
from pyspiffe.svid import INVALID_INPUT_ERROR
from pyspiffe.svid.jwt_svid import JwtSvid
from pyspiffe.bundle.jwt_bundle.jwt_bundle ... | 2.078125 | 2 |
auto-generated-sdk/setup.py | afernandes85/sampleapi-python-sdk | 0 | 12783285 | <reponame>afernandes85/sampleapi-python-sdk<filename>auto-generated-sdk/setup.py
# coding: utf-8
"""
Swagger Petstore
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For... | 1.28125 | 1 |
app.py | cibinsb/EMBL_task | 0 | 12783286 | import falcon
import json
import pathlib
from helper.log import logger
from src.middleware import HttpMethodValidator
from helper.utils import Constants
from src.query_builder import RunQuery
from src.db import DataBase
from falcon_swagger_ui import register_swaggerui_app
try:
logger.info("Connecting to Database")... | 2.3125 | 2 |
test/test3.py | LUSHDigital/lrpi_display | 0 | 12783287 | #!/usr/bin/env python
import pygame
from pygame.locals import *
import os
from time import sleep
print(dir(pygame))
DIM = [480,320] # screen framebuffer dimensions
WHITE = (255, 255, 255)
BLACK = ( 0, 0, 0)
BLUE = ( 0, 0, 255)
GREEN = ( 0, 255, 0)
RED = (255, 0, 0)
ORANGE ... | 2.703125 | 3 |
manim_express/math/quaternion.py | hkeliang/manim-kunyuan | 0 | 12783288 | import numpy as np
from manimlib import *
class Quaternion:
def __init__(self, x=None, y=0, z=0, w=1):
"""Quaternion style [x, y, z, w]"""
if issubclass(type(x), (np.ndarray, list, tuple)):
self._x = x[0]
self._y = x[1]
self._z = x[2]
self._w = x[3]
... | 3.265625 | 3 |
detect_car.py | marty331/license-plate-recognition | 12 | 12783289 | import matplotlib.pyplot as plt
import cv2
#import imutils
import requests
import base64
import json
import numpy as np
from PIL import Image
from PIL import ImageEnhance
from skimage import color, data, restoration
from scipy.signal import convolve2d
import pytesseract
import PIL.ImageOps
pytesseract.pytesseract.tess... | 2.625 | 3 |
_unittests/ut_garden/test_poulet.py | Pandinosaurus/mlstatpy | 9 | 12783290 | <filename>_unittests/ut_garden/test_poulet.py
# -*- coding: utf-8 -*-
"""
@brief test log(time=4s)
"""
import unittest
from mlstatpy.garden.poulet import maximum, find_maximum, histogramme_poisson_melange, proba_poisson_melange
class TestPoulet(unittest.TestCase):
def test_poulet1(self):
res = maxim... | 2.671875 | 3 |
explorer/services/deal.py | AthenaExplorer/xm_s_explorer_v2 | 0 | 12783291 | <gh_stars>0
import datetime
from mongoengine import Q
from base.utils.fil import _d, height_to_datetime, datetime_to_height, bson_to_decimal
from explorer.models.deal import Deal, Dealinfo,DealDay,DealStat
from explorer.models.miner import MinerDealPriceHistory
from base.utils.paginator import mongo_paginator
from mong... | 2.28125 | 2 |
opensea.py | btproghornbt/scripts | 0 | 12783292 | <gh_stars>0
#!/bin/env python3
# importing os module
import os
import requests
import shutil # to save it locally
from tenacity import retry, wait_exponential, TryAgain
def mkdir_p(path):
try:
# similar to `mkdir -p` in bash
# makedirs for recursion; exist_ok = True for no error if dir exists
... | 2.875 | 3 |
chp1/dictAttack.py | farhan3/violent-python | 0 | 12783293 | <gh_stars>0
#!/usr/bin/env python
"""
Perform Dictionary Attack using the provided password file and dictionary,
along with the algorithm, e.g. DES, SHA512.
Usage:
dictAttack.py dictAttack [-v] <passwdFileName> <dictionary> <algorithm>
dictAttack.py dictAttackExample [-v]
dictAttack.py -h | --help
di... | 4.125 | 4 |
flex_nav_create_flexbe_behaviors/src/flex_nav_create_flexbe_behaviors/create_move_base_sm.py | CNURobotics/chris_create_flexible_navigation | 0 | 12783294 | #!/usr/bin/env python
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] tags will be kept. ... | 1.75 | 2 |
fluo_timelapse.py | simonepignotti/fluo_timelapse | 0 | 12783295 | #!/usr/bin/env python3
import os
import sys
import time
import json
import argparse
# filter wheel
import hid
# relay switch
import serial
# camera
import gphoto2 as gp
DEBUG = True
config_dict = {
'camera': {
'aWHITE': {
'exp': '1/4',
'iso': '200',
'f_val': '2',
... | 2.296875 | 2 |
Climate_API.py | wdawn9618/sqlalchemy-challenge | 0 | 12783296 | <filename>Climate_API.py
from flask import Flask, jsonify
import numpy as np
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from sqlalchemy.pool import StaticPool
engine = create_engine("sqlite:///Res... | 2.90625 | 3 |
reference/regexercise_solutions/literals.py | JaDogg/__py_playground | 1 | 12783297 | def search(strings, chars):
"""Given a sequence of strings and an iterator of chars, return True
if any of the strings would be a prefix of ''.join(chars); but
only consume chars up to the end of the match."""
if not all(strings):
return True
tails = strings
for ch in chars:
tail... | 3.90625 | 4 |
python/schuelerpraktika/joshua_neubeck/mein_programm.py | maximilianharr/code_snippets | 0 | 12783298 | <reponame>maximilianharr/code_snippets<gh_stars>0
# -*- coding: utf-8 -*-
import time
import random
import sys
print('*********************************'); time.sleep(0.5)
print('*** SCHERE ** STEIN ** PAPIER ***'); time.sleep(0.5)
print('*********************************\n'); time.sleep(0.5)
print('Dabei ist die Sc... | 3.5 | 4 |
hw1/test.py | pannag/cs294 | 1 | 12783299 | #!/usr/bin/envpython
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
def get_data():
base_cond=[[18,20,19,18,13,4,1],
[20,17,12,9,3,0,0],
[20,20,20,12,5,3,0]]
cond1=[[18,19,18,19,20,15,14],
[19,20,18,16,20,15,9],
[19,20,20,20,17,10,0],
[20,20,20,20,7,9,1]]
co... | 2.53125 | 3 |
src/audio_utils/mel/__init__.py | stefantaubert/audio-utils | 0 | 12783300 | from audio_utils.mel.main import (get_wav_tensor_segment, mel_to_numpy,
wav_to_float32_tensor)
from audio_utils.mel.mel_plot import (concatenate_mels, plot_melspec,
plot_melspec_np)
from audio_utils.mel.stft import STFT
from audio_utils.mel.taco_st... | 1.4375 | 1 |
app/api/src/services/test_services.py | Greyman-Seu/AiServer | 0 | 12783301 | <filename>app/api/src/services/test_services.py
# @File : test_services.py
# @Date : 2020/08/17
# @Author: zhuyangkun
# @Email:<EMAIL>
from app.core.logging_core.logging_fastapi import fastapi_logger
def print_name(name):
fastapi_logger.info(f"name is {name}")
if __name__ == "__main__":
print... | 1.695313 | 2 |
examples_and_tutorial/dD_examples.py | timotheehornek/sparsetorch | 0 | 12783302 | import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import torch
from sparsetorch.dD_basis_functions import Tensorprod, Elemprod, Sparse
from sparsetorch.oneD_basis_functions import Hat, Gauss, Fourier, Chebyshev, Legendre
from sparsetorch.plotter import plot_3D_all
from sparsetorch.utils import ge... | 2.234375 | 2 |
util/device.py | SENERGY-Platform/mgw-kasa-dc | 0 | 12783303 | <reponame>SENERGY-Platform/mgw-kasa-dc<filename>util/device.py
"""
Copyright 2021 InfAI (CC SES)
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/LI... | 2.046875 | 2 |
avgn/custom_parsing/stowell_birds.py | xingjeffrey/avgn_paper | 0 | 12783304 | <reponame>xingjeffrey/avgn_paper
import pandas as pd
from avgn.utils.audio import get_samplerate
import librosa
from avgn.utils.json import NoIndentEncoder
import json
import avgn
from avgn.utils.paths import DATA_DIR
def parse_csv(csvrow, DSLOC):
wav_df = pd.DataFrame(
columns=[
"species",
... | 2.734375 | 3 |
coding/learn_gevent/gevent_14_spawn.py | yatao91/learning_road | 3 | 12783305 | # -*- coding: utf-8 -*-
import gevent
from gevent import Greenlet
def foo(message, n):
gevent.sleep(n)
print(message)
thread1 = Greenlet.spawn(foo, "Hello", 1)
thread2 = gevent.spawn(foo, "I live!", 2)
thread3 = gevent.spawn(lambda x: (x + 1), 2)
threads = [thread1, thread2, thread3]
gevent.joinall(thre... | 3.15625 | 3 |
pikuli/uia/control_wrappers/data_grid.py | NVoronchev/pikuli | 0 | 12783306 | <gh_stars>0
# -*- coding: utf-8 -*-
from pikuli import FindFailed, logger
from pikuli.uia.control_wrappers.data_item import DataItem
from .uia_control import UIAControl
class DataGrid(UIAControl):
CONTROL_TYPE = 'DataGrid'
def __init__(self, *args, **kwargs):
super(DataGrid, self).__init__(*args, **... | 2.046875 | 2 |
interlinks/scripts/JudaicaLink-interlink-04.py | judaicalink/judaicalink-generators | 1 | 12783307 | # <NAME>
#This code extracts further information from GND for the authors of Freimann collection who have an GND-ID assigned to them.
#15/01/2018
#Ver. 01
import rdflib
from rdflib import Namespace, URIRef, Graph , Literal
from SPARQLWrapper import SPARQLWrapper2, XML , RDF , JSON
from rdflib.namespace import RDF, FOA... | 2.28125 | 2 |
Python/PyinstallerUI.py | ClericPy/somethings | 4 | 12783308 | <reponame>ClericPy/somethings
# -*- coding: utf-8 -*-
# pip install pyinstallerui
# > python -m pyinstallerui
from pyinstallerui.core import main
main()
| 1.109375 | 1 |
backup_initialize/checksum.py | hwwilliams/backup-tarfile-s3 | 0 | 12783309 | import hashlib
import json
import os
import logging
import re
logger = logging.getLogger(__name__)
def get_hash(backup_name, backup_sources):
sha256_hash = hashlib.sha256()
for source in backup_sources:
source_path = source['Path']
exclusions = '(?:% s)' % '|'. join(source['Exclude'])
... | 2.640625 | 3 |
tests/experiments/panda-physics.py | LuCeHe/home-platform | 1 | 12783310 | <reponame>LuCeHe/home-platform
from panda3d.core import Vec3, ClockObject
from panda3d.bullet import BulletWorld
from panda3d.bullet import BulletPlaneShape
from panda3d.bullet import BulletRigidBodyNode
from panda3d.bullet import BulletBoxShape
from direct.showbase import ShowBase
base = ShowBase.ShowBase()
base.cam.... | 2.046875 | 2 |
helper_functions.py | zywkloo/Insomnia-Dungeon | 0 | 12783311 | #### ====================================================================================================================== ####
############# IMPORTS #############
#### =========================================================... | 1.9375 | 2 |
test/unit/test_noise_gates.py | stjordanis/pyquil | 677 | 12783312 | import numpy as np
from pyquil.gates import RZ, RX, I, CZ, ISWAP, CPHASE
from pyquil.noise_gates import _get_qvm_noise_supported_gates, THETA
def test_get_qvm_noise_supported_gates_from_compiler_isa(compiler_isa):
gates = _get_qvm_noise_supported_gates(compiler_isa)
for q in [0, 1, 2]:
for g in [
... | 2.015625 | 2 |
tools/eslint/internal/toolchain.bzl | jmillikin/rules_javascript | 2 | 12783313 | <gh_stars>1-10
# Copyright 2019 the rules_javascript authors.
#
# 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 applica... | 1.867188 | 2 |
applanga.py | applanga/applanga-cli | 2 | 12783314 | <reponame>applanga/applanga-cli
#!/usr/bin/env python
import click
from lib import constants
import commands
@click.group()
@click.version_option(constants.VERSION_NUMBER)
@click.option('--debug/--no-debug', default=False)
@click.pass_context
def cli(ctx, debug):
ctx.obj['DEBUG'] = debug
# Add all the commands ... | 1.867188 | 2 |
RIFF/riffedit.py | mirabilos/ev-useful | 0 | 12783315 | #!/usr/bin/python3
# coding: UTF-8
#-
# Copyright © 2018, 2020 mirabilos <<EMAIL>>
#
# Provided that these terms and disclaimer and all copyright notices
# are retained or reproduced in an accompanying document, permission
# is granted to deal in this work without restriction, including un‐
# limited rights to use, pub... | 1.804688 | 2 |
digital-curling/myenv_keras/env.py | km-t/dcpython | 0 | 12783316 | import sys
import gym
import numpy as np
import gym.spaces
import math
import pandas as pd
df = pd.read_csv('./logs.csv', sep=',')
df = df.sample(frac=1)
def getData(line, keyNum):
if keyNum == 0: # vec
vec = str(df.iloc[line, 0])
v = np.zeros(11, dtype=np.float32)
for i in range(11):
... | 2.890625 | 3 |
setup.py | fdvty/open-box | 184 | 12783317 | <gh_stars>100-1000
#!/usr/bin/env python
# This en code is licensed under the MIT license found in the
# LICENSE file in the root directory of this en tree.
import sys
import importlib.util
from pathlib import Path
from distutils.core import setup
from setuptools import find_packages
requirements = dict()
for extra i... | 1.96875 | 2 |
setup.py | matt-carr/cloudstorage | 0 | 12783318 | import io
import re
from glob import glob
from os.path import basename, dirname, join, splitext
from setuptools import find_packages, setup
def read(*names, **kwargs):
with io.open(
join(dirname(__file__), *names),
encoding=kwargs.get('encoding', 'utf8')
) as fh:
return fh.rea... | 2.03125 | 2 |
utils/own_utils.py | arslan-chaudhry/orthog_subspace | 17 | 12783319 | <filename>utils/own_utils.py<gh_stars>10-100
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import tensorflow as tf
def OWNNorm(W):
"""
Implements the Orthogonalize... | 2.09375 | 2 |
06-appexecute/app_execute.py | AppTestBot/AppTestBot | 0 | 12783320 | import time
import pyaudio
import wave
from google_speech import Speech
class Call_APP():
def __init__(self, appname):
self.chunk = 1024
self.appname = appname
self.f = wave.open(r"/home/kimsoohyun/00-Research/02-Graph/06-appexecute/하이빅스비_2.wav","rb")
self.p = pyaudio.PyAudio()
... | 3.015625 | 3 |
2021/day12/day12.py | ChrisCh7/advent-of-code | 3 | 12783321 | <filename>2021/day12/day12.py
from collections import defaultdict
paths = []
def part1(connections: dict[str, list[str]]):
traverse('start', connections, [])
print('Part 1:', len(paths))
def part2(connections: dict[str, list[str]]):
counter = traverse_p2('start', connections, [])
print('Part 2:', c... | 3.703125 | 4 |
Chapter04/references/musicvae.py | loftwah/hands-on-music-generation-with-magenta | 0 | 12783322 | <filename>Chapter04/references/musicvae.py<gh_stars>0
# -*- coding: utf-8 -*-
"""MusicVAE.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/notebooks/magenta/music_vae/music_vae.ipynb
Copyright 2017 Google LLC.
Licensed under the Apache License, Version... | 1.546875 | 2 |
Properties/analysis/complexity metrics/complexity/PMSmetrics.py | NazaninBayati/SCA | 0 | 12783323 | <filename>Properties/analysis/complexity metrics/complexity/PMSmetrics.py
db = open("Project Metrics Summary.txt","r")
db = db.read()
db_st=[]
db_st2=[]
db_st = db.split("\n")
#print(db_st.__len__())
i = 0
db_list=[]
print(db_st[0])
#print(db.split("\n"))
db_temp = db_st[2:db_st.__len__()-1]
db_st=db_temp
#print(db_st... | 2.875 | 3 |
Data science/Analise de dados/exercicio python/ler csv.py | Andrelirao/aulas-graduacao | 10 | 12783324 | <filename>Data science/Analise de dados/exercicio python/ler csv.py
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 23:28:44 2020
@author: luisc
"""
import csv
arquivo = open('titanic.csv');
linhas = csv.reader(arquivo);
for linha in linhas:
print(linha)
| 3.171875 | 3 |
Rendering/Core/Testing/Python/TexturedSphere.py | jasper-yeh/VtkDotNet | 3 | 12783325 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
#
# Texture a sphere.
#
# renderer and interactor
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRender... | 2.265625 | 2 |
app/Main/SYS/UniqueOperators.py | fineans/Vython | 0 | 12783326 | <gh_stars>0
from rply.token import BaseBox
import sys
from Main.Errors import error, errors
class UniqueOp(BaseBox):
def __init__(self, var):
self.var = var
class Increment(UniqueOp):
def eval(self):
try:
self.var.value = self.var.value + 1
return self.var.value
... | 2.421875 | 2 |
tests/test_staroid.py | staroids/staroid-python | 2 | 12783327 | import unittest
import tempfile
import os
import pathlib
import shutil
from staroid import Staroid
def integration_test_ready():
return "STAROID_ACCESS_TOKEN" in os.environ and "STAROID_ACCOUNT" in os.environ
class TestStaroid(unittest.TestCase):
def test_initialize(self):
s = Staroid()
def test... | 2.46875 | 2 |
configuration/defaults.py | Wildertrek/gamechanger-data | 18 | 12783328 | <reponame>Wildertrek/gamechanger-data
from . import RENDERED_DIR
from pathlib import Path
DEFAULT_APP_CONFIG_NAME = "local"
DEFAULT_ES_CONFIG_NAME = "local"
RENDERED_DEFAULTS_PATH = Path(RENDERED_DIR, "defaults.json")
TEMPLATE_FILENAME_SUFFIX = '.template' | 1.3125 | 1 |
src/wavegrad/random.py | JeremyCCHsu/test-debug | 0 | 12783329 | from scipy.stats import truncnorm
import numpy as np
import torch
def truncnorm_like(x):
size = [int(s) for s in x.shape]
eps = truncnorm.rvs(-3.001, 3.001, size=size) / 3.
return torch.from_numpy(eps)
| 2.625 | 3 |
iconic/iconic/roller.py | mikkoJJ/iconic-roller | 0 | 12783330 | <reponame>mikkoJJ/iconic-roller
""" Functions for randomly rolling the relationships.
"""
from .defaults import ICONS, RELATIONSHIP_TYPES
from .icon_relationships import IconRelationship
import random
from typing import List
def roll_relationships(relationship_points: int, min_icons: int) -> List[IconRelationship]:
... | 3.75 | 4 |
lspeas/tests/_test_centerline.py | almarklein/stentseg | 1 | 12783331 | <filename>lspeas/tests/_test_centerline.py
import numpy as np
import visvis as vv
import os
from stentseg.utils import PointSet
from stentseg.utils.centerline import find_centerline, points_from_mesh, smooth_centerline, pp_to_graph
from stentseg.utils.datahandling import select_dir, loadvol, loadmodel
from stentseg.ut... | 2.09375 | 2 |
javatools/change.py | sokoslee/jvm.py | 0 | 12783332 | # This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be usefu... | 2.3125 | 2 |
pywatts/callbacks/debug_callback.py | zyxsachin/pyWATTS | 30 | 12783333 | <gh_stars>10-100
import xarray as xr
from typing import Dict, Optional
from pywatts.callbacks.base_callback import BaseCallback
class PrintCallback(BaseCallback):
"""
Print callback class to print out result data into terminal for debugging.
:param BaseCallback: Base callback class.
:type BaseCallba... | 2.96875 | 3 |
#074 - Maior e menor valores em Tupla.py | EronBruce/Exercicios_Python | 0 | 12783334 | <reponame>EronBruce/Exercicios_Python<gh_stars>0
from random import randint
numeros = (randint(0,10),randint(0,10),randint(0,10),randint(0,10),randint(0,10))
print('Os valores sorteados foram: ', end='')
for n in numeros:
print(f'{n} ', end='')
print('\nO maior valor sorteado foi {}'.format(max(numeros)))
p... | 3.6875 | 4 |
redis/_compat.py | yujinrobot/redis-py | 0 | 12783335 | <reponame>yujinrobot/redis-py
"""Internal module for Python 2 backwards compatibility."""
import sys
if sys.version_info[0] < 3:
from urlparse import urlparse
from itertools import imap, izip
from string import letters as ascii_letters
try:
from cStringIO import StringIO as BytesIO
except ... | 2.515625 | 3 |
model.py | RistoranteRist/FastFlow | 0 | 12783336 | <gh_stars>0
from tkinter import HIDDEN
from numpy import require
import torch
import torch.nn as nn
import numpy as np
import FrEIA.modules as Fm
import FrEIA.framework as Ff
from FrEIA.framework import *
from FrEIA.framework import topological_order
from typing import List, Tuple, Iterable, Union, Optional
from torc... | 1.945313 | 2 |
Data_Science/Neural Networks from Scratch/P.1 Intro and Neuron Code.py | maledicente/cursos | 1 | 12783337 | import sys
import numpy as np
import matplotlib
"""print("Python:", sys.version)
print("Numpy", np.__version__)
print("Matplotlib", matplotlib.__version__)"""
inputs = [1.2,5.1,2.1]
weights = [3.1,2.1,8.7]
bias = 3
output = (inputs[0] * weights[0] +
inputs[1] * weights[1] +
inputs[2] * weights[2] + bias)
... | 2.984375 | 3 |
research/cv/retinanet_resnet152/train.py | mindspore-ai/models | 77 | 12783338 | <gh_stars>10-100
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 1.453125 | 1 |
Physics250-ME30/energydensityofwire.py | illusion173/Physics250 | 0 | 12783339 | <filename>Physics250-ME30/energydensityofwire.py
import numpy as np
import math
extraNumber = 4 * math.pi * pow(10,-7)
def energydensityofWire():
length = float(input('Input length: '))
amps = float(input('Input Amps: '))
length = length/100
part1 = (extraNumber * amps)/(2*math.pi*length)
... | 3.53125 | 4 |
pixelpuncher/game/models.py | ej2/pixelpuncher | 0 | 12783340 | from django.db import models
from django_extensions.db import fields
from pixelpuncher.player.models import Player
class GameState(object):
PLAY = 'PLAY'
GAME_OVER = 'OVER'
CLOSED = 'CLSD'
STATE = (
('PLAY', 'Playing',),
('OVER', 'Game Over',),
('CLSD', 'Closed',),
)
cl... | 2.171875 | 2 |
test/mx/test_mx_rolling.py | RingoIngo/gluon-ts | 7 | 12783341 | <filename>test/mx/test_mx_rolling.py
# Copyright 2018 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
#
# http://www.apache.org/licens... | 2.359375 | 2 |
cottonformation/res/lookoutequipment.py | MacHu-GWU/cottonformation-project | 5 | 12783342 | # -*- coding: utf-8 -*-
"""
This module
"""
import attr
import typing
from ..core.model import (
Property, Resource, Tag, GetAtt, TypeHint, TypeCheck,
)
from ..core.constant import AttrMeta
#--- Property declaration ---
#--- Resource declaration ---
@attr.s
class InferenceScheduler(Resource):
"""
AWS... | 2.078125 | 2 |
firmware_password_manager.py | jwrn3/firmware_password_manager | 1 | 12783343 | #!/usr/local/bin/python3
# -*- coding: utf-8 -*-
"""
This should not be blank.
"""
# Copyright (c) 2020 University of Utah Student Computing Labs. ################
# All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby ... | 2.03125 | 2 |
glance/__init__.py | GlanceApps/Glance-Website | 1 | 12783344 | <filename>glance/__init__.py
""" glance """
| 0.859375 | 1 |
app/views_info.py | fossabot/stream_vod_indexer | 0 | 12783345 | from django.shortcuts import render
from django.http import JsonResponse
NotImplemented = JsonResponse({"error":"NotImplemented"})
# Create your views here.
def slugs(request):
return NotImplemented
def last_updated(request):
return NotImplemented
def streamer(request):
return NotImplemented
def endpoi... | 2.03125 | 2 |
src/ensae_projects/hackathon/random_answers.py | sdpython/ensae_projects | 1 | 12783346 | # -*- coding: utf-8 -*-
"""
@file
@brief Generates random answers for challenges.
"""
import os
import numpy
import pandas
def random_answers_2020_images():
"""
Generates random answers the deep learning challenge of
hackathons :ref:`l-hackathon-2020`.
"""
name = os.path.join(os.path.split(__file_... | 3.0625 | 3 |
maskrcnn_benchmark/modeling/roi_heads/box_head/roi_box_predictors.py | JunhoPark0314/DCNet | 93 | 12783347 | <reponame>JunhoPark0314/DCNet
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from maskrcnn_benchmark.modeling import registry
from torch import nn
import torch
@registry.ROI_BOX_PREDICTOR.register("FastRCNNPredictor")
class FastRCNNPredictor(nn.Module):
def __init__(self, config, in_channe... | 1.921875 | 2 |
check_deps.py | racitup/ddrescue_used | 2 | 12783348 | <gh_stars>1-10
"""
Checks for tool package dependencies.
##License:
Original work Copyright 2016 <NAME>
Everyone is permitted to copy, distribute and modify this software,
subject to this statement and the copyright notice above being included.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
IN NO EV... | 1.640625 | 2 |
img2dataset/logger.py | rom1504/img2dataset | 482 | 12783349 | """logging utils for the downloader"""
import wandb
import time
from collections import Counter
import fsspec
import json
from multiprocessing import Process, Queue
import queue
class CappedCounter:
"""Maintain a counter with a capping to avoid memory issues"""
def __init__(self, max_size=10 ** 5):
... | 2.84375 | 3 |
materials/migrations/0055_auto_20190327_2305.py | mgovoni-devel/MatD3 | 7 | 12783350 | # Generated by Django 2.1.7 on 2019-03-28 03:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('materials', '0054_auto_20190318_1704'),
]
operations = [
migrations.AlterField(
model_name='dataset',
name='dimensio... | 1.632813 | 2 |