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
findtime/utils.py
MattCCS/FindTime
0
27445
<filename>findtime/utils.py<gh_stars>0 def day_of_year(dt): return dt.timetuple().tm_yday
[ 1, 529, 9507, 29958, 2886, 2230, 29914, 13239, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 13, 1753, 2462, 29918, 974, 29918, 6360, 29898, 6008, 1125, 13, 1678, 736, 11636, 29889, 9346, 24120, 552, 2141, 18276, 29918, 2...
CoV19/base/urls.py
just-ary27/CovBot-revamp
1
166941
<filename>CoV19/base/urls.py from django.urls import path,include from . import views urlpatterns = [ path('',views.index), ]
[ 1, 529, 9507, 29958, 7967, 29963, 29896, 29929, 29914, 3188, 29914, 26045, 29889, 2272, 13, 3166, 9557, 29889, 26045, 1053, 2224, 29892, 2856, 13, 13, 3166, 869, 1053, 8386, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 2224, 877, 742, 74...
groot.py
adit-chandra/project-groot
0
67727
import sys import gzip import bz2 import os import time import subprocess import math import multiprocessing as mp from optparse import OptionParser from utils import * import AAF def main(): parser = OptionParser() parser.add_option("-k", dest="kLen", type=int, default=25, help="k for ...
[ 1, 1053, 10876, 13, 5215, 330, 7554, 13, 5215, 289, 29920, 29906, 13, 5215, 2897, 13, 5215, 931, 13, 5215, 1014, 5014, 13, 5215, 5844, 13, 5215, 6674, 307, 985, 292, 408, 22326, 13, 3166, 3523, 5510, 1053, 10831, 11726, 13, 13, 3166...
Scripts/GeMS_MetadataCSDGM2_Arc10.py
mahunterUSGS/GeMS_Tools
0
66485
""" script to ease construction of CSDGM2-style metadata for an GeMS-style geodatabase. To use, Run ValidateDatabase to make sure that the database is complete and there are no missing DMU, Glossary, or DataSources entries In ArcCatalog, go to Customize>Options>Metadata and set Metadata Style to ...
[ 1, 9995, 13, 2154, 304, 16326, 7632, 310, 315, 7230, 21576, 29906, 29899, 3293, 15562, 363, 385, 1879, 4345, 29899, 3293, 1737, 397, 3223, 29889, 13, 13, 1762, 671, 29892, 13, 1678, 7525, 15758, 403, 9112, 304, 1207, 1854, 393, 278, 2...
sprite-animation-generator.py
eijiuema/sprite-animation-generator
0
38285
from collections import defaultdict from PIL import Image import operator image = Image.open("images\\test.png") pixel_map = image.load() initial_coordinate = tuple(int(x.strip()) for x in input("Initial coordinates: ").split(',')) pixel_list = [] directions = [(1, 0), (0, -1), (1, -1), ...
[ 1, 515, 16250, 1053, 2322, 8977, 13, 3166, 349, 6227, 1053, 7084, 13, 5215, 5455, 13, 13, 3027, 353, 7084, 29889, 3150, 703, 8346, 1966, 1688, 29889, 2732, 1159, 13, 13, 29886, 15711, 29918, 1958, 353, 1967, 29889, 1359, 580, 13, 13, ...
subsurface/geological_formats/segy_reader.py
andieie/subsurface
55
30690
from typing import Union from scipy.spatial.qhull import Delaunay from shapely.geometry import LineString from subsurface.structs.base_structures import StructuredData import numpy as np try: import segyio segyio_imported = True except ImportError: segyio_imported = False def read_in_segy(filepath: str, ...
[ 1, 515, 19229, 1053, 7761, 13, 3166, 4560, 2272, 29889, 1028, 15238, 29889, 29939, 29882, 913, 1053, 360, 3100, 348, 388, 13, 3166, 528, 481, 873, 29889, 19156, 1053, 7407, 1231, 13, 3166, 1014, 7610, 2161, 29889, 4984, 29879, 29889, 31...
text_studio/pipeline.py
tevnpowers/thesis
2
44015
<filename>text_studio/pipeline.py """Sequence of text processing components. A text processing pipeline is a sequence of text processing components, namely text_studio.Annotator and text_studio.Action objects that are executed in order to produce newly annotated data and/or insights. """ from collections import Ordere...
[ 1, 529, 9507, 29958, 726, 29918, 12073, 29914, 13096, 5570, 29889, 2272, 13, 15945, 29908, 20529, 310, 1426, 9068, 7117, 29889, 13, 13, 29909, 1426, 9068, 16439, 338, 263, 5665, 310, 1426, 9068, 7117, 29892, 13, 8588, 873, 1426, 29918, ...
src/utils/summarize_data.py
bgerofi/mlperf-deepcam
16
71972
# The MIT License (MIT) # # Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the...
[ 1, 396, 450, 341, 1806, 19245, 313, 26349, 29897, 13, 29937, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29900, 405, 13044, 10764, 315, 1955, 29925, 1955, 8098, 29889, 2178, 10462, 21676, 29889, 13, 29937, 13, 2...
app/__init__.py
ch0ppy35/pyTed
0
154013
from flask import Flask import logging import os from logging.handlers import RotatingFileHandler, SMTPHandler from config import Config app = Flask(__name__) app.config.from_object(Config) if not os.path.exists('logs'): os.mkdir('logs') # Normal logging setup file_handler = RotatingFileHandler('logs/pyted.log',...
[ 1, 515, 29784, 1053, 2379, 1278, 13, 5215, 12183, 13, 5215, 2897, 13, 3166, 12183, 29889, 3179, 9306, 1053, 9664, 1218, 2283, 4598, 29892, 13766, 3557, 4598, 13, 3166, 2295, 1053, 12782, 13, 13, 932, 353, 2379, 1278, 22168, 978, 1649, ...
gym_pool/envs/utils.py
to314as/gym-pool
1
162502
<reponame>to314as/gym-pool<filename>gym_pool/envs/utils.py import functools import operator def prod(l): return functools.reduce(operator.mul, l, 1)
[ 1, 529, 276, 1112, 420, 29958, 517, 29941, 29896, 29946, 294, 29914, 29887, 962, 29899, 10109, 29966, 9507, 29958, 29887, 962, 29918, 10109, 29914, 264, 4270, 29914, 13239, 29889, 2272, 13, 5215, 2090, 312, 8789, 13, 5215, 5455, 13, 13, ...
backend/tests/test_search.py
Davidw1339/GroceryBuddy
0
35458
<filename>backend/tests/test_search.py import json import search import test_data import copy from utils import Error def test_no_args(client): ''' Tests search without arguments. ''' rv = client.get('/search') response = json.loads(rv.data) assert response == {'success': False, ...
[ 1, 529, 9507, 29958, 27852, 29914, 21150, 29914, 1688, 29918, 4478, 29889, 2272, 13, 5215, 4390, 13, 5215, 2740, 13, 5215, 1243, 29918, 1272, 13, 5215, 3509, 13, 3166, 3667, 29879, 1053, 4829, 13, 13, 13, 1753, 1243, 29918, 1217, 29918,...
udacity/take_a_break.py
JuanBalceda/python-basics
0
167015
import webbrowser import time # Take a break every hours num = 0 while num < 3: print('Begin at: ' + time.ctime()) time.sleep(2*60*60) webbrowser.open("https://www.youtube.com/watch?v=dlFA0Zq1k2A&list=RDdlFA0Zq1k2A") num += 1 print('End at: ' + time.ctime())
[ 1, 1053, 591, 1327, 8777, 13, 5215, 931, 13, 13, 29937, 11190, 263, 2867, 1432, 6199, 13, 13, 1949, 353, 29871, 29900, 13, 13, 8000, 954, 529, 29871, 29941, 29901, 13, 1678, 1596, 877, 17946, 472, 29901, 525, 718, 931, 29889, 312, 6...
src/preprocessor.py
aaditkamat/dr-ranking-metric
18
75221
<gh_stars>10-100 import codecs import yaml from typing import Tuple, Dict import numpy as np import pandas as pd from scipy import stats from sklearn.model_selection import train_test_split import tensorflow as tf from tensorflow.python.framework import ops from model import MF def sigmoid(x: np.ndarray) -> np.ndar...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 5215, 775, 2395, 13, 5215, 343, 8807, 13, 3166, 19229, 1053, 12603, 552, 29892, 360, 919, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518,...
scripts/trials.py
brychanrobot/orrt-star-ros
3
90403
import subprocess import time for obstacles in [5, 10, 15, 20]: scores = [] for i in range(30): procs = [] for j in range(4): time.sleep(0.1) # allow for different random number generation procs.append(subprocess.Popen(['build/main', '-w', '15' , '-l', '180', '-o', str(obstacles), '--fmt'], stdout=subpro...
[ 1, 1053, 1014, 5014, 13, 5215, 931, 13, 13, 1454, 14979, 23435, 297, 518, 29945, 29892, 29871, 29896, 29900, 29892, 29871, 29896, 29945, 29892, 29871, 29906, 29900, 5387, 13, 13, 12, 1557, 2361, 353, 5159, 13, 13, 12, 1454, 474, 297, ...
tests/integration/test_integration_article.py
pwitab/visma
5
35871
<reponame>pwitab/visma<filename>tests/integration/test_integration_article.py import pytest from visma.api import VismaClientException from visma.models import Article, ArticleAccountCoding, Unit class TestCRUDArticle: @pytest.fixture() def article(self): article = Article.objects.all()[0] y...
[ 1, 529, 276, 1112, 420, 29958, 29886, 29893, 277, 370, 29914, 1730, 655, 29966, 9507, 29958, 21150, 29914, 27925, 29914, 1688, 29918, 27925, 29918, 7914, 29889, 2272, 13, 5215, 11451, 1688, 13, 13, 3166, 1998, 655, 29889, 2754, 1053, 5741...
test/test_brute_force_2.py
MikeJongen/nonogram-solver
0
167208
<gh_stars>0 import sys import os import unittest import nonogram_solver.basic.brute_force_2 as brute_force class TestBasic(unittest.TestCase): def test_number_of_solutions(self): row = brute_force.BruteForceRowSolver2([2, 1], [0] * 5) no_solutions = row._get_number_of_solutions() self.ass...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 443, 27958, 13, 13, 5215, 1661, 13342, 29918, 2929, 369, 29889, 16121, 29889, 1182, 1082, 29918, 10118, 29918, 29906, 408, 1506, 1082, 29918, 10118,...
tls_parser/change_cipher_spec_protocol.py
nabla-c0d3/tls_parser
6
198391
<reponame>nabla-c0d3/tls_parser from tls_parser.record_protocol import TlsRecord, TlsRecordHeader, TlsSubprotocolMessage, TlsRecordTypeByte from tls_parser.tls_version import TlsVersionEnum from typing import Tuple class TlsChangeCipherSpecRecord(TlsRecord): @classmethod def from_parameters(cls, tls_version: ...
[ 1, 529, 276, 1112, 420, 29958, 8511, 29899, 29883, 29900, 29881, 29941, 29914, 29873, 3137, 29918, 16680, 13, 3166, 260, 3137, 29918, 16680, 29889, 11651, 29918, 20464, 1053, 323, 3137, 9182, 29892, 323, 3137, 9182, 7850, 29892, 323, 3137, ...
cpp/msvc/parse_sln_internal.py
btc-ag/revengtools
2
134968
<reponame>btc-ag/revengtools ''' Created on 01.04.2011 @author: SIGIESEC ''' import logging import re import sys import ntpath import posixpath class InternalSolutionFileParser(object): """ A parser for Visual Studio 2008 Solution files (.SLN). It parses the dependencies between native C++ projects only. ...
[ 1, 529, 276, 1112, 420, 29958, 3116, 29883, 29899, 351, 29914, 27901, 29887, 8504, 13, 12008, 13, 20399, 373, 29871, 29900, 29896, 29889, 29900, 29946, 29889, 29906, 29900, 29896, 29896, 13, 13, 29992, 8921, 29901, 317, 6259, 8673, 1660, ...
sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/aio.py
rsdoherty/azure-sdk-for-python
207
120774
<gh_stars>100-1000 # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Genera...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 29937, 448, 2683, 2683, 2683, 2683, 1378, 29899, 13, 29937, 14187, 1266, 313, 29883, 29897, 778...
foobar2020/solutionProblem19.py
franklinvp/foobar
7
186702
<gh_stars>1-10 This one I had done before https://github.com/franklinvp/foobar/blob/master/foobar2018/extra_challenge_solar_panels.py but hadn't tested it against the secret testcases. It passed.
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 4013, 697, 306, 750, 2309, 1434, 13, 13, 1678, 2045, 597, 3292, 29889, 510, 29914, 29888, 10003, 1915, 29894, 29886, 29914, 1181, 22872, 29914, 10054, 29914, 6207, 29...
pybond/bond/bond_helpers/observe_files.py
necula01/bond
8
35448
<reponame>necula01/bond # Helper functions to observe files and directories import os import re def collect_directory_contents(directory, file_filter=None, collect_file_contents=False): """ Collect an object reflecting the contents of a directory ...
[ 1, 529, 276, 1112, 420, 29958, 484, 1810, 29874, 29900, 29896, 29914, 29890, 898, 13, 29937, 6162, 546, 3168, 304, 14111, 2066, 322, 17525, 13, 5215, 2897, 13, 5215, 337, 13, 13, 1753, 6314, 29918, 12322, 29918, 10853, 29898, 12322, 298...
mathgenerator/funcs/fibonacciSeriesFunc.py
furins/mathgenerator
0
53188
<filename>mathgenerator/funcs/fibonacciSeriesFunc.py from .__init__ import * def fibonacciSeriesFunc(minNo=1): n = random.randint(minNo,20) def createFibList(n): l=[] for i in range(n): if i<2: l.append(i) else: val = l[i-1]+l[i-2] ...
[ 1, 529, 9507, 29958, 755, 27959, 29914, 7692, 2395, 29914, 29888, 747, 265, 21566, 19204, 14400, 29889, 2272, 13, 3166, 869, 1649, 2344, 1649, 1053, 334, 13, 13, 13, 1753, 18755, 265, 21566, 19204, 14400, 29898, 1195, 3782, 29922, 29896, ...
tests/test_gists.py
github3py/github3py
2
129885
import github3 from github3 import gists from tests.utils import (BaseCase, load) class TestGist(BaseCase): def __init__(self, methodName='runTest'): super(TestGist, self).__init__(methodName) self.gist = gists.Gist(load('gist')) self.api = 'https://api.github.com/gists/3813862' def s...
[ 1, 1053, 18546, 29941, 13, 3166, 18546, 29941, 1053, 330, 2879, 13, 3166, 6987, 29889, 13239, 1053, 313, 5160, 8259, 29892, 2254, 29897, 13, 13, 13, 1990, 4321, 29954, 391, 29898, 5160, 8259, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311...
src/lib/__init__.py
gfjiangly/RCNet
0
14424
# -*- encoding:utf-8 -*- # @Time : 2019/10/23 15:45 # @Author : gfjiang # @Site : # @File : __init__.py # @Software: PyCharm
[ 1, 396, 448, 29930, 29899, 8025, 29901, 9420, 29899, 29947, 448, 29930, 29899, 30004, 13, 29937, 732, 2481, 1678, 584, 29871, 29906, 29900, 29896, 29929, 29914, 29896, 29900, 29914, 29906, 29941, 29871, 29896, 29945, 29901, 29946, 29945, 3000...
worker/config.py
projectweekend/3spot
0
74614
<reponame>projectweekend/3spot import os SQS_WAIT_TIME = os.getenv('SQS_WAIT_TIME', 20) SLEEP_TIME = os.getenv('SLEEP_TIME', 60) PROD_LOGGER = os.getenv('PROD_LOGGER', False) SQS_QUEUE_NAME = os.getenv('SQS_QUEUE_NAME', 'song-feed-playlists-to-process') SQS_REGION = os.getenv('SQS_REGION', 'us-east-1') SPOTIFY_C...
[ 1, 529, 276, 1112, 420, 29958, 4836, 18448, 355, 29914, 29941, 17500, 13, 5215, 2897, 13, 13, 13, 29903, 29984, 29903, 29918, 12982, 1806, 29918, 15307, 353, 2897, 29889, 657, 6272, 877, 29903, 29984, 29903, 29918, 12982, 1806, 29918, 153...
Algorithms/Easy/1475. Final Prices With a Special Discount in a Shop/answer.py
KenWoo/Algorithm
0
127365
<reponame>KenWoo/Algorithm from typing import List class Solution: def finalPrices(self, prices: List[int]) -> List[int]: res = [] N = len(prices) for i in range(N-1): j = i + 1 while j < N and prices[i] < prices[j]: j += 1 res.append(pri...
[ 1, 529, 276, 1112, 420, 29958, 29968, 264, 29956, 3634, 29914, 22461, 4540, 13, 3166, 19229, 1053, 2391, 13, 13, 13, 1990, 24380, 29901, 13, 1678, 822, 2186, 4040, 1575, 29898, 1311, 29892, 26094, 29901, 2391, 29961, 524, 2314, 1599, 23...
.env/lib/python3.8/site-packages/aws_cdk/aws_codebuild/_jsii/__init__.py
careck/begariver-cdk
0
1611363
import abc import builtins import datetime import enum import typing import jsii import publication import typing_extensions import aws_cdk.assets._jsii import aws_cdk.aws_cloudwatch._jsii import aws_cdk.aws_codecommit._jsii import aws_cdk.aws_ec2._jsii import aws_cdk.aws_ecr._jsii import aws_cdk.aws_ecr_assets._jsii...
[ 1, 1053, 25638, 13, 5215, 4240, 1144, 13, 5215, 12865, 13, 5215, 14115, 13, 5215, 19229, 13, 13, 5215, 432, 1039, 29875, 13, 5215, 17745, 13, 5215, 19229, 29918, 24299, 13, 13, 5215, 25879, 29918, 2252, 29895, 29889, 16596, 3032, 29926,...
main.py
Spain-AI/dark_helper
0
33789
<filename>main.py from capture_monitor import CaptureMonitor from face_lib import FaceSystem from visualizer import Visualizer #MainWindow #from PyQt5 import QtCore, QtGui, QtWidgets import os monitor = CaptureMonitor(bb=(0, 0, 600, 480)) face_system = FaceSystem(os.path.abspath("./bio/bio.json")) def thread_process(...
[ 1, 529, 9507, 29958, 3396, 29889, 2272, 13, 3166, 10446, 29918, 3712, 2105, 1053, 8868, 545, 7185, 2105, 13, 3166, 3700, 29918, 1982, 1053, 10635, 3924, 13, 3166, 7604, 3950, 1053, 9249, 3950, 396, 6330, 5907, 13, 29937, 3166, 10772, 17...
tests/unit/app/test_session.py
bernease/whylogs-python
0
8533
<reponame>bernease/whylogs-python import pytest from whylogs.app.session import get_or_create_session, get_session, get_logger, reset_default_session, session_from_config from whylogs.app.config import SessionConfig from whylogs.app.session import Session from pandas import util def test_get_global_session(): _...
[ 1, 529, 276, 1112, 420, 29958, 495, 484, 559, 29914, 14606, 20756, 29899, 4691, 13, 13, 13, 5215, 11451, 1688, 13, 3166, 2020, 20756, 29889, 932, 29889, 7924, 1053, 679, 29918, 272, 29918, 3258, 29918, 7924, 29892, 679, 29918, 7924, 298...
pred_to_eval/test_ct_engine.py
FluteXu/ms-project
0
68013
# Copyright (c) 2017-present, Facebook, 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
[ 1, 396, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29955, 29899, 6338, 29892, 13327, 29892, 9266, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, ...
prune_main.py
Sallyeen/DeepCompression-PyTorch-master
7
1605124
<reponame>Sallyeen/DeepCompression-PyTorch-master if __name__ == '__main__': import pruning.main
[ 1, 529, 276, 1112, 420, 29958, 29903, 635, 27294, 29914, 2772, 1022, 1523, 2590, 29899, 19737, 29911, 25350, 29899, 6207, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 12, 5215, 544, 27964, 29889, 3396, 13, 13, 2 ]
models.py
shepherd-dc/flask-blog
0
85983
<reponame>shepherd-dc/flask-blog from exts import db from datetime import datetime from werkzeug.security import generate_password_hash, check_password_hash class User(db.Model): __tablename__ = 'user' id = db.Column(db.Integer, primary_key=True, autoincrement=True) email = db.Column(db.String(50), nullabl...
[ 1, 529, 276, 1112, 420, 29958, 11360, 561, 2018, 29899, 13891, 29914, 1579, 1278, 29899, 7312, 13, 3166, 1294, 29879, 1053, 4833, 13, 3166, 12865, 1053, 12865, 13, 3166, 23085, 13289, 29889, 8926, 1053, 5706, 29918, 5630, 29918, 8568, 298...
src/dflow/analysis.py
slawler/SI_2019_Coastal
1
82685
<reponame>slawler/SI_2019_Coastal<filename>src/dflow/analysis.py def tide_constituents(dates, elevation): from tappy import tappy quiet = True debug = False outputts = False outputxml = False ephemeris = False rayleigh = 1.0 print_vau_table = False missing_data = 'ignore' linear...
[ 1, 529, 276, 1112, 420, 29958, 29879, 10653, 1358, 29914, 5425, 29918, 29906, 29900, 29896, 29929, 29918, 7967, 579, 284, 29966, 9507, 29958, 4351, 29914, 29881, 1731, 29914, 15916, 29889, 2272, 13, 1753, 260, 680, 29918, 3075, 1981, 1237, ...
teuthology/orchestra/test/util.py
varshar16/teuthology
117
135471
def assert_raises(excClass, callableObj, *args, **kwargs): """ Like unittest.TestCase.assertRaises, but returns the exception. """ try: callableObj(*args, **kwargs) except excClass as e: return e else: if hasattr(excClass,'__name__'): excName = excClass.__name__ e...
[ 1, 822, 4974, 29918, 336, 4637, 29898, 735, 29883, 2385, 29892, 1246, 519, 9930, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 1678, 9995, 13, 1678, 8502, 443, 27958, 29889, 3057, 8259, 29889, 9294, 29934, 1759, 267, 29892, 541, 3639, ...
Stage_3/Task11_Graph/depth_first_search.py
Pyabecedarian/Algorithms-and-Data-Structures-using-Python
0
7271
""" The Depth First Search (DFS) The goal of a dfs is to search as deeply as possible, connecting as many nodes in the graph as possible and branching where necessary. Think of the BFS that builds a search tree one level at a time, whereas the DFS creates a search tree by exploring one branch of the tree a...
[ 1, 9995, 13, 1576, 10034, 386, 3824, 11856, 313, 4037, 29903, 29897, 13, 13, 1678, 450, 7306, 310, 263, 4489, 29879, 338, 304, 2740, 408, 24344, 408, 1950, 29892, 16791, 408, 1784, 7573, 297, 278, 3983, 408, 1950, 322, 13, 1678, 5443,...
src/prefpanels/PrintingPanel.py
vadmium/grailbrowser
9
81325
"""General Grail preferences panel.""" __version__ = "$Revision: 1.12 $" import grailutil import PrefsPanels import string import Tkinter GROUP = "printing" LABEL_WIDTH = 16 class FontSizeVar(Tkinter.StringVar): _default = "10.0 / 10.7" def get(self): sizes = grailutil.conv_fontsize(Tkinter.String...
[ 1, 9995, 15263, 4989, 309, 5821, 2063, 9451, 1213, 15945, 13, 13, 1649, 3259, 1649, 353, 3908, 1123, 4924, 29901, 29871, 29896, 29889, 29896, 29906, 395, 29908, 13, 13, 5215, 2646, 309, 4422, 13, 5215, 349, 24539, 23684, 1379, 13, 5215,...
tests/components/sonos/test_sensor.py
MrDelik/core
3
129171
"""Tests for the Sonos battery sensor platform.""" from unittest.mock import PropertyMock from soco.exceptions import NotSupportedException from homeassistant.components.sensor import SCAN_INTERVAL from homeassistant.components.sonos.binary_sensor import ATTR_BATTERY_POWER_SOURCE from homeassistant.const import STATE...
[ 1, 9995, 24376, 363, 278, 5791, 359, 16988, 23530, 7481, 1213, 15945, 13, 3166, 443, 27958, 29889, 17640, 1053, 9079, 18680, 13, 13, 3166, 269, 6235, 29889, 11739, 29879, 1053, 2216, 14039, 287, 2451, 13, 13, 3166, 3271, 465, 22137, 298...
asteval/asteval.py
sthagen/asteval
125
198352
#!/usr/bin/env python """Safe(ish) evaluation of mathematical expression using Python's ast module. This module provides an Interpreter class that compiles a restricted set of Python expressions and statements to Python's AST representation, and then executes that representation using values held in a symbol table. T...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 17618, 1725, 29898, 728, 29897, 17983, 310, 19475, 4603, 773, 5132, 29915, 29879, 8717, 13, 5453, 29889, 13, 13, 4013, 3883, 8128, 385, 4124, 1457, 357, 770, 393, 752, 54...
hw0/code/hw0.py
kandluis/cs224w
6
119200
<reponame>kandluis/cs224w # coding: utf-8 # ## 1. Analyzing the Wikipedia voters network [9 points] # Download the Wikipedia voting network wiki-Vote.txt.gz: http://snap.stanford.edu/ # data/wiki-Vote.html. # # Using one of the network analysis tools above, load the Wikipedia voting network. # # Note that Wikipedi...
[ 1, 529, 276, 1112, 420, 29958, 29895, 392, 29880, 4664, 29914, 2395, 29906, 29906, 29946, 29893, 13, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 13, 29937, 444, 29871, 29896, 29889, 11597, 12339, 292, 278, 14109, 9014, 414, 3564, 51...
deepthinking/utils/prefix_sums_data.py
aks2203/deep-thinking
19
101752
""" prefix_sums_data.py Prefix sum related dataloaders Collaboratively developed by <NAME>, <NAME>, <NAME>, and <NAME>. Developed for DeepThinking project October 2021 """ import torch from torch.utils import data from easy_to_hard_data import PrefixSumDataset # Ignore statemenst for pylint:...
[ 1, 9995, 10944, 29918, 2083, 29879, 29918, 1272, 29889, 2272, 13, 1678, 349, 9569, 2533, 4475, 1418, 7003, 24574, 13, 13, 1678, 13435, 3717, 6703, 8906, 13, 1678, 491, 529, 5813, 10202, 529, 5813, 10202, 13, 1678, 529, 5813, 10202, 322,...
tqsdk/demo/example/stgy4zd.py
boyscout2008/tqsdk-python
0
176617
<filename>tqsdk/demo/example/stgy4zd.py #!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Golden' ''' 震荡品种策略函数:两波多后的大空,一波两浪多后的空 实测和效果见策略执行文件 ''' import talib #两波多后的空策略 def dual_bo_duo(quote, klines, logger): df = klines.to_dataframe() if len(df) < 20: return False #logger.info("klines....
[ 1, 529, 9507, 29958, 29873, 29939, 15348, 29914, 17482, 29914, 4773, 29914, 303, 1927, 29946, 8849, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 29871, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, ...
dvc/remote/gdrive/utils.py
Baranowski/dvc
0
41650
<reponame>Baranowski/dvc<gh_stars>0 import os from dvc.progress import Tqdm FOLDER_MIME_TYPE = "application/vnd.google-apps.folder" class TrackFileReadProgress(object): def __init__(self, progress_name, fobj): self.progress_name = progress_name self.fobj = fobj file_size = os.fstat(fobj...
[ 1, 529, 276, 1112, 420, 29958, 4297, 273, 11716, 29914, 29881, 7071, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 2897, 13, 13, 3166, 270, 7071, 29889, 18035, 1053, 323, 29939, 18933, 13, 13, 13, 29943, 5607, 8032, 29918, 299...
build_tools/typhoon-blade/src/blade/blade_platform.py
algo-data-platform/PredictorService
2
145245
# Copyright (c) 2011 Tencent Inc. # All rights reserved. # # Author: <NAME> <<EMAIL>> # Date: October 20, 2011 """ This is the blade_platform module which deals with the environment variable. """ import os import subprocess import configparse import console from blade_util import var_to_list class BuildArch...
[ 1, 396, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29896, 12444, 1760, 9266, 29889, 13, 29937, 2178, 10462, 21676, 29889, 13, 29937, 13, 29937, 13361, 29901, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29937, 4712, 29901...
tests/test_dynamic_growths.py
zerorock1312/lt-maker-master
0
146062
import random """ With 50% growth, 38 level-ups random level-up variance of 2.5 stats off average dynamic level-up variance of 0.8 stats off average With 30% growth, 38 level-ups random level-up variance of 2.3 stats off average dynamic level-up variance of 0.7 stats off average With 10% growth, 38 level-ups random le...
[ 1, 1053, 4036, 13, 13, 15945, 29908, 13, 3047, 29871, 29945, 29900, 29995, 14321, 29892, 29871, 29941, 29947, 3233, 29899, 14340, 13, 8172, 3233, 29899, 786, 20162, 310, 29871, 29906, 29889, 29945, 22663, 1283, 6588, 13, 16626, 3233, 29899,...
sug-blog/unit4/account.py
SolangeUG/blog-application
1
101515
<filename>sug-blog/unit4/account.py import handler.handler as handler import util.security as security import util.validator as validator from google.appengine.ext import db class AccountHandler(handler.TemplateHandler): """ AccountHandler inherits from the hander.TemplateHandler class. It gives users the...
[ 1, 529, 9507, 29958, 29879, 688, 29899, 7312, 29914, 5441, 29946, 29914, 10149, 29889, 2272, 13, 5215, 7834, 29889, 13789, 408, 7834, 13, 5215, 3667, 29889, 8926, 408, 6993, 13, 5215, 3667, 29889, 3084, 1061, 408, 2854, 1061, 13, 3166, ...
tst/test_features_extraction.py
mitchellkrogza/Malicious-Web-Content-Detection-Using-Machine-Learning
0
67966
<gh_stars>0 # This file will test all the functionality of features_extraction.py import unittest from features_extraction import * class TestFeaturesExtraction(unittest.TestCase): def test_having_ip_address(self): ipv4_address = "172.16.31.10" ipv6_address_1 = "fe80:0:0:0:204:61ff:fe9d:f156" ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 910, 934, 674, 1243, 599, 278, 9863, 310, 5680, 29918, 1062, 13857, 29889, 2272, 13, 13, 5215, 443, 27958, 13, 3166, 5680, 29918, 1062, 13857, 1053, 334, 13, 13, 13, 1990, 4321...
examples/producer_consumer.py
ctismer/goless
1
133829
<gh_stars>1-10 """ This file demonstrates a simple producer/consumer setup. The produce goroutine generates some data and sends on a channel, and the consume goroutine receives on the channel and processes the data. This is one of the simplest models of concurrent programming and very easy with goless. Code modeled o...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 13, 4013, 934, 9004, 1078, 263, 2560, 14297, 29914, 25978, 261, 6230, 29889, 13, 1576, 7738, 330, 272, 449, 457, 16785, 777, 848, 322, 16003, 373, 263...
server.py
BoziDaniel/textAdv
0
1607255
<gh_stars>0 from flask import Flask, render_template, url_for app = Flask(__name__) @app.route('/') @app.route('/main_menu') def route_main(): return render_template("main.html") @app.route('/game') def route_play_game(): return render_template('game.html') if __name__ == '__main__': app.run( ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 29784, 1053, 2379, 1278, 29892, 4050, 29918, 6886, 29892, 3142, 29918, 1454, 13, 13, 932, 353, 2379, 1278, 22168, 978, 1649, 29897, 13, 13, 29992, 932, 29889, 13134, 11219, 1495, ...
src/genie/libs/parser/iosxr/tests/ShowIpInterfaceBrief/cli/equal/golden_output4_expected.py
balmasea/genieparser
204
188709
<gh_stars>100-1000 expected_output = { "interface": { "Loopback0": { "interface_status": "Up", "ip_address": "192.168.3.11", "protocol_status": "Up" }, "MgmtEth0/RSP0/CPU0/0": { "interface_status": "Up", "ip_address": "172.16.17.32"...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 9684, 29918, 4905, 353, 426, 13, 1678, 376, 13248, 1115, 426, 13, 4706, 376, 18405, 1627, 29900, 1115, 426, 13, 9651, 376, 13248, 29918, ...
NN_autograd_bias.py
JaPhi/NN_autograd_bias
1
125676
import autograd.numpy as np from matplotlib import pyplot, cm from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt from numba import njit, prange import numba import time from autograd import grad, elementwise_grad, jacobian def feed_forward(X, Y, W0, W1, W2, W3, W4, return_loss=True): ...
[ 1, 1053, 1120, 468, 3665, 29889, 23749, 408, 7442, 30004, 13, 3166, 22889, 1053, 11451, 5317, 29892, 7477, 30004, 13, 3166, 286, 572, 29918, 10154, 29895, 1169, 29889, 29885, 5317, 29941, 29881, 1053, 27815, 29941, 29881, 30004, 13, 5215, ...
src/analysis.py
luca-bottero/Parallel_n_body
2
191905
<gh_stars>1-10 import numpy as np import matplotlib.pyplot as plt from numba import jit class DataAnalyzer(): def __init__(self, ResultsPath = ''): try: self.PosHistory = np.load(ResultsPath + '/PosHistory.npy') self.Mass = np.load(ResultsPath + '/Masses.npy') #load yaml...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 3166, 954, 2291, 1053, 432, 277, 13, 13, 1990, 3630, 2744, 14997, 3298, 7295, 13, 1678, ...
localshop/urls.py
rcoup/localshop
0
26942
import re from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from django.views.generic.base import RedirectView from localshop.apps.packages.xmlrpc import handle_request admin.autodiscover() static_prefix = re.escape(settings.STATIC_URL.lstrip('/')) ...
[ 1, 1053, 337, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 5527, 29889, 26045, 1053, 15038, 29892, 3160, 29892, 3142, 13, 3166, 9557, 29889, 21570, 1053, 4113, 13, 3166, 9557, 29889, 7406, 29889, 19206, 29889, 3188, 105...
gecko/fan.py
mmillmor/home_assistant-components
0
1613793
"""Fan platform for Gecko.""" from .geckolib import GeckoPump from homeassistant.components.fan import SUPPORT_PRESET_MODE, FanEntity from .const import DOMAIN, ICON from .entity import GeckoEntity async def async_setup_entry(hass, entry, async_add_entities): """Setup sensor platform.""" facade = hass.data[D...
[ 1, 9995, 29943, 273, 7481, 363, 1879, 27604, 1213, 15945, 13, 3166, 869, 479, 384, 324, 747, 1053, 1879, 27604, 29925, 3427, 13, 3166, 3271, 465, 22137, 29889, 14036, 29889, 12963, 1053, 317, 4897, 15082, 29918, 15094, 10490, 29918, 20387...
pybricks/libraries.py
emthomas/pybricks
2
81195
import json import os import requests class LibrariesApi(object): """The Libraries API""" def __init__(self, hostname, token): self.hostname = "%s/api/" % hostname self.__headers = {'authorization': "Bearer %s" % token, "content-type": "application/scim+json", "acce...
[ 1, 1053, 4390, 13, 5215, 2897, 13, 13, 5215, 7274, 13, 13, 13, 1990, 365, 4626, 4314, 11713, 29898, 3318, 1125, 13, 1678, 9995, 1576, 365, 4626, 4314, 3450, 15945, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3495, 978, ...
vindauga/widgets/desktop.py
gabbpuy/vindauga
5
156143
<reponame>gabbpuy/vindauga # -*- coding: utf-8 -*- import logging from vindauga.constants.command_codes import cmNext, cmPrev, cmReleasedFocus from vindauga.constants.grow_flags import gfGrowHiX, gfGrowHiY from vindauga.constants.event_codes import evCommand from vindauga.constants.option_flags import ofTileable from ...
[ 1, 529, 276, 1112, 420, 29958, 29887, 8846, 3746, 29891, 29914, 29894, 513, 2987, 29874, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 12183, 13, 13, 3166, 325, 513, 2987, 29874, 29889, 3075...
examples/processors/other.py
calibre12/zipreport
0
85087
from zipreport import ZipReportCli from zipreport.processors.zipreport import ZipReportClient, ZipReportProcessor from zipreport.report import ReportFileLoader, ReportJob from zipreport.template import JinjaRender def generate_pdf_server(report:str, data: dict, output_file:str) -> bool: zpt = ReportFileLoader.loa...
[ 1, 515, 14319, 12276, 1053, 796, 666, 13020, 29907, 492, 13, 3166, 14319, 12276, 29889, 5014, 943, 29889, 7554, 12276, 1053, 796, 666, 13020, 4032, 29892, 796, 666, 13020, 18689, 13, 3166, 14319, 12276, 29889, 12276, 1053, 13969, 2283, 10...
scripts/NameParser.py
lauriholmas/harn-tools
5
128060
import csv, json def writeNames(): given_names = { 'male': [], 'female': [] } surnames = [] with open('ScandinavianNames.data.json', 'w', encoding='utf-8') as jsonFile: given_names['male'] = parseNames('ScandinavianMaleNames.csv') given_names['female'] = parseNames('ScandinavianFemaleNames....
[ 1, 1053, 11799, 29892, 4390, 13, 13, 1753, 2436, 8659, 7295, 13, 1678, 2183, 29918, 7039, 353, 426, 525, 19202, 2396, 19997, 525, 29888, 331, 744, 2396, 5159, 500, 13, 1678, 269, 595, 1280, 353, 5159, 13, 1678, 411, 1722, 877, 4421, ...
test/unit/jobs/test_statuses.py
NHSDigital/list-reconciliation
4
51513
import pytest from jobs.statuses import JobStatus @pytest.mark.parametrize( "code,value", [ (JobStatus.SENT_TO_DPS, "SENT_TO_DPS"), (JobStatus.PROCESSED_BY_DPS, "PROCESSED_BY_DPS"), (JobStatus.COMPLETE, "COMPLETE"), (JobStatus.NOTIFIED_VALIDATION_FAILED, "NOTIFIED_VALIDATION_FA...
[ 1, 1053, 11451, 1688, 13, 3166, 17643, 29889, 4882, 267, 1053, 17163, 5709, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3207, 300, 374, 911, 29898, 13, 1678, 376, 401, 29892, 1767, 613, 13, 1678, 518, 13, 4706, 313, 11947, 5709...
itdtool/tasks.py
nikoskal/itd_tool
0
106816
# from __future__ import absolute_import # # from itdtool.celeryapp import app # # from lxml import etree # # import xmltodict # import sys # # from passlib.hash import md5_crypt # from django.conf import settings # # # # # @app.task # def get_query_params_id(id): # # from itdtool.models import QueryParameters # ...
[ 1, 396, 515, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 29937, 13, 29937, 515, 372, 29881, 10154, 29889, 2242, 708, 932, 1053, 623, 13, 29937, 396, 515, 301, 3134, 1053, 634, 929, 13, 29937, 396, 1053, 4903, 20034, 919, 13,...
src/didery/controllers/history.py
reputage/didery
8
1600574
<reponame>reputage/didery import falcon import arrow import time try: import simplejson as json except ImportError: import json from ..help import helping from ..did.didering import Did, getDIDModel from ..db import dbing as db from ..controllers.validation import factory from ..models.models import BasicHist...
[ 1, 529, 276, 1112, 420, 29958, 276, 649, 482, 29914, 18361, 708, 13, 5215, 11092, 535, 13, 5215, 16578, 13, 5215, 931, 13, 13, 2202, 29901, 13, 1678, 1053, 2560, 3126, 408, 4390, 13, 19499, 16032, 2392, 29901, 13, 1678, 1053, 4390, ...
src/Prototype.pyw
SilverousBlack/Prototypes
0
106933
""" Prototype Algorithms Library (c) <NAME>, 2020 License(s): MIT Licence Notice: The distribution, ownership, reproduction and use of this library is subject to the above stated license. Contains all prototype algorithms from: > Prototype Algorithms Core [Prototype.pyw] > Searching Algorithms [SearchingAlgorithms.p...
[ 1, 9995, 13, 1184, 10414, 11545, 12404, 9538, 13, 29898, 29883, 29897, 529, 5813, 10202, 29871, 29906, 29900, 29906, 29900, 13, 13, 29931, 293, 1947, 29898, 29879, 1125, 341, 1806, 10413, 663, 13, 13, 3664, 625, 29901, 450, 4978, 29892, ...
Week3/exercise2.py
tb2010/pynet
0
74921
#!/usr/bin/env python """ Exercise 2 Using SNMPv3 create two SVG image files. The first image file should graph the input and output octets on interface FA4 on pynet-rtr1 every five minutes for an hour. Use the pygal library to create the SVG graph file. Note, you should be doing a subtraction here (i.e. the input/...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 13, 1252, 6269, 895, 29871, 29906, 13, 13, 15156, 21989, 3580, 29894, 29941, 1653, 1023, 13955, 29954, 1967, 2066, 29889, 13, 13, 1576, 937, 1967, 934, 881, 3983, 278, 18...
flask_response_builder/response_builder.py
cs91chris/flask_response_builder
4
45392
from functools import wraps import flask from flask import current_app as cap from .builders.builder import Builder from .config import DEFAULT_BUILDERS, set_default_config class ResponseBuilder: def __init__(self, app=None, builders=None): """ :param app: :param builders: """ ...
[ 1, 515, 2090, 312, 8789, 1053, 11463, 567, 13, 13, 5215, 29784, 13, 3166, 29784, 1053, 1857, 29918, 932, 408, 2117, 13, 13, 3166, 869, 4282, 414, 29889, 16409, 1053, 5373, 2700, 13, 3166, 869, 2917, 1053, 22236, 29918, 29933, 3120, 29...
rosny/signal.py
lRomul/rosny
6
161990
<gh_stars>1-10 import signal _signals = [signal.SIGINT, signal.SIGTERM] _default_handlers = {sig: signal.getsignal(signal.SIGINT) for sig in _signals} class SignalException(BaseException): def __init__(self, signum: signal.Signals, frame): message = f"Handle signal: {signal.Signals(signum).name}" ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 7182, 13, 13, 29918, 4530, 1338, 353, 518, 25436, 29889, 5425, 29954, 10192, 29892, 7182, 29889, 5425, 29954, 4945, 29924, 29962, 13, 29918, 4381, 29918, 3179, ...
complete_workflow/image_process.py
totoyoyo/deformable-template-capstone
1
170079
import cv2 from PIL import Image import numpy as np import matplotlib.pyplot as plt from skimage.restoration import (denoise_tv_chambolle, denoise_bilateral, denoise_wavelet, estimate_sigma) from pathlib import Path def process_img_and_save(img_path: Path, denoise_h=20, ...
[ 1, 1053, 13850, 29906, 13, 3166, 349, 6227, 1053, 7084, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 3166, 2071, 3027, 29889, 5060, 12418, 1053, 313, 1145, 29877, 895, 29918, 12427, 29918, 305, 1117, 3...
_scripts/parse.py
KaiL4eK/keras_traffic_signs_localization
4
160113
from __future__ import print_function import os import cv2 import argparse parser = argparse.ArgumentParser(description='Process video with ANN') parser.add_argument('filepath', action='store', help='Path to video file to process') args = parser.parse_args() def parse_file(): img_ref = cv2.imread(args.filepath) ...
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 13, 5215, 2897, 13, 5215, 13850, 29906, 13, 5215, 1852, 5510, 13, 13, 16680, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 7032, 4863, 411, 319, 10262, 1495, 13, ...
test/test_words.py
dubmix3105/pysh
7
27471
import sys import pytest from pysh import shwords, shwords_f def test_conversions(): with pytest.raises(ValueError): shwords('{:{}}', 1, 2) assert '{:{}}'.format(1, 2) == ' 1' # by contrast def test_multiword(): assert shwords('touch {!@}', ['a', 'b']) \ == ['touch', 'a', 'b'] with pytest.raises(...
[ 1, 1053, 10876, 13, 13, 5215, 11451, 1688, 13, 13, 3166, 11451, 845, 1053, 528, 9303, 29892, 528, 9303, 29918, 29888, 13, 13, 13, 1753, 1243, 29918, 535, 26100, 7295, 13, 29871, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1...
server.py
swyngaard/sensor-logger
0
136918
from flask_socketio import SocketIO from flask import Flask, render_template, request from time import sleep from threading import Thread, Event from flask_autoindex import AutoIndex import logging import os import getpass import sys from shongololo import start_up as SU from shongololo import sys_admin as SA from shon...
[ 1, 515, 29784, 29918, 11514, 601, 1053, 29141, 5971, 13, 3166, 29784, 1053, 2379, 1278, 29892, 4050, 29918, 6886, 29892, 2009, 13, 3166, 931, 1053, 8709, 13, 3166, 3244, 292, 1053, 10480, 29892, 6864, 13, 3166, 29784, 29918, 6921, 2248, ...
test/ResultsAndPrizes/top-3/test_top_3_winning_numbers_of_the_last_draw.py
FearFactor1/SPA
1
52867
# Топ-3 + Выигрышные номера последнего тиража def test_top_3_winning_numbers_last_draw(app): app.ResultAndPrizes.open_page_results_and_prizes() app.ResultAndPrizes.click_game_top_3() app.ResultAndPrizes.button_get_report_winners() assert "ВЫИГРЫШНЫЕ НОМЕРА" in app.ResultAndPrizes.parser_report_text_w...
[ 1, 396, 7624, 29964, 29899, 29941, 718, 14966, 29917, 29969, 3541, 30002, 3029, 4228, 1488, 494, 17235, 18461, 7109, 494, 2711, 13, 13, 13, 13, 1753, 1243, 29918, 3332, 29918, 29941, 29918, 5080, 1076, 29918, 20326, 29918, 4230, 29918, 40...
scraper/storage_spiders/anhducdigitalvn.py
chongiadung/choinho
0
83965
<reponame>chongiadung/choinho # Auto generated by generator.py. Delete this line if you make modification. from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//form[@id='product_addtocart_form']/div[@class='product-shop']/div[@class='product-name']/h1", 'price' ...
[ 1, 529, 276, 1112, 420, 29958, 305, 549, 29875, 328, 686, 29914, 1859, 21307, 13, 29937, 11133, 5759, 491, 15299, 29889, 2272, 29889, 21267, 445, 1196, 565, 366, 1207, 21733, 29889, 13, 3166, 24559, 2272, 29889, 1028, 11376, 1053, 27308, ...
bootloader/waflib/Tools/perl.py
BA7JCM/pyinstaller
0
1612383
<reponame>BA7JCM/pyinstaller #! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import os from waflib import Task, Options, Utils, Errors from waflib.Configure import conf from waflib.TaskGen import extension, feature, before_method @before_method(...
[ 1, 529, 276, 1112, 420, 29958, 5688, 29955, 29967, 24494, 29914, 2272, 6252, 261, 13, 29937, 29991, 847, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 8025, 29901, 23616, 29899, 29947, 13, 29937, 399, 25614, 29991, 1938, 451, 3863, 299...
structural/proxy/udemy-1.py
rafaelcassau/design-patterns
13
170132
""" A proxy provides a surrogate or place holder to provide access to an object. Ex1: Use an extra level of indirection to support distributed, controlled, or conditional access. """ class SubjectInterface: """ Define the common interface for RealSubject and Proxy so that a Proxy can be used anywh...
[ 1, 9995, 13, 29909, 10166, 8128, 263, 1190, 9102, 403, 470, 2058, 19464, 304, 3867, 13, 5943, 304, 385, 1203, 29889, 13, 13, 1252, 29896, 29901, 13, 1678, 4803, 385, 4805, 3233, 310, 1399, 8684, 304, 2304, 13235, 29892, 13, 1678, 2070...
scripts_v1/22_Save_Proximity_model.py
onebacha/recipe_rec
0
76724
# %% Packages import os os.chdir('/Users/czarrar/Dropbox/Circle/Jerb/recipe_rec/scripts') import recipe_rec import importlib recipe_rec = importlib.reload(recipe_rec) # %% Read in ingredients recipe_file = '../data/30_ingredients+ave_ratings.csv' recs = recipe_rec.RecipeRec() recs.load_from_csv(recipe_file, index_col...
[ 1, 396, 17806, 18744, 1179, 13, 5215, 2897, 13, 359, 29889, 305, 3972, 11219, 5959, 29914, 2067, 2749, 279, 29914, 15063, 1884, 29914, 23495, 280, 29914, 29967, 23936, 29914, 4361, 412, 29918, 3757, 29914, 16713, 1495, 13, 13, 5215, 9522,...
errores.py
fbzavaleta/DS_Software_Stack
0
14911
# E_LEN = "No es posible operar vectores de diferente módulo"
[ 1, 396, 13, 29923, 29918, 1307, 29940, 353, 376, 3782, 831, 29125, 1751, 279, 325, 522, 2361, 316, 12186, 2016, 286, 4431, 7207, 29908, 13, 2 ]
ADT7310_CTR.py
pit-ray/ADT7310-CTR
0
119067
<reponame>pit-ray/ADT7310-CTR #!/usr/bin/python3 # coding: utf-8 import spidev import time class ADT7310_CTR: def __init__(self, spi_port, device, max_hz=100000): self.port = spi_port self.device = device self.max_hz = max_hz self.initialize() def initialize(self): # c...
[ 1, 529, 276, 1112, 420, 29958, 23600, 29899, 764, 29914, 3035, 29911, 29955, 29941, 29896, 29900, 29899, 1783, 29934, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 29941, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 5215, 805, 680,...
sample_server.py
sandu-alexandru/asn_diameter_python
0
188838
<reponame>sandu-alexandru/asn_diameter_python """ Sample Diameter Server, which can be used for testing purposes. Generates a Diameter Server with the default(local) config, and then starts the server, making it available for incoming connections and requests handling. """ from diameter_server import * if __name__ ==...
[ 1, 529, 276, 1112, 420, 29958, 29879, 392, 29884, 29899, 744, 29916, 392, 582, 29914, 294, 29876, 29918, 29881, 2829, 1308, 29918, 4691, 13, 15945, 29908, 13, 17708, 22904, 1308, 5656, 29892, 607, 508, 367, 1304, 363, 6724, 11976, 29889, ...
misc/hangman.py
maryletteroa/practice-space
0
164020
<gh_stars>0 # Hangman Game # # Credit to <NAME>'s "Python Programming for the Absolute Beginner 3rd Edition" # # The classic game of Hangman. The computer picks a random word # and the player wrong to guess it, one letter at a time. If the player # can't guess the word in time, the little stick figure gets hanged. #...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 379, 574, 1171, 8448, 13, 29937, 13, 29937, 24596, 277, 304, 529, 5813, 16299, 29879, 376, 11980, 7835, 4056, 363, 278, 1976, 14977, 14893, 1089, 29871, 29941, 5499, 17138, 29908, ...
tools/try_test1.py
csuzhuzhuxia/GlassDetect
6
119834
import sys from mmdet.apis import inference_detector, init_detector import json import os import numpy as np import argparse from tqdm import tqdm import json class MyEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, np.integer): return int(obj) elif isinstance(obj, np.floating): ...
[ 1, 1053, 10876, 29871, 13, 3166, 286, 3487, 300, 29889, 11355, 1053, 27262, 29918, 4801, 3019, 29892, 2069, 29918, 4801, 3019, 29871, 13, 5215, 4390, 29871, 13, 5215, 2897, 29871, 13, 5215, 12655, 408, 7442, 29871, 13, 5215, 1852, 5510, ...
Calibration/IsolatedParticles/python/isolatedTracksCone_cfi.py
pasmuss/cmssw
0
65286
<gh_stars>0 import FWCore.ParameterSet.Config as cms isolatedTracksCone= cms.EDAnalyzer("IsolatedTracksCone", doMC = cms.untracked.bool(False), Verbosity = cms.untracked.int32( 1 ), useJetTrigger = cms...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 383, 29956, 9203, 29889, 9329, 2697, 29889, 3991, 408, 274, 1516, 13, 13, 275, 324, 630, 5323, 4684, 29907, 650, 29922, 274, 1516, 29889, 3352, 2744, 14997, 3298, 703, 29902, 2929...
compute_extrinsic.py
Ericcsr/ClothFromDepth
0
87712
import numpy as np import open3d as o3d from argparse import ArgumentParser import os parser = ArgumentParser() parser.add_argument("--red",type=float, default= 0.5) parser.add_argument("--blue", type=float, default = 0.4) parser.add_argument("--green", type=float, default = 0.4) parser.add_argument("--scan_folder",ty...
[ 1, 1053, 12655, 408, 7442, 13, 5215, 1722, 29941, 29881, 408, 288, 29941, 29881, 13, 3166, 1852, 5510, 1053, 23125, 11726, 13, 5215, 2897, 13, 13, 16680, 353, 23125, 11726, 580, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 1127, 613,...
sdk/python/tests/integration/feature_repos/universal/data_source_creator.py
marsishandsome/feast
1
16920
from abc import ABC, abstractmethod from typing import Dict import pandas as pd from feast.data_source import DataSource from feast.repo_config import FeastConfigBaseModel class DataSourceCreator(ABC): @abstractmethod def create_data_source( self, destination: str, df: pd.DataFrame, ...
[ 1, 515, 25638, 1053, 16417, 29892, 9846, 5696, 13, 3166, 19229, 1053, 360, 919, 13, 13, 5215, 11701, 408, 10518, 13, 13, 3166, 1238, 579, 29889, 1272, 29918, 4993, 1053, 3630, 4435, 13, 3166, 1238, 579, 29889, 20095, 29918, 2917, 1053, ...
kyk/kyk.py
atrautsch/kyk
0
33118
#!/usr/bin/env python3 import os import time import shutil import signal import yaml import sass import pyinotify from colorama import init, Fore, Style from jsmin import jsmin from csscompressor import compress VERSION = '1.4.7' class Kyk(object): """Kyk Build JS - if min: minify in place, append _m...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 2897, 13, 5215, 931, 13, 5215, 528, 4422, 13, 5215, 7182, 13, 13, 5215, 343, 8807, 13, 5215, 269, 465, 13, 5215, 11451, 262, 327, 1598, 13, 13, 3166, 2927, 3304, ...
src/dataset/config.py
Digital-Pathology/CustomDataset
0
157130
""" Configuration for development - change these with caution! """ REGION_DIMS = (512, 512) DEFAULT_FILTRATION_STATUS = None DEFAULT_FILTRATION_CACHE_FILEPATH = "filtration_cache.h5" DEFULAT_FILTRATION_CACHE_TITLE = "filtration_cache" DATASET_FILTRATION_PREPROCESSING_MULTIPROCESSING = False FILTRATION_CACHE_A...
[ 1, 29871, 13, 15945, 29908, 13, 1678, 20999, 363, 5849, 448, 1735, 1438, 411, 5777, 918, 29991, 13, 15945, 29908, 13, 13, 13, 18166, 2725, 29918, 4571, 4345, 353, 313, 29945, 29896, 29906, 29892, 29871, 29945, 29896, 29906, 29897, 13, 1...
networkx/classes/tests/test_digraph_historical.py
KyleBenson/networkx
0
22636
<filename>networkx/classes/tests/test_digraph_historical.py #!/usr/bin/env python """Original NetworkX graph tests""" from nose.tools import * import networkx import networkx as nx from networkx.testing.utils import * from historical_tests import HistoricalTests class TestDiGraphHistorical(HistoricalTests): def ...
[ 1, 529, 9507, 29958, 11618, 29916, 29914, 13203, 29914, 21150, 29914, 1688, 29918, 7501, 1140, 29918, 16211, 936, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 26036, 8527, 29990, 3983, 6987, 15945, ...
flashcards/views.py
YellowAndGreen/Anki2
0
137349
import collections import json import random import re from datetime import timedelta, datetime from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.cache import cache from django.db.models import Q from django.http import JsonResponse, FileResponse ...
[ 1, 1053, 16250, 30004, 13, 5215, 4390, 30004, 13, 5215, 4036, 30004, 13, 5215, 337, 30004, 13, 3166, 12865, 1053, 5335, 287, 2554, 29892, 12865, 30004, 13, 30004, 13, 3166, 9557, 29889, 21570, 1053, 7191, 30004, 13, 3166, 9557, 29889, 2...
crawler_mongo.py
9527A/practice
0
148966
import pymongo def data_seve(mydict): myclient = pymongo.MongoClient("mongodb://localhost:27017/") mydb = myclient["cralwer"] mycol = mydb["data"] for m in mydict: if m in mycol.find(): pass else: x = mycol.insert_one(m) def data_get(): ...
[ 1, 1053, 282, 962, 7443, 30004, 13, 30004, 13, 1753, 848, 29918, 344, 345, 29898, 1357, 8977, 1125, 30004, 13, 1678, 590, 4645, 353, 282, 962, 7443, 29889, 29924, 7443, 4032, 703, 23264, 597, 7640, 29901, 29906, 29955, 29900, 29896, 299...
src/toast/tests/cache.py
doicbek/toast
29
194624
<reponame>doicbek/toast # Copyright (c) 2015-2020 by the parties listed in the AUTHORS file. # All rights reserved. Use of this source code is governed by # a BSD-style license that can be found in the LICENSE file. import sys import numpy as np import ctypes from .mpi import MPITestCase from ..cache import Cache...
[ 1, 529, 276, 1112, 420, 29958, 1867, 293, 16863, 29914, 517, 579, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29945, 29899, 29906, 29900, 29906, 29900, 491, 278, 13973, 9904, 297, 278, 26524, 29950, 24125, 934, ...
Others/Source/02/2.2/print_test.py
silence0201/Learn-Python
1
161098
# coding: utf-8 ######################################################################### # 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> # # author yeeku.H.lee <EMAIL> # # # # version 1.0 ...
[ 1, 396, 14137, 29901, 23616, 29899, 29947, 30004, 13, 13383, 13383, 13383, 13383, 7346, 29937, 30004, 13, 29937, 29871, 31222, 31433, 29901, 529, 29874, 2822, 543, 1124, 597, 1636, 29889, 26844, 1537, 277, 29889, 990, 1013, 234, 153, 178, ...
src/tag_spy/http_client.py
DD-DeCaF/tag-spy
0
129776
# Copyright 2020 Novo Nordisk Foundation Center for Biosustainability, # Technical University of Denmark. # # 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/licens...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29906, 29900, 2864, 29877, 5245, 3873, 10606, 7817, 363, 350, 2363, 504, 475, 3097, 29892, 13, 29937, 8364, 936, 3014, 310, 3384, 3502, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380,...
Week 01/problems/arrays/equilibrium_point.py
imran-rashid/11-weeks-dsa-workshop
2
152880
# Given an array A of N positive numbers. The task is to find the first Equilibrium Point in the array. # https://www.geeksforgeeks.org/equilibrium-index-of-an-array/ # https://practice.geeksforgeeks.org/problems/equilibrium-point-1587115620/1/ import math # time is O(n) | Space is O(1) def equilibriumPoint(A...
[ 1, 396, 11221, 385, 1409, 319, 310, 405, 6374, 3694, 29889, 450, 3414, 338, 304, 1284, 278, 937, 11243, 15943, 16241, 8984, 297, 278, 1409, 29889, 6756, 13, 29937, 2045, 597, 1636, 29889, 479, 14541, 20324, 14541, 29889, 990, 29914, 168...
scripts/fine_tuning.py
pedbrgs/Pruning-Darknet
3
83579
import os import argparse import subprocess import numpy as np import pandas as pd def training_model(filename, technique, pruning_rate, layer): """ Training the pruned model """ # Opens the temporary file f = open('../eval.txt', 'a+') # Training with pre-trained weights if technique.upper() != ...
[ 1, 1053, 2897, 13, 5215, 1852, 5510, 13, 5215, 1014, 5014, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 13, 1753, 6694, 29918, 4299, 29898, 9507, 29892, 11043, 29892, 544, 27964, 29918, 10492, 29892, 7546, 1125, 13, 13, ...
qharv/reel/test/test_config_h5.py
Paul-St-Young/harvest_qmcpack
2
165738
<reponame>Paul-St-Young/harvest_qmcpack import h5py import numpy as np from qharv.reel import config_h5 def test_saveh5(): mat = np.arange(9).reshape(3, 3) config_h5.saveh5('mat.h5', mat) config_h5.saveh5('mat.h5', mat, name='mat') fp = h5py.File('mat.h5', 'r') mat1 = fp['mat'][()] fp.close() assert np...
[ 1, 529, 276, 1112, 420, 29958, 18275, 29899, 855, 29899, 3492, 865, 29914, 8222, 10147, 29918, 29939, 14047, 4058, 13, 5215, 298, 29945, 2272, 13, 5215, 12655, 408, 7442, 13, 3166, 3855, 8222, 29894, 29889, 276, 295, 1053, 2295, 29918, ...
Max/Max_0387_20200213.py
Morek999/OMSCS_Taiwan_Leetcode
1
138453
<reponame>Morek999/OMSCS_Taiwan_Leetcode """ 387. First Unique Character in a String https://leetcode.com/problems/first-unique-character-in-a-string/ Time complexity: O() Space complexity: O() """ from typing import List class Solution: def firstUniqChar(self, s: str) -> int: hodling = {} ...
[ 1, 529, 276, 1112, 420, 29958, 20761, 29895, 29929, 29929, 29929, 29914, 29949, 4345, 9295, 29918, 29911, 1794, 11440, 29918, 3226, 300, 401, 13, 15945, 29908, 6756, 13, 29941, 29947, 29955, 29889, 3824, 853, 1387, 26804, 297, 263, 1714, ...
2. Existing Conversion Efficiency (EC), Appendix A/DL_FP_EC.py
rioarya/Land-Conversion_Woody-Biomass-Utilization-Scenarios
0
67079
<filename>2. Existing Conversion Efficiency (EC), Appendix A/DL_FP_EC.py<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Fri Dec 13 15:21:55 2019 @author: raryapratama """ #%% #Step (1): Import Python libraries, set land conversion scenarios general parameters import numpy as np import matplotlib.py...
[ 1, 529, 9507, 29958, 29906, 29889, 1222, 15423, 1281, 3259, 382, 2416, 13396, 313, 11206, 511, 22871, 861, 319, 29914, 19558, 29918, 26353, 29918, 11206, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 2989...
radiaTest-server/server/model/user.py
openeuler-mirror/radiaTest
0
125144
<filename>radiaTest-server/server/model/user.py from server.model.base import BaseModel from server.model.permission import Role from server import db, redis_client from server.utils.redis_util import RedisKey class User(db.Model, BaseModel): __tablename__ = "user" gitee_id = db.Column(db.Integer(), primary_k...
[ 1, 529, 9507, 29958, 3665, 423, 3057, 29899, 2974, 29914, 2974, 29914, 4299, 29914, 1792, 29889, 2272, 13, 3166, 1923, 29889, 4299, 29889, 3188, 1053, 7399, 3195, 13, 3166, 1923, 29889, 4299, 29889, 16074, 1053, 1528, 280, 13, 3166, 1923,...
qbt_migrate/cli.py
Reverse256/qbt_migrate
42
1603284
<filename>qbt_migrate/cli.py import logging import argparse from . import QBTBatchMove, discover_bt_backup_path logger = logging.getLogger(__name__) def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('-e', '--existing-path', help='Existing root of path to look for.') parser.add_ar...
[ 1, 529, 9507, 29958, 29939, 3116, 29918, 26983, 403, 29914, 11303, 29889, 2272, 13, 5215, 12183, 13, 5215, 1852, 5510, 13, 13, 3166, 869, 1053, 660, 29933, 29911, 23145, 16619, 29892, 6523, 29918, 3116, 29918, 1627, 786, 29918, 2084, 13, ...
tf_metric_learning/utils/recall.py
Ximilar-com/tf-metric-learning
28
99848
import tensorflow as tf import numpy as np from tqdm import tqdm from tf_metric_learning.utils.index import AnnoyDataIndex class AnnoyEvaluatorCallback(AnnoyDataIndex): """ Callback, extracts embeddings, add them to AnnoyIndex and evaluate them as recall. """ def __init__( self, mod...
[ 1, 1053, 26110, 408, 15886, 13, 13, 5215, 12655, 408, 7442, 13, 3166, 260, 29939, 18933, 1053, 260, 29939, 18933, 13, 13, 3166, 15886, 29918, 16414, 29918, 21891, 29889, 13239, 29889, 2248, 1053, 530, 1217, 29891, 1469, 3220, 13, 13, 13...
examples/client/main.py
TheFarGG/Discode
3
1039
<filename>examples/client/main.py<gh_stars>1-10 import os import discode TOKEN = os.environ.get("TOKEN") # The token from the developer portal. client = discode.Client(token=TOKEN, intents=discode.Intents.default()) @client.on_event("ready") async def on_ready(): print(client.user, "is ready!") # The ready l...
[ 1, 529, 9507, 29958, 19057, 29914, 4645, 29914, 3396, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 2897, 13, 13, 5215, 766, 401, 13, 13, 4986, 29968, 1430, 353, 2897, 29889, 21813, 29889, 657, ...
laserAtomTrap/src/__init__.py
statisdisc/modellingAndSimulation
0
151427
<gh_stars>0 __all__ = ["objects", "plots", "utilities"]
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 1649, 497, 1649, 353, 6796, 12650, 613, 376, 26762, 613, 376, 4422, 1907, 3108, 2 ]
tests/test_eval_metrics.py
IntheGrass/citeomatic_learning
162
169574
<filename>tests/test_eval_metrics.py import unittest from citeomatic.eval_metrics import precision_recall_f1_at_ks, average_results class TestEvalMetrics(unittest.TestCase): def test_precision_recall_f1_at_ks(self): gold_y = ['1', '2', '3'] pred_y = ['1', '4', '3'] scores_y = [1.0, 0.1, 0....
[ 1, 529, 9507, 29958, 21150, 29914, 1688, 29918, 14513, 29918, 2527, 10817, 29889, 2272, 13, 5215, 443, 27958, 13, 3166, 274, 568, 290, 2454, 29889, 14513, 29918, 2527, 10817, 1053, 16716, 29918, 3757, 497, 29918, 29888, 29896, 29918, 271, ...