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
src/run_joint_confidence_generator-only.py
williamsashbee/Confident_classifier
0
14700
<reponame>williamsashbee/Confident_classifier<gh_stars>0 ############################################## # This code is based on samples from pytorch # ############################################## # Writer: <NAME> from __future__ import print_function import argparse import torch import torch.nn as nn import torch.n...
2.34375
2
450/Nagendra/greedy/Swap and Maximize .py
Nagendracse1/Competitive-Programming
3
14701
#code https://practice.geeksforgeeks.org/problems/swap-and-maximize/0 for _ in range(int(input())): n = int(input()) arr = list(map(int, input().split())) arr.sort() max = 0 for i in range(n//2): max -= 2*arr[i] max += 2*arr[n-i-1] print(max)
3.421875
3
ga4stpg/tree/generate.py
GiliardGodoi/ppgi-stpg-gpx
0
14702
<gh_stars>0 from random import sample, shuffle from ga4stpg.graph import UGraph from ga4stpg.graph.disjointsets import DisjointSets class GenerateBasedPrimRST: def __init__(self, stpg): self.stpg = stpg def __call__(self): result = UGraph() terminals = self.stpg.termina...
2.65625
3
Probabilistic_Matching.py
Data-Linkage/Rwandan_linkage
0
14703
import pandas as pd import rapidfuzz import math import numpy as np # ------------------------- # # --------- DATA ---------- # # ------------------------- # # Read in mock census and PES data CEN = pd.read_csv('Data/Mock_Rwanda_Data_Census.csv') PES = pd.read_csv('Data/Mock_Rwanda_Data_Pes.csv') # select ne...
2.921875
3
rootfs/guest/daemon.py
ucsdsysnet/faasnap
0
14704
<filename>rootfs/guest/daemon.py import time, sys, mmap import subprocess from flask import Flask, request app = Flask(__name__) import fcntl, time, struct import redis from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor # executor = ProcessPoolExecutor(max_workers=2) executor = ThreadPoolExecutor(...
2.03125
2
mil_text/rank_plot_all.py
AntonValk/BagGraph-Graph-MIL
8
14705
<gh_stars>1-10 import csv import numpy as np import seaborn as sns import pandas as pd import matplotlib.pyplot as plt datasets = ['alt.atheism', 'comp.graphics', 'comp.os.ms-windows.misc', 'comp.sys.ibm.pc.hardware', 'comp.sys.mac.hardware', 'comp.windows.x', 'misc.forsale', 'rec.autos', 'rec.motor...
2.265625
2
rh_logger/backends/backend_datadog_logging.py
tomuram/rh_logger
1
14706
<filename>rh_logger/backends/backend_datadog_logging.py '''logger.py - the Datadog logger''' import collections import datadog import datetime import os import logging import rh_logger import rh_logger.api import sys import traceback class DatadogLogger(rh_logger.api.Logger): '''Logger for datadog''' def __i...
2.40625
2
script_preprocess/building_aggregated_data.py
FrappucinoGithub/school_meal_forecast_regressions
2
14707
import os import pandas as pd import spacy from sklearn.feature_extraction.text import CountVectorizer import datetime import numpy as np from processing import get_annee_scolaire if __name__ == "__main__": #print("files", os.listdir("data_processed")) ########################## # Chargement des donné...
2.546875
3
main/migrations/0028_auto_20170103_1634.py
jsmnbom/htxaarhuslan
1
14708
<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-01-03 15:34 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('main', '0027_auto_20170103_1130'), ] ...
1.640625
2
gw_grb_h_0_ppd_summaries.py
KamshatTazhenova/hh0
11
14709
import numpy as np import matplotlib.pyplot as mp import matplotlib.cm as mpcm import matplotlib.colors as mpc import scipy.stats as ss # plotting settings lw = 1.5 mp.rc('font', family = 'serif') mp.rcParams['text.latex.preamble'] = [r'\boldmath'] mp.rcParams['axes.linewidth'] = lw mp.rcParams['lines.linewidth'] = lw...
2.3125
2
first_lab.py
ShevchenyaIlya/Chess_knight_move
0
14710
<gh_stars>0 import pygame from laboratory.base import ChessBoard, ChessHorse, Grid import os os.environ["SDL_VIDEO_WINDOW_POS"] = "400, 100" surface = pygame.display.set_mode((600, 600)) pygame.display.set_caption("Chess knight move") pygame.init() grid = ChessBoard() horse = ChessHorse() cells = Grid() def stand_c...
2.859375
3
models/faster_rcnn_fpn.py
martin-marek/parking-space-occupancy
6
14711
from torch import nn from torchvision.models.detection.backbone_utils import resnet_fpn_backbone from torchvision.models.utils import load_state_dict_from_url from .utils import pooling from .utils.class_head import ClassificationHead class FasterRCNN_FPN(nn.Module): """ A Faster R-CNN FPN inspired parking l...
2.578125
3
configProvider.py
misc77/dsegenerator
0
14712
from resources import Resources import configparser def getConfigEntry(group, item): entry = None if group != None and item != None: config = configparser.ConfigParser() try: config.read(Resources.getConfigFile()) except(FileNotFoundError): print("ERROR: File '"...
3.109375
3
H5_News_Tracker/gui/ticker_window.py
Mouse-Diplodicus/H5-NewsTracker
0
14713
<reponame>Mouse-Diplodicus/H5-NewsTracker """ Program displays a window with text using Tkinter when run. """ import tkinter import webbrowser from tkinter import font from tkinter import ttk class TickerWindow(tkinter.Frame): """Main Object for creating and running the news ticker gui""" max_label_width = 8...
3.0625
3
Yu/Web.py
Hiroshiba/KotohiraYu
0
14714
# -*- coding: utf-8 -*- import os import configparser import glob import sqlite3 import traceback import json from bottle import route, run, auth_basic, abort, response from sqlite3 import OperationalError config = configparser.ConfigParser() config.read('config/config.ini') def VERIFY(username, password): retur...
2.5
2
urduhack/stop_words.py
fahdrazavi/urduhack
0
14715
<gh_stars>0 # coding: utf8 """ Complete collection of stopwords for the Urdu language. Maintainer: <NAME>(<EMAIL>) version = 2019.04.07 Source = https://github.com/urduhack/urdu-stopwords """ # Urdu Language Stop words list STOP_WORDS = frozenset(""" آ آئی آئیں آئے آتا آتی آتے آس آنا آنی آنے آپ آیا ابھی از اس اسی اس...
2.0625
2
src/sequencemodel_09.py
PatrikValkovic/neural-networks-step-by-step
1
14716
<reponame>PatrikValkovic/neural-networks-step-by-step import numpy as np from progressbar import progressbar class SequenceModel: def __init__(self, layers, loss, metrices = [], random_seed = None): self._rand = np.random.RandomState(random_seed); self.loss = loss self.metrices = metrices ...
3.21875
3
django_sso_app/app/views.py
paiuolo/django-sso-app
1
14717
from django.http import HttpResponseRedirect from django.views import View from ..core import app_settings class AppLoginView(View): def get(self, request, *args, **kwargs): next = request.GET.get('next', '') return HttpResponseRedirect(app_settings.REMOTE_LOGIN_URL + next) class AppSignupView...
2.078125
2
tests/components/multimatic/__init__.py
thomasgermain/home-assistant
7
14718
<filename>tests/components/multimatic/__init__.py<gh_stars>1-10 """The tests for multimatic integration.""" from __future__ import annotations import datetime from typing import Any from unittest.mock import AsyncMock, patch from pymultimatic.model import ( ActiveFunction, BoilerStatus, Circulation, D...
2.078125
2
test/e2e/test_200_header_invalid.py
elukey/mod_h2
0
14719
<gh_stars>0 # # mod-h2 test suite # check handling of invalid chars in headers # import copy import os import re import sys import time import pytest from datetime import datetime from TestEnv import TestEnv from TestHttpdConf import HttpdConf def setup_module(module): print("setup_module: %s" % module.__name__)...
2.640625
3
controller/controller.py
angelocarbone/MoDelS
1
14720
from scenarios import helper from scenarios.builder import Builder from model.enumerations import e_ExperienceFactor, e_MentalOrEmotionalFactor, e_PhyOrPhyFactor, e_EntityType, e_Relation, e_CausalFactorType from model.knowledge_base import kb from model.entities import Entity, CausalFactor from model.utils import Boun...
2.28125
2
stan/data/data_lex.py
chappers/Stan
1
14721
<filename>stan/data/data_lex.py """ The :mod:`stan.data_lex` module is the lexer for SAS-like language. """ from pyparsing import * from stan.data.data_expr import EXPR_, ID_, DATA, SET, RENAME, RUN, DROP, KEEP, SEMI_, LOGICAL_ # set up logic dataStepStmt = Forward() # data/set inline options rename_stmt = (OneO...
2.234375
2
setup.py
JayDwayne/Neopo
0
14722
<reponame>JayDwayne/Neopo import os from platform import system from setuptools import setup from subprocess import run, PIPE, CalledProcessError running_on_windows = system() == "Windows" running_in_docker = os.path.isfile("/.dockerenv") # Consistent version as AUR try: count = run(["git", "rev-list", "--count",...
1.820313
2
jmetal/core/operator.py
LuckysonKhaidem/ProjectAlpha
1
14723
<reponame>LuckysonKhaidem/ProjectAlpha from abc import ABCMeta, abstractmethod from typing import TypeVar, Generic, List S = TypeVar('S') R = TypeVar('R') """ .. module:: Operator :platform: Unix, Windows :synopsis: Templates for operators. .. moduleauthor:: <NAME> <<EMAIL>> """ class Operator(Generic[S, R])...
2.703125
3
foo/pictureR/wordsTemplate.py
MangetsuC/arkHelper
147
14724
<filename>foo/pictureR/wordsTemplate.py<gh_stars>100-1000 from PIL import Image, ImageDraw, ImageFont from numpy import asarray from cv2 import cvtColor, COLOR_RGB2BGR, imshow, waitKey from os import getcwd def getFontSize_name(resolution): x = resolution[0] if x <= 1024: return (16, (1024,576)) el...
2.6875
3
bin/concat_msa.py
HadrienG/arbetsprov
5
14725
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse from Bio import AlignIO def concat_msa(msas, output): """concatenate msas together""" alignments = [] for msa in msas: align = AlignIO.read(msa, "fasta") # shorten id so the concatenated alignment keeps it for record i...
3.390625
3
rendez-vous.py
MrDarkness117/parseTsum
0
14726
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.keys import Keys...
2.21875
2
stdlib/getpass_qs.py
bpuderer/python-snippets27
3
14727
import getpass # prompt user without echoing output print getpass.getpass() print getpass.getpass(prompt="Custom Prompt:") print "user login name:", getpass.getuser()
2.421875
2
backend/todo/migrations/0008_auto_20190403_0812.py
Bhunesh2000/todoWithDjango
0
14728
<reponame>Bhunesh2000/todoWithDjango<gh_stars>0 # Generated by Django 2.2 on 2019-04-03 08:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('todo', '0007_todo_dateevent'), ] operations = [ migrations.AlterField( model_name=...
1.398438
1
public/neumeeditor/models/fields/short_code_field.py
jacobsanz97/cantus
0
14729
import re from django.db import models unacceptable_chars = "[^a-z0-9\._]" duplicate_spaces_and_dots = "[\ .]+" class ShortCodeField(models.CharField): description = "A short string representing a glyph name" def pre_save(self, model_instance, add): model_instance.short_code = sanitize_short_code(mo...
2.546875
3
2/week2/c.py
briannice/logiscool-python
0
14730
def som(a, b): """Bereken de som van twee getallen. Als de som groter is dan nul return je de som. Als de som kleiner is dan nul, dan return je nul. Args: a (int): het eerste getal b (int): het tweede getal """ pass assert som(1, 2) == 3 assert som(-1, -2) == -3 assert som(0, ...
3.625
4
src/plugins/pipeline_plugins/utils/blob.py
google/cc4d
11
14731
<filename>src/plugins/pipeline_plugins/utils/blob.py<gh_stars>10-100 # python3 # coding=utf-8 # Copyright 2020 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.a...
2.140625
2
LinearModel/scripts/three_classes_train.py
SMZCC/TF-deep-learn
0
14732
# coding=utf-8 # date: 2019/1/1, 19:38 # name: smz import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from sklearn.utils import shuffle from LinearModel.modules.model3 import ModelThreeClasses from LinearModel.configuration.options import opts from LinearModel.scripts.gen_data import generate_d...
2.390625
2
trio/_core/tests/test_multierror.py
JefffHofffman/trio
4
14733
<gh_stars>1-10 import logging import pytest from traceback import extract_tb, print_exception, format_exception, _cause_message import sys import os import re from pathlib import Path import subprocess from .tutil import slow from .._multierror import MultiError, concat_tb from ..._core import open_nursery class N...
2.234375
2
servo/drv/ec3po_gpio.py
mmind/servo-hdctools
2
14734
<gh_stars>1-10 # Copyright 2016 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Driver for gpio controls through ec3po. Provides the following console controlled function: _Get_single, _Set_single, _Get_multi, _Set...
2.734375
3
scipy_util/util.py
idf/sci_util_py
0
14735
""" Adapted from https://github.com/bytefish/facerec """ import os from PIL import Image import numpy as np import random def read_image(filename): imarr = np.array([]) try: im = Image.open(os.path.join(filename)) im = im.convert("L") # convert to greyscale imarr = np.array(im, dtype=...
2.96875
3
cmsplugin_markdown/apps.py
glomium/cmstemplate
0
14736
from django.apps import AppConfig class CmspluginMarkdownConfig(AppConfig): name = 'cmsplugin_markdown'
1.078125
1
tools/harness/tests/freemem.py
lambdaxymox/barrelfish
111
14737
########################################################################## # Copyright (c) 2009, ETH Zurich. # All rights reserved. # # This file is distributed under the terms in the attached LICENSE file. # If you do not find this file, copies can be found by writing to: # ETH Zurich D-INFK, Universitaetstrasse 6, CH...
2.484375
2
grad_cam.py
SamuelCahyawijaya/pytorch-smoothgrad
77
14738
import argparse import os import sys import numpy as np from scipy import misc import cv2 import torch import torch.nn as nn from torch.autograd import Variable from torchvision.models import vgg16, vgg19 from torchvision.utils import save_image from lib.gradients import GradCam, GuidedBackpropGrad from lib.image_uti...
2.375
2
Task2G.py
asew4/Flood-Warning-System-8
0
14739
from floodsystem import stationdata, datafetcher, station stations = stationdata.build_station_list() stationdata.update_water_levels(stations) #Empty lists for each of the risk categories severe_level_station = [] high_level_station = [] moderate_level_station = [] low_level_station = [] for station in stations: #S...
3.15625
3
Protheus_WebApp/Modules/SIGAACD/ACDA035TESTCASE.py
98llm/tir-script-samples
17
14740
#//------------------------------------------------------------------- #/*/{Protheus.doc} ACDA035 - # #@author <NAME> #@since 23/09/2019 #@version P12 # # CT001 - Inclusão de Lançamento de Inventário # CT002 - Visão de um lançamento de inventário # CT003 - Visualização das legendas # CT004 - Alteração de...
2.15625
2
tests/unit/test_cust_driver.py
abreu4/jina
2
14741
from pathlib import Path from jina import Flow, Document from jina.executors import BaseExecutor from jina.parsers import set_pea_parser from jina.peapods.peas import BasePea cur_dir = Path(__file__).parent def test_load_executor_with_custom_driver(): with BaseExecutor.load_config(str(cur_dir / 'yaml/test-execu...
2.09375
2
02-19-Cuma/forLoop.py
cihatdev/misha-staj
9
14742
<reponame>cihatdev/misha-staj<gh_stars>1-10 # for loops # for letter in "<NAME>": # print(letter) friends = ["Hasan", "Mahmut", "Ali", "Veli"] for friend in friends: print(friend) for index in range(3, 10): print(index) for index in range(len(friends)): print(friends[index]) for index in range(5...
3.6875
4
ricga/ricga_server.py
MeteorKepler/laughing-invention
1
14743
from __future__ import absolute_import from __future__ import division from __future__ import print_function import cgi from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer import tensorflow as tf from ricga import configuration from ricga import inference_wrapper from ricga.inference_utils import caption_g...
1.929688
2
rotation_analysis/analysis/probe/gui/gui.py
Sepidak/spikeGUI
0
14744
import os import sys if sys.platform.startswith('linux'): from OpenGL import GL from PyQt5.QtQml import QQmlApplicationEngine from PyQt5.QtWidgets import QApplication from analysis.probe.gui.backend_classes import PythonBackendClass1, Logger from analysis.probe.gui.image_providers import PyplotImagePro...
2.203125
2
test/integration/test_forcemerge.py
jgough/opensearch-curator
0
14745
<filename>test/integration/test_forcemerge.py import opensearchpy import curator import os import json import string import random import tempfile from time import sleep import click from click import testing as clicktest from mock import patch, Mock from . import CuratorTestCase from . import testvars as testvars im...
2.015625
2
datacube_alchemist/_utils.py
erin-telfer/datacube-alchemist
15
14746
<reponame>erin-telfer/datacube-alchemist<filename>datacube_alchemist/_utils.py import json from pathlib import Path import re from typing import Dict import boto3 import structlog from datacube.model import Dataset from datacube.virtual import Measurement, Transformation from eodatasets3 import DatasetAssembler, seria...
1.882813
2
HMBBF/migrations/0015_auto_20161202_1733.py
HLoveMe/HWMBBF_Serve
0
14747
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('HMBBF', '0014_theme'), ] operations = [ migrations.AddField( model_name='theme', name='time', ...
1.523438
2
rb/processings/text_classifier/text_classifier.py
readerbench/ReaderBench
0
14748
from rb.core.lang import Lang from rb.core.document import Document from rb.complexity.complexity_index import ComplexityIndex, compute_indices from rb.similarity.word2vec import Word2Vec from rb.similarity.vector_model import VectorModelType, CorporaEnum, VectorModel from rb.similarity.vector_model_factory import VECT...
2.296875
2
vault_importer/csv.py
rpetti/vault-keepassxc-importer
0
14749
import csv class Csv: def __init__(self, csv_file): self.reader = csv.reader(open(csv_file, newline=''), delimiter=',') def parse(self): parsed = [] # Ignore the first line, 't is the header next(self.reader) for row in self.reader: secret = { ...
3.671875
4
src/reader/_plugins/enclosure_tags.py
mirekdlugosz/reader
205
14750
""" enclosure_tags ~~~~~~~~~~~~~~ Fix tags for MP3 enclosures (e.g. podcasts). Adds a "with tags" link to a version of the file with tags set as follows: * the entry title as title * the feed title as album * the entry/feed author as author This plugin needs additional dependencies, use the ``unstable-plugins`` ext...
2.484375
2
sqllite/delete_the_data.py
arjunjanamatti/pymongo_practise
0
14751
<filename>sqllite/delete_the_data.py import _sqlite3 mydb = _sqlite3.connect(database = 'namelist') with mydb: cur = mydb.cursor() name = 'update_name_placeholder' cur.execute('DELETE FROM users WHERE First_name = ?', (name,)) mydb.commit() print('Data deleted!!!') cur = mydb.cursor() ...
3.703125
4
tools/messages/aura4_messages.py
AuraUAS/aura-core
8
14752
<reponame>AuraUAS/aura-core import struct # Message id constants command_ack_id = 10 config_airdata_id = 11 config_board_id = 12 config_ekf_id = 13 config_imu_id = 14 config_mixer_id = 15 config_mixer_matrix_id = 16 config_power_id = 17 config_pwm_id = 18 config_stability_damping_id = 19 command_inceptors_id = 20 comm...
2.046875
2
influxdbnagiosplugin/tests/test_query.py
paulboot/influxdb-nagios-plugin
5
14753
<gh_stars>1-10 """ Query construction tests. """ from hamcrest import assert_that, is_, equal_to from influxdbnagiosplugin.query import ExplicitQueryBuilder, SingleMeasurementQueryBuilder def test_explicit_query(): query = ExplicitQueryBuilder("SHOW MEASUREMENTS") assert_that(query().query, is_(equal_to( ...
2.65625
3
sfftk_migrate/test_sfftk_migrate.py
emdb-empiar/sfftk-migrate
0
14754
# -*- coding: utf-8 -*- import os import sys import types import unittest import inspect from lxml import etree from . import XSL, XML, VERSION_LIST from .core import get_module, get_stylesheet, get_source_version, get_migration_path, list_versions from .main import parse_args from .migrate import migrate_by_styleshe...
2.6875
3
ross/stochastic/st_shaft_element.py
hssaabbl/ross
69
14755
"""Shaft element module for STOCHASTIC ROSS. This module creates an instance of random shaft element for stochastic analysis. """ from ross.shaft_element import ShaftElement from ross.stochastic.st_materials import ST_Material from ross.stochastic.st_results_elements import plot_histogram from ross.units import Q_, ch...
3.484375
3
sympy/benchmarks/bench_symbench.py
vprusso/sympy
0
14756
<filename>sympy/benchmarks/bench_symbench.py #!/usr/bin/env python from __future__ import print_function, division from sympy.core.compatibility import xrange from random import random from sympy import factor, I, Integer, pi, simplify, sin, sqrt, Symbol, sympify from sympy.abc import x, y, z from timeit import defaul...
2.515625
3
tests/test_capture.py
atac/c10-tools
5
14757
<gh_stars>1-10 from tempfile import NamedTemporaryFile import os import pytest from c10_tools.capture import main @pytest.fixture def args(): return {'<infile>': pytest.PCAP, '<outfile>': NamedTemporaryFile('wb').name, '-f': True, '-q': True, '-t': pytest.TMATS} ...
2.1875
2
e-olymp/p15/373.py
ferhatelmas/algo
25
14758
<gh_stars>10-100 # TODO: tle import re import sys m = {"?": ".?", "*": ".*?"} def score(s): return sum(ord(e) - ord("a") + 1 for e in s) def tr(s): return "(?=({}))".format("".join(m.get(e, e) for e in s)) for ln in sys.stdin: p, s = ln.rstrip().split() res = re.findall(tr(p), s) print(score...
2.921875
3
dino.py
panpepson/DinoBot-chroma-offline
0
14759
<reponame>panpepson/DinoBot-chroma-offline<filename>dino.py #!/usr/bin/python3 import numpy as np import cv2 from mss.linux import MSS as mss from PIL import Image import time import pyautogui as pg #mon = {'top': 480, 'left': 130, 'width': 70, 'height': 35} mon = {'top': 200, 'left': 410, 'width': 50, 'height': 30} ...
2.40625
2
trove/tests/scenario/groups/instance_create_group.py
sapcc/trove
1
14760
# Copyright 2015 Tesora Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
1.8125
2
reco_utils/recommender/deeprec/models/dkn.py
suhoy901/recommenders
28
14761
<filename>reco_utils/recommender/deeprec/models/dkn.py<gh_stars>10-100 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import numpy as np import tensorflow as tf from reco_utils.recommender.deeprec.models.base_model import BaseModel __all__ = ["DKN"] class DKN(BaseMode...
2.703125
3
LeNet-5/LeNet-5.py
huangjunxiong11/TF2
0
14762
import tensorflow as tf from tensorflow.keras import datasets, layers, optimizers, Sequential, metrics, losses # 1.数据集准备 (x, y), (x_val, y_val) = datasets.mnist.load_data() # 加载数据集,返回的是两个元组,分别表示训练集和测试集 x = tf.convert_to_tensor(x, dtype=tf.float32) / 255. # 转换为张量,并缩放到0~1 y = tf.convert_to_tensor(y, dtype=tf.int32) #...
3.265625
3
gw_full_latest/CloudTTN.py
rendikanyut/LowCostLoRaGw
654
14763
<gh_stars>100-1000 #------------------------------------------------------------------------------- # Part of this Python script is taken from the Pycom NanoGateway # https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway # # Adapted by <EMAIL> # # This file is part of the low-cost LoRa gate...
2.09375
2
pythonProject1/venv/Lib/site-packages/tkinterpp/dialoguebox.py
mjtomlinson/CNE330_Python_1_Final_Project
0
14764
try: import tkinter as tk except ImportError: import Tkinter as tk class DialogueEntry(tk.Toplevel): """ DialogueEntry : tkinter.Toplevel Dialogue box that allow the user to input a text in a field. kwargs : title : title of the dialogue box text : text di...
3.703125
4
siqbal/hooks.py
smehata/siqbal
0
14765
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import unicode_literals from . import __version__ as app_version app_name = "SIqbal" app_title = "SIqbal" app_publisher = "RC" app_description = "Customizations for SIqbal" app_icon = "octicon octicon-file-directory" app_color = "green" app_email = "<EMAIL>" app_lice...
1.210938
1
testing/python/tests/test_dcgm_reader.py
omertuc/DCGM
0
14766
<filename>testing/python/tests/test_dcgm_reader.py # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
2.21875
2
tests/lava/lib/dl/slayer/neuron/test_alif.py
timcheck/lava-dl
37
14767
# Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause import sys import os import unittest import numpy as np import matplotlib.pyplot as plt import torch import torch.nn.functional as F from lava.lib.dl.slayer.neuron import alif verbose = True if (('-v' in sys.argv) or ('--verbose' in sys....
2.328125
2
amount_test.py
kalafut/go-ledger
0
14768
import decimal import pytest from amount import Amount as A def test_basic(): a = A(("0.30", "$")) assert '$ 0.30' == str(a) a = A({"$": decimal.Decimal(4)}) assert '$ 4', str(a) def test_add(): a = A(("2.34", "$")) b = A(("5.97", "$")) assert "$ 8.31" == str(a+b) c = A(("9.01", "CA...
2.9375
3
DiscoGAN/discogan_train.py
sumersumerdjl/kozistr-Awesome-GANs
1
14769
<reponame>sumersumerdjl/kozistr-Awesome-GANs from __future__ import absolute_import from __future__ import print_function from __future__ import division import tensorflow as tf # import numpy as np import time import discogan import sys sys.path.insert(0, '../') import image_utils as iu from datasets import Pix2Pi...
1.953125
2
examples/index.bzl
SebastianPodgajny/rules_nodejs
0
14770
<gh_stars>0 "Used to reference the nested workspaces for examples in /WORKSPACE" ALL_EXAMPLES = [ "angular", "app", "kotlin", "nestjs", "parcel", "protocol_buffers", "user_managed_deps", "vendored_node", "vendored_node_and_yarn", "web_testing", "webapp", "worker", ]
1.085938
1
testproject/testproject/views.py
Najiva/django-tables2-column-shifter
19
14771
from django.views.generic import TemplateView from django_tables2.config import RequestConfig from django_tables2_column_shifter.tables import ( ColumnShiftTableBootstrap2, ColumnShiftTableBootstrap3, ColumnShiftTableBootstrap4, ColumnShiftTableBootstrap5, ) from .models import Author, Book from .tabl...
2.0625
2
release/stubs.min/Autodesk/Revit/DB/__init___parts/Workset.py
htlcnn/ironpython-stubs
182
14772
class Workset(WorksetPreview,IDisposable): """ Represents a workset in the document. """ @staticmethod def Create(document,name): """ Create(document: Document,name: str) -> Workset Creates a new workset. document: The document in which the new instance is created. name: The wo...
2.390625
2
experiments/12_wiki_training.py
dddaga/word-tree
0
14773
import numpy as np EXPERIMENT_NAME = 'EXP_12' CORPUS_PATH = '/home/dddhiraj/Documents/stuff/data/wiki_en.txt' TRAINING_WINDOW = 5 CONTEXT_DIMENSION = 64 LEANING_RATE = 1 DROPOUT = 0.05 CONTEXT_DECAY = 1 - TRAINING_WINDOW ** -0.5 CONTRASTIVE_WEIGHT = 1#0.1 NEGATIVE_SAMPLE_SIZE ...
2.203125
2
yasi.py
arenadotio/yasi-sexp-indenter
0
14774
#!/usr/bin/env python # coding: utf-8 """ yasi Date: 20th November 2013 Author: nkmathew <<EMAIL>> Dialect aware s-expression indenter """ from __future__ import print_function import argparse import hashlib import os import re import shutil import sys import time import collections import json import difflib tr...
2.453125
2
Speedo/plugins/animoji.py
aviskumar/speedo
0
14775
<filename>Speedo/plugins/animoji.py<gh_stars>0 import asyncio from collections import deque from . import * @speedo.on(Speedo_cmd(pattern="think$", outgoing=True)) @speedo.on(sudo_cmd(pattern="think$", allow_sudo=True)) async def _(event): if event.fwd_from: return event = await eor(event, "think") ...
2.484375
2
Chapter09/01-optimize-mlp-layers.py
KonstantinKlepikov/Hands-On-Genetic-Algorithms-with-Python
0
14776
<filename>Chapter09/01-optimize-mlp-layers.py from deap import base from deap import creator from deap import tools import random import numpy import mlp_layers_test import elitism # boundaries for layer size parameters: # [layer_layer_1_size, hidden_layer_2_size, hidden_layer_3_size, hidden_layer_4_size] BOUNDS_LOW...
2.734375
3
tokenizer/state_table.py
xxronvel/foobar
1
14777
# -*- coding: utf-8 -*- """ MIT License Copyright (c) 2016 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modif...
1.851563
2
notifications_utils/__init__.py
cds-snc/notifier-utils
3
14778
import re SMS_CHAR_COUNT_LIMIT = 612 # 153 * 4 # regexes for use in recipients.validate_email_address. # Valid characters taken from https://en.wikipedia.org/wiki/Email_address#Local-part # Note: Normal apostrophe eg `Firstname-o'surname@domain.com` is allowed. hostname_part = re.compile(r"^(xn-|[a-z0-9]+)(-[a-z0-9]...
2.515625
3
respondd/Cache.py
FreiFunkMuenster/py-respondd
0
14779
import time class Cache(object): globalCache = {} localCace = {} timeout = 0 now = time.time() @staticmethod def setTimeout(timeout): Cache.timeout = timeout @staticmethod def updateTime(): Cache.now = time.time() @staticmethod def _isValid(timestamp): return True if Cache.now - Cache.timeout <= tim...
2.8125
3
jsonclasses_cli/package/swift/main_program_content.py
forever9717/jsonclasses-cli
0
14780
from jsonclasses.cgraph import CGraph from .import_lines import import_lines from .string_query import string_query from .int_query import int_query from .float_query import float_query from .bool_query import bool_query from .sort_order import sort_order from .data_enum import data_enum from .data_class import data_cl...
2.0625
2
common/utils/__init__.py
jl1990/alpha-zero-general
0
14781
"""Useful utils """ from .eval import * from .misc import * # progress bar from .progress.progress.bar import Bar as Bar
0.929688
1
examples/move_presets.py
crazy-djactor/OnVifControlCam
0
14782
import zeep import asyncio, sys from onvif import ONVIFCamera import cv2 import numpy as np import urllib from urllib.request import urlopen IP="192.168.2.22" # Camera IP address PORT=80 # Port USER="admin" # Username PASS="<PASSWORD>" # Password XMAX = 1 XMIN = -1 YMAX = 1 YMIN = -1 movere...
2.21875
2
utils.py
OttrOne/suivi
0
14783
<gh_stars>0 from string import ascii_lowercase, digits from random import choice from re import compile def id_generator(length=8, chars=ascii_lowercase + digits): return ''.join(choice(chars) for _ in range(length)) def hrsize(num: int) -> str: for unit in ['', 'KiB', 'MiB', 'GiB', 'TiB']: if num < 1...
2.953125
3
comment/admin.py
Samurai-XHe/myblog
1
14784
from django.contrib import admin from .models import Comment @admin.register(Comment) class CommentAdmin(admin.ModelAdmin): list_display = ('id', 'content_object', 'text', 'comment_time', 'user', 'root', 'parent', 'reply_to')
1.71875
2
DiSPy/core/path.py
munrojm/DiSPy
19
14785
<filename>DiSPy/core/path.py import numpy as np from typing import Dict, List from monty.json import MSONable from pymatgen.core.structure import Structure from pymatgen.symmetry.groups import SymmOp from DiSPy.core.dg import DistortionGroup from DiSPy.core.vecutils import closewrapped # -- Path object and its attri...
2.3125
2
photos/models.py
kimutaimeshack/Instagram_clone
0
14786
<gh_stars>0 from django.db import models import datetime as dt from django.urls import reverse # Create your models here. class Editor(models.Model): first_name = models.CharField(max_length =30 ,null=True) last_name = models.CharField(max_length =30 ,null=True) email = models.EmailField() phone_number ...
2.3125
2
tests/unit/test_product.py
jeantardelli/architecture-patterns-with-python
1
14787
from datetime import date, timedelta from allocation.domain import events from allocation.domain.model import Product, OrderLine, Batch today = date.today() tomorrow = today + timedelta(days=1) later = tomorrow + timedelta(days=10) def test_prefers_warehouse_batches_to_shipments(): in_stock_batch = Batch("in-stoc...
2.546875
3
tests/unit/states/test_grafana.py
yuriks/salt
1
14788
# -*- coding: utf-8 -*- ''' :codeauthor: <NAME> <<EMAIL>> ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals # Import Salt Testing Libs from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase from tests.support.mock import ( ...
2.171875
2
08.Graph/Kruskal.py
SP2021-2/Algorithm
1
14789
def pprint(arr): for line in arr: print(line) # 5 7 # 0 1 1 # 0 2 3 # 1 2 3 # 1 3 6 # 2 3 4 # 2 4 2 # 3 4 5 import sys import heapq as hq N, M = map(int, sys.stdin.readline().split(" ")) W = [[float('inf')] * N for _ in range(N)] h = [] for _ in range(M): i, j, w = map(int, sys.stdin.readline().split(...
3.609375
4
resources.py
kordimsan/FreeWorker-Api
0
14790
#from flask_restful import Resource, reqparse from flask_restplus import Resource, reqparse,fields from models import UserModel, RevokedTokenModel from flask_jwt_extended import (create_access_token, create_refresh_token, jwt_required, jwt_refresh_token_required, get_jwt_identity, get_raw_jwt) from run import api pars...
2.65625
3
archivist/parser.py
Serhiy1/archivist-python
2
14791
"""common parser argument """ # pylint: disable=missing-docstring # pylint: disable=too-few-public-methods import argparse from enum import Enum import logging from sys import exit as sys_exit from . import archivist from .logger import set_logger from .proof_mechanism import ProofMechanism LOGGER = logging.getL...
2.875
3
skytap/models/UserData.py
mapledyne/skytap
3
14792
<reponame>mapledyne/skytap """Support for the UserData resource in Skytap. Specifically, this is for custom ('user data') that's applied to an environment or VM. This data can be text or, in the context of using it with this Skytap script, it can also be JSON or YAML and will then be re-parsed. This allows users to p...
2.796875
3
example.py
six-two/py_derive_cmd
0
14793
<filename>example.py<gh_stars>0 #!/usr/bin/env python3 # pylint: disable=unused-wildcard-import from py_derive_cmd import * import cmd class MyCmd(cmd.Cmd): pass s = Settings(MyCmd, print_warnings=False) @make_command(s, 'Test for the decorator', aliases=['d']) def test_decorator(shell: MyCmd, req_arg: str, opt_...
2.296875
2
tf_quant_finance/datetime/constants.py
slowy07/tf-quant-finance
3,138
14794
# Lint as: python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
3.359375
3
generate_trajectories.py
keuntaeklee/pytorch-PPUU
159
14795
import argparse, pdb import gym import numpy as np import os import pickle import random import torch import scipy.misc from gym.envs.registration import register parser = argparse.ArgumentParser() parser.add_argument('-display', type=int, default=0) parser.add_argument('-seed', type=int, default=1) parser.add_argumen...
1.921875
2
main.py
mvazifeh/gridart
0
14796
import matplotlib.pylab as plt import numpy as np import random from scipy.ndimage import gaussian_filter mu =9 N = 50 k = 10 eta =10 sigma = 2 p0 = 0.5 inverse_random = False L = range(N*N) Q = np.zeros((N*mu,N*mu)) for o in range(mu*mu): print(o) F = 1000*k a = np.ones((N,N)) for k_ in range(1000): ...
2.34375
2
fixture/contact.py
ruslankl9/python_training
0
14797
<gh_stars>0 from model.contact import Contact import re class ContactHelper(object): def __init__(self, app): self.app = app def change_field_value(self, field_name, text): wd = self.app.wd if text is not None: wd.find_element_by_name(field_name).click() wd.fi...
2.46875
2
setup.py
nakagami/pure-pyawabi
1
14798
from setuptools import setup setup( name="pure-pyawabi", version="0.2.4", description='A morphological analyzer awabi clone', long_description=open('README.md', encoding='utf-8').read(), long_description_content_type="text/markdown", url='https://github.com/nakagami/pure-pyawabi/', classifi...
1.09375
1
vacancies_and_studentships/models.py
okyame/Arkestra
1
14799
from django.db import models # from cms.models.fields import PlaceholderField from cms.models import CMSPlugin # from filer.fields.image import FilerImageField from arkestra_utilities.output_libraries.dates import nice_date # from arkestra_utilities.models import ArkestraGenericModel from arkestra_utilities.generic_...
2.1875
2