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/probflow/utils/initializers.py | chiragnagpal/probflow | 134 | 12665025 | """Initializers.
Functions to initialize posterior distribution variables.
* :func:`.xavier` - Xavier initializer
* :func:`.scale_xavier` - Xavier initializer scaled for scale parameters
* :func:`.pos_xavier` - positive-only initizlier
----------
"""
import numpy as np
from probflow.utils.settings import get_bac... |
examples/misc/djangoweb/webpages/models.py | takipsizad/pyjs | 739 | 12665036 | from django.db.models import *
class Page(Model):
name = CharField(max_length=50)
text = TextField()
def __unicode__(self):
return str(self.text)
|
tests/test_cases/test_multi_dimension_array/test_cocotb_array.py | lavanyajagan/cocotb | 350 | 12665057 | <reponame>lavanyajagan/cocotb<filename>tests/test_cases/test_multi_dimension_array/test_cocotb_array.py<gh_stars>100-1000
import cocotb
from cocotb.triggers import Timer
@cocotb.test()
async def test_in_vect_packed(dut):
test_value = 0x5
dut.in_vect_packed.value = test_value
await Timer(1, "ns")
asser... |
tests/issues/test_issue_020.py | RodrigoDeRosa/related | 190 | 12665064 | <filename>tests/issues/test_issue_020.py
import related
@related.immutable
class ImageOptions(object):
registry = related.URLField()
email = related.StringField()
def test_image_options():
options = ImageOptions(
registry="https://imgur.com/gallery/GAhlfKS", email="<EMAIL>"
)
assert opti... |
models/__init__.py | briana-jin-zhang/spatial-segmentation | 733 | 12665082 | <filename>models/__init__.py
from . import backbone
from .losses import *
from .single_stage_model import *
from .supervised import *
from .partial_completion_mask import *
from .partial_completion_content import *
from .partial_completion_content_cgan import *
|
cryptol-remote-api/python/tests/cryptol/test_EvenMansour.py | GaloisInc/cryptol | 773 | 12665084 | import unittest
from pathlib import Path
import unittest
import cryptol
from cryptol.single_connection import *
from cryptol.bitvector import BV
class TestEvenMansour(unittest.TestCase):
def test_EvenMansour(self):
connect(verify=False)
load_file(str(Path('tests','cryptol','test-files','examples',... |
src/django-nonrel/tests/regressiontests/comment_tests/custom_comments/__init__.py | adamjmcgrath/glancydesign | 790 | 12665087 | <filename>src/django-nonrel/tests/regressiontests/comment_tests/custom_comments/__init__.py<gh_stars>100-1000
from django.core import urlresolvers
from regressiontests.comment_tests.custom_comments.models import CustomComment
from regressiontests.comment_tests.custom_comments.forms import CustomCommentForm
def get_mo... |
mayo/session/test.py | deep-fry/mayo | 110 | 12665122 | <reponame>deep-fry/mayo
from mayo.session.base import SessionBase
class Test(SessionBase):
mode = 'test'
def __init__(self, config):
super().__init__(config)
self.load_checkpoint(self.config.system.checkpoint.load)
def test(self):
todo = list(zip(self.task.names, self.task.predic... |
tests/data/test_DataBuffer.py | ankitshah009/dcase_util | 122 | 12665130 | <gh_stars>100-1000
""" Unit tests for FIFOBuffer """
import nose.tools
import numpy
import dcase_util
from dcase_util.containers import MetaDataContainer
from dcase_util.data import DataBuffer
def test_DataBuffer():
buf = DataBuffer(size=2)
nose.tools.eq_(buf.count, 0)
nose.tools.eq_(buf.full, False)
... |
tests/test_difference.py | ajhynes7/datatest | 277 | 12665144 | <reponame>ajhynes7/datatest
# -*- coding: utf-8 -*-
import datetime
import decimal
import re
import textwrap
from . import _unittest as unittest
from datatest.differences import (
BaseDifference,
Missing,
Extra,
Invalid,
Deviation,
_make_difference,
NOVALUE,
)
# FOR TESTING: A minimal subc... |
mushroom_rl/environments/pybullet_envs/air_hockey/__init__.py | jdsalmonson/mushroom-rl | 344 | 12665147 | from mushroom_rl.environments.pybullet_envs.air_hockey.hit import AirHockeyHit
from mushroom_rl.environments.pybullet_envs.air_hockey.defend import AirHockeyDefend
AirHockeyHit.register()
AirHockeyDefend.register()
|
app/helpers/eventing/helpers.py | DaveCheez/serverless-store-demo | 171 | 12665160 | # 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 agreed to in writing, ... |
tests_obsolete/extension/dataflow_/manager/dataflow_manager.py | akmaru/veriloggen | 232 | 12665168 | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import ve... |
blockchain-workbench/rest-api-samples/python/swagger_client/api/applications_api.py | chaosmail/blockchain | 738 | 12665173 | # coding: utf-8
"""
Azure Blockchain Workbench REST API
The Azure Blockchain Workbench REST API is a Workbench extensibility point, which allows developers to create and manage blockchain applications, manage users and organizations within a consortium, integrate blockchain applications into services and plat... |
osp/citations/models/citation.py | davidmcclure/open-syllabus-project | 220 | 12665179 | <reponame>davidmcclure/open-syllabus-project<filename>osp/citations/models/citation.py
from osp.common import config
from osp.common.models import BaseModel
from osp.corpus.models import Document
from osp.citations.models import Text
from osp.institutions.models import Institution
from osp.institutions.models import... |
kythe/docs/asciidoc.bzl | wcalandro/kythe | 1,168 | 12665193 | load("@bazel_skylib//lib:shell.bzl", "shell")
load("@bazel_skylib//lib:paths.bzl", "paths")
AsciidocInfo = provider(
doc = "Information about the asciidoc-generated files.",
fields = {
"primary_output_path": "Path of the primary output file beneath {resource_dir}.",
"resource_dir": "File for th... |
examples/slack/chat.py | q0w/snug | 123 | 12665208 | """queries for the 'chat' method family"""
import snug
from .query import json_post
from .types import Message
@json_post('chat.postMessage', rtype=Message, key='message')
def post_message(channel: str, text: str) -> snug.Query[Message]:
return {'channel': channel, 'text': text}
|
saas/aiops/api/aiops-server/services/tsp_algorithms_service.py | iuskye/SREWorks | 407 | 12665217 | #!/usr/bin/env python
# encoding: utf-8
""" """
__author__ = 'sreworks'
import logging
from services.base_service import BaseService
from models.tsp_algorithms_model import TSPAlgorithmsModel
class TSPAlgorithmsService(BaseService):
def __init__(self):
BaseService.__init__(self)
self.logger = log... |
LA Team Results/FinalPipeline_LM_mean_per_facies.py | jcohut/2016_ml_competition_facies_classification | 182 | 12665236 | <filename>LA Team Results/FinalPipeline_LM_mean_per_facies.py<gh_stars>100-1000
import numpy as np
from sklearn.cluster import FeatureAgglomeration
from sklearn.ensemble import ExtraTreesClassifier, GradientBoostingClassifier, VotingClassifier
from sklearn.feature_selection import SelectFromModel
from sklearn.model_se... |
src/db/migrations/00011.py | agu3rra/InfraBox | 265 | 12665249 | import os
import base64
from Crypto.PublicKey import RSA
from pyinfraboxutils.secrets import encrypt_secret
import psycopg2
private_key_path = os.environ.get('INFRABOX_RSA_PRIVATE_KEY_PATH', '/var/run/secrets/infrabox.net/rsa/id_rsa')
def decrypt_secret(s):
with open(private_key_path) as f:
key = RSA.... |
src/CVC_solver.py | shushu-qin/deeponet | 140 | 12665274 | <filename>src/CVC_solver.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
def solve_CVC(xmin, xmax, tmin, tmax, f, g, V, Nx, Nt):
"""Solve
u_t + a(x) * u_x = 0
"""
# Case I:... |
convfeatures.py | taha-a/image | 161 | 12665279 | <filename>convfeatures.py
import tensorflow as tf
import numpy as np
import argparse
import os
batch_size = 10
files, input_layer, output_layer = [None]*3
def build_prepro_graph(inception_path):
global input_layer, output_layer
with open(inception_path, 'rb') as f:
fileContent = f.read()
graph_de... |
lib/metric/__init__.py | khanhptnk/bandit-nmt | 149 | 12665280 | from .PertFunction import PertFunction
from .Loss import *
from .Reward import *
from .Bleu import *
|
gdc_client/settings/parser.py | jrouly/gdc-client | 139 | 12665300 | <filename>gdc_client/settings/parser.py
import logging
from functools import partial
from gdc_client.common.config import GDCClientConfigShared
logger = logging.getLogger("gdc-client")
HELP = (
"Path to INI-type config file. See what settings will look like if a custom"
" config file is used"
)
class Setti... |
vit/formatter/modified_julian.py | kinifwyne/vit | 179 | 12665313 | from vit.formatter.modified import Modified
class ModifiedJulian(Modified):
def format(self, modified, task):
return self.julian(modified)
|
examples/django_hx_chatserver/example_app/run.py | bliedblad/hendrix | 309 | 12665325 | <gh_stars>100-1000
from hendrix.deploy.base import HendrixDeploy
from hendrix.experience import hey_joe
deployer = HendrixDeploy(options={'wsgi': 'example_app.wsgi.application', 'http_port': 7575})
websocket_service = hey_joe.WebSocketService("127.0.0.1", 9000)
deployer.add_non_tls_websocket_service(websocket_service... |
tools/find/tokenizer.py | Schweinepriester/oil | 2,209 | 12665341 | #!/usr/bin/env python2
# Copyright 2019 <NAME>. All rights reserved.
# Copyright 2019 <NAME>. 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/li... |
tests/pre_test.py | danielpalstra/mealie | 1,927 | 12665379 | <filename>tests/pre_test.py
from mealie.core.config import determine_sqlite_path, settings
DB_URL = determine_sqlite_path(path=True, suffix="test")
DB_URL.unlink(missing_ok=True)
if settings.DB_ENGINE != "postgres":
# Monkeypatch Database Testing
settings.DB_URL = determine_sqlite_path(path=False, suffix="tes... |
scripts/nfs-roles-management/internal/model/share_mount_model.py | AlfiyaRF/cloud-pipeline | 126 | 12665412 | # Copyright 2017-2020 EPAM Systems, Inc. (https://www.epam.com/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
bert-distillation-multimetric/sigopt_clients/sigopt_experiment_client.py | meghanaravikumar/sigopt-examples | 213 | 12665424 | <reponame>meghanaravikumar/sigopt-examples
import logging
class SigOptExperiment:
def __init__(self, connection):
self.connection = connection
def initialize_random_experiment(self, experiment_name, project_name, parameters_list, metrics_list, observation_budget,
... |
ppgan/faceutils/face_enhancement/face_enhance.py | pcwuyu/PaddleGAN | 6,852 | 12665456 | <filename>ppgan/faceutils/face_enhancement/face_enhance.py
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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.... |
open/core/betterself/models/supplement.py | lawrendran/open | 105 | 12665459 | <reponame>lawrendran/open
from django.db.models import CharField, ManyToManyField, BooleanField
from open.core.betterself.constants import BetterSelfResourceConstants
from open.core.betterself.models.ingredient_composition import IngredientComposition
from open.utilities.models import BaseModelWithUserGeneratedContent... |
examples/classifiers/CeleryTasks.py | jashanmeet-collab/mango | 123 | 12665461 | """
This is the file running on all the workers.
They will run the classifier with the desired hyper parameters
And return back the results.
"""
# from __future__ import absolute_import, unicode_literals
# from __future__ import absolute_import, unicode_literals
# from celery import Celery
from __future__ import abso... |
cartoframes/viz/widget_list.py | CartoDB/cartoframes | 236 | 12665474 | from .widget import Widget
from .styles.utils import prop
class WidgetList:
"""WidgetList
Args:
widgets (list, Widget): The list of widgets for a layer.
default_widget (Widget, optional): The widget to be used by default.
"""
def __init__(self, widgets=None, default_widget=None):
... |
create/models.py | Orad/webvirtmgr | 1,633 | 12665478 | <reponame>Orad/webvirtmgr
from django.db import models
class Flavor(models.Model):
label = models.CharField(max_length=12)
memory = models.IntegerField()
vcpu = models.IntegerField()
disk = models.IntegerField()
def __unicode__(self):
return self.name
|
testing/slides/examples/test_marks.py | ramosmaria/school2021 | 252 | 12665513 | import pytest
import time
@pytest.mark.slow
def test_slow():
time.sleep(2)
assert 1 + 1 == 2
def test_fast():
assert 1 + 1== 2
|
inferno/extensions/initializers/__init__.py | 0h-n0/inferno | 204 | 12665516 | from .base import *
from .presets import *
|
IOMC/EventVertexGenerators/python/VtxSmearedEarly2p2TeVCollision_cfi.py | ckamtsikis/cmssw | 852 | 12665520 | import FWCore.ParameterSet.Config as cms
from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import Early2p2TeVCollisionVtxSmearingParameters,VtxSmearedCommon
VtxSmeared = cms.EDProducer("BetafuncEvtVtxGenerator",
Early2p2TeVCollisionVtxSmearingParameters,
VtxSmearedCommon
)
|
sk_dsp_comm/test/sandbox.py | chiranthsiddappa/scikit-dsp-comm | 139 | 12665542 | import numpy as np
from sk_dsp_comm import fec_conv
from sk_dsp_comm import digitalcom as dc
np.random.seed(100)
cc = fec_conv.FecConv()
print(cc.Nstates)
import matplotlib.pyplot as plt
import numpy as np
from sk_dsp_comm import fec_conv as fc
SNRdB = np.arange(2,12,.1)
Pb_uc = fc.conv_Pb_bound(1/2,5,[1,4,12,32,80... |
aries_cloudagent/protocols/present_proof/v2_0/models/__init__.py | kuraakhilesh8230/aries-cloudagent-python | 247 | 12665543 | <gh_stars>100-1000
"""Package-wide data and code."""
from os import environ
UNENCRYPTED_TAGS = environ.get("EXCH_UNENCRYPTED_TAGS", "False").upper() == "TRUE"
|
mysqloperator/init_main.py | sjmudd/mysql-operator | 206 | 12665554 | # Copyright (c) 2020, 2021, Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
#
import subprocess
import mysqlsh
import sys
import os
import logging
import shutil
from typing import cast
from .controller import utils, k8sobject
from... |
tests/slack_sdk/oauth/installation_store/test_interaface.py | timgates42/python-slack-sdk | 2,486 | 12665556 | import unittest
from slack_sdk.oauth.installation_store import InstallationStore
from slack_sdk.oauth.installation_store.async_installation_store import (
AsyncInstallationStore,
)
class TestInterface(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_sync(s... |
python/ray/workflow/examples/comparisons/google_cloud_workflows/concat_array_workflow.py | linyiyue/ray | 21,382 | 12665566 | from typing import List
from ray import workflow
@workflow.step
def iterate(array: List[str], result: str, i: int) -> str:
if i >= len(array):
return result
return iterate.step(array, result + array[i], i + 1)
if __name__ == "__main__":
workflow.init()
print(iterate.step(["foo", "ba", "r"],... |
src/python/grapl_analyzerlib/tests/test_query_gen.py | msilvey/grapl | 313 | 12665580 | <reponame>msilvey/grapl<filename>src/python/grapl_analyzerlib/tests/test_query_gen.py<gh_stars>100-1000
import unittest
import pytest
import hypothesis
from grapl_analyzerlib.prelude import GraphClient
from grapl_analyzerlib.nodes.lens import LensView, LensQuery
@pytest.mark.integration_test
class TestQueryGen(unitt... |
ch-poetry-nlg/data_loader.py | shinoyuki222/torch-light | 310 | 12665675 | <gh_stars>100-1000
import numpy as np
import torch
from torch.autograd import Variable
import const
class DataLoader(object):
def __init__(self, src_sents, max_len, batch_size, cuda=True):
self.cuda = cuda
self.sents_size = len(src_sents)
self._step = 0
self._stop_step = self.sents_... |
tests/core/test_task_composite.py | ai-fast-track/mantisshrimp | 580 | 12665681 | # from icevision.all import *
# first_task = tasks.Task("first")
# second_task = tasks.Task("second")
# record = BaseRecord(
# (
# FilepathRecordComponent(),
# InstancesLabelsRecordComponent(task=first_task),
# BBoxesRecordComponent(task=first_task),
# InstancesLabelsRecordComponen... |
alipay/aop/api/domain/TradeComplainQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 12665685 | <reponame>antopen/alipay-sdk-python-all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class TradeComplainQueryResponse(object):
def __init__(self):
self._complain_event_id = None
self._complain_reason = None
self._content =... |
api/brands/urls.py | gaybro8777/osf.io | 628 | 12665704 | <gh_stars>100-1000
from django.conf.urls import url
from api.brands import views
app_name = 'osf'
urlpatterns = [
url(r'^$', views.BrandList.as_view(), name=views.BrandList.view_name),
url(r'^(?P<brand_id>\w+)/$', views.BrandDetail.as_view(), name=views.BrandDetail.view_name),
]
|
bot.py | sevazhidkov/tweets-search-bot | 2,071 | 12665726 | <gh_stars>1000+
import os
import json
import requests
import telebot
import re
from telebot import types
LOKLAK_API_URL = "http://loklak.org/api/search.json?q={query}"
bot = telebot.TeleBot(os.environ['TELEGRAM_BOT_TOKEN'])
user_results = {}
def get_tweet_rating(tweet):
"""
Function that count tweet rating ... |
libraries/botbuilder-schema/botbuilder/schema/teams/additional_properties.py | Fl4v/botbuilder-python | 388 | 12665752 | <gh_stars>100-1000
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
class ContentType:
O365_CONNECTOR_CARD = "application/vnd.microsoft.teams.card.o365connector"
FILE_CONSENT_CARD = "application/vnd.microsoft.teams.card.file.consent"
FILE_DOWNLOAD_INFO = "appli... |
learning_tensorflow/1.py | drpreetyrai/ChatBotCourse | 5,087 | 12665771 | <gh_stars>1000+
import tensorflow as tf
sess = tf.Session()
a = tf.placeholder("float")
b = tf.placeholder("float")
c = tf.constant(6.0)
d = tf.mul(a, b)
y = tf.mul(d, c)
print sess.run(y, feed_dict={a: 3, b: 3})
A = [[1.1,2.3],[3.4,4.1]]
Y = tf.matrix_inverse(A)
print sess.run(Y)
sess.close()
|
routeros_api/api_communicator/encoding_decorator.py | davidc/RouterOS-api | 183 | 12665795 | class EncodingApiCommunicator(object):
def __init__(self, inner):
self.inner = inner
def call(self, path, command, arguments=None, queries=None,
additional_queries=()):
path = path.encode()
command = command.encode()
arguments = self.transform_dictionary(argum... |
ice/core/utils.py | i2y/ice | 313 | 12665802 | from collections import Sequence
from .constants import LPARA, RPARA
def issequence(obj):
return isinstance(obj, Sequence)
def issequence_except_str(obj):
if isinstance(obj, str):
return False
return isinstance(obj, Sequence)
def is_tuple_or_list(obj):
return type(obj) in {tuple, list}
d... |
eeauditor/auditors/aws/AWS_License_Manager_Auditor.py | kbhagi/ElectricEye | 442 | 12665807 | <gh_stars>100-1000
#This file is part of ElectricEye.
#SPDX-License-Identifier: Apache-2.0
#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 t... |
vut/lib/python3.8/site-packages/pipenv/vendor/passa/internals/specifiers.py | dan-mutua/djangowk1 | 6,263 | 12665842 | <reponame>dan-mutua/djangowk1
# -*- coding=utf-8 -*-
from __future__ import absolute_import, unicode_literals
import itertools
import operator
from packaging.specifiers import SpecifierSet, Specifier
from vistir.misc import dedup
def _tuplize_version(version):
return tuple(int(x) for x in version.split("."))
... |
model/AO_model/AO_model.py | ishine/Looking-to-Listen-at-the-Cocktail-Party | 145 | 12665871 | <filename>model/AO_model/AO_model.py
from keras import optimizers
from keras.layers import Input, Dense, Convolution2D, Bidirectional,TimeDistributed
from keras.layers import Flatten, BatchNormalization, Reshape
from keras.layers.core import Activation
from keras.models import Model, load_model
from keras.layers.recurr... |
doc/examples/sparsevid.py | samgal/scikit-video | 615 | 12665953 | <gh_stars>100-1000
import matplotlib.pyplot as plt
import numpy as np
import scipy
import sklearn.linear_model
from matplotlib import gridspec
from sklearn.feature_extraction import image
import skvideo.datasets
try:
xrange
except NameError:
xrange = range
np.random.seed(0)
# use greedy K-SVD algorithm with... |
pony/orm/tests/test_relations_one2one4.py | ProgHaj/pony | 2,628 | 12665977 | <gh_stars>1000+
from __future__ import absolute_import, print_function, division
import unittest
from pony.orm.core import *
from pony.orm.tests.testutils import *
from pony.orm.tests import setup_database, teardown_database
db = Database()
class Person(db.Entity):
name = Required(unicode)
passport = Option... |
USPTO/rank-diff-wln/nntrain.py | wengong-jin/nips17-rexgen | 113 | 12666008 | import tensorflow as tf
from utils.nn import linearND, linear
from mol_graph import atom_fdim as adim, bond_fdim as bdim, max_nb, smiles2graph
from models import *
import math, sys, random
from optparse import OptionParser
import threading
parser = OptionParser()
parser.add_option("-t", "--train", dest="train_path")
p... |
examples/core/data_readers/tum.py | mli0603/lietorch | 360 | 12666030 |
import numpy as np
import torch
import csv
import os
import cv2
import math
import random
import json
import pickle
import os.path as osp
from lietorch import SE3
from .stream import RGBDStream
from .rgbd_utils import loadtum
intrinsics_dict = {
'freiburg1': [517.3, 516.5, 318.6, 255.3],
'freiburg2': [520.9... |
components/aws/sagemaker/tests/unit_tests/tests/common/test_boto3_manager.py | Strasser-Pablo/pipelines | 2,860 | 12666042 | <gh_stars>1000+
import unittest
import os
from boto3.session import Session
from unittest.mock import patch, MagicMock, ANY
from common.boto3_manager import Boto3Manager
class Boto3ManagerTestCase(unittest.TestCase):
def test_assume_default_boto3_session(self):
returned_session = Boto3Manager._get_boto3... |
dragonfly/nn/syn_nn_functions.py | hase1128/dragonfly | 675 | 12666060 | <reponame>hase1128/dragonfly<gh_stars>100-1000
"""
Implements various synthetic functions on NN architectures.
-- <EMAIL>
"""
# pylint: disable=invalid-name
import numpy as np
def _get_vals_wo_None(iter_of_vals):
""" Returns a list of values without Nones. """
return [x for x in iter_of_vals if x is not None]... |
trove/common/policies/configuration_parameters.py | sapcc/trove | 244 | 12666065 | # 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
# d... |
src/python/emane/events/eventservice.py | weston-nrl/emane | 114 | 12666092 | #
# Copyright (c) 2013-2015,2017 - Adjacent Link LLC, Bridgewater,
# New Jersey
# 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 copyrig... |
dspn/plot-state-progress.py | rishabh1694/dspn-mod | 102 | 12666110 | import argparse
import itertools
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.colors as colors
import numpy as np
import os
import data
from PIL import Image
parser = argparse.ArgumentParser()
parser.add_argument("n", type=int, nargs="*")
parser.add_argument... |
libact/query_strategies/tests/test_density_weighted_meta.py | afedyukova/libact | 788 | 12666119 | <reponame>afedyukova/libact
import unittest
import os
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.cluster import KMeans
from sklearn.metrics.pairwise import cosine_similarity
from libact.base.dataset import Dataset, import_libsvm_sparse
from libact.models import LogisticRegression
fro... |
tests/test_authentication.py | joshlk/many_requests | 398 | 12666120 | <filename>tests/test_authentication.py
from asks import BasicAuth
from unittest import TestCase
import pytest
from asks.response_objects import Response
from many_requests.many_requests_ import ManyRequests
from many_requests.common import BadResponse
from .mock_server import web_server
@pytest.mark.usefixtures("web... |
python/tvm/driver/tvmc/pass_config.py | XiaoSong9905/tvm | 4,640 | 12666121 | # 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... |
pygears/lib/cat_util.py | bogdanvuk/pygears | 120 | 12666129 | from pygears.typing import Queue, typeof
def din_data_cat(intfs, order=None):
if order is None:
order = range(len(intfs))
data = []
for o in order:
intf = intfs[o]
if intf['modport'] == 'producer':
continue
if issubclass(intf['type'], Queue):
if ... |
linter.py | TheBossProSniper/electric-windows | 210 | 12666130 | import json, os, sys
os.chdir(r'C:\Users\xtrem\Desktop\Electric\Electric Packages\packages')
for f in os.listdir():
data = ''
try:
with open(f, 'r') as file:
data = json.load(file)
except:
continue
linted = {
'display-name': data['display-name'],
'package-... |
onnx_tf/handlers/backend/max.py | malisit/onnx-tensorflow | 1,110 | 12666152 | <filename>onnx_tf/handlers/backend/max.py
import tensorflow as tf
from onnx_tf.common import exception
from onnx_tf.common import data_type
from onnx_tf.common import sys_config
from onnx_tf.handlers.backend_handler import BackendHandler
from onnx_tf.handlers.handler import onnx_op
@onnx_op("Max")
class Max(BackendH... |
ctc_decoder/bk_tree.py | TenaciousC22/CTCDecoder | 705 | 12666179 | from typing import List
import editdistance as ed
class BKTree:
"""Burkhard Keller tree: used to find strings within tolerance (w.r.t. edit distance metric)
to given query string."""
def __init__(self, txt_list: List[str]) -> None:
"""Pass list of texts (words) which are inserted into the tree."... |
kraino/core/keras_extensions.py | mateuszmalinowski/visual_turing_test-tutorial | 151 | 12666185 | <reponame>mateuszmalinowski/visual_turing_test-tutorial
"""
Additional theano/keras functions.
Author: <NAME>
Email: <EMAIL>
"""
#import marshal
import numpy
#import types
from keras.layers.convolutional import Convolution1D
from keras.layers.convolutional import MaxPooling1D
from keras.layers.core import Lambda
f... |
nikola/data/themes/base/messages/messages_ia.py | asmeurer/nikola | 1,901 | 12666194 | <filename>nikola/data/themes/base/messages/messages_ia.py
# -*- encoding:utf-8 -*-
"""Autogenerated file, do not edit. Submit translations on Transifex."""
MESSAGES = {
"%d min remaining to read": "%dminutas de lectura remanente",
"(active)": "(active)",
"Also available in:": "Anque disponibile in:",
"... |
cnsenti/__init__.py | edddyeddy/cnsenti | 140 | 12666213 | from cnsenti.emotion import Emotion
from cnsenti.sentiment import Sentiment |
qinhaifang/src/evalTools/script/evaluateScene.py | SpaceNetChallenge/BuildingFootprintDetectors | 161 | 12666226 | <reponame>SpaceNetChallenge/BuildingFootprintDetectors
from spaceNet import evalTools as eT
from spaceNet import geoTools as gT
import numpy as np
import sys
import multiprocessing
import time
if __name__ == "__main__":
# load Truth and Test File Locations
if len(sys.argv) > 1:
truth_fp = sys.argv[1]
... |
proximal/lin_ops/warp.py | kyleaj/ProxImaL | 101 | 12666279 | from .lin_op import LinOp
import numpy as np
import cv2
from proximal.halide.halide import Halide
from proximal.utils.utils import Impl
class warp(LinOp):
"""Warp using a homography.
"""
def __init__(self, arg, H, implem=None):
self.H = H.copy()
# Compute inverse
self.Hinv = np.... |
h2o-py/tests/testdir_munging/pyunit_isax.py | ahmedengu/h2o-3 | 6,098 | 12666317 | <gh_stars>1000+
from __future__ import print_function
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def isax():
df = h2o.create_frame(rows=1,cols=256,real_fraction=1.0,missing_fraction=0.0,seed=123)
df2 = df.cumsum(axis=1)
res = df2.isax(num_words=10,max_cardinality=10)
... |
test/scrapers/test_hitrust_matches.py | HanselD/aws-allowlister | 180 | 12666324 | import unittest
from aws_allowlister.database.compliance_data import ComplianceData
from aws_allowlister.database.database import connect_db
compliance_data = ComplianceData()
db_session = connect_db()
class HitrustQATestCase(unittest.TestCase):
def test_gh_51_HITRUST_compliant_services(self):
results = ... |
src/DataJoin/data_join/example_id_appender.py | huangwei19/9nfl | 103 | 12666326 | # Copyright 2020 The 9nFL 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 applicable la... |
zeus/modules/operators/quant/__init__.py | shaido987/vega | 240 | 12666361 | import zeus
if zeus.is_tf_backend():
from .tensorflow_quant import *
elif zeus.is_torch_backend():
from .pytorch_quant import *
|
data/test/python/9b5bb2aa0435ae771160122adef80202b6062e82test_nsobjectcontroller.py | harshp8l/deep-learning-lang-detection | 132 | 12666363 | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSObjectController (TestCase):
def testMethods(self):
self.assertResultIsBOOL(NSObjectController.automaticallyPreparesContent)
self.assertArgIsBOOL(NSObjectController.setAutomaticallyPreparesContent_, 0)
self.assertResultI... |
Python/CombinationSumTest.py | TonnyL/Windary | 205 | 12666382 | <reponame>TonnyL/Windary
from unittest import TestCase
from CombinationSum import CombinationSum
class TestCombinationSum(TestCase):
def test_combinationSum(self):
cs = CombinationSum()
list0 = cs.combinationSum([2, 3, 6, 7], 7)
self.assertTrue(len(list0) == 2)
self.assertTrue(li... |
runtime/stdlib/api.py | cheery/lever | 136 | 12666423 | <reponame>cheery/lever
from rpython.translator.platform import platform
import pathobj
from space import *
import ffi
import json, os
class ApiConfig:
def __init__(self):
self.headers_dir = None
conf = ApiConfig()
def init(lever_path):
conf.headers_dir = pathobj.concat(lever_path, pathobj.parse(u"hea... |
tests/test_provider_banzaicloud_k8s.py | mjuenema/python-terrascript | 507 | 12666448 | <reponame>mjuenema/python-terrascript
# tests/test_provider_banzaicloud_k8s.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:19:55 UTC)
def test_provider_import():
import terrascript.provider.banzaicloud.k8s
def test_resource_import():
from terrascript.resource.banzaicloud.k8s import k8s_ma... |
tests/test_service_catalog/test_api/test_service/test_service_put.py | LaudateCorpus1/squest | 112 | 12666479 | <filename>tests/test_service_catalog/test_api/test_service/test_service_put.py
from rest_framework import status
from rest_framework.reverse import reverse
from tests.test_service_catalog.base_test_request import BaseTestRequest
from tests.utils import check_data_in_dict
class TestApiServicePut(BaseTestRequest):
... |
pytorch_tools/segmentation_models/__init__.py | YevheniiSemendiak/pytorch-tools | 155 | 12666481 | <reponame>YevheniiSemendiak/pytorch-tools<filename>pytorch_tools/segmentation_models/__init__.py<gh_stars>100-1000
from .unet import Unet
from .linknet import Linknet
from .deeplabv3_plus import DeepLabV3
from .segm_fpn import SegmentationFPN
from .segm_bifpn import SegmentationBiFPN
from .hrnet import HRNet
|
infer_tools_tree/metric/dijstra.py | gvieralopez/Coronary-Artery-Tracking-via-3D-CNN-Classification | 107 | 12666545 | <reponame>gvieralopez/Coronary-Artery-Tracking-via-3D-CNN-Classification<gh_stars>100-1000
# -*- coding: UTF-8 -*-
# @Time : 04/08/2020 15:38
# @Author : QYD
# @FileName: dijstra.py
# @Software: PyCharm
import heapq
import numpy as np
import copy
def get_distance(p1, p2):
return np.linalg.norm(np.array(p1) -... |
zerver/migrations/0332_realmuserdefault.py | Pulkit007/zulip | 17,004 | 12666589 | <reponame>Pulkit007/zulip
# Generated by Django 3.2.2 on 2021-05-31 16:49
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("zerver", "0331_scheduledmessagenotificationemail"),
]
operations = [
migrations.C... |
uxy/uxy_ls.py | sustrik/uxy | 735 | 12666624 | <reponame>sustrik/uxy
# Copyright (c) 2019 <NAME>
#
# 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, m... |
backend/src/baserow/contrib/database/api/formula/urls.py | ashishdhngr/baserow | 839 | 12666654 | from django.urls import re_path
from baserow.contrib.database.api.formula.views import TypeFormulaView
app_name = "baserow.contrib.database.api.export"
urlpatterns = [
re_path(
r"(?P<field_id>[0-9]+)/type/$",
TypeFormulaView.as_view(),
name="type_formula",
),
]
|
tests/replication_tests/test_lr3opt.py | juicetinliu/VeRyPy | 156 | 12666704 | # -*- coding: utf-8 -*-
import unittest
from collections import namedtuple
from os import path
from random import shuffle
import numpy as np
from replicationbase import ReplicationBase, REPRO_QUALITY_LEVELS
from classic_heuristics.lr3opt import lr3opt_init, _check_lr3opt_move, _init_with_random
from cvrp_ops import ... |
kivymd/uix/templates/rotatewidget/__init__.py | marvelous-benji/KivyMD | 1,111 | 12666725 | from .rotatewidget import RotateWidget
|
appscan/getJson.py | eiri/java-sdk-core | 686 | 12666744 | <reponame>eiri/java-sdk-core
import json
import sys
def main():
data = load_data()
printFields(data)
def load_data():
data = ""
filename = sys.argv[1]
with open(filename, "r") as read:
data = json.load(read)
if isinstance(data, list):
data = data[0]
return data
def printFi... |
nodejs/node_modules/speaker/deps/mpg123/scripts/tag_lyrics.py | qcuong98/KT-AI-Hackathon | 323 | 12666780 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# needs mutagen
# grabbed from: http://code.activestate.com/recipes/577138-embed-lyrics-into-mp3-files-using-mutagen-uslt-tag/
# simplified to only work on one file and get lyrics from stdin
# I suspect this is public domain code. Just a usage example o... |
tests/test_08b_provider_gencode.py | tilschaef/genomepy | 112 | 12666805 | import pytest
import genomepy
from tests import linux, travis
@pytest.mark.skipif(travis and linux, reason="FTP does not work on Travis-Linux")
def test_gencodeprovider(gencode):
assert gencode.name == "GENCODE"
assert gencode.taxid_fields == ["taxonomy_id"]
@pytest.mark.skipif(travis and linux, reason="FT... |
DeepAlignmentNetwork/menpofit/visualize/__init__.py | chiawei-liu/DeepAlignmentNetwork | 220 | 12666821 | from .textutils import print_progress, statistics_table
from .base import (view_image_multiple_landmarks,
plot_cumulative_error_distribution)
|
tools/inference_synthesis.py | yuzhd/Text2Scene | 109 | 12666857 | <reponame>yuzhd/Text2Scene
#!/usr/bin/env python
import _init_paths
import os, sys, cv2, json
import math, PIL, cairo
import numpy as np
import pickle, random
import os.path as osp
from time import time
from copy import deepcopy
from glob import glob
import matplotlib.pyplot as plt
from composites_utils import *
from... |
lib/model/MLP.py | desmondblue/image-reconstruction-web-app | 8,045 | 12666864 | <reponame>desmondblue/image-reconstruction-web-app
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
class MLP(nn.Module):
def __init__(self,
filter_channels,
merge_layer=0,
... |
BPNN/BPNN_Regression/TensorFlow_BPNN_Regression.py | Jojoxiao/Machine-Learning-for-Beginner-by-Python3 | 397 | 12666866 | #-*- coding:utf-8 -*-
# &Author AnFany
# 适用于多维输出
from BPNN_DATA_Reg import model_data as R_data
import numpy as np
import tensorflow as tf
'''第一部分:数据准备'''
train_x_data = R_data[0] # 训练输入
train_y_data = R_data[1] # 训练输出
predict_x_data = R_data[2] # 测试输入
predict_y_data = R_data[3] # 测试输出
'''第二部分... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.