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
fastGraph/__main__.py
AngusKung/fastGraph
0
62246
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import sys import random import psutil import logging import pandas as pd import numpy as np from io import open from collections import Counter from multiprocessing import cpu_count from concurrent.futures import ProcessPoolExecutor from scipy.sparse import csr...
[ 1, 396, 29991, 847, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 4036, 13, 5215, 6529, 4422, 13, 5215, 12183, 13...
CodeChef/CENS20D.py
PROxZIMA/Competitive-Coding
1
82881
# https://www.codechef.com/viewsolution/36973732 for _ in range(int(input())): n = int(input()) a = list(map(int, input().split())) count = 0 for i in range(n): for j in range(i + 1, n): if a[i] & a[j] == a[i]: count += 1 print(count)
[ 1, 396, 2045, 597, 1636, 29889, 401, 1173, 29888, 29889, 510, 29914, 1493, 2929, 918, 29914, 29941, 29953, 29929, 29955, 29941, 29955, 29941, 29906, 13, 13, 1454, 903, 297, 3464, 29898, 524, 29898, 2080, 22130, 29901, 13, 1678, 302, 353, ...
mycode/test03.py
JamesWang007/kitti_object_vis
0
191401
import torch import numpy as np import _init_path import numpy as np import os import torch import torch.nn as nn import torch.optim as optim import torch.optim.lr_scheduler as lr_sched from torch.nn.utils import clip_grad_norm_ from torch.utils.data import DataLoader import tensorboard_logger as tb_log from dataset i...
[ 1, 1053, 4842, 305, 13, 5215, 12655, 408, 7442, 13, 13, 5215, 903, 2344, 29918, 2084, 13, 5215, 12655, 408, 7442, 13, 5215, 2897, 13, 5215, 4842, 305, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 5215, 4842, 305, 29889, 2...
displ/queue/internal.py
tflovorn/displ
4
1604844
<filename>displ/queue/internal.py<gh_stars>1-10 import os import subprocess from displ.queue.queuefile import get_qf_path from displ.queue.queue_util import global_config def enqueue(config): # Assumes appropriate queufile already exists. # (allow for queuefile to be written and examined before enqueuing) ...
[ 1, 529, 9507, 29958, 2218, 572, 29914, 9990, 29914, 7564, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 2897, 13, 5215, 1014, 5014, 13, 3166, 766, 572, 29889, 9990, 29889, 9990, 1445, 1053, 679,...
hyperparam_optim_mask_rcnn.py
branislav1991/MicroscopyUNet
1
53324
<gh_stars>1-10 import os from sys import float_info from hyperopt import fmin, tpe, hp from train_mask_rcnn import train_mask_rcnn, CHECKPOINT_DIR import pickle import math from keras import backend as K train_path="./data/stage1_train/" val_path="./data/stage1_val/" train_ids = next(os.walk(train_path)) ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 2897, 30004, 13, 3166, 10876, 1053, 5785, 29918, 3888, 30004, 13, 3166, 11266, 3670, 1053, 285, 1195, 29892, 260, 412, 29892, 298, 29886, 30004, 13, 3166, 7945,...
BOT-DEMO/MoLFI_demo.py
Pad0y/logparser
0
67246
<reponame>Pad0y/logparser #!/usr/bin/env python import sys sys.path.append("../") from logparser import MoLFI import pandas as pd input_dir = "../logs/HDFS/" # The input directory of log file output_dir = "MoLFI_result/" # The output directory of parsing results log_file = "HDFS_2k.log" # The input log file name l...
[ 1, 529, 276, 1112, 420, 29958, 20369, 29900, 29891, 29914, 1188, 16680, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 5215, 10876, 13, 13, 9675, 29889, 2084, 29889, 4397, 703, 6995, 1159, 13, 3166, 1480, 16680, 1053, 4546, ...
mysign_app/migrations/0002_add_is_admin.py
mindhashnl/roomsignage
0
162951
# Generated by Django 2.2.5 on 2019-09-24 09:16 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mysign_app', '0001_initial'), ] operations = [ migrations.AddField( model_name='user', ...
[ 1, 396, 3251, 630, 491, 15337, 29871, 29906, 29889, 29906, 29889, 29945, 373, 29871, 29906, 29900, 29896, 29929, 29899, 29900, 29929, 29899, 29906, 29946, 29871, 29900, 29929, 29901, 29896, 29953, 13, 13, 5215, 9557, 29889, 2585, 29889, 9794,...
Beta/Longest Subarray with Maximum Average Value.py
mwk0408/codewars_solutions
6
165524
<reponame>mwk0408/codewars_solutions def solve(arr, k): cur=float("-inf") ans=tuple() total=sum(arr) for i in range(len(arr), k-1, -1): temp=compute(arr, total, i) if temp[0]>cur: cur=temp[0] ans=(temp[1], i) total-=arr[i-1] return ans def compute(arr,...
[ 1, 529, 276, 1112, 420, 29958, 29885, 29893, 29895, 29900, 29946, 29900, 29947, 29914, 401, 29893, 1503, 29918, 2929, 17925, 13, 1753, 4505, 29898, 2749, 29892, 413, 1125, 13, 1678, 3151, 29922, 7411, 703, 29899, 7192, 1159, 13, 1678, 606...
networking/connection/stun_client.py
bcgrendel/python_networking
0
8551
<reponame>bcgrendel/python_networking import socket import sys import traceback import struct import threading; from threading import Thread; import time; import datetime; import json #import buffered_message; import hashlib from Crypto.PublicKey import RSA from connection_state import ConnectionState # publickey = RSA...
[ 1, 529, 276, 1112, 420, 29958, 12328, 629, 355, 295, 29914, 4691, 29918, 11618, 292, 13, 5215, 9909, 13, 5215, 10876, 13, 5215, 9637, 1627, 13, 5215, 2281, 13, 5215, 3244, 292, 29936, 13, 3166, 3244, 292, 1053, 10480, 29936, 13, 5215,...
src/lamdas/segment-delete/segment_delete.py
aws-samples/amazon-pinpoint-segment-campaign-automation
3
99282
import logging import os import time import boto3 client = boto3.client("pinpoint") def lambda_handler(event, context): log_level = str(os.environ.get("LOG_LEVEL")).upper() if log_level not in ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]: log_level = "ERROR" logging.getLogger().setLevel(log...
[ 1, 1053, 12183, 13, 5215, 2897, 13, 5215, 931, 13, 13, 5215, 289, 3747, 29941, 13, 13, 4645, 353, 289, 3747, 29941, 29889, 4645, 703, 12687, 3149, 1159, 13, 13, 13, 1753, 14013, 29918, 13789, 29898, 3696, 29892, 3030, 1125, 13, 1678, ...
ConfManager/models/interfaces.py
cygerior/LabManager
0
144115
<filename>ConfManager/models/interfaces.py from django.db import models from polymorphic.models import PolymorphicModel class Interface(PolymorphicModel): name = models.CharField(max_length=30, unique=True) def __str__(self): return self.name class NetworkInterface(Interface): mac_address = mod...
[ 1, 529, 9507, 29958, 16376, 3260, 29914, 9794, 29914, 1639, 8726, 29889, 2272, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 3166, 24324, 5676, 293, 29889, 9794, 1053, 2043, 962, 5676, 293, 3195, 13, 13, 13, 1990, 25796, 29898, 7713, 962...
galaxydb/__init__.py
alantelles/galaxydb
2
33394
<gh_stars>1-10 from galaxydb.column import Column from galaxydb.scheme import Scheme from galaxydb.logic import Logic from galaxydb.table import Table from galaxydb.constants import * from galaxydb.statics import *
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 15400, 29891, 2585, 29889, 4914, 1053, 12481, 30004, 13, 3166, 15400, 29891, 2585, 29889, 816, 2004, 1053, 1102, 2004, 30004, 13, 3166, 15400, 29891, 2585, 29889,...
pravash/createincident.py
amvasudeva/rapidata
0
140792
#! /usr/bin/python #Need to install requests package for python #sudo easy_install requests import requests # Set the request parameters url = 'https://wiprodemo.service-now.com/api/now/table/incident' user = 'Default' pwd = '<PASSWORD>' # Set proper headers headers = {"Content-Type":"application/json","Accept":"...
[ 1, 396, 29991, 847, 4855, 29914, 2109, 29914, 4691, 13, 29937, 8139, 287, 304, 2601, 7274, 3577, 363, 3017, 13, 29937, 15360, 4780, 29918, 6252, 7274, 13, 5215, 7274, 13, 29871, 13, 396, 3789, 278, 2009, 4128, 13, 2271, 353, 525, 991,...
scraper/functions/progress_bar.py
cordeirossauro/iw-scraper
0
138976
<reponame>cordeirossauro/iw-scraper import math class ProgressBar: def __init__(self, total_steps, bar_size, message, current_step = 1): self.total_steps = total_steps self.current_step = current_step self.bar_size = bar_size self.message = message def print_bar(self): ...
[ 1, 529, 276, 1112, 420, 29958, 2616, 311, 29875, 2124, 585, 307, 29914, 9429, 29899, 1557, 336, 546, 13, 5215, 5844, 13, 13, 13, 1990, 20018, 4297, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3001, 29918, 24530, 29892, 2594, ...
backend/src/baserow/contrib/database/migrations/0007_datefield.py
cjh0613/baserow
839
156947
# Generated by Django 2.2.11 on 2020-05-26 10:23 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('database', '0006_auto_20200522_1329'), ] operations = [ migrations.CreateModel( name='DateFiel...
[ 1, 396, 3251, 630, 491, 15337, 29871, 29906, 29889, 29906, 29889, 29896, 29896, 373, 29871, 29906, 29900, 29906, 29900, 29899, 29900, 29945, 29899, 29906, 29953, 29871, 29896, 29900, 29901, 29906, 29941, 13, 13, 3166, 9557, 29889, 2585, 1053,...
open_spiel/python/algorithms/psro_v2/rl_policy.py
julianstastny/open_spiel
0
76210
# Copyright 2019 DeepMind Technologies Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29896, 29929, 21784, 29924, 513, 8364, 11763, 19806, 29889, 2178, 10462, 21676, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552,...
optimetry/zoo/ggt.py
optimetry/optimetry
2
119856
<reponame>optimetry/optimetry<filename>optimetry/zoo/ggt.py """GGT optimizer: an efficient full-matrix adaptive gradient method. """ import math import torch class GGT(torch.optim.Optimizer): """GGT full-matrix adaptive optimizer. Uses GPU-friendly operations for applying pseudoinverse powers of a low-rank Gr...
[ 1, 529, 276, 1112, 420, 29958, 3670, 17528, 719, 29914, 3670, 17528, 719, 29966, 9507, 29958, 3670, 17528, 719, 29914, 2502, 29877, 29914, 1505, 29873, 29889, 2272, 13, 15945, 29908, 29954, 23799, 5994, 3950, 29901, 385, 8543, 2989, 29899, ...
client/data/email_builder.py
jurandirjdsilva/pycryptomail
1
141702
<reponame>jurandirjdsilva/pycryptomail<filename>client/data/email_builder.py class EmailBuilder: def __init__(self): self.message = {} def set_from_email(self, email): self.message['from'] = email return self def set_receiver_email(self, email): self.message['receiver'] = e...
[ 1, 529, 276, 1112, 420, 29958, 29926, 332, 392, 381, 29926, 6289, 309, 1564, 29914, 2272, 29883, 4641, 290, 737, 29966, 9507, 29958, 4645, 29914, 1272, 29914, 5269, 29918, 16409, 29889, 2272, 13, 1990, 22608, 5627, 29901, 13, 1678, 822, ...
hmmlearn/tests/test_hmm.py
paschalidoud/hmmlearn
0
133809
from __future__ import print_function from unittest import TestCase import numpy as np from nose import SkipTest from numpy.testing import assert_array_equal, assert_array_almost_equal from sklearn.datasets.samples_generator import make_spd_matrix from sklearn.mixture import GMM from sklearn.utils import check_random...
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 13, 3166, 443, 27958, 1053, 4321, 8259, 13, 13, 5215, 12655, 408, 7442, 13, 3166, 26414, 1053, 4971, 666, 3057, 13, 3166, 12655, 29889, 13424, 1053, 4974, 29918, 2378, 29918,...
classifier/vec/get_embedding_matrix.py
banboooo044/natural-language-sentiment-anaysis
0
186126
<reponame>banboooo044/natural-language-sentiment-anaysis # Word2vec, Fasttext の単語分散表現から文章分散表現を取得 ## 学習済みモデルをそのまま使う場合: ## word2vec : python3 get_embedding_matrix word2vec ## fasttext : python3 get_embedding_matrix fasttext ## fasttext+neologd : python3 get_embedding_matrix fasttext-neologd ## 自分で学習した [filename].model ...
[ 1, 529, 276, 1112, 420, 29958, 2571, 833, 3634, 29877, 29900, 29946, 29946, 29914, 25047, 29899, 11675, 29899, 18616, 2073, 29899, 273, 1036, 275, 13, 29937, 10803, 29906, 2003, 29892, 23786, 726, 29871, 30199, 232, 144, 155, 30968, 30748, ...
one_point_stats/stats/noise.py
piyanatk/one_point_stats
0
165997
import numpy as np from scipy.stats import skew, kurtosis __all__ = ['sky_noise_error', 'propagate_noise_error', 'mcnoise'] def sky_noise_error(nu_obs, nu_emit, nu_ch_bw, tint, a_eff, n_station, bmax): """Calculate instrument noise error of an interferometer. This assume that Tsys is dominated by Tsky. ...
[ 1, 1053, 12655, 408, 7442, 13, 3166, 4560, 2272, 29889, 16202, 1053, 18109, 29893, 29892, 413, 4227, 19263, 13, 13, 1649, 497, 1649, 353, 6024, 7912, 29918, 1217, 895, 29918, 2704, 742, 525, 7728, 351, 403, 29918, 1217, 895, 29918, 2704...
data/2019-11-28/openml-datasets-single-column/plot_features_versus_target.py
VIDA-NYU/prida
1
1604003
''' This script gets a file with metadata, learning features, and target values for each line, and plots different features against the target. ''' FEATURE_NAMES = ['query_num_of_columns','query_num_of_rows','query_row_column_ratio','query_max_mean','query_max_outlier_percentage','query_max_skewness','query_max_kurt...
[ 1, 14550, 13, 4013, 2471, 4947, 263, 934, 411, 15562, 29892, 6509, 5680, 29892, 322, 3646, 29871, 13, 5975, 363, 1269, 1196, 29892, 322, 24580, 1422, 5680, 2750, 278, 3646, 29889, 13, 13, 12008, 13, 13, 16359, 1299, 11499, 29918, 5813, ...
algorithms/aiAlgorithms/cnn/cnn_facial_recognition.py
bigfoolliu/liu_aistuff
1
46137
<reponame>bigfoolliu/liu_aistuff<filename>algorithms/aiAlgorithms/cnn/cnn_facial_recognition.py<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding:utf-8 -*- # author: bigfoolliu # TODO: not finished. """ fer2013.csv文件内容 - emotion,pixels,Usage - pixels为48*48的像素值 """ import string, os, sys import numpy as np import mat...
[ 1, 529, 276, 1112, 420, 29958, 3752, 1181, 324, 492, 29884, 29914, 492, 29884, 29918, 29874, 391, 3096, 29966, 9507, 29958, 9564, 12404, 29914, 1794, 22461, 12404, 29914, 29883, 15755, 29914, 29883, 15755, 29918, 5444, 1455, 29918, 29423, 6...
Reconocimiento/Prueba1lidarchidovibr.py
larj3852/Lidar_TT
0
58320
# -*- coding: utf-8 -*- """ ... """ import LibraryTT.txt2array as conversion import numpy as np from numpy import sqrt import pandas as pd import matplotlib.pyplot as plt import random import math from mpl_toolkits.mplot3d import Axes3D # import open3d as o3d # %matplotlib inline D = conversion.txt2...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 30004, 13, 15945, 19451, 13, 856, 30004, 13, 15945, 19451, 13, 30004, 13, 5215, 9538, 19988, 29889, 3945, 29906, 2378, 408, 11301, 30004, 13, 5215, 12655, 40...
resource/pypi/cryptography-1.7.1/tests/hazmat/primitives/test_keywrap.py
hipnusleo/Laserjet
0
196972
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import binascii import os import pytest from cryptography.ha...
[ 1, 396, 910, 934, 338, 14581, 7794, 21144, 1090, 278, 4958, 310, 278, 13380, 19245, 29892, 10079, 30004, 13, 29937, 29871, 29906, 29889, 29900, 29892, 322, 278, 350, 7230, 19245, 29889, 2823, 278, 365, 2965, 1430, 1660, 934, 297, 278, 3...
contact_PPO.py
ZhaomingXie/RLAlg
0
1609445
import argparse import os import sys import random import numpy as np import scipy import torch import torch.optim as optim import torch.multiprocessing as mp import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torch.utils.data from params import Params import pickle impo...
[ 1, 1053, 1852, 5510, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 4036, 13, 5215, 12655, 408, 7442, 13, 5215, 4560, 2272, 13, 13, 5215, 4842, 305, 13, 5215, 4842, 305, 29889, 20640, 408, 5994, 13, 5215, 4842, 305, 29889, 18056, 307, 9...
tests/filterbanks/stft_test.py
michelolzam/asteroid
1
141575
<reponame>michelolzam/asteroid import pytest import torch from torch import testing import numpy as np from scipy.signal import get_window from asteroid.filterbanks import Encoder, Decoder, STFTFB from asteroid.filterbanks import make_enc_dec, griffin_lim, misi from asteroid.filterbanks.stft_fb import perfect_synthesi...
[ 1, 529, 276, 1112, 420, 29958, 29885, 436, 295, 324, 29920, 314, 29914, 1901, 3398, 13, 5215, 11451, 1688, 13, 5215, 4842, 305, 13, 3166, 4842, 305, 1053, 6724, 13, 5215, 12655, 408, 7442, 13, 3166, 4560, 2272, 29889, 25436, 1053, 679...
WORC/plotting/plot_barchart.py
MStarmans91/WORC
47
104525
#!/usr/bin/env python # Copyright 2016-2019 Biomedical Imaging Group Rotterdam, Departments of # Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29953, 29899, 29906, 29900, 29896, 29929, 3457, 27067, 936, 1954, 6751, 6431, 9664, 357, 16846, 29892, 23242, 1860, 310, 13, 29937, 2079...
sshpipe/sshpipe/bin/sshpipe_socket_handler.py
Acrisel/sshpipe
0
117576
#!/usr/bin/env python3 ''' Created on Oct 18, 2017 @author: arnon ''' from sshpipe import SSHPipeHandler import logging from logging.handlers import SocketHandler import pickle import struct mlogger = logging.getLogger(__file__) class SSHPipeSocketHandler(SSHPipeHandler, SocketHandler): ''' SSHPipeSocketHandle...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 12008, 13, 20399, 373, 4756, 29871, 29896, 29947, 29892, 29871, 29906, 29900, 29896, 29955, 13, 13, 29992, 8921, 29901, 564, 5464, 13, 12008, 13, 13, 3166, 13927, 17760, 1053, 588...
app/schemas/card_serealize.py
Suspir0n/Care-API
1
90834
from ..settings.config import ma class CardSchema(ma.Schema): class Meta: fields = ('uid', 'active', 'deleted', 'createAt', 'updateAt', 'num_card', 'name', 'date_valid', 'cod_security') card_schema = CardSchema() cards_schema = CardSchema(many=True)
[ 1, 515, 6317, 11027, 29889, 2917, 1053, 611, 13, 13, 13, 1990, 9160, 12763, 29898, 655, 29889, 12763, 1125, 13, 1678, 770, 20553, 29901, 13, 4706, 4235, 353, 6702, 5416, 742, 525, 4925, 742, 525, 311, 22742, 742, 525, 3258, 4178, 742,...
asq/test/test_to_set.py
sixty-north/asq
175
89007
import unittest from asq.queryables import Queryable __author__ = "<NAME>" class TestToSet(unittest.TestCase): def test_to_set(self): a = [1, 2, 4, 8, 16, 32] b = Queryable(a).to_set() c = set([1, 2, 4, 8, 16, 32]) self.assertEqual(b, c) def test_to_set_closed(self): ...
[ 1, 1053, 443, 27958, 13, 3166, 408, 29939, 29889, 1972, 1849, 1053, 13641, 519, 13, 13, 1649, 8921, 1649, 353, 9872, 5813, 11903, 13, 13, 1990, 4321, 1762, 2697, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 13, 1678, 822, 1243, 299...
axonius_api_client/cli/grp_system/__init__.py
rwils83/axonius_api_client
0
165934
# -*- coding: utf-8 -*- """Command line interface for Axonius API Client.""" import click from ..context import AliasedGroup from . import ( grp_central_core, grp_discover, grp_meta, grp_nodes, grp_roles, grp_settings, grp_users, ) @click.group(cls=AliasedGroup) def system(): """Group...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 6255, 1196, 5067, 363, 22523, 265, 2482, 3450, 12477, 1213, 15945, 13, 5215, 2828, 13, 13, 3166, 6317, 4703, 1053, 10785, 1463, 4782, 13, ...
examples/widget_demo.py
PBLab/magicgui
0
137704
"""Widget demonstration of magicgui.""" import datetime from enum import Enum from pathlib import Path from magicgui import magicgui class Medium(Enum): """Enum for various media and their refractive indices.""" Glass = 1.520 Oil = 1.515 Water = 1.333 Air = 1.0003 @magicgui( main_window=T...
[ 1, 9995, 8801, 9004, 362, 310, 15709, 23569, 1213, 15945, 13, 13, 5215, 12865, 13, 3166, 14115, 1053, 1174, 398, 13, 3166, 2224, 1982, 1053, 10802, 13, 13, 3166, 15709, 23569, 1053, 15709, 23569, 13, 13, 13, 1990, 3436, 1974, 29898, 1...
python/lib/path/dijkstra_dense.py
KATO-Hiro/atcoder-1
0
1600733
"""<https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm>""" import sys import numba as nb import numpy as np input = sys.stdin.readline # Dijkstra algorithm without priority queue (this is slow for sparse graphs) @nb.njit("i8[:](i8,i8[:,:],i8,i8)", cache=True) def dijkstra(V, G, s, INF): # Shortest path from v...
[ 1, 9995, 29966, 991, 597, 264, 29889, 6011, 29889, 990, 29914, 4594, 29914, 29928, 13535, 4151, 29995, 29906, 29955, 29879, 29918, 20567, 11903, 15945, 13, 5215, 10876, 13, 13, 5215, 954, 2291, 408, 302, 29890, 13, 5215, 12655, 408, 7442,...
exercicios/Lista1/Q27.py
AlexandrePeBrito/CursoUdemyPython
0
1601996
<gh_stars>0 #Leia um valor de area em hectares e apresente-o convertido em metros quadrados. #a formula de conversao eh: M=H*10000 #sendo M a area em metros quadrado e H area em hectaries h=float(input("Informe a area em hectares: ")) m=h*10000 print(f"A area convertida em metros quadrados eh {round(m,2)}")
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 3226, 423, 1922, 16497, 316, 4038, 953, 28834, 5114, 321, 24677, 29872, 29899, 29877, 3588, 1941, 953, 24086, 15448, 2255, 29889, 13, 29937, 29874, 7063, 316, 9678, 6241, 321, 2988...
lyrics_crawler_single/lyric_spider.py
Tauranis/lyrics-crawler
0
86147
<gh_stars>0 import scrapy import logging logging.basicConfig() logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) try: from lyrics_crawler_single.constants import ( OUTPUT_FILE, ) except: from constants import OUTPUT_FILE class LyricsSpider(scrapy.Spider): name = "lyrics" ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 24559, 2272, 13, 13, 5215, 12183, 13, 13, 21027, 29889, 16121, 3991, 580, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 21707, 29889, 842, 10108, 29898, 2...
silx/gui/plot/actions/control.py
linupi/silx
2
1608287
<gh_stars>1-10 # coding: utf-8 # /*########################################################################## # # Copyright (c) 2004-2019 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "S...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 29937, 4949, 13383, 13383, 13383, 13383, 7346, 2277, 13, 29937, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 2...
Configuration/StandardSequences/python/RawToDigi_Repacked_cff.py
nistefan/cmssw
0
165674
import FWCore.ParameterSet.Config as cms from Configuration.StandardSequences.RawToDigi_cff import * scalersRawToDigi.scalersInputTag = 'rawDataRepacker' csctfDigis.producer = 'rawDataRepacker' dttfDigis.DTTF_FED_Source = 'rawDataRepacker' gctDigis.inputLabel = 'rawDataRepacker' gtDigis.DaqGtInputTag = 'rawDataRepack...
[ 1, 1053, 383, 29956, 9203, 29889, 9329, 2697, 29889, 3991, 408, 274, 1516, 13, 13, 3166, 20999, 29889, 15449, 16941, 2063, 29889, 22131, 1762, 29928, 10091, 29918, 29883, 600, 1053, 334, 13, 13, 19529, 414, 22131, 1762, 29928, 10091, 2988...
boards/apollo2_evb/examples/multi_boot_secure_sample/generate_secureboot_assets.py
wher0001/AmbiqSuiteSDK
25
97958
#!/usr/bin/env python3 import argparse import sys import os # This key table has to match the one in bootloader keyTbl = [0xDEADBEEF, 0xAAAAAAAA, 0x11111111, 0x00000000, 0xFFFFFFFF, 0x55555555, 0xA5A5A5A5, 0x66666666] #****************************************************************************** # # Main function #...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 1852, 5510, 13, 5215, 10876, 13, 5215, 2897, 13, 13, 29937, 910, 1820, 1591, 756, 304, 1993, 278, 697, 297, 6579, 12657, 13, 1989, 29911, 2204, 353, 518, 29900, 2991...
riseofsavior.py
aimogue/Adventure-game---Rise-of-Savior
2
127973
import sys import os import time import random import keyboard from console.screen import sc from rich.console import Console mythical_creature_list = None male_name_list = None both_sex_name_list = None name_of_queen = None weapon_type_list = None your_weapon_type = None name_of_trainer = None ...
[ 1, 1053, 10876, 30004, 13, 5215, 2897, 30004, 13, 5215, 931, 30004, 13, 5215, 4036, 30004, 13, 5215, 12247, 30004, 13, 3166, 2991, 29889, 10525, 1053, 885, 30004, 13, 3166, 8261, 29889, 11058, 1053, 9405, 30004, 13, 30004, 13, 30004, 13...
qiskit/transpiler/passes/optimization/optimize_1q_decomposition.py
rao107/qiskit-terra
0
196132
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
[ 1, 396, 910, 775, 338, 760, 310, 660, 3873, 277, 29889, 13, 29937, 13, 29937, 313, 29907, 29897, 14187, 1266, 27955, 29871, 29906, 29900, 29896, 29955, 29892, 29871, 29906, 29900, 29896, 29947, 29889, 13, 29937, 13, 29937, 910, 775, 338, ...
sdk/python/pulumi_gcp/compute/region_instance_group_manager.py
sisisin/pulumi-gcp
121
42004
<filename>sdk/python/pulumi_gcp/compute/region_instance_group_manager.py<gh_stars>100-1000 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi....
[ 1, 529, 9507, 29958, 15348, 29914, 4691, 29914, 29886, 352, 15547, 29918, 29887, 6814, 29914, 26017, 29914, 12803, 29918, 8758, 29918, 2972, 29918, 12847, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, ...
resource/pypi/cffi-1.9.1/demo/api.py
hipnusleo/Laserjet
0
67486
<gh_stars>0 import cffi from cffi import FFI class PythonFFI(FFI): def __init__(self, backend=None): FFI.__init__(self, backend=backend) self._pyexports = {} def pyexport(self, signature): tp = self._typeof(signature, consider_function_as_funcptr=True) def decorator...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 274, 600, 29875, 30004, 13, 3166, 274, 600, 29875, 1053, 383, 3738, 30004, 13, 30004, 13, 1990, 5132, 29943, 3738, 29898, 29943, 3738, 1125, 30004, 13, 30004, 13, 1678, 822, 4770,...
ReLERNN/imports.py
peterdfields/ReLERNN
14
40829
import glob import pickle import sys import msprime as msp import numpy as np import os import multiprocessing as mp import shutil import random import copy import argparse import h5py import allel import time from sklearn.neighbors import NearestNeighbors from sklearn.utils import resample import matplotlib as mpl m...
[ 1, 1053, 13149, 13, 5215, 5839, 280, 13, 5215, 10876, 13, 5215, 10887, 10080, 408, 286, 1028, 13, 5215, 12655, 408, 7442, 13, 5215, 2897, 13, 5215, 6674, 307, 985, 292, 408, 22326, 13, 5215, 528, 4422, 13, 5215, 4036, 13, 5215, 3509...
get_episodes.py
sam-drew/random-episodes
0
157092
<gh_stars>0 from selenium import webdriver import time def log_id(ID): f = open("IDs.txt", "a") f.write((str((ID + "\n")))) f.close() print("Logging ID: " + ID) def strip_id(url): splitString = url.rsplit("?", 1) splitString = splitString[0].rsplit("/") ep_id = splitString[len(splitString)...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 18866, 1053, 1856, 9465, 13, 5215, 931, 13, 13, 1753, 1480, 29918, 333, 29898, 1367, 1125, 13, 1678, 285, 353, 1722, 703, 1367, 29879, 29889, 3945, 613, 376, 29874, 1159, 13, 16...
lesson7/exercise1b.py
mfeindt0705/pynetmf
0
186628
#!/usr/bin/nv python3 from lxml import etree f = open("show_security_zones.xml") lines = f.read() my_xml = etree.fromstring(lines) bstring = etree.tostring(my_xml) print(bstring.decode())
[ 1, 18787, 4855, 29914, 2109, 29914, 29876, 29894, 3017, 29941, 13, 13, 13, 3166, 301, 3134, 1053, 634, 929, 13, 13, 29888, 353, 1722, 703, 4294, 29918, 8926, 29918, 29920, 2873, 29889, 3134, 1159, 13, 13, 9012, 353, 285, 29889, 949, 5...
flaskbb/utils/helpers.py
konstantin1985/forum
0
114305
<filename>flaskbb/utils/helpers.py # -*- coding: utf-8 -*- """ flaskbb.utils.helpers ~~~~~~~~~~~~~~~~~~~~ A few helpers that are used by flaskbb :copyright: (c) 2014 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ import re import time import itertools import operator import ...
[ 1, 529, 9507, 29958, 1579, 1278, 1327, 29914, 13239, 29914, 3952, 6774, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 1678, 29784, 1327, 29889, 13239, 29889, 3952, 677...
students/k3343/laboratory_works/Berezhnova_Marina/laboratory_work_1/django_project_flights/flights_app/models.py
TonikX/ITMO_ICT_-WebProgramming_2020
10
25183
<gh_stars>1-10 from django.db import models from django.contrib.auth.models import User # Create your models here. class Companies(models.Model): name = models.CharField(max_length=30) def __str__(self): return "{}".format(self.name) class Gates(models.Model): name = models.CharField(max_length=...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 4911, 13, 13, 29937, 6204, 596, 4733, 1244, 29889, 13, 1990, 3831, ...
flextensor/testing/others/hand-craft/tune_conv2d_NCHWc.py
jcf94/FlexTensor
4
98761
<gh_stars>1-10 from __future__ import absolute_import import time import json import tvm from flextensor.task import register_task, Task from flextensor.measure import _evaluate from flextensor.nn import conv2d_nchwc from flextensor.configs.conv2d_config import yolo_shapes_b1 from flextensor.scheduler import schedule,...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 13, 5215, 931, 13, 5215, 4390, 13, 5215, 260, 6925, 13, 3166, 9115, 486, 6073, 29889, 7662, 1053, 6036, ...
tests/pytests/test_tags.py
wayn111/RediSearch
0
2914
<filename>tests/pytests/test_tags.py # -*- coding: utf-8 -*- from includes import * from common import * def search(env, r, *args): return r.execute_command('ft.search', *args) def testTagIndex(env): r = env env.expect('ft.create', 'idx', 'ON', 'HASH','schema', 'title', 'text', 'tags', 'tag').ok() N ...
[ 1, 529, 9507, 29958, 21150, 29914, 2272, 21150, 29914, 1688, 29918, 11338, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 7805, 1053, 334, 13, 3166, 3619, 1053, 334, 13, 13, ...
scrips/rename.py
YingqiLiulll/scrips_for_SR
0
94939
import numpy as np import os from skimage import io path = r'/data1/zyli/benchmark/Set5/LR_bicubic/X4/' img_path = sorted([os.path.join(path, name) for name in os.listdir(path) if name.endswith('.png')])###这里的'.tif'可以换成任意的文件后缀 for i in range(len(img_path)): img_name = img_path[i] print(img_name) name = im...
[ 1, 29871, 13, 5215, 12655, 408, 7442, 13, 5215, 2897, 13, 3166, 2071, 3027, 1053, 12013, 13, 13, 2084, 353, 364, 29915, 29914, 1272, 29896, 29914, 1537, 492, 29914, 1785, 16580, 29914, 2697, 29945, 29914, 29519, 29918, 29890, 293, 431, ...
monitor_sdk/api/translate/translate_client.py
easyopsapis/easyops-api-python
5
130973
# -*- coding: utf-8 -*- import os import sys import monitor_sdk.api.translate.list_translate_data_pb2 import monitor_sdk.api.translate.list_translate_rule_pb2 import monitor_sdk.utils.http_util import google.protobuf.json_format class TranslateClient(object): def __init__(self, server_ip="", server_port=0, se...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 13, 5215, 11819, 29918, 15348, 29889, 2754, 29889, 21652, 29889, 1761, 29918, 21652, 29918, 1272, 29918, 24381, 29906,...
problem_49/test_prime_permutations.py
plilja/project-euler
0
34913
<filename>problem_49/test_prime_permutations.py import unittest from prime_permutations import * class PrimePermutationsTest(unittest.TestCase): def test_prime_permutations(self): self.assertEqual(sorted(prime_permutations()), sorted([2969, 6299, 9629])) if __name__ == '__main__': unittest.main()
[ 1, 529, 9507, 29958, 17199, 29918, 29946, 29929, 29914, 1688, 29918, 10080, 29918, 546, 6149, 800, 29889, 2272, 13, 5215, 443, 27958, 13, 13, 3166, 6019, 29918, 546, 6149, 800, 1053, 334, 13, 13, 13, 1990, 15512, 15737, 329, 800, 3057, ...
djangular_serve/__init__.py
forafekt/djangular-serve
0
188261
<reponame>forafekt/djangular-serve from .serve import main
[ 1, 529, 276, 1112, 420, 29958, 1454, 29874, 1725, 1193, 29914, 19776, 6825, 29899, 16349, 13, 3166, 869, 16349, 1053, 1667, 13, 2 ]
test/test_dgcspn.py
fedelux3/deeprob-kit
0
113191
<reponame>fedelux3/deeprob-kit import unittest import torch import numpy as np from deeprob.spn.layers.dgcspn import SpatialGaussianLayer, SpatialProductLayer, SpatialSumLayer, SpatialRootLayer class TestDgcSpn(unittest.TestCase): def __init__(self, *args, **kwargs): super(TestDgcSpn, self).__init__(*arg...
[ 1, 529, 276, 1112, 420, 29958, 29888, 287, 295, 1314, 29941, 29914, 311, 29872, 22795, 29899, 7354, 13, 5215, 443, 27958, 13, 5215, 4842, 305, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 316, 29872, 22795, 29889, 1028, 29876, 29889, 29277...
app/editor/new_game_dialog.py
zerorock1312/lt-maker-master
0
141937
from PyQt5.QtWidgets import QVBoxLayout, QDialog, QLineEdit, QDialogButtonBox from app.extensions.custom_gui import PropertyBox, Dialog class NewGameDialog(Dialog): def __init__(self, parent=None): super().__init__(parent) self.setWindowTitle("New Game") self.window = parent layout...
[ 1, 515, 10772, 17303, 29945, 29889, 17303, 8801, 29879, 1053, 660, 29963, 3313, 3453, 29892, 660, 7647, 29892, 660, 3542, 6103, 29892, 660, 7647, 3125, 3313, 13, 3166, 623, 29889, 24299, 29889, 6341, 29918, 23569, 1053, 9079, 3313, 29892, ...
cassie/misc/plotting_ex.py
WooQi57/cassie-run
36
77487
import numpy as np import time import math # from cassie_env import CassieEnv from cassiemujoco import * from trajectory.trajectory import CassieTrajectory import matplotlib.pyplot as plt from matplotlib import style from matplotlib.animation import FuncAnimation import matplotlib.animation as animation from mpl_too...
[ 1, 1053, 12655, 408, 7442, 13, 5215, 931, 13, 5215, 5844, 13, 13, 29937, 515, 274, 465, 347, 29918, 6272, 1053, 13088, 347, 21745, 13, 13, 3166, 274, 465, 3768, 8016, 6235, 1053, 334, 13, 3166, 23324, 706, 29889, 3018, 622, 706, 105...
cli.py
superiorbocal/AnPy
1
195983
<reponame>superiorbocal/AnPy import argparse import sqlite3 from tabulate import tabulate from anpy_lib import file_management from anpy_lib import table_generator from anpy_lib.data_handling import SQLDataHandler def set_up(): file_management.create_anpy_dir_if_not_exist() handler = SQLDataHandler(sqlite3....
[ 1, 529, 276, 1112, 420, 29958, 9136, 1611, 29890, 18642, 29914, 2744, 19737, 13, 5215, 1852, 5510, 13, 5215, 21120, 29941, 13, 13, 3166, 4434, 5987, 1053, 4434, 5987, 13, 13, 3166, 385, 2272, 29918, 1982, 1053, 934, 29918, 21895, 13, ...
congd/split_MFSK_features.py
dailai/ConGD-Baseline-Method
8
1604212
<reponame>dailai/ConGD-Baseline-Method<gh_stars>1-10 import copy import os import shutil def check_create_par_dir(file_path): dir_ = os.path.dirname(file_path) if not os.path.exists(dir_): os.makedirs(dir_) def split_feat(feats, seg_points, save_path): feats_copy = copy.copy(feats) check_cre...
[ 1, 529, 276, 1112, 420, 29958, 29881, 737, 1794, 29914, 1168, 29954, 29928, 29899, 9496, 5570, 29899, 4062, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 3509, 13, 5215, 2897, 13, 5215, 528, 4422, 13, 13, ...
batuta/base.py
makecodes/batuta
0
28294
from dynaconf import FlaskDynaconf from flask import Flask def create_app(**config): app = Flask(__name__) FlaskDynaconf(app) # config managed by Dynaconf app.config.load_extensions('EXTENSIONS') # Load extensions from settings.toml app.config.update(config) # Override with passed config return...
[ 1, 515, 270, 18477, 5527, 1053, 2379, 1278, 29928, 18477, 5527, 13, 3166, 29784, 1053, 2379, 1278, 13, 13, 13, 1753, 1653, 29918, 932, 29898, 1068, 2917, 1125, 13, 1678, 623, 353, 2379, 1278, 22168, 978, 1649, 29897, 13, 1678, 2379, 1...
tests/test_pllcalcs.py
bobbyjsmith11/pll
0
185264
<filename>tests/test_pllcalcs.py from unittest import TestCase from pll.pll_calcs import * class TestGeneralFunctions(TestCase): def test_interp_linear_1(self): """ test the linear interpolator with a value within the x array """ test_var = interp_linear([10,20], [1,2], 12) self....
[ 1, 529, 9507, 29958, 21150, 29914, 1688, 29918, 572, 29880, 1052, 2395, 29889, 2272, 13, 3166, 443, 27958, 1053, 4321, 8259, 13, 13, 3166, 282, 645, 29889, 572, 29880, 29918, 1052, 2395, 1053, 334, 13, 13, 13, 1990, 4321, 15263, 6678, ...
scripts/courtlistener/tokenizeText.py
sandeepsoni/semantic-progressiveness
2
135136
""" Tokenize and tag documents from a .jsonl file """ import spacy import ujson import plac import os import sys import logging if "../../" not in sys.path: sys.path.append ("../../") from modules import constants TAGGED_EXT=".tokenized" MAX_LENGTH = 10000000 NLP = spacy.load ("en_core_web_sm") NLP.max_length = M...
[ 1, 9995, 25159, 675, 322, 4055, 10701, 515, 263, 869, 3126, 29880, 934, 9995, 13, 13, 5215, 805, 4135, 13, 5215, 318, 3126, 13, 5215, 2174, 29883, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 12183, 13, 13, 361, 376, 21546, 29908, 451...
evaluate/evaluate_debug.py
goodgodgd/vode-2020
4
22984
<filename>evaluate/evaluate_debug.py import os import os.path as op import numpy as np import pandas as pd import cv2 import tensorflow as tf import settings from config import opts from tfrecords.tfrecord_reader import TfrecordReader import utils.util_funcs as uf import utils.convert_pose as cp from model.synthesize....
[ 1, 529, 9507, 29958, 24219, 403, 29914, 24219, 403, 29918, 8382, 29889, 2272, 13, 5215, 2897, 13, 5215, 2897, 29889, 2084, 408, 1015, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 5215, 13850, 29906, 13, 5215, 26110, 408,...
app/utilities/__init__.py
Maxyme/movie-review
0
108869
<filename>app/utilities/__init__.py """app utilities"""
[ 1, 529, 9507, 29958, 932, 29914, 4422, 1907, 29914, 1649, 2344, 26914, 2272, 13, 15945, 29908, 932, 3667, 1907, 15945, 29908, 13, 2 ]
src/data/batchloader.py
jiahui890/chexpert-aml
0
51247
<reponame>jiahui890/chexpert-aml<gh_stars>0 import pandas as pd import numpy as np class BatchLoader: def __init__(self, dataset, batch_size, return_labels=None, without_image=False, return_X_y=True): self.dataset = dataset self.batch_size = batch_size self.return_labels = return_labels ...
[ 1, 529, 276, 1112, 420, 29958, 29926, 423, 15669, 29947, 29929, 29900, 29914, 305, 735, 10700, 29899, 8807, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 13, 1990, 350, 905, 1...
src/data/prepare_train_data.py
ds-praveenkumar/m5-accuracy-prediction
0
30966
# github link: https://github.com/ds-praveenkumar/kaggle # Author: ds-praveenkumar # file: forcasting/prepare_train_data.py/ # Created by ds-praveenkumar at 13-06-2020 15 34 # feature: import os import pandas as pd import numpy as np import click from src.utility.timeit import timeit root = os.path.dirname(os.getcwd(...
[ 1, 396, 18546, 1544, 29901, 2045, 597, 3292, 29889, 510, 29914, 6289, 29899, 29886, 336, 345, 5842, 24540, 29914, 29895, 351, 6234, 13, 29937, 13361, 29901, 18031, 29899, 29886, 336, 345, 5842, 24540, 13, 29937, 934, 29901, 363, 4384, 292...
basic-programs/tensor_autograd.py
lcskrishna/my-pytorch-experiments
0
191531
import torch x = torch.ones(2,2, requires_grad = True) print (x) y = x + 2 print (y) print (y.grad_fn) z = y * y * 3 out = z.mean() print (z) print (out) a = torch.randn(2,2) a = ((a * 3)/ (a - 1)) print (a.requires_grad) a.requires_grad_(True) print (a.requires_grad) b = (a * a).sum() print (b.grad_fn) out.backwa...
[ 1, 1053, 4842, 305, 13, 29916, 353, 4842, 305, 29889, 2873, 29898, 29906, 29892, 29906, 29892, 6858, 29918, 5105, 353, 5852, 29897, 13, 2158, 313, 29916, 29897, 13, 13, 29891, 353, 921, 718, 29871, 29906, 13, 2158, 313, 29891, 29897, 13...
examples/topic_with_admin_key.py
wensheng/hedera-sdk-py
9
1602489
from hedera import ( PrivateKey, KeyList, TopicCreateTransaction, TopicUpdateTransaction, TopicInfoQuery, ) from get_client import client initialAdminKeys = [PrivateKey.generate() for i in range(3)] thresholdKey = KeyList.of(initialAdminKeys[0], initialAdminKeys[1]) # Create topic tran = Topic...
[ 1, 515, 298, 287, 1572, 1053, 313, 13, 1678, 12230, 2558, 29892, 13, 1678, 7670, 1293, 29892, 13, 1678, 7488, 293, 4391, 12460, 29892, 13, 1678, 7488, 293, 6422, 12460, 29892, 13, 1678, 7488, 293, 3401, 3010, 29892, 13, 1678, 1723, 13...
lingvo/tasks/asr/tools/simple_wer_v2.py
allenwang28/lingvo
2,611
132399
# Lint as: python3 # Copyright 2018 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.org/licenses/LICENSE-2.0 # # Unless ...
[ 1, 396, 365, 524, 408, 29901, 3017, 29941, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29947, 450, 323, 6073, 17907, 13189, 943, 29889, 2178, 26863, 2538, 9841, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 2...
graph_analysis/deprecated/gensim_embedding.py
roy860328/VSGM
6
1607747
# https://stackoverflow.com/questions/35747245/bigram-to-a-vector # Bigram to a vector from gensim.models import word2vec, Phrases from glove_embedding import load_object import gensim.downloader as api def five(): word_vectors = api.load("glove-wiki-gigaword-100") word_vectors["apple"].shape five() def bigram...
[ 1, 396, 2045, 597, 2417, 29889, 510, 29914, 2619, 29914, 29941, 29945, 29955, 29946, 29955, 29906, 29946, 29945, 29914, 3752, 2572, 29899, 517, 29899, 29874, 29899, 8111, 13, 29937, 7997, 2572, 304, 263, 4608, 13, 3166, 26943, 326, 29889, ...
src/tasks.py
accraze/stream-processor
0
139377
import time from src.celery import app @app.task(bind=True, default_retry_delay=10) def process_event(self, event): process_change(event['wait']) return event def process_change(wait_secs): start = time.time() while time.time() - start < wait_secs: time.sleep(0.001)
[ 1, 1053, 931, 13, 13, 3166, 4765, 29889, 2242, 708, 1053, 623, 13, 13, 13, 29992, 932, 29889, 7662, 29898, 5355, 29922, 5574, 29892, 2322, 29918, 276, 2202, 29918, 18829, 29922, 29896, 29900, 29897, 13, 1753, 1889, 29918, 3696, 29898, 1...
data/vispapers/preprocess.py
sonne-academic/solr-utils
0
106721
from data.vispapers import read_all, DATA_FOLDER import json import gzip def preprocess(): with gzip.open(DATA_FOLDER / 'vispapers.jsonl.gz', 'wt', encoding='utf-8') as file: for document in read_all(): file.write(json.dumps(document)+'\n') if __name__ == '__main__': preprocess()
[ 1, 515, 848, 29889, 1730, 29886, 21321, 1053, 1303, 29918, 497, 29892, 360, 8254, 29918, 29943, 5607, 8032, 13, 5215, 4390, 13, 5215, 330, 7554, 13, 13, 13, 1753, 758, 5014, 7295, 13, 1678, 411, 330, 7554, 29889, 3150, 29898, 14573, 2...
restore-firm0firm1.py
ihaveamac/hardmod-b9s-installer
13
1604545
<gh_stars>10-100 #!/usr/bin/env python3 import os import sys import time def doexit(msg, errcode=0): print(msg) input('Press Enter to continue...') sys.exit(errcode) def doexit(msg, errcode=0): print(msg) input('Press Enter to continue...') sys.exit(errcode) if not os.path.isfile('NAND-pa...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 931, 13, 13, 13, 1753, 437, 13322, 29898, 76...
pyscript/apps/temp/old/load_optimizer.py
janiversen/ha_config
0
43893
<gh_stars>0 @state_trigger("sensor.power_meter != '9999'") def load_optimizer(value=None): pass
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 13, 13, 13, 29992, 3859, 29918, 21001, 703, 29879, 6073, 29889, 13519, 29918, 29391, 2804, 525, 29929, 29929, 29929, 29929, 29915, 1159, 13, 1753, 2254, 29918, 20640, 3950, 29898, 1767, 2...
iocage/cli/stop.py
project-fifo/iocage
0
199178
<gh_stars>0 """stop module for the cli.""" import logging from collections import OrderedDict from operator import itemgetter import click from iocage.lib.ioc_json import IOCJson from iocage.lib.ioc_list import IOCList from iocage.lib.ioc_stop import IOCStop __cmdname__ = "stop_cmd" __rootcmd__ = True @click.comma...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 9847, 3883, 363, 278, 9335, 1213, 15945, 13, 5215, 12183, 13, 3166, 16250, 1053, 8170, 287, 21533, 13, 3166, 5455, 1053, 2944, 657, 357, 13, 13, 5215, 2828, 13, 13, 3166...
data_split.py
TalSchuster/FewRel
0
15771
<reponame>TalSchuster/FewRel<filename>data_split.py import os import random from shutil import copyfile import json random.seed(123) ROOT_PATH = './data/' k = 5 target_path = './data/wiki_5_splits/' ''' Splits the training set to 5 folds. In each split, the held out set is used for test. ''' path = os.path.join(RO...
[ 1, 529, 276, 1112, 420, 29958, 29911, 284, 4504, 5402, 29914, 29943, 809, 9662, 29966, 9507, 29958, 1272, 29918, 5451, 29889, 2272, 13, 5215, 2897, 13, 5215, 4036, 13, 3166, 528, 4422, 1053, 3509, 1445, 13, 5215, 4390, 13, 13, 8172, 2...
server/core/views/api/admin_jenkins_job.py
FranciscoShi/jenkins-gitlab-integrator
2
153247
import json from functools import partial from aiohttp import web from aiohttp.web_exceptions import HTTPConflict from server.core.common import LoggingMixin from server.core.json_encoders import CustomJSONEncoder from server.core.models import RecordNotFound from server.core.models.jenkins_jobs import JenkinsJob fro...
[ 1, 1053, 4390, 13, 3166, 2090, 312, 8789, 1053, 7687, 13, 13, 3166, 263, 601, 1124, 1053, 1856, 13, 3166, 263, 601, 1124, 29889, 2676, 29918, 11739, 29879, 1053, 7331, 16376, 29176, 13, 13, 3166, 1923, 29889, 3221, 29889, 9435, 1053, ...
pyfarm/models/job.py
guidow/pyfarm-master
0
186500
<filename>pyfarm/models/job.py # No shebang line, this module is meant to be imported # # Copyright 2013 <NAME> # # 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/li...
[ 1, 529, 9507, 29958, 2272, 29888, 2817, 29914, 9794, 29914, 9057, 29889, 2272, 13, 29937, 1939, 1183, 29890, 574, 1196, 29892, 445, 3883, 338, 6839, 304, 367, 19673, 13, 29937, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29941, 52...
tests/processors.py
rysdyk/avocado
0
124603
<reponame>rysdyk/avocado from avocado.models import DataContext from avocado.query.pipeline import QueryProcessor class ManagerQueryProcessor(QueryProcessor): def __init__(self, *args, **kwargs): kwargs['context'] = DataContext(json={ 'field': 'tests.employee.is_manager', 'operator...
[ 1, 529, 276, 1112, 420, 29958, 18450, 4518, 29895, 29914, 485, 542, 912, 13, 3166, 1029, 542, 912, 29889, 9794, 1053, 3630, 2677, 13, 3166, 1029, 542, 912, 29889, 1972, 29889, 13096, 5570, 1053, 13641, 18689, 13, 13, 13, 1990, 15629, ...
formatting.py
yvesdubief/biofeedback
0
184986
%matplotlib inline # plots graphs within the notebook %config InlineBackend.figure_format='svg' # not sure what this does, may be default images to svg format from IPython.display import display,Image, Latex from __future__ import division from sympy.interactive import printing printing.init_printing(use_latex='mathj...
[ 1, 1273, 2922, 17357, 10583, 29871, 13, 29937, 24580, 18445, 2629, 278, 451, 19273, 13, 29995, 2917, 512, 1220, 5841, 355, 29889, 4532, 29918, 4830, 2433, 15120, 29915, 396, 451, 1854, 825, 445, 947, 29892, 1122, 367, 2322, 4558, 304, 2...
jenkins_job_wrecker/__init__.py
chenhuahuan/jenkins-job-wrecker
210
141507
__version__ = '1.7.1'
[ 1, 4770, 3259, 1649, 353, 525, 29896, 29889, 29955, 29889, 29896, 29915, 13, 2 ]
python/dgllife/model/pretrain/__init__.py
VIGNESHinZONE/dgl-lifesci
0
15229
# -*- coding: utf-8 -*- # # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # # pylint: disable= no-member, arguments-differ, invalid-name # # Utilities for using pre-trained models. import torch from dgl.data.utils import _get_dgl_url, download from .molecule...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 13, 29937, 14187, 1266, 16631, 29889, 510, 29892, 9266, 29889, 470, 967, 23736, 1078, 29889, 2178, 26863, 2538, 9841, 29889, 13, 29937, 10937, 29928...
ptmv/snd.py
ryw89/ptmv
0
46975
import os import subprocess import tempfile import time import wave import simpleaudio def extract(file): ptmv_tempdir = os.path.join(tempfile.gettempdir(), "ptmv") if not os.path.exists(ptmv_tempdir): os.makedirs(ptmv_tempdir) snd_file = ptmv_tempdir + str(int(time.time())) + ".wav" command = "ffmpeg -i " + file ...
[ 1, 1053, 2897, 13, 5215, 1014, 5014, 13, 5215, 5694, 1445, 13, 5215, 931, 13, 5215, 10742, 13, 5215, 2560, 18494, 13, 13, 1753, 6597, 29898, 1445, 1125, 13, 12, 415, 29324, 29918, 7382, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898...
wsgi/openshift/manage.py
chiora93/WavelenBlog
0
181173
#!/usr/bin/env python import settings.development as settings import os, sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.development") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 5215, 6055, 29889, 25431, 408, 6055, 13, 5215, 2897, 29892, 10876, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 2897, 29889, 21813, 29889, 842, 4381, 703,...
Tutorials/10 Days of Statistics/Day 5 - Poisson Distribution I/solution.py
abhinavgunwant/hackerrank-solutions
1
158924
#!/bin/python3 # Calculates factorial def fact(n): f = 1 while n > 0: f *= n n -= 1 return f # Calculates Poisson Distribution def poissonDist(k, l): return (l**k*(2.71828**(-l)))/fact(k) if __name__ == '__main__': x = float(input()) y = float(input()) print(...
[ 1, 18787, 2109, 29914, 4691, 29941, 13, 13, 29937, 20535, 1078, 7329, 616, 13, 1753, 2114, 29898, 29876, 1125, 13, 1678, 285, 353, 29871, 29896, 13, 1678, 1550, 302, 1405, 29871, 29900, 29901, 308, 13, 4706, 285, 334, 29922, 302, 13, ...
manyfaced/common/arguments.py
Zloool/mlgwebhoneypot
8
1607948
import argparse import sys import settings """ usage: mfh.py [-h] [-c [PORT]] [-s [PORT]] [-u] [-v] Serve some sweet honey to the ubiquitous bots! optional arguments: -h, --help show this help message and exit -c [PORT] port to start a CLIENT on -s [PORT] port to start a SERVER on -u ...
[ 1, 1053, 1852, 5510, 13, 5215, 10876, 13, 13, 5215, 6055, 13, 13, 15945, 29908, 13, 21125, 29901, 286, 29888, 29882, 29889, 2272, 21069, 29882, 29962, 21069, 29883, 518, 15082, 5262, 21069, 29879, 518, 15082, 5262, 21069, 29884, 29962, 21...
setup.py
edwardchalstrey1/mapreader-plant-scivision
0
94654
#!/usr/bin/env python from setuptools import find_packages, setup requirements = [] with open("requirements.txt") as f: for line in f: stripped = line.split("#")[0].strip() if len(stripped) > 0: requirements.append(stripped) setup( name="mapreader-plant-scivision", version="0.0...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 3166, 731, 21245, 8789, 1053, 1284, 29918, 8318, 29892, 6230, 13, 13, 12277, 1860, 353, 5159, 13, 2541, 1722, 703, 12277, 1860, 29889, 3945, 1159, 408, 285, 29901, 13, 1678, 363, 1196,...
cairis/gui/DictionaryListCtrl.py
RachelLar/cairis_update
0
12246
# 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, Version 2.0 (the # "License"); you may...
[ 1, 396, 29871, 10413, 21144, 304, 278, 13380, 18540, 10606, 313, 3289, 29943, 29897, 1090, 697, 13, 29937, 29871, 470, 901, 17737, 3406, 19405, 8571, 4110, 29889, 29871, 2823, 278, 6058, 12107, 934, 13, 29937, 29871, 13235, 411, 445, 664,...
girder/girder_large_image/rest/large_image_resource.py
girder/large_image
85
196616
############################################################################## # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lice...
[ 1, 835, 13383, 13383, 13383, 13383, 7346, 2277, 29937, 13, 29937, 29871, 14187, 1266, 26240, 2519, 9266, 29889, 13, 29937, 13, 29937, 29871, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 278, 376, 299...
dante.py
jbudis/dante
4
164322
<filename>dante.py import matplotlib matplotlib.use('Agg') import os import cProfile import pstats import multiprocess import sys from datetime import datetime import traceback import logging import arguments from parser import ReadFile import prefiltering import templates import report import annotation import post...
[ 1, 529, 9507, 29958, 29881, 1647, 29889, 2272, 13, 5215, 22889, 13, 13, 2922, 17357, 29889, 1509, 877, 29909, 1505, 1495, 13, 13, 5215, 2897, 13, 5215, 274, 13909, 13, 5215, 282, 16202, 13, 5215, 6674, 307, 985, 13, 5215, 10876, 13, ...
QuillSourceProcessor.py
Sturtuk/IND_langTras
78
149853
<reponame>Sturtuk/IND_langTras<filename>QuillSourceProcessor.py # -*- coding: utf-8 -*- # @Date : Jul 13, 2016 # @Author : <NAME>, <NAME> # @Version : 1 import QuillLanguage as qlang import QuillEngXlit as xlit import re import const import primaryHelper class QuillSourceProcessor(object): def __i...
[ 1, 529, 276, 1112, 420, 29958, 855, 4227, 2679, 29914, 22255, 29918, 3893, 2308, 294, 29966, 9507, 29958, 2182, 453, 4435, 18689, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 30004, 13, ...
python/simplepvr/simple_pvr/pvr_initializer.py
olefriis/simplepvr
5
77280
# -*- coding: <utf-8> -*- from .config import config from datetime import timedelta import os from time import sleep from .master_import import HDHomeRun from .master_import import RecordingManager from .master_import import Scheduler from .server import app _config_recordings_path = config.get('SimplePVR', 'recor...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 529, 9420, 29899, 29947, 29958, 448, 29930, 29899, 13, 13, 3166, 869, 2917, 1053, 2295, 13, 13, 3166, 12865, 1053, 5335, 287, 2554, 13, 5215, 2897, 13, 3166, 931, 1053, 8709, 13, 13, 3166, 869,...
src/opendr/control/mobile_manipulation/mobileRL/evaluation.py
makistsantekidis/opendr
3
161601
<reponame>makistsantekidis/opendr<gh_stars>1-10 # Copyright 2020-2021 OpenDR European Project # # 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....
[ 1, 529, 276, 1112, 420, 29958, 29885, 557, 2879, 1647, 29895, 333, 275, 29914, 459, 355, 29878, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29900, 29899, 29906, 2990...
code/lip_tracking/speech_feature_extraction/speechpy/feature.py
hengxyz/Talking-head-Audio-Visual-Matching
1
157818
<filename>code/lip_tracking/speech_feature_extraction/speechpy/feature.py<gh_stars>1-10 from __future__ import division import numpy as np from . import processing from scipy.fftpack import dct import math from . import functions def filterbanks(num_filter, fftpoints, sampling_freq, low_freq=None, high_freq=None): ...
[ 1, 529, 9507, 29958, 401, 29914, 3466, 29918, 11294, 292, 29914, 5965, 5309, 29918, 14394, 29918, 1062, 13857, 29914, 5965, 5309, 2272, 29914, 14394, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, ...
democracy/signals.py
shawnadelic/django-democracy
0
94905
from django.contrib.contenttypes.models import ContentType from django.db.models.signals import post_save from django.dispatch import receiver from .models import (PollBase, PollChoiceBase, PollChoiceModelMixin, PollModelMixin) @receiver(post_save) def create_poll_choice(sender, instance, create...
[ 1, 515, 9557, 29889, 21570, 29889, 3051, 8768, 29889, 9794, 1053, 10576, 1542, 13, 3166, 9557, 29889, 2585, 29889, 9794, 29889, 4530, 1338, 1053, 1400, 29918, 7620, 13, 3166, 9557, 29889, 13369, 1053, 19870, 13, 13, 3166, 869, 9794, 1053,...
examples/class_a.py
maxschommer/pcbdl
117
111737
#!/usr/bin/env python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29929, 5087, 365, 12182, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 3...
gaphor/C4Model/toolbox.py
mrmonkington/gaphor
42
134550
"""The action definition for the C4 model toolbox.""" from gaphor.C4Model import c4model, diagramitems from gaphor.core import gettext from gaphor.diagram.diagramtoolbox import ( ToolboxDefinition, ToolDef, ToolSection, default_namespace, general_tools, namespace_config, ) from gaphor.diagram.d...
[ 1, 9995, 1576, 3158, 5023, 363, 278, 315, 29946, 1904, 5780, 1884, 1213, 15945, 13, 13, 3166, 17261, 2015, 29889, 29907, 29946, 3195, 1053, 274, 29946, 4299, 29892, 13722, 7076, 13, 3166, 17261, 2015, 29889, 3221, 1053, 679, 726, 13, 31...
Sixt_Day/Seventh_Day_Templet1.py
vijayingale/Adv_Python_Trainig
0
170333
from jinja2 import Template class Persone: def __init__(self, name ,age): self.name = name self.age = age def getAge(self): return self.age def getName(self): return self.name person = Persone('peter',23) tn = Template("my name is {{ per.getName()}} and I am {{ per.getAge...
[ 1, 515, 432, 262, 1764, 29906, 1053, 25663, 13, 13, 1990, 9034, 650, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1024, 1919, 482, 1125, 13, 4706, 1583, 29889, 978, 353, 1024, 13, 4706, 1583, 29889, 482, 353, 5046, 13, 13, ...
downloads/managers.py
akondasif/Clone-test-repo
0
176135
<filename>downloads/managers.py from django.db.models import Manager from django.db.models.query import QuerySet class ReleaseQuerySet(QuerySet): def published(self): return self.filter(is_published=True) def draft(self): return self.filter(is_published=False) def downloads(self): ...
[ 1, 529, 9507, 29958, 10382, 29879, 29914, 1171, 18150, 29889, 2272, 13, 3166, 9557, 29889, 2585, 29889, 9794, 1053, 15629, 13, 3166, 9557, 29889, 2585, 29889, 9794, 29889, 1972, 1053, 13641, 2697, 13, 13, 13, 1990, 23708, 3010, 2697, 2989...
mojoco trivial/mujocoSim/UR5/simple_example/Mujoco_py_example.py
garlicbutter/Jonathan-Tom
2
8335
<filename>mojoco trivial/mujocoSim/UR5/simple_example/Mujoco_py_example.py import numpy as np import mujoco_py as mj from mujoco_py_renderer import SimulationError, XMLError, MujocoPyRenderer from mujoco_py import (MjSim, load_model_from_xml,functions, load_model_from_path, MjSimState, ...
[ 1, 529, 9507, 29958, 29885, 3848, 6235, 12604, 29914, 2589, 29926, 6235, 8942, 29914, 4574, 29945, 29914, 12857, 29918, 4773, 29914, 29924, 8016, 6235, 29918, 2272, 29918, 4773, 29889, 2272, 13, 5215, 12655, 408, 7442, 13, 5215, 3887, 29926...