max_stars_repo_path
string
max_stars_repo_name
string
max_stars_count
int64
id
string
content
string
add_param_types
int64
add_return_types
int64
add_class_field_types
int64
add_instance_field_types
int64
add_total
int64
add_error
int64
test/pytest/test_output_returners.py
showipintbri/ttp
254
1645795
<reponame>showipintbri/ttp<filename>test/pytest/test_output_returners.py import sys sys.path.insert(0, "../..") import pprint import logging logging.basicConfig(level="ERROR") from ttp import ttp def test_file_returner_format_raw(): template_1 = """ <input load="text"> interface Port-Chanel11 vlan 10 interf...
0
0
0
0
0
0
web/dbpatterns/documents/resources.py
fatiherikli/dbpatterns
133
1645864
from __future__ import annotations import operator from bson import ObjectId from django.conf.urls import url from django.core.urlresolvers import reverse from tastypie import http from tastypie import fields from tastypie.exceptions import ImmediateHttpResponse from tastypie.utils import trailing_slash from api.aut...
3
7
3
0
13
0
zeus/trainer/modules/conf/lr_scheduler.py
TianQi-777/xingtian
240
1645897
# -*- coding=utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the ...
1
2
7
0
10
0
sal/context_processors.py
nathandarnell/sal
215
1645919
from django.conf import settings # import the settings file import plistlib import os from server.utils import get_server_version SAL_VERSION = get_server_version() def display_name(request) -> dict[str,object]: return {'DISPLAY_NAME': settings.DISPLAY_NAME} def config_installed(request) -> dict[str,object]...
0
3
0
0
3
0
pase/models/WorkerScheduler/worker_scheduler.py
ishine/pase
428
1645933
from __future__ import annotations import torch import random import numpy as np import torch.nn.functional as F from .min_norm_solvers import MinNormSolver, gradient_normalizers from torch.autograd import Variable class backprop_scheduler(object): def __init__(self, model, mode: object | None=None): sel...
7
11
0
0
18
0
docs/source/_static/fenced-template.py
jacobwhall/panflute
361
1645942
from __future__ import annotations """ Pandoc filter using panflute, for fenced code blocks """ import panflute as pf def prepare(doc): pass def fenced_action(options, data, element, doc): if doc.format == 'latex': pass # return None -> element unchanged # return [] -> delete elemen...
1
1
0
0
2
0
tests/test_jobaction.py
fredstro/mrq
745
1645965
<gh_stars>100-1000 from mrq.job import Job from mrq.queue import Queue import time import pytest OPTS = [] for p_query in [ # Query, number_matching ({"path": "tests.tasks.general.MongoInsert"}, 3), ({"queue": "q1"}, 2), ({"params": "{\"a\": 44}"}, 1) ]: OPTS.append([p_query]) def test_cancel_by...
0
0
0
0
0
0
docs/sample.py
roviso/hyberledger-py
389
1645995
<reponame>roviso/hyberledger-py # Copyright O Corp. 2019 All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # import os import asyncio from hfc.fabric import Client from hfc.fabric.channel.channel import SYSTEM_CHANNEL_NAME CONNECTION_PROFILE_PATH = 'test/fixtures/network.json' CONFIG_YAML_PATH = 'test/fixtur...
0
0
0
0
0
0
mail_templated/default_settings.py
artemrizhov/django-mail-templated
105
1646005
<filename>mail_templated/default_settings.py # The template for tags that is used to cut the email parts from the rendered # contents. ``block`` is the name of block, i.e. "subject", "body", "html". # ``bound`` either "start" or "end". TAG_FORMAT = '###{bound}_{block}###' # The template for tag variables that is used ...
0
0
0
0
0
0
siuba/tests/test_dply_verbs.py
sethvargo/siuba
831
1646017
<reponame>sethvargo/siuba """ This file is for pandas specific verb operations. """ import pytest from siuba.dply.verbs import mutate, arrange, filter, ungroup from siuba.siu import _ import pandas as pd from pandas.testing import assert_frame_equal @pytest.fixture(scope = "function") def df1(): yield pd.DataFra...
0
0
0
0
0
0
drift_detection/cusum.py
JanSurft/tornado
103
1646032
""" The Tornado Framework By <NAME> University of Ottawa, Ontario, Canada E-mail: apesaran -at- uottawa -dot- ca / alipsgh -at- gmail -dot- com --- *** The Cumulative Sum (CUSUM) Method Implementation *** Paper: Page, Ewan S. "Continuous inspection schemes." Published in: Biometrika 41.1/2 (1954): 100-115. URL...
3
2
0
3
8
0
support/RocAlphaGo-develop/AlphaGo/training/reinforcement_policy_trainer.py
sjkim04/AlphaGOZero-python-tensorflow
325
1646033
from __future__ import annotations import os import json import re import numpy as np from shutil import copyfile from keras.optimizers import SGD import keras.backend as K from AlphaGo.ai import ProbabilisticPolicyPlayer import AlphaGo.go as go from AlphaGo.models.policy import CNNPolicy from AlphaGo.util import flatt...
2
3
0
0
5
0
Recognition-Algorithms/Recognition using KNearestNeighbors/Pre_proccessed_data_collection.py
swapnilgarg7/Face-X
175
1646036
#Pre-Proccessed Images Data Collection import cv2 import numpy as np import os photo = cv2.imread("path of image") #photo should be of 640x480 pixels and axis must match. name = input("Enter your name : ") frames = [] outputs = [] frames.append(photo.flatten()) outputs.append([name]) X = np.array(frames...
0
0
0
0
0
0
insights/parsers/ls_boot.py
mglantz/insights-core
121
1646063
<reponame>mglantz/insights-core<gh_stars>100-1000 """ LsBoot - command ``ls -lanR /boot`` =================================== The ``ls -lanR /boot`` command provides information for the listing of the ``/boot`` directory. See the ``FileListing`` class for a more complete description of the available features of the c...
0
0
0
0
0
0
corehq/apps/app_manager/tests/mocks/mobile_ucr.py
dimagilg/commcare-hq
471
1646069
<gh_stars>100-1000 import mock from couchdbkit import ResourceNotFound def mock_report_configurations(report_configurations_by_id): return mock.patch('corehq.apps.app_manager.models.ReportModule.reports', property( lambda self: [report_configurations_by_id[r.report_id] for r in self....
0
0
0
0
0
0
Chapter6/ex_6_1.py
zxjzxj9/PyTorchIntroduction
205
1646091
from __future__ import annotations """ 本示例所用的代码可以被用于NLP项目中用于统计词频,构建单词表 """ from collections import Counter class Vocab(object): UNK: str = '<unk>' def __init__(self, counter, max_size: object | None=None, min_freq: int=1, specials: list[str]=['<unk>', '<pad>'], specials_first: bool=True): ...
4
1
1
3
9
0
test/test_PointSource/test_Types/test_ps_base.py
DarthLazar/lenstronomy
107
1646093
import pytest import unittest from lenstronomy.PointSource.Types.base_ps import PSBase from lenstronomy.LensModel.lens_model import LensModel class TestPSBase(object): def setup(self): self.base = PSBase(lens_model=LensModel(lens_model_list=[]), fixed_magnification=False, additional_image=False) ...
0
0
0
0
0
0
Algo and DSA/LeetCode-Solutions-master/Python/rearrange-spaces-between-words.py
Sourav692/FAANG-Interview-Preparation
3,269
1646143
<gh_stars>1000+ # Time: O(n) # Space: O(1) # inplace solution class Solution(object): def reorderSpaces(self, text): """ :type text: str :rtype: str """ text = list(text) # count the spaces and words space_count, word_count = 0, 0 for i, c in enumera...
0
0
0
0
0
0
tools/checkteamtags/owners_file_tags.py
zipated/src
2,151
1646165
# Copyright (c) 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import re from collections import defaultdict def parse(filename) -> object: """Searches the file for lines that start with `# TEAM:` or `...
1
5
0
0
6
0
Stephanie/Modules/football_module.py
JeremyARussell/stephanie-va
866
1646237
from __future__ import annotations from Stephanie.Modules.base_module import BaseModule from Stephanie.local_libs.football_manager import FootballManager class FootballModule(BaseModule): modules: tuple[tuple[str, tuple[str, str]], tuple[str, tuple[str, str]], tuple[str, tuple[str, str, str]], tuple[str, tuple[st...
0
14
1
0
15
0
tutorials/mobilenetv3_prod/Step1-5/mobilenetv3_ref/__init__.py
fengxiaoshuai/models
7,090
1646242
from .metric import accuracy_torch from .presets import *
0
0
0
0
0
0
siem/09_GetOffensesForIp.py
IBM/api-samples
172
1646259
#!/usr/bin/env python3 # This sample demonstrates how to use the siem/source_addresses and # siem/local_destination_addresses endpoints in the REST API. # Here we will be showing an example of how to get all offenses associated with # an IP address. For this scenario to work there must already be offenses on # the sys...
0
5
0
0
5
0
apiserver/apiserver/coordinator_server.py
johnnykwwang/Halite-III
232
1646266
<reponame>johnnykwwang/Halite-III from . import app, setup_logging from . import config from . import coordinator app.config["MAX_CONTENT_LENGTH"] = config.MAX_COMPILED_BOT_UPLOAD_SIZE setup_logging("coordinator_server.log", app.logger) app.register_blueprint(coordinator.coordinator_api, url_prefix="/v1/coordinator")...
0
0
0
0
0
0
Python/kmphtomph.py
thefool76/hacktoberfest2021
448
1646274
#!/usr/bin/env python kmh = int(raw_input("Enter km/h: ")) mph = 0.6214 * kmh print "Speed:", kmh, "KM/H = ", mph, "MPH"
0
0
0
0
0
0
tutorials/cloud-iot-gateways-rpi/colors.py
tjwebb/community
1,723
1646287
<filename>tutorials/cloud-iot-gateways-rpi/colors.py class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' CEND = '\33[0m' CBOLD = '\33[1m' CITALIC = '\33[3m' CURL = '\33[4m' C...
0
0
0
0
0
0
pushkin/database/migrations/versions/e2a42bcd4c02_initial_state.py
Nordeus/pushkin
281
1646294
<reponame>Nordeus/pushkin ''' The MIT License (MIT) Copyright (c) 2016 Nordeus LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u...
0
0
0
0
0
0
7.5/Add to plugins folder/Code editor/template/__init__.py
taotaoqqq/Python_editor
237
1646308
<reponame>taotaoqqq/Python_editor __author__ = '<NAME>'
0
0
0
0
0
0
tests/ex-tests/002-testRefcount/ex-test_refcount.py
nandub/nim-pymod
256
1646346
#!/usr/bin/env python # Copyright (c) 2015 SnapDisco Pty Ltd, Australia. # All rights reserved. # # This source code is licensed under the terms of the MIT license # found in the "LICENSE" file in the root directory of this source tree. import _refcount import numpy as np import sys def refcount(obj) -> object: ...
0
1
0
0
1
0
tests/contrib/django/asgi.py
melancholy/dd-trace-py
308
1646347
from django.core.asgi import get_asgi_application application = get_asgi_application()
0
0
0
0
0
0
statsforecast/adapters/prophet.py
Nixtla/statsforecast
483
1646377
<gh_stars>100-1000 # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/adapters.prophet.ipynb (unless otherwise specified). __all__ = ['AutoARIMAProphet'] # Cell import sys from copy import deepcopy import numpy as np import statsmodels.api as sm import pandas as pd from ..arima import AutoARIMA if sys.version_info.min...
0
0
0
0
0
0
cross3d/softimage/softimagescenecamera.py
vedantirb/cross3d
129
1646408
## # \namespace cross3d.softimage.softimagescenecamera # # \remarks The SotimageSceneCamera class provides the implementation of the AbstractSceneCamera class as it applies # to Softimage scenes # # \author douglas # \author <NAME> # \date 03/15/10 # import os import re import math import traceback...
0
0
0
0
0
0
tests/ut/python/pynative_mode/test_multi_grad.py
PowerOlive/mindspore
3,200
1646461
<gh_stars>1000+ # Copyright 2020 Huawei Technologies Co., Ltd # # 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 ...
0
0
0
0
0
0
bootstrap/lib/overwrite_print.py
Cadene/bootstrap.pytorch
196
1646532
from .logger import Logger # TODO: better overwritting def print(*msg): Logger().log_message(*msg, stack_displacement=2)
0
0
0
0
0
0
Source/prj/main/PackageConfig.py
fairhopeweb/Projeny
752
1646541
<filename>Source/prj/main/PackageConfig.py<gh_stars>100-1000 from mtm.util.Assert import * class PackageConfig: def __init__(self): self.dependencies = []
0
0
0
0
0
0
code/datasets.py
hyungkwonko/DanbooRegion
292
1646546
<filename>code/datasets.py from rotate import * def d_resize(x, d, fac=1.0): new_min = min(int(d[1] * fac), int(d[0] * fac)) raw_min = min(x.shape[0], x.shape[1]) if new_min < raw_min: interpolation = cv2.INTER_AREA else: interpolation = cv2.INTER_LANCZOS4 y = cv2.resize(x, (int(d[...
0
0
0
0
0
0
brute_force__examples/single.py
DazEB2/SimplePyScripts
117
1646565
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import annotations __author__ = 'ipetrash' # SOURCE: https://ru.stackoverflow.com/a/776780/201445 import hashlib from itertools import product def brute_force(mask, hsh, alphabet) -> object | None: # заменяем '*' на '{}' для последующей подстанов...
0
1
0
0
1
0
indra/tests/test_biofactoid.py
zebulon2/indra
136
1646617
import os import json from indra.sources import biofactoid here = os.path.dirname(os.path.abspath(__file__)) def test_process_document(): doc_json = os.path.join(here, 'biofactoid_doc.json') with open(doc_json, 'r') as fh: doc = json.load(fh) bp = biofactoid.process_json([doc]) assert len(bp....
0
0
0
0
0
0
2013_08_21/numeros_romanos.py
samisafatli/dojo
114
1646645
<gh_stars>100-1000 LETRAS_ROMANAS = { "Y": 0, "I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000 } def romano_para_decimal(romano): resposta = 0 romano = romano + 'Y' if (len(romano) == 1): return LETRAS_ROMANAS[romano] for i in xrange(len(romano) - 1 ): at...
0
0
0
0
0
0
tests/integration/test_replicated_fetches_bandwidth/test.py
mga-chka/ClickHouse
15,577
1646652
<reponame>mga-chka/ClickHouse #!/usr/bin/env python3 from helpers.cluster import ClickHouseCluster import pytest import random import string from helpers.network import NetThroughput import subprocess import time import statistics cluster = ClickHouseCluster(__file__) node1 = cluster.add_instance('node1', with_zookeep...
0
0
0
0
0
0
tests/tensortrade/unit/feed/api/generic/test_reduce.py
nicomon24/tensortrade
3,081
1646676
from tensortrade.feed import Stream from tests.utils.ops import assert_op def test_reduce_sum(): s1 = Stream.source([1, 2, 3, 4, 5, 6, 7], dtype="float").rename("s1") s2 = Stream.source([7, 6, 5, 4, 3, 2, 1], dtype="float").rename("s2") w = Stream.reduce([s1, s2]).sum().rename("w") expected = [8...
0
0
0
0
0
0
models/unsupervised/dbscan.py
pragnesh-ai/driverlessai-recipes
194
1646689
<filename>models/unsupervised/dbscan.py """Clustering using DBScan""" import datatable as dt import numpy as np import sklearn as sk from h2oaicore.models import CustomUnsupervisedModel from h2oaicore.transformer_utils import CustomUnsupervisedTransformer class DBScanTransformer(CustomUnsupervisedTransformer): @s...
0
0
0
0
0
0
chempy/eyring.py
bertiewooster/chempy
340
1646700
<reponame>bertiewooster/chempy<filename>chempy/eyring.py # -*- coding: utf-8 -*- from .util.pyutil import ChemPyDeprecationWarning import warnings from .kinetics.eyring import eyring_equation, EyringParam, EyringParamWithUnits warnings.warn("use .kinetics.eyring instead of .eyring", ChemPyDeprecationWarning)
0
0
0
0
0
0
tensorflow_graphics/rendering/volumetric/tests/ray_radiance_test.py
Liang813/graphics
2,759
1646705
<reponame>Liang813/graphics<filename>tensorflow_graphics/rendering/volumetric/tests/ray_radiance_test.py # Copyright 2020 The TensorFlow Authors # # 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 a...
0
0
0
0
0
0
src/openvr/gl_renderer.py
risa2000/pyopenvr
204
1646714
<filename>src/openvr/gl_renderer.py<gh_stars>100-1000 #!/bin/env python # file openvr_gl_renderer.py from OpenGL.GL import * # @UnusedWildImport # this comment squelches an IDE warning import numpy import openvr """ Renders OpenGL scenes to virtual reality headsets using OpenVR API """ # TODO: matrixForOpenVrMat...
0
0
0
0
0
0
anchore/cli/feeds.py
berez23/anchore
401
1646728
import sys import click import time import calendar import datetime from anchore.cli.common import anchore_print, anchore_print_err from anchore import anchore_auth, anchore_feeds from anchore.anchore_utils import contexts config = {} @click.group(name='feeds', short_help='Manage syncing of and subscriptions to Anch...
0
0
0
0
0
0
nesmdb/__init__.py
duhaime/nesmdb
408
1646753
import apu import convert import cycle
0
0
0
0
0
0
demo/LKE_demo.py
CUHK-CSE/logalizer
859
1646762
#!/usr/bin/env python import sys sys.path.append('../') from logparser import LKE input_dir = '../logs/HDFS/' # The input directory of log file output_dir = 'LKE_result/' # The output directory of parsing results log_file = 'HDFS_2k.log' # The input log file name log_format = '<Date> <Ti...
0
0
0
0
0
0
deepspeed/runtime/swap_tensor/constants.py
jglaser/DeepSpeed
6,728
1646808
""" "Copyright 2020 The Microsoft DeepSpeed Team. Licensed under the MIT license. """ ######################################### # AIO ######################################### AIO_FORMAT = ''' "aio": { "block_size": 1048576, "queue_depth": 8, "thread_count": 1, "single_submit": false, "overlap_events": true }...
0
0
0
0
0
0
zhaquirks/heiman/__init__.py
WolfRevo/zha-device-handlers
213
1646813
"""Quirks for Heiman devices.""" HEIMAN = "Heiman"
0
0
0
0
0
0
tests/python/correctness/ft_shard_basic.py
sid17/weaver
163
1646815
#! /usr/bin/env python # # =============================================================== # Description: Basic fault tolerance test: # create a graph, kill some primary shards, read # from backups. # # Created: 2014-06-12 10:21:05 # # Author: <NAME>, <EMAIL> #...
0
0
0
0
0
0
development_playgrounds/StructuredInferencePlayground_modified.py
ai-di/Brancher
208
1646828
import matplotlib.pyplot as plt import numpy as np from brancher.variables import RootVariable, RandomVariable, ProbabilisticModel from brancher.standard_variables import NormalVariable, DeterministicVariable, MultivariateNormalVariable from brancher import inference import brancher.functions as BF N_itr = 250 N_smpl...
0
0
0
0
0
0
ffmlp/__init__.py
VCAT19/torch-ngp
262
1646852
from .ffmlp import FFMLP
0
0
0
0
0
0
tests/test_selectors.py
dhruvdcoder/jsonbender
115
1646865
<gh_stars>100-1000 import unittest from jsonbender.selectors import F, ProtectedF, K, S, OptionalS from jsonbender.test import BenderTestMixin class TestK(unittest.TestCase, BenderTestMixin): selector_cls = K def test_k(self): self.assert_bender(K(1), {}, 1) self.assert_bender(K('string'), {...
0
0
0
0
0
0
tkinter/optionmenu/pandas-filter/main.py
whitmans-max/python-examples
140
1646867
#!/usr/bin/env python3 # date: 2020.01.24 # import tkinter as tk import pandas as pd # --- functions --- def on_click(): val = selected.get() if val == 'all': print(df) else: df2 = df[ df['TIME'] == val ] print(df2) # --- main --- df = pd.DataFrame({ 'TIME'...
0
0
0
0
0
0
wot/population.py
zsteve/wot
106
1646870
# -*- coding: utf-8 -*- from __future__ import annotations import numpy as np class Population: """ A Population is a measure over the the cells at given timepoint. Parameters ---------- time : int or float The time at which the cells where measured. p : 1-D array-like Measur...
3
2
0
0
5
0
ninfs/gui/confighandler.py
Jhynjhiruu/ninfs
213
1646875
<filename>ninfs/gui/confighandler.py<gh_stars>100-1000 # This file is a part of ninfs. # # Copyright (c) 2017-2021 <NAME> # This file is licensed under The MIT License (MIT). # You can find the full license text in LICENSE.md in the root of this project. from configparser import ConfigParser from os import environ, ma...
0
0
0
0
0
0
pml/SplitClassifier_tests.py
gatapia/py_ml_utils
183
1646882
from __future__ import print_function, absolute_import import unittest, sklearn, sklearn.dummy, numpy as np from SplitClassifier import SplitClassifier class T(unittest.TestCase): def test_split_classifier_with_single_classifier(self): c = sklearn.dummy.DummyClassifier('constant', constant=0) sc = S...
0
2
0
0
2
0
zeus/vcs/__init__.py
conrad-kronos/zeus
221
1646907
<filename>zeus/vcs/__init__.py from .client import vcs_client # NOQA
0
0
0
0
0
0
transistor/persistence/exporters/xml.py
awesome-archive/transistor
232
1646929
# -*- coding: utf-8 -*- """ transistor.persistence.exporters.xml ~~~~~~~~~~~~ This module implements classes that export (serialize) the data inside a BaseWorker from a SplashScraper to XML. Most of this module is heavily inspired or else copied from Scrapy. It has been modified to fit Transistor's API in requiring a ...
2
2
0
1
5
0
dib-render/chamfer_dist/chamfer.py
DrZedd42/DIB-R
607
1646931
# Copyright (c) 2019, 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 rights to use, copy, m...
0
3
0
0
3
0
mmaction/models/common/__init__.py
HypnosXC/mmaction2
549
1646935
from .conv2plus1d import Conv2plus1d __all__ = ['Conv2plus1d']
0
0
0
0
0
0
src/tests/test_unfoldattn.py
microsoft/vision-longformer
169
1646939
import time import unittest from typing import Union import torch import numpy as np import random from functools import lru_cache from einops import rearrange, repeat import torch.nn.functional as F from torch import nn, einsum @lru_cache() def get_2dmask(seq_len, nx, ny, w, d) -> object: return torch.BoolTensor...
31
8
0
0
39
0
build/setup.tf.py
nammingi/haste
291
1646956
<reponame>nammingi/haste # Copyright 2020 LMNT, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
0
0
0
0
0
0
gui.py
playboy8/starquant
322
1646962
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import yaml from PyQt5 import QtCore, QtWidgets, QtGui from source.gui.ui_main_window import MainWindow import atexit from signal import signal, SIGINT, SIG_DFL from os import kill from multiprocessing import Process import itchat # https://stackoverfl...
0
0
0
0
0
0
Ch17/hopfield.py
jason-168/MLCode
146
1646979
<gh_stars>100-1000 # Code from Chapter 17 of Machine Learning: An Algorithmic Perspective (2nd Edition) # by <NAME> (http://stephenmonika.net) # You are free to use, change, or redistribute the code in any way you wish for # non-commercial purposes, but please maintain the name of the original author. # This code com...
0
0
0
0
0
0
mlcomp/contrib/search/grid.py
megachester/mlcomp
166
1646995
<filename>mlcomp/contrib/search/grid.py<gh_stars>100-1000 from itertools import product from os.path import join from typing import List from glob import glob from mlcomp.utils.io import yaml_load from mlcomp.utils.misc import dict_flatten def cell_name(cell: dict): c = dict_flatten(cell) parts = [] for ...
0
0
0
0
0
0
tests/table/test_count.py
0scarB/piccolo
750
1647010
from tests.example_apps.music.tables import Band from ..base import DBTestCase class TestCount(DBTestCase): def test_exists(self): self.insert_rows() response = Band.count().where(Band.name == "Pythonistas").run_sync() self.assertTrue(response == 1)
0
0
0
0
0
0
docs_src/progressbar/tutorial002.py
madkinsz/typer
7,615
1647012
<reponame>madkinsz/typer import time import typer def iterate_user_ids(): # Let's imagine this is a web API, not a range() for i in range(100): yield i def main(): total = 0 with typer.progressbar(iterate_user_ids(), length=100) as progress: for value in progress: # Fake...
0
0
0
0
0
0
test/t5_chinese_autotitle_test.py
6666ev/bert_seq2seq
795
1647021
<gh_stars>100-1000 import torch from bert_seq2seq.tokenizer import load_chinese_base_vocab, T5PegasusTokenizer from bert_seq2seq.extend_model_method import ExtendModel import glob device = torch.device("cuda" if torch.cuda.is_available() else "cpu") from bert_seq2seq.t5_ch import T5Model vocab_path = "./state_dict...
0
0
0
0
0
0
datasette/utils/sqlite.py
eyeseast/datasette
5,978
1647068
using_pysqlite3 = False try: import pysqlite3 as sqlite3 using_pysqlite3 = True except ImportError: import sqlite3 if hasattr(sqlite3, "enable_callback_tracebacks"): sqlite3.enable_callback_tracebacks(True) _cached_sqlite_version = None def sqlite_version() -> object: global _cached_sqlite_vers...
0
4
0
0
4
0
src/rnn_decoder_lsa.py
ishine/ppg-vc
133
1647112
from __future__ import annotations import torch import torch.nn as nn import torch.nn.functional as F from .lsa_attention import LocationSensitiveAttention from .basic_layers import Linear, Conv1d from .vc_utils import get_mask_from_lengths class DecoderPrenet(nn.Module): def __init__(self, in_dim, sizes): ...
4
8
0
0
12
0
DQM/L1TMonitorClient/python/L1TStage2uGTClient_cff.py
ckamtsikis/cmssw
852
1647132
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDHarvester import DQMEDHarvester from DQM.L1TMonitor.L1TStage2uGT_cff import l1tStage2uGMTOutVsuGTIn # directory path shortening ugtDqmDir = 'L1T/L1TStage2uGT' ugtBoardCompDqmDir = ugtDqmDir+'/uGTBoardComparisons' # input histograms...
0
0
0
0
0
0
axes/migrations/0006_remove_accesslog_trusted.py
AMDINDOWS/django-axes
831
1647139
<reponame>AMDINDOWS/django-axes # Generated by Django 2.0.4 on 2019-03-13 08:55 from django.db import migrations class Migration(migrations.Migration): dependencies = [("axes", "0005_remove_accessattempt_trusted")] operations = [migrations.RemoveField(model_name="accesslog", name="trusted")]
0
0
0
0
0
0
config.py
Heinlein-vi/simulated-unsupervised-tensorflow
639
1647154
#-*- coding: utf-8 -*- import argparse def str2bool(v) -> object: return v.lower() in ('true', '1') arg_lists = [] parser = argparse.ArgumentParser() def add_argument_group(name) -> object: arg = parser.add_argument_group(name) arg_lists.append(arg) return arg # Network net_arg = add_argument_group('Network...
0
3
0
0
3
0
test/cut/test_cut_ops_preserve_id.py
stachu86/lhotse
353
1647170
import pytest # Note: # Definitions for `cut1`, `cut2` and `cut_set` parameters are standard Pytest fixtures located in test/cut/conftest.py # ######################################## # ############### PADDING ################ # ######################################## @pytest.mark.parametrize("direction", ["right...
4
0
0
0
4
0
silver/api/views/plan_views.py
DocTocToc/silver
222
1647187
# Copyright (c) 2015 Presslabs SRL # # 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 writ...
0
4
4
0
8
0
learntools/data_viz_to_coder/ex1.py
roannav/learntools
359
1647247
<reponame>roannav/learntools import pandas as pd import matplotlib import seaborn as sns import matplotlib.pyplot as plt from learntools.core import * df = pd.read_csv("../input/fifa.csv", index_col="Date", parse_dates=True) class FeedbackSys(EqualityCheckProblem): _var = 'one' _expected = 1 _hint = ("Ho...
0
0
0
0
0
0
binding.gyp
likern/nwm
460
1647264
<filename>binding.gyp { 'targets': [ { 'target_name': 'nwm', 'sources': [ 'src/nwm/nwm_node.cc' ], 'dependencies': ['listc', 'nwmc'], 'include_dirs' : [ "<!(node -e \"require('nan')\")" ] }, { 'target_name': 'listc', 'type': 'static_library...
0
0
0
0
0
0
examples/hwapi/hwconfig_console.py
sebastien-riou/micropython
13,648
1647303
# This is hwconfig for "emulation" for cases when there's no real hardware. # It just prints information to console. class LEDClass: def __init__(self, id): self.id = "LED(%d):" % id def value(self, v): print(self.id, v) def on(self): self.value(1) def off(self): self....
0
0
0
0
0
0
AutotestWebD/apps/user_center/views/user_token.py
yangjourney/sosotest
422
1647305
<filename>AutotestWebD/apps/user_center/views/user_token.py from apps.common.func.CommonFunc import * from apps.common.func.LanguageFunc import * from django.shortcuts import render, HttpResponse from apps.user_login.services.user_loginService import UserLoginService from urllib import parse from apps.user_center.servi...
0
0
0
0
0
0
emukit/examples/profet/meta_benchmarks/meta_surrogates.py
EmuKit/Emukit
272
1647331
from __future__ import annotations import numpy as np import torch def objective_function( config, model_objective, model_cost, task_feature_objective, task_feature_cost, x_mean_objective, x_std_objective, x_mean_cost, x_std_cost, y_mean_objective: object | None=None, y_std...
6
1
0
0
7
0
gas_station/solution.py
mahimadubey/leetcode-python
528
1647336
class Solution: # @param gas, a list of integers # @param cost, a list of integers # @return an integer def canCompleteCircuit(self, gas, cost): n = len(gas) t = [0 for i in range(n)] for i in range(n): t[i] = gas[i] - cost[i] res = 0 cs = 0 # Current...
0
0
0
0
0
0
generic_scaffold/tests.py
spapas/django-generic-scaffold
106
1647342
from django.test import TestCase, RequestFactory, Client import django if django.VERSION >= (2, 0, 0): from django.urls import reverse else: from django.core.urlresolvers import reverse from django.db import models from django.views.generic import ListView, CreateView , DetailView, UpdateView, DeleteView from g...
0
0
12
0
12
0
local/get_spk_emb.py
ishine/pytorch-kaldi-neural-speaker-embeddings
141
1647350
from kaldi_io import read_vec_flt, write_vec_flt, open_or_fd, write_mat import sys import numpy as np from collections import defaultdict dev_test_spk = ['p311', 'p226', 'p303', 'p234', 'p302', 'p237', 'p294', 'p225'] with open(sys.argv[1], 'r') as f: content = f.readlines() content = [x.strip() for x in content]...
0
0
0
0
0
0
core/RosettaStone.py
lluisgomez/DeepRosetta
166
1647364
<filename>core/RosettaStone.py import os class RosettaStone(object): """ Class imodeling our network representation """ def __init__(self, *args, **kwargs): self.importers = self.list_importers() self.exporters = self.list_exporters() def load_list(self, module): """ Loads a list...
0
0
0
0
0
0
mmdet/ops/riroi_align/modules/riroi_align.py
yanglinGEM/ReDet
270
1647400
from torch.nn.modules.module import Module from ..functions.riroi_align import RiRoIAlignFunction class RiRoIAlign(Module): def __init__(self, out_size, spatial_scale, sample_num: int=0, nOrientation: int=8): super(RiRoIAlign, self).__init__() self.out_size = out_size self.spatial_scale...
2
1
0
0
3
0
reviewboard/admin/forms/support_settings.py
grimmy/reviewboard
921
1647433
<reponame>grimmy/reviewboard """Administration form for support settings.""" from __future__ import unicode_literals from django import forms from django.utils.translation import ugettext_lazy as _ from djblets.siteconfig.forms import SiteSettingsForm from reviewboard.admin.support import get_install_key class Sup...
0
0
0
0
0
0
tests/r/test_bomregions2012.py
hajime9652/observations
199
1647461
<filename>tests/r/test_bomregions2012.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.bomregions2012 import bomregions2012 def test_bomregions2012(): """Test module bomregions2012.py by dow...
0
0
0
0
0
0
os/example_utime.py
AEMICS/pycopy-lib
126
1647506
<gh_stars>100-1000 import sys import os os.utime(sys.argv[1], (1.1, 2.2))
0
0
0
0
0
0
gcloud/apigw/views/register_project.py
wkma/bk-sops
881
1647549
# -*- 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 file except in complianc...
0
1
0
0
1
0
test/test_from_iterable.py
dbrattli/aioreactive
280
1647562
import asyncio from typing import Optional import aioreactive as rx import pytest from aioreactive.notification import OnCompleted, OnError, OnNext from aioreactive.testing import AsyncTestObserver, VirtualTimeEventLoop from expression.system.disposable import AsyncDisposable @pytest.yield_fixture() # type:ignore d...
1
1
2
0
4
0
common/data_refinery_common/migrations/0054_datasetannotation.py
erflynn/refinebio
106
1647568
# Generated by Django 2.2.10 on 2020-03-16 17:25 import django.contrib.postgres.fields.jsonb import django.db.models.deletion import django.db.models.manager import django.utils.timezone from django.db import migrations, models class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ...
0
0
2
0
2
0
hikyuu/admin/widget/Ui_HkuPersonInfoWidget.py
kknet/hikyuu
1,283
1647595
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Ui_HkuPersonInfoWidget.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 impo...
0
0
0
0
0
0
Hackerrank/Python/Simple Array Sum.py
Shaswat-2203/HacktoberfestForBeginners
115
1647607
#By <NAME> #Algorithms #Data Structures size=int(input("Entre The Size Of Array")) #takes input as size of array ar=[] #array declaration arrsum=0 for i in range(0,size): ...
0
0
0
0
0
0
homeassistant/components/min_max/__init__.py
andersop91/core
22,481
1647664
"""The min_max component.""" from homeassistant.const import Platform DOMAIN = "min_max" PLATFORMS = [Platform.SENSOR]
0
0
0
0
0
0
976 Largest Perimeter Triangle.py
krishna13052001/LeetCode
872
1647679
<filename>976 Largest Perimeter Triangle.py #!/usr/bin/python3 """ Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths. If it is impossible to form any triangle of non-zero area, return 0. Example 1: Input: [2,1,2] Output: 5 Example 2: ...
0
0
0
0
0
0
rotkehlchen/utils/mixins/serializableenum.py
rotkehlchenio/rotkehlchen
137
1647703
<gh_stars>100-1000 from enum import Enum from typing import Type, TypeVar from rotkehlchen.errors.serialization import DeserializationError # lgtm[py/unsafe-cyclic-import] T = TypeVar('T', bound=Enum) class SerializableEnumMixin(Enum): def __str__(self) -> str: return ' '.join(word.lower() for word in...
0
0
0
0
0
0
smartsim/database/slurmOrchestrator.py
neuralvis/SmartSim
117
1647711
# BSD 2-Clause License # # Copyright (c) 2021, Hewlett Packard Enterprise # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright noti...
10
4
0
2
16
0
scripts/owner/suggest_owners.py
allansrc/fuchsia
210
1647755
<gh_stars>100-1000 #!/usr/bin/env python3.8 # Copyright 2021 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. """ Suggests OWNERS for projects in a jiri manifest without owners. For each project in a given jiri manifest file...
0
0
0
0
0
0
recipes/Python/577428_Simplest_example_serving_browser/recipe-577428.py
tdiprima/code
2,023
1647767
#!/usr/bin/env python import socket, threading, time def handle(s): print s print repr(s.recv(4096)) html = "<html><body>" html += time.asctime() html += "</body></html>" s.send(html) s.close() s = socket.socket() s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind(('', 8888)); s.listen(...
0
0
0
0
0
0