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 |
|---|---|---|---|---|---|---|---|---|---|---|
kitsune/messages/urls.py | AndrewDVXI/kitsune | 929 | 1626311 | <filename>kitsune/messages/urls.py
from django.conf.urls import url
from kitsune.messages import views
urlpatterns = [
url(r"^$", views.inbox, name="messages.inbox"),
url(r"^/bulk_action$", views.bulk_action, name="messages.bulk_action"),
url(r"^/read/(?P<msgid>\d+)$", views.read, name="messages.read"),
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/modification_prop.py | upgradeQ/OBS-Studio-Python-Scripting-Cheatsheet | 116 | 1626316 | from __future__ import annotations
import obspython as S
from itertools import cycle
class Example:
def __init__(self, source_name: object | None=None):
self.source_name = source_name
self.data: str = ""
def update_text(self):
source = S.obs_get_source_by_name(self.source_n... | 1 | 3 | 0 | 1 | 5 | 0 |
src/beanmachine/ppl/compiler/gen_bmg_graph.py | horizon-blue/beanmachine-1 | 177 | 1626319 | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Dict, List, Set
import beanmachine.ppl.compiler.bmg_nodes as bn
import beanmachine.ppl.compiler.profiler as prof
import ... | 13 | 12 | 4 | 2 | 31 | 0 |
openmdao/core/parallel_group.py | friedenhe/OpenMDAO | 451 | 1626365 | <filename>openmdao/core/parallel_group.py<gh_stars>100-1000
"""Define the ParallelGroup class."""
from openmdao.core.group import Group
class ParallelGroup(Group):
"""
Class used to group systems together to be executed in parallel.
Parameters
----------
**kwargs : dict
Dict of arguments... | 0 | 0 | 0 | 0 | 0 | 0 |
ds2/mapping/__init__.py | keelya/datastructures | 159 | 1626381 | <reponame>keelya/datastructures<filename>ds2/mapping/__init__.py
from ds2.mapping.mapping import Mapping, Entry
from ds2.mapping.listmappingsimple import ListMappingSimple
from ds2.mapping.listmapping import ListMapping
from ds2.mapping.listmapping_notDRY import ListMapping as ListMapping_notDRY
from ds2.mapping.hashma... | 0 | 0 | 0 | 0 | 0 | 0 |
backend/api/apps.py | skaghzz/doccano | 3,989 | 1626385 | import importlib
from django.apps import AppConfig
class ApiConfig(AppConfig):
name: str = 'api'
verbose_name: str = 'Api'
def ready(self):
importlib.import_module('api.signals')
| 0 | 0 | 2 | 0 | 2 | 0 |
geomstats/geometry/hyperbolic.py | xpennec/geomstats | 743 | 1626390 | """Common interface to hyperbolic spaces."""
import geomstats.errors as errors
from geomstats.geometry._hyperbolic import _Hyperbolic
from geomstats.geometry.hyperboloid import Hyperboloid
from geomstats.geometry.manifold import Manifold
from geomstats.geometry.poincare_ball import PoincareBall
from geomstats.geometry... | 1 | 1 | 0 | 0 | 2 | 0 |
pyowm/airpollutionapi30/airstatus.py | Trendometrics/pyowm | 799 | 1626392 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyowm.commons import exceptions
from pyowm.utils import formatting, timestamps
from pyowm.weatherapi25 import location
class AirStatus:
"""
A class representing a dataset about air quality
:param reference_time: GMT UNIXtime telling when the data has be... | 2 | 6 | 0 | 0 | 8 | 0 |
alipay/aop/api/response/AlipayCommerceVoucherResultConsultResponse.py | antopen/alipay-sdk-python-all | 213 | 1626424 | <filename>alipay/aop/api/response/AlipayCommerceVoucherResultConsultResponse.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.VoucherConsultInfo import VoucherConsultInfo
class AlipayCommerceVoucherResultConsultR... | 0 | 0 | 0 | 0 | 0 | 0 |
python/ql/test/query-tests/Security/lib/flask/globals.py | vadi2/codeql | 4,036 | 1626430 |
class LocalProxy(object):
pass
request = LocalProxy()
current_app = LocalProxy()
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/concurrency_patterns/5-select/example5.py | agentOfChaos/aiochan | 128 | 1626433 | from __future__ import annotations
from aiochan import *
def cleanup():
print('Cleaned up')
async def boring(msg, quit) -> object | None:
c = Chan()
async def work() -> None:
i = 0
while True:
_, ch = await select((c, f'{msg} {i}'), quit)
if ch is quit:
... | 0 | 2 | 0 | 0 | 2 | 0 |
mac/pyobjc-framework-Quartz/Examples/Programming with Quartz/CocoaDrawingShell/main.py | albertz/music-player | 132 | 1626434 | from PyObjCTools import NibClassBuilder, AppHelper
NibClassBuilder.extractClasses("MainMenu")
import MyView
AppHelper.runEventLoop()
| 0 | 0 | 0 | 0 | 0 | 0 |
src/stitching/branch_test.py | tszssong/DREAM | 408 | 1626444 | <reponame>tszssong/DREAM<filename>src/stitching/branch_test.py
import numpy as np
import struct as st
import torch
import torch.nn as nn
import math
from branch_util import *
def load_feat(feat_file):
feats = list()
with open(feat_file, 'rb') as in_f:
feat_num, feat_dim = st.unpack('ii', in_f.read(8))
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/lsp_test_client/utils.py | karthiknadig/jedi-language-server | 300 | 1626448 | from __future__ import annotations
"""Provides LSP client side utilities for easier testing."""
import os
import pathlib
import platform
import re
from random import choice
import py
def normalizecase(path: str) -> str:
"""Fixes 'file' uri or path case for easier testing in windows."""
if platform.system() ... | 2 | 5 | 0 | 0 | 7 | 0 |
tests/integration/cartography/intel/aws/ec2/test_ec2_volumes.py | roryfinn3/cartography | 2,322 | 1626462 | import cartography.intel.aws.ec2.volumes
import tests.data.aws.ec2.volumes
TEST_ACCOUNT_ID = '000000000000'
TEST_REGION = 'eu-west-1'
TEST_UPDATE_TAG = 123456789
def test_load_volumes(neo4j_session):
data = tests.data.aws.ec2.volumes.DESCRIBE_VOLUMES
cartography.intel.aws.ec2.volumes.load_volumes(
ne... | 0 | 0 | 0 | 0 | 0 | 0 |
point_sampling/vox2pointvaluepair_from_hsp.py | IsaacGuan/implicit-decoder | 325 | 1626467 | <gh_stars>100-1000
import numpy as np
import cv2
import os
import h5py
from scipy.io import loadmat
import random
import json
class_name_list = [
"02828884_bench",
"04090263_rifle",
"04256520_couch",
"04530566_vessel",
"02958343_car",
]
def list_image(root, recursive, exts):
image_list = []
cat = {}
for path, ... | 0 | 0 | 0 | 0 | 0 | 0 |
config/custom_components/meross_cloud/climate.py | LRvdLinden/homeassistant-config | 288 | 1626468 | from __future__ import annotations
import logging
from datetime import timedelta
from typing import Optional, Iterable, List
from homeassistant.components.climate import SUPPORT_TARGET_TEMPERATURE, SUPPORT_PRESET_MODE, HVAC_MODE_OFF, \
HVAC_MODE_HEAT
from homeassistant.components.climate.const import HVAC_MODE_AUT... | 11 | 21 | 0 | 1 | 33 | 0 |
lib/simplejson/tests/test_dump.py | nirzari18/Query-Analysis-Application-on-Google-App-Engine | 882 | 1626483 | from unittest import TestCase
from simplejson.compat import StringIO, long_type, b, binary_type, PY3
import simplejson as json
def as_text_type(s) -> object:
if PY3 and isinstance(s, binary_type):
return s.decode('ascii')
return s
class TestDump(TestCase):
def test_dump(self):
sio = String... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/test_blurhash.py | zen-tools/Mastodon.py | 516 | 1626502 | import pytest
def test_blurhash_decode(api):
fake_media_dict = {
'width': 320,
'height': 240,
'blurhash': '=~NdOWof1PbIPUXSvgbI$f'
}
decoded_image = api.decode_blurhash(fake_media_dict)
assert len(decoded_image) == 9 * 16
assert len(decoded_image[0]) == 16
decoded_i... | 0 | 0 | 0 | 0 | 0 | 0 |
airbyte-integrations/connectors/source-intercom/unit_tests/unit_test.py | darian-heede/airbyte | 6,215 | 1626523 | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import pytest
import requests
from airbyte_cdk.sources.streams.http.auth import NoAuth
from source_intercom.source import Companies, Contacts, IntercomStream
test_data = [
(
IntercomStream,
{"data": [], "pages": {"next": "https://api.in... | 0 | 0 | 0 | 0 | 0 | 0 |
SoftLayer/CLI/block/refresh.py | dvzrv/softlayer-python | 126 | 1626535 | """Refresh a duplicate volume with a snapshot from its parent."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
@click.command()
@click.argument('volume_id')
@click.argument('snapshot_id')
@environment.pass_env
def cli(env, volume_id, snapshot_id):... | 0 | 0 | 0 | 0 | 0 | 0 |
graphite_beacon/utils.py | z1nkum/graphite-beacon | 478 | 1626548 | <reponame>z1nkum/graphite-beacon<gh_stars>100-1000
import operator as op
from re import compile as re
from funcparserlib.lexer import Token, make_tokenizer
from funcparserlib.parser import a, finished, many, maybe, skip, some
# NOTE: the unit conversions below should be considered deprecated and migrated
# over to `u... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | comerford/nsot | 387 | 1626572 | <gh_stars>100-1000
#!/usr/bin/env python
from __future__ import absolute_import
from distutils import log
from distutils.core import Command
import os
from subprocess import check_output
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from setuptools.comm... | 0 | 0 | 0 | 0 | 0 | 0 |
veles/publishing/registry.py | AkshayJainG/veles | 1,007 | 1626583 | # -*- coding: utf-8 -*-
"""
.. invisible:
_ _ _____ _ _____ _____
| | | | ___| | | ___/ ___|
| | | | |__ | | | |__ \ `--.
| | | | __|| | | __| `--. \
\ \_/ / |___| |___| |___/\__/ /
\___/\____/\_____|____/\____/
Created on Apr 23, 2015
Publishing backends registry.
████████... | 0 | 0 | 1 | 0 | 1 | 0 |
pyhashcat/tests/test_hash_compare.py | security-geeks/hacking-tools | 198 | 1626586 | <reponame>security-geeks/hacking-tools
__author__ = 'girish'
from unittest import TestCase
import unittest
from pyhashcat.Hasher import MD5Hasher
from pyhashcat.Hasher import AbstractHasher
class hasher_test(TestCase):
def setUp(self):
self.data = "Nobody inspects the spammish repetition"
sel... | 0 | 0 | 0 | 0 | 0 | 0 |
src/sage/manifolds/local_frame.py | UCD4IDS/sage | 1,742 | 1626638 | from __future__ import annotations
r"""
Local Frames
The class :class:`LocalFrame` implements local frames on vector bundles
(see :class:`~sage.manifolds.vector_bundle.TopologicalVectorBundle` or
:class:`~sage.manifolds.differentiable.vector_bundle.DifferentiableVectorBundle`).
For `k=0,1,\dots`, a *local frame* on a... | 36 | 15 | 0 | 3 | 54 | 0 |
scripts/mnpr_UIs.py | semontesdeoca/MNPR | 218 | 1626683 | """
@license: MIT
@repository: https://github.com/semontesdeoca/MNPR
_ _ ___
_ __ ___ _ __ _ __ _ __ | | | |_ _|___
| '_ ` _ \| '_ \| '_ \| '__| | | | || |/ __|
| | | | | | | | | |_) | | | |_| || |\__ \
|_| |_| |_|_| |_| .__/|_| \___/|___|___/
... | 3 | 0 | 1 | 1 | 5 | 0 |
matrix-python-project/cover_generator/structure.py | hokaso/hocassian-media-matrix | 141 | 1626722 | import sys, os, time, json, random
from PIL import Image, ImageDraw, ImageFont, ImageFilter
sys.path.append(os.getcwd())
class Structure(object):
def __init__(self):
self.first_title: None = None
self.secord_title: None = None
self.font_path: str = "cover_generator/font"
with o... | 0 | 4 | 0 | 6 | 10 | 0 |
vumi/scripts/benchmark_persist.py | seidu626/vumi | 199 | 1626738 | # -*- test-case-name: vumi.scripts.tests.test_benchmark_persist -*-
import sys
import time
from twisted.python import usage
from twisted.internet import reactor
from twisted.internet.defer import maybeDeferred, inlineCallbacks, DeferredList
from vumi.message import TransportUserMessage
from vumi.persist.model import M... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | boylegu/regal | 432 | 1626757 | <filename>setup.py
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
__version_info__ = (1, 2)
__version__ = '.'.join([str(v) for v in __version_info__])
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
os.ch... | 0 | 0 | 0 | 0 | 0 | 0 |
compiler/model_configs/sram_8b_256w_1wpr_1las_1rw.py | im-world/OpenRAM | 335 | 1626774 | <gh_stars>100-1000
from shared_config import *
word_size = 8
num_words = 256
words_per_row = 1
local_array_size = 1
output_extended_config = True
output_datasheet_info = True
netlist_only = True
nominal_corner_only = True
| 0 | 0 | 0 | 0 | 0 | 0 |
parsl/tests/manual_tests/test_oauth_ssh.py | cylondata/parsl | 323 | 1626790 | <filename>parsl/tests/manual_tests/test_oauth_ssh.py
from parsl.channels import OAuthSSHChannel
def test_channel():
channel = OAuthSSHChannel(hostname='ssh.demo.globus.org', username='yadunand')
x, stdout, stderr = channel.execute_wait('ls')
print(x, stdout, stderr)
assert x == 0, "Expected exit code ... | 0 | 0 | 0 | 0 | 0 | 0 |
scout/commands/load/base.py | Clinical-Genomics/scout | 111 | 1626810 | <gh_stars>100-1000
#!/usr/bin/env python
# encoding: utf-8
import logging
import click
from .case import case as case_command
from .cytoband import cytoband as cytoband_command
from .exons import exons as exons_command
from .institute import institute as institute_command
from .panel import panel as panel_command
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
indra/assemblers/index_card/__init__.py | zebulon2/indra | 136 | 1626820 | <filename>indra/assemblers/index_card/__init__.py
from .assembler import IndexCardAssembler
| 0 | 0 | 0 | 0 | 0 | 0 |
py/testdir_0xdata_slow/test_covtype200_upload.py | gigliovale/h2o | 882 | 1626829 | <reponame>gigliovale/h2o
import unittest, time, sys, random, logging
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm, h2o_exec as h2e, h2o_jobs
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py | google-ar/chromium | 777 | 1626850 | <reponame>google-ar/chromium<filename>tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
#!/usr/bin/python
#
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Loops Custom Tabs tests and o... | 0 | 0 | 0 | 0 | 0 | 0 |
sqlsite/sqlar.py | j4mie/sqlsite | 192 | 1626863 | from zlib import decompress
def get_row(db, name) -> object:
query = "SELECT rowid, sz FROM sqlar WHERE name=:name"
return db.cursor().execute(query, {"name": name}).fetchone()
def get_blob(db, row) -> object:
return db.blobopen("main", "sqlar", "data", row["rowid"], False)
def get_data(db, row) -> ob... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/setupMysql.py | xinnosuke/Halite-II | 232 | 1626865 | <reponame>xinnosuke/Halite-II<filename>tests/setupMysql.py<gh_stars>100-1000
import configparser
import os
parser = configparser.ConfigParser()
parser.read("../halite.ini")
passwordField = "" if parser["database"]["password"] == "" else "-p"+parser["database"]["password"]
os.system("mysql -u "+parser["database"]["use... | 0 | 0 | 0 | 0 | 0 | 0 |
api/desecapi/urls/version_1.py | Eisfunke/desec-stack | 197 | 1626866 | <gh_stars>100-1000
from django.urls import include, path, re_path
from rest_framework.routers import SimpleRouter
from desecapi import views
tokens_router = SimpleRouter()
tokens_router.register(r'', views.TokenViewSet, basename='token')
auth_urls = [
# User management
path('', views.AccountCreateView.as_vie... | 0 | 0 | 0 | 0 | 0 | 0 |
gans/one_dim_gan.py | garyxcheng/federated | 330 | 1626885 | <filename>gans/one_dim_gan.py
# Copyright 2018, 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/LICENSE-2.0
#
# Unless required by applicab... | 0 | 0 | 0 | 0 | 0 | 0 |
src/autogen/elasticity_rhs.py | ldXiao/polyfem | 228 | 1626903 | <filename>src/autogen/elasticity_rhs.py<gh_stars>100-1000
import os
import argparse
from sympy import *
from sympy.matrices import *
import re
# local
import pretty_print
def Det(mat):
assert(mat.rows == mat.cols)
if(mat.rows == 1):
return mat[0]
elif(mat.rows == 2):
return mat[0, 0] *... | 0 | 0 | 0 | 0 | 0 | 0 |
Visualization/plot_pitch_contour_show_controlability.py | hash2430/pitchtron | 123 | 1626904 | <filename>Visualization/plot_pitch_contour_show_controlability.py
from datasets.generate_mel_f0 import get_mel_and_f0
import matplotlib.pyplot as plt
from configs.grl_200224 import create_hparams
from librosa.core import dtw
import numpy as np
hparams = create_hparams()
reference_path = '/mnt/sdd1/selvas_wav/pfo/wav_tr... | 0 | 0 | 0 | 0 | 0 | 0 |
src/python2/request/thumbnail_set_request_builder.py | meson800/onedrive-sdk-python | 912 | 1626917 | # -*- coding: utf-8 -*-
from __future__ import annotations
'''
# Copyright (c) 2015 Microsoft Corporation
#
# 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 wi... | 3 | 7 | 0 | 0 | 10 | 0 |
pth_transfer.py | jie311/FGD | 103 | 1626934 | # -*- coding: utf-8 -*-
import torch
import argparse
from collections import OrderedDict
def change_model(args):
fgd_model = torch.load(args.fgd_path)
all_name = []
for name, v in fgd_model["state_dict"].items():
if name.startswith("student."):
all_name.append((name[8:], v))
el... | 0 | 0 | 0 | 0 | 0 | 0 |
server/shapes/management/commands/analyze_bruce_scene.py | paulu/opensurfaces | 137 | 1626945 | <reponame>paulu/opensurfaces
import json
import math
from django.core.management.base import BaseCommand
from clint.textui import progress
from shapes.models import MaterialShape
from bsdfs.models import ShapeBsdfLabel_wd
from common.utils import queryset_progress_bar
class Command(BaseCommand):
args = ''
he... | 0 | 0 | 0 | 0 | 0 | 0 |
keras/downstream_tasks/BraTS/__init__.py | joeranbosma/ModelsGenesis | 574 | 1626946 | #!/usr/bin/env python
"""
File: __init__.py
Date: 5/1/18
Author: <NAME> (<EMAIL>)
Brain Tumor Segmentation 2018 Data Set
"""
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from BraTS.DataSet import *
| 0 | 0 | 0 | 0 | 0 | 0 |
core/polyaxon/cli/admin.py | admariner/polyaxon | 3,200 | 1626969 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | 1 | 1 | 0 | 0 | 2 | 0 |
fum/management/commands/copygroup.py | jsavikko/futurice-ldap-user-manager | 111 | 1626971 | <gh_stars>100-1000
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from django.template.loader import get_template
from django.template import Context
from django.forms import EmailField
from django.core.exceptions import ValidationErr... | 0 | 0 | 0 | 0 | 0 | 0 |
huobi_api/huobi.py | linkquan/51bitquant | 310 | 1626992 | """
微信:Griezmann_JR
火币交易所推荐码:asd43
币安推荐码: 22795115
币安推荐链接:https://www.binance.co/?ref=22795115
Gateio交易所荐码:1100714
Bitmex交易所推荐码:SzZBil 或者 https://www.bitmex.com/register/SzZBil
代码地址: https://github.com/ramoslin02/51bitqunt
视频更新:首先在Youtube上更新,搜索51bitquant 关注我
1. bilibili.com
2. 优酷 youku.com
3. 百... | 0 | 0 | 0 | 0 | 0 | 0 |
_old/DeMobile/demobile.py | tigefa4u/reddit | 444 | 1626999 | <reponame>tigefa4u/reddit<gh_stars>100-1000
#/u/GoldenSights
import praw # simple interface to the reddit API, also handles rate limiting of requests
import time
import sqlite3
'''USER CONFIGURATION'''
APP_ID = ""
APP_SECRET = ""
APP_URI = ""
APP_REFRESH = ""
# https://www.reddit.com/comments/3cm1p8/how_to_make_your_... | 0 | 0 | 0 | 0 | 0 | 0 |
mars/tensor/images/tests/test_images_execution.py | ConanoutlooklvTBS/mars | 2,413 | 1627001 | # 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 required by applicable law or a... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/misc/djangoweb/media/WebPage.py | takipsizad/pyjs | 739 | 1627007 | import pyjd
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.DockPanel import DockPanel
from pyjamas.ui.HTML import HTML
from pyjamas.JSONService import JSONProxy
from pyjamas import DOM
from pyjamas import Factory
from pyjamas import History
from pyjamas import Window
from pyjamas import logging
log = lo... | 0 | 3 | 0 | 0 | 3 | 0 |
test-common/integrationtest/libs/test_loader.py | lotabout/OpenMLDB | 2,659 | 1627024 | <gh_stars>1000+
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2021 4Paradigm
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
resotocore/core/web/directives.py | MrMarvin/cloudkeeper | 316 | 1627042 | import logging
from argparse import Namespace
from re import RegexFlag, fullmatch
from typing import Optional, Callable, Awaitable
from aiohttp.hdrs import METH_OPTIONS
from aiohttp.web import HTTPRedirection, HTTPNotFound, HTTPBadRequest, HTTPException, HTTPNoContent
from aiohttp.web_exceptions import HTTPServiceUnav... | 16 | 9 | 0 | 0 | 25 | 0 |
python/072 Edit Distance.py | allandproust/leetcode-share | 156 | 1627050 | '''
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)
You have the following 3 operations permitted on a word:
a) Insert a character
b) Delete a character
c) Replace a character
'''
class Solution(object):
def minDistance(... | 0 | 1 | 0 | 0 | 1 | 0 |
RecoJets/FFTJetProducers/python/fftjetvertexadder_cfi.py | ckamtsikis/cmssw | 852 | 1627053 | import FWCore.ParameterSet.Config as cms
fftjetVertexAdder = cms.EDProducer(
"FFTJetVertexAdder",
#
# Label for the beam spot info
beamSpotLabel = cms.InputTag("offlineBeamSpot"),
#
# Label for an existing collection of primary vertices
existingVerticesLabel = cms.InputTag("offlinePrimaryVe... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/helpers.py | huy-ha/PIXOR | 259 | 1627061 | <filename>scripts/helpers.py
import numpy as np
import math
from scipy.spatial import ConvexHull
import numpy as np
from sklearn.cluster import DBSCAN
#import open3d
# A label of -1 corresponds to noise
def cluster_point_cloud(pts, eps=0.3, min_samples=30):
db = DBSCAN(eps=0.3, min_samples=10, algorithm='ball_tree', ... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/gen_tacacsrc.py | jccardonar/trigger | 380 | 1627067 | <filename>tools/gen_tacacsrc.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
gen_tacacsrc.py - Simple, stupid tool that creates a .tacacsrc if is not found.
"""
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__copyright__ = 'Copyright 2006-2011, AOL Inc.'
__version__ = '1.9'
from trigger.tacacsrc import *
t = Tac... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/stl/hlt/hlt_david2.py | timgates42/trex-core | 956 | 1627079 | <filename>scripts/stl/hlt/hlt_david2.py<gh_stars>100-1000
from trex.stl.trex_stl_hltapi import STLHltStream
class STLS1(object):
'''
Example number 2 of using HLTAPI from David
Creates 3 streams (imix) Eth/802.1Q/IP/TCP without VM
'''
def get_streams (self, direction = 0, **kwargs):
retur... | 0 | 0 | 0 | 0 | 0 | 0 |
blueoil/converter/core/graph_pattern_matching.py | msakai/blueoil | 248 | 1627110 | <filename>blueoil/converter/core/graph_pattern_matching.py
# -*- coding: utf-8 -*-
# Copyright 2019 The Blueoil 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
#... | 0 | 0 | 0 | 0 | 0 | 0 |
util/test/tests/Vulkan/VK_Buffer_Truncation.py | PLohrmannAMD/renderdoc | 6,181 | 1627116 | import rdtest
import renderdoc as rd
class VK_Buffer_Truncation(rdtest.Buffer_Truncation):
demos_test_name: str = 'VK_Buffer_Truncation'
internal: bool = False | 0 | 0 | 2 | 0 | 2 | 0 |
starfish/core/spots/AssignTargets/_base.py | njmei/starfish | 164 | 1627144 | from abc import abstractmethod
from starfish.core.intensity_table.decoded_intensity_table import DecodedIntensityTable
from starfish.core.morphology.binary_mask import BinaryMaskCollection
from starfish.core.pipeline.algorithmbase import AlgorithmBase
class AssignTargetsAlgorithm(metaclass=AlgorithmBase):
"""
... | 4 | 1 | 0 | 0 | 5 | 0 |
pylibui/__init__.py | superzazu/pylibui | 222 | 1627154 | """
Python wrapper for libui.
"""
| 0 | 0 | 0 | 0 | 0 | 0 |
flocker/node/agents/test/test_cinder.py | stackriot/flocker | 2,690 | 1627164 | <gh_stars>1000+
# Copyright 2015 ClusterHQ Inc. See LICENSE file for details.
"""
Tests for ``flocker.node.agents.cinder``.
"""
from ..cinder import _openstack_verify_from_config, _get_compute_id
from ....common import ipaddress_from_string
from ....testtools import TestCase
class VerifyTests(TestCase):
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/metrics/test_primitives.py | NunoEdgarGFlowHub/torchbearer | 358 | 1627171 | <reponame>NunoEdgarGFlowHub/torchbearer<filename>tests/metrics/test_primitives.py
import unittest
import torch
from torch.autograd import Variable
import torchbearer
from torchbearer.metrics import Loss, Epoch, CategoricalAccuracy, TopKCategoricalAccuracy, BinaryAccuracy, MeanSquaredError
class TestLoss(unittest.Te... | 0 | 0 | 0 | 0 | 0 | 0 |
src/tools/nuscenes-devkit/prediction/input_representation/agents.py | jie311/TraDeS | 1,284 | 1627181 | # nuScenes dev-kit.
# Code written by <NAME>, 2020.
import colorsys
from typing import Any, Dict, List, Tuple, Callable
import cv2
import numpy as np
from pyquaternion import Quaternion
from nuscenes.prediction import PredictHelper
from nuscenes.prediction.helper import quaternion_yaw
from nuscenes.prediction.input_r... | 33 | 8 | 0 | 0 | 41 | 0 |
lldb/test/API/commands/expression/char/TestExprsChar.py | elizabethandrews/llvm | 305 | 1627191 | <filename>lldb/test/API/commands/expression/char/TestExprsChar.py
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ExprCharTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def do_test(self, dictionary=None):
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/servlib/logging_util_test.py | ywlianghang/mysql_streamer | 419 | 1627206 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Copyright 2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 0 | 0 | 0 | 0 | 0 | 0 |
onionbot/dirbot/middleware.py | keyboardcowboy42/ahmia | 176 | 1627207 | """Proxy middleware to support .onion addresses."""
# Install Polipo
# and setup Polipo http://localhost:8123/
# Install Tor with Tor2web mode
# Direct every request to .onion sites to privoxy that uses Tor
import datetime
import hashlib
import re
from urlparse import urlparse
import pysolr
from scrapy import log
... | 0 | 2 | 0 | 0 | 2 | 0 |
bookwyrm/views/preferences/edit_user.py | mouse-reeve/fedireads | 270 | 1627214 | <gh_stars>100-1000
""" edit your own account """
from io import BytesIO
from uuid import uuid4
from PIL import Image
from django.contrib.auth.decorators import login_required
from django.core.files.base import ContentFile
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from ... | 0 | 0 | 0 | 0 | 0 | 0 |
deepmath/guidance/model_wavenet.py | LaudateCorpus1/deepmath | 830 | 1627230 | <reponame>LaudateCorpus1/deepmath<gh_stars>100-1000
# Copyright 2017 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/LI... | 0 | 0 | 0 | 0 | 0 | 0 |
python/gtsam/tests/test_Rot3.py | h-rover/gtsam | 1,402 | 1627235 | """
GTSAM Copyright 2010-2019, Georgia Tech Research Corporation,
Atlanta, Georgia 30332-0415
All Rights Reserved
See LICENSE for the license information
Rot3 unit tests.
Author: <NAME>
"""
# pylint: disable=no-name-in-module
import unittest
import numpy as np
import gtsam
from gtsam import Rot3
from gtsam.utils.tes... | 0 | 2 | 0 | 0 | 2 | 0 |
rope_profiling/test.py | Earthman100/spyder | 7,956 | 1627271 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2009- Spyder Project Contributors
#
# Distributed under the terms of the MIT License
# (see spyder/__init__.py for details)
# --------------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
lie_learn/spectral/SO3FFT_Naive.py | machism0/lie_learn | 140 | 1627299 |
from __future__ import annotations
from functools import lru_cache
import numpy as np
from lie_learn.representations.SO3.irrep_bases import change_of_basis_matrix
from lie_learn.representations.SO3.pinchon_hoggan.pinchon_hoggan_dense import rot_mat, Jd
from lie_learn.representations.SO3.wigner_d import wigner_d_matr... | 19 | 29 | 0 | 1 | 49 | 0 |
openproblems/tasks/label_projection/datasets/__init__.py | bendemeo/SingleCellOpenProblems | 134 | 1627300 | <filename>openproblems/tasks/label_projection/datasets/__init__.py
from .pancreas import pancreas_batch
from .pancreas import pancreas_random
from .zebrafish import zebrafish_labels
from .zebrafish import zebrafish_random
| 0 | 0 | 0 | 0 | 0 | 0 |
nlu/components/utils/feature_assembler/feature_assembler.py | milyiyo/nlu | 480 | 1627309 | from sparknlp_jsl.base import FeaturesAssembler
"""
The FeaturesAssembler is used to collect features from different columns.
It can collect features from single value columns (anything which can be cast to a float, if casts fails then the value is set to 0),
array columns or SparkNLP annotations (if the annotation i... | 0 | 0 | 0 | 0 | 0 | 0 |
create_zip/zip.py | anshul2807/Automation-scripts | 496 | 1627335 | <filename>create_zip/zip.py<gh_stars>100-1000
import os
import zipfile
import argparse
def cli_parse():
cli = argparse.ArgumentParser(prog='zip creator',
description='Basic automation script for \
creating zip file from a folder')
cli.add_arg... | 0 | 0 | 0 | 0 | 0 | 0 |
src/azure-cli/azure/cli/command_modules/sqlvm/_util.py | YuanyuanNi/azure-cli | 3,287 | 1627375 | <reponame>YuanyuanNi/azure-cli<gh_stars>1000+
# --------------------------------------------------------------------------------------------
# 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 |
nuplan/planning/simulation/controller/tracker/test/test_lqr_tracker.py | motional/nuplan-devkit | 128 | 1627379 | <gh_stars>100-1000
import unittest
from unittest.mock import MagicMock, Mock, patch
import numpy as np
import numpy.testing as np_test
import numpy.typing as npt
from nuplan.common.actor_state.state_representation import TimePoint
from nuplan.planning.scenario_builder.test.mock_abstract_scenario import MockAbstractSc... | 0 | 0 | 0 | 0 | 0 | 0 |
pubnub/models/consumer/v3/channel.py | natekspencer/pubnub-python | 146 | 1627391 | from __future__ import annotations
from pubnub.models.consumer.v3.pn_resource import PNResource
class Channel(PNResource):
def __init__(self, resource_name: object | None=None, resource_pattern: object | None=None):
super(Channel, self).__init__(resource_name, resource_pattern)
@staticmethod
def... | 2 | 9 | 0 | 0 | 11 | 0 |
f5/iworkflow/cm/cloud/test/functional/test_tenants.py | nghia-tran/f5-common-python | 272 | 1627401 | <reponame>nghia-tran/f5-common-python
# Copyright 2015-2106 F5 Networks 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 requi... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/python/correctness/two_neighborhood_testing.py | sid17/weaver | 163 | 1627444 | import sys
import time
import weaver.client as client
import simple_client
# creating graph
nodes = [None] * 5
coord_id = 0
c = client.Client(client._CLIENT_ID+1, coord_id)
sc = simple_client.simple_client(c)
tx_id = c.begin_tx()
center = c.create_node(tx_id)
nodes[0] = c.create_node(tx_id)
nodes[1] = c.create_node(... | 0 | 0 | 0 | 0 | 0 | 0 |
guietta/examples/slider_get.py | zhenggc1/guietta | 1,984 | 1627449 | <filename>guietta/examples/slider_get.py
# -*- coding: utf-8 -*-
from guietta import B, E, HS, _, Gui, Quit
gui = Gui(
[ 'Enter expression:', E('expr') , B('Eval!') ],
[ 'Result:' , 'result' , _ ],
[ HS('myslider') , _ , Quit ] )
while True:
name, event = ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/dbpedia/dbpedia/people.py | ljch2018/quepy | 951 | 1627479 | # coding: utf-8
# Copyright (c) 2012, Machinalis S.R.L.
# This file is part of quepy and is distributed under the Modified BSD License.
# You should have received a copy of license in the LICENSE file.
#
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
"""
People related regex
"""
from refo import Plus, Quest... | 0 | 4 | 0 | 0 | 4 | 0 |
temp-snn/snn/recep_field.py | Pandinosaurus/Spiking-Neural-Network | 755 | 1627486 | <gh_stars>100-1000
####################################################### README #########################################################
# This file consists of function that convolves an image with a receptive field so that input to the network is
# close to the form perceived by our eyes.
#######################... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_utils.py | timgates42/ramses | 178 | 1627494 | <reponame>timgates42/ramses<gh_stars>100-1000
import pytest
from mock import Mock, patch
from ramses import utils
class TestUtils(object):
def test_contenttypes(self):
assert utils.ContentTypes.JSON == 'application/json'
assert utils.ContentTypes.TEXT_XML == 'text/xml'
assert utils.Conte... | 0 | 0 | 0 | 0 | 0 | 0 |
deepdow/benchmarks.py | vishalbelsare/deepdow | 511 | 1627496 | from __future__ import annotations
"""Collection of benchmarks."""
from abc import ABC, abstractmethod
import cvxpy as cp
from cvxpylayers.torch import CvxpyLayer
import torch
from .layers import CovarianceMatrix
class Benchmark(ABC):
"""Abstract benchmark class.
The idea is to create some benchmarks that ... | 8 | 13 | 0 | 0 | 21 | 0 |
applications/popart/bert/bert.py | payoto/graphcore_examples | 260 | 1627511 | <gh_stars>100-1000
# Copyright (c) 2019 Graphcore Ltd. 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 requi... | 0 | 0 | 0 | 0 | 0 | 0 |
pentagon/component/kops/__init__.py | reactiveops/pentagon | 192 | 1627518 | import os
import glob
import shutil
import logging
import traceback
import sys
import re
import subprocess
import yaml
from pentagon.component import ComponentBase
from pentagon.helpers import render_template
from pentagon.defaults import AWSPentagonDefaults as PentagonDefaults
class Cluster(ComponentBase):
_pat... | 0 | 2 | 0 | 0 | 2 | 0 |
compressible_sr/c2p.py | zooechiu/pyro2 | 151 | 1627522 | <reponame>zooechiu/pyro2
import numpy as np
from numba import njit
@njit(cache=True)
def f(p, U_ij, gamma, idens, ixmom, iymom, iener):
"""
Function whose root needs to be found for cons to prim
"""
D = U_ij[idens]
tau = U_ij[iener]
if abs(tau+p) < 1.e-6:
u = U_ij[ixmom]
v =... | 0 | 0 | 0 | 0 | 0 | 0 |
python/tvm/tir/tensor_intrin/dot_product_common.py | shengxinhu/tvm | 4,640 | 1627549 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 6 | 2 | 0 | 0 | 8 | 0 |
glucosetracker/core/views.py | arhanair/glucose-tracker-monitor | 134 | 1627561 | import logging
from django.views.generic import TemplateView, FormView, View
from django.contrib import messages
from django.core.mail import EmailMessage
from django.conf import settings
import mailchimp
from braces.views import (
AjaxResponseMixin,
JSONResponseMixin,
LoginRequiredMixin,
)
from glucoses... | 0 | 6 | 3 | 0 | 9 | 0 |
examples/definition_object_test.py | ywchiu/flasgger | 1,696 | 1627587 | """
A test using simple class based definitions
"""
from flask import Flask, jsonify, request
from flask.views import View
from flasgger import Swagger
app = Flask(__name__)
# Flasgger is initialized like a standard flask extension.
# You can also use .init_app() with the "app factory" pattern.
swag = Swagger(app)
... | 0 | 4 | 1 | 0 | 5 | 0 |
seleniumwire/thirdparty/mitmproxy/addons/__init__.py | KozminMoci/selenium-wire | 975 | 1627589 | from seleniumwire.thirdparty.mitmproxy.addons import core
from seleniumwire.thirdparty.mitmproxy.addons import streambodies
from seleniumwire.thirdparty.mitmproxy.addons import upstream_auth
def default_addons() -> list[object]:
return [
core.Core(),
streambodies.StreamBodies(),
upstream_a... | 0 | 1 | 0 | 0 | 1 | 0 |
tensorflow_addons/seq2seq/tests/attention_wrapper_test.py | leondgarse/addons | 1,560 | 1627590 | <filename>tensorflow_addons/seq2seq/tests/attention_wrapper_test.py
# Copyright 2019 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:... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/how_to/simple_lookup_decoder.py | haoxusci/starfish | 164 | 1627605 | <gh_stars>100-1000
"""
.. _howto_simplelookupdecoder:
Decoding Spots with :py:class:`.SimpleLookupDecoder`
====================================================
Linearly multiplexed assays are designed such that every RNA transcript is labeled in only one of
potentially many imaging rounds (e.g. osmFISH, sequential sm... | 0 | 0 | 0 | 0 | 0 | 0 |
plugin/lighthouse/reader/coverage_file.py | x9090/lighthouse | 1,741 | 1627635 | from __future__ import annotations
import abc
class CoverageFile(object):
"""
Templated class for Lighthouse-compatible code coverage file reader.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def __init__(self, filepath: object | None=None):
self.filepath = filepath
self... | 2 | 0 | 0 | 1 | 3 | 0 |
data/source/tests/pyyal_test_support/get_version.py | libyal/libyal | 176 | 1627638 |
def test_get_version(self):
"""Tests the get_version function."""
version = ${python_module_name}.get_version()
self.assertIsNotNone(version)
| 0 | 0 | 0 | 0 | 0 | 0 |
Chapter13/lib/ksy/fbs.py | feiwang20/DRLHandsOn-Playground | 2,497 | 1627643 | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from __future__ import annotations
import array
import struct
import zlib
from enum import Enum
from pkg_resources import parse_version
from kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, Byt... | 4 | 0 | 0 | 1 | 5 | 0 |
recipes/Python/578230_Pareto_front/recipe-578230.py | tdiprima/code | 2,023 | 1627679 | def pareto_frontier(Xs, Ys, maxX: bool = True, maxY: bool = True) -> tuple[object, object]:
myList = sorted([[Xs[i], Ys[i]] for i in range(len(Xs))], reverse=maxX)
p_front = [myList[0]]
for pair in myList[1:]:
if maxY:
if pair[1] >= p_front[-1][1]:
p_front.append(pai... | 2 | 1 | 0 | 0 | 3 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.