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
Python/ldap/neo2open.py
ebouaziz/miscripts
0
29800
#!/usr/bin/env python # Create/update LDAP entries from custom directory to opendirectory schema import binascii import os import re import sys cmtcre = re.compile(r'#.*$') try: filename = sys.argv[1] except IndexError: filename = os.path.join(os.path.expanduser('~'), 'Desktop', 'openldap.ldif') def get_us...
2.40625
2
pyble/const/characteristic/time_with_dst.py
bgromov/PyBLEWrapper
14
29801
NAME="Time with DST" UUID=0x2A11
1.148438
1
Practice Problem Solutions/5 - Lists/program.py
argosopentech/practical-programming-in-python
1
29802
print('Grocery list:') print('"add" to add items and "view" to view list') grocery_list = [] while True: command = input('Enter command: ') if command == 'add': to_add = input('Enter new item: ') grocery_list.append(to_add) # elif stands for "else if" elif command == 'view': for ...
4.125
4
notes.py
ahmed-mo2nis/Aida-VA
0
29803
from datetime import datetime from tts import tts def take_notes(speech_text): words_of_message = speech_text.split() words_of_message.remove("note") cleaned_message = ' '.join(words_of_message) f = open("notes.txt", "a+") f.write("'" + cleaned_message + "'" + " - note taken at: " + datetime.strfti...
3.703125
4
entity_embed/evaluation.py
TheAngryGoldfish/entity-embed
89
29804
<gh_stars>10-100 import csv import json def pair_entity_ratio(found_pair_set_len, entity_count): return found_pair_set_len / entity_count def precision_and_recall(found_pair_set, pos_pair_set, neg_pair_set=None): # if a neg_pair_set is provided, # consider the "universe" to be only the what's inside pos...
2.8125
3
src/replication.py
RipcordSoftware/avancedb-replication-monitor
8
29805
<filename>src/replication.py from enum import Enum from urllib.parse import urlparse from src.couchdb import CouchDB class Replication: _RETRY_LIMIT = 3 class ReplType(Enum): All = 1 Docs = 2 Designs = 3 def __init__(self, model, source, target, continuous=False, create=False, d...
2.578125
3
networks/isomera.py
andrewcpotter/holopy
1
29806
#!/usr/bin/env python # coding: utf-8 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Jan 5 2021 @author: <NAME> based on the Iso-MPS codes """ #%% -- IMPORTS -- import sys sys.path.append("..") # import one subdirectory up in files # external packages import numpy as np import qiskit as qk import netwo...
1.976563
2
custom_components/docker_monitor/switch.py
aneisch/home-assistant
18
29807
<reponame>aneisch/home-assistant ''' Docker Monitor component For more details about this component, please refer to the documentation at https://github.com/aneisch/docker_monitor ''' import logging from homeassistant.components.switch import ( ENTITY_ID_FORMAT, PLATFORM_SCHEMA, SwitchDevice ) from homeas...
2.171875
2
packages/simcore-sdk/tests/unit/test_node_ports_v2_port.py
Surfict/osparc-simcore
0
29808
<reponame>Surfict/osparc-simcore # pylint:disable=unused-variable # pylint:disable=unused-argument # pylint:disable=redefined-outer-name # pylint:disable=no-member # pylint:disable=protected-access # pylint:disable=too-many-arguments import re import shutil import tempfile import threading from collections import nam...
2.0625
2
utilities_common/platform_sfputil_helper.py
deran1980/sonic-utilities
0
29809
import sys import click from sonic_py_common import multi_asic, device_info platform_sfputil = None def load_platform_sfputil(): global platform_sfputil try: import sonic_platform_base.sonic_sfp.sfputilhelper platform_sfputil = sonic_platform_base.sonic_sfp.sfputilhelper.SfpUtilHelper() ...
2.453125
2
structures/tree/__init__.py
spencerpomme/pyalgolib
0
29810
# data structure module
0.996094
1
geco/mips/loading/miplib.py
FreestyleBuild/GeCO
8
29811
import tempfile from urllib.request import urlretrieve, urlopen from urllib.error import URLError import pyscipopt as scip import os import pandas as pd class Loader: def __init__(self, persistent_directory=None): """ Initializes the MIPLIB loader object Parameters ---------- ...
2.765625
3
plugin.py
uwsbel/blenderPlugin
3
29812
<reponame>uwsbel/blenderPlugin<filename>plugin.py /******************************************************* * Copyright (C) 2013-2014 <NAME> <<EMAIL>>, Simulation Based Engineering Lab <sbel.wisc.edu> * Some rights reserved. See LICENSE * Use of this source code is governed by a BSD-style license that can be * found in...
1.734375
2
datasets.py
perwin/s4g_barsizes
2
29813
<gh_stars>1-10 # Python code for assembling S$G-based local bar-size and fraction dataset # # ListDataFrame with # name, M_star, B-V_tc, g-r_tc, a_max_obs[arcsec, kpc], amax_dp[arcsec, kpc], distance, # distance_source, inclination # distance_source = direct (Cepheids, SBF, TRGB, etc), T-F, redshift # # Two se...
1.976563
2
Oled.py
Ths2-9Y-LqJt6/cattmate
1
29814
#!/usr/bin/python import Adafruit_SSD1306 import os from retrying import retry from PIL import Image, ImageDraw, ImageFont class Oled: def __init__(self, display_bus, font_size): # declare member variables self.draw = None self.font = None self.disp = None self.width = Non...
2.828125
3
ArtGAN/data/ingest_stl10.py
rh01/caffe-model-for-category-artgan
304
29815
from configargparse import ArgParser from PIL import Image import logging import numpy as np import os def transform_and_save(img_arr, output_filename): """ Takes an image and optionally transforms it and then writes it out to output_filename """ img = Image.fromarray(img_arr) img.save(output_file...
2.90625
3
working_example/python/hello_serverless/lambda/create.py
darko-mesaros/workshop-serverless-with-cdk
33
29816
import os import json import boto3 def handler(event, context): table = os.environ.get('table') dynamodb = boto3.client('dynamodb') item = { "name":{'S':event["queryStringParameters"]["name"]}, "location":{'S':event["queryStringParameters"]["location"]}, "age":{'S':even...
2.296875
2
pypeit/spectrographs/gemini_flamingos.py
ykwang1/PypeIt
0
29817
""" Module for Gemini FLAMINGOS. .. include:: ../include/links.rst """ import os from pkg_resources import resource_filename from IPython import embed import numpy as np from pypeit import msgs from pypeit import telescopes from pypeit.core import framematch from pypeit.images import detector_container from pypeit....
2.28125
2
tests/test_scene.py
Lxinyuelxy/multi-label-learn
4
29818
<reponame>Lxinyuelxy/multi-label-learn import numpy as np from mllearn.problem_transform import BinaryRelevance from mllearn.problem_transform import CalibratedLabelRanking from mllearn.problem_transform import ClassifierChain from mllearn.problem_transform import RandomKLabelsets from mllearn.alg_adapt import MLKNN fr...
2.921875
3
scripts/Steamwatcher.py
nicovanbentum/Utility-Scripts
0
29819
<reponame>nicovanbentum/Utility-Scripts<filename>scripts/Steamwatcher.py<gh_stars>0 """ This Python modules describes an application that checks for active steam downloads and shuts down the computer when they are all finished. """ import os import signal import threading import subprocess import winreg as reg import ...
2.65625
3
mywebsite.py
jzorrof/my_website
0
29820
<reponame>jzorrof/my_website<filename>mywebsite.py<gh_stars>0 # -*- coding: utf-8 -*- __author__ = 'Fanzhong' from flask import Flask, render_template from boto.s3.connection import S3Connection from boto.s3.key import Key import json app = Flask(__name__) ''' This is my website index I'll create my website from now ...
2.421875
2
tests/neptune/new/internal/backends/test_neptune_backend_mock.py
neptune-ml/neptune-client
13
29821
<reponame>neptune-ml/neptune-client # # Copyright (c) 2020, Neptune Labs Sp. z o.o. # # 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 # # Unle...
1.835938
2
rasp/device/regressor_device.py
CreeperLin/RASP
1
29822
from ..utils.reporter import report class RegressorDevice(): tape = [] regressor = None @staticmethod def init(regressor): RegressorDevice.tape = [] RegressorDevice.regressor = regressor @staticmethod def reset(): RegressorDevice.tape = [] @staticmethod def a...
2.34375
2
cctbx_website/run_tests.py
dwpaley/cctbx_project
0
29823
<reponame>dwpaley/cctbx_project from __future__ import absolute_import, division, print_function from libtbx import test_utils import libtbx.load_env #tst_list = [ # "$D/regression/tst_py_from_html.py" # ] tst_list = [ "$D/regression/tst_1_template.py", "$D/regression/tst_2_doc_high_level_objects.py", "$D/reg...
1.625
2
python/tlbm/wavy_channel/wavy_channel_generator.py
stu314159/HPC_Introduction_with_LBM
0
29824
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 7 08:53:18 2021 @author: sblair """ import numpy as np import scipy.integrate as integrate from scipy.optimize import fsolve import matplotlib.pyplot as plt L_hx = 30; # cm, length of the heat exchanger nX = 100; # number of points i...
2.59375
3
tests/client/test_decoders.py
timgates42/apistar
4,284
29825
import os from starlette.applications import Starlette from starlette.responses import PlainTextResponse, Response from starlette.testclient import TestClient from apistar.client import Client, decoders app = Starlette() @app.route("/text-response/") def text_response(request): return PlainTextResponse("hello,...
2.46875
2
Src/check_linguistic_info.py
rstodden/ATILF-LLF.v3
0
29826
import os, json from collections import Counter # test if exist and mkdir # ../Results/features/corpus_info/ # ../Results/labels for col in ["FEATS", "PARSEME:MWE", "UPOS", "XPOS", "DEPREL", "DEPS", "LEMMA"]: for file_type in ["train.cupt", "dev.cupt", "test.blind.cupt"]: counter_dict = dict() count_all = Counte...
2.578125
3
rex/eutil.py
dnanto/rex
0
29827
#!/usr/bin/env python3 import sys from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter, FileType from Bio import Entrez from rex.util import batchify def parse_args(argv): parser = ArgumentParser(description="eutil", formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument( "eutil", def...
2.859375
3
src/relevancy_measures/calc_NCDG.py
dannycho7/RTP_Latest
0
29828
<filename>src/relevancy_measures/calc_NCDG.py<gh_stars>0 #!/usr/bin/python3 import sys import argparse import math parser = argparse.ArgumentParser(description='Post-processing after labeling, please put your rating in a file with ' 'the same order as in docs.txt, one rati...
2.71875
3
opytimark/core/benchmark.py
gugarosa/opytimark
3
29829
<gh_stars>1-10 """Benchmark-based class. """ import opytimark.utils.exception as e class Benchmark: """A Benchmark class is the root of any benchmarking function. It is composed by several properties that defines the traits of a function, as well as a non-implemented __call__ method. """ def _...
3.0625
3
tronx/helpers/decorators.py
beastzx18/Tron
8
29830
<filename>tronx/helpers/decorators.py<gh_stars>1-10 from pyrogram.types import CallbackQuery from .variables import USER_ID from pyrogram.errors import MessageNotModified def alert_user(func): async def wrapper(_, cb: CallbackQuery): if cb.from_user and not cb.from_user.id in USER_ID: await cb.answer( f...
2.28125
2
cachetclient/v1/__init__.py
amdemas/cachet-client
0
29831
<reponame>amdemas/cachet-client<filename>cachetclient/v1/__init__.py from cachetclient.v1.client import Client # noqa from cachetclient.v1.subscribers import Subscriber # noqa from cachetclient.v1.components import Component # noqa from cachetclient.v1.component_groups import ComponentGroup # noqa from cachetclien...
1.117188
1
documentation/admin.py
establishment/django-establishment
1
29832
from django.contrib import admin from establishment.documentation.models import DocumentationEntry admin.site.register(DocumentationEntry)
1.203125
1
libs/parsers/__init__.py
pullself/Compilers
0
29833
<filename>libs/parsers/__init__.py import libs.parsers.parser import libs.parsers.constructor __all__ = ['parser', 'constructor']
1.4375
1
src/demo.py
FanShuixing/CenterNet
0
29834
<gh_stars>0 from __future__ import absolute_import from __future__ import division from __future__ import print_function import _init_paths import os import cv2 from opts import opts from detectors.detector_factory import detector_factory import pandas as pd import json image_ext = ['jpg', 'jpeg', 'png', 'webp'] vi...
2.125
2
example/app.py
jfwm2/gourde
6
29835
<filename>example/app.py #!/usr/bin/env python """Gourde example.""" import argparse import flask from gourde import Gourde # Optional API. try: import flask_restplus except ImportError: flask_restplus = None class Error(Exception): """All local errors.""" pass # This could be as simple as : # g...
2.75
3
precise/skatervaluation/battlecode/arrangingbattles.py
OVVO-Financial/precise
0
29836
from precise.skaters.covariance.allcovskaters import ALL_D0_SKATERS from precise.skaters.covarianceutil.likelihood import cov_skater_loglikelihood from uuid import uuid4 import os import json import pathlib from pprint import pprint import traceback from collections import Counter from momentum.functions import rvar fr...
2.234375
2
src/PCMF/Positive_CMF.py
N-YS-KK/PCMF
3
29837
<filename>src/PCMF/Positive_CMF.py<gh_stars>1-10 import numpy as np import tensorflow as tf class Positive_Collective_Matrix_Factorization: """ Our proposed model PCMF. Attributes ---------- X : numpy.ndarray Y : numpy.ndarray alpha : int Y weight of loss function. d_hidden ...
2.75
3
UniquePaths.py
pauloadaoag/leetcode
0
29838
<filename>UniquePaths.py class Solution: # @return an integer def uniquePaths(self, m, n): if ((m == 0) or (n == 0)): return 0 if (n > m): return self.uniquePaths(n, m) row = [1] * m for i in range(1, n): # print row r2 = [1] ...
3.359375
3
Spider/ScanningSpider/spiders/CVEDetails.py
halftion/discern
7
29839
<gh_stars>1-10 import re import scrapy import util from ScanningSpider.items import CVEItem from ScanningSpider.items import CVEDetailItem class CVEDetails(scrapy.Spider): name = "cve_detail" allowed_domains = ['cvedetails.com'] base_url = 'https://www.cvedetails.com/vulnerability-list/year-' baer_deta...
2.859375
3
dep/scm.py
harveyt/dep
0
29840
<reponame>harveyt/dep # # Source Code Management # ====================== # # %%LICENSE%% # import os import re from dep import opts from dep.helpers import * class Repository: def __init__(self, work_dir, url, vcs, name): self.work_dir = work_dir self.url = url self.vcs = vcs self....
2.40625
2
env/Lib/site-packages/promise/compat.py
nerdyator/graphene-django-cookbook
2
29841
try: from asyncio import Future, iscoroutine, ensure_future # type: ignore except ImportError: class Future: # type: ignore def __init__(self): raise Exception("You need asyncio for using Futures") def set_result(self): raise Exception("You need asyncio for using Fut...
2.59375
3
examples/run_flexible_building_optimal_operation.py
sonercandas/fledge
2
29842
<filename>examples/run_flexible_building_optimal_operation.py """Example script for setting up and solving a flexible building optimal operation problem.""" import matplotlib.pyplot as plt import numpy as np import pandas as pd import pyomo.environ as pyo import fledge.config import fledge.database_interface import f...
3.078125
3
Searching_and_Recursion_Model_project/07_csSearchRotatedSortedArray.py
sarahmarie1976/CSPT15_DS_ALGO_SEARCH_RECURSION_GP
0
29843
<filename>Searching_and_Recursion_Model_project/07_csSearchRotatedSortedArray.py """ For a given positive integer n determine if it can be represented as a sum of two Fibonacci numbers (possibly equal). Example For n = 1, the output should be fibonacciSimpleSum2(n) = true. Explanation: 1 = 0 + 1 = F0 + F1. For n = ...
4.21875
4
2020/day_09/day09.py
d02d33pak/Advent-Of-Code
0
29844
""" Advent of Code : Day 09 """ from os import path def parse_input(filename): """ Parse input file values """ script_dir = path.dirname(__file__) file_path = path.join(script_dir, filename) with open(file_path, "r") as file: val = list(map(int, file.read().splitlines())) return val d...
3.484375
3
companies/migrations/0003_auto_20210221_1537.py
Ins-V/wc_crm
0
29845
<filename>companies/migrations/0003_auto_20210221_1537.py<gh_stars>0 # Generated by Django 3.1.7 on 2021-02-21 13:37 import companies.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('companies', '0002_auto_20210221_1408'), ] operation...
1.828125
2
Problemset/longest-palindromic-substring/longest-palindromic-substring.py
KivenCkl/LeetCode
7
29846
# @Title: 最长回文子串 (Longest Palindromic Substring) # @Author: KivenC # @Date: 2019-06-12 15:25:33 # @Runtime: 136 ms # @Memory: 13.1 MB class Solution: def longestPalindrome(self, s: str) -> str: # # way 1 # # 从回文串的中心向两边扩展,O(n^2) # # 分奇数串和偶数串 # if len(s) < 2: # return s ...
3.546875
4
Tools/SystemDebug/python/tca.py
tomlenth/oneAPI-samples
1
29847
#!/usr/bin/env python3 ''' ============================================================== Copyright © 2019 Intel Corporation SPDX-License-Identifier: MIT ============================================================== ''' import intel.tca as tca target = tca.get_target(id="whl_u_cnp_lp") components = [(c.component,...
1.953125
2
src/tests/assembly/structured_config/assembled_config/test_assembled_config.py
fabio-d/fuchsia-stardock
5
29848
<gh_stars>1-10 # Copyright 2022 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import pathlib import subprocess import sys from run_assembly import run_product_assembly def main(): parser = argparse....
2.453125
2
vaas-app/src/vaas/manager/api.py
allegro/vaas
251
29849
<filename>vaas-app/src/vaas/manager/api.py # -*- coding: utf-8 -*- import logging from celery.result import AsyncResult from tastypie.resources import ModelResource, ALL_WITH_RELATIONS, Resource from tastypie import fields from tastypie.fields import ListField from tastypie.authentication import ApiKeyAuthentication,...
1.6875
2
Examples/StackImgExample.py
Mohak-CODING-HEAVEN/CVPRO
5
29850
from cvpro import stackImages import cv2 cap = cv2.VideoCapture(0) while True: success, img = cap.read() imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) imgList = [img, img, imgGray, img, imgGray] imgStacked = stackImages(imgList, 2, 0.5) cv2.imshow("stackedImg", imgStacked) cv2.w...
2.546875
3
tests/unit/test_models.py
Joel-Milligan/physics-tutor-assignment
0
29851
<reponame>Joel-Milligan/physics-tutor-assignment from datetime import datetime from app.models import Assessment, User def test_new_user(): new_user = User('usernam1', 'password', datetime(2020, 1, 1), True) assert new_user.username == 'usernam1' assert new_user.password != 'password' assert new_user....
3.171875
3
micro/config.py
lastseal/micro-config
0
29852
<gh_stars>0 # -*- coding: utf-8 -* from datetime import datetime from slack_sdk import WebClient from slack_sdk.errors import SlackApiError import dataset import logging import dotenv import signal import sys import os class SlackHandler(logging.Handler): def __init__(self, token, channel, username): su...
2.328125
2
tweetgen2.py
NISH1001/tweetypie
4
29853
<filename>tweetgen2.py #!/usr/bin/env python3 from collections import defaultdict import random import sys from preprocess import ( preprocess_sentence ) from data import ( load_df ) class MarkovChain: def __init__(self, lookback=2): self.trie = defaultdict(lambda : defaultdict(int)) sel...
3.171875
3
Projects/VerilogOnline/archive/vo-tools-6/extra/converters/fig2json/archive/test.py
fredmorcos/attic
2
29854
#!/usr/bin/python2 from pprint import PrettyPrinter from argparse import ArgumentParser def parse_image_header(input_file): comment = None for num, line in enumerate(input_file): line = line.strip() if num == 0: # First line, has to be a comment with the version, but we don't ...
3.21875
3
k8s/python/repo.py
logevents/demo-jenkins
2
29855
<gh_stars>1-10 from http.server import HTTPServer, SimpleHTTPRequestHandler class RepoRequestHandler(SimpleHTTPRequestHandler): def _set_headers(self): self.send_response(200) self.send_header("Content-type", "text/plain") self.end_headers() def _encode(self, text): return tex...
2.5625
3
ExerciciosPYTHON/NovPython/012.py
Samuel-Melo890/Python-Desafios
0
29856
<filename>ExerciciosPYTHON/NovPython/012.py<gh_stars>0 print('='*8,'Inscritos','='*8) from module.interface import * from time import sleep menu('Lista de Inscritos') with open('Inscritos.txt') as arq: for o, n in enumerate(arq): print(f'\033[35m{o + 1}\033[m \033[36m{n.title()}\033[m') sleep(0.4) ...
3.328125
3
pulse2percept/datasets/tests/test_nanduri2012.py
narenberg/pulse2percept
40
29857
<reponame>narenberg/pulse2percept import pandas as pd import numpy.testing as npt from pulse2percept.datasets import load_nanduri2012 def test_load_nanduri2012(): data = load_nanduri2012(shuffle=False) npt.assert_equal(isinstance(data, pd.DataFrame), True) columns = ['subject', 'implant', 'electrode', '...
2.5
2
arcsecond/api/endpoints/satellites.py
onekiloparsec/arcsecond.python
7
29858
from ._base import APIEndPoint class SatellitesAPIEndPoint(APIEndPoint): name = 'satellites' def _list_url(self, **filters): return self._build_url('satellites', **filters) def _detail_url(self, norad_number): return self._build_url('satellites', norad_number)
2.140625
2
dask/TestNB2.py
mlkimmins/scalingpythonml
13
29859
#!/usr/bin/env python # coding: utf-8 # In[1]: import dask from dask_kubernetes import KubeCluster import numpy as np # In[ ]: #tag::remote_lb_deploy[] # In[2]: # Specify a remote deployment using a load blanacer, necessary for communication with notebook from cluster dask.config.set({"kubernetes.scheduler-s...
2.34375
2
api_v1/tests/test_models.py
andela-akiura/yonder
1
29860
<gh_stars>1-10 from django.test import TestCase from factories import ImageFactory, ThumbnailImageFactory, ThumbnailFilterFactory from faker import Faker from django.contrib.auth.models import User fake = Faker() class UserModelTest(TestCase): pass class ImageModelTest(TestCase): def setUp(self): sel...
2.265625
2
turbustat/tests/test_rfft_to_fft.py
CFD-UTSA/Turbulence-stars
42
29861
<reponame>CFD-UTSA/Turbulence-stars # Licensed under an MIT open source license - see LICENSE from __future__ import print_function, absolute_import, division import pytest from ..statistics.rfft_to_fft import rfft_to_fft from ._testing_data import dataset1 import numpy as np import numpy.testing as npt try: i...
2.0625
2
Penrose2.py
whitegreen/quasicrystal
1
29862
<reponame>whitegreen/quasicrystal import matplotlib.pyplot as plt import numpy as np # projection method: Chapter 3, Grimm & Schreiber, 2002 basis = [] for i in range(5): a = np.pi * 0.4 * i basis.append([np.cos(a), np.sin(a), np.cos(2 * a), np.sin(2 * a), np.sqrt(0.5)]) basis = np.transpose(basis) def latti...
2.4375
2
ProgrammingChallenges#Book/Chapter 1/03.TheTrip/solutions/TheTrip.py
xergioalex/programmingContests
0
29863
from sys import stdin # Main program def main(): expenses = [0]*1000 for line in stdin: n = int(line) if (n == 0): break; total, toExchangePos, toExchangeNeg = (0,)*3 for i in range(n): line = stdin.readline() expenses[i] = float(line) ...
3.625
4
webserver/contest/context_processors.py
theSage21/judge-interface
3
29864
<gh_stars>1-10 from contest import models from django.utils import timezone from contest.functions import is_contest_on, contest_phase def contest_time(request): context = {} now = timezone.now() contest = models.ContestControl.objects.first() if now < contest.start: time = contest.start e...
2.28125
2
python/calico/felix/frules.py
a0x8o/felix
6
29865
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 Tigera, Inc. All rights reserved. # Copyright (c) 2015 Cisco Systems. 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 #...
1.84375
2
browse.py
Thorsten-Sick/tags_for_media_ccc_de
1
29866
#!/usr/bin/env python3 # TODO: Write a command line tool to browser and search in the database # TODO: Define a command set to search for strings, tags, similar talks, mark talks as seen, mark talks as irrelevant, mark talks as relevant, open a browser and watch, show details, quit # https://opensource.com/article/...
3.171875
3
Curso-Em-Video-Python/1Materias/08_Utilizando_Modulos/#08 - Utilizando Módulos C random.py
pedrohd21/Cursos-Feitos
0
29867
<reponame>pedrohd21/Cursos-Feitos import random # num = random.random() para numeros de 0 e 1 num = random.randint(1, 10) print(num) '''import random 'choice' n1 = str(input('Primeiro aluno: ')) n2 = str(input('Segundo aluno: ')) n3 = str(input('Terceiro aluno: ')) n4 = str(input('Quarto aluno: ')) lista = [n1, n2, n...
3.8125
4
help.py
TarikCinar/python-sesli-asistan
1
29868
<filename>help.py # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'help.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form): For...
1.914063
2
tarea2c/mod/game_over.py
camilo-nb/CC3501-tareas
0
29869
<gh_stars>0 import os from collections import deque import numpy as np from OpenGL.GL import * import lib.basic_shapes as bs import lib.easy_shaders as es import lib.transformations as tr class GameOver: def __init__(self): self.GPU = deque([ es.toGPUShape(bs.createTextureCube(os.path.join('m...
2.15625
2
src/pycity_scheduling/classes/electrical_heater.py
ElsevierSoftwareX/SOFTX-D-20-00087
4
29870
""" The pycity_scheduling framework Copyright (C) 2022, Institute for Automation of Complex Power Systems (ACS), E.ON Energy Research Center (E.ON ERC), RWTH Aachen University Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Softwa...
1.625
2
klasses/api.py
mitodl/bootcamp-ecommerce
2
29871
""" API functionality for bootcamps """ import logging from datetime import datetime, timedelta import pytz from django.core.exceptions import ValidationError, ObjectDoesNotExist from django.db.models import Sum from applications.constants import AppStates from ecommerce.models import Line, Order from klasses.constan...
2.453125
2
news/management/commands/fetch_planet.py
SIBSIND/PHPMYADMINWEBSITE
31
29872
# -*- coding: UTF-8 -*- # vim: set expandtab sw=4 ts=4 sts=4: # # phpMyAdmin web site # # Copyright (C) 2008 - 2016 <NAME> <<EMAIL>> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either vers...
2.09375
2
src/convert_dataset_video_to_mouth_img.py
iglaweb/HippoYD
7
29873
import collections import csv import os import sys from enum import Enum from pathlib import Path # adapt paths for jupyter module_path = os.path.abspath(os.path.join('..')) if module_path not in sys.path: sys.path.append(module_path) import face_alignment from yawn_train.src.blazeface_detector import BlazeFaceD...
2.171875
2
homeassistant/components/launch_library/diagnostics.py
MrDelik/core
30,023
29874
"""Diagnostics support for Launch Library.""" from __future__ import annotations from typing import Any from pylaunches.objects.event import Event from pylaunches.objects.launch import Launch from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers....
2.171875
2
py_tests/test_vision_pipeline_manager.py
machine2learn/mlpiot.base
1
29875
<gh_stars>1-10 """Tests for mlpiot.base.vision_pipeline_manager""" import unittest from mlpiot.base.action_executor import ActionExecutor from mlpiot.base.event_extractor import EventExtractor from mlpiot.base.scene_descriptor import SceneDescriptor from mlpiot.base.trainer import Trainer from mlpiot.base.vision_pipe...
2.28125
2
day04/code2.py
jfdahl/Advent-of-Code-2019
0
29876
<reponame>jfdahl/Advent-of-Code-2019 #!/usr/bin/env python3 import re import numpy as np start = 168630 stop = 718098 double = re.compile(r'(\d)\1') triple = re.compile(r'(\d)\1\1') def is_decreasing(num): previous = None for digit in str(num): if not previous: previous = digit ...
3.671875
4
layint_api/models/stats_history_inner.py
LayeredInsight/layint_api_python
0
29877
<gh_stars>0 # coding: utf-8 """ Layered Insight Assessment, Compliance, Witness & Control LI Assessment & Compliance performs static vulnerability analysis, license and package compliance. LI Witness provides deep insight and analytics into containerized applications. Control provides dynamic runtime security...
1.875
2
powerapi/database/influxdb2.py
jorgermurillo/powerapi
0
29878
# Copyright (c) 2018, INRIA # Copyright (c) 2018, University of Lille # 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 notice, thi...
1.625
2
client/verta/verta/_tracking/organization.py
coutureai/CoutureModelDB
0
29879
<gh_stars>0 # -*- coding: utf-8 -*- from .._protos.public.uac import Organization_pb2 as _Organization from .._protos.public.common import CommonService_pb2 as _CommonCommonService class CollaboratorType: def __init__(self, global_collaborator_type=None, default_repo_collaborator_type=None, defau...
2.015625
2
experiment/core/utmLib/ml/BN.py
LeonDong1993/TractableDE-ContCNet
0
29880
<reponame>LeonDong1993/TractableDE-ContCNet<filename>experiment/core/utmLib/ml/BN.py<gh_stars>0 # coding: utf-8 import numpy as np from copy import deepcopy from functools import partial from utmLib import utils from utmLib.ml.graph import Node, Graph from pdb import set_trace class BayesianNetwork: def __in...
2.59375
3
examples/pybullet/examples/quadruped.py
felipeek/bullet3
9,136
29881
<filename>examples/pybullet/examples/quadruped.py import pybullet as p import time import math import pybullet_data def drawInertiaBox(parentUid, parentLinkIndex, color): dyn = p.getDynamicsInfo(parentUid, parentLinkIndex) mass = dyn[0] frictionCoeff = dyn[1] inertia = dyn[2] if (mass > 0): Ixx = iner...
2.34375
2
tensormonk/architectures/gans_esrgan.py
Tensor46/TensorMONK
29
29882
""" TensorMONK's :: architectures :: ESRGAN """ __all__ = ["Generator", "Discriminator", "VGG19"] import torch import torch.nn as nn import torchvision from ..layers import Convolution class DenseBlock(nn.Module): r"""From DenseNet - https://arxiv.org/pdf/1608.06993.pdf.""" def __init__(self, tensor_size: t...
2.765625
3
ingenico/connect/sdk/domain/product/device_fingerprint_request.py
festicket/connect-sdk-python3
12
29883
# -*- coding: utf-8 -*- # # This class was auto-generated from the API references found at # https://epayments-api.developer-ingenico.com/s2sapi/v1/ # from ingenico.connect.sdk.data_object import DataObject class DeviceFingerprintRequest(DataObject): __collector_callback = None @property def collector_c...
2.203125
2
tests/nnapi/specs/skip/V1_2/space_to_batch_v1_2.mod.py
periannath/ONE
255
29884
<filename>tests/nnapi/specs/skip/V1_2/space_to_batch_v1_2.mod.py # # Copyright (C) 2018 The Android Open Source Project # # 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.apa...
2.078125
2
print_dict_results.py
ofirtal/alice_google_wordcount
1
29885
class PrintDictResults: def __init__(self, dict_of_sorted_words): self.list_of_sorted_words = dict_of_sorted_words def print_items(self, counter): print(f'{counter + 1}. "{self.list_of_sorted_words[counter][1]}" : {self.list_of_sorted_words[counter][0]}') def get_all_words(self): f...
3.546875
4
examples/steps/test_calc.py
bigbirdcode/pt_gh
0
29886
"""Example for Pytest-Gherkin""" import ast from pytest import approx from pt_gh import step, value_options operator = value_options("add", "subtract") @step("I have {num1:d} and {num2:d}") def given_numbers_i(num1, num2, context): """Example of parameter types converted based on annotation and context i...
3.265625
3
runtime/opt/taupage/init.d/02-register-td-agent.py
a1exsh/taupage
49
29887
#!/usr/bin/env python3 import logging import subprocess import re import boto.utils from jinja2 import Environment, FileSystemLoader from taupage import get_config logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) TPL_NAME = 'td-agent.conf.jinja2' TD_AGENT_TEMPLATE_PATH = '/etc/td-agent/t...
1.820313
2
yagocd/resources/property.py
1and1/yagocd
0
29888
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # The MIT License # # Copyright (c) 2016 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Soft...
1.421875
1
bb2cogs/tasks.py
Team-EG/j-bot
2
29889
import discord import asyncio import json import asyncpg from discord.ext import commands from discord.ext import tasks class Tasks(commands.Cog): def __init__(self, client): self.client = client print(f'{__name__} 로드 완료!') self.change_status.add_exception_type(asyncpg.Postgr...
2.625
3
controllers/api_error.py
elandcloud/python-api
0
29890
<gh_stars>0 from controllers.type_result import Error def unknownError(err): return Error(10001,"Unknown error",err) def invalidParamError(field,condition,err): return Error(10007, "Invalid field(%s: %s)"%(field, condition), err) def parameterParsingError(err): return Error(10008, "Parameter parsing err...
2.359375
2
Optimization/optimize.py
cty123/TriNet
10
29891
import numpy as np import math from scipy.optimize import minimize class Optimize(): def __init__(self): self.c_rad2deg = 180.0 / np.pi self.c_deg2rad = np.pi / 180.0 def isRotationMatrix(self, R) : Rt = np.transpose(R) shouldBeIdentity = np.dot(Rt, R) I = np.id...
2.765625
3
freyr/utils/agents.py
gutogirardon/freyer-stocks-api
3
29892
""" Freyr - A Free stock API """ import random import requests.utils header = [ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:83.0) Gecko/20100101 Firefox/83.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82.0) Gecko/20100101 Firefox/82.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0)...
2.109375
2
mixcoatl/resource_utils.py
zomGreg/mixcoatl
0
29893
from mixcoatl.admin.billing_code import BillingCode from mixcoatl.geography.region import Region from mixcoatl.admin.group import Group from mixcoatl.admin.user import User def get_servers(servers, **kwargs): """ Returns a list of servers Arguments: :param servers: a list of servers that needs to be filt...
2.453125
2
PWGJE/EMCALJetTasks/Tracks/analysis/old/ComparePeriodsTriggerToMB.py
maroozm/AliPhysics
114
29894
<filename>PWGJE/EMCALJetTasks/Tracks/analysis/old/ComparePeriodsTriggerToMB.py<gh_stars>100-1000 #! /usr/bin/env python from ROOT import TCanvas, TGraphErrors, TLegend, TPaveText from ROOT import kBlack, kBlue, kRed from Helper import Frame, ReadHistList from Graphics import Style from SpectrumContainer import DataCon...
1.84375
2
python/utility_functions.py
stellarpower/vio_common
16
29895
<reponame>stellarpower/vio_common import json import os import numpy as np from numpy import genfromtxt SECOND_TO_MILLIS = 1000 SECOND_TO_MICROS = 1000000 SECOND_TO_NANOS = 1000000000 TIME_UNIT_TO_DECIMALS = {'s': 0, "ms": 3, "us": 6, "ns": 9} def parse_time(timestamp_str, time_unit): """ convert a timestam...
2.71875
3
app/models.py
nickspeal/net-zero-python-backend
0
29896
from app import db # Junction Tables for many-to-many relationships campaign_users = db.Table('campaign_users', db.Column('campaign', db.Integer, db.ForeignKey('campaigns.id'), primary_key=True), db.Column('user', db.Integer, db.ForeignKey('users.username'), primary_key=True), ) campaign_vehicles = db.Table('...
2.8125
3
course/views.py
author31/HongsBlog
0
29897
from typing import List from django.shortcuts import render from django.views.generic.detail import DetailView from django.views.generic.list import ListView from assignment.models import Assignment from course.models import Course class CourseListView(ListView): template_name = 'course/course_list.html' model...
2.09375
2
aldryn_search/apps.py
lab360-ch/aldryn-search
11
29898
from django.apps import AppConfig class AldrynSearchConfig(AppConfig): name = 'aldryn_search' def ready(self): from . import conf # noqa
1.515625
2
tests/utils.py
openlobby/openlobby-server
7
29899
<reponame>openlobby/openlobby-server from datetime import datetime def strip_value(data, *path): element = path[0] value = data.get(element) if len(path) == 1: data[element] = "__STRIPPED__" return value else: if isinstance(value, dict): return strip_value(value, *p...
2.78125
3