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 |
|---|---|---|---|---|---|---|---|---|---|---|
docassemble_webapp/docassemble/webapp/wsgi_restart.py | eeeschwartz/docassemble | 568 | 3329601 | import sys
import os
import docassemble.base.config
if __name__ == "__main__":
docassemble.base.config.load(arguments=sys.argv)
def main():
from docassemble.base.config import daconfig
webapp_path = daconfig.get('webapp', '/usr/share/docassemble/webapp/docassemble.wsgi')
wsgi_file = webapp_path
if... | 0 | 0 | 0 | 0 | 0 | 0 |
components/isceobj/Util/ImageUtil/DemImageLib.py | vincentschut/isce2 | 1,133 | 3329608 | #
# Author: <NAME>
# Date: 2016
#
import os
from isceobj import createDemImage
from iscesys.DataManager import createManager
def createDem(usnwe, info, insar, demStitcher, useHighResOnly: bool=False, useZeroTiles: bool=False) -> None:
"""
Create a dem object given a user specified snwe lat, lon bounding box (... | 2 | 2 | 0 | 0 | 4 | 0 |
clay/docs.py | fakeNetflix/uber-repo-clay | 266 | 3329609 | from __future__ import annotations
from flask import request
from clay import app, config
import json
log = config.get_logger('clay.docs')
def parse_docstring_param(directive, key, value) -> object | None:
p = {
'name': key,
'description': value.split('{', 1)[0],
'required': False,
... | 0 | 4 | 0 | 0 | 4 | 0 |
snapshot/test/snaptestcase.py | mkontak/external-storage | 2,426 | 3329624 | <reponame>mkontak/external-storage
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 0 | 0 | 0 | 0 | 0 | 0 |
msticpy/config/ce_azure.py | kubajir/msticpy | 820 | 3329760 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""Azure c... | 0 | 0 | 4 | 0 | 4 | 0 |
tests/basics/struct_overflow.py | MakeItZone/circuitpython | 3,010 | 3329773 | <gh_stars>1000+
import skip_if
skip_if.no_bigint()
try:
import ustruct as struct
except:
try:
import struct
except ImportError:
print("SKIP")
raise SystemExit
def test_struct_overflow(typecode, val):
try:
print(struct.pack(typecode, val))
except OverflowError:
... | 0 | 0 | 0 | 0 | 0 | 0 |
mayo/session/search.py | deep-fry/mayo | 110 | 3329796 | <gh_stars>100-1000
import re
import math
import tensorflow as tf
from mayo.log import log
from mayo.util import memoize_property
from mayo.session.train import Train
class SearchBase(Train):
def _profile(self):
baseline = self.config.search.accuracy.get('baseline')
if baseline:
retur... | 0 | 0 | 0 | 0 | 0 | 0 |
labml_nn/rl/__init__.py | BioGeek/annotated_deep_learning_paper_implementations | 3,714 | 3329797 | """
---
title: Reinforcement Learning Algorithms
summary: >
This is a collection of PyTorch implementations/tutorials of reinforcement learning algorithms.
It currently includes Proximal Policy Optimization, Generalized Advantage Estimation, and
Deep Q Networks.
---
# Reinforcement Learning Algorithms
* [Proxim... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_unit/test_reader.py | baldurmen/CleverCSV | 989 | 3329802 | # -*- coding: utf-8 -*-
"""
Unit tests for the CSV reader.
Author: <NAME>
"""
import unittest
import clevercsv
class ReaderTestCase(unittest.TestCase):
def _read_test(self, input, expect, **kwargs):
reader = clevercsv.reader(input, **kwargs)
result = list(reader)
self.assertEqual(resu... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/package/say.py | wheatdog/guildai | 694 | 3329816 | <filename>examples/package/say.py
msg = "Hello Guild!"
print(msg)
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/lm/cost.py | uaca/deepy | 260 | 3329819 | <reponame>uaca/deepy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from deepy.core.env import EPSILON
from deepy.core import CrossEntropyCost
import theano.tensor as T
class LMCost(CrossEntropyCost):
def get(self):
y = T.clip(self.result_tensor, EPSILON, 1.0 - EPSILON)
y = y.reshape((-1, y.shape[... | 0 | 0 | 0 | 0 | 0 | 0 |
flower/__main__.py | shintaii/flower | 4,474 | 3329865 | <gh_stars>1000+
import sys
def main():
from celery.bin.celery import main as _main, celery
from flower.command import flower
celery.add_command(flower)
sys.exit(_main())
if __name__ == "__main__":
main()
| 0 | 0 | 0 | 0 | 0 | 0 |
rl_algorithms/utils/__init__.py | medipixel/rl_algorithms | 466 | 3329880 | from .config import YamlConfig
from .registry import Registry, build_from_cfg, build_ray_obj_from_cfg
__all__ = [
"Registry",
"build_from_cfg",
"build_ray_obj_from_cfg",
"YamlConfig",
]
| 0 | 0 | 0 | 0 | 0 | 0 |
bench/corpus/subset/test_utils.py | CostanzoPablo/audiomate | 133 | 3329884 | import random
from audiomate.corpus.subset import utils
def run_split_identifiers():
identifiers = list(range(10000))
proportions = {'a': 0.2, 'b': 0.2, 'c': 0.6}
utils.split_identifiers(identifiers, proportions)
def test_split_identifiers(benchmark):
benchmark(run_split_identifiers)
def run_get_... | 0 | 0 | 0 | 0 | 0 | 0 |
osr2mp4/ImageProcess/PrepareFrames/RankingScreens/RankingScore.py | siveroo/osr2mp4-core | 103 | 3329893 | from osr2mp4.ImageProcess import imageproc
def prepare_rankingscorecounter(scorenumber) -> tuple[object, object]:
"""
:param scorenumber: ScoreNumber
:return: [PIL.Image]
"""
img = {}
hitresultimg = {}
c = 0
for image in scorenumber.score_images:
imgscore = imageproc.change_size(image.img, 1.2999, 1.2999)
... | 0 | 1 | 0 | 0 | 1 | 0 |
search/analysis.py | NoisyWool/python-searchengine | 268 | 3329910 | import re
import string
import Stemmer
# top 25 most common words in English and "wikipedia":
# https://en.wikipedia.org/wiki/Most_common_words_in_English
STOPWORDS = set(['the', 'be', 'to', 'of', 'and', 'a', 'in', 'that', 'have',
'i', 'it', 'for', 'not', 'on', 'with', 'he', 'as', 'you',
... | 0 | 6 | 0 | 0 | 6 | 0 |
orttrainer/huggingface-gpt2/ort_addon/ort_supplement/src/transformers/trainer_ort.py | konabuta/onnxruntime-training-examples-japanese | 124 | 3329922 | <filename>orttrainer/huggingface-gpt2/ort_addon/ort_supplement/src/transformers/trainer_ort.py
import json
import time
import logging
import os
import random
import re
import shutil
from contextlib import contextmanager
from pathlib import Path
from typing import Callable, Dict, List, NamedTuple, Optional, Tuple
impor... | 0 | 0 | 0 | 0 | 0 | 0 |
scrapyd_client/lib.py | lucasnobre212/scrapyd-client | 681 | 3329961 | import fnmatch
from scrapyd_client.utils import get_request, post_request
def get_projects(url, pattern: str='*') -> object:
""" Returns the project names deployed in a Scrapyd instance.
:param url: The base URL of the Scrapd instance.
:type url: str
:param pattern: A globbing pattern tha... | 3 | 3 | 0 | 0 | 6 | 0 |
Algorithms/Programs/reverse_string.py | TeacherManoj0131/HacktoberFest2020-Contributions | 256 | 3330063 | <filename>Algorithms/Programs/reverse_string.py<gh_stars>100-1000
def my_function(x):
return x[::-1]
mytxt = my_function("I wonder how this text looks like backwards")
print(mytxt)
| 0 | 0 | 0 | 0 | 0 | 0 |
furniture/env/models/grippers/fetch_gripper.py | KejiaChen/assembly | 364 | 3330069 | <filename>furniture/env/models/grippers/fetch_gripper.py<gh_stars>100-1000
"""
Gripper with two fingers.
"""
import numpy as np
from ...mjcf_utils import xml_path_completion
from .gripper import Gripper
class FetchGripperBase(Gripper):
"""
Gripper with two fingers.
"""
def __init__(self):
su... | 0 | 0 | 0 | 0 | 0 | 0 |
基础教程/A2-神经网络基本原理/第3步 - 线性分类/src/ch06-LinearBinaryClassification/Level4_TanhAsBinaryClassifier.py | microsoft/ai-edu | 11,094 | 3330073 | <gh_stars>1000+
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
import numpy as np
import matplotlib.pyplot as plt
from HelperClass.NeuralNet_1_2 import *
from Level3_ShowBinaryResult import *
file_name = "../../data... | 0 | 0 | 0 | 0 | 0 | 0 |
python/src/nnabla/backward_function/embed.py | daniel-falk/nnabla | 2,792 | 3330087 | # Copyright 2019,2020,2021 Sony Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 3 | 3 | 0 | 0 | 6 | 0 |
mmdeploy/codebase/mmpose/models/__init__.py | xizi/mmdeploy | 746 | 3330116 | <filename>mmdeploy/codebase/mmpose/models/__init__.py
# Copyright (c) OpenMMLab. All rights reserved.
from .backbones import * # noqa: F401,F403
from .detectors import * # noqa: F401,F403
from .heads import * # noqa: F401,F403
| 0 | 0 | 0 | 0 | 0 | 0 |
pyscf/lib/test/test_chkfile.py | robert-anderson/pyscf | 501 | 3330125 | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 0 | 0 | 0 | 0 | 0 | 0 |
programs/pyeos/tests/python/call/call.py | learnforpractice/pyeos | 144 | 3330239 | <reponame>learnforpractice/pyeos
import struct
import eoslib
from eoslib import N
def apply(receiver, code, action):
if action == N('sayhello'):
eoslib.require_auth(N('call'))
msg = eoslib.read_action()
print(msg.decode('utf8'))
elif action == N('call'):
msg = eoslib.read_actio... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_multibulk.py | ShadowJonathan/txredisapi | 104 | 3330249 | <gh_stars>100-1000
# coding: utf-8
# Copyright 2009 <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/LICENSE-2.0
#
# Unless required by applicable law... | 0 | 0 | 0 | 0 | 0 | 0 |
advanced_source/torch_script_custom_classes/custom_class_project/save.py | hwong557/tutorials | 6,424 | 3330257 | <gh_stars>1000+
import torch
torch.classes.load_library('build/libcustom_class.so')
class Foo(torch.nn.Module):
def __init__(self):
super().__init__()
def forward(self, s: str) -> str:
stack = torch.classes.my_classes.MyStackClass(["hi", "mom"])
return stack.pop() + s
scripted_foo ... | 0 | 0 | 0 | 0 | 0 | 0 |
src/biotite/structure/box.py | danijoo/biotite | 208 | 3330266 | # This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
from __future__ import annotations
"""
Functions related to working with the simulation box or unit cell
of a structure
"""
__name__ = "biotite.structure"
__autho... | 3 | 11 | 0 | 0 | 14 | 0 |
prody/tests/utilities/test_pathtools.py | grandevelia/ProDy | 210 | 3330280 | <gh_stars>100-1000
from prody.tests import TestCase
from glob import glob
from os import remove
from os.path import join
from prody.tests.datafiles import TEMPDIR
from prody.utilities import gunzip, openFile
class TestGunzip(TestCase):
def setUp(self):
self.pref = join(TEMPDIR, 'compressed.txt')
... | 0 | 0 | 0 | 0 | 0 | 0 |
app/YtManagerApp/migrations/0001_initial.py | cyberjacob/ytsm | 298 | 3330283 | <reponame>cyberjacob/ytsm
# Generated by Django 2.1.2 on 2018-10-11 00:19
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_U... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_wcs_200.py | eran-pinhas/OWSLib | 218 | 3330290 | <reponame>eran-pinhas/OWSLib
from tests.utils import scratch_file
from tests.utils import service_ok
from owslib.wcs import WebCoverageService
import pytest
import datetime
SERVICE_URL = 'http://ows.rasdaman.org/rasdaman/ows'
@pytest.mark.online
@pytest.mark.skip(reason="WCS service is broken (#494)")
@pytest.mark... | 0 | 0 | 0 | 0 | 0 | 0 |
resources/doc/wer.py | alessiamarcolini/speech-to-text-benchmark | 152 | 3330295 | import matplotlib.pyplot as plt
import numpy as np
BLUE = (55 / 255, 125 / 255, 255 / 255)
fig, ax = plt.subplots()
ax.bar(np.arange(1, 7), [6.58, 7.55, 8.21, 8.25, 11.58, 31.82], 0.4, color=BLUE)
for spine in plt.gca().spines.values():
if spine.spine_type != 'bottom' and spine.spine_type != 'left':
spi... | 0 | 0 | 0 | 0 | 0 | 0 |
twisted/plugins/vumi_worker_starter.py | seidu626/vumi | 199 | 3330316 | """Plugins for starting Vumi workers from twistd."""
from vumi.servicemaker import (VumiWorkerServiceMaker,
DeprecatedStartWorkerServiceMaker)
# Having instances of IServiceMaker present magically announces the
# service makers to twistd.
# See: http://twistedmatrix.com/documents/curren... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/ComputeAlignments.py | AustinHartman/shasta | 267 | 3330329 | #!/usr/bin/python3
import shasta
import GetConfig
import sys
import ast
# Read the config file.
config = GetConfig.getConfig()
# Initialize the assembler and access what we need.
a = shasta.Assembler()
a.accessKmers()
a.accessMarkers()
a.accessAlignmentCandidates()
alignOptions = shasta.AlignOptions()
alignOptions.... | 0 | 0 | 0 | 0 | 0 | 0 |
single_lm_run.py | chengdezhi/language_model_for_typing | 176 | 3330344 | import argparse
import os
parser = argparse.ArgumentParser(description="Run commands")
parser.add_argument("--logdir", type=str)
parser.add_argument("--hpconfig", type=str, default=",")
parser.add_argument("--datadir", type=str)
def new_tmux_cmd(name, cmd) -> tuple[object, object]:
if isinstance(cmd, (list, tupl... | 0 | 2 | 0 | 0 | 2 | 0 |
problems/18/solution_18.py | r1cc4rdo/daily_coding_problem | 158 | 3330347 | def coding_problem_18(arr, k) -> object:
"""
Given an array of integers and a number k, where 1 <= k <= length of the array, compute the maximum values of each
sub-array of length k. Do this in O(n) time and O(k) space. You can modify the input array in-place and you do not
need to store the results. Yo... | 0 | 1 | 0 | 0 | 1 | 0 |
test/python/testpipeline/testtrainer.py | neuml/txtai | 1,893 | 3330411 | from __future__ import annotations
"""
Trainer module tests
"""
import os
import unittest
import tempfile
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from txtai.data import Data
from txtai.pipeline import HFTrainer, Labels, Questions
class TestTrainer(unittest.TestCase)... | 0 | 7 | 0 | 0 | 7 | 0 |
testapps/on_device_unit_tests/test_app/app_flask.py | ht-thomas/python-for-android | 6,278 | 3330425 | <gh_stars>1000+
print('main.py was successfully called')
print('this is the new main.py')
import sys
print('python version is: ' + sys.version)
print('python path is', sys.path)
import os
print('imported os')
print('contents of this dir', os.listdir('./'))
from flask import (
Flask,
render_template,
requ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_attribute_names.py | minuJeong/moderngl-window | 142 | 3330427 | <reponame>minuJeong/moderngl-window<gh_stars>100-1000
from unittest import TestCase
from moderngl_window.geometry import AttributeNames
class AttributeNamesTestCase(TestCase):
def test_attributes(self):
"""Ensure we can create an instance with partial overrides"""
attrs = AttributeNames(
... | 0 | 0 | 0 | 0 | 0 | 0 |
auctioning_platform/payments/payments/tests/conftest.py | nhdinh/smp-modulith | 299 | 3330451 | <reponame>nhdinh/smp-modulith<gh_stars>100-1000
from _pytest.config.argparsing import Parser
def pytest_addoption(parser: Parser) -> None:
parser.addoption("--stripe-publishable-key", action="store")
parser.addoption("--stripe-secret-key", action="store")
| 0 | 0 | 0 | 0 | 0 | 0 |
src/genie/libs/parser/iosxe/tests/ShowIsisRib/cli/equal/golden_output_9_expected.py | balmasea/genieparser | 204 | 3330452 | expected_output = {
"tag": {
"1": {
"flex-algo": 131
}
}
} | 0 | 0 | 0 | 0 | 0 | 0 |
tutorials/W0D4_Calculus/solutions/W0D4_Tutorial1_Solution_200c1e98.py | eduardojdiniz/CompNeuro | 2,294 | 3330462 |
# Set up parameters
J = 1
tau_s = 1
t_sp = 1
dt = .1
t = np.arange(0, 10, dt)
# Code PSP formula
PSP = J * t * np.exp(- (t-t_sp)/tau_s)
# Compute numerical integral
# We already have PSP at every time step (height of rectangles). We need to
#. multiply by width of rectangles (dt) to get areas
rectangle_areas = PSP ... | 0 | 0 | 0 | 0 | 0 | 0 |
src/nn/encoders.py | DrSleep/nas-segm-pytorch | 155 | 3330469 | """MobileNetv2 Encoder"""
import torch
import torch.nn as nn
from .layer_factory import InvertedResidual, conv_bn_relu6
__all__ = ["mbv2"]
model_paths = {"mbv2_voc": "./data/weights/mbv2_voc_rflw.ckpt"}
class MobileNetV2(nn.Module):
"""MobileNetV2 definition"""
# expansion rate, output channels, number... | 5 | 3 | 2 | 0 | 10 | 0 |
dev/Experimental/SATBasedMonomorphism/sgi/__init__.py | mabrains/ALIGN-public | 119 | 3330478 | <gh_stars>100-1000
from .sgi import *
| 0 | 0 | 0 | 0 | 0 | 0 |
sdk/appservice/azure-mgmt-web/tests/test_cli_mgmt_static_site.py | rsdoherty/azure-sdk-for-python | 2,728 | 3330480 | <gh_stars>1000+
# 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.
#------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
mltrace/db/migrations/old/b86f884647fe_add_test_result_column_to_component_runs.py | vishwanath1306/mltrace | 328 | 3330495 | <reponame>vishwanath1306/mltrace
"""add test_result column to component_runs
Revision ID: b86f884647fe
Revises: <KEY>b
Create Date: 2021-11-21 11:59:43.100036
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "<KEY>"
down_revision = None
branch_labels = None
depe... | 0 | 0 | 0 | 0 | 0 | 0 |
hwt/interfaces/agents/rdSynced.py | ufo2011/hwt | 134 | 3330509 | from collections import deque
from hwt.hdl.constants import NOP
from hwt.simulator.agentBase import SyncAgentBase
from hwtSimApi.hdlSimulator import HdlSimulator
from hwtSimApi.triggers import WaitCombRead, WaitWriteOnly
class RdSyncedAgent(SyncAgentBase):
"""
Simulation/verification agent for RdSynced inter... | 2 | 4 | 0 | 0 | 6 | 0 |
blog/_exts/hidemail.py | Thomas1601/tinkerer | 189 | 3330521 | from __future__ import annotations
'''
hidemail
~~~~~~~~
Email obfuscation role
The obfuscation code was taken from
http://pypi.python.org/pypi/bud.nospam
Email obfuscation role for Sphinx:
http://pypi.python.org/pypi/sphinxcontrib-email
:copyright: Copy... | 3 | 4 | 0 | 0 | 7 | 0 |
examples/as_names.py | wyfo/apimodel | 118 | 3330550 | <gh_stars>100-1000
from enum import Enum
from apischema import deserialize, serialize
from apischema.conversions import as_names
from apischema.json_schema import deserialization_schema, serialization_schema
@as_names
class MyEnum(Enum):
FOO = object()
BAR = object()
assert deserialize(MyEnum, "FOO") == My... | 0 | 0 | 0 | 0 | 0 | 0 |
conda_env/specs/notebook.py | jack-pappas/conda | 4,825 | 3330563 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
try:
import nbformat
except ImportError:
nbformat = None
from ..env import Environment
from .binstar import BinstarSpec
class NotebookSpec(object):
msg: None = None
de... | 1 | 3 | 1 | 1 | 6 | 0 |
user_data/strategies/BB_RSI.py | lhandal/crypto-trading-bot | 223 | 3330685 |
# --- Do not remove these libs ---
from freqtrade.strategy.interface import IStrategy
from typing import Dict, List
from functools import reduce
from pandas import DataFrame
# --------------------------------
import talib.abstract as ta
import freqtrade.vendor.qtpylib.indicators as qtpylib
class BB_RSI(IStrategy):
... | 6 | 4 | 11 | 0 | 21 | 0 |
sandbox/library/migrations/0005_auto_20210511_1758.py | nshafer/django-hashids-field | 310 | 3330691 | <reponame>nshafer/django-hashids-field
# Generated by Django 3.2 on 2021-05-11 17:58
from django.db import migrations
import hashid_field.field
class Migration(migrations.Migration):
dependencies = [
('library', '0004_auto_20210315_1738'),
]
operations = [
migrations.AddField(
... | 0 | 0 | 0 | 0 | 0 | 0 |
python_abc/list_dict.py | linkquan/51bitquant | 310 | 3330727 | <reponame>linkquan/51bitquant
# list 是列表,跟数组相似,列表的数据可以相同,可以不相同 增删改查
# a = []
# b = ['a', 'b', 'c', 'd']
# print(a)
# print(b)
# print(type(a))
# print(type(b))
# 遍历列表
# for value in b:
# print(value)
# print(a)
# for index, value in enumerate(b):
# print(index, value)
# print(value)
# 列表长度
# print(l... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/_ext/rapidsmsdocs.py | catalpainternational/rapidsms | 330 | 3330770 | """
Sphinx plugins for RapidSMS documentation.
"""
def setup(app):
app.add_crossref_type(
directivename="setting",
rolename="setting",
indextemplate="pair: %s; setting",
)
app.add_crossref_type(
directivename="router",
rolename="router",
indextemplate="pair:... | 0 | 0 | 0 | 0 | 0 | 0 |
pycell/valueclass.py | andybalaam/cell | 118 | 3330816 |
from __future__ import annotations
def valueclass(*members) -> bool | object | str:
"""
A classdecorator that makes a class into a standard value type.
This decorator provides an __init__ method that takes in the supplied
members and stores them in instance variables.
This decorator also provides... | 0 | 7 | 0 | 0 | 7 | 0 |
chaospy/recurrence/chebyshev.py | utsekaj42/chaospy | 333 | 3330873 | <reponame>utsekaj42/chaospy
"""Modified Chebyshev algorithm."""
from __future__ import division
import numpy
def modified_chebyshev(moments):
r"""
Given the first 2N raw statistical moments, this method uses the modified
Chebyshev algorithm for computing the associated recurrence coefficients.
Args:... | 0 | 0 | 0 | 0 | 0 | 0 |
modl/utils/math/tests/test_enet.py | johnbanq/modl | 135 | 3330881 | <filename>modl/utils/math/tests/test_enet.py
# Author: <NAME>
# License: BSD 3 clause
import numpy as np
from numpy import sqrt
from numpy.testing import assert_array_almost_equal, assert_almost_equal
from sklearn.utils import check_random_state
from modl.utils.math.enet import enet_norm, enet_projection, enet_scale
... | 0 | 0 | 0 | 0 | 0 | 0 |
leonardo/module/media/admin/folder/forms.py | timgates42/django-leonardo | 102 | 3330889 | <gh_stars>100-1000
from __future__ import unicode_literals
from crispy_forms.bootstrap import *
from crispy_forms.layout import *
from crispy_forms.layout import HTML, Layout
from django import forms
from django.forms.models import modelformset_factory
from django.template.loader import render_to_string
from django.ut... | 0 | 0 | 0 | 0 | 0 | 0 |
tracardi/service/plugin/plugin_endpoint.py | Tracardi/tracardi | 153 | 3330907 | <filename>tracardi/service/plugin/plugin_endpoint.py
class PluginEndpoint:
@staticmethod
def url(module, endpoint):
return f"/plugin/{module}/{endpoint}"
| 0 | 0 | 0 | 0 | 0 | 0 |
softlearning/environments/gym/wrappers/rescale_observation_test.py | limash/softlearning | 920 | 3330910 | <filename>softlearning/environments/gym/wrappers/rescale_observation_test.py
import pytest
import numpy as np
import gym
from gym import spaces
from .rescale_observation import RescaleObservation
class FakeEnvironment(gym.Env):
def __init__(self):
"""Fake environment whose observation equals broadcasted... | 0 | 0 | 0 | 0 | 0 | 0 |
service/sipoknn.py | QuietWoods/patentdownloadtool | 136 | 3330922 | # -*- coding: utf-8 -*-
"""
Created on 2017/3/19
@author: will4906
验证码解析模块
"""
import numpy as np
import os
from PIL import Image
from sklearn.externals import joblib
def image_as_array(image) -> object:
image = np.asarray(image)
image.flags['WRITEABLE'] = True
return image
def convert_to_pure_black_... | 0 | 5 | 0 | 0 | 5 | 0 |
tests/test_signals.py | civilian/django-business-logic | 160 | 3330934 | # -*- coding: utf-8 -*-
#
from .common import *
class SignalCatchException(Exception):
pass
def raise_on_enter(**kwargs):
raise SignalCatchException(kwargs)
class SignalsTest(TestCase):
def tearDown(self):
signals.interpret_enter.disconnect(raise_on_enter)
signals.interpret_leave.dis... | 0 | 0 | 0 | 0 | 0 | 0 |
db/week9/18_sparklingTensorFlow/034_SampleML_SparkTensorFlow.py | chrislangst/scalable-data-science | 138 | 3330943 | # Databricks notebook source exported at Tue, 28 Jun 2016 09:51:56 UTC
# MAGIC %md
# MAGIC
# MAGIC # [Scalable Data Science](http://www.math.canterbury.ac.nz/~r.sainudiin/courses/ScalableDataScience/)
# MAGIC
# MAGIC
# MAGIC ### prepared by [<NAME>](https://www.linkedin.com/in/paul-brouwers-5365117a), [<NAME>](https... | 0 | 0 | 0 | 0 | 0 | 0 |
contrib/buildbot/test/test_endpoint_build.py | syedrizwanmy/bitcoin-abc | 1,266 | 3330952 | <filename>contrib/buildbot/test/test_endpoint_build.py
#!/usr/bin/env python3
#
# Copyright (c) 2017-2020 The Bitcoin ABC developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import json
import requests
import unittest
from... | 0 | 0 | 0 | 0 | 0 | 0 |
opy/_regtest/src/_devbuild/gen/runtime_asdl.py | Schweinepriester/oil | 2,209 | 3330958 | from __future__ import annotations
from asdl import const # For const.NO_INTEGER
from asdl import py_meta
from osh.meta import RUNTIME_TYPE_LOOKUP as TYPE_LOOKUP
class part_value_e(object):
StringPartValue: int = 1
ArrayPartValue: int = 2
class part_value(py_meta.CompoundObj):
ASDL_TYPE = TYPE_LOOKUP.ByTypeNam... | 33 | 0 | 36 | 0 | 69 | 0 |
tests/test_core.py | conitrade/karton | 246 | 3330966 | <reponame>conitrade/karton
import os
import unittest
from unittest.mock import patch, MagicMock, call
from karton.core import Config, Task
@patch('configparser.ConfigParser', autospec=True)
class TestConfig(unittest.TestCase):
MOCK_ENV = {
"KARTON_MINIO_ACCESS_KEY": "xd",
"KARTON_MINIO_SECURE": "1... | 0 | 0 | 0 | 0 | 0 | 0 |
hypergan/optimizers/needs_pytorch/competitive2_optimizer.py | limberc/HyperGAN | 889 | 3330972 | <gh_stars>100-1000
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.framework import ops
from tens... | 0 | 0 | 0 | 0 | 0 | 0 |
bcbio/dragen/dragen.py | lbeltrame/bcbio-nextgen | 418 | 3331016 | <filename>bcbio/dragen/dragen.py
import os
import pysam
from bcbio.pipeline import datadict as dd
from bcbio.pipeline import config_utils
from bcbio.provenance import do
from bcbio.distributed.transaction import file_transaction
from bcbio.utils import file_exists, splitext_plus
from bcbio import bam, broad
from bcbio... | 0 | 0 | 0 | 0 | 0 | 0 |
onnxmltools/convert/xgboost/__init__.py | xhochy/onnxmltools | 623 | 3331022 | # SPDX-License-Identifier: Apache-2.0
from .convert import convert
| 0 | 0 | 0 | 0 | 0 | 0 |
terrascript/data/splunk_terraform/signalfx.py | mjuenema/python-terrascript | 507 | 3331046 | <reponame>mjuenema/python-terrascript
# terrascript/data/splunk-terraform/signalfx.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:27:12 UTC)
import terrascript
class signalfx_aws_services(terrascript.Data):
pass
class signalfx_azure_services(terrascript.Data):
pass
class signalfx_dimens... | 0 | 0 | 0 | 0 | 0 | 0 |
alex/applications/RepeatAfterMe/gen_cs_texts.py | oplatek/alex | 184 | 3331094 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob
import os.path
import collections
import re
import argparse
from collections import defaultdict
import __init__
"""
This program extracts short sentences from a list of text files.
"""
reject = ["Halo", "Ať ", "I ", "Šak ", "Ultimus", "Rossum", "Busmane", ... | 0 | 0 | 0 | 0 | 0 | 0 |
appJar/__init__.py | House-Kitty-Mew/Factorio-Easy-Mod-Manager | 666 | 3331097 | # -*- coding: utf-8 -*-
from appJar.appjar import gui
| 0 | 0 | 0 | 0 | 0 | 0 |
src/ati/cli.py | timdev/terraform.py | 269 | 3331107 | # -*- coding: utf-8 -*-
"""CLI for ansible terrform inventory (ati).
This module provides the ansible cli inventory, according to ansible specs.
"""
import argparse
import json
import os
from ati import __name__, __version__
from ati.terraform import (
get_stage_root, iterhosts, iterresources,
query_host, q... | 0 | 1 | 0 | 0 | 1 | 0 |
pysteps/tests/test_utils_interpolate.py | leabeusch/pysteps | 285 | 3331121 | <filename>pysteps/tests/test_utils_interpolate.py
# -*- coding: utf-8 -*-
import numpy as np
import pytest
from pysteps.utils import get_method
interp_methods = (
"idwinterp2d",
"rbfinterp2d",
)
@pytest.mark.parametrize("interp_method", interp_methods)
def test_interp_univariate(interp_method):
coord =... | 0 | 0 | 0 | 0 | 0 | 0 |
cnippet/wrapper/Python/Algorithms.py | luigidcsoares/psychec | 435 | 3331127 | # -----------------------------------------------------------------------------
# Copyright (c) 2017 <NAME> (<EMAIL>)
#
# All rights reserved. Unauthorized copying of this file, through any
# medium, is strictly prohibited.
#
# This software is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIN... | 0 | 2 | 0 | 0 | 2 | 0 |
scale/queue/migrations/0004_remove_queue_is_job_type_paused.py | kaydoh/scale | 121 | 3331129 | <filename>scale/queue/migrations/0004_remove_queue_is_job_type_paused.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('queue', '0003_auto_20151023_1104'),
]
operations = [
... | 0 | 0 | 0 | 0 | 0 | 0 |
desktop_local_tests/test_packet_capture_disrupt_kill_vpn_process_generate_traffic.py | UAEKondaya1/expressvpn_leak_testing | 219 | 3331149 | <reponame>UAEKondaya1/expressvpn_leak_testing
from desktop_local_tests.local_packet_capture_test_case_with_disrupter_and_generator import LocalPacketCaptureTestCaseWithDisrupterAndGenerator
from desktop_local_tests.disrupter_kill_vpn_process import DisrupterKillVPNProcess
class TestPacketCaptureDisruptKillVPNProcessAn... | 0 | 0 | 0 | 0 | 0 | 0 |
rl/preprocessor/base_preprocessor.py | AsimKhan2019/OpenAI-Lab | 340 | 3331210 | <reponame>AsimKhan2019/OpenAI-Lab<filename>rl/preprocessor/base_preprocessor.py
import numpy as np
from rl.util import logger, log_self
def create_dummy_states(state):
state_shape = state.shape
previous_state = np.zeros(state_shape)
pre_previous_state = np.zeros(state_shape)
pre_pre_previous_state = n... | 0 | 0 | 0 | 0 | 0 | 0 |
mayan/apps/document_signatures/settings.py | eshbeata/open-paperless | 2,743 | 3331213 | <filename>mayan/apps/document_signatures/settings.py
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from smart_settings import Namespace
namespace = Namespace(name='signatures', label=_('Document signatures'))
setting_storage_backend = namespace.add_setting(
globa... | 0 | 0 | 0 | 0 | 0 | 0 |
mordred/tests/test_ETA.py | ademidun/mordred | 199 | 3331223 | <filename>mordred/tests/test_ETA.py<gh_stars>100-1000
from rdkit import Chem
from numpy.testing import assert_almost_equal
from mordred import Calculator, ExtendedTopochemicalAtom
references = {
# Roy et. al. Quantitative Structure-Activity Relationships in Drug Design,
# Predictive Toxicology, and Risk A... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/python/treadmill/sproc/keytabs.py | krcooke/treadmill | 133 | 3331225 | <reponame>krcooke/treadmill
"""Runs Treadmill keytab locker service.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import time
import click
from treadmill import appenv
from treadmill ... | 0 | 0 | 0 | 0 | 0 | 0 |
autoPyTorch/components/baselines/base_baseline.py | mens-artis/Auto-PyTorch | 1,657 | 3331294 | import os as os
import json
import numpy as np
import time
import random
import logging
import pickle
from abc import abstractmethod
from sklearn.model_selection import train_test_split
class BaseBaseline():
def __init__(self, name):
self.configure_logging()
self.name = name
self.confi... | 0 | 1 | 0 | 4 | 5 | 0 |
src/benepar/integrations/downloader.py | thomaslu2000/Incremental-Parsing-Representations | 723 | 3331308 | import os
BENEPAR_SERVER_INDEX = "https://kitaev.com/benepar/index.xml"
_downloader = None
def get_downloader() -> object:
global _downloader
if _downloader is None:
import nltk.downloader
_downloader = nltk.downloader.Downloader(server_index_url=BENEPAR_SERVER_INDEX)
return _downloader
d... | 0 | 4 | 0 | 0 | 4 | 0 |
converter/parser.py | juxiangyu/kaldi-onnx | 224 | 3331324 | <filename>converter/parser.py<gh_stars>100-1000
# Copyright 2019 Xiaomi, 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/LICE... | 0 | 0 | 0 | 0 | 0 | 0 |
fooof/tests/plts/test_fm.py | dieloz/fooof | 154 | 3331325 | """Tests for fooof.plts.fm."""
from fooof.tests.tutils import plot_test
from fooof.tests.settings import TEST_PLOTS_PATH
from fooof.plts.fm import *
###################################################################################################
####################################################################... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/examples/bio_14cells/plot_output.py | aaberbach/bmtk | 216 | 3331330 | <filename>docs/examples/bio_14cells/plot_output.py
import matplotlib.pyplot as plt
from bmtk.analyzer.spike_trains import plot_raster, plot_rates, plot_rates_boxplot
from bmtk.analyzer.compartment import plot_traces
plot_raster(config_file='config.json', group_by='pop_name', show=False)
plot_rates(config_file='confi... | 0 | 0 | 0 | 0 | 0 | 0 |
metadata-ingestion/src/datahub/utilities/parsing_util.py | ShubhamThakre/datahub | 1,603 | 3331335 | import logging
from typing import Any, Dict, List, Optional
logger = logging.getLogger(__name__)
def get_first_missing_key(inp_dict: Dict, keys: List[str]) -> Optional[str]:
cur_val = inp_dict
for key in keys:
if cur_val is None:
return None
if not isinstance(cur_val, dict) or key... | 4 | 2 | 0 | 0 | 6 | 0 |
percentage_values_in_list.py | DazEB2/SimplePyScripts | 117 | 3331346 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
"""
https://ru.stackoverflow.com/questions/510347
Есть некий список с возрастающими данными: [30, 42, 49, 50, 65, 104, 420, 404, 513, ...].
Задача: подсчитать в процентном соотношении размер (ширину) каждого значения (элемента) в списке. Список ... | 0 | 1 | 0 | 0 | 1 | 0 |
tick/hawkes/model/base/model_hawkes.py | sumau/tick | 411 | 3331350 | <reponame>sumau/tick<filename>tick/hawkes/model/base/model_hawkes.py<gh_stars>100-1000
# License: BSD 3 clause
import numpy as np
from scipy.sparse import sputils, csr_matrix
from tick.base_model import N_CALLS_LOSS, PASS_OVER_DATA
from tick.base_model.model_first_order import ModelFirstOrder
from tick.hawkes.model.b... | 0 | 0 | 0 | 0 | 0 | 0 |
simulation/simulation.py | Barala/doorman | 1,831 | 3331382 | # Copyright 2016 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 1 | 0 | 0 | 0 | 1 | 0 |
android_env/components/log_stream_test.py | yjaeseok/android_env | 768 | 3331411 | # coding=utf-8
# Copyright 2021 DeepMind Technologies 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
#
# Unless required by applic... | 1 | 0 | 0 | 0 | 1 | 0 |
leo/extensions/__init__.py | ATikhonov2/leo-editor | 1,550 | 3331419 | # left blank
__all__ = []
| 0 | 0 | 0 | 0 | 0 | 0 |
LeetCode/0198_House_Robber.py | Achyut-sudo/PythonAlgorithms | 144 | 3331455 | def rob(self, nums: List[int]) -> int:
length = len(nums)
if length == 0:
return 0
dp = [0] * len(nums)
dp[0] = nums[0]
for i in range(1,length):
if i==1:
dp[i] = max(dp[0],nums[i])
elif i==2:
dp[i] = dp[0]+nums[i]
else:
dp[i] = max(dp[i-2],dp[i-3]) + nums... | 1 | 1 | 0 | 0 | 2 | 0 |
freebase_data/convert.py | datha88/kbqa-ar-smcnn | 139 | 3331475 | <filename>freebase_data/convert.py
import sys, os
import pickle
def www2fb(in_str):
out_str = 'fb:%s' % (in_str.split('www.freebase.com/')[-1].replace('/', '.'))
return out_str
def main():
in_fn = sys.argv[1]
db = in_fn.split('-')[-1].split('.')[0]
out_fn = '%s.core.txt' % (db)
ent_fn = '%s.e... | 0 | 0 | 0 | 0 | 0 | 0 |
shopify/resources/tender_transaction.py | subhrajyoti21/shopify_python_api | 828 | 3331478 | from ..base import ShopifyResource
class TenderTransaction(ShopifyResource):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
model/prefix_encoder.py | Xiao9905/P-tuning-v2 | 232 | 3331498 | import torch
class PrefixEncoder(torch.nn.Module):
r'''
The torch.nn model to encode the prefix
Input shape: (batch-size, prefix-length)
Output shape: (batch-size, prefix-length, 2*layers*hidden)
'''
def __init__(self, config):
super().__init__()
self.prefix_projection = conf... | 1 | 1 | 0 | 0 | 2 | 0 |
deepFEPE/train_good.py | KuangHaofei/pytorch-deepFEPE | 112 | 3331509 | """
# main training script
Reviewed and tested by You-Yi on 07/07/2020.
Edition history:
Organized and documented by You-Yi on 05/18/2020.
Increments upon train_good_corr_3_vals_goodF.py on 09/29/2019 by Rui. Reorganized as baseline deep_F.
Authors:
<NAME>, <NAME>
"""
import argparse
import yaml
imp... | 2 | 1 | 0 | 0 | 3 | 0 |
utils/vis_tools_sunrgbd.py | lowe2011/Total3DUnderstanding | 288 | 3331520 | <reponame>lowe2011/Total3DUnderstanding<gh_stars>100-1000
"""
Created on June, 2019
@author: <NAME>
Toolkit functions used for visualizing rooms.
"""
from utils.vis_tools import Scene3D
import numpy as np
from utils.sunrgbd_utils import get_NYU37_class_id, cvt2nyu37class_map, process_layout, get_world_R, transform_t... | 0 | 0 | 0 | 0 | 0 | 0 |
Ryven/packages/auto_generated/contextvars/nodes.py | tfroehlich82/Ryven | 2,872 | 3331532 | <gh_stars>1000+
from NENV import *
import contextvars
class NodeBase(Node):
pass
class Copy_Context_Node(NodeBase):
"""
"""
title = 'copy_context'
type_ = 'contextvars'
init_inputs = [
]
init_outputs = [
NodeOutputBP(type_='data'),
]
color = '#32DA22'
... | 0 | 0 | 0 | 0 | 0 | 0 |
python/akg/ms/ops_ascend.py | tianjiashuo/akg | 286 | 3331542 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 38 | 42 | 0 | 0 | 80 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.