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
pickups/irc.py
mtomwing/pickups
75
24400
<gh_stars>10-100 import logging RPL_WELCOME = 1 RPL_WHOISUSER = 311 RPL_ENDOFWHO = 315 RPL_LISTSTART = 321 RPL_LIST = 322 RPL_LISTEND = 323 RPL_TOPIC = 332 RPL_WHOREPLY = 352 RPL_NAMREPLY = 353 RPL_ENDOFNAMES = 366 RPL_MOTD = 372 RPL_MOTDSTART = 375 RPL_ENDOFMOTD = 376 ERR_NOSUCHCHANNEL = 403 logger = logging.getLo...
2.40625
2
ForumMediaAnalyzer/MediaAnalyzer.py
jesseVDwolf/ForumMediaAnalyzer
0
24401
import re import cv2 import json import base64 import logging import requests import numpy as np from datetime import datetime import pytz import gridfs import pymongo from pymongo import MongoClient from pymongo.errors import ServerSelectionTimeoutError as MongoServerSelectionTimeoutError import image...
2.34375
2
fluid/image_classification/train.py
bingyanghuang/models
0
24402
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np import time import sys import functools import math import paddle import paddle.fluid as fluid import paddle.dataset.flowers as flowers import models import reader import argparse fr...
2.171875
2
Room.py
jberkow713/Adventure_Game
0
24403
# Implement a class to hold room information. This should have name and # description attributes. class Room: def __init__(self, number, world, name, description, enemies, enemyHP, enemy_diff, companion=[], item=[] ,enemy_description=[] ): self.number = number self.name = name self.worl...
3.375
3
server.py
fdp0525/seam-erasure
1
24404
from __future__ import print_function import os import base64 import cStringIO import time import numpy from PIL import Image from flask import (Flask, request, render_template, url_for, flash, redirect, send_file) from SeamErasure import seam_erasure, obj_reader, util from SeamErasure.lib import weight_data ...
2.34375
2
summarizer/server.py
mhsong95/ai-moderator
4
24405
<reponame>mhsong95/ai-moderator<filename>summarizer/server.py from http.server import HTTPServer, BaseHTTPRequestHandler from urllib.parse import parse_qs from IPython.display import display from summarizer import Summarizer bert_model = Summarizer() from transformers import pipeline bart_summarizer = pipeline("summari...
2.703125
3
otter/html.py
transientlunatic/otter
0
24406
import matplotlib, numpy from . import plot import markdown import tabulate md_extensions = [ 'markdown.extensions.tables', 'markdown.extensions.extra' ] class HTMLElement(object): tag = None childtag = None def __init__(self, content=None, **kwargs): self.content = [] self.m...
2.75
3
pymodaq_plugins/hardware/PI/PIPython/pipython/datarectools.py
SofyMeu/pymodaq_plugins
1
24407
#!/usr/bin/python # -*- coding: utf-8 -*- """Tools for setting up and using the data recorder of a PI device.""" from logging import debug, warning from time import sleep, time from pipython.pitools import FrozenClass # seconds SERVOTIMES = { 'C-413K011': 0.00003333333, 'C-663.11': 50E-6, 'C-702.00': 100...
1.984375
2
stemel/stemel_foxdot.py
reneghosh/stemel
0
24408
from FoxDot import * from stemel.stemel import * def foxdotidy(pitches, durations, sustains): """ transform a stemel note matrix into a foxdot-compatible one. """ # clean up values that have rests but other notes too # replace mixed durations with the first non-rest counter = 0 for line in durations: ...
2.859375
3
msgpack_stream/_io.py
gesslerpd/msgpack-stream
0
24409
import io class container(dict): __getattr__ = dict.__getitem__ __setattr__ = dict.__setitem__ __delattr__ = dict.__delitem__ def pack(typ, obj): stream = io.BytesIO() typ.pack(stream, obj) data = stream.getvalue() stream.close() return data def unpack(typ, data): stream = io....
2.8125
3
code/segmentation.py
alejandropages/KernelPheno
0
24410
<gh_stars>0 from skimage.segmentation import slic from skimage.io import imread, imsave from skimage.color import rgb2gray from skimage.measure import label, regionprops from skimage.filters import threshold_otsu, gaussian from skimage.color import label2rgb from skimage.morphology import binary_closing, binary_opening...
2.3125
2
examples/logan.py
codepr/drain
0
24411
<gh_stars>0 #!/usr/bin/env python # # Drain usage example, a simple HTTP log aggregation stats monitor. # # Monitor an ever-growing HTTP log in Common Log Format by tailing it (let's a # tail subprocess handle all the hassles like rename, re-creation during # log-rotation etc.) and aggregating some stats on a time-basi...
2.890625
3
Instructions/app.py
RHARO-DATA/sqlalchemy_Challenge
0
24412
from flask import Flask, jsonify from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func, desc import pandas as pd import numpy as np import datetime as dt import sqlalchemy engine = create_engine("sqlite:///Resources/hawaii.sqlite") ...
2.828125
3
cogdl/layers/gin_layer.py
cenyk1230/cogdl
1,072
24413
import torch import torch.nn as nn from cogdl.utils import spmm class GINLayer(nn.Module): r"""Graph Isomorphism Network layer from paper `"How Powerful are Graph Neural Networks?" <https://arxiv.org/pdf/1810.00826.pdf>`__. .. math:: h_i^{(l+1)} = f_\Theta \left((1 + \epsilon) h_i^{l} + ...
2.953125
3
purviewcli/model/__init__.py
pblocz/purviewcli
0
24414
from .atlas import *
1.195313
1
src/backend/database/__init__.py
aimanow/sft
0
24415
from app.extensions import db, bcrypt __all__ = ['db', 'bcrypt']
1.140625
1
arboreto/utils.py
redst4r/arboreto
20
24416
<reponame>redst4r/arboreto<filename>arboreto/utils.py """ Utility functions. """ def load_tf_names(path): """ :param path: the path of the transcription factor list file. :return: a list of transcription factor names read from the file. """ with open(path) as file: tfs_in_file = [line.str...
2.234375
2
twitter_auth.py
lagolucas/twitter-mimic
1
24417
<filename>twitter_auth.py import tweepy def autentica(): auth = tweepy.OAuthHandler(consumer_token, consumer_secret) auth.set_access_token(key, secret) api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True, retry_count=3, retry_delay=60, retry_errors=set([50...
2.71875
3
user.py
kevin3708/PythonIP1
0
24418
<filename>user.py class User: """ Class that generates new instances of users. """ user_list = [] def __init__(self,tUsername,iUsername,email,sUsername): self.tUsername=tUsername self.iUsername=iUsername self.email=email self.sUsername=sUsername def save_user...
3.640625
4
tf_DDPG.py
laket/DDPG_Eager
2
24419
# Copyright 2018 <NAME>. 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 agree...
2.671875
3
apps/restaccount/resources.py
solatis/microservices
38
24420
import json import falcon import time import uuid import requests from apps.database import init_db, db_session from apps.models import Account from apps.restaccount.logging import logging logger = logging.getLogger(__name__) from decouple import config ES_HOST = config('EVENTSTORE_HOST', default='eventstore') ES_PO...
2.09375
2
mmselfsup/models/algorithms/cae.py
mitming/mmselfsup
355
24421
<reponame>mitming/mmselfsup # Copyright (c) OpenMMLab. All rights reserved. from typing import Sequence import torch from torchvision.transforms import Normalize from ..builder import ALGORITHMS, build_backbone, build_head, build_neck from .base import BaseModel @ALGORITHMS.register_module() class CAE(BaseModel): ...
2.15625
2
plncpro/predstoseq.py
nicolasDelhomme/PLncPRO
5
24422
<gh_stars>1-10 ''' PLNCPRO This file takes as input and it extracts dasta seq by label after reading prediction file Author : <NAME> email: <EMAIL> UrMi 3/5/16 ''' import sys import getopt #import math #import re from Bio import SeqIO from Bio.Seq import Seq def main(args = sys.argv,home=None): #set defaults cutoff...
2.671875
3
KnowledgeQuizTool/SummitMeeting/TitleBaidu.py
JianmingXia/StudyTest
0
24423
# -*- coding: utf-8 -*- # @Author : Skye # @Time : 2018/1/8 20:38 # @desc : python 3 , 答题闯关辅助,截屏 ,OCR 识别,百度搜索 import io import urllib.parse import webbrowser import requests import base64 import matplotlib.pyplot as plt import numpy as np from PIL import Image import os def pull_screenshot(): os.system('a...
2.578125
3
tools/tianchi_xray/mixup_test.py
vivym/maskrcnn-benchmark
0
24424
<reponame>vivym/maskrcnn-benchmark import os import random import numpy as np import matplotlib.pyplot as plt from PIL import Image def main(): names = list(os.listdir('datasets/tianchi_xray/restricted/')) img1 = Image.open(os.path.join('datasets/tianchi_xray/restricted', names[random.randint(0, len(names))])...
2.171875
2
mockito_util/write_readme.py
edgeware/mockito-python
4
24425
from __future__ import print_function import os import re def openFile(f, m='r'): if (os.path.exists(f)): return open(f, m) else: return open('../' + f, m) demo_test = ' '.join(openFile('mockito_test/demo_test.py').readlines()) demo_test = demo_test.split('#DELIMINATOR')[1] readme_before = ''.join(...
2.640625
3
pyperformance/run.py
brandtbucher/pyperformance
255
24426
<reponame>brandtbucher/pyperformance<gh_stars>100-1000 from collections import namedtuple import hashlib import sys import time import traceback import pyperformance from . import _utils, _python, _pythoninfo from .venv import VenvForBenchmarks, REQUIREMENTS_FILE from . import _venv class BenchmarkException(Exceptio...
2.03125
2
src/mqc/qc_filters.py
stephenkraemer/bistro
1
24427
"""MotifPileupProcessors for QC filtering""" # TODO: combine PhredFilter and MapqFilter to avoid cost for double # iteration from mqc.visitors import Visitor from mqc.pileup.pileup import MotifPileup import mqc.flag_and_index_values as mfl qflag = mfl.qc_fail_flags mflag = mfl.methylation_status_flags from typing ...
2.3125
2
akilib/raspberrypi/AKI_I2C_LPS25H.py
nonNoise/akilib
29
24428
<filename>akilib/raspberrypi/AKI_I2C_LPS25H.py #import mraa import smbus import time I2C_ADDR = 0x5C class AKI_I2C_LPS25H: def __init__(self): print "AKI_I2C_LPS25H" self.i2c = smbus.SMBus(1) def i2cReg(self,wr,addr=0x00,data=0x00): try: if(wr == "w"): retu...
2.71875
3
figure/Figure2C_general_size_effect.py
YuanxiaoGao/Evolution_of_reproductive_strategies_in_incipient_multicellularity
0
24429
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 27 09:58:57 2020 @author: gao """ import numpy as np import matplotlib.pyplot as plt from matplotlib import colors from mpl_toolkits.axes_grid1 import AxesGrid import matplotlib as mpl import os from matplotlib.colors import LinearSegme...
2.15625
2
lib/jnpr/eznc/facts/swver.py
cro/py-junos-eznc
0
24430
<reponame>cro/py-junos-eznc<gh_stars>0 import re class version_info(object): def __init__(self, verstr ): """verstr - version string""" m1 = re.match('(.*)([RBIXS])(.*)', verstr) self.type = m1.group(2) self.major = tuple(map(int,m1.group(1).split('.'))) # creates tuyple after_type = m1.group(3...
2.203125
2
modules.py
callistachang/CycleGAN-Music-Transfer
0
24431
<reponame>callistachang/CycleGAN-Music-Transfer<gh_stars>0 import numpy as np import tensorflow as tf from tensorflow.keras import Model, layers, Input from collections import namedtuple def abs_criterion(pred, target): return tf.reduce_mean(tf.abs(pred - target)) def mae_criterion(pred, target): return tf....
2.203125
2
app.py
chaipi-chaya/Boston-Crime-Analysis
2
24432
from flask import Flask from flask import render_template from flask import request,session, redirect, url_for, escape,send_from_directory import requests import json app = Flask(__name__, static_url_path='') def predictor(tavg, model, degree): if degree == 3: y = model['coef'][0][3]*(tavg**3) + \ ...
2.875
3
ghostIm/oneBitGen.py
acyanbird/flappyGhost
2
24433
<reponame>acyanbird/flappyGhost<filename>ghostIm/oneBitGen.py from PIL import Image def img2coe(name): img = Image.open(name) img = img.convert("1") width, height = img.size output_file = name.split('.')[0] + ".coe" f = open(output_file, "w") # using the 16, so change radix to 16, can be 2(...
3.015625
3
cursoEmVideo/Python/Mundo 2/Exercicios/Ex067.py
VictorDG00/Cursos
2
24434
# faça um programa que mostre a tabuada de varios numeros # um de cada vez, para cada valor digitado # o programa sera interrompido quando for solicityado um numero negativo while True: multiplicado = int(input('Digite um numero para ver sua tabuada: ')) for tab in range(1, 11): print(f'{multiplicado}x...
4.0625
4
events/migrations/0002_auto_20210501_1442.py
seanyoung247/TWCoulsdon
1
24435
# Generated by Django 3.2 on 2021-05-01 14:42 from django.db import migrations, models import easy_thumbnails.fields import embed_video.fields class Migration(migrations.Migration): dependencies = [ ('events', '0001_initial'), ] operations = [ migrations.AddField( model_name...
1.640625
2
python/utils.py
JonathanAMichaels/NeuropixelsRegistration
0
24436
import numpy as np from scipy.io import loadmat import os import logging from scipy.signal import butter, filtfilt def mat2npy(mat_chanmap_dir): mat_chanmap = loadmat(mat_chanmap_dir) x = mat_chanmap['xcoords'] y = mat_chanmap['ycoords'] npy_chanmap = np.hstack([x,y]) #np.save('chanmap.npy', n...
2.5
2
fairseq/models/wav2vec/wav2vec2_cif_bert.py
eastonYi/fairseq
0
24437
# 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 copy import contextlib import torch import torch.nn.functional as F from typing import List, Tuple, Dict, Optional from transformers imp...
1.8125
2
2/src/3_2D_ritter.py
dsanmartin/IPM468-PJ
0
24438
<reponame>dsanmartin/IPM468-PJ<gh_stars>0 import pathlib import numpy as np from dambreak import Experiment2D from plot import plot2D, plot3D, quiver #%% Initial condition def h0_(x, y, x0, y0, h0): H = np.zeros_like(x) idx = np.array((x <= x0) & (y <= y0)) H[idx] = h0 return H #%%Parameters h_0 = 40 x0 = 100...
1.8125
2
realsense/manual/cluster.py
mrzhuzhe/yunru
0
24439
<reponame>mrzhuzhe/yunru<filename>realsense/manual/cluster.py # 聚类 # 需要移除远处点 import open3d as o3d import numpy as np import matplotlib.pyplot as plt sourcePath="./zz_test_panda/scene/integrated.ply" tatgetPath="./zz_test_panda/scene/cropped_1.ply" # 加载点云 print("Load a ply point cloud, print it, and render it") pcd =...
2.25
2
functionalities.py
Dilkovak/Naggy-Bot
0
24440
<reponame>Dilkovak/Naggy-Bot import random def coinflip(): # print(random.random()) return random.random()
2.234375
2
class2/demo3.py
sanderslhc/python-learing
1
24441
<reponame>sanderslhc/python-learing<gh_stars>1-10 #多分支结构 score=int(input('请输入成绩')) #判断 if score>=90 and score<=100: print('A') elif score>=80 and score<=89: print('B') elif score>=70 and score<=79: print('C') elif score>=60 and score<=69: print('D') elif score>=0 and score<=59: print('E'...
3.609375
4
lib/sdf/sdf_optimizer.py
phschoepf/PoseCNN-PyTorch
85
24442
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved. # This work is licensed under the NVIDIA Source Code License - Non-commercial. Full # text can be found in LICENSE.md import sys import cv2 import time from .sdf_utils import * import _init_paths from fcn.config import cfg from layers.sdf_matching_loss impo...
1.960938
2
src/game_elements/Map.py
crazyStewie/ProjetoJojinho
0
24443
from pymunk.vec2d import Vec2d from src.utils import AngleHelper import pymunk class Map: def __init__(self): self.crossings = [] self.streets = [] self.STREET_WIDTH = 50 self.SIDEWALK_WIDTH = 60 self.sidewalk_crossings = [] self.sidewalks = [] self.distance...
2.515625
3
custom_components/magic_lights/setup_tasks/create_living_space.py
justanotherariel/hass_MagicLights
0
24444
<filename>custom_components/magic_lights/setup_tasks/create_living_space.py from __future__ import annotations import asyncio import logging from custom_components.magic_lights.setup_tasks.task import SetupTask from custom_components.magic_lights.helpers.service_call import create_async_call from typing import Dict, T...
1.898438
2
layouts/landing_page.py
nikitcha/ceebios-biowser
0
24445
<gh_stars>0 import dash_html_components as html import dash app = dash.Dash(__name__) style_div = {'display': 'flex','flex-wrap': 'wrap', 'padding':'20px'} style_text = {'width': '500px', 'padding':'20px'} div_octo = html.Div([ html.Div([html.Img(src=app.get_asset_url('planet1.jpg'), width="500px")]), html.Di...
2.859375
3
examples/network_diagram.py
community-fabric/python-ipfabric-diagrams
1
24446
<reponame>community-fabric/python-ipfabric-diagrams """ network_diagram.py """ from ipfabric_diagrams import IPFDiagram, Network, NetworkSettings, VALID_NET_PROTOCOLS, Layout if __name__ == '__main__': ipf = IPFDiagram() net = Network(sites=['MPLS', 'LAB01'], all_network=True) json_data = ipf.diagram_jso...
2.21875
2
msteams/adaptivecard/containers/fact_set.py
HarshadRanganathan/pyteams
6
24447
<filename>msteams/adaptivecard/containers/fact_set.py from msteams.adaptivecard.containers.layout import Layout class FactSet(Layout): """ FactSet element displays a series of facts (i.e. name/value pairs) in a tabular form """ FACTS = 'facts' def __init__(self, spacing=None, separator=None): ...
3.1875
3
tests/functional/conftest.py
andreakropp/datarobot-user-models
0
24448
<reponame>andreakropp/datarobot-user-models import os import uuid import warnings import datarobot as dr import pytest from dr_usertool.datarobot_user_database import DataRobotUserDatabase from dr_usertool.utils import get_permissions from tests.drum.constants import TESTS_DATA_PATH, PUBLIC_DROPIN_ENVS_PATH ENDPOINT...
1.835938
2
test/units/modules/network/f5/test_bigip_policy.py
Container-Projects/ansible-provider-docs
37
24449
<reponame>Container-Projects/ansible-provider-docs<gh_stars>10-100 # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import ...
1.632813
2
experiments/spooky-mouse.py
Nithanaroy/invisible-pen
0
24450
import pyautogui pyautogui.moveTo(2317, 425, duration=1)
1.289063
1
__main__.py
wwakabobik/openweather_pws
0
24451
<filename>__main__.py<gh_stars>0 from openweather_pws import Station, Measurements
1.039063
1
main.py
JakeSichley/Discord-Bot
1
24452
<filename>main.py """ MIT License Copyright (c) 2021 <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, modify, merg...
2.03125
2
tests/test_lighting.py
HighCWu/neural-renderer-paddle
14
24453
import unittest import paddle import neural_renderer_paddle as nr class TestLighting(unittest.TestCase): def test_case1(self): """Test whether it is executable.""" faces = paddle.randn([64, 16, 3, 3], dtype=paddle.float32) textures = paddle.randn([64, 16, 8, 8, 8, 3], dtype=paddle.fl...
2.75
3
InterpretationTechniques/featureExamination/iceForPredictor.py
HelenaMaria112/PredictionInterpreter
1
24454
<gh_stars>1-10 ''' Created on 04.10.2019 @author: areb ''' import pycebox.ice as pIce from Connections.predictor import * import matplotlib.pyplot as plt from InterpretationTechniques.PlotAndShow import * # https://github.com/AustinRochford/PyCEbox/blob/master/pycebox/ice.py def plotIce(data, pr): ''' :param ...
2.5625
3
src/ch3/generatefeedvector.py
amolnayak311/Programming-Collective-Intelligence
0
24455
''' Created on Sep 4, 2015 @author: Amol ''' from feedparser import parse import re from itertools import groupby #Remove HTML and get the remaining words def getwords(html): txt = re.compile(r'<[^>]+>').sub('', html) words = re.compile(r'[^A-Z^a-z]+').split(txt) return [word.lower() for word in words if...
2.515625
3
examples/withRaycing/01_SynchrotronSources/U32TaperedScan.py
adinatan/xrt
0
24456
<reponame>adinatan/xrt<filename>examples/withRaycing/01_SynchrotronSources/U32TaperedScan.py<gh_stars>0 # -*- coding: utf-8 -*- __author__ = "<NAME>" __date__ = "08 Mar 2016" #import pickle import numpy as np #import matplotlib.pyplot as plt import os, sys; sys.path.append(os.path.join('..', '..', '..')) # analysis:...
1.84375
2
Python_10_Plot_Bokeh_Candlestick.py
rogerolowski/SimpleStockAnalysisPython
195
24457
<reponame>rogerolowski/SimpleStockAnalysisPython # -*- coding: utf-8 -*- """ Created on Fri Nov 27 08:09:11 2020 @author: Tin """ # Plot Candlestick in bokeh import pandas as pd # Dataframe Library from math import pi from bokeh.plotting import figure, show, output_file pd.set_option('max_columns', None) #...
2.96875
3
elephant.py
polewskm/lvl1-elephant
0
24458
<filename>elephant.py<gh_stars>0 # # elephant.py # from threading import Thread from adafruit_servokit import ServoKit from gpiozero import LED,Button,Servo import time import random import board import neopixel import subprocess import os.path print("Initializing...") # pin definitions PIN_LEFT_EYE = 17 PIN_LEFT_BR...
2.921875
3
0.17/_downloads/8c453dbbabf4b225611c41642ea9b1d5/plot_morph_stc.py
drammock/mne-tools.github.io
0
24459
# -*- coding: utf-8 -*- r""" ================================================================ Morphing source estimates: Moving data from one brain to another ================================================================ Morphing refers to the operation of transferring :ref:`source estimates <sphx_glr_auto_tutorial...
2.546875
3
jasper.py
ramosmy/acoustic_model
6
24460
""" Citing from jasper from Nvidia """ import torch import torch.nn as nn import torch.functional as F class SubBlock(nn.Module): def __init__(self, dropout): super(SubBlock, self).__init__() self.conv = nn.Conv1d(in_channels=256, out_channels=256, kernel_size=11...
2.859375
3
charts/create_datasets.py
Smelly-London/datavisualisation
1
24461
import pandas as pd # Load the original csv df = pd.read_csv('data/carto.csv') # Group by name of borough # The output is a list of tuples with ('name of borough', dataframe of that borough) grouped = list(df.groupby('location_name')) for x in grouped: # Get the name of the borough name_of_borough = x[0] ...
3.59375
4
pm4pymdl/algo/mvp/gen_framework/rel_activities/__init__.py
dorian1000/pm4py-mdl
5
24462
<gh_stars>1-10 from pm4pymdl.algo.mvp.gen_framework.rel_activities import classic, rel_activities_builder
1.078125
1
batched_flattened_indices_pseudo_random_permutation.py
eladn/tensors_data_class
0
24463
<filename>batched_flattened_indices_pseudo_random_permutation.py<gh_stars>0 import torch import hashlib import dataclasses import numpy as np from typing import List, Tuple, final from .misc import collate_tensors_with_variable_shapes, CollateData, inverse_permutation from .tensors_data_class_base import TensorsDataCl...
2.109375
2
legacy/zero_training.py
GabrielePicco/pytorch-lightning
4
24464
# Copyright The PyTorch Lightning team. # # 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 i...
2.546875
3
lab02/lab02/operaciones/views.py
josepilco7501/TECSUP-DAE-2021-2
0
24465
from django.shortcuts import render from django.http import HttpResponse # Create your views here. def calculadora(request): context = { 'titulo' : "Ingrese los numeros", } return render(request,'operaciones/formulario.html',context) def resultado(request): a=request.POST['numeroa'] b=req...
2.4375
2
sim/turn.py
adacker10/showdown
8
24466
<filename>sim/turn.py ''' <NAME> turn.py This file is entirely devoted to the do_turn(Battle) method. One call of do_turn does all the logic for a single turn. Functions defined in this file are: * functions are are only called in the do_turn method. Functions called by run_move are called only once per run_move...
3.515625
4
opencamlib-read-only/scripts/voronoi/voronoi_bisectors.py
play113/swer
0
24467
<filename>opencamlib-read-only/scripts/voronoi/voronoi_bisectors.py<gh_stars>0 import ocl import camvtk import time import vtk import datetime import math import random def drawVertex(myscreen, p, vertexColor, rad=1): myscreen.addActor( camvtk.Sphere( center=(p.x,p.y,p.z), radius=rad, color=vertexColor ) ) def d...
2.59375
3
wheel5/scheduler.py
xdralex/pytorch-wheel5
2
24468
from torch.optim.lr_scheduler import _LRScheduler class WarmupScheduler(_LRScheduler): def __init__(self, optimizer, epochs, next_scheduler): self.epochs = epochs self.next_scheduler = next_scheduler super(WarmupScheduler, self).__init__(optimizer) def get_lr(self): if self.la...
2.390625
2
analysis/dbase/tracking/train.py
BrancoLab/FC_analysis
1
24469
import deeplabcut as dlc import os from fcutils.file_io.utils import listdir # from fcutils.video.utils import trim_clip config_file = 'D:\\Dropbox (UCL - SWC)\\Rotation_vte\\Locomotion\\dlc\\locomotion-Federico\\config.yaml' dlc.train_network(config_file) # fld = 'D:\\Dropbox (UCL - SWC)\\Rotation_vte\\Locomotion...
1.882813
2
rmApp.py
LREN-CHUV/mip-apps-manager
0
24470
<gh_stars>0 #!/usr/bin/env python import argparse, shutil, os, sys def getArgs(): parser = argparse.ArgumentParser() parser.add_argument('app', help='Application identifier (used by the app developer)') parser.add_argument('mipDir', help='Directory containing the mip application (<path>/app/)') return parser.par...
2.921875
3
setup.py
aparafita/flow-torch
22
24471
<filename>setup.py #!/usr/bin/env python from setuptools import setup version = '0.1.2' long_description = """ # flow This project implements basic Normalizing Flows in PyTorch and provides functionality for defining your own easily, following the conditioner-transformer architecture. This is specially useful fo...
2.1875
2
app/routes/__init__.py
Poketnans/capstone-q3
0
24472
from flask import Flask from .storage_blueprint import bp_storage from .tattooists_blueprint import bp_tattooists from .tattoos_blueprint import bp_tattoos from .clients_blueprint import bp_clients def init_app(app: Flask) -> None: ''' Registra as blueprints ''' app.register_blueprint(bp_storage) app.re...
1.679688
2
PDF-Tools/makepdf/make-pdf-helloworld.py
maysam-h/pdf-toolz
0
24473
#20080518 #20080519 import mPDF import time import zlib import sys if len(sys.argv) != 2: print "Usage: make-pdf-helloworld pdf-file" print " " print " Source code put in the public domain by <NAME>, no Copyright" print " Use at your own risk" print " https://DidierStevens.com" ...
2.65625
3
tests/test_adapters.py
bernt-matthias/cutadapt
0
24474
import pytest from dnaio import Sequence from cutadapt.adapters import Adapter, Match, Where, LinkedAdapter def test_issue_52(): adapter = Adapter( sequence='GAACTCCAGTCACNNNNN', where=Where.BACK, remove='suffix', max_error_rate=0.12, min_overlap=5, read_wildcards=...
2.265625
2
oaff/app/oaff/app/data/sources/common/provider.py
JBurkinshaw/ogc-api-fast-features
19
24475
from typing import List, Optional from pydantic import BaseModel class Provider(BaseModel): url: str name: str roles: Optional[List[str]] = None
2.203125
2
hackerrank/Data Structures/Super Maximum Cost Queries/solution.py
ATrain951/01.python-com_Qproject
4
24476
#!/bin/python3 import os # # Complete the 'solve' function below. # # The function is expected to return an INTEGER_ARRAY. # The function accepts following parameters: # 1. 2D_INTEGER_ARRAY tree # 2. 2D_INTEGER_ARRAY queries # def solve(tree, queries): # Write your code here from bisect import bisect_righ...
3.34375
3
tests/test.py
bitlang/kabob
0
24477
<filename>tests/test.py from unittest import TestCase from kabob import _ class KabobTestCase(TestCase): def _T(self, obj, kbb): from kabob.wand import Kabob self.assertIsInstance(kbb, Kabob) return [x for x in kbb(obj)] class TestKabob(KabobTestCase): def test_contains(self): ...
3.015625
3
flatbuffers/internal/run_flatc.bzl
kgreenek/rules_flatbuffers
2
24478
load("//flatbuffers/internal:string_utils.bzl", "capitalize_first_char") def _include_args_from_depset(includes_depset): # Always include the workspace root. include_args = ["-I", "."] for include in includes_depset.to_list(): include_args.append("-I") include_args.append(include) retur...
1.960938
2
src/search_name.py
MansurS404/MS403
1
24479
#!usr/bin/python2.7 # coding=utf-8 ####################################################### # Name : Multi BF (MBF) <cookie method> # # File : search_name.py # # Author : DulLah # # Github : https://github.com/dz-id # # Fa...
2.5
2
vistrails/gui/modules/constant_configuration.py
remram44/VisTrails-mybinder
83
24480
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: <EMAIL> ## ## This file is part of VisTrails. ## ## "Redistributio...
0.972656
1
setup.py
davidrpugh/solowPy
31
24481
<reponame>davidrpugh/solowPy import os from distutils.core import setup def read(*paths): """Build a file path from *paths* and return the contents.""" with open(os.path.join(*paths), 'r') as f: return f.read() DESCRIPTION = ("Library for solving, simulating, and estimating the " + "S...
2.40625
2
seaport/pull_request/portfile.py
fossabot/seaport
0
24482
<filename>seaport/pull_request/portfile.py<gh_stars>0 #!/usr/bin/env python3 # Copyright (c) 2021, harens # # 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 cod...
1.914063
2
CRYSTAL/crystal_raman.py
permanentchange/raman-sc
1
24483
<reponame>permanentchange/raman-sc #!/usr/bin/env python # # Raman off-resonant activity calculator # using CRYSTAL as a back-end. # # Contributors: <NAME> (Georgia Tech) # MIT license, 2013 # # def parse_fort34_header(fort34_fh): import sys from math import sqrt # fort34_fh.seek(0) # just in case #...
2.234375
2
src/eval/novel_bigrams.py
HenryDashwood/sentence-planner
3
24484
# # Copyright (c) 2021 Idiap Research Institute, https://www.idiap.ch/ # Written by <NAME> <<EMAIL>> # """ Computes the proportion of novel bigrams in the summary. """ import numpy as np import pandas as pd from interface import Evaluation from eval_utils import preprocess_article, preprocess_summary class NovelBi...
2.984375
3
examples/caget.py
delta-accelerator/channel_access.client
0
24485
import argparse import channel_access.common as ca import channel_access.client as cac if __name__ == '__main__': parser = argparse.ArgumentParser(description='Read process values') parser.add_argument('pvs', metavar='PV', type=str, nargs='+', help='list of process values') args ...
2.578125
3
utils/hamiltonian.py
fhoeb/fh-thesis-scripts
2
24486
from scipy.special import factorial from itertools import count import numpy as np from tmps.utils import pauli, fock def get_boson_boson_dim(alpha, cutoff_coh): """ Find the cutoff for the local dimension (identical everywhere) from the chosen accuracy alpha for the impurity coherent state. "...
2.46875
2
zpgc_2016/include/logbook.py
mpatacchiola/naogui
2
24487
#!/usr/bin/env python import os import time class Logbook(object): def __init__(self): """ Class initialization """ self._id = time.strftime("%d%m%Y_%H%M%S", time.gmtime()) #id of the log, it's the timestamp self._trial = 0 self._pinv = 0.0 self._rinv = 0.0...
3.140625
3
src/experimental_results/outdoor test/path_planning_analysis.py
NASLab/GroundROS
1
24488
<reponame>NASLab/GroundROS<gh_stars>1-10 # python experimental tests for Husky from numpy import sin, cos, pi, load import matplotlib.pyplot as plt from time import sleep yaw_bound = 2 * pi / 180 yaw_calibrate = pi / 180 * (0) x_offset_calibrate = 0 y_offset_calibrate = -.08 f0 = plt.figure() ax0 = f0.add_subplot(1...
2.484375
2
source/study/score.py
mverleg/WW
0
24489
from sys import stderr from study.models import Result, ActiveTranslation def update_score(learner, result, verified=False): """ Update the score after a phrase has been judged. :param result: Result.CORRECT, Result.CLOSE or Result.INCORRECT :return: Result instance """ if result == Result.CORRECT: base =...
2.5625
3
titan/react_pkg/prettier/__init__.py
mnieber/moonleap
0
24490
<gh_stars>0 from pathlib import Path from moonleap import add, create from titan.project_pkg.service import Tool from titan.react_pkg.nodepackage import load_node_package_config class Prettier(Tool): pass base_tags = [("prettier", ["tool"])] @create("prettier") def create_prettier(term, block): prettier ...
2.140625
2
docs/make_readme.py
thombashi/tabledata
4
24491
#!/usr/bin/env python """ .. codeauthor:: <NAME> <<EMAIL>> """ import sys from readmemaker import ReadmeMaker PROJECT_NAME = "tabledata" OUTPUT_DIR = ".." def main(): maker = ReadmeMaker( PROJECT_NAME, OUTPUT_DIR, is_make_toc=True, project_url=f"https://github.com/thombashi/{P...
2.421875
2
expired_cert_finder/scanner.py
alphagov/expired-cert-finder
1
24492
#! /usr/bin/env python from expired_cert_finder.plugins.raw import RawParser from expired_cert_finder.plugins.yaml import YamlParser from expired_cert_finder.allowed_certs import AllowedCerts rawParser = RawParser yamlParser = YamlParser # handle dynamic loading. def scan_file_for_certificate(path, expired_only, d...
2.984375
3
pywi/processing/__init__.py
jeremiedecock/mrif
1
24493
"""Processing modules This package contains image processing algorithms. """ from . import compositing from . import filtering from . import transform
1.1875
1
atlas/foundations_contrib/src/test/test_lazy_bucket.py
DeepLearnI/atlas
296
24494
import unittest from mock import Mock from foundations_spec.helpers.spec import Spec from foundations_spec.helpers import let, let_mock, set_up class TestLazyBucket(Spec): @let def lazy_bucket(self): from foundations_contrib.lazy_bucket import LazyBucket return LazyBucket(self.bucket_constru...
2.625
3
Hw/H3_CNN/model.py
zhigangjiang/DLAndML-Experiment
2
24495
<filename>Hw/H3_CNN/model.py<gh_stars>1-10 from abc import ABC import torch.nn as nn class CNN5(nn.Module, ABC): def __init__(self): super(CNN5, self).__init__() # torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding) # torch.nn.MaxPool2d(kernel_size, stride, padding) ...
2.640625
3
calvestbr/__init__.py
IsaacHiguchi/calvestbr
0
24496
"""Top-level package for Calendário dos Vestibulares do Brasil.""" __author__ = """Ana_Isaac_Marina""" __email__ = '<EMAIL>' __version__ = '0.0.1'
0.871094
1
controllers/utils_faq.py
haoyuchen1992/CourseBuilder
0
24497
from utils import BaseHandler class FaqHandler(BaseHandler): """Handler for FAQ page.""" def get(self): """Handler GET requests.""" # print "Get current get_user" # print self.get_user() # if not self.get_user(): # self.transient_student = True #This if statement will let the non-student un...
2.71875
3
tests/knowledge/rules/aws/context_aware/test_ec2_role_share_rule.py
my-devops-info/cloudrail-knowledge
0
24498
<reponame>my-devops-info/cloudrail-knowledge import unittest from cloudrail.knowledge.context.aws.aws_connection import PublicConnectionDetail, PolicyConnectionProperty, ConnectionDirectionType from cloudrail.knowledge.context.aws.ec2.ec2_instance import Ec2Instance from cloudrail.knowledge.context.aws.ec2.network_int...
2.0625
2
python/setup.py
rpiotrow/lolo
34
24499
<reponame>rpiotrow/lolo from setuptools import setup from glob import glob import shutil import sys import os # single source of truth for package version version_ns = {} with open(os.path.join("lolopy", "version.py")) as f: exec(f.read(), version_ns) version = version_ns['__version__'] # Find the lolo jar JAR_FI...
1.960938
2