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
revasbot/revas_calculations.py
iwo-strzebonski/SeleBot
0
176568
class RevasCalculations: '''Functions related to calculations go there ''' pass
[ 1, 770, 830, 4428, 27065, 800, 29901, 13, 1678, 14550, 6678, 29879, 4475, 304, 17203, 748, 727, 13, 1678, 14550, 13, 1678, 1209, 13, 2 ]
biosimulators_test_suite/results/data_model.py
Ryannjordan/Biosimulators_test_suite
0
17389
""" Data model for results of test cases :Author: <NAME> <<EMAIL>> :Date: 2021-01-01 :Copyright: 2021, Center for Reproducible Biomedical Modeling :License: MIT """ from .._version import __version__ from ..warnings import TestCaseWarning # noqa: F401 import enum __all__ = [ 'TestCaseResultType', 'TestCaseR...
[ 1, 9995, 3630, 1904, 363, 2582, 310, 1243, 4251, 13, 13, 29901, 13720, 29901, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29901, 2539, 29901, 29871, 29906, 29900, 29906, 29896, 29899, 29900, 29896, 29899, 29900, 29896, 13, 29901, 11882, ...
django_sqlprint_middleware/__init__.py
thebjorn/django-sqlprint-middleware
1
1616599
<gh_stars>1-10 # -*- coding: utf-8 -*- """ ========================== django-sqlprint-middleware ========================== Middleware that pretty prints Django's sql statements. Installation ------------ Install from PyPI:: pip install django-sqlprint-middleware then add it to the `MIDDLEWARE_CLASSES` settings...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 9166, 4936, 1360, 13, 14095, 29899, 2850, 2158, 29899, 17662, 2519...
cursor/device.py
brendanhowell/cursor
3
74391
<gh_stars>1-10 from cursor import data from cursor import renderer from enum import Enum import wasabi import inspect import hashlib log = wasabi.Printer() class MinMax: def __init__(self, minx: int, maxx: int, miny: int, maxy: int): self.minx = minx self.maxx = maxx self.miny = miny ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 10677, 1053, 848, 13, 3166, 10677, 1053, 4050, 261, 13, 13, 3166, 14115, 1053, 1174, 398, 13, 5215, 471, 19266, 13, 5215, 16096, 13, 5215, 6608, 1982, 13, 1...
sms/backends/__init__.py
sms77io/django-sms
29
1610806
# SMS backends shipped with django-sms
[ 1, 396, 317, 4345, 1250, 1975, 528, 16242, 411, 9557, 29899, 29879, 1516, 13, 2 ]
Practice/Problem Solving/BirthdayChocolate.py
avantikasharma/HackerRank-Solutions
1
190656
#!/bin/python import sys def solve(n, s, d, m): total=0 for i in range(n-m+1): sum=0 for j in range(m): sum=sum+s[i+j] if sum==d: total=total+1 return total n = int(raw_input().strip()) s = map(int, raw_input().strip().split(' ')) d, m = raw_inp...
[ 1, 18787, 2109, 29914, 4691, 13, 13, 5215, 10876, 13, 13, 1753, 4505, 29898, 29876, 29892, 269, 29892, 270, 29892, 286, 1125, 13, 1678, 3001, 29922, 29900, 13, 1678, 363, 474, 297, 3464, 29898, 29876, 29899, 29885, 29974, 29896, 1125, 1...
statuscheck/services/bases/_statusio.py
amureki/statuscheck
35
102057
import httpx from statuscheck.services.bases._base import BaseServiceAPI from statuscheck.services.models.generic import ( COMPONENT_TYPE_DEGRADED, COMPONENT_TYPE_GOOD, COMPONENT_TYPE_MAINTENANCE, COMPONENT_TYPE_MAJOR_OUTAGE, COMPONENT_TYPE_PARTIAL_OUTAGE, COMPONENT_TYPE_SECURITY, COMPONENT...
[ 1, 1053, 1732, 29916, 13, 13, 3166, 4660, 3198, 29889, 9916, 29889, 29890, 2129, 3032, 3188, 1053, 7399, 3170, 8787, 13, 3166, 4660, 3198, 29889, 9916, 29889, 9794, 29889, 19206, 1053, 313, 13, 1678, 4810, 3580, 1164, 3919, 29918, 11116, ...
tests/test_util.py
rampage644/densecap-tensorflow
10
1614766
import densecap.util def test_IoU_overlap(): box0 = (0, 0, 100, 100) box1 = (50, 50, 100, 100) box2 = (0, 50, 100, 100) box3 = (50, 0, 100, 100) assert densecap.util.iou(box0, box1) == 50 ** 2 / (2 * 100 ** 2 - 50 ** 2) assert densecap.util.iou(box0, box2) == (50 * 100) / (2 * 100 ** 2 - 50 *...
[ 1, 1053, 972, 3471, 481, 29889, 4422, 13, 13, 13, 1753, 1243, 29918, 29902, 29877, 29965, 29918, 957, 6984, 7295, 13, 1678, 3800, 29900, 353, 313, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 29900, 29900, 29892, 29871, 29896, 29900, ...
Model/lookalike-model/lookalike_model/trainer/train_multi_gpu.py
rangaswamymr/incubator-bluemarlin
21
138478
<filename>Model/lookalike-model/lookalike_model/trainer/train_multi_gpu.py import os os.environ['CUDA_VISIBLE_DEVICES'] = "0,1,2,3" import time import pickle import random import numpy as np import tensorflow as tf import sys from input import DataInput, DataInputTest from model_multi_gpu import Model, DIN from sklear...
[ 1, 529, 9507, 29958, 3195, 29914, 6914, 2606, 446, 29899, 4299, 29914, 6914, 2606, 446, 29918, 4299, 29914, 3018, 4983, 29914, 14968, 29918, 9910, 29918, 29887, 3746, 29889, 2272, 13, 5215, 2897, 13, 359, 29889, 21813, 1839, 29907, 29965, ...
Codigos Python/String_to_int.py
BrunoHarlis/Solucoes_LeetCode
0
32210
<gh_stars>0 # Fonte: https://leetcode.com/problems/string-to-integer-atoi/ # Autor: <NAME> # Data: 03/08/2021 """ Implemente a função myAtoi(string s), que converte uma string em um inteiro assinado de 32 bits (semelhante à função C / C ++ atoi). O algoritmo para myAtoi(string s) é o seguinte: Leia e ignore qualquer...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 383, 9568, 29901, 2045, 597, 280, 300, 401, 29889, 510, 29914, 17199, 29879, 29914, 1807, 29899, 517, 29899, 16031, 29899, 1219, 29875, 29914, 13, 29937, 15811, 29901, 529, 5813, 2...
dl.py
onoira/instawow-installer
0
1604605
<reponame>onoira/instawow-installer from __future__ import annotations import json import os import os.path as path import re import shutil import zipfile from configparser import ConfigParser from glob import glob import requests _RE_NAME_GUI = re.compile( r'\b\binstawow-desktop.+\.exe\b', fl...
[ 1, 529, 276, 1112, 420, 29958, 3231, 3055, 29914, 2611, 1450, 340, 29899, 6252, 261, 13, 3166, 4770, 29888, 9130, 1649, 1053, 25495, 30004, 13, 30004, 13, 5215, 4390, 30004, 13, 5215, 2897, 30004, 13, 5215, 2897, 29889, 2084, 408, 2224,...
Scripts/mapOutline_AGP2.py
usgs/gems-tools-pro
15
194849
<filename>Scripts/mapOutline_AGP2.py # MapOutline.py # generates rectangular (in lat-long) map outline and # appropriate tics in projection of user's choosing. Result is # stored in an existing geodatabase # # For complex map outlines, try several runs and intersect the results. # # <NAME>, U.S. Geologic...
[ 1, 529, 9507, 29958, 4081, 29879, 29914, 1958, 3744, 1220, 29918, 10051, 29925, 29906, 29889, 2272, 13, 29937, 7315, 3744, 1220, 29889, 2272, 30004, 13, 29937, 259, 16785, 7705, 6825, 313, 262, 3405, 29899, 5426, 29897, 2910, 27887, 322, ...
project1b.py
kaamila42/project1
0
92253
<gh_stars>0 filename = input("Input the Filename: " ,"py = python", "txt = text", ...) f_extns = filename.split(".") print(f " The extension of the file is '{f_extns[]}'")
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 9507, 353, 1881, 703, 4290, 278, 2514, 3871, 29901, 29871, 376, 29871, 1699, 2272, 353, 3017, 613, 376, 3945, 353, 1426, 613, 2023, 8443, 13, 29888, 29918, 1062, 1983, 353, 10422, 29889...
python/cursoemvideo/040.py
Gustavo-Martins/learning
0
160305
# Reads two grades and prints average grade1 = float(input('Digite a primeira nota: ')) grade2 = float(input('Digite a segunda nota: ')) grade_average = (grade1 + grade2) / 2 print('Tirando {:.1f} e {:.1f}, a média é {:.1f}'.format(grade1, grade2, grade_average)) if grade_average < 5: print('O aluno(a) está REPROV...
[ 1, 396, 7523, 29879, 1023, 867, 3076, 322, 14677, 6588, 13, 8228, 29896, 353, 5785, 29898, 2080, 877, 14991, 568, 263, 20997, 451, 29874, 29901, 525, 876, 13, 8228, 29906, 353, 5785, 29898, 2080, 877, 14991, 568, 263, 17329, 451, 29874,...
piefuzz/__init__.py
timeyyy/piefuzz
7
186810
from piefuzz.piefuzz import *
[ 1, 515, 282, 2575, 18813, 29889, 29886, 2575, 18813, 1053, 334, 13, 2 ]
BlogSite-Flask/flaskblog/__init__.py
Mihir008/Web-Ideas
10
167414
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_bcrypt import Bcrypt from flask_login import LoginManager app = Flask(__name__) app.config['SECRET_KEY'] = '<KEY>' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.db' db = SQLAlchemy(app) bcrypt = Bcrypt(app) login_manager = LoginMan...
[ 1, 515, 29784, 1053, 2379, 1278, 29871, 13, 3166, 29784, 29918, 2850, 284, 305, 6764, 1053, 3758, 2499, 305, 6764, 259, 13, 3166, 29784, 29918, 12328, 4641, 1053, 350, 29883, 4641, 13, 3166, 29784, 29918, 7507, 1053, 19130, 3260, 13, 13...
person_detector.py
RocketMan112/STEM_Mentorship
0
156800
import logging log = logging.getLogger(__name__) class PersonDetectorBase: def initialize(self): pass def name(self): return "Error - Base PersonDetector class, not for direct use" class FakeFixedPersonDetector(PersonDetectorBase): def initialize(self): pass def name(self):...
[ 1, 1053, 12183, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 1990, 5196, 6362, 3019, 5160, 29901, 13, 1678, 822, 11905, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 1024, 29898, 1311, 1125, 13...
bcs-ui/backend/tests/resources/test_resource.py
laodiu/bk-bcs
1
1616915
<reponame>laodiu/bk-bcs # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 TH<NAME>, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this ...
[ 1, 529, 276, 1112, 420, 29958, 433, 397, 5871, 29914, 29890, 29895, 29899, 29890, 2395, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 29911, 264, 1760, 338, 22301, 304, 2304, 278...
MiScan/model.py
QuKunLab/MiScan
3
1613529
from keras import Model from keras.layers import Dropout, Input from keras.optimizers import adam from .layers import dense, activation def build_dense_model(input_dim=13885, lr=1e-6, dropout=0.25, acti='leakyrelu' ): input_x...
[ 1, 515, 13023, 294, 1053, 8125, 13, 3166, 13023, 294, 29889, 29277, 1053, 20724, 449, 29892, 10567, 13, 3166, 13023, 294, 29889, 20640, 19427, 1053, 594, 314, 13, 13, 3166, 869, 29277, 1053, 20619, 29892, 26229, 13, 13, 13, 1753, 2048, ...
Reader.py
noahwc/gtfs-pyparse
0
115246
# This class parses a gtfs text file class Reader: def __init__(self, file): self.fields = [] self.fp = open(file, "r") self.fields.extend(self.fp.readline().rstrip().split(",")) def get_line(self): data = {} line = self.fp.readline().rstrip().split(",") for e...
[ 1, 396, 910, 770, 610, 29879, 267, 263, 330, 29873, 5847, 1426, 934, 13, 13, 1990, 830, 1664, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 934, 1125, 13, 4706, 1583, 29889, 9621, 353, 5159, 13, 4706, 1583, 29889, 18091, ...
PyTorch/loader.py
avinashsai/Gated-CNN-for-ABSA
0
81148
<reponame>avinashsai/Gated-CNN-for-ABSA import sys import os import re import ast from ast import literal_eval label = {'negative':0,'positive':1,'neutral':2} def preprocess(string): string = re.sub(r"[^A-Za-z0-9(),!?\'\`]", " ", string) string = re.sub(r"\'s", " \'s", string) string = re.sub(r"\'ve", " \'ve", str...
[ 1, 529, 276, 1112, 420, 29958, 485, 262, 1161, 29879, 1794, 29914, 29954, 630, 29899, 29907, 10262, 29899, 1454, 29899, 2882, 8132, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 337, 13, 5215, 8717, 13, 3166, 8717, 1053, 16333, 29918, 1451...
templogboss/myapp/models.py
Bossabossy/Templog
0
57578
<gh_stars>0 from __future__ import unicode_literals from django.db import models class Node(models.Model): node_name=models.CharField(max_length=100) description=models.CharField(max_length=100) def __str__(self): return "{}:{}:{}".format(self.id, self.node_name, self.description) class Record(models.Model): c...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 13, 13, 1990, 9071, 29898, 9794, 29889, 3195, 1125, 13, 12, 3177, 29918, 978...
semisupervised/label_spreading.py
romanorac/ml
4
109737
# coding=utf8 import numpy as np class LabelSpreading: def __init__(self, alpha=0.2, max_iter=30, tol=1e-3): """ :param alpha: clamping factor between (0,1) :param max_iter: maximum number of iterations :param tol: convergence tolerance """ self.alpha = alpha ...
[ 1, 396, 14137, 29922, 9420, 29947, 13, 5215, 12655, 408, 7442, 13, 13, 13, 1990, 15796, 5592, 19715, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 15595, 29922, 29900, 29889, 29906, 29892, 4236, 29918, 1524, 29922, 29941, 29900, 2...
build/lib/myrest/myparser.py
xiaoyexu/myrestengine
0
1602638
<filename>build/lib/myrest/myparser.py # -*- coding: UTF-8 -*- import re class StringReader(object): def __init__(self, text): self.text = text self.maxlength = len(text) self.currentPosition = 0 def isOverLength(self, length): return length >= self.maxlength or length < 0 ...
[ 1, 529, 9507, 29958, 4282, 29914, 1982, 29914, 1357, 5060, 29914, 1357, 16680, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 18351, 29899, 29947, 448, 29930, 29899, 13, 5215, 337, 13, 13, 13, 1990, 1714, 6982, 29898, 3318, 1125...
conductor/conductor/tests/unit/common/models/test_order_lock_history.py
aalsudais/optf-has
4
147055
# # ------------------------------------------------------------------------- # Copyright (C) 2019 IBM. # # 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...
[ 1, 396, 13, 29937, 448, 2683, 2683, 2683, 2683, 1378, 13, 29937, 259, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29929, 27955, 29889, 13, 29937, 13, 29937, 259, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, ...
Bio/UniGene/UniGene.py
zachcp/biopython
5
1611651
# Copyright 2001 by <NAME>. All Rights Reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. from __future__ import print_function import warnings from Bio import BiopythonDeprecationWarning wa...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29900, 29896, 491, 529, 5813, 15513, 2178, 26863, 2538, 9841, 29889, 13, 29937, 910, 775, 338, 760, 310, 278, 3457, 459, 1656, 4978, 322, 4095, 287, 491, 967, 13, 29937, 19405, 29889, 29871, 352...
api/urls.py
alaasalman/aussieshopper
0
146476
<reponame>alaasalman/aussieshopper from django.conf.urls import url, include from rest_framework import routers from api import views app_name = 'api' router = routers.SimpleRouter() router.register(r'stats', views.StatsViewSet) urlpatterns = [ url(r'bot/handle/', views.HandleChatMessage.as_view(), ...
[ 1, 529, 276, 1112, 420, 29958, 2883, 294, 284, 1171, 29914, 11214, 583, 1251, 2496, 13, 3166, 9557, 29889, 5527, 29889, 26045, 1053, 3142, 29892, 3160, 13, 13, 3166, 1791, 29918, 4468, 1053, 16053, 2153, 13, 13, 3166, 7882, 1053, 8386, ...
dolosse/hardware/xia/pixie16/list_mode_data_decoder.py
Tobias2023/dolosse
0
88220
""" file: list_mode_data_decoder.py brief: Decodes binary data produced by an XIA Pixie16 module author: <NAME> date: January 17, 2019 """ from enum import Enum from functools import partial from io import BytesIO from struct import unpack from dolosse.constants.data import WORD, HALF_WORD class HeaderCodes(Enum): ...
[ 1, 9995, 13, 1445, 29901, 1051, 29918, 8513, 29918, 1272, 29918, 7099, 6119, 29889, 2272, 13, 1182, 2575, 29901, 3826, 2631, 7581, 848, 7371, 491, 385, 1060, 10764, 349, 861, 347, 29896, 29953, 3883, 13, 8921, 29901, 529, 5813, 29958, 1...
deepcompton/scripts/CreateDatasetWithUncertainties.py
vuillaut/DeepIntegralCompton
1
27703
<gh_stars>1-10 # Deep Learning applique a l'imagerie Compton avec les donnees du satellite INTEGRAL # Hackatlon AstroInfo 2021 ##___ Importations import numpy as np import matplotlib.pyplot as plt import Utilitaires_Compton as compton import pickle as pkl from os import listdir from sys import setrecursionlimit #...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 21784, 29257, 623, 9854, 263, 301, 29915, 326, 1875, 347, 422, 12533, 2535, 966, 18332, 267, 868, 28421, 2672, 4330, 14345, 1964, 13, 29937, 379, 547, 271, 1...
api/src/controller/feature/FeatureDataController.py
SamuelJansen/FeatureManager
1
46706
from python_framework import Controller, ControllerMethod, HttpStatus from Role import * from dto.FeatureDataDto import * @Controller(url = '/feature-datas', tag='FeatureData', description='Single FeatureData controller') class FeatureDataController: @ControllerMethod(url='/<string:featureKey>/<string:sampleKey>...
[ 1, 515, 3017, 29918, 4468, 1053, 15830, 29892, 15830, 4062, 29892, 9056, 5709, 13, 3166, 1528, 280, 1053, 334, 13, 13, 3166, 270, 517, 29889, 19132, 1469, 29928, 517, 1053, 334, 13, 13, 29992, 2956, 29898, 2271, 353, 8207, 14394, 29899,...
inlineedit/apps.py
VolkerGoeschl/django-inlineedit
0
60419
<reponame>VolkerGoeschl/django-inlineedit<filename>inlineedit/apps.py from django.apps import AppConfig class InlineeditConfig(AppConfig): label = "inlineedit" name = 'inlineedit'
[ 1, 529, 276, 1112, 420, 29958, 13072, 3946, 8120, 1968, 29880, 29914, 14095, 29899, 14764, 5628, 29966, 9507, 29958, 14764, 5628, 29914, 13371, 29889, 2272, 13, 3166, 9557, 29889, 13371, 1053, 2401, 3991, 13, 13, 13, 1990, 512, 1220, 5628...
pyvisdk/enums/file_system_interface_version.py
Infinidat/pyvisdk
0
99683
######################################## # Automatically generated, do not edit. ######################################## from pyvisdk.thirdparty import Enum FileSystemInterfaceVersion = Enum( 'NFSV3_0', )
[ 1, 29871, 13, 13383, 13383, 7346, 13, 29937, 15854, 19574, 5759, 29892, 437, 451, 3863, 29889, 13, 13383, 13383, 7346, 13, 13, 13, 3166, 11451, 1730, 8181, 29889, 22585, 22633, 1053, 1174, 398, 13, 13, 2283, 3924, 10448, 6594, 353, 1174...
client/Agent/stare.py
zhanglei/Qalarm
1
81087
from os import stat import json import signal import socket import time from module import conf # Report def report(error, module): if report.fp is None: report.fp = open(conf.qalarm_file, 'a') # Level if 'level' not in error: error['level'] = 'default' else: error['level'] =...
[ 1, 515, 2897, 1053, 1002, 13, 5215, 4390, 13, 5215, 7182, 13, 5215, 9909, 13, 5215, 931, 13, 13, 3166, 3883, 1053, 1970, 13, 13, 13, 29937, 13969, 13, 1753, 3461, 29898, 2704, 29892, 3883, 1125, 13, 1678, 565, 3461, 29889, 18091, 33...
player.py
Drayux/Battlematus
0
1189
# PLAYER class player: def __init__(self):
[ 1, 396, 349, 18799, 1001, 13, 13, 1990, 4847, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 308, 13, 2 ]
hwt/interfaces/agents/signal.py
mgielda/hwt
0
146339
from collections import deque from hwt.hdl.constants import Time from hwt.simulator.agentBase import AgentBase, SyncAgentBase from hwt.synthesizer.exceptions import IntfLvlConfErr # 100 MHz DEFAULT_CLOCK = 10 * Time.ns class SignalAgent(SyncAgentBase): """ Agent for signal interface, it can use clock and r...
[ 1, 515, 16250, 1053, 316, 802, 13, 13, 3166, 298, 14554, 29889, 29882, 11671, 29889, 3075, 1934, 1053, 5974, 13, 3166, 298, 14554, 29889, 3601, 9183, 29889, 14748, 5160, 1053, 28330, 5160, 29892, 317, 2720, 19661, 5160, 13, 3166, 298, 1...
src/test/unit/testgamer.py
alok1974/pychess
2
73347
import unittest from pychess.core.gamer import Game from pychess.element.squarer import Square from pychess.element.piecer import Piece from pychess import constant as c from pychess.core.mover import Move def _check_win(game): if game.is_game_over: winner = str(game.winner.name).capitalize() pr...
[ 1, 1053, 443, 27958, 13, 13, 13, 3166, 282, 3376, 404, 29889, 3221, 29889, 29887, 4183, 1053, 8448, 13, 3166, 282, 3376, 404, 29889, 5029, 29889, 26613, 279, 261, 1053, 19256, 13, 3166, 282, 3376, 404, 29889, 5029, 29889, 12343, 2265, ...
FabricUI/widget/ConfigWidget.py
shuaih7/FabricUI
0
194782
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created on 11.25.2020 Updated on 04.12.2020 Author: <EMAIL> """ import os import sys import json from PyQt5.uic import loadUi from PyQt5.QtGui import QIntValidator from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot from PyQt5.QtWidgets import QTabWidget, QFileDialog abs...
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 15945, 29908, 13, 20399, 373, 29871, 29896, 29896, 29889, 29906, 29945, 29889, 29906, 29900, 29906, 29900, ...
Preprocessing/randomSampler.py
kstisser/DeepLearningPointCloud
0
78934
<reponame>kstisser/DeepLearningPointCloud<filename>Preprocessing/randomSampler.py import numpy as np class RandomSampler: def __init__(self): print("Opened random sampler") def randomlySamplePoints(self, points, downsampleNumber): rows = points.shape[0] randomIndices = (np.random.choic...
[ 1, 529, 276, 1112, 420, 29958, 29895, 303, 29415, 29914, 2772, 1022, 29931, 799, 1076, 5228, 20442, 29966, 9507, 29958, 6572, 19170, 29914, 8172, 22966, 20069, 29889, 2272, 13, 5215, 12655, 408, 7442, 13, 13, 1990, 16968, 22966, 20069, 29...
tests/auth/auth_test.py
oslokommune/okdata-sdk-python
2
1604066
import json import logging import re import pytest from okdata.sdk.auth.auth import Authenticate from okdata.sdk.auth.credentials.client_credentials import ClientCredentialsProvider from okdata.sdk.config import Config from okdata.sdk.exceptions import ApiAuthenticateError from freezegun import freeze_time from test...
[ 1, 1053, 4390, 13, 5215, 12183, 13, 5215, 337, 13, 13, 5215, 11451, 1688, 13, 13, 3166, 3431, 1272, 29889, 15348, 29889, 5150, 29889, 5150, 1053, 13189, 4173, 403, 13, 3166, 3431, 1272, 29889, 15348, 29889, 5150, 29889, 11944, 9409, 298...
Easy/1629_slowestKey.py
a-shah8/LeetCode
1
129234
class Solution: def slowestKey(self, releaseTimes: List[int], keysPressed: str) -> str: # Time Complexity: O(N) # Space Complexity: O(1) longest = releaseTimes[0] slowestKey = keysPressed[0] for i in range(1, len(releaseTimes)): ...
[ 1, 770, 24380, 29901, 13, 1678, 822, 5232, 342, 2558, 29898, 1311, 29892, 6507, 29164, 29901, 2391, 29961, 524, 1402, 6611, 24104, 29901, 851, 29897, 1599, 851, 29901, 13, 308, 13, 4706, 396, 5974, 26596, 537, 29901, 438, 29898, 29940, ...
lib/main.py
gammaforceio/infrascript
0
56916
#!/usr/bin/env python3 # vim: set ft=python:sw=4:ts=4 import os import sys # This location is set within the Dockerfile. sys.path.insert(0, '/opt/infra/lib') from infra import ( load_definitions_file, parse_args, get_org_repo, cleanup_boilerplate, write_tf_backend_file, write_tfvars_file, ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 325, 326, 29901, 731, 11791, 29922, 4691, 29901, 2774, 29922, 29946, 29901, 1372, 29922, 29946, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 29937, 910, 4423, 338, 731, 2...
cryptopanic-producer/src/utils/fetch_utils.py
bietdoikiem/pipeline-asm-1
0
69587
import requests from requests.models import Response from asyncio.queues import Queue import asyncio async def producer(queue: Queue, arg, callback): result: Response try: result = await callback(arg) await asyncio.sleep(0.2) await queue.put(result.json()) except Exception as error: ...
[ 1, 1053, 7274, 30004, 13, 3166, 7274, 29889, 9794, 1053, 13291, 30004, 13, 3166, 408, 948, 3934, 29889, 802, 1041, 1053, 5462, 434, 30004, 13, 5215, 408, 948, 3934, 30004, 13, 30004, 13, 30004, 13, 12674, 822, 14297, 29898, 9990, 29901,...
mrplot/modules/design/variable_design.py
enzofabricio/mrplot
0
24126
<reponame>enzofabricio/mrplot # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'variable_design.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): ...
[ 1, 529, 276, 1112, 420, 29958, 4666, 974, 370, 2200, 601, 29914, 29885, 29878, 5317, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 30004, 13, 30004, 13, 29937, 3812, 5314, 5759, 515, 5183, 14313, 934,...
src/rrt/rrt.py
hjp-muser/rrt-algorithms
0
132241
from src.rrt.rrt_base import RRTBase class RRT(RRTBase): def __init__(self, X, Q, x_init, x_goal, max_samples, r, prc=0.01): """ Template RRT planner :param X: Search Space :param Q: list of lengths of edges added to tree :param x_init: tuple, initial location :para...
[ 1, 515, 4765, 29889, 29878, 2273, 29889, 29878, 2273, 29918, 3188, 1053, 390, 13079, 5160, 13, 13, 13, 1990, 390, 13079, 29898, 29934, 13079, 5160, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1060, 29892, 660, 29892, 921, 29918, ...
Textbook/Chapter 3/statsFunctions2.py
hunterluepke/Learn-Python-for-Stats-and-Econ
16
42574
#statsFunctions2.py def total(list_obj): total = 0 n = len(list_obj) for i in range(n): total += list_obj[i] return total def mean(list_obj): n = len(list_obj) mean = total(list_obj) / n return mean list1 = [3, 6, 9, 12, 15] total_list1 = total(list1) print(total_list1) mean_list1...
[ 1, 396, 16202, 6678, 29879, 29906, 29889, 2272, 13, 1753, 3001, 29898, 1761, 29918, 5415, 1125, 13, 1678, 3001, 353, 29871, 29900, 13, 1678, 302, 353, 7431, 29898, 1761, 29918, 5415, 29897, 13, 1678, 363, 474, 297, 3464, 29898, 29876, 1...
insta/migrations/0003_auto_20200106_0720.py
Josephat-n/instagram
0
186712
# Generated by Django 2.1 on 2020-01-06 04:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('insta', '0002_profile_name'), ] operations = [ migrations.AlterField( model_name='image', name='image_comments', ...
[ 1, 396, 3251, 630, 491, 15337, 29871, 29906, 29889, 29896, 373, 29871, 29906, 29900, 29906, 29900, 29899, 29900, 29896, 29899, 29900, 29953, 29871, 29900, 29946, 29901, 29906, 29900, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 29892, ...
vedro/plugins/slicer/__init__.py
iri6e4k0/vedro
2
172943
<gh_stars>1-10 from ._slicer import Slicer __all__ = ("Slicer",)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 869, 29918, 29879, 506, 261, 1053, 317, 506, 261, 13, 13, 1649, 497, 1649, 353, 4852, 29903, 506, 261, 613, 29897, 13, 2 ]
libary/yml_wrapper.py
NekoFanatic/kaiji
0
19221
from typing import Union import yaml class ConfigReader: def __init__(self): with open("config.yml", "r") as f: data = yaml.safe_load(f) self.data = data def __getattr__(self, __name: str): s = __name.split("_") data = self.data try: for i in s...
[ 1, 515, 19229, 1053, 7761, 13, 5215, 343, 8807, 13, 13, 13, 1990, 12782, 6982, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 411, 1722, 703, 2917, 29889, 21053, 613, 376, 29878, 1159, 408, 285, 29901, 13, 9651, ...
bdbc/lib/python3.5/site-packages/bigchaindb_driver/crypto.py
entropyx/fiduchain-blockchain-interface
0
5693
from collections import namedtuple from cryptoconditions import crypto CryptoKeypair = namedtuple('CryptoKeypair', ('signing_key', 'verifying_key')) def generate_keypair(): """Generates a cryptographic key pair. Returns: :class:`~bigchaindb_driver.crypto.CryptoKeypair`: A :obj:`collections...
[ 1, 515, 16250, 1053, 4257, 23583, 13, 13, 3166, 274, 17929, 1116, 2187, 1053, 274, 17929, 13, 13, 13, 29907, 17929, 2558, 18784, 353, 4257, 23583, 877, 29907, 17929, 2558, 18784, 742, 6702, 4530, 292, 29918, 1989, 742, 525, 369, 9215, ...
rltf/agents/pg_agent.py
psFournier/rltf
90
188132
import gym import numpy as np from rltf.agents import LoggingAgent from rltf.memory import PGBuffer from rltf.monitoring import Monitor class AgentPG(LoggingAgent): def __init__(self, env_maker, model, gamma, lam, rollout_len, ...
[ 1, 1053, 330, 962, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 364, 1896, 29888, 29889, 351, 1237, 418, 1053, 4522, 3460, 19661, 13, 3166, 364, 1896, 29888, 29889, 14834, 418, 1053, 349, 7210, 3043, 13, 3166, 364, 1896, 29888, 29889, 37...
pyportable_installer/__main__.py
wuye999/pyportable-installer
20
101022
from lk_utils import relpath from rich_click import Path from ._vendor.rich_click_ext import click @click.grp(help='PyPortable Installer command line interface.') def cli(): pass @click.cmd() @click.arg('directory', default='.', type=Path()) def init(directory='.'): """ Initialize project with template...
[ 1, 515, 301, 29895, 29918, 13239, 1053, 1104, 2084, 13, 3166, 8261, 29918, 3808, 1053, 10802, 13, 13, 3166, 869, 29918, 19167, 29889, 4018, 29918, 3808, 29918, 1062, 1053, 2828, 13, 13, 13, 29992, 3808, 29889, 629, 29886, 29898, 8477, 2...
main.py
CaioMar/dsutils
1
168200
""" Author: <NAME> Since: 2019-12 """ import json import querybuilder as qb import importlib importlib.reload(qb) with open('./config.json', 'rb') as file: CONFIG = json.load(fp=file) SAFRAS = ['201901'] QUERY_DICT = CONFIG["123456"] print(qb.ConfigQueryReader(SAFRAS, QUERY_DICT)\ .build())
[ 1, 9995, 13, 13720, 29901, 529, 5813, 29958, 13, 23036, 29901, 29871, 29906, 29900, 29896, 29929, 29899, 29896, 29906, 13, 15945, 29908, 13, 5215, 4390, 13, 13, 5215, 2346, 16409, 408, 3855, 29890, 13, 5215, 1053, 1982, 13, 5215, 1982, ...
tests/test_misc.py
untom/scikits.cuda
0
1607981
<gh_stars>0 #!/usr/bin/env python """ Unit tests for scikits.cuda.misc """ from unittest import main, TestCase, TestSuite import pycuda.autoinit import pycuda.gpuarray as gpuarray import numpy as np from numpy.testing import assert_raises import skcuda.misc as misc class test_misc(TestCase): def setUp(self): ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 15945, 29908, 13, 8325, 6987, 363, 4560, 29895, 1169, 29889, 29883, 6191, 29889, 29885, 10669, 13, 15945, 29908, 13, 13, 3166, ...
test/integration/ggrc/proposal/api/test_property.py
j0gurt/ggrc-core
1
196711
<gh_stars>1-10 # Copyright (C) 2018 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """TestCase for proposal property api.""" from ggrc.models import all_models from integration.ggrc.models import factories from integration.ggrc.proposal.api import base class TestPropoert...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29947, 5087, 9266, 29889, 13, 29937, 10413, 21144, 1090, 1732, 597, 1636, 29889, 4288, 29889, 990, 29...
tests/test_patch.py
ElMehdi19/flask-mux
1
100899
from flask.testing import FlaskClient import pytest from flask import Flask from flask_mux import Mux from testing import test_router from testing.test_cases.middlewares import test_mws_router @pytest.fixture def client(): app = Flask(__name__) mux = Mux(app) mux.use('/', test_mws_router) return app.t...
[ 1, 515, 29784, 29889, 13424, 1053, 2379, 1278, 4032, 13, 5215, 11451, 1688, 13, 3166, 29784, 1053, 2379, 1278, 13, 3166, 29784, 29918, 29885, 1314, 1053, 341, 1314, 13, 3166, 6724, 1053, 1243, 29918, 15140, 13, 3166, 6724, 29889, 1688, ...
modular_exp.py
a-l-r1/cryptography
0
1609294
<reponame>a-l-r1/cryptography def square_modular_exp(x:int, power:int, modulus:int) -> int: if (modulus <= 0): raise ValueError("modular_pow: modulus must be " + \ "positive: (%d ** %d) %% %d" % (x, power, modulus)) result = 1 bit_list = [] while (power != 0): bit_list.insert(0, power % 2) power //= 2 ...
[ 1, 529, 276, 1112, 420, 29958, 29874, 29899, 29880, 29899, 29878, 29896, 29914, 29883, 4641, 5275, 13, 1753, 6862, 29918, 1545, 1070, 29918, 4548, 29898, 29916, 29901, 524, 29892, 3081, 29901, 524, 29892, 878, 14999, 29901, 524, 29897, 1599...
lib/desconst.py
elp2/des
20
67565
# Applied once at the beginning of the algorithm. INITIAL_PERMUTATION = [ 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, ...
[ 1, 29871, 13, 29937, 2401, 2957, 2748, 472, 278, 6763, 310, 278, 5687, 29889, 13, 26019, 25758, 29918, 13171, 29924, 2692, 8098, 353, 518, 13, 268, 29945, 29947, 29892, 29871, 29945, 29900, 29892, 29871, 29946, 29906, 29892, 29871, 29941, ...
src/tests/assembly/structured_config/assembled_config/test_assembled_config.py
fabio-d/fuchsia-stardock
5
29848
<gh_stars>1-10 # Copyright 2022 The Fuchsia 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 argparse import pathlib import subprocess import sys from run_assembly import run_product_assembly def main(): parser = argparse....
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29906, 450, 383, 19873, 423, 13189, 943, 29889, 2178, 10462, 21676, 29889, 13, 29937, 4803, 310, 445, 2752, 775, 338, ...
wflow-water-index/wflow-water-index.py
Fondus/Fondus-Python-SDK
0
26305
<filename>wflow-water-index/wflow-water-index.py import argparse import datetime import math from netCDF4 import Dataset import numpy as np import threading import queue # Worker 類別,負責處理資料 class Worker(threading.Thread): def __init__(self, req, res, num): threading.Thread.__init__(self) self.req ...
[ 1, 529, 9507, 29958, 29893, 1731, 29899, 13405, 29899, 2248, 29914, 29893, 1731, 29899, 13405, 29899, 2248, 29889, 2272, 13, 5215, 1852, 5510, 13, 5215, 12865, 13, 5215, 5844, 13, 3166, 7787, 29907, 4037, 29946, 1053, 13373, 24541, 13, 52...
parser_app/api/serializers.py
prantoamt/django-parser-app
3
99187
from rest_framework import serializers from rest_framework import serializers from rest_framework.fields import SkipField from rest_framework.fields import ChoiceField import six from parser_app.models import RegisteredModel class ChoiceDisplayField(ChoiceField): def __init__(self, *args, **kwargs): super...
[ 1, 515, 1791, 29918, 4468, 1053, 7797, 19427, 13, 3166, 1791, 29918, 4468, 1053, 7797, 19427, 13, 3166, 1791, 29918, 4468, 29889, 9621, 1053, 4971, 666, 3073, 13, 3166, 1791, 29918, 4468, 29889, 9621, 1053, 14542, 625, 3073, 13, 5215, 4...
glymur/lib/openjpeg.py
jarrelscy/glymur
0
197350
"""Wraps library calls to openjpeg. """ import ctypes import sys from ..config import glymur_config _, OPENJPEG = glymur_config() # Maximum number of tile parts expected by JPWL: increase at your will JPWL_MAX_NO_TILESPECS = 16 J2K_MAXRLVLS = 33 # Number of maximum resolution level authorized PATH_LEN = 4096 #...
[ 1, 9995, 29956, 336, 567, 3489, 5717, 304, 1722, 26568, 29889, 13, 15945, 29908, 13, 13, 5215, 274, 8768, 13, 5215, 10876, 13, 13, 3166, 6317, 2917, 1053, 330, 368, 29885, 332, 29918, 2917, 13, 13, 3383, 6418, 1430, 29967, 4162, 29954...
env.py
Reeche/metacognitive_learning_part23
0
81790
import numpy as np from heuristics import lex, equalweight from utils import select_p_based_on_experiment class environment(): def __init__(self, x1, y1, x2, y2, p, experiment): """ The environment is initiated with different parameters of x1, x2, y1, y2 and p. :param x1: uniform[-10, 10]...
[ 1, 1053, 12655, 408, 7442, 13, 13, 3166, 540, 332, 6765, 1053, 19566, 29892, 5186, 7915, 13, 3166, 3667, 29879, 1053, 1831, 29918, 29886, 29918, 6707, 29918, 265, 29918, 735, 15362, 13, 13, 1990, 5177, 7295, 13, 1678, 822, 4770, 2344, ...
venv/lib/python3.6/site-packages/ansible_collections/dellemc/openmanage/tests/unit/plugins/modules/test_dellemc_configure_idrac_eventing.py
usegalaxy-no/usegalaxy
1
172225
# -*- coding: utf-8 -*- # # Dell EMC OpenManage Ansible Modules # Version 3.0.0 # Copyright (C) 2020-2021 Dell Inc. or its subsidiaries. All Rights Reserved. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # from __future__ import (absolute_import, division, print_functio...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 29937, 13, 29937, 360, 514, 382, 12513, 4673, 2517, 482, 530, 1687, 3382, 2540, 13, 29937, 10079, 29871, 29941, 29889, 29900, 29889, 29900, 13, 29937...
pose_sync_pytorch/video_pose_landmarks.py
lilly9117/Cross-Cutting
40
57765
from torchvision import models import numpy as np import torch import os from moviepy.editor import VideoFileClip SKIP_FRAME_RATE = 10 MINIMAX_FRAME = 4 # 함수에서 documentaiton 읽기 model = models.detection.fasterrcnn_resnet50_fpn(pretrained=True) model.eval() os.environ['KMP_DUPLICATE_LIB_OK']='True' def extract_boxes(re...
[ 1, 515, 4842, 305, 4924, 1053, 4733, 13, 5215, 12655, 408, 7442, 13, 5215, 4842, 305, 13, 5215, 2897, 13, 3166, 14064, 2272, 29889, 15204, 1053, 13987, 2283, 29907, 3466, 13, 13, 16033, 5690, 29918, 29943, 4717, 2303, 29918, 29934, 3040...
esphome/components/zyaura/sensor.py
OttoWinter/esphomeyaml
249
117170
import esphome.codegen as cg import esphome.config_validation as cv from esphome import pins from esphome.components import sensor from esphome.const import ( CONF_ID, CONF_CLOCK_PIN, CONF_DATA_PIN, CONF_CO2, CONF_TEMPERATURE, CONF_HUMIDITY, DEVICE_CLASS_CARBON_DIOXIDE, DEVICE_CLASS_HUMI...
[ 1, 1053, 831, 561, 608, 29889, 401, 1885, 408, 274, 29887, 13, 5215, 831, 561, 608, 29889, 2917, 29918, 18157, 408, 13850, 13, 3166, 831, 561, 608, 1053, 282, 1144, 13, 3166, 831, 561, 608, 29889, 14036, 1053, 23530, 13, 3166, 831, ...
recsys/recommender/utils.py
shenghuiliuu/recsys
50
1615750
import numpy as np import pandas as pd from copy import deepcopy def super_str(x): if isinstance(x,np.int64): x=float(x) if isinstance(x,int): x=float(x) ans=str(x) return ans def convert_to_array(x): if isinstance(x, np.ndarray): return x else: return np.a...
[ 1, 1053, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 3166, 3509, 1053, 6483, 8552, 13, 13, 1753, 2428, 29918, 710, 29898, 29916, 1125, 13, 13, 1678, 565, 338, 8758, 29898, 29916, 29892, 9302, 29889, 524, 29953, 29946, 1125, 13, ...
Scripts/Prepare/generate_tif.py
broxtopd/Map-Tiling-App
0
1605149
<gh_stars>0 # Script create an image (tif) file from GIS data # ############################################################################### # Copyright (c) 2018, <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (th...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14415, 1653, 385, 1967, 313, 29873, 361, 29897, 934, 515, 402, 3235, 848, 30004, 13, 29937, 30004, 13, 13383, 13383, 13383, 13383, 7346, 4136, 2277, 29937, 30004, 13, 29937, 14187,...
threadingHelpers.py
Mimieam/NMouse
0
71914
from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * import traceback, sys import logging # Make this threadsafe class QtHandler(logging.Handler): def __init__(self, output_widget: QTextEdit): logging.Handler.__init__(self) self.widget: QTextEdit = output_widget ...
[ 1, 515, 10772, 17303, 29945, 29889, 17303, 28707, 1053, 334, 13, 3166, 10772, 17303, 29945, 29889, 17303, 8801, 29879, 1053, 334, 13, 3166, 10772, 17303, 29945, 29889, 17303, 9203, 1053, 334, 13, 13, 5215, 9637, 1627, 29892, 10876, 13, 52...
dm_control/scripts/print_profile.py
mhauskn/dm_control
0
1601647
<reponame>mhauskn/dm_control import sys import pstats p = pstats.Stats(sys.argv[1]) p.sort_stats('cumtime').print_stats(50)
[ 1, 529, 276, 1112, 420, 29958, 29885, 6208, 3959, 29914, 18933, 29918, 6451, 13, 5215, 10876, 13, 5215, 282, 16202, 13, 13, 29886, 353, 282, 16202, 29889, 25060, 29898, 9675, 29889, 19218, 29961, 29896, 2314, 13, 29886, 29889, 6605, 29918...
contests_atcoder/arc113/arc113_d_stupid.py
takelifetime/competitive-programming
0
149513
<filename>contests_atcoder/arc113/arc113_d_stupid.py from itertools import product from collections import defaultdict MOD = 998244353 n, m, k = map(int, input().split()) def stupid(n, m, k): ret = defaultdict(int) for content in product(range(1, k + 1), repeat=n * m): a = [] b = [0] * m ...
[ 1, 529, 9507, 29958, 1285, 9197, 29918, 271, 29883, 6119, 29914, 5666, 29896, 29896, 29941, 29914, 5666, 29896, 29896, 29941, 29918, 29881, 29918, 303, 786, 333, 29889, 2272, 13, 3166, 4256, 8504, 1053, 3234, 13, 3166, 16250, 1053, 2322, ...
portal/capstone/simulator.py
LDSSA/portal
2
178642
<reponame>LDSSA/portal<gh_stars>1-10 import json import logging import queue import random import time import traceback from concurrent.futures import ThreadPoolExecutor as PoolExecutor from datetime import datetime, timezone import requests from django.db import transaction, close_old_connections from django.conf imp...
[ 1, 529, 276, 1112, 420, 29958, 10249, 1799, 29909, 29914, 25089, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 4390, 13, 5215, 12183, 13, 5215, 9521, 13, 5215, 4036, 13, 5215, 931, 13, 5215, 9637, 1627, 13...
flink-python/pyflink/examples/datastream/windowing/sliding_time_window.py
rudikershaw/flink
9
146909
################################################################################ # 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...
[ 1, 835, 13383, 13383, 13383, 13383, 7346, 4136, 29937, 13, 29937, 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, ...
src/preprocessing/compute_moments.py
thomasjo/nemo-redux
0
102371
from argparse import ArgumentParser from pathlib import Path import torch from nemo.datasets import classification_dataloaders, detection_dataloaders from nemo.utils import ensure_reproducibility DATASET_TYPES = [ "classification", "detection", ] class RunningAverage: def __init__(self, num_channels=3)...
[ 1, 515, 1852, 5510, 1053, 23125, 11726, 13, 3166, 2224, 1982, 1053, 10802, 13, 13, 5215, 4842, 305, 13, 13, 3166, 6583, 29877, 29889, 14538, 1691, 1053, 12965, 29918, 29881, 2075, 29877, 24574, 29892, 15326, 29918, 29881, 2075, 29877, 245...
tests/functional/test_cmd_line_call.py
fevral13/django-migration-linter
0
86542
# Copyright 2019 3YOURMIND GmbH # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, soft...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29896, 29929, 29871, 29941, 29979, 22970, 16173, 29928, 18156, 13, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, ...
estimate_nislands_params.py
willyrv/estimate_islands
1
96495
<reponame>willyrv/estimate_islands<filename>estimate_nislands_params.py # -*- coding: utf-8 -*- """ Created on Mon May 2 14:48:39 2016 @author: willy """ import re import argparse from nisland_model import max_llk_estim_hist_theta_variable parser = argparse.ArgumentParser(description='Estimates the parameters of a...
[ 1, 529, 276, 1112, 420, 29958, 29893, 9403, 15291, 29914, 342, 6490, 29918, 275, 5252, 29966, 9507, 29958, 342, 6490, 29918, 6994, 5252, 29918, 7529, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, ...
SENN/scripts/main_beer.py
ricokoff/FACT-AI
1
92831
''' Code for training and evaluating Self-Explaining Neural Networks. Copyright (C) 2018 <NAME> <<EMAIL>> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, (at yo...
[ 1, 14550, 5920, 363, 6694, 322, 6161, 1218, 21782, 29899, 9544, 433, 2827, 2448, 3631, 8527, 29879, 29889, 13, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29947, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 13, 910, 1824...
app/lib/duplication_check/compare.py
WHUT-XGP/ASoulCnki
0
1609614
<reponame>WHUT-XGP/ASoulCnki # -*- encoding: utf-8 -*- """ Filename :compare.py Description :1:1文章比较 Time :2021/06/22 22:54:18 Author :hwa Version :1.0 """ def article_compare(article1, article2): red_list = [] for i in range(0, len(article1)): if article1[i...
[ 1, 529, 276, 1112, 420, 29958, 25039, 2692, 29899, 29990, 19903, 29914, 3289, 5059, 29907, 29876, 1984, 13, 29937, 448, 29930, 29899, 8025, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 3434, 3871, 308, 584, 18307, ...
dirbot/items.py
lihongqiang/crawl-image
1
39076
from scrapy.item import Item, Field class MyImage(Item): image_urls = Field() images = Field() image_paths = Field() image_label = Field()
[ 1, 515, 24559, 2272, 29889, 667, 1053, 10976, 29892, 8989, 13, 13, 13, 1990, 1619, 2940, 29898, 2001, 1125, 13, 13, 1678, 1967, 29918, 26045, 353, 8989, 580, 13, 1678, 4558, 353, 8989, 580, 13, 1678, 1967, 29918, 24772, 353, 8989, 580...
caos/_internal/utils/working_directory.py
caotic-co/caos
0
84890
<filename>caos/_internal/utils/working_directory.py import os def is_dev_environment() -> bool: """Returns True if the project source code structure is found in the working directory""" return os.path.isdir("caos") and \ os.path.isdir("caos/_cli_commands") and \ os.path.isfile(...
[ 1, 529, 9507, 29958, 1113, 359, 19891, 7564, 29914, 13239, 29914, 22899, 29918, 12322, 29889, 2272, 13, 5215, 2897, 13, 13, 13, 1753, 338, 29918, 3359, 29918, 20944, 580, 1599, 6120, 29901, 13, 1678, 9995, 11609, 29879, 5852, 565, 278, ...
atlas/auth/voms/models.py
kiae-grid/panda-bigmon-atlas
0
187810
<reponame>kiae-grid/panda-bigmon-atlas __author__ = 'sbel' from django.db import models from django.utils import timezone class VomsUser(models.Model): id = models.AutoField(db_column='ID', primary_key=True) username = models.CharField(max_length=60, db_column='USERNAME', db_index=True) dn = models.CharFi...
[ 1, 529, 276, 1112, 420, 29958, 29895, 23395, 29899, 7720, 29914, 29886, 5863, 29899, 3752, 3712, 29899, 271, 3333, 13, 1649, 8921, 1649, 353, 525, 29879, 6596, 29915, 13, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 3166, 9557, 29889, 1...
pqu/Check/check.py
brown170/fudge
14
36702
<filename>pqu/Check/check.py # <<BEGIN-copyright>> # Copyright 2021, Lawrence Livermore National Security, LLC. # See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: BSD-3-Clause # <<END-copyright>> import sys import glob, os, shutil, filecmp PYTHON = sys.executable files = sorted( glob.glob(...
[ 1, 529, 9507, 29958, 29886, 339, 29914, 5596, 29914, 3198, 29889, 2272, 13, 29937, 3532, 29933, 17958, 29899, 8552, 1266, 6778, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29896, 29892, 19520, 22469, 5514, 3086, 14223, 29892, 365, 1...
src/ganground/metric/kernel.py
tsirif/ganground
1
147789
# -*- coding: utf-8 -*- r""" :mod:`ganground.metric.kernel` -- Kernel function definitions ============================================================= .. module:: kernel :platform: Unix :synopsis: Helper functions for Maximum Mean Discrepancy, plus kernel function definitions. """ from abc import abstra...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29878, 15945, 29908, 13, 29901, 1545, 18078, 8029, 14486, 29889, 16414, 29889, 17460, 29952, 1192, 476, 5851, 740, 15848, 13, 9166, 9166, 9166, 4936, 2751,...
allennlp/nn/parallel/__init__.py
MSLars/allennlp
11,433
88956
<filename>allennlp/nn/parallel/__init__.py from allennlp.nn.parallel.sharded_module_mixin import ShardedModuleMixin from allennlp.nn.parallel.ddp_accelerator import ( DdpAccelerator, DdpWrappedModel, TorchDdpAccelerator, ) from allennlp.nn.parallel.fairscale_fsdp_accelerator import ( FairScaleFsdpAccele...
[ 1, 529, 9507, 29958, 497, 2108, 22833, 29914, 15755, 29914, 23482, 29914, 1649, 2344, 26914, 2272, 13, 3166, 599, 2108, 22833, 29889, 15755, 29889, 23482, 29889, 845, 25600, 29918, 5453, 29918, 28084, 262, 1053, 1383, 25600, 7355, 29924, 86...
aries_cloudcontroller/model/v10_credential_exchange.py
didx-xyz/aries-cloudcontroller-pyton
5
150921
<gh_stars>1-10 # coding: utf-8 from __future__ import annotations from datetime import date, datetime # noqa: F401 import re # noqa: F401 from typing import Any, Dict, List, Optional, Union, Literal # noqa: F401 from pydantic import AnyUrl, BaseModel, EmailStr, validator, Field, Extra # noqa: F401 from aries_cl...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 25495, 13, 13, 3166, 12865, 1053, 2635, 29892, 12865, 29871, 396, 694, 25621, 2...
python/TrackExtrapolateTool.py
Plamenna/proba
0
178466
import ROOT import shipunit as u minNdf = 20 parallelToZ = ROOT.TVector3(0., 0., 1.) top = ROOT.gGeoManager.GetTopVolume() z_ecal = top.GetNode('Ecal_1').GetMatrix().GetTranslation()[2] def extrapolateToPlane(fT,z): # etrapolate to a plane perpendicular to beam direction (z) rc,pos,mom = False,None,None fst = fT...
[ 1, 1053, 16641, 2891, 13, 5215, 7751, 5441, 408, 318, 13, 13, 1195, 29940, 2176, 353, 29871, 29906, 29900, 13, 23482, 1762, 29999, 353, 16641, 2891, 29889, 8050, 3019, 29941, 29898, 29900, 1696, 29871, 29900, 1696, 29871, 29896, 1846, 298...
src/hydra_zen/experimental/_implementations.py
rlbellaire/hydra-zen
0
165891
# Copyright (c) 2021 Massachusetts Institute of Technology # SPDX-License-Identifier: MIT from pathlib import Path from typing import Any, Callable, List, Mapping, Optional, Union from hydra._internal.callbacks import Callbacks from hydra._internal.hydra import Hydra from hydra._internal.utils import create_config_sea...
[ 1, 396, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29896, 16167, 8907, 310, 17968, 13, 29937, 10937, 29928, 29990, 29899, 29931, 293, 1947, 29899, 12889, 29901, 341, 1806, 13, 3166, 2224, 1982, 1053, 10802, 13, 3166, 19229,...
exercicios/agenda_de_contatos.py
ricardoluizbb/python-codes
1
98516
<reponame>ricardoluizbb/python-codes<gh_stars>1-10 AGENDA = {} def exibir_contatos(): if len(AGENDA) > 0: for contato in AGENDA: buscar_contato(contato) print('-' * 30) else: print('\nA sua agenda está vazia. Adicione alguns contatos!\n') def buscar_contato(contato): ...
[ 1, 529, 276, 1112, 420, 29958, 2200, 538, 20424, 466, 1327, 29914, 4691, 29899, 18137, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 10051, 1430, 7698, 353, 6571, 13, 13, 1753, 429, 747, 381, 29918, 1285, 4507, ...
difftorch/util.py
gbaydin/difftorch
30
169092
import torch import typing def check_vector(x, name): if not torch.is_tensor(x): raise RuntimeError('{} needs to be a Tensor'.format(name)) if x.dim() != 1: raise RuntimeError('{} needs to be a vector (one-dimensional Tensor)'.format(name)) def check_scalar(x, name): if not torch.is_tens...
[ 1, 1053, 4842, 305, 13, 5215, 19229, 13, 13, 13, 1753, 1423, 29918, 8111, 29898, 29916, 29892, 1024, 1125, 13, 1678, 565, 451, 4842, 305, 29889, 275, 29918, 20158, 29898, 29916, 1125, 13, 4706, 12020, 24875, 2392, 877, 8875, 4225, 304, ...
Multidimensional-Arrays/Lab-Multidimensional-Lists/primary_diagonal.py
dechevh/Python-Advanced
2
137333
<filename>Multidimensional-Arrays/Lab-Multidimensional-Lists/primary_diagonal.py<gh_stars>1-10 n = int(input()) matrix = [list(map(int, input().split(" "))) for _ in range(n)] total = 0 for i in range(n): value = matrix[i][i] total += value print(total)
[ 1, 529, 9507, 29958, 6857, 333, 326, 8180, 29899, 2588, 29879, 29914, 28632, 29899, 6857, 333, 326, 8180, 29899, 1293, 29879, 29914, 16072, 29918, 6051, 351, 7177, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 299...
jentry/entry/script/file.py
HansBug/jentry
0
147173
import codecs from typing import Iterator, Tuple import javalang from javalang.ast import Node from javalang.tree import MethodDeclaration, PackageDeclaration, ClassDeclaration from ...model import JavaEntry def is_entry_method(node: Node) -> bool: """ Determine if the given method node is an entry or not. ...
[ 1, 1053, 775, 2395, 13, 3166, 19229, 1053, 20504, 1061, 29892, 12603, 552, 13, 13, 5215, 432, 7712, 574, 13, 3166, 432, 7712, 574, 29889, 579, 1053, 9071, 13, 3166, 432, 7712, 574, 29889, 8336, 1053, 8108, 6185, 23838, 29892, 22029, 6...
src/asphalt/serialization/marshalling.py
Asphalt-framework/asphalt-serialization
0
48131
<filename>src/asphalt/serialization/marshalling.py from __future__ import annotations from typing import Any from asphalt.core import qualified_name def default_marshaller(obj: Any) -> Any: """ Retrieve the state of the given object. Calls the ``__getstate__()`` method of the object if available, other...
[ 1, 529, 9507, 29958, 4351, 29914, 294, 561, 1997, 29914, 15550, 2133, 29914, 3034, 845, 27855, 29889, 2272, 13, 3166, 4770, 29888, 9130, 1649, 1053, 25495, 13, 13, 3166, 19229, 1053, 3139, 13, 13, 3166, 408, 561, 1997, 29889, 3221, 1053...
src/plotting/TATA_enrichment_plots.py
Switham1/PromoterArchitecture
0
139785
<filename>src/plotting/TATA_enrichment_plots.py<gh_stars>0 import argparse import os import matplotlib.pyplot as plt import pandas as pd import seaborn as sns def parse_args(args): """define arguments""" parser = argparse.ArgumentParser(description="TATA_enrichment_plots") parser.add_argument( "f...
[ 1, 529, 9507, 29958, 4351, 29914, 5317, 1259, 29914, 29911, 8254, 29918, 264, 4018, 358, 29918, 26762, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 1852, 5510, 13, 5215, 2897, 13, 13, 5215, 22889, 29889, 2272, 5317...
tensorflow_addons/optimizers/tests/moving_average_test.py
leandro-gracia-gil/addons
2
66529
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29896, 29929, 450, 323, 6073, 17907, 13189, 943, 29889, 2178, 26863, 2538, 9841, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 15...
app/auth/passwords.py
LambArchie/Competition-Manager
0
115230
<reponame>LambArchie/Competition-Manager<gh_stars>0 """ Controls passwords checks """ from hashlib import sha1 from urllib.request import Request, urlopen from flask import current_app PWNED_PASSWORD_API = "https://api.pwnedpasswords.com/range/" def strength_check(password): """Checks if password reaches minimum ...
[ 1, 529, 276, 1112, 420, 29958, 29931, 1117, 13197, 347, 29914, 6843, 300, 654, 29899, 3260, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 13, 17825, 27630, 12747, 13, 15945, 29908, 13, 3166, 6608, 1982, 1053, 528, 29874,...
imblearn/utils/tests/test_validation.py
fengtongtong/imbalanced-learning
1
83223
<reponame>fengtongtong/imbalanced-learning """Test for the validation helper""" # Authors: <NAME> <<EMAIL>> # <NAME> # License: MIT from collections import Counter import numpy as np import pytest from pytest import raises from sklearn.neighbors.base import KNeighborsMixin from sklearn.neighbors import Near...
[ 1, 529, 276, 1112, 420, 29958, 29888, 996, 29873, 549, 29873, 549, 29914, 326, 5521, 8362, 29899, 21891, 13, 15945, 29908, 3057, 363, 278, 8845, 16876, 15945, 29908, 13, 29937, 13189, 943, 29901, 529, 5813, 29958, 3532, 26862, 6227, 6778,...
Chapter 4/restful_python_chapter_04_05/gamesapi/games/admin.py
Mohamed2011-bit/Building-RESTful-Python-Web-Services
116
130133
<gh_stars>100-1000 """ Book: Building RESTful Python Web Services Chapter 4: Throttling, Filtering, Testing and Deploying an API with Django Author: <NAME> - Twitter.com/gastonhillar Publisher: Packt Publishing Ltd. - http://www.packtpub.com """ from django.contrib import admin # Register your models here.
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 15945, 29908, 13, 10967, 29901, 17166, 16759, 1319, 5132, 2563, 15538, 13, 1451, 3314, 29871, 29946, 29901, 498, 26970, 1847, 29892, 19916, ...
setup.py
sdu-cfei/modest-py
37
8804
from setuptools import setup setup( name='modestpy', version='0.1', description='FMI-compliant model identification package', url='https://github.com/sdu-cfei/modest-py', keywords='fmi fmu optimization model identification estimation', author='<NAME>, Center for Energy Informatics SDU', aut...
[ 1, 515, 731, 21245, 8789, 1053, 6230, 13, 13, 14669, 29898, 13, 1678, 1024, 2433, 1545, 342, 2272, 742, 13, 1678, 1873, 2433, 29900, 29889, 29896, 742, 13, 1678, 6139, 2433, 29943, 10403, 29899, 2388, 492, 424, 1904, 29769, 3577, 742, ...
farmer/version.py
jstaf/farmer
0
1600758
<reponame>jstaf/farmer import click import pkg_resources def get_package_versions(): distributions = [dist for dist in pkg_resources.working_set if dist.project_name.startswith(__package__)] return {dist.project_name: dist.version for dist in distributions} def print_package_versions(): for package, ver...
[ 1, 529, 276, 1112, 420, 29958, 29926, 303, 2142, 29914, 15641, 1050, 13, 5215, 2828, 13, 5215, 282, 9415, 29918, 13237, 13, 13, 13, 1753, 679, 29918, 5113, 29918, 26100, 7295, 13, 1678, 18822, 353, 518, 5721, 363, 1320, 297, 282, 9415...
main.py
ANOVAProjectUSYD/trading-bot
0
68707
import os, argparse import datetime import time from poloniex import Poloniex def read_ticker(): #TODO: should add a check to see if user input is in the list of valid options ticker = input("Enter the ticker pair, e.g. BTC_ETH \n") return ticker def continueOption(): '''Allows user to be able to vie...
[ 1, 1053, 2897, 29892, 1852, 5510, 13, 5215, 12865, 13, 5215, 931, 13, 3166, 1248, 9599, 29916, 1053, 2043, 9599, 29916, 13, 13, 1753, 1303, 29918, 29873, 6541, 7295, 13, 1678, 396, 4986, 3970, 29901, 881, 788, 263, 1423, 304, 1074, 56...
ceilometer/network/notifications.py
rackerlabs/instrumented-ceilometer
3
16540
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Author: <NAME> <<EMAIL>> # # 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/l...
[ 1, 396, 448, 29930, 29899, 8025, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 13, 29937, 14187, 1266, 29871, 30211, 29871, 29906, 29900, 29896, 29906, 1570, 16814, 8527, 29892, 365, 12182, 313, 29928, 1633, 8514, 29897, 13, 299...