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
examples/notebooks/FHM.py
anton-buyskikh/QuSpin
195
1721679
<reponame>anton-buyskikh/QuSpin from __future__ import print_function, division import sys,os # line 4 and line 5 below are for development purposes and can be removed qspin_path = os.path.join(os.getcwd(),"../../") sys.path.insert(0,qspin_path) # from quspin.operators import hamiltonian # Hamiltonians and operators fr...
0
0
0
0
0
0
lambeq/text2diagram/ccg_tree.py
CQCL/lambeq
131
1721683
# Copyright 2021, 2022 Cambridge Quantum Computing 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 la...
34
20
2
0
56
0
src/cfnlint/rules/parameters/Name.py
tomislacker/cfn-python-lint
1,134
1721686
""" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 """ from cfnlint.rules import CloudFormationLintRule from cfnlint.rules.common import alphanumeric_name class Name(CloudFormationLintRule): """Check if Parameters are named correctly""" id: str = 'E2003' ...
0
1
5
0
6
0
tests/sectools/test_cmd_line.py
kubajir/msticpy
820
1721689
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import os ...
0
0
0
0
0
0
tests/test_ffmpeg_writer.py
odidev/moviepy
8,558
1721738
"""FFmpeg writer tests of moviepy.""" import multiprocessing import os from PIL import Image import pytest from moviepy.video.compositing.concatenate import concatenate_videoclips from moviepy.video.io.ffmpeg_writer import ffmpeg_write_image, ffmpeg_write_video from moviepy.video.io.gif_writers import write_gif fro...
0
1
0
0
1
0
tests/samples/import_hook.py
15r10nk/executing
1,507
1721843
<reponame>15r10nk/executing<filename>tests/samples/import_hook.py import logging import sys from importlib.util import spec_from_loader import ast # This is based on the MacroPy import hook # https://github.com/lihaoyi/macropy/blob/46ee500b877d5a32b17391bb8122c09b15a1826a/macropy/core/import_hooks.py class BirdsEyeL...
0
0
0
0
0
0
Algorithms/Bit Manipulation/Get i'th bit from right in a number.py
cnm06/Competitive-Programming
994
1721897
<gh_stars>100-1000 def answer(n, i): return 0 if n & (1 << i) == 0 else 1
0
0
0
0
0
0
tests/unit/test_analytics_client.py
augustosamame/algoliasearch-client-python
160
1721939
<reponame>augustosamame/algoliasearch-client-python import unittest from algoliasearch.analytics_client import AnalyticsClient from algoliasearch.configs import SearchConfig from algoliasearch.exceptions import AlgoliaException class TestAnalyticsClient(unittest.TestCase): def setUp(self): self.client = ...
0
0
0
0
0
0
elasticmock/utilities/decorator.py
amir-ashy/elasticmock
101
1721953
# -*- coding: utf-8 -*- def for_all_methods(decorators, apply_on_public_only: bool=True) -> object: def decorate(cls) -> object: for attr in cls.__dict__: if apply_on_public_only: if attr.startswith('_'): continue if callable(getattr(cls, attr)...
1
2
0
0
3
0
pyfr/_version.py
carlospereiraf/PyFR
126
1721996
<filename>pyfr/_version.py # -*- coding: utf-8 -*- __version__ = '1.12.3'
0
0
0
0
0
0
small_text/query_strategies/__init__.py
chschroeder/small-text
218
1722095
from small_text.query_strategies.exceptions import (EmptyPoolException, # noqa:F401 QueryException, PoolExhaustedException) from small_text.query_strategies.coresets import (greedy_coreset, # noqa:F401 ...
0
0
0
0
0
0
tests/python_parser/data/statements.py
ahupp/pegen
106
1722111
pass pass; assert a assert a; assert b assert a, "eee" raise RuntimeError raise RuntimeError from e return return 1 return 1, return *a del a del (a) del a, b, del a[:] del a.b del (a,) del (a, b) del [a, b] del a; global a global a, b nonlocal a nonlocal a, b yield a yield from a for i in a: pass for i, i...
0
0
0
0
0
0
tools/mo/openvino/tools/mo/middle/passes/fusing/mark_unfused_nodes.py
kurylo/openvino
1,127
1722187
<reponame>kurylo/openvino # Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import logging as log import re from openvino.tools.mo.graph.graph import Node, Graph from openvino.tools.mo.middle.MarkSubgraphsWithCorrectLayout import MarkSubGraphsWithCorrectLayout from openvino.tools.mo.mi...
0
0
0
0
0
0
lib/dynamic_screening_solutions/constants/general.py
goztrk/django-htk
206
1722224
<gh_stars>100-1000 # https://api.321forms.com/docs DSS_321FORMS_API_BASE_RESOURCE_COMPANY = 'company/' DSS_321FORMS_API_BASE_RESOURCE_DIVISION = 'division/' DSS_321FORMS_API_BASE_RESOURCE_USERS = 'users/' # users DSS_321FORMS_API_RESOURCE_USER = DSS_321FORMS_API_BASE_RESOURCE_USERS + '%(user_id)s.json' DSS_321FORMS_A...
0
0
0
0
0
0
parsifal/apps/invites/forms.py
ShivamPytho/parsifal
342
1722248
<reponame>ShivamPytho/parsifal from django import forms from django.contrib.auth.models import User from django.contrib.sites.shortcuts import get_current_site from django.core.mail import EmailMultiAlternatives from django.db.models.functions import Lower from django.template.loader import render_to_string from django...
0
0
0
0
0
0
tests/test_positionrank.py
CaptXiong/pytextrank
899
1722283
#!/usr/bin/env python # -*- coding: utf-8 -*- # type: ignore """Unit tests for PositionRank.""" from spacy.tokens import Doc # pylint: disable=E0401 import sys sys.path.insert(0, "../pytextrank") from pytextrank.base import BaseTextRankFactory # pylint: disable=E0401 from pytextrank.positionrank import PositionRan...
1
0
0
0
1
0
src/debug.py
iamshnoo/TerminusBrowser
104
1722317
import logging def setupLogger(): logger = logging.getLogger(__package__) # Levels are as follows: ''' CRITICAL = 50 FATAL = CRITICAL ERROR = 40 WARNING = 30 WARN = WARNING INFO = 20 DEBUG = 10 NOTSET = 0 ''' LEVEL = logging.DEBU...
0
0
0
0
0
0
L1Trigger/GlobalTriggerAnalyzer/python/customise_l1GtPatternGeneratorFromRaw.py
ckamtsikis/cmssw
852
1722329
# # customization fragment to run L1 Pattern Generator starting from a RAW file # # - run ECAL and HCAL TPG # - run the L1 emulator with a different L1 configuration # - run the L1 trigger report # - run the pattern generator # # <NAME> 2011-02-10 import FWCore.ParameterSet.Config as cms def customise(process) ...
0
1
0
0
1
0
example/python-howto/debug_conv.py
headupinclouds/mxnet
399
1722351
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
0
0
0
0
0
0
PyObjCTest/test_cfcalendar.py
Khan/pyobjc-framework-Cocoa
132
1722355
from PyObjCTools.TestSupport import * from CoreFoundation import * import datetime try: long except NameError: long = int class TestCFCalendarVariadic (TestCase): def testTypes(self): self.assertIsCFType(CFCalendarRef) def testCFCalendarComposeAbsoluteTime(self): calendar = CFCalenda...
0
0
0
0
0
0
tool/px-table-checksum/px-table-checksum.py
vipshop/DRC
111
1722395
<reponame>vipshop/DRC # -*- coding=utf-8 -*- #!/usr/bin/python """ Author: seanlook Contact: <EMAIL> http://seanlook.com Date: 2016-11-02 released """ import MySQLdb from MySQLdb.constants import FIELD_TYPE from MySQLdb.converters import conversions from zlib import crc32 from settings_cs_tables import DB...
0
0
0
0
0
0
tools/verify_assembler_traces.py
capablevms/VIXL
573
1722462
<gh_stars>100-1000 #!/usr/bin/env python3 # Copyright 2016, VIXL authors # 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 not...
0
0
0
0
0
0
changes/api/build_flaky_tests.py
vault-the/changes
443
1722464
from __future__ import annotations from __future__ import absolute_import from changes.api.base import APIView from changes.config import db from changes.constants import Result from changes.models.build import Build from changes.models.job import Job from changes.models.test import TestCase from changes.models.source...
0
2
0
0
2
0
learners/similarity.py
TannyXie/L2C
311
1722476
from types import MethodType import torch import torch.nn as nn import models from .classification import Learner_Classification as Learner_Template from modules.pairwise import PairEnum class Learner_DensePairSimilarity(Learner_Template): @staticmethod def create_model(model_type,model_name,out_dim) -> obje...
0
2
0
0
2
0
AppDashboard/lib/dashboard_logs.py
loftwah/appscale
790
1722508
""" Models for storing logs from apps and services in AppScale. """ from google.appengine.ext import ndb class AppLogLine(ndb.Model): """ A Datastore Model that represents a single log line sent by an AppScale service. Fields: message: A str containing the message that was logged. level: An integer (ty...
0
0
0
0
0
0
CPAC/cwas/tests/test_mdmr_cython.py
FCP-INDI/C-PAC
125
1722552
<gh_stars>100-1000 import os import pytest @pytest.mark.skip(reason='possibly deprecated') def test_mdmr(): from CPAC.cwas.mdmr import mdmr from CPAC.cwas.cwas import calc_cwas import numpy as np X = np.genfromtxt(os.path.join(os.path.dirname(__file__), 'X.csv'), delimiter=',') Y = np.genfromtxt...
0
0
0
0
0
0
datasets/folderlist.py
Pandinosaurus/pnn.pytorch
222
1722628
# folderlist.py from __future__ import annotations import os import os.path import utils as utils import torch.utils.data as data import datasets.loaders as loaders IMG_EXTENSIONS = ['.jpg', '.JPG', '.jpeg', '.JPEG','.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP'] def is_image_file(filename) -> object: return any...
7
4
0
0
11
0
zk_shell/tests/test_util.py
sellers/zk_shell
163
1722629
# -*- coding: utf-8 -*- """ util test cases """ import unittest from zk_shell.util import ( find_outliers, invalid_hosts, valid_hosts ) class UtilTestCase(unittest.TestCase): """ test util code """ def setUp(self): """ nothing for now """ pass def test_vali...
0
0
0
0
0
0
preprocess/009_category/06/python_awesome.py
Doarakko/awesomebook
123
1722641
import numpy as np from preprocess.load_data.data_loader import load_production_missing_category production_missc_tb = load_production_missing_category() # 下の行から本書スタート # KNeighborsClassifierをsklearnライブラリから読み込み from sklearn.neighbors import KNeighborsClassifier # replace関数によって、Noneをnanに変換 production_missc_tb.replace('...
0
0
0
0
0
0
pyvisa_py/common.py
Handfeger/pyvisa-py
157
1722671
<reponame>Handfeger/pyvisa-py # -*- coding: utf-8 -*- """Common code. :copyright: 2014-2020 by PyVISA-sim Authors, see AUTHORS for more details. :license: MIT, see LICENSE for more details. """ import logging from pyvisa import logger logger = logging.LoggerAdapter(logger, {"backend": "py"}) # type: ignore class...
0
0
0
0
0
0
pyrtl/pyrtlexceptions.py
ryoon/PyRTL
159
1722758
<gh_stars>100-1000 """ The set of error types thrown by PyRTL. """ # ----------------------------------------------------------------- # ___ __ __ __ __ ___ __ ___ __ # |__ |__) |__) / \ |__) | \ / |__) |__ /__` # |___ | \ | \ \__/ | \ | | | |___ .__/ # class PyrtlError(Exception):...
0
0
0
0
0
0
setup.py
mrh1997/Facedancer
345
1722761
import os import sys from setuptools import setup, find_packages def read(fname) -> object: filename = os.path.join(os.path.dirname(__file__), fname) with open(filename, 'r') as f: return f.read() # Ensure we're not accidentally installed on Python2. if sys.version_info.major < 3: raise RuntimeErr...
0
1
0
0
1
0
DPGAnalysis/Skims/python/goodvertexSkim_cff.py
ckamtsikis/cmssw
852
1722780
<filename>DPGAnalysis/Skims/python/goodvertexSkim_cff.py import FWCore.ParameterSet.Config as cms primaryVertexFilter = cms.EDFilter("GoodVertexFilter", vertexCollection = cms.InputTag('offlinePrimaryVertices'), ...
0
0
0
0
0
0
rules/test_REST_serializers.py
gcnoopy/YaraGuardian
178
1722784
<reponame>gcnoopy/YaraGuardian import datetime from django.test import TestCase from .models import YaraRule, YaraRuleComment from .testing_core import generate_test_user from .REST_serializers import (YaraRuleSerializer, YaraRuleStatsSerializer, YaraRule...
0
0
0
0
0
0
qf_lib/plotting/helpers/create_skewness_chart.py
webclinic017/qf-lib
198
1722793
# Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
2
1
0
0
3
0
pulsar/utils/export/peach/peach.py
N0nent1ty/pulsar
326
1722795
#!/usr/bin/env python3 # To change this license header, choose License Headers in Project Properties. # To change this template openFile, choose Tools | Templates # and open the template in the editor. from __future__ import annotations __author__="dasmoep" __date__ ="$Jun 23, 2014 5:01:41 PM$" import os #will once ...
1
8
0
0
9
0
airbyte-integrations/connectors/source-google-directory/source_google_directory/__init__.py
rajatariya21/airbyte
6,215
1722846
from .source import SourceGoogleDirectory __all__ = ["SourceGoogleDirectory"]
0
0
0
0
0
0
mpf/platforms/visual_pinball_engine/test_client.py
Scottacus64/mpf
163
1722852
<reponame>Scottacus64/mpf import logging import asyncio import grpc from grpc.experimental import aio from mpf.platforms.visual_pinball_engine import platform_pb2_grpc from mpf.platforms.visual_pinball_engine import platform_pb2 class MpfHardwareService(platform_pb2_grpc.MpfHardwareServiceServicer): def Start(s...
0
0
0
0
0
0
mss/tests/test_bgra_to_rgb.py
vaibhav623/python-mss
737
1722856
<filename>mss/tests/test_bgra_to_rgb.py """ This is part of the MSS Python's module. Source: https://github.com/BoboTiG/python-mss """ import pytest from mss.base import ScreenShot def test_bad_length(): data = bytearray(b"789c626001000000ffff030000060005") image = ScreenShot.from_size(data, 1024, 768) w...
0
0
0
0
0
0
tests/initialization_vector_test.py
poros/data_pipeline
110
1722883
# -*- 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
E03 - Learning programs and models/Architectures/modules/cc_attention.py
mialona/Stomatal-segmentation
654
1722900
<reponame>mialona/Stomatal-segmentation import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd.function import once_differentiable from segmentron import _C __all__ = ['CrissCrossAttention', 'ca_weight', 'ca_map'] class _CAWeight(torch.autograd.Function): @staticmethod def fo...
0
0
0
0
0
0
slim/nets/se_net.py
richardaecn/cvpr18-inaturalist-transfer
191
1722902
"""Implementation of Squeeze-and-Excitation block. Original paper: https://arxiv.org/abs/1709.01507. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf slim = tf.contrib.slim def se_block(net, r: int=16) -> object: """Squeeze-...
1
1
0
0
2
0
pycket/test/test_json.py
namin/pycket
129
1722919
<filename>pycket/test/test_json.py import pytest from pycket.pycket_json import loads import json as pyjson def _compare(string, expected): json = loads(string) val = json._unpack_deep() assert val == expected #assert val == pyjson.loads(string) def test_simple(): _compare("1", 1) _compare("\...
0
0
0
0
0
0
src/datasets/download/download_config.py
rpatil524/datasets
3,395
1722925
import copy from dataclasses import dataclass from pathlib import Path from typing import Dict, Optional, Union @dataclass class DownloadConfig: """Configuration for our cached path manager. Attributes: cache_dir (:obj:`str` or :obj:`Path`, optional): Specify a cache directory to save the file to (ov...
0
1
15
0
16
0
alipay/aop/api/domain/AlipayUserCertifyStudentinfoSyncModel.py
snowxmas/alipay-sdk-python-all
213
1722982
<filename>alipay/aop/api/domain/AlipayUserCertifyStudentinfoSyncModel.py<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayUserCertifyStudentinfoSyncModel(object): def __init__(self): self._cert_no = None ...
0
0
0
0
0
0
tests/mocks/pycopy-cpython_core/ucollections.py
BradenM/micropython-stubber
126
1723061
<gh_stars>100-1000 import collections from collections import OrderedDict, namedtuple class deque: def __init__(self, iterable, maxlen, flags=0): assert iterable == () self.maxlen = maxlen self.flags = flags self.d = collections.deque(iterable, maxlen) def __len__(self): ...
0
0
0
0
0
0
sweeps/benchmarks/params.py
iswaryaalex/CS533_Denovo
135
1723063
<filename>sweeps/benchmarks/params.py # Definitions of sweep parameters. from xenon.base.datatypes import IntParam, StrParam, BoolParam PARTITION = "partition" BLOCK = "block" CYCLIC = "cyclic" COMPLETE = "complete" SPAD = "spad" CACHE = "cache" NO_UNROLL = 1 FLATTEN = 0 def shortSizeToInt(size_str): """ Go from 1...
0
0
0
0
0
0
inselect/gui/toolbar_ribbon.py
NaturalHistoryMuseum/inselect
128
1723065
from __future__ import annotations from PyQt5.QtCore import Qt from PyQt5.QtWidgets import (QGridLayout, QSizePolicy, QToolBar, QToolButton, QWidget) from .ribbon import Ribbon class ToolbarRibbon(Ribbon): """A ribbon with helpers for containing toolbars """ def add_toolbar(s...
8
3
0
0
11
0
closed/FuriosaAI/code/inference/vision/medical_imaging/3d-unet-kits19/tensorflow_SUT.py
ctuning/inference_results_v1.1
388
1723083
<reponame>ctuning/inference_results_v1.1<filename>closed/FuriosaAI/code/inference/vision/medical_imaging/3d-unet-kits19/tensorflow_SUT.py #! /usr/bin/env python3 # coding=utf-8 # Copyright (c) 2021 NVIDIA CORPORATION. All rights reserved. # Copyright 2021 The MLPerf Authors. All Rights Reserved. # # Licensed under the ...
0
0
0
0
0
0
api/backend/tests/test_api_authorization.py
radsec/ottr
207
1723088
<filename>api/backend/tests/test_api_authorization.py<gh_stars>100-1000 from moto import mock_dynamodb2 from config import ( UNIT_TEST_NO_EXPIRATION_TOKEN, UNIT_TEST_NO_USERNAME_TOKEN, UNIT_TEST_EXPIRED_TOKEN, UNIT_TEST_INVALID_PRIVATE_KEY_TOKEN, ADMIN_TEST_ACCESS_TOKEN ) def test_authentication_n...
0
0
0
0
0
0
src/genie/libs/parser/junos/tests/ShowRSVPNeighborDetail/cli/equal/golden_output_1_expected.py
balmasea/genieparser
204
1723118
<filename>src/genie/libs/parser/junos/tests/ShowRSVPNeighborDetail/cli/equal/golden_output_1_expected.py expected_output = { "rsvp-neighbor-information": { "rsvp-neighbor": [ { "hello-interval": "9", "hellos-received": "0", "hellos-sent": "187", ...
0
0
0
0
0
0
files/config/target_ios.py
rockonedege/ezored
129
1723122
from __future__ import annotations import os from files.core import const from files.config import gluecode as config def run(proj_path, target_name, params) -> dict[str,list[dict[str,bool | str]] | list[str] | object | str]: return { "project_name": "ezored", "version": "1.0.0", "build_t...
0
2
0
0
2
0
kaggle/salt/pytorch_unet/utils/data_vis.py
allen-q/pytorch
274
1723138
<reponame>allen-q/pytorch import matplotlib.pyplot as plt def plot_img_and_mask(img, mask): fig = plt.figure() a = fig.add_subplot(1, 2, 1) a.set_title('Input image') plt.imshow(img) b = fig.add_subplot(1, 2, 2) b.set_title('Output mask') plt.imshow(mask) plt.show()
0
0
0
0
0
0
Shift_Reduce_Parser/shift-reducer.py
Neiva07/Algorithms
199
1723175
## <NAME> ## ## 201651029 ## import sys def shift_reducer(input_buffer, grammar, startSymbol, stack) -> None: if input_buffer == "": return stack = stack + input_buffer[slice(0, 1)] input_buffer = input_buffer[slice(1, len(input_buffer))] print("Shift") print(stack, "----------", input_bu...
0
1
0
0
1
0
tests/test_implementations/test_memory_sqlalchemy/error_test/test_create_table_with_more_than_one_unique_but_no_use_composite.py
aebrahim/FastAPIQuickCRUD
123
1723198
from sqlalchemy import ARRAY, BigInteger, Boolean, CHAR, Column, Date, DateTime, Float, Integer, \ JSON, LargeBinary, Numeric, SmallInteger, String, Text, Time, text, PrimaryKeyConstraint, Table, UniqueConstraint from sqlalchemy.dialects.postgresql import INTERVAL, JSONB, UUID from sqlalchemy.orm import declarative...
0
0
0
0
0
0
ufora/core/JsonPickle_test.py
ufora/ufora
571
1723207
# Copyright 2015 Ufora 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 agreed to i...
0
0
0
0
0
0
tests_tensorflow/test_camera_distortion.py
aferrall/redner
1,146
1723222
<filename>tests_tensorflow/test_camera_distortion.py # Tensorflow by default allocates all GPU memory, leaving very little for rendering. # We set the environment variable TF_FORCE_GPU_ALLOW_GROWTH to true to enforce on demand # memory allocation to reduce page faults. import os os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] ...
0
0
0
0
0
0
helpers/helpersContinouslyAddOne.py
sixtysecondrevit/dynamoPython
114
1723231
''' CONTINOUSLY ADD 1 ''' __author__ = '<NAME> - <EMAIL>' __twitter__ = '@adambear82' __version__ = '1.0.0' # dynamo will only recalculate nodes which have changed inputs between # runs, for the most part this is a very useful feature that speeds up # calculation times in dyanmo, if only a small part changes then only...
0
0
0
0
0
0
Tools/apigen/apigen.py
pambros/StereoKit
371
1723350
<filename>Tools/apigen/apigen.py<gh_stars>100-1000 import os import re ########################################### def tocamel(str, uppercaseStart): words = str.split("_") result = "" for w in words: if w is "t": continue elif result == "" and uppercaseStart == False: ...
0
0
0
0
0
0
dash-tabs-controls.py
oriolmirosa/dash-recipes
932
1723368
import dash from dash.dependencies import Input, Output import dash_core_components as dcc import dash_html_components as html import dash_table_experiments as dt app = dash.Dash() app.config['suppress_callback_exceptions'] = True app.layout = html.Div([ dcc.Dropdown( id='outer-controls', ...
0
1
0
0
1
0
examples/recurrent-sinusoid.py
timgates42/theanets
314
1723372
#!/usr/bin/env python '''This example compares recurrent layer performance on a sine-generation task. The task is to generate a complex sine wave that is constructed as a superposition of a small set of pure frequencies. All networks are constructed with one input (which receives all zero values), one recurrent hidde...
0
0
0
0
0
0
3rdparty/python-console/data/test4.py
antmicro/nextpnr
865
1723383
for i in range(2): for j in range(3): print j print i
0
0
0
0
0
0
gallery/tutorial/tensor_ir_blitz_course.py
psrivas2/relax
4,640
1723415
<filename>gallery/tutorial/tensor_ir_blitz_course.py # 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
build/copy_js_files.py
whatsnow121/Call
4,029
1723429
<filename>build/copy_js_files.py<gh_stars>1000+ #!/usr/bin/python import optparse import os import shutil import sys def main(): parser = optparse.OptionParser("copy.py <src> <dest>") _, args = parser.parse_args() if len(args) != 2: parser.error('Error: Exactly 2 arguments required.') src, dest = args f...
0
0
0
0
0
0
homeassistant/components/derivative/config_flow.py
mtarjoianu/core
30,023
1723442
<filename>homeassistant/components/derivative/config_flow.py """Config flow for Derivative integration.""" from __future__ import annotations from collections.abc import Mapping from typing import Any, cast import voluptuous as vol from homeassistant.const import ( CONF_NAME, CONF_SOURCE, TIME_DAYS, ...
0
0
0
0
0
0
tests/tokens/test_cli.py
testruction/databricks-cli
252
1723492
<reponame>testruction/databricks-cli # Databricks CLI # Copyright 2017 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"), except # that the use of services to which certain application programming # interfaces (each, an "API") connect requires that the user first obtain # a license for...
0
0
0
0
0
0
qark/plugins/webview/set_allow_file_access.py
op01/qark
2,943
1723513
import logging from qark.issue import Severity from qark.plugins.webview.helpers import webview_default_vulnerable from qark.scanner.plugin import JavaASTPlugin log = logging.getLogger(__name__) SET_ALLOW_FILE_ACCESS_DESCRIPTION = ( "File system access is enabled in this WebView. If untrusted data is used to spe...
0
0
0
0
0
0
Python/Tests/TestData/DebuggerProject/EGGceptionOnCall.py
techkey/PTVS
404
1723533
import os, sys sys.path.append(os.path.abspath('EGG.egg')) import EGG.function_exception EGG.function_exception.f()
0
0
0
0
0
0
lenzzz/0000/main.py
saurabh896/python-1
3,976
1723535
<reponame>saurabh896/python-1 from PIL import Image,ImageDraw,ImageFont im = Image.open("pic.jpg") x,y = im.size font = ImageFont.truetype("verdana.ttf", x/3) dr = ImageDraw.Draw(im) dr.text((3*x/4,0),font=font,text="4",fill="#FF0000") im.save("pictuer_has_number.jpg")
0
0
0
0
0
0
RCNN-Python/utils/selective_search.py
concerttttt/RCNNs-on-Win64
403
1723575
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import itertools import copy import joblib import numpy import scipy.sparse import segment import collections import skimage.io import features import color_space def _calc_adjacency_matrix(label_img, n_region) -> object: r = numpy.vstack([label_img[:,...
4
9
0
0
13
0
src/mlspace/dockerfiles/torch_gpu.py
abhishekkrthakur/mlspace
283
1723589
DOCKERFILE = """ FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime ARG DEBIAN_FRONTEND=noninteractive ARG requirements ENV TZ=Europe/Oslo RUN apt-get update RUN apt-get install -y \ build-essential \ cmake \ curl \ gcc \ git \ wget \ sudo \ && rm -rf /var/lib/apt/lists/* RUN curl -f...
0
0
0
0
0
0
cdt/timeseries/graph/VARLiNGAM.py
TheSignPainter/CausalDiscoveryToolbox
528
1723605
from __future__ import annotations """VARLiNGAM algorithm. Author: <NAME> .. MIT License .. .. 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 wit...
3
2
0
0
5
0
demo/ddpm_demo.py
jonbakerfish/mmgeneration
718
1723633
<gh_stars>100-1000 import argparse import os import os.path as osp import sys import mmcv import numpy as np import torch from mmcv import DictAction from torchvision import utils # yapf: disable sys.path.append(os.path.abspath(os.path.join(__file__, '../..'))) # isort:skip # noqa from mmgen.apis import init_model...
0
0
0
0
0
0
scripts/pydanticJSONgenerator.py
sidphbot/jina-hub
106
1723648
import enum from enum import Enum from typing import List from pydantic import BaseModel from pydantic.fields import Field Types = enum.Enum( 'Types', { 'pod': 'pod', 'app': 'app' } ) Kinds = enum.Enum( 'Kinds', { 'encoder' : 'encoder', 'indexer' : 'indexer', ...
0
0
14
0
14
0
src/genie/libs/parser/nxos/tests/ShowRunningConfigTrm/cli/equal/golden_output_expected.py
balmasea/genieparser
204
1723665
expected_output = { 'advertise_evpn_multicast': True, }
0
0
0
0
0
0
tests/basics/list_insert.py
learnforpractice/micropython-cpp
13,648
1723746
a = [1, 2, 3] a.insert(1, 42) print(a) a.insert(-1, -1) print(a) a.insert(99, 99) print(a) a.insert(-99, -99) print(a)
0
0
0
0
0
0
questions/54836382/54836382_within_qrc/qml_rc.py
sesu089/stackoverflow
302
1723780
<reponame>sesu089/stackoverflow<gh_stars>100-1000 # -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.12.1) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x03\x89\ \x00\ \x00\x11\x18\x78\x9c\xe5\x57\x...
0
0
0
0
0
0
tests/test_import.py
gusbeane/galpy
147
1723820
###################TEST WHETHER THE PACKAGE CAN BE IMPORTED#################### def test_top_import(): import galpy def test_orbit_import(): import galpy.orbit def test_potential_import(): import galpy.potential def test_actionAngle_import(): import galpy.actionAngle ...
0
0
0
0
0
0
tests/store/test_cli.py
freefrag/mlflow
1,825
1723823
import json from mlflow.entities import FileInfo from mlflow.store.cli import _file_infos_to_json def test_file_info_to_json(): file_infos = [ FileInfo("/my/file", False, 123), FileInfo("/my/dir", True, None), ] info_str = _file_infos_to_json(file_infos) assert json.loads(info_str) ==...
0
0
0
0
0
0
datapackage_pipelines/specs/schemas/validator.py
gperonato/datapackage-pipelines
109
1723836
import os import json import jsonschema from ..errors import SpecError schema_filename = 'pipeline-spec.schema.json' schema_filename = os.path.join(os.path.dirname(__file__), schema_filename) schema = json.load(open(schema_filename)) validator = jsonschema.validators.validator_for(sche...
0
1
0
0
1
0
mama_cas/management/commands/checkservice.py
ganlanshu/django-mama-cas
370
1723845
<reponame>ganlanshu/django-mama-cas from django.core.management.base import BaseCommand from mama_cas.services import get_backend_path from mama_cas.services import get_callbacks from mama_cas.services import get_logout_url from mama_cas.services import logout_allowed from mama_cas.services import proxy_allowed from m...
0
0
0
0
0
0
hiplot/compress.py
mathematicalmichael/hiplot
2,378
1723853
# 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. import typing as tp from .experiment import Datapoint def _build_columns_list(datapoints: tp.List[Datapoint]) -> tp.List[str]: columns: ...
2
2
3
0
7
0
atest/examples/jump_a.py
icankeep/jupyterlab-lsp
1,117
1723855
A_CONSTANT = "constant" ANOTHER_CONSTANT = "another constant" def a_function_definition(n: int=1) -> str: return A_CONSTANT * n
1
1
0
0
2
0
util/reggen/gen_rust.py
asb/opentitan
1,375
1723873
<reponame>asb/opentitan # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 """ Generate Rust constants from validated register JSON tree """ import io import logging as log import sys import textwrap import warnings from ty...
0
0
0
0
0
0
bw_plex/__init__.py
Hellowlol/bw_plex
371
1723886
from __future__ import annotations import logging import os import sys from logging.handlers import RotatingFileHandler from multiprocessing.pool import ThreadPool as Pool DEFAULT_FOLDER = None THEMES = None TEMP_THEMES = None FP_HASHES = None LOG_FILE = None LOG = logging.getLogger('bw_plex') INI_FILE = None DB_PATH ...
6
5
0
0
11
0
pygem/cad/custom_deformation.py
vishalbelsare/PyGeM
223
1723888
<filename>pygem/cad/custom_deformation.py """ Module for custom deformations to CAD geometries. """ import numpy as np from pygem import CustomDeformation as OriginalCustomDeformation from .cad_deformation import CADDeformation class CustomDeformation(CADDeformation, OriginalCustomDeformation): """ Class to p...
0
0
0
0
0
0
tensorflow/script/run_cls_cmd.py
enpelonio/O-CNN
299
1723918
import os import argparse parser = argparse.ArgumentParser() parser.add_argument('--alias', type=str, required=False, default='0202_randinit') parser.add_argument('--gpu', type=int, required=False, default=0) parser.add_argument('--mode', type=str, required=False, default='randinit') parser.add_argument('--ckpt', typ...
0
0
0
0
0
0
baseline/__init__.py
sagnik/baseline
241
1723921
from baseline.version import __version__ from baseline.utils import * from baseline.vectorizers import * from baseline.confusion import * from baseline.data import * from baseline.reader import * from eight_mile.progress import * from baseline.reporting import * from baseline.model import * from baseline.embeddings imp...
0
0
0
0
0
0
Python/PyParsing/node_parser.py
Gjacquenot/training-material
115
1723952
'''parser for tree-structured data''' from pyparsing import (Forward, Word, alphas, alphanums, Literal, Optional, ZeroOrMore, Group) from node import Node class NodeParser: '''Class implementing tree structured data parser, data is of the form (c1 ((c2) (c3 ((c4) (c5))) (c6)))''' ...
0
2
0
2
4
0
setup.py
zldrobit/pyssim
310
1723967
"""Setup script for pyssim.""" from setuptools import find_packages from setuptools import setup setup( name='pyssim', version='0.4', description=('Module for computing Structured Similarity Image Metric ' '(SSIM) in Python'), author='<NAME>, <NAME>, <NAME>', author_email='<EMAIL>...
0
0
0
0
0
0
server/shapes/admin.py
paulu/opensurfaces
137
1723968
from django.contrib import admin from imagekit.admin import AdminThumbnail from common.admin import AutoUserMixin from shapes.models import SubmittedShape, \ MaterialShape, ShapeSubstance, ShapeSubstanceLabel, \ ShapeName, MaterialShapeNameLabel, MaterialShapeQuality from normals.models import ShapeRectifiedN...
0
0
8
0
8
0
gff/convert_gff3_to_bed.py
senjoro/biocode
355
1723980
<gh_stars>100-1000 #!/usr/bin/env python3 """ This script can be used to transform a GFF3 file into a BED file. LIMITATIONS: - The only currently-tested input GFF3 consists of coding gene models. - Its encoding is meant to include prokaryotes and eukaryotes, though it was written/tested first for eukaryotes. Th...
0
0
0
0
0
0
recipes/Python/576690_Pyscanlogger__PythPort/recipe-576690.py
tdiprima/code
2,023
1723986
#!/usr/bin/env python """ pyscanlogger: Simple port scan detector/logger tool, inspired by scanlogd {http://www.openwall.com/scanlogd} """ import sys, os import dpkt, pcap import struct import socket import time import threading import optparse # UDP - in progress... SCAN_TIMEOUT = 5 WEIGHT_THRESHOLD = 25 PIDFILE...
0
0
0
0
0
0
tick/robust/tests/modified_huber_test.py
sumau/tick
411
1723994
# License: BSD 3 clause import unittest import numpy as np from scipy.sparse import csr_matrix from tick.robust import ModelModifiedHuber from tick.base_model.tests.generalized_linear_model import TestGLM from tick.linear_model import SimuLogReg class Test(TestGLM): def test_ModelModifiedHuber(self): "...
0
0
0
0
0
0
syzygy/agent/memprof/memprof.gyp
nzeh/syzygy
343
1723998
<reponame>nzeh/syzygy<gh_stars>100-1000 # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
0
0
0
0
0
0
util/data.py
coleblackman/AccDNN
231
1724043
#!/usr/bin/env python from settings import * import numpy as np import struct def _bool2int(x, dw): y = 0 for i,j in enumerate(x): y += j<<(i * dw) return y def _quantize(mat, dw, dq, is_complement=True): FIX_POINT_MAX = 2 ** (dw - 1) - 1 FIX_POINT_MIN = - 2 ** (dw - 1) FIX_POINT_SCAL...
0
0
0
0
0
0
src/aprl/multi/score_worker.py
fkamrani/adversarial-policies
211
1724047
"""Helper functions for training.py executed on worker nodes using Ray Tune. It's important these are all pickleable.""" import os.path as osp from sacred import observers from aprl.multi import common_worker def score_worker(base_config, tune_config, reporter): """Run a aprl.score experiment with specified c...
0
0
0
0
0
0
isserviceup/storage/favorites.py
EvgeshaGars/is-service-up
182
1724081
from isserviceup.models.favorite import Favorite from isserviceup.services import SERVICES def get_favorite_services(user_id) -> object: favs = Favorite.objects(user_id=user_id) res = [] for fav in favs: res.append(SERVICES[fav.service_id]) return res def update_favorite_status(user_id, serv...
0
1
0
0
1
0
executor/cook/subprocess.py
CGe0516/Cook
345
1724089
from __future__ import annotations """This module provides helper functions for subprocess management.""" import logging import signal import subprocess import sys import os import psutil import cook import cook.io_helper as cio def launch_process(command, environment) -> object | None: """Launches the process...
0
7
0
0
7
0
tools/python/test/test_point.py
babic95/dlib
11,719
1724098
from dlib import point, points try: import cPickle as pickle # Use cPickle on Python 2.7 except ImportError: import pickle def test_point(): p = point(27, 42) assert repr(p) == "point(27, 42)" assert str(p) == "(27, 42)" assert p.x == 27 assert p.y == 42 ser = pickle.dumps(p, 2) d...
0
0
0
0
0
0