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
fltk/synthpriv/datasets/__init__.py
tudelft-eemcs-dml/fltk-testbed-gr-1
0
12769951
from .adult import DistAdultDataset from .purchase import DistPurchaseDataset from .synthetic import SyntheticDataset from .texas import DistTexasDataset
0.914063
1
core/switch.py
kit-tm/fdeval
1
12769952
from core.consumable import Consumable from core.events import * from core.engine import Engine class Port: def __init__(self, id): self.id = id self.target = None self.link_out = None self.link_in = None self.delegated = None # This variable is used to calculate ...
2.734375
3
scripts/attacks.py
akashkumar25/AnalysisBySynthesis
59
12769953
# --- # jupyter: # jupytext_format_version: '1.2' # kernelspec: # display_name: Python 3 # language: python # name: python3 # language_info: # codemirror_mode: # name: ipython # version: 3 # file_extension: .py # mimetype: text/x-python # name: python # nbconvert_export...
2.140625
2
test.py
spokenlore/PythonCalendar
0
12769954
import time def main(): start = time.time() minimumElapsed = .5 while True: if time.time() - start > minimumElapsed: print "Loading..." minimumElapsed += .5 main()
3.4375
3
woodcutter/src/Gamestate.py
cevirici/dominion-woodcutter
0
12769955
<reponame>cevirici/dominion-woodcutter # -*- coding: utf-8 -*- from .Card import * from .Pile import * from .Utils import * class Gamestate: def __init__(self): self.cards = [] self.zones = {z: [[] for p in range(PLAYER_COUNT)] for z in PlayerZones} self.zones.update({z: [] for z in Neutra...
2.484375
2
neurokit2/ecg/ecg_peaks.py
danibene/NeuroKit
0
12769956
# - * - coding: utf-8 - * - from ..signal import signal_fixpeaks, signal_formatpeaks from .ecg_findpeaks import ecg_findpeaks def ecg_peaks( ecg_cleaned, sampling_rate=1000, method="neurokit", correct_artifacts=False, **kwargs ): """**Find R-peaks in an ECG signal** Find R-peaks in an ECG signal using t...
3.1875
3
preprocess/export_docIds.py
nladuo/snrm
0
12769957
<filename>preprocess/export_docIds.py import pymongo import json client = pymongo.MongoClient() db = client.snrm coll = db.docs docIds = [] for doc in coll.find({}): docIds.append(doc["docNo"]) with open("../data/docIds.json", "w") as f: json.dump(docIds, f)
2.6875
3
tests/source_image_caching_resolver_ut.py
jamieparkinson/loris
150
12769958
<gh_stars>100-1000 import os import shutil import unittest from tests.abstract_resolver import AbstractResolverTest from loris import resolver class SourceImageCachingResolverTest(AbstractResolverTest, unittest.TestCase): def setUp(self): super(SourceImageCachingResolverTest, self).setUp() tests...
2.609375
3
tests/api/single_load/test_optional_types.py
ssato/python-anyconfig
213
12769959
# # Copyright (C) 2021 <NAME> <<EMAIL>> # License: MIT # # pylint: disable=missing-docstring import unittest import anyconfig.api from . import common LOADER_TYPES = frozenset(anyconfig.api.list_types()) @unittest.skipIf('yaml' not in LOADER_TYPES, 'yaml loader is not available') class YamlTestCa...
1.992188
2
logic.py
qwlea/chess
0
12769960
<filename>logic.py import pygame # This class internally handles all of the board logic that's necessary to ensure legal moves are played class Logic: def __init__(self, bd): self._board = bd # This is a utility function that is used by the other functions of this class def verify_legal(se...
3.640625
4
josm/uniteStopAreaRelationsByName.py
mapanica/scripts
0
12769961
<reponame>mapanica/scripts #!/bin/jython ''' This code is released under the WTFPL – Do What the Fuck You Want to Public License. ''' from javax.swing import JOptionPane from org.openstreetmap.josm import Main import org.openstreetmap.josm.command as Command import org.openstreetmap.josm.data.osm.Node as Node import ...
1.945313
2
services/process/icdar_process_service.py
ktodorov/historical-ocr
0
12769962
from entities.cache.cache_options import CacheOptions import os from services.file_service import FileService from torch._C import dtype import numpy as np import torch from tqdm import tqdm from typing import List, Tuple from enums.ocr_output_type import OCROutputType from enums.language import Language from servic...
2
2
tasks/task_viper/temp.py
chenyanghungry/person-reid-lib
81
12769963
<gh_stars>10-100 import numpy as np a = [53, 13, 84, 32, 1] b = np.random.choice(len(a), 3, True) print(a[b])
2.734375
3
beginner_contest/133/B.py
FGtatsuro/myatcoder
0
12769964
_input = [i for i in open(0).read().split('\n') if i] n, d = [int(i) for i in _input[0].split()] x_list = [[int(i) for i in x.split()]for x in _input[1:]] x_list2 = x_list[:] import math count = 0 for x1 in x_list: for x2 in x_list2: dist = math.sqrt(sum((x1[i]-x2[i])**2 for i in range(d))) if int...
3.078125
3
Quantitative Finance/MultiPeriod_Bionmial.py
darnoceloc/Algorithms
0
12769965
""" # T: maturity # n: # option periods # N: # futures periods # S: initial stock price # r: continuously-compounded interest rate # c: dividend yield # sigma: annualized volatility # K: strike price # cp: +1/-1 with regards to call/put """ from __future__ import division from math import exp, sqrt import numpy as np...
3.328125
3
projects/make-project.py
2-complex/g2c
1
12769966
<reponame>2-complex/g2c<filename>projects/make-project.py import shutil import sys import os def replace_in_file(path, a, b): f = open(path, 'r') s = f.read().replace(a, b) f.close() f = open(path, 'w') f.write(s) f.close() def replace_in_filename(path, a, b): j = len(path)-1 if path[-1]!='/': j-=1 whil...
3.25
3
test/test_pyfftw_numpy_interface.py
insertinterestingnamehere/pyFFTW
0
12769967
<filename>test/test_pyfftw_numpy_interface.py # Copyright 2014 Knowledge Economy Developments Ltd # # <NAME> # <EMAIL> # # 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 s...
1.304688
1
qs-engine/settings.py
kirte2849/Quickspy
1
12769968
###Database #database typy Option:(mongodb, mysql, redis) DB_TYPE = 'mongdb' #database ip DB_HOST = 'localhost' #database port DB_PORT = '1' #username #USERNAME = None #passward #PASSWARD = None #database name DB_DBNAME = 'quickspy' ###
1.632813
2
dnn_biot/test_dnn_biot.py
AasmundResell/FEniCS-Brain-Flow
0
12769969
from fenics import * from matplotlib.pyplot import show from dolfin_adjoint import * from ufl_dnn.neural_network import ANN class BoundaryOuter(SubDomain): def inside(self, x, on_boundary): return on_boundary def a_u(u, v): return my * (inner(grad(u), grad(v)) + inner(grad(u), nabla_grad(v))) * dx def...
2.609375
3
knowledge_extractor/pipeline.py
janez87/social-knowledge-extractor
5
12769970
<reponame>janez87/social-knowledge-extractor<filename>knowledge_extractor/pipeline.py import pprint import pandas as pd import collections from scipy.spatial.distance import cosine from .strategies.AST import AST from .strategies.EHE import EHE from flask import current_app class Pipeline: def createSpace(self,se...
2.453125
2
apps/external_apps/swaps/admin.py
indro/t2c
3
12769971
<filename>apps/external_apps/swaps/admin.py from django.contrib import admin from swaps.models import Offer, Swap class OfferAdmin(admin.ModelAdmin): list_display = ('offerer', 'short_description', 'offering', 'want', 'state', 'swapped_by') list_filter = ('offerer', 'state') search_fields ...
1.703125
2
py/skr/commands/cmd_octodex.py
er1iang/awesome-pyscript
3
12769972
import click import logging import os import requests import xml.etree.ElementTree as ET from multiprocessing.dummy import Pool class OctocatsDownloader: feeds_url = "http://feeds.feedburner.com/Octocats" def __init__(self, output="octocats", max_threads=5, force=False, logger=None): if not os.path.e...
2.546875
3
bigdata_study/pyflink1.x/core/table_operator.py
kingreatwill/penter
13
12769973
from pyflink.table import * from pyflink.table.expressions import col, lit, concat from pyflink.table.window import Tumble def demo01(): # environment configuration t_env = BatchTableEnvironment.create(environment_settings=EnvironmentSettings.new_instance().in_batch_mode().use_blink_planner().build()) # ...
2.375
2
Module/startingInventory.py
1234567890num/KH2Randomizer
7
12769974
from Class.locationClass import KH2StartingItem class StartingInventory: def generateStartingInventory(inventory, itemsToAdd): for item in itemsToAdd: inventory.setReward(int(item)) def getOptions(): return { "moduleName": "Sora's Starting Inventory", "opti...
2.875
3
opencda/core/actuation/pid_controller.py
xiaxin2000/OpenCDA-Documents
1
12769975
# -*- coding: utf-8 -*- """ PID Control Class """ # Author: <NAME> <<EMAIL>> # License: MIT from collections import deque import math import numpy as np import carla class Controller: """ PID Controller implementation. Parameters ---------- args : dict The configuration dictionary parse...
3.03125
3
fedlab_benchmarks/feature-skew-fedavg/models.py
KarhouTam/FedLab-benchmarks
46
12769976
<gh_stars>10-100 import torch import torch.nn as nn import torch.nn.functional as F """ Code below is from NIID-bench official code: https://github.com/Xtra-Computing/NIID-Bench """ class SimpleCNNMNIST(nn.Module): def __init__(self, input_dim, hidden_dims, output_dim=10): super(SimpleCNNMNIST, self).__ini...
3.046875
3
shop/forms.py
KWeselski/Shop-Django
0
12769977
<filename>shop/forms.py<gh_stars>0 from django import forms class CouponForm(forms.Form): code = forms.CharField(widget=forms.TextInput(attrs={ 'class': 'form-control', 'placeholder': 'Promo code', 'aria-label': 'Recipient\'s username', 'aria-describedby': 'basic-addon2' }))
1.71875
2
prediction/FaceDetectMicroservice/secrets.py
anishapai/CombinedTechStack
1
12769978
<reponame>anishapai/CombinedTechStack API_KEY = 'paste_your_api_key_here'
1
1
ATFGen/pida_types/tstr.py
goodwinxp/ida_info_code_gen
1
12769979
from abc_type import IdaTypes from ida_types import IDA_TYPES class IdaTStr(IdaTypes): def __init__(self, ida_type=IDA_TYPES['str']): self.ida_type = {'idt': ida_type, 'value': ''} def decode(self, data): count = ord(data[0]) offset = 1 for i in range(0, count): im...
2.375
2
hackerrank/contests/zenhacks/bob.py
spradeepv/dive-into-python
0
12769980
""" Problem Statement Bob is in a candy shop and wants to purchase his favorite candy, which he knows costs N dollars. He has an infinite number of 1,2,5,10,20,50, and 100 dollar bills in his pocket. Bob wants to know the number of different ways he can pay the N dollars for his candy. Input Format A single integer,...
3.796875
4
RecSearch/Tests/DataInterfaces/Splitters/Test_query.py
matthew-kimm/RecSearch
0
12769981
<filename>RecSearch/Tests/DataInterfaces/Splitters/Test_query.py from RecSearch.DataInterfaces.Splitters.query import IXQuerySplit from RecSearch.Tests.DataInterfaces.Splitters.SharedTestSplitter import SharedTestSplitter import unittest import pandas as pd class TestQuerySplitter(SharedTestSplitter, unittest.TestCas...
2.609375
3
pypoptools/pypoptesting/tests/pop_e2e.py
black0rwhite/alt-integration-cpp
0
12769982
""" Test with multiple nodes, and multiple PoP endorsements, checking to make sure nodes stay in sync. """ import time from ..framework.test_framework import PopIntegrationTestFramework from ..framework.pop_util import endorse_block, mine_until_pop_enabled from ..framework.sync_util import start_all, connect_all, sync...
2.265625
2
blog/articles/urls.py
dotHashemi/django-practice
1
12769983
<filename>blog/articles/urls.py<gh_stars>1-10 from django.urls import path from articles import views urlpatterns = [ path('', views.index, name='articles.index'), path('<int:id>/', views.show, name='articles.show'), ]
1.875
2
hyrodactil/tests/public/test_views.py
hizardapp/Hizard
1
12769984
<gh_stars>1-10 import os from django.core import mail from django.core.urlresolvers import reverse from django_webtest import WebTest from ..factories._accounts import UserFactory from ..factories._companysettings import ( InterviewStageFactory ) from ..factories._openings import OpeningWithQuestionFactory from ...
2.25
2
src/printBoard.py
Harry-Hopkinson/dots-and-boxes
1
12769985
<filename>src/printBoard.py<gh_stars>1-10 from checkDraw import * from checkWin import * from constants import * from endGame import * from play import * from playAgain import * from playerOneMove import * from playerTwoMove import * from board import * def printBoard(board): for i in range(len(board)...
3.34375
3
supermarketToexpress/views.py
NotEnterprising/DATABASE_supermarket
0
12769986
<filename>supermarketToexpress/views.py from django.contrib.auth.decorators import login_required from django.contrib import messages from django.shortcuts import render, HttpResponseRedirect, redirect from supermarket.models import Supermarket from .models import SupermarketToExpress from .forms import CreateSupermar...
2.296875
2
mechlib/filesys/_rct.py
sjklipp/mechdriver
0
12769987
""" rct cnf fs because don't knwo where else to put it and avoid circular imports """ from mechanalyzer.inf import thy as tinfo from mechlib.filesys._build import build_fs from mechlib.filesys.mincnf import min_energy_conformer_locators def rcts_cnf_fs(rct_infos, thy_dct, es_keyword_dct, run_prefix, save_prefix...
1.992188
2
floo/editor.py
barrasch/floobits-sublime
124
12769988
import sys import os try: import sublime except Exception: pass NEW_ACCOUNT_TXT = '''Welcome {username}!\n\nYou're all set to collaborate. You should check out our docs at https://{host}/help/plugins/sublime#usage. You must run 'Floobits - Complete Sign Up' so you can log in to the website.''' LINKED_ACCOU...
2.359375
2
supervisord_dependent_startup/tests/__init__.py
bendikro/ordered-startup-supervisord
54
12769989
from __future__ import print_function import os from supervisord_dependent_startup.supervisord_dependent_startup import (DependentStartup, DependentStartupError, get_all_co...
2.046875
2
Python/Loops/loops.py
boneskewer69/ifis
0
12769990
<gh_stars>0 x = 1 while True: x = input("Number:\n> ") if int(x) == 0: break
3.15625
3
bin/simulate_stream.py
astrolabsoftware/fink-alert-simulator
0
12769991
#!/usr/bin/env python # Copyright 2019-2022 AstroLab Software # Author: <NAME> # # 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 re...
2.109375
2
array_processing/__init__.py
uafgeotools/array_processing
9
12769992
<gh_stars>1-10 from . import algorithms from . import tools
1.03125
1
apps/common/functions.py
iamjdcollins/districtwebsite
0
12769993
<filename>apps/common/functions.py import os import shutil import re import uuid from urllib.parse import urlparse, urlsplit, urlunsplit from django.conf import settings from django.apps import apps from django.db.models import Q from django.core.mail import EmailMessage from django.contrib.auth import get_permission_c...
1.820313
2
ros/src/util/packages/data_preprocessor/scripts/get_ImageTopic.py
baharkhabbazan/autoware
64
12769994
<reponame>baharkhabbazan/autoware #!/usr/bin/env python import sys import os import rospy import numpy as np import cv2 import pcl from get_rosbaginfo import get_type_and_topic, get_baginfo import sensor_msgs.point_cloud2 as pc2 from sensor_msgs.msg import Image, PointCloud2 from cv_bridge import CvBridge class Image...
2.4375
2
src/sqlfluff/core/rules/std/L001.py
netlify/sqlfluff
2
12769995
"""Implementation of Rule L001.""" from sqlfluff.core.rules.base import BaseRule, LintResult, LintFix from sqlfluff.core.rules.doc_decorators import document_fix_compatible @document_fix_compatible class Rule_L001(BaseRule): """Unnecessary trailing whitespace. | **Anti-pattern** | The • character represe...
2.59375
3
CI/src/integration_tests/test_image_with_symlink_over_directory.py
tdhooks/sarus
84
12769996
<reponame>tdhooks/sarus # Sarus # # Copyright (c) 2018-2021, ETH Zurich. All rights reserved. # # Please, refer to the LICENSE file in the root directory. # SPDX-License-Identifier: BSD-3-Clause import unittest import common.util as util class TestImageWithSymlinkOverDirectory(unittest.TestCase): """ These ...
2.0625
2
Sets/12_Check Subset.py
FaranakAlikhah/ADM-HW1
0
12769997
<filename>Sets/12_Check Subset.py #!/usr/bin/env python # coding: utf-8 # # *section 4: Strings* # # ### writer : <NAME> 1954128 # ### 12.Check Subset: # # # In[ ]: num_testCase=int(input()) for i in range(num_testCase): num_testCase1=int(input()) a=set(input().split()) num_testCase2=int(input()) ...
3.015625
3
examples/Mansell/Hannibal.py
Rapid-Design-of-Systems-Laboratory/beluga-legacy
1
12769998
#================================================================================== # PROGRAM: "Hannibal.py" # LOCATION: beluga>examples>Mansell # Author: <NAME> (2016) # # Description: Preliminary test of a track path optimization using a user-defined # terrain elevation profile. #========================...
2.765625
3
pymeterreader/core/channel_upload_info.py
Schwaneberg/pymeterreader
5
12769999
import typing as tp from dataclasses import dataclass from datetime import datetime, timedelta @dataclass() class ChannelUploadInfo: """ Channel Upload info structure :param uuid: uuid of db entry to feed :param interval: interval between readings in seconds :param factor: multiply to original val...
2.90625
3
app/razorpay_gateway/models.py
S3Infosoft/s3-loyalty-webapp
0
12770000
from django.db import models from django.utils import timezone import datetime # Create your models here. class PurchaseOrder(models.Model): razorpay_payment_id=models.CharField(max_length=100) razorpay_order_id=models.CharField(max_length=100) razorpay_signature=models.CharField(max_length=500) user_unique_id=mo...
2.40625
2
PROIE.py
yyaddaden/PROIE
5
12770001
# -*- coding: UTF-8 -*- import cv2 import matplotlib.pyplot as plt import numpy as np class PROIE(): def __init__(self): ##### pass # PRIVATE METHODS def _threshold(self): ##### self.blur_img = cv2.GaussianBlur(self.in_img_g, (5, 5), 0) _, self.thresh_img = cv2....
2.9375
3
hth/news/tests/test_admin.py
roperi/myband
1
12770002
from hth.core.tests.selenium import AdminTestCase class NewsTestCase(AdminTestCase): def test_can_create_post(self): # Ryan logs into the admin self.adminLogin() # He adds a draft Post self.find_link('Posts').click() self.find_link('ADD POST').click() self.find...
2.453125
2
hentaihavendev/__init__.py
unsecuring/hentaihavendev
0
12770003
from hentaihavendev import fact from hentaihavendev import nsfw
0.949219
1
Course 01 - Getting Started with Python/Extra Studies/Functions/ex010.py
marcoshsq/python_practical_exercises
9
12770004
<filename>Course 01 - Getting Started with Python/Extra Studies/Functions/ex010.py # Exercise 105 - Parsing and Generating Dictionaries '''Write a program that has a grades() function that can receive multiple grades from students and will return a dictionary with the following information: - Number of notes - The h...
4.125
4
tests/unit/common/test_alignedtable.py
hrnciar/hdmf
0
12770005
import numpy as np from pandas.testing import assert_frame_equal import warnings from hdmf.backends.hdf5 import HDF5IO from hdmf.common import DynamicTable, VectorData, get_manager, AlignedDynamicTable from hdmf.testing import TestCase, remove_test_file class TestAlignedDynamicTableContainer(TestCase): """ T...
2.515625
3
Filtering/filter_pileup_for_unique_sites.py
Lammlab/Resic
3
12770006
<gh_stars>1-10 ############################################################################################################################## # Author: <NAME> # Main goal: Takes several pileup files and for each one prints to a new file only unique sites (that is, only sites that are # not in any of the other pileup...
2.5
2
reviewboard/accounts/views.py
amalik2/reviewboard
921
12770007
from __future__ import unicode_literals import logging from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.forms.forms import ErrorDict from django.http import HttpResponseRedire...
1.210938
1
{{cookiecutter.project_slug}}/tasks.py
i2biz/cookiecutter-python-pylint
0
12770008
<filename>{{cookiecutter.project_slug}}/tasks.py # coding=utf-8 from invoke import task @task def style(ctx): ctx.run( "black --check {{cookiecutter.project_slug}} {{cookiecutter.project_slug}}_test" ) @task def lint(ctx): ctx.run( "pylint {{cookiecutter.project_slug}} {{cookiecutter.pr...
1.921875
2
test/test_image_streamer_deployment_group_facts.py
nabhajit-ray/oneview-ansible
108
12770009
<reponame>nabhajit-ray/oneview-ansible #!/usr/bin/python # -*- coding: utf-8 -*- ### # Copyright (2016-2017) Hewlett Packard Enterprise Development LP # # 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 Lic...
1.898438
2
clustering_based/clustering_based_k_anon.py
fhstp/k-Anonymity
4
12770010
# -*- coding: utf-8 -*- """ main module for cluster_based_k_anon """ import operator import random import time from functools import cmp_to_key from basic_mondrian.models.numrange import NumRange from basic_mondrian.utils.utility import (cmp_str, get_num_list_from_str, qid_t...
2.4375
2
test_apps/python_app/targets/dut/o1_dut0.py
Origen-SDK/o2
0
12770011
<filename>test_apps/python_app/targets/dut/o1_dut0.py origen.app.instantiate_dut("dut.o1_dut0")
1.257813
1
Basics/E07_Typography/E08_HeadlineAlignment.py
freder/PageBotExamples
5
12770012
<filename>Basics/E07_Typography/E08_HeadlineAlignment.py #!/usr/bin/env python3 # -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # # P A G E B O T E X A M P L E S # # www.pagebot.io # Licensed under MIT conditions # # ----------------------------------...
2.765625
3
Lib/test/bugs/pr183.py
jimmyyu2004/jython
332
12770013
<gh_stars>100-1000 # Test case for PR#183; print of a recursive PyStringMap causes a JVM stack # overflow. g = globals() print(g)
1.6875
2
api/services/__init__.py
adkl/etf_online_competition_system
0
12770014
<reponame>adkl/etf_online_competition_system<gh_stars>0 from .etf_oracle_service import EtfOracleService
1.0625
1
data/exploits/cve-2015-5287/sosreport-rhel7.py
OsmanDere/metasploit-framework
26,932
12770015
<reponame>OsmanDere/metasploit-framework<filename>data/exploits/cve-2015-5287/sosreport-rhel7.py #!/usr/bin/python # CVE-2015-5287 (?) # abrt/sosreport RHEL 7.0/7.1 local root # rebel 09/2015 # [user@localhost ~]$ python sosreport-rhel7.py # crashing pid 19143 # waiting for dump directory # dump directory: /var/tmp/a...
1.328125
1
sfepy/mesh/splinebox.py
clazaro/sfepy
0
12770016
<gh_stars>0 from __future__ import absolute_import from __future__ import print_function import numpy as nm from .bspline import BSpline from sfepy.base.base import Struct from six.moves import range class SplineBox(Struct): """ B-spline geometry parametrization. The geometry can be modified by moving spl...
2.203125
2
server/spells/__init__.py
zorlu/cards2-server
0
12770017
<reponame>zorlu/cards2-server from .hpdp import HpDpSpell from .damage import DamageSpell from .hp import HpSpell from .dp import DpSpell from .draw import DrawSpell from .execute import ExecuteSpell from .swap import SwapSpell from .restore import RestoreSpell from .aura import AuraSpell from .buff_add import AddBuffS...
1.921875
2
__init__.py
brennanmcfarland/arctic-flaming-monkey-typhoon
0
12770018
<gh_stars>0 import os import sys sys.path.append(os.path.abspath('./arc23'))
1.328125
1
starthinker/task/ga_settings_download/ga_schemas.py
viohman/starthinker
0
12770019
########################################################################### # # Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/...
1.210938
1
pyramidal/urls.py
gofflab/neuron-seq-site
0
12770020
from django.conf.urls import patterns, url from pyramidal import views urlpatterns = patterns('', #Index url(r'^$',views.index,name='index'), #Geneset Views url(r'^geneset/(?P<gene_list>[a-zA-Z0-9_\-\.\+]+)/?$',views.geneset,name='gene_set'), #Isoform Views url(r'^genes?/(?P<gene_id>[\w.-]+)/isoforms?/?$',vie...
1.820313
2
master_india_project/master_india_app/models.py
bikash-pal/master_india_assignment
0
12770021
from django.db import models # Create your models here. class Categories(models.Model): catagorie=models.CharField(max_length=100) class SubCatagories(models.Model): #question = models.ForeignKey(Question, on_delete=models.CASCADE) subCatagories=models.CharField(max_length=100) class Products(models.Model)...
2.4375
2
poker/texas_holdem/score_hand.py
jrj92280/python-kata
3
12770022
def score_hand(player_one: list, player_two: list): if len(player_one) != 7 or len(player_two) != 7: raise RuntimeError('invalid hands') # pairs player_one_pairs = player_one[1] player_two_pairs = player_two[1] player_one_has_pairs = len(player_one_pairs) player_two_has_pairs = len(pla...
3.765625
4
HackerRank/PythonHackerRankSolutions/BuiltIns/Zipped.py
accidentalgenius09/competitive-programming-solution
8
12770023
<filename>HackerRank/PythonHackerRankSolutions/BuiltIns/Zipped.py ''' Title : Zipped! Subdomain : Built-Ins Domain : Python Author : codeperfectplus Created : 17 January 2020 ''' # Enter your code here. Read input from STDIN. Print output to STDOUT n, x = map(int, input().split()) sheet = [] for _ in rang...
3
3
airflow/constants.py
vishwas78/python-workflow-test
0
12770024
PROJECT_NAME = "rtheta-central" BUCKET_NAME = "central.rtheta.in" ZONE = "asia-south1-a"
1.132813
1
sortsearch/ferriswheel.py
ashutoshdumiyan/CSES-Solutions
0
12770025
from sys import stdin n, x = map(int, stdin.readline().split()) li = [int(c) for c in stdin.readline().split()] li.sort() res = 0 i = 0 j = n - 1 while i <= j: if li[i] + li[j] > x: j -= 1 else: i += 1 j -= 1 res += 1 print(res)
2.671875
3
dict_of_dicts_init.py
denis-ryzhkov/timeit_ab
0
12770026
#!/usr/bin/env python """ A/B timeit test: dict of dicts init. Output: exists = False: speedup seconds option 15% 0.780859 in else 11% 0.821429 defaultdict 10% 0.825422 not in 3% 0.890609 get 0% 0.918161 setdefault -83% 1.683932 try exists = True: speedup seconds option ...
3.21875
3
Test/trainValues.py
ADMoreau/Software-Assurance-Defect-Localization
1
12770027
<reponame>ADMoreau/Software-Assurance-Defect-Localization<gh_stars>1-10 import csv from difflib import SequenceMatcher trainInit = [] testInit = [] ############LISTS OS IMPORTEED FEATURES############################# temp1 = open('90filteredOMITGOOD.csv','r') data1 = csv.reader((line.replace('\0','') for line in temp...
2.4375
2
backend/bomberbot/migrations/0004_teacher_city.py
somarae8/bomberbot_finalproject
2
12770028
<reponame>somarae8/bomberbot_finalproject # Generated by Django 3.1.2 on 2020-10-22 16:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bomberbot', '0003_auto_20201018_2352'), ] operations = [ migrations.AddField( model_na...
1.59375
2
VGGFeatureLoss.py
nikadilli/elemental-imageing-enhancement
1
12770029
import fastai from fastai.vision import * from fastai.callbacks import * from fastai.utils.mem import * from torchvision.models import vgg16_bn from skimage.measure import compare_ssim def gram_matrix(x): n,c,h,w = x.size() x = x.view(n, c, -1) return (x @ x.transpose(1,2))/(c*h*w) class VGG16FeatureLos...
2.09375
2
runner.py
IsaacG/Advent-of-Code
3
12770030
<filename>runner.py #!/bin/python3 """Run AoC code in various flavors.""" import datetime import importlib import os import pathlib import string import subprocess import time import traceback from typing import List, Optional import dotenv import inotify_simple import pytz import typer from pylib import site EST =...
2.953125
3
srptools/constants.py
idlesign/srptools
20
12770031
from __future__ import unicode_literals import hashlib HASH_SHA_1 = hashlib.sha1 HASH_SHA_256 = hashlib.sha256 PRIME_1024_GEN = '2' PRIME_1024 = '''\ EEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C9C256576D674DF74\ 96EA81D3383B4813D692C6E0E0D5D8E250B98BE48E495C1D6089DAD15DC7D7B46154D6B6\ CE8EF4AD69B15D4982...
1.5625
2
jogo-adivinhacao.py
engvinicius/estudos
2
12770032
#!/usr/bin/env python # # Um simples jogo de adivinhação com dicas. # # <NAME> # @VinihJunior # <EMAIL> from random import randint while True: print("************************************************") print("* *") print("* Adivinhe qual é o ANIMAL \o/ ...
4
4
Leetcode/0945. Minimum Increment to Make Array Unique/0945.py
Next-Gen-UI/Code-Dynamics
0
12770033
<filename>Leetcode/0945. Minimum Increment to Make Array Unique/0945.py class Solution: def minIncrementForUnique(self, A: List[int]) -> int: ans = 0 minAvailable = 0 A.sort() for a in A: ans += max(minAvailable - a, 0) minAvailable = max(minAvailable, a) + 1 return ans
3.234375
3
papergit/dropbox.py
jameshruby/paper-to-git
78
12770034
<reponame>jameshruby/paper-to-git import dropbox from dropbox import DropboxOAuth2FlowNoRedirect from papergit.config import config class Dropbox: """ The base dropbox class to access. """ def __init__(self): self.dbx = None def initialize(self): assert config.initialized ...
3.453125
3
wer_computation.py
Skfreak/ASR_Project_1
0
12770035
# importing necessary packages import pandas as pd import numpy as np from sklearn.preprocessing import LabelEncoder from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, confusion_matrix from sklearn.externals import joblib from sklearn.preprocessing import StandardScaler import os imp...
2.578125
3
lib/googlecloudsdk/third_party/apis/policytroubleshooter/v1beta/policytroubleshooter_v1beta_messages.py
google-cloud-sdk-unofficial/google-cloud-sdk
2
12770036
<filename>lib/googlecloudsdk/third_party/apis/policytroubleshooter/v1beta/policytroubleshooter_v1beta_messages.py<gh_stars>1-10 """Generated message classes for policytroubleshooter version v1beta. """ # NOTE: This file is autogenerated and should not be edited by hand. from __future__ import absolute_import from ap...
2
2
test/01.py
vkpedia/test1
0
12770037
<filename>test/01.py import numpy as np print(np.ones(10))
1.34375
1
ckan/tests/lib/search/test_query.py
gg2/ckan
1
12770038
# -*- coding: utf-8 -*- import pytest import ckan.model as model import ckan.lib.search as search import ckan.tests.factories as factories from ckan.lib.create_test_data import CreateTestData @pytest.mark.usefixtures("clean_db", "clean_index") class TestTagQuery(object): def create_test_data(self): facto...
2.5
2
localization/scripts/wordcount.py
Ubastic/SlayTheSpire_Modify
0
12770039
<reponame>Ubastic/SlayTheSpire_Modify<filename>localization/scripts/wordcount.py """ This script counts words in json files. Example usage: python3 wordcount.py eng/achievements.json # count words in single file python3 wordcount.py eng # count words in single dir python3 wordcount.py ...
3.375
3
src/obfuscapk/obfuscators/new_signature/__init__.py
Elyorbe/Obfuscapk
688
12770040
<reponame>Elyorbe/Obfuscapk #!/usr/bin/env python3 from .new_signature import NewSignature
0.882813
1
src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedactiveFnfEtAnalyticsFlows/cli/equal/golden_output_expected.py
balmasea/genieparser
204
12770041
<reponame>balmasea/genieparser<filename>src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedactiveFnfEtAnalyticsFlows/cli/equal/golden_output_expected.py expected_output = {'current-eta-records': 0, 'excess-packets-received': 60, 'excess-syn-received': 0, 'total-eta-fnf': 2, 'total-eta-idp': 2, 'total-eta-rec...
1.039063
1
tests/unit/bellman/environments/transition_model/keras_models/test_trajectory_sampling.py
RL-Gym/bellman
40
12770042
<reponame>RL-Gym/bellman<filename>tests/unit/bellman/environments/transition_model/keras_models/test_trajectory_sampling.py<gh_stars>10-100 # Copyright 2021 The Bellman Contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Y...
2.078125
2
flame/algorithms/import_observationer_by_location.py
busstoptaktik/FIRE
0
12770043
# -*- coding: utf-8 -*- from fire.api.model.punkttyper import GeometriObjekt, PunktInformation __author__ = "Septima" __date__ = "2019-12-02" __copyright__ = "(C) 2019 by Septima" import os from datetime import datetime from typing import List, Dict from PyQt5.QtCore import QCoreApplication from PyQt5.QtGui import ...
1.804688
2
leggps/training.py
jacksonloper/leg-gps
8
12770044
import scipy as sp import scipy.optimize from . import legops import tensorflow as tf import numpy as np import numpy.random as npr from . import constructions def fit_model_family(ts,xs,model_family,p_init,maxiter=100,use_tqdm_notebook=False): ''' Fits a custom LEG model Input: - ts: list of timesta...
2.265625
2
aug.py
daaiwusheng/ferattention
79
12770045
<gh_stars>10-100 import cv2 from torchvision import transforms from pytvision.transforms import transforms as mtrans # transformations #normalize = mtrans.ToMeanNormalization( # #mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225], # mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], # ) # cifar10 # normalize =...
2.1875
2
proj04/proj04.py
scienceman44/SAVY
0
12770046
# Name: # Date: """ proj04 Asks the user for a string and prints out whether or not the string is a palindrome. """ loop_control = True g = [] p = [] j = raw_input('I am the computer') h = raw_input('I calculate palindromes') k = raw_input('I know all') while loop_control == True: d = raw_input('type a word for ...
4.1875
4
utils/data_util.py
yuejiaxiang/semEvel2020_task8
0
12770047
<gh_stars>0 import re import unicodedata import numpy as np import torch def get_ner_BIO(label_list): # list_len = len(word_list) # assert(list_len == len(label_list)), "word list size unmatch with label list" list_len = len(label_list) begin_label = 'B' inside_label = 'I' whole_tag = '' i...
2.5
2
bookstore/src/cart/dummy.py
mehulk99/Online-Book-Store
1
12770048
<gh_stars>1-10 class SomeSingleton(object): __instance__ = None def __new__(cls, *args,**kwargs): if SomeSingleton.__instance__ is None: SomeSingleton.__instance__ = object.__new__(cls) return SomeSingleton.__instance__ def __init__(self,f=0,y=0): self.f = f self...
3.265625
3
zeus/urls.py
flyliufu/PythonDemo
0
12770049
from django.urls import path from . import views app_name = 'zeus' urlpatterns = [ path('token', views.token, name='token'), ]
1.5625
2
Mac/graph1.py
Vishu26/Hydrological-Cycle
0
12770050
<filename>Mac/graph1.py from grap import Ui_Form from PyQt5.QtCore import * from PyQt5.QtGui import * from sys import argv from PyQt5.QtWidgets import * import matplotlib as mpl mpl.use('Qt5Agg') import matplotlib.pyplot as plt import numpy as np class mas(QWidget, Ui_Form): def __init__(self): super(ma...
2.453125
2