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
mindinsight/profiler/proposer/compose_proposer.py
fapbatista/mindinsight
0
12789051
<reponame>fapbatista/mindinsight # Copyright 2020 Huawei Technologies Co., Ltd # # 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 requir...
1.828125
2
10.68. Reversed.py
kyumiouchi/python-basic-to-advanced
0
12789052
<reponame>kyumiouchi/python-basic-to-advanced """ Reversed OBS: It is different from reverse() from list => the function reverse() just work with list and reversed() with any iterable. """ list_number = [1, 2, 3, 4, 5] result = reversed(list_number) print(result) # <list_reverseiterator object at 0x0000029BC4B12FD0...
4.5625
5
apps/landing/models.py
pythonvietnam/nms
19
12789053
<reponame>pythonvietnam/nms from django.db import models from apps.base.models import Timestampable # Create your models here. class Landing(Timestampable): email = models.EmailField(blank=False, max_length=255, unique=True) class Meta: db_table = 'landing' def __str__(self): return self...
2.546875
3
functionality/kmeans_cluster_ijcai18_4_203.py
neerbek/taboo-selective
0
12789054
# -*- coding: utf-8 -*- """ Created on January 24, 2018 @author: neerbek """ # -*- coding: utf-8 -*- import os os.chdir("../../taboo-core") from numpy.random import RandomState # type: ignore from sklearn.cluster import KMeans # type: ignore import ai_util import confusion_matrix import kmeans_cluster_util as kut...
1.75
2
Libraries/warshallfloyd.py
tonko2/AtCoder
2
12789055
<filename>Libraries/warshallfloyd.py N = 10 cost = [[float('inf')] * N] * N for k in range(N): for i in range(N): for j in range(N): if cost[i][k] != float('inf') and cost[k][j] != float('inf'): cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j])
3.171875
3
CodeUP/Python basic 100/6047.py
cmsong111/NJ_code
0
12789056
<gh_stars>0 import math a,b = map(int,input().split()) c=pow(2,b) print(a*c)
2.875
3
scraper.py
wind1s/proxyscraper
0
12789057
""" * Copyright (c) 2022, <NAME> <<EMAIL>> * * SPDX-License-Identifier: BSD-2-Clause Compiles a database of proxy servers with their respective metadata. Links: https://geonode.com/free-proxy-list https://proxylist.geonode.com/api/proxy-list?limit=1000&page=1 Custom proxy key value pair: key = ip (192.16...
2.046875
2
lldb/test/API/tools/lldb-server/TestGdbRemoteProcessInfo.py
mkinsner/llvm
2,338
12789058
import gdbremote_testcase import lldbgdbserverutils from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestGdbRemoteProcessInfo(gdbremote_testcase.GdbRemoteTestCaseBase): mydir = TestBase.compute_mydir(__file__) def test_qProcessInfo_retur...
1.976563
2
defuzzyfikasi.py
cahyoardhi/fuzzy-algorithm
3
12789059
def fdefuzzyfikasi(inputan): for k,v in inputan.items(): if k == 'kecil': kecil = v else: besar = v tempbesar = 0 tempkecil = 0 x = 0 y = 0 for i in range(20,90,7): if i <= 60: tempkecil += i x...
2.9375
3
giftest.py
TimothyBergstrom/Zergy
0
12789060
import tkinter as tk from Gifhandler import * #Main window top=tk.Tk() #Icon top.iconbitmap('gifs/zergyicon.ico') #Setting color top.configure(background='gold') #Title top.title('Zergy') #Fixing picture canvas (will load later) topcanvas=tk.Canvas(top,width=250,height=250,background='gold') topcanvas.pack() #Ope...
2.84375
3
elastic/elastic_driver.py
HungThinhPhung/Miscellaneous
0
12789061
import json import pickle import requests from elastic.using_requests import get_gov demo_tax_codes = pickle.load(open('error.p', 'rb')) host = 'http://0.0.0.0:9201' host = 'http://10.0.6.21:30152' e_index = 'index' e_index = 'sme_autocomplete_index_2' e_type = 'sme_autocomplete_type' default_link = host + '/' + e_i...
2.640625
3
test/test/pytools/viz/dendrogram/test_dendrogram.py
BCG-Gamma/pytools
17
12789062
""" Tests for package pytools.viz.dendrogram """ # noinspection PyPackageRequirements import hashlib import logging from io import StringIO import numpy as np # noinspection PyPackageRequirements import pytest # noinspection PyPackageRequirements import scipy.cluster.hierarchy as hc from pytools.viz.dendrogram imp...
2.46875
2
tasks/tests/tasknamefilter_test.py
kemmot/PyTasks
0
12789063
<reponame>kemmot/PyTasks import unittest import unittest.mock as mock import filters.tasknamefilter as tasknamefilter class TaskNameFilterTests(unittest.TestCase): def test_constructor_sets_name(self): target = tasknamefilter.TaskNameFilter(mock.Mock(), 'test') self.assertEqual('test', target.nam...
2.8125
3
astar_spark/SP_ASTAR version1/graph.py
adoni91/HGraphProject
0
12789064
from node import * from nodeitem import * from math import sqrt, pow import time class Graph: def __init__(self, node=[]): self.node=node def createNodeProperty(self, line): return [int(line.split()[0]), int(line.split()[1])] def createEdgeProperty(self, line): retu...
2.859375
3
app/viewer/__init__.py
Dbrown411/py-oct
0
12789065
from .viewer_panels import *
1.1875
1
scripts/2e_gen_direct_ac3d.py
skywalkerisnull/ImageAnalysis
0
12789066
#!/usr/bin/python3 import sys #sys.path.insert(0, "/usr/local/opencv3/lib/python2.7/site-packages/") import argparse #import commands import cv2 import fnmatch import numpy as np import os.path import random import navpy sys.path.append('../lib') import AC3D import Pose import ProjectMgr import SRTM import transform...
2.3125
2
focuser.py
chripell/yaaca
1
12789067
<gh_stars>1-10 from astropy.stats import sigma_clipped_stats from photutils import DAOStarFinder, IRAFStarFinder from collections import namedtuple import numpy as np FocusData = namedtuple('FocusData', 'bot p10 mean p90 top std back back_std') class Focuser: def __init__(self, fwhm=3.0, threshold_stds=100., ...
2.265625
2
dropout_finetuning.py
alecmeade/ai_for_earth
1
12789068
import gc import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import torch import torch.nn as nn import torchvision import sys # To view tensorboard metrics # tensorboard --logdir=logs --port=6006 --bind_all from torch.utils.tensorboard import SummaryWriter from functools import partial fr...
1.820313
2
roles/sensu/client/files/plugins/metrics-process-usage.py
Shasthojoy/cuttle
21
12789069
#!/usr/bin/env python # # metrics-process-usage.py # # PLATFORMS: # Linux # # DEPENDENCIES: # Python 2.7+ (untested on Python3, should work though) # Python module: psutil https://pypi.python.org/pypi/psutil # # USAGE: # # metrics-process-usage.py -n <process_name> -w <cpu_warning_pct> -c <cpu_critical_pct> -W <m...
2.1875
2
insta/migrations/0007_remove_post_likes.py
Kennedy-karuri/insta-clone
0
12789070
<reponame>Kennedy-karuri/insta-clone # Generated by Django 2.2.8 on 2020-10-22 01:34 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('insta', '0006_auto_20201022_0146'), ] operations = [ migrations.RemoveField( model_name='post', ...
1.359375
1
setup.py
MarouenMechtri/CNG-Manager
1
12789071
# Copyright 2010-2012 Institut Mines-Telecom # # 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 agre...
1.734375
2
Preprocessing/Salimi/utils/_init__.py
maliha93/Fairness-Analysis-Code
0
12789072
<gh_stars>0 ### ### FairDB utilities ###
0.863281
1
oops/#040_garbageCollection.py
krishankansal/PythonPrograms
0
12789073
import gc print(gc.isenabled()) gc.disable() print(gc.isenabled()) gc.enable() print(gc.isenabled())
1.640625
2
chembl_webresource_client/scripts/chembl_m2t.py
RowAnalytics/chembl_webresource_client
248
12789074
#!/usr/bin/env python from __future__ import print_function __author__ = 'mnowotka' # ---------------------------------------------------------------------------------------------------------------------- import sys import argparse from chembl_webresource_client.scripts.utils import get_serializer, chembl_id_regex,...
2.125
2
tests/api/records/test_loaders.py
galterlibrary/InvenioRDM-at-NU
6
12789075
"""Test record form i.e. marshmallow schema is configured as expected.""" from copy import deepcopy import pytest from cd2h_repo_project.modules.records.marshmallow.json import ( AuthorSchemaV1, MetadataSchemaV1, RecordSchemaV1, ResourceTypeSchemaV1 ) @pytest.fixture def create_input_metadatav1(): """Facto...
2.703125
3
python/server/backends/mock.py
liamstar97/searchhub
48
12789076
<gh_stars>10-100 from collections import defaultdict import random from loremipsum import get_sentences from lucidfind.backends import Backend, Document from lucidfind.fusion import compare_datasources class MockBackend(Backend): def __init__(self): self.datasources = {} def get_document(self, doc_i...
2.3125
2
pyapps/sensorapp.py
helena-project/beetle
16
12789077
#!/usr/bin/env python """ pygatt cloud monitoring ======================= This module implements a cloud monitoring application for home sensors """ import argparse import os import socket import ssl import struct import sys import threading from datetime import datetime from jinja2 import Environment, FileSystemLoa...
2.625
3
Remark/Macros/Comment_Macro.py
kaba2/remark
0
12789078
<gh_stars>0 # -*- coding: utf-8 -*- # Description: Comment macro # Detail: Consumes its input and produces no output. from Remark.Macro_Registry import registerMacro class Comment_Macro(object): def name(self): return 'Comment' def expand(self, parameter, remark): # This macro simply eats it...
2.609375
3
leetcode_python/String/convert-a-number-to-hexadecimal.py
yennanliu/Python_basics
18
12789079
<reponame>yennanliu/Python_basics<filename>leetcode_python/String/convert-a-number-to-hexadecimal.py # Time: O(logn) # Space: O(1) # Given an integer, write an algorithm to convert it to hexadecimal. # For negative integer, two’s complement method is used. # # IMPORTANT: # You must not use any method provided by the ...
4.3125
4
generate_confirmation_tokens.py
FiwareULPGC/agreement-mail-utilities
0
12789080
<reponame>FiwareULPGC/agreement-mail-utilities<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import getopt import sys import uuid from openpyxl import * def generate_token(): return uuid.uuid4().hex def generate_confirmation_tokens(filepath): wb = load_workbook(filepath) ws = wb.worksheets...
2.5625
3
tools/bin/pythonSrc/PSI-0.3b2_gp/psi/_version.py
YangHao666666/hawq
450
12789081
# The MIT License # # Copyright (C) 2007 <NAME> # # Copyright (C) 2008-2009 <NAME> # # Copyright (C) 2008-2009 Abilisoft Ltd. # # # 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 restr...
1.257813
1
main.py
JiwooKimAR/MWP-solver-with-pretrained-language-model
5
12789082
import os import sys import torch import argparse from collections import OrderedDict from dataloader import Dataset from evaluation import Evaluator from experiment import EarlyStop, train_model from utils import Config, Logger, ResultTable, make_log_dir, set_random_seed os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID...
2.1875
2
servers/web/flask/views/mine.py
ericharmeling/photoblocks
2
12789083
<reponame>ericharmeling/photoblocks<filename>servers/web/flask/views/mine.py from flask import request def mine(blockchain): # Form data image_file = request.files['file'] image_loc = blockchain.dir + image_file.filename label = request.form['label'] last_label = request.form['last_label'] n_k...
2.65625
3
receptiveFields.py
ericrosenbrown/ReceptiveFields
0
12789084
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <markdowncell> # We are going to be doing an activity about viewing images through different filters. These filters are similar to things that happen in the brain when the images from our eyes are registered in our brain. # <codecell> import matplotlib.pyplot as ...
3.625
4
object_pool/exception.py
dduraipandian/object_pool
3
12789085
<filename>object_pool/exception.py class InvalidMinInitCapacity(Exception): def __init__(self, pool_name): self.message = f"ERROR:: {pool_name}: min_init can not be less than 0 with lazy=False option." class InvalidMaxCapacity(Exception): def __init__(self, pool_name): self.message = f"ERROR::...
2.984375
3
memtrain/memtrain_common/question.py
iandorsey00/memtrain
0
12789086
import decimal import random import string import textwrap import time import os from memtrain.memtrain_common.mtstatistics import MtStatistics class NoResponsesError(Exception): pass class Question: '''Manages the current cue and response interface''' def __init__(self, settings, database): # I...
2.46875
2
uvicore/http/routing/auto_api.py
coboyoshi/uvicore
0
12789087
<filename>uvicore/http/routing/auto_api.py # Do not import future here or http/bootstrap.py get_type_hints fails # See https://bugs.python.org/issue41249 # NO from __future__ import annotations import uvicore import json from uvicore.http.request import Request from uvicore.http.params import Query from uvicore.typing...
2.453125
2
vmssz.py
muralipi/vmssdashboard
56
12789088
'''vmssz.py - class of basic Azure VM scale set operations, without UDs, with zones''' import json import azurerm class VMSSZ(): '''VMSSZ class - encapsulates the model and status of a zone redundant VM scale set''' def __init__(self, vmssname, vmssmodel, subscription_id, access_token): '''class ini...
2.46875
2
nyc/core/CoreUtils.py
imohitawasthi/nyc
0
12789089
from nltk.corpus import stopwords from nltk.stem.lancaster import LancasterStemmer from utils import Constants from utils import Utils #################################################################################### #################################################################################### #############...
1.9375
2
script/stereograph_pointcloud.py
7675t/theta_camera
0
12789090
<reponame>7675t/theta_camera #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function # THEATAの画像を取得,球体のPointCloudとして出力する import sys import rospy import cv2 from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError import numpy as np from sensor_msgs.msg import PointClo...
2.484375
2
senko.py
mtsev/senko
6
12789091
#!/usr/bin/env python3 import os import logging import yaml from discord.ext.commands import Bot, Context, CommandError, CommandOnCooldown # create logger log = logging.getLogger(__package__) log.setLevel(logging.DEBUG) # create file handler which logs even debug messages fh = logging.FileHandler('../senko.log') fh.s...
2.265625
2
instagramNotifier.py
akaeme/InstagramNotifier
0
12789092
import argparse # from fbchat.models import * import logging import os import sys import urllib.request from getpass import getpass from time import sleep from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from fbchat import Client from API.InstagramAPI import I...
2.484375
2
ros/src/control/servers/heave.py
srmauvsoftware/URSim
30
12789093
#!/usr/bin/env python from control.msg import heaveFeedback, heaveAction, heaveResult import rospy import time import actionlib class Heave(object): feedback = heaveFeedback() result = heaveResult() def __init__(self, name): self.heavePub = rospy.Publisher('/heave_setpoint', Float64, queue_size=1)...
2.453125
2
denma_contact_form/migrations/0004_remove_contactform_subscribed_user.py
denma-group/website-backend-django
0
12789094
<filename>denma_contact_form/migrations/0004_remove_contactform_subscribed_user.py # Generated by Django 2.2 on 2019-09-05 23:51 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('denma_contact_form', '0003_auto_20190905_1300'), ] operations = [ m...
1.335938
1
Pyton_Exp/__temp_migrations/vote_s/0003_group_tipo_votante.py
hbahamonde/Vote_Buying_Inequality
0
12789095
<gh_stars>0 # Generated by Django 2.2.12 on 2021-03-26 13:39 from django.db import migrations import otree.db.models class Migration(migrations.Migration): dependencies = [ ('vote_s', '0002_auto_20210326_1039'), ] operations = [ migrations.AddField( model_name='group', ...
1.453125
1
src/main/resources/archetype-resources/src/test/resources/robotframework/quickstart/testlibs/LoginLibrary.py
MarkusBernhardt/robotframework-archetype-quickstart
2
12789096
import os import sys class LoginLibrary: def __init__(self): self._sut_path = os.path.join(os.path.dirname(__file__), '..', 'sut', 'login.py') self._status = '' def create_user(self, username, password): self._run_command('create', username, pass...
2.875
3
development/workflow/raw_container.py
pingsutw/flyte-app
7
12789097
import logging from flytekit import ContainerTask, kwtypes, task, workflow logger = logging.getLogger(__file__) calculate_ellipse_area_shell = ContainerTask( name="ellipse-area-metadata-shell", input_data_dir="/var/inputs", output_data_dir="/var/outputs", inputs=kwtypes(a=float, b=float), outputs...
2.15625
2
core_pipeline.py
Kelsiii/Gaze
0
12789098
<gh_stars>0 from gaze.pipes import Graph from gaze.nodes import NetworkSource from gaze.nodes import NetworkSink import os IN_IP="0.0.0.0" IN_PORT=5001 OUT_IP = os.getenv("OUT_IP") if os.getenv("OUT_IP") else "127.0.0.1" OUT_PORT = int(os.getenv("OUT_PORT")) if os.getenv("OUT_PORT") else 5001 print(IN_IP,IN_PORT,OUT...
2.453125
2
research-analytics/dashboard.py
jhupiterz/research-analytics
0
12789099
#--------------------------------------------------------------------------# # This code makes use of all other functions of # # the package to build a Dash Web App # #--------------------------------------------------------------------------# # imports ...
2.21875
2
suppliers/models.py
yanwarsolahudin/regensi_api
1
12789100
<filename>suppliers/models.py from django.db import models from utils.models import Timestamp, generate_string_code class Supplier(Timestamp): PREFIX = 'SPR' supplier_code = models.CharField(max_length=100, unique=True) name = models.CharField(max_length=100, default='Ex: <NAME>') address = models.T...
2.359375
2
src/python/dnsresolvd.py
rgolubtsov/dnsresolvd-multilang
2
12789101
<reponame>rgolubtsov/dnsresolvd-multilang # # src/python/dnsresolvd.py # ============================================================================= # DNS Resolver Daemon (dnsresolvd). Version 0.9.9 # ============================================================================= # A daemon that performs DNS lookups fo...
2.484375
2
src/aceinna/tools/cli.py
LukaszChl/ros_openimu
6
12789102
import os import sys import argparse try: from aceinna.bootstrap.cli import CommandLine from aceinna.framework.constants import BAUDRATE_LIST except: # pylint: disable=bare-except print('load package from local') sys.path.append('./src') from aceinna.bootstrap.cli import CommandLine from acein...
2.34375
2
pypardot/objects_v3/accounts.py
andyoneal/PyPardotSF
18
12789103
class Accounts(object): """ A class to query and use Pardot accounts. Account field reference: http://developer.pardot.com/kb/api-version-3/object-field-references/#prospectAccount """ def __init__(self, client): self.client = client def query(self, **kwargs): """ Retur...
3.15625
3
day24/aoc2018-day24.py
SebastiaanZ/aoc-2018
1
12789104
from reindeer import Disease # Part I disease = Disease("day24-input.txt") found, result = disease.battle() print(f"Answer part I: {result}") # Part II for boost in range(10000): body = Disease("day24-input.txt", boost) found, result = body.battle() if found: break print(f"Answer part II: {resu...
2.828125
3
Curso Udemy 2022/Curso_Luiz_Otavio/Aula 41.py
Matheusfarmaceutico/Exercicios-Python
0
12789105
# uso do split e count '''string = 'O Brasil Brasil I I I I' lista_1 = string.split(' ') palavra = '' cont = 0 for valor in lista_1: quantvezes = lista_1.count(valor) if quantvezes > cont: cont = quantvezes palavra = valor print(f'A palavra que mais apareceu nessa frase foi {palavra} ')''' # uso...
3.65625
4
tests/test_data.py
lgray/AwkwardQL
1
12789106
import pytest def test_data(): from awkwardql.data import (RecordArray, PrimitiveArray, ListArray, UnionArray, instantiate) # data in columnar form events = RecordArray({ ...
2.484375
2
general/chainerrl/baselines/train_dqfd.py
marioyc/baselines
127
12789107
"""original source: https://github.com/chainer/chainerrl/pull/480 MIT License Copyright (c) Preferred Networks, Inc. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals from __future__ import absolute_import from builtins import * from future import stand...
2.125
2
pygraph/test/testutil.py
emliunix/pygraph
0
12789108
# -*- coding: utf-8 -*- import unittest from pygraph import util class TestUtil(unittest.TestCase): def test_pointsToEdges(self): points = [(1, 1), (2, 2), (3, 3)] expected = [ ((1, 1), (2, 2)), ((2, 2), (3, 3)), ((3, 3), (1, 1)) ] self.assertLi...
2.984375
3
modules/py/bindings/setup.py
ICHEC/QNLP
29
12789109
import setuptools setuptools.setup( name="PyQNLPSimulator", version="0.1", author="<NAME> (ICHEC), <NAME> (ICHEC)", author_email="<EMAIL>, <EMAIL>", description="Quantum NLP package", long_description="Quantum NLP project @ ICHEC", url="https://github.com/ichec/qnlp", packages=setuptool...
1.210938
1
monitoring/plugins/ref_matching_threshold_real/run.py
CrossRef/reference-matching-evaluation
14
12789110
#!/usr/bin/env python3 import numpy as np import matching.cr_search_validation_matcher import utils.data_format_keys as dfk import sys from evaluation.link_metrics import LinkMetricsResults from multiprocessing import Pool from utils.utils import read_json, save_json def modify_simple_threshold(dataset, threshold):...
2.125
2
pymclevel/id_definitions_2.py
bennettdc/MCEdit-Unified
237
12789111
<gh_stars>100-1000 import os import json from logging import getLogger import collections #from pymclevel import MCEDIT_DEFS, MCEDIT_IDS #import pymclevel import re #import id_definitions log = getLogger(__name__) def get_deps(base_version, file_name): deps = [base_version] print "Base: {}".format(base_versio...
2.28125
2
big_data/maps/convert_rates_tsv_to_json.py
paulhtremblay/big-data
0
12789112
import pprint import json pp = pprint.PrettyPrinter(indent = 4) def convert(path): with open(path, 'r') as read_obj: line = 'init' counter = 0 l = [] while line: line = read_obj.readline() counter += 1 if counter == 1: continue ...
2.90625
3
models/nin_.py
billhhh/model-quantization-1
66
12789113
<filename>models/nin_.py import torch.nn as nn import torch import torch.nn.functional as F from .quant import custom_conv from .layers import norm, actv class Net(nn.Module): def __init__(self, args): super(Net, self).__init__() self.args = args self.body = nn.Sequential( ...
2.40625
2
sync_operation.py
judsoncrouch/photo_sync
0
12789114
from dirsync import sync import win32api as win import os import click def get_drive_names(): drives = win.GetLogicalDriveStrings() drives = drives.split('\000')[:-1] drive_map = {} for d in drives: drive_name = win.GetVolumeInformation(d)[0] drive_map[drive_name] = d return drive_...
2.96875
3
fluxgapfill/metrics/metrics.py
stanfordmlgroup/methane-gapfill-ml
8
12789115
<gh_stars>1-10 import numpy as np from sklearn.metrics import ( mean_squared_error, mean_absolute_error, r2_score ) from scipy.stats import pearsonr def pearson_r_squared(truth, prediction): return pearsonr(truth, prediction)[0] ** 2 def reference_standard_dev(truth, prediction): return np.std(t...
2.515625
3
versions/v1/v1_tb/aux_kfold.py
otavares93/rxpix2pix
0
12789116
<filename>versions/v1/v1_tb/aux_kfold.py<gh_stars>0 import os import numpy as np import argparse from sklearn.model_selection import StratifiedKFold #from data.image_folder import make_dataset #from tensorflow.keras.preprocessing.image import ImageDataGenerator import tensorflow as tf import json import pandas as pd ...
2.140625
2
libs/jsconsole/jsconsolescript.py
bugbound/webnuke
23
12789117
class JSConsoleScript: def __init__(self, jsinjector): self.version=0.1 self.jsinjector = jsinjector self.jsinjector.add_help_topic('wn_help()', 'Shows WebNuke Help')
1.734375
2
flask_plots/core.py
juniors90/Flask-Plots
1
12789118
<reponame>juniors90/Flask-Plots #!/usr/bin/env python # -*- coding: utf-8 -*- # # This docstring was part of Matplotlib. All rights reserved. # Full Text: # https://matplotlib.org/stable/users/project/license.html # # This file is part of the # Flask-Plots Project https://github.com/juniors90/Flask-Plots/ # # Copy...
1.6875
2
m26-py/m26/speed.py
cjoakim/oss
0
12789119
__author__ = 'cjoakim' import math from .elapsed_time import ElapsedTime class Speed(object): def __init__(self, d, et): self.dist = d # an instance of Distance self.etime = et # an instance of ElapsedTime def mph(self): return self.dist.as_miles() / self.etime.hours() def...
3.46875
3
huskar_api/models/instance/__init__.py
mowangdk/huskar
59
12789120
from __future__ import absolute_import from .management import InstanceManagement from .schema import InfraInfo __all__ = ['InstanceManagement', 'InfraInfo']
1.023438
1
cogs/orb_control.py
azsry/orb
3
12789121
<reponame>azsry/orb """ Handles general control tasks and acts as a function generaliser for other commands. Also contains some admin-only commands and runs the database """ import discord from discord.ext import commands as bot_commands import csv import os from google.cloud import firestore from utils import repo, l...
2.734375
3
customer/migrations/0008_contact.py
martinlehoux/erp-reloaded
0
12789122
<reponame>martinlehoux/erp-reloaded # Generated by Django 3.0.3 on 2020-03-02 02:54 from django.db import migrations, models import django.db.models.deletion import phonenumber_field.modelfields class Migration(migrations.Migration): dependencies = [ ('customer', '0007_customer_logo'), ] operat...
1.734375
2
script/my_codes/train.py
ThivakaranThana/AlignedReid-Reproduction-Pytorch
0
12789123
<gh_stars>0 """Train with optional Global Distance, Local Distance, Identification Loss.""" from __future__ import print_function import sys sys.path.insert(0, '.') import torch from torch.autograd import Variable import torch.nn as nn import torch.optim as optim from torch.nn.parallel import DataParallel import ti...
1.703125
2
process_model.py
hdm-dt-fb/rvt_model_services
28
12789124
<reponame>hdm-dt-fb/rvt_model_services<filename>process_model.py """ process_model.py Usage: process_model.py <command> <project_code> <full_model_path> [options] Arguments: command action to be run on model, like: qc, audit or dwf currently available: qc, a...
1.851563
2
main.py
localhoct/os-remote
0
12789125
import telebot from telebot import types import os import random from PIL import ImageGrab from winsound import Beep import requests import platform import psutil import time # proxy = 'http://192.168.88.170:8888' # os.environ['http_proxy'] = proxy # os.environ['HTTP_PROXY'] = proxy # os.environ['https_p...
2.234375
2
apriori/apriori.py
TCphysics/MLlearning
0
12789126
<gh_stars>0 class ApriopriCT(object): ''' This python script finds the frequency list FL with maximum length and then build rules based on each list in FL. ''' def __init__(self, dataList, itemList, minSupport=0.2, minConfidence=0.8): ''' param dataList: original data...
3.03125
3
test/unit/puzzles/student_prizes_test.py
dclark87/pytools
0
12789127
<reponame>dclark87/pytools # # # ''' ''' import unittest from pytools.puzzles import student_prizes class StudentPrizesTestCase(unittest.TestCase): ''' ''' def test_student_prizes(self): ''' :return: ''' # Import packages import itertools # Init vari...
3.34375
3
tests/ncoghlan.py
jeamland/asciicompat
2
12789128
"""Test cases for dual bytes/str APIs""" import unittest """ The Python 2 str type conveniently permitted the creation of APIs that could be used as either binary APIs (8-bit str in, 8-bit str out) or as text APIs (unicode in, unicode out). The critical enabler for this feature was the ability to define any *consta...
3.484375
3
BOJ/1697.py
Jaesin22/TIL
0
12789129
<reponame>Jaesin22/TIL from collections import deque max = 10 ** 5 n, k = map(int, input().split()) visited = [0] * (max + 1) def BFS(): queue = deque() queue.append(n) while queue: x = queue.popleft() if x == k: print(visited[x]) break for nx in (...
2.984375
3
app/api/routers/auth.py
ABGEO/magtifun.abgeo.dev
0
12789130
""" This file is part of the magtifun.abgeo.dev. (c) 2021 <NAME> <<EMAIL>> For the full copyright and license information, please view the LICENSE file that was distributed with this source code. """ from datetime import timedelta from fastapi import Depends, HTTPException, status from fastapi.security import OAuth...
2.609375
3
piot/inputs/pozyx.py
frantp/iot-sensor-reader
0
12789131
<gh_stars>0 from collections import OrderedDict import time from ..core import DriverBase import pypozyx class Driver(DriverBase): def __init__(self, i2c=False, bus=1, port=None): super().__init__() self._sensor = pypozyx.PozyxI2C(bus) if i2c else \ pypozyx.PozyxSerial(port or pypozyx...
2.46875
2
Algorithms_medium/1288. Remove Covered Intervals.py
VinceW0/Leetcode_Python_solutions
4
12789132
""" 1288. Remove Covered Intervals Medium Given a list of intervals, remove all intervals that are covered by another interval in the list. Interval [a,b) is covered by interval [c,d) if and only if c <= a and b <= d. After doing so, return the number of remaining intervals. Example 1: Input: intervals = [[1,4],[3...
3.78125
4
Calibration/HcalAlCaRecoProducers/python/ALCARECOHcalCalIsoTrkProducerFilter_cff.py
malbouis/cmssw
852
12789133
<reponame>malbouis/cmssw import FWCore.ParameterSet.Config as cms #------------------------------------------------ #AlCaReco filtering for HCAL isotrk: #------------------------------------------------ from Calibration.HcalAlCaRecoProducers.alcaHcalIsotrkProducer_cfi import * from Calibration.HcalAlCaRecoProducers.a...
0.960938
1
cuffdiffgui.py
AgazW/Seq-Pip
0
12789134
<reponame>AgazW/Seq-Pip # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'bowtiegui.ui' # # Created: Tue Mar 1 14:46:40 2016 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QStr...
1.757813
2
LeNet5/mnist_inference.py
carbo-T/TF
1
12789135
<filename>LeNet5/mnist_inference.py # -*- coding: utf8 -*- import tensorflow as tf # define basic params INPUT_NODE = 784 OUTPUT_NODE = 10 IMAGE_SIZE = 28 NUM_CHANNELS = 1 NUM_LABELS = 10 CONV1_DEPTH = 6 CONV1_SIZE = 5 CONV2_DEPTH = 16 CONV2_SIZE = 5 FC_SIZE = 84 def inference(input_tensor, train, regularizer): ...
2.65625
3
geninv.py
manticode/wow-inventory-offline
1
12789136
<gh_stars>1-10 import argparse import re import csv from slpp import slpp as lua def prerun(): """ Check input args are valid. """ argparser = argparse.ArgumentParser(description="Inventory database file.") argparser.add_argument("-i", help="the lua datafile", dest="infilename") argparser.add_argument...
2.9375
3
SalesforceApi.py
mvogelgesang/SF-Event-Monitoring-Log-Retrieval
0
12789137
<reponame>mvogelgesang/SF-Event-Monitoring-Log-Retrieval<filename>SalesforceApi.py import datetime import getopt import json import logging import os import requests import sys from FileWriter import FileWriter from requests.auth import HTTPBasicAuth """ Salesforce API """ class SalesforceApi: def __init__(self,e...
2.6875
3
randomstate/prng/mt19937/__init__.py
bashtage/ng-numpy-randomstate
43
12789138
<gh_stars>10-100 from .mt19937 import *
1.210938
1
code/python/visualize_contingency_tables.py
vishalbelsare/S3M
52
12789139
#!/usr/bin/env python3 # # visualize_contingency_tables.py: Visualizes all contingency tables # obtained by our method in the form of a diagram in the plane. # # Input: JSON file with shapelets # # Output: A set of points in the plane, each representing one table, # such that the distance to the origin refers ...
3.328125
3
app/auth/forms.py
INASIC/AnnotateChange
13
12789140
# -*- coding: utf-8 -*- # Author: <NAME> <<EMAIL>> # License: See LICENSE file # Copyright: 2020 (c) The Alan Turing Institute from flask import current_app, flash from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, SubmitField, BooleanField from wtforms.validators import ( DataRequir...
3
3
{{cookiecutter.project_slug}}/backend/app/app/core/config.py
abnerjacobsen/full-stack
516
12789141
<filename>{{cookiecutter.project_slug}}/backend/app/app/core/config.py import os def getenv_boolean(var_name, default_value=False): result = default_value env_value = os.getenv(var_name) if env_value is not None: result = env_value.upper() in ("TRUE", "1") return result API_V1_STR = "/api/v1...
1.890625
2
metrics.py
theletterf/collectd-spark
3
12789142
GAUGE = 'gauge' COUNTER = 'counter' SPARK_PROCESS_METRICS = { # jvm generics "jvm.total.used": ( GAUGE, "gauges", "value" ), "jvm.total.committed": ( GAUGE, "gauges", "value" ), # heap memory "jvm.heap.used": ( GAUGE, "gauges",...
2.203125
2
setup.py
petejh/catclass
0
12789143
<reponame>petejh/catclass<gh_stars>0 from setuptools import setup setup( name = 'cat-class', version = '0.1.0', description = ('An image classifier employing a deep neural network ' 'to identify pictures of cats.'), url = 'https://github.com/petejh/cat-class', author = '<NAM...
1.539063
2
tests/test_quadrature/test_quadrature.py
AI-Pranto/OpenMOC
97
12789144
<reponame>AI-Pranto/OpenMOC<gh_stars>10-100 #!/usr/bin/env python import os import sys import math sys.path.insert(0, os.pardir) sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) from testing_harness import TestHarness from input_set import LatticeGridInput import openmoc class QuadratureTestHarness(TestHarness...
2.28125
2
2014-2015/2-jan2015/p2/CowRouting2.py
esqu1/USACO
0
12789145
<reponame>esqu1/USACO<gh_stars>0 ######### # USACO CONTEST 1 PROBLEM 2 # SOLUTION BY <NAME> # PYTHON 2.7.6 ######### import sys def readin(): f = open("cowroute.in",'r') s = f.read().split("\n") f.close() return s def find(list,el): if el in list: return list.index(el) else: re...
2.984375
3
62.py
r9y9/nlp100
18
12789146
<filename>62.py import plyvel from tqdm import tqdm db = plyvel.DB("artist.ldb", create_if_missing=False) r = [] for k, v in tqdm(db): if v == b"Japan": r.append(k.decode("utf-8")) for k in r: print(k) print("Total: {}".format(len(r)))
2.5
2
terrascript/provider/hashicorp/googleworkspace.py
mjuenema/python-terrascript
507
12789147
# terrascript/provider/hashicorp/googleworkspace.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:17:22 UTC) import terrascript class googleworkspace(terrascript.Provider): """terraform-provider-googleworkspace""" __description__ = "terraform-provider-googleworkspace" __namespace__ = "h...
1.53125
2
misc_files/GPSVehicle.py
twardokus/v2verifier
9
12789148
<gh_stars>1-10 import math import json import time import subprocess import pynmea2 from txrx import Utility from WavePacketBuilder import WAVEPacketBuilder class GPSVehicle: def __init__(self, vehicle_num, gps_sock, gui_sock, gui_lock): self.vehicle_num = vehicle_num self.gps_sock = gps_sock ...
2.65625
3
networkmonitor/src/configuration/contextConfig.py
luther38/NetworkMonitor
0
12789149
<reponame>luther38/NetworkMonitor import os from networkmonitor.src.configuration import IConfig, YamlConfig, JsonConfig from networkmonitor.src.collections import Configuration class ContextConfig: """ ConfigContext is the handler for the IConfig and tells the process who needs to do what. Methods ...
2.890625
3
roles/openshift_health_checker/test/curator_test.py
KoteikinyDrova/openshift-ansible
1
12789150
import pytest from openshift_checks.logging.curator import Curator def canned_curator(exec_oc=None): """Create a Curator check object with canned exec_oc method""" check = Curator("dummy") # fails if a module is actually invoked if exec_oc: check._exec_oc = exec_oc return check def assert_...
2.234375
2