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
sdks/python/apache_beam/io/gcp/dicomio.py
hengfengli/beam
5,279
1674222
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
11
10
0
0
21
0
tests/modules/contrib/test_getcrypto.py
spxtr/bumblebee-status
1,089
1674257
import pytest pytest.importorskip("requests") pytest.importorskip("requests.exceptions") def test_load_module(): __import__("modules.contrib.getcrypto")
0
0
0
0
0
0
homeassistant/components/sonos/config_flow.py
andersop91/core
22,481
1674266
"""Config flow for SONOS.""" import dataclasses from homeassistant import config_entries from homeassistant.components import ssdp, zeroconf from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResult from homeassistant.helpers.config_entry_flow import DiscoveryFlowHandler from ....
2
3
0
0
5
0
src/textacy/spacier/core.py
austinjp/textacy
1,929
1674279
<reponame>austinjp/textacy """ :mod:`textacy.spacier.core`: Convenient entry point for loading spaCy language pipelines and making spaCy docs. """ from __future__ import annotations import functools import logging import pathlib from typing import Optional import spacy from cachetools import cached from cachetools.ke...
0
0
0
0
0
0
tests/python/view_layer/test_move_above_below_scene_collection_c.py
rbabari/blender
365
1674280
<gh_stars>100-1000 # ############################################################ # Importing - Same For All Render Layer Tests # ############################################################ import unittest import os import sys from view_layer_common import * # ######################################################...
0
0
0
0
0
0
configs/universe_r101_gfl/universe_r101_gfl_mstrain_private_pseudo.py
kazakh-shai/kaggle-global-wheat-detection
136
1674294
<reponame>kazakh-shai/kaggle-global-wheat-detection _base_ = "./universe_r101_gfl_mstrain_local_pseudo.py" kaggle_working = "/kaggle/working/" data_root = "/kaggle/input/global-wheat-detection/" data = dict( train=dict( ann_file=[ kaggle_working + "coco_train.json", kaggle_working +...
0
0
0
0
0
0
mealpy/swarm_based/MFO.py
Alhassan20/mealpy
162
1674319
#!/usr/bin/env python # ------------------------------------------------------------------------------------------------------% # Created by "<NAME>" at 11:59, 17/03/2020 % # ...
12
2
0
0
14
0
examples/40_advanced/example_debug_logging.py
Louquinze/auto-sklearn
6,390
1674344
# -*- encoding: utf-8 -*- """ ===================== Logging and debugging ===================== This example shows how to provide a custom logging configuration to *auto-sklearn*. We will be fitting 2 pipelines and showing any INFO-level msg on console. Even if you do not provide a logging_configuration, autosklearn c...
0
0
0
0
0
0
lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
dan-zheng/llvm-project
765
1674409
""" Test SB API support for identifying artificial (tail call) frames. """ import lldb import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * class TestTailCallFrameSBAPI(TestBase): mydir = TestBase.compute_mydir(__file__) @skipIf(compiler="cl...
0
0
0
0
0
0
app/api/cms/banner.py
Allen7D/mini-shop-server
533
1674418
<reponame>Allen7D/mini-shop-server # _*_ coding: utf-8 _*_ """ Created by Allen7D on 2020/6/30. ↓↓↓ Banner接口 ↓↓↓ """ from app.extensions.api_docs.redprint import Redprint from app.extensions.api_docs.cms import banner as api_doc from app.core.token_auth import auth from app.core.utils import paginate from app.model...
0
0
0
0
0
0
Python/klampt/plan/motionplanning.py
smeng9/Klampt
238
1674465
<reponame>smeng9/Klampt # This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.8 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. """Python interface to C++ motion planning routines""" from sys import version_info if v...
0
0
0
0
0
0
python/tvm/micro/project_api/server.py
XiaoSong9905/tvm
4,640
1674480
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
25
18
1
0
44
0
manuscript/listings/cubify.py
ssloy/least-squares-course
129
1674482
<gh_stars>100-1000 import numpy as np from mesh import Mesh from scipy.sparse import lil_matrix from scipy.sparse.linalg import lsmr def normalize(v): return v / np.linalg.norm(v) def cross(v1, v2): return [v1[1]*v2[2] - v1[2]*v2[1], v1[2]*v2[0] - v1[0]*v2[2], v1[0]*v2[1] - v1[1]*v2[0]] def nearest_ax...
0
0
0
0
0
0
flearn/trainers/afl.py
Iacob-Alexandru-Andrei/fair_flearn
171
1674484
import numpy as np from tqdm import trange, tqdm import tensorflow as tf from .fedbase import BaseFedarated from flearn.utils.tf_utils import process_grad, cosine_sim, softmax, norm_grad from flearn.utils.model_utils import batch_data, gen_batch, gen_epoch, project class Server(BaseFedarated): def __init__(self,...
0
0
0
0
0
0
Chapter08/8A_OpenBankAPI/props/apisandbox.py
uyenphuong18406/Hands-On-Artificial-Intelligence-for-Banking
115
1674491
<reponame>uyenphuong18406/Hands-On-Artificial-Intelligence-for-Banking # API server URL BASE_URL = "https://apisandbox.openbankproject.com" API_VERSION = "v2.0.0" API_VERSION_V210 = "v2.1.0" API_VERSION_V220 = "v2.2.0" # API server will redirect your browser to this URL, should be non-functional # You will paste the re...
0
0
0
0
0
0
meta_reward_learning/semantic_parsing/common_flags.py
deepneuralmachine/google-research
23,901
1674494
<gh_stars>1000+ # coding=utf-8 # Copyright 2021 The Google Research 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
0
0
0
0
0
0
基础教程/A2-神经网络基本原理/第5步 - 非线性分类/src/ch11-NonLinearMultipleClassification/HelperClass2/Visualizer_1_1.py
microsoft/ai-edu
11,094
1674503
<reponame>microsoft/ai-edu # Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. import numpy as np import matplotlib.pyplot as plt import math from HelperClass2.EnumDef_2_0 import * def DrawTwoCategoryPoints(X1, X2, Y, xl...
0
0
0
0
0
0
opacus/grad_sample/layer_norm.py
anibadde/opacus
958
1674526
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import torch import torch.nn as nn import torch.nn.functional as F from opacus.utils.tensor_utils import sum_over_all_but_batch_and_last_n from .utils import create_or_extend_grad_sample, register_grad_sampler @register_g...
4
1
0
0
5
0
average_scores.py
coderSkyChen/Action_Recognition_Zoo
240
1674531
# @Author : <NAME> # @Email : <EMAIL> # @Personal homepage : https://coderskychen.cn import numpy as np import pdb def valid(): files_scores = ['/home/mcg/cxk/action-recognition-zoo/results/tsn-flow/output/flow.npz', '/home/mcg/cxk/action-recognition-zoo/results/tsn-rgb/output/rgb.npz'] allsum = np.zeros...
0
0
0
0
0
0
tutorial/examples/external_css_and_js/custom-dash-renderer.py
blozano824/dash-docs
379
1674537
import dash import dash_html_components as html external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] app = dash.Dash(__name__, external_stylesheets=external_stylesheets) app.renderer = 'var renderer = new DashRenderer();' app.layout = html.Div('Simple Dash App') if __name__ == '__main__': app....
0
0
0
0
0
0
skyfield/errors.py
facorazza/python-skyfield
765
1674548
"""Exceptions specific to the Skyfield library.""" class DeprecationError(Exception): """Explain that a Skyfield feature has been removed.""" class EphemerisRangeError(ValueError): """An ephemeris has been asked about positions outside its time range. Attributes: - `start_time`, `end_time`: the rang...
0
0
0
1
1
0
Test/FunctionalTests/CommonTestScripts/CreateNewDocumentSingular.py
jethac/ATF
821
1674551
<gh_stars>100-1000 #Copyright (c) 2014 Sony Computer Entertainment America LLC. See License.txt. import sys sys.path.append("./CommonTestScripts") import Test cntOg = Test.GetEnumerableCount(atfDocService.OpenDocuments) if (cntOg == 0): cntExp = 1 else: cntExp = cntOg doc = atfFile.OpenNewDo...
0
0
0
0
0
0
other/Imaging-1.1.7/build/lib.macosx-10.7-intel-2.7/__init__.py
dguo/headlines
132
1674552
# # The Python Imaging Library. # $Id$ # # package placeholder # # Copyright (c) 1999 by Secret Labs AB. # # See the README file for information on usage and redistribution. # # ;-)
0
0
0
0
0
0
src/optim.py
RechardWong/End-to-end-ASR-Pytorch
913
1674556
import torch import numpy as np from functools import partial class Optimizer(): def __init__(self, parameters, optimizer, lr, eps, lr_scheduler, tf_start: int=1, tf_end: int=1, tf_step: int=1, **kwargs): # Setup teacher forcing scheduler self.tf_type = tf_end != 1 self.tf_rate = lambda st...
3
4
0
1
8
0
Test/litani/test/e2e/tests/no_timed_out.py
OscarShiang/FreeRTOS-Briey
369
1674559
# Copyright Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license" fil...
0
4
0
0
4
0
levels/urls.py
FuentesFelipe/asvs
128
1674583
from django.conf.urls import url from .views import levels urlpatterns = [ url(r'(?P<level>\d+)', levels, name="level"), ]
0
0
0
0
0
0
unsilence/lib/detect_silence/DetectSilence.py
zbouvier/unsilence
236
1674590
<filename>unsilence/lib/detect_silence/DetectSilence.py import re import subprocess from pathlib import Path from unsilence.lib.intervals.Intervals import Intervals, Interval def detect_silence(input_file: Path, **kwargs): """ Detects silence in a file and outputs the intervals (silent/not silent) as a lib.I...
0
0
0
0
0
0
zippy/benchmarks/src/benchmarks/whoosh/tests/test_indexing.py
lucapele/pele-c
319
1674596
from __future__ import with_statement import random from collections import defaultdict from datetime import datetime import pytest from whoosh import analysis, fields, index, qparser, query from whoosh.compat import b, u, xrange, text_type, PY3, permutations from whoosh.filedb.filestore import RamStorage from whoosh...
0
2
0
0
2
0
tools/svg.py
razsaroya/Online3DViewer
917
1674610
<gh_stars>100-1000 import os import sys import shutil from lib import tools_lib as Tools def Main (argv): toolsDir = os.path.dirname (os.path.abspath (__file__)) rootDir = os.path.dirname (toolsDir) os.chdir (rootDir) iconsDir = os.path.join (rootDir, 'assets', 'icons') tempDir = os.path.join ('build', 'temp') ...
0
0
0
0
0
0
camel_tools/utils/transliterate.py
5amessi/camel_tools
211
1674646
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2021 New York University A<NAME> # # 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 ...
3
1
0
0
4
0
mitemp_bt/__init__.py
sgoudsme/mitemp
106
1674648
"""Public interface for btlewrap.""" import sys # This check must be run first, so that it fails before loading the other modules. # Otherwise we do not get a clean error message. if sys.version_info <= (3, 4): raise ValueError('this library requires at least Python 3.4. ' + 'You\'re running v...
0
0
0
0
0
0
Python/Tests/TestData/FormattingTests/document.py
techkey/PTVS
404
1674652
def f ( one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve ) : pass def g () -> object: return 5 ** 2
0
1
0
0
1
0
tests/components/voicerss/__init__.py
domwillcode/home-assistant
30,023
1674661
<filename>tests/components/voicerss/__init__.py """The tests for VoiceRSS tts platforms."""
0
0
0
0
0
0
tests/calendars/test_cfe_calendar.py
SJCosgrove/quantoipian
412
1674697
<gh_stars>100-1000 from unittest import TestCase import pandas as pd from .test_trading_calendar import ExchangeCalendarTestBase from zipline.utils.calendars.exchange_calendar_cfe import CFEExchangeCalendar class CFECalendarTestCase(ExchangeCalendarTestBase, TestCase): answer_key_filename = "cfe" calendar_cl...
0
0
0
0
0
0
scripts/find_max_server_load.py
nishp77/lbry-sdk
4,996
1674699
import time import asyncio import random from argparse import ArgumentParser from lbry.wallet.network import ClientSession class AgentSmith(ClientSession): async def do_nefarious_things(self): await self.send_request('blockchain.claimtrie.search', { 'no_totals': True, 'offset': ra...
0
2
0
1
3
0
goodreads/book.py
akigmm/goodreads_python_wrapper
284
1674706
from __future__ import annotations """Goodreads book class""" from . import author from . import shelf class GoodreadsBook: def __init__(self, book_dict, client): self._book_dict = book_dict self._client = client def __repr__(self) -> object: return self.title @property def g...
0
26
0
0
26
0
hydrus/core/HydrusDocumentHandling.py
thatfuckingbird/hydrus-websocket-server
1,417
1674712
<reponame>thatfuckingbird/hydrus-websocket-server #import PyPDF2 import re def GetNumWordsFromString( s ): s = re.sub( r'[\s]+', ' ', s ) # turns multiple spaces into single spaces num_words = len( s.split( ' ' ) ) return num_words def GetPDFNumWords( path ): # I discovered a p...
0
0
0
0
0
0
paddlevideo/loader/dataset/frame.py
txyugood/PaddleTableTennis
883
1674717
<gh_stars>100-1000 # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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 ...
0
0
0
0
0
0
tensorflow/python/ops/embedding_ops.py
MathMachado/tensorflow
848
1674733
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
28
11
0
0
39
0
official/utils/misc/model_helpers.py
slomrafgrav/models
515
1674737
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
5
2
0
0
7
0
scripts/CleanupDuplicateMarkers.py
chanzuckerberg/shasta
267
1674744
#!/usr/bin/python3 import shasta import GetConfig # Read the config file. config = GetConfig.getConfig() # Initialize the assembler and access what we need. a = shasta.Assembler() a.accessMarkers() a.accessAlignmentData() a.accessCompressedAlignments() a.accessMarkerGraphVertices(readWriteAccess = True) a.accessMark...
0
0
0
0
0
0
downstream/tinypersons/mmdet/models/necks/channel_mapper.py
bwconrad/solo-learn
271
1674745
from __future__ import annotations import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from ..builder import NECKS @NECKS.register_module() class ChannelMapper(BaseModule): r"""Channel Mapper to reduce/increase channels of backbone features. This is used to reduce/increa...
6
1
0
1
8
0
alipay/aop/api/domain/AlipayEcoContractSignflowsCreateModel.py
antopen/alipay-sdk-python-all
213
1674755
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.Attachment import Attachment from alipay.aop.api.domain.ConfigInfoBean import ConfigInfoBean from alipay.aop.api.domain.TemplateInfoBean import Te...
0
6
0
4
10
0
xmuda/common/utils/torch_util.py
weiliu-ai/AUDA
127
1674764
import random import numpy as np import torch def set_random_seed(seed) -> None: if seed < 0: return random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) # torch.cuda.manual_seed_all(seed) def worker_init_fn(worker_id): """The function is designed for pytorch multi-process ...
0
1
0
0
1
0
RecoTracker/IterativeTracking/python/JetCoreRegionalStep_cff.py
TaeunKwon/cmssw
852
1674774
import FWCore.ParameterSet.Config as cms #for dnn classifier from Configuration.ProcessModifiers.trackdnn_cff import trackdnn from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary # This step runs over all clusters # run only if there are high pT jets jetsForCoreTracking = cms.EDFilter('CandP...
0
0
0
0
0
0
pythonql/parser/PythonQLLexer.py
hi117/pythonql
229
1674792
from __future__ import annotations import ply.lex as lex import types import re # Token class, has all the necessary data for error reporting # and reconstruction of the program class PQLexerToken: def __init__(self, type, value, line_no, column): self.type = type self.value = value self.line_no = line_...
0
8
34
0
42
0
Language Skills/Python/Unit 01 Python Syntax/01 Python Syntax/Varibles and Data Types/Variables.py
rhyep/Python_tutorials
346
1674808
# Write your code below! my_variable = 10
0
0
0
0
0
0
tensorflow_probability/python/internal/reparameterization.py
jakee417/probability-1
3,670
1674810
# Copyright 2018 The TensorFlow Probability 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
0
3
0
0
3
0
tests/test_model/test_recognizer/test_resnet.py
YinAoXiong/ZCls
110
1674822
<reponame>YinAoXiong/ZCls # -*- coding: utf-8 -*- """ @date: 2020/11/21 下午4:16 @file: test_resnest.py @author: zj @description: """ import torch from zcls.config import cfg from zcls.config.key_word import KEY_OUTPUT from zcls.model.recognizers.resnet.resnet import ResNet from zcls.model.recognizers.resnet.torchvis...
0
0
0
0
0
0
cli/ripsaw/commands/operator.py
troy0820/benchmark-operator
130
1674828
#!/usr/bin/env python # -*- coding: utf-8 -*- # 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 a...
9
2
0
0
11
0
examples/example.py
ziman/idris-py
140
1674829
<gh_stars>100-1000 #!/usr/bin/env python import sys import importlib import math Unit = object() World = object() class IdrisError(Exception): pass def _idris_error(msg): raise IdrisError(msg) def _idris_pymodule(name): return importlib.import_module(name) def _idris_call(f, args): return f(*list(args)) ...
0
0
0
0
0
0
test/export/anki_exporter_wrapper_spec.py
ll-in-anki/CrowdAnki
391
1674835
from unittest.mock import MagicMock from mamba import describe, it, context from crowd_anki.export.anki_exporter_wrapper import AnkiJsonExporterWrapper DUMMY_EXPORT_DIRECTORY = "/tmp" TEST_DECK_ID = 1 with describe(AnkiJsonExporterWrapper) as self: with context("user is trying to export dynamic deck"): ...
0
0
0
0
0
0
rqalpha/data/base_data_source/storages.py
LawrentChen/rqalpha
5,263
1674840
# -*- coding: utf-8 -*- # 版权所有 2020 深圳米筐科技有限公司(下称“米筐科技”) # # 除非遵守当前许可,否则不得使用本软件。 # # * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件): # 遵守 Apache License 2.0(下称“Apache 2.0 许可”), # 您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。 # 除非法律有要求或以书面形式达成协议,否则本软件分发时...
0
16
1
3
20
0
course/migrations/0111_alter_git_source_in_course_to_a_required_field.py
inducer/courseflow
284
1674856
<filename>course/migrations/0111_alter_git_source_in_course_to_a_required_field.py # Generated by Django 1.11.8 on 2018-01-02 06:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('course', '0110_add_force_lang_field_to_course'), ] operations = ...
0
0
0
0
0
0
torch_geometric/datasets/actor.py
NucciTheBoss/pytorch_geometric
2,350
1674858
<filename>torch_geometric/datasets/actor.py from typing import Callable, List, Optional import numpy as np import torch from torch_sparse import SparseTensor, coalesce from torch_geometric.data import Data, InMemoryDataset, download_url class Actor(InMemoryDataset): r"""The actor-only induced subgraph of the fi...
0
0
0
0
0
0
lorawan_sensing_network/lora_gateway/code.py
gamblor21/Adafruit_Learning_System_Guides
665
1674879
<reponame>gamblor21/Adafruit_Learning_System_Guides<filename>lorawan_sensing_network/lora_gateway/code.py<gh_stars>100-1000 # SPDX-FileCopyrightText: 2019 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT """ Adafruit IO LoRa Gateway Learn Guide: https://learn.adafruit.com/multi-device-lora-temperature-...
0
0
0
0
0
0
douyin/downloaders/__init__.py
miaotiaotech/DouYin
657
1674886
from douyin.downloaders.base import Downloader from douyin.downloaders.video import VideoDownloader from douyin.downloaders.music import MusicDownloader
0
0
0
0
0
0
pytorch-frontend/tools/autograd/utils.py
AndreasKaratzas/stonne
206
1674890
from __future__ import annotations import re import os import yaml from .nested_dict import nested_dict __all__ = [ 'CodeTemplate', 'IDENT_REGEX', 'YamlLoader', 'nested_dict', 'split_name_params', 'write', ] from tools.codegen.code_template import CodeTemplate # You should use these lines, rather than doing...
0
6
0
0
6
0
alipay/aop/api/response/AlipayMarketingCampaignDrawcampQueryResponse.py
snowxmas/alipay-sdk-python-all
213
1674904
<filename>alipay/aop/api/response/AlipayMarketingCampaignDrawcampQueryResponse.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.MpPrizeInfoModel import MpPrizeInfoModel class AlipayMarketingCampaignDrawcampQueryR...
0
0
0
0
0
0
tests/test_type/test_enum.py
leonardt/magma
167
1674921
<reponame>leonardt/magma import pytest import magma as m from magma.testing import check_files_equal def test_enum(): class State(m.Enum): zero = 0 one = 1 two = 2 assert issubclass(State, m.Enum) class circuit(m.Circuit): name = "enum_test" io = m.IO(I=m.In(State...
0
0
0
0
0
0
tests/test_parse.py
eerimoq/asn1tools
198
1674922
import sys import unittest import importlib import asn1tools sys.path.append('tests/files') sys.path.append('tests/files/3gpp') sys.path.append('tests/files/cen') sys.path.append('tests/files/etsi') sys.path.append('tests/files/ieee') sys.path.append('tests/files/ietf') sys.path.append('tests/files/oma') class Asn1...
1
0
1
0
2
0
integration_tests/projects/001_flow_run_with_selectors/fal_scripts/after.py
emekdahl/fal
360
1674923
import pandas as pd import io import os from functools import reduce model_name = context.current_model.name output = f"Model name: {model_name}" output = output + f"\nStatus: {context.current_model.status}" df: pd.DataFrame = ref(model_name) buf = io.StringIO() df.info(buf=buf, memory_usage=False) info = buf.getval...
0
0
1
0
1
0
app/scp/batch_script/eval_LIDM.py
hailiang-wang/aclweb-I17-1074
361
1674953
<gh_stars>100-1000 ###################################################################### ###################################################################### # Copyright <NAME>, Cambridge Dialogue Systems Group, 2017 # ###################################################################### ##########################...
0
0
0
0
0
0
src/beanmachine/ppl/utils/tests/treeprinter_test.py
horizon-blue/beanmachine-1
177
1674963
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Tests for print_tree from treeprinter.py""" import unittest from beanmachine.ppl.utils.treeprinter import print_tree class TreePrinter...
0
1
0
0
1
0
train_pong.py
Silvicek/distributional-dqn
131
1674977
<filename>train_pong.py import distdeepq def main(): env, _ = distdeepq.make_env("Pong") model = distdeepq.models.cnn_to_dist_mlp( convs=[(32, 8, 4), (64, 4, 2), (64, 3, 1)], hiddens=[256], dueling=False ) act = distdeepq.learn( env, p_dist_func=model, ...
0
0
0
0
0
0
util/decode_inst_trace.py
hyu-iot/gem5
765
1674983
#!/usr/bin/env python3 # Copyright (c) 2013-2014 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
0
0
0
0
0
0
samples/HostedFeatureServiceAdmin/listLayersInHostedFeatureService.py
kevinsigwart/ArcREST
208
1674990
<gh_stars>100-1000 """ Simple sample that lists all layers in a given hosted feature service """ import arcrest if __name__ == "__main__": url = "https://<url to spatial data store>/ArcGIS/rest/admin" username = "<user name>" password = "<password> " sh = arcrest.AGOLTokenSecurityHandler(username...
0
0
0
0
0
0
tests/test_modeling_luke.py
MarcelGM/transformers
101
1675001
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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 r...
32
3
4
1
40
0
saleor/app/migrations/0014_alter_app_options.py
eanknd/saleor
1,392
1675010
# Generated by Django 3.2.13 on 2022-05-11 13:07 from __future__ import annotations from django.db import migrations from django.db.models.signals import post_migrate def assign_permissions(apps, schema_editor): def on_migrations_complete(sender: object | None=None, **kwargs): Group = apps.get_model("auth...
1
0
2
0
3
0
ncclient/operations/third_party/huawei/rpc.py
NorthLandTeam/ncclient
498
1675019
# -*- coding: utf-8 -*- # by yangxufeng.zhao from __future__ import annotations from ncclient.xml_ import * from ncclient.operations.rpc import RPC class CLI(RPC): def request(self, command: object | None=None) -> object: """command text view: Execution user view exec Configuration...
2
2
0
0
4
0
tempest/lib/api_schema/response/compute/v2_54/servers.py
cityofships/tempest
254
1675036
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
0
0
0
0
0
0
deepaugment/augmenter.py
abcp4/deepaugment
221
1675044
# (C) 2019 <NAME> <<EMAIL>> import numpy as np from imgaug import augmenters as iaa def normalize(X) -> object: return (X / 255.0).copy() def denormalize(X) -> object: X_dn = (X * 255).copy() return X_dn def transform(aug_type, magnitude, X) -> object: if aug_type == "crop": X_aug = iaa.C...
0
4
0
0
4
0
vyapp/plugins/python_mode.py
AndreasDavour/vy
927
1675065
<reponame>AndreasDavour/vy """ Overview ======== Extra mode for python programming language. Key-Commands ============ Namespace: python-mode Mode: NORMAL Event: <Key-exclam> Description: Switch to PYTHON mode. """ def python_mode(area): area.chmode('PYTHON') def install(area): area.add_mode('PYTHON') ...
0
0
0
0
0
0
test_url.py
thelastant/django_nj
212
1675069
from django.conf.urls import url, include from niji import urls as niji_urls urlpatterns = [ url(r'testurl', include(niji_urls, namespace="niji")), ]
0
0
0
0
0
0
echo_server.py
hiveml/simple-ml-serving
181
1675085
#!/usr/bin/env python # usage: python echo_server.py to launch the server ; and then in another session, do # curl -v -XPOST 127.0.0.1:12480 -F "data=@./image.jpg" from flask import Flask, request app = Flask(__name__) @app.route('/', methods=['POST']) def classify(): try: data = request.files.get('data').r...
0
0
0
0
0
0
tests/test_variable_registration.py
Kyle-Kyle/angr
6,132
1675088
<filename>tests/test_variable_registration.py import angr import nose def test_registration(): s = angr.SimState(arch='AMD64') a1 = s.solver.BVS('a', 64, key=(1,), eternal=True) a2 = s.solver.BVS('a', 64, key=(1,), eternal=True) nose.tools.assert_is(a1, a2) b1 = s.solver.BVS('b', 64, key=(2,), et...
0
0
0
0
0
0
scaper_concept/venv/lib/python3.9/site-packages/prompt_toolkit/shortcuts/progress_bar/formatters.py
edudbot/web-scraper
4,028
1675090
""" Formatter classes for the progress bar. Each progress bar consists of a list of these formatters. """ import datetime import time from abc import ABCMeta, abstractmethod from typing import TYPE_CHECKING, List, Tuple from prompt_toolkit.formatted_text import ( HTML, AnyFormattedText, StyleAndTextTuples,...
58
30
8
0
96
0
finetuning/v2/compare.py
wietsedv/bertje
104
1675093
<gh_stars>100-1000 import os import json from utils import reset_config, config def main(): data_cfgs = config.data.cfgs if config.data.name is None else [None] model_cfgs = config.model.cfgs if config.model.name is None else [None] for data_cfg in data_cfgs: print('') for model_cfg in m...
0
0
0
0
0
0
tests/test_dplyr_arrange.py
stjordanis/datar
110
1675097
# https://github.com/tidyverse/dplyr/blob/master/tests/testthat/test-arrange.r from datar.dplyr.arrange import arrange import pytest from pandas.testing import assert_frame_equal from datar.all import * from datar.core.grouped import DataFrameGroupBy from datar.core.exceptions import ColumnNotExistingError, DataUnrecy...
0
0
0
0
0
0
xonsh/ptk2/__init__.py
ion201/xonsh
4,716
1675100
from xonsh.ptk_shell import * # noqa: F403 F401
0
0
0
0
0
0
tsai/models/RNN.py
imilas/tsai
1,545
1675102
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/105_models.RNN.ipynb (unless otherwise specified). __all__ = ['RNN', 'LSTM', 'GRU'] # Cell from ..imports import * from .layers import * # Cell class _RNN_Base(Module): def __init__(self, c_in, c_out, hidden_size: int=100, n_layers: int=1, bias: bool=True, rnn_drop...
6
1
0
0
7
0
utils/imgs.py
bfortuner/pytorch_tiramisu
306
1675104
import numpy as np import matplotlib.pyplot as plt Sky = [128,128,128] Building = [128,0,0] Pole = [192,192,128] Road = [128,64,128] Pavement = [60,40,222] Tree = [128,128,0] SignSymbol = [192,128,128] Fence = [64,64,128] Car = [64,0,128] Pedestrian = [64,64,0] Bicyclist = [0,128,192] Unlabelled = [0,0,0] DSET_MEAN =...
1
2
0
0
3
0
tools/code_coverage/coverage.py
iridium-browser/iridium-browser
575
1675126
<filename>tools/code_coverage/coverage.py #!/usr/bin/env python # Copyright 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. """This script helps to generate code coverage report. It uses Clang Source-based Code Cove...
0
0
0
0
0
0
capirca/lib/cisconx.py
google-admin/capirca
604
1675129
<reponame>google-admin/capirca<gh_stars>100-1000 # Copyright 2021 Google 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/LICEN...
0
0
0
0
0
0
tasks.py
URunDEAD/SSHLibrary
119
1675136
from __future__ import annotations import sys from pathlib import Path from docutils.core import publish_cmdline from invoke import task from rellu import initialize_labels, ReleaseNotesGenerator, Version from rellu.tasks import clean from robot.libdoc import libdoc assert Path.cwd() == Path(__file__).parent REPOS...
6
0
0
0
6
0
python/deprecated/eval_sgf.py
syys96/KataGo
1,676
1675168
<filename>python/deprecated/eval_sgf.py #!/usr/bin/python3 import sys import os import argparse import traceback import random import math import time import re import logging import colorsys import json import tensorflow as tf import numpy as np import data from board import Board from model import Model description...
0
0
0
0
0
0
Configuration/ProcessModifiers/python/vectorHits_cff.py
ckamtsikis/cmssw
852
1675187
<filename>Configuration/ProcessModifiers/python/vectorHits_cff.py<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms # This modifier is for activating Vector Hits reconstruction in the Phase II OT vectorHits = cms.Modifier()
0
0
0
0
0
0
mne/minimum_norm/resolution_matrix.py
vagechirkov/mne-python
1,953
1675209
<filename>mne/minimum_norm/resolution_matrix.py # -*- coding: utf-8 -*- """Compute resolution matrix for linear estimators.""" # Authors: <EMAIL> # # License: BSD-3-Clause from copy import deepcopy import numpy as np from .. import pick_channels_forward, EvokedArray, SourceEstimate from ..io.constants import FIFF fro...
0
0
0
0
0
0
powerdns_recursor/tests/metrics.py
mchelen-gov/integrations-core
663
1675219
# (C) Datadog, Inc. 2010-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) GAUGE_METRICS = [ 'cache-entries', 'concurrent-queries', 'failed-host-entries', 'negcache-entries', 'packetcache-entries', 'throttle-entries', ] RATE_METRICS = [ 'all-outqueries', ...
0
0
0
0
0
0
AITRexRush/Algorithm_1/modules/DQNAgent/agent.py
EdgarLi/AIGames
543
1675248
''' Function: dqn agent Author: Charles 微信公众号: Charles的皮卡丘 ''' import cv2 import time import torch import random import numpy as np import torch.nn as nn from collections import deque from .network import DeepQNetwork '''dqn agent''' class DQNAgent(): def __init__(self, mode, fps, checkpointspath, **kwargs): se...
0
1
0
17
18
0
mlir/test/python/ir/integer_set.py
LaudateCorpus1/llvm-project
605
1675252
# RUN: %PYTHON %s | FileCheck %s import gc from mlir.ir import * def run(f) -> object: print("\nTEST:", f.__name__) f() gc.collect() assert Context._get_live_count() == 0 return f # CHECK-LABEL: TEST: testIntegerSetCapsule @run def testIntegerSetCapsule(): with Context() as ctx: is1 = IntegerSet.get...
0
1
0
0
1
0
tests/helpers/examples/contract/cerberus/coroutines.py
proofit404/userstories
187
1675264
from examples.contract.cerberus import * # noqa: F401, F403 from examples.contract.common.coroutines import * # noqa: F401, F403
0
0
0
0
0
0
tests/chainer_compiler_tests/chainer_compiler_test.py
vermashresth/chainer-compiler
116
1675280
<reponame>vermashresth/chainer-compiler import os import pytest import sys import chainer from chainer.backend import CpuDevice import chainer.functions as F import chainer.links as L import chainerx.testing import numpy as np all_device_names = ['@numpy', 'native:0'] try: import cupy all_device_names.exten...
0
0
0
0
0
0
tests/cli/v012/test_datasource_snowflake.py
victorcouste/great_expectations
6,451
1675305
from copy import deepcopy from unittest.mock import patch import pytest from click.testing import CliRunner from great_expectations import DataContext from great_expectations.cli.v012 import cli from great_expectations.cli.v012.datasource import _collect_snowflake_credentials from great_expectations.data_context.util...
0
0
0
0
0
0
robogym/envs/rearrange/tests/test_robot_polymorphism.py
0xflotus/robogym
288
1675350
<reponame>0xflotus/robogym import pytest from robogym.envs.rearrange.blocks import make_env from robogym.robot.composite.ur_gripper_arm import ( MujocoIdealURGripperCompositeRobot as IdealDynamicsCls, ) from robogym.robot.composite.ur_gripper_arm import ( MujocoURTcpJointGripperCompositeRobot as JointDynamicsC...
0
0
0
0
0
0
bless_client/bless_client.py
TokyoFarmer/bless
2,787
1675353
#!/usr/bin/env python """bless_client A sample client to invoke the BLESS Lambda function and save the signed SSH Certificate. Usage: bless_client.py region lambda_function_name bastion_user bastion_user_ip remote_usernames bastion_ips bastion_command <id_rsa.pub to sign> <output id_rsa-cert.pub> region: AWS...
0
1
0
0
1
0
examples/legacy/seq2seq/old_test_tatoeba_conversion.py
dctelus/transformers
8,028
1675362
<filename>examples/legacy/seq2seq/old_test_tatoeba_conversion.py # Copyright 2020 The HuggingFace Team. 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...
0
0
0
0
0
0
widgy/contrib/form_builder/views.py
isopets/django-widgy
168
1675363
<gh_stars>100-1000 from django.views.generic.edit import FormMixin from django.shortcuts import get_object_or_404 from widgy.models import Node class HandleFormMixin(FormMixin): """ An abstract view mixin for handling form_builder.Form submissions. """ def post(self, *args, **kwargs): """ ...
0
0
0
0
0
0
usaspending_api/common/management/commands/matview_runner.py
ststuck/usaspending-api
217
1675383
<filename>usaspending_api/common/management/commands/matview_runner.py import asyncio import logging import psycopg2 import subprocess from django.core.management import call_command from django.core.management.base import BaseCommand from pathlib import Path from usaspending_api.common.data_connectors.async_sql_quer...
0
0
0
0
0
0
test/unit/module/config/test_config_file_args.py
tomislacker/cfn-python-lint
1,134
1675394
""" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 """ import logging from test.testlib.testcase import BaseTestCase import jsonschema from mock import patch import cfnlint.config # pylint: disable=E0401 try: # pragma: no cover from pathlib import Path except Imp...
0
0
0
0
0
0