max_stars_repo_path
stringlengths
4
237
max_stars_repo_name
stringlengths
6
117
max_stars_count
int64
0
95.2k
id
stringlengths
1
7
content
stringlengths
12
593k
input_ids
listlengths
7
549k
regform/apps.py
elishaking/django-form
0
151678
from django.apps import AppConfig class RegformConfig(AppConfig): name = 'regform'
[ 1, 515, 9557, 29889, 13371, 1053, 2401, 3991, 13, 13, 13, 1990, 2169, 689, 3991, 29898, 2052, 3991, 1125, 13, 1678, 1024, 353, 525, 1727, 689, 29915, 13, 2 ]
env/lib/python3.6/site-packages/gunicorn/workers/base.py
anthowen/duplify
7
1610655
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from datetime import datetime import os from random import randint import signal from ssl import SSLError import sys import time import traceback from gunicorn import six from gunicorn import...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 13, 29937, 13, 29937, 910, 934, 338, 760, 310, 330, 2523, 1398, 5492, 1090, 278, 341, 1806, 19405, 29889, 13, 29937, 2823, 278, 6058, 12107, 363, 901, 2472, 29889, 13, ...
library/docker/docker.py
Kafkamorph/shutit
0
46719
<filename>library/docker/docker.py #Copyright (C) 2014 OpenBet Limited # #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, cop...
[ 1, 529, 9507, 29958, 5258, 29914, 14695, 29914, 14695, 29889, 2272, 13, 29937, 11882, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29946, 4673, 29933, 300, 28873, 13, 29937, 13, 29937, 27293, 338, 1244, 1609, 16896, 29892, 3889, 310...
mosqito/sound_level_meter/noct_spectrum/_nominal_frequency.py
MitchellAcoustics/MoSQITo
1
197837
from numpy import array NOMINAL_OCTAVE_CENTER_FREQUENCIES = array( [ 31.5, 63.0, 125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0, 16000.0, ] ) NOMINAL_THIRD_OCTAVE_CENTER_FREQUENCIES = array( [ 25.0, 31.5, ...
[ 1, 515, 12655, 1053, 1409, 13, 13, 29940, 6488, 1177, 1964, 29918, 29949, 1783, 7520, 29923, 29918, 29907, 3919, 1001, 29918, 29943, 1525, 13356, 1430, 8426, 2890, 353, 1409, 29898, 13, 1678, 518, 13, 308, 29941, 29896, 29889, 29945, 2989...
chess/__main__.py
quadratic-bit/pygame-chess
3
35477
<filename>chess/__main__.py from sys import exit from typing import Optional, Final import pygame from rich.traceback import install from chess.board import Chessboard, Move, PieceType, PieceColour from chess.bot import ChessBot from chess.const import GameState from chess.utils import load_image, load_sound, load_fo...
[ 1, 529, 9507, 29958, 305, 404, 29914, 1649, 3396, 26914, 2272, 13, 3166, 10876, 1053, 6876, 13, 3166, 19229, 1053, 28379, 29892, 9550, 13, 13, 5215, 22028, 13, 3166, 8261, 29889, 15003, 1627, 1053, 2601, 13, 13, 3166, 521, 404, 29889, ...
test/agenda_test.py
chalothon/CLIPS_1
0
52297
<gh_stars>0 import unittest from clips import Environment, CLIPSError, Strategy, SalienceEvaluation DEFTEMPLATE = """(deftemplate template-fact (slot template-slot)) """ DEFRULE = """(defrule MAIN::rule-name (declare (salience 10)) (implied-fact implied-value) => (assert (rule-fired))) """ DEFTEMPLAT...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 443, 27958, 13, 13, 3166, 9335, 567, 1053, 16738, 29892, 24492, 29925, 29173, 29892, 3767, 8963, 29892, 317, 2606, 663, 29923, 4387, 362, 13, 13, 13, 24405, 4330, 3580, 29931, 304...
demo.py
PAV-Laboratory/cryptoblotter
1
34928
#!/usr/bin/env python3 from cryptofeed import FeedHandler from cryptofeed.defines import TRADES from cryptoblotter.exchanges import CoinbaseBlotter from cryptoblotter.trades import SequentialIntegerTradeCallback, ThreshCallback from cryptoblotter.trades.constants import VOLUME async def trades(trade): print(tra...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 3166, 24941, 974, 12613, 1053, 5169, 287, 4598, 13, 3166, 24941, 974, 12613, 29889, 1753, 1475, 1053, 323, 4717, 2287, 29903, 13, 13, 3166, 24941, 711, 8276, 357, 29889, 735...
scripts/python/download_os_images.py
rbrud/power-up
0
134263
#!/usr/bin/env python # Copyright 2018 IBM Corp. # # 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 require...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29947, 27955, 2994, 29886, 29889, 13, 29937, 13, 29937, 2178, 26863, 2538, 9841, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380...
2/dogcat.py
JonahY/AE_NN_Cls
3
86779
<filename>2/dogcat.py # coding=utf-8 import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable from torch.utils.data import Dataset from torchvision import transforms, datasets, models import shutil # 随机种子设置 random_s...
[ 1, 529, 9507, 29958, 29906, 29914, 26169, 4117, 29889, 2272, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 5215, 2897, 13, 5215, 12655, 408, 7442, 13, 5215, 4842, 305, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 5215, 484...
run_pipy.py
johnrcruzado/adatasets
3
152927
<filename>run_pipy.py # pylint: disable=C0321,C0103,C0301,E1305,E1121,C0302,C0330,C0111,W0613,W0611,R1705 # -*- coding: utf-8 -*- """ Pypi Uploader python pypi.py 1) Create the package in one folder 2) A file called .pypirc that has to contain login credentials. $ ~ YOURTEXTEDITOR ~/.pypirc Open a file and pas...
[ 1, 529, 9507, 29958, 3389, 29918, 13096, 29891, 29889, 2272, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 29907, 29900, 29941, 29906, 29896, 29892, 29907, 29900, 29896, 29900, 29941, 29892, 29907, 29900, 29941, 29900, 29896, 29892, 29923, ...
app.py
Lunga001/pmg-cms-2
2
158501
from pmg import app from pmg.tasks import StartScheduler from pmg.models.soundcloud_track import SoundcloudTrack from flask_script import Server, Manager from flask_migrate import MigrateCommand app.debug = True manager = Manager(app) manager.add_command("runserver", Server(port=5000, threaded=True, host="0.0.0.0")) ...
[ 1, 515, 26354, 29887, 1053, 623, 13, 3166, 26354, 29887, 29889, 20673, 1053, 7370, 4504, 14952, 13, 3166, 26354, 29887, 29889, 9794, 29889, 29802, 9274, 29918, 11294, 1053, 14976, 9274, 17936, 13, 3166, 29784, 29918, 2154, 1053, 5656, 29892...
project_e/dealers/forms.py
ElectricFleming/project-e
0
94975
<filename>project_e/dealers/forms.py<gh_stars>0 from django import forms class DealerCreationForm(forms.Form): name = forms.CharField() address = forms.CharField() #Address
[ 1, 529, 9507, 29958, 4836, 29918, 29872, 29914, 311, 284, 414, 29914, 9514, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 9557, 1053, 7190, 13, 13, 1990, 897, 18362, 9832, 362, 2500, 29898, 9514, 29889, 2500, 1125, ...
wok/core/base.py
atugushev/wok
0
149702
<gh_stars>0 import functools import pathlib import typing import click import pygit2 from . import context def is_clean(repo: pygit2.Repository) -> bool: return not any( code for code in repo.status().values() if ( code ^ (code & pygit2.GIT_STATUS_WT_NEW) ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 2090, 312, 8789, 13, 5215, 2224, 1982, 13, 5215, 19229, 13, 13, 5215, 2828, 13, 5215, 19484, 277, 29906, 13, 13, 3166, 869, 1053, 3030, 13, 13, 13, 1753, 338, 29918, 14941, 29...
setup.py
SforAiDl/max
5
66507
<filename>setup.py import codecs import os from setuptools import find_packages, setup NAME = "Jeta" DESCRIPTION = "A JAX based meta learning library" with open("README.md", "r") as f: LONG_DESCRIPTION = f.read() PROJECT = os.path.abspath(os.path.dirname(__file__)) EXCLUDE = () VERSION = "0.1.0" AUTHOR = "Socie...
[ 1, 529, 9507, 29958, 14669, 29889, 2272, 13, 5215, 775, 2395, 13, 5215, 2897, 13, 13, 3166, 731, 21245, 8789, 1053, 1284, 29918, 8318, 29892, 6230, 13, 13, 5813, 353, 376, 29967, 1187, 29908, 13, 2287, 7187, 24290, 2725, 353, 376, 299...
data_process.py
liliangbin/unet-match
1
1603287
# -*- coding:utf-8 -*- import SimpleITK as sitk import cv2 from keras.preprocessing.image import img_to_array, load_img def to_hu(image): MIN_BLOOD = -10 MAX_BLOOD = 400 print(MAX_BLOOD, "===", MIN_BLOOD) image = (image - MIN_BLOOD) / (MAX_BLOOD - MIN_BLOOD) image[image > 1] = 1. image[image ...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 9420, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 12545, 1806, 29968, 408, 7845, 29895, 13, 5215, 13850, 29906, 13, 3166, 13023, 294, 29889, 1457, 19170, 29889, 3027, 1053, 10153, 29918, 517, 29...
experiments/_play.py
Chen-Cai-OSU/GeometryofEmbedding
2
85904
import matplotlib matplotlib.use('tkagg') import os import subprocess import sys from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) import tensorflow as tf from ampligraph.common.aux import rel_rank_stat, load_data, eige...
[ 1, 1053, 22889, 13, 2922, 17357, 29889, 1509, 877, 11178, 16170, 1495, 13, 5215, 2897, 13, 5215, 1014, 5014, 13, 5215, 10876, 13, 3166, 1852, 5510, 1053, 23125, 11726, 29892, 23125, 24863, 29648, 18522, 13, 5215, 12183, 13, 21707, 353, ...
Challenges-5/delStartEven.py
chandrakant100/Python-Project
0
84620
# Challenge 3 : Write a function called delete_starting_evens() that has a parameter named lst. # The function should remove elements from the front of lst until the front of the list is not even. # The function should then return lst. # Date : Sun 07 Jun 2020 07:21:17 AM IST def de...
[ 1, 396, 27211, 29871, 29941, 584, 14350, 263, 740, 2000, 5217, 29918, 2962, 292, 29918, 5750, 575, 580, 393, 756, 263, 3443, 4257, 24471, 29889, 13, 29937, 1669, 450, 740, 881, 3349, 3161, 515, 278, 4565, 310, 24471, 2745, 278, 4565, ...
tests/unit/transformations/test_histedges.py
gnafit/gna
5
109739
#!/usr/bin/env python from matplotlib import pyplot as P import numpy as N from load import ROOT as R import gna.constructors as C import pytest @pytest.mark.parametrize('edges', [N.linspace(0.0, 10.0, 11), N.geomspace(0.1, 1000.0, 5)]) def test_histedges_v01(edges): centers = 0.5*(edges[1:]+edges[:-1]) width...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 3166, 22889, 1053, 11451, 5317, 408, 349, 13, 5215, 12655, 408, 405, 13, 3166, 2254, 1053, 16641, 2891, 408, 390, 13, 5215, 330, 1056, 29889, 11433, 943, 408, 315, 13, 5215, 1145...
FSWDF-Project/main.py
chrischism8063/Mongo-py
0
192152
# main entry to the system from application import app
[ 1, 396, 1667, 6251, 304, 278, 1788, 13, 3166, 2280, 1053, 623, 13, 2 ]
setup.py
SteveLTN/iex-api-python
0
12113
<reponame>SteveLTN/iex-api-python<filename>setup.py import setuptools import glob import os required = [ "requests", "pandas", "arrow", "socketIO-client-nexus" ] setuptools.setup(name='iex-api-python', version="0.0.5", description='Fetch data from the IEX API', ...
[ 1, 529, 276, 1112, 420, 29958, 7789, 345, 5850, 29940, 29914, 347, 29916, 29899, 2754, 29899, 4691, 29966, 9507, 29958, 14669, 29889, 2272, 13, 5215, 731, 21245, 8789, 13, 5215, 13149, 13, 5215, 2897, 13, 13, 12403, 353, 518, 13, 1678, ...
practice/practice_1.1/binary_search.py
Electro98/aads
7
106989
"""Шаблон бинарного поиска""" def search(sequence, item): """Бинарный поиск""" raise NotImplementedError()
[ 1, 9995, 30074, 29910, 29975, 25851, 5660, 19619, 1868, 733, 29917, 2494, 15945, 29908, 13, 13, 13, 1753, 2740, 29898, 16506, 29892, 2944, 1125, 13, 1678, 9995, 30031, 29917, 19619, 2370, 733, 29917, 6231, 15945, 29908, 13, 1678, 12020, 2...
cloudmesh/shell/shellutil.py
JulienPalard/cloudmesh
0
170554
'''some useful functions while working with shell''' from __future__ import print_function from cloudmesh.user.cm_user import cm_user import json from cloudmesh_common.tables import array_dict_table_printer, dict_key_list_table_printer from cloudmesh_base.util import banner import csv from cmd3.console import Console i...
[ 1, 14550, 5372, 5407, 3168, 1550, 1985, 411, 6473, 12008, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 3166, 9570, 4467, 29882, 29889, 1792, 29889, 4912, 29918, 1792, 1053, 7477, 29918, 1792, 13, 5215, 4390, 13, 3166, ...
exercicio27.py
monabrisa/-infosatc-lp-avaliativo-01
0
106631
<filename>exercicio27.py hectares = float(input("Digite o valor da área em hectares: ")) metros = hectares * 10000 print("{} hectares são {} m²".format(hectares, metros))
[ 1, 529, 9507, 29958, 735, 6269, 11088, 29906, 29955, 29889, 2272, 13, 354, 312, 5114, 353, 5785, 29898, 2080, 703, 14991, 568, 288, 16497, 1146, 17335, 953, 28834, 5114, 29901, 376, 876, 13, 28204, 353, 28834, 5114, 334, 29871, 29896, 2...
sppas/sppas/src/anndata/hierarchy.py
mirfan899/MTTS
0
181746
<reponame>mirfan899/MTTS # -*- coding: UTF-8 -*- """ .. --------------------------------------------------------------------- ___ __ __ __ ___ / | \ | \ | \ / the automatic \__ |__/ |__/ |___| \__ annotation and \ | |...
[ 1, 529, 276, 1112, 420, 29958, 11038, 12963, 29947, 29929, 29929, 29914, 11490, 9375, 13, 29937, 448, 29930, 29899, 14137, 29901, 18351, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 1678, 6317, 13, 4706, 448, 2683, 2683, 2683, 2...
Training/MOOC Tensorflow 2.0/BeiDa/class1/p22_random.uniform.py
church06/Pythons
177
116321
import tensorflow as tf f = tf.random.uniform([2, 2], minval=0, maxval=1) print("f:", f)
[ 1, 1053, 26110, 408, 15886, 13, 13, 29888, 353, 15886, 29889, 8172, 29889, 29590, 4197, 29906, 29892, 29871, 29906, 1402, 1375, 791, 29922, 29900, 29892, 4236, 791, 29922, 29896, 29897, 13, 2158, 703, 29888, 29901, 613, 285, 29897, 13, 2 ...
practice.py
precognition2018/SimpleFaceAPI
0
79009
import tensorflow as tf x = tf.placeholder(tf.float32, [None,3]) x_data = [[1,2,3],[4,5,6]] w = tf.Variable(tf.random_normal([3,2])) b = tf.Variable(tf.random_normal([2,1])) expr = tf.matmul(x,w) + b sess = tf.Session() sess.run(tf.global_variables_initializer()) print(x_data) print(sess.run(w)) print(sess.run(b...
[ 1, 1053, 26110, 408, 15886, 13, 13, 29916, 353, 15886, 29889, 27074, 29898, 13264, 29889, 7411, 29941, 29906, 29892, 518, 8516, 29892, 29941, 2314, 13, 13, 29916, 29918, 1272, 353, 5519, 29896, 29892, 29906, 29892, 29941, 16272, 29946, 2989...
kge/ui/ui_manager.py
Fredkiss3/kge
4
59616
from typing import Callable, Set, Union, Type import kge.inputs.keys as Keys from kge.core import events # from kge.core.component_system import ComponentSystem # from kge.ui.canvas_renderer import CanvasRenderer from kge.core.system import System from kge.utils.vector import Vector from kge.ui.canvas import C...
[ 1, 515, 19229, 1053, 8251, 519, 29892, 3789, 29892, 7761, 29892, 5167, 30004, 13, 30004, 13, 5215, 413, 479, 29889, 2080, 29879, 29889, 8149, 408, 4813, 952, 30004, 13, 3166, 413, 479, 29889, 3221, 1053, 4959, 30004, 13, 29937, 515, 413...
code/tools/prepare_instance.py
santomon/taskonomy
789
45333
import subprocess import os def download_task_model(task): m_path = os.path.join('/home/ubuntu/s3', "model_log_final", task, "logs/model.permanent-ckpt") dirs, fname = os.path.split(m_path) dst_dir = dirs.replace('/home/ubuntu/s3', "s3://taskonomy-unpacked-oregon") ...
[ 1, 1053, 1014, 5014, 13, 5215, 2897, 13, 1753, 5142, 29918, 7662, 29918, 4299, 29898, 7662, 1125, 13, 1678, 286, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 11219, 5184, 29914, 8767, 29914, 29879, 29941, 742, 376, 4299, 29918, 1188,...
textprivacy/__init__.py
KennethEnevoldsen/DaAnonymization
12
95417
"""Top-level package for TextAnonymization.""" __author__ = """<NAME>""" __email__ = "<EMAIL>" __version__ = "0.1.0" from textprivacy import utils from textprivacy.textanonymization import TextAnonymizer from textprivacy.textpseudonymization import TextPseudonymizer
[ 1, 9995, 7031, 29899, 5563, 3577, 363, 3992, 2744, 4735, 2133, 1213, 15945, 13, 13, 1649, 8921, 1649, 353, 9995, 29966, 5813, 11903, 15945, 13, 1649, 5269, 1649, 353, 9872, 26862, 6227, 11903, 13, 1649, 3259, 1649, 353, 376, 29900, 2988...
annotations.py
jtextor/immunet
1
170518
import json import gzip from pathlib import Path # JSON KEYS DATASET_ID_JSON_KEY = "ds_id" DATASET_TYPE_JSON_KEY = "type" SLIDE_ID_JSON_KEY = "slide_id" TILE_ID_JSON_KEY = "tile_id" ANNOT_TYPE_JSON_KEY = "type" ANNOT_X_JSON_KEY = "x" ANNOT_Y_JSON_KEY = "y" ANNOT_POSITIVITY_JSON_KEY = "positivity" SLIDES_JSON_KEY = "sl...
[ 1, 1053, 4390, 13, 5215, 330, 7554, 13, 3166, 2224, 1982, 1053, 10802, 13, 13, 29937, 4663, 14636, 29903, 13, 25832, 8127, 29911, 29918, 1367, 29918, 7249, 29918, 10818, 353, 376, 6289, 29918, 333, 29908, 13, 25832, 8127, 29911, 29918, ...
ImageProcessingScripts/Image Contours Co-ordinates/image_contours_co-ordinates.py
sumitsoni0907/Awesome_Python_Scripts
1
117357
<reponame>sumitsoni0907/Awesome_Python_Scripts # Image Contours Co-ordinates # imported necessary library import tkinter from tkinter import * import tkinter as tk import tkinter.messagebox as mbox from tkinter import ttk from tkinter import filedialog from PIL import ImageTk, Image import cv2 import numpy as np # ...
[ 1, 529, 276, 1112, 420, 29958, 2083, 277, 1100, 29875, 29900, 29929, 29900, 29955, 29914, 29909, 29893, 14151, 29918, 11980, 29918, 4081, 29879, 13, 13, 29937, 7084, 2866, 2470, 3189, 29899, 24266, 13, 13, 29937, 19673, 5181, 3489, 13, 52...
appengine/cr-buildbucket/errors.py
mithro/chromium-infra
0
91020
# Copyright 2014 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. import re BUCKET_NAME_REGEX = re.compile(r'^[0-9a-z_\.\-/]{1,100}$') class Error(Exception): pass class BuildNotFoundError(Error): pass class Buil...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29896, 29946, 450, 678, 456, 1974, 13189, 943, 29889, 2178, 10462, 21676, 29889, 13, 29937, 4803, 310, 445, 2752, 775, 338, 4095, 287, 491, 263, 350, 7230, 29899, 3293, 19405, 393, 508, 367, 13,...
src/__init__.py
MishaCatskill/lykos
0
73660
<filename>src/__init__.py import argparse import datetime import time import botconfig import src.settings as var from src import logger from src.logger import stream, stream_handler, debuglog, errlog, plog from src import db # Import the user-defined game modes # These are not required, so failing to import it doesn...
[ 1, 529, 9507, 29958, 4351, 29914, 1649, 2344, 26914, 2272, 13, 5215, 1852, 5510, 13, 5215, 12865, 13, 5215, 931, 13, 13, 5215, 9225, 2917, 13, 5215, 4765, 29889, 11027, 408, 722, 13, 3166, 4765, 1053, 17927, 13, 3166, 4765, 29889, 217...
Searching and Sorting/playlist.py
mishrakeshav/CSES-Problem-Set
0
37610
def solve(): n = int(input()) k = list(map(int,input().split())) hashmap = dict() j = 0 ans = 0 c = 0 for i in range(n): if k[i] in hashmap and hashmap[k[i]] > 0: while i > j and k[i] in hashmap and hashmap[k[i]] > 0: hashmap[k[j]] -= 1 ...
[ 1, 29871, 13, 1753, 4505, 7295, 13, 1678, 302, 353, 938, 29898, 2080, 3101, 13, 1678, 413, 353, 1051, 29898, 1958, 29898, 524, 29892, 2080, 2141, 5451, 22130, 13, 1678, 6608, 1958, 353, 9657, 580, 13, 1678, 432, 353, 29871, 29900, 13,...
pada/assemble/__init__.py
eleveyuan/kada
4
1603524
# comment code to fix partially/circular import # from pada.assemble.locates import url # from pada.assemble.assembles import assemble # from pada.assemble.pipes import pipe # # # __all__ = ['url', 'assemble', 'pipe']
[ 1, 396, 3440, 775, 304, 2329, 22039, 29914, 6034, 1070, 1053, 13, 29937, 515, 282, 1114, 29889, 465, 6967, 29889, 2029, 1078, 1053, 3142, 13, 29937, 515, 282, 1114, 29889, 465, 6967, 29889, 465, 1590, 793, 1053, 24940, 13, 29937, 515, ...
source_optics/scanner/commits.py
heemayl/source_optics
1
137172
# Copyright 2018-2019 SourceOptics Project Contributors # # 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...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29896, 29947, 29899, 29906, 29900, 29896, 29929, 7562, 20624, 1199, 8010, 2866, 1091, 29560, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313,...
tests/test_integration_features.py
daviesje/21cmFAST
28
126268
""" A set of large-scale tests which test code updates against previously-run "golden" results. The idea here is that any new updates (except for major versions) should be non-breaking; firstly, they should not break the API, so that the tests should run without crashing without being changed. Secondly, the actual res...
[ 1, 9995, 13, 29909, 731, 310, 2919, 29899, 7052, 6987, 607, 1243, 775, 11217, 2750, 9251, 29899, 3389, 376, 29887, 1025, 264, 29908, 13, 9902, 29889, 13, 13, 1576, 2969, 1244, 338, 393, 738, 716, 11217, 313, 19499, 363, 4655, 6910, 29...
test/client/device/common/test_thread_base.py
redmic-project/device-oag-buoy-buoy-client
0
107126
<filename>test/client/device/common/test_thread_base.py import unittest from nose.tools import eq_ from buoy.client.device.common.base import BaseThread from buoy.client.notification.client.common import NoticePriorityQueue class TestThreadBase(unittest.TestCase): def setUp(self): queue_notice = NoticeP...
[ 1, 529, 9507, 29958, 1688, 29914, 4645, 29914, 10141, 29914, 9435, 29914, 1688, 29918, 7097, 29918, 3188, 29889, 2272, 13, 5215, 443, 27958, 13, 13, 3166, 26414, 29889, 8504, 1053, 11594, 29918, 13, 13, 3166, 1321, 12602, 29889, 4645, 298...
chap05/list0507.py
ytianjin/GitTest
0
110822
# 打印输出位的逻辑与运算的结果、逻辑或运算的结果、逻辑异或运算的结果以及取反的结果 a = int(input('正整数a:')) b = int(input('正整数b:')) w = int(input('表示位数:')) f = '{{:0{}b}}'.format(w) m = 2 ** w - 1 # w位都相当于二进制数的1 print('a = ' + f.format(a)) print('b = ' + f.format(b)) print('a & b = ' + f.format(a & b)) print('a | b = ' + f.format(a...
[ 1, 396, 29871, 31656, 232, 144, 179, 31573, 30544, 30956, 30210, 236, 131, 190, 235, 193, 148, 31267, 31894, 31565, 30210, 31320, 30801, 30330, 236, 131, 190, 235, 193, 148, 31391, 31894, 31565, 30210, 31320, 30801, 30330, 236, 131, 190, ...
src/firebolt/client/client.py
ptiurin/firebolt-python-sdk
0
1617803
<filename>src/firebolt/client/client.py from typing import Any, Optional from async_property import async_cached_property # type: ignore from httpx import AsyncClient as HttpxAsyncClient from httpx import Client as HttpxClient from httpx import _types from httpx import codes as HttpxCodes from httpx._types import Aut...
[ 1, 529, 9507, 29958, 4351, 29914, 8696, 2095, 29873, 29914, 4645, 29914, 4645, 29889, 2272, 13, 3166, 19229, 1053, 3139, 29892, 28379, 13, 13, 3166, 7465, 29918, 6799, 1053, 7465, 29918, 29883, 3791, 29918, 6799, 29871, 396, 1134, 29901, ...
attack/attacker.py
smallflyingpig/adversarial_attack_and_defense
0
51726
<filename>attack/attacker.py import torch from torch import nn from abc import ABC, abstractmethod class AdditiveAttacker(ABC): def __init__(self, eps, data_min=-1, data_max=1): self.eps = eps self.data_min = data_min self.data_max = data_max @abstractmethod def _get_perturbation(s...
[ 1, 529, 9507, 29958, 1131, 547, 29914, 1131, 28940, 29889, 2272, 13, 5215, 4842, 305, 13, 3166, 4842, 305, 1053, 302, 29876, 13, 3166, 25638, 1053, 16417, 29892, 9846, 5696, 13, 13, 1990, 3462, 3321, 4165, 28940, 29898, 19658, 1125, 13,...
app/src/main/python/doupai.py
One-PZ/lmgp
0
174655
# -*- coding:utf-8 -*- import re import json import requests """ 目标APP:逗拍 目标url:APP视频分享链接 爬取思路: 1. 通过APP里的分享获取视频url 2. 对https://v2.doupai.cc/topic/XXXXXX.json发送post请求,获取json数据 """ class DouPai(object): def __init__(self, url): self.url = url self.session = requests.Session() def get_...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 9420, 29899, 29947, 448, 29930, 29899, 13, 5215, 337, 13, 5215, 4390, 13, 5215, 7274, 13, 13, 15945, 29908, 13, 30895, 31062, 20576, 30383, 236, 131, 154, 233, 142, 144, 13, 30895, 31062, 2271, ...
api-v2/config_helper.py
MikeChurvis/mikechurvis.github.io
1
54113
from django.core.exceptions import ImproperlyConfigured def validate_settings(settings, required_settings: set[str]): required_settings = { 'CONTACTFORM_NAME_MAX_LENGTH', 'CONTACTFORM_ORGANIZATION_MAX_LENGTH', 'CONTACTFORM_EMAIL_MAX_LENGTH', 'CONTACTFORM_EMAIL_REGULAR_EXPRESSION', ...
[ 1, 515, 9557, 29889, 3221, 29889, 11739, 29879, 1053, 1954, 771, 546, 368, 3991, 2955, 13, 13, 13, 1753, 12725, 29918, 11027, 29898, 11027, 29892, 3734, 29918, 11027, 29901, 731, 29961, 710, 29962, 1125, 13, 1678, 3734, 29918, 11027, 353,...
icon-downloader/isko.py
vpa1/vetrani-bez-jedu
0
85629
<gh_stars>0 import requests,psycopg2,logging try: aqdata=requests.get('http://portal.chmi.cz/files/portal/docs/uoco/web_generator/actual_hour_data_cze.json').json() conn = psycopg2.connect(user = "wforecast_app", password = "<PASSWORD>", host = "db", ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 7274, 29892, 567, 29891, 9708, 29887, 29906, 29892, 21027, 13, 2202, 29901, 29871, 13, 1678, 263, 29939, 1272, 29922, 24830, 29889, 657, 877, 1124, 597, 25089, 29889, 305, 2460, 298...
tests/serializer.py
asellappen/python-junit-xml
95
129029
import codecs import os import tempfile from xml.dom import minidom from six import PY2 from junit_xml import to_xml_report_file, to_xml_report_string def serialize_and_read(test_suites, to_file=False, prettyprint=False, encoding=None): """writes the test suite to an XML string and then re-reads it using minido...
[ 1, 1053, 775, 2395, 13, 5215, 2897, 13, 5215, 5694, 1445, 13, 3166, 4903, 29889, 3129, 1053, 1375, 333, 290, 13, 13, 3166, 4832, 1053, 349, 29979, 29906, 13, 13, 3166, 4707, 277, 29918, 3134, 1053, 304, 29918, 3134, 29918, 12276, 2991...
python_sample_app/publisher/publisher.py
open-edge-insights/eii-samples
1
76455
<gh_stars>1-10 # Copyright (c) 2020 Intel Corporation. # # 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, m...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29900, 18555, 15025, 29889, 13, 29937, 13, 29937, 20894, 2333, 338, 1244, 1609, 16896, 29892, 3889, 3...
tests/test_users.py
benranderson/demo
1
172274
<reponame>benranderson/demo import json from tests.utils import add_user, recreate_db class TestUsersList: def test_add_user(self, client, test_db): response = client.post( "/users", data=json.dumps({"username": "ben", "email": "<EMAIL>"}), content_type="application/js...
[ 1, 529, 276, 1112, 420, 29958, 1785, 9502, 1330, 29914, 17482, 13, 5215, 4390, 13, 13, 3166, 6987, 29889, 13239, 1053, 788, 29918, 1792, 29892, 337, 3258, 29918, 2585, 13, 13, 13, 1990, 4321, 5959, 1293, 29901, 13, 1678, 822, 1243, 29...
setup.py
okanlv/coco-caption
11
1608187
<gh_stars>10-100 import sys import os import subprocess from setuptools import setup, find_packages import get_stanford_models get_stanford_models.main() packages = [p for p in find_packages() if "pycocoevalcap" in p] setup( name="pycocoevalcap", packages=packages, package_dir={"pycocoevalcap": "pycocoev...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 1014, 5014, 13, 3166, 731, 21245, 8789, 1053, 6230, 29892, 1284, 29918, 8318, 13, 5215, 679, 29918, 14411, 4006, ...
gans/models/gans/gan.py
tlatkowski/gans-2.0
78
176423
from abc import ABC from abc import abstractmethod class GAN(ABC): @property @abstractmethod def generators(self): raise NotImplementedError @property @abstractmethod def discriminators(self): raise NotImplementedError @abstractmethod def predict(self, inputs): ...
[ 1, 515, 25638, 1053, 16417, 13, 13, 3166, 25638, 1053, 9846, 5696, 13, 13, 13, 1990, 402, 2190, 29898, 19658, 1125, 13, 13, 1678, 732, 6799, 13, 1678, 732, 16595, 5696, 13, 1678, 822, 1176, 4097, 29898, 1311, 1125, 13, 4706, 12020, ...
tkinter_examples/draw_chess_board.py
DazEB2/SimplePyScripts
117
9520
<filename>tkinter_examples/draw_chess_board.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' from tkinter import * root = Tk() root.title('Chess board') canvas = Canvas(root, width=700, height=700, bg='#fff') canvas.pack() fill = '#fff' outline = '#000' size = 88 for i in range(8): f...
[ 1, 529, 9507, 29958, 11178, 1639, 29918, 19057, 29914, 4012, 29918, 305, 404, 29918, 3377, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 299...
restfulpy/tests/test_orderable_mixin.py
maryayi/restfulpy
1
101749
<reponame>maryayi/restfulpy import unittest from sqlalchemy import Unicode from nanohttp import settings from restfulpy.orm import DeclarativeBase, DBSession, Field, OrderableMixin from restfulpy.testing import WebAppTestCase from restfulpy.tests.helpers import MockupApplication class OrderableCheckingModel(Orderab...
[ 1, 529, 276, 1112, 420, 29958, 5219, 388, 29875, 29914, 5060, 1319, 2272, 13, 5215, 443, 27958, 13, 13, 3166, 4576, 284, 305, 6764, 1053, 23862, 13, 3166, 302, 1562, 1124, 1053, 6055, 13, 13, 3166, 1791, 1319, 2272, 29889, 555, 1053, ...
tfidf.py
ezhouyang/class
1
86191
<reponame>ezhouyang/class #coding:utf-8 import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn import svm from sklearn.neighbors import KNeighborsClassifier from...
[ 1, 529, 276, 1112, 420, 29958, 6096, 10774, 29891, 574, 29914, 1990, 13, 29937, 29883, 3689, 29901, 9420, 29899, 29947, 13, 13, 5215, 12655, 408, 7442, 13, 3166, 2071, 19668, 29889, 14394, 29918, 1062, 13857, 29889, 726, 1053, 3917, 12877...
tweet-fanclub/handler.py
alexellis/faas-twitter-fanclub
22
124312
import requests import json import base64 import redis import os def handle(st): # parse Github event req = json.loads(st) minutes = 1 minutes_val = os.getenv("cache-minutes") if minutes_val != None: minutes = int(minutes_val) loginName = req["sender"]["login"] try: redis...
[ 1, 1053, 7274, 13, 5215, 4390, 13, 5215, 2967, 29953, 29946, 13, 5215, 29825, 13, 5215, 2897, 13, 13, 1753, 4386, 29898, 303, 1125, 13, 1678, 396, 6088, 402, 2985, 1741, 13, 1678, 12428, 353, 4390, 29889, 18132, 29898, 303, 29897, 13,...
class work/Jacob_ledbetter_102215_pygmaedemo/Jacob_ledbetter_102215_pygmaedemo.py
jll123567/freshmen-code
0
173554
#------------------------------------------ #press f5 #arows to move #get hearts avoid green thing #if you die try again #good luck #_______---------------------------- #import import pygame import random import time #init pygame.init() #surface size display_width=1000 display_height=600 #color def black= (0,0,...
[ 1, 396, 2683, 2683, 28400, 13, 13, 13, 13, 13, 13, 29937, 2139, 285, 29945, 13, 29937, 279, 1242, 304, 4337, 13, 29937, 657, 26490, 4772, 7933, 2655, 13, 29937, 361, 366, 762, 1018, 1449, 13, 29937, 16773, 9885, 13, 13, 13, 13, 29...
matcher.py
timsliu/nimble-notifier
0
125043
<reponame>timsliu/nimble-notifier # matcher.py # # This program opens the list of active users in each state and matches with # the list of available sites import os import json import util from haversine import haversine, Unit import copy import defs def users_this_tick(user_dict, tick): '''filters a user...
[ 1, 529, 276, 1112, 420, 29958, 9346, 29879, 492, 29884, 29914, 16135, 569, 29899, 1333, 3709, 13, 29937, 1993, 261, 29889, 2272, 13, 29937, 13, 29937, 910, 1824, 13246, 278, 1051, 310, 6136, 4160, 297, 1269, 2106, 322, 7087, 411, 13, ...
HADOOP/SPOILER_mapper.py
Athan-asios/HADOOP-AND-SPARK-USAGE-FOR-BIG-DATA-ANALYSIS
0
149240
#!/usr/bin/env python3 # ref: http://open.blogs.nytimes.com/2014/07/10/emr-streaming-in-go/ import sys import json def main(): # loop through each line of stdin for line in sys.stdin: try: # parse the incoming json j = json.loads(line.strip()) # initialize outpu...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 29937, 2143, 29901, 1732, 597, 3150, 29889, 25762, 29889, 1460, 3706, 29889, 510, 29914, 29906, 29900, 29896, 29946, 29914, 29900, 29955, 29914, 29896, 29900, 29914, 331, 29878, ...
grr/client/client_plugins.py
ethicalhackeragnidhra/Grr
1
134216
#!/usr/bin/env python """Centralized import point for client plugins. This acts as a centralized point for modules that need to be loaded for the client components so that the client_startup.Init() function will find and register them. This also acts as a sensible single place to add deployment specific plugin module...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 23369, 1705, 1891, 1053, 1298, 363, 3132, 18224, 29889, 13, 13, 4013, 14741, 408, 263, 6555, 1891, 1298, 363, 10585, 393, 817, 304, 367, 7500, 363, 13, 1552, 3132, 7117, ...
test.py
sasha42/c3lingo-stats
2
35769
#!/usr/bin/env python3 import unittest from textwrap import dedent from datetime import timedelta from parse import parse_block, TranslationShift class TestTranslationShift(unittest.TestCase): def test_eq(self): self.assertEqual(TranslationShift('name', 'lang'), TranslationShift('name', 'lang')) ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 443, 27958, 13, 3166, 1426, 6312, 1053, 28262, 296, 13, 3166, 12865, 1053, 5335, 287, 2554, 13, 3166, 6088, 1053, 6088, 29918, 1271, 29892, 4103, 18411, 29657, 13, 13,...
main.py
BL-Lac149597870/drugVQA
0
18713
<filename>main.py ''' Author: QHGG Date: 2021-02-27 13:42:43 LastEditTime: 2021-03-01 23:26:38 LastEditors: QHGG Description: FilePath: /drugVQA/main.py ''' import torch from sklearn import metrics import warnings warnings.filterwarnings("ignore") torch.cuda.set_device(0) print('cuda size == 1') from trainAndTest impo...
[ 1, 529, 9507, 29958, 3396, 29889, 2272, 13, 12008, 13, 13720, 29901, 660, 29950, 26788, 13, 2539, 29901, 29871, 29906, 29900, 29906, 29896, 29899, 29900, 29906, 29899, 29906, 29955, 29871, 29896, 29941, 29901, 29946, 29906, 29901, 29946, 2994...
Chapter08/qt08_winBkground01.py
csy1993/PythonQt
0
178799
<filename>Chapter08/qt08_winBkground01.py<gh_stars>0 # -*- coding: utf-8 -*- ''' 【简介】 界面背景图片设置 ''' import sys from PyQt5.QtWidgets import QMainWindow , QApplication app = QApplication(sys.argv) win = QMainWindow() win.setWindowTitle("界面背景图片设置") win.resize(350, 250) win.setObjectName("MainWindow") win....
[ 1, 529, 9507, 29958, 1451, 3314, 29900, 29947, 29914, 17915, 29900, 29947, 29918, 5080, 29933, 29895, 2057, 29900, 29896, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 299...
igibson/metrics/agent.py
Nick-AhSen/iGibson
0
8291
import copy import numpy as np import pybullet as p from igibson.metrics.metric_base import MetricBase class BehaviorRobotMetric(MetricBase): def __init__(self): self.initialized = False self.state_cache = {} self.next_state_cache = {} self.agent_pos = {part: [] for part in ["l...
[ 1, 1053, 3509, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 11451, 18850, 408, 282, 13, 13, 3166, 8919, 747, 1100, 29889, 2527, 10817, 29889, 16414, 29918, 3188, 1053, 4737, 2200, 5160, 13, 13, 13, 1990, 1522, 16300, 21860, 327, 10095, 2...
ProjectEuler.Problem.013.py
jihunroh/ProjectEuler-Python
0
7323
from ProjectEulerCommons.Base import * numbers_list = """37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 91942213363574161572522430563301811072406154908250 23067588207539346171171980310421047513778063246676 8926167...
[ 1, 515, 8010, 29923, 8584, 5261, 787, 29889, 5160, 1053, 334, 13, 13, 20326, 29918, 1761, 353, 9995, 29941, 29955, 29896, 29900, 29955, 29906, 29947, 29955, 29945, 29941, 29941, 29929, 29900, 29906, 29896, 29900, 29906, 29955, 29929, 29947, ...
test/functional/test_framework/tachacoin.py
tachacoin/tachacoin
0
129607
from .address import * from .script import * from .mininode import * from .util import * from .tachacoinconfig import * from .blocktools import * from .key import * from .segwit_addr import * import io def make_transaction(node, vin, vout): tx = CTransaction() tx.vin = vin tx.vout = vout tx.rehash() ...
[ 1, 515, 869, 7328, 1053, 334, 13, 3166, 869, 2154, 1053, 334, 13, 3166, 869, 1195, 262, 356, 1053, 334, 13, 3166, 869, 4422, 1053, 334, 13, 3166, 869, 29873, 496, 11216, 262, 2917, 1053, 334, 13, 3166, 869, 1271, 8504, 1053, 334, ...
{{cookiecutter.project_slug}}/app/api/helpers/__init__.py
khanh41/fastapi-mongodb-base-project
3
120680
<reponame>khanh41/fastapi-mongodb-base-project import ast import os import zipfile import wget def base_file_download(path_check, url_download): if not os.path.isfile(path_check): wget.download(url_download, path_check) def base_zip_download(path_check, url_download): if not os.path.isdir(path_chec...
[ 1, 529, 276, 1112, 420, 29958, 29895, 5403, 29882, 29946, 29896, 29914, 11255, 2754, 29899, 23264, 29899, 3188, 29899, 4836, 13, 5215, 8717, 13, 5215, 2897, 13, 5215, 14319, 1445, 13, 13, 5215, 281, 657, 13, 13, 13, 1753, 2967, 29918, ...
sensor/Csv_Manip.py
utagsa2021/GolfSwingAnalysis
0
114354
import csv import numpy as np import pandas as pd # Removes first few rows of data that don't have actual sensor readings def trim_csv(in_file_name, out_file_name): with open(in_file_name, "r") as inp, open(out_file_name, "w") as out: writer = csv.writer(out) for row in csv.reader(inp): ...
[ 1, 1053, 11799, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 13, 13, 29937, 5240, 586, 267, 937, 2846, 4206, 310, 848, 393, 1016, 29915, 29873, 505, 3935, 23530, 1303, 886, 13, 1753, 17151, 29918, 7638, 29898, 262, 299...
ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_client.py
vsosrc/ambari
0
102084
<reponame>vsosrc/ambari #!/usr/bin/env python ''' 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 file to you under the Apache License, Ver...
[ 1, 529, 276, 1112, 420, 29958, 4270, 359, 2214, 29914, 1117, 1306, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 12008, 13, 29931, 293, 21144, 304, 278, 13380, 18540, 10606, 313, 3289, 29943, 29897, 1090, 697, 13, 272,...
singleAlgoritm/ContinuousEnvMlpInput/SAC.py
NLS-SJTU/BatcRL
3
102329
import os import torch import numpy as np import torch.nn as nn import torch.nn.functional as F class ReplayBuffer: def __init__(self, state_dim, action_dim,max_size=1e6, device = torch.device('cpu')): self.state_dim = state_dim self.action_dim = action_dim self.max_size = max_size ...
[ 1, 1053, 2897, 13, 13, 5215, 4842, 305, 13, 5215, 12655, 408, 7442, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 5215, 4842, 305, 29889, 15755, 29889, 2220, 284, 408, 383, 13, 1990, 830, 1456, 7701, 29901, 13, 1678, 822, ...
ckanext/federgob/FDG/merge_metadata.py
ontoquercus/ckanext-federgob
1
99660
<reponame>ontoquercus/ckanext-federgob #!/usr/bin/python # -*- coding: utf-8 -*- #Script by: <NAME> #Date: 28-10-2014 #Script to process the user metadata about the catalog. #Get all the fields from fields.conf fields_conf_file = open('fields.conf','r') fields_lines = fields_conf_file.readlines() fields_conf_file.cl...
[ 1, 529, 276, 1112, 420, 29958, 10268, 339, 6269, 375, 29914, 384, 273, 1062, 29899, 29888, 2447, 29887, 711, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29...
tests/test_topo.py
marrow-legacy/pulp.dependancy
0
72329
# encoding: utf-8 from unittest import TestCase from pulp.wsgi.graph.registry import register, graph from pulp.wsgi.graph.exception import * from pulp.wsgi.graph.topo import resolve, leveled @register class A(object): provides = ['foo'] @register class B(object): uses = ['foo', 'bar'] @register class C(ob...
[ 1, 396, 8025, 29901, 23616, 29899, 29947, 13, 13, 3166, 443, 27958, 1053, 4321, 8259, 13, 13, 3166, 9505, 29886, 29889, 5652, 3146, 29889, 4262, 29889, 1727, 6020, 1053, 6036, 29892, 3983, 13, 3166, 9505, 29886, 29889, 5652, 3146, 29889, ...
aoc-2021/day5.py
flanggut/advent-of-code
0
54036
<gh_stars>0 import aoc import numpy as np def drawlinetogrid(grid, begin, end): diff = end - begin numpoints = np.max(np.abs(diff)) if numpoints == 0: return diff = diff / numpoints for i in range(0, numpoints + 1): coord = (begin + i * diff).astype(int) grid[coord[0], coor...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 263, 542, 13, 5215, 12655, 408, 7442, 13, 13, 13, 1753, 4216, 1915, 300, 468, 2429, 29898, 7720, 29892, 3380, 29892, 1095, 1125, 13, 1678, 2923, 353, 1095, 448, 3380, 13, 1678, ...
data-integration/getPANGAEA.py
enermaps/enermaps
5
133336
#!/usr/bin/env python3 """ Pipeline for PANGAEA data, with custom NETCDF reading. This script allows for data updates. @author: giuseppeperonato """ import json import logging import os import shutil import sys import frictionless import numpy as np import pandas as pd import requests import utilities import xarray ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 15945, 29908, 13, 29925, 23828, 363, 349, 2190, 12739, 29923, 29909, 848, 29892, 411, 2888, 405, 2544, 29907, 4037, 5183, 29889, 13, 4013, 2471, 6511, 363, 848, 11217, 29889, 13, ...
examples/assessing_frontier/zt_loader.py
OscarDeGar/py_grama
13
37678
## Data Loader: TE-CCA zT Dataset # <NAME> (<EMAIL>) 2021-03-12 # from citrination_client import CitrinationClient, PifSystemReturningQuery from citrination_client import DataQuery, DatasetQuery, Filter from matminer.featurizers.base import MultipleFeaturizer from matminer.featurizers import composition as cf from pyma...
[ 1, 444, 3630, 4309, 1664, 29901, 17067, 29899, 4174, 29909, 503, 29911, 13373, 24541, 13, 29937, 529, 5813, 29958, 313, 29966, 26862, 6227, 12948, 29871, 29906, 29900, 29906, 29896, 29899, 29900, 29941, 29899, 29896, 29906, 13, 29937, 13, 3...
test.py
Yanrs/PokemonGoInBrazil
0
130365
<reponame>Yanrs/PokemonGoInBrazil import sys import unittest from unittest.mock import patch, Mock import urllib.request import urllib.error import http.client import main # Pokemon Go in Brazil Test Suite # -------------------------------- # For the HTML Parser tests, unicode strings # are encoded to utf-8 in bytes, ...
[ 1, 529, 276, 1112, 420, 29958, 29979, 273, 2288, 29914, 29925, 554, 9857, 8120, 797, 29933, 9504, 309, 13, 5215, 10876, 13, 5215, 443, 27958, 13, 3166, 443, 27958, 29889, 17640, 1053, 13261, 29892, 26297, 13, 5215, 3142, 1982, 29889, 38...
src/scene/common.py
Speterius/ray_tracing
3
148052
<gh_stars>1-10 from typing import Union, List, Tuple import numpy as np # Typing aliases: Vector3D = Union[np.ndarray, list, Tuple[float, float, float]] Color = Union[List[int], Tuple[int, int, int]]
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 19229, 1053, 7761, 29892, 2391, 29892, 12603, 552, 13, 5215, 12655, 408, 7442, 13, 13, 29937, 14213, 292, 14430, 2129, 29901, 13, 12877, 29941, 29928, 353, 7761...
utils.py
plotly/sample_dash_livy_spark
6
189429
<filename>utils.py<gh_stars>1-10 from constants import JobStates, SparkStates import json import requests def prettify_json(json_dict): return json.dumps(json_dict, indent=4, sort_keys=True) def parse_json(json_text): return json.loads(json_text) job_states = JobStates() spark_states = SparkStates() cla...
[ 1, 529, 9507, 29958, 13239, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 17727, 1053, 17163, 855, 1078, 29892, 20814, 855, 1078, 13, 5215, 4390, 13, 5215, 7274, 13, 13, 13, 1753, 758, 698, 15...
Panalyzer/TraceParser/csv2np_buffered.py
dashazhangdake/gem5test
0
47675
import csv import numpy as np import time from pathlib import Path from Panalyzer.utils.wr_extractor import wr_extractor from Panalyzer.TraceParser.logic_masking import * def arm32buffered_csv2np(fcsv, buffersize, num_reg): detailded_info = {'wr': None, 'regval': None, 'tick': None, 'masking': None, ...
[ 1, 1053, 11799, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 5215, 931, 30004, 13, 30004, 13, 3166, 2224, 1982, 1053, 10802, 30004, 13, 30004, 13, 3166, 6518, 14997, 3298, 29889, 13239, 29889, 15866, 29918, 21111, 272, 1053, 2358, 29918,...
nngen/operator/pad.py
hirayamy/nngen
0
96145
<reponame>hirayamy/nngen from __future__ import absolute_import from __future__ import print_function from __future__ import division from nngen.operator.pool import _pool class pad(_pool): def __sub_str__(self): if hasattr(self, 'pad_col_left') and self.padding == 'SAME': padding = ("'%s'-(...
[ 1, 529, 276, 1112, 420, 29958, 2918, 764, 25934, 29914, 29876, 865, 264, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 3166, 4770, 29888, 9130, 1649, 1053, 85...
models/eval_rels.py
IIGROUP/PUM
12
176408
import os from dataloaders.visual_genome import VG, vg_collate from lib.utils import define_model, load_ckpt, do_test from config import cfg from torch.utils.data import DataLoader test_data = VG(cfg.test_data_name, num_val_im=5000, filter_duplicate_rels=True, use_proposals=cfg.use_proposals, filter_no...
[ 1, 1053, 2897, 13, 3166, 1418, 7003, 24574, 29889, 20119, 29918, 1885, 608, 1053, 478, 29954, 29892, 325, 29887, 29918, 1054, 9632, 13, 3166, 4303, 29889, 13239, 1053, 4529, 29918, 4299, 29892, 2254, 29918, 384, 415, 29892, 437, 29918, 16...
scripts/train_template.py
mibaumgartner/hackathon_health
0
75684
from dataset import CovidImageDataset from argparse import ArgumentParser import torch import torch.nn as nn from model import VGG import numpy as np import os from pytorch_lightning.utilities.seed import seed_everything import random def seed_worker(worker_id): ''' https://pytorch.org/docs/stable/notes/rando...
[ 1, 515, 8783, 1053, 25669, 333, 2940, 16390, 24541, 13, 3166, 1852, 5510, 1053, 23125, 11726, 13, 5215, 4842, 305, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 3166, 1904, 1053, 478, 26788, 13, 5215, 12655, 408, 7442, 13, 5...
avrofilter/avrofilter.py
CAIDA/hermes-avrofilter
0
55368
# Copyright 2019 The Regents of the University of California. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29896, 29929, 450, 2169, 1237, 310, 278, 3014, 310, 8046, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, ...
src/model/operationsbn.py
guoyongcs/HNAS
60
113826
import torch import torch.nn as nn import torch.nn.functional as F import math import sys sys.path.append("..") from option import args OPS = { 'none': lambda C, stride, affine: Zero(stride), 'avg_pool_3x3': lambda C, stride, affine: nn.AvgPool2d(3, stride=stride, padding=1, count_include_pad=False),...
[ 1, 1053, 4842, 305, 30004, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 30004, 13, 5215, 4842, 305, 29889, 15755, 29889, 2220, 284, 408, 383, 30004, 13, 5215, 5844, 30004, 13, 5215, 10876, 30004, 13, 9675, 29889, 2084, 29889, 439...
config.py
StuartSul/SampyoNet
0
32410
## Built-in packages import getopt import json import os import sys ## Third-party packages from PIL import Image import joblib import numpy as np import tqdm ## Tensorflow from tensorflow.keras.layers import BatchNormalization from tensorflow.keras.layers import Dense from tensorflow.keras.layers import Dropout from...
[ 1, 444, 5373, 2782, 29899, 262, 9741, 13, 5215, 679, 3670, 13, 5215, 4390, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 2277, 18008, 29899, 22633, 9741, 13, 3166, 349, 6227, 1053, 7084, 13, 5215, 4982, 1982, 13, 5215, 12655, 408, 7442, ...
src/isa.py
plafl/helisim
6
1610075
# Atmosfera ISA # Condiciones a nivel del mar P0 = 101.3e3 # Pa T0 = 288 # K # Gravedad g = 9.81 # m/s^2 # Ley de temperatura en la troposfera: T = T0 - L*h L = 0.0065 # K/m # Constante del gas Ra = 287 # J/(Kg*K) # h en metros, T en kelvins def T(h): return T0 - L*h # h en metros...
[ 1, 396, 2180, 7681, 571, 29874, 306, 8132, 13, 13, 29937, 11790, 14674, 263, 23594, 628, 1766, 13, 29925, 29900, 353, 29871, 29896, 29900, 29896, 29889, 29941, 29872, 29941, 1678, 396, 2621, 13, 29911, 29900, 353, 29871, 29906, 29947, 299...
python/AlgoritmosPython/raizAlgarismos.py
jonfisik/Projects
2
98158
__author__ = 'JPaschoal' __version__ = '1.0.1' __email__ = '<EMAIL>' __date__ = '08/05/2021' ''' Qualquer número natural de quatro algarismos pode ser dividido em duas dezenas formadas pelos seus dois primeiros e dois últimos dígitos. Exemplos: 1297: 12 e 97 5314: 53 e 14 Escreva um programa que imprime todos ...
[ 1, 4770, 8921, 1649, 29871, 353, 525, 29967, 29925, 294, 1859, 284, 29915, 13, 1649, 3259, 1649, 353, 525, 29896, 29889, 29900, 29889, 29896, 29915, 13, 1649, 5269, 1649, 259, 353, 12801, 26862, 6227, 16299, 13, 1649, 1256, 1649, 1678, ...
lesson 16/question 2.py
Kev-in123/ICS2O7
2
1609911
<filename>lesson 16/question 2.py import random rolls = [random.randint(1, 6) + random.randint(1,6) for i in range(50)] try: interested_roll = int(input("What number are you interested in: ")) except ValueError: print("Invalid value try again") interested_roll = int(input("What number are you interested...
[ 1, 529, 9507, 29958, 2222, 265, 29871, 29896, 29953, 29914, 12470, 29871, 29906, 29889, 2272, 13, 5215, 4036, 30004, 13, 30004, 13, 1245, 29879, 353, 518, 8172, 29889, 9502, 524, 29898, 29896, 29892, 29871, 29953, 29897, 718, 4036, 29889, ...
python/spinn/models/fat_classifier.py
stanfordnlp/spinn
200
57337
<reponame>stanfordnlp/spinn<gh_stars>100-1000 """From the project root directory (containing data files), this can be run with: Boolean logic evaluation: python -m spinn.models.fat_classifier --training_data_path ../bl-data/pbl_train.tsv \ --eval_data_path ../bl-data/pbl_dev.tsv SST sentiment (Demo only, model...
[ 1, 529, 276, 1112, 420, 29958, 14411, 4006, 12938, 29886, 29914, 1028, 2559, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 15945, 29908, 4591, 278, 2060, 3876, 3884, 313, 1285, 17225, 848...
laia/common/saver.py
eivtho/PyLaia
89
1600676
<reponame>eivtho/PyLaia import inspect import os from typing import Any, Callable import torch from laia.common.logging import get_logger _logger = get_logger(__name__) class Saver: def __call__(self, *args: Any, **kwargs: Any): return self.save(*args, **kwargs) def save(self, *args: Any, **kwargs...
[ 1, 529, 276, 1112, 420, 29958, 29872, 440, 386, 29877, 29914, 19737, 5661, 423, 13, 5215, 16096, 13, 5215, 2897, 13, 3166, 19229, 1053, 3139, 29892, 8251, 519, 13, 13, 5215, 4842, 305, 13, 13, 3166, 425, 423, 29889, 9435, 29889, 21027...
fluid/image_classification/eval.py
Panxj/models-1
0
182868
<gh_stars>0 import os import sys import numpy as np import argparse import functools import paddle import paddle.fluid as fluid from utility import add_arguments, print_arguments from se_resnext import SE_ResNeXt import reader parser = argparse.ArgumentParser(description=__doc__) add_arg = functools.partial(add_argum...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 12655, 408, 7442, 13, 5215, 1852, 5510, 13, 5215, 2090, 312, 8789, 13, 13, 5215, 282, 22352, 13, 5215, 282, 22352, 29889, 1579, 5416, 408, 22576...
tests/example/reflexes/example_reflex.py
FarhanAliRaza/django-sockpuppet
371
139049
<reponame>FarhanAliRaza/django-sockpuppet from sockpuppet.reflex import Reflex class ExampleReflex(Reflex): def increment(self, step=1): self.session['count'] = int(self.element.dataset['count']) + step class DecrementReflex(Reflex): def decrement(self, step=1): self.session['otherCount'] = ...
[ 1, 529, 276, 1112, 420, 29958, 29943, 279, 5403, 29909, 492, 29934, 19924, 29914, 14095, 29899, 21852, 3746, 7988, 13, 3166, 577, 384, 3746, 7988, 29889, 999, 2506, 1053, 9897, 2506, 13, 13, 13, 1990, 8741, 5620, 2506, 29898, 5620, 2506...
ops/multihead/__init__.py
ancientmooner/CCNet
0
192043
from .multihead_block import MultiheadBlock from .multihead_spatial_block import MultiheadSpatialBlock __all__ = [ 'MultiheadBlock', 'MultiheadSpatialBlock', ]
[ 1, 515, 869, 9910, 2813, 29918, 1271, 1053, 14974, 2813, 7445, 13, 3166, 869, 9910, 2813, 29918, 1028, 15238, 29918, 1271, 1053, 14974, 2813, 29903, 5031, 616, 7445, 13, 13, 1649, 497, 1649, 353, 518, 13, 1678, 525, 15329, 2813, 7445, ...
viper/cli.py
curtisma/conda-virtuoso
2
171942
""" Command line interface for viper """ import click from .docs import docs as docs_internal from .cdslib import add_library, include_cdslib @click.group() def virt(): """ Cadence virtuoso command-line utilities """ pass @virt.command() def docs(): docs_internal() @virt.group() def cdslib(): ...
[ 1, 9995, 13, 6255, 1196, 5067, 363, 3516, 546, 13, 15945, 29908, 13, 5215, 2828, 13, 3166, 869, 2640, 1053, 10561, 408, 10561, 29918, 7564, 13, 3166, 869, 2252, 29879, 1982, 1053, 788, 29918, 5258, 29892, 3160, 29918, 2252, 29879, 1982,...
lmbl_weight.py
zhuruijie16/Scripts_CE
0
199293
<filename>lmbl_weight.py import os import pandas as pd import numpy as np import shutil cwd = os.getcwd() sysname = os.path.basename(cwd) print(sysname) if os.path.isdir(cwd+'/lmbl/'): shutil.rmtree(cwd+'/lmbl/') os.mkdir('lmbl') coor = os.path.join(cwd+ '/coordinates/') lmbl = os.path.join(cwd+ '/lmbl/') os.chdir(...
[ 1, 529, 9507, 29958, 21457, 2204, 29918, 7915, 29889, 2272, 13, 5215, 2897, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 5215, 528, 4422, 13, 29883, 9970, 353, 2897, 29889, 657, 29883, 9970, 580, 13, 9675, 978, 353, 28...
znfTruth/renameNewick.py
joelarmstrong/treeBuildingEvaluation
0
173168
<reponame>joelarmstrong/treeBuildingEvaluation #!/usr/bin/env python import sys from sonLib.bioio import fastaRead from sonLib.nxnewick import NXNewick from sonLib.nxtree import NXTree import networkx as nx def induceTreeOnLeaves(nxtree, leaves): leaves = set(leaves) dg = nxtree.nxDg nodesToKeep = [] f...
[ 1, 529, 276, 1112, 420, 29958, 2212, 295, 2817, 1110, 29914, 8336, 8893, 292, 29923, 4387, 362, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 5215, 10876, 13, 3166, 1487, 14868, 29889, 24840, 601, 1053, 5172, 29874, 6359, ...
Python/prova/fibro 2.py
marcelosilva7/Primeiro-repositorio
0
84341
t1 = 0 t2 = 1 print(f'{t1} -> {t2} -> ', end='') for c in range(1, 21): t3 = t1 + t2 print(f'{t3} -> ', end='') t1 = t2 t2 = t3 print('FIM', end='')
[ 1, 260, 29896, 353, 29871, 29900, 30004, 13, 29873, 29906, 353, 29871, 29896, 30004, 13, 2158, 29898, 29888, 29915, 29912, 29873, 29896, 29913, 1599, 426, 29873, 29906, 29913, 1599, 13420, 1095, 2433, 1495, 30004, 13, 1454, 274, 297, 3464, ...
builder_engine/custom_components/__init__.py
DiablosWhisper/machine_learning_toolpack
0
166672
<reponame>DiablosWhisper/machine_learning_toolpack<filename>builder_engine/custom_components/__init__.py from .optimizers import * from .callbacks import * from .metrics import * from .losses import * from .layers import *
[ 1, 529, 276, 1112, 420, 29958, 12130, 370, 5409, 8809, 275, 546, 29914, 23523, 29918, 21891, 29918, 10154, 4058, 29966, 9507, 29958, 16409, 29918, 10599, 29914, 6341, 29918, 14036, 29914, 1649, 2344, 26914, 2272, 13, 3166, 869, 20640, 19427...
web/migrations/0007_auto_20180824_0925.py
zinaukarenku/zkr-platform
2
7360
<filename>web/migrations/0007_auto_20180824_0925.py<gh_stars>1-10 # Generated by Django 2.1 on 2018-08-24 09:25 from django.db import migrations, models import web.models class Migration(migrations.Migration): dependencies = [ ('web', '0006_organizationmember_user'), ] operations = [ mi...
[ 1, 529, 9507, 29958, 2676, 29914, 26983, 800, 29914, 29900, 29900, 29900, 29955, 29918, 6921, 29918, 29906, 29900, 29896, 29947, 29900, 29947, 29906, 29946, 29918, 29900, 29929, 29906, 29945, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, ...
AsRoot/app/views.py
erin-hughes/qradar-sample-apps
8
25383
<reponame>erin-hughes/qradar-sample-apps # Copyright 2020 IBM Corporation # # 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 require...
[ 1, 529, 276, 1112, 420, 29958, 261, 262, 29899, 29882, 6129, 267, 29914, 29939, 3665, 279, 29899, 11249, 29899, 13371, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29900, 27955, 15025, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, ...
aztk/spark/models/plugins/spark_ui_proxy/configuration.py
Geims83/aztk
161
52316
import os from aztk.models.plugins.plugin_configuration import PluginConfiguration, PluginPort, PluginTargetRole from aztk.models.plugins.plugin_file import PluginFile dir_path = os.path.dirname(os.path.realpath(__file__)) class SparkUIProxyPlugin(PluginConfiguration): def __init__(self): super().__init_...
[ 1, 1053, 2897, 13, 3166, 263, 2065, 29895, 29889, 9794, 29889, 12800, 29889, 8582, 29918, 13305, 1053, 1858, 3851, 8614, 29892, 1858, 3851, 2290, 29892, 1858, 3851, 8667, 16727, 13, 3166, 263, 2065, 29895, 29889, 9794, 29889, 12800, 29889, ...
tests/test_fetcher.py
someshchaturvedi/reference-sequence-fetcher
0
165218
from reference_sequence_fetcher.fetcher import Fetcher, handle_error import pytest import json class MockResponse(object): ''' Mock object to test handle_error function in test_handle_error_function. It mocks the functionality of Response object from requests library ''' def __init__(self, status_...
[ 1, 515, 3407, 29918, 16506, 29918, 9155, 261, 29889, 9155, 261, 1053, 383, 3486, 261, 29892, 4386, 29918, 2704, 13, 5215, 11451, 1688, 13, 5215, 4390, 13, 13, 13, 1990, 26297, 5103, 29898, 3318, 1125, 13, 1678, 14550, 13, 1678, 26297, ...
autotest/t056_test_pcg_fmt.py
ritchie46/flopy
1
1608378
<reponame>ritchie46/flopy # -*- coding: utf-8 -*- """ This simple script tests that the pcg load function works for both free- and fixed-format pcg files for mf2005 models. Refer to pull request #311: "Except block to forgive old fixed format pcg for post-mf2k model versions" for more details. """ import os import fl...
[ 1, 529, 276, 1112, 420, 29958, 768, 305, 347, 29946, 29953, 29914, 29888, 417, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 4013, 2560, 2471, 6987, 393, 278, 22844, 29887,...