max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 7 115 | max_stars_count int64 101 368k | id stringlengths 2 8 | content stringlengths 6 1.03M |
|---|---|---|---|---|
zeus/api/resources/revision_file_coverage.py | conrad-kronos/zeus | 221 | 12684452 | from flask import request
from operator import or_
from zeus.models import FileCoverage, Revision
from zeus.utils.builds import fetch_build_for_revision
from .base_revision import BaseRevisionResource
from ..schemas import FileCoverageSchema
filecoverage_schema = FileCoverageSchema(many=True)
class RevisionFileCov... |
test/Decider/switch-rebuild.py | Valkatraz/scons | 1,403 | 12684457 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... |
python/veles/scli/client.py | pombredanne/veles | 918 | 12684471 | # Copyright 2017 CodiLime
#
# 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, softwar... |
blender_rendering/utils/fbx2bvh.py | yujiatay/deep-motion-editing | 966 | 12684476 | <reponame>yujiatay/deep-motion-editing
import bpy
import numpy as np
from os import listdir, path
def fbx2bvh(data_path, file):
sourcepath = data_path+"/"+file
bvh_path = data_path+"/"+file.split(".fbx")[0]+".bvh"
bpy.ops.import_scene.fbx(filepath=sourcepath)
frame_start = 9999
frame_end = -9999
... |
social/apps/django_app/default/config.py | raccoongang/python-social-auth | 1,987 | 12684490 | from social_django.config import PythonSocialAuthConfig
|
tools/ci_build/op_registration_utils.py | kimjungwow/onnxruntime-riscv | 6,036 | 12684509 | # !/usr/bin/env python3
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
'''
Utilities to help process files containing kernel registrations.
'''
import os
import sys
import typing
from logger import get_logger
log = get_logger("op_registration_utils")
def map_ort_const... |
sympy/utilities/__init__.py | nashalex/sympy | 8,323 | 12684550 | """This module contains some general purpose utilities that are used across
SymPy.
"""
from .iterables import (flatten, group, take, subsets,
variations, numbered_symbols, cartes, capture, dict_merge,
prefixes, postfixes, sift, topological_sort, unflatten,
has_dups, has_variety, reshape, default_sort_key, o... |
test/lib/__init__.py | noryb009/rmc | 164 | 12684599 | from acceptance_test_case import AcceptanceTestCase # @UnusedImport
from flask_test_case import FlaskTestCase # @UnusedImport
from model_test_case import ModelTestCase # @UnusedImport
from fixtures_test_case import FixturesTestCase # @UnusedImport
|
src/python/tldrstory/database.py | neuml/tldrstory | 260 | 12684603 | <reponame>neuml/tldrstory<filename>src/python/tldrstory/database.py
"""
Database module
"""
class Database(object):
"""
Defines data structures and methods to store article content.
"""
def save(self, article):
"""
Saves an article.
Args:
article: article metadata ... |
tests/parser/globals/test_globals.py | upgradvisor/vyper | 1,471 | 12684622 | <reponame>upgradvisor/vyper<filename>tests/parser/globals/test_globals.py
from pytest import raises
from vyper.exceptions import UndeclaredDefinition
def test_permanent_variables_test(get_contract_with_gas_estimation):
permanent_variables_test = """
struct Var:
a: int128
b: int128
var: Var
@external
def... |
moldesign/units/unitsystem.py | Autodesk/molecular-design-toolkit | 147 | 12684638 | <filename>moldesign/units/unitsystem.py
from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
# Copyright 2017 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not ... |
tools/win/link_limiter/build_link_limiter.py | kjthegod/chromium | 2,151 | 12684655 | <reponame>kjthegod/chromium
#!/usr/bin/env python
# Copyright (c) 2012 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.
import glob
import os
import shutil
import subprocess
import sys
import tempfile
BUILD_DIR = 'build'
... |
python-bitwise-operators/stegano/eraser.py | syberflea/materials | 3,682 | 12684665 | """
Secret file eraser.
"""
from itertools import islice
from random import random
from .bitmap import Bitmap
def erase(bitmap: Bitmap) -> None:
"""Scramble a previously hidden data."""
if bitmap.reserved_field > 0:
for byte_offset in islice(bitmap.byte_offsets, bitmap.reserved_field):
b... |
tools/perf/page_sets/desktop_ui/webui_tab_strip_story.py | chromium/chromium | 14,668 | 12684668 | <gh_stars>1000+
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from page_sets.desktop_ui.browser_element_identifiers import \
kTabCounterButtonElementId
from page_sets.desktop_ui.custom_metric_utils i... |
tests/draw/svg/test_visibility.py | rianmcguire/WeasyPrint | 4,512 | 12684672 | <reponame>rianmcguire/WeasyPrint<gh_stars>1000+
"""
weasyprint.tests.test_draw.svg.test_visibility
----------------------------------------------
Test how the visibility is controlled with "visibility" and "display"
attributes.
"""
from ...testing_utils import assert_no_logs
from .. import assert_pix... |
conversion/convert_depth_maps.py | thduynguyen/sixd_toolkit | 127 | 12684724 | # Author: <NAME> (<EMAIL>)
# Center for Machine Perception, Czech Technical University in Prague
import os
import sys
import glob
import numpy as np
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from pysixd import inout
from params.dataset_params import get_dataset_params
par = get_dat... |
robustness_metrics/datasets/__init__.py | goncaloperes/robustness_metrics | 383 | 12684731 | # coding=utf-8
# Copyright 2021 The Robustness Metrics 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 appli... |
Tests/test_Compass.py | lukasz-kozlowski/biopython | 2,856 | 12684735 | # Copyright 2009 by <NAME>. All rights reserved.
# Revisions copyright 2009-2010 by <NAME>. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Tests for parsing Compass output."... |
research/maskgan/models/bidirectional_vd.py | 873040/Abhishek | 153 | 12684757 | # Copyright 2017 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/LICENSE-2.0
#
# Unless required by applicab... |
sdk/databox/azure-mgmt-databox/tests/test_cli_mgmt_databox.py | rsdoherty/azure-sdk-for-python | 2,728 | 12684759 | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------------... |
apps/user/filter.py | parekhpriyanshu/website | 312 | 12684794 | <gh_stars>100-1000
#!/usr/bin/python
# -*- coding:utf-8 -*-
import django_filters
from django.db.models import Q
from apps.article.models import Article
from apps.user.models import User
class CategoryFilter(django_filters.rest_framework.FilterSet):
category = django_filters.rest_framework.CharFilter(field_... |
vehicle/OVMS.V3/components/wolfssl/wrapper/python/wolfcrypt/wolfcrypt/__about__.py | qtwre/Open-Vehicle-Monitoring-System-3 | 322 | 12684817 | <gh_stars>100-1000
# __about__.py
#
# Copyright (C) 2006-2020 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (a... |
docs/examples/fig5p4.py | uluturki/Mathematics-of-Epidemics-on-Networks | 136 | 12684828 | import EoN
import networkx as nx
import matplotlib.pyplot as plt
import scipy
import random
def get_deg_seq(N, Pk):
while True: #run until degree sequence has even sum of N entries
deg_seq = []
for counter in range(N):
r = random.random()
for k in Pk:
if Pk... |
datmo/core/storage/local/tests/test_dal_environment.py | awesome-archive/datmo | 331 | 12684832 | <reponame>awesome-archive/datmo<filename>datmo/core/storage/local/tests/test_dal_environment.py
"""
Tests for LocalDAL
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import tempfile
import platform
from datetime import datetime
from datmo.co... |
setup.py | ajcr/rolling | 189 | 12684865 | from setuptools import setup, find_packages
from rolling import __version__
long_description = """**rolling** is a collection of computationally efficient
rolling window iterators for Python.
Many useful arithmetical, logical and statistical functions are implemented
to allow the window to be computed in sub-linear ... |
ee/clickhouse/views/test/test_clickhouse_person.py | leirons/posthog | 7,409 | 12684875 | <gh_stars>1000+
from uuid import uuid4
from ee.clickhouse.client import sync_execute
from ee.clickhouse.models.event import create_event
from ee.clickhouse.util import ClickhouseTestMixin
from posthog.api.test.test_person import factory_test_person
from posthog.models import Event, Person
from posthog.models.person im... |
modules/google-earth-engine/docker/sepal-ee/sepal/ee/radar/_terrain_flattening.py | BuddyVolly/sepal | 153 | 12684879 | <reponame>BuddyVolly/sepal
import math
import ee
from sepal.ee.image import replace
# Volumetric model (Hoekman & Reiche 2015)
def apply(image):
geometry = image.geometry()
srtm = ee.Image('USGS/SRTMGL1_003').clip(geometry)
# convert Sigma0 dB to Power
sigma0_pow = ee.Image.constant(10).pow(image.di... |
rest-service/manager_rest/upload_manager.py | cloudify-cosmo/cloudify-manager | 124 | 12684943 | #########
# Copyright (c) 2015 GigaSpaces Technologies 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... |
detectron/utils/lr_policy.py | willkuhn/Detectron | 743 | 12684974 | <reponame>willkuhn/Detectron<gh_stars>100-1000
# Copyright (c) 2017-present, Facebook, 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
... |
jhkaggle/jhkaggle/__init__.py | DATA602/jh-kaggle-util | 273 | 12684980 | import json
import os
from pathlib import Path
jhkaggle_config = {}
def load_config(profile,filename = None):
global jhkaggle_config
if not filename:
home = str(Path.home())
filename = os.path.join(home,".jhkaggleConfig.json")
if not os.path.isfile(filename):
raise Exception(f"If no 'filename' p... |
npt/utils/batch_utils.py | jacobkimmel/non-parametric-transformers | 302 | 12684991 | <filename>npt/utils/batch_utils.py
import warnings
from collections import OrderedDict, defaultdict
import numpy as np
from sklearn.utils.multiclass import type_of_target
from sklearn.utils.validation import column_or_1d
import torch
TORCH_MAJOR = int(torch.__version__.split('.')[0])
TORCH_MINOR = int(torch.__version... |
napari/components/experimental/chunk/__init__.py | MaksHess/napari | 1,345 | 12685004 | """chunk module"""
from ._loader import chunk_loader, synchronous_loading, wait_for_async
from ._request import ChunkLocation, ChunkRequest, LayerRef, OctreeLocation
__all__ = [
'ChunkLocation',
'OctreeLocation',
'ChunkRequest',
'LayerRef',
'chunk_loader',
'wait_for_async',
'synchronous_loa... |
opendatatools/index/__init__.py | solider245/OpenData | 1,179 | 12685022 | from .index_interface import * |
cactus/tests/integration/__init__.py | danielchasehooper/Cactus | 1,048 | 12685038 | <filename>cactus/tests/integration/__init__.py
#coding:utf-8
from __future__ import unicode_literals
import os
import shutil
from six.moves import http_client, urllib
from cactus.site import Site
from cactus.plugin.manager import PluginManager
from cactus.utils.helpers import CaseInsensitiveDict
from cactus.utils.par... |
tests/mini_toolbox/__init__.py | luenk/PySnooper | 15,937 | 12685040 | <filename>tests/mini_toolbox/__init__.py<gh_stars>1000+
# Copyright 2019 <NAME> and collaborators.
# This program is distributed under the MIT license.
import tempfile
import shutil
import io
import sys
from . import pathlib
from . import contextlib
@contextlib.contextmanager
def BlankContextManager():
yield
@... |
sync/rest/documents/update-document/update-document.6.x.py | Tshisuaka/api-snippets | 234 | 12685041 | <reponame>Tshisuaka/api-snippets
# Download the Python helper library from twilio.com/docs/python/install
import os
from twilio.rest import Client
from datetime import datetime
# Your Account Sid and Auth Token from twilio.com/user/account
# To set up environmental variables, see http://twil.io/secure
account_sid = os... |
wradlib/io/dem.py | wradlib/wradlib | 180 | 12685043 | #!/usr/bin/env python
# Copyright (c) 2011-2020, wradlib developers.
# Distributed under the MIT License. See LICENSE.txt for more info.
"""
Digital Elevation Model Data I/O
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Provide surface/terrain elevation information from SRTM data
.. autosummary::
:nosignatures:
:toctree: ... |
itchatmp/utils.py | yf-ftd/itchatmp | 1,504 | 12685046 | import time, json
import functools, logging, traceback
from weakref import ref
logger = logging.getLogger('itchatmp')
def retry(n=3, waitTime=3):
def _retry(fn):
@functools.wraps(fn)
def __retry(*args, **kwargs):
for i in range(n):
try:
r... |
tests/tests_core/test_outliers.py | andompesta/expan | 320 | 12685052 | <gh_stars>100-1000
from __future__ import division
from expan.core.experiment import Experiment, _choose_threshold_type
import pandas as pd
import numpy as np
def test_choose_threshold_type_upper():
data = np.array([1, 2, 3, np.nan])
assert _choose_threshold_type(data) == 'upper'
def test_choose_threshold_t... |
moya/template/__init__.py | moyaproject/moya | 129 | 12685075 | <gh_stars>100-1000
from __future__ import absolute_import
from .enginebase import TemplateEngine
from .moyatemplates import Template
from .environment import Environment
TemplateEngine
Template
Environment
|
client/python/lib/tests/test_grpc_requests.py | Xaenalt/model_server | 234 | 12685099 | #
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
analysis/control/replay/estimator_helper.py | leozz37/makani | 1,178 | 12685103 | # Copyright 2020 Makani Technologies 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 applicable law or agreed to... |
numba_scipy/special/overloads.py | heroxbd/numba-scipy | 161 | 12685107 | import numba
import scipy.special as sc
from . import signatures
def choose_kernel(name, all_signatures):
def choice_function(*args):
for signature in all_signatures:
if args == signature:
f = signatures.name_and_types_to_pointer[(name, *signature)]
return lam... |
jasmin/protocols/cli/options.py | 2naive/jasmin | 750 | 12685109 | <gh_stars>100-1000
"""Variant of cmd2's option parsing mechanism (http://www.assembla.com/wiki/show/python-cmd2)
"""
import re
import pyparsing
import optparse
class OptionParser(optparse.OptionParser):
def __init__(self, option_class=optparse.Option):
optparse.OptionParser.__init__(self, add_help_option... |
boto3_type_annotations/boto3_type_annotations/apigatewayv2/client.py | cowboygneox/boto3_type_annotations | 119 | 12685111 | from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from typing import Union
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import List
class Client(BaseClient):
def can_paginate(self, operation_name: str = None):
pass
def... |
examples/tile.py | penguinflys/imgviz | 171 | 12685123 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import imgviz
def tile():
data = imgviz.data.arc2017()
rgb = data["rgb"]
bboxes = data["bboxes"].astype(int)
masks = data["masks"] == 1
crops = []
for bbox, mask in zip(bboxes, masks):
slice_ = slice(bbox[0], bbox[2]), slice(bbox... |
inceptor/engine/component/UnookComponent.py | whitefi/inceptor | 743 | 12685130 | from config.Config import Config
from engine.component.TemplateModuleComponent import TemplateModuleComponent
class UnhookComponent(TemplateModuleComponent):
def __init__(self, code=None):
placeholder = Config().get("PLACEHOLDERS", "UNHOOK")
super().__init__(code, placeholder)
|
stix_shifter_modules/error_test/stix_translation/results_translator.py | pyromaneact/stix-shifter | 129 | 12685159 | from stix_shifter_utils.modules.base.stix_translation.base_results_translator import BaseResultTranslator
from stix_shifter_utils.stix_translation.src.utils.exceptions import TranslationResultException
import json
import uuid
ERROR_TYPE_TRANSLATE_EXCEPTION = 'translate_exception'
class ResultsTranslator(BaseResultTra... |
config.py | ZevranGong/webserver | 125 | 12685160 | WTF_CSRF_ENABLED = True
SECRET_KEY = 'you-will-never-guess' |
tests/trio/test_keep_alive.py | ai-mocap/hypercorn | 264 | 12685176 | <reponame>ai-mocap/hypercorn<gh_stars>100-1000
from __future__ import annotations
from typing import Callable, Generator
import h11
import pytest
import trio
from hypercorn.config import Config
from hypercorn.trio.tcp_server import TCPServer
from hypercorn.typing import Scope
from ..helpers import MockSocket
KEEP_A... |
tests/nn/checkpoint/test_checkpoint_activations_norm.py | zhaojuanmao/fairscale | 1,662 | 12685186 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
# pylint: disable=missing-module-docstring
# pylint: disable=missing-class-docstring
# pylint: disable=missing-function-d... |
yawast/reporting/reporter.py | Prodject/yawast | 200 | 12685187 | # Copyright (c) 2013 - 2019 <NAME> and Contributors.
# This file is part of YAWAST which is released under the MIT license.
# See the LICENSE file or go to https://yawast.org/license/ for full license details.
import gc
import hashlib
import json
import os
import time
import zipfile
from datetime import datetime
fr... |
cinder/tests/unit/volume/drivers/dell_emc/unity/test_replication.py | helenwalsh/cinder | 571 | 12685203 | <filename>cinder/tests/unit/volume/drivers/dell_emc/unity/test_replication.py
# Copyright (c) 2016 - 2019 Dell Inc. or its subsidiaries.
# 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 o... |
glove.py | tliu526/gram | 218 | 12685226 | import sys, time, random
import numpy as np
import theano
import theano.tensor as T
from theano import config
from theano.ifelse import ifelse
import cPickle as pickle
from collections import OrderedDict
def numpy_floatX(data):
return np.asarray(data, dtype=config.floatX)
def unzip(zipped):
new_params = Ordered... |
demo/face/utils/estimate_pose.py | shachargluska/centerpose | 245 | 12685296 | <reponame>shachargluska/centerpose<gh_stars>100-1000
# coding: UTF-8
from math import asin, atan2, cos, sin
import numpy as np
def isRotationMatrix(R):
''' checks if a matrix is a valid rotation matrix(whether orthogonal or not)
'''
Rt = np.transpose(R)
shouldBeIdentity = np.dot(Rt, R)
I = np.id... |
migrations/versions/5177cfff57d7_add_testgroup_and_te.py | vault-the/changes | 443 | 12685314 | <reponame>vault-the/changes<filename>migrations/versions/5177cfff57d7_add_testgroup_and_te.py
"""Add TestGroup and TestSuite
Revision ID: 5177cfff57d7
Revises: <PASSWORD>
Create Date: 2013-11-04 12:42:37.249656
"""
from __future__ import absolute_import, print_function
# revision identifiers, used by Alembic.
revis... |
python/graphscope/nx/tests/algorithms/forward/test_threshold.py | LI-Mingyu/GraphScope-MY | 1,521 | 12685342 | import networkx.algorithms.tests.test_threshold
import pytest
from graphscope.nx.utils.compat import import_as_graphscope_nx
from graphscope.nx.utils.compat import with_graphscope_nx_context
import_as_graphscope_nx(networkx.algorithms.tests.test_threshold,
decorators=pytest.mark.usefixtures("g... |
pajbot/modules/basic/ignore.py | UVClay/SkookumBot | 145 | 12685348 | import logging
from pajbot.managers.db import DBManager
from pajbot.models.command import Command
from pajbot.models.command import CommandExample
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleType
from pajbot.modules.basic import BasicCommandsModule
log = ... |
src/main/resources/resource/I2cMux/I2cMux.py | holgerfriedrich/myrobotlab | 179 | 12685355 | <gh_stars>100-1000
port="COM3"
#
if ('virtual' in globals() and virtual):
virtualArduino = Runtime.start("virtualArduino", "VirtualArduino")
virtualArduino.connect(port)
ard = Runtime.createAndStart("Arduino","Arduino")
ard.connect(port)
#
i2cmux = Runtime.createAndStart("i2cMux","I2cMux")
# From version 1.0.23... |
tools/sts-job-manager/lib/table_util.py | ruchirjain86/professional-services | 2,116 | 12685361 | <reponame>ruchirjain86/professional-services<filename>tools/sts-job-manager/lib/table_util.py
#!/usr/bin/env python3
# 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 a... |
salesforce/api/metadata.py | xjsender/haoide | 237 | 12685370 | <filename>salesforce/api/metadata.py<gh_stars>100-1000
import sublime
import time
import pprint
import os
import csv
import json
import datetime
from xml.sax.saxutils import unescape, quoteattr
from .. import xmltodict
from ..soap import SOAP
from ..login import soap_login, rest_login
from ... import requests, util
fr... |
passive/find_reflected_params.py | knassar702/community-scripts | 629 | 12685379 | <reponame>knassar702/community-scripts
"""
looks for parameter values that are reflected in the response.
Author: <EMAIL>
The scan function will be called for request/response made via ZAP, excluding some of the automated tools
Passive scan rules should not make any requests
Note that new passive scripts will initiall... |
examples/reports/report_stats.py | vishalbelsare/zvt | 2,032 | 12685385 | # -*- coding: utf-8 -*-
import logging
from apscheduler.schedulers.background import BackgroundScheduler
from examples.report_utils import report_top_stats
from zvt import init_log
logger = logging.getLogger(__name__)
sched = BackgroundScheduler()
@sched.scheduled_job("cron", hour=19, minute=30, day_of_week="mon-... |
merlin/gaussian.py | goodmami/pywsd | 581 | 12685393 | #!/usr/bin/python -*- coding: utf-8 -*-
#
# Merlin - Almost Native Python Machine Learning Library: Gaussian Distribution
#
# Copyright (C) 2014-2015 alvations
# URL:
# For license information, see LICENSE.md
import numpy as np
"""
Class for univariate gaussian
p(x) = 1/sqrt(2*pi*simga^2) * e ^ - (x-miu)^2/2*sigma^2
... |
distributed/http/__init__.py | bnavigator/distributed | 1,358 | 12685410 | <gh_stars>1000+
from .utils import get_handlers
|
bookwyrm/migrations/0149_merge_20220526_1716.py | mouse-reeve/fedireads | 270 | 12685428 | <gh_stars>100-1000
# Generated by Django 3.2.13 on 2022-05-26 17:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0148_alter_user_preferred_language"),
("bookwyrm", "0148_merge_20220326_2006"),
]
operations = []
|
research/domain_adaptation/domain_separation/grl_ops_test.py | 873040/Abhishek | 3,326 | 12685444 | # Copyright 2016 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/LICENSE-2.0
#
# Unless required by applicab... |
filters/numenvs.py | adamgayoso/scvi-tools-handbook | 150 | 12685451 | <reponame>adamgayoso/scvi-tools-handbook<filename>filters/numenvs.py
#!/usr/bin/env python3
"""
Simple pandoc filter to create flexible environments in markdown. Style of
environments controlled via latex environment definitions or css for html.
Numbered theorem environment example:
begin-Theorem
$2+2=4$
end... |
muffin/handler.py | klen/muffin | 704 | 12685470 | <reponame>klen/muffin
"""Muffin Handlers."""
import inspect
import typing as t
from http_router import Router
from http_router.typing import TYPE_METHODS
from asgi_tools import Request
from asgi_tools.app import HTTPView, HTTP_METHODS
from asgi_tools.utils import is_awaitable
class HandlerMeta(type):
"""Prepar... |
src/tools/python/deps-to-manifest.py | michel-slm/breakpad | 2,151 | 12685496 | #!/usr/bin/python
# Copyright 2016 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of con... |
TrainingExtensions/torch/test/python/test_comp_ratio_select.py | quic-tsinghal/aimet | 945 | 12685541 | # /usr/bin/env python3.5
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2017-2018, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modifica... |
examples/experimental/onnx/performance_checker.py | openvinotoolkit/nncf_pytorch | 136 | 12685547 | """
Copyright (c) 2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... |
src/python/pants/backend/go/util_rules/link.py | yoav-orca/pants | 1,806 | 12685549 | <gh_stars>1000+
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from dataclasses import dataclass
from pants.backend.go.util_rules.sdk import GoSdkProcess
from pants.engine.fs import Digest
from pants... |
pclib/test/TestSimpleSink_test.py | belang/pymtl | 206 | 12685561 | <filename>pclib/test/TestSimpleSink_test.py
#=========================================================================
# TestSimpleSink_test.py
#=========================================================================
from __future__ import print_function
from pymtl import *
from TestSimpleSource import TestSimpleS... |
tools/kapture_import_image_folder.py | v-mehta/kapture | 264 | 12685592 | #!/usr/bin/env python3
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
"""
This script imports images from a folder in the kapture format
"""
import argparse
import logging
import os
import os.path as path
import PIL
from PIL import Image
# kapture
import path_to_kapture # noqa: F401
import kapture
... |
PyPortal_NewNewNew/newnewnew.py | joewalk102/Adafruit_Learning_System_Guides | 665 | 12685598 | import time
import board
import adafruit_pyportal
# We can cycle through the latest featured products
#PRODUCTS_TYPE = "featured"
#or we can view the latest new products
PRODUCTS_TYPE = "new"
# Set up where we'll be fetching data from
DATA_SOURCE = "https://www.adafruit.com/api/products?format=micro&"+PRODUCTS_TYPE+"... |
packages/python/3.10.0-alpha.7/test.py | ShaneLee/piston | 1,320 | 12685602 | working = True
match working:
case True:
print("OK")
case False:
print() |
tools/mo/openvino/tools/mo/utils/simple_proto_parser.py | ryanloney/openvino-1 | 1,127 | 12685635 | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import ast
import logging as log
import os
from openvino.tools.mo.utils.error import Error
class SimpleProtoParser(object):
"""
This is a simple Proto2 parser that has limited functionality and is intended to parse configurati... |
python_modules/dagster/dagster_tests/core_tests/definitions_tests/foo/bar.py | dbatten5/dagster | 4,606 | 12685636 | <filename>python_modules/dagster/dagster_tests/core_tests/definitions_tests/foo/bar.py
from dagster import pipeline
from .baz import baz_solid # pylint: disable=import-error
@pipeline
def bar_pipeline():
baz_solid()
|
release/scripts/presets/fluid/oil.py | rbabari/blender | 365 | 12685652 | import bpy
bpy.context.fluid.domain_settings.viscosity_base = 5.0
bpy.context.fluid.domain_settings.viscosity_exponent = 5
|
tests/ext/test_sentry.py | hartungstenio/loafer | 111 | 12685676 | from unittest import mock
from loafer.ext.sentry import sentry_handler
def test_sentry_handler():
mock_scope = mock.MagicMock()
sdk_mocked = mock.Mock()
sdk_mocked.push_scope.return_value = mock_scope
handler = sentry_handler(sdk_mocked)
exc = ValueError("test")
exc_info = (type(exc), exc, N... |
rentomatic/use_cases/storageroom_use_cases.py | keobox/rentomatic | 410 | 12685678 | from rentomatic.shared import use_case as uc
from rentomatic.shared import response_object as res
class StorageRoomListUseCase(uc.UseCase):
def __init__(self, repo):
self.repo = repo
def process_request(self, request_object):
domain_storageroom = self.repo.list(filters=request_object.filters... |
AppServer/google/appengine/tools/devappserver2/safe_subprocess.py | loftwah/appscale | 790 | 12685683 | <reponame>loftwah/appscale
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... |
airmozilla/new/cron.py | mozilla/airmozilla | 115 | 12685690 | <gh_stars>100-1000
import cronjobs
from airmozilla.cronlogger.decorators import capture
from . import eventemails
@cronjobs.register
@capture
def send_new_event_emails():
eventemails.send_new_event_emails(verbose=True)
|
alipay/aop/api/domain/OrderItem.py | snowxmas/alipay-sdk-python-all | 213 | 12685692 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class OrderItem(object):
def __init__(self):
self._address = None
self._brand_name = None
self._category = None
self._city = None
self._city_c... |
the-waf-apigateway/python/the_waf_apigateway/waf.py | mttfarmer/serverless | 1,627 | 12685696 | from aws_cdk import (
aws_cloudformation as cfn,
aws_wafv2 as waf,
core,
)
class Waf(cfn.NestedStack):
def __init__(self, scope: core.Construct, id: str, target_arn, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
waf_rules = []
# 1, AWS general rules
aws_ma... |
DataFormats/FWLite/scripts/edmLumisInFiles.py | ckamtsikis/cmssw | 852 | 12685710 | <filename>DataFormats/FWLite/scripts/edmLumisInFiles.py<gh_stars>100-1000
#! /usr/bin/env python
from __future__ import print_function
from FWCore.PythonUtilities.LumiList import LumiList
import optparse
if __name__ == '__main__':
parser = optparse.OptionParser ("Usage: %prog [--options] edm1.root [edm2.r... |
tests/mime/message/headers/part_test.py | skshetry/flanker | 929 | 12685717 | # coding:utf-8
import flanker.mime.message.part as part
from nose.tools import eq_
STRINGS = (
# Some normal strings
(b'', ''),
(b'hello', 'hello'),
(b'''hello
there
world''', '''hello
there
world'''),
(b'''hello
there
world
''', '''hello
the... |
osr2mp4/ImageProcess/PrepareFrames/RankingScreens/RankingReplay.py | siveroo/osr2mp4-core | 103 | 12685734 | from osr2mp4.ImageProcess import imageproc
from osr2mp4.ImageProcess.PrepareFrames.YImage import YImage
rankingreplay = "pause-replay"
def prepare_rankingreplay(scale, settings):
img = YImage(rankingreplay, settings, scale).img
img = imageproc.newalpha(img, 0.4)
return [img]
|
sasila/system_normal/processor/mzitu_proccessor_regex.py | iiiusky/Sasila | 327 | 12685736 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from sasila.system_normal.spider.spider_core import SpiderCore
from sasila.system_normal.pipeline.pic_pipeline import PicPipeline
from sasila.system_normal.processor.base_processor import BaseProcessor, Rule, LinkExtractor
from sasila.system_normal.downloader.h... |
hc/lib/tests/test_string.py | karthikprabhu/healthchecks | 4,813 | 12685748 | from django.test import TestCase
from hc.lib.string import replace
class StringTestCase(TestCase):
def test_it_works(self):
result = replace("$A is $B", {"$A": "aaa", "$B": "bbb"})
self.assertEqual(result, "aaa is bbb")
def test_it_ignores_placeholders_in_values(self):
result = repla... |
yargy/tagger.py | xepozz/yargy | 250 | 12685753 |
class Tagger(object):
tags = []
def __call__(self, tokens):
raise NotImplementedError
def check_tag(self, tag):
return tag in self.tags
class PassTagger(Tagger):
def __call__(self, tokens):
for token in tokens:
yield token
class TaggersComposition(Tagger):
... |
custom_components/reolink_dev/sensor.py | gasecki/Home-Assistant_Config | 163 | 12685762 | """This component provides support for Reolink IP VoD support."""
from urllib.parse import quote_plus
from dataclasses import dataclass
import datetime as dt
import asyncio
import logging
import os
from dateutil import relativedelta
from homeassistant.core import CALLBACK_TYPE, HomeAssistant
import homeassistant.util.... |
test/unit/test_action_restore.py | ssavrim/curator | 2,449 | 12685791 | from unittest import TestCase
from mock import Mock, patch
import elasticsearch
import curator
# Get test variables and constants from a single source
from . import testvars as testvars
class TestActionRestore(TestCase):
def test_init_raise_bad_snapshot_list(self):
self.assertRaises(TypeError, curator.Rest... |
cumulusci/tasks/metadata_etl/tests/test_permissions.py | davisagli/CumulusCI | 163 | 12685792 | <filename>cumulusci/tasks/metadata_etl/tests/test_permissions.py<gh_stars>100-1000
import pytest
from cumulusci.core.exceptions import TaskOptionsError
from cumulusci.tasks.metadata_etl import AddPermissionSetPermissions
from cumulusci.tasks.salesforce.tests.util import create_task
from cumulusci.utils.xml import meta... |
software/glasgow/support/bits.py | tmbinc/glasgow | 1,014 | 12685794 | import re
import operator
from functools import reduce
import collections.abc
__all__ = ["bits"]
class bits:
"""An immutable bit sequence, like ``bytes`` but for bits.
This bit sequence is ordered from LSB to MSB; this is the direction in which it is converted
to and from iterators, and to and from byt... |
precompute_BM_2ed.py | fevorl/BM3D_py | 157 | 12685795 | import numpy as np
def precompute_BM(img, kHW, NHW, nHW, tauMatch):
"""
:search for similar patches
:param img: input image
:param kHW: length of side of patch
:param NHW: how many patches are stacked
:param nHW: length of side of search area
:param tauMatch: threshold determine whether tw... |
koku/koku/test_migration_sql_helpers.py | rubik-ai/koku | 157 | 12685812 | <reponame>rubik-ai/koku
import os
from django.db import connection as conn
from . import migration_sql_helpers as msh
from api.iam.test.iam_test_case import IamTestCase
class TestMigrationSQLHelpers(IamTestCase):
def test_find_func_dir(self):
"""
Test success finding function dir
"""
... |
tests/st/fusion/test_unsorted_segment_sum_fission.py | PowerOlive/mindspore | 3,200 | 12685820 | <filename>tests/st/fusion/test_unsorted_segment_sum_fission.py
# 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... |
2013/CVE-2013-3827/poc/pocsploit/CVE-2013-3827.py | hjyuan/reapoc | 421 | 12685833 | <reponame>hjyuan/reapoc<filename>2013/CVE-2013-3827/poc/pocsploit/CVE-2013-3827.py<gh_stars>100-1000
import requests
# Vuln Base Info
def info():
return {
"author": "cckuailong",
"name": '''Javafaces LFI''',
"description": '''An Unspecified vulnerability in the Oracle GlassFish Server comp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.