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
interventions/plot_intervention.py
priyald17/emissions-assumptions
1
12779751
import seaborn as sns import matplotlib.pyplot as plt import matplotlib.patches as mpatches import pandas as pd import os dam_cols_ap2 = ['co2_dam', 'so2_dam_ap2', 'nox_dam_ap2', 'pm25_dam_ap2'] dam_cols_eas = ['co2_dam', 'so2_dam_eas', 'nox_dam_eas', 'pm25_dam_eas'] # Plotting total damage stacked plot def plot_tota...
2.515625
3
release/stubs.min/System/ComponentModel/__init___parts/RefreshEventArgs.py
YKato521/ironpython-stubs
0
12779752
class RefreshEventArgs(EventArgs): """ Provides data for the System.ComponentModel.TypeDescriptor.Refreshed event. RefreshEventArgs(componentChanged: object) RefreshEventArgs(typeChanged: Type) """ @staticmethod def __new__(self, *__args): """ __new__(cls: type,componentCha...
2
2
authorship_unmasking/unmasking/interfaces.py
torond/unmasking
5
12779753
<filename>authorship_unmasking/unmasking/interfaces.py # Copyright (C) 2017-2019 <NAME>, Webis Group # # 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/LIC...
1.984375
2
hwtLib/avalon/sim/mmAgent_test.py
optical-o/hwtLib
0
12779754
<reponame>optical-o/hwtLib<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- import unittest from hwt.hdl.constants import READ, WRITE from hwt.interfaces.utils import addClkRstn from hwt.simulator.simTestCase import SingleUnitSimTestCase from hwt.synthesizer.unit import Unit from hwtLib.avalon.mm import Aval...
1.953125
2
gmaltcli/tests/tools.py
gmalt/hgt2sql
5
12779755
class MockCallable(object): def __init__(self): self.called = False self.args = () self.kwargs = {} def __call__(self, *args, **kwargs): self.called = True self.args = args self.kwargs = kwargs
2.765625
3
userapp/urls.py
ZiYin-ss/pythonnetshop
0
12779756
<filename>userapp/urls.py<gh_stars>0 # coding=utf-8 from django.conf.urls import url from . import views urlpatterns = [ url(r'^register/$', views.RegisterView.as_view()), url(r'^checkUname/$', views.CheckUnameView.as_view()), url(r'^center/$', views.CenterView.as_view()), url(r'^logout/$', views.Logo...
1.609375
2
main.py
PratikshaJain37/Pixels-Fighting-pygame
0
12779757
# Main.py - Pixels Fighting # # Author: <NAME> # # ---------------------# # Imports # import pygame from pygame.locals import * from helpers import * import random import numpy as np import time # ---------------------# # Initialize number of rows/columns INT = 100 INT_SQ = INT*INT # Initialize size of arrays SIZE...
3.171875
3
TPS_dice_roller_bot/core/constants.py
PumaConcolor/TPS-dice-roller-bot
4
12779758
<filename>TPS_dice_roller_bot/core/constants.py DICE_ROLL_REGEX = '[\\w|\\s|!-/|:-@]*?[\\s]' \ '([0-9]*[\\s]*)d[\\s]*([0-9]+)' \ '[\\s]*([\\+|\\-][\\s]*[0-9]*)*[\\s]*(.*)[\\s]*$' SPONGEBOB_CLEANER_REGEX = '\\/spongebob|\\/spongerep|\\/spr|\\/sp' ZALGO_CLEANER_REGEX = '\\/zalgo|\\/z...
2.421875
2
o3d/documentation/build_docs.py
rwatson/chromium-capsicum
11
12779759
<filename>o3d/documentation/build_docs.py #!/usr/bin/python2.4 # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain ...
1.476563
1
setup.py
scikit-hep/mplhep_data
0
12779760
<gh_stars>0 #!/usr/bin/env python # Copyright (c) 2021, <NAME> # # Distributed under the 3-clause BSD license, see accompanying file LICENSE # or https://github.com/Scikit-HEP/mplhep_data for details. from setuptools import setup setup()
0.886719
1
LeetCode/Trie/Design Search Autocomplete System.py
UtkarshPathrabe/Competitive-Coding
13
12779761
class TrieNode: def __init__(self, string = '', times = 0): self.string = string self.times = times self.children = defaultdict(TrieNode) class AutocompleteSystem: def __init__(self, sentences: List[str], times: List[int]): self.root = TrieNode() self.currentString...
3.34375
3
adv/d_malora.py
smashwidget/dl-1
0
12779762
import adv.adv_test from adv import * from slot.a import * def module(): return D_Malora class D_Malora(Adv): a1 = ('od',0.13) conf = {} conf['slot.a'] = KFM()+FitF() conf['acl'] = """ `s1 `s2, seq=4 """ def prerun(this): if this.condition('buff all team'): ...
1.945313
2
app/search/ui/views.py
ExiledNarwal28/glo-2005-project
0
12779763
<filename>app/search/ui/views.py<gh_stars>0 from flask import render_template, redirect, url_for, request, Blueprint from app.search.forms import GeneralSearchForm search_blueprint = Blueprint('search', __name__) @search_blueprint.route('/', methods=('GET', 'POST')) def search(): form = GeneralSearchForm(reques...
2.203125
2
python/test/arrays/read_l2.py
mdvx/TimeBase
0
12779764
<gh_stars>0 import dxapi import time import sys from datetime import datetime def readstream(): # Create timebase connection db = dxapi.TickDb.createFromUrl("dxtick://localhost:8023") try: # Open in read-write mode db.open(True) # Get the data stream stream = db.getStream("l2") # Create cursor usi...
2.453125
2
solutions/130/130-yongjoonseo.py
iknoom/LeetCode-Solutions
4
12779765
<filename>solutions/130/130-yongjoonseo.py from collections import deque class Solution: def BFS(self, board, sy, sx, visited, n, m): q = deque([(sy, sx)]) visited[sy][sx] = 1 candis = [(sy, sx)] dy = [0, 1, 0, -1] dx = [1, 0, -1, 0] out = False while q: ...
3.21875
3
modules/flow0d/cardiovascular0D_coronary.py
marchirschvogel/amb
0
12779766
#!/usr/bin/env python3 # Copyright (c) 2019-2021, Dr.-Ing. <NAME> # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import sys import sympy as sp # coronary model with a 3-element Windkessel (ZCR, proximal part) i...
2.21875
2
APPRoot/loveword/migrations/0022_auto_20210217_1455.py
1633743096/-
9
12779767
<reponame>1633743096/- # Generated by Django 2.2.1 on 2021-02-17 06:55 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('loveword', '0021_quotation'), ] operations = [ migrations.AlterField( model_name='quotation'...
1.460938
1
sentenceEmbedder.py
varghesepaul-cp/NLP_Sentence_Similarity
0
12779768
import genism from genism.models.doc2vec import Doc2Vec , TaggedDocument from sklearn.metrics.pairwise import cosine_similarity f= open('dataset.txt','r') print(f.read) corpus = [ "This is first Sentence", "This is second Sentence", "This is third Sentence", "This is fourth Sentence", ...
2.59375
3
Pillow-4.3.0/Tests/test_file_bmp.py
leorzz/simplemooc
0
12779769
from helper import unittest, PillowTestCase, hopper from PIL import Image, BmpImagePlugin import io class TestFileBmp(PillowTestCase): def roundtrip(self, im): outfile = self.tempfile("temp.bmp") im.save(outfile, 'BMP') reloaded = Image.open(outfile) reloaded.load() sel...
2.3125
2
exp2/layers.py
raghakot/deep-learning-experiments
7
12779770
from keras.layers.convolutional import Convolution2D from keras import backend as K import tensorflow as tf permutation = [[1, 0], [0, 0], [0, 1], [2, 0], [1, 1], [0, 2], [2, 1], [2, 2], [1, 2]] def shift_rotate(w, shift=1): shape = w.get_shape() for i in range(shift): w = tf.reshape(tf.gather_nd(w,...
2.71875
3
model-service/model_manager.py
leifan89/model-service
0
12779771
<filename>model-service/model_manager.py<gh_stars>0 from typing import Any from typing import Dict from .model.classifier import Classifier class ModelManager: def __init__(self, models: Dict[str, Classifier]): self.models = models def add_model(self, name: str, model: Classifier) -> None: i...
2.828125
3
utils/flooder.py
bentettmar/kahoot-flooder
1
12779772
import kahoot import threading import utils class Flooder: def __init__(self, gamepin, botname, amount, delay, window): self.gamepin = gamepin self.botname = botname self.amount = amount self.delay = delay self.window = window self.suffix = 0 self.bot = kaho...
2.953125
3
utils/json.py
visinf/mnvi
0
12779773
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json as jsn import os import sys import unicodedata from utils import six def read_json(filename): def _convert_from_unicode(data): new_data = dict() for name, value in six.iterite...
2.65625
3
mkt/reviewers/tasks.py
oremj/zamboni
0
12779774
<reponame>oremj/zamboni<filename>mkt/reviewers/tasks.py import datetime import logging from django.conf import settings from celeryutils import task from tower import ugettext as _ import amo from amo.utils import send_mail_jinja import mkt.constants.reviewers as rvw log = logging.getLogger('z.task') @task def s...
1.84375
2
47/test_password.py
alehpineda/bitesofpy
0
12779775
<gh_stars>0 from password import validate_password, used_passwords def test_password_len(): assert not validate_password("<PASSWORD>") assert not validate_password("<PASSWORD>") def test_password_missing_chars(): assert not validate_password("UPPERCASE") assert not validate_password("lowercase") ...
2.921875
3
tests/record/test_enums.py
Ellipsanime/openpype-shotgun
6
12779776
<reponame>Ellipsanime/openpype-shotgun<filename>tests/record/test_enums.py<gh_stars>1-10 import uuid from assertpy import assert_that from shotgrid_leecher.record.enums import QueryStringType def test_query_string_type_from_unknown_type(): # Arrange guid = uuid.uuid4() # Act actual = QueryStringType...
2.609375
3
day1/part1.py
cheddar-cheeze/advent-of-code-2018
0
12779777
<filename>day1/part1.py #! /bin/python3 import requests text = """ +6 -17 +16 +7 +12 +2 -7 -5 -4 -16 +2 +12 -16 -1 -12 -3 +8 -12 +8 -3 +18 -9 +1 -20 +15 -11 -18 -8 +18 -4 +10 +1 -2 +13 +12 +16 -6 +12 +2 +11 +5 +1 -14 +16 -20 -5 +20 +6 +13 +11 +3 -9 -15 +1 +19 +8 +19 -16 +19 -17 -17 +19 +2 +5 +16 +2 -4 +19 +6 -16 +15...
2.484375
2
mvc/__init__.py
PyXRD/pyxrd
27
12779778
<reponame>PyXRD/pyxrd # coding=UTF-8 # ex:ts=4:sw=4:et=on # ------------------------------------------------------------------------- # Copyright (C) 2014 by <NAME> <mathijs dot dumon at gmail dot com> # Copyright (C) 2005 by <NAME> <<EMAIL>> # # mvc is a framework derived from the original pygtkmvc framework # ho...
1.304688
1
app/main/handlers/main.py
chrisrowles/raspi-sh
0
12779779
<filename>app/main/handlers/main.py<gh_stars>0 import io import socket import weakref import paramiko import tornado.websocket from tornado.ioloop import IOLoop from app.main.worker import Worker from app.main.handlers.base import BaseHandler DELAY = 3 workers = {} def recycle(worker): if worker.handler: ...
2.25
2
purpledrop/electrode_board.py
uwmisl/purpledrop-driver
0
12779780
import json import numpy as np import os import pkg_resources import re from typing import Any, AnyStr, Dict, List, Optional, Tuple def load_peripheral(pdata, templates=None): """Load a peripheral from a dict This loads a peripheral with support for templates, as used in the board definition file format ...
3
3
example/FT600_massive_send/Python/usb_rx_check.py
Janet-ZHU/FTDI-245fifo-interface
0
12779781
<gh_stars>0 #-*- coding:utf-8 -*- # Python2.7 x86 # Function: Function: Verify the correctness of the data received by the host computer import sys, time import numpy as np from warnings import filterwarnings datatype = np.uint16 def openUSB(): import ftd3xx if sys.platform == 'win32': ...
2.84375
3
master.py
jet-black/ppo-lstm-parallel
38
12779782
from multiprocessing import Queue, Process from threading import Thread import numpy as np import utils from agent import PPOAgent from policy import get_policy from worker import Worker import environments class SimpleMaster: def __init__(self, env_producer): self.env_name = env_producer.get_env_name()...
2.390625
2
trex/management/commands/secretkey.py
bjoernricks/trex
0
12779783
<filename>trex/management/commands/secretkey.py # -*- coding: utf-8 -*- # # (c) 2014 <NAME> <<EMAIL>> # # See LICENSE comming with the source of 'trex' for details. # from optparse import make_option from django.core.management.base import BaseCommand from django.utils.crypto import get_random_string class Command(...
2.3125
2
app/resources/api.py
PopuriAO29/mp3-reverser
0
12779784
import os from flask import abort from flask import request from flask import send_from_directory from app import app from app.main.RequestParameters import RequestParameters from app.main.Session import Session from app.main.Session import Status from app.main.exceptions.exceptions import InvalidSessionIdError API_...
2.484375
2
tests/extractor.py
benstobbs/winevt-kb
9
12779785
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for the Windows Event Log message resource extractor class.""" import unittest from dfvfs.helpers import fake_file_system_builder from dfvfs.helpers import windows_path_resolver from dfvfs.lib import definitions as dfvfs_definitions from dfvfs.path import factory...
2.28125
2
apps/zblog/api_view/views.py
zhengze/zblogsite
3
12779786
<gh_stars>1-10 from apps.zblog.models import (Article, Category, Tag, Album, Photo, Music ) from rest_framework import viewsets from apps.zblog.serializers import (ArticleSerializer, CategorySerializer, TagSerializer, AlbumSerializer, PhotoSerializer, MusicSerializer ) clas...
2.109375
2
murano/dsl/macros.py
OndrejVojta/murano
1
12779787
<reponame>OndrejVojta/murano # Copyright (c) 2014 Mirantis, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
1.8125
2
project/db.py
Melchizedek13/CS50
0
12779788
<filename>project/db.py import os import sqlite3 from typing import Dict, List, Tuple conn = sqlite3.connect(os.path.join('db', 'expenses.db')) cursor = conn.cursor() def insert(table: str, column_values: Dict): columns = ', '.join( column_values.keys() ) values = [tuple(column_values.values())] placehol...
3.484375
3
log.py
SwaksharDeb/classification-with-costly-features
0
12779789
<gh_stars>0 import numpy as np import time, sys, utils from consts import * #============================== class PerfAgent(): def __init__(self, env, brain): self.env = env self.brain = brain self.agents = self.env.agents self.done = np.zeros(self.agents, dtype=np.bool) ...
2.359375
2
src/pyrobot/kinect2/camera.py
wangcongrobot/pyrobot
0
12779790
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import rospkg import threading import yaml from copy import deepcopy import message_filters import numpy as np import pyrobot.utils....
2.1875
2
models/pose/loss/pose_modules.py
raviv/torchcv
308
12779791
<reponame>raviv/torchcv #!/usr/bin/env python # -*- coding:utf-8 -*- # Author: <NAME>(<EMAIL>) # Loss function for Pose Estimation. import torch import torch.nn as nn from torch.autograd import Variable class OPMseLoss(nn.Module): def __init__(self, configer): super(OPMseLoss, self).__init__() s...
2.546875
3
Scripts/SeqGui/SeqGui.py
eoc21/biopython
3
12779792
<reponame>eoc21/biopython import string from Bio import Seq from Bio import Alphabet from Bio.Alphabet import IUPAC from wxPython.wx import * from Bio import Translate from Bio import Transcribe ID_APPLY = 101 ID_CLEAR = 102 ID_EXIT = 103 ID_CLOSE = 104 ID_ABOUT = 105 ID_CODON = 106 ID_TRANSFORM = 107 class ParamsP...
2.21875
2
stackvm/devices/stdio.py
Dentosal/StackVM
1
12779793
from ..device import Device from ..byteutil import * class StdioDevice(Device): VERSION = "1.0.0" def write(self, pop_fn): count = pop_fn() data = bytes(pop_fn() for _ in range(count)).decode("utf-8") print(data, end="") def read(self, push_fn): data = input().encode("utf...
2.78125
3
renconstruct/tasks/clean.py
devorbitus/renconstruct
0
12779794
<reponame>devorbitus/renconstruct ### System ### import os from glob import glob from subprocess import run ### Logging ### from renconstruct import logger class CleanTask: # The higher priority, the earlier the task runs # This is relative to all other enabled tasks PRIORITY = -1000 def __init__(s...
2.28125
2
pyabc/visualization/sample.py
Pat-Laub/pyABC
0
12779795
import matplotlib.pyplot as plt import numpy as np from typing import List, Union from ..storage import History from .util import to_lists_or_default def plot_sample_numbers( histories: Union[List, History], labels: Union[List, str] = None, rotation: int = 0, title: str = "Total requi...
3.140625
3
adclassifier/feature_selection.py
BoudhayanBanerjee/political-ad-classifier
2
12779796
<reponame>BoudhayanBanerjee/political-ad-classifier from sklearn.feature_selection import VarianceThreshold from sklearn.feature_selection import SelectKBest from sklearn.feature_selection import chi2 from sklearn.feature_selection import mutual_info_classif from sklearn.feature_selection import RFE from sklearn.featur...
1.851563
2
mojo/devtools/common/android_gdb/session.py
zbowling/mojo
1
12779797
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Manages a debugging session with GDB. This module is meant to be imported from inside GDB. Once loaded, the |DebugSession| attaches GDB to a running Moj...
2.015625
2
python/clock.py
h-nari/NetLCD
0
12779798
<filename>python/clock.py import time import netLcd from sys import argv from PIL import Image from datetime import datetime usage = '%s ip_addr' if len(argv) < 2: print(usage % argv[0]) exit(1) nd = netLcd.NetLcd(argv[1]) nd.clear(obscure=1) day0 = sec0 = -1 while(1): now = datetime.now(); if d...
3.09375
3
lab2_part2.py
mariac-molina/KR
0
12779799
from agents import * class Dirt(Thing): pass vac = VacuumEnvironment() d1 = Dirt() d2 = Dirt() d3 = Dirt() vac.add_thing(d1, [0,0]) vac.add_thing(d2, [0,1]) vac.add_thing(d3, [0,2])
2.046875
2
bot.py
0ceanlight/mcbeDiscordBot
5
12779800
<filename>bot.py<gh_stars>1-10 import datetime import json import logging import aiohttp import discord from discord.ext import commands extensions = [ "cogs.utils", "cogs.admin", "cogs.src", # "cogs.trans", "cogs.player", "cogs.general", # "cogs.webserver", # "cogs.twitter", "cogs...
2.734375
3
krcg/config.py
smeea/krcg
6
12779801
"""Configuration""" #: static KRCG server KRCG_STATIC_SERVER = "https://static.krcg.org" SUPPORTED_LANGUAGES = ["fr", "es"] VEKN_TWDA_URL = "http://www.vekn.fr/decks/twd.htm" #: aliases to match players abbreviations and typos in the TWDA ALIASES = { # parsing will consider the legacy double dash "--" as a comment ...
1.71875
2
setup.py
sergief/norma43parser
0
12779802
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="norma43parser", version="1.1.2", license="MIT", author="<NAME>", author_email="<EMAIL>", description="Parser for Bank Account information files formatted in Norma 43", long_descrip...
1.515625
2
tests/integration/call_run_within_script_with_autokeras_test.py
bhack/cloud
0
12779803
""" Search for a good model for the [MNIST](https://keras.io/datasets/#mnist-database-of-handwritten-digits) dataset. """ import argparse import os import autokeras as ak import tensorflow_cloud as tfc from tensorflow.keras.datasets import mnist parser = argparse.ArgumentParser(description="Model save path arguments...
2.8125
3
resourses/courses_resource.py
maxazure/papers
0
12779804
from flask_restful import Resource, reqparse, request from flask_restful import fields, marshal_with, marshal from sqlalchemy.exc import IntegrityError from sqlalchemy import or_, and_, text from flask_jwt_extended import jwt_required from models.course import Course from app import db from utils.util import max_res ...
2.296875
2
aasaan/ashramvisit/models.py
deepakkt/aasaan
0
12779805
<filename>aasaan/ashramvisit/models.py<gh_stars>0 from django.db import models from contacts.models import Center, Contact, IndividualContactRoleZone, Zone from smart_selects.db_fields import GroupedForeignKey class AshramVisit(models.Model): Center = GroupedForeignKey(Center, 'zone') arrival_date = models.Da...
2.15625
2
others/montecarlo.py
1lch2/PythonExercise
1
12779806
import random import math import numpy as np import matplotlib.pyplot as plt # Calculating Pi using Monte Carlo algorithm. def montecarlo_pi(times:int): inside = 0 total = times for i in range(times): x_i = random.random() y_i = random.random() delta = x_i ** 2 + y_i **2 - 1 ...
3.59375
4
Week5/ps6/experiments.py
AustinKladke/6.00.1x-MIT-CS-Python
0
12779807
<reponame>AustinKladke/6.00.1x-MIT-CS-Python<filename>Week5/ps6/experiments.py # -*- coding: utf-8 -*- """ Created on Wed Mar 10 19:37:20 2021 @author: akladke """ import string # letter_lst = [] # num_lst = [] # count_lower = 1 # for i in string.ascii_lowercase: # print(ord(i)) # letter_lst.append(i) # ...
3.609375
4
service/settings/production.py
Mystopia/fantastic-doodle
3
12779808
<gh_stars>1-10 from service.settings.base import * SECRET_KEY = os.getenv('SECRET_KEY') DEBUG = False ALLOWED_HOSTS = [h.strip() for h in os.getenv('ALLOWED_HOSTS', '').split(',') if h] STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorag...
1.671875
2
CRI_WeeklyMaps/__init__.py
adambreznicky/smudge_python
1
12779809
__file__ = '__init__.py' __date__ = '6/18/2015' __author__ = 'ABREZNIC'
1.125
1
notebooks/old/lupton_rgb.py
train-your-deblender/cutout-evaluation
0
12779810
# Licensed under a 3-clause BSD style license - see LICENSE.rst # # TODO: Remove this when https://github.com/parejkoj/astropy/tree/luptonRGB # is in Astropy. """ Combine 3 images to produce a properly-scaled RGB image following Lupton et al. (2004). For details, see : http://adsabs.harvard.edu/abs/2004PASP..116...
2.3125
2
mendeley/models/files.py
providedh/mendeley-python-sdk
0
12779811
import os import re from mendeley.response import SessionResponseObject class File(SessionResponseObject): """ A file attached to a document. .. attribute:: id .. attribute:: size .. attribute:: file_name .. attribute:: mime_type .. attribute:: filehash .. attribute:: download_url ...
2.734375
3
python/snpx/snpx_tf/arch/resnet.py
ahmedezzat85/SNPX_ML
0
12779812
import tensorflow as tf from . tf_net import TFNet class Resnet(TFNet): """ """ def __init__(self, data, data_format, num_classes, is_train=True): dtype = data.dtype.base_dtype super(Resnet, self).__init__(dtype, data_format, train=is_train) self.net_out = tf.identity(data, name='da...
2.78125
3
multilingual_t5/r_bn_en/__init__.py
sumanthd17/mt5
0
12779813
"""r_bn_en dataset.""" from .r_bn_en import RBnEn
0.980469
1
host/workers.py
mjsamuel/Homebridge-MagicHome-Sync
2
12779814
<filename>host/workers.py import logging, threading, time from PIL import ImageGrab class StoppableThread(threading.Thread): def __init__(self, *args, **kwargs): super(StoppableThread, self).__init__(*args, **kwargs) self._stop_event = threading.Event() def stop(self): self._stop_eve...
2.765625
3
ex093.py
Gustavo-Dev-Web/python
0
12779815
<reponame>Gustavo-Dev-Web/python dados = {} gols = [] dados['Nome'] = str(input('Nome do Atleta:')) partidas = int(input('Quantas partidas o jogador jogou:')) for c in range(0,partidas): gols.append(int(input(f'Quantos gols o jogador {dados["Nome"]} fez na partida {c}: '))) dados['Gols'] = gols[:] dados['Total'...
3.59375
4
src/yolo_preparing.py
vikasg603/Vehicle-Front-Rear-Detection-for-License-Plate-Detection-Enhancement
29
12779816
''' This file is used to delete the images without labels (Delete the images without corresponding txt file) AND THEN Generate the train.txt and test.txt for YOLO ''' from os.path import splitext, isfile, join, basename from os import remove from glob import glob, iglob # root path dir = '/home/shaoheng/Documents/cars...
3.15625
3
splendor_sim/src/action/reserve_card_action.py
markbrockettrobson/SplendorBots
1
12779817
import copy import typing import splendor_sim.interfaces.action.i_action as i_action import splendor_sim.interfaces.card.i_card as i_card import splendor_sim.interfaces.coin.i_coin_type as i_coin_type import splendor_sim.interfaces.game_state.i_game_state as i_game_state import splendor_sim.interfaces.player.i_player ...
2.390625
2
RecoVertex/BeamSpotProducer/scripts/copyFiles.py
nistefan/cmssw
0
12779818
#!/usr/bin/env python import sys,os,commands from CommonMethods import * def main(): if len(sys.argv) < 3: error = "Usage: copyFiles.py fromDir destDir (optional filter)" exit(error) fromDir = sys.argv[1] print fromDir if (fromDir[len(fromDir)-1] != '/'): fromDir += '/' dest...
3.28125
3
spawn_npc.py
Matrix-King-Studio/HydraDeepQNet
0
12779819
<gh_stars>0 import logging import random import carla def spawn_npc(client, world, blueprint_library, safe=True, number_of_vehicles=30, number_of_walkers=0): actor_list = [] try: blueprints = blueprint_library.filter('vehicle.*') if safe: blueprints = [x for x in blueprints if in...
2.46875
2
tools/tensorflow/cnn/alexnet/unpickle.py
feifeibear/dlbench
181
12779820
<gh_stars>100-1000 import cPickle import numpy as np import tensorflow as tf PATH = './cifar-10-batches-py' TARGETPATH = '/home/comp/csshshi/tensorflow/cifar-10-batches-py' TEST_FILES = ['test_batch'] FILES = ['data_batch_1', 'data_batch_2', 'data_batch_3', 'data_batch_4', 'data_batch_5'] TRAIN_COUNT = 50000 EVAL_COU...
2.25
2
src/commands/huificator.py
slimsevernake/osbb-bot
9
12779821
import re HUEVELS = { 'у': 'хую', 'У': 'хую', 'е': 'хуе', 'Е': 'хуе', 'ё': 'хуё', 'Ё': 'хуё', 'а': 'хуя', 'А': 'хуя', 'о': 'хуё', 'О': 'хуё', 'э': 'хуе', 'Э': 'хуе', 'я': 'хуя', 'Я': 'хуя', 'и': 'хуи', 'И': 'хуи', 'ы': 'хуы', 'Ы': 'хуы', 'ю': ...
3.484375
3
workshop_sections/extras/lstm_text_classification/trainer/task.py
CharleyGuo/tensorflow-workshop
691
12779822
import model import tensorflow as tf import utils def train(target, num_param_servers, is_chief, lstm_size=64, input_filenames=None, sentence_length=128, vocab_size=2**15, learning_rate=0.01, output_dir=None, batch_size=1024, ...
2.515625
3
commhelp.py
Myselfminer/N
2
12779823
<gh_stars>1-10 ##def get(what): ## if what=="q": ## what=what.strip("?help ") ## site=what ## else: ## a=open("commreg.temp","r") ## a.readlines() ## result=[] ## for i in a: ## result.append(a[i+site*5]+":"+a[i+site*5]) ## return result def get(): a...
2.9375
3
orig/dos2unix.py
benhoyt/pas2go
33
12779824
<filename>orig/dos2unix.py import os for path in os.listdir('.'): if not path.endswith('.PAS'): continue with open(path, 'rb') as f: dos_text = f.read() unix_text = dos_text.replace(b'\r\n', b'\n').replace(b'\t', b' ') with open(path, 'wb') as f: f.write(unix_text) p...
2.421875
2
klaxer/api.py
klaxer/klaxer
2
12779825
"""The main Klaxer server""" import logging import json import hug from falcon import HTTP_400, HTTP_500 from klaxer.rules import Rules from klaxer.errors import AuthorizationError, NoRouteFoundError, ServiceNotDefinedError from klaxer.lib import classify, enrich, filtered, route, send, validate from klaxer.models i...
2.109375
2
test_djangocms_blog/settings.py
marshalc/djangocms-blog
0
12779826
""" Django settings for test_djangocms_blog project. Generated by 'django-admin startproject' using Django 3.0.5. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ ...
1.914063
2
test/http2_test/http2_test_server.py
farcaller/grpc
0
12779827
# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
1.34375
1
bqskit/ir/opt/instantiaters/qfactor.py
jkalloor3/bqskit
0
12779828
"""This module implements the QFactor class.""" from __future__ import annotations import logging from typing import Any from typing import TYPE_CHECKING import numpy as np import numpy.typing as npt from bqskitrs import QFactorInstantiatorNative from bqskit.ir.opt.instantiater import Instantiater from bqskit.qis.st...
2.453125
2
backtest/indicators.py
tacchang001/Store_OANDA_data_locally
0
12779829
<reponame>tacchang001/Store_OANDA_data_locally # https://note.mu/addwis/n/n2c2dc09af892 import numpy as np import pandas as pd from scipy.signal import lfilter, lfilter_zi from numba import jit _OPEN = 'o' _HIGH = 'h' _LOW = 'l' _CLOSE = 'c' # dfのデータからtfで指定するタイムフレームの4本足データを作成する関数 def TF_ohlc(df, tf): x = df.resa...
2.296875
2
model_loader.py
donikv/IlluminationBase
0
12779830
import tensorflow as tf def create_pb_model(pb_path, sz, bs): def load_graph(frozen_graph_filename): # We load the protobuf file from the disk and parse it to retrieve the # unserialized graph_def with tf.compat.v1.gfile.GFile(frozen_graph_filename, "rb") as f: graph_def = tf.co...
2.453125
2
yc102/201.py
c-yan/yukicoder
0
12779831
SA, PA, XA = input().split() SB, PB, XB = input().split() PA = int(PA) PB = int(PB) if PA > PB: print(SA) elif PA < PB: print(SB) elif PA == PB: print(-1)
3.3125
3
Aula 12/ex040P.py
alaanlimaa/Python_CVM1-2-3
0
12779832
'''Crie um programa que leia duas notas de um aluno e calcule sua média, mostrando uma mensagem no final, de acordo com a média atingida:''' p1 = float(input('Nota da P1: ')) p2 = float(input('Nota da P2: ')) media = (p1 + p2) / 2 if media < 5.0: print('Sua média foi {:.1f}, REPROVADO!'.format(media)) elif media >...
4
4
trade.py
pjwarner/m-oney-an
0
12779833
import dbConnection as data import calcCost as cost from decimal import * import getMtGoxRequest as req class trade: def __init__(self): print 'Initialized...' self.info = req.get_res('0/info.php', {}) self.priceInfo = req.get_res('1/BTCUSD/public/ticker', {}) def buy(self): """ Current implem...
2.875
3
pointnet/dataset.py
shnhrtkyk/semantic3dnet
0
12779834
<filename>pointnet/dataset.py import numpy as np import laspy import os from scipy.spatial import KDTree from sklearn.preprocessing import normalize import logging from p2v import voxelize from p2v_pyntcloud import voxelization import torch class Dataset(): ATTR_EXLUSION_LIST = ['X', 'Y', 'Z', 'raw_classification...
2.375
2
migrations/versions/bcb167cb67ef_create_pitch_table.py
John-Kimani/Blue_Chip_Pitch_App
0
12779835
<reponame>John-Kimani/Blue_Chip_Pitch_App """Create pitch table Revision ID: bcb167cb67ef Revises: <KEY> Create Date: 2022-03-07 11:38:54.009444 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'bcb167cb67ef' down_revision = '<KEY>' branch_labels = None depends_...
1.609375
2
cfn_policy_validator/parsers/resource/sqs.py
awslabs/aws-cloudformation-iam-policy-validator
41
12779836
""" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 """ from urllib.parse import urlparse from cfn_policy_validator.application_error import ApplicationError from cfn_policy_validator.parsers.output import Policy, Resource class SqsQueuePolicyParser: """ AWS::SQS...
2.46875
2
examples/wmc-1.py
gfrances/PySDD
34
12779837
<reponame>gfrances/PySDD #!/usr/bin/env python3 from pathlib import Path import math from pysdd.sdd import SddManager, Vtree, WmcManager here = Path(__file__).parent def main(): # Start from a given CNF and VTREE file vtree = Vtree.from_file(bytes(here / "input" / "simple.vtree")) sdd = SddManager.from_...
2.265625
2
pype/ftrack/actions/action_create_folders.py
tws0002/pype
0
12779838
<reponame>tws0002/pype import os import sys import logging import argparse import re from pype.vendor import ftrack_api from pype.ftrack import BaseAction from avalon import lib as avalonlib from pype.ftrack.lib.io_nonsingleton import DbConnector from pypeapp import config, Anatomy class CreateFolders(BaseAction): ...
1.96875
2
extractor/open163.py
pwh19920920/spiders
390
12779839
<filename>extractor/open163.py # pylint: disable=W0123 import re import requests def get(url: str) -> dict: """ videos """ data = {} data["videos"] = [] headers = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"...
2.765625
3
Lab02_final_Group2_05/PenguinPiC.py
evantancy/ece4078-team2-05
0
12779840
<reponame>evantancy/ece4078-team2-05 import numpy as np import requests import cv2 class PenguinPi: def __init__(self, ip="localhost"): """ Args: ip (str, optional): IP address. Defaults to "localhost". """ self.ip = ip self.port = 40000 def s...
3.09375
3
temporal_model.py
rashidhaffadi/EGT
0
12779841
import torch import torch.nn as nn from torch.functional import F from utils import * class SequenceModel(nn.Module): """docstring for SequenceModel""" def __init__(self, input_size, hidden_size, n_layers, **kwargs): super(SequenceModel, self).__init__() self.rnn = nn.LSTM(input_size, hidden_size, n_layers, ...
2.890625
3
mollie/api/resources/payments.py
wegroupwolves/async-mollie-api-python
0
12779842
from ..error import IdentifierError from ..objects.payment import Payment from .base import Base class Payments(Base): RESOURCE_ID_PREFIX = "tr_" def get_resource_object(self, result): return Payment(result, self) async def get(self, payment_id, **params): if not payment_id or not paymen...
2.515625
3
train.py
SuriyaNitt/deepdrive
0
12779843
import networks.tflearn.deepdrivenet as ddn #threeD_conv_net import ml_utils.calc_optical_flow as cop #calc_opticalflow import ml_utils.handle_data as hd import os import numpy as np import tflearn import tensorflow as tf debug = 0 calc_flow = 0 load_model_on_start = 0 depth = 16 batchSize = 16 modelBatchSize = 2 rows ...
2.09375
2
toad/stats_test.py
Padfoot-ted/toad
1
12779844
import pytest import numpy as np import pandas as pd from .stats import IV, WOE, gini, gini_cond, entropy_cond, quality, _IV, VIF np.random.seed(1) feature = np.random.rand(500) target = np.random.randint(2, size = 500) A = np.random.randint(100, size = 500) B = np.random.randint(100, size = 500) mask = np.random.r...
1.984375
2
plugins/dlab_deployment/dlab_deployment/infrastructure/command_executor.py
mediapills/dlab
0
12779845
# ***************************************************************************** # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this fi...
1.84375
2
local-runner-en/replay-dump.py
leloykun/russian-ai-cup
0
12779846
<filename>local-runner-en/replay-dump.py #pylint: disable=missing-docstring, invalid-name import urllib import re import sys import contextlib import os import errno import subprocess import zipfile import json RUN_PLAYER_RE = re.compile(r'''<span\s+class\s*=\s*["']?run-player["']?\s*(.*)>''') TOKEN_RE = re.compile(r'...
2.4375
2
group_admin/files/group-admin-monthly-report.py
hpfilho/FlickrTasks
1
12779847
<reponame>hpfilho/FlickrTasks #!/usr/bin/python3 # This generates a report with photos that need to be removed # or kept in a groups. It is useful for groups based in cameras, # lenses or anything exif related. # # Author: <NAME> # Date : Jan 01, 2018 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
2.40625
2
HackerRank/Mathematics/Fundamentals/Even_Odd_Query.py
AdityaChirravuri/CompetitiveProgramming
1
12779848
<reponame>AdityaChirravuri/CompetitiveProgramming<filename>HackerRank/Mathematics/Fundamentals/Even_Odd_Query.py #!/bin/python3 import os import sys # Complete the solve function below. def solve(arr, queries): result = [] for i,j in queries: if(i<len(arr) and arr[i]==0 and i!=j): result....
4.0625
4
acq4/modules/MultiPatch/pipetteTemplate_pyqt5.py
aleonlein/acq4
1
12779849
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'acq4/modules/MultiPatch/pipetteTemplate.ui' # # Created by: PyQt5 UI code generator 5.8.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_PipetteControl(object): def setupUi(...
1.6875
2
qihui/data_processing/decode_preprocessing.py
Nelsonvon/transformers
0
12779850
import sys import string import datetime import logging from nltk.tokenize import word_tokenize from transformers import BertTokenizer logger = logging.getLogger(__name__) def decode_preprocessing(dataset, output_file, tokenizer, max_len, mode): with open(dataset, 'r') as fin: input_lines = fin.readl...
2.890625
3