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
fooof/tests/utils/test_debug.py
varman-m/eeg_notebooks_doc
154
1708402
"""Test functions for fooof.utils.debug""" from fooof.utils.debug import * ################################################################################################### ################################################################################################### def test_sys_info(): sys_info()
0
0
0
0
0
0
Packs/IntegrationsAndIncidentsHealthCheck/Scripts/IncidentsCheck_NumberofIncidentsNoOwner/IncidentsCheck_NumberofIncidentsNoOwner_test.py
diCagri/content
799
1708410
<gh_stars>100-1000 import pytest import demistomock as demisto from IncidentsCheck_NumberofIncidentsNoOwner import main, RED_HTML_STYLE, GREEN_HTML_STYLE @pytest.mark.parametrize('incident_ids, expected', [ (['1', '2', '3'], f"<h1 style={RED_HTML_STYLE}3</h1>"), (['2'], f"<h1 style={RED_HTML_STYLE}1</h1>"), ...
0
0
0
0
0
0
pyftdi/tests/cbus.py
marcjordan2112/pyftdi
345
1708428
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2020, <NAME> <<EMAIL>> # All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause import sys from doctest import testmod from os import environ from unittest import TestCase, TestSuite, makeSuite, main as ut_main from pyftdi.ftdi import Ftdi, FtdiEr...
0
1
0
0
1
0
cctbx/sgtbx/boost_python/tst_N_fold_rot.py
dperl-sol/cctbx_project
155
1708435
<gh_stars>100-1000 from __future__ import absolute_import, division, print_function from scitbx import matrix from libtbx.math_utils import iround from cctbx import sgtbx from cctbx.uctbx import unit_cell '''Test the calculation of point-group symmetry operations by comparison to published matrices.''' cubic = unit_c...
0
0
0
0
0
0
python/tests/compress_test.py
nxxm/brotli
11,699
1708440
<filename>python/tests/compress_test.py # Copyright 2016 The Brotli Authors. All rights reserved. # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT import unittest from . import _test_utils import brotli class TestCompress(_test_utils.TestCase): VAR...
0
0
0
0
0
0
apps/volve-3d-vtk/app.py
GavinPass/dash-sample-apps
2,332
1708472
<reponame>GavinPass/dash-sample-apps #!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd import pyvista as pv import xarray as xr from jupyter_dash import JupyterDash import dash import dash_html_components as html import vtk import dash_vtk from dash_vtk.utils import...
0
0
0
0
0
0
json_to_models/cli.py
bogdandm/attrs-api-client
111
1708476
<reponame>bogdandm/attrs-api-client<gh_stars>100-1000 import argparse import configparser import importlib import itertools import json import os.path import re import sys from collections import defaultdict from datetime import datetime from pathlib import Path from typing import Any, Callable, Dict, Generator, Iterab...
0
0
0
0
0
0
utils/munin/base.py
louis-pre/NewsBlur
3,073
1708503
import sys class MuninGraph(object): def run(self): cmd_name = None if len(sys.argv) > 1: cmd_name = sys.argv[1] if cmd_name == 'config': self.print_config() else: metrics = self.calculate_metrics() self.print_metrics(metrics) ...
0
0
0
0
0
0
tutorials/mobilenetv3_prod/Step6/paddlevision/datasets/__init__.py
fengxiaoshuai/models
7,090
1708504
from .folder import ImageFolder, DatasetFolder from .vision import VisionDataset __all__ = ('ImageFolder', 'DatasetFolder', 'VisionDataset')
0
0
0
0
0
0
flatdata-py/flatdata/lib/tar_archive_resource_storage.py
heremaps/flatdata
140
1708520
<gh_stars>100-1000 ''' Copyright (c) 2021 HERE Europe B.V. See the LICENSE file in the root of this project for license details. ''' import tarfile from .errors import CorruptResourceError from .errors import MissingResourceError from .file_resource_storage import FileResourceStorage class TarArchiveResourceStora...
0
0
0
0
0
0
tests/python/cuda/test_topo.py
jakeKonrad/torch-quiver
196
1708533
import quiver import torch world_size = torch.cuda.device_count() device_list = list(range(world_size)) numa_topo = quiver.NumaTopo(device_list) numa_topo.info()
0
0
0
0
0
0
moltemplate/force_fields/cooke_deserno_supporting_files/gen_potential-cooke.py
jsbtic/moltemplate
132
1708535
<reponame>jsbtic/moltemplate<gh_stars>100-1000 #!/usr/bin/python import os,sys from fractions import Fraction from numpy import * ### PARAMETERS ### sigma = 1.00 epsilon = 1.00 b_hh = 0.95 * sigma b_ht = 0.95 * sigma b_tt = 1.00 * sigma r_init = 0.000001 r_max = sigma * 3. r_space = 0.01 ################## ### INP...
0
0
0
0
0
0
scripts/fixheaders.py
dabinn/open3mod
957
1708538
<filename>scripts/fixheaders.py<gh_stars>100-1000 #!/usr/bin/env python3 # -*- coding: UTF_8 -*- # ----------------------------------------------------------------------------------- ## Script to change the license/copyright headers of all source files at once. ## Matching via RE is supported. Footers also. ## ## Prov...
0
0
0
0
0
0
extend.py
fmiotello/Catch-A-Waveform
101
1708545
import argparse import os import librosa from utils.utils import calc_snr, calc_lsd from generating import AudioGenerator if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--input_folder', help='Folder of trained model', type=str, required=True) parser.add_argument('--lr_si...
0
0
0
0
0
0
test/connector/exchange/kraken/test_kraken_user_stream_tracker.py
BGTCapital/hummingbot
3,027
1708559
<reponame>BGTCapital/hummingbot #!/usr/bin/env python from os.path import join, realpath import sys; sys.path.insert(0, realpath(join(__file__, "../../../../../"))) from hummingbot.connector.exchange.kraken.kraken_user_stream_tracker import KrakenUserStreamTracker from hummingbot.connector.exchange.kraken.kraken_auth ...
0
0
0
0
0
0
tests/integration/cloudformation/test_cloudformation_iam.py
suryatmodulus/localstack
31,928
1708563
import jinja2 from localstack.utils.common import short_uid from localstack.utils.generic.wait_utils import wait_until from tests.integration.cloudformation.test_cloudformation_changesets import load_template_raw def test_delete_role_detaches_role_policy( cfn_client, iam_client, cleanup_stacks, clean...
0
0
0
0
0
0
ssqueezepy/_gmw.py
Mario-Kart-Felix/ssqueezepy
271
1708565
<reponame>Mario-Kart-Felix/ssqueezepy<gh_stars>100-1000 # -*- coding: utf-8 -*- """Generalized Morse Wavelets. For complete functionality, utility functions have been ported from jLab, and largely validated to match jLab's behavior. jLab tests not ported. """ import numpy as np from numpy.fft import ifft from numba im...
0
0
0
0
0
0
Geometry/HcalEventSetup/python/HcalGeometryDBWriter_cfi.py
ckamtsikis/cmssw
852
1708570
<reponame>ckamtsikis/cmssw import FWCore.ParameterSet.Config as cms HcalHardcodeGeometryEP = cms.ESProducer( "HcalHardcodeGeometryEP" , appendToDataLabel = cms.string("_master"), UseOldLoader = cms.bool(False) ...
0
0
0
0
0
0
cloudmarker/clouds/azmonitor.py
TinLe/cloudmarker
208
1708571
<filename>cloudmarker/clouds/azmonitor.py """Microsoft Azure monitor plugin to read Azure monitoring data. This module defines the :class:`AzMonitor` class that retrieves data from Microsoft Azure. """ import logging from azure.common.credentials import ServicePrincipalCredentials from azure.mgmt.monitor import Mon...
0
0
0
0
0
0
tests/__init__.py
Alindil/python-plexapi
749
1708581
<filename>tests/__init__.py # -*- coding: utf-8 -*- import sys from os.path import dirname, abspath # Make sure plexapi is in the systempath sys.path.insert(0, dirname(dirname(abspath(__file__))))
0
0
0
0
0
0
malwareconfig/decoders/luxnet.py
BA7JCM/RATDecoders
905
1708599
from malwareconfig.common import Decoder from malwareconfig.common import string_printable class LuxNet(Decoder): decoder_name: str = "LuxNet" decoder__version: int = 1 decoder_author: str = "@kevthehermit" decoder_description: str = "Luxnet RAT Decoder" def __init__(self): self.config: d...
0
0
4
1
5
0
third_party/pyelftools/test/test_arm_support.py
zipated/src
2,151
1708601
<reponame>zipated/src<filename>third_party/pyelftools/test/test_arm_support.py #------------------------------------------------------------------------------- # elftools tests # # <NAME> (<EMAIL>) # This code is in the public domain #------------------------------------------------------------------------------- try: ...
0
0
0
0
0
0
src/python/gem5/components/cachehierarchies/ruby/topologies/simple_pt2pt.py
hyu-iot/gem5
765
1708609
# Copyright (c) 2021 The Regents of the University of California. # 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 copyright # notice, this lis...
0
0
0
1
1
0
virtual/lib/python3.6/site-packages/pylint/test/functional/with_used_before_assign.py
drewheathens/The-Moringa-Tribune
463
1708615
<gh_stars>100-1000 ''' Regression test for https://bitbucket.org/logilab/pylint/issue/128/attributeerror-when-parsing ''' from __future__ import with_statement def do_nothing(): """ empty """ with open("") as ctx.obj: # [undefined-variable] context.do() # [used-before-assignment] context = No...
0
0
0
0
0
0
tests/types/test_document.py
andrew-ld/aiogram
2,744
1708636
<reponame>andrew-ld/aiogram from aiogram import types from .dataset import DOCUMENT document = types.Document(**DOCUMENT) def test_export(): exported = document.to_python() assert isinstance(exported, dict) assert exported == DOCUMENT def test_file_name(): assert isinstance(document.file_name, str)...
0
0
0
0
0
0
quarkc/lib/quark_runtime.py
datawire/quark
112
1708660
# Quark Runtime # Usage: from quark_runtime import * # This brings in the stuff mentioned in __all__ below. # The wrong way to do this, but minimizes the code change. from __future__ import annotations from __future__ import absolute_import from __future__ import unicode_literals __version__ = '0.4.2' __all__ = str(...
1
62
2
10
75
0
RecoEgamma/EgammaIsolationAlgos/python/eleEcalExtractorBlocks_cff.py
ckamtsikis/cmssw
852
1708677
import FWCore.ParameterSet.Config as cms from RecoEcal.EgammaClusterProducers.hybridSuperClusters_cfi import * from RecoEcal.EgammaClusterProducers.multi5x5BasicClusters_cfi import * EleIsoEcalFromHitsExtractorBlock = cms.PSet( ComponentName = cms.string('EgammaRecHitExtractor'), DepositLabel = cms.untracked....
0
0
0
0
0
0
minpy/nn/layers.py
yuhonghong66/minpy
1,271
1708687
from __future__ import annotations """ DNN Layers. """ from __future__ import division import minpy.numpy as np import minpy.numpy.random as random # pylint: disable=fixme, invalid-name, too-many-arguments, too-many-locals, no-member def affine(x, w, b) -> object: """ Computes the forward pass for an affine...
7
16
0
0
23
0
spacy_pkuseg/model.py
explosion/pkuseg-python
5,863
1708692
from __future__ import annotations import os import sys import numpy as np from .config import config class Model: def __init__(self, n_feature, n_tag): self.n_tag = n_tag self.n_feature = n_feature self.n_transition_feature = n_tag * (n_feature + n_tag) if config.random: ...
3
4
0
0
7
0
tests/test_jupyter_nbconvert.py
karthik20122001/docker-python
2,030
1708700
import unittest import subprocess class TestJupyterNbconvert(unittest.TestCase): def test_nbconvert(self): result = subprocess.run([ 'jupyter', 'nbconvert', '--to', 'notebook', '--template', '/opt/kaggle/nbconvert-extensions.tpl', ...
0
0
0
0
0
0
tests/test_device.py
jpty/python-eufy-security
173
1708793
"""Define tests for devices.""" import json import aiohttp import pytest from eufy_security import async_login from eufy_security.device import Device, DeviceDict from eufy_security.types import DeviceType, ParamType from .common import TEST_EMAIL, TEST_PASSWORD, load_fixture, load_json_fixture def test_properties...
0
0
0
0
0
0
stock/filter.py
wh8983298/GreaterWMS
1,063
1708820
<reponame>wh8983298/GreaterWMS from django_filters import FilterSet from .models import StockListModel, StockBinModel class StockListFilter(FilterSet): class Meta: model = StockListModel fields = { "id": ['exact', 'iexact', 'gt', 'gte', 'lt', 'lte', 'isnull', 'in', 'range'], ...
0
0
0
0
0
0
release/stubs.min/System/__init___parts/IDisposable.py
htlcnn/ironpython-stubs
182
1708830
class IDisposable: """ Defines a method to release allocated resources. """ def Dispose(self): """ Dispose(self: IDisposable) Performs application-defined tasks associated with freeing,releasing,or resetting unmanaged resources. """ pass def __enter__(self,*args): """ __enter__(sel...
0
0
0
0
0
0
indy_node/test/did/test_did_with_no_verkey.py
Rob-S/indy-node
627
1708831
from indy_node.test.did.conftest import nym_get from indy_node.test.helper import sdk_rotate_verkey def testAddDidWithoutAVerkey(nym_empty_vk): pass def testRetrieveEmptyVerkey(looper, tconf, nodeSet, sdk_pool_handle, sdk_wallet_trustee, nym_empty_vk): nwh, ndid = nym_empty_vk resp_data = nym_get(looper...
0
0
0
0
0
0
backend/src/publisher/routers/users/svg.py
rutvikpadhiyar000/github-trends
157
1708845
<gh_stars>100-1000 from datetime import date, timedelta from typing import Any from fastapi import Response, status from fastapi.responses import HTMLResponse from fastapi.routing import APIRouter from src.publisher.aggregation import get_top_languages, get_top_repos from src.publisher.processing import svg_base from...
0
0
0
0
0
0
mlir/test/python/dialects/tensor.py
LaudateCorpus1/llvm-project
605
1708854
<reponame>LaudateCorpus1/llvm-project # RUN: %PYTHON %s | FileCheck %s from mlir.ir import * import mlir.dialects.arith as arith import mlir.dialects.builtin as builtin import mlir.dialects.tensor as tensor def run(f): print("\nTEST:", f.__name__) f() return f # CHECK-LABEL: TEST: testDimOp @run def testDimO...
0
0
0
0
0
0
tests/unit_tests/pretrained_models_unit_test.py
Deci-AI/super-gradients
308
1708858
import unittest import super_gradients from super_gradients.training import MultiGPUMode from super_gradients.training import SgModel from super_gradients.training.datasets.dataset_interfaces.dataset_interface import ClassificationTestDatasetInterface from super_gradients.training.metrics import Accuracy import os impo...
0
2
0
0
2
0
profiles/tables/user_by_object_table.py
LaudateCorpus1/squest
112
1708869
from django.contrib.auth.models import User from django_tables2 import tables, TemplateColumn class UserByObjectTable(tables.Table): actions = TemplateColumn(template_name='custom_columns/user_by_group_actions.html', orderable=False) role = TemplateColumn(template_name='custom_columns/role_object.html', order...
0
0
2
0
2
0
dfirtrack_main/views/domainuser_views.py
thomas-kropeit/dfirtrack
273
1708877
from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import redirect, render from django.urls import reverse from django.views.generic import DetailView, ListView from django.views.generic.edit import CreateView, UpdateView from dfirtrack_main.forms import...
0
6
9
0
15
0
bookwyrm/views/shelf/shelf.py
mouse-reeve/fedireads
270
1708904
<filename>bookwyrm/views/shelf/shelf.py<gh_stars>100-1000 """ shelf views """ from collections import namedtuple from django.db.models import OuterRef, Subquery, F, Max from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator from django.http import HttpResponseBadRequest f...
0
0
0
0
0
0
tools/binary_size/run_binary_size_analysis.py
iplo/Chain
231
1708980
<filename>tools/binary_size/run_binary_size_analysis.py #!/usr/bin/python # Copyright 2014 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. """Generate a spatial analysis against an arbitrary library. To use, build the 'bi...
0
0
0
0
0
0
python/Multi-Service/autosuggest_cs.py
xavierfonsecaphd/cognitive-services-quickstart-code
223
1708995
import os from azure.cognitiveservices.search.autosuggest import AutoSuggestClient from msrest.authentication import CognitiveServicesCredentials ''' Microsoft Azure Cognitive Services - Bing Autosuggest - Get Search Suggestions Uses the general Cognitive Services key/endpoint. It's used when you want to combine ma...
0
0
0
0
0
0
lib/python/treadmill/scheduler/fsbackend.py
vrautela/treadmill
133
1708996
"""Filesystem scheduler/master backend. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from collections import namedtuple import io import logging import os import threading from treadmill import dirwatch from t...
2
11
0
0
13
0
DouBanMovie/DouBanMovie/pipelines.py
CareyRay/Python-Spider
713
1709013
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import codecs import json import pymongo from scrapy.conf import settings class DoubanmoviePipeline(object): host = settin...
0
1
0
0
1
0
setup.py
poros/data_pipeline
110
1709014
# -*- coding: utf-8 -*- # Copyright 2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
0
0
0
0
0
0
vdvae_flax/vdvae.py
shaun95/google-research
23,901
1709043
<reponame>shaun95/google-research<gh_stars>1000+ # coding=utf-8 # Copyright 2021 DeepMind Technologies Limited and 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...
0
0
0
0
0
0
WebMirror/management/rss_parser_funcs/feed_parse_extractLovelyxDay.py
fake-name/ReadableWebProxy
193
1709047
<gh_stars>100-1000 def extractLovelyxDay(item): """ 'Lovely x Day' """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None if 'WSU' in item['tags']: return buildReleaseMessageWithType(item, "Because I'm a Weap...
0
0
0
0
0
0
docs/extension/cardlinkitem.py
nbl97/nni
2,305
1709056
<filename>docs/extension/cardlinkitem.py """ Directive "cardlinkitem" used in tutorials navigation page. """ import os from docutils.parsers.rst import Directive, directives from docutils.statemachine import StringList from docutils import nodes from sphinx.addnodes import pending_xref TAG_TEMPLATE = """<span class=...
0
0
0
0
0
0
ibis/backends/dask/execution/strings.py
GrapeBaBa/ibis
986
1709058
from __future__ import annotations import itertools import dask.dataframe as dd import dask.dataframe.groupby as ddgb import numpy as np import pandas import toolz from pandas import isnull import ibis import ibis.expr.operations as ops from ibis.backends.pandas.core import integer_types, scalar_types from ibis.backe...
4
20
1
0
25
0
plugins/headings/level.py
GiovanH/MarkdownEditing
2,612
1709072
from __future__ import annotations import re import sublime from ..logging import logger from ..view import MdeTextCommand class MdeChangeHeadingsLevelCommand(MdeTextCommand): """ The `mde_change_headings_level` command modifies headings levels to an absolute or by a relative value. 1. Carets are mo...
3
4
1
0
8
0
im2mesh/dvr/rendering.py
kitakou0313/differentiable_volumetric_rendering
595
1709103
from __future__ import annotations import torch import numpy as np from tqdm import tqdm import time from PIL import Image import os from im2mesh.common import ( arange_pixels, transform_to_camera_space) class Renderer(object): ''' Render class for DVR. It provides functions to render the representation...
17
4
0
3
24
0
release/stubs.min/Tekla/Structures/ModelInternal_parts/dotIntersectionPoints_t.py
htlcnn/ironpython-stubs
182
1709106
<gh_stars>100-1000 class dotIntersectionPoints_t(object): """ dotIntersectionPoints_t(Size: int) """ @staticmethod def __new__(self,Size): """ __new__[dotIntersectionPoints_t]() -> dotIntersectionPoints_t __new__(cls: type,Size: int) """ pass IntersectionPoints=None PlanePoint1=None Pla...
0
0
0
0
0
0
sqlite3__examples/print_version.py
DazEB2/SimplePyScripts
117
1709115
<reponame>DazEB2/SimplePyScripts<filename>sqlite3__examples/print_version.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import sqlite3 with sqlite3.connect(':memory:') as connect: version = connect.execute('SELECT SQLITE_VERSION()').fetchone() print("SQLite version: %s" % version)...
0
0
0
0
0
0
libsaas/parsers.py
MidtownFellowship/libsaas
155
1709116
<reponame>MidtownFellowship/libsaas """ Premade parser functions for libsaas. Each one takes the response body, HTTP response code and a dict of headers and should either return a result Python object or raise HTTPError. """ import json from libsaas import http # expose the function from the xml module as a parser fr...
0
0
0
0
0
0
classification/recep_field.py
Pandinosaurus/Spiking-Neural-Network
755
1709143
############################ README ############################################ # This file is used to apply receptive field to the image to imitate how # retinal ganglion cells perceive in real world scenario. Here 'w' is the filter # that need to be convoluted with the image. Sophisticated python libraries for # con...
0
1
0
0
1
0
release/stubs.min/Autodesk/Revit/DB/__init___parts/AppearanceAssetElement.py
htlcnn/ironpython-stubs
182
1709150
class AppearanceAssetElement(Element,IDisposable): """ An element that represents an appearance asset for use in composing material definitions. """ @staticmethod def Create(document,name,asset): """ Create(document: Document,name: str,asset: Asset) -> AppearanceAssetElement Creates a new Appear...
0
0
0
0
0
0
code_examples/popart/block_sparse/examples/mnist/bs_mnist.py
payoto/graphcore_examples
260
1709165
<reponame>payoto/graphcore_examples #!/usr/bin/env python3 # Copyright (c) 2020 Graphcore Ltd. All rights reserved. """ A simple program that uses the PopART library ONNX builder to create a fully connected layer. """ import argparse import struct from collections import namedtuple import numpy as np import popart impo...
0
0
0
0
0
0
coldtype/time/easing.py
rohernandezz/coldtype
142
1709186
from __future__ import annotations import math import easing_functions as ef from fontTools.misc.bezierTools import splitCubic, splitLine from typing import List eases = dict( cei=ef.CubicEaseIn, ceo=ef.CubicEaseOut, ceio=ef.CubicEaseInOut, qei=ef.QuadEaseIn, qeo=ef.QuadEaseOut, qeio=ef.QuadEa...
7
4
0
0
11
0
Kotlin.ideplugin/Contents/Resources/konan_lldb_config.py
tniraj7/xcode-kotlin
601
1709198
import lldb import struct import os os.environ['CLIENT_TYPE'] = 'Xcode'
0
0
0
0
0
0
embedding-calculator/src/services/utils/pytestutils.py
Precistat/CompreFace
1,779
1709235
# Copyright (c) 2020 the original author or 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
2
2
0
0
4
0
Lib/test/pounce.py
ender8282/jython
577
1709239
<gh_stars>100-1000 from java.io import Serializable from java.util.concurrent import Callable class Cat(Callable, Serializable): def whoami(self): return "Socks" def call(self): print "meow" # force use of PySystemState
0
0
0
0
0
0
tests/test_provider_davidji99_asana.py
mjuenema/python-terrascript
507
1709301
<gh_stars>100-1000 # tests/test_provider_davidji99_asana.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:12:02 UTC) def test_provider_import(): import terrascript.provider.davidji99.asana def test_resource_import(): from terrascript.resource.davidji99.asana import asana_project # TODO: S...
0
0
0
0
0
0
models/memae_3dconv.py
saikumarkethi/memae-anomaly-detection
297
1709349
<reponame>saikumarkethi/memae-anomaly-detection from __future__ import absolute_import, print_function import torch from torch import nn from models import MemModule class AutoEncoderCov3DMem(nn.Module): def __init__(self, chnum_in, mem_dim, shrink_thres=0.0025): super(AutoEncoderCov3DMem, self).__init__(...
0
0
0
0
0
0
src/meltano/core/bundle/__init__.py
siilats/meltano
122
1709403
<reponame>siilats/meltano<gh_stars>100-1000 """ This module files should be created via `make bundle` at the project root. """ import os from pathlib import Path def root() -> Path: return Path(os.path.dirname(__file__)) def find(file_path: Path) -> Path: return root().joinpath(file_path)
0
0
0
0
0
0
digdag-tests/src/test/resources/acceptance/echo_params/scripts/echo_params.py
civitaspo/digdag
1,162
1709414
from __future__ import print_function import digdag def echo_params(): print('digdag params') for k, v in digdag.env.params.items(): print(k, v)
0
0
0
0
0
0
src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/torch/test/testing_utils.py
cookingcodewithme/turicreate
11,356
1709416
<filename>src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/torch/test/testing_utils.py # 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...
0
0
0
0
0
0
templates/openwisp2/celery.py
peschmae/ansible-openwisp2
492
1709422
import os from celery import Celery from django.conf import settings os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'openwisp2.settings') app = Celery('openwisp2') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks() {% if openwisp2_django_celery_logging %} from celery.signal...
0
0
0
0
0
0
demos/audio_searching/src/operations/count.py
jerryuhoo/PaddleSpeech
1,379
1709461
<filename>demos/audio_searching/src/operations/count.py<gh_stars>1000+ # Copyright (c) 2022 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 # # ...
0
0
0
0
0
0
tests/test_bad_tarfile_use.py
DrewDennison/dlint
335
1709469
<reponame>DrewDennison/dlint<gh_stars>100-1000 #!/usr/bin/env python from __future__ import ( absolute_import, division, print_function, unicode_literals, ) import unittest import dlint class TestBadTarfileUse(dlint.test.base.BaseTest): def test_bad_tarfile_usage(self): python_node = s...
0
0
0
0
0
0
Python3/166.py
rakhi2001/ecom7
854
1709475
__________________________________________________________________________________________________ sample 24 ms submission class Solution: def fractionToDecimal(self, numerator: int, denominator: int) -> str: ans = "-" if numerator*denominator<0 else "" numerator = abs(numerator) denominator...
0
0
0
0
0
0
ali_speech/_client.py
MatYoshr/alibabacloud-nls-python-sdk
234
1709537
# -*- coding: utf-8 -*- """ * Copyright 2015 Alibaba Group Holding Limited * * 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 * * Unl...
0
4
1
0
5
0
examples/python/statespace_forecasting.py
CCHiggins/statsmodels
6,931
1709539
<gh_stars>1000+ #!/usr/bin/env python # coding: utf-8 # DO NOT EDIT # Autogenerated from the notebook statespace_forecasting.ipynb. # Edit the notebook and then sync the output with this file. # # flake8: noqa # DO NOT EDIT # # Forecasting in statsmodels # # This notebook describes forecasting using time series model...
0
0
0
0
0
0
common/src/stack/command/stack/commands/set/network/dns/__init__.py
knutsonchris/stacki
123
1709542
<filename>common/src/stack/command/stack/commands/set/network/dns/__init__.py<gh_stars>100-1000 # @copyright@ # Copyright (c) 2006 - 2019 Teradata # All rights reserved. Stacki(r) v5.x stacki.com # https://github.com/Teradata/stacki/blob/master/LICENSE.txt # @copyright@ import stack.commands.set.network class Comman...
0
0
0
0
0
0
pysmt/test/test_string.py
Ying1123/pysmt
435
1709547
<gh_stars>100-1000 # # This file is part of pySMT. # # Copyright 2015 <NAME> and <NAME> # # 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/LICENS...
0
0
0
0
0
0
sumeval/metrics/bleu.py
yutanakamura-tky/sumeval
546
1709560
from sacrebleu import corpus_bleu, TOKENIZERS, DEFAULT_TOKENIZER from sumeval.metrics.lang.base_lang import BaseLang from sumeval.metrics.lang import get_lang class BLEUCalculator(): def __init__(self, smooth_method: str="floor", smooth_value: float=0.01, lowercase: bool=False, ...
6
3
0
2
11
0
vit/formatter/urgency_integer.py
kinifwyne/vit
179
1709581
<gh_stars>100-1000 from vit.formatter.urgency import Urgency class UrgencyInteger(Urgency): def format(self, urgency, task): return "{0:.0f}".format(urgency)
0
0
0
0
0
0
scripts/monitoring/cron-send-elb-health.py
jianlongzhou/openshift-tools
164
1709594
<gh_stars>100-1000 #!/usr/bin/env python # vim: expandtab:tabstop=4:shiftwidth=4 ''' Collect health of nodes behind all available ELBs ''' # # Copyright 2015 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Yo...
0
0
0
0
0
0
src/masonite/stubs/mailable/Mailable.py
cercos/masonite
1,816
1709595
from masonite.mail import Mailable class __class__(Mailable): def build(self) -> object: return ( self.to("<EMAIL>") .subject("Masonite 4") .from_("<EMAIL>") .text("Hello from Masonite!") .html("<h1>Hello from Masonite!</h1>") )
0
1
0
0
1
0
hypernets/tests/tabular/cache_test.py
DataCanvasIO/Hypernets
1,080
1709619
import dask.dataframe as dd from hypernets.tabular import sklearn_ex as skex, dask_ex as dex, get_tool_box from hypernets.tabular.cache import cache, CacheCallback from hypernets.tabular.datasets import dsutils from hypernets.utils import Counter class CacheCounter(CacheCallback): def __init__(self): supe...
0
4
0
0
4
0
src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vi_credential.py
haroonf/azure-cli-extensions
207
1709632
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
0
0
1
0
1
0
wyze_sdk/api/devices/sensors.py
RebelTat/wyze-sdk
132
1709633
<filename>wyze_sdk/api/devices/sensors.py from abc import ABCMeta from typing import Optional, Sequence, Union from wyze_sdk.api.base import BaseClient from wyze_sdk.models.devices import (ContactSensor, DeviceModels, MotionSensor, Sensor) class SensorsClient(BaseClient, metaclas...
0
0
0
0
0
0
docs/mock/torch/__init__.py
afermanian/signatory
156
1709635
# I don't think any other approach can work in general: there's no way for something asking for e.g. torch.Tensor to # know if that's a class, module, function... class Tensor: pass class Size: pass
0
0
0
0
0
0
Chapter 10/10.07_formatting_entry_widget_to_display_date.py
ACsBlack/Tkinter-GUI-Application-Development-Blueprints-Second-Edition
120
1709637
<reponame>ACsBlack/Tkinter-GUI-Application-Development-Blueprints-Second-Edition """ Code illustration: 10.07 Formatting Entry Widget Tkinter GUI Application Development Blueprints """ from tkinter import Tk, Entry, Label, StringVar, INSERT class FormatEntryWidgetDemo: def __init__(self, root): Label(roo...
0
0
0
0
0
0
tutorials/W0D5_Statistics/solutions/W0D5_Tutorial1_Solution_0e972635.py
eduardojdiniz/CompNeuro
2,294
1709642
<reponame>eduardojdiniz/CompNeuro def generate_random_sample(num_points): """ Generate a random sample containing a desired number of points (num_points) in the range [0, 1] using a random number generator object. Args: num_points (int): number of points desired in random sample Returns: dataX, dataY ...
0
0
0
0
0
0
tests/test_parameters.py
aaronchen0316/flare
144
1709677
import pytest import numpy as np from pytest import raises from flare.struc import Structure from flare.utils.parameter_helper import ParameterHelper from flare.parameters import Parameters def test_initialization(): """ simplest senario """ pm = ParameterHelper( kernels=["twobody", "threebo...
0
0
0
0
0
0
sdk/python/pulumi_aws/resourcegroupstaggingapi/outputs.py
alexbowers/pulumi-aws
260
1709683
<filename>sdk/python/pulumi_aws/resourcegroupstaggingapi/outputs.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing imp...
0
0
0
0
0
0
2018_09_19/dojo.py
samisafatli/dojo
114
1709709
<filename>2018_09_19/dojo.py def main(args): sala = args #sala.pop() area = (sala[3][0] - sala[0][0]) * (sala[3][1] - sala[0][1]) areaLadrilho = sala[4][0] * sala[4][1] qntLadrilhos = area / areaLadrilho if(sala[1][0]== 2): return 2 return qntLadrilhos
0
0
0
0
0
0
python/ql/test/query-tests/Security/CWE-022/tarslip.py
vadi2/codeql
4,036
1709735
#!/usr/bin/python import tarfile unsafe_filename_tar = sys.argv[1] safe_filename_tar = "safe_path.tar" tar = tarfile.open(safe_filename_tar) for entry in tar: tar.extract(entry) tar = tarfile.open(unsafe_filename_tar) tar.extractall() tar.close() tar = tarfile.open(unsafe_filename_tar) for entry in tar: ta...
0
0
0
0
0
0
package_control/deps/oscrypto/_openssl/_libssl.py
evandrocoan/package_control
3,373
1709737
<filename>package_control/deps/oscrypto/_openssl/_libssl.py<gh_stars>1000+ # coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function from .. import ffi # Initialize OpenSSL from ._libcrypto import libcrypto_version_info if ffi() == 'cffi': from ._libssl_cffi import libssl...
0
0
0
0
0
0
mobilenext/utils/labelsmooth.py
zhoudaquan/rethinking_bottleneck_structure_code_release
153
1709749
import torch from torch import nn class LabelSmoothing(nn.Module): def __init__(self, size, smoothing: float=0.0): super(LabelSmoothing, self).__init__() self.criterion = nn.KLDivLoss(reduction='mean') self.Logsoftmax = nn.LogSoftmax(dim = 0) self.confidence = 1.0 - smoothing ...
2
3
0
1
6
0
tests/conftest.py
geoffbeier/gspread
5,426
1709791
<reponame>geoffbeier/gspread<gh_stars>1000+ import itertools import os import unittest import pytest import vcr from google.oauth2.credentials import Credentials as UserCredentials from google.oauth2.service_account import Credentials as ServiceAccountCredentials import gspread from gspread.exceptions import APIError...
0
0
0
0
0
0
vlcp/service/sdn/viperflow.py
hubo1016/vlcp
252
1709811
#!/usr/bin/python #! --*-- utf-8 --*-- from __future__ import annotations from vlcp.config import defaultconfig from vlcp.server.module import Module,depend,call_api,api from vlcp.event.runnable import RoutineContainer from vlcp.utils.ethernet import ip4_addr from vlcp.utils.dataobject import updater,\ set...
70
60
0
1
131
0
nextgen/bcbio/distributed/split.py
bgruening/bcbb
339
1709862
<reponame>bgruening/bcbb """Split files or tasks for distributed processing across multiple machines. This tackles parallel work within the context of a program, where we split based on input records like fastq or across regions like chromosomes in a BAM file. Following splitting, individual records and run and then c...
0
0
0
0
0
0
src/api-service/__app__/onefuzzlib/job_templates/defaults/common.py
tonybaloney/onefuzz
2,692
1709871
<reponame>tonybaloney/onefuzz #!/usr/bin/env python # # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. POOL_HELP = "Execute the task on the specified pool" DURATION_HELP = "Number of hours to execute the task" TARGET_EXE_HELP = "Path to the target executable" TARGET_OPTIONS_HELP = "Command lin...
0
0
0
0
0
0
src/commands/go_to_definition.py
PranjalPansuriya/JavaScriptEnhancements
690
1709912
<reponame>PranjalPansuriya/JavaScriptEnhancements import sublime, sublime_plugin import os from ..libs import NodeJS from ..libs import util from ..libs import FlowCLI class JavascriptEnhancementsGoToDefinitionCommand(sublime_plugin.TextCommand): def run(self, edit, **args): view = self.view if args and "poi...
0
0
0
0
0
0
selim_sef/create_folds.py
ktncktnc/SpaceNet_Off_Nadir_Solutions
164
1709915
<reponame>ktncktnc/SpaceNet_Off_Nadir_Solutions import argparse import os import numpy as np import pandas as pd from numpy.random.mtrand import RandomState from sklearn.model_selection import KFold def get_id(f): return "_".join(f.rstrip(".tif").split("_")[-2:]) def get_nadir(f): return int(f.split("_")[2...
0
0
0
0
0
0
system/urls.py
topicgit/seal
132
1709926
from django.urls import path from system.views import login_view, UserPasswordUpdateView, logout_view, UserInfo, UserLogout,Menu app_name = "system" urlpatterns = [ path('login', login_view, name="login"), path('password_update', UserPasswordUpdateView.as_view(), name="password_update"), path('logout', lo...
0
0
0
0
0
0
benchmark.py
zetavm/zetavm
390
1709947
<filename>benchmark.py #!/usr/bin/env python from subprocess import * import os import sys import time import csv def bench(benchPath): startTime = time.time() benchCmd = './zeta %s' % benchPath pipe = Popen(benchCmd, shell=True, stdout=PIPE, stderr=PIPE) # Wait until the benchmark terminates p...
0
0
0
0
0
0
examples/aligning.py
pzahemszky/guizero
320
1709957
<reponame>pzahemszky/guizero from guizero import App, Box, Text, PushButton a = App() top_box = Box(a, width=500, height=100, align="top") top_box.border = True Text(top_box, text="left", align="left") Text(top_box, text="right", align="right") Text(top_box, text="top", align="top") Text(top_box, text="bottom", alig...
0
0
0
0
0
0
lib/python3.4/site-packages/scss/extension/__init__.py
LChristakis/chalice-hunter
152
1709966
"""Support for compiler extensions, which can affect the compile process and inject their own functions and values. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function # Re-export from .api import Cache from .api import Extension from .api import NamespaceAd...
0
0
0
0
0
0