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/rest/test_api_settings_proxy.py | DmitryRibalka/monitorrent | 465 | 3220708 | <filename>tests/rest/test_api_settings_proxy.py<gh_stars>100-1000
import json
import falcon
from mock import PropertyMock, MagicMock, patch
from ddt import ddt, data, unpack
from tests import RestTestBase
from monitorrent.rest.settings_proxy import SettingsProxyEnabled, SettingsProxy
from monitorrent.settings_manager i... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/dbnd/test_dbnd/targets_tests/pandas_tests/test_pandas_formats.py | ipattarapong/dbnd | 224 | 3220711 | <filename>modules/dbnd/test_dbnd/targets_tests/pandas_tests/test_pandas_formats.py
from __future__ import print_function
import logging
import pytest
from pandas.util.testing import assert_frame_equal
from targets import target
from targets.extras.pandas_ctrl import PandasMarshallingCtrl
from targets.target_config ... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/steepestDescentDemo.py | vipavlovic/pyprobml | 4,895 | 3220728 | # Author: <NAME>
from __future__ import annotations
import superimport
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import minimize, line_search
def aoki_vectorized(x) -> object:
"""
F(x,y) = 0.5 (x^2 - y)^2 + 0.5 (x-1)^2
"""
f = 0.5 * np.square(np.square(x[:][0]) - x[:]... | 1 | 5 | 0 | 0 | 6 | 0 |
platypush/backend/sensor/envirophat/__init__.py | BlackLight/platypush | 228 | 3220734 | <gh_stars>100-1000
from platypush.backend.sensor import SensorBackend
class SensorEnvirophatBackend(SensorBackend):
"""
Backend to poll analog sensor values from an enviroPHAT sensor pHAT
(https://shop.pimoroni.com/products/enviro-phat)
Requires:
* ``envirophat`` (``pip install envirophat``)... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/jamf/test_jamf_webhook_event_cleanup.py | arubdesu/zentral | 634 | 3220755 | <reponame>arubdesu/zentral
from django.test import SimpleTestCase
from zentral.contrib.jamf.preprocessors import WebhookEventPreprocessor
class TestJamfWebhookEventCleanup(SimpleTestCase):
def test_jamf_webhook_event_cleanup(self):
d = {
"un": 1,
"deux": [{"un": 1, "deux": None}, {... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/utils/stop_streaming.py | tornado12345/TensorFlowOnSpark | 4,363 | 3220761 | # Copyright 2017 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
"""
Simple utility to shutdown a Spark StreamingContext by signaling the reservation Server.
Note: use the reservation server address (host, port) reported in the driver logs.
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
exchangelib/folders/known_folders.py | RossK1/exchangelib | 1,006 | 3220768 | from .base import Folder
from .collections import FolderCollection
from ..items import CalendarItem, Contact, Message, Task, DistributionList, MeetingRequest, MeetingResponse, \
MeetingCancellation, ITEM_CLASSES, ASSOCIATED
from ..version import EXCHANGE_2010_SP1, EXCHANGE_2013, EXCHANGE_2013_SP1
class Calendar(F... | 0 | 2 | 136 | 0 | 138 | 0 |
mergify_engine/web/api/applications.py | truthiswill/mergify-engine | 266 | 3220783 | <reponame>truthiswill/mergify-engine<gh_stars>100-1000
# -*- encoding: utf-8 -*-
#
# Copyright © 2021 Mergify SAS
#
# 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.or... | 0 | 0 | 0 | 0 | 0 | 0 |
qa/rpc-tests/fork-large-block.py | btc1/bitcoin | 404 | 3220787 | <gh_stars>100-1000
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.uti... | 0 | 0 | 0 | 0 | 0 | 0 |
apps/autotest/views/monkey.py | rainydaygit/testtcloudserver | 349 | 3220791 | from flask import Blueprint, request, current_app
from apps.autotest.business.monkey import (
MonkeyBusiness, MonkeyDeviceStatusBusiness, MonkeyErrorLogBusiness,
MonkeyPackageBusiness, MonkeyReportBusiness, MonkeyDeviceUsingBusiness,
)
from apps.autotest.extentions import parse_list_args2, parse_list_args, val... | 0 | 0 | 0 | 0 | 0 | 0 |
unsupervised_Cora_Citeseer/layers/discriminator2.py | baobunuo/GraphCL | 275 | 3220807 | from __future__ import annotations
import torch
import torch.nn as nn
class Discriminator2(nn.Module):
def __init__(self, n_h):
super(Discriminator2, self).__init__()
self.f_k = nn.Bilinear(n_h, n_h, 1)
for m in self.modules():
self.weights_init(m)
def weights_init(self, m... | 2 | 1 | 0 | 0 | 3 | 0 |
geoviews/data/geom_dict.py | pmav99/geoviews | 172 | 3220812 | from __future__ import annotations
import sys
from collections import OrderedDict
import numpy as np
from holoviews.core.data import Interface, DictInterface, MultiInterface
from holoviews.core.data.interface import DataError
from holoviews.core.data.spatialpandas import to_geom_dict
from holoviews.core.dimension impo... | 6 | 17 | 1 | 0 | 24 | 0 |
alipay/aop/api/domain/SceneExtParam.py | snowxmas/alipay-sdk-python-all | 213 | 3220822 | <reponame>snowxmas/alipay-sdk-python-all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class SceneExtParam(object):
def __init__(self):
self._apply_reason = None
self._contract_no = None
self._discountamt = None
sel... | 0 | 0 | 0 | 0 | 0 | 0 |
Lib/objc/_WirelessDiagnostics.py | snazari/Pyto | 701 | 3220835 | from __future__ import annotations
"""
Classes from the 'WirelessDiagnostics' framework.
"""
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name) -> None:
return None
def _Class(name) -> object | None:
try:
return ObjCClass(name)
except NameError:
re... | 0 | 2 | 0 | 0 | 2 | 0 |
test/test_cdeint.py | jb-c/torchcde | 247 | 3220844 | import pytest
import torch
import torchcde
@pytest.mark.parametrize("backend, method, kwargs", (('torchdiffeq', 'rk4', {"options": {"step_size": 1.0}}),
('torchdiffeq', 'dopri5', {}),
('torchsde', 'midpoint', {"d... | 0 | 8 | 0 | 0 | 8 | 0 |
pase/models/pase.py | ishine/pase | 428 | 3220862 | <reponame>ishine/pase
try:
from .Minions.minions import *
from .Minions.cls_minions import *
from .attention_block import attention_block
from .frontend import wf_builder
from .WorkerScheduler.encoder import *
except ImportError:
from Minions.minions import *
from Minions.cls_minions import ... | 0 | 0 | 0 | 0 | 0 | 0 |
python/helpers/pydev/pydev_tests_python/regression_check.py | tgodzik/intellij-community | 349 | 3220866 | <gh_stars>100-1000
# Based on: https://github.com/ESSS/pytest-regressions (License: MIT)
# Created copy because we need Python 2.6 which is not available on pytest-regressions.
# Note: only used for testing.
# encoding: UTF-8
import difflib
import pytest
import sys
from functools import partial
if sys.version_info[0]... | 0 | 0 | 0 | 0 | 0 | 0 |
webservices/common/models/candidates.py | 18F/openFEC | 246 | 3220875 | <filename>webservices/common/models/candidates.py
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import ARRAY, TSVECTOR
from sqlalchemy.ext.declarative import declared_attr
from webservices import docs
from .base import db, BaseModel
class CandidateSearch(BaseModel):
__tablename__ = 'ofec_candidate... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_dataverse.py | chopeen/dataverse | 681 | 3220887 | from selenium import webdriver
import time, unittest, config
def is_alert_present(wd) -> bool:
try:
wd.switch_to_alert().text
return True
except:
return False
class test_dataverse(unittest.TestCase):
def setUp(self):
if (config.local):
self.wd = webdriver.Firefo... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/bitbucket_server_api_test.py | briandcho/all-repos | 350 | 3220902 | from all_repos.bitbucket_server_api import get_all
from testing.mock_http import FakeResponse
from testing.mock_http import urlopen_side_effect
def test_get_all(mock_urlopen):
mock_urlopen.side_effect = urlopen_side_effect({
'https://example.com/api?limit=2': FakeResponse(
b'{'
b' ... | 0 | 0 | 0 | 0 | 0 | 0 |
python/ray/serve/pipeline/common.py | jamesliu/ray | 21,382 | 3220907 | <gh_stars>1000+
from enum import Enum
from pydantic import BaseModel, PositiveInt
class ExecutionMode(Enum):
LOCAL = 1
TASKS = 2
ACTORS = 3
def str_to_execution_mode(s: str) -> ExecutionMode:
if s in ["local", "LOCAL"]:
return ExecutionMode.LOCAL
elif s in ["TASKS", "tasks"]:
re... | 0 | 0 | 0 | 0 | 0 | 0 |
muddery/server/database/gamedata/character_combat.py | dongwudanci/muddery | 127 | 3220932 | """
Characters' combat.
"""
import json, traceback
from django.conf import settings
from muddery.server.utils import utils
from muddery.server.utils.exception import MudderyError, ERR
class CharacterCombat(object):
"""
Player character's combat data.
"""
# data storage
storage_class = utils.class... | 0 | 2 | 0 | 0 | 2 | 0 |
tools/pot/openvino/tools/pot/algorithms/sparsity/default/utils.py | ryanloney/openvino-1 | 1,127 | 3220946 | <filename>tools/pot/openvino/tools/pot/algorithms/sparsity/default/utils.py
# Copyright (C) 2020-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.pot.graph import node_utils as nu
from openvino.tools.pot.graph.model_utils import get_nodes_by_type
from openvino.tools.... | 0 | 0 | 0 | 0 | 0 | 0 |
deep_architect/contrib/deep_learning_backend/pytorch_ops.py | dapatil211/deep_architect | 272 | 3220951 | <filename>deep_architect/contrib/deep_learning_backend/pytorch_ops.py
from math import ceil
import torch
import torch.nn as nn
import torch.nn.functional as F
from deep_architect.helpers.pytorch_support import siso_pytorch_module
def calculate_same_padding(h_in, w_in, stride, filter_size):
h_out = ceil(float(h_... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_glacier/test_glacier_vaults.py | gtourkas/moto | 5,460 | 3220952 | import boto.glacier
import boto3
import sure # noqa # pylint: disable=unused-import
import pytest
from moto import mock_glacier_deprecated, mock_glacier
from moto.core import ACCOUNT_ID
from uuid import uuid4
# Has boto3 equivalent
@mock_glacier_deprecated
def test_create_vault():
conn = boto.glaci... | 0 | 0 | 0 | 0 | 0 | 0 |
mmdet/apis/__init__.py | Karybdis/mmdetection-mini | 834 | 3220958 | from .inference import (inference_detector,
init_detector, show_result_pyplot)
from .test import single_gpu_test
from .train import get_root_logger, set_random_seed, train_detector
__all__ = [
'get_root_logger', 'set_random_seed', 'train_detector', 'init_detector',
'inference_detector', 's... | 0 | 0 | 0 | 0 | 0 | 0 |
src/app/beer_garden/api/http/handlers/vbeta/chunk.py | scott-taubman/beer-garden | 230 | 3220968 | # -*- coding: utf-8 -*-
from brewtils.errors import ModelValidationError
from brewtils.models import Operation, Resolvable
from brewtils.schema_parser import SchemaParser
from tornado.escape import json_decode
from beer_garden.api.http.base_handler import BaseHandler
class FileChunkAPI(BaseHandler):
async def g... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_backend_fasttext.py | jimfhahn/Annif | 121 | 3220982 | """Unit tests for the fastText backend in Annif"""
import logging
import pytest
import annif.backend
import annif.corpus
from annif.exception import NotSupportedException
fasttext = pytest.importorskip("annif.backend.fasttext")
def test_fasttext_default_params(project):
fasttext_type = annif.backend.get_backend... | 0 | 0 | 0 | 0 | 0 | 0 |
Documents/Router/CVE-2017-7494/impacket/Dot11KeyManager.py | edinjapan/NSABlocklist | 201 | 3220983 | <filename>Documents/Router/CVE-2017-7494/impacket/Dot11KeyManager.py
# Copyright (c) 2003-2016 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Description:
# IEEE 802.11 Netw... | 0 | 0 | 0 | 0 | 0 | 0 |
ST_DM/KDD2021-MSTPAC/code/MST-PAC/nets/common/ernie_encoder.py | zhangyimi/Research | 1,319 | 3220994 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 2 | 8 | 0 | 5 | 15 | 0 |
clusterloader2/pkg/prometheus/manifests/dashboards/network.dashboard.py | jupblb/perf-tests | 685 | 3221000 | <filename>clusterloader2/pkg/prometheus/manifests/dashboards/network.dashboard.py
#!/usr/bin/env python3
# Copyright 2019 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... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/test_http.py | adamchainz/vanilla | 101 | 3221014 | <reponame>adamchainz/vanilla
import json
import gc
import pytest
import vanilla
import vanilla.http
# TODO: remove
import logging
logging.basicConfig()
class TestHTTP(object):
def test_get_body(self):
h = vanilla.Hub()
serve = h.http.listen()
@h.spawn
def _():
co... | 0 | 0 | 0 | 0 | 0 | 0 |
spotty/deployment/container/docker/scripts/stop_container_script.py | greglira/spotty | 246 | 3221022 | <reponame>greglira/spotty
import os
import chevron
from spotty.deployment.container.docker.scripts.abstract_docker_script import AbstractDockerScript
class StopContainerScript(AbstractDockerScript):
def render(self) -> str:
# read template file
template_path = os.path.join(os.path.dirname(__file_... | 0 | 0 | 0 | 0 | 0 | 0 |
torch/optim/__init__.py | raven38/pytorch | 206 | 3221058 | <filename>torch/optim/__init__.py
"""
:mod:`torch.optim` is a package implementing various optimization algorithms.
Most commonly used methods are already supported, and the interface is general
enough, so that more sophisticated ones can be also easily integrated in the
future.
"""
from .adadelta import Adadelta
from... | 0 | 0 | 0 | 0 | 0 | 0 |
xls/tools/delay_info_main_test.py | felixzhuologist/xls | 687 | 3221084 | <reponame>felixzhuologist/xls
# Lint as: python3
#
# Copyright 2021 The XLS 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
#
# Unl... | 0 | 0 | 0 | 0 | 0 | 0 |
topik/fileio/tests/__init__.py | ContinuumIO/topik | 104 | 3221094 | <filename>topik/fileio/tests/__init__.py
# sample data files are located in the same folder
import os
test_data_path = os.path.join(os.path.dirname(__file__), "data")
| 0 | 0 | 0 | 0 | 0 | 0 |
tf_agents/environments/atari_preprocessing_test.py | Francis777/agents | 3,175 | 3221098 | # coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 2 | 4 | 0 | 2 | 8 | 0 |
doc/examples/print_elem_refs.py | SHolzmann/autosar | 199 | 3221106 | <gh_stars>100-1000
import autosar
#Create some packages and data types
ws = autosar.workspace('4.2.2')
datatypes = ws.createPackage('DataTypes', role='DataType')
basetypes = datatypes.createSubPackage('BaseTypes')
u8Type = basetypes.createSwBaseType('uint8', 8, nativeDeclaration='uint8')
u16Type = basetypes.createSwBa... | 0 | 0 | 0 | 0 | 0 | 0 |
tempest/api/compute/flavors/test_flavors_negative.py | cityofships/tempest | 254 | 3221125 | # Copyright 2017 Red Hat, 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
#
# Unless required by... | 0 | 0 | 0 | 0 | 0 | 0 |
deepspeed/ops/adam/cpu_adam.py | olegklimov/DeepSpeed | 6,728 | 3221127 | <reponame>olegklimov/DeepSpeed<gh_stars>1000+
'''
Copyright 2020 The Microsoft DeepSpeed Team
'''
import math
import torch
import time
from pathlib import Path
from ..op_builder import CPUAdamBuilder
from deepspeed.utils.logging import should_log_le
class DeepSpeedCPUAdam(torch.optim.Optimizer):
opt... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/tests/utils/cli_utils.py | MuhammadZeeshan34/feast | 2,258 | 3221129 | <reponame>MuhammadZeeshan34/feast
import random
import string
import subprocess
import sys
import tempfile
from contextlib import contextmanager
from pathlib import Path
from textwrap import dedent
from typing import List, Tuple
from feast import cli
from feast.feature_store import FeatureStore
def get_example_repo(... | 0 | 0 | 0 | 0 | 0 | 0 |
make/pefixup.py | SSYSS000/Proton | 17,337 | 3221131 | <filename>make/pefixup.py
#!/usr/bin/env python3
import sys
import os
import stat
import pefile
for path in sys.argv[1:]:
pe = pefile.PE(path)
for section in pe.sections:
if section.Name.decode("utf-8")[0:5] == ".text":
section.Characteristics &= ~pefile.SECTION_CHARACTERISTICS['IMAGE_SCN... | 0 | 0 | 0 | 0 | 0 | 0 |
pkgs/tools/yasm/src/tools/python-yasm/pyxelator/cparse.py | manggoguy/parsec-modified | 2,151 | 3221151 | <filename>pkgs/tools/yasm/src/tools/python-yasm/pyxelator/cparse.py<gh_stars>1000+
#!/usr/bin/env python
"""
(c) 2002, 2003, 2004, 2005 <NAME> <<EMAIL>>
Released under GNU LGPL license.
"""
import sys
from lexer import Lexer
from parse_core import Symbols, Parser
import node as node_module
class Node(node_modul... | 0 | 0 | 0 | 0 | 0 | 0 |
moe_examples/tests/bandit_example_test.py | dstoeckel/MOE | 966 | 3221167 | # -*- coding: utf-8 -*-
"""Integration test for bandit_example MOE example."""
from moe.bandit.constant import TEST_EPSILON
from moe_examples.tests.moe_example_test_case import MoeExampleTestCase
from moe_examples.bandit_example import run_example
class TestBanditExample(MoeExampleTestCase):
"""Test the bandit_... | 0 | 0 | 0 | 0 | 0 | 0 |
external-import/crowdstrike/src/crowdstrike/rule/__init__.py | tiiibs/connectors | 132 | 3221172 | # -*- coding: utf-8 -*-
"""OpenCTI CrowdStrike rule module."""
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/extension/fsm_/state/test_fsm_state.py | jesseclin/veriloggen | 232 | 3221181 | <filename>tests/extension/fsm_/state/test_fsm_state.py
from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import fsm_state
expected_verilog = """
module test;
reg CLK;
reg RST;
wire valid;
blinkled
uut
(
.CLK(CLK),
.RST(RST),
.valid(valid)
);
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_cases/test_cocotb/test_queues.py | lavanyajagan/cocotb | 350 | 3221191 | <reponame>lavanyajagan/cocotb
# Copyright cocotb contributors
# Licensed under the Revised BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-3-Clause
"""
Tests relating to cocotb.queue.Queue, cocotb.queue.LifoQueue, cocotb.queue.PriorityQueue
"""
import pytest
import cocotb
from cocotb.queue import ... | 0 | 0 | 0 | 0 | 0 | 0 |
pyalgotrade/cn/tushare/test_tuSharePollingThread.py | 01FinTech/pyalgotrade-cn | 1,000 | 3221195 | <gh_stars>100-1000
# Copyright 2011-2015 ZackZK
#
# 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 agree... | 0 | 0 | 0 | 0 | 0 | 0 |
Algo and DSA/LeetCode-Solutions-master/Python/minimum-difference-between-largest-and-smallest-value-in-three-moves.py | Sourav692/FAANG-Interview-Preparation | 3,269 | 3221200 | <gh_stars>1000+
# Time: O(n + klogk)
# Space: O(k)
import random
class Solution(object):
def minDifference(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
def nth_element(nums, left, n, right, compare=lambda a, b: a < b):
def partition_around_pivot(left... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_version.py | lgeiger/io | 558 | 3221249 | <reponame>lgeiger/io<gh_stars>100-1000
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LI... | 0 | 0 | 0 | 0 | 0 | 0 |
docassemble_webapp/docassemble/webapp/install_certs.py | Chromadream/docassemble | 568 | 3221250 | <filename>docassemble_webapp/docassemble/webapp/install_certs.py<gh_stars>100-1000
import sys
import os
import stat
import re
import copy
from pwd import getpwnam
import shutil
def main():
from docassemble.base.config import daconfig, S3_ENABLED, s3_config, AZURE_ENABLED, azure_config
certs_location = daconfig... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/hubert/update_ckpt.py | Shiguang-Guo/fairseq | 16,259 | 3221261 | # 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 torch
src_ckpt = "/checkpoint/wnhsu/w2v/archived/hubert_base_ls960_it2.pt"
ref_ckpt = "/checkpoint/wnhsu/w2v/hubert_icassp_oss_v3/iter... | 0 | 1 | 0 | 0 | 1 | 0 |
mrflow_dataset.py | jswulff/mrflow | 124 | 3221300 | #! /usr/bin/env python2
import sys,os
import argparse
import subprocess
MRFLOW_HOME = os.environ['MRFLOW_HOME']
sys.path.append(MRFLOW_HOME)
import dataset_parameters
def generate_paths(dataset, arg) -> tuple[object, object]:
""" Generate paths for either Sintel or Kitti
Requires the following environment... | 0 | 1 | 0 | 0 | 1 | 0 |
lib/rucio/api/meta.py | llwang00/rucio | 187 | 3221301 | # Copyright European Organization for Nuclear Research (CERN)
#
# 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
#
# Authors:
# - <NAME>, <<EMAIL>>, 20... | 4 | 4 | 0 | 0 | 8 | 0 |
commands/configure.py | anshubansal2000/cloudmapper | 5,021 | 3221328 | from __future__ import annotations
import json
import os.path
import netaddr
import argparse
from shared.organization import get_organization_accounts
__description__ = "Add and remove items from the config file"
def configure(action, arguments) -> object | None:
if not os.path.isfile(arguments.config_file):
... | 0 | 6 | 0 | 0 | 6 | 0 |
examples/pyglet/noisy/__init__.py | daleathan/pynsist | 671 | 3221362 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#... | 0 | 0 | 0 | 0 | 0 | 0 |
dataloader/data_loaders.py | cwlin1998/DeepGlobalRegistration | 325 | 3221398 | <reponame>cwlin1998/DeepGlobalRegistration
# Copyright (c) <NAME> (<EMAIL>) and <NAME> (<EMAIL>)
#
# Please cite the following papers if you use any part of the code.
# - <NAME>, <NAME>, <NAME>, Deep Global Registration, CVPR 2020
# - <NAME>, <NAME>, <NAME>, Fully Convolutional Geometric Features, ICCV 2019
# - <NAME>,... | 0 | 0 | 0 | 0 | 0 | 0 |
social_auth/backends/contrib/orkut.py | merutak/django-social-auth | 863 | 3221399 | from social.backends.orkut import OrkutOAuth as OrkutBackend
| 0 | 0 | 0 | 0 | 0 | 0 |
c7n/actions/invoke.py | al3pht/cloud-custodian | 2,415 | 3221431 | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
try:
from botocore.config import Config
except ImportError:
from c7n.config import Bag as Config # pragma: no cover
from .core import EventAction
from c7n import utils
from c7n.manager import res... | 1 | 1 | 3 | 0 | 5 | 0 |
Test Files/SpeechRecog.py | aswinjayaji/bunk_bot | 445 | 3221446 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import speech_recognition as sr
r = sr.Recognizer()
while(1):
# Exception handling to handle
# exceptions at the runtime
try:
# use the microphone as source for input.
with sr.Microphone() as source2:
# wait for ... | 0 | 0 | 0 | 0 | 0 | 0 |
integration_tests/test_suites/daemon-test-suite/conftest.py | dbatten5/dagster | 4,606 | 3221469 | import pytest
from dagster import file_relative_path
from dagster.core.test_utils import instance_for_test
from dagster.core.workspace import WorkspaceProcessContext
from dagster.core.workspace.load_target import PythonFileTarget
@pytest.fixture(name="instance")
def instance_fixture():
with instance_for_test(
... | 0 | 1 | 0 | 0 | 1 | 0 |
systemrdl/core/value_normalization.py | jasonpjacobs/systemrdl-compiler | 141 | 3221499 | <filename>systemrdl/core/value_normalization.py
import hashlib
from typing import Any, Optional, Union, List
from .. import rdltypes
from .. import node
def normalize(value: Any, owner_node: Optional[node.Node]=None) -> str:
"""
Flatten an RDL value into a unique string that is used for type
normalization... | 0 | 0 | 0 | 0 | 0 | 0 |
misc/psi/tests/increase-slots.py | jatanloya/HElib-PSI | 1,360 | 3221535 | <gh_stars>1000+
#!/usr/bin/env python3
# Copyright (C) 2020 IBM Corp.
# This program is Licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless re... | 0 | 0 | 0 | 0 | 0 | 0 |
build_remoting.py | dietmarw/FMPy | 225 | 3221546 | import os
import tarfile
import shutil
from subprocess import check_call
from fmpy.util import download_file
url = 'https://github.com/rpclib/rpclib/archive/refs/tags/v2.3.0.tar.gz'
checksum = 'eb9e6fa65e1a79b37097397f60599b93cb443d304fbc0447c50851bc3452fdef'
# build configuration
config = 'Release'
download_file(u... | 0 | 0 | 0 | 0 | 0 | 0 |
django_file_form/s3_multipart/utils.py | kosior/django-file-form | 133 | 3221549 | import os
import time
import boto3
from botocore.exceptions import ClientError
from botocore.client import Config
from django.utils.crypto import get_random_string
from storages.utils import setting, lookup_env
def get_bucket_name() -> object:
return setting("AWS_STORAGE_BUCKET_NAME") or lookup_env(
["DJ... | 0 | 9 | 0 | 0 | 9 | 0 |
sample/sample-python/sample-filter-tables-event.py | George-/tsduck | 542 | 3221551 | #!/usr/bin/env python
#----------------------------------------------------------------------------
#
# TSDuck sample Python application running a chain of plugins:
# Filter tables using plugin events to get binary tables in a Python class.
#
# See sample-filter-tables-log.py for an equivalent example using log lines
#... | 0 | 0 | 0 | 0 | 0 | 0 |
lldb/test/API/functionalities/module_cache/universal/TestModuleCacheUniversal.py | LaudateCorpus1/llvm-project | 605 | 3221555 | """Test the LLDB module cache funcionality for universal mach-o files."""
import glob
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
import os
import time
class ModuleCacheTestcaseUniversal(TestBase):
mydir = TestBase.compute_mydir(_... | 0 | 1 | 0 | 0 | 1 | 0 |
pyeda/boolalg/test/test_exxpr.py | ivotimev/pyeda | 196 | 3221562 | <reponame>ivotimev/pyeda<filename>pyeda/boolalg/test/test_exxpr.py
"""
Test expression Boolean functions
NOTE: This was from some miscellaneous work a while ago.
Needs to be reorganized.
"""
from nose.tools import assert_raises
from pyeda.boolalg import boolfunc
from pyeda.boolalg import exprnode
from pyeda.bo... | 0 | 0 | 0 | 0 | 0 | 0 |
libcity/model/traffic_speed_prediction/MTGNN.py | moghadas76/test_bigcity | 221 | 3221572 | <reponame>moghadas76/test_bigcity
from __future__ import division
import torch
import torch.nn as nn
from torch.nn import init
import numbers
import torch.nn.functional as F
from logging import getLogger
from libcity.model.abstract_traffic_state_model import AbstractTrafficStateModel
from libcity.model import loss
cl... | 0 | 0 | 0 | 0 | 0 | 0 |
reddit2telegram/channels/grimdank/app.py | mainyordle/reddit2telegram | 187 | 3221574 | <filename>reddit2telegram/channels/grimdank/app.py
#encoding:utf-8
subreddit = 'grimdank'
t_channel = '@grimdank'
def send_post(submission, r2t):
return r2t.send_simple(submission)
| 0 | 0 | 0 | 0 | 0 | 0 |
scripts/pseudo_full_pangenome.py | aweimann/panaroo | 116 | 3221583 | <gh_stars>100-1000
import sys, os
import argparse
from collections import OrderedDict, defaultdict
import gffutils as gff
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from io import StringIO
import numpy as np
from random import sample
from dendropy.simulate import treesim
from dend... | 0 | 0 | 0 | 0 | 0 | 0 |
hls4ml/templates/vivado_accelerator/zcu102/python_drivers/axi_stream_driver.py | jaemyungkim/hls4ml | 380 | 3221587 | <reponame>jaemyungkim/hls4ml
from pynq import DefaultHierarchy, DefaultIP, allocate
from pynq import Overlay
from datetime import datetime
import pynq.lib.dma
import numpy as np
class NeuralNetworkOverlay(Overlay):
def __init__(self, bitfile_name, x_shape, y_shape, dtype=np.float32, dtbo=None, download=True, igno... | 0 | 0 | 0 | 0 | 0 | 0 |
czsc/signals/ta.py | fnsoxt/czsc | 206 | 3221592 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
"""
author: zengbin93
email: <EMAIL>
create_dt: 2021/11/21 17:48
describe: 技术分析相关信号的计算
ta-lib 安装包:https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
"""
import numpy as np
from collections import OrderedDict
from .. import analyze
from ..objects import Signal
from ..enum imp... | 0 | 0 | 0 | 0 | 0 | 0 |
mars/deploy/yarn/config.py | hxri/mars | 2,413 | 3221628 | # -*- coding: utf-8 -*-
# Copyright 1999-2021 Alibaba Group Holding 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 require... | 30 | 10 | 4 | 3 | 47 | 0 |
src/train.py | amitgalor18/trackformer | 175 | 3221631 | <gh_stars>100-1000
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import datetime
import os
import random
import time
from argparse import Namespace
from pathlib import Path
import numpy as np
import sacred
import torch
import yaml
from torch.utils.data import DataLoader, DistributedSampler
im... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_cloudformation/fixtures/kms_key.py | symroe/moto | 5,460 | 3221674 | <filename>tests/test_cloudformation/fixtures/kms_key.py
template = {
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CloudFormation Sample Template to create a KMS Key. The Fn::GetAtt is used to retrieve the ARN",
"Resources": {
"myKey": {
"Type": "AWS::KMS::Key",
... | 0 | 0 | 0 | 0 | 0 | 0 |
server/plugins/diskspace/diskspace.py | nathandarnell/sal | 215 | 3221698 | from __future__ import annotations
import sal.plugin
TITLES = {'ok': 'Machines with less than 80% disk utilization',
'warning': 'Machines with 80%-90% disk utilization',
'alert': 'Machines with more than 90% disk utilization'}
class DiskSpace(sal.plugin.Widget):
description: str = 'Availabl... | 0 | 3 | 2 | 0 | 5 | 0 |
kitsune/groups/migrations/0002_auto_20200629_0826.py | AndrewDVXI/kitsune | 929 | 3221716 | <filename>kitsune/groups/migrations/0002_auto_20200629_0826.py
# Generated by Django 2.2.13 on 2020-06-29 08:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('groups', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/lib/python3.6/site-packages/clint/eng.py | Guillaume-Fernandez/phishfinder | 1,230 | 3221729 | # -*- coding: utf-8 -*-
"""
clint.eng
~~~~~~~~~
This module provides English language string helpers.
"""
from __future__ import print_function
MORON_MODE = False
COMMA = ','
CONJUNCTION = 'and'
SPACE = ' '
try:
unicode
except NameError:
unicode = str
def join(l, conj=CONJUNCTION, im_a_moron=MORON_MODE, ... | 0 | 1 | 0 | 0 | 1 | 0 |
hphp/hack/test/fanout/tools/fanout.py | donsbot/hhvm | 9,491 | 3221752 | <gh_stars>1000+
#!/usr/bin/env python3
# pyre-strict
from __future__ import annotations
import argparse
import logging
import os
import tempfile
from enum import Enum
import attr
from .fanout_test_driver import (
Binaries,
run_scenario_saved_state_init,
run_scenario_incremental_no_old_decls,
run_scen... | 0 | 0 | 0 | 0 | 0 | 0 |
oregami/sark_bc.py | lallouslab/oregami | 179 | 3221756 | <filename>oregami/sark_bc.py
import sark
##########################################################
# Adding backwards compatability for sark before python3 #
##########################################################
# Sark started using start_ea, end_ea instead of start_ea, end_ea
# We will make the old sark (for py... | 0 | 0 | 0 | 0 | 0 | 0 |
gryphon/data_service/auditors/coinbase_orderbook_auditor.py | qiquanzhijia/gryphon | 1,109 | 3221766 | from delorean import Delorean
from gryphon.data_service.auditors.orderbook_auditor import OrderbookAuditor
class CoinbaseOrderbookAuditor(OrderbookAuditor):
def __init__(self):
super(CoinbaseOrderbookAuditor, self).__init__()
self.exchange_name: str = 'COINBASE_BTC_USD'
product_id = 'BTC-... | 0 | 1 | 0 | 3 | 4 | 0 |
tests/nnapi/specs/V1_2/unidirectional_sequence_lstm_dynamic_nnfw.mod.py | juitem/ONE | 255 | 3221778 | <reponame>juitem/ONE<filename>tests/nnapi/specs/V1_2/unidirectional_sequence_lstm_dynamic_nnfw.mod.py
#
# Copyright (C) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
# Copyright (C) 2019 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this f... | 0 | 0 | 0 | 0 | 0 | 0 |
ml_editor/inference.py | VestiDev/ml-powered-applications-2020-book | 542 | 3221790 | <filename>ml_editor/inference.py<gh_stars>100-1000
"""inference.py: This module contains function stubs serving as book examples.
The functions are not used for the ml_editor app or notebook
"""
from functools import lru_cache
REQUIRED_FEATURES = [
"is_question",
"action_verb_full",
"language_question",
... | 0 | 0 | 0 | 0 | 0 | 0 |
python/skytools/__init__.py | zzahti/skytools | 116 | 3221794 | <reponame>zzahti/skytools
"""Tools for Python database scripts."""
_symbols = {
# skytools.adminscript
'AdminScript': 'skytools.adminscript:AdminScript',
# skytools.config
'Config': 'skytools.config:Config',
# skytools.dbservice
'DBService': 'skytools.dbservice:DBService',
'ServiceContext'... | 0 | 0 | 0 | 0 | 0 | 0 |
demo/EFK-stack/search.py | kuraakhilesh8230/aries-cloudagent-python | 247 | 3221807 | import csv
from elasticsearch_dsl import connections
from elasticsearch_dsl import Search
connections.create_connection(hosts=["localhost"], timeout=20)
s = Search(index="fluentd-*")
# only return the selected fields
s = s.source(
[
"str_time",
"timestamp",
"handler",
"ellapsed_m... | 0 | 0 | 0 | 0 | 0 | 0 |
malaya_speech/age_detection.py | ishine/malaya-speech | 111 | 3221844 | <gh_stars>100-1000
from malaya_speech.supervised import classification
from herpetologist import check_type
_availability = {
'vggvox-v2': {
'Size (MB)': 30.9,
'Quantized Size (MB)': 7.92,
'Accuracy': 0.57523,
},
'deep-speaker': {
'Size (MB)': 96.9,
'Quantized Size (... | 0 | 0 | 0 | 0 | 0 | 0 |
pyshtools/backends/__init__.py | mjc87/SHTOOLS | 251 | 3221853 | """
backends
This module defines functions for accessing and setting optional parameters of
the backends used for the spherical harmonic transforms in pyshtools.
Supported backends
------------------
shtools (default) Spherical Harmonic Tools (Fortran 95), installed
as part of ... | 0 | 0 | 0 | 0 | 0 | 0 |
serde/__init__.py | mauvealerts/pyserde | 113 | 3221867 | """
`pyserde` is a yet another serialization library on top of
[dataclasses](https://docs.python.org/3/library/dataclasses.html).
## Overview
Declare a class with pyserde's `@serialize` and `@deserialize` decorators.
>>> from dataclasses import dataclass
>>> from serde import serialize, deserialize
>>>
>>> @deserial... | 0 | 0 | 0 | 0 | 0 | 0 |
recs/popularity_recommender.py | WingCode/live-project | 806 | 3221868 | <filename>recs/popularity_recommender.py
from decimal import Decimal
from analytics.models import Rating
from collector.models import Log
from recs.base_recommender import base_recommender
from django.db.models import Count
from django.db.models import Q
from django.db.models import Avg
class PopularityBasedRecs(base... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/basics/list_count.py | learnforpractice/micropython-cpp | 13,648 | 3221873 | # list count tests
a = [1, 2, 3]
a = a + a + a
b = [0, 0, a, 0, a, 0]
print(a.count(2))
print(b.count(a))
| 0 | 0 | 0 | 0 | 0 | 0 |
trackeval/metrics/ideucl.py | AlexanderSing/TrackEval | 325 | 3221883 | from __future__ import annotations
import numpy as np
from scipy.optimize import linear_sum_assignment
from ._base_metric import _BaseMetric
from .. import _timing
from collections import defaultdict
from .. import utils
class IDEucl(_BaseMetric):
"""Class which implements the ID metrics"""
@staticmethod
... | 2 | 7 | 0 | 1 | 10 | 0 |
grr/server/grr_response_server/prometheus_stats_collector.py | khanhgithead/grr | 4,238 | 3221884 | #!/usr/bin/env python
# Lint as: python3
from __future__ import annotations
"""Prometheus-based statistics collection."""
import collections
from typing import Dict, Text
import prometheus_client
import six
from grr_response_core.lib import utils
from grr_response_core.lib.rdfvalues import stats as rdf_stats
from g... | 10 | 5 | 0 | 1 | 16 | 0 |
utils/comparison.py | cwwang15/neural_network_cracking | 196 | 3221886 | <gh_stars>100-1000
#!/usr/bin/env python
import sys
import argparse
import csv
def main(args):
writer = csv.writer(args.ofile, delimiter='\t',
quoting=csv.QUOTE_NONE, quotechar=None)
for row in csv.DictReader(
args.ifile, delimiter='\t', quoting=csv.QUOTE_NONE, quotechar=No... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/black/const.py | gilbertekalea/booking.com_crawler | 16,110 | 3221916 | <filename>venv/Lib/site-packages/black/const.py
DEFAULT_LINE_LENGTH = 88
DEFAULT_EXCLUDES = r"/(\.direnv|\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|venv|\.svn|_build|buck-out|build|dist)/" # noqa: B950
DEFAULT_INCLUDES = r"(\.pyi?|\.ipynb)$"
STDIN_PLACEHOLDER = "__BLACK_STDIN_FILENAME__"
| 0 | 0 | 0 | 0 | 0 | 0 |
vendor/github.com/elastic/beats/metricbeat/scripts/create_metricset.py | psadmin-io/ps-tuxbeat | 115 | 3221922 | <reponame>psadmin-io/ps-tuxbeat
import os
import argparse
# Creates a new metricset with all the necessary file
# In case the module does not exist, also the module is created
def generate_metricset(base_path, metricbeat_path, module, metricset):
generate_module(base_path, metricbeat_path, module, metricset)
... | 0 | 0 | 0 | 0 | 0 | 0 |
theano/compile/tests/test_misc.py | mdda/Theano | 295 | 3221924 | <filename>theano/compile/tests/test_misc.py
import numpy, theano, unittest
from theano.compile.pfunc import pfunc
from theano.compile.sharedvalue import shared
from theano import tensor
from theano.tensor.nnet import sigmoid
class NNet(object):
def __init__(self,
input=tensor.dvector('input'),
... | 0 | 0 | 0 | 0 | 0 | 0 |
bin/awscli/customizations/s3/utils.py | iilness2/bash-lambda-layer-custom | 399 | 3221925 | # Copyright 2013 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | 13 | 21 | 0 | 0 | 34 | 0 |
chainercv/links/model/senet/se_resnext.py | souravsingh/chainercv | 1,600 | 3221929 | <filename>chainercv/links/model/senet/se_resnext.py
from __future__ import division
import numpy as np
import chainer
import chainer.functions as F
from chainer import initializers
import chainer.links as L
from chainercv.links import Conv2DBNActiv
from chainercv.links.model.resnet import ResBlock
from chainercv.lin... | 0 | 0 | 0 | 0 | 0 | 0 |
src/base/models.py | justingrayston/gae-secure-scaffold-python | 163 | 3221931 | <filename>src/base/models.py
# 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
#
# Unles... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.