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
ProjectEuler_plus/euler_006.py
byung-u/HackerRank
0
42300
#!/usr/bin/env python3 import sys t = int(input().strip()) for a0 in range(t): n = int(input().strip()) # http://oeis.org/search?q=1%2C9%2C36%2C100%2C225&language=english&go=Search square_of_sum = (n ** 2 * (n + 1) ** 2) / 4 # http://oeis.org/search?q=1%2C5%2C14%2C30%2C55&sort=&language=english&go=Sea...
3.546875
4
yx_motor/authenticate.py
Jesse-Clarkayx/yx_motor
0
42301
# AUTOGENERATED! DO NOT EDIT! File to edit: 04_authenticate.ipynb (unless otherwise specified). __all__ = ['Authenticate'] # Cell import requests from .api import API class Authenticate: "Class for handling authenticate API actions" def __init__(self, api: API): self.api = api self.base_en...
2.578125
3
src/inception/__init__.py
jercytryn/inception
6
42302
<reponame>jercytryn/inception<gh_stars>1-10 """ Inception api for semi-automaed 2D object insertion into indoor scenery >>> import inception >>> inception.magic_insert('http://my/awesome/foreground.jpg', '/Users/mrayder/background.png', (30, 40, 300, 500)) """ # expose the top level api methods up the very top level ...
2.03125
2
mallet/CFNetwork/NSURLRequest.py
bartoszj/Mallet
16
42303
<reponame>bartoszj/Mallet<gh_stars>10-100 #! /usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2014 <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 Softwa...
1.421875
1
ngspy/Promotor.py
manuSrep/ngspy
0
42304
#!/usr/bin/python # -*- coding: utf8 -*- """ Functions and classes for handling next generation sequencing data. :author: <NAME> :license: FreeBSD License ---------- Copyright (c) 2016, <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided ...
1.570313
2
slicedimage/backends/_s3.py
ttung/slicedimage
6
42305
<gh_stars>1-10 import urllib.parse from io import BytesIO from pathlib import PurePosixPath import boto3 from botocore import UNSIGNED from botocore.config import Config from ._base import Backend, verify_checksum RETRY_STATUS_CODES = frozenset({500, 502, 503, 504}) class S3Backend(Backend): CONFIG_UNSIGNED_RE...
2.109375
2
revdbc/revdbc.py
emundo/revdbc
3
42306
<filename>revdbc/revdbc.py from enum import Enum, auto import logging import os import re from typing import cast, Dict, List, NamedTuple, Optional, Set, Tuple, Union import warnings import cantools import cantools.subparsers.dump import numpy as np from scipy.spatial.distance import minkowski import sklearn from skle...
2.125
2
server/data_access/__init__.py
jdayton3/Geney
2
42307
<filename>server/data_access/__init__.py from .GeneyJob import GeneyJob
1
1
postprocessing/classify_phase.py
JoshMend/prebotc-graph-model
0
42308
import numpy as np def fit_MRF_pseudolikelihood(adj_exc,adj_inh,y): ''' Fit a Markov random field using maximum pseudolikelihood estimation, also known as logistic regression. The conditional probabilities follow y_i ~ Logistic(B[0] + B[1] A1_{ij} y_j + A1[2] X_{ij} (1-y_j) + B[...
2.890625
3
src/bin/ocvf_recognizer.py
warp1337/facerecognition_pipeline
21
42309
# Copyright (c) 2015. # <NAME> <bytefish[at]gmx[dot]de> and # <NAME> <flier[at]techfak.uni-bielefeld.de> and # <NAME> <nkoester[at]techfak.uni-bielefeld.de> # # # Released to public domain under terms of the BSD Simplified license. # # Redistribution and use in source and binary forms, with or without # modification, a...
0.8125
1
wuqian/wuqian/migrations/0009_uploadimage.py
Broadroad/pyWebsite
0
42310
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('wuqian', '0008_wuqianbusiness_image'), ] operations = [ migrations.CreateModel( name='UploadImage', ...
1.609375
2
Programmers/C30L49190/C30L49190.py
iamGreedy/CodingTest
0
42311
<filename>Programmers/C30L49190/C30L49190.py # %% import numpy as np import itertools as it def delta(k, m, n, dx, dy): for y, x in it.product(range(m), range(m)): rx = x - dx ry = y - dy if 0 <= rx < n and 0 <= ry < n: yield k[ry][rx] else: yield 0 ret...
2.734375
3
pythonteste/desafio106.py
dangiotto/Python
1
42312
<gh_stars>1-10 def ajuda(com, cor=0): print(c[cor], end='') help(com) print(c[0], end='') def titulo(msg, cor=0): tam = len(msg)+4 print(c[cor], end='') print('~' * tam) print(f' {msg}') print('~' * tam) print(c[0], end='') #pricipal c = ('\033[m', #sem cores '\03...
3.09375
3
tests/test_hyp_search.py
PFLeget/treegp
6
42313
from __future__ import print_function import numpy as np import treegp from treegp_test_helper import timer from treegp_test_helper import get_correlation_length_matrix from treegp_test_helper import make_1d_grf from treegp_test_helper import make_2d_grf @timer def test_hyperparameter_search_1d(): optimizer = ['l...
2.140625
2
EpisodeType.py
Morasiu/VideoDownloader
0
42314
<filename>EpisodeType.py from enum import Enum class EpisodeType(Enum): Normal = 1, Filler = 2
2.1875
2
Scripts/SeaIce/JAXA_seaice_recordmagnitude_year.py
dargueso/IceVarFigs
1
42315
<reponame>dargueso/IceVarFigs """ Calculates current year percentage of record daily low SIE 2002-present using JAXA metadata Website : https://ads.nipr.ac.jp/vishop/vishop-extent.html Author : <NAME> Date : 18 October 2016 """ ### Import modules import numpy as np import matplotlib.pyplot as plt import ma...
2.40625
2
estraven/__about__.py
enpaul/genly
0
42316
# pylint: disable=missing-docstring __title__ = "estraven" __summary__ = "An opinionated YAML formatter for Ansible playbooks" __version__ = "0.0.0" __url__ = "https://github.com/enpaul/estraven/" __license__ = "MIT" __authors__ = ["<NAME> <<EMAIL>>"]
0.988281
1
win32/utils/type_limits.py
GGelatin/TekkenBot
45
42317
<reponame>GGelatin/TekkenBot #!/usr/bin/env python3 # Copyright (c) 2019, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above cop...
1.570313
2
setup.py
mmabey/vbox-sdk
4
42318
#!/usr/bin/env python # *-* coding: utf-8 *-* from os import path from setuptools import setup, find_packages with open('VERSION') as v_file: version = v_file.read().strip() def read(fname): return open(path.join(path.dirname(__file__), fname)).read() setup( name='vbox_sdk', packages=find_packages...
1.679688
2
coopihc/agents/lqrcontrollers/IHCT_LQGController.py
jgori-ouistiti/CoopIHC
0
42319
<gh_stars>0 import numpy import copy import warnings from coopihc.agents.BaseAgent import BaseAgent from coopihc.observation.RuleObservationEngine import RuleObservationEngine from coopihc.base.State import State from coopihc.base.elements import discrete_array_element, array_element, cat_element from coopihc.policy.Li...
2.21875
2
scripts/collect_result.py
mlindauer/EPM_DNN
1
42320
import numpy as np import pandas as pd from collections import OrderedDict import tabulate del(tabulate.LATEX_ESCAPE_RULES[u'$']) del(tabulate.LATEX_ESCAPE_RULES[u'\\']) del(tabulate.LATEX_ESCAPE_RULES[u'{']) del(tabulate.LATEX_ESCAPE_RULES[u'}']) del(tabulate.LATEX_ESCAPE_RULES[u'^']) data = {} scens = ["SPEAR-SWV"...
2.03125
2
enthought/mayavi/filters/cell_derivatives.py
enthought/etsproxy
3
42321
# proxy module from __future__ import absolute_import from mayavi.filters.cell_derivatives import *
0.957031
1
examples/manager.py
seregagavrilov/queue_mfc_manager
0
42322
<reponame>seregagavrilov/queue_mfc_manager from redis import Redis from examples.tasks_example import some_function, get_url from queue_manager import QManager redis = Redis() manager = QManager(redis) manager.add_to_queue(some_function, 'asd', 'bc', ['s', 'e', 'r', '1'], sourname='Name') manager.add_to_queue(get_url...
2.390625
2
migrations/versions/a7d4e728b549_.py
eubr-bigsea/caipirinha
0
42323
<reponame>eubr-bigsea/caipirinha """empty message Revision ID: a7d4e728b549 Revises: d<PASSWORD> Create Date: 2017-08-09 12:31:42.628620 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. from sqlalchemy.dialects import mysql from caipirinha.migration_utils import is_sqlite ...
1.484375
1
sampleScan.py
tink3rtanner/opc
29
42324
import os directory="/home/pi/Desktop/samplepacks/" sampleList=[["test","test"]] def main(): for file in os.listdir(directory): fullPath = directory + file if os.path.isdir(fullPath): #print #print "directory: ",file #print fullPath containsAif=0 #each folder in parent directory for subfil...
2.96875
3
train_keras.py
vin-liao/char-rnn
0
42325
import numpy as np from utils import Data import keras.optimizers from keras.callbacks import LambdaCallback, ModelCheckpoint from keras.models import Sequential from keras.layers import Dense, Embedding, GlobalMaxPooling1D, CuDNNLSTM, Dropout, BatchNormalization, Activation, LSTM import getopt import sys from sklearn....
2.421875
2
examples/highfreq/highfreq_ops.py
wan9c9/qlib
8,637
42326
<filename>examples/highfreq/highfreq_ops.py<gh_stars>1000+ import numpy as np import pandas as pd import importlib from qlib.data.ops import ElemOperator, PairOperator from qlib.config import C from qlib.data.cache import H from qlib.data.data import Cal from qlib.contrib.ops.high_freq import get_calendar_day class D...
2.578125
3
termitup_internal/modules_api/activateRelval.py
pmchozas/llod4lion
7
42327
<reponame>pmchozas/llod4lion #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 11 18:18:18 2021 @author: pmchozas """ from modules_api.Term import Term from modules_api import relvalCode import re import unidecode def validate_syns(myterm, reslist): synonyms="" for resource in reslist: ...
2.125
2
_bin/grpc_server.py
dhermes/tcp-h2-describe
0
42328
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
2.65625
3
scripts/04_3d_concepts/modeling/polygon_reduction/polygonreduction_create_r19.py
PluginCafe/cinema4d_py_sdk_extended
85
42329
<reponame>PluginCafe/cinema4d_py_sdk_extended """ Copyright: MAXON Computer GmbH Author: <NAME> Description: - Creates a new PolygonReduction object. Class/method highlighted: - c4d.utils.PolygonReduction """ import c4d polyReduction = c4d.utils.PolygonReduction()
1.546875
2
Algorithms_medium/0034. Find First and Last Position of Element in Sorted Array.py
VinceW0/Leetcode_Python_solutions
4
42330
<filename>Algorithms_medium/0034. Find First and Last Position of Element in Sorted Array.py """ 0034. Find First and Last Position of Element in Sorted Array Medium Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. If target is not found in the ...
4.03125
4
PtzCamera/web_server.py
nightdeveloper/ServoTest
0
42331
#!/usr/bin/python3 import os import sys file_dir = os.path.dirname(__file__) sys.path.append(file_dir) import io import logging import time import traceback from flask import Flask, render_template, send_file, Response from threading import Condition, Lock from enums import Position from mymemcache import MemCache...
2.375
2
consumers/venv/lib/python3.7/site-packages/faust/stores/__init__.py
spencerpomme/Public-Transit-Status-with-Apache-Kafka
0
42332
"""Storage registry.""" from typing import Type from mode.utils.imports import FactoryMapping from faust.types import StoreT __all__ = ['by_name', 'by_url'] STORES: FactoryMapping[Type[StoreT]] = FactoryMapping( memory='faust.stores.memory:Store', rocksdb='faust.stores.rocksdb:Store', ) STORES.include_setupto...
1.96875
2
test/unit/00.nop-commit.py
rescrv/Consus
239
42333
<gh_stars>100-1000 import consus c1 = consus.Client() t1 = c1.begin_transaction() t1.commit() c2 = consus.Client(b'127.0.0.1') t2 = c1.begin_transaction() t2.commit() c3 = consus.Client('127.0.0.1') t3 = c1.begin_transaction() t3.commit() c4 = consus.Client(b'127.0.0.1', 1982) t4 = c1.begin_transaction() t4.commit(...
1.71875
2
manticore/core/smtlib/__init__.py
ivanpustogarov/manticore
0
42334
<reponame>ivanpustogarov/manticore from __future__ import absolute_import # noqa from .expression import Expression, Bool, BitVec, Array, BitVecConstant # noqa from .constraints import ConstraintSet # noqa from .solver import * # noqa from . import operators as Operators # noqa import logging logger = logging.ge...
2.21875
2
no_cloud/cli.py
saalaa/no-cloud
0
42335
# Copyright (C) 2016 <NAME> <<EMAIL>> # Released under the terms of the BSD license. import os import re import sys import click import string import datetime import subprocess from . import __version__ from .remote import get_remote from .crypto import fernet_encrypt, fernet_decrypt, sha512_hash, digest from .forma...
1.960938
2
PredictUtils/utils.py
Iglohut/autoscore_3d
0
42336
<reponame>Iglohut/autoscore_3d import numpy as np from skimage.exposure import cumulative_distribution def cdf(im): ''' computes the CDF of an image im as 2D numpy ndarray ''' c, b = cumulative_distribution(im) # pad the beginning and ending pixels and their CDF values c = np.insert(c, 0, [0] *...
2.828125
3
tests/test_context.py
billyrrr/firestore-odm
1
42337
from firestore_odm import config from firestore_odm import context Config = config.Config def test_firebase_app_context(): config = Config( app_name="flask-boiler-testing", debug=True, testing=True, certificate_filename="flask-boiler-testing-firebase-adminsdk-4m0ec-7505aaef8d.json...
1.945313
2
AXF/App/migrations/0007_remove_user_phone_number.py
sajinchang/django_axf
0
42338
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2018-12-17 19:55 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('App', '0006_goods_user'), ] operations = [ migrations.RemoveField( mode...
1.375
1
sheets/serializers.py
LD31D/django_sheets
0
42339
from rest_framework import serializers from .models import Cell class CellSerializer(serializers.ModelSerializer): class Meta: model = Cell fields = ('coordinates', 'value')
1.992188
2
Basic Image Processing/Raw_Flips.py
vigneshdurairaj/OpenCv
0
42340
<filename>Basic Image Processing/Raw_Flips.py<gh_stars>0 # Image Processing Intro import numpy as np import argparse import imutils import cv2 ap = argparse.ArgumentParser() ap.add_argument("-i","--image", required = True, help= "Path to the imagee") args = vars(ap.parse_args()) image = cv2.imread(args["image"]) cv2...
3.25
3
lwc/views.py
codingforentrepreneurs/launch-with-code
64
42341
<reponame>codingforentrepreneurs/launch-with-code from django.shortcuts import render def testhome(request): context = {} template = "donotuse.html" return render(request, template, context) # def home2(request): # context = {} # template = "home2.html" # return render(request, template, context)
2.203125
2
Data/Packages/LiveReload/CommandAPI.py
RodrigoTomeES/sublime-text-settings
4
42342
#!/usr/bin/python # -*- coding: utf-8 -*- import sublime import sublime_plugin import LiveReload import webbrowser import os class LiveReloadTest(sublime_plugin.ApplicationCommand): def run(self): path = os.path.join(sublime.packages_path(), 'LiveReload', 'web') file_name = os.path.join(path, 't...
2.203125
2
python/lib/xjson/parser.py
hidaruma/caty
0
42343
from xjson.xtypes import * from topdown import * from decimal import Decimal import itertools from itertools import dropwhile import json def series_of_escape(s): return len(list(itertools.takewhile(lambda c: c=='\\', reversed(s)))) #@profile class string(EagerParser): def matches(self, seq): return ...
2.375
2
sourcelyzer/dao/plugin.py
sourcelyzer/sourcelyzer
1
42344
<gh_stars>1-10 from sourcelyzer.dao import Base from sqlalchemy import Column, Integer, String, Boolean, DateTime, func import datetime class Plugin(Base): __tablename__ = 'sourcelyzer_plugin' id = Column(Integer, primary_key=True, autoincrement=True) repository_id = Column(Integer) key = Column(Strin...
2.09375
2
multipledispatch/core.py
LowinData/multipledispatch
1
42345
<gh_stars>1-10 from contextlib import contextmanager from warnings import warn from .conflict import ordering, ambiguities, super_signature, AmbiguityWarning import inspect import sys class Dispatcher(object): """ Dispatch methods based on type signature Use ``multipledispatch.dispatch`` to add implementatio...
2.6875
3
src/day6.py
blu3r4y/AdventOfCode2019
1
42346
# Advent of Code 2019, Day 6 # (c) blu3r4y import networkx as nx from aocd.models import Puzzle from funcy import print_calls @print_calls def part1(graph): checksum = 0 for target in graph.nodes: checksum += nx.shortest_path_length(graph, "COM", target) return checksum @print_calls def part2(...
3.078125
3
core/frontend/views.py
LegolasVzla/django-google-maps
5
42347
from decimal import Decimal import json import logging from django.shortcuts import render from django.core.serializers.json import DjangoJSONEncoder from django.http import (HttpResponse) from django.views.generic import View from rest_framework import status from rest_framework.views import APIView from api.models i...
1.882813
2
deps/lib/python3.5/site-packages/openzwave/group.py
jfarmer08/hassio
0
42348
# -*- coding: utf-8 -*- """ .. module:: openzwave.group This file is part of **python-openzwave** project https://github.com/OpenZWave/python-openzwave. :platform: Unix, Windows, MacOS X :sinopsis: openzwave API .. moduleauthor: bibi21000 aka <NAME> <<EMAIL>> License : GPL(v3) **python-openzwave** is free s...
1.742188
2
plugin.video.vstream/resources/hosters/vidzi.py
akuala/REPO.KUALA
2
42349
<reponame>akuala/REPO.KUALA #-*- coding: utf-8 -*- #https://vidzi.tv/xxx.html #Vstream https://github.com/Kodi-vStream/venom-xbmc-addons from resources.lib.handler.requestHandler import cRequestHandler from resources.lib.parser import cParser from resources.hosters.hoster import iHoster from resources.lib.packer import...
2.046875
2
histoprep/preprocess/__init__.py
jopo666/HistoPrep
11
42350
from ._metadata import * from ._visualise import * from ._writer import * from . import functional
1.015625
1
fuse/losses/segmentation/loss_dice.py
LaudateCorpus1/fuse-med-ml
57
42351
""" (C) Copyright 2021 IBM Corp. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software d...
2
2
ui/ui.py
cr33dog/pyxfce
4
42352
<gh_stars>1-10 #!/usr/bin/env python from _ui import * def spawn_command_line(*args, **kwargs): import gtk return(spawn_command_line_on_screen(gtk.gdk.screen_get_default(), *args, **kwargs)) SPAWN_LEAVE_DESCRIPTORS_OPEN = 1 << 0 SPAWN_DO_NOT_REAP_CHILD = 1 << 1 SPAWN_SEARCH_PATH = 1 << 2 SPAWN_STDO...
2.40625
2
doc/pulse-paper/dj_algorithm.py
BoxiLi/qutip-qip
2
42353
<reponame>BoxiLi/qutip-qip TEXTWIDTH = 5.93 LINEWIDTH = 3.22 import matplotlib as mpl import matplotlib.pyplot as plt try: from quantum_plots import global_setup global_setup(fontsize = 10) except: pass plt.rcParams.update({"text.usetex": False, "font.size": 10}) num_qubits = 3 import nump...
2.421875
2
scripts/populate.py
mentix02/3do
0
42354
<reponame>mentix02/3do<gh_stars>0 #!/usr/bin/env python3 import sys import json import requests URL = 'http://localhost:{}/api/tasks' def main(argv): if len(argv) != 2: print(f'usage: {argv[0]} <port>', file=sys.stderr) exit(1) url = URL.format(argv[1]) with open('data.json') as f: tasks = json.load(f...
2.828125
3
tests/test_scm_pipeline.py
Forks-yugander-krishan-singh/jenkins-job-builder-pipeline
0
42355
from base import assert_case def test_script_pipeline(): assert_case('scm_pipeline')
1.4375
1
tape/task_models/RandomSequenceMask.py
nickbhat/tape-1
42
42356
from typing import Optional import tensorflow as tf import tensorflow.keras.backend as K from tensorflow.keras import Model from tensorflow.keras.layers import Layer import numpy as np import rinokeras as rk from rinokeras.layers import WeightNormDense as Dense from rinokeras.layers import LayerNorm, Stack class Ra...
2.890625
3
second_order/rk4_analysis.py
isoleph/ARK
0
42357
<reponame>isoleph/ARK #!/usr/bin/env python3 # script to plot and compare second order RK4 results import matplotlib.pyplot as plt import numpy as np import pandas as pd # purely cosmetic import seaborn as sns sns.set(); def main(): # create dataframe from C++ outfile df = pd.read_csv("ARK2.csv", header=0);...
2.765625
3
QAStrategy/__init__.py
vx-qa/QAStrategy
0
42358
__version__ = '0.0.22' __author__ = 'yutiansut' from QAStrategy.util import QA_data_futuremin_resample from QAStrategy.qactabase import QAStrategyCTABase
1.023438
1
Practice/member/views.py
yongbj96/Practice-Django
0
42359
from django.shortcuts import render, redirect from django.http import HttpResponse from .models import BoardMember # Post 추가 from django.core import serializers from rest_framework.decorators import api_view, permission_classes, authentication_classes from rest_framework.permissions import IsAuthenticated # 로그인여부 확인 f...
2.140625
2
checkdt/core/connection.py
openskullbox/checkdt
0
42360
from cryptography.fernet import Fernet import sqlalchemy from sqlalchemy import Column, Integer, String from sqlalchemy.dialects.postgresql import ENUM from sqlalchemy.ext.declarative import declarative_base from checkdt.config.config import CORE__ENCRYPTION_KEY from checkdt.core.session_maker import session_init Ba...
2.609375
3
syzygy/scripts/benchmark/ibmperf_test.py
nzeh/syzygy
343
42361
#!/usr/bin/python2.6 # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
2.421875
2
scripts/hello.py
so-os-troxa/python-lib-example
0
42362
#!/usr/bin/env python3 from dev_aberto import hello from babel.dates import format_datetime from datetime import datetime import gettext gettext.install('hello', localedir='locale') if __name__ == '__main__': date, name = hello() date = format_datetime(datetime.strptime(date, '%Y-%m-%dT%H:%M:%SZ')) print(...
2.625
3
mot-tools/transfer/coco_transfer.py
Bruce-yi/Bruce-yi-DeepLearning-Tools
0
42363
# from __future__ import absolute_import # from __future__ import division # from __future__ import print_function # import _init_paths # from opts import opts import os import json import cv2 import collections def xychange(a, w, h): ans = [(a[0]+a[2]/2)/w, (a[1]+a[3]/2)/h, a[2]/w, a[3]/h] ret...
2.328125
2
setup.py
lulukelu/aws-iam-permissions-guardrails
88
42364
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="iam-permissions-guardrails", # Replace with your own username version="0.0.3", author="<NAME>", author_email="<EMAIL>", description="IAM Permissions Guardrails module", long_descripti...
1.617188
2
main.py
hiyoung123/ProxyPool
2
42365
#!/usr/bin/env python # -*- encoding: utf-8 -*- import os import sys from scrapy.cmdline import execute if __name__ == '__main__': sys.path.append(os.path.abspath(__file__)) # execute(['scrapy', 'crawl', 'XiLa']) execute(['scrapy', 'crawl', 'Kuai'])
1.820313
2
sleeplearning/lib/loaders/carofile.py
a1247418/MT18_LH_human-sleep-classification
0
42366
<reponame>a1247418/MT18_LH_human-sleep-classification<filename>sleeplearning/lib/loaders/carofile.py import numpy as np import scipy.io from scipy import signal from typing import Tuple from sleeplearning.lib.loaders.baseloader import BaseLoader class Carofile(BaseLoader): def __init__(self, path: str, epoch_le...
2.171875
2
src/bos_consensus/blockchain/test_state_lifecycle.py
LuffyEMonkey/isaac-consensus-protocol
1
42367
<filename>src/bos_consensus/blockchain/test_state_lifecycle.py from ..common import Ballot, BallotVotingResult, Message from ..consensus import get_fba_module from ..consensus.fba.isaac import IsaacState from .util import blockchain_factory IsaacConsensus = get_fba_module('isaac').IsaacConsensus def test_state_life...
2.21875
2
demos/python_demos/common/pipelines/__init__.py
ivanvikhrev/open_model_zoo
4
42368
from .async_pipeline import AsyncPipeline
0.976563
1
craid/bgsBuddy/test/test_globals.py
HausReport/ClubRaiders
0
42369
<filename>craid/bgsBuddy/test/test_globals.py from unittest import TestCase import json #from craid.bgsBuddy import GlobalDictionaries #import GlobalDictionaries class Test(TestCase): def setUp(self): # load .jsonl file print("Hi!") def tearDown(self): pass def test_add_system...
2.53125
3
dataent/config/tools.py
dataent/dataent
0
42370
<gh_stars>0 from __future__ import unicode_literals from dataent import _
1.046875
1
mistune_contrib/meta.py
lepture/mistune-contrib
44
42371
<filename>mistune_contrib/meta.py # coding: utf-8 """ mistune_contrib.meta ~~~~~~~~~~~~~~~~~~~~ Support Meta features for mistune. Metadata are keywords headers at the top of the Markdown text: Title: A Metadata DEMO Author: <NAME> :copyright: (c) 2015 by <NAME>. """ import re ...
2.796875
3
rsLight_import.py
initialfx/Maya-to-Houdini
1
42372
import json def filePath(): """ ask for file path""" filepath = hou.ui.selectFile() return filepath def getData(filename): return eval(open(filename).read(), {"false": False, "true":True}) temp_data = getData(filePath()) for i in range(len(temp_data)): #print(dict[i]) data = temp_data[i...
2.5
2
2021/CN/challenge_1/solve.py
yu1hpa/ctf-writeups
0
42373
<filename>2021/CN/challenge_1/solve.py from pwn import * io = remote("13.37.111.222", "5000") #io = process("./challenge_1") payload = b"" payload += b"A"*64 io.sendlineafter("username:", payload) io.interactive() # FLAG: CN{finding_boundaries_is_never_easy}
1.742188
2
nuke_stubs/nuke/nuke_classes/PyCustom_Knob.py
sisoe24/Nuke-Python-Stubs
1
42374
from numbers import Number from typing import * import nuke from . import * class PyCustom_Knob(Script_Knob): """ PyCustom_Knob """ def __hash__(self, ): """ Return hash(self). """ return None def __init__(self, *args, **kwargs): """ Initialize sel...
2.96875
3
Utility/parallel_generator.py
Lammlab/Resic
3
42375
<gh_stars>1-10 def parallel_generator(generators, functors): """ :param generators: A list of k generators (initialized) repersenting files, file are sorted with respect to the functors. :param functors: A list of k functors (must be the same size as the generators),...
3.234375
3
get_together/views/orgs.py
vhfmag/GetTogether
0
42376
from django.utils.translation import ugettext_lazy as _ from django.contrib import messages from django.contrib.auth import logout as logout_user from django.contrib.auth.decorators import login_required from django.contrib.sites.models import Site from django.shortcuts import render, redirect, get_object_or_404 from ...
1.976563
2
test_images/transform_matrix.py
OussamaFatmi/udacity_advanced_lane_finding_project
0
42377
import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg import glob as glb import os import cv2 import pickle ################################################################################################################# def create_new_folder (new_dir): if not os.path.exists(new_dir...
2.5
2
interfaces.py
Matthew-Steen/StarPredictions
0
42378
<filename>interfaces.py from tkinter import * from tkinter import ttk from PIL import ImageTk,Image import pandas as pd import math import pickle #import models with open("pickle_model_numPlanets.pkl", 'rb') as file1: pickle_model1 = pickle.load(file1, encoding='ISO-8859-1') with open("pickle_model_PlanetRadius.pk...
2.84375
3
energyplus/EnergyPlus-9-0-1/workflows/app_g_postprocess.py
vcmorini/building-design
0
42379
<filename>energyplus/EnergyPlus-9-0-1/workflows/app_g_postprocess.py import os import platform import subprocess from eplaunch.workflows.base import BaseEPLaunchWorkflow1, EPLaunchWorkflowResponse1 class AppGPostProcessWorkflow(BaseEPLaunchWorkflow1): def name(self): return "AppGPostProcess-9.0.1" ...
2.3125
2
sam_et_max/shadow/shadow.py
bertrandvidal/stuff
0
42380
import os from uuid import uuid4 from zipfile import ZipFile import urllib2 import crypt import spwd import sys ZIP_URL = "http://xato.net/files/10k%20most%20common.zip" PASSWORDS_FILE = "10k most common.txt" ZIP_FILE = os.path.join(os.path.abspath(os.path.dirname(__file__)), str(uuid4())) if not os.path.exists(PASSW...
2.84375
3
divisor_selection.py
FoxProklya/Step-Python
0
42381
<gh_stars>0 def reg(n): j = 0 i = 2 while i**2<=n and j!=1: if n % i == 0: j = 1 else: i = i + 1 else: if j == 1: j = "Составное число" elif j == 0: j = "Простое число" return j n = int(input()) print(reg(n))
3.578125
4
scripts/component_graph/server/__main__.py
opensource-assist/fuschia
3
42382
<reponame>opensource-assist/fuschia #!/usr/bin/env python3 # Copyright 2019 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. """Entry point to start the server. Main will launch a root handler on port 8080 by default and sta...
2.5
2
django/prof_education/reports/data_sources/students.py
sergeymirasov/h-edu
0
42383
from django.db.models import Avg, Count from prof_education.regions.models import Region from prof_education.students.models import Student from ..column_sets import ColumnFormats, ColumnSet, ColumnSetItem from ..columns import AggrColumn, IntegerAggrColumn from ..filters import ModelChoicesFilter, NumberFilter from ...
2.078125
2
developer/developer_helper.py
geodynamics/pylith_installer
6
42384
#!/usr/bin/env python3 """Application for managing the PyLith build environment. """ import sys import os import argparse import subprocess import configparser class Package(): """Base class for software package. """ NAME = None CLONE_RECURSIVE = False def __init__(self, config): if not ...
2.3125
2
main.py
ashish-khulbey/Test-Repo
0
42385
<gh_stars>0 <<<<<<< HEAD print("Hello, from local repo!") ======= print("Hello, World!") print("Hello, from Github!") >>>>>>> afa8fcd69f454d2ea375b62996d0354e2ad6cb1e
1.71875
2
models/nms.py
haohlin/pointgmm-primitive-detection
0
42386
<reponame>haohlin/pointgmm-primitive-detection # 3D IoU caculate code for 3D object detection # Kent 2018/12 import numpy as np import torch from scipy.spatial import ConvexHull from numpy import * import matplotlib from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d.art3d impo...
2.796875
3
uap/post/forms.py
Tyromancer/UAP-Application-Platform-Django
0
42387
from django import forms from django.forms import ModelForm, CharField from ckeditor.widgets import CKEditorWidget from .models import URP, Application class URPCreateForm(ModelForm): """Form for URP creation""" description = CharField(widget=CKEditorWidget()) class Meta: model = URP fiel...
2.453125
2
src/app.py
afunTW/pyqt5-video-labeling
6
42388
import logging from collections import OrderedDict from copy import deepcopy from datetime import datetime, timedelta from pathlib import Path from time import sleep import cv2 import numpy as np import pandas as pd from PyQt5.QtCore import Qt, QTimer, pyqtSlot from PyQt5.QtGui import QColor, QImage, QPixmap from PyQt...
2.0625
2
lightflow_rest/__main__.py
AustralianSynchrotron/lightflow-rest
0
42389
<reponame>AustralianSynchrotron/lightflow-rest def main(args): """ Main entry point for the extension. """ from lightflow_rest.service import app app.run() if __name__ == '__main__': import sys main(sys.argv[1:])
1.570313
2
Exercicios/ex013.py
LuccasAls/Python-Exercicos
0
42390
salario = float(input('Qual o seu salario: ')) aumento = salario*1.15 print('O seu salário de R${:.2f} recebeu um aumento de 15% seu novo salário é R${:.2f}'.format(salario, aumento))
3.75
4
datasets/epa_historical_air_quality/_images/run_csv_transform_kub/csv_transform.py
renovate-bot/public-datasets-pipelines
90
42391
<reponame>renovate-bot/public-datasets-pipelines # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
2.328125
2
fullstack/migrations/0002_booking_schedule_tournament_turf.py
arondasamuel123/TurfAPI
0
42392
<gh_stars>0 # Generated by Django 3.0.4 on 2020-03-30 13:49 import cloudinary.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('fullstack', '0001_initial'), ] operations = [...
1.804688
2
metric_learn/_util.py
Aaron1993/metric-learn
1
42393
<gh_stars>1-10 import numpy as np import six from sklearn.utils import check_array from sklearn.utils.validation import check_X_y from metric_learn.exceptions import PreprocessorError # hack around lack of axis kwarg in older numpy versions try: np.linalg.norm([[4]], axis=1) except TypeError: def vector_...
2.890625
3
configs/_base_/explain/count_concepts.py
CAMP-eXplain-AI/imba-explain
0
42394
<filename>configs/_base_/explain/count_concepts.py concept_detector_cfg = dict( quantile_threshold=0.99, with_bboxes=True, count_disjoint=True, ) target_layer = 'layer3.5'
1.273438
1
ConditionalStatement/Firm.py
Rohitm619/Softuni-Python-Basic
1
42395
from math import floor from math import ceil hours_needed = int(input()) days_for_work = int(input()) overtime_workers = int(input()) normal_shift = 8 learn_time = days_for_work - days_for_work * 10 / 100 hours_for_work = learn_time * normal_shift overtime = overtime_workers * (2 * days_for_work) all_time = hours_for...
3.90625
4
tests/data_tests/reader_tests/xml_reader_test.py
alueschow/polymatheia
3
42396
"""Test the :class:`~polymatheia.data.reader.LocalReader`.""" import os import pytest from lxml.etree import XMLSyntaxError from polymatheia.data.reader import XMLReader def test_xml_reader(): """Test that the XML local reading works.""" count = 0 for record in XMLReader('tests/fixtures/xml_reader_test'...
2.828125
3
realtime-analysis-with-simple-model/app/__init__.py
natanascimento/realtime-image-analysis
0
42397
from app.infrastructure.repositories.camera.capture import CameraCapture def main(): CameraCapture().run()
1.265625
1
fipu_face/fipu_face.py
fipu-lab/fipu-face
1
42398
from fipu_face import retina_face as rf import binascii import time from fipu_face.utils import * from fipu_face.img_utils import * from exceptions.image_exception import * from fipu_face.img_config import * from fipu_face.segmentation.bg_segmentation import get_non_white_bg_pct # from fipu_face.facial_landmarks.emoti...
2.40625
2
examples/pix2pose/legacy/processors.py
dema-software-solutions/paz-1
0
42399
import numpy as np from paz.abstract import Processor from paz.backend.keypoints import project_points3D from paz.backend.keypoints import build_cube_points3D from paz.backend.image import draw_cube from paz.processors import DrawBoxes3D class DrawBoxes3D(Processor): def __init__(self, camera, class_to_dimensions...
2.578125
3