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
code/plot-step_wind.py
jennirinker/torque2020-iea-15mw
1
51000
# -*- coding: utf-8 -*- """Plot step wind """ import matplotlib.pyplot as plt import numpy as np import os from _inputs import (step_dir, model_keys, i_gspd, i_pit, i_gtrq, fig_dir, fast_labels, h2_labels) from _utils import read_step plot_keys = [('GenSpeed', i_gspd,'Generator Speed [rpm]', 1), ('BldPitc...
2.4375
2
clear_files_on_ftp_server.py
ChrisEby/ClearFilesOnFtpServer
0
51001
<filename>clear_files_on_ftp_server.py # __author__ = '<NAME>' from ftplib import FTP, error_perm from datetime import datetime, timedelta from configparser import ConfigParser from os import path def main(): config_file = 'settings.ini' # Check if the ini file exists, create if not if not path.isfile(c...
3.25
3
torchaddons/distributions/_categorical.py
jakkes/torchaddons
0
51002
<gh_stars>0 from typing import Tuple import torch import torchaddons from torchaddons import distributions class Categorical(distributions.Base): """Categorical distribution.""" def __init__(self, probabilities: torch.Tensor) -> None: """Creates a categorical distribution. Args: ...
2.703125
3
custom_components/hahm/switch.py
Thomas55555/custom_homematic
0
51003
<reponame>Thomas55555/custom_homematic """binary_switch for Homematic(IP) Local.""" from __future__ import annotations import logging from typing import Any, Union from hahomematic.const import HmPlatform from hahomematic.devices.switch import CeSwitch from hahomematic.platforms.switch import HmSwitch from homeassis...
1.835938
2
src/scatter.py
HumphreyHao/NBA-analyse
0
51004
import pandas as pd import plotly.graph_objs as go flist = ['data/data_cleaned/poss_ppp_data/poss2015.csv', 'data/data_cleaned/poss_ppp_data/poss2016.csv', 'data/data_cleaned/poss_ppp_data/poss2017.csv', 'data/data_cleaned/poss_ppp_data/poss2018.csv', 'data/data_cleaned/poss_ppp_data/poss2019.csv'] def sc...
3.03125
3
run.py
futianfan/pyscreener
1
51005
<gh_stars>1-10 import csv from distutils.dir_util import copy_tree from operator import itemgetter from pathlib import Path import tempfile import pyscreener from pyscreener import args, preprocess, postprocess def main(): print('''\ *************************************************************** * ____ __ ...
2.546875
3
examples/test_matrix.py
francois-vincent/simply
0
51006
# encoding: utf-8 from contextlib import contextmanager import time import pytest import requests from simply.platform import factory from simply.utils import ConfAttrDict @contextmanager def platform_setup(conf): platform = factory(conf) platform.setup('all_containers') yield platform platform.res...
2.1875
2
greens/main.py
grillazz/fastapi-mongodb
4
51007
<gh_stars>1-10 from fastapi import FastAPI from greens import config from greens.routers import router as v1 from greens.services.repository import get_mongo_meta from greens.utils import get_logger, init_mongo global_settings = config.get_settings() if global_settings.environment == "local": get_logger("uvicorn...
2.21875
2
vqcd_all_chan.py
iitis/variational_channel_fidelity
0
51008
from vqcd_main_funcs import * from vqcd_secondary_funcs import * # returns the list of required relative error for which we get a different ranks def error_val_list(qdim, rank, any_chan_no, kraus_chan, opt_ang, an, device_type, noise_mdl, noise_amp): """ returns a list containing threshold of relative error...
2.53125
3
logger.py
PanDAWMS/harvester_monitoring
0
51009
import os import logging from pathlib import Path class ServiceLogger: def __init__(self, name, file, loglevel='DEBUG'): p = str(Path(file).parent) + '/logs/' i = 0 while True: if not os.path.exists(p): i = i + 1 p = str(Path(file).parents[i]) +...
2.765625
3
events/contrib/plugins/form_handlers/http_repost/forms.py
mansonul/events
0
51010
from django import forms from django.utils.translation import ugettext_lazy as _ from .....base import BasePluginForm, get_theme __title__ = 'fobi.contrib.plugins.form_handlers.http_repost.forms' __author__ = '<NAME> <<EMAIL>>' __copyright__ = '2014-2017 <NAME>' __license__ = 'GPL 2.0/LGPL 2.1' __all__ = ('HTTPRepost...
1.835938
2
pyreq/collector/__init__.py
ksks2211/pyreq
0
51011
from .selector import collect_attr, collect_links
1.054688
1
tests/data/leapp-rerun-tests-repos/ipu-rerun-repo/tags/firstboot.py
dhodovsk/leapp
29
51012
from leapp.tags import Tag class FirstBootTag(Tag): name = 'first_boot'
1.421875
1
Python/python/inp.py
manishaverma1012/programs
0
51013
a = int (input(' enter the first number ')) b = int (input('enter the second number ')) z = a + b print(a+b)
3.875
4
cpy_deploy/boards.py
tammymakesthings/cpydeploy
0
51014
class Boards: def __init__(self): self.description = "CPY_Deploy Board Definitions"
1.5
2
op2d/hal/backend/falcon.py
op2-project/op2-daemon
10
51015
<gh_stars>1-10 import RPi.GPIO as GPIO import time from application import log from application.notification import IObserver, NotificationCenter from application.python import Null from sipsimple.configuration.settings import SIPSimpleSettings from sipsimple.threading import run_in_thread, run_in_twisted_thread from...
2.4375
2
QCL_gui/comms.py
alex123go/QCL_controllerViaArduino
0
51016
# -*- coding: utf-8 -*- """ Created on Fri Jan 8 00:34:40 2021 @author: Alex1 """ import serial import time class QCL_comms(): """docstring for QCL_comms""" def __init__(self, arg=None): super(QCL_comms, self).__init__() self.arg = arg self.serActive = False def connect(self,port = 'COM9'): self.ser =...
2.71875
3
pyobjmap/matrix.py
jessecusack/pyobjmap
0
51017
import numpy as np from . import utils def tile_position(x0, y0, x1=None, y1=None): """Need doc string...""" if x1 is None and y1 is None: x1 = x0 y1 = y0 if (x0.size != y0.size) or (x1.size != y1.size): raise ValueError("x0 and y0 or x1 and y1 size do not match.") x0g = np...
3.3125
3
graphing/tests/diagram_maker.py
jonsim/robin-project
0
51018
#!/usr/bin/python #--------------------------------------------------------------# # DESCRIPTION # # Takes a csv (must be comma separated ONLY) where each line # # represents a single pixel row and each value represents # # the z values for each corresponding p...
2.515625
3
geckodrive.py
joshhighet/ransomwatch
0
51019
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' loads the dom and fetches html source after javascript rendering w/ firefox, geckodriver & selenium use sharedutils.py:socksfetcher for faster results if no post-processing required ''' import time import requests from selenium import webdriver from selenium.webdriver....
2.5625
3
covid_project/who_data/admin.py
Valentin-Rault/Covid-project
0
51020
<reponame>Valentin-Rault/Covid-project from django.contrib import admin from .models import WhoData # Register your models here. class WhoDataAdmin(admin.ModelAdmin): list_display = ( "date_reported", 'country_code', "country", "new_cases", "cumulative_cases", "new...
1.960938
2
intro-ansible/venv3/lib/python3.8/site-packages/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware.py
Stienvdh/statrick
0
51021
<reponame>Stienvdh/statrick #!/usr/bin/python # -*- coding: utf-8 -*- # # Dell EMC OpenManage Ansible Modules # Version 3.0.0 # Copyright (C) 2019-2021 Dell Inc. or its subsidiaries. All Rights Reserved. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # from __future__ i...
1.757813
2
terminal.py
megaelius/Delfos-datathon-fme
0
51022
<reponame>megaelius/Delfos-datathon-fme import json import math import time import numpy as np from pathlib import Path from Auxiliary.recommender import Recommender def main(): ini = time.time() w = {'Price':1/12, 'Embedding':3/12, 'Ratings':3/12, 'Rating':1/6, 'Embeddings...
2.40625
2
scripts/013_Features_Dwell.py
mustelideos/recsys-challenge-2019
8
51023
#!/usr/bin/env python # coding: utf-8 import sys sys.path.append("../") import pandas as pd import numpy as np import pathlib import pickle import os import itertools import argparse import logging import helpers.feature_helpers as fh from collections import Counter OUTPUT_DF_TR = 'df_steps_tr.csv' OUTPUT_DF_VAL =...
2.453125
2
savu/plugins/azimuthal_integrators/pyfai_azimuthal_integrator_tools.py
elainehoml/Savu
39
51024
from savu.plugins.plugin_tools import PluginTools class PyfaiAzimuthalIntegratorTools(PluginTools): """1D azimuthal integrator by pyFAI """
1.289063
1
python-packages/middlewares/test/__init__.py
bryan-liu-nova/ZRXFork
1,075
51025
"""Tests of zero_x.middlewares."""
1.132813
1
iCount/externals/cutadapt.py
genialis/iCount
0
51026
""".. Line to protect from pydocstyle D205, D400. Cutadapt -------- Remove adapter sequences from reads in FASTQ file. """ import os import shutil import subprocess import tempfile import iCount from iCount.files.fastq import get_qual_encoding, ENCODING_TO_OFFSET def get_version(): """Get cutadapt version."""...
2.6875
3
models/fedbayes.py
mingxuts/multi-center-fed-learning
4
51027
import copy import importlib import os import numpy as np import tensorflow as tf import logging tf.get_logger().setLevel(logging.ERROR) from client import Client from server import Server from model import ServerModel from baseline_constants import MAIN_PARAMS, MODEL_PARAMS from fedbayes_helper import * from fedbaye...
1.992188
2
src/filenames_server.py
jonlwowski012/DropboxROS
0
51028
<gh_stars>0 #!/usr/bin/env python from dropboxros.srv import * from dropboxros.msg import username, filenames import rospy import os def handle_checkfiles(req): filenames_cli = filenames() all_filenames = [f for f in os.listdir('.') if os.path.isfile(f)] client_files = [] filetimes=[] for filename in all_filename...
2.4375
2
sol/sol_array_count9.py
igamberdievhasan/codingbat-notebooks
0
51029
def array_count9(nums): count = 0 # Standard loop to look at each value for num in nums: if num == 9: count = count + 1 return count
3.78125
4
granule_ingester/granule_ingester/writers/DataStore.py
kevinmarlis/incubator-sdap-ingester
0
51030
<reponame>kevinmarlis/incubator-sdap-ingester from abc import ABC, abstractmethod from nexusproto import DataTile_pb2 as nexusproto from granule_ingester.healthcheck import HealthCheck class DataStore(HealthCheck, ABC): @abstractmethod def save_data(self, nexus_tile: nexusproto.NexusTile) -> None: ...
2.046875
2
building_footprint_segmentation/seg/base_criterion.py
santhi-2020/building-footprint-segmentation
28
51031
from abc import abstractmethod class BaseCriterion: def __init__(self, **kwargs): pass def __call__(self, ground_truth, predictions): return self.compute_criterion(ground_truth, predictions) @abstractmethod def compute_criterion(self, ground_truth, predictions): r...
2.875
3
run.py
malags/java-misconceptions-pmd
0
51032
#!/usr/bin/env python3 from pathlib import Path import sys import subprocess import re import argparse import os #Path of file dir_path = os.path.dirname(os.path.realpath(__file__)) #TODO: insert correct org name org='YOUR_ORG_NAME_HERE' pmd_pos = dir_path + '/pmd-bin-6.14.0/bin' pos_yaclu = dir_path+ '/yaclu' root...
2.453125
2
leetcode-algorithms/747. Largest Number At Least Twice of Others/747.largest-number-at-least-twice-of-others.py
cnyy7/LeetCode_EY
0
51033
# # @lc app=leetcode id=747 lang=python3 # # [747] Largest Number At Least Twice of Others # # https://leetcode.com/problems/largest-number-at-least-twice-of-others/description/ # # algorithms # Easy (40.25%) # Total Accepted: 47.6K # Total Submissions: 118K # Testcase Example: '[0,0,0,1]' # # In a giv...
3.703125
4
guess/guess/guess_site/apps.py
PeteCoward/teach-python
1
51034
<reponame>PeteCoward/teach-python from django.apps import AppConfig class GuessSiteConfig(AppConfig): name = 'guess_site'
1.609375
2
libs/linearmodel.py
kuod/pygcta
1
51035
<gh_stars>1-10 import numpy as np import numpy.linalg as la import pdb class pygcta(object): """ class for pygcta """ def __init__(self, Y = None, K = None, X = None): """ Constructor Y: Phenotype OBJECT K: LIST of kernels TODO: add covariates later ...
2.34375
2
Capitulo 1/78 - utf.py
mmmacedo/python
0
51036
# -*- coding: utf-8 -*- # A primeira linha informa ao interpretador Python que é utilizado a codifição UTF-8 # Dessa forma é possível utilizar caracteres especiais em comentários e no PRINT print("Codificação UTF-8: ç ã é í")
3.34375
3
pyverilog/test_rectify_p_in_collision.py
ifsheldon/billiard_game
0
51037
import numpy as np import pyverilator import os from . import to_float, to_fix_point_int import taichi as ti from .all_python_functions import calc_next_pos_and_velocity, rectify_positions_and_velocities, \ rectify_positions_in_collision, calc_after_collision_velocity, two_ball_collides, normalize_vector def rect...
2.640625
3
features/start_app.py
Navdit/automate_coc
0
51038
# Import modules from time import sleep from features.helpers.appium_helpers import app_driver, compare_screenshots from features.helpers.common_helpers import get_config_and_set_logging, get_file_abs_path # Read Config file and set logging CONFIG, LOGGER = get_config_and_set_logging("config.yaml", "app_logs.log", "IN...
2.21875
2
queryFunctions.py
bevvvvv/DS220Proj2WineReview
0
51039
# pip install neo4j-driver # https://neo4j.com/docs/api/python-driver/current/ from neo4j.v1 import GraphDatabase, basic_auth def pickwine(variety, country, region, winery, price, score, params): prices = price.split(" to ") lower = int(prices[0]) upper = int(prices[1]) scores = score.split(" to ") lowScore...
3.046875
3
psdaq/psdaq/seq/finite.py
slactjohnson/lcls2
0
51040
from psdaq.seq.seq import * sync_marker = 6 instrset = [] # Insert global sync instruction (1Hz?) instrset.append(FixedRateSync(marker=sync_marker,occ=1)) for i in range(4): sh = i*4 b0 = len(instrset) instrset.append(ControlRequest(0xf<<sh)) instrset.append(FixedRateSync(marker=0,occ=i+1)) ...
1.898438
2
crawler-demo/GPA.py
colddew/mix-python
1
51041
# -*- coding: utf-8 -*- import urllib import urllib2 import cookielib import re import string # 绩点运算 class SDU: # 类的初始化 def __init__(self): # 登录URL self.loginUrl = 'http://jwxt.sdu.edu.cn:7890/pls/wwwbks/bks_login2.login' # 成绩URL self.gradeUrl = 'http://jwxt.sdu.edu.cn:7890/pl...
3.015625
3
parse_bert_embedding_json.py
QiS9596/bert
0
51042
<filename>parse_bert_embedding_json.py<gh_stars>0 import json import numpy as np def parse_bert_embedding_json(json_path, mode='concat4'): with open(json_path) as file: sentences = [] for line in file.readlines(): line_dict = json.loads(line) features = line_dict['features'] ...
2.765625
3
resources/constants.py
kuntzer/SALSA-public
1
51043
<reponame>kuntzer/SALSA-public # Speed of light in m/s speed_light = 299792458 # J s Planck_constant = 6.626e-34 # m Wavelenght of band V wavelenght_visual = 550e-9 # flux density (Jy) in V for a 0 mag star Fv = 3640.0 # photons s-1 m-2 in Jy Jy = 1.51e7 #1 rad = 57.3 grad RAD = 57.29578 # 1 AU ib cn AU = 149.597...
2.015625
2
tests/base.py
ddc67cd/lunasdk
8
51044
import unittest from operator import attrgetter from typing import Dict import numpy as np from PIL import Image from _pytest._code import ExceptionInfo from lunavl.sdk.errors.errors import ErrorInfo from lunavl.sdk.faceengine.engine import VLFaceEngine from lunavl.sdk.image_utils.geometry import Rect from lunavl.sdk...
2.40625
2
gen_capture_testcases.py
emilydolson/eco-ea-mancala
0
51045
<reponame>emilydolson/eco-ea-mancala<gh_stars>0 import random import numpy as np for _ in range(500): board = [0]*14 endcell = random.randint(1, 6) opposite = abs(7-(endcell%7))+7 board[endcell] = 0 correct = random.randint(1, 6) while correct == endcell: correct = random.randint(1, 6) ...
3.375
3
data_management/web_scraping.py
Matrixeigs/energy_management_system
68
51046
<gh_stars>10-100 # The web scraping function from EMA to obtain the prices import requests import bs4 import time from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, FLOAT, INTEGER,create_engine from sqlalchemy.orm import sessionmaker from apscheduler.schedulers.blocking import Blocki...
2.75
3
avam/lr/lr1.py
vickykatoch/bk-deep-learn
0
51047
<gh_stars>0 from avam.utils.data_utils import load_dataset import numpy as np train_set_x_orig, train_set_y_orig, test_set_x_orig, test_set_y_orig, classes = load_dataset() print(train_set_x_orig)
1.601563
2
src/towncrier/test/test_create.py
daobook/towncrier
0
51048
# Copyright (c) <NAME>, 2015 # See LICENSE for details. import os from textwrap import dedent from twisted.trial.unittest import TestCase import mock from click.testing import CliRunner from ..create import _main def setup_simple_project(config=None, mkdir=True): if not config: config = dedent( ...
2.171875
2
testes/teste_grid_borda.py
ClasRCDM/MyGames---OnlyInProgramming
0
51049
from pygame import init, display, time, event, draw, QUIT from numpy import arange def grid(janela, comprimento, tamanho_linha, tamanho_quadrado): def draw_grid(v): draw.line(janela, (255, 255, 255), (v * tamanho_quadrado, 0), (v * tamanho_quadrado, comprimento)) ...
3.109375
3
gitarootools/audio/imccontainer.py
boringhexi/gitarootools
2
51050
# -*- coding: utf-8 -*- # Copyright (c) 2019, 2020 boringhexi """imccontainer.py - read/write IMC audio container files An IMC audio container file is a file type from Gitaroo Man that has the extension .IMC and contains audio subsongs.""" import struct from itertools import count, zip_longest from gitarootools.au...
2.59375
3
app/core/migrations/0026_boec_unreadactivitycount.py
VMatyagin/recipe-rest
0
51051
# Generated by Django 3.1.13 on 2021-07-16 09:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("core", "0025_activity_warning"), ] operations = [ migrations.AddField( model_name="boec", name="unreadActivityCount...
1.53125
2
Gathered CTF writeups/ctf-7867/2020/pbctf/gcombo/solve.py
mihaid-b/CyberSakura
1
51052
import requests import parsel import re def parse(html): ''' Parse form data including the entry ID, page history, and some token thingies ''' sel = parsel.Selector(html) inputs = sel.css('input[type=hidden]') entry_re = re.compile(r'entry\.(.*)_') entry = int(entry_re.search(inputs[0...
3.046875
3
handmouse.py
nuggetcatsoftware/Alpha-Mouse
0
51053
from operator import truediv import cv2 from time import sleep import HandTrackingModule as htm import os import autopy import numpy as np import math import mediapipe as mp #import modules #variables frameR=20 #frame rduction frameR_x=800 frameR_y=110 wCam,hCam=1300 ,400 pTime=0 smoothening = 5 #need to tune plocX, p...
2.390625
2
plans/migrations/0005_recurring_payments.py
feedgurus/django-plans
240
51054
<gh_stars>100-1000 # Generated by Django 3.0.5 on 2020-04-15 07:32 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('plans', '0004_create_user_plans'), ] operations = [ migrations.AddField( mod...
1.65625
2
labelbox/data/serialization/coco/categories.py
Cyniikal/labelbox-python
0
51055
<gh_stars>0 import sys from pydantic import BaseModel class Categories(BaseModel): id: int name: str supercategory: str isthing: int = 1 def hash_category_name(name: str) -> int: return hash(name) + sys.maxsize
2.625
3
heatlib/models.py
ondrolexa/heat
2
51056
from abc import ABC, abstractmethod import numpy as np import matplotlib.pyplot as plt from heatlib.units import Time from heatlib.boundary_conditions import Boundary_Condition from heatlib.domains import Domain_Constant_1D, Domain_Variable_1D from heatlib.solvers import Solver_1D ####################################...
2.96875
3
conkit/io/rosetta_npz.py
FilomenoSanchez/conk
12
51057
# BSD 3-Clause License # # Copyright (c) 2016-21, University of Liverpool # 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 copyright notic...
1.351563
1
qtop.py
tinaba96/fn2q
0
51058
<reponame>tinaba96/fn2q<gh_stars>0 import torch.nn as nn import numpy class qtop(): # quantization operators def __init__(self, model, bw): self.lev = pow(2., int(bw) - 1) #quantization levels #self.max = (self.lev - 1.) / self.lev #maximum number #self.max = (self.lev - 1.) / ...
1.914063
2
22_Generate Parentheses.py
jasoriya/leetcode
0
51059
# -*- coding: utf-8 -*- """ Created on Wed May 15 13:26:06 2019 @author: Shreyans """ """ Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ "((()))", "(()())", "(())()", "()(())", "()()()"...
3.890625
4
common/analyzer.py
kinpa200296/MM_labs
0
51060
<filename>common/analyzer.py from utils import check_instance from rand import BaseRandom from matplotlib import pyplot as plt class RandomAnalyzer(object): def __init__(self, rand): check_instance(rand, BaseRandom, 'rand should be an instance of BaseRandom') self._rand = rand @property ...
2.578125
3
ranking/bayesian_sets.py
kienpt/site_discovery_public
4
51061
from math import sqrt from numpy import * import numpy as np import sys from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.decomposition import NMF from sklearn.decomposition import PCA from sklearn.decomposition import TruncatedSVD from ...
2.78125
3
dfpipeline/tests/test_impute.py
IBM/dataframe-pipeline
2
51062
############################################################################## # Copyright 2020 IBM Corp. 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 # # htt...
2.453125
2
py/orbit/injection/__init__.py
LeoRya/py-orbit
17
51063
## \namespace orbit::injection ## \brief These classes are for turn by turn injection of particles. ## ## Classes: ## - InjectParts - Class. Does the turn by turn injection ## - Joho - Class for generating JOHO style particle distributions ## - addTeapotInjectionNode - Adds an injection node to a teapot lattic...
2.46875
2
python3/veinmind/docker.py
honsunrise/libveinmind
0
51064
<reponame>honsunrise/libveinmind from . import binding as binding from . import runtime as runtime from . import filesystem as filesystem from . import image as image import ctypes as C class Docker(runtime.Runtime): "Docker refers to a parsed docker application object." # Initialize the docker object, assuming it ...
2.484375
2
digsby/src/gui/visuallisteditor.py
ifwe/digsby
35
51065
import wx from gui.textutil import CopyFont, default_font #from gui.toolbox import prnt from wx import EXPAND,ALL,TOP,VERTICAL,ALIGN_CENTER_HORIZONTAL,ALIGN_CENTER_VERTICAL,LI_HORIZONTAL ALIGN_CENTER = ALIGN_CENTER_HORIZONTAL|ALIGN_CENTER_VERTICAL TOPLESS = ALL & ~TOP bgcolors = [ wx.Color(238, 238, 238), wx...
2.40625
2
zephyr/zmake/zmake/modules.py
sjg20/ec
0
51066
<filename>zephyr/zmake/zmake/modules.py<gh_stars>0 # Copyright 2020 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Registry of known Zephyr modules.""" import pathlib import os import zmake.build_config as build_co...
2
2
mundo3/ex081.py
Igor3550/Exercicios-de-python
0
51067
<reponame>Igor3550/Exercicios-de-python # faça um programa que leia varios valores e coloque em uma lista depois disso mostre # quantos numeros foram digitados # a lista de valores ordenada de forma decrescente # se o valor 5 foi digitado e esta ou não na lista from time import sleep valores = [] while True: n = i...
4
4
code/constants.py
remicres/sr4rs
43
51068
factors = [1, 2, 4] pads = [32, 64, 128, 256, 512] gen_scope = "gen" dis_scope = "dis" outputs_prefix = "output_" lr_key = "lr" hr_key = "hr" lr_input_name = "lr_input" hr_input_name = "hr_input" pretrain_key = "pretrain" train_key = "train" epoch_key = "per_epoch"
1.367188
1
autoBOTLib/features/features_topic.py
EMBEDDIA/autoBOT
1
51069
<gh_stars>1-10 import logging from collections import defaultdict logging.basicConfig(format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S') logging.getLogger().setLevel(logging.INFO) import pandas as pd import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer from s...
2.375
2
Air_Ng/__init__.py
aunghtet008900/Air-Ng
1
51070
from .airminum_ng import *
1.179688
1
api_postgres/urls.py
DCMidwood/dap-backend
0
51071
from django.db import router from django.urls import path, include from .router import router from . import views urlpatterns = [ path('', include(router.urls)) ]
1.632813
2
common/db/chat.py
whyh/FavourDemo
1
51072
<gh_stars>1-10 from .orm import * __all__ = ("Chat", "LockedChat") class Chat(Kind): invite = StringField() occupied = BooleanField(index=True, default=False) class LockedChat(Chat): _kind = "chat" _p_lock = True
2.53125
3
stage/test_mapreduce_executor.py
Sentienz/datacollector-tests
1
51073
<filename>stage/test_mapreduce_executor.py # Copyright 2018 StreamSets Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
2.421875
2
petstagram_2/petstagram_2/pets/models.py
BoyanPeychinov/python_web_basics
1
51074
<reponame>BoyanPeychinov/python_web_basics<gh_stars>1-10 from django.db import models class Pet(models.Model): CAT_CHOICE = 'cat' DOG_CHOICE = 'dog' PARROT_CHOICE = 'parrot' POSSIBLE_CHOICES = [ ('cat', CAT_CHOICE), ('dog', DOG_CHOICE), ('parrot', PARROT_CHOICE), ] typ...
2.671875
3
lucent/optvis/param/lowres.py
TomFrederik/lucent
2
51075
# Copyright 2020 The Lucent 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 applicable ...
2.484375
2
dns_messages/dns_objects/dns_message_parser.py
wahlflo/dns-messages
0
51076
<gh_stars>0 from dns_messages.dns_objects import * from ..dns_objects.dns_message import DnsMessage, OPCODE, RCODE from ..utilities import convert_bytes_to_bit_list, extract_int_from_raw_bits, parse_name RR_TYPE_TO_CLASS_MAPPING = { RRType.A: A, RRType.NS: None, RRType.CNAME: CNAME, RRType.SOA: SOA, ...
1.9375
2
terrascript/resource/terraform_provider_graylog/graylog.py
mjuenema/python-terrascript
507
51077
# terrascript/resource/terraform-provider-graylog/graylog.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:17:31 UTC) import terrascript class graylog_alarm_callback(terrascript.Resource): pass class graylog_alert_condition(terrascript.Resource): pass class graylog_dashboard(terrascript.R...
1.703125
2
video.py
ThssSE/Intelligent-monitoring-platform
1
51078
#!/usr/bin/env python from flask import ( render_template, Response, Blueprint, request, session, current_app ) import time from .camera import Camera from .auth import login_required from .db import get_db_by_config,get_db from . import history_records from . import intruding_records bp = Blueprint('video', __nam...
2.40625
2
977_square_sorted_array.py
ojhaanshu87/LeetCode
0
51079
<reponame>ojhaanshu87/LeetCode<filename>977_square_sorted_array.py """ Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: Input: nums = [-4,-1,0,3,10] Output: [0,1,9,16,100] Explanation: After squaring, the array beco...
4
4
awswrangler/redshift.py
asafepy/aws-data-wrangler
0
51080
from typing import TYPE_CHECKING, Dict, List, Union, Optional, Any, Tuple import json from logging import getLogger, Logger import pg8000 # type: ignore import pyarrow as pa # type: ignore from boto3 import client # type: ignore from awswrangler import data_types from awswrangler.exceptions import (RedshiftLoadErr...
2.40625
2
RFIDIOt-master/hitag2brute.py
kaosbeat/datakamp
0
51081
#!/usr/bin/python # hitag2brute.py - Brute Force hitag2 password # # <NAME> <<EMAIL>> # http://rfidiot.org/ # # This code is copyright (c) <NAME>, 2008, All rights reserved. # For non-commercial use only, the following terms apply - for all other # uses, please contact the author: # # This code is free sof...
2.734375
3
Python/13. Regex and Parsing/16. Validating Postal Codes/Solution.py
AdityaSingh17/HackerRank-Solutions
0
51082
<filename>Python/13. Regex and Parsing/16. Validating Postal Codes/Solution.py # Validating Postal Codes # Problem Link: https://www.hackerrank.com/challenges/validating-postalcode/problem import re regex_integer_in_range = r"^[1-9]\d{5}$" # Do not delete 'r'. regex_alternating_repetitive_digit_pair = r"(?=(.).\1)" ...
3.890625
4
fares_validator/warnings.py
TransitApp/gtfs-fares-v2-validator
3
51083
<filename>fares_validator/warnings.py # generic warnings UNEXPECTED_FIELDS = 'A GTFS fares-v2 file has column name(s) not defined in the specification.' UNUSED_AREA_IDS = 'Areas defined in areas.txt are unused in other fares files.' UNUSED_NETWORK_IDS = 'Networks defined in routes.txt are unused in other fares files.' ...
1.671875
2
debian_watcher/storage.py
westwardharbor0/debian-watcher
0
51084
<reponame>westwardharbor0/debian-watcher from os import listdir, mkdir, remove from os.path import exists from logging import info from .cached import Cached class Storage(Cached): def __init__(self, storage_dir=None, cache=True, max_history=20): if not storage_dir: raise Exception("Need to ...
2.421875
2
atools/utilities.py
andrewtarzia/atools
0
51085
#!/usr/bin/env python # -*- coding: utf-8 -*- # Distributed under the terms of the MIT License. """ Utilities. Author: <NAME> Date Created: 29 May 2020 """ from rdkit.Chem import AllChem as rdkit def update_from_rdkit_conf(stk_mol, rdk_mol, conf_id): """ Update the structure to match `conf_id` of `mol`. ...
2.1875
2
src/pattern.py
Goader/embroidery
2
51086
from cv2 import cv2 from collections import Counter from PIL import Image, ImageDraw, ImageFont from scipy.fftpack import dct from sklearn.cluster import KMeans import matplotlib.pyplot as plt import gmpy2 import numpy as np import time import os """ Transparency If putting the pixel with RGBA = (Ra, Ga, Ba, Aa) over...
2.53125
3
prla/assignments/a1/birthdays.py
AegirAexx/python-sandbox
0
51087
<gh_stars>0 from collections import Counter def birthdays(string): st = string.split() dic = Counter(x[0:4] for x in st) return [tuple([k for k in st if k.startswith(x)]) for x in [x for x in dic if dic[x] > 1]]
3.0625
3
tools/where.py
china-x-orion/infoeye
1
51088
<gh_stars>1-10 #!/usr/bin/python """ Author: rockylinux E-Mail: <EMAIL> """ import commands #display the software #return a list containning installed software class whereissoftware: def __init__(self): self.__name = 'whereissoftware' def getData(self): (status, output) = commands.getstatus...
2.65625
3
curso_bioinfo/bio01.py
FellowsDevel/learning_python
0
51089
###################### # análise de sequencia from Bio.Seq import Seq seq1 = Seq("ATG") print('Sequencia :', seq1) # sequencia complementar seq1_comp = seq1.complement() print('Sequencia complementar :', seq1_comp) # sequencia complementar reversa seq1_comp_reversa = seq1.reverse_comp...
3.34375
3
test/speedTests/setup.py
henrystoldt/MAPLEAF
15
51090
<filename>test/speedTests/setup.py<gh_stars>10-100 import numpy from setuptools import setup from Cython.Build import cythonize setup(ext_modules=cythonize("addScalarCython.pyx"), include_dirs=[numpy.get_include()])
1.148438
1
models.py
ShahkarHassan/DotaDatabase
0
51091
# This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Make sure each ForeignKey has `on_delete` set to the desired behavior. # * Remove `managed = False` lines if ...
2.0625
2
mw4/test/test_units/environment/test_skymeter.py
Raddock/MountWizzard4
0
51092
############################################################ # -*- coding: utf-8 -*- # # # # # # # # # ## ## # ## # # # # # # # # # # # # # # # ## # ## ## ###### # # # # # # # # # Python-based Tool for interaction with the 10micron mounts # GUI with PyQT5 fo...
1.992188
2
test/test_get_info_edit_page.py
smagdenko/addressbook
0
51093
def test_contacts_on_home_page(app): contact_from_home_page = app.contact.get_contacts_list()[1] contact_from_edit_page = app.contact.get_info_from_edit_page(1) assert contact_from_edit_page.email_1 == contact_from_home_page.email_1 assert contact_from_edit_page.email_2 == contact_from_home_page.emai...
2.28125
2
tron/core/jobrun.py
dnephin/Tron
0
51094
<gh_stars>0 """ Classes to manage job runs. """ from collections import deque import logging import itertools from tron import node, command_context, event from tron.core.actionrun import ActionRun, ActionRunFactory from tron.serialize import filehandler from tron.utils import timeutils, proxy from tron.utils.observe...
2.34375
2
tests/integration/test_scheme.py
firefly-cpp/simframe
0
51095
# Tests for Scheme class import pytest from simframe.integration import Scheme def test_scheme_repr_str(): def f(): pass s = Scheme(f) assert isinstance(repr(s), str) assert isinstance(str(s), str) def test_scheme_attributes(): def f(): pass with pytest.raises(TypeError): ...
2.1875
2
qtoolkit/data_structures/gloa/quantum_circuit_group.py
nelimee/qtoolkit
3
51096
# ====================================================================== # Copyright CERFACS (October 2018) # Contributor: <NAME> (<EMAIL>) # # This software is governed by the CeCILL-B license under French law and # abiding by the rules of distribution of free software. You can use, # modify and/or redistribute ...
1.539063
2
epde/operators/equation_selections.py
vnleonenko/EPDE
15
51097
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 4 13:49:36 2021 @author: mike_ubuntu """ import numpy as np from epde.operators.template import Compound_Operator class Tournament_selection(Compound_Operator): """ Basic tournament selection, inherits properties from class ``Compound_Ope...
3.140625
3
tests/test_scipy.py
glotzerlab/fsph
3
51098
<gh_stars>1-10 import unittest import hypothesis as hp, hypothesis.strategies as hps import numpy as np import scipy as sp, scipy.special import fsph def Ylm_scipy(phis, thetas, lmax): result = [] for l in range(lmax + 1): for m in range(l + 1): result.append(sp.special.sph_harm(m, l, thet...
2.34375
2
01.10minutes_to_pandas/time_series.py
predora005/pandas-practice
0
51099
<filename>01.10minutes_to_pandas/time_series.py # coding: utf-8 import numpy as np import pandas as pd ################################################## # メイン ################################################## if __name__ == '__main__': print("----------------------------------------------------------------...
3.203125
3