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
tock/projects/migrations/0009_auto_20160525_1431.py
mikiec84/tock
134
3317422
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('projects', '0008_auto_20160525_0535'), ] operations: list[object] = [ migrations.AddField( ...
0
0
2
0
2
0
Documentation/tools/write-commands-overview.py
lisurui6/MIRTK
146
3317429
<gh_stars>100-1000 #!/usr/bin/env python ############################################################################## # Medical Image Registration ToolKit (MIRTK) # # Copyright 2013-2015 Imperial College London # Copyright 2013-2015 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may...
0
0
0
0
0
0
mcunet/tinynas/nn/networks/__init__.py
1999michael/tinyml
306
3317431
from .mobilenet_v2 import * from .proxyless_nets import *
0
0
0
0
0
0
sklego/meta/grouped_estimator.py
lahdjirayhan/scikit-lego
784
3317449
from deprecated import deprecated from .grouped_predictor import GroupedPredictor @deprecated( version="0.5.2", reason="Please use `sklego.meta.GroupedPredictor` instead. " "This object will be removed from the meta submodule in version 0.7.0.", ) def GroupedEstimator(*args, **kwargs) -> object: retur...
0
1
0
0
1
0
experiments/scripts/deepsurv_run.py
kstawiski/DeepSurv
395
3317460
<reponame>kstawiski/DeepSurv import argparse from collections import defaultdict import pandas as pd import numpy as np import h5py import uuid import copy import json import sys, os sys.path.append("/DeepSurv/deepsurv") import deep_surv # Force matplotlib to not use any Xwindows backend. import matplotlib matplotl...
0
0
0
0
0
0
vendor/github.com/osrg/gobgp/tools/grpc/python/get_neighbor.py
RostyslavFridman/metallb
125
3317486
<gh_stars>100-1000 import gobgp_pb2_grpc import gobgp_pb2 import sys import grpc from grpc.framework.interfaces.face.face import ExpirationError _TIMEOUT_SECONDS = 1 def run(gobgpd_addr): channel = grpc.insecure_channel(gobgpd_addr + ':50051') stub = gobgp_pb2_grpc.GobgpApiStub(channel) try: pee...
0
0
0
0
0
0
generate_docs.py
drjerry/acsploit
107
3317496
#! /usr/bin/env python3 from pdoc import cli import os class PdocArgs(object): def __init__(self, modules): self.template_dir: None = None self.html: bool = True self.http: None = None self.filter: None = None self.external_links: None = None self.overwrite: bool = ...
0
0
0
9
9
0
isobar/io/cv/__init__.py
rvega/isobar
241
3317515
from .output import CVOutputDevice, get_cv_output_devices __all__ = ["CVOutputDevice", "get_cv_output_devices"]
0
0
0
0
0
0
mmdet3d/ops/paconv/utils.py
Guangyun-Xu/mmdetection3d
2,216
3317582
<filename>mmdet3d/ops/paconv/utils.py import torch def calc_euclidian_dist(xyz1, xyz2): """Calculate the Euclidian distance between two sets of points. Args: xyz1 (torch.Tensor): (N, 3), the first set of points. xyz2 (torch.Tensor): (N, 3), the second set of points. Returns: torc...
0
0
0
0
0
0
Unit Digit of a raised to power b.py
wisarut-si/Python
28,321
3317609
<filename>Unit Digit of a raised to power b.py def last_digit(a, b): if b==0: #This Code assumes that 0^0 is 1 return 1 elif a%10 in [0,5,6,1]: return a%10 elif b%4==0: return ((a%10)**4)%10 else: return ((a%10)**(b%4))%10 #Courtesy to https://brilliant.org/wiki/fi...
0
0
0
0
0
0
.github/scripts/build_assets/selenium_runner/enums.py
JRcalado/devicons
2,618
3317687
<reponame>JRcalado/devicons<filename>.github/scripts/build_assets/selenium_runner/enums.py from enum import Enum class IcomoonOptionState(Enum): """ The state of the Icomoon toolbar options """ SELECT = 0, EDIT = 1 class IcomoonPage(Enum): """ The available pages on the Icomoon website. ...
0
0
0
0
0
0
ida_import/ida_import.py
RUB-SysSec/Marx
118
3317688
<gh_stars>100-1000 import marx import os import re from sys import stdout # IDA imports from idaapi import add_dref, dr_O, Form from idc import MakeComm, MakeQword, Comment # from idautils import DataRefsFrom # from idautils import Modules as ida_Modules # Number of bytes of an address WORD_BYTE_COUNT = 8 class Ma...
0
0
0
0
0
0
ambari-server/src/main/python/ambari_server/serverClassPath.py
likenamehaojie/Apache-Ambari-ZH
1,664
3317710
#!/usr/bin/env python ''' 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")...
1
5
3
0
9
0
easy_rl/agents/sync_agent.py
simonoso/EasyRL
125
3317712
# Copyright (c) 2019 Alibaba 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 required by applicable law...
0
5
0
0
5
0
test/run/t312.py
timmartin/skulpt
2,671
3317715
s = set([1,2,3]) copy_s = s.copy() new_s = set(s) copy_s.add(42) new_s.add(13) print s print copy_s print new_s
0
0
0
0
0
0
music21/graph/findPlot.py
cuthbertLab/music21
1,449
3317751
<filename>music21/graph/findPlot.py # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # Name: graph/findPlot.py # Purpose: Methods for finding appropriate plots for plotStream. # # Authors: <NAME> # <NAME> # # Copyright: Copyright...
0
0
0
0
0
0
h2o-py/tests/testdir_algos/coxph/pyunit_coxph_smoke_stratify.py
vishalbelsare/h2o-3
6,098
3317770
from __future__ import print_function import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.coxph import H2OCoxProportionalHazardsEstimator def coxph_smoke_strata(): heart = h2o.import_file(pyunit_utils.locate("smalldata/coxph_test/heart.csv")) heart['transpla...
0
0
0
0
0
0
alipay/aop/api/domain/MiniResourceRule.py
antopen/alipay-sdk-python-all
213
3317776
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations import json from alipay.aop.api.constant.ParamConstants import * class MiniResourceRule(object): def __init__(self): self._floor_id: None = None self._identity_id: None = None self._identity_name: None = Non...
0
10
0
8
18
0
webspider/crawlers/__init__.py
zxh001-zxh/webspider
256
3317795
# coding=utf-8 from webspider.crawlers.lg_cites import get_cites_from_lg from webspider.crawlers.lg_companies import (get_companies_pagination_from_lg, get_companies_from_lg, get_company_detail_from_lg, clean_lg_company_data, ) from webspider.crawlers.lg_jobs import (get_job...
0
0
0
0
0
0
up/tasks/ssl/data/__init__.py
ModelTC/EOD
196
3317797
from .ssl_transforms import * # noqa from .ssl_dataset import * # noqa
0
0
0
0
0
0
kansha/alembic/versions/361f9cbae3fc_rename_board_archive.py
AnomalistDesignLLC/kansha
161
3317804
<reponame>AnomalistDesignLLC/kansha """Rename board.archive Revision ID: 361f9cbae3fc Revises: 2b0edcfa57b4 Create Date: 2015-12-18 17:00:10.034124 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '2b0edcfa57b4' def upgrade(): with...
0
0
0
0
0
0
osmnx/__init__.py
mattijsstam/osmnx
3,535
3317809
<reponame>mattijsstam/osmnx """OSMnx init.""" from ._api import * from ._version import __version__
0
0
0
0
0
0
ctpbee/research/plot.py
mcFore/ctpbee
461
3317820
<gh_stars>100-1000 from jinja2 import Environment, PackageLoader, select_autoescape from ctpbee.constant import BarData env = Environment( loader=PackageLoader('ctpbee', 'research'), autoescape=select_autoescape(['html', 'xml']) ) kline_template = env.get_template("bs_template.html") class Plot(object): ...
0
0
0
0
0
0
tests/packagedcode/data/pypi/setup.py-versions/docutils-0.16/setup.py
s4-2/scancode-toolkit
1,511
3317828
<filename>tests/packagedcode/data/pypi/setup.py-versions/docutils-0.16/setup.py #!/usr/bin/env python # $Id: setup.py 8453 2020-01-12 13:28:32Z grubert $ # Copyright: This file has been placed in the public domain. from __future__ import print_function import sys import os import glob try: import setuptools exce...
0
0
0
0
0
0
src/beanmachine/ppl/compiler/tests/fix_beta_bernoulli_basic_test.py
horizon-blue/beanmachine-1
177
3317833
<filename>src/beanmachine/ppl/compiler/tests/fix_beta_bernoulli_basic_test.py # 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. """Compare original and conjugate prior transformed Beta-Be...
0
0
0
0
0
0
hphp/hack/src/hh_codesynthesis/agentGraphGenerator.py
donsbot/hhvm
9,491
3317860
<filename>hphp/hack/src/hh_codesynthesis/agentGraphGenerator.py #!/usr/bin/env python3 # pyre-strict # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the "hack" directory of this source tree. # # This library will construct a logic ...
0
0
0
0
0
0
tracing/tracing/mre/mre_result_unittest.py
tingshao/catapult
2,151
3317877
<filename>tracing/tracing/mre/mre_result_unittest.py # Copyright 2015 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 unittest from tracing.mre import function_handle from tracing.mre import map_single_trace from t...
0
0
0
0
0
0
model-optimizer/extensions/front/tf/CorrectRollAxes.py
monroid/openvino
2,406
3317907
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from mo.front.common.partial_infer.utils import int64_array from mo.front.common.replacement import FrontReplacementSubgraph from mo.front.tf.graph_utils import add_constant_to_negative_values from mo.graph.graph import Graph class Co...
1
1
1
0
3
0
mturk/serializers.py
Kyeongan/crowdsource-platform
138
3317923
<filename>mturk/serializers.py from rest_framework import serializers from rest_framework.exceptions import ValidationError from crowdsourcing.serializers.dynamic import DynamicFieldsModelSerializer from mturk.models import MTurkAccount from mturk.interface import MTurkProvider from crowdsourcing.crypto import AESUtil ...
0
0
0
0
0
0
dashboard/websocket.py
AKTheKnight/ArchiveBot
250
3317938
import asyncio import datetime import os import sys import websockets DEBUG = 'WSDEBUG' in os.environ and os.environ['WSDEBUG'] == '1' # Taken from qwarc.utils PAGESIZE = os.sysconf('SC_PAGE_SIZE') def get_rss() -> object: with open('/proc/self/statm', 'r') as fp: return int(fp.readline().split()[1]) * PAGESIZE ...
0
3
0
1
4
0
django_file_form/forms.py
kosior/django-file-form
133
3317997
<filename>django_file_form/forms.py import json import uuid from django.urls import reverse from django.forms import CharField, Form, HiddenInput from .util import get_list, with_typehint from .uploaded_file import get_initial_data_from_uploaded_file # UploadedFileField and MultipleUploadedFileField must be in this ...
0
0
0
0
0
0
tests/ut/python/parallel/test_neighborexchange.py
PowerOlive/mindspore
3,200
3317999
<gh_stars>1000+ # Copyright 2021 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
tests/past_api07_sources_base.py
ajhynes7/datatest
277
3318021
# -*- coding: utf-8 -*- from . import _unittest as unittest from datatest.__past__.api07_sources import MinimalSource from .mixins import OtherTests from .mixins import CountTests class TestBaseSource(OtherTests, unittest.TestCase): fieldnames: list[str] = ['label1', 'label2', 'value'] testdata: list[list[st...
0
0
2
0
2
0
jax_cfd/base/resize_test.py
rainwangphy/jax-cfd
244
3318059
<gh_stars>100-1000 # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
0
0
0
0
0
0
Packs/PrismaSaasSecurity/Integrations/SaasSecurity/SaasSecurity_test.py
diCagri/content
799
3318060
import io from freezegun import freeze_time import pytest import json from CommonServerPython import DemistoException, EntryType, EntryFormat from datetime import datetime from SaasSecurity import Client import demistomock as demisto def util_load_json(path) -> object: with io.open(path, mode='r', encoding='utf-...
0
1
0
0
1
0
Kivy/RGB2Gray/RGB2Gray.py
Sherlockzw/Bilibili346623
441
3318072
<gh_stars>100-1000 import matplotlib matplotlib.use('module://kivy.garden.matplotlib.backend_kivy') import matplotlib.pyplot as plt from PIL import Image import numpy as np from kivy.garden.matplotlib.backend_kivyagg import FigureCanvas,FigureCanvasKivyAgg from kivy.app import App from kivy.uix.gridlayout ...
0
0
0
0
0
0
fedlab/core/network_manager.py
SMILELab-FL/FedLab
171
3318080
<reponame>SMILELab-FL/FedLab<filename>fedlab/core/network_manager.py # Copyright 2021 Peng Cheng Laboratory (http://www.szpclab.com/) and FedLab Authors (smilelab.group) # 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...
0
0
0
0
0
0
python/paddle/fluid/contrib/slim/quantization/imperative/ptq_registry.py
zmxdream/Paddle
17,085
3318131
# Copyright (c) 2021 PaddlePaddle 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 app...
0
4
3
0
7
0
src/oci/core/models/instance_agent_features.py
Manny27nyc/oci-python-sdk
249
3318140
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
0
5
0
4
9
0
examples/basic/calc/views.py
b1ngz/django_dramatiq
229
3318167
from django.shortcuts import render from .tasks import add def calc(req) -> object: if req.method == "POST": add.send(float(req.POST["a"]), float(req.POST["b"])) return render(req, "calc.html")
0
1
0
0
1
0
homeassistant/components/smarttub/helpers.py
tbarbette/core
30,023
3318173
"""Helper functions for SmartTub integration.""" import smarttub def get_spa_name(spa: smarttub.Spa) -> str: """Return the name of the specified spa.""" return f"{spa.brand} {spa.model}"
1
1
0
0
2
0
recipes/earcut/all/conanfile.py
rockandsalt/conan-center-index
562
3318185
<gh_stars>100-1000 from conans import ConanFile, tools from conans.errors import ConanInvalidConfiguration import os class EarcutConan(ConanFile): name = "earcut" description = "A C++ port of earcut.js, a fast, header-only polygon triangulation library." homepage = "https://github.com/mapbox/earcut.hpp" ...
0
0
0
0
0
0
var/spack/repos/builtin/packages/lordec/package.py
BenWibking/spack
2,360
3318192
<filename>var/spack/repos/builtin/packages/lordec/package.py # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Lordec(MakefilePackage): """L...
0
0
0
0
0
0
cords/utils/data/dataloader/SSL/nonadaptive/__init__.py
krishnatejakk/AUTOMATA
185
3318213
<filename>cords/utils/data/dataloader/SSL/nonadaptive/__init__.py from .craigdataloader import CRAIGDataLoader from .nonadaptivedataloader import NonAdaptiveDSSDataLoader from .submoddataloader import FacLocDataLoader from .submoddataloader import GraphCutDataLoader from .submoddataloader import SaturatedCoverageDataLo...
0
0
0
0
0
0
NAS/APS-channel-search/nets/resnet_20s_decode.py
naviocean/SimpleCVReproduction
923
3318238
''' Decode model from alpha ''' import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init from torch.autograd import Variable from utils.compute_flops import * from nets.se_module import SELayer import argparse from pdb import set_trace as br __all__ = ['resnet_decode'] def _we...
9
6
0
2
17
0
2012_03_27/test_fatorial.py
samisafatli/dojo
114
3318246
<filename>2012_03_27/test_fatorial.py import unittest from fatorial import fatorial class FatorialTestCase(unittest.TestCase): def test_fatorial_1_1(self): self.assertEqual(1, fatorial(1, 1)) def test_fatorial_2_1(self): self.assertEqual(2, fatorial(2, 1)) def test_fatorial_3_1(self): ...
0
0
0
0
0
0
amqpstorm/management/exception.py
ZygusPatryk/amqpstorm
193
3318272
<filename>amqpstorm/management/exception.py from amqpstorm.exception import AMQPError from amqpstorm.exception import AMQP_ERROR_MAPPING class ApiError(AMQPError): """Management Api Error""" def __init__(self, message=None, *args, **kwargs): self._message = message self._error_code = kwargs.p...
0
0
0
0
0
0
src/models21/tools/tf-eval.py
AndrewSerra/Knet.jl
1,492
3318273
import tensorflow as tf validation_dir="fooval/val" #"/datasets/ImageNet/ILSVRC/Data/CLS-LOC/val" #"val" BATCH_SIZE = 32 IMG_SIZE = (224,224) #model = tf.keras.applications.mobilenet #pretrained = tf.keras.applications.MobileNet model = tf.keras.applications.mobilenet_v2 pretrained = tf.keras.applications.MobileNetV2...
0
1
0
0
1
0
conx/networks/__init__.py
Calysto/conx
105
3318295
## All functions here must be loadable networks ## All modules must be named differently from their functions! ## Otherwise, confuses tools like nose, inspect, etc. from ._keras import vgg16, vgg19, inceptionv3
0
0
0
0
0
0
Chapter15/three_color_led_gui.py
trappn/Mastering-GUI-Programming-with-Python
138
3318326
<reponame>trappn/Mastering-GUI-Programming-with-Python import sys from PyQt5 import QtWidgets as qtw from PyQt5 import QtCore as qtc from PyQt5 import QtGui as qtg from RPi import GPIO class ThreeColorLed(): """Represents a three color LED circuit""" def __init__(self, red, green, blue, pinmode=GPIO.BOARD, f...
0
0
0
0
0
0
src/cluster.py
germal/Semantic_SLAM-1
213
3318349
<reponame>germal/Semantic_SLAM-1 # coding: utf-8 ''' This file is part of Semantic SLAM License: MIT Author: <NAME> Email: <EMAIL> Web: https://1989Ryan.github.io/ ''' import rospy import numpy as np import os import sys from sklearn.cluster import DBSCAN from sklearn.preprocessing import StandardScaler from sensor_msg...
0
0
0
0
0
0
scratch/fm_param_agoge_vae_rnn.py
boldsort/NeuralDX7
119
3318360
#%% from __future__ import annotations import os os.environ['MLFLOW_TRACKING_URI'] = 'http://localhost:9001' import torch torch.randn(10,10).cuda() import torch.nn as nn import torch.nn.functional as F from torch.optim import AdamW from torch.optim.lr_scheduler import StepLR from pathlib import Path from torch.utils.da...
10
13
0
0
23
0
desktop/core/ext-py/nose-1.3.7/functional_tests/test_entrypoints.py
kokosing/hue
5,079
3318374
import os import sys from nose.exc import SkipTest try: from pkg_resources import EntryPoint except ImportError: raise SkipTest("No setuptools available; skipping") here = os.path.dirname(__file__) support = os.path.join(here, 'support') ep = os.path.join(support, 'ep') def test_plugin_entrypoint_is_loadabl...
0
0
0
0
0
0
components/google-cloud/google_cloud_pipeline_components/container/experimental/gcp_launcher/export_model_remote_runner.py
Iuiu1234/pipelines
2,860
3318375
# Copyright 2021 The Kubeflow 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 applicabl...
0
0
0
0
0
0
pkg/codegen/internal/test/testdata/external-resource-schema/python/pulumi_example/component.py
pcen/pulumi
12,004
3318422
<reponame>pcen/pulumi # coding=utf-8 # *** WARNING: this file was generated by test. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import _utilities imp...
0
0
0
0
0
0
counterpartylib/test/arc4_test.py
longhoangwkm/counterparty-lib
169
3318427
<reponame>longhoangwkm/counterparty-lib import pprint import tempfile import pytest from counterpartylib.test import conftest # this is require near the top to do setup of the test suite from counterpartylib.test import util_test from counterpartylib.test.util_test import CURR_DIR from counterpartylib.test.fixtures.pa...
0
0
0
0
0
0
example/issues/194_flask_config/app.py
sephiartlist/dynaconf
2,293
3318431
<reponame>sephiartlist/dynaconf from flask import Flask from dynaconf import FlaskDynaconf from dynaconf import settings app = Flask(__name__) settings["MESSAGE"] = "hello" assert settings["MESSAGE"] == "hello" FlaskDynaconf(app, dynaconf_instance=settings) assert app.config["MESSAGE"] == "hello" app.config.set(...
0
0
0
0
0
0
Geometry/HcalTestBeamData/python/hcalTB02Parameters_cff.py
ckamtsikis/cmssw
852
3318437
<reponame>ckamtsikis/cmssw import FWCore.ParameterSet.Config as cms from Geometry.HcalTestBeamData.hcalTB02XtalParameters_cfi import * from Configuration.ProcessModifiers.dd4hep_cff import dd4hep dd4hep.toModify(hcalTB02XtalParameters, fromDD4Hep = cms.bool(True), ) hcalTB02HcalParameters = hcalTB02...
0
0
0
0
0
0
bin/qbiogolr.py
alliance-genome/ontobio
101
3318438
<reponame>alliance-genome/ontobio #!/usr/bin/env python """ Command line wrapper to ontobio.golr library. Type: qbiogolr -h For instructions """ import argparse from ontobio.golr.golr_associations import search_associations from ontobio.ontol_factory import OntologyFactory from ontobio.io.ontol_renderers impo...
0
0
0
0
0
0
zoo/inception/inception_v3.py
sujeet-ap/keras-idiomatic-programmer
833
3318497
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
8
10
0
0
18
0
testsuite/test_rys_wheeler.py
fishjojo/libcint
109
3318501
from __future__ import annotations import os, sys sys.path.insert(0, os.path.abspath(os.path.join(__file__, '../../scripts'))) import ctypes import numpy as np import rys_wheeler import rys_roots import rys_tabulate cint = ctypes.CDLL('../build/libcint.so') def cint_call(fname, nroots, x, low: object | None=None) -> ...
1
15
0
0
16
0
challenges/matrices_for_sale/poller/for-release/machine.py
pingjuiliao/cb-multios
473
3318518
<gh_stars>100-1000 #!/usr/bin/env python # # Copyright (C) 2014 Narf Industries <<EMAIL>> # # 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 #...
0
0
0
0
0
0
mpire/exception.py
synapticarbors/mpire
505
3318523
<reponame>synapticarbors/mpire<gh_stars>100-1000 class StopWorker(Exception): """ Exception used to kill workers from the main process """ pass class CannotPickleExceptionError(Exception): """ Exception used when Pickle has trouble pickling the actual Exception """ pass
0
0
0
0
0
0
benchmarks/operator_benchmark/pt/groupnorm_test.py
Hacky-DH/pytorch
60,067
3318546
<gh_stars>1000+ import operator_benchmark as op_bench import torch import torch.nn.functional as F """Microbenchmarks for groupnorm operator.""" groupnorm_configs_short = op_bench.cross_product_configs( dims=( (32, 8, 16), (32, 8, 56, 56), ), num_groups=(2, 4), tags=["short"], ) cl...
0
0
0
0
0
0
ote_sdk/ote_sdk/configuration/__init__.py
ntyukaev/training_extensions
775
3318554
<reponame>ntyukaev/training_extensions # Copyright (C) 2021-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # """ This module contains base elements that make up OTE ConfigurableParameters, as well as a collection of helper functions to interact with them. The configuration helper module can be imported ...
0
0
0
0
0
0
sphinx/doc_examples/evolve-example.py
anton-buyskikh/QuSpin
195
3318561
from __future__ import print_function, division # import sys,os quspin_path = os.path.join(os.getcwd(),"../../") sys.path.insert(0,quspin_path) # from quspin.operators import hamiltonian # Hamiltonians and operators from quspin.basis import boson_basis_1d # Hilbert space spin basis from quspin.tools.evolution import ev...
0
4
0
0
4
0
typed_python/compiler/type_wrappers/bound_method_wrapper.py
APrioriInvestments/typed_python
105
3318665
<reponame>APrioriInvestments/typed_python # Copyright 2017-2019 typed_python 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
0
0
0
0
0
sdriving/environments/highway.py
avik-pal/social-driving
127
3318672
<reponame>avik-pal/social-driving<filename>sdriving/environments/highway.py<gh_stars>100-1000 import math from collections import deque from itertools import product import numpy as np import torch from gym.spaces import Box, Discrete, Tuple from sdriving.environments.base_env import BaseMultiAgentDrivingEnvironment ...
0
0
0
0
0
0
easyAI/games/GameOfBones.py
tomviner/easyAI
345
3318677
<reponame>tomviner/easyAI """ This is the example featured in section 'A quick example' of the docs """ from easyAI import TwoPlayerGame class GameOfBones(TwoPlayerGame): """In turn, the players remove one, two or three bones from a pile of bones. The player who removes the last bone loses.""" def __ini...
0
0
0
0
0
0
tests/ops/test_spacy.py
jessevig/robustness-gym
399
3318681
from unittest import TestCase from robustnessgym import lookup from robustnessgym.ops import SpacyOp from tests.testbeds import MockTestBedv0 class TestSpacy(TestCase): def setUp(self): self.testbed = MockTestBedv0() def test_apply(self): # Create the Spacy cached operation spacy = S...
0
0
0
0
0
0
tests/models/DCNMix_test.py
HCMY/DeepCTR
6,192
3318684
<reponame>HCMY/DeepCTR import pytest from deepctr.models import DCNMix from ..utils import check_model, get_test_data, SAMPLE_SIZE @pytest.mark.parametrize( 'cross_num,hidden_size,sparse_feature_num', [(0, (8,), 2), (1, (), 1), (1, (8,), 3) ] ) def test_DCNMix(cross_num, hidden_size, sparse_feature_num)...
0
0
0
0
0
0
frappe/website/doctype/website_script/website_script.py
Don-Leopardo/frappe
3,755
3318694
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: MIT. See LICENSE # License: MIT. See LICENSE import frappe from frappe.model.document import Document class WebsiteScript(Document): def on_update(self): """clear cache""" frappe.clear_cache(user = 'Guest') from frappe.website....
0
0
0
0
0
0
ch04-图片/show_image.py
makelove/OpenCV-Python-Tutorial
2,875
3318735
<reponame>makelove/OpenCV-Python-Tutorial # -*- coding: utf-8 -*- # @Time : 2018/1/19 20:39 # @Author : play4fun # @File : show_image.py # @Software: PyCharm """ show_image.py: 制作有用的工具,日常使用 在环境变量中设置: alias show='/Users/play/.py3/bin/python3.6 /Users/play/github/OpenCV-Python-Tutorial/ch04-图片/show_image.py ' ""...
0
0
0
0
0
0
ch3/dnc/UVa11935.py
lyskevin/cpbook-code
1,441
3318750
from __future__ import annotations import sys events = [] def can(f: float) -> bool | object: global events cur_d, cur_n, leak_rate, dt = 0, 0, 0, 0 original_f = f for i in range(len(events)): dt = events[i][0] - cur_d f -= dt / 100 * cur_n f -= dt * leak_rate if f < 0: return False ...
1
1
0
0
2
0
tests/containers/test_audio.py
CostanzoPablo/audiomate
133
3318787
import os import numpy as np from audiomate import containers import pytest from tests import resources @pytest.fixture() def sample_container(): container_path = resources.get_resource_path( ['sample_files', 'audio_container'] ) sample_container = containers.AudioContainer(container_path) s...
0
0
0
0
0
0
care/facility/models/prescription_supplier.py
gigincg/care
189
3318802
<gh_stars>100-1000 import enum from django.db import models from care.facility.models import FacilityBaseModel from care.facility.models.mixins.permissions.facility import FacilityRelatedPermissionMixin from care.users.models import User class PrescriptionSupplier(FacilityBaseModel): class SchemeEnum(enum.Enum)...
0
0
0
0
0
0
swift/codegen/test/test_ql.py
adityasharad/ql
643
3318809
<gh_stars>100-1000 import sys from copy import deepcopy from swift.codegen.lib import ql from swift.codegen.test.utils import * def test_property_has_first_table_param_marked(): tableparams = ["a", "b", "c"] prop = ql.Property("Prop", "foo", "props", tableparams) assert prop.tableparams[0].first asse...
0
0
0
0
0
0
python/utils/run_benchmarks.py
BradReesWork/cugraph
991
3318818
<reponame>BradReesWork/cugraph # Copyright (c) 2018-2020, NVIDIA CORPORATION. # 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 requi...
0
0
0
0
0
0
tests/changes/api/test_adminmessage_index.py
vault-the/changes
443
3318819
<reponame>vault-the/changes from datetime import datetime from changes.testutils import APITestCase PATH = '/api/0/messages/' class AdminMessageIndexTest(APITestCase): def test_get_no_messages(self): resp = self.client.get(PATH) assert resp.status_code == 200 assert not self.unserialize...
0
0
0
0
0
0
tests/garage/experiment/test_deterministic.py
blacksph3re/garage
1,500
3318844
"""Tests for deterministic.py""" import random import numpy as np import tensorflow as tf import torch from garage.experiment import deterministic def test_deterministic_pytorch(): """Test deterministic behavior of PyTorch""" deterministic.set_seed(111) rand_tensor = torch.rand((5, 5)) deterministic...
0
0
0
0
0
0
src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/parse.py
cookingcodewithme/turicreate
11,356
3318851
<reponame>cookingcodewithme/turicreate # -*- coding: utf-8 -*- # Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from __future__ import print_function...
0
0
0
0
0
0
readthedocs/core/tests/test_signup.py
yarons/readthedocs.org
4,054
3318861
from http import HTTPStatus from unittest.mock import patch import requests import requests_mock from django.test import TestCase from django.conf import settings from readthedocs.forms import SignupFormWithNewsletter class TestNewsletterSignup(TestCase): form_data: dict[str,str] = { "email": "<EMAIL>"...
0
0
1
0
1
0
animeMusic_server/db/conn.py
waahah/animeMusic
287
3318874
<filename>animeMusic_server/db/conn.py # -*- coding:utf-8 -*- import os from pymongo import ( MongoReplicaSetClient, MongoClient, read_preferences ) import gridfs mc = MongoClient(host='localhost') anime_music = mc['anime_music']
0
0
0
0
0
0
insights/tests/client/test_schedule.py
maxamillion/insights-core
121
3318876
import tempfile from mock.mock import call, patch from pytest import mark import insights.client.schedule as sched from insights.client.config import InsightsConfig def test_get_schedule_cron(): target = tempfile.mktemp() config = InsightsConfig() with tempfile.NamedTemporaryFile() as source: sc...
0
0
0
0
0
0
core/common_mobilenetv2.py
StarStar-666/TensorFlow
428
3318896
#! /usr/bin/env python # coding=utf-8 from __future__ import annotations import tensorflow as tf def convolutional(input_data, filters_shape, trainable, name, downsample: bool=False, activate: bool=True, bn: bool=True) -> object: with tf.variable_scope(name): if downsample: pad_h, pad_w = (f...
10
9
0
0
19
0
Python/klampt/control/blocks/utils.py
joaomcm/Klampt
238
3318901
from __future__ import annotations """ Contains the following helper controllers: - :class:`RemappedBlock`: a remapping of inputs/outputs into another block's inputs and outputs. - :class:`MultiBlock`: a block that runs many other sub-blocks on each step. The I/O dictionaries are basically used as a blackboard ...
12
43
0
7
62
0
tcconfig/tcdel.py
personalcomputer/tcconfig
644
3318914
#!/usr/bin/env python3 """ .. codeauthor:: <NAME> <<EMAIL>> """ import errno import sys import subprocrunner as spr from .__version__ import __version__ from ._argparse_wrapper import ArgparseWrapper from ._capabilities import check_execution_authority from ._common import initialize_cli, is_execute_tc_command, no...
0
4
0
0
4
0
excalibur/__init__.py
FabioPT/excalibur
1,108
3318920
from .__version__ import __version__ # noqa
0
0
0
0
0
0
discovery-provider/alembic/versions/9ff8c8ae8de2_wipe_challenges.py
Tenderize/audius-protocol
429
3318943
"""Wipe challenges Revision ID: 9ff8c8ae8de2 Revises: <PASSWORD> Create Date: 2021-08-19 22:23:09.417170 """ from alembic import op # revision identifiers, used by Alembic. revision = "9ff8c8ae8de2" down_revision = "<PASSWORD>" branch_labels = None depends_on = None def upgrade(): # To drop: # - challenge...
0
0
0
0
0
0
app/uri/base_uri.py
cipherboy/modern-paste
271
3318949
<reponame>cipherboy/modern-paste import config class URI: fqdn = config.DOMAIN path = '/' api_endpoint = False def __init__(self): pass @classmethod def uri(cls, **kwargs): embedded_params = set([key for key in kwargs if '<{key}>'.format(key=key) in cls.path]) params ...
0
0
0
0
0
0
bot.py
Yinr/LCBot
517
3318953
#!/usr/bin/env python3 # coding: utf-8 from __future__ import annotations from wxpy import * import config import re from wxpy.utils import start_new_thread import time import os import platform from importlib import reload ''' 使用 cache 来缓存登陆信息,同时使用控制台登陆 ''' console_qr = (False if platform.system() == 'Windows' else T...
0
10
0
0
10
0
sars_tutorial/util/fpmc/utils.py
dav009/sars_tutorial
328
3318963
import csv import math import numpy as np def sigmoid(x) -> object: if x >= 0: return math.exp(-np.logaddexp(0, -x)) else: return math.exp(x - np.logaddexp(x, 0)) def load_data_from_dir(dirname) -> tuple[object, object, object]: fname_user_idxseq = dirname + '/' + 'idxseq.txt' fname...
1
4
0
0
5
0
dockerfiles/examples/read-bytes/scale-job.py
kaydoh/scale
121
3319000
<gh_stars>100-1000 import argparse import logging import sys import json import os logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', level=logging.DEBUG, stream=sys.stdout) def run_algorithm(bytes_total, input_file, out_dir): """Read the indicated number of bytes from in...
0
0
0
0
0
0
libraries/botbuilder-dialogs/tests/test_number_prompt.py
Fl4v/botbuilder-python
388
3319038
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from __future__ import annotations from typing import Callable import aiounittest from recognizers_text import Culture from botbuilder.dialogs import DialogContext, DialogTurnResult from botbuilder.dialogs.prompts import ( ...
13
7
2
0
22
0
Test/test_finance_data.py
lifg2000/StockAnalysisSystem
138
3319043
<filename>Test/test_finance_data.py from os import sys, path root_path = path.dirname(path.dirname(path.abspath(__file__))) try: import stock_analysis_system from Utiltity.common import * from Utiltity.time_utility import * from Collector.CollectorUtility import * except Exception as e: sys.path.ap...
0
0
0
0
0
0
prody/apps/prody_apps/prody_select.py
grandevelia/ProDy
210
3319045
<filename>prody/apps/prody_apps/prody_select.py """Extract a selection of atoms from a PDB file.""" from ..apptools import * __all__ = ['prody_select'] def prody_select(selstr, *pdbs, **kwargs): """Write selected atoms from a PDB file in PDB format. :arg selstr: atom selection string, see :ref:`selections` ...
0
0
0
0
0
0
sdv/metadata/errors.py
bjg290/SDV
817
3319061
"""Metadata Exceptions.""" class MetadataError(Exception): """Error to raise when Metadata is not valid.""" class MetadataNotFittedError(MetadataError): """Error to raise when Metadata is used before fitting."""
0
0
0
0
0
0
ros/geometry/tf/src/tf/broadcaster.py
numberen/apollo-platform
742
3319077
<filename>ros/geometry/tf/src/tf/broadcaster.py<gh_stars>100-1000 # Software License Agreement (BSD License) # # Copyright (c) 2008, <NAME>, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: ...
0
0
0
0
0
0
xfeat/selector/_elimination.py
Drunkar/xfeat
304
3319091
"""Feature elimination methods.""" from xfeat.base import SelectorMixin from xfeat.types import XDataFrame from xfeat.utils import analyze_columns, cudf_is_available try: import cudf # NOQA except ImportError: cudf = None class DuplicatedFeatureEliminator(SelectorMixin): """Remove duplicated features."...
4
4
0
2
10
0
ppci/cli/mkuimage.py
rakati/ppci-mirror
161
3319093
<gh_stars>100-1000 """ Uboot image creation utility. Use this utility to create uboot bootable images. """ import argparse from .base import base_parser, LogSetup from ..format.uboot_image import write_uboot_image, OperatingSystem from ..format.uboot_image import Architecture parser = argparse.ArgumentParser( ...
0
0
0
0
0
0