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 |
|---|---|---|---|---|
tests/test_field_defs.py | pombredanne/django-mutant | 152 | 11118540 | from __future__ import unicode_literals
import warnings
from django.apps.registry import Apps
from django.core.exceptions import ValidationError
from django.test import SimpleTestCase
from mutant.contrib.numeric.models import IntegerFieldDefinition
from mutant.contrib.text.models import CharFieldDefinition
from muta... |
cami/scripts/objects.py | hugmyndakassi/hvmi | 677 | 11118543 | <filename>cami/scripts/objects.py
#
# Copyright (c) 2020 Bitdefender
# SPDX-License-Identifier: Apache-2.0
#
import struct
import yaml
from intro_defines import defines, section_hints
class CamiYAMLObject(yaml.YAMLObject):
"""
Every object created from an .yaml file should extend this class.
Please do no... |
tools/mo/openvino/tools/mo/front/caffe/elu.py | ryanloney/openvino-1 | 1,127 | 11118558 | <reponame>ryanloney/openvino-1<gh_stars>1000+
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.ops.activation_ops import Elu
from openvino.tools.mo.front.caffe.collect_attributes import collect_attributes
from openvino.tools.mo.front.extractor import FrontExtract... |
realtime_voice_conversion/stream/decode_stream.py | karanokuri/realtime-yukarin | 296 | 11118609 | <reponame>karanokuri/realtime-yukarin
import numpy
from yukarin.acoustic_feature import AcousticFeature
from ..segment.feature_segment import FeatureSegmentMethod
from ..segment.wave_segment import WaveSegmentMethod
from ..stream.base_stream import BaseStream
from ..yukarin_wrapper.vocoder import Vocoder
class Decod... |
python/maths/Ugly Number/nth_ugly_number.py | SounakMandal/AlgoBook | 191 | 11118630 | def ugly_num(num):
while num != 1:
if num % 2 == 0:
num//=2
elif num % 3 == 0:
num//=3
elif num % 5 == 0:
num//=5
else:
return num
return num
N = int(input("Enter the Nth Ugly Number to be displayed"))
i=0
num=1
while N != i... |
vilya/views/api/projects.py | mubashshirjamal/code | 1,582 | 11118679 | # -*- coding: utf-8 -*-
import json
from quixote.errors import TraversalError
from vilya.models.project import CodeDoubanProject
from vilya.models.team import Team
from vilya.views.api.utils import jsonize
_q_exports = []
def _q_index(request):
sortby = request.get_form_var('sortby')
if sortby in CodeDouba... |
cupyx/_gufunc.py | prkhrsrvstv1/cupy | 6,180 | 11118683 | <reponame>prkhrsrvstv1/cupy
import cupy
class GeneralizedUFunc(cupy._core._gufuncs._GUFunc):
__doc__ = cupy._core._gufuncs._GUFunc.__doc__
|
dictionary/utils/admin.py | ankitgc1/django-sozluk-master | 248 | 11118704 | <reponame>ankitgc1/django-sozluk-master
from functools import wraps
from django.contrib.admin.models import CHANGE, LogEntry
from django.contrib.contenttypes.models import ContentType
from django.shortcuts import redirect, reverse
# Admin site specific utilities
def log_admin(msg, authorizer, model_type, model_obj... |
LeetCode/python3/216.py | ZintrulCre/LeetCode_Archiver | 279 | 11118777 | <reponame>ZintrulCre/LeetCode_Archiver<gh_stars>100-1000
class Solution:
def combinationSum3(self, k: int, n: int) -> List[List[int]]:
ret = []
self.Backtrack(k, n, [], ret, 1)
return ret
def Backtrack(self, k, sum, combination, ret, m):
if k == 0:
if sum == 0:
... |
skfda/preprocessing/__init__.py | jiduque/scikit-fda | 147 | 11118784 | <filename>skfda/preprocessing/__init__.py
from . import registration
from . import smoothing
from . import dim_reduction
|
tinderbotz/helpers/constants_helper.py | cr4zy8/TinderBotz | 202 | 11118790 | import enum
# Using enum class create enumerations
class Socials(enum.Enum):
SNAPCHAT = "snapchat"
INSTAGRAM = "instagram"
PHONENUMBER = "phone"
FACEBOOK = "facebook"
class Sexuality(enum.Enum):
MEN = "Men"
WOMEN = "Women"
EVERYONE = "Everyone"
class Language(enum.Enum):
ENGLISH = ... |
tests/test_utils/test_alias_multinomial.py | mitming/mmselfsup | 355 | 11118846 | <filename>tests/test_utils/test_alias_multinomial.py<gh_stars>100-1000
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
from mmselfsup.utils import AliasMethod
def test_alias_multinomial():
example_in = torch.Tensor([1, 2, 3, 4])
example_alias_method = AliasMethod(example_in)
as... |
examples/human_based/run_test_TLO.py | JokerHB/mealpy | 162 | 11118853 | #!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "<NAME>" at 14:11, 07/06/2020 %
# ... |
Trakttv.bundle/Contents/Libraries/Shared/trakt_sync/differ/handlers/list.py | disrupted/Trakttv.bundle | 1,346 | 11118876 | <filename>Trakttv.bundle/Contents/Libraries/Shared/trakt_sync/differ/handlers/list.py
from trakt_sync.differ.handlers.core.base import Handler
class List(Handler):
name = 'list'
def on_added(self, current):
yield self.add(current)
def on_removed(self, base):
yield self.remove(base)
... |
polly/utils/pyscop/jscop2iscc.py | mkinsner/llvm | 2,338 | 11118883 | <reponame>mkinsner/llvm<filename>polly/utils/pyscop/jscop2iscc.py
#!/usr/bin/env python
import argparse, isl, os
import json
def printDomain(scop):
domain = isl.USet('{}')
for statement in scop['statements']:
domain = domain.union(isl.USet(statement['domain']))
print "D :=",
print str(domain) + ";"
def... |
tests/acceptance/test_shell.py | michaszcz/procrastinate | 215 | 11118915 | import asyncio
import pytest
pytestmark = pytest.mark.asyncio
@pytest.fixture
async def shell(process_env):
PIPE = asyncio.subprocess.PIPE
proc = await asyncio.create_subprocess_exec(
"procrastinate",
"shell",
env=process_env(),
stdin=PIPE,
stdout=PIPE,
stderr... |
Tests/image_tests/renderpasses/graphs/OptixDenoiser.py | gonsolo/Falcor | 1,615 | 11118959 | <filename>Tests/image_tests/renderpasses/graphs/OptixDenoiser.py
from falcor import *
def render_graph_OptixDenoiser():
g = RenderGraph("OptixDenoiser")
loadRenderPassLibrary("AccumulatePass.dll")
loadRenderPassLibrary("GBuffer.dll")
loadRenderPassLibrary("OptixDenoiser.dll")
loadRenderPassLibrary(... |
tfne/algorithms/codeepneat/_codeepneat_speciation_mod.py | githealthy18/Tensorflow-Neuroevolution | 121 | 11118990 | import statistics
import logging
class CoDeepNEATSpeciationMOD:
def _speciate_modules_basic(self, mod_spec_parents, new_module_ids):
""""""
### Removal of Parental But Not Elite Modules ###
# Remove modules from module container that served as parents and were kept, though do not belong to... |
tests/test_utils.py | Pijuli/django-jazzmin | 972 | 11119030 | from unittest.mock import patch, MagicMock, Mock
import pytest
from django.db.models.functions import Upper
from django.urls import reverse
from jazzmin.utils import (
order_with_respect_to,
get_admin_url,
get_custom_url,
get_model_meta,
get_app_admin_urls,
get_view_permissions,
)
from .test_a... |
modules/nltk_contrib/scripttranscriber/Utils/kunyomi.py | h4ck3rm1k3/NLP-project | 123 | 11119054 | """
Native Japanese pronunciations for characters
"""
__author__ = """
<EMAIL> (<NAME>)
<EMAIL> (<NAME>)
"""
DUMMY_PHONE_ = 'DUM'
KUNYOMI_ = {}
def LoadKunyomiWbTable(table):
if KUNYOMI_: return ## already loaded
p = open(table)
lines = p.readlines()
p.close()
for line in lines:
line = line.sp... |
demos/kitchen_sink/libs/baseclass/bottom_app_bar.py | abang90/testapp | 1,111 | 11119081 | <gh_stars>1000+
from kivy.uix.screenmanager import Screen
class KitchenSinkBottomAppBar(Screen):
def callback_for_bottom_app_bar(self, app, text, value):
if value and app.data_screens["Bottom App Bar"]["object"]:
toolbar = self.ids.bottom_toolbar
if text == "Off":
t... |
bin/process_AR.py | seralf/tate_collection | 330 | 11119106 | '''
For AR experiment
Using the level2list.json as index and the artworks jsons as content
associate AR artworks with index
outputs json of acno for each object in level2list
only if that index contains the artwork
'''
import json
from os import walk
level2list = json.loads(open('../processed/level2list.json').... |
tradingbot/components/broker/__init__.py | stungkit/TradingBot | 218 | 11119113 | <reponame>stungkit/TradingBot<filename>tradingbot/components/broker/__init__.py
from .abstract_interfaces import ( # NOQA # isort:skip
AbstractInterface,
AccountBalances,
StocksInterface,
AccountInterface,
)
from .av_interface import AVInterface, AVInterval # NOQA # isort:skip
from .ig_interface impor... |
unittest_reinvent/running_modes/reinforcement_tests/test_reinforce_tanimoto_similarity.py | lilleswing/Reinvent-1 | 183 | 11119144 | <reponame>lilleswing/Reinvent-1
import os
import shutil
import unittest
from reinvent_models.lib_invent.enums.generative_model_regime import GenerativeModelRegimeEnum
from reinvent_models.model_factory.configurations.model_configuration import ModelConfiguration
from reinvent_models.model_factory.generative_model impo... |
DiffAugment-biggan-imagenet/compare_gan/tpu/tpu_summaries.py | Rian-T/data-efficient-gans | 1,902 | 11119164 | <filename>DiffAugment-biggan-imagenet/compare_gan/tpu/tpu_summaries.py
# coding=utf-8
# Copyright 2018 Google LLC & <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.... |
docs/source/conf.py | SMILELab-FL/FedLab | 171 | 11119166 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
tests/guinea-pigs/unittest/subtest_skip.py | Tirzono/teamcity-messages | 105 | 11119201 | import sys
from teamcity.unittestpy import TeamcityTestRunner
if sys.version_info < (3, 4):
from unittest2 import main, TestCase
else:
from unittest import main, TestCase
class TestXXX(TestCase):
def testSubtestSkip(self):
for i in range(0, 3):
with self.subTest(i=i):
... |
Stackless/unittests/test_thread.py | masamitsu-murase/stackless | 854 | 11119205 | from __future__ import absolute_import
# import common
import unittest
import stackless
import sys
import time
import struct
import _teststackless
from _stackless import _test_nostacklesscall as apply_not_stackless
from support import test_main # @UnusedImport
from support import StacklessTestCase, AsTaskletTestCase... |
python/dgl/_ffi/object_generic.py | ketyi/dgl | 9,516 | 11119212 | <reponame>ketyi/dgl
"""Common implementation of Object generic related logic"""
# pylint: disable=unused-import
from __future__ import absolute_import
from numbers import Number, Integral
from .. import _api_internal
from .base import string_types
# Object base class
_CLASS_OBJECT_BASE = None
def _set_class_object_b... |
Stock/Common/Ui/Basic/Other/DyStockIndustryCompareWindow.py | Leonardo-YXH/DevilYuan | 135 | 11119224 | from PyQt5.QtWidgets import QTabWidget
class DyStockIndustryCompareWindow(QTabWidget):
""" 股票行业比较窗口 """
def __init__(self, eventEngine, tableCls, targetCode, targetName, baseDate):
"""
@tableCls: DyStockTableWidget class, 这么做是防止import递归
@targetCode, @targetName: 跟哪个股票进行行业比较
... |
observations/r/larynx.py | hajime9652/observations | 199 | 11119282 | <filename>observations/r/larynx.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def larynx(path):
"""data from Section... |
torchbenchmark/models/fastNLP/reproduction/text_classification/train_bert.py | Chillee/benchmark | 2,693 | 11119323 | import sys
sys.path.append('../../')
from reproduction.text_classification.data.IMDBLoader import IMDBLoader
from fastNLP.embeddings import BertEmbedding
from reproduction.text_classification.model.lstm import BiLSTMSentiment
from fastNLP import Trainer
from fastNLP import CrossEntropyLoss, AccuracyMetric
from fastNLP... |
unittests/NAPI/js-native-api/test_symbol/binding.gyp | ScriptBox99/microsoft-hermes-windows | 1,666 | 11119339 | {
"targets": [
{
"target_name": "test_symbol",
"sources": [
"../entry_point.c",
"test_symbol.c"
]
}
]
}
|
Note-5 DQN与HS300指数择时/D3QN_Scale/params.py | summerRainn/DeepLearningNotes | 345 | 11119383 | ACTION_SIZE = 3
MAX_GRAD_NORM = 10
INPUT_SHAPE = [None, 50, 58, 5]
MEMORY_SIZE = 2048
BATCH_SIZE = 128
GAMMA = 0.9
TARGET_STEP_SIZE = 512
TRAIN_STEP_SIZE = 32
# ENTROPY_BETA = 0.1
# POLICY_BETA = 1
# VALUE_BETA = 1
# ACTOR_NORM_BETA = 1e-3
# CRITIC_NORM_BETA = 0.1 |
office__word__doc_docx/table__hyperlink_cell.py | DazEB2/SimplePyScripts | 117 | 11119413 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# pip install python-docx
import docx
from hyperlink import add_hyperlink
headers = ('NAME', 'DESCRIPTION')
rows = [
('php', 'PHP — скриптовый язык программирования общего назначения, активно применяемый для разработки веб-приложений. Испо... |
__other__/points-of-hundreds/main.py | whitmans-max/python-examples | 140 | 11119440 | <reponame>whitmans-max/python-examples
def convert(text):
parts = []
while text:
parts.insert(0, text[-3:])
text = text[:-3]
return '.'.join(parts)
print(convert(str(123)))
print(convert(str(1234)))
print(convert(str(12345)))
print(convert(str(123456)))
print(convert(str(1234567)))
'''
12... |
code/BootEA.py | kongmoumou/BootEA | 131 | 11119500 | import sys
import time
from train_funcs import get_model, generate_related_mat, train_tris_k_epo, train_alignment_1epo
from train_bp import bootstrapping, likelihood
from model import P
import utils as ut
def train(folder):
ori_triples1, ori_triples2, triples1, triples2, model = get_model(folder)
hits1 = No... |
cdlib/datasets/__init__.py | TnTo/cdlib | 248 | 11119532 | from .remote import *
|
observations/r/cuckoohosts.py | hajime9652/observations | 199 | 11119537 | <filename>observations/r/cuckoohosts.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def cuckoohosts(path):
"""Compari... |
tests/SampleApps/python/stackoverflow-flask/app/main.py | samruddhikhandale/Oryx | 403 | 11119568 | <gh_stars>100-1000
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return app.send_static_file('index.html')
@app.route('/api/data')
def get_data():
return app.send_static_file('data.json')
if __name__ == '__main__':
app.run()
|
AdvancedElectricLongboard/OpenOCD/share/openocd/contrib/rpc_examples/ocd_rpc_example.py | AdvancedElectricLongboard/LongboardSTM32FW | 708 | 11119656 | <filename>AdvancedElectricLongboard/OpenOCD/share/openocd/contrib/rpc_examples/ocd_rpc_example.py
#!/usr/bin/env python3
"""
OpenOCD RPC example, covered by GNU GPLv3 or later
Copyright (C) 2014 <NAME> (<EMAIL>)
Example output:
./ocd_rpc_example.py
echo says hi!
target state: halted
target halted due to debug-reques... |
rotkehlchen/tests/api/test_adex.py | rotkehlchenio/rotkehlchen | 137 | 11119681 | <gh_stars>100-1000
import random
import warnings as test_warnings
from contextlib import ExitStack
from http import HTTPStatus
import pytest
import requests
from rotkehlchen.accounting.structures.balance import Balance
from rotkehlchen.chain.ethereum.modules.adex.types import Bond, ChannelWithdraw, Unbond
from rotkeh... |
tests/test_cli.py | termim/geocoder | 1,506 | 11119684 | #!/usr/bin/env python
# coding: utf8
import subprocess
location = 'Ottawa, Ontario'
def test_cli_google():
assert not subprocess.call(['geocode', location, '--provider', 'google'])
def test_cli_osm():
assert not subprocess.call(['geocode', location, '--provider', 'osm'])
|
challenge_1/python/igniteflow/src/challenge_1.py | rchicoli/2017-challenges | 271 | 11119688 | #!/usr/bin/env python
"""
#Reverse a String
##Premise
- For this coding challenge, your task is to reverse a string for any given
string input.
Example: Given s = "hello", return "olleh".
- Try to make the solution as short and simple as possible in your respective
language of choice.
"""
def reverse_str... |
txdav/caldav/datastore/test/test_util.py | backwardn/ccs-calendarserver | 462 | 11119706 | <filename>txdav/caldav/datastore/test/test_util.py
##
# Copyright (c) 2010-2017 Apple 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/licen... |
tacker/sol_refactored/common/coordinate.py | h1r0mu/tacker | 116 | 11119752 | <filename>tacker/sol_refactored/common/coordinate.py
# Copyright (C) 2021 Nippon Telegraph and Telephone Corporation
# 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 Licen... |
test/files/column_operators_binops.py | stefano-maggiolo/sqlalchemy2-stubs | 106 | 11119812 | <filename>test/files/column_operators_binops.py<gh_stars>100-1000
from sqlalchemy import ARRAY
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.orm import registry
from sqlalchemy.sql import ColumnElement
mapper_registry: registry... |
utils/__init__.py | ChrisSun06/Context-Aware-Consistency | 771 | 11119814 | <filename>utils/__init__.py
from .logger import Logger |
descarteslabs/vectors/feature.py | carderne/descarteslabs-python | 167 | 11119829 | <reponame>carderne/descarteslabs-python<gh_stars>100-1000
import copy
from shapely.geometry import shape
from descarteslabs.common.dotdict import DotDict
class Feature(object):
"""
An object matching the format of a GeoJSON Feature with geometry and properties.
Attributes
----------
geometry : ... |
galileo/framework/tf/python/layers/feature_combiner.py | YaoPu2021/galileo | 115 | 11119842 | # Copyright 2020 JD.com, Inc. Galileo 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 a... |
access_undenied_aws/__init__.py | JonHolman/access-undenied-aws | 109 | 11119844 | <gh_stars>100-1000
import logging
logger = logging.getLogger("access-undenied-aws")
|
mechanics/swig/tests/test_siconos_mechanisms.py | ljktest/siconos | 137 | 11119881 | #!/usr/bin/env python
def test_slider_crank():
"""Run siconos_mechanisms for bodydef and local options of slider crank
"""
import siconos.tests.siconos_mechanisms
|
src/DynamixelSDK/python/tests/protocol2_0/indirect_address.py | ERP1234/5DOF_Robot_arm | 361 | 11119942 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
# Copyright 2017 ROBOTIS CO., LTD.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... |
Company Specific Interview Questions/Google/Solutions/Python/google_find_odds.py | strangestroad/interview-techdev-guide | 320 | 11119961 | <filename>Company Specific Interview Questions/Google/Solutions/Python/google_find_odds.py
t=int(input())
while t!=0:
n=int(input())
l=list(map(int,input().split()))
l.sort()
s=list(set(l))
for i in range(0,len(s)):
if l.count(s[i])%2!=0:
print(s[i],end=" ")
print() ... |
test/units/test_oci_app_catalog_listing_resource_version_facts.py | slmjy/oci-ansible-modules | 106 | 11119986 | <reponame>slmjy/oci-ansible-modules<filename>test/units/test_oci_app_catalog_listing_resource_version_facts.py
# Copyright (c) 2019, Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or... |
python/torch_mlir/dialects/torch/importer/jit_ir/torchscript_annotations.py | sogartar/torch-mlir | 213 | 11119999 | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
from typing import List, Optional, Tuple
import torch
import t... |
tests/test_lookup.py | Asana/carbonate | 167 | 11120048 | <gh_stars>100-1000
import unittest
from mock import Mock
from carbonate.cluster import Cluster
from carbonate.lookup import lookup
class LookupTest(unittest.TestCase):
def setUp(self):
self.config = Mock()
def test_lookup(self):
self.config.replication_factor = Mock(return_value=2)
... |
CAM_pytorch/data/MyDataSet.py | agnes-yang/PytorchNetHub | 274 | 11120060 | <reponame>agnes-yang/PytorchNetHub
#!/usr/bin/python
# -*- coding:utf-8 -*-
# power by Mr.Li
import os
from torch.utils import data
from torchvision import transforms as T
import cv2
import random
from utils.config import opt
class MyDataSet(data.Dataset):
'''
主要目标: 获取所有图片的地址,并根据训练,验证,测试划分数据
'''
def __i... |
Validation/CaloTowers/python/calotowersValidationSequence_cff.py | ckamtsikis/cmssw | 852 | 11120069 | <reponame>ckamtsikis/cmssw
import FWCore.ParameterSet.Config as cms
from Validation.CaloTowers.CaloTowersParam_cfi import *
import Validation.CaloTowers.CaloTowersParam_cfi
AllCaloTowersValidation = Validation.CaloTowers.CaloTowersParam_cfi.calotowersAnalyzer.clone()
calotowersValidationSequence = cms.Sequence(AllCalo... |
feedhq/feeds/management/commands/favicons.py | feedhq/feedhq | 361 | 11120072 | from . import SentryCommand
from ...models import enqueue_favicon, UniqueFeed
class Command(SentryCommand):
"""Fetches favicon updates and saves them if there are any"""
def add_arguments(self, parser):
parser.add_argument('--all', action='store_true', dest='all',
default=... |
strategies/ichimokuStrat1.py | webclinic017/backtrader-pyqt-ui | 105 | 11120074 | <reponame>webclinic017/backtrader-pyqt-ui
###############################################################################
#
# Copyright (C) 2021 - Skinok
#
# This program 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 Fo... |
f5/bigip/tm/cm/device.py | nghia-tran/f5-common-python | 272 | 11120077 | # coding=utf-8
#
# Copyright 2016 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 required by applicable law or ... |
unsupervisedRR/nnutils/pcreg_trainer.py | Sebastian-Jung/unsupervisedRR | 105 | 11120079 | <reponame>Sebastian-Jung/unsupervisedRR<filename>unsupervisedRR/nnutils/pcreg_trainer.py
import torch
from ..models.model_util import nn_gather
from ..utils.losses import get_rgb_loss
from ..utils.metrics import evaluate_3d_correspondances, evaluate_pose_Rt
from .trainer import BasicTrainer
def batchify(x):
retu... |
alembic/versions/00026_34f427187628_add_rss_bits.py | awesome-archive/ReadableWebProxy | 193 | 11120082 | """Add rss bits!
Revision ID: 34f427187628
Revises: <PASSWORD>
Create Date: 2017-02-27 02:45:31.776790
"""
# revision identifiers, used by Alembic.
revision = '34f427187628'
down_revision = 'b88c4e0<PASSWORD>'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy_uti... |
external/model-preparation-algorithm/mpa_tasks/apis/detection/config.py | opencv/openvino_training_extensions | 775 | 11120110 | <gh_stars>100-1000
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from attr import attrs
from ote_sdk.configuration.elements import (add_parameter_group,
# ParameterGroup,
# configurable_boolean,
... |
archivebox/__init__.py | sarvex/ArchiveBox | 6,340 | 11120124 | __package__ = 'archivebox'
|
pyleri/prio.py | robbm1/pyleri | 106 | 11120136 | '''Prio class.
:copyright: 2021, <NAME> <<EMAIL>>
'''
from .elements import NamedElement
from .rule import Rule
from .exceptions import MaxRecursionError
class _Prio(NamedElement):
MAX_RECURSION = 50
__slots__ = ('_elements', '_name')
def __init__(self, *elements):
self._elements = self._valid... |
bcs-ui/backend/bcs_web/audit_log/audit/auditors.py | laodiu/bk-bcs | 599 | 11120140 | <reponame>laodiu/bk-bcs<filename>bcs-ui/backend/bcs_web/audit_log/audit/auditors.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 <NAME>, a Tencent company. All rights reserved.
Licensed un... |
modules/exploitation/xxe-serve.py | decidedlygray/ptf | 4,391 | 11120157 | #!/usr/bin/python
AUTHOR="<NAME> (Su1ph3r)"
DESCRIPTION="This module will install/update XXE Serve (XXE Out of Band Server)"
INSTALL_TYPE="GIT"
REPOSITORY_LOCATION="https://github.com/joernchen/xxeserve.git"
INSTALL_LOCATION="xxe-serve"
DEBIAN=""
ARCHLINUX =""
BYPASS_UPDATE="NO"
AFTER_COMMANDS="cd {INSTALL_LOC... |
tests/query_test/test_decimal_fuzz.py | Keendata/impala | 1,523 | 11120181 | # 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... |
imagetagger/imagetagger/tools/migrations/0003_auto_20171222_0302.py | jbargu/imagetagger | 212 | 11120187 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-12-22 02:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tools', '0002_tool_public'),
]
operations = [
migrations... |
beacon_chain/state/chain.py | muta6150/beacon_chain | 217 | 11120193 | <gh_stars>100-1000
from typing import (
List,
TYPE_CHECKING,
)
if TYPE_CHECKING:
from .block import Block # noqa: F401
class Chain():
# Note, this is not an object defined in the v2.1 spec
# this is a helper object to mask complexity in tracking
# blocks
def __init__(self, head: 'Block'... |
examples/preprocessing/plot_transformers.py | jmrichardson/pyts | 1,217 | 11120214 | <filename>examples/preprocessing/plot_transformers.py
"""
============
Transformers
============
Some algorithms make assumptions on the distribution of the data.
Therefore it can be useful to transform time series so that they
approximatively follow a given distribution.
Two transformers are made available:
* :class... |
biostar/recipes/management/commands/cleanup.py | Oribyne/biostar-central-fork | 477 | 11120217 | <gh_stars>100-1000
import logging, os, csv
import shutil
from django.conf import settings
from django.core.management.base import BaseCommand
from biostar.recipes.models import Data, Job, Analysis, Project
logger = logging.getLogger('engine')
__CURR_DIR = os.path.dirname(os.path.realpath(__file__))
class Command(B... |
tests/test_eval.py | ming-hai/spleeter | 19,827 | 11120224 | #!/usr/bin/env python
# coding: utf8
""" Unit testing for Separator class. """
__email__ = '<EMAIL>'
__author__ = '<NAME>'
__license__ = 'MIT License'
from os import makedirs
from os.path import join
from tempfile import TemporaryDirectory
import pytest
import numpy as np
from spleeter.__main__ import evaluate
fro... |
rpython/jit/backend/arm/test/test_slist.py | nanjekyejoannah/pypy | 381 | 11120251 | <reponame>nanjekyejoannah/pypy<filename>rpython/jit/backend/arm/test/test_slist.py<gh_stars>100-1000
import py
from rpython.jit.metainterp.test import test_slist
from rpython.jit.backend.arm.test.support import JitARMMixin
class TestSList(JitARMMixin, test_slist.ListTests):
# for the individual tests see
# ===... |
examples/cp/visu/rcpsp_multi_mode_json.py | yukarinoki/docplex-examples | 302 | 11120264 | <reponame>yukarinoki/docplex-examples
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# ------------------------------------------------------------... |
L1TriggerConfig/RPCTriggerConfig/python/RPCHwConfigOffline_cfi.py | ckamtsikis/cmssw | 852 | 11120267 | <filename>L1TriggerConfig/RPCTriggerConfig/python/RPCHwConfigOffline_cfi.py<gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
from CondCore.DBCommon.CondDBSetup_cfi import *
L1RPCHwConfigOffline = cms.ESSource("PoolDBESSource",
CondDBSetup,
toGet = cms.VPSet(cms.PSet(
record = cms.string('L1RP... |
php-src/sdk/Python/PhalApiClient/python3.x/__init__.py | agui2200/roadRunnerXphalApi | 1,564 | 11120271 | #-*- coding:utf-8 -*-
#gaoyiping (<EMAIL>) 2017-02-18 |
networkx/algorithms/tests/test_asteroidal.py | jebogaert/networkx | 10,024 | 11120301 | <filename>networkx/algorithms/tests/test_asteroidal.py<gh_stars>1000+
import networkx as nx
def test_is_at_free():
is_at_free = nx.asteroidal.is_at_free
cycle = nx.cycle_graph(6)
assert not is_at_free(cycle)
path = nx.path_graph(6)
assert is_at_free(path)
small_graph = nx.complete_graph(2)... |
add_trailing_comma/_plugins/calls.py | asottile/add-trailing-comma | 238 | 11120304 | <gh_stars>100-1000
import ast
import functools
from typing import Iterable
from typing import List
from typing import Set
from typing import Tuple
from tokenize_rt import Offset
from tokenize_rt import Token
from add_trailing_comma._ast_helpers import ast_to_offset
from add_trailing_comma._data import register
from a... |
esmvaltool/install/__init__.py | cffbots/ESMValTool | 148 | 11120349 | <reponame>cffbots/ESMValTool
"""Install Julia and R dependencies."""
import subprocess
import sys
from pathlib import Path
class Install:
"""Install extra dependencies.
Diagnostics written in Julia or R need extra dependencies. Use this
command to install them.
Note that Julia or R must be pre-insta... |
src/scenic/simulators/webots/utils.py | ArenBabikian/Scenic | 141 | 11120364 | """Various utilities for working with Webots scenarios."""
import math
import numpy as np
from scenic.core.geometry import normalizeAngle
def webotsToScenicPosition(pos):
"""Convert a Webots position to a Scenic position.
Drops the Webots Y coordinate.
"""
x, y, z = pos
return (x, -z)
def scen... |
examples/gym/mountain_car_continuous_env.py | jhardy0/deer | 373 | 11120372 | <filename>examples/gym/mountain_car_continuous_env.py<gh_stars>100-1000
""" Mountain car environment with continuous action space.
Author: <NAME>
"""
import numpy as np
import copy
import math
from deer.base_classes import Environment
import gym
class MyEnv(Environment):
def __init__(self, rng):
""" Init... |
examples/example_edifice.py | fding/pyedifice | 151 | 11120378 | <reponame>fding/pyedifice
import edifice
from edifice import View, Label, TextInput
class App(edifice.Component):
def __init__(self):
super(App, self).__init__()
self.text = ""
def render(self):
return View(layout="column")(
Label("Hello world: " + self.text),
T... |
src/graphql/execution/collect_fields.py | closeio/graphql-core | 590 | 11120380 | from typing import Any, Dict, List, Set, Union, cast
from ..language import (
FieldNode,
FragmentDefinitionNode,
FragmentSpreadNode,
InlineFragmentNode,
SelectionSetNode,
)
from ..type import (
GraphQLAbstractType,
GraphQLIncludeDirective,
GraphQLObjectType,
GraphQLSchema,
Graph... |
tests/performance/grpc_latency.py | BrightTux/model_server | 305 | 11120384 | #!/usr/bin/env python3
#
# Copyright (c) 2018-2020 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... |
alf/environments/suite_unittest_test.py | www2171668/alf | 175 | 11120406 | # Copyright (c) 2019 Horizon Robotics. 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... |
backtrack/Yu/17.py | lidongdongbuaa/leetcode | 1,232 | 11120453 | <reponame>lidongdongbuaa/leetcode
class Solution(object):
def letterCombinations(self, string):
# input : "23"
# output: ["ad","ae","af","bd","be","bf","cd","ce","cf"]
#Edge
if not string:
return []
#Global Variable
self.dict = {
"2"... |
feedhq/feeds/management/commands/__init__.py | feedhq/feedhq | 361 | 11120479 | <filename>feedhq/feeds/management/commands/__init__.py
import os
from django.conf import settings
from django.core.management.base import BaseCommand
from raven import Client
class SentryCommand(BaseCommand):
def handle(self, *args, **kwargs):
try:
self.handle_sentry(*args, **kwargs)
... |
google_refexp_py_lib/refexp_eval.py | sidr97/Google_Refexp_toolbox | 164 | 11120504 | """Python class for the evaluation of Google Refexp dataset.
This script contains two python classes:
1. GoogleRefexpEvalComprehension
- Use precision@k score to evaluate comprehension task performance
- Can evaluate generation task through an end-to-end way
2. GoogleRefexpEvalGeneration
- Use Amazon Mechanic... |
jaclearn/nlp/tree/node.py | dapatil211/Jacinle | 114 | 11120518 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : node.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 07/04/2018
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
"""
The definition for tree Nodes.
"""
from copy import deepcopy
__all__ = ['Node']
class Node(object):
d... |
data_gen/singing/binarize.py | dtx525942103/DiffSinger | 288 | 11120532 | import os
import random
from copy import deepcopy
import pandas as pd
import logging
from tqdm import tqdm
import json
import glob
import re
from resemblyzer import VoiceEncoder
import traceback
import numpy as np
import pretty_midi
import librosa
from scipy.interpolate import interp1d
import torch
from textgrid import... |
test-framework/test-suites/unit/tests/command/stack/commands/list/firmware/test_command_stack_commands_list_firmware_plugin_basic.py | kmcm0/stacki | 123 | 11120544 | from unittest.mock import create_autospec, ANY
import pytest
from stack.commands import DatabaseConnection
from stack.commands.list.firmware import Command
from stack.commands.list.firmware.plugin_basic import Plugin
class TestListFirmwareBasicPlugin:
"""A test case for the list firmware imp basic plugin."""
@pytes... |
backend/src/data/github/graphql/user/contribs/models.py | rutvikpadhiyar000/github-trends | 157 | 11120567 | from datetime import date, datetime
from typing import List, Optional
from pydantic import BaseModel, Field
class RawCalendarDay(BaseModel):
date: date
weekday: int
count: int = Field(alias="contributionCount")
class RawCalendarWeek(BaseModel):
contribution_days: List[RawCalendarDay] = Field(alias=... |
pyjs/lib/errno.py | takipsizad/pyjs | 739 | 11120577 | EPERM = 1
ENOENT = 2
ESRCH = 3
EINTR = 4
EIO = 5
ENXIO = 6
E2BIG = 7
ENOEXEC = 8
EBADF = 9
ECHILD = 10
EAGAIN = 11
ENOMEM = 12
EACCES = 13
EFAULT = 14
ENOTBLK = 15
EBUSY = 16
EEXIST = 17
EXDEV = 18
ENODEV = 19
ENOTDIR = 20
EISDIR = 21
EINVAL = 22
ENFILE = 23
EMFILE = 24
ENOTTY = 25
ETXTBSY = 26
EFBIG = 27
ENOSPC = 28
E... |
nomad/api/acl.py | i4s-pserrano/python-nomad | 109 | 11120589 | <reponame>i4s-pserrano/python-nomad<gh_stars>100-1000
import nomad.api.exceptions
from nomad.api.base import Requester
class Acl(Requester):
"""
The endpoint manage security ACL and tokens
https://www.nomadproject.io/api/acl-tokens.html
"""
ENDPOINT = "acl"
def __init__(self, **kwargs):
... |
applications/SwimmingDEMApplication/python_scripts/cellular_flow/altair_cube_mesher.py | lkusch/Kratos | 778 | 11120667 | <filename>applications/SwimmingDEMApplication/python_scripts/cellular_flow/altair_cube_mesher.py
import cube_mesher
BaseClass = cube_mesher.box_data
class altair_box_data(BaseClass):
def __init__(self, xmin, ymin, zmin, xmax, ymax, zmax, nx, ny, nz):
BaseClass.__init__(self, xmin, ymin, zmin, xmax, ymax, ... |
bolt/construct.py | thunder-project/bolt | 178 | 11120680 | class ConstructBase(object):
@classmethod
def dispatch(cls, method, *args, **kwargs):
if method in cls.__dict__:
return cls.__dict__[method].__func__(*args, **kwargs)
else:
raise NotImplementedError("Method %s not implemented on %s" % (method, cls.__name__))
@static... |
srsly/tests/util.py | Hirni-Meshram2/srsly | 255 | 11120681 | import tempfile
from pathlib import Path
from contextlib import contextmanager
import shutil
@contextmanager
def make_tempdir(files={}, mode="w"):
temp_dir_str = tempfile.mkdtemp()
temp_dir = Path(temp_dir_str)
for name, content in files.items():
path = temp_dir / name
with path.open(mode)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.