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 |
|---|---|---|---|---|---|---|---|---|---|---|
tests/test_iam.py | calebmarcus/awacs | 358 | 184465 | <reponame>calebmarcus/awacs<gh_stars>100-1000
import unittest
from awacs.iam import ARN
class TestARN(unittest.TestCase):
def test_aws(self):
arn = ARN("root", "us-east-1", "account")
self.assertEqual(arn.JSONrepr(), "arn:aws:iam::account:root")
def test_cn(self):
arn = ARN("root", "... | 0 | 0 | 0 | 0 | 0 | 0 |
solutions/LeetCode/Python3/33.py | timxor/leetcode-journal | 854 | 184470 | <reponame>timxor/leetcode-journal
__________________________________________________________________________________________________
sample 24 ms submission
class Solution:
def search(self, nums: List[int], target: int) -> int:
if len(nums)==0:return -1
left = 0
right = len(nums) - 1
... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/transformer_example.py | AlOussama/PyPSA | 594 | 184475 | ## Example of transformer with non-trivial phase shift and tap ratio
#
#This example is a copy of pandapower's minimal example.
import pypsa
import numpy as np
network = pypsa.Network()
network.add("Bus","MV bus",v_nom=20,v_mag_pu_set=1.02)
network.add("Bus","LV1 bus",v_nom=.4)
network.add("Bus","LV2 bus",v_nom=.4)
... | 0 | 0 | 0 | 0 | 0 | 0 |
contrib/python/haystack/backend.py | Kronuz/Xapiand | 370 | 184490 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2018 Dubalu LLC. All rights reserved.
#
# 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 withou... | 0 | 0 | 0 | 0 | 0 | 0 |
share/lib/python/neuron/rxdtests/tests/reaction_null_dest.py | niltonlk/nrn | 203 | 184521 | <gh_stars>100-1000
from neuron import h, rxd
h.load_file("stdrun.hoc")
cell = h.Section(name="cell")
r = rxd.Region([cell])
Ca = rxd.Species(r, name="ca", charge=2, initial=60e-3)
reaction_decay = rxd.Reaction(Ca, 0 * Ca, 1e-8)
tvec = h.Vector().record(h._ref_t)
cavec = h.Vector().record(Ca.nodes[0]._ref_concentrat... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/genducers.py | StepanBakshayev/transducers-python | 182 | 184586 | <reponame>StepanBakshayev/transducers-python<filename>tests/genducers.py
# Copyright 2014 Cognitect. 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.a... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/serialise/json-serialise/run.py | jonnyrocks/pyangbind | 176 | 184686 | <reponame>jonnyrocks/pyangbind
#!/usr/bin/env python
import json
import os.path
import unittest
from decimal import Decimal
import six
from bitarray import bitarray
from pyangbind.lib.pybindJSON import dumps
from pyangbind.lib.xpathhelper import YANGPathHelper
from tests.base import PyangBindTestCase
class JSONSer... | 0 | 0 | 0 | 0 | 0 | 0 |
res/PyTorchExamples/examples/le/__init__.py | juitem/ONE | 255 | 184688 | import torch
import torch.nn as nn
# model
class net_le(nn.Module):
def __init__(self):
super().__init__()
def forward(self, inputs) -> object:
return torch.le(inputs[0], inputs[1])
_model_ = net_le()
# dummy input for onnx generation
_dummy_ = [torch.randn(1, 2, 3, 3), torch.randn(1, 2, 3... | 0 | 1 | 0 | 0 | 1 | 0 |
tutorial/_tutorial_explorerhat.py | DT-was-an-ET/explorer-hat | 156 | 184728 | from _tutorial import *
explorerhat = None
name = ''
horse = '''
>>\.
/_ )`.
/ _)`^)`. _.---. _
(_,' \ `^-)"" `.\\
| | \\
\ / |
/ \ /.___.'\ (\ (_
< ,"|| \ |`. \`-'
\\\\ () )| )/
hjw |_>|> /_] //
/_] ... | 0 | 1 | 0 | 0 | 1 | 0 |
pages/tests/test_commands.py | timbortnik/django-page-cms | 113 | 184744 | # -*- coding: utf-8 -*-
"""Django page CMS command tests suite module."""
from pages.models import Page, Content, PageAlias
from pages.tests.testcase import TestCase
from django.core.management import call_command
from django.test import LiveServerTestCase
import json
from django.test.testcases import LiveServerThread... | 0 | 1 | 0 | 0 | 1 | 0 |
examples.py/Basics/Color/WaveGradient.py | timgates42/processing.py | 1,224 | 184757 | <filename>examples.py/Basics/Color/WaveGradient.py<gh_stars>1000+
"""
Wave Gradient
by <NAME>.
Adapted to python by <NAME>
Generate a gradient along a sin() wave.
"""
import math
amplitude = 30
fillGap = 2.5
def setup():
size(200, 200)
background(200, 200, 200)
noLoop()
def draw():
frequency =... | 0 | 0 | 0 | 0 | 0 | 0 |
axelrod/tests/unit/test_random_.py | nandhinianandj/Axelrod | 596 | 184792 | """Tests for the random functions."""
import unittest
from collections import Counter
import axelrod as axl
from axelrod import BulkRandomGenerator, Pdf, RandomGenerator
C, D = axl.Action.C, axl.Action.D
class TestRandomGenerator(unittest.TestCase):
def test_return_values(self):
# The seed doesn't matte... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/response/AntfortuneQuotationResearchdataQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 184836 | <reponame>antopen/alipay-sdk-python-all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AntfortuneQuotationResearchdataQueryResponse(AlipayResponse):
def __init__(self):
super(AntfortuneQuotationResearchdataQueryResponse, ... | 0 | 0 | 0 | 0 | 0 | 0 |
demos/GCAMatting/trainer.py | briana-jin-zhang/spatial-segmentation | 733 | 184909 | from __future__ import annotations
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils as nn_utils
import torch.backends.cudnn as cudnn
from torch.nn import SyncBatchNorm
import torch.optim.lr_scheduler as lr_scheduler
from torch.nn.parallel import ... | 7 | 7 | 0 | 4 | 18 | 0 |
testing/MLDB-986-recording.py | kstepanmpmg/mldb | 665 | 184912 | <reponame>kstepanmpmg/mldb
#
# MLDB-986-recording.py
# mldb.ai inc, 2015
# This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved.
#
from mldb import mldb
dataset_config = {
'type' : 'sparse.mutable',
'id' : 'example'
}
ds = mldb.create_dataset(dataset_config)
out = mldb.post('/v1... | 0 | 0 | 0 | 0 | 0 | 0 |
vulnerabilities/HTMLInjection.py | xllauca/TIWAP | 109 | 184923 | # Imports
from helper.db_manager import DBManager
# DB Manager
dbm = DBManager()
# Stored
def stored_html(name) -> tuple[object, object]:
if dbm.save_name(name=name):
msg = "Name saved!"
else:
msg = "Unable to save name."
data = dbm.get_names()
return msg, data
| 0 | 1 | 0 | 0 | 1 | 0 |
tests/conftest.py | Phonebooth/api-client | 112 | 184930 | import os
from typing import NamedTuple
from unittest.mock import Mock, sentinel
import pytest
import requests
import requests_mock
import vcr
from apiclient import APIClient
from apiclient.request_formatters import BaseRequestFormatter
from apiclient.response_handlers import BaseResponseHandler
BASE_DIR = os.path.a... | 0 | 2 | 6 | 0 | 8 | 0 |
sphinx/doc_examples/exp_op-example.py | anton-buyskikh/QuSpin | 195 | 184952 | from __future__ import print_function, division
#
import sys,os
quspin_path = os.path.join(os.getcwd(),"../../")
sys.path.insert(0,quspin_path)
#
from quspin.operators import hamiltonian, exp_op # Hamiltonians, operators and exp_op
from quspin.basis import spin_basis_1d # Hilbert space spin basis
import numpy as np # g... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/util.py | byjg/redis-dump-load | 158 | 184987 | <reponame>byjg/redis-dump-load<filename>tests/util.py
import nose.plugins.skip
import functools
import sys
try:
import ijson as ijson_root
have_ijson = True
except ImportError:
have_ijson = False
py3 = sys.version_info[0] == 3
# python 2/3 compatibility
if py3:
# borrowed from six
def b(s):
... | 0 | 0 | 0 | 0 | 0 | 0 |
__scraping__/zdravi.doktorka.cz - requests, BS/main.py | whitmans-max/python-examples | 140 | 185043 | <gh_stars>100-1000
# date: 2020.07.01
# https://stackoverflow.com/questions/62667459/python-web-scraper-gives-the-same-page-as-the-response
import requests
from bs4 import BeautifulSoup
import csv
URL = 'https://zdravi.doktorka.cz/clanky?page=0'
HEADERS = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Ap... | 0 | 0 | 0 | 0 | 0 | 0 |
bcs-ui/backend/templatesets/release/generator/form_mode.py | laodiu/bk-bcs | 599 | 185065 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 1 | 2 | 0 | 0 | 3 | 0 |
openbook_lists/migrations/0003_list_follows.py | TamaraAbells/okuna-api | 164 | 185068 | # Generated by Django 2.1.3 on 2018-12-04 13:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('openbook_follows', '0007_remove_follow_list'),
('openbook_lists', '0002_auto_20181023_1331'),
]
operations: list[obje... | 0 | 0 | 2 | 0 | 2 | 0 |
tests/test_n_gram_based_scorers.py | liguiming77/vizseq | 404 | 185098 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
if __name__ == '__main__':
import unittest
from tests.scorers import (test_bleu, test_chrf, test_bp, test_cider,... | 0 | 0 | 0 | 0 | 0 | 0 |
samples/CommandableMixin.py | amih90/bacpypes | 240 | 185104 | <gh_stars>100-1000
#!/usr/bin/env python
"""
Rebuilt Commandable
"""
from bacpypes.debugging import ModuleLogger
from bacpypes.consolelogging import ConfigArgumentParser
from bacpypes.core import run
from bacpypes.primitivedata import Date
from bacpypes.app import BIPSimpleApplication
from bacpypes.object import r... | 0 | 0 | 0 | 0 | 0 | 0 |
pyxb/bundles/opengis/gml_3_3/lr.py | eLBati/pyxb | 123 | 185109 | from pyxb.bundles.opengis.gml_3_3.raw.lr import *
| 0 | 0 | 0 | 0 | 0 | 0 |
leetcode/444.sequence-reconstruction.py | geemaple/algorithm | 177 | 185112 | <reponame>geemaple/algorithm
import collections
class Solution(object):
def sequenceReconstruction(self, org, seqs):
"""
:type org: List[int]
:type seqs: List[List[int]]
:rtype: bool
"""
graph = collections.defaultdict(list)
indegree_map = {}
... | 0 | 0 | 0 | 0 | 0 | 0 |
dataloaders/coco1000_dataset.py | sorrowyn/C-Tran | 104 | 185129 |
from __future__ import annotations
from __future__ import print_function, division
import os
import torch
from skimage import io, transform
import numpy as np
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms#, utils
import pickle
from pdb import set_trace as stop
from PIL import Imag... | 4 | 9 | 0 | 2 | 15 | 0 |
office365/sharepoint/changes/change_web.py | wreiner/Office365-REST-Python-Client | 544 | 185137 | from office365.sharepoint.changes.change import Change
class ChangeWeb(Change):
@property
def web_id(self) -> object:
return self.properties.get("WebId", None)
| 0 | 1 | 0 | 0 | 1 | 0 |
textbeat/plugins/fluidsynth.py | cuppajoeman/textbeat | 231 | 185148 | <reponame>cuppajoeman/textbeat
#!/usr/bin/env python
import textbeat.instrument as instrument
from textbeat.instrument import Instrument
from shutilwhich import which
ERROR = False
if which('fluidsynth'):
try:
import fluidsynth # https://github.com/flipcoder/pyfluidsynth
except:
ERROR = True
el... | 0 | 0 | 0 | 0 | 0 | 0 |
digital_gesture_recognition/image_segmentation.py | tz28/chinese-number-gestures-recognition | 673 | 185161 | <reponame>tz28/chinese-number-gestures-recognition
from PIL import Image
import cv2
import numpy as np
im = Image.open("old//dataset//new_pic//2.png").convert('L')
im.show()
mat = np.asarray(im)
ret2, th_1 = cv2.threshold(mat, 0, 225, cv2.THRESH_BINARY+cv2.THRESH_OTSU)
cv2.imshow('BINARY',th_1)
cv2.waitKey() | 0 | 0 | 0 | 0 | 0 | 0 |
examples/todo_app/app/config.py | MarkoShiva/quart | 1,085 | 185169 | from pathlib import Path
path = Path().absolute()
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = "sqlite:///" + str(path) + "/Database/database.db"
SECRET_KEY = "e9515dfe457bfe64c1c30d73e161de0f76f6b03f"
| 0 | 0 | 0 | 0 | 0 | 0 |
bindings/python/cntk/contrib/crosstalk/tests/embed_test.py | shyamalschandra/CNTK | 17,702 | 185229 | <reponame>shyamalschandra/CNTK<gh_stars>1000+
import pytest
import numpy as np
from cntk.contrib import crosstalk as cstk
import tempfile
workdir = tempfile.gettempdir()
input_dim = 3
emb_dim = 100
dict1 = ['a', 'b', 'c']
dict2 = ['c', 'a', 'b']
emb1 = np.random.random((input_dim, emb_dim)).astype(np.float32)
emb2 = [... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/response/AlipayFundTransPayeeBindQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 185277 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayFundTransPayeeBindQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayFundTransPayeeBindQueryResponse, self).__init__()
self._bind: None = None
... | 0 | 1 | 0 | 1 | 2 | 0 |
scripts/make_mosaic.py | mtanida/augdat | 103 | 185285 | # -*- coding: utf-8 -*-
# Description: generates a mosaic image based on a list of UUIDs
# Example usage:
# python make_mosaic.py ../data/src/pd_items.json ../img/mosaic_800x480.jpg w 800 480 0.2 0.66 10
import json
import math
import os
from PIL import Image
from pprint import pprint
import re
import sys
import ur... | 0 | 0 | 0 | 0 | 0 | 0 |
core/jobs/batch_jobs/story_migration_jobs.py | yash10019coder/oppia | 5,422 | 185304 | <filename>core/jobs/batch_jobs/story_migration_jobs.py
# coding: utf-8
#
# Copyright 2021 The Oppia 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... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/modules/auth/resources/test_getting_oauth2clients_info.py | IsmaelJS/test-github-actions | 1,420 | 185333 | # encoding: utf-8
# pylint: disable=missing-docstring
import pytest
@pytest.mark.parametrize('auth_scopes', (
['auth:read'],
['auth:read', 'auth:write'],
))
def test_getting_list_of_oauth2_clients_by_authorized_user(
flask_app_client, regular_user, regular_user_oauth2_client, auth_scopes
):
# pyli... | 0 | 0 | 0 | 0 | 0 | 0 |
malaya_speech/train/model/transformer/encoder.py | ishine/malaya-speech | 111 | 185337 | <reponame>ishine/malaya-speech<filename>malaya_speech/train/model/transformer/encoder.py<gh_stars>100-1000
import tensorflow as tf
from .transformer import EncoderStack
from .model_utils import (
get_position_encoding,
get_padding_bias,
get_decoder_self_attention_bias,
)
import numpy as np
_NEG_INF = -1e9
... | 0 | 0 | 0 | 0 | 0 | 0 |
pythran/tests/scipy/spectral.py | davidbrochart/pythran | 1,647 | 185360 | # Author: <NAME>
# 2010 - 2011
"""Tools for spectral analysis of unequally sampled signals."""
import numpy as np
#pythran export lombscargle(float64[], float64[], float64[])
#runas import numpy; x = numpy.arange(2., 12.); y = numpy.arange(1., 11.); z = numpy.arange(3., 13.); lombscargle(x, y, z)
def lombscargle(x, ... | 0 | 1 | 0 | 0 | 1 | 0 |
clipspy-1.0.0/test/classes_test.py | bauman/clips-rules-rebuild | 108 | 185501 | import os
import unittest
from tempfile import mkstemp
from clips import Environment, Symbol, InstanceName
from clips import CLIPSError, ClassDefaultMode, LoggingRouter
DEFCLASSES = [
"""
(defclass AbstractClass (is-a USER)
(role abstract))
""",
"""(defclass InheritClass (is-a AbstractClass))""... | 0 | 1 | 1 | 0 | 2 | 0 |
cms/apps.py | Manny27nyc/pythondotorg | 911 | 185509 | from django.apps import AppConfig
class CmsAppConfig(AppConfig):
name: str = 'cms'
| 0 | 0 | 1 | 0 | 1 | 0 |
codigo/Live148/tests/routes/test_home.py | cassiasamp/live-de-python | 572 | 185511 | def test_home_retorna_status_code_200(client):
response = client.get("/")
assert response.status_code == 200
def test_home_retorna_texto_ola(client):
response = client.get("/")
assert response.text == "ola"
def test_echo_retorna_status_code_200(client):
response = client.get("/echo")
assert ... | 0 | 0 | 0 | 0 | 0 | 0 |
models/pointasnl_sem_seg_res.py | DLPerf/PointASNL | 209 | 185597 | <filename>models/pointasnl_sem_seg_res.py
import os
import sys
BASE_DIR = os.path.dirname(__file__)
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tensorflow as tf
import tf_util
from pointnet_util import pointnet_fp_module
from pointasnl_util import PointASNLSetAbstraction, get_re... | 0 | 0 | 0 | 0 | 0 | 0 |
src/backup/utils.py | showthesunli/liuli | 139 | 185604 | <filename>src/backup/utils.py
"""
Created by howie.hu at 2022-01-25.
Description: 存储器通用函数
Changelog: all notable changes to this file will be documented
"""
from src.common.remote import get_html_by_requests
from src.config import Config
from src.processor.html_render import render_book_html
from src.util... | 0 | 0 | 0 | 0 | 0 | 0 |
cellphonedb/src/core/exceptions/NoInteractionsFound.py | BioTuring-Notebooks/CellphoneDB | 278 | 185609 | <reponame>BioTuring-Notebooks/CellphoneDB
class NoInteractionsFound(Exception):
def __init__(self, description: str = None, hint: str = None):
super(NoInteractionsFound, self).__init__('No CellPhoneDB interacions found in this input.')
self.description = description
self.hint = hint
| 0 | 0 | 0 | 0 | 0 | 0 |
tridet/modeling/dd3d/__init__.py | flipson/dd3d | 227 | 185630 | # Copyright 2021 Toyota Research Institute. All rights reserved.
from tridet.modeling.dd3d.core import DD3D
from tridet.modeling.dd3d.nuscenes_dd3d import NuscenesDD3D
from tridet.modeling.dd3d.nuscenes_dd3d_tta import NuscenesDD3DWithTTA
from tridet.modeling.dd3d.test_time_augmentation import DD3DWithTTA
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_datetime.py | Attsun1031/schematics | 1,430 | 185638 | <filename>tests/test_datetime.py
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
import sys
from dateutil.tz import gettz, tzutc
import pytest
from schematics.exceptions import ConversionError, ValidationError
from schematics.types import DateTimeType, UTCDateTimeType, TimestampType
UTC = DateTime... | 0 | 0 | 0 | 0 | 0 | 0 |
reddit2telegram/channels/genshin_impact_reddit/app.py | mainyordle/reddit2telegram | 187 | 185649 | <gh_stars>100-1000
#encoding:utf-8
subreddit = 'Genshin_Impact'
t_channel = '@Genshin_Impact_reddit'
def send_post(submission, r2t):
return r2t.send_simple(submission)
| 0 | 0 | 0 | 0 | 0 | 0 |
Stock/Trade/DyStockStrategyBase.py | Leonardo-YXH/DevilYuan | 135 | 185657 | from __future__ import annotations
from EventEngine.DyEvent import *
class DyStockStrategyState:
running: str = 'sRunning'
monitoring: str = 'sMonitoring'
backTesting: str = 'sBackTesting'
def __init__(self, *states):
self._state: None = None
self.add(*states)
@property
def... | 0 | 7 | 3 | 1 | 11 | 0 |
tests/m3u/test_translator.py | grdorin/mopidy | 6,700 | 185698 | import io
import pathlib
import pytest
from mopidy.m3u import translator
from mopidy.m3u.translator import path_to_uri
from mopidy.models import Playlist, Ref, Track
def loads(s, basedir) -> object:
return translator.load_items(io.StringIO(s), basedir)
def dumps(items) -> object:
fp = io.StringIO()
tr... | 0 | 2 | 0 | 0 | 2 | 0 |
coherence/upnp/core/action.py | stonewell/Coherence | 112 | 185707 | <gh_stars>100-1000
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright (C) 2006 Fluendo, S.A. (www.fluendo.com).
# Copyright 2006,2007,2008,2009 <NAME> <<EMAIL>>
from twisted.python import failure
from twisted.python.util import OrderedDict
from coherence import log
class ... | 0 | 0 | 0 | 0 | 0 | 0 |
models_tf.py | Breast-Cancer-PINN-ML-Team/NYU-BIRADS_Classifier | 123 | 185720 | <reponame>Breast-Cancer-PINN-ML-Team/NYU-BIRADS_Classifier<filename>models_tf.py
import layers_tf as layers
def baseline(x, parameters, nodropout_probability=None, gaussian_noise_std=None):
if gaussian_noise_std is not None:
x = layers.all_views_gaussian_noise_layer(x, gaussian_noise_std)
# first co... | 0 | 0 | 0 | 0 | 0 | 0 |
podman/tests/integration/test_volumes.py | kevinwylder/podman-py | 106 | 185734 | import random
import unittest
from podman import PodmanClient
from podman.errors import NotFound
from podman.tests.integration import base
class VolumesIntegrationTest(base.IntegrationTest):
def setUp(self):
super().setUp()
self.client = PodmanClient(base_url=self.socket_uri)
self.addCle... | 0 | 0 | 0 | 0 | 0 | 0 |
opentapioca/languagemodel.py | heathersherry/opentapioca | 191 | 185763 | import pickle
import re
from unidecode import unidecode
from collections import defaultdict
from math import log
from opentapioca.readers.dumpreader import WikidataDumpReader
separator_re = re.compile(r'[,\-_/:;!?)]? [,\-_/:;!?(]?')
def tokenize(phrase) -> object:
"""
Split a text into lists of words
"""... | 0 | 4 | 0 | 4 | 8 | 0 |
ztag/schema.py | justinbastress/ztag | 107 | 185803 | from zschema.leaves import *
from zschema.compounds import *
import zschema.registry
from ztag.annotation import Annotation
import zcrypto_schemas.zcrypto as zcrypto
import zgrab2_schemas.zgrab2 as zgrab2
import zgrab2_schemas.zgrab2.mssql as zgrab2_mssql
import zgrab2_schemas.zgrab2.oracle as zgrab2_oracle
import z... | 0 | 1 | 1 | 0 | 2 | 0 |
PyObjCTest/test_nslayoutmanager.py | Khan/pyobjc-framework-Cocoa | 132 | 185829 |
from PyObjCTools.TestSupport import *
from AppKit import *
try:
long
except NameError:
long = int
class TestNSLayoutManagerHelper (NSObject):
def layoutManager_shouldUseTemporaryAttributes_forDrawingToScreen_atCharacterIndex_effectiveRange_(self, a, b, c, d, e) -> int: return 1
def layoutManager_did... | 0 | 2 | 0 | 0 | 2 | 0 |
tests/components/nexia/test_switch.py | MrDelik/core | 30,023 | 185843 | <gh_stars>1000+
"""The switch tests for the nexia platform."""
from homeassistant.const import STATE_ON
from .util import async_init_integration
async def test_hold_switch(hass):
"""Test creation of the hold switch."""
await async_init_integration(hass)
assert hass.states.get("switch.nick_office_hold").... | 0 | 0 | 0 | 0 | 0 | 0 |
AppServer/lib/django-1.2/tests/regressiontests/text/tests.py | loftwah/appscale | 790 | 185984 | # coding: utf-8
from django.test import TestCase
from django.utils.text import *
from django.utils.http import urlquote, urlquote_plus, cookie_date, http_date
from django.utils.encoding import iri_to_uri
class TextTests(TestCase):
"""
Tests for stuff in django.utils.text and other text munging util functions.... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/pokemon_species.py | ymin1103/pokedex | 1,177 | 185997 | <filename>scripts/pokemon_species.py
# Encoding: UTF-8
"""Reorganize Pokemon, PokemonForm, etc. to Species, Pokemon, etc.
This is an unmaintained one-shot script, only included in the repo for
reference.
"""
import csv
import os
from pokedex import defaults
number_of_species = 649
high_id_start = 10000
csv_dir = ... | 0 | 0 | 0 | 0 | 0 | 0 |
java/org/brotli/dec/build_defs.bzl | Marcuse7/brotli | 11,699 | 186010 | from __future__ import annotations
"""Utilities for Java brotli tests."""
_TEST_JVM_FLAGS = [
"-DBROTLI_ENABLE_ASSERTS=true",
]
def brotli_java_test(name, main_class: object | None = None, jvm_flags: object | None = None, **kwargs):
"""test duplication rule that creates 32/64-bit test pair."""
if jvm_fla... | 2 | 0 | 0 | 0 | 2 | 0 |
src/genie/libs/parser/iosxe/tests/ShowIox/cli/equal/golden_output_expected.py | balmasea/genieparser | 204 | 186014 | <filename>src/genie/libs/parser/iosxe/tests/ShowIox/cli/equal/golden_output_expected.py
expected_output = {
'caf_service': 'Not Running',
'ha_service': 'Not Running',
'ioxman_service': 'Not Running',
'sec_storage_service': 'Not Running',
'libvirtd': 'Running',
'dockerd': 'Not Running',
'redundancy_status': 'Non-... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_data/test_batch_process.py | automaton123456/nanodet | 4,388 | 186040 | <reponame>automaton123456/nanodet<filename>tests/test_data/test_batch_process.py
import pytest
import torch
from nanodet.data.batch_process import stack_batch_img
def test_stack_batch_img():
with pytest.raises(AssertionError):
dummy_imgs = [torch.rand((1, 30, 30)), torch.rand((3, 28, 10))]
stack_... | 0 | 0 | 0 | 0 | 0 | 0 |
chariot/language_model_preprocessor.py | Y-Kuro-u/chariot | 134 | 186046 | <filename>chariot/language_model_preprocessor.py
import itertools
import numpy as np
import pandas as pd
from chariot.dataset_preprocessor import DatasetPreprocessor
from chariot.dataset_preprocessor import ProcessBuilder
from chariot.transformer.formatter.base import BaseFormatter
from chariot.transformer.generator.ba... | 0 | 0 | 0 | 0 | 0 | 0 |
notebook/pypdf2_split.py | vhn0912/python-snippets | 174 | 186048 | <reponame>vhn0912/python-snippets<filename>notebook/pypdf2_split.py
import PyPDF2
merger = PyPDF2.PdfFileMerger()
merger.append('data/src/pdf/sample1.pdf', pages=PyPDF2.pagerange.PageRange(':2'))
merger.write('data/temp/sample_split1.pdf')
merger.close()
merger = PyPDF2.PdfFileMerger()
merger.append('data/src/pdf/... | 0 | 0 | 0 | 0 | 0 | 0 |
terrascript/provider/hashicorp/kubernetes.py | mjuenema/python-terrascript | 507 | 186107 | # terrascript/provider/hashicorp/kubernetes.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:20:43 UTC)
import terrascript
class kubernetes(terrascript.Provider):
"""terraform-provider-kubernetes"""
__description__: str = "terraform-provider-kubernetes"
__namespace__: str = "hashicorp"
... | 0 | 0 | 7 | 0 | 7 | 0 |
sarpy/__init__.py | spacefan/sarpy | 119 | 186136 | from .__about__ import *
import logging
__all__ = ['__version__',
'__classification__', '__author__', '__url__', '__email__',
'__title__', '__summary__',
'__license__', '__copyright__']
# establish logging paradigm
logger = logging.getLogger(__name__)
logger.setLevel(logging.WARNING... | 0 | 0 | 0 | 0 | 0 | 0 |
testing/fibonacci/fibonacci/tests/test_fibonacci.py | asteroidshappen/school2021 | 252 | 186163 | <gh_stars>100-1000
def test_initial():
from fibonacci import fibonacci
assert fibonacci(0) == 0
assert fibonacci(1) == 1
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_masking.py | ddhostallero/cxplain | 105 | 186204 | """
Copyright (C) 2019 <NAME>, ETH Zurich
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, merge, publish, distri... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/components/signal_messenger/test_notify.py | andersop91/core | 22,481 | 186243 | """The tests for the signal_messenger platform."""
import json
import logging
import os
import tempfile
from unittest.mock import patch
from homeassistant.setup import async_setup_component
from tests.components.signal_messenger.conftest import (
MESSAGE,
NUMBER_FROM,
NUMBERS_TO,
SIGNAL_SEND_PATH_SUFI... | 2 | 0 | 0 | 0 | 2 | 0 |
torch_glow/tests/nodes/quantized_layernorm_test.py | YaronBenAtar/glow | 2,838 | 186257 | <filename>torch_glow/tests/nodes/quantized_layernorm_test.py
# Copyright (c) Glow Contributors. See CONTRIBUTORS file.
#
# 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.apach... | 0 | 0 | 0 | 0 | 0 | 0 |
src/beanmachine/ppl/utils/tests/graph_test.py | horizon-blue/beanmachine-1 | 177 | 186261 | <filename>src/beanmachine/ppl/utils/tests/graph_test.py
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for Graph from graph.py"""
import unittest
from beanmachine.ppl.utils.grap... | 0 | 0 | 0 | 0 | 0 | 0 |
sphinx/source/docs/user_guide/examples/styling_toolbar_autohide.py | kevin1kevin1k/bokeh | 15,193 | 186290 | from bokeh.plotting import figure, output_file, show
output_file("styling_toolbar_autohide.html")
# Basic plot setup
plot = figure(width=400, height=400, title='Toolbar Autohide')
plot.line([1,2,3,4,5], [2,5,8,2,7])
# Set autohide to true to only show the toolbar when mouse is over plot
plot.toolbar.autohide = True
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/opendr/control/single_demo_grasp/training/learner_utils.py | ad-daniel/opendr | 217 | 186295 | <gh_stars>100-1000
# Copyright 2020-2022 OpenDR European 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 appl... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/pytests/unit/states/test_memcached.py | babs/salt | 9,425 | 186327 | """
:codeauthor: <NAME> <<EMAIL>>
"""
import pytest
import salt.states.memcached as memcached
from salt.exceptions import CommandExecutionError
from tests.support.mock import MagicMock, patch
@pytest.fixture
def configure_loader_modules() -> dict[object,dict[object,object]]:
return {memcached: {}}
def test... | 0 | 1 | 0 | 0 | 1 | 0 |
peeringdb/migrations/0006_auto_20180213_0031.py | schiederme/peering-manager | 173 | 186435 | <filename>peeringdb/migrations/0006_auto_20180213_0031.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-12 23:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("peeringdb", "0005_auto_20180122_1845")]
operations = [
migrations.Cr... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/trac/test-trac-0175.py | eLBati/pyxb | 123 | 186436 | <filename>tests/trac/test-trac-0175.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.utils.domutils
import operator
import functools
from xml.dom import Node
from pyxb.utils.six.mo... | 0 | 0 | 0 | 0 | 0 | 0 |
nlpaug/augmenter/sentence/random.py | techthiyanes/nlpaug | 3,121 | 186486 | from __future__ import annotations
"""
Augmenter that apply operation (sentence level) to textual input based on abstractive summarization.
"""
import os
from nlpaug.augmenter.sentence import SentenceAugmenter
import nlpaug.model.word_rule as nmr
from nlpaug.util import Action, Doc
class RandomSentAug(Sentence... | 7 | 2 | 0 | 0 | 9 | 0 |
common/src/stack/ansible/plugins/modules/stacki_storage_controller_info.py | sammeidinger/stack | 123 | 186488 | # @copyright@
# Copyright (c) 2006 - 2020 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
DOCUMENTATION = """
module: stacki_storage_controller_info
short_description: Return data about Stacki storage controllers
description:
- If n... | 0 | 0 | 0 | 0 | 0 | 0 |
tflib/losses/__init__.py | yaojia1/AttGAN-final | 581 | 186489 | <reponame>yaojia1/AttGAN-final<filename>tflib/losses/__init__.py
from tflib.losses.losses import *
| 0 | 0 | 0 | 0 | 0 | 0 |
symposion/cms/migrations/0001_initial.py | azkarmoulana/pycon | 154 | 186503 | <reponame>azkarmoulana/pycon
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
import symposion.cms.models
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', '0001_initial'),
]
operatio... | 0 | 0 | 0 | 0 | 0 | 0 |
test/unittests/test_publishing.py | usnistgov/corr-sumatra | 143 | 186516 | from __future__ import annotations
"""
"""
from __future__ import unicode_literals
from builtins import object
import unittest
import sys
import os
import shutil
from io import StringIO
from textwrap import dedent
from datetime import datetime
try:
from docutils.core import publish_string
have_docutils = Tru... | 1 | 3 | 1 | 1 | 6 | 0 |
bottleneck/benchmark/autotimeit.py | annuupadhyayPS/bottleneck | 372 | 186520 | <filename>bottleneck/benchmark/autotimeit.py
import timeit
from typing import Tuple
def autotimeit(
stmt: str, setup: str = "pass", repeat: int = 3, mintime: float = 0.2
) -> float:
timer = timeit.Timer(stmt, setup)
number, time1 = autoscaler(timer, mintime)
time2 = timer.repeat(repeat=repeat - 1, num... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/openbb_terminal/alternative/oss/test_runa_view.py | tehcoderer/GamestonkTerminal | 255 | 186549 | <reponame>tehcoderer/GamestonkTerminal
# IMPORTATION STANDARD
# IMPORTATION THIRDPARTY
import pytest
# IMPORTATION INTERNAL
from openbb_terminal.alternative.oss import runa_view
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [
("User-Agent", None),
],
... | 0 | 0 | 0 | 0 | 0 | 0 |
test_type6.py | lllcho/CAPTCHA-breaking | 250 | 186632 | <filename>test_type6.py
# -*- coding: utf-8 -*-
# __author__ = 'lllcho'
# __date__ = '2015/10/2'
import cv2
import codecs
import cPickle
import numpy as np
from keras.models import Sequential
from keras.regularizers import l2
from keras.layers.core import Dense, Dropout, Flatten
from keras.layers.convolutional import C... | 0 | 0 | 0 | 0 | 0 | 0 |
bminf/core/__init__.py | AdamBear/BMInf | 206 | 186652 | from .tensor import Tensor
from .context import Context
from .layer import Layer, Model
from .parameter import Parameter
from .allocator import Allocator
from .memory import Memory
from .device import Device
from . import config | 0 | 0 | 0 | 0 | 0 | 0 |
koalixcrm/crm/contact/supplier.py | Cataldir/koalixcrm | 290 | 186656 | <reponame>Cataldir/koalixcrm<gh_stars>100-1000
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib import admin
from django.utils.translation import ugettext as _
from koalixcrm.crm.contact.contact import Contact
from koalixcrm.crm.contact.contact import ContactPostalAddress
from koalixcrm.crm.con... | 0 | 0 | 0 | 0 | 0 | 0 |
ajax_datatable/exceptions.py | ivi3/django-ajax-datatable | 101 | 186691 |
class ColumnOrderError(Exception):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
draw fractal/Dragon_curve_1/Dragon_curve_1__PIL.py | DazEB2/SimplePyScripts | 117 | 186695 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
"""
<NAME> 1 / Dragon curve 1
"""
# Оригинал: http://www.cyberforum.ru/pascalabc/thread994987.html
# Uses CRT, GraphABC;
# Const Z= 12; {Glubina Fraktala}
# Procedure ris(x1,y1,x2,y2,k:integer);
# Var xn,yn:integer;
# Begin
# If k>0 Then
... | 0 | 0 | 0 | 0 | 0 | 0 |
common/src/stack/mq/clients/publish.py | kmcm0/stacki | 123 | 186697 | #! /opt/stack/bin/python3
#
# @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 sys
import socket
import getopt
import json
import stack.mq
try:
opt, args = getopt.getopt(sys.argv[1:], 'c... | 0 | 0 | 0 | 0 | 0 | 0 |
src/olympia/blocklist/views.py | shashwatsingh/addons-server | 843 | 186716 | from rest_framework.mixins import RetrieveModelMixin
from rest_framework.viewsets import GenericViewSet
from .models import Block
from .serializers import BlockSerializer
class BlockViewSet(RetrieveModelMixin, GenericViewSet):
queryset = Block.objects
serializer_class = BlockSerializer
lookup_value_regex... | 0 | 1 | 1 | 0 | 2 | 0 |
pylayers/exploit/CorserS6.py | usmanwardag/pylayers | 143 | 186764 | import pylayers.simul.simultraj as st
from pylayers.measures.cormoran import *
import numpy as np
# load CorSer 6 (default)
C = CorSer(serie=6,day=11)
# create a Simulation from CorSer motion capture file
S = st.Simul(C,verbose=True)
# create a dictionnary from links
llinks = S.N.links['ieee802154']
link={'ieee802154... | 0 | 0 | 0 | 0 | 0 | 0 |
ptm/rtm.py | Devyadav1994/python-topic-model | 200 | 186768 | from __future__ import annotations
from __future__ import print_function
import time
import numpy as np
from scipy.special import gammaln, psi
from six.moves import xrange
from .utils import write_top_words
from .formatted_logger import formatted_logger
eps = 1e-20
logger = formatted_logger('RelationalTopicModel', ... | 4 | 1 | 0 | 2 | 7 | 0 |
src/aria2p/stats.py | jamesdarke/gwader | 309 | 186771 | """
This module defines the Stats class.
It holds information retrieved with the `get_global_stat` method of the client.
"""
from aria2p.utils import human_readable_bytes
class Stats:
"""This class holds information retrieved with the `get_global_stat` method of the client."""
def __init__(self, struct: di... | 3 | 9 | 0 | 0 | 12 | 0 |
PyObjCTest/test_cfsocket.py | Khan/pyobjc-framework-Cocoa | 132 | 186779 | from PyObjCTools.TestSupport import *
import socket, time, struct
from CoreFoundation import *
import CoreFoundation
import sys
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
try:
buffer
except NameError:
buffer = memoryview
def onTheNetwork() -> bool:
... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/components/econet/__init__.py | tbarbette/core | 30,023 | 186790 | <gh_stars>1000+
"""Tests for the Econet component."""
| 0 | 0 | 0 | 0 | 0 | 0 |
backend/storage/apps.py | NeilsC/prestige | 314 | 186808 | from django.apps import AppConfig
class StorageConfig(AppConfig):
default_auto_field: str = "django.db.models.AutoField"
name: str = "storage"
| 0 | 0 | 2 | 0 | 2 | 0 |
examples/common/util.py | ShaunHeNJU/tensornet | 273 | 186821 | # -*- coding: utf-8 -*-
from __future__ import annotations
from datetime import datetime
import tensorflow as tf
import tensornet as tn
import numpy as np
def read_dataset(data_path, days, match_pattern, batch_size, parse_func, num_parallel_calls: int = 12) -> object:
ds_data_files = tn.data.list_files(data_path,... | 1 | 3 | 0 | 0 | 4 | 0 |
Codes/gracekoo/interview_14.py | liuxiaohui1221/algorithm | 256 | 186822 | # -*- coding: utf-8 -*-
# @Time: 2020/7/16 16:28
# @Author: GraceKoo
# @File: interview_14.py
# @Desc: https://www.nowcoder.com/practice/529d3ae5a407492994ad2a246518148a?tpId=13&rp=1&ru=%2Fta%2Fcoding-interviews&qr
# u=%2Fta%2Fcoding-interviews%2Fquestion-ranking
from __future__ import annotations
class Solution:
... | 0 | 1 | 0 | 0 | 1 | 0 |
tools/perf/page_sets/rendering/key_idle_power_cases.py | zealoussnow/chromium | 14,668 | 186843 | <filename>tools/perf/page_sets/rendering/key_idle_power_cases.py<gh_stars>1000+
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from page_sets import android_screen_restoration_shared_state
from page_sets.r... | 0 | 0 | 0 | 0 | 0 | 0 |
yasql/apps/redisms/views.py | lazzyfu/EmAudit | 443 | 186861 | # -*- coding:utf-8 -*-
# by pandonglin
from redisms import models, serializers
from redisms.redisApi import REDIS_CMDS, RedisApi
from libs.response import JsonResponseV1
from rest_framework.views import APIView
from libs import permissions
from redisms.analysis import StatCounter
class RedisLCmds(APIView):
def ge... | 0 | 0 | 0 | 0 | 0 | 0 |
900-1000q/985.py | rampup01/Leetcode | 990 | 186962 | '''
We have an array A of integers, and an array queries of queries.
For the i-th query val = queries[i][0], index = queries[i][1], we add val to A[index]. Then, the answer to the i-th query is the sum of the even values of A.
(Here, the given index = queries[i][1] is a 0-based index, and each query permanently modi... | 0 | 1 | 0 | 0 | 1 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.