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
cartoonify.py
adl1995/image-processing-filters
0
10700
<filename>cartoonify.py #!/usr/bin/env python __author__ = "<NAME>" __email__ = "<EMAIL>" __status__ = "Production" import matplotlib.pyplot as plt import numpy as np import skimage as ski import Image def cartoonify(im, display=False): """ function receives an image and add its gradient magnitude in it and add i...
3.828125
4
keymapper/__init__.py
rburns629/KeyMapper
0
10701
from dataclasses import dataclass import json import re @dataclass class KeyMapper(dict): """ Example: km = KeyMapper({'messages': {'message1': 'Hello World!'}}}) print(km['messages.message1']) Variables: __delimiter__ is set to dot-notation by default, unless specified otherwise. ...
3.234375
3
PythonFiles_DataScience/demo37_pythonfordatascience.py
mahnooranjum/Programming_DataScience
0
10702
# -*- coding: utf-8 -*- """Demo37_PythonforDataScience.ipynb # PYTHON FOR DATA SCIENCE We will take our python programming skills a step further and process large data in it. Python is an excellent language for deployment. Hence we will be using open source data during the learning process!! This will make sure we un...
4.1875
4
quantrocket/db.py
Jay-Jay-D/quantrocket-client
0
10703
<gh_stars>0 # Copyright 2017 QuantRocket - All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
2.5625
3
ink2canvas/GradientHelper.py
greipfrut/pdftohtml5canvas
4
10704
<filename>ink2canvas/GradientHelper.py from ink2canvas.lib.simpletransform import parseTransform class GradientHelper(object): def __init__(self, abstractShape): self.abstractShape = abstractShape def hasGradient(self, key): style = self.abstractShape.getStyle() if ...
3.03125
3
project/manage.py
yosukesuzuki/let-me-notify
0
10705
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Kay management script. :Copyright: (c) 2009 Accense Technology, Inc. All rights reserved. :license: BSD, see LICENSE for more details. """ import sys import os import logging sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path import kay kay.setup_en...
1.796875
2
examples/plotting/field_pole_figure.py
heprom/pymicro
30
10706
<reponame>heprom/pymicro<filename>examples/plotting/field_pole_figure.py from pymicro.crystal.microstructure import * from pymicro.crystal.texture import * from pymicro.examples import PYMICRO_EXAMPLES_DATA_DIR from matplotlib import pyplot as plt, colors, colorbar, cm import pathlib as pl '''This example demonstrat...
2.671875
3
model/img2seq_torch.py
marcoleewow/LaTeX_OCR
290
10707
<gh_stars>100-1000 import time import sys import os import numpy as np import torch import torch.nn as nn import torchvision.models as models from torch.nn.utils.rnn import pack_padded_sequence from model.base_torch import BaseModel from model.utils.general import init_dir, get_logger from model.utils.g...
2.21875
2
src/third_party/dart/tools/dom/scripts/all_tests.py
rhencke/engine
21
10708
#!/usr/bin/python # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. """This entry point runs all script tests.""" import logging.config import unittest if ...
2.046875
2
src/11/11367.py
youngdaLee/Baekjoon
11
10709
<filename>src/11/11367.py """ 11367. Report Card Time 작성자: xCrypt0r 언어: Python 3 사용 메모리: 29,380 KB 소요 시간: 64 ms 해결 날짜: 2020년 9월 18일 """ def main(): for _ in range(int(input())): name, score = input().split() score = int(score) if score < 60: grade = 'F' elif score < 67: grade = 'D...
3.453125
3
imgaug/augmentables/bbs.py
bill0714/imgaug
1
10710
from __future__ import print_function, division, absolute_import import copy import numpy as np import skimage.draw import skimage.measure from .. import imgaug as ia from .utils import normalize_shape, project_coords # TODO functions: square(), to_aspect_ratio(), contains_point() class BoundingBox(object): ""...
2.828125
3
scanner_relay/run.py
breakds/brokering
0
10711
<gh_stars>0 #!/usr/bin/env python from twisted.internet import endpoints from twisted.internet import protocol from twisted.internet import defer from twisted.mail import imap4 from scanner_relay.pipeline import Pipeline from scanner_relay.authentication import PassStoreFetcher, PlainPasswordFetcher import logging ...
1.96875
2
cubes_pilingup.py
akiselev1/hackerrank-solutions
0
10712
""" Created by akiselev on 2019-06-14 There is a horizontal row of cubes. The length of each cube is given. You need to create a new vertical pile of cubes. The new pile should follow these directions: if is on top of then . When stacking the cubes, you can only pick up either the leftmost or the rightmost cube ...
4.15625
4
flask_web/bootstrap_web_core_py3.py
bopopescu/docker_images_a
0
10713
<filename>flask_web/bootstrap_web_core_py3.py<gh_stars>0 # # # File: flask_web_py3.py # # # import os import json import redis import urllib import flask from flask import Flask from flask import render_template,jsonify from flask_httpauth import HTTPDigestAuth from flask import request, session, url_f...
1.96875
2
git_talk/lib/changelog/main.py
cove9988/git-talk
5
10714
<filename>git_talk/lib/changelog/main.py<gh_stars>1-10 import os import logging from typing import Optional import click from git_talk.lib.changelog import generate_changelog from git_talk.lib.changelog.presenter import MarkdownPresenter from git_talk.lib.changelog.repository import GitRepository #...
2.28125
2
SQED-Generator/Generators/constraint_generator.py
upscale-project/generic-sqed-demo
6
10715
<reponame>upscale-project/generic-sqed-demo # Copyright (c) Stanford University # # This source code is patent protected and being made available under the # terms explained in the ../LICENSE-Academic and ../LICENSE-GOV files. # Author: <NAME> # Email: <EMAIL> import copy import sys sys.path.append("../FormatParsers/...
2.1875
2
modules/losses.py
Sapperdomonik/retinaface-tf2
0
10716
import tensorflow as tf def _smooth_l1_loss(y_true, y_pred): t = tf.abs(y_pred - y_true) return tf.where(t < 1, 0.5 * t ** 2, t - 0.5) def MultiBoxLoss(num_class=2, neg_pos_ratio=3): """multi-box loss""" def multi_box_loss(y_true, y_pred): num_batch = tf.shape(y_true)[0] num_prior = ...
2.4375
2
tests.py
ckelly/pybingmaps
0
10717
<reponame>ckelly/pybingmaps import unittest import random from time import sleep import os from bingmaps import * class BingMapsTestError(Exception): """Bing Maps test exception""" def __init__(self, reason): self.reason = unicode(reason) def __str__(self): return self.reason # TODO: en...
3.0625
3
fds/config.py
dvershinin/fds
9
10718
<filename>fds/config.py from cds.CloudflareWrapper import suggest_set_up, cf_config_filename from .FirewallWrapper import FirewallWrapper import logging as log def open_web_if_webserver_running(): fw = FirewallWrapper() from .utils import is_process_running, query_yes_no webserver_running = is_process_run...
2.421875
2
awardapp/migrations/0004_auto_20191024_1607.py
Elisephan/Awards-project
0
10719
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-10-24 16:07 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('awardapp', '0003_auto_20191024_1606'), ] operations = [ migrations.AlterField...
1.375
1
hikari/events/channel_events.py
Reliku/hikari
0
10720
<reponame>Reliku/hikari<gh_stars>0 # -*- coding: utf-8 -*- # cython: language_level=3 # Copyright (c) 2020 Nekokatt # # 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, incl...
1.351563
1
tests/unit/test_coordinator.py
sopel39/presto-admin
34
10721
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
1.523438
2
other/string chains/strings4.py
saulc/myth-math
0
10722
# <NAME> # <NAME> # config file format import random def openFile(): file = open("test.txt", 'r') return file def printFile(f): print(f.read()) def readInput(): testout = "CarpenteRatcheThread" file = open("test.txt", 'r') s = str(file.read()) words = s.split(" "); # print("Expect...
3.53125
4
supervised_learning/analysis.py
gonzalezJohnas/SpeechCommand-recognition
0
10723
from global_utils import * # target word TARGET_WORD = 'right' def display_lowpass_normal(wav, lowpass_signal, fs, label=''): fig, (axs_raw, axs_low) = plt.subplots(2) fig.tight_layout(pad=3.0) fig.set_figheight(FIG_HEIGHT) fig.set_figwidth(FIG_WIDTH) # display the plot axs_raw.plot(wav) ...
2.609375
3
qnarre/base/proof.py
quantapix/qnarre.com
0
10724
# Copyright 2019 Quantapix Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
2.28125
2
learningPygame/Dave/06-SpaceInvaders/space_invaders.py
Rosebotics/catapult2019
0
10725
import pygame, sys, random, time from pygame.locals import * class Missile: def __init__(self, screen, x): # Store the data. Initialize: y to 591 and exploded to False. self.screen = screen self.x = x self.y = 591 self.exploded = False def move(self): # ...
3.296875
3
tests/test_app/rest_app/rest_app/controllers/config_controller.py
jadbin/guniflask
12
10726
from guniflask.config import settings from guniflask.web import blueprint, get_route @blueprint class ConfigController: def __init__(self): pass @get_route('/settings/<name>') def get_setting(self, name): return {name: settings[name]}
1.898438
2
model/_UNet_trainer.py
yasahi-hpc/AMRNet
0
10727
<gh_stars>0 from ._base_trainer import _BaseTrainer, MeasureMemory import pathlib import torch.multiprocessing as mp import torch from torch import nn import horovod.torch as hvd import numpy as np import xarray as xr import itertools from .flow_dataset import FlowDataset from .unet import UNet import sys from .visuali...
1.867188
2
agents/vpg_policy_translation_with_dislocation.py
pjarosik/rlus
3
10728
<reponame>pjarosik/rlus from spinup import vpg import tensorflow as tf import numpy as np from gym.spaces import Box, Discrete from envs.focal_point_task_us_env import FocalPointTaskUsEnv from envs.phantom import ( ScatterersPhantom, Ball, Teddy ) from envs.imaging import ImagingSystem, Probe from envs.gene...
1.8125
2
lib/losses/dice.py
zongdaoming/CMT
3
10729
import sys,os sys.path.append('/home/zongdaoming/cv/multi-organ/multi-organ-ijcai') from lib.losses.BaseClass import _AbstractDiceLoss from lib.losses.basic import * class DiceLoss(_AbstractDiceLoss): """Computes Dice Loss according to https://arxiv.org/abs/1606.04797. For multi-class segmentation `weight` pa...
2.40625
2
icons.py
jasantunes/alfred-golinks
312
10730
<gh_stars>100-1000 # encoding: utf-8 # # Copyright (c) 2019 <NAME> <<EMAIL>> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2019-09-06 # """Overlay check mark on icons.""" from __future__ import print_function, absolute_import from Cocoa import ( NSBitmapImageRep, NSPNGFileType, ...
1.804688
2
project/python/Main/CTRL/tracker.py
warak/IOT-GrannyWarden
0
10731
import datetime from threading import Thread from time import sleep import DBC.dbcreate as dbc class Tracker(Thread): max_idle_time = 720 # minutes default_sleep = 3600 # secs def track(self): dbcl = dbc.DBClient() # print(dbcl.getlasttime()) print("Tracker activated") ...
3.09375
3
tests/unit/test_snapshot.py
cnnradams/python-spanner
0
10732
# Copyright 2016 Google LLC All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
1.992188
2
hashtable.py
quake0day/oj
0
10733
A = ['a','b'] B = ['c','b','a'] def generatehash(A): hashA = {} for item in A: if item not in hashA: hashA[item] = 1 else: hashA[item] += 1 return hashA def compareHash(A, B): lenA = len(A) lenB = len(B) hashA = generatehash(A) if lenB < lenA: ...
3.625
4
Manipulation of PDF Files/pandf_gui.py
clair513/DIY
1
10734
<filename>Manipulation of PDF Files/pandf_gui.py # Importing required packages: import pandas as pd from tkinter import * from tkinter.ttk import * root = Tk() # To visualize input DataFrame: def generate_plot(gui_root, df, x_axis, y_axis=None, plot={'type':None, 'hue':None}, ...
3.390625
3
utils/get_dataset.py
gautierdag/pytorch-attentive-lm
16
10735
<gh_stars>10-100 import os import torch from torch.utils.data import DataLoader, TensorDataset import requests import io import zipfile from .data_reader import read_vocabulary, read_lm_data, lm_data_producer from .pre_process_wikitext import pre_process def get_dataset(dataset, batch_size, device): """ Retu...
2.484375
2
Conteudo das Aulas/087/calc_est.py
cerberus707/lab-python
0
10736
from tkinter import * #Cria a nossa tela instancia = Tk() #Dá um título a tela instancia.title('Calculadora para Estatística') #Dá um tamanho a tela instancia.geometry("800x600") #Dá um ícone ao aplicativo #instancia.wm_iconbitmap('icone.ico') #Inicia o programa instancia.mainloop()
3.46875
3
property_scraper.py
iplaughlin/property_scraping
0
10737
# -*- coding: utf-8 -*- """ Created on Sat Mar 19 09:42:09 2022 @author: iaala """ import requests import sql_configs import datetime import os from bs4 import BeautifulSoup import time from find_tables import ( table_information_one, table_information_two, table_information_three, table_information_...
2.546875
3
Chapter03/Activity11/fibonacci.py
vumaasha/python-workshop
0
10738
def fibonacci_iterative(n): previous = 0 current = 1 for i in range(n - 1): current_old = current current = previous + current previous = current_old return current def fibonacci_recursive(n): if n == 0 or n == 1: return n else: return fibonacci_recursive...
4.25
4
matches/tests/test_view_index.py
ToxaZ/nostradamus
0
10739
<filename>matches/tests/test_view_index.py from django.urls import resolve, reverse from django.test import TestCase from matches.views import matches_index from matches.models import Match class AllMatchesTests(TestCase): def setUp(self): self.match = Match.objects.create( match_id=1, ...
2.34375
2
hmc/applications/banana/banana.py
JamesBrofos/Thresholds-in-Hamiltonian-Monte-Carlo
1
10740
from typing import Callable, Tuple import numpy as np def posterior_factory(y: np.ndarray, sigma_y: float, sigma_theta: float) -> Tuple[Callable]: """The banana distribution is a distribution that exhibits a characteristic banana-shaped ridge that resembles the posterior that can emerge from models that ...
3.15625
3
msp430.py
sprout42/binaryninja-msp430
0
10741
<reponame>sprout42/binaryninja-msp430 from binaryninja import ( Architecture, BranchType, FlagRole, InstructionInfo, LowLevelILFlagCondition, RegisterInfo, ) from .instructions import TYPE3_INSTRUCTIONS, Instruction, Registers from .lifter import Lifter class MSP430(Architecture): name = ...
2.140625
2
app/domain/__init__.py
emge1/tracardi
0
10742
__all__ = [ 'session', 'event', 'profile', 'consent', 'segment', 'source', 'rule', 'entity' ]
1.023438
1
metric_calculation/faster_metrics.py
imatge-upc/saliency-2018-videosalgan
10
10743
<reponame>imatge-upc/saliency-2018-videosalgan<filename>metric_calculation/faster_metrics.py<gh_stars>1-10 from salience_metrics import auc_judd, auc_shuff, cc, nss, similarity, normalize_map """ DHF1K paper: "we employ five classic met-rics, namely Normalized Scanpath Saliency (NSS), Sim-ilarity Metric (SIM)...
2.109375
2
tests/rules/test_pacman_invalid_option.py
RogueScholar/thefuck-termux
0
10744
import pytest from thefuck.rules.pacman_invalid_option import get_new_command from thefuck.rules.pacman_invalid_option import match from thefuck.types import Command good_output = """community/shared_meataxe 1.0-3 A set of programs for working with matrix representations over finite fields """ bad_output = "erro...
2.828125
3
dimod/reference/composites/scalecomposite.py
joseppinilla/dimod
1
10745
<reponame>joseppinilla/dimod<filename>dimod/reference/composites/scalecomposite.py # Copyright 2019 D-Wave Systems 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 # # htt...
2.03125
2
tests/test_config.py
savilard/flask-ecom-api
1
10746
import os def test_development_config(test_app): test_app.config.from_object('flask_ecom_api.config.DevelopmentConfig') assert not test_app.config['TESTING'] assert test_app.config['SQLALCHEMY_DATABASE_URI'] == os.environ.get('DATABASE_URL') def test_testing_config(test_app): test_app.config.from_ob...
2.3125
2
leasing/forms.py
suutari-ai/mvj
1
10747
from django import forms from django.core import validators from django.core.exceptions import ValidationError from leasing.enums import ( InfillDevelopmentCompensationState, LeaseState, TenantContactType, ) from leasing.models import Contact, DecisionMaker, District, LeaseType, Municipality from leasing.v...
2.171875
2
src/main/management/commands/create_admin_user.py
LokotamaTheMastermind/website-portfolio-django-project
0
10748
# polls/management/commands/create_admin_user.py import sys import logging from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.conf import settings class Command(BaseCommand): help = 'Creates the initial admin user' def handle(self, *args...
2.296875
2
app.py
jdanper/incredipaper
0
10749
import unirest import json import requests import os import subprocess import time import argparse rootUrl = "https://api.unsplash.com/" unirest.default_header("Accept", "application/json") unirest.default_header("Accept-Version", "v1") unirest.default_header("Authorization","<CLIENT-ID>") def downloadPic(randomPic_...
2.625
3
tests/client_asyncio_test.py
ninchat/ninchat-python
0
10750
<gh_stars>0 # Copyright (c) 2017, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions ...
1.539063
2
msgraph/base.py
jstacoder/python-msgraph
2
10751
<reponame>jstacoder/python-msgraph from datetime import datetime class Base(object): date_format = '%Y-%m-%d' time_format = '%H:%M:%S' datetime_format = date_format + 'T%s' % time_format full_datetime_format = date_format + 'T' + time_format + '.%f' iso_format = date_format + 'T%sZ' % time_format ...
2.75
3
nc/models.py
caktus/Traffic-Stops
1
10752
from caching.base import CachingManager, CachingMixin from django.db import models from tsdata.models import CensusProfile PURPOSE_CHOICES = ( (1, "Speed Limit Violation"), (2, "Stop Light/Sign Violation"), (3, "Driving While Impaired"), (4, "Safe Movement Violation"), (5, "Vehicle Equipment Violat...
1.992188
2
flasky/auth/forms/__init__.py
by46/fasky
0
10753
<reponame>by46/fasky<gh_stars>0 from .login import LoginForm from .registration import RegistrationForm
0.917969
1
API_SIMIT_Mail/multapp/urls.py
profefonso/Services-SM
0
10754
from django.urls import path from django.contrib import admin from rest_framework_swagger.views import get_swagger_view from .views import notification schema_view = get_swagger_view(title='MAIL API') urlpatterns = [ path('front/betsy/irish/embargo/admin/', admin.site.urls), # Swagger API path( ...
1.601563
2
tests/legacy_mocket.py
jepler/Adafruit_CircuitPython_Requests
0
10755
<filename>tests/legacy_mocket.py from unittest import mock SOCK_STREAM = 0 set_interface = mock.Mock() interface = mock.MagicMock() getaddrinfo = mock.Mock() socket = mock.Mock() class Mocket: def __init__(self, response): self.settimeout = mock.Mock() self.close = mock.Mock() self.conne...
2.875
3
run.py
romeroyakovlev/ii
1
10756
# -*- coding: utf-8 -*- import api,points from api.bottle import * II_PATH=os.path.dirname(__file__) or '.' TEMPLATE_PATH.insert(0,II_PATH) @route('/list.txt') def list_txt(): response.set_header ('content-type','text/plain; charset=utf-8') lst = api.load_echo(False)[1:] if request.query.n: retur...
2.21875
2
learning_labs/yang/01-yang/add_loopback_ip.py
hpreston/sbx_nxos
33
10757
#!/usr/bin/env python from ncclient import manager import sys from lxml import etree # Set the device variables DEVICES = ['172.16.30.101', '172.16.30.102'] USER = 'admin' PASS = '<PASSWORD>' PORT = 830 LOOPBACK_IP = { '172.16.30.101': '10.99.99.1/24', '172.16.30.102': '10.99.99.2/24' } DEVICE_NAMES = {'172...
2.671875
3
Plotly_Dash/spacex_dash_app.py
AtypicalLogic/Coursera-IBM_DS-Applied_Data_Science_Capstone
0
10758
<reponame>AtypicalLogic/Coursera-IBM_DS-Applied_Data_Science_Capstone # To run this file, Win Start > cmd > file dir > run: python spacex_dash_app.py # Import required libraries import pandas as pd import dash from dash import html from dash import dcc from dash.dependencies import Input, Output import plotly.express a...
3.765625
4
configs/mnist_paper_residual_cnn_gp.py
rhaps0dy/cnn-gp
23
10759
<reponame>rhaps0dy/cnn-gp """ The best randomly-searched ResNet reported in the paper. In the original paper there is a bug. This network sums together layers after the ReLU nonlinearity, which are not Gaussian, and also do not have mean 0. As a result, the overall network does not converge to a Gaussian process. The ...
3.015625
3
python/learn/PythonDataVisualizationCookbookSE_Code/Chapter 07/ch07_rec08_scatterplot.py
flyingwjw/Documentation
0
10760
<gh_stars>0 import matplotlib.pyplot as plt import numpy as np # daily search trend for keyword 'flowers' for a year d = [ 1.04, 1.04, 1.16, 1.22, 1.46, 2.34, 1.16, 1.12, 1.24, 1.30, 1.44, 1.22, 1.26, 1.34, 1.26, 1.40, 1.52, 2.56, 1.36, 1.30, 1.20, 1.12, 1.12, 1.12, 1.06, 1.06, 1.00, 1.02, 1.04, 1.02, 1.06, 1.02, 1...
2.15625
2
src/thespian/tweaks.py
mtttech/dndpersonae
1
10761
from dataclasses import dataclass import logging from attributes import get_ability_modifier from sourcetree.utils import ( get_feats_list, get_feat_perks, get_feat_proficiencies, get_feat_requirements, ) from stdio import prompt log = logging.getLogger("thespian.tweaks") class AbilityScoreImproveme...
3.375
3
atomic1D/ImpuritySpecies.py
TBody/atomic1D
1
10762
class ImpuritySpecies(object): # For storing OpenADAS data related to a particular impurity species # Loosely based on cfe316/atomic/atomic_data.py/AtomicData class (although with much less code since # all of the F77 importing is done in the seperate <<make json_update>> code since BOUT++ protocol # requires fort...
2.78125
3
Utils/Matrix.py
valavanisleonidas/Machine_Learning_Toolkit
0
10763
<reponame>valavanisleonidas/Machine_Learning_Toolkit import os import platform import numpy class Matrix: def __init__(self): if platform.system() == "Windows": self.delimiterForPath = "\\" else: self.delimiterForPath = "/" self.labelsDType = numpy.int32 se...
2.53125
3
networking_calico/plugins/ml2/drivers/calico/policy.py
manojcode/networking-calico
0
10764
<reponame>manojcode/networking-calico # -*- coding: utf-8 -*- # Copyright (c) 2018 Tigera, 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....
1.78125
2
25/main.py
gosha20777/mipt-bioinfo-2021
0
10765
<filename>25/main.py<gh_stars>0 def global_alignment(seq1, seq2, score_matrix, penalty): len1, len2 = len(seq1), len(seq2) s = [[0] * (len2 + 1) for i in range(len1 + 1)] backtrack = [[0] * (len2 + 1) for i in range(len1 + 1)] for i in range(1, len1 + 1): s[i][0] = - i * penalty for j in ran...
2.90625
3
utils/visualize_tree.py
moyiming1/Retrosynthesis-pathway-ranking
10
10766
<gh_stars>1-10 import os, sys project_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(project_path) import pickle def construct_tree_for_visual(tree, node_info_key, depth=0): tree_for_visual = {'smiles': 'http://askcos.mit.edu/draw/smiles/' + str(tree['smiles']).replace('#', '%2...
2.5625
3
python-is-easy/assignments/snowman/main.py
eDyablo/pirple
0
10767
<filename>python-is-easy/assignments/snowman/main.py<gh_stars>0 ''' Homework assignment for the 'Python is easy' course by Pirple. Written be <NAME>. Snowman(Hangman) game. ''' from os import ( name as os_name, system as system_call, ) from os.path import ( abspath, dirname, join as join_path, )...
3.8125
4
src/GenericTsvReader.py
getzlab/ABSOLUTE
0
10768
<reponame>getzlab/ABSOLUTE """ Created on Jul 5, 2012 @author: lichtens """ import csv import os class GenericTsvReader(object): """ Read a TSV file. This class wraps a DictReader, but handles comments, which are not handled gracefully in the python csv library. The next() method assumes...
2.859375
3
examples/applications/plot_impact_imbalanced_classes.py
cdchushig/imbalanced-learn
5,678
10769
""" ========================================================== Fitting model on imbalanced datasets and how to fight bias ========================================================== This example illustrates the problem induced by learning on datasets having imbalanced classes. Subsequently, we compare different approac...
3.625
4
python/fix-page-breaks.py
utcompling/GeoAnnotate
9
10770
<filename>python/fix-page-breaks.py #!/usr/bin/python import argparse import re parser = argparse.ArgumentParser(description='Fix page breaks in War of The Rebellion text') parser.add_argument('files', nargs='*', help='Files to process') args = parser.parse_args() for file in args.files: outfile...
3.109375
3
2021/02/part2.py
FranciscoAT/advent-of-code
0
10771
<gh_stars>0 def main(file: str) -> None: depth = 0 distance = 0 aim = 0 with open(f"{file}.in") as f: for line in f.readlines(): line = line.rstrip().split(" ") command = line[0] unit = int(line[1]) if command == "forward": distance...
3.515625
4
tf_seal/python/tensor.py
karlhigley/tf-seal
94
10772
<reponame>karlhigley/tf-seal<filename>tf_seal/python/tensor.py import numpy as np import tensorflow as tf import tf_seal.python.ops.seal_ops as ops from tensorflow.python.keras.utils import tf_utils from tensorflow.python.client import session as tf_session from tensorflow.python.framework import ops as tf_ops clas...
2.5625
3
program/admin.py
Dumbaz/autoradio-pv
0
10773
from django.core.exceptions import ObjectDoesNotExist from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from django.shortcuts import render from django.conf import settings from .models import Language, Type, MusicFocus, Category, Topic, RTRCategory, Host, Note, RRule, Schedule, ...
2.046875
2
test/logic/test_block_features.py
Sam-prog-sudo/Sam.github.io
3
10774
<gh_stars>1-10 import hashlib import json from time import time import pytest from app.chaine.blockchain import Blockchain @pytest.fixture def first_block(): return { 'index': 1, 'timestamp': time(), 'transactions': [], 'proof': 1989, 'previous_hash': 1, } def test_...
2.15625
2
urls.py
cartologic/cartoview_graduated_styler
0
10775
<gh_stars>0 # from django.conf.urls import patterns, url, include # from django.views.generic import TemplateView # from . import views, APP_NAME # # urlpatterns = patterns('', # url(r'^$', views.index, name='%s.index' % APP_NAME), # ) from django.urls import path, re_path, include from . import views, APP_NAME fr...
1.882813
2
core/rest/wscdn.py
cybert79/Osmedeus
1
10776
import os import glob import json from pathlib import Path from flask_restful import Api, Resource, reqparse from flask_jwt_extended import jwt_required from flask import Flask, request, escape, make_response, send_from_directory import utils # incase you can't install ansi2html it's won't break the api try: from ...
2.484375
2
custom_components/hahm/services.py
noxhirsch/custom_homematic
0
10777
"""Module with hahomematic services.""" from __future__ import annotations from datetime import datetime import logging from hahomematic.const import ( ATTR_ADDRESS, ATTR_INTERFACE_ID, ATTR_NAME, ATTR_PARAMETER, ATTR_VALUE, HmPlatform, ) from hahomematic.device import HmDevice from hahomematic...
1.992188
2
app/migrations/0001_initial.py
MariaAlice00/ifpi-tds-projeto-integrador
0
10778
# Generated by Django 3.2.3 on 2021-06-03 00:35 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Livro', fields=[ ('id', models.BigAutoField...
1.765625
2
graalpython/com.oracle.graal.python.parser.antlr/postprocess.py
transposit/graalpython
1
10779
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # The Universal Permissive License (UPL), Version 1.0 # # Subject to the condition set forth below, permission is hereby granted to any # person obtaining a copy of this softw...
1.171875
1
scripts/ape_protocol_deploy.py
coordinape/coordinape-protocol
22
10780
<reponame>coordinape/coordinape-protocol from brownie import accounts, Wei, chain, ApeToken, ApeVaultFactory, ApeDistributor, ApeRegistry, ApeRouter, FeeRegistry, MockRegistry, MockVaultFactory, MockToken, MockVault def deploy_token(): funds = accounts.load('moist', '\0') user = accounts.load('ape_deployer', '\0') ...
2.390625
2
groups/views.py
MAKENTNU/web
10
10781
<filename>groups/views.py from django.contrib.auth.mixins import PermissionRequiredMixin from django.urls import reverse_lazy from django.views.generic import DetailView, ListView, UpdateView from .models import Committee class CommitteeList(ListView): model = Committee template_name = 'groups/committee_list...
2
2
src/programy/braintree.py
motazsaad/fit-bot-fb-clt
0
10782
<reponame>motazsaad/fit-bot-fb-clt<gh_stars>0 """ Copyright (c) 2016-2019 <NAME> http://www.keithsterling.com 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...
1.703125
2
reana_commons/publisher.py
marcdiazsan/reana-commons
0
10783
# -*- coding: utf-8 -*- # # This file is part of REANA. # Copyright (C) 2018 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """REANA-Commons module to manage AMQP connections on REANA.""" import json import logging fr...
2.421875
2
model/commit.py
uniaim-event-team/pullre-kun
3
10784
from sqlalchemy import ( BigInteger, Column, DateTime, Text, String, Integer, ) from sqlalchemy.sql.functions import current_timestamp from model.base import BaseObject class Commit(BaseObject): __tablename__ = 'commits' id = Column(BigInteger, primary_key=True, autoincrement=True) ...
2.46875
2
drae/__init__.py
hso/drae.py
0
10785
<reponame>hso/drae.py from drae import search
0.992188
1
tests/components/template/test_select.py
JeffersonBledsoe/core
5
10786
"""The tests for the Template select platform.""" import pytest from homeassistant import setup from homeassistant.components.input_select import ( ATTR_OPTION as INPUT_SELECT_ATTR_OPTION, ATTR_OPTIONS as INPUT_SELECT_ATTR_OPTIONS, DOMAIN as INPUT_SELECT_DOMAIN, SERVICE_SELECT_OPTION as INPUT_SELECT_SE...
2.21875
2
corefacility/core/test/models/test_application_access.py
serik1987/corefacility
0
10787
import os import random import string import base64 from django.utils import timezone from django.contrib.auth.hashers import make_password, check_password from django.test import TestCase from parameterized import parameterized from core.models import Module, EntryPoint, ExternalAuthorizationSession, User AUTHORIZA...
2.171875
2
cmsfix/lib/macro.py
trmznt/cmsfix
0
10788
<filename>cmsfix/lib/macro.py from rhombus.lib.utils import get_dbhandler from rhombus.lib.tags import * from cmsfix.models.node import Node import re # the pattern below is either # ///123 # <<MacroName>> # [[MacroName]] pattern = re.compile('///(\d+)|///\{([\w-]+)\}|\&lt\;\&lt\;(.+)\&gt\;\&gt\;|\[\[(.+)\]\]') # s...
2.375
2
xastropy/sdss/qso.py
bpholden/xastropy
3
10789
''' #;+ #; NAME: #; sdss.qso #; Version 1.1 #; #; PURPOSE: #; Class for SDSS QSO #; 2015 Written by JXP #;- #;------------------------------------------------------------------------------ ''' # Import libraries import numpy as np import os from astropy.table import QTable, Column from astropy.coordinates i...
2.203125
2
ez_sten/__init__.py
deadlift1226/ez-sten
0
10790
<reponame>deadlift1226/ez-sten name = "module" from .module import func
1.070313
1
wisdem/test/test_optimization_drivers/test_dakota_driver.py
johnjasa/WISDEM
81
10791
import unittest import numpy as np from openmdao.utils.assert_utils import assert_near_equal from wisdem.optimization_drivers.dakota_driver import DakotaOptimizer try: import dakota except ImportError: dakota = None @unittest.skipIf(dakota is None, "only run if Dakota is installed.") class Te...
2.3125
2
lab4_runTFCurveFitting.py
pskdev/EveryBodyTensorFlow
1
10792
#-*- coding: utf-8 -*- #! /usr/bin/env python ''' #------------------------------------------------------------ filename: lab4_runTFCurveFitting.py This is an example for linear regression in tensorflow Which is a curve fitting example written by <NAME> @ Aug 2017 #---------------------------------------------...
3.125
3
app/route/stats/route.py
LifeLaboratory/finopolis_backend
0
10793
<reponame>LifeLaboratory/finopolis_backend # coding=utf-8 from app.route.stats.processor import * from app.api.base.base_router import BaseRouter from app.api.base import base_name as names class Stats(BaseRouter): def __init__(self): super().__init__() self.args = [names.face, names.post, names....
2.40625
2
script/calculate_correct_percentage_kingdom.py
xie186/dragmap-meth
4
10794
<gh_stars>1-10 from Bio import TogoWS import argparse import sys import os def summary(options): num_reads = 0 num_correct = 0 with open(options.input) as file_input: for line in file_input: line = line.rstrip() ele = line.split("\t") if "FAILED" in line: ...
3.28125
3
borax/patterns/singleton.py
kinegratii/borax
51
10795
<reponame>kinegratii/borax<filename>borax/patterns/singleton.py<gh_stars>10-100 # coding=utf8 class MetaSingleton(type): def __init__(cls, *args): type.__init__(cls, *args) cls.instance = None def __call__(cls, *args, **kwargs): if not cls.instance: cls.instance = type.__c...
2.25
2
aiida/backends/general/migrations/utils.py
pranavmodx/aiida-core
0
10796
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
1.992188
2
src/models/__init__.py
DwaraknathT/sparsity
0
10797
<filename>src/models/__init__.py __all__ = ["transformers", "vision"] from .transformers import * from .vision import *
1.21875
1
packages/pyright-internal/src/tests/samples/genericTypes12.py
sasano8/pyright
4,391
10798
# This sample tests the checker's ability to enforce # type invariance for type arguments. # pyright: strict from typing import Dict, Union foo: Dict[Union[int, str], str] = {} bar: Dict[str, str] = {} # This should generate an error because # both type parameters for Dict are invariant, # and str isn't assignable ...
2.65625
3
test.py
Naveenkhasyap/udacity-ml
0
10799
<reponame>Naveenkhasyap/udacity-ml how_many_snakes = 1 snake_string = """ Welcome to Python3! ____ / . .\\ \\ ---< \\ / __________/ / -=:___________/ <3, Juno """ print(snake_string * how_many_snakes)
3.125
3