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
src/rust/iced-x86-py/tests/decoder_test.py
clayne/iced
1,018
3282515
# SPDX-License-Identifier: MIT # Copyright (C) 2018-present iced project and contributors import copy import pytest from iced_x86 import * from typing import Any, Callable @pytest.mark.parametrize("bitness", [16, 32, 64, 0, 15, 128]) def test_invalid_bitness(bitness: int) -> None: data = b"\x90" if bitness in (16, ...
7
18
0
0
25
0
WebMirror/management/rss_parser_funcs/feed_parse_extractNovelSaga.py
fake-name/ReadableWebProxy
193
3282527
from __future__ import annotations def extractNovelSaga(item) -> bool | object | None: """ 'Novel Saga' """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or 'preview' in item['title'].lower(): return None if 'Dragon Martial Emperor' in item['tags']: return build...
0
1
0
0
1
0
tests/test_ec2/test_security_groups_cloudformation.py
gtourkas/moto
5,460
3282544
import boto3 import sure # noqa # pylint: disable=unused-import import json from moto import mock_cloudformation, mock_ec2 from tests import EXAMPLE_AMI_ID from string import Template from uuid import uuid4 SEC_GROUP_INGRESS = Template( """{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "AWS C...
0
0
0
0
0
0
pythran/optimizations/comprehension_patterns.py
davidbrochart/pythran
1,647
3282546
""" Comprehension patterns transforms list comprehension into intrinsics. """ from pythran.analyses import OptimizableComprehension from pythran.passmanager import Transformation from pythran.transformations.normalize_tuples import ConvertToTuple from pythran.conversion import mangle from pythran.utils import attr_t...
0
7
0
0
7
0
utils/files.py
eloqute/WaveRNN
1,819
3282558
from pathlib import Path from typing import Union def get_files(path: Union[str, Path], extension: str='.wav') -> list[object]: if isinstance(path, str): path = Path(path).expanduser().resolve() return list(path.rglob(f'*{extension}'))
2
1
0
0
3
0
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/models/direct_url.py
brianherrera/lumberyard
1,738
3282570
from __future__ import annotations """ PEP 610 """ import json import re import urllib.parse from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import Any, Dict, Iterable, Optional, Type, TypeVar, Union T = TypeVar("T") DIRECT_URL_METADATA...
8
16
3
0
27
0
python/oneflow/utils/vision/transforms/functional_tensor.py
grybd/oneflow
3,285
3282592
""" Copyright 2020 The OneFlow 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 applicable law or agr...
34
13
0
0
47
0
src/fuzzingtool/core/defaults/encoders/ChainEncoder.py
NESCAU-UFLA/FuzzingTool
131
3282616
# Copyright (c) 2020 - present <NAME> <https://github.com/VitorOriel> # # 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, ...
2
2
0
0
4
0
MOnewUser/env/lib/python3.8/site-packages/Crypto/Cipher/AES.py
julio-cesar-leitao/PGP-PKI
2,063
3282625
# -*- coding: utf-8 -*- # # Cipher/AES.py : AES # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # n...
0
3
0
0
3
0
var/spack/repos/builtin/packages/r-modeltools/package.py
kkauder/spack
2,360
3282629
<reponame>kkauder/spack # 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 RModeltools(RPackage): """Tools and Classes for Statistical Models...
0
0
0
0
0
0
Algorithms/Tree-Algorithm/level_traversing/level_traversing.py
Pandi-Sangareswari/algo_ds_101
182
3282642
<filename>Algorithms/Tree-Algorithm/level_traversing/level_traversing.py<gh_stars>100-1000 # author: <NAME> # date: 2/10/2021 # Level order traversal on BST implementation in python from collections import deque from typing import List, Optional import sys #Definition for a binary tree node. class TreeNode: def...
0
0
0
0
0
0
python/ray/autoscaler/local/coordinator_server.py
firebolt55439/ray
21,382
3282669
<gh_stars>1000+ """Web server that runs on local/private clusters to coordinate and manage different clusters for multiple users. It receives node provider function calls through HTTP requests from remote CoordinatorSenderNodeProvider and runs them locally in LocalNodeProvider. To start the webserver the user runs: `py...
0
0
0
0
0
0
python/powerlift/src/powerlift/measures/task_measures.py
microsoft/interpret
2,122
3282702
<filename>python/powerlift/src/powerlift/measures/task_measures.py """ Task related measures. """ from math import log, e from numbers import Number from typing import Iterable, List, Tuple import numpy as np import pandas as pd def entropy(labels: Iterable, base: Number = None, normalized: bool = False) -> Number:...
0
0
0
0
0
0
docs/images/dist_script.py
dharunya0609/lifelines
1,654
3282721
# -*- coding: utf-8 -*- f, axes = plt.subplots(2, 1) ax = axes[0] H = lambda t, lambda_, rho: (t / lambda_) ** rho S = lambda t, lambda_, rho: np.exp(-H(t, lambda_, rho)) t = np.linspace(0.001, 10, 200) ax.set_title(r"Weibull survival functions upon varying the parameters") ax.plot(t, S(t, 0.5, 1), label=r"$\lambda=0...
0
0
0
0
0
0
manual-scans/aws-cname-eb.py
ovotech/domain-protect
185
3282746
#!/usr/bin/env python import boto3 import argparse import dns.resolver from utils_print import my_print, print_list from utils_aws import list_hosted_zones vulnerable_domains = [] def vulnerable_cname_eb(domain_name) -> bool: try: dns.resolver.resolve(domain_name, "A") return False except...
0
1
0
0
1
0
Python/libraries/recognizers-date-time/recognizers_date_time/__init__.py
AhmedLeithy/Recognizers-Text
688
3282758
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from .date_time import * from .resources import *
0
0
0
0
0
0
yt/frontends/sph/io.py
Xarthisius/yt
360
3282760
""" Generic file-handing functions for SPH data """ from yt.utilities.io_handler import BaseIOHandler class IOHandlerSPH(BaseIOHandler): """IOHandler implementation specifically for SPH data This exists to handle particles with smoothing lengths, which require us to read in smoothing lengths along wi...
0
1
0
0
1
0
core/Streams/UDPStream.py
Seabreg/pcapfex
203
3282770
<gh_stars>100-1000 # -*- coding: utf8 -*- __author__ = '<NAME>' from PacketStream import * import dpkt class UDPStream(PacketStream): def __init__(self, ipSrc, portSrc, ipDst, portDst, firstPacketNumber, pcapFile): PacketStream.__init__(self, ipSrc, portSrc, ipDst, portDst, firstPacketNumber, pcapFile) ...
0
0
0
0
0
0
tests/test_starlette_extension.py
WardPearce/slowapi
404
3282780
import time import hiro # type: ignore from starlette.applications import Starlette from starlette.requests import Request from starlette.responses import PlainTextResponse from starlette.routing import Route from starlette.testclient import TestClient from slowapi.util import get_ipaddr, get_remote_address from tes...
14
24
0
0
38
0
lib/antlr3/antlr3/recognizers.py
MiCHiLU/google_appengine_sdk
1,463
3282797
from __future__ import annotations """ANTLR3 runtime package""" # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 <NAME> # 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. Re...
4
45
3
14
66
0
toolchain/riscv/MSYS/python/Lib/ctypes/test/test_unicode.py
zhiqiang-hu/bl_iot_sdk
207
3282801
<reponame>zhiqiang-hu/bl_iot_sdk<filename>toolchain/riscv/MSYS/python/Lib/ctypes/test/test_unicode.py import unittest import ctypes from ctypes.test import need_symbol import _ctypes_test @need_symbol('c_wchar') class UnicodeTestCase(unittest.TestCase): def test_wcslen(self): dll = ctypes.CDLL(_c...
0
0
0
0
0
0
python/cusignal/filtering/_sosfilt_cuda.py
jrc-exp/cusignal
606
3282805
# Copyright (c) 2019-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 required by applicable law or agreed...
0
2
0
0
2
0
ctc_fast/swbd-utils/compare_errs.py
SrikarSiddarth/stanford-ctc
268
3282833
<reponame>SrikarSiddarth/stanford-ctc import pickle import numpy as np from editDist import edit_distance as ed from errorAnalysis import disp_err_corr ''' Given two pickle files, compare the hyps from each to the ref ''' if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() parse...
0
0
0
0
0
0
.github/validate_universe_json.py
snosrap/spaCy
22,040
3282847
<filename>.github/validate_universe_json.py<gh_stars>1000+ import json import re import sys from pathlib import Path def validate_json(document): universe_file = Path(document) with universe_file.open() as f: universe_data = json.load(f) for entry in universe_data["resources"]: if ...
0
0
0
0
0
0
scripts/test/test_config.py
sparsebase/facebook360_dep
221
3282854
#!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. """Global constants referenced across test scripts. Attributes: TEST_CAM (str): For apps that use only a...
0
0
0
0
0
0
test_suite/suite/test02/test.py
joncatanio/cannoli
755
3282864
a = 0 while a < 10: print(a) a = a + 1 else: print("while else output!") print("Just printed out 10 numbers in a while loop")
0
0
0
0
0
0
cuegui/cuegui/Main.py
sqlboy/OpenCue
329
3282872
# Copyright Contributors to the OpenCue Project # # 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...
0
0
0
0
0
0
experiments/deep_learning_with_pytorch/cbow.py
brettkoonce/transfer-nlp
307
3282874
import logging from typing import Dict, List, Any import numpy as np import pandas as pd import torch from transfer_nlp.common.tokenizers import CustomTokenizer from transfer_nlp.embeddings.embeddings import Embedding from transfer_nlp.loaders.loaders import DatasetSplits, DataFrameDataset from transfer_nlp.loaders.v...
15
5
0
3
23
0
sdk/python/pulumi_kubernetes/meta/v1/Status.py
polivbr/pulumi-kubernetes
277
3282881
# coding=utf-8 # *** WARNING: this file was generated by pulumigen. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** from __future__ import annotations import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... i...
41
16
0
0
57
0
moto/awslambda/exceptions.py
gtourkas/moto
5,460
3282909
<filename>moto/awslambda/exceptions.py from botocore.client import ClientError from moto.core.exceptions import JsonRESTError class LambdaClientError(ClientError): def __init__(self, error, message): error_response = {"Error": {"Code": error, "Message": message}} super().__init__(error_response, N...
0
0
0
0
0
0
mcpipy/spacefill.py
wangtt03/raspberryjammod
338
3282930
<gh_stars>100-1000 # # Code by <NAME> and under the MIT license # import lsystem from mineturtle import * from sys import argv COLORS = (block.WOOL_WHITE,block.HARDENED_CLAY_STAINED_WHITE,block.WOOL_PINK,block.WOOL_MAGENTA,block.WOOL_PURPLE,block.HARDENED_CLAY_STAINED_LIGHT_BLUE,block.HARDENED_CLAY_STAINED_CYAN...
0
0
0
0
0
0
tools/utilities/pythonlibs/audio/classifier.py
shawncal/ELL
2,094
3282968
<reponame>shawncal/ELL ################################################################################################### # # Project: Embedded Learning Library (ELL) # File: classifier.py # Authors: <NAME> # # Requires: Python 3.x # ###########################################################################...
0
0
0
0
0
0
AutotestWebD/apps/user_login/views/test.py
yangjourney/sosotest
422
3282972
print("111" == "111")
0
0
0
0
0
0
distro/src/bin/atlas_stop.py
mario-renau-alstom/atlas
1,248
3282978
#!/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 "Li...
0
1
0
0
1
0
tensorflow/python/keras/utils/losses_utils.py
EricRemmerswaal/tensorflow
190,993
3282980
# 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...
6
11
4
0
21
0
modules/xlsxwriter/chart_bar.py
noraj/Kvasir
194
3283001
############################################################################### # # ChartBar - A class for writing the Excel XLSX Bar charts. # # Copyright 2013, <NAME>, <EMAIL> # from __future__ import annotations from . import chart class ChartBar(chart.Chart): """ A class for writing the Excel XLSX Bar ch...
1
1
0
6
8
0
certbot-apache/tests/util.py
luisriverag/certbot
16,789
3283011
<reponame>luisriverag/certbot """Common utilities for certbot_apache.""" import shutil import sys import unittest import augeas import josepy as jose try: import mock except ImportError: # pragma: no cover from unittest import mock # type: ignore from certbot.compat import os from certbot.plugins import co...
0
0
0
0
0
0
cinder/volume/drivers/san/hp/hpmsa_common.py
arunvinodqmco/cinder
571
3283036
# Copyright 2014 <NAME> # Copyright 2015 DotHill Systems # # 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 re...
0
1
1
2
4
0
main-circle.py
raboof/sand-spline
301
3283041
#!/usr/bin/python3 # -*- coding: utf-8 -*- from numpy import pi from numpy import array from numpy.random import random from numpy.random import randint from numpy import linspace from numpy import arange from numpy import column_stack from numpy import cos from numpy import sin BG = [1,1,1,1] FRONT = [0,0,0,0.01] ...
0
0
0
0
0
0
tests/python/frontend/nnvm_to_relay/test_forward.py
mingwayzhang/tvm
286
3283049
<reponame>mingwayzhang/tvm # 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 ...
0
0
0
0
0
0
tools/extra/extract_seconds.py
ayzk/ft-caffe-public
933
3283059
<filename>tools/extra/extract_seconds.py #!/usr/bin/env python # # All modification made by Intel Corporation: Copyright (c) 2016 Intel Corporation # # All contributions by the University of California: # Copyright (c) 2014, 2015, The Regents of the University of California (Regents) # All rights reserved. # # All o...
0
0
0
0
0
0
tests/core/design/core_dense_test.py
isaaccorley/flax
2,249
3283081
# Copyright 2021 The Flax 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 or agreed to in wri...
4
6
6
0
16
0
mne/viz/backends/_utils.py
vagechirkov/mne-python
1,953
3283100
<gh_stars>1000+ # -*- coding: utf-8 -*- # # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: Simplified BSD from contextlib import contextmanager import numpy as np import collections.abc from ...externals.decorator import decorator VALID_BROWS...
0
0
0
0
0
0
sfm/sfm/urls.py
Xtuden-com/sfm-ui
129
3283106
<reponame>Xtuden-com/sfm-ui<gh_stars>100-1000 from django.conf.urls import include, url from django.contrib import admin from django.views.generic import RedirectView from .views import password_reset_done urlpatterns = [ url(r'^$', RedirectView.as_view(url="ui/", permanent=True)), url(r'^admin/', admin.site.u...
0
0
0
0
0
0
evennia/comms/migrations/0014_auto_20170705_1736.py
Jaykingamez/evennia
1,544
3283156
<gh_stars>1000+ # -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-05 17:36 from django.db import migrations # This migration only made sense earlier in the git history, during # the player->account transition. Now it will do nothing since players.PlayerDB # no longer exists. def forwards(apps, schema...
0
0
0
0
0
0
tools/mpy-cross/hellortt.py
lymzzyh/micropython
170
3283162
# import os class HelloRtt: def __repr__(self) -> str: self.__call__() return "" def __call__(self): print("hello world!!") print("hello RTT") hello = HelloRtt()
0
1
0
0
1
0
foresight/utils.py
abdulmohit/foresight
193
3283171
from __future__ import annotations from math import log def check_enough_values(num_values, value_bits, state_bits, modulus: object | None=None) -> object: if modulus: return log(modulus, 2) * num_values >= state_bits else: return num_values * value_bits >= state_bits
1
1
0
0
2
0
lifxlan/unpack.py
cannero/lifxlan
464
3283177
# coding=utf-8 # unpack.py # Author: <NAME> import binascii import struct from .message import HEADER_SIZE_BYTES, Message from .msgtypes import * # Creates a LIFX Message out of packed binary data # If the message type is not one of the officially released ones above, it will create just a Message out of it # If it...
0
1
0
0
1
0
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_drivers_icpe_ethernet_cfg.py
CiscoDevNet/ydk-py
177
3283180
<gh_stars>100-1000 """ Cisco_IOS_XR_drivers_icpe_ethernet_cfg This module contains a collection of YANG definitions for Cisco IOS\-XR drivers\-icpe\-ethernet package configuration. This YANG module augments the Cisco\-IOS\-XR\-ifmgr\-cfg module with configuration data. Copyright (c) 2013\-2018 by Cisco Systems, I...
0
0
0
0
0
0
src/saml2/cache.py
skanct/pysaml2
5,079
3283215
<reponame>skanct/pysaml2 #!/usr/bin/env python import shelve import six from saml2.ident import code, decode from saml2 import time_util, SAMLError import logging logger = logging.getLogger(__name__) # The assumption is that any subject may consist of data # gathered from several different sources, all with their ow...
0
0
0
0
0
0
src/unix/build_icons.py
hanya/mozc
1,144
3283225
<reponame>hanya/mozc # -*- coding: utf-8 -*- # Copyright 2010-2021, Google 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: # # * Redistributions of source code must retain the above cop...
0
0
0
0
0
0
trinity/protocol/les/requests.py
pipermerriam/py-evm
137
3283227
<reponame>pipermerriam/py-evm from typing import ( Any, Dict, Tuple, ) from eth_typing import BlockIdentifier from eth.rlp.headers import BlockHeader from p2p.exceptions import ValidationError from trinity.protocol.common.requests import ( BaseHeaderRequest, ) from .constants import MAX_HEADERS_FET...
0
0
0
0
0
0
python/dgl/data/reddit.py
lfchener/dgl
9,516
3283248
<reponame>lfchener/dgl """ Reddit dataset for community detection """ from __future__ import absolute_import import scipy.sparse as sp import numpy as np import os from .dgl_dataset import DGLBuiltinDataset from .utils import _get_dgl_url, generate_mask_tensor, load_graphs, save_graphs, deprecate_property from .. imp...
0
0
0
0
0
0
todoist/managers/reminders.py
jonringer/todoist-python
617
3283290
# -*- coding: utf-8 -*- from __future__ import annotations from .. import models from .generic import AllMixin, GetByIdMixin, Manager, SyncMixin class RemindersManager(Manager, AllMixin, GetByIdMixin, SyncMixin): state_name: str = "reminders" object_type: str = "reminder" def add(self, item_id, **kwargs...
0
2
2
0
4
0
histomicstk/features/compute_haralick_features.py
basanto/HistomicsTK
249
3283293
<filename>histomicstk/features/compute_haralick_features.py<gh_stars>100-1000 import numpy as np import pandas as pd from skimage.measure import regionprops from .graycomatrixext import graycomatrixext from .graycomatrixext import _default_num_levels from .graycomatrixext import _default_offsets from ._compute_margina...
0
0
0
0
0
0
da.py
jizizr/PagerMaid_Plugins
153
3283321
<filename>da.py from asyncio import sleep from pagermaid import log from pagermaid.listener import listener from pagermaid.utils import alias_command from telethon.errors import PeerFloodError @listener(is_plugin=True, outgoing=True, command=alias_command("da"), description="以此命令删除所有消息。(非群组管理员只删除自己的消息)", ...
0
0
0
0
0
0
shopify/resources/customer_group.py
butlertron/shopify_python_api
828
3283338
from .customer_saved_search import CustomerSavedSearch class CustomerGroup(CustomerSavedSearch): pass
0
0
0
0
0
0
workbench/predict_tensorflow.py
skynode/eShopOnContainersAI
387
3283341
import sys, os, os.path, glob import tensorflow as tf import numpy keras_backend = 'tensorflow' os.environ['KERAS_BACKEND'] = keras_backend def load_graph(frozen_graph_filename) -> object: # We load the protobuf file from the disk and parse it to retrieve the # unserialized graph_def with tf.gfile.GFile(...
2
4
0
0
6
0
contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py
HeyLey/catboost
6,989
3283353
<reponame>HeyLey/catboost """Suite Standard Suite: Common classes and commands for most applications. Level 1, version 1 Generated from /System/Library/CoreServices/System Events.app AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = '????' class Standard_Suite_Events: ...
0
0
0
0
0
0
IOPool/Input/test/test_read_overlapping_lumis_cfg.py
ckamtsikis/cmssw
852
3283370
import FWCore.ParameterSet.Config as cms process = cms.Process("READ") process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring("file:overlap.root")) process.tst = cms.EDAnalyzer("RunLumiEventChecker", eventSequence = cms.untracked.VEventID( cms.EventID(1,0,0), ...
0
0
0
0
0
0
venv/Lib/site-packages/statsmodels/nonparametric/bandwidths.py
EkremBayar/bayar
6,931
3283394
<reponame>EkremBayar/bayar import numpy as np from scipy.stats import scoreatpercentile from statsmodels.compat.pandas import Substitution from statsmodels.sandbox.nonparametric import kernels def _select_sigma(x, percentile=25): """ Returns the smaller of std(X, ddof=1) or normalized IQR(X) over axis 0. ...
0
0
0
0
0
0
Lib/site-packages/pbr/tests/test_core.py
inging44/python3
1,738
3283405
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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...
0
0
1
0
1
0
Algo and DSA/LeetCode-Solutions-master/Python/strange-printer.py
Sourav692/FAANG-Interview-Preparation
3,269
3283438
<gh_stars>1000+ # Time: O(n^3) # Space: O(n^2) class Solution(object): def strangePrinter(self, s): """ :type s: str :rtype: int """ def dp(s, i, j, lookup): if i > j: return 0 if (i, j) not in lookup: lookup[(i, j)] ...
0
0
0
0
0
0
mpunet/logging/log_results.py
alexsosn/MultiPlanarUNet
156
3283444
<gh_stars>100-1000 import os import copy import numpy as np import pandas as pd from mpunet.utils import create_folders def init_result_dict_3D(all_images, n_classes): if n_classes == 1: n_classes = 2 # Prepare dictionary of per class results detailed_results = {"class": range(1, n_classes)} ...
0
0
0
0
0
0
observations/r/schmid.py
hajime9652/observations
199
3283445
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def schmid(path) -> tuple[object, object]: """12 variables created by Sch...
0
1
0
0
1
0
ddtrace/contrib/boto/__init__.py
p7g/dd-trace-py
308
3283469
""" Boto integration will trace all AWS calls made via boto2. This integration is automatically patched when using ``patch_all()``:: import boto.ec2 from ddtrace import patch # If not patched yet, you can patch boto specifically patch(boto=True) # This will report spans with the default instrumen...
0
0
0
0
0
0
Configuration/Skimming/test/CSmaker_Onia_PDMu_1e29_reprocess361p4_cfg.py
ckamtsikis/cmssw
852
3283492
import FWCore.ParameterSet.Config as cms process = cms.Process("makeSD") process.configurationMetadata = cms.untracked.PSet( version = cms.untracked.string('$Revision: 1.1 $'), annotation = cms.untracked.string('Onia central skim'), name = cms.untracked.string('$Source: /cvs_server/repositories/CMSSW/CMS...
0
0
0
0
0
0
tests/test_util.py
ionelmc/python-hunter
707
3283495
<reponame>ionelmc/python-hunter<filename>tests/test_util.py import re from array import array from collections import OrderedDict from collections import deque from collections import namedtuple from datetime import date from datetime import datetime from datetime import time from datetime import timedelta from datetim...
0
0
0
0
0
0
vissl/hooks/grad_clip_hooks.py
blazejdolicki/vissl
2,512
3283502
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Union import torch.nn.utils as utils from classy_vision import tasks from classy_vision.hooks.classy_hook import ClassyHook...
3
1
0
0
4
0
codigo/Live152/exemplo_03.py
cassiasamp/live-de-python
572
3283510
<reponame>cassiasamp/live-de-python def corrotina(): print('Começou') valor = yield print(f'Recebi: {valor}') c = corrotina() next(c) # Começou c.send(10) # Recebi: 10 # StopIteration
0
0
0
0
0
0
deepvariant/make_examples.py
google/deepvariant
2,553
3283527
<gh_stars>1000+ # Copyright 2017 Google LLC. # # 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 notice, # this list of conditions and the following...
0
0
0
0
0
0
vmprof/test/test_run.py
kayhayen/vmprof-python
430
3283567
<reponame>kayhayen/vmprof-python<filename>vmprof/test/test_run.py<gh_stars>100-1000 """ Test the actual run """ import py import sys import tempfile import time import gzip import time import pytz import vmprof import six import pytest from cffi import FFI from datetime import datetime import requests from vmshare.serv...
0
0
0
0
0
0
services/core/DNP3Agent/dnp3_master.py
cloudcomputingabc/volttron
406
3283575
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2018, 8minutenergy / Kisensum. # # 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.apa...
6
2
0
12
20
0
svgwrite__examples/from_examples/length_units.py
DazEB2/SimplePyScripts
117
3283604
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' # SOURCE: https://github.com/mozman/svgwrite/blob/master/examples/ltattrie/length_units.py # pip install svgwrite import svgwrite def create_svg(name): svg_size = 900 font_size = 20 title1 = 'Example of units of length' title2...
0
0
0
0
0
0
graveyard/ngt_utils/containers.py
AndrewAnnex/StereoPipeline
323
3283609
<reponame>AndrewAnnex/StereoPipeline<gh_stars>100-1000 ## __BEGIN_LICENSE__ ## Copyright (C) 2006-2010 United States Government as represented by ## the Administrator of the National Aeronautics and Space Administration ## All Rights Reserved. ## __END_LICENSE__ import collections import threading import Queue KEY, P...
0
0
0
0
0
0
advection/tests/test_advection.py
SebastianoF/pyro2
151
3283612
<filename>advection/tests/test_advection.py from util import runparams import advection.simulation as sn class TestSimulation(object): @classmethod def setup_class(cls): """ this is run once for each class before any tests """ pass @classmethod def teardown_class(cls): """ thi...
0
0
0
0
0
0
tencentcloud/sms/v20190711/errorcodes.py
lleiyyang/tencentcloud-sdk-python
465
3283618
<reponame>lleiyyang/tencentcloud-sdk-python<gh_stars>100-1000 # -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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 ...
0
0
0
0
0
0
5.Sentence-Similarity/Bert whitening/run.py
jasoncao11/nlp-notebook
136
3283629
<reponame>jasoncao11/nlp-notebook import torch import numpy as np from sklearn import metrics from transformers import BertModel from load_data import traindataloader, valdataloader BERT_PATH = '../bert-base-chinese' device = "cuda" if torch.cuda.is_available() else 'cpu' bert = BertModel.from_pretrained(BERT_PATH).to...
0
0
0
0
0
0
fluent.runtime/tests/format/test_parameterized_terms.py
shlomyb-di/python-fluent
155
3283700
import unittest from fluent.runtime import FluentBundle, FluentResource from fluent.runtime.errors import FluentFormatError, FluentReferenceError from ..utils import dedent_ftl class TestParameterizedTerms(unittest.TestCase): def setUp(self): self.bundle = FluentBundle(['en-US'], use_isolating=False) ...
0
0
0
0
0
0
datacube/drivers/readers.py
eodcgmbh/datacube-core
363
3283716
<filename>datacube/drivers/readers.py # This file is part of the Open Data Cube, see https://opendatacube.org for more information # # Copyright (c) 2015-2020 ODC Contributors # SPDX-License-Identifier: Apache-2.0 from typing import List, Optional, Callable from .driver_cache import load_drivers from .datasource import...
0
0
0
0
0
0
arelle/CntlrComServer.py
DataFinnovation/Arelle
292
3283728
<gh_stars>100-1000 ''' Created on Nov 28, 2011 This module is Arelle's COM server controller (This module can be a pattern for custom integration of Arelle into an application. It is provided for future referenced but not used in the production code. It cannot be used in cx_freeze or py2app installer-built deployment...
0
0
0
0
0
0
lib/net/network.py
zhangyongshun/BagofTricks-LT
115
3283738
import torch import torch.nn as nn import torch.nn.functional as F from backbone import (res32_cifar, res50, res10) from modules import GAP, FCNorm, Identity, LWS import copy import numpy as np import cv2 import os class Network(nn.Module): def __init__(self, cfg, mode: str="train", num_classes: int=1...
5
8
0
0
13
0
tools/wraptypes/cparser.py
AnantTiwari-Naman/pyglet
1,160
3283754
#!/usr/bin/env python '''Parse a C source file. To use, subclass CParser and override its handle_* methods. Then instantiate the class with a string to parse. Derived from ANSI C grammar: * Lexicon: http://www.lysator.liu.se/c/ANSI-C-grammar-l.html * Grammar: http://www.lysator.liu.se/c/ANSI-C-grammar-y.html R...
0
0
0
0
0
1
src/noisy_linear.py
akolishchak/doom-net-pytorch
143
3283767
# # noisy_linear.py, doom-net # # Created by <NAME> on 07/04/17. # # based on https://arxiv.org/abs/1706.10295 # import torch import math from torch.nn.parameter import Parameter import torch.nn as nn import torch.nn.functional as F from device import device class NoisyLinear(nn.Module): def __init__(self, in_fea...
1
2
0
3
6
0
tests/modules/imported/modulee.py
Fryguy/py2rb
124
3283794
<reponame>Fryguy/py2rb from imported.submodules import submodulea def bar(): print("imported.modulee.bar()") submodulea.foo()
0
0
0
0
0
0
content/en/api/v1/aws-logs-integration/CreateAWSLambdaARN.py
fhsgoncalves/documentation
219
3283838
from datadog import initialize, api options = { 'api_key': '<DATADOG_API_KEY>', 'app_key': '<DATADOG_APPLICATION_KEY>' } initialize(**options) account_id = "<AWS_ACCOUNT_ID>" lambda_arn = "arn:aws:lambda:<REGION>:<AWS_ACCOUNT_ID>:function:<LAMBDA_FUNCTION_NAME>" api.AwsLogsIntegration.add_log_lambda_arn(acc...
0
0
0
0
0
0
tests/docker-images/latest-version-image/python-examples/producer_schema.py
turtlequeue/pulsar
9,156
3283865
<reponame>turtlequeue/pulsar #!/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 ...
0
0
0
0
0
0
lib/python/treadmill/nodedata.py
bretttegartms/treadmill
133
3283870
"""Get node data node data from configs/node.json It is a combination of cell data and node data """ import io import json import logging import os _LOGGER = logging.getLogger(__name__) FILE = 'node.json' def get(config_dir) -> object: """Get node data """ node_file = os.path.join(config_dir, FILE) ...
0
1
0
0
1
0
py/examples/graphics_hilbert.py
swt2c/wave
3,013
3283875
# Graphics / Hilbert # Use turtle #graphics recursively to draw Hilbert curves. # --- from h2o_wave import ui, main, app, Q, graphics as g def hilbert(t: g.Turtle, width: float, depth: int, reverse: bool=False) -> None: # recursive angle = -90 if reverse else 90 if depth == 0: t.f(width).r(angle).f(...
7
2
0
0
9
0
AppServer/google/appengine/api/backends/backends.py
loftwah/appscale
790
3283884
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
12
12
0
0
24
0
pyannotate_tools/annotations/tests/types_test.py
terencehonles/pyannotate
1,363
3283886
import unittest from pyannotate_tools.annotations.types import AnyType, ClassType, TupleType, UnionType class TestTypes(unittest.TestCase): def test_instance_str(self): # type: () -> None assert str(ClassType('int')) == 'int' assert str(ClassType('List', [ClassType('int')])) == 'List[int]...
0
0
0
0
0
0
configs/swa/swa_fcos_r101_caffe_fpn_gn-head_1x_coco.py
hyz-xmaster/swa_object_detection
211
3283900
<filename>configs/swa/swa_fcos_r101_caffe_fpn_gn-head_1x_coco.py _base_ = ['../fcos/fcos_r101_caffe_fpn_gn-head_1x_coco.py', '../_base_/swa.py']
0
0
0
0
0
0
bp_common/software/py/pc_histogram.py
wantan244/black-parrot
236
3283907
<reponame>wantan244/black-parrot # # pc_histogram.py # # Black Parrot PC execution count profiler # # input: operation_trace.csv # output: PC Histogram stats pc_stats/bp_pc_histogram.log # # @author Borna <EMAIL> # # How to use: # python pc_histogram.py --trace {operation_trace.csv} # ...
0
0
0
0
0
0
reversing/matryoshka/generate.py
cclauss/fbctf-2019-challenges
213
3283916
<gh_stars>100-1000 # Generate import ctypes from ctypes import * import sys import struct import subprocess import os import time import codecs import argparse import random from shutil import copyfile try: from macholib.MachO import MachO except ImportError: print('macholib module not installed.') sys.exit...
0
0
0
0
0
0
zerver/lib/mdiff.py
TylerPham2000/zulip
17,004
3283917
import logging import os import subprocess class DiffException(Exception): pass def diff_strings(output: str, expected_output: str) -> str: mdiff_path = "frontend_tests/zjsunit/mdiff.js" if not os.path.isfile(mdiff_path): # nocoverage msg = "Cannot find mdiff for Markdown diff rendering" ...
2
1
0
0
3
0
bin/send-complex-mime.py
aidenjude/mailslurper
1,135
3283938
#!/bin/env python # -*- coding: latin-1 -*- import smtplib import email import email.MIMEText import email.MIMEImage import email.MIMEAudio import email.MIMEMultipart import mimetypes import socket import getpass import os import sys from time import gmtime, strftime if os.name == "posix": import pwd _MIME_PREA...
0
0
0
0
0
0
compressible_sdc/simulation.py
SebastianoF/pyro2
151
3283948
<reponame>SebastianoF/pyro2<gh_stars>100-1000 """The routines that implement the 4th-order compressible scheme, using SDC time integration """ from __future__ import print_function import mesh.patch as patch import compressible_fv4 from util import msg class Simulation(compressible_fv4.Simulation): """Drive th...
0
0
0
0
0
0
dockerscan/actions/__init__.py
michalkoczwara/dockerscan
1,286
3283951
from .scan import * from .helpers import * from .registry import *
0
0
0
0
0
0
fpga/lib/eth/tb/mii_ep.py
totuwei/corundum
1,121
3283953
from __future__ import annotations """ Copyright (c) 2019 <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 the rights to use, copy, modify,...
7
13
0
6
26
0
text_rcnn.py
zhengwsh/text-classification
107
3283967
import tensorflow as tf import numpy as np import copy class TextRCNN(object): """ A RNN-CNN for text classification/regression. Uses an embedding layer, followed by a recurrent, convolutional, fully-connected (and softmax) layer. """ def __init__( self, model_type, sequence_length, num_clas...
1
3
0
0
4
0