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 |
|---|---|---|---|---|---|---|---|---|---|---|
test/integration/samples_in/digit_ordering.py | Inveracity/flynt | 487 | 191423 | <gh_stars>100-1000
log.notice("Search: finished in {0:,} ms.".format(vm.search_time_elapsed_ms)) | 0 | 0 | 0 | 0 | 0 | 0 |
tests/mocks/urllib2/mock_http_error.py | tervay/the-blue-alliance | 266 | 191428 | from urllib2 import HTTPError
class MockHTTPError(HTTPError):
def __init__(self, code):
super(MockHTTPError, self).__init__('https://thebluealliance.com', code, 'mock', {}, None)
| 0 | 0 | 0 | 0 | 0 | 0 |
src/scripts/run_nips17_fhvae_exp.py | syfengcuhk/FactorizedHierarchicalVAE | 155 | 191429 | <gh_stars>100-1000
import os
import shutil
from runners import *
from runners.fhvae_runner import train, test, dump_latent, dump_repr, repl_repr_utt, factorize, traverse
from tools.kaldi.prep_kaldi_feat import flatten_channel
from datasets.segment import Segment
from datasets.datasets_loaders import datasets_loader
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
torchcv/models/__init__.py | CVHj/torchcv | 433 | 191435 | <reponame>CVHj/torchcv
from torchcv.models.ssd.net import SSD300, SSD512
from torchcv.models.ssd.box_coder import SSDBoxCoder
from torchcv.models.fpnssd.net import FPNSSD512
from torchcv.models.fpnssd.box_coder import FPNSSDBoxCoder
from torchcv.models.retinanet.net import RetinaNet
from torchcv.models.retinanet.box_... | 0 | 0 | 0 | 0 | 0 | 0 |
ulmo/twc/__init__.py | sblack-usu/ulmo | 123 | 191464 | <filename>ulmo/twc/__init__.py
from . import kbdi
| 0 | 0 | 0 | 0 | 0 | 0 |
growler/middleware/responsetime.py | pyGrowler/Growler | 806 | 191468 | <reponame>pyGrowler/Growler
#
# growler/middleware/responsetime.py
#
"""
Provides middleware which adds a header indicating how long the request took to
process
"""
import time
import logging
logger = logging.getLogger(__name__)
class ResponseTime:
"""
Middleware which saves the time when initially called, ... | 0 | 0 | 0 | 0 | 0 | 0 |
release/data_prepare/baseModel_data_convert.py | plataKwon/KPRN | 258 | 191491 | #***********************************************************
#Copyright 2018 eBay Inc.
#Use of this source code is governed by a MIT-style
#license that can be found in the LICENSE file or at
#https://opensource.org/licenses/MIT.
#***********************************************************
# -*- coding:utf-8 -*-
from _... | 0 | 0 | 0 | 0 | 0 | 0 |
Test/LensCalibrationTest.py | thpe/voxelsdk | 112 | 191539 | import argparse
import sys
import matplotlib.pyplot as plt
import numpy as np
#parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
#parser.add_argument("-f", "--file", type=str, help="Voxel file (.vxl)", required=True)
#args = parser.parse_args()
## Voxel-A lens
k1 = -0.158396... | 0 | 0 | 0 | 0 | 0 | 0 |
python-leetcode/laozhang/tree/leetcode_32_.py | sweeneycai/cs-summary-reflection | 227 | 191547 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# coding=utf-8
"""
32. 二叉树的层次遍历
"""
from typing import List
from laozhang import TreeNode
class Solution:
res: list[object] = []
def levelOrder(self, root: TreeNode) -> List[List[int]]:
if not root:
return []
def helper(root: TreeN... | 2 | 2 | 1 | 0 | 5 | 0 |
tests/nnapi/specs/Ex/zeros_like_ex_4D_int32.mod.py | bogus-sudo/ONE-1 | 255 | 191556 | # model
model = Model()
i1 = Input("op1", "TENSOR_INT32", "{1, 2, 2, 1}")
i2 = Output("op2", "TENSOR_INT32", "{1, 2, 2, 1}")
model = model.Operation("ZEROS_LIKE_EX", i1).To(i2)
# Example 1. Input in operand 0,
input0 = {i1: # input 0
[-2, -1, 0, 3]}
output0 = {i2: # output 0
[0, 0, 0, 0]}
# Inst... | 0 | 0 | 0 | 0 | 0 | 0 |
python_src/adaptive_formation/test_imp.py | tkortz/motion_planning_rt | 111 | 191593 | <reponame>tkortz/motion_planning_rt<filename>python_src/adaptive_formation/test_imp.py
import numpy as np
import time
from scipy.integrate import odeint
from math import *
def MassSpringDamper(state,t,F, mode='critically_damped'):
x = state[0]
xd = state[1]
if mode=='oscillations':
m = 1.0; k = 2; b = 0 # undapmp... | 0 | 0 | 0 | 0 | 0 | 0 |
shadowreader/libs/validate.py | luckymike/shadowreader | 150 | 191649 | """
Copyright 2018 Edmunds.<EMAIL>, 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, s... | 5 | 1 | 0 | 0 | 6 | 0 |
pyzoo/zoo/pipeline/api/onnx/mapper/pow.py | abdolence/analytics-zoo | 2,970 | 191663 | #
# Copyright 2018 Analytics Zoo 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 required by applicable law or agreed to... | 0 | 2 | 0 | 0 | 2 | 0 |
src/pyjion/wsgi.py | psydox/Pyjion | 1,137 | 191675 | <reponame>psydox/Pyjion<filename>src/pyjion/wsgi.py
import pyjion
class PyjionWsgiMiddleware:
"""Enables the Pyjion JIT for all WSGI requests."""
def __init__(self, application):
pyjion.enable()
self.application = application
def __call__(self, environ, start_response):
return sel... | 0 | 0 | 0 | 0 | 0 | 0 |
plots/chapter3.py | haeseung81/PyTorchStepByStep | 170 | 191683 | from __future__ import annotations
import torch
import numpy as np
import matplotlib.pyplot as plt
from operator import itemgetter
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import ListedColormap
from sklearn.metrics import confusion_matrix, roc_curve, precision_recall_curve
plt.style.use('fivethirt... | 22 | 23 | 0 | 0 | 45 | 0 |
atlastk/__main__.py | splashelec/atlas-python | 221 | 191693 | <reponame>splashelec/atlas-python
"""
MIT License
Copyright (c) 2018 <NAME> (https://q37.info/s/rmnmqd49)
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 l... | 0 | 0 | 0 | 0 | 0 | 0 |
transpyle/fortran/ast_generalizer.py | EraYaN/transpyle | 107 | 191739 | from __future__ import annotations
"""Transformer of Fortran AST into Python AST."""
import ast
import functools
import itertools
import logging
import re
import typing as t
import xml.etree.ElementTree as ET
import horast
import horast.nodes as horast_nodes
import numpy as np
import static_typing as st
import typed_... | 93 | 109 | 2 | 1 | 205 | 0 |
AppDB/appscale/datastore/fdb/stats/entities.py | loftwah/appscale | 790 | 191752 | from __future__ import annotations
"""
Each stat kind is populated from one or more stat sections (which are described
in the containers module).
Ns_Kind_CompositeIndex -> composite-indexes
Kind_CompositeIndex -> composite-indexes
Ns_Kind_IsRootEntity -> entities + builtin-indexes
Ns_Kind_NotRootEntity -> entities + bu... | 3 | 2 | 0 | 0 | 5 | 0 |
monitor/plugins/sqli.py | laozhudetui/wam | 227 | 191754 | #!/usr/bin/env python
# coding: utf-8
from baseframe import Plugin
class MyPlugin(Plugin):
info: dict[str,str] = {
'name': '<NAME>',
'tag': 'sqli'
}
rules: list[dict[str,object | str]] = [
{
'desc': 'PHP常见SQLi过滤函数',
'rule': (
r'(?i)get_magi... | 0 | 0 | 2 | 0 | 2 | 0 |
Nepali_nlp/news_scrap.py | potamides/Nepali_nlp | 123 | 191776 | import sys
sys.path.append('..')
import re
import urllib
from bs4 import BeautifulSoup
from urllib.request import Request, urlopen
from newsplease import NewsPlease
def get_content_onlinekhabar(link) -> object:
"""This function extract the contants from onlinakhabar.com
Arguments:
link {string}... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/test_edifice.py | fding/pyedifice | 151 | 191795 | import unittest
import unittest.mock
import edifice._component as component
import edifice.engine as engine
import edifice.base_components as base_components
from edifice.qt import QT_VERSION
if QT_VERSION == "PyQt5":
from PyQt5 import QtWidgets
else:
from PySide2 import QtWidgets
if QtWidgets.QApplication.in... | 0 | 28 | 0 | 18 | 46 | 0 |
fmpy/gui/TableDialog.py | CSchulzeTLK/FMPy | 225 | 191798 | <filename>fmpy/gui/TableDialog.py<gh_stars>100-1000
from PyQt5.QtCore import Qt, QAbstractTableModel, QModelIndex
from PyQt5.QtGui import QFont, QIcon
from PyQt5.QtWidgets import QDialog, QHeaderView
import pyqtgraph as pg
import numpy as np
from fmpy.gui.generated.TableDialog import Ui_TableDialog
pg.setConf... | 0 | 0 | 0 | 0 | 0 | 0 |
src/common/status.py | THUKElab/Video2Description | 152 | 191806 | from enum import Enum
class ModelWeightsStatus(Enum):
NO_INFO: int = 0
SUCCESS: int = 1
MODEL_NOT_FOUND: int = 2
WIP: int = 3 | 0 | 0 | 4 | 0 | 4 | 0 |
examples/dynamic_costs_example.py | Ressmann/starthinker | 138 | 191839 | <filename>examples/dynamic_costs_example.py
###########################################################################
#
# Copyright 2021 Google LLC
#
# 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
BAMF_Detect/modules/njrat.py | bwall/bamfdetect | 152 | 191842 | <gh_stars>100-1000
from common import Modules, data_strings_wide, load_yara_rules, PEParseModule, ModuleMetadata, is_ip_or_domain
class njRat(PEParseModule):
def __init__(self):
md = ModuleMetadata(
module_name="njrat",
bot_name="njRat",
description="RAT",
a... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/monitoring/ops-gcp-check-tags.py | fahlmant/openshift-tools | 164 | 191857 | <gh_stars>100-1000
#!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
"""
This is a script that gathers tags from instances and reports the status of the tags to zabbix
Usage:
ops-gcp-check-tags.py --gcp-creds-file /root/.gce/creds.json --region=us-east1 --clusterid=testcluster
"""
# Ignoring module n... | 0 | 0 | 0 | 0 | 0 | 0 |
parsl/tests/test_regression/test_1480.py | cylondata/parsl | 323 | 191870 | from parsl import python_app
import pytest
from parsl.tests.configs.htex_local import fresh_config
local_config = fresh_config()
@python_app
def compute_descript(size: int=1000) -> object:
import numpy as np
x = np.array(list(range(0, size)), dtype=complex).astype(np.float32)
return x
@pytest.mark.local... | 1 | 1 | 0 | 0 | 2 | 0 |
build/fuchsia/emu_target.py | chromium/chromium | 14,668 | 191878 | <filename>build/fuchsia/emu_target.py<gh_stars>1000+
# Copyright 2019 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.
"""Implements commands for running/interacting with Fuchsia on an emulator."""
import json
import loggi... | 0 | 0 | 0 | 0 | 0 | 0 |
OnlineStudy/generic/handlers/homework.py | NanRenTeam-9/MongoMicroCourse | 132 | 191885 | from __future__ import annotations
from startX.serivce.v1 import StartXHandler, get_m2m_display
from django.urls import reverse
from django.utils.safestring import mark_safe
from .base_promission import PermissionHandler
class HomeworkHandler(PermissionHandler, StartXHandler):
def display_outline(self, model: ob... | 2 | 1 | 2 | 0 | 5 | 0 |
tools/print_descriptor.py | ztlevi/perfetto | 933 | 191887 | <reponame>ztlevi/perfetto<gh_stars>100-1000
#!/usr/bin/env python3
# Copyright (C) 2021 The Android Open Source 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.apa... | 0 | 0 | 0 | 0 | 0 | 0 |
social_auth/backends/pipeline/misc.py | merutak/django-social-auth | 863 | 191894 | from social.pipeline.partial import save_status_to_session
save_status_to_session # placate pyflakes
| 0 | 0 | 0 | 0 | 0 | 0 |
lib/python2.7/site-packages/braintree/exceptions/unexpected_error.py | ervinpepic/E-commerce | 182 | 191934 | <gh_stars>100-1000
from braintree.exceptions.braintree_error import BraintreeError
class UnexpectedError(BraintreeError):
""" Raised for unknown or unexpected errors. """
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
www/speed/benchmarks/big_integers.py | sejalseth/brython | 5,926 | 192021 | n = 60
for i in range(10000):
2 ** n
| 0 | 0 | 0 | 0 | 0 | 0 |
test/unit/common/middleware/s3api/helpers.py | fossabot/swift-1 | 1,802 | 192051 | <filename>test/unit/common/middleware/s3api/helpers.py<gh_stars>1000+
# Copyright (c) 2013 OpenStack Foundation
#
# 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/li... | 0 | 0 | 0 | 0 | 0 | 0 |
cocos/tests/test_numerics/test_linalg/test_svd.py | michaelnowotny/cocos | 101 | 192105 | <gh_stars>100-1000
import cocos.device
import cocos.numerics as cn
import cocos.numerics.linalg as linalg
import numpy as np
# backend = 'cpu'
# backend = 'cuda'
# backend = 'opencl'
backend = None
def compare_cocos_numpy(cocos_array, numpy_array):
return np.allclose(np.array(cocos_array), numpy_array)
def tes... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/numpy/arange.py | Fryguy/py2rb | 124 | 192124 | <reponame>Fryguy/py2rb
import numpy as np
def print_array(data):
datas = []
for i in data:
if float("%.3f" % abs(i)) == 0:
datas.append(float("%.3f" % abs(i)))
else:
datas.append(float("%.3f" % i))
print(datas)
x = np.arange(-1.0, 1.0, 0.1)
print_array(x)
x = np.ara... | 0 | 0 | 0 | 0 | 0 | 0 |
unittest/scripts/py_devapi/validation/mysqlx_table_delete.py | mueller/mysql-shell | 119 | 192138 | <reponame>mueller/mysql-shell
#@ TableDelete: valid operations after delete
|All expected functions are available|
|No additional functions are available|
#@ TableDelete: valid operations after where
|All expected functions are available|
|No additional functions are available|
#@ TableDelete: valid operations after ... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/576757_Shelllike_datprocessing_using_Popen_pipes/recipe-576757.py | tdiprima/code | 2,023 | 192175 | <filename>recipes/Python/576757_Shelllike_datprocessing_using_Popen_pipes/recipe-576757.py
from io import BytesIO
from subprocess import Popen, PIPE
from os import pipe, fdopen
from threading import Thread
class Pipeable( object ):
def __init__( self ):
self.output = None
def _output( self, input = None ):
retur... | 0 | 0 | 0 | 0 | 0 | 0 |
burst/config/menus.py | genevievegraves/burst | 139 | 192196 | <reponame>genevievegraves/burst
def main_menu():
input_map = {'1': 'compute', '2': 'storage', '3': 'default', '4': 'exit'}
print('\nSelect from the options below:')
print(' 1. Set up or remove a compute service')
print(' 2. Set up or remove a storage service')
print(' 3. Change settings for com... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/commands/test_reducers.py | zazula/talos | 1,536 | 192209 | <filename>tests/commands/test_reducers.py<gh_stars>1000+
def test_reducers():
print("\n >>> start reducers...")
import talos
x, y = talos.templates.datasets.iris()
p = talos.templates.params.iris()
model = talos.templates.models.iris
x = x[:50]
y = y[:50]
for strategy in ['trees',
... | 0 | 0 | 0 | 0 | 0 | 0 |
qt__pyqt__pyside__pyqode/qt_fill_QTableWidget_from_SQL/main.py | DazEB2/SimplePyScripts | 117 | 192270 | <reponame>DazEB2/SimplePyScripts
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
try:
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
except:
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import sqlite3
class Widget(QMainWindow... | 0 | 0 | 0 | 0 | 0 | 0 |
rotkehlchen/tests/api/test_exchange_rates_query.py | rotkehlchenio/rotkehlchen | 137 | 192303 | from http import HTTPStatus
import pytest
import requests
from rotkehlchen.constants.assets import A_ETH, A_EUR, A_KRW, A_USD
from rotkehlchen.fval import FVal
from rotkehlchen.tests.utils.api import (
api_url_for,
assert_error_response,
assert_proper_response,
assert_proper_response_with_result,
)
... | 0 | 0 | 0 | 0 | 0 | 0 |
components/PyTorch/pytorch-kfp-components/tests/iris/iris_pytorch.py | Iuiu1234/pipelines | 2,860 | 192362 | #!/usr/bin/env/python3
#
# Copyright (c) Facebook, Inc. and its affiliates.
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_math.py | dhruvmanila/instant-markdown-d | 114 | 192407 | import pytest
@pytest.mark.parametrize(
"server_options,port",
[("--debug", 8090), ("--debug --mathjax", 8090), ("--debug", 9090)],
)
@pytest.mark.parametrize("method", ["curl", "stdin"])
def test_math(browser, Server, server_options, port, method):
with Server(server_options, port) as srv:
srv.s... | 0 | 0 | 0 | 0 | 0 | 0 |
PictorialBar/pictorialbar_multi_custom_symbols.py | pyecharts/pyecharts_gallery | 759 | 192412 | <reponame>pyecharts/pyecharts_gallery
import json
from pyecharts import options as opts
from pyecharts.charts import PictorialBar
location = ["山西", "四川", "西藏", "北京", "上海", "内蒙古", "云南", "黑龙江", "广东", "福建"]
values = [13, 42, 67, 81, 86, 94, 166, 220, 249, 262]
with open("symbol.json", "r", encoding="utf-8") as f:
... | 0 | 0 | 0 | 0 | 0 | 0 |
cflearn/api/cv/data/interface.py | carefree0910/carefree-learn | 400 | 192429 | from torch import Tensor
from typing import Any
from typing import Dict
from typing import List
from typing import Tuple
from typing import Union
from typing import Callable
from typing import Optional
from functools import partial
from torchvision.datasets import MNIST
from ....data import Transforms
from ....types i... | 11 | 4 | 0 | 0 | 15 | 0 |
scripts/performance/perf_load/perf_req_gen_demoted_node.py | Rob-S/indy-node | 627 | 192481 | import random
from indy import ledger, did
import json
from perf_load.perf_req_gen import RequestGenerator
from perf_load.perf_utils import random_string
class RGPoolNewDemotedNode(RequestGenerator):
_req_types: list[str] = ["0"]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)... | 0 | 3 | 1 | 3 | 7 | 0 |
tests/spot/blvt/test_redeem_blvt.py | Banging12/binance-connector-python | 512 | 192483 | <reponame>Banging12/binance-connector-python
import responses
from binance.spot import Spot as Client
from tests.util import mock_http_response
from tests.util import random_str
from binance.error import ParameterRequiredError
mock_item = {"key_1": "value_1", "key_2": "value_2"}
key = random_str()
secret = random_str(... | 0 | 0 | 0 | 0 | 0 | 0 |
WebMirror/management/rss_parser_funcs/feed_parse_extractWLTranslations.py | fake-name/ReadableWebProxy | 193 | 192551 | <filename>WebMirror/management/rss_parser_funcs/feed_parse_extractWLTranslations.py
def extractWLTranslations(item):
"""
# 'WL Translations'
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
if 'Chapter Re... | 0 | 0 | 0 | 0 | 0 | 0 |
models/FaceDetectorAndRecognition/FaceBoxes.py | Dou-Yu-xuan/deep-learning-visal | 150 | 192552 | import torch
import torch.nn as nn
import torchvision
class Conv2dCReLU(nn.Module):
def __init__(self,in_channels,out_channels,kernel_size,stride,padding):
super(Conv2dCReLU, self).__init__()
self.conv = nn.Conv2d(in_channels=in_channels,out_channels=out_channels,kernel_size=kernel_size,stride=stri... | 0 | 3 | 0 | 0 | 3 | 0 |
iSearch/display.py | louisun/iSearch | 255 | 192561 | <reponame>louisun/iSearch
#!/usr/bin/env python
# coding=utf-8
import json
from termcolor import colored
type_to_chinese = {
"basic":"【基本含义】",
"synonyms":"【同近义词】",
"discriminate":"【词语辨析】",
"word_group":"【词组】",
"collins":"【用例介绍】",
"bilingual":"【双语例句】",
"fanyiToggle":"【有道翻译】"
}
def is_title... | 0 | 0 | 0 | 0 | 0 | 0 |
Mafia-Killer404/pro.py | shyamjangid07/Reverse-Engineering | 337 | 192618 | <reponame>shyamjangid07/Reverse-Engineering
# Decompiled by HTR-TECH | <NAME>
# Github : https://github.com/htr-tech
#---------------------------------------
# Source File : pro.py
# Time : Sun Feb 14 08:34:41 2021
#---------------------------------------
# uncompyle6 version 3.7.4
# Python bytecode 2.7
# Decompiled f... | 0 | 0 | 0 | 0 | 0 | 0 |
successstories/tests/test_utils.py | buketkonuk/pythondotorg | 911 | 192634 | <reponame>buketkonuk/pythondotorg
import datetime
from django.test import SimpleTestCase
from ..utils import convert_to_datetime, get_field_list
class UtilsTestCase(SimpleTestCase):
def test_convert_to_datetime(self):
tests = [
('%Y-%m-%d %H:%M:%S', '2017-02-24 21:05:24'),
('%Y-... | 0 | 0 | 0 | 0 | 0 | 0 |
plugins/pushover/alerta_pushover.py | hamptons/alerta-contrib | 114 | 192660 | <filename>plugins/pushover/alerta_pushover.py
import logging
import os
import requests
try:
from alerta.plugins import app # alerta >= 5.0
except ImportError:
from alerta.app import app # alerta < 5.0
from alerta.plugins import PluginBase
LOG = logging.getLogger('alerta.plugins.pushover')
PUSHOVER_URL = '... | 0 | 0 | 0 | 0 | 0 | 0 |
nglview/config.py | vhorvath/nglview | 161 | 192664 | <filename>nglview/config.py
BACKENDS = dict()
| 0 | 0 | 0 | 0 | 0 | 0 |
pytorch/edgeml_pytorch/cuda/setup.py | cw18-coder/EdgeML | 719 | 192665 | import setuptools #enables develop
import os
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
from edgeml_pytorch.utils import findCUDA
if findCUDA() is not None:
setuptools.setup(
name='fastgrnn_cuda',
ext_modules=[
CUDAExtension('fastgrnn_cuda', [
'f... | 0 | 0 | 0 | 0 | 0 | 0 |
pyzx/circuit/quipperparser.py | mnm-team/pyzx-heuristics | 219 | 192708 | # PyZX - Python library for quantum circuit rewriting
# and optimization using the ZX-calculus
# Copyright (C) 2018 - <NAME> and <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... | 2 | 2 | 0 | 0 | 4 | 0 |
Utils/metrics.py | arafin-lab/model_inversion_experiments | 101 | 192714 | from __future__ import annotations
import torch
import torch.nn.functional as F
import numpy as np
import matplotlib.pyplot as plt
from sklearn.pipeline import Pipeline
from SVC_Utils import *
from sklearn.metrics import roc_curve, auc
# determine device to run network on (runs on gpu if available)
device = torch.dev... | 1 | 2 | 0 | 0 | 3 | 0 |
data_process/gen_label_graph.py | kxhit/SG_PR | 105 | 192732 | #!/usr/bin/env python3
# This file is covered by the LICENSE file in the root of this project.
import argparse
import os
import yaml
import numpy as np
import pcl
# import matplotlib.pyplot as plt
# from mpl_toolkits.mplot3d import Axes3D
from auxiliary.laserscan import SemLaserScan
import random
import open3d
# from ... | 3 | 3 | 0 | 0 | 6 | 0 |
web/spider/test.py | laozhudetui/LSpider | 311 | 192744 | <filename>web/spider/test.py<gh_stars>100-1000
#!/usr/bin/env python
# encoding: utf-8
'''
@author: LoRexxar
@contact: <EMAIL>
@file: test.py.py
@time: 2020/4/3 15:45
@desc:
'''
from django.test import TestCase
from django.utils import timezone
from .controller.spider import SpiderCore
class SpiderCoreTests(TestCa... | 0 | 0 | 0 | 0 | 0 | 0 |
es_sink/es_sink/__init__.py | avmi/community | 305 | 192747 | __all__ = ['descriptor',
'es_transport',
'flushing_buffer',
'line_buffer',
'sqs_transport',
'transport_exceptions',
'transport_result',
'transport_utils'] | 0 | 0 | 0 | 0 | 0 | 0 |
python-modules/twisted/twisted/conch/test/test_window.py | stormtheh4ck3r/python-for-android | 267 | 192806 | <reponame>stormtheh4ck3r/python-for-android
"""
Tests for the insults windowing module, L{twisted.conch.insults.window}.
"""
from twisted.trial.unittest import TestCase
from twisted.conch.insults.window import TopWindow
class TopWindowTests(TestCase):
"""
Tests for L{TopWindow}, the root window container c... | 0 | 0 | 0 | 0 | 0 | 0 |
classification/training/update/WindowClassificationTrainUpdateSchedulerParam.py | Tessellate-Imaging/Monk_Gui | 129 | 192846 | import os
import sys
import json
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
class WindowClassificationTrainUpdateSchedulerParam(QtWidgets.QWidget):
forward_loss_param = QtCore.pyqtSignal();
backward_optimizer_param = QtCore.pyqtSignal();
def __init__(se... | 0 | 0 | 0 | 8 | 8 | 0 |
src/pipelines/epidemiology/us_wa_authority.py | chrismayemba/covid-19-open-data | 430 | 192870 | <filename>src/pipelines/epidemiology/us_wa_authority.py<gh_stars>100-1000
# Copyright 2020 Google LLC
#
# 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/L... | 0 | 0 | 0 | 0 | 0 | 0 |
sagify/template/sagify_base/prediction/predictor.py | kevinbuchanjr/sagify | 352 | 192902 | <gh_stars>100-1000
# This is the file that implements a flask server to do inferences. It's the file that you will
# modify to implement the scoring for your own algorithm.
from __future__ import print_function
import json
import flask
from . import predict
app = flask.Flask(__name__)
@app.route('/ping', metho... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/st/ops/cpu/test_minimum_op.py | PowerOlive/mindspore | 3,200 | 192912 | <gh_stars>1000+
# Copyright 2020 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
Lib/importlib/machinery.py | oleksandr-pavlyk/cpython | 52,316 | 192927 | """The machinery of importlib: finders, loaders, hooks, etc."""
from ._bootstrap import ModuleSpec
from ._bootstrap import BuiltinImporter
from ._bootstrap import FrozenImporter
from ._bootstrap_external import (SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES,
OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIX... | 0 | 1 | 0 | 0 | 1 | 0 |
litex_boards/targets/rz_easyfpga.py | trabucayre/litex-boards | 177 | 192939 | #!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2021 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-2-Clause
import os
import argparse
from migen import *
from litex.build.io import DDROutput
from litex_boards.platforms import easyfpga
from litex.soc.cores.clock import CycloneIVPL... | 3 | 0 | 0 | 0 | 3 | 0 |
riptable/benchmarks/bench_primops.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | 307 | 192955 | # -*- coding: utf-8 -*-
"""
Benchmarks for primitive/low-level array operations.
"""
__all__ = [
"bench_astype",
"bench_astype_numba",
"bench_astype_numpy",
"bench_bool_index",
"bench_bool_index_numpy",
"bench_compare_ops",
"bench_compare_ops_numpy",
"bench_mbget",
"benc... | 0 | 17 | 9 | 0 | 26 | 0 |
Stock_Analysis/pivot_points.py | vhn0912/Finance | 441 | 192956 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import yfinance as yf
yf.pdr_override()
import datetime as dt
symbol = 'AMD'
market = 'SPY'
num_of_years = 1
start = dt.date.today() - dt.timedelta(days=365*num_of_years)
end... | 0 | 0 | 0 | 0 | 0 | 0 |
python/ray/util/sgd/torch/examples/image_models/args.py | 77loopin/ray | 21,382 | 192966 | <gh_stars>1000+
# Modified by <NAME> in 2020
#
# Original work by <NAME> as part of the timm package
# (see LICENSE_THIRDPARTY)
# Note: other authors MUST include themselves in the above copyright notice
# in order to abide by the terms of the Apache license
import logging
import argparse
import yaml
config_pa... | 0 | 0 | 0 | 0 | 0 | 0 |
mmdet/models/detectors/reppoints_detector_reid.py | firmamentqj/AlignPS | 144 | 192971 | <filename>mmdet/models/detectors/reppoints_detector_reid.py<gh_stars>100-1000
import torch
from mmdet.core import bbox2result, bbox_mapping_back, multiclass_nms
from ..builder import DETECTORS
from .single_stage_reid import SingleStageReidDetector
@DETECTORS.register_module()
class RepPointsDetectorReid(SingleStageR... | 0 | 0 | 0 | 0 | 0 | 0 |
qiskit_nature/mappers/second_quantization/parity_mapper.py | jschuhmac/qiskit-nature | 132 | 192974 | <gh_stars>100-1000
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modificatio... | 0 | 0 | 0 | 0 | 0 | 0 |
mars/tensor/reduction/nanprod.py | hxri/mars | 2,413 | 192983 | <filename>mars/tensor/reduction/nanprod.py
#!/usr/bin/env python
# -*- 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
#
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/ignition/linux_perf_report_test.py | TwistedCore/external_v8 | 1,244 | 193001 | # Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import linux_perf_report as ipr
import StringIO
import unittest
PERF_SCRIPT_OUTPUT = """
# This line is a comment
# This should be ignored too
#
# cde... | 0 | 0 | 0 | 0 | 0 | 0 |
python_toolbox/math_tools/statistics.py | hboshnak/python_toolbox | 119 | 193003 | # Copyright 2009-2017 <NAME>.
# This program is distributed under the MIT license.
import numbers
infinity = float('inf')
infinities = (infinity, -infinity)
def get_median(iterable) -> object:
'''Get the median of an iterable of numbers.'''
sorted_values = sorted(iterable)
if len(iterable) % 2 == 0:
... | 0 | 2 | 0 | 0 | 2 | 0 |
packages/pyright-internal/src/tests/samples/typeNarrowingIsNoneTuple1.py | Jasha10/pyright | 3,934 | 193015 | # This sample tests the type narrowing case for unions of tuples
# where one or more of the entries is tested against type None.
from typing import TypeVar, Tuple, Union
_T1 = TypeVar("_T1")
def func1(a: Union[Tuple[_T1, None], Tuple[None, str]]) -> Tuple[_T1, None]:
if a[1] is None:
reveal_type(a, expe... | 4 | 1 | 0 | 0 | 5 | 0 |
shap/benchmark/measures.py | santanaangel/shap | 16,097 | 193028 | import numpy as np
from tqdm.autonotebook import tqdm
import gc
import warnings
import sklearn.utils
_remove_cache = {}
def remove_retrain(nmask, X_train, y_train, X_test, y_test, attr_test, model_generator, metric, trained_model, random_state) -> object:
""" The model is retrained for each test sample with the i... | 2 | 14 | 0 | 0 | 16 | 0 |
nsot/migrations/0036_add_protocol.py | comerford/nsot | 387 | 193047 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields.json
class Migration(migrations.Migration):
dependencies = [
('nsot', '00... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/mechanic/java_resolver_test.py | Kua-Fu/rally | 1,577 | 193048 | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | 0 | 0 | 0 | 0 | 0 | 0 |
test/test_torcontrolprotocol.py | faridblack/txtorcon | 180 | 193068 | from __future__ import print_function
from __future__ import with_statement
from os.path import exists
from twisted.python import log, failure
from twisted.trial import unittest
from twisted.test import proto_helpers
from twisted.internet import defer, error
from txtorcon import TorControlProtocol, TorProtocolFactor... | 0 | 33 | 0 | 1 | 34 | 0 |
applications/CoSimulationApplication/python_scripts/coupled_solvers/gauss_seidel_weak.py | lkusch/Kratos | 778 | 193088 | # Importing the base class
from KratosMultiphysics.CoSimulationApplication.base_classes.co_simulation_coupled_solver import CoSimulationCoupledSolver
def Create(settings, models, solver_name) -> object:
return GaussSeidelWeakCoupledSolver(settings, models, solver_name)
class GaussSeidelWeakCoupledSolver(CoSimulat... | 0 | 2 | 0 | 0 | 2 | 0 |
learn2learn/vision/datasets/quickdraw.py | Brikwerk/learn2learn | 1,774 | 193128 | <gh_stars>1000+
#!/usr/bin/env python3
import os
import tarfile
import subprocess
import numpy as np
import pickle
from PIL import Image
from torch.utils.data import Dataset
from learn2learn.data.utils import download_file
from torchvision.datasets.folder import default_loader
DATA_DIR = 'quickdraw'
GCLOUD_BUCKET =... | 0 | 0 | 0 | 0 | 0 | 0 |
ballerinaByExample/vendor/pygments/pygments/lexers/eiffel.py | ayeshLK/ballerina-release | 182 | 193141 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
"""
pygments.lexers.eiffel
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the Eiffel language.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, words
from pyg... | 0 | 0 | 0 | 0 | 0 | 0 |
boto3_type_annotations_with_docs/boto3_type_annotations/sns/paginator.py | cowboygneox/boto3_type_annotations | 119 | 193154 | from typing import Dict
from botocore.paginate import Paginator
class ListEndpointsByPlatformApplication(Paginator):
def paginate(self, PlatformApplicationArn: str, PaginationConfig: Dict = None) -> Dict:
"""
Creates an iterator that will paginate through responses from :py:meth:`SNS.Client.list_e... | 8 | 6 | 0 | 0 | 14 | 0 |
tests/test_spiderloader/__init__.py | FingerCrunch/scrapy | 41,267 | 193172 | <gh_stars>1000+
import sys
import os
import shutil
import warnings
from zope.interface.verify import verifyObject
from twisted.trial import unittest
# ugly hack to avoid cyclic imports of scrapy.spiders when running this test
# alone
import scrapy
import tempfile
from scrapy.interfaces import ISpiderLoader
from scra... | 0 | 0 | 0 | 0 | 0 | 0 |
dragonfire/config.py | ismlkrkmz/Dragonfire | 1,320 | 193176 | <reponame>ismlkrkmz/Dragonfire<filename>dragonfire/config.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: config
:platform: Unix
:synopsis: the module that contains the configuration for the API of Dragonfire.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import os
class Config():
"""Class that ... | 0 | 0 | 0 | 0 | 0 | 0 |
HunterAdminApi/test/api/authentication/test_ldap.py | tt9133github/hunter | 322 | 193183 | <reponame>tt9133github/hunter<gh_stars>100-1000
#!/ usr/bin/env
# coding=utf-8
#
# Copyright 2019 ztosec & https://sec.zto.com/
#
# 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 |
nuplan/planning/nuboard/tabs/overview_tab.py | motional/nuplan-devkit | 128 | 193196 | <filename>nuplan/planning/nuboard/tabs/overview_tab.py
import logging
from collections import defaultdict
from dataclasses import dataclass
from typing import Any, Dict, List
import numpy as np
from bokeh.document.document import Document
from bokeh.models import ColumnDataSource, DataTable, TableColumn
from nuplan.p... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/proto_build_generator.py | jzjonah/apollo | 22,688 | 193224 | #!/usr/bin/env python3
from __future__ import annotations
import os
import re
import sys
import subprocess
TAB = " " * 4
##==================== REFERENCE ===========================================##
#
# https://github.com/grpc/grpc/blob/master/bazel/test/python_test_repo/BUILD
#
##==================== HEADER TEMPLA... | 0 | 12 | 0 | 0 | 12 | 0 |
up/extensions/python/iou_overlap.py | ModelTC/EOD | 196 | 193232 | <reponame>ModelTC/EOD
# Import from local
from .._C import overlaps
def gpu_iou_overlap(b1, b2, mode='IoU'):
"""compute IoU/IoF/IoS between b1 and b2
Args:
b1: Tensor, [N, >=4]
b2: Tensor, [M, >=4]
mode: str, {IoU, IoF, IoS} Intersection over Union/First/Second area
"""
if b1.n... | 0 | 0 | 0 | 0 | 0 | 0 |
saleor/graphql/shipping/tests/mutations/test_shipping_zone_create.py | eanknd/saleor | 1,392 | 193234 | from unittest import mock
import graphene
from django.utils.functional import SimpleLazyObject
from freezegun import freeze_time
from .....shipping.error_codes import ShippingErrorCode
from .....shipping.models import ShippingZone
from .....webhook.event_types import WebhookEventAsyncType
from .....webhook.payloads i... | 0 | 0 | 0 | 0 | 0 | 0 |
TopQuarkAnalysis/TopJetCombination/python/TtSemiLepHypGeom_cfi.py | ckamtsikis/cmssw | 852 | 193254 | <filename>TopQuarkAnalysis/TopJetCombination/python/TtSemiLepHypGeom_cfi.py
import FWCore.ParameterSet.Config as cms
#
# module to make the geom hypothesis
#
ttSemiLepHypGeom = cms.EDProducer("TtSemiLepHypGeom",
## met input
mets = cms.InputTag("patMETs"),
## jet input
jets = cms.InputTag("selected... | 0 | 0 | 0 | 0 | 0 | 0 |
pyscf/fci/spin_op.py | QuESt-Calculator/pyscf | 501 | 193255 | #!/usr/bin/env python
# Copyright 2014-2021 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... | 7 | 9 | 0 | 0 | 16 | 0 |
library/oneview_label_facts.py | LaudateCorpus1/oneview-ansible | 108 | 193256 | #!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2021) Hewlett Packard Enterprise Development LP
#
# 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/licen... | 0 | 1 | 0 | 0 | 1 | 0 |
var/spack/repos/builtin/packages/gosam-contrib/package.py | LiamBindle/spack | 2,360 | 193258 | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class GosamContrib(AutotoolsPackage):
"""Additional libraries for GoSam MC generator"""
hom... | 0 | 3 | 3 | 0 | 6 | 0 |
art/estimators/poison_mitigation/strip/strip.py | monshri/adversarial-robustness-toolbox | 1,350 | 193270 | # MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020
#
# 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
# r... | 8 | 4 | 0 | 2 | 14 | 0 |
examples/pytorch/math_word_problem/mathqa/src/evaluation.py | cminusQAQ/graph4nlp | 1,269 | 193273 | <filename>examples/pytorch/math_word_problem/mathqa/src/evaluation.py
def convert_to_string(idx_list, form_manager):
w_list = []
for i in range(len(idx_list)):
w_list.append(form_manager.get_idx_symbol(int(idx_list[i])))
return " ".join(w_list)
def is_all_same(c1, c2, form_manager):
all_same =... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unittests/command_parse/test_geo.py | itamarhaber/iredis | 1,857 | 193308 | <filename>tests/unittests/command_parse/test_geo.py
def test_geoadd(judge_command):
judge_command(
'GEOADD Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania"',
{
"command": "GEOADD",
"key": "Sicily",
"longitude": "15.087269",
"latitude"... | 0 | 0 | 0 | 0 | 0 | 0 |
E03 - Learning programs and models/Architectures/utils/default_setup.py | mialona/Stomatal-segmentation | 654 | 193332 | <reponame>mialona/Stomatal-segmentation<gh_stars>100-1000
import os
import logging
import json
import torch
from .distributed import get_rank, synchronize
from .logger import setup_logger
from .env import seed_all_rng
from ..config import cfg
def default_setup(args):
num_gpus = int(os.environ["WORLD_SIZE"]) if "W... | 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.