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
tests/extension/thread_/mutex_try_lock/test_thread_mutex_try_lock.py
akmaru/veriloggen
0
31400
from __future__ import absolute_import from __future__ import print_function import veriloggen import thread_mutex_try_lock expected_verilog = """ module test; reg CLK; reg RST; blinkled uut ( .CLK(CLK), .RST(RST) ); initial begin $dumpfile("uut.vcd"); $dumpvars(0, uut); end ini...
1.882813
2
CardiaT/idea/models.py
nikitasingh01/CardiaT
0
31401
from django.db import models from django.utils import timezone from django.contrib.auth.models import User class Idea(models.Model): title = models.CharField(max_length=100) content = models.TextField() date_posted = models.DateTimeField(default=timezone.now) author = models.ForeignKey(User, on_delet...
2.328125
2
sample_problems/problems_with_solution31.py
adi01trip01/adi_workspace
0
31402
# Write a Python program to compute the greatest common divisor (GCD) of two positive integers. n1 = int(input("Enter the first number: ")) n2 = int(input("Enter the second number: ")) a1 = [] a2 = [] a3 = [] for i in range(1, n1 + 1): if n1 % i == 0: a1.append(i) for i in range(1, n2 + 1): if n2 % ...
3.90625
4
Biological_Questions/Cell_Cycle_Duration/SuperOutliers_Plot_LinTrees.py
The-Kristina/CellComp
7
31403
<reponame>The-Kristina/CellComp import time start_time = time.process_time() import sys sys.path.append("../") from Biological_Questions.Cell_Cycle_Duration.Shortlist_Outliers import ShortlistOutliers from Movie_Analysis_Pipeline.Merging_Movie_Datasets.Find_Family_Class import FindFamily from Cell_IDs_Analysis.Plotte...
2.03125
2
keras_contrib/utils/kito.py
ZFTurbo/keras-contrib
0
31404
<reponame>ZFTurbo/keras-contrib<filename>keras_contrib/utils/kito.py """ Reduce neural net structure (Conv + BN -> Conv) Also works: DepthwiseConv2D + BN -> DepthwiseConv2D SeparableConv2D + BN -> SeparableConv2D This code takes on input trained Keras model and optimize layer structure and weights in such a way ...
2.78125
3
alipay/aop/api/domain/TopicItemVo.py
snowxmas/alipay-sdk-python-all
213
31405
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class TopicItemVo(object): def __init__(self): self._desc = None self._id = None self._status = None self._title = None @property def desc(self): return...
2.234375
2
project/api/views/bank_list.py
Rafiatu/cinch
0
31406
<filename>project/api/views/bank_list.py from rest_framework import status from rest_framework.viewsets import ViewSet from rest_framework.decorators import action from rest_framework.permissions import AllowAny, IsAuthenticated from api.lib.response import Response from payment.get_bank_list import BankList class Ba...
2.234375
2
Pipeline/4_R0_ARRP/Executable/r0_arrp_make.py
johnlspouge/R0_Unstratified_Case_Data
0
31407
<filename>Pipeline/4_R0_ARRP/Executable/r0_arrp_make.py #!/usr/bin/env python from os import system log = f'r0_arrp.log' C = ' -c ../../1_Prem_Matrices_to_df/Data/UNSDMethodology.csv' E = ' -e ../../3_Prem_Matrices_to_PF_Eigenvalue/Output/pf_eigenvalue.csv' S = ' -s ../../2_ARRP/Output/slope.csv' system( f'r0_arrp....
1.804688
2
cloudkitty-9.0.0/cloudkitty/rating/pyscripts/db/api.py
scottwedge/OpenStack-Stein
0
31408
<filename>cloudkitty-9.0.0/cloudkitty/rating/pyscripts/db/api.py # -*- coding: utf-8 -*- # Copyright 2015 Objectif Libre # # 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 # # h...
2.078125
2
scripts/src/communication/power_consumption.py
GLO3013-E4/COViRondelle2021
0
31409
<gh_stars>0 import time from ina219 import INA219 SHUNT_OHMS = 0.1 MAX_EXPECTED_AMPS = 0.2 def read(): ina1 = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, address=0x40) ina1.configure(ina1.RANGE_16V, ina1.GAIN_AUTO) # print("ici") # print("INA1 ==============") # print("Bus Voltage : %.3f V" % ina1...
2.828125
3
pyrobolearn/robots/littledog.py
Pandinosaurus/pyrobolearn
2
31410
<reponame>Pandinosaurus/pyrobolearn #!/usr/bin/env python # -*- coding: utf-8 -*- """Provide the Little Dog robotic platform. """ import os import numpy as np from pyrobolearn.robots.legged_robot import QuadrupedRobot __author__ = "<NAME>" __copyright__ = "Copyright 2018, PyRoboLearn" __license__ = "GNU GPLv3" __ver...
2.46875
2
Scripts/simulation/business/advertising_manager.py
velocist/TS4CheatsInfo
0
31411
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\business\advertising_manager.py # Compiled at: 2017-04-27 01:01:18 # Size of source mod 2**32: 6129 ...
2.03125
2
app.py
ansokolov/28days
0
31412
<gh_stars>0 import os import datetime import csv import json i = 0 def initial_menu(): user_action = input("1. Log In \n" + "2. Create new user \n" + "3. Create with CSV \n" + "4. Update with CSV \n") if user_action == "1": use...
3.734375
4
tests/integration_tests/test_shell_plate_rbe2.py
tchin-divergent/tacs
0
31413
import numpy as np from mpi4py import MPI from tacs import TACS, elements, constitutive, functions from static_analysis_base_test import StaticTestCase ''' Create a two separate cantilevered plates connected by an RBE3 element. Apply a load at the RBE2 center node and test KSFailure, StructuralMass, and Compliance fu...
2.34375
2
src/conntact/assembly_algorithm_blocks.py
swri-robotics/ConnTact
9
31414
<gh_stars>1-10 # Copyright 2021 Southwest Research Institute # Licensed under the Apache License, Version 2.0 #UR IP Address is now 172.16.17.32 #Computer has to be 172.16.31.10 # Imports for ros # from _typeshed import StrPath from builtins import staticmethod from operator import truediv from pickle import STRING,...
2.0625
2
2017/misc/ncme/server.py
HackGT/ctf-problems
2
31415
<reponame>HackGT/ctf-problems<gh_stars>1-10 ''' Simple socket server using threads ''' import socket import sys from thread import * def clientthread(conn): conn.send('Nice job! The flag is hackgt{here_kitty_kitty}\n') conn.close() HOST = '' # Symbolic name, meaning all available interfaces...
3.078125
3
tools/build_defs/buck_helpers.bzl
YifanShenSZ/pytorch
0
31416
# Only used for PyTorch open source BUCK build IGNORED_ATTRIBUTE_PREFIX = [ "apple", "fbobjc", "windows", "fbandroid", "macosx", ] IGNORED_ATTRIBUTES = [ "feature", "platforms", ] def filter_attributes(kwgs): keys = list(kwgs.keys()) # drop unncessary attributes for key in ke...
2.65625
3
Chapter8/datacurator.py
PacktPublishing/Testing-Time-Machines
1
31417
<reponame>PacktPublishing/Testing-Time-Machines import datetime import pandas as pd # Retrieve the test cases from the csv into a dictionary dataFile = open('testcases.csv', 'r') dataFrame = pd.read_csv('testcases.csv', index_col=0) dataDictionary = dataFrame.transpose().to_dict() # Create a new dictionary to save the...
2.875
3
src/rumour_dnn_evaluator.py
jerrygaoLondon/RPDNN
17
31418
<filename>src/rumour_dnn_evaluator.py import os from datetime import timedelta from allennlp.data.iterators import BucketIterator from allennlp.data.token_indexers import ELMoTokenCharactersIndexer from allennlp_rumor_classifier import load_classifier_from_archive, RumorTweetsDataReader from allennlp_rumor_classifier...
2.15625
2
1528_shuffle_string.py
kannan5/LeetCode
0
31419
<gh_stars>0 import math class Solution: def restoreString(self, s, indices): str_list, mov_index = list(s), 0 traverse = len(indices) for x in range(0, traverse): mov_index = indices[x] if mov_index == x: continue str_list[mov_index] = s...
3.390625
3
python2.7/site-packages/cpyrit/config.py
84KaliPleXon3/sslstrip-hsts-openwrt
4
31420
# -*- coding: UTF-8 -*- # # Copyright 2008-2011, <NAME>, <EMAIL> # # This file is part of Pyrit. # # Pyrit 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 version 3 of the License, or # ...
1.875
2
exercises/spiral-matrix/spiral_matrix.py
kishankj/python
1,177
31421
<filename>exercises/spiral-matrix/spiral_matrix.py def spiral_matrix(size): pass
0.78125
1
run_project.py
suryamp97/CSE_535_Project2_Boolean_Query_and_Inverted_Index
1
31422
<filename>run_project.py ''' @author: <NAME> Institute: University at Buffalo ''' from tqdm import tqdm from preprocessor import Preprocessor from indexer import Indexer from collections import OrderedDict from linkedlist import LinkedList import inspect as inspector import sys import argparse import json import time ...
2.765625
3
app/home/views.py
1IllI1/BBS_MIGRATE
0
31423
# coding:utf8 # 调用蓝图 from . import home from flask import render_template, redirect, url_for, flash, session, request,current_app from app.home.forms import RegistForm, LoginForm, UserdetailForm, PwdForm, CommentForm, PostForm from app.models import User, UserLoginLog, Comment, Post,Col from werkzeug.security import ge...
2.140625
2
NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/units/cgs.py
sahirsharma/Martian
0
31424
<reponame>sahirsharma/Martian<gh_stars>0 # -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines the CGS units. They are also available in the top-level `astropy.units` namespace. """ from __future__ import absolute_import, division, print_function, unicode_lit...
2.484375
2
sysinv/sysinv/sysinv/sysinv/api/controllers/v1/kube_version.py
albailey/config
10
31425
<gh_stars>1-10 # # Copyright (c) 2019 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # import pecan from pecan import rest from wsme import types as wtypes import wsmeext.pecan as wsme_pecan from sysinv.api.controllers.v1 import base from sysinv.api.controllers.v1 import collection from sysinv.commo...
2.03125
2
starter.py
michaelStettler/unsup2
0
31426
import sys import pylab as plb import numpy as np import mountaincar class DummyAgent(): """A not so good agent for the mountain-car task. """ def __init__(self, mountain_car = None, parameter1 = 3.0): if mountain_car is None: self.mountain_car = mountaincar.MountainCar() ...
3.15625
3
grove/alpha/jordan_gradient/jordan_gradient.py
mkeshita/grove
229
31427
import numpy as np from pyquil import Program from pyquil.api import QuantumComputer, get_qc from grove.alpha.jordan_gradient.gradient_utils import (binary_float_to_decimal_float, measurements_to_bf) from grove.alpha.phaseestimation.phase_estimation import phase_...
2.78125
3
test/benchmark/jvp_conv2d.py
jabader97/backpack
395
31428
from torch import randn from torch.nn import Conv2d from backpack import extend def data_conv2d(device="cpu"): N, Cin, Hin, Win = 100, 10, 32, 32 Cout, KernelH, KernelW = 25, 5, 5 X = randn(N, Cin, Hin, Win, requires_grad=True, device=device) module = extend(Conv2d(Cin, Cout, (KernelH, KernelW))).to...
2.703125
3
BSVega_vs_Upsilon.py
JanObloj/Robust-uncertainty-sensitivity-analysis
0
31429
# -*- coding: utf-8 -*- """ Spyder Editor Code written by <NAME> with modifications by <NAME> and <NAME> This file produces plots comparing our first order sensitivity with BS vega. """ # %% # To run the stuff, you need the package plotly in your anaconda "conda install plotly" import plotly.graph_objs as go from...
2.6875
3
lib/python/archive/cplexTest11.py
craigmax-dev/Mixed-Integer-Linear-Programming-for-Spacecraft-Maneuvers
0
31430
<filename>lib/python/archive/cplexTest11.py<gh_stars>0 import sys import docplex.mp import cplex # Teams in 1st division team_div1 = ["Baltimore Ravens","Cincinnati Bengals", "Cleveland Browns","Pittsburgh Steelers","Houston Texans", "Indianapolis Colts","Jacksonville Jaguars","Tennessee Titans","Buffa...
2.296875
2
DeepLearningExamples/TensorFlow2/Recommendation/WideAndDeep/data/outbrain/nvtabular/preproc.py
puririshi98/benchmark
0
31431
<filename>DeepLearningExamples/TensorFlow2/Recommendation/WideAndDeep/data/outbrain/nvtabular/preproc.py # Copyright (c) 2021, NVIDIA CORPORATION. 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 ...
1.921875
2
sfzlint/lint.py
kmturley/sfzlint
0
31432
<filename>sfzlint/lint.py<gh_stars>0 # -*- coding: utf-8 -*- import re import sys import xml.etree.ElementTree as ET from argparse import ArgumentParser from pathlib import Path from lark.exceptions import UnexpectedCharacters, UnexpectedToken from .parser import validate, SFZ, SFZValidatorConfig from . import spec, s...
2.46875
2
utils/GeneralUtils.py
nanohedra/nanohedra
2
31433
import numpy as np # Copyright 2020 <NAME> and <NAME>. __author__ = "<NAME> and <NAME>" __copyright__ = "Copyright 2020, Nanohedra" __version__ = "1.0" def euclidean_squared_3d(coordinates_1, coordinates_2): if len(coordinates_1) != 3 or len(coordinates_2) != 3: raise ValueError("len(coordinate list) !=...
2.8125
3
vscode/app.py
abdennour/samples
0
31434
<filename>vscode/app.py from flask import Flask, render_template, request, make_response, g import os import socket import random import json import collections hostname = socket.gethostname() votes = collections.defaultdict(int) app = Flask(__name__) def getOptions(): option_a = 'Cats' option_b = 'Dogs' ...
2.546875
3
src/NumericLettersParsers.py
shaigoldman/YotzerHaMafteach
0
31435
<gh_stars>0 """Hebrew Letter-Based Numering Identifiers and Quantifiers""" def remove_chucks(hebrew_word) -> str: """ Hebrew numbering systems use 'chuck-chucks' (aka quotation marks that aren't being used to signify a quotation) in between letters that are meant as numerics rather than w...
4.28125
4
tests/test_add.py
OwenMcDonnell/pglet-python
0
31436
import pytest import pglet from pglet import Textbox, Stack @pytest.fixture def page(): return pglet.page('test_add', no_window=True) def test_add_single_control(page): result = page.add(Textbox(id="txt1", label="<NAME>:")) assert result.id == "txt1", "Test failed" def test_add_controls_argv(page): t...
2.484375
2
src/collector/utils.py
baboon-king/2c
0
31437
<reponame>baboon-king/2c #!/usr/bin/env python """ Created by howie.hu at 2021/04/29. Description: 采集器相关通用工具函数 Changelog: all notable changes to this file will be documented """ import os import html2text import requests from gne import GeneralNewsExtractor from readability import Document from textrank4...
2.453125
2
Middleware.py
huobingli/fpyd
0
31438
<gh_stars>0 from mysql_comm.mysql_comm import * from redis_comm.redis_comm import * def insert_datas(datas): with UsingMysql(log_time=True) as um: pass def insert_data(database, data): with UsingMysql(log_time=True) as um: sql = "insert into " + database + "(fp_id, fp_title, fp_res_org, f...
2.453125
2
tests/llist_test.py
kata198/python-cllist
2
31439
#!/usr/bin/env python # -*- coding: utf-8 -*- import gc import sys import random import unittest from cllist import sllist from cllist import sllistnode from cllist import dllist from cllist import dllistnode gc.set_debug(gc.DEBUG_UNCOLLECTABLE | gc.DEBUG_STATS) if sys.hexversion >= 0x03000000: # python 3 compat...
2.40625
2
trio/_highlevel_open_unix_stream.py
monobot/trio
0
31440
import trio from trio._highlevel_open_tcp_stream import close_on_error from trio.socket import socket, SOCK_STREAM try: from trio.socket import AF_UNIX has_unix = True except ImportError: has_unix = False __all__ = ["open_unix_socket"] async def open_unix_socket(filename,): """Opens a connection to ...
2.671875
3
mod_setup_nftables.py
surarim/nifard
0
31441
#!/usr/local/bin/python3 # -*- coding: utf-8 -*- # Встроенные модули import time, sys, subprocess from threading import Thread # Внешние модули try: import psycopg2 except ModuleNotFoundError as err: print(err) sys.exit(1) # Внутренние модули try: from mod_common import * except ModuleNotFoundError as err: ...
2.140625
2
dlapp/forms.py
tavershimafx/E-library
0
31442
from django import forms from . models import Holdings class HoldingsForm(forms.ModelForm): class Meta: model = Holdings fields = ['title', 'holding', 'authors', 'category'] widgets={ 'title': forms.TextInput(attrs={'class': 'form-control'}), 'holding': forms.FileInp...
2.171875
2
tests/aircraft/deploys/ubuntu/models/v1beta3/storage_config_data_test.py
relaxdiego/aircraft
9
31443
<reponame>relaxdiego/aircraft import pytest from aircraft.deploys.ubuntu.models.v1beta3 import StorageConfigData @pytest.fixture def input_config(request): marker = request.node.get_closest_marker('data_kwargs') config = dict( disks=[ { 'path': '/dev/sda', ...
2.09375
2
tests/tests_core/test_definitions.py
markuswiertarkus/simbatch
1
31444
<filename>tests/tests_core/test_definitions.py from simbatch.core import core from simbatch.core.definitions import SingleAction import pytest # TODO check dir on prepare tests TESTING_AREA_DIR = "S:\\simbatch\\data\\" @pytest.fixture(scope="module") def simbatch(): # TODO pytest-datadir pytest-datafiles ...
1.976563
2
creational/singleton/singleton_main.py
Kozak24/Patterns
0
31445
<reponame>Kozak24/Patterns<filename>creational/singleton/singleton_main.py from creational.singleton.logic import God def main(): god = God() another_god = God() if god != another_god: raise Exception("God should be equal to God") for _ in range(0, 7): god.do_something() another...
2.96875
3
src/awss3/__init__.py
ZhiruiFeng/CarsMemory
9
31446
<reponame>ZhiruiFeng/CarsMemory #!/usr/bin/env python # aws s3
0.816406
1
rsa_demo/stubs/pyasn1/type/univ.py
jlinoff/rsa_demo
2
31447
<filename>rsa_demo/stubs/pyasn1/type/univ.py<gh_stars>1-10 # Really hackey stubs, not suitable for typeshed. from typing import Any class Integer(): def __init__(self, value: Any = None) -> None: ... class Sequence(): def __init__(self) -> None: ... def setComponentByPosition(self, idx: int, value: An...
2.25
2
2021/python/tests/test_day25.py
shalgrim/advent-of-code
0
31448
<gh_stars>0 import pytest from day25_1 import map_step, map_step_n from day25_1 import main as main1 @pytest.fixture def test_input(): with open('../../data/test25.txt') as f: return [line.strip() for line in f.readlines()] example_1_0 = [ list('...>...'), list('.......'), list('......>'), ...
2.40625
2
solver.py
satyenrajpal/speed-prediction-challenge
5
31449
<filename>solver.py import cv2, os import numpy as np import sys from utils import movingAverage, plot, computeAverage import queue from sklearn import linear_model class Solver(): def __init__(self, config): self.vid = cv2.VideoCapture(config.vidpath) self.txtfile = config.txtfile self.vis = config.vis self....
2.765625
3
status/trajectories.py
ioos/glider-dac-status
0
31450
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import json import requests import os import sys from app import app from shapely.geometry import LineString from status.profile_plots import iter_deployments, is_recent_data, is_recent_update def get_trajectory(erddap_url): ''' Reads the trajectory in...
2.5
2
game/client/view/pad/pad.py
AntonYermilov/progue
0
31451
from abc import ABC, abstractmethod class Pad(ABC): def __init__(self, view, x0: int, y0: int, x1: int, y1: int): """ Creates pad with corners in specified coordinates :param view: base view instance :param x0: x-coordinate of top left corner (included) :param y0: y-coordin...
4.0625
4
urls.py
audacious-software/Passive-Data-Kit-Codebook
0
31452
<filename>urls.py from django.conf.urls import url from .views import pdk_codebook_page, pdk_codebook_sitemap urlpatterns = [ url(r'^(?P<generator>.+)/$', pdk_codebook_page, name='pdk_codebook_page'), url(r'^sitemap.json$', pdk_codebook_sitemap, name='pdk_codebook_sitemap') ]
1.726563
2
model_evaluation/test_data.py
huawenbo/ERSW-project
5
31453
<filename>model_evaluation/test_data.py # -*- coding: utf-8 -*- """ Created on Sat May 8 09:54:36 2021 @author: Administrator """ import torch from torch.utils.tensorboard import SummaryWriter from sklearn.metrics import roc_auc_score import numpy as np # %% data = torch.load('dataset/dic_3_1_7878.pt') ...
2.15625
2
jdcloud_sdk/services/iotcore/models/ThingTypeInfoVO.py
Tanc009/jdcloud-sdk-python
14
31454
<reponame>Tanc009/jdcloud-sdk-python<filename>jdcloud_sdk/services/iotcore/models/ThingTypeInfoVO.py # coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 a...
2.03125
2
cars/admin.py
rngallen/signals
0
31455
<reponame>rngallen/signals from django.contrib import admin from .models import Car # Register your models here. @admin.register(Car) class CarAdmin(admin.ModelAdmin): list_display = ("name", "price", "buyer", "code")
1.664063
2
backend/forum/utils/djtools/query_cache.py
karolyi/forum-django
7
31456
from typing import Iterable, Optional from django import VERSION from django.db.models.base import Model from django.db.models.fields.related import ManyToManyField from django.db.models.fields.reverse_related import ManyToOneRel from django.db.models.manager import Manager from django.db.models.query import QuerySet ...
2.1875
2
web/poisson_web.py
DreadyBear/codereview
60
31457
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> import os import psycopg2 import numpy as np import pandas as pd import patsy import statsmodels.api as sm import pickle import random from math import floor, exp from datetime import * import pytz from dateutil.relativedelta import * import calendar fro...
2.53125
3
genericScreener.py
rsandx/generic-stocks-screener
0
31458
<reponame>rsandx/generic-stocks-screener<gh_stars>0 #! python3 import pandas as pd import numpy as np import re, json from ta import * import sys, os, logging, logging.config, traceback, concurrent_log_handler, getopt import multiprocessing as mp import contextlib import heapq import talib from datetime i...
1.929688
2
VideoReaders.py
aegissystems/yolact
1
31459
import cv2 class VideoReader(object): ''' Class docstring for VideoReader(): Provides a generator for video frames. Returns a numpy array in BGR format. ''' def __init__(self, file_name): self.file_name = file_name try: # OpenCV parses an integer to read a webcam. Supplying '0' wi...
3.3125
3
OrderBookContainer.py
sturex/pyOrderbookTrading
19
31460
import os import json from contextlib import suppress from OrderBook import * from Signal import Signal class OrderBookContainer: def __init__(self, path_to_file): self.order_books = [] self.trades = [] self.cur_directory = os.path.dirname(path_to_file) self.f_name = ...
2.59375
3
leetcode/0753_cracking_the_safe.py
jacquerie/leetcode
3
31461
<reponame>jacquerie/leetcode<gh_stars>1-10 # -*- coding: utf-8 -*- class Solution: def crackSafe(self, n, k): if k == 1: return '0' * n s = self.deBrujin(n, k) return s + s[:n - 1] def deBrujin(self, n, k): """See: https://en.wikipedia.org/wiki/De_Bruijn_sequence#A...
3.40625
3
estimators/apps.py
bearroast/django-estimators
46
31462
<reponame>bearroast/django-estimators from django.apps import AppConfig class EstimatorConfig(AppConfig): name = 'estimators'
1.164063
1
pwny/transfer.py
EntySec/Pwny
7
31463
<filename>pwny/transfer.py #!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2022 EntySec # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without...
2.15625
2
clorm/util/wrapper.py
potassco/clorm
21
31464
'''Functions and classes to wrap existing classes. Provides a wrapper metaclass and also a function that returns a wrapped class. The function is more flexible as a metaclass has multiple inheritence limitations. A wrapper metaclass for building wrapper objects. It is instantiated by specifying a class to be to be wra...
3.421875
3
hotel.py
youmitsu/tdr-reservation-clawler
0
31465
<reponame>youmitsu/tdr-reservation-clawler from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains import time import os import json import sys from lib import setupDriver, setupMode, access, stopUntilLoading, stopUntilSpinnerLoading from loginModule import loginSection from not...
2.53125
3
traceback_test.py
tor4z/python_test
0
31466
<filename>traceback_test.py import traceback class A: def __init__(self): pass def tb(self): es = traceback.extract_stack() print(es) fs = es[-2] print(fs.name) print(fs.locals) def another_function(): lumberstack(A()) lumberstack(A()) def lumberstac...
2.84375
3
dev/cpp/cpptarget.py
bowlofstew/client
40
31467
import os from biicode.common.model.brl.block_cell_name import BlockCellName from biicode.common.model.bii_type import BiiType def _binary_name(name): return os.path.splitext(name.replace("/", "_"))[0] class CPPTarget(object): def __init__(self): self.files = set() # The source files in this targe...
2.15625
2
monk/tf_keras_1/finetune/level_11_optimizers_main.py
Sanskar329/monk_v1
7
31468
from tf_keras_1.finetune.imports import * from system.imports import * from tf_keras_1.finetune.level_10_schedulers_main import prototype_schedulers class prototype_optimizers(prototype_schedulers): ''' Main class for all optimizers in expert mode Args: verbose (int): Set verbosity levels ...
2.078125
2
test/com/facebook/buck/core/module/impl/test_app.py
Unknoob/buck
8,027
31469
<reponame>Unknoob/buck<filename>test/com/facebook/buck/core/module/impl/test_app.py # Copyright (c) Facebook, Inc. and its affiliates. # # 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 # # ...
2
2
models/FastNeuralStyleTransferModel.py
taivu1998/GANime
24
31470
''' This program implements a Fast Neural Style Transfer model. References: https://www.tensorflow.org/tutorials/generative/style_transfer ''' from __future__ import absolute_import, division, print_function, unicode_literals import tensorflow as tf import tensorflow_hub as hub import os, sys import time import...
2.984375
3
editor/urls.py
AndersonBY/p5py
15
31471
# -*- coding: utf-8 -*- # @Author: Anderson # @Date: 2019-04-25 00:30:09 # @Last Modified by: ander # @Last Modified time: 2019-12-07 01:14:16 from django.urls import path from . import views urlpatterns = [ path("", views.editor, name="editor"), path("upload_code", views.upload_code, name="upload_code") ...
1.578125
2
Data Science Bootcamp for Beginners/4.py
yuto-moriizumi/Python
0
31472
<reponame>yuto-moriizumi/Python s = "Rats live on no evil star" print(s[::-1])
1.96875
2
models/get_train_stats.py
olavosamp/semiauto-video-annotation
0
31473
import numpy as np import torchvision.datasets as datasets from pathlib import Path import libs.dirs as dirs import libs.utils as utils import libs.dataset_utils as dutils import models.utils as mutils import libs.commons as commons from libs.vis_fun...
2.3125
2
pre_processing.py
ziyuanli17/Vessel-Segmentation
0
31474
import cv2 as cv import sys import numpy as np import tifffile as ti import argparse import itertools max_lowThreshold = 100 window_name = 'Edge Map' title_trackbar = 'Min Threshold:' ratio = 3 kernel_size = 3 def CannyThreshold(val): low_threshold = val #img_blur = cv.blur(src_gray, (3,3)) ...
2.625
3
tests/hpp/tests/test_generation_utils.py
javisenberg/addonpayments-Python-SDK
2
31475
# -*- encoding: utf-8 -*- from __future__ import absolute_import, unicode_literals import re from addonpayments.utils import GenerationUtils class TestGenerationUtils: def test_generate_hash(self): """ Test Hash generation success case. """ test_string = '20120926112654.thestore...
2.59375
3
tcellmatch/models/layers/layer_conv.py
theislab/tcellmatch
25
31476
<gh_stars>10-100 import tensorflow as tf from typing import Union, Tuple class LayerConv(tf.keras.layers.Layer): """ A layer class that implements sequence convolution. Instances of this class can be used as layers in the context of tensorflow Models. This layer implements convolution and pooling. Uses t...
3.375
3
form-ex2/main.py
acandreani/ads_web_exercicios
1
31477
<reponame>acandreani/ads_web_exercicios from flask import Flask, render_template, request app = Flask(__name__) bd={"usuario":"<EMAIL>","senha":"12345"} def usuario_existe(usuario): return usuario == bd["usuario"] def verifica_senha(usuario,senha): return usuario == bd["usuario"] and senha==bd["senha"] ...
2.859375
3
raspberry/camera/get_number_faces_opencv.py
Dangaran/home_station_project
0
31478
import picamera from time import sleep from time import time import os import numpy as np import cv2 import imutils import argparse import face_recognition from camera.check_rectangle_overlap import check_rectangle_overlap # https://picamera.readthedocs.io/en/release-1.0/api.html def get_number_faces(): time_now...
2.96875
3
ejercicios_basicos/poo/poo10/test_figura_geo.py
JuanDuran85/ejemplos_python
0
31479
<reponame>JuanDuran85/ejemplos_python from Cuadrado import Cuadrado from Rectangulo import Rectangulo print("Creacion objeto Cuadrado".center(50, "-")) cuadrado1 = Cuadrado(lado=10, color='azul') print(cuadrado1) print(cuadrado1.color) print(cuadrado1.ancho) print(cuadrado1.alto) print(cuadrado1.area()) # trabajando...
3.046875
3
Gems/AWSCore/Code/Tools/ResourceMappingTool/multithread/worker.py
aaarsene/o3de
1
31480
<reponame>aaarsene/o3de<gh_stars>1-10 """ Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT """ import sys import traceback from PySide2.QtCore import (QObject, QRunnabl...
2
2
loopchain/blockchain/blocks/v0_5/block_builder.py
windies21/loopchain
105
31481
<gh_stars>100-1000 # Copyright 2018-current ICON Foundation # # 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 applicabl...
1.992188
2
calculadora.py
rheimon1/Calculadora
0
31482
<reponame>rheimon1/Calculadora def media_suicida (mediaProvas, mediaTrabalhos): if mediaProvas >= 5 and mediaTrabalhos >= 5: return mediaProvas * 0.6 + mediaTrabalhos * 0.4 return min(mediaProvas, mediaTrabalhos) notasProva = [] notasTrabalho = [] quantidadeProva = int(input("Quantidade de provas: ")...
3.5
4
lstm-lm/encoder.py
helloMLWo/daga
46
31483
<reponame>helloMLWo/daga """Encoder module""" from __future__ import division import torch import torch.nn as nn from torch.nn.utils.rnn import pack_padded_sequence as pack from torch.nn.utils.rnn import pad_packed_sequence as unpack class LSTMEncoder(nn.Module): """LSTM encoder""" def __init__( sel...
2.6875
3
StataLovers/StataLovers/main_func.py
Kolpashnikova/StataLoversSource
0
31484
<reponame>Kolpashnikova/StataLoversSource import pandas as pd def summarize(vars, df): ''' this function prints out descriptive statistics in the similar way that Stata function sum does. Args: pandas column of a df Output: None (print out) ''' num = max([len(i) for i in vars]) if num <...
4.03125
4
study_notes/proga_mod.py
chicolucio/python_useful_tips
0
31485
<gh_stars>0 print('Begin', __name__) print('Defines fA') def fA(): print('Inside fA') if __name__ == "__main__": print('Calls fA') fA() print('End', __name__)
2.4375
2
wdae/wdae/common_reports_api/tests/test_common_reports_api.py
iossifovlab/gpf
0
31486
<filename>wdae/wdae/common_reports_api/tests/test_common_reports_api.py import pytest from rest_framework import status pytestmark = pytest.mark.usefixtures( "wdae_gpf_instance", "dae_calc_gene_sets", "use_common_reports" ) def test_variant_reports(admin_client): url = "/api/v3/common_reports/studies/study4...
2.125
2
ckan/tests/logic/action/test_create.py
rossjones/ckan-mini
3
31487
<reponame>rossjones/ckan-mini '''Unit tests for ckan/logic/auth/create.py. ''' from pylons import config import mock import nose.tools import ckan.tests.helpers as helpers import ckan.tests.factories as factories import ckan.model as model import ckan.logic as logic import ckan.plugins as p assert_equals = nose.too...
2.15625
2
CodeWars/7 Kyu/Broken sequence.py
anubhab-code/Competitive-Programming
0
31488
def find_missing_number(sequence): try: numbers = sorted(int(word) for word in sequence.split(" ") if word) except ValueError: return 1 return next((i + 1 for i, n in enumerate(numbers) if i + 1 != n), 0)
3.875
4
Topsis_Samarth_102083050/t_102083050.py
Samarth-Gupta-2909/Topsis_Samarth_102083050
0
31489
<reponame>Samarth-Gupta-2909/Topsis_Samarth_102083050 import pandas as pd import os import sys def main(): # Arguments not equal to 5 if len(sys.argv) != 5: print("ERROR : NUMBER OF PARAMETERS") print("USAGE : python topsis.py inputfile.csv '1,1,1,1' '+,+,-,+' result.csv ") exi...
3.0625
3
pyrichlet/weight_models/_pitman_yor_process.py
cabo40/pyrichlet
13
31490
from ._base import BaseWeight from ..exceptions import NotFittedError from ..utils.functions import mean_log_beta import numpy as np from scipy.special import loggamma class PitmanYorProcess(BaseWeight): def __init__(self, pyd=0, alpha=1, truncation_length=-1, rng=None): super().__init__(rng=rng) ...
2.203125
2
nlp/router.py
kirollosHossam/MachineLearningTask
0
31491
from __future__ import annotations from typing import Dict, List, Optional, Union from fastapi import FastAPI, HTTPException from pydantic import BaseModel from nlp.nlp import Trainer app = FastAPI() trainer = Trainer() #BaseModel is used as data validator when using fast api it cares all about exception handilng and ...
2.796875
3
alibabacloud/endpoint/default_endpoint_resolver.py
wallisyan/alibabacloud-python-sdk-v2
0
31492
<reponame>wallisyan/alibabacloud-python-sdk-v2<gh_stars>0 # Copyright 2018 Alibaba Cloud 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...
1.375
1
src/experiment_collector.py
Context-Aware-Monitoring/Efficient-Stream-Monitoring
0
31493
import pandas as pd import numpy as np import glob import os import global_config import yaml import time import sys import collections def flatten(d, parent_key='', sep='_'): items = [] for k, v in d.items(): new_key = parent_key + sep + k if parent_key else k if isinstance(v, collections.Mut...
2.140625
2
coord2vec/pipelines/lagoon_utils/auto_stage.py
jonzarecki/coord2vec
0
31494
<reponame>jonzarecki/coord2vec from typing import Union, List from lagoon import Stage, Task from coord2vec.pipelines.lagoon_utils.lambda_task import LambdaTask class AutoStage(Stage): def __init__(self, name: str, **kwargs): super().__init__(name, **kwargs) self.output_param_to_task = dict() ...
2.53125
3
recipes/Python/576708_DVMVersusCAPM/recipe-576708.py
tdiprima/code
2,023
31495
<gh_stars>1000+ #On the name of ALLAH and may the blessing and peace of Allah #be upon the Messenger of Allah <NAME>. #Author : <NAME> #Date : 07/03/09 #version :2.6.1 """ collections module's extras in python 2.6.1 were used in my program, DVMextrapolating DVMgordonsModel and CAPM subclasses of namedtuple Python cla...
3.40625
3
nexinfosys/restful_service/service_main.py
ENVIRO-Module/nis-backend
4
31496
<reponame>ENVIRO-Module/nis-backend import binascii import csv import io import json import logging import os import traceback import urllib from pathlib import Path import openpyxl import pandas as pd import pyximport import redis # from flask import (jsonify, abort, redirect, url_for, # # ) from N...
1.820313
2
readthedocs/doc_builder/backends/mkdocs.py
storagebot/readthedocs.org
0
31497
<reponame>storagebot/readthedocs.org import os import shutil import codecs import logging import zipfile from django.template import Template, Context from django.contrib.auth.models import SiteProfileNotAvailable from django.core.exceptions import ObjectDoesNotExist from django.conf import settings from builds impor...
1.789063
2
resources/trials/maya/rotateOrderSym.py
adrienparis/Gapalion
0
31498
<reponame>adrienparis/Gapalion<gh_stars>0 #!/bin/env mayapy # -- coding: utf-8 -- u"""Ce test vérifie que le transform [LEFT] a bien le même rotateOrder que le transform [RIGHT] Les [does not exist] indique un problème dans la nomenclature des noms et donc qu'il ne peut tester la symétrie des rotateOrders""" __author...
2.546875
3
prompt2.py
lreicher/astr-19
0
31499
# <NAME> Prompt #3 - Coding Journal #1 def main(): # Uses formatted strings to output the required info (result & type) # Adds floats x = 1.342 # float y = 3.433 # float z = x + y # float float_sum_string = "Addition: {0} + {1} = {2} with type = {3}".format(str(x),str(y),str(z),str(ty...
4.25
4