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 |
|---|---|---|---|---|
src/probnum/linalg/solvers/_probabilistic_linear_solver.py | alpiges/probnum | 226 | 12719405 | """Probabilistic linear solvers.
Iterative probabilistic numerical methods solving linear systems :math:`Ax = b`.
"""
class ProbabilisticLinearSolver:
r"""Compose a custom probabilistic linear solver.
Class implementing probabilistic linear solvers. Such (iterative) solvers infer
solutions to problems o... |
27. LeetCode Problems/mini-peaks.py | Ujjawalgupta42/Hacktoberfest2021-DSA | 225 | 12719443 | def miniPeaks(nums):
result = []
left = 0
right = 0
for i in range(1, len(nums) - 1):
left = nums[i - 1]
right = nums[i + 1]
if nums[i] > left and nums[i] > right:
result.append(nums[i])
return result
# Time Complexity : O(n)
# Space Co... |
srcs/python/kungfu/tensorflow/v1/benchmarks/__main__.py | Pandinosaurus/KungFu | 291 | 12719461 | """
Usage:
kungfu-run -q -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --method CPU
kungfu-run -q -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --method NCCL
kungfu-run -q -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --method NCCL+CPU
mpirun -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --m... |
netmiko/a10/a10_ssh.py | mtuska/netmiko | 2,833 | 12719565 | """A10 support."""
from netmiko.cisco_base_connection import CiscoSSHConnection
class A10SSH(CiscoSSHConnection):
"""A10 support."""
def session_preparation(self) -> None:
"""A10 requires to be enable mode to disable paging."""
self._test_channel_read(pattern=r"[>#]")
self.set_base_pr... |
aliyun-python-sdk-domain/aliyunsdkdomain/__init__.py | silent-beaters/aliyun-openapi-python-sdk | 1,001 | 12719570 | __version__ = '3.14.6' |
atcoder/_math.py | SotaroHattori/ac-library-python | 108 | 12719625 | <filename>atcoder/_math.py
import typing
def _is_prime(n: int) -> bool:
'''
Reference:
<NAME> and <NAME>,
Fast Primality Testing for Integers That Fit into a Machine Word
'''
if n <= 1:
return False
if n == 2 or n == 7 or n == 61:
return True
if n % 2 == 0:
ret... |
examples/run_random.py | Roryoung/realworldrl_suite | 284 | 12719652 | <filename>examples/run_random.py<gh_stars>100-1000
# coding=utf-8
# Copyright 2020 The Real-World RL Suite 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.o... |
bridge/npbackend/bohrium/reorganization.py | bh107/bohrium | 236 | 12719661 | <reponame>bh107/bohrium
"""
Reorganization of Array Elements Routines
===========================
"""
import warnings
import numpy_force as numpy
from . import bhary
from bohrium_api import _info
from ._util import is_scalar
from .bhary import fix_biclass_wrapper
from . import array_create
from . import array_manipulat... |
qt__pyqt__pyside__pyqode/move_window_on_center__QDesktopWidget.py | gil9red/SimplePyScripts | 117 | 12719681 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from PyQt5.QtWidgets import QApplication, QWidget
app = QApplication([])
mw = QWidget()
rect = mw.frameGeometry()
center = app.desktop().availableGeometry().center() # This is where QDesktopWidget is used
rect.moveCenter(center)
mw.move(rect... |
sparse_operation_kit/documents/tutorials/utility.py | x-y-z/HugeCTR | 130 | 12719682 | <reponame>x-y-z/HugeCTR
"""
Copyright (c) 2021, NVIDIA 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 applica... |
tests/basics/fun_name.py | peterson79/pycom-micropython-sigfox | 692 | 12719684 | def Fun():
pass
class A:
def __init__(self):
pass
def Fun(self):
pass
try:
print(Fun.__name__)
print(A.__init__.__name__)
print(A.Fun.__name__)
print(A().Fun.__name__)
except AttributeError:
print('SKIP')
|
neuralnilm/monitor/monitor.py | ceavelasquezpi/neuralnilm | 135 | 12719767 | from __future__ import print_function, division
from time import sleep
import pymongo
from monary import Monary
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from neuralnilm.consts import DATA_FOLD_NAMES
from neuralnilm.utils import get_colors
from neuralnilm.config import config
class Monito... |
scripts/visualize.py | nexxt-intelligence/simalign | 198 | 12719773 | <filename>scripts/visualize.py
import matplotlib.pyplot as plt
import numpy as np
from typing import List, Text, Tuple
def line2matrix(line: Text, n: int, m: int) -> Tuple[np.ndarray, np.ndarray]:
'''
converts alignemnt given in the format "0-1 3p4 5-6" to alignment matrices
n, m: maximum length of the in... |
pubnub/endpoints/objects_v2/uuid/get_uuid.py | natekspencer/pubnub-python | 146 | 12719794 | from pubnub.endpoints.objects_v2.objects_endpoint import ObjectsEndpoint, \
IncludeCustomEndpoint, UuidEndpoint
from pubnub.enums import PNOperationType
from pubnub.enums import HttpMethod
from pubnub.models.consumer.objects_v2.uuid import PNGetUUIDMetadataResult
class GetUuid(ObjectsEndpoint, UuidEndpoint, Inclu... |
hlib/tests/test_math.py | pasqoc/heterocl | 236 | 12719799 | <reponame>pasqoc/heterocl
import heterocl as hcl
import heterocl.tvm as tvm
import numpy as np
import numpy.testing as tst
import hlib
dtype = hcl.Float(64)
_sum = hcl.reducer(0, lambda x, y: x + y, dtype)
_max = hcl.reducer(-100000, lambda x, y: tvm.make.Max(x, y), dtype)
_min = hcl.reducer(100000, lambda x, y: tvm.... |
viewer_examples/1_collection_viewer.py | ritamonteiroo/scikit | 453 | 12719814 | <gh_stars>100-1000
from skimage import data
from skimage.viewer import CollectionViewer
from skimage.transform import pyramid_gaussian
img = data.lena()
img_collection = tuple(pyramid_gaussian(img))
view = CollectionViewer(img_collection)
view.show()
|
app/tests/plugins/another_test_plugin/__init__.py | golem4300/quattran | 183 | 12719839 | from app.tests import test_kernel
@test_kernel.container.register('another_test_plugin', tags=['plugin'])
class AnotherTestPlugin(object):
pass
|
apps/molecular_generation/SD_VAE/train_zinc.py | agave233/PaddleHelix | 454 | 12719886 | <filename>apps/molecular_generation/SD_VAE/train_zinc.py
#!/usr/bin/python3
#-*-coding:utf-8-*-
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... |
dress/scripts/readability/getFKGL.py | XingxingZhang/dress | 157 | 12719893 | <gh_stars>100-1000
#!/usr/bin/python
from readability import Readability
import sys
if __name__ == '__main__':
infile = sys.argv[1]
text = open(infile).read()
rd = Readability(text)
print(rd.FleschKincaidGradeLevel())
|
modules/dbnd/src/targets/marshalling/numpy.py | ipattarapong/dbnd | 224 | 12719921 | from __future__ import absolute_import
import numpy as np
from targets.marshalling.marshaller import Marshaller
from targets.target_config import FileFormat
class NumpyArrayMarshaller(Marshaller):
type = np.ndarray
file_format = FileFormat.numpy
def target_to_value(self, target, **kwargs):
"""
... |
esphome/components/monochromatic/light.py | OttoWinter/esphomeyaml | 249 | 12719962 | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import light, output
from esphome.const import CONF_OUTPUT_ID, CONF_OUTPUT
monochromatic_ns = cg.esphome_ns.namespace("monochromatic")
MonochromaticLightOutput = monochromatic_ns.class_(
"MonochromaticLightOutput", light.Li... |
aztk_cli/spark/endpoints/job/submit.py | Geims83/aztk | 161 | 12719977 | import argparse
import typing
import aztk.spark
from aztk_cli import config
from aztk_cli.config import JobConfig
def setup_parser(parser: argparse.ArgumentParser):
parser.add_argument(
"--id",
dest="job_id",
required=False,
help="The unique id of your Spark Job. Defaults to the i... |
migrations/20211109_01_xKblp-change-comments-on-black-jack-record.py | zw-g/Funny-Nation | 126 | 12719993 | <reponame>zw-g/Funny-Nation<gh_stars>100-1000
"""
change comments on black jack record
"""
from yoyo import step
__depends__ = {'20211103_04_Y0xbO-remove-uuid-s-primary-key-on-black-jack-record'}
steps = [
step("ALTER TABLE `blackJackGameRecord` CHANGE `status` `status` INT NOT NULL COMMENT '0 represent in progr... |
geosnap/tests/test_incs.py | weikang9009/geosnap | 148 | 12720086 | from geosnap import analyze
linc = analyze.incs.linc
def test_linc():
labels_0 = [1, 1, 1, 1, 2, 2, 3, 3, 3, 4]
labels_1 = [1, 1, 1, 1, 1, 2, 3, 3, 3, 4]
res = linc([labels_0, labels_1])
assert res[4] == 1.0
assert res[7] == 0.0 == res[-1]
labels_2 = [1, 1, 1, 1, 1, 2, 3, 3, 3, 4]
res = ... |
Chapter06/extract_contents.py | add54/ADMIN_SYS_PYTHON | 116 | 12720117 | <filename>Chapter06/extract_contents.py
import tarfile
import os
os.mkdir('work')
with tarfile.open('work.tar', 'r') as t:
t.extractall('work')
print(os.listdir('work'))
|
lib/yahoo/oauth.py | goztrk/django-htk | 206 | 12720144 | # Python Standard Library Imports
import time
from rauth import OAuth1Service
from rauth.service import process_token_request
from rauth.utils import parse_utf8_qsl
YAHOO_OAUTH_REQUEST_TOKEN_URL = 'https://api.login.yahoo.com/oauth/v2/get_request_token'
YAHOO_OAUTH_ACCESS_TOKEN_URL = 'https://api.login.yahoo.com/oau... |
social_core/tests/backends/test_stackoverflow.py | sg4e/social-core | 745 | 12720154 | <gh_stars>100-1000
import json
from urllib.parse import urlencode
from .oauth import OAuth2Test
class StackoverflowOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.stackoverflow.StackoverflowOAuth2'
user_data_url = 'https://api.stackexchange.com/2.1/me'
expected_username = 'foobar'
access... |
tests/runner.py | QIANDY2021/blender-retarget | 112 | 12720159 | import sys
import unittest
import coverage
cov = coverage.Coverage(
branch=True,
source=['animation_retarget'],
)
cov.start()
suite = unittest.defaultTestLoader.discover('.')
if not unittest.TextTestRunner().run(suite).wasSuccessful():
exit(1)
cov.stop()
cov.xml_report()
if '--save-html-report' in sys.... |
contrib/pyln-client/pyln/client/gossmap.py | Bladez1753/lightning | 2,288 | 12720190 | <gh_stars>1000+
#! /usr/bin/python3
from pyln.spec.bolt7 import (channel_announcement, channel_update,
node_announcement)
from pyln.proto import ShortChannelId, PublicKey
from typing import Any, Dict, List, Optional, Union, cast
import io
import struct
# These duplicate constants in ligh... |
tests/protocols/mrp/test_mrp_interface.py | Jacobs4/pyatv | 532 | 12720211 | """Unit tests for interface implementations in pyatv.protocols.mrp."""
import math
import pytest
from pyatv import exceptions
from pyatv.protocols.mrp import MrpAudio, messages, protobuf
DEVICE_UID = "F2204E63-BCAB-4941-80A0-06C46CB71391"
# This mock is _extremely_ basic, so needs to be adjusted heavily when addin... |
constants.py | AlexRogalskiy/smart-social-distancing | 113 | 12720214 | <reponame>AlexRogalskiy/smart-social-distancing
PROCESSOR_VERSION = "0.7.0"
# Entities
AREAS = "areas"
CAMERAS = "cameras"
ALL_AREAS = "ALL"
# Metrics
OCCUPANCY = "occupancy"
SOCIAL_DISTANCING = "social-distancing"
FACEMASK_USAGE = "facemask-usage"
IN_OUT = "in-out"
DWELL_TIME = "dwell-time"
|
lib/django-1.4/django/contrib/formtools/tests/wizard/sessionstorage.py | MiCHiLU/google_appengine_sdk | 790 | 12720217 | <filename>lib/django-1.4/django/contrib/formtools/tests/wizard/sessionstorage.py<gh_stars>100-1000
from django.test import TestCase
from django.contrib.formtools.tests.wizard.storage import TestStorage
from django.contrib.formtools.wizard.storage.session import SessionStorage
class TestSessionStorage(TestStorage, Te... |
mayan/apps/checkouts/events.py | eshbeata/open-paperless | 2,743 | 12720223 | <reponame>eshbeata/open-paperless
from __future__ import absolute_import, unicode_literals
from django.utils.translation import ugettext_lazy as _
from events.classes import Event
event_document_auto_check_in = Event(
name='checkouts_document_auto_check_in',
label=_('Document automatically checked in')
)
eve... |
tools/test_eval.py | yoxu515/CFBI | 312 | 12720227 | import sys
sys.path.append('.')
sys.path.append('..')
from networks.engine.eval_manager import Evaluator
import importlib
def main():
import argparse
parser = argparse.ArgumentParser(description="Test CFBI")
parser.add_argument('--gpu_id', type=int, default=7)
parser.add_argument('--config', type=str, ... |
python/lib/qfloatslider.py | Azrod29150/Systematic-LEDs | 101 | 12720237 | <gh_stars>100-1000
from PyQt5 import QtCore, QtGui, QtWidgets
__all__ = ['QFloatSlider']
class QFloatSlider(QtWidgets.QSlider):
"""
Subclass of QtWidgets.QSlider
Horizontal slider giving floating point values.
Usage: QFloatSlider(min, max, step, default)
where min = minimum value of slider
... |
TicTacToe-GUI/TicTacToe.py | avinashkranjan/PraticalPythonProjects | 930 | 12720245 | # -*- coding: utf-8 -*-
"""
Tic Toe Using pygame , numpy and sys with Graphical User Interface
"""
import pygame
import sys
from pygame.locals import *
import numpy as np
# ------
# constants
# -------
width = 800
height = 800
#row and columns
board_rows = 3
board_columns = 3
cross_width = 25
square_si... |
pypeit/deprecated/waveimage.py | ykwang1/PypeIt | 107 | 12720261 | """
Module for guiding construction of the Wavelength Image
.. include common links, assuming primary doc root is up one directory
.. include:: ../links.rst
"""
import inspect
import numpy as np
import os
from pypeit import msgs
from pypeit import utils
from pypeit import datamodel
from IPython import embed
class... |
src/poliastro/earth/atmosphere/__init__.py | bryanwweber/poliastro | 634 | 12720282 | <filename>src/poliastro/earth/atmosphere/__init__.py
from poliastro.earth.atmosphere.coesa62 import COESA62
from poliastro.earth.atmosphere.coesa76 import COESA76
__all__ = ["COESA62", "COESA76"]
|
hippy/module/standard/misc/funcs.py | jweinraub/hippyvm | 289 | 12720292 | <filename>hippy/module/standard/misc/funcs.py<gh_stars>100-1000
from rpython.rlib.rstring import StringBuilder
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.rlib.rarithmetic import intmask
from rpython.rlib.rrandom import Random
from hippy.builtin import wrap, Optional, BoolArg, StringArg
from hippy... |
google/colab/html/_html.py | figufema/TesteClone | 1,521 | 12720322 | #!/usr/bin/python
#
# 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 applicable law or ag... |
WBT/PRE/testing.py | Hornbydd/WhiteboxTools-ArcGIS | 157 | 12720395 | import whitebox
import ast
import json
import os
import sys
wbt = whitebox.WhiteboxTools()
# wbt.set_verbose_mode(True)
# print(wbt.version())
# print(wbt.help())
# tools = wbt.list_tools(['dem'])
# for index, tool in enumerate(tools):
# print("{}. {}: {}".format(index, tool, tools[tool]))
# def get_tool_para... |
sdk/cwl/tests/federation/arvboxcwl/setup_user.py | rpatil524/arvados | 222 | 12720400 | <gh_stars>100-1000
# Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
import arvados
import arvados.errors
import time
import json
while True:
try:
api = arvados.api()
break
except arvados.errors.ApiError:
time.sleep(2)
existing = api.use... |
tools/report-converter/codechecker_report_converter/report.py | ryankurte/codechecker | 1,601 | 12720419 | <filename>tools/report-converter/codechecker_report_converter/report.py<gh_stars>1000+
# -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier:... |
examples/pyplot/plot_hexcells.py | kclamar/vedo | 836 | 12720431 | """3D Bar plot of a TOF camera with hexagonal pixels"""
from vedo import *
import numpy as np
settings.defaultFont = "Glasgo"
settings.useParallelProjection = True
vals = np.abs(np.random.randn(4*6)) # pixel heights
cols = colorMap(vals, "summer")
k = 0
items = [__doc__]
for i in range(4):
for j in range(6):
... |
pybotters/models/bitflyer.py | maruuuui/pybotters | 176 | 12720440 | <filename>pybotters/models/bitflyer.py
from __future__ import annotations
import asyncio
import logging
import operator
from decimal import Decimal
from typing import Awaitable
import aiohttp
from ..store import DataStore, DataStoreManager
from ..typedefs import Item
from ..ws import ClientWebSocketResponse
logger ... |
research/active_learning/experiments/visualize_feature_maps.py | dnarqq/WildHack | 402 | 12720449 | <reponame>dnarqq/WildHack<gh_stars>100-1000
import argparse, random, sys, time
import PIL
import torch
import torchvision.models as models
import matplotlib.pyplot as plt
from torchvision.transforms import *
sys.path.append("..")
from DL.utils import *
from DL.networks import *
from Database.DB_models import *
from DL... |
src/vbLib/ExecuteCMDSync.py | mehrdad-shokri/macro_pack | 1,550 | 12720452 |
VBA = \
r"""
Function ExecuteCmdSync(targetPath As String)
'Run a shell command, returning the output as a string'
' Using a hidden window, pipe the output of the command to the CLIP.EXE utility...
' Necessary because normal usage with oShell.Exec("cmd.exe /C " & sCmd) always pops a windows
Dim instr... |
tf_siren/siren_mlp.py | jackietung1219/tf_SIREN | 134 | 12720464 | import tensorflow as tf
from tf_siren import siren
class SIRENModel(tf.keras.Model):
def __init__(self, units: int, final_units: int,
final_activation: str = "linear",
num_layers: int = 1,
w0: float = 30.0,
w0_initial: float = 30.0,
... |
alg/asac/Predictor_G.py | loramf/mlforhealthlabpub | 171 | 12720471 | '''
ASAC (Active Sensing using Actor-Critic Model) (12/18/2018)
Prediction Function only with Selected Samples
'''
#%% Necessary packages
import tensorflow as tf
#%% Prediction Function
'''
Inputs:
- trainX, train Y (training set)
- testX: testing features
- trainG: mask vector for selected training samples
... |
utils/gap_configs/python/ips/cluster/l1_interleaver.py | 00-01/gap_sdk | 118 | 12720474 | #
# Copyright (C) 2020 GreenWaves Technologies
#
# 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 agre... |
tests/test_provider_hashicorp_time.py | mjuenema/python-terrascript | 507 | 12720505 | <filename>tests/test_provider_hashicorp_time.py
# tests/test_provider_hashicorp_time.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:28:43 UTC)
def test_provider_import():
import terrascript.provider.hashicorp.time
def test_resource_import():
from terrascript.resource.hashicorp.time import... |
tests/python/correctness/line_properties.py | sid17/weaver | 163 | 12720516 | <reponame>sid17/weaver
#! /usr/bin/env python
#
# ===============================================================
# Description: Basic test for node/edge properties API.
#
# Created: 2013-12-17 14:50:18
#
# Author: <NAME>, <EMAIL>
#
# Copyright (C) 2013, Cornell University, see the LICENSE fil... |
src/mceditlib/operations/analyze.py | elcarrion06/mcedit2 | 673 | 12720518 | <gh_stars>100-1000
"""
analyze.py
Get counts of blocks, entities, and tile entities in a selection.
"""
from __future__ import absolute_import
import logging
import numpy
from collections import defaultdict
from mceditlib.operations import Operation
log = logging.getLogger(__name__)
class AnalyzeOperation(Op... |
pyvips/vtargetcustom.py | mrpal39/pyvips | 142 | 12720524 | <filename>pyvips/vtargetcustom.py
from __future__ import division
import logging
import pyvips
from pyvips import ffi, vips_lib
logger = logging.getLogger(__name__)
class TargetCustom(pyvips.Target):
"""An output target you can connect action signals to to implement
behaviour.
"""
def __init__(se... |
test/programytest/storage/stores/nosql/mongo/store/test_oobs.py | cdoebler1/AIML2 | 345 | 12720542 | import unittest
from unittest.mock import patch
import programytest.storage.engines as Engines
from programy.storage.stores.nosql.mongo.config import MongoStorageConfiguration
from programy.storage.stores.nosql.mongo.engine import MongoStorageEngine
from programy.storage.stores.nosql.mongo.store.oobs import MongoOOBSto... |
evennia/help/models.py | Jaykingamez/evennia | 1,544 | 12720555 | """
Models for the help system.
The database-tied help system is only half of Evennia's help
functionality, the other one being the auto-generated command help
that is created on the fly from each command's `__doc__` string. The
persistent database system defined here is intended for all other
forms of help that do no... |
api_tests/requests/views/test_request_action_list.py | gaybro8777/osf.io | 628 | 12720576 | import pytest
from api.base.settings.defaults import API_BASE
from api_tests.requests.mixins import PreprintRequestTestMixin
@pytest.mark.enable_quickfiles_creation
@pytest.mark.django_db
class TestPreprintRequestActionList(PreprintRequestTestMixin):
def url(self, request):
return '/{}requests/{}/actions/... |
packages/core/minos-microservice-common/tests/test_common/test_database/test_locks.py | minos-framework/minos-python | 247 | 12720591 | import unittest
from minos.common import (
DatabaseLock,
Lock,
)
from minos.common.testing import (
MockedDatabaseClient,
)
class TestDatabaseLock(unittest.IsolatedAsyncioTestCase):
def test_base(self):
self.assertTrue(issubclass(DatabaseLock, Lock))
async def test_client(self):
... |
tests/test_coder.py | ohduran/ring | 450 | 12720595 | import sys
import ring
from ring.coder import (
Registry, Coder, JsonCoder, coderize, registry as default_registry)
import pytest
def test_coder_registry():
registry = Registry()
error_coder = None, None
registry.register('_error', error_coder)
assert registry.get('_error') == (None, None)
... |
src/orders/migrations/0011_NotificationToGiverIsSent.py | denkasyanov/education-backend | 151 | 12720604 | # Generated by Django 3.1.4 on 2020-12-31 21:27
from django.db import migrations, models
def mark_giver_notification_as_sent_for_all_previous_orders(apps, schema_editor):
apps.get_model('orders.Order').objects.filter(giver__isnull=False) \
.update(notification_to_giver_is_sent=True)
class Migration(mig... |
linter.py | phpdude/api-blueprint-sublime-plugin | 130 | 12720617 | <filename>linter.py
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by <NAME>
# Copyright (c) 2013 <NAME>
# https://github.com/WMeldon/SublimeLinter-apiblueprint
#
# Modified by <NAME>
#
# License: MIT
"""This module exports the Apiblueprint plugin class."""
def Ap... |
django_linter/transformers/__init__.py | enefeq/django_linter | 101 | 12720624 | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from astroid import MANAGER, Class, CallFunc
from .models import transform_model_class
from .testing import transform_test_response
from .factories import transform_factory_return
def register(linter):
M... |
tests/test_api.py | Sunkist-Cherry/Spam-Filter | 433 | 12720635 | import unittest
from unittest import mock
import cherry
class ApiTest(unittest.TestCase):
def setUp(self):
self.model = 'foo'
self.text = 'random string'
@mock.patch('cherry.api.Classify')
def test_classify_api(self, mock_classify):
cherry.classify(model=self.model, text=self.tex... |
sdk/python/ekuiper/runtime/sink.py | MonicaisHer/ekuiper | 250 | 12720640 | # Copyright 2021 EMQ Technologies Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
cryptodetector/method.py | nondejus/crypto-detector | 109 | 12720649 | <gh_stars>100-1000
"""
Copyright (c) 2017 Wind River Systems, 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... |
tapiriik/services/BeginnerTriathlete/__init__.py | prohfesor/tapiriik | 1,445 | 12720655 | from .beginnertriathlete import *
|
utils/accumulators.py | iam-sr13/attention-cnn | 974 | 12720661 | <filename>utils/accumulators.py
import torch
from copy import deepcopy
class Mean:
"""
Running average of the values that are 'add'ed
"""
def __init__(self, update_weight=1):
"""
:param update_weight: 1 for normal, 2 for t-average
"""
self.average = None
self.cou... |
examples/list_documents.py | MrTeferi/photoshop-python-api | 270 | 12720668 | """List current photoshop all documents."""
# Import local modules
import photoshop.api as ps
app = ps.Application()
doc = app.documents[0]
print(doc.name)
for doc in app.documents:
print(doc.name)
|
sdk/servicefabric/azure-servicefabric/azure/servicefabric/operations/__init__.py | rsdoherty/azure-sdk-for-python | 2,728 | 12720690 | # 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.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
examples/xml/soap12-mtom/soap12_mtom.py | edustaff/spyne | 786 | 12720765 | <gh_stars>100-1000
#!/usr/bin/env python
import logging
logger = logging.getLogger(__name__)
import os
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('spyne.protocol.xml').setLevel(logging.DEBUG)
from spyne.application import Application
from spyne.decorator import rpc
from spyne.service import ServiceBa... |
recipes/Python/576977_Context_manager_restoring/recipe-576977.py | tdiprima/code | 2,023 | 12720772 | <gh_stars>1000+
from __future__ import with_statement
from contextlib import contextmanager
import sys
__docformat__ = "restructuredtext"
@contextmanager
def restoring(expr, clone=None):
'''A context manager that evaluates an expression when entering the runtime
context and restores its value when exiting.
... |
okta/exceptions/__init__.py | corylevine/okta-sdk-python | 145 | 12720821 | <filename>okta/exceptions/__init__.py
from . exceptions import HTTPException, OktaAPIException # noqa
|
tmtoolkit/__main__.py | samir-joshi/tmtoolkit | 167 | 12720842 | """
tmtoolkit – Text Mining and Topic Modeling Toolkit for Python
CLI module
<NAME> <<EMAIL>>
"""
if __name__ == '__main__':
import sys
import subprocess
import json
from tmtoolkit.preprocess import DEFAULT_LANGUAGE_MODELS
def _setup(args):
try:
import spacy
from... |
tests/test_data_table.py | figufema/TesteClone | 1,521 | 12720845 | # Copyright 2019 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
keystone/credential/schema.py | ferag/keystone | 615 | 12720860 | # 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, software
# distributed under the Li... |
rman_operators/rman_operators_editors/rman_operators_editors_vol_aggregates.py | prman-pixar/RenderManForBlender | 432 | 12720865 | <gh_stars>100-1000
from bpy.props import (StringProperty, BoolProperty, EnumProperty, IntProperty)
from ...rman_ui.rman_ui_base import CollectionPanel
from ...rfb_logger import rfb_log
from ...rman_operators.rman_operators_collections import return_empty_list
from ...rman_config import __RFB_CONFIG_DICT__ as rfb... |
envs/real_net_env.py | zongzefang/deeprl_signal_control | 194 | 12720876 | """
Particular class of real traffic network
@author: <NAME>
"""
import configparser
import logging
import numpy as np
import matplotlib.pyplot as plt
import os
import seaborn as sns
import time
from envs.env import PhaseMap, PhaseSet, TrafficSimulator
from real_net.data.build_file import gen_rou_file
sns.set_color_c... |
software/glasgow/support/logging.py | electroniceel/Glasgow | 1,014 | 12720879 | <gh_stars>1000+
import operator
from .lazy import *
from .bits import bits
__all__ = ["dump_hex", "dump_bin", "dump_seq", "dump_mapseq"]
def dump_hex(data):
def to_hex(data):
try:
data = memoryview(data)
except TypeError:
data = memoryview(bytes(data))
if dump_he... |
migrations/versions/1fe582999fec_.py | muellermartin/moa | 238 | 12720891 | """empty message
Revision ID: 1fe582999fec
Revises: <PASSWORD>
Create Date: 2019-11-19 11:12:38.940614
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1fe582999fec'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
# ### ... |
jcvi/utils/console.py | paradoxcell/jcvi | 517 | 12720920 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# console.py
# utils
#
# Created by <NAME> on 01/09/21
# Copyright © 2021 <NAME>. All rights reserved.
#
"""
We create a singleton console instance at the module level or as an attribute
of your top-level object.
"""
from rich.console import Console
console = Console()... |
django_cassandra_engine/base/validation.py | Saurabh-Singh-00/django-cassandra-engine | 334 | 12720953 | <filename>django_cassandra_engine/base/validation.py<gh_stars>100-1000
from django.db.backends.base.validation import BaseDatabaseValidation
class CassandraDatabaseValidation(BaseDatabaseValidation):
pass
|
test/cprofile_rust_cython_complex.py | utapyngo/simplification | 113 | 12720960 | <gh_stars>100-1000
# this tests numpy array simplification using RDP
# 216804 --> 3061 points (98.5% reduction)
# 50ms per VW operation on MBA Core i7
# Note that for the equivalent VW output we should reduce tolerance by an order of magnitude, then divide by 2
# e.g. 0.01 -> 0.0005
from simplification.cutil import... |
samples/vsphere/logforwarding/log_forwarding.py | restapicoding/VMware-SDK | 589 | 12720962 | #!/usr/bin/env python
"""
* *******************************************************
* Copyright (c) VMware, Inc. 2017, 2018, 2018. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR... |
bootstrap.py/txtmark.py | onesty-dev/txtmark | 361 | 12720978 | <gh_stars>100-1000
#!/usr/bin/env python
# vim:fileencoding=utf-8 :et:ts=4:sts=4
#
# Copyright 2015 <NAME> <<EMAIL>>
#
# 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.... |
examples/interfaces/multiple.py | dmytrostriletskyi/design-kit | 107 | 12720989 | <reponame>dmytrostriletskyi/design-kit
from accessify import implements
class HumanSoulInterface:
def love(self, who, *args, **kwargs):
pass
class HumanBasicsInterface:
@staticmethod
def eat(food, *args, allergy=None, **kwargs):
pass
if __name__ == '__main__':
@implements(HumanS... |
scripts/coverage.py | lishoujun/pysimdjson | 531 | 12720991 | """
This is a backport and modernization of Cython's coverage.py support from the
3.* branch to the stable 0.29.* branch.
Most importantly for us, it includes support for coverage.py's `exclude_lines`
configuration option, allowing us to filter things like MemoryError from the
coverage reports.
It is standalone, and ... |
tests/test_schema.py | center-for-threat-informed-defense/attack-flow | 165 | 12721009 | <reponame>center-for-threat-informed-defense/attack-flow
import json
from pathlib import Path
from tempfile import NamedTemporaryFile
from textwrap import dedent
import pytest
from attack_flow.schema import (
anchor,
generate_html,
get_properties,
html_name,
insert_html,
InvalidRelationshipsEr... |
networkx/classes/tests/test_graph_historical.py | jebogaert/networkx | 10,024 | 12721033 | """Original NetworkX graph tests"""
import networkx
import networkx as nx
from .historical_tests import HistoricalTests
class TestGraphHistorical(HistoricalTests):
@classmethod
def setup_class(cls):
HistoricalTests.setup_class()
cls.G = nx.Graph
|
turbo/register.py | wecatch/app-turbo | 157 | 12721051 | <filename>turbo/register.py<gh_stars>100-1000
from __future__ import absolute_import, division, print_function, with_statement
import os
from turbo.conf import app_config
from turbo.util import get_base_dir, import_object
def _install_app(package_space):
for app in getattr(import_object('apps.settings', package... |
test/run/t143.py | timmartin/skulpt | 2,671 | 12721059 | print repr((1,2,3))
print repr([1,2,3])
print repr({1:'ok', 2:'stuff'})
print repr("weewaa")
|
tests/links_tests/connection_tests/test_graph_mlp.py | pfnet/chainerchem | 184 | 12721087 | <filename>tests/links_tests/connection_tests/test_graph_mlp.py
from chainer import cuda
from chainer import gradient_check
import numpy
import pytest
from chainer_chemistry.links.connection.graph_mlp import GraphMLP # NOQA
in_size = 3
atom_size = 5
out_size = 4
channels = [16, out_size]
batch_size = 2
@pytest.fixt... |
scripts/mvmc_driver.py | dumpmemory/ners | 156 | 12721090 | """
Script for running over all instances of MVMC.
Since running the script can take a long time, it is possible to parallelize across
different machines using the --index and --skip arguments.
Examples:
python scripts/mvmc_driver.py --mvmc_path data/mvmc --index 0 --skip 1
"""
import argparse
import os
import su... |
sdk/python/pulumi_gcp/logging/billing_account_exclusion.py | sisisin/pulumi-gcp | 121 | 12721135 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
src/genie/libs/parser/iosxe/tests/ShowEnvTemperature/cli/equal/golden_output_expected.py | balmasea/genieparser | 204 | 12721233 | <reponame>balmasea/genieparser
expected_output = {
'switch': {
"1": {
'system_temperature_state': 'ok',
}
}
}
|
tests/test_status.py | johnashu/dataplicity-lomond | 225 | 12721234 | from lomond.status import Status
def test_constants():
expected_constants = {
'BAD_DATA', 'DATA_NOT_UNDERSTOOD', 'EXTENSION_FAILED', 'GOING_AWAY',
'MESSAGE_TOO_LARGE', 'NORMAL', 'POLICY_VIOLATION', 'PROTOCOL_ERROR',
'UNEXPECTED_CONDITION'
}
assert expected_constants == set(filter(... |
plenum/test/view_change/test_master_primary_different_from_previous.py | jandayanan/indy-plenum | 148 | 12721362 | import types
import pytest
from plenum.test.helper import checkViewNoForNodes, \
sdk_send_random_and_check, countDiscarded
from plenum.test.malicious_behaviors_node import slow_primary
from plenum.test.test_node import getPrimaryReplica, ensureElectionsDone
from plenum.test.view_change.helper import provoke_and_w... |
moto/polly/resources.py | jonnangle/moto-1 | 5,460 | 12721427 | <filename>moto/polly/resources.py
# -*- coding: utf-8 -*-
VOICE_DATA = [
{
"Id": "Joanna",
"LanguageCode": "en-US",
"LanguageName": "US English",
"Gender": "Female",
"Name": "Joanna",
},
{
"Id": "Mizuki",
"LanguageCode": "ja-JP",
"LanguageName... |
grin-py/services/NEED_dosWatcher.py | hunternsk/grin-pool | 130 | 12721458 | #!/usr/bin/python
# Copyright 2018 <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
corporate/migrations/0014_customerplan_end_date.py | dumpmemory/zulip | 17,004 | 12721480 | # Generated by Django 3.2.6 on 2021-09-17 10:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("corporate", "0013_alter_zulipsponsorshiprequest_org_website"),
]
operations = [
migrations.AddField(
model_name="customerplan",
... |
src/zapv2/ajaxSpider.py | thc202/zap-api-python | 146 | 12721491 | <filename>src/zapv2/ajaxSpider.py
# Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2017 the ZAP development team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.