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
ansible/roles/kubernetes/tests/test_master.py
dominikl/deployment
0
12770951
<gh_stars>0 import testinfra.utils.ansible_runner from re import match testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( '.molecule/ansible_inventory').get_hosts('kubernetes-master') def test_get_nodes(Command, Sudo): with Sudo(): out = Command.check_output( 'kubectl --kubec...
2.234375
2
python/blackjack/game.py
JohnPaton/blackjack
2
12770952
<reponame>JohnPaton/blackjack<filename>python/blackjack/game.py from .deck import Deck from .player import Player, Dealer class Game(): """A game of blackjack. Attributes: dealer (Dealer): The dealer deck (Deck): The deck player (Player): The player Methods: bust: return ...
3.796875
4
Florence/MeshGeneration/CustomMesher.py
romeric/florence
65
12770953
import os, sys import numpy as np from copy import deepcopy from warnings import warn from .Mesh import Mesh from .GeometricPath import * from Florence.Tensor import totuple, unique2d __all__ = ['HarvesterPatch', 'SubdivisionArc', 'SubdivisionCircle', 'QuadBall', 'QuadBallSphericalArc'] """ A series of custom meshes...
2.203125
2
lingvo/core/spectrum_augmenter_on_device.py
Singed-jj/lingvo
1
12770954
<reponame>Singed-jj/lingvo # Lint as: python2, python3 # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache....
1.867188
2
Day_3/Day_3_Cards_of_the_Same_Suit.py
Kasun-se-2018-023/HackerRank_10_days_statistics_course
1
12770955
No need to use combinations or permutations. There are 13 cards of each suit. Draw one card. It can be anything with probability of 1. Now there are 51 cards left and 12 of them are the same suit as the first card you drew. So the chance the second card matches the 1st is 12/51.
2.890625
3
commands/hello.py
el-ideal-ideas/MocaCommands
0
12770956
<filename>commands/hello.py #!/usr/bin/env python3 # Please make sure this file can be executed. # chmod +x hello.py print('Hello World!!')
2.25
2
capreolus/tests/common_fixtures.py
bpiwowar/capreolus-xpm
0
12770957
import os import pytest from capreolus.collection import COLLECTIONS, Collection from capreolus.index.anserini import AnseriniIndex from capreolus.utils.common import Anserini @pytest.fixture(scope="function") def trec_index(request, tmpdir): """ Build an index based on sample data and create an AnseriniInd...
2.046875
2
test.py
EuphoriaYan/Chinese-ancient-book-recognition-HSK
0
12770958
import tensorflow as tf from PIL import Image import numpy as np import os from util import check_or_makedirs im = Image.open("1.jpg") print(im.mode, im.size) np_im = np.array(im) tf_im = tf.constant(np_im) print(tf_im.dtype) img = tf.image.grayscale_to_rgb(tf_im[:, :, tf.newaxis]) # scale image to fixed size fixed...
2.5
2
AGD_ST/search/datasets.py
Erfun76/AGD
52
12770959
import glob import random import os import numpy as np from torch.utils.data import Dataset from PIL import Image import torchvision.transforms as transforms class ImageDataset(Dataset): def __init__(self, root, transforms_=None, unaligned=False, mode='train', portion=None): self.transform = tran...
2.40625
2
experiments/basic/beaming.py
vuillaut/agnpy
25
12770960
<reponame>vuillaut/agnpy<filename>experiments/basic/beaming.py<gh_stars>10-100 import numpy as np import math import astropy.units as u import astropy.constants as const from astropy.coordinates import Distance import matplotlib.pyplot as plt from scipy.interpolate import interp1d import sys sys.path.append("/home/jsi...
2.234375
2
healthForecaster.py
rashecl/healthForecaster
0
12770961
import numpy as np from sas7bdat import SAS7BDAT import glob import pandas as pd from sklearn import preprocessing from sas7bdat import SAS7BDAT import glob import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from sklearn import utils, model_selection, metrics, linear_model, neighbors, ensemble...
2.71875
3
pytagcloud/lang/counter.py
cocode/PyTagCloud
0
12770962
<filename>pytagcloud/lang/counter.py # -*- coding: utf-8 -*- import re from pytagcloud.lang.stopwords import StopWords from operator import itemgetter from collections import defaultdict def get_tag_counts(text): """ Search tags in a given text. The language detection is based on stop lists. This implement...
3.53125
4
pyclustering/nnet/__init__.py
JosephChataignon/pyclustering
1,013
12770963
<reponame>JosephChataignon/pyclustering<gh_stars>1000+ """! @brief Neural and oscillatory network module. Consists of models of bio-inspired networks. @authors <NAME> (<EMAIL>) @date 2014-2020 @copyright BSD-3-Clause """ import math from enum import IntEnum class initial_type(IntEnum): """! ...
3
3
leprikon/migrations/0031_registration_questions_agreements.py
leprikon-cz/leprikon
4
12770964
<reponame>leprikon-cz/leprikon<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.11.23 on 2019-09-01 22:42 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion def set_registration_questions_agreements(apps, sch...
1.5625
2
underscore/constant_finder.py
doboy/Underscore
7
12770965
<gh_stars>1-10 # Copyright (c) 2013 <NAME>, http://huan.do import ast from assignment_manager import AssignmentManager from utils import value_of class ConstantFinder(ast.NodeVisitor): def __init__(self, env): self.env = env self.assignment_manager = AssignmentManager() def visit_Constant(s...
2.46875
2
load_data.py
yodacatmeow/VGG16-SNU-B36-50
2
12770966
# Public python modules import numpy as np import pandas as pd import pickle import feature from os import path # If categories of test data = categories of the training data class load(): def __init__(self, data_path, batch_size): self.pointer = 0 self.dataframe = pickle.load(open(data_path,"rb"))...
2.90625
3
covidbot/local/alerts.py
igorecarrasco/covidbot
1
12770967
from random import choices from typing import Callable import humanize from .covid import Covid from .graph import Graph from .image import Image from .testing import Testing from .twitter import Twitter class Alerts(Covid, Graph, Image, Testing, Twitter): def __init__(self): super().__init__() @pr...
3.171875
3
migrations/versions/2870937c5fa_.py
daghan/MarkDownBlog
25
12770968
<gh_stars>10-100 """empty message Revision ID: 2870937c5fa Revises: <PASSWORD> Create Date: 2015-02-06 14:21:20.794958 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '<PASSWORD>' from alembic import op import sqlalchemy as sa from migrations.utils import drop_column_sqlite def up...
1.71875
2
hpecp/client.py
pramaku/hpecp-python-library
0
12770969
""" This module is the main module that users of this library will interact with. """ from __future__ import absolute_import from six import raise_from from .logger import Logger from .tenant import TenantController from .config import ConfigController from .gateway import GatewayController from .k8s_worker import K8...
2
2
partsdb/tools/__init__.py
HaseloffLab/PartsDB
2
12770970
<filename>partsdb/tools/__init__.py from cutGenes import prepareLibrary from compRev import compRev from getUtrCoordinates import getUtrCoordinates from annotateBlastp import annotateBlastp from saveSeqs import saveSequences
1.109375
1
formate_black/__init__.py
python-formate/formate-black
0
12770971
#!/usr/bin/env python3 # # __init__.py """ Use black with formate. """ # # Copyright © 2021 <NAME> <<EMAIL>> # # 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, includ...
2.046875
2
tryagain/try04.py
jpsura/pyapi
0
12770972
<filename>tryagain/try04.py #!/usr/bin/env python3 import uuid #simulate job id with uuid package ticket = uuid.uuid1() try: print("please type the config file to load") configfile = input("filename: ") with open(configfile, 'r') as configfileobj: switchconfig = configfileobj.read() except: ...
2.625
3
example/app.py
storborg/aiohttp_themes
1
12770973
<reponame>storborg/aiohttp_themes import sys import aiohttp import aiohttp.web import aiohttp_themes from aiohttp_themes.theme import Theme from aiohttp_themes.asset import SASSAsset, RequireJSAsset @aiohttp_themes.template('index.html') async def hello_view(request): name = request.match_info.get('name', 'Anon...
2.125
2
juneberry/config/experiment_outline.py
sei-nmvanhoudnos/Juneberry
0
12770974
<filename>juneberry/config/experiment_outline.py #! /usr/bin/env python3 # ========================================================================================================================================================== # Copyright 2021 Carnegie Mellon University. # # NO WARRANTY. THIS CARNEGIE MELLON UNIV...
1.320313
1
full-problems/minimizeStringVal.py
vikas-t/DS-Algo
0
12770975
<reponame>vikas-t/DS-Algo<gh_stars>0 #!/usr/bin/python3 # https://practice.geeksforgeeks.org/problems/minimize-string-value/0 import sys def findMax(sc, n): mx = -1*sys.maxsize mxi = None for i in range(n): if sc[i] > mx: mx = sc[i] mxi = i return mxi def sol(s...
3.109375
3
lib/exabgp/bgp/message/message.py
bopopescu/exabgp_priv
2
12770976
<reponame>bopopescu/exabgp_priv # encoding: utf-8 """ update/__init__.py Created by <NAME> on 2010-01-15. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import pack # ================================================================== BGP Message # # 0 1 ...
2.03125
2
Exercicios/Extras/Arrow.py
RicardoMart922/estudo_Python
0
12770977
def seta(n): for i in range(n): if i == n - 1: print((2 * n) * '*', end='') print((i + 1) * '*') else: print((2 * n) * ' ', end='') print((i + 1) * '*') for j in range(n - 1, 0, -1): print((2 * n) * ' ',end='') print(j * '*') seta(1...
3.765625
4
autokey/CapsCtrl/caps_g.py
TeX2e/dotfiles
1
12770978
keyboard.send_keys("<ctrl>+g")
1.140625
1
sandbox/src/htmlTabularParser.py
sniemi/SamPy
5
12770979
<reponame>sniemi/SamPy<filename>sandbox/src/htmlTabularParser.py ''' Created on Sep 2, 2009 @author: niemi ''' import BeautifulSoup import urllib2 url = 'http://www.stsci.edu/institute/org/ins/cos_stis/projects/UserSupport/BOP/cos_spec_limits.html' url2 = 'http://www.stsci.edu/institute/org/ins/cos_stis/projects/Use...
2.921875
3
leonardo/module/web/widgets/tables.py
timgates42/django-leonardo
102
12770980
import floppyforms as forms from django.forms.models import modelformset_factory from django.utils.translation import ugettext_lazy as _ from horizon import tables from horizon.tables.formset import FormsetDataTable, FormsetRow from leonardo.module.web.models import WidgetDimension class Slider(forms.RangeInput): ...
2.171875
2
swcpm/main.py
Davis-Software/SWC_packagemanager
1
12770981
from swcpm import click, swc_pm from .run import run_command from .info import info_command from .wget import wget_command from .install import install_command from .update import update_command from .remove import remove_command #############################################################################...
2.1875
2
SplunkforPaloAltoNetworks/bin/panUserUpdate.py
moshekaplan/Splunk-Apps
34
12770982
# Copyright (c) 2015, Palo Alto Networks # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS...
1.789063
2
tests/samples/config_copy.py
ron-huberfeld/lms
85
12770983
# flake8: noqa import os WTF_CSRF_ENABLED = False # On production, delete this line! SECRET_KEY = '' SERVER_ADDRESS = os.getenv('SERVER_ADDRESS', '127.0.0.1:80') FEATURE_FLAG_CHECK_IDENTICAL_CODE_ON = os.getenv( 'FEATURE_FLAG_CHECK_IDENTICAL_CODE_ON', False, ) USERS_CSV = 'users.csv' # Babel config LANGUA...
1.382813
1
vivarium_cell/composites/injected_glc_phosphorylation.py
vivarium-collective/vivarium-cell
7
12770984
""" ================================================ Toy Injected Glucose Phosphorylation Compartment ================================================ This is a toy example referenced in the documentation. """ from vivarium.core.experiment import Experiment from vivarium.core.process import Composite from vivarium.li...
2.421875
2
ppo_robot.py
nakamotoo/lifelong_rl
0
12770985
<reponame>nakamotoo/lifelong_rl<filename>ppo_robot.py from experiment_utils.launch_experiment import launch_experiment from experiment_configs.configs.ppo_her.ppo_her_config import get_config # from experiment_configs.configs.pg.ppo_config import get_config from experiment_configs.algorithms.batch import get_algorith...
1.921875
2
api-prototype/database/run_dev.py
LandRegistry/land-charges-discovery
2
12770986
<filename>api-prototype/database/run_dev.py from service.server import app import os app.run( host="0.0.0.0", debug=True )
1.21875
1
Python/main.py
minjibyeongho/KOSA-Pytorch
2
12770987
#https://docs.python.org/ko/3/library/__main__.html #main.py #from module import * import module if __name__ == "__main__": print(__name__) #hello() module.hello()
2.171875
2
1/sonarsweep.py
ejpo/AoC-2021
0
12770988
import sys import os def readDepths(filePath): with open(filePath) as f: depths = f.readlines() return depths #Process Individual depths def processDepthReadings(depthReadings): previousDepth = -1 depthIncreases = 0 for depth in depthReadings: depth = int(depth) if previou...
3.8125
4
cache.py
Omar-Saleh/TomasuloProcessor
1
12770989
import math class Cache(object): """docstring for cache""" def __init__(self, size, length, associativity, cycle_time, writing_policy,parent ): #super(cache, self).__init__() #self.arg = arg self.index = int(math.log(size / (length * associativity),2)) self.offset = int(math.log(length,2)) self.tag ...
3.21875
3
ABC/abc051-abc100/abc059/a.py
KATO-Hiro/AtCoder
2
12770990
<gh_stars>1-10 '''input atcoder beginner contest ABC ''' # -*- coding: utf-8 -*- # AtCoder Beginner Contest # Problem A if __name__ == '__main__': a, b, c = input().split() result = a[0] + b[0] + c[0] print(result.upper())
3.109375
3
setup.py
XDeschuyteneer/live
0
12770991
# -*- coding: utf-8 -*- # Learn more: https://github.com/kennethreitz/setup.py from setuptools import setup, find_packages with open('README.md') as f: readme = f.read() with open('LICENSE') as f: license = f.read() setup( name='livedata-subscribetags', version='0.1.0', description='Sample scr...
1.335938
1
check_fr24feed.py
anbucher/check_fr24feed
0
12770992
<gh_stars>0 #! /usr/bin/env python3 # -*- coding: utf-8; py-indent-offset: 4 -*- # # Author: <NAME> # Contact: icinga (at) buchermail (dot) de # # License: The Unlicense, see LICENSE file. # https://github.com/anbucher/check_fr24feed.git """Have a look at the check's README for further details. """ import ...
1.875
2
projects/judge_map/generate_json.py
freelawproject/cleanup-scripts
0
12770993
import pprint template = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-111.6782379150,39.32373809814] # Lat then Long } }, { "type": "Feature", "geometry": { "...
2.859375
3
desafios/desafio#07.py
thiagocanabarro/PythonProjects
0
12770994
<filename>desafios/desafio#07.py #Desenvolva um programa que leia as duas notas de um aluno. Calcule e mostre a sua média n1 = int(input("Digite a nota de seu primeiro teste: ")) n2 = int(input("Digite a nota de seu segundo teste: ")) me = ((n1+n2)/2) print ("A média aritmética de suas notas é:",me)
3.859375
4
serializers/protobuf_serializer/structure_pb2.py
whiteRa2bit/serializers
0
12770995
<reponame>whiteRa2bit/serializers # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: structure.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflectio...
1.304688
1
static/data/heatmap/edit.py
noahbkim/finances
1
12770996
<reponame>noahbkim/finances import json import os
0.902344
1
flow/envs/bay_bridge/__init__.py
pcmoritz/flow
16
12770997
from flow.envs.bay_bridge.base import BayBridgeEnv __all__ = ["BayBridgeEnv"]
1.070313
1
tests/test_models/test_fields.py
fossabot/postmodel
15
12770998
<reponame>fossabot/postmodel import pytest from datetime import datetime, date, timedelta import json import uuid from tests.testmodels import ( IntFieldsModel, DataVersionFieldsModel, DatetimeFieldsModel, DateFieldsModel, TimeDeltaFieldsModel, JSONFieldsModel, UUIDFieldsModel ) from postm...
2.28125
2
balancer/balancer.py
jawilk/balancer-exchange-python
6
12770999
<gh_stars>1-10 import json from web3 import Web3 from utils import load_abi def initialize_tokens(tokens): all_tokens = [] for token in tokens: all_tokens.append(Token( contract_address = Web3.toChecksumAddress(token['address']), balance = token['balance'], decima...
2.3125
2
qt__pyqt__pyside__pyqode/pyqt5__QComboBox.py
DazEB2/SimplePyScripts
117
12771000
<reponame>DazEB2/SimplePyScripts<filename>qt__pyqt__pyside__pyqode/pyqt5__QComboBox.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' from PyQt5.Qt import * class MainWindow(QWidget): def __init__(self): super().__init__() self.tb_result = QTextBrowser() self.c...
2.359375
2
python/SerialPortUI.py
ptracton/wb_platform
0
12771001
#! /usr/bin/env python3 """ UI class for Serial Port hardware. This will have an instantiation of a Serial port. """ # # The GUI libraries since we build some GUI components here # import PyQt5 import PyQt5.QtCore import PyQt5.QtWidgets import SerialPort class SerialPortUI(PyQt5.QtCore.QObject): connectButton...
3.03125
3
rw_calibration/rw_calibration.py
mrossi93/rw_calibration
0
12771002
"""Main module.""" import itertools as it import numpy as np def read_data(filepath, sep=" "): """This function reads file containing Points Coordinates Arguments: filepath (str) -- Path to the file to be read Keyword Arguments: sep (str) -- Separator for columns in file (default: " ") ...
4.0625
4
intro_exercise.py
kefa4520/ds_week1
0
12771003
# Lines starting with # are comments and are not run by Python. """ Multi-line comments are possible with triple quotes like this. """ # import pandas and matplotlib # Load the pandas library as pd import pandas as pd # Load the matplotlib library as plt import matplotlib.pyplot as plt # load the numpy library...
2.875
3
ardublocklyserver/uploader.py
bijij/ardublockly
0
12771004
<filename>ardublocklyserver/uploader.py import subprocess import os class uploader: # constants uploaderName = "avrdude.exe" compilerName = "arduino-builder.exe" #def __init__(self): def LoadSketchWithDefaults(self, sketchName, builderConfigFilePath): self.sketchName = sketchName ...
2.4375
2
hw4/mv4.py
iaxat/MMIS3500
0
12771005
file = open("AAPL.txt", "r") lines = file.readlines() prices = [] for line in lines: price = float(line) prices.append(price) print(price) print(prices)
3.40625
3
file handling/Count the Number of Blank Spaces in a Text File.py
ZephyrAveryl777/Python-Programs
6
12771006
<filename>file handling/Count the Number of Blank Spaces in a Text File.py ''' Problem Description: -------------------- The program reads a file and counts the number of blank spaces in a text file. ''' print(__doc__) print('-'*25) fileName=input('Enter file name: ') k=0 with open(fileName,'r')as f: for l...
3.953125
4
src/data/dicom_conversion.py
DonDzundza/hecktor
0
12771007
<gh_stars>0 import warnings from os.path import join from datetime import time, datetime import numpy as np from skimage.draw import polygon import SimpleITK as sitk import pydicom as pdcm from pydicom.tag import Tag def convert_dicom_to_nifty(input_filepaths, output_folder, ...
2.265625
2
deep_audio_features/utils/load_dataset.py
nikosmichas/deep_audio_features
0
12771008
import os import numpy as np import glob from sklearn.model_selection import StratifiedShuffleSplit import sys, os sys.path.insert(0, os.path.join( os.path.dirname(os.path.realpath(__file__)), "../../")) from deep_audio_features.bin import config import wave import contextlib def load(folders=None, test_val=[0.2,...
2.640625
3
algorithm/search/frequency_queries/frequency_queries.py
delaanthonio/hackerrank
1
12771009
#!/usr/bin/env python3 """ :problem: https://www.hackerrank.com/challenges/frequency-queries/problem """ from typing import List, Tuple from collections import Counter def process_queries(queries: List[Tuple[int, int]]) -> List[int]: """Execute queries and report whether a value with a given count exists.""" ...
3.953125
4
sequence_search/consumer/settings/__init__.py
RNAcentral/sequence_search
2
12771010
""" Copyright [2009-2019] EMBL-European Bioinformatics Institute 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 a...
1.851563
2
tf2/train.py
lihebi/AdvAE
1
12771011
<filename>tf2/train.py import tensorflow as tf from tensorflow.keras.layers import Input, Flatten, Dense, Activation from tensorflow.keras.layers import Conv2D, ReLU, MaxPool2D, Softmax, Reshape from tensorflow.keras import Sequential from tensorflow.keras.optimizers import Adam import numpy as np from cleverhans.futu...
2.59375
3
players/__init__.py
gdahia/ufba-ai-minesweeper
0
12771012
<filename>players/__init__.py import players.player import players.logical import players.user
1.390625
1
neorl/core.py
ssimonc/NeoRL
50
12771013
<reponame>ssimonc/NeoRL import gym from .utils import get_json, sample_dataset, LOCAL_JSON_FILE_PATH, DATA_PATH class EnvData(gym.Env): def get_dataset(self, task_name_version: str = None, data_type: str = "high", train_num: int = 100, need_val: bool = True, val_ratio: float = 0.1, path: str =...
2.703125
3
Lib/site-packages/altendpy/tests/test_timeit.py
fochoao/cpython
0
12771014
import altendpy.timeit def test_runner(): short = altendpy.timeit.Example(statement="time.sleep(0.1)") long = altendpy.timeit.Example(statement="time.sleep(0.2)") runner = altendpy.timeit.Runner( examples=(short, long), repeats=1, interleave=True, cycles=10, ) run...
2.421875
2
models.py
jiwei-dot/VAE
0
12771015
<gh_stars>0 import torch import torch.nn as nn class Conv_BN_ReLU(nn.Module): def __init__(self, in_channels, out_channels, stride): super(Conv_BN_ReLU, self).__init__() self.conv = nn.Conv2d(in_channels, out_channels, 3, stride, 1, bias=False) self.bn = nn.BatchNorm2d(out_channels...
2.640625
3
Scripts/builders/monkeypatch_tempdir_cleanup.py
onecent1101/3p-package-source
4
12771016
# # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # import platform if platform.system() == 'Windows': from tempfile import TemporaryDirectory from ...
2.1875
2
src/pynn/bin/train_lm_lstm.py
enesyugan/yapay-nn
0
12771017
#!/usr/bin/env python3 # encoding: utf-8 # Copyright 2019 <NAME> # Licensed under the Apache License, Version 2.0 (the "License") import os import argparse import torch import torch.distributed as dist import torch.multiprocessing as mp from pynn.util import save_object_param from pynn.net.lm_lstm import SeqLM from...
1.960938
2
Ex009.py
Fernando-Rodrigo/Exercicios
1
12771018
n = int(input('Digite um número para calcular a tabuada ')) m = 1 print('{} x {:2} = {}'.format(n, 1, n*1)) print('{} x {:2} = {}'.format(n, 2, n*2)) print('{} x {:2} = {}'.format(n, 3, n*3)) print('{} x {:2} = {}'.format(n, 4, n*4)) print('{} x {:2} = {}'.format(n, 5, n*5)) print('{} x {:2} = {}'.format(n, 6, n*6)) p...
3.84375
4
app/models.py
YuliyaSim/blogwebsite
0
12771019
<reponame>YuliyaSim/blogwebsite from app import db class Blogpost(db.Model): post_id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(64)) subtitle = db.Column(db.String(64)) author = db.Column(db.String(64)) date_posted = db.Column(db.DateTime) content = db.Column(db.Text)...
2.6875
3
pyHPConfBackup.py
efflicto/pyHPConfigBackup
2
12771020
<filename>pyHPConfBackup.py import os import zipfile import glob import datetime import telnetlib import time print("Starting backup...") hosts = ["192.168.1.1"] user = "UserName" passw = "PassWord" loc = "/mnt/backup" date = str(datetime.date.today()) hosts_ok =0 count =0 print("Removing all old backup files") for f...
2.859375
3
distribution/build/lib/ALeA/dependencies/interfaceFAAL/__init__.py
MKilani/ALeA
0
12771021
from py4j.java_gateway import JavaGateway, GatewayParameters from subprocess import * def interfaceFAAL(word_A, word_B, addition_app): aligments = addition_app.addition(word_A, word_B) alignmentsResultsItem = {} alignmentsResultsItem["bestAlignGlobal"] = aligments[0].getGlobalSimilarityScore() a...
2.328125
2
driftbase/api/servers.py
directivegames/drift-base
1
12771022
import datetime import logging import uuid import marshmallow as ma from flask import url_for, g, jsonify from flask.views import MethodView from flask_smorest import Blueprint, abort import http.client as http_client from drift.core.extensions.jwt import current_user, requires_roles from drift.core.extensions.urlreg...
1.84375
2
pymtl3/passes/sverilog/translation/test/SVTranslator_L2_cases_test.py
hsqforfun/pymtl3
1
12771023
<gh_stars>1-10 #========================================================================= # SVTranslator_L2_cases_test.py #========================================================================= """Test the SystemVerilog translator.""" from pymtl3.datatypes import Bits1, Bits32, Bits96, bitstruct, concat from pymtl3...
2.21875
2
examples/do_noise.py
jackthgu/rnnoise
0
12771024
import os stream = os.popen('echo Returned output') output = stream.read() output
2.09375
2
mcsf/commands/up.py
beremaran/mcsf
0
12771025
import time import logging from mcsf.commands.base import Command from mcsf.services.backup import BackupService from mcsf.services.json_storage import JsonStorage from mcsf.services.ssh import SshService from mcsf.services.vultr import VultrService class UpCommand(Command): def __init__(self): self.json...
2.296875
2
_modules/keystonev3/domains.py
tommycz1/salt-formula-keystone
3
12771026
<filename>_modules/keystonev3/domains.py from keystonev3.common import send from keystonev3.arg_converter import get_by_name_or_uuid_multiple @send('post') def domain_create(name, **kwargs): url = '/domains' json = { 'domain': kwargs, } json['domain']['name'] = name return url, json @get...
1.984375
2
nagios_graphite/__init__.py
SegFaultAX/nagios_graphite
3
12771027
<reponame>SegFaultAX/nagios_graphite<filename>nagios_graphite/__init__.py # -*- coding: utf-8 -*- """Nagios command for Graphite metrics""" from nagios_graphite import metadata __version__ = metadata.version __author__ = metadata.authors[0] __license__ = metadata.license __copyright__ = metadata.copyright
1.203125
1
rainforest/common/wgs84_ch1903.py
gugerlir/rainforest
3
12771028
#-*- coding: utf-8 -*- import numpy as np class GPSConverter(object): ''' GPS Converter class which is able to perform convertions between the CH1903 and WGS84 system. ''' # Convert CH y/x/h to WGS height def CHtoWGSheight(self, y, x, h): # Axiliary values (% Bern) y_aux = (y ...
3.390625
3
mne/viz/tests/test_figure.py
stevemats/mne-python
1,953
12771029
# Authors: <NAME> <<EMAIL>> # # License: Simplified BSD import pytest from mne.viz._mpl_figure import _psd_figure from mne.viz._figure import _get_browser def test_browse_figure_constructor(): """Test error handling in MNEBrowseFigure constructor.""" with pytest.raises(TypeError, match='an instance of Raw, E...
1.945313
2
docsie_universal_importer/providers/dropbox/urls.py
LikaloLLC/docsie-universal-doc-importer
0
12771030
<filename>docsie_universal_importer/providers/dropbox/urls.py from docsie_universal_importer.providers.base.urls import default_urlpatterns from .import_provider import DropboxOAuth2Provider urlpatterns = default_urlpatterns(DropboxOAuth2Provider)
1.75
2
argus/engine/__init__.py
NickVeld/argus
0
12771031
<filename>argus/engine/__init__.py from argus.engine.engine import ( EventEnum, Events, Engine, State, )
1.257813
1
ansible/roles/exit-scanner/files/ipscan.py
torproject-git/metrics-cloud
1
12771032
<gh_stars>1-10 #!/usr/bin/env python2 # Copyright 2013-2017 <NAME> <<EMAIL>> # # This file is part of exitmap. # # exitmap is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
2.515625
3
build/lib/peewee_utils/main.py
negadive/peewee-utils
1
12771033
from peewee import ForeignKeyField _clone_set = lambda s: set(s) if s else set() def prefetch_to_dict(model, recurse=True, backrefs=True, max_depth=None, exclude=None, __seen=None, __parent=None): """ Convert a model instance (and any related objects) to a dictionary, without querying. :param bool recur...
2.578125
3
non_essentials/t2response.py
deapplegate/wtgpipeline
1
12771034
<filename>non_essentials/t2response.py detector = 't2kb' for detector in ['t2ka','t2kb']: f = open(detector + '.response').readlines() wave_0,trans_0,x_0,y_0 = [float(x) for x in f[0][:-1].split(' ')] wave_1,trans_1,x_1,y_1 = [float(x) for x in f[1][:-1].split(' ')] waves = [] resps = []...
2.703125
3
iliad/integrators/stateful/softabs_euler.py
JamesBrofos/Iliad
1
12771035
import copy from typing import Tuple import numpy as np from odyssey.distribution import Distribution from iliad.integrators.info import SoftAbsLeapfrogInfo from iliad.integrators.states import SoftAbsLeapfrogState from iliad.integrators.terminal import cond from iliad.integrators.fields import riemannian, softabs ...
2.65625
3
2020/solutions/day_01.py
Noettore/AdventOfCode
0
12771036
<gh_stars>0 """AOC Day 1""" import pathlib import time def read_input(input_path: str) -> tuple: """take input file path and return appropriate data structure""" with open(input_path, 'r') as input_file: entries = list() is_present = [False]*2020 for entry in input_file.readlines(): ...
3.484375
3
src/mail.py
harrydaihaolin/Stock-Trading-Server
0
12771037
import logging logging = logging.getLogger() import constants from mailchimp3 import MailChimp import web_template from string import Template client = MailChimp(mc_api=constants.MAILCHIMPAPI, mc_user=constants.MAILCHIMPUSENAME) campaign_name="trading_alert" from_name="<NAME>" reply_to="<EMAIL>" audience_id="4e7840aba...
2.484375
2
examples/tensorflow/model.py
nicolaspi/config-state
2
12771038
from abc import abstractmethod from typing import List from typing import Optional from typing import Tuple from typing import Union import tensorflow as tf from config_state import builder from config_state import ConfigField from config_state import ConfigState from config_state import DeferredConf from config_stat...
2.484375
2
code/day3.py
MikeD89/Advent2020
0
12771039
<reponame>MikeD89/Advent2020<filename>code/day3.py from utils import utils def processItem(line): tree = '#' retVal = [] line = line.strip() for x in line: retVal.append(x == tree) return retVal def calcSlope(data, xStep, yStep): count = 0 x = 0 for y in range(0, len(data), ...
3.484375
3
tests/test_scrape_selector.py
gubschk/CDEWIP
0
12771040
# -*- coding: utf-8 -*- """ test_scrape_selector ~~~~~~~~~~~~~~~~~~~~ Test the HTML/XML Selector. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import unittest from chemdataextra...
2.65625
3
alphamind/benchmarks/data/winsorize.py
rongliang-tech/alpha-mind
186
12771041
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ Created on 2017-4-25 @author: cheng.li """ import datetime as dt import numpy as np import pandas as pd from alphamind.data.winsorize import winsorize_normal def benchmark_winsorize_normal(n_samples: int, n_features: int, n_loops: int) -> None: pr...
2.796875
3
ibidem/advent_of_code/y2020/dec03.py
mortenlj/advent_of_code
0
12771042
from ibidem.advent_of_code.board import Board from ibidem.advent_of_code.util import get_input_name PART1_SLOPE = (3, 1) PART2_SLOPES = ( (1, 1), (3, 1), (5, 1), (7, 1), (1, 2), ) def load(): with open(get_input_name(3, 2020)) as fobj: return Board.from_string(fobj.read()) def part1...
3.578125
4
urlShortner/urls.py
erfanhs/Tuky
3
12771043
<filename>urlShortner/urls.py<gh_stars>1-10 from django.conf import settings from django.contrib import admin from django.urls import path, include from django.conf.urls.static import static from django.views.generic import TemplateView from main.views import * urlpatterns = [ # admin panel path('admin/', ad...
1.890625
2
src/LPB/LPBVisitor.py
CptSpookz/LPB
1
12771044
<filename>src/LPB/LPBVisitor.py # Generated from LPB.g4 by ANTLR 4.7.1 from antlr4 import * if __name__ is not None and "." in __name__: from .LPBParser import LPBParser else: from LPBParser import LPBParser from antlr4.error.Errors import ParseCancellationException # This class defines a complete generic visi...
2.203125
2
_project/testovani/apps.py
SucheG/cayman-pullup.cz
0
12771045
from django.apps import AppConfig class TestovaniConfig(AppConfig): name = 'testovani'
1.070313
1
utils/perms.py
np-overflow/bytehackz-discord-bot
0
12771046
<gh_stars>0 from dis_snek.models.application_commands import Permission from utils.config import BOT_DEV_ROLE, ADMIN_ROLE, PARTICIPANT_ROLE, GUILD NOT_EVERYBODY = Permission( id=PARTICIPANT_ROLE, guild_id=GUILD, type=1, permission=False ) ADMIN_ONLY = Permission( id=ADMIN_ROLE, guild_id=GUILD,...
1.695313
2
examples/00-mapdl-examples/contact_elements.py
RGPATCHI/pymapdl
194
12771047
""" .. _ref_contact_example: Contact Element Example ~~~~~~~~~~~~~~~~~~~~~~~ This example demonstrates how to create contact elements for general contact. Begin by launching MAPDL. """ from ansys.mapdl import core as pymapdl mapdl = pymapdl.launch_mapdl() ##########################################################...
3.171875
3
cogs/backend.py
evergreenbots/evergreen
0
12771048
<filename>cogs/backend.py<gh_stars>0 import discord import base64 import paramiko import asyncio import httpx from apikeys import ssh_secret, ssh_pass, ssh_user, ssh_ip, amp_pass, amp_url_base, amp_user from discord.ext import commands class Backend(commands.Cog, name="Server sided stuff"): HEADERS = {'Accept': ...
2.265625
2
qhana/backend/maxCutSolver.py
UST-QuAntiL/qhana
1
12771049
<reponame>UST-QuAntiL/qhana from abc import ABCMeta, abstractmethod from typing import List import networkx as nx """ Represents an abstract MaxCutSolver class. """ class MaxCutSolver(metaclass=ABCMeta): """ Instantiates the MaxCutSolver with the graph. """ def __init__(self, graph: nx.Graph) -> None:...
2.984375
3
tests/test_dataloader.py
NiWaRe/deepee
16
12771050
<filename>tests/test_dataloader.py from deepee import UniformDataLoader from torch.utils.data import Dataset import torch class SimpleDataset(Dataset): def __init__(self): super().__init__() self.data = torch.arange(1, 100, 1, dtype=torch.int) def __getitem__(self, idx: int) -> torch.Tensor: ...
2.796875
3