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 |
|---|---|---|---|---|
module/M_drown.py | mehrdad-shokri/a2sv | 655 | 108968 | <filename>module/M_drown.py<gh_stars>100-1000
import socket
from C_display import *
#Module
def check_tls(hostname,port):
client_hello = '16030100d8010000d403037d408377c8e5204623867604ab0ee4a140043a4e383f770a1e6b66c2d45d34e820de8656a211d79fa9809e9ae6404bb7bcc372afcdd6f51882e39ac2241a8535090016c02bc02fc00ac009c013... |
accessify/__init__.py | dmytrostriletskyi/design-kit | 107 | 108994 | from accessify.access import (
accessify,
private,
protected,
)
from accessify.interfaces import (
implements,
throws,
)
|
tests/test_provider_pmorillon_grid5000.py | mjuenema/python-terrascript | 507 | 108998 | # tests/test_provider_pmorillon_grid5000.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:17:36 UTC)
def test_provider_import():
import terrascript.provider.pmorillon.grid5000
def test_resource_import():
from terrascript.resource.pmorillon.grid5000 import grid5000_ceph_pool
from terras... |
ghostwriter/commandcenter/migrations/0002_auto_20201009_1918.py | bbhunter/Ghostwriter | 601 | 109000 | # Generated by Django 2.2.3 on 2020-10-09 19:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('commandcenter', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='cloudservicesconfiguration',
na... |
examples/starwars/data.py | radekwlsk/graphene-django | 4,038 | 109015 | <filename>examples/starwars/data.py
from .models import Character, Faction, Ship
def initialize():
human = Character(name="Human")
human.save()
droid = Character(name="Droid")
droid.save()
rebels = Faction(id="1", name="Alliance to Restore the Republic", hero=human)
rebels.save()
empire... |
reckoner/meta.py | LynRodWS/reckoner | 192 | 109031 | # -- coding: utf-8 --
# pylint: skip-file
# Copyright 2019 FairwindsOps 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 req... |
tests/features/change_theme_on_legacy_widgets.py | dmalves/ttkbootstrap | 406 | 109041 | import tkinter as tk
from ttkbootstrap import Style
from random import choice
root = tk.Tk()
root.minsize(500, 500)
style = Style('superhero')
def new_theme():
theme = choice(style.theme_names())
print(theme)
style.theme_use(theme)
btn = tk.Button(root, text='Primary')
btn.configure(command=new_theme)
b... |
test/modules/redfish_auth.py | arunrordell/RackHD | 451 | 109054 | from config.redfish1_0_config import config
from config.auth import *
from config.settings import *
from logger import Log
from json import loads, dumps
import pexpect
import pxssh
import subprocess
LOG = Log(__name__)
class Auth(object):
"""
Class to abstract python authentication functionality
"""
@... |
src/netius/test/middleware/proxy.py | timgates42/netius | 107 | 109057 | <reponame>timgates42/netius<gh_stars>100-1000
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apa... |
python/test/resource/test_dataset_mixed.py | Fosstack/vmaf | 2,874 | 109074 | <gh_stars>1000+
dataset_name = 'example'
quality_width = 1920
quality_height = 1080
from vmaf.config import VmafConfig
ref_videos = [
{'content_id': 0, 'path': VmafConfig.resource_path('yuv', 'checkerboard_1920_1080_10_3_0_0.yuv'), 'yuv_fmt': 'yuv420p', 'width': 1920, 'height': 1080},
{'content_id': 1, 'pat... |
yacv/abstractsyntaxtree.py | amitpatra/yacv | 120 | 109091 | from yacv.grammar import Production
from yacv.constants import YACV_EPSILON
from pprint import pformat
class AbstractSyntaxTree(object):
def __init__(self, *args):
if len(args) == 0:
self.root = None
self.desc = []
self.prod_id = None
self.node_id = None
... |
micro-benchmark/snippets/external/cls_parent/main.py | WenJinfeng/PyCG | 121 | 109096 | from ext import parent
class A(parent):
def fn(self):
self.parent_fn()
a = A()
a.fn()
|
stereomag/rank.py | Dawars/stereo-magnification | 348 | 109100 | <reponame>Dawars/stereo-magnification
#!/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
#
# U... |
esphome/components/tcs34725/sensor.py | OttoWinter/esphomeyaml | 249 | 109147 | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c, sensor
from esphome.const import (
CONF_COLOR_TEMPERATURE,
CONF_GAIN,
CONF_ID,
CONF_ILLUMINANCE,
CONF_GLASS_ATTENUATION_FACTOR,
CONF_INTEGRATION_TIME,
DEVICE_CLASS_ILLUMINANCE,
ICON_LI... |
vnpy/gateway/deribit/__init__.py | ChaunceyDong/vnpy | 19,529 | 109173 | <gh_stars>1000+
from vnpy_deribit import DeribitGateway
|
deepy/tensor/__init__.py | uaca/deepy | 260 | 109184 | <reponame>uaca/deepy<gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from wrapper import deepy_tensor
from functions import concat, concatenate, reverse, ifelse, apply, repeat, var, vars, activate, is_neural_var, is_theano_var
from onehot import onehot_tensor, onehot
import theano_nnet_imports as nnet
... |
test/IECore/TypedDataAsObject.py | bradleyhenke/cortex | 386 | 109226 | ##########################################################################
#
# Copyright (c) 2007, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... |
dataviva/api/hedu/services.py | joelvisroman/dataviva-site | 126 | 109265 | from dataviva.api.hedu.models import Ybu, Ybc_hedu, Yu, Yuc, Yc_hedu, Ybuc
from dataviva.api.attrs.models import University as uni, Course_hedu, Bra
from dataviva import db
from sqlalchemy.sql.expression import func, desc, not_
class University:
def __init__(self, university_id):
self._hedu = None
... |
tt/tests/unit/definitions/test_boolean_inputs_factory.py | fkromer/tt | 233 | 109322 | """Tests for boolean_inputs_factory method."""
import unittest
from tt.definitions import boolean_variables_factory
class TestBooleanInputsFactory(unittest.TestCase):
def test_str_methods(self):
"""Test converting to string via __str__ and __repr__."""
factory = boolean_variables_factory(['A', ... |
packages/pyright-internal/src/tests/samples/tryExcept7.py | martindemello/pyright | 4,391 | 109355 | # This sample tests the syntax handling for Python 3.11 exception groups
# as described in PEP 654.
def func1():
try:
pass
# This should generate an error if using Python 3.10 or earlier.
except* BaseException:
pass
# This should generate an error if using Python 3.10 or earlier.
... |
SRT/lib/xvision/style_trans.py | yerang823/landmark-detection | 612 | 109385 | <gh_stars>100-1000
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#
from PIL import Image, ImageOps
import numpy as np
import random
import imgaug as ia
from imgaug impo... |
tools/expand_model.py | nyu-dl/dl4mt-multi | 143 | 109389 | <gh_stars>100-1000
import sys
import numpy
import logging
rng = numpy.random.RandomState(1234)
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('expand_model')
ref_model = dict(numpy.load(sys.argv[1]))
old_model = dict(numpy.load(sys.argv[2]))
for o_key, o_val in old_model.items():
if o_key n... |
src/sparsify/schemas/system.py | dhuangnm/sparsify | 152 | 109420 | # Copyright (c) 2021 - present / Neuralmagic, 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 b... |
tests/rtllib/test_aes.py | SwiftWinds/PyRTL | 159 | 109437 | import unittest
import pyrtl
import pyrtl.corecircuits
from pyrtl.rtllib import aes, testingutils
class TestAESDecrypt(unittest.TestCase):
"""
Test vectors are retrieved from:
http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
"""
def setUp(self):
pyrtl.reset_working_block()
... |
python/ccxt/static_dependencies/__init__.py | DavidFelsen/ccxt | 24,910 | 109456 | <filename>python/ccxt/static_dependencies/__init__.py
__all__ = ['ecdsa', 'keccak']
|
tests/ignite/engine/__init__.py | Juddd/ignite | 4,119 | 109465 | import torch
try:
from torch.utils.data import IterableDataset
except ImportError:
class IterableDataset:
pass
class BatchChecker:
def __init__(self, data, init_counter=0):
self.counter = init_counter
self.data = data
self.true_batch = None
def check(self, batch):
... |
tests/test_multi_k_model.py | shifaoh/dna2vec | 151 | 109501 | <gh_stars>100-1000
import pytest
from dna2vec.multi_k_model import MultiKModel
K_LOW = 3
K_HIGH = 8
kmer_samples = ['AAA', 'ACGT', 'ACGTACGT']
cosine_testdata = [
('AAA', 'AAAA', 'CCCC'),
('ACGA', 'ACGT', 'TTTT'),
('ACGT', 'ACGTAA', 'TTT'),
]
@pytest.fixture(scope="module")
def mk_model():
filepath =... |
pytools/modules/newyearcardgenerator/__init__.py | maopucheng/pytools | 757 | 109508 | '''初始化'''
from .newyearcardgenerator import NewYearCardGenerator |
examples/pxScene2d/external/libnode-v10.15.3/deps/v8/tools/lldb_commands.py | madanagopaltcomcast/pxCore | 2,151 | 109520 | # Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import lldb
import re
def jst(debugger, *args):
"""Print the current JavaScript stack trace"""
target = debugger.GetSelectedTarget()
process = targe... |
lucent/misc/io/collapse_channels.py | fuzhanrahmanian/lucent | 449 | 109546 | <gh_stars>100-1000
# Copyright 2018 The Lucid 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 requi... |
Python/Tests/TestData/AddImport/ImportFunctionFromExistingFromImportParens.py | techkey/PTVS | 404 | 109553 | <gh_stars>100-1000
from test_module import (module_func_2)
module_func() |
src/olympia/devhub/cron.py | covariant/addons-server | 843 | 109574 | from datetime import datetime
from django.conf import settings
import requests
import olympia.core.logger
from olympia.devhub.models import BlogPost
log = olympia.core.logger.getLogger('z.cron')
def update_blog_posts():
"""Update the blog post cache."""
items = requests.get(settings.DEVELOPER_BLOG_URL, ... |
eval/evaluate.py | aiainui/crnn-audio-classification | 307 | 109583 | <filename>eval/evaluate.py
import os
import torch
from tqdm import tqdm
from net import MelspectrogramStretch
from utils import plot_heatmap, mkdir_p
class ClassificationEvaluator(object):
def __init__(self, data_loader, model):
self.data_loader = data_loader
self.device = torch.device("cuda" if... |
tools/clang/bindings/python/tests/cindex/test_comment.py | clayne/DirectXShaderCompiler | 1,192 | 109623 | from clang.cindex import TranslationUnit
from tests.cindex.util import get_cursor
def test_comment():
files = [('fake.c', """
/// Aaa.
int test1;
/// Bbb.
/// x
void test2(void);
void f() {
}
""")]
# make a comment-aware TU
tu = TranslationUnit.from_source('fake.c', ['-std=c99'], unsaved_files=files,
... |
BRATS/data/explore.py | eanemo/KiU-Net-pytorch | 236 | 109638 | import os
import numpy as np
from numpy.lib.stride_tricks import as_strided
import nibabel as nib
def nib_load(file_name):
proxy = nib.load(file_name)
data = proxy.get_data().astype('float32')
proxy.uncache()
return data
def crop(x, ksize, stride=3):
shape = (np.array(x.shape[:3]) - ksize)/stride ... |
conceptnet5/db/connection.py | tesYolan/conceptnet5 | 2,195 | 109644 | <filename>conceptnet5/db/connection.py
import psycopg2
from conceptnet5.db import config
_CONNECTIONS = {}
def get_db_connection(dbname=None):
"""
Get a global connection to the ConceptNet PostgreSQL database.
`dbname` specifies the name of the database in PostgreSQL.
"""
if dbname is None:
... |
Python3/598.py | rakhi2001/ecom7 | 854 | 109685 | __________________________________________________________________________________________________
sample 68 ms submission
class Solution:
def maxCount(self, m: int, n: int, ops: List[List[int]]) -> int:
rMin, cMin = sys.maxsize, sys.maxsize
for i in ops:
rMin = min(rMin, i[0])
... |
saas/aiops/api/aiops-server/services/base_service.py | iuskye/SREWorks | 407 | 109750 | <gh_stars>100-1000
#!/usr/bin/env python
# encoding: utf-8
""" """
__author__ = 'sreworks'
from models.db_session import db
class BaseService(object):
def __init__(self):
self.db = db
self.db_session = db.session
|
swift_rpc/server/__init__.py | rfyiamcool/swift_rpc | 116 | 109780 | #coding:utf-8
from tornado import (
gen,
ioloop,
log,
web
)
from tornado.httpserver import HTTPServer
from .handlers import _AsyncBase, _Base, _ThreadPoolBase, _MessageQueueBase
from swift_rpc.log import get_logger
class RPCServer(object):
def __init__(self,config):
self.config = config
... |
Configuration/DataProcessing/python/Impl/cosmicsEra_Run2_2017.py | Purva-Chaudhari/cmssw | 852 | 109784 | <filename>Configuration/DataProcessing/python/Impl/cosmicsEra_Run2_2017.py<gh_stars>100-1000
#!/usr/bin/env python3
"""
_cosmicsEra_Run2_2017_
Scenario supporting cosmic data taking
"""
import os
import sys
from Configuration.Eras.Era_Run2_2017_cff import Run2_2017
from Configuration.DataProcessing.Impl.cosmics imp... |
finalists/yc14600/PyTorch-Encoding/tests/unit_test/test_function.py | lrzpellegrini/cvpr_clvision_challenge | 2,190 | 109806 | ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: <NAME>
## ECE Department, Rutgers University
## Email: <EMAIL>
## Copyright (c) 2017
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this source tree
##+++++++... |
quantifiedcode/backend/api/v1/task.py | marcinguy/quantifiedcode | 118 | 109829 | # -*- coding: utf-8 -*-
"""
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
import os
from flask import request
from quantifiedcode.settings import backend, settings
from ...utils.api import ArgumentError, get_pagination_args
from ...models... |
Chapter17/PI-QTicTacToe/run.py | trappn/Mastering-GUI-Programming-with-Python | 138 | 109837 | <gh_stars>100-1000
"""Qtictactoe by <NAME>"""
from qtictactoe.__main__ import main
if __name__ == '__main__':
main()
|
deepy/utils/__init__.py | uaca/deepy | 260 | 109872 | <filename>deepy/utils/__init__.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from dim_to_var import dim_to_var
from fake_generator import FakeGenerator
from initializers import *
from map_dict import MapDict
from scanner import Scanner
from stream_pickler import StreamPickler
from timer import Timer
|
examples/processing/plot_line_noise.py | dieloz/fooof | 154 | 109900 | <reponame>dieloz/fooof
"""
Dealing with Line Noise
=======================
This example covers strategies for dealing with line noise.
"""
###################################################################################################
# sphinx_gallery_thumbnail_number = 2
# Import the spectral parameterization ... |
homeassistant/components/uptime/__init__.py | domwillcode/home-assistant | 22,481 | 109901 | <reponame>domwillcode/home-assistant<filename>homeassistant/components/uptime/__init__.py
"""The uptime component."""
|
tests/formatters/chrome_preferences.py | pyllyukko/plaso | 1,253 | 109920 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Google Chrome Preferences file event formatter."""
import unittest
from plaso.formatters import chrome_preferences
from tests.formatters import test_lib
class ChromePreferencesPrimaryURLFormatterHelperTest(
test_lib.EventFormatterTestCase):
"""T... |
qiskit/opflow/gradients/circuit_qfis/lin_comb_full.py | QAMP-Spring-2022-Transpiler-Hackathon/qiskit-terra | 1,456 | 109933 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
plenum/test/node_catchup/test_catchup_from_unequal_nodes_without_waiting.py | andkononykhin/plenum | 148 | 109936 | <reponame>andkononykhin/plenum
import pytest
from plenum.common.messages.node_messages import Commit
from plenum.server.catchup.node_leecher_service import NodeLeecherService
from plenum.test.delayers import delay_3pc
from plenum.test.helper import sdk_send_random_and_check, max_3pc_batch_limits, assert_eq, sdk_send_r... |
utils/tests/test_text_utils.py | nathandarnell/sal | 215 | 109960 | <reponame>nathandarnell/sal
"""General functional tests for the text_utils module."""
from django.test import TestCase
from utils import text_utils
class TextUtilsTest(TestCase):
"""Test the Utilities module."""
def test_safe_text_null(self):
"""Ensure that null characters are dropped."""
... |
tt/expressions/__init__.py | fkromer/tt | 233 | 109970 | <reponame>fkromer/tt
"""Tools for working with Boolean expressions."""
from .bexpr import BooleanExpression # noqa
|
examples/window.py | superzazu/pylibui | 222 | 109982 | """
Shows an empty window.
"""
from pylibui.core import App
from pylibui.controls import Window
class MyWindow(Window):
def onClose(self, data):
super().onClose(data)
app.stop()
app = App()
window = MyWindow('Window', 800, 600)
window.setMargined(True)
window.show()
app.start()
app.close()... |
btalib/utils.py | demattia/bta-lib | 352 | 110009 | #!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
# Copyright (C) 2020 <NAME>
# Use of this source code is governed by the MIT License
###############################################################################
__all__ =... |
ConvertShellcode.py | rvrsh3ll/CPLResourceRunner | 232 | 110036 | <reponame>rvrsh3ll/CPLResourceRunner<filename>ConvertShellcode.py
#!/usr/bin/env python
import binascii
import sys
file_name = sys.argv[1]
with open (file_name) as f:
hexdata = binascii.hexlify(f.read())
hexlist = map(''.join, zip(hexdata[::2], hexdata[1::2]))
shellcode = ''
for i in hexlist:
shellcode += "0x{},... |
mopp/mopp_lib.py | diwashsapkota/jupyter-text2code | 2,147 | 110046 | <reponame>diwashsapkota/jupyter-text2code
import json
from IPython import get_ipython
from IPython.core.magics.namespace import NamespaceMagics
_nms = NamespaceMagics()
_Jupyter = get_ipython()
_nms.shell = _Jupyter.kernel.shell
def dataframes_info():
values = _nms.who_ls()
info = {v: (eval(v).columns.tolis... |
river/datasets/synth/friedman.py | fox-ds/river | 2,184 | 110055 | import math
import random
from typing import Tuple
from .. import base
class Friedman(base.SyntheticDataset):
"""Friedman synthetic dataset.
Each observation is composed of 10 features. Each feature value is sampled uniformly in [0, 1].
The target is defined by the following function:
$$y = 10 sin(... |
models/warp.py | RNubla/FeatureFlow | 161 | 110069 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class backWarp(nn.Module):
"""
A class for creating a backwarping object.
This is used for backwarping to an image:
Given optical flow from frame I0 to I1 --> F_0_1 and frame I1,
it generates I0 <-... |
src/intensio_obfuscator/core/obfuscation/intensio_delete.py | bbhunter/Intensio-Obfuscator | 553 | 110075 | # -*- coding: utf-8 -*-
# https://github.com/Hnfull/Intensio-Obfuscator
#---------------------------------------------------------- [Lib] -----------------------------------------------------------#
import re
import fileinput
import os
import sys
from progress.bar import Bar
try:
from intensio_obfuscator.core.u... |
scripts/conversionScripts/Opt_FD_name.py | rinelson456/raven | 159 | 110143 | # Copyright 2017 Battelle Energy Alliance, 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 t... |
torchMoji/examples/create_twitter_vocab.py | UmaTaru/run | 163 | 110149 | """ Creates a vocabulary from a tsv file.
"""
import codecs
from torchMoji.torchmoji.create_vocab import VocabBuilder
from torchMoji.torchmoji.word_generator import TweetWordGenerator
with codecs.open('../../twitterdata/tweets.2016-09-01', 'rU', 'utf-8') as stream:
wg = TweetWordGenerator(stream)
vb = VocabBu... |
release/stubs.min/Tekla/Structures/ModelInternal_parts/dotStringProperty_t.py | htlcnn/ironpython-stubs | 182 | 110202 | <gh_stars>100-1000
class dotStringProperty_t(object):
# no doc
aName=None
aValueString=None
FatherId=None
ValueStringIteration=None
|
functions/source/CleanupPV/lambda_function.py | srinivasreddych/quickstart-redhat-openshift | 179 | 110213 | import json
import logging
import boto3
import cfnresponse
import time
ec2_client = boto3.client('ec2')
logs_client = boto3.client('logs')
def boto_throttle_backoff(boto_method, max_retries=10, backoff_multiplier=2, **kwargs):
retry = 0
results = None
while not results:
try:
results ... |
plugins/webosint/who/whois.py | Appnet1337/OSINT-SAN | 313 | 110242 | import requests
def whois_more(IP):
result = requests.get('http://api.hackertarget.com/whois/?q=' + IP).text
print('\n'+ result + '\n')
|
tests/warnings/semantic/UNDEFINED_DECORATOR.py | dina-fouad/pyccel | 206 | 110243 | # pylint: disable=missing-function-docstring, missing-module-docstring/
@toto # pylint: disable=undefined-variable
def f():
pass
|
mastiff/plugins/analysis/EXE/EXE-resources.py | tt1379/mastiff | 164 | 110248 | #!/usr/bin/env python
"""
Copyright 2012-2013 The MASTIFF Project, All Rights Reserved.
This software, having been partly or wholly developed and/or
sponsored by KoreLogic, Inc., is hereby released under the terms
and conditions set forth in the project's "README.LICENSE" file.
For a list of all contributors... |
baseline/onnx/apis/grpc_service_pb2_grpc.py | sagnik/baseline | 241 | 110249 | <filename>baseline/onnx/apis/grpc_service_pb2_grpc.py
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import baseline.onnx.apis.grpc_service_pb2 as grpc__service__pb2
class GRPCInferenceServiceStub(object):
... |
dfvfs/path/xfs_path_spec.py | dfjxs/dfvfs | 176 | 110252 | # -*- coding: utf-8 -*-
"""The XFS path specification implementation."""
from dfvfs.lib import definitions
from dfvfs.path import factory
from dfvfs.path import path_spec
class XFSPathSpec(path_spec.PathSpec):
"""XFS path specification implementation.
Attributes:
inode (int): inode.
location (str): loca... |
koku/api/migrations/0031_clone_schema.py | rubik-ai/koku | 157 | 110277 | # Generated by Django 3.1.2 on 2020-10-14 12:24
import os
from django.db import migrations
from koku import migration_sql_helpers as msh
def apply_clone_schema(apps, schema_editor):
path = msh.find_db_functions_dir()
msh.apply_sql_file(schema_editor, os.path.join(path, "clone_schema.sql"), literal_placehold... |
survae/transforms/stochastic/permutation.py | alisiahkoohi/survae_flows | 262 | 110281 | <gh_stars>100-1000
import torch
from survae.transforms.stochastic import StochasticTransform
class StochasticPermutation(StochasticTransform):
'''A stochastic permutation layer.'''
def __init__(self, dim=1):
super(StochasticPermutation, self).__init__()
self.register_buffer('buffer', torch.ze... |
care/facility/migrations/0121_auto_20200619_2306.py | gigincg/care | 189 | 110283 | <gh_stars>100-1000
# Generated by Django 2.2.11 on 2020-06-19 17:36
from django.db import migrations, models
import django.db.models.deletion
import fernet_fields.fields
class Migration(migrations.Migration):
dependencies = [
('facility', '0120_patientsample_icmr_label'),
]
operations = [
... |
apps/reputation/serializers.py | macdaliot/exist | 159 | 110285 | <filename>apps/reputation/serializers.py
from rest_framework import serializers
from .models import blacklist
class blSerializer(serializers.ModelSerializer):
source = serializers.CharField(source='get_source_display')
class Meta:
model = blacklist
fields = ('__all__')
class sourceSerializer(s... |
tests/modules/core/test_speedtest.py | spxtr/bumblebee-status | 1,089 | 110299 | import pytest
pytest.importorskip("speedtest")
def test_load_module():
__import__("modules.core.speedtest")
|
tests/xfdnn/test_xfdnn_compiler_caffe_deephi.py | yarenty/ml-suite | 334 | 110336 | <filename>tests/xfdnn/test_xfdnn_compiler_caffe_deephi.py<gh_stars>100-1000
#!/usr/bin/env python
#
# // SPDX-License-Identifier: BSD-3-CLAUSE
#
# (C) Copyright 2018, Xilinx, Inc.
#
import os,sys
from xfdnn.tools.compile.bin.xfdnn_compiler_caffe import CaffeFrontend as xfdnnCompiler
def run_compiler(dsp, mem, protot... |
yukarin/param.py | m95music/yukarin | 139 | 110376 | class AcousticParam(object):
def __init__(
self,
sampling_rate: int = 24000,
pad_second: float = 0,
threshold_db: float = None,
frame_period: int = 5,
order: int = 8,
alpha: float = 0.466,
f0_floor: float = 71,
... |
poco/utils/multitouch_gesture.py | HBoPRC/Poco | 1,444 | 110386 | <filename>poco/utils/multitouch_gesture.py
# coding=utf-8
import math
from poco.utils.track import MotionTrack
def make_pinching(direction, center, size, percent, dead_zone, duration):
w, h = size
half_distance = percent / 2
dead_zone_distance = dead_zone / 2
pa0 = center
pb0 = list(pa0)
pa1 ... |
teradata/tdodbc.py | Teradata/PyTd | 133 | 110388 | <gh_stars>100-1000
"""An implementation of the Python Database API Specification v2.0
using Teradata ODBC."""
# The MIT License (MIT)
#
# Copyright (c) 2015 by Teradata
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software... |
alipay/aop/api/domain/DeviceTradeInfoList.py | antopen/alipay-sdk-python-all | 213 | 110464 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class DeviceTradeInfoList(object):
def __init__(self):
self._biz_tid = None
self._dau = None
self._device_face_trade_dau = None
self._device_face_trade_dau_d_value = Non... |
community-content/pytorch_text_classification_using_vertex_sdk_and_gcloud/python_package/setup.py | gogasca/vertex-ai-samples | 213 | 110467 |
from setuptools import find_packages
from setuptools import setup
import setuptools
from distutils.command.build import build as _build
import subprocess
REQUIRED_PACKAGES = [
'transformers',
'datasets',
'tqdm',
'cloudml-hypertune'
]
setup(
name='trainer',
version='0.1',
install_require... |
codigo_das_aulas/aula_05/aula_05_01.py | VeirichR/curso-python-selenium | 234 | 110472 | from selenium.webdriver import Firefox
url = 'http://selenium.dunossauro.live/aula_05_a.html'
firefox = Firefox()
firefox.get(url)
div_py = firefox.find_element_by_id('python')
div_hk = firefox.find_element_by_id('haskell')
print(div_hk.text)
firefox.quit()
|
tensorflow_io/python/ops/archive_ops.py | lgeiger/io | 558 | 110509 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
mods/NERO/teams.py | LeRoi46/opennero | 215 | 110525 | <reponame>LeRoi46/opennero
import json
import constants
import OpenNero
import agent as agents
def factory(ai, *args):
cls = ai_map.get(ai, NeroTeam)
return cls(*args)
class TeamEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, NeroTeam):
return {
'... |
pyEX/stocks/quote.py | adamklaff/pyEX | 335 | 110529 | <gh_stars>100-1000
# *****************************************************************************
#
# Copyright (c) 2020, the pyEX authors.
#
# This file is part of the pyEX library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
#
from functools import wra... |
pygmt/tests/test_grdtrack.py | weiji14/gmt-python | 168 | 110535 | """
Tests for grdtrack.
"""
import os
import numpy as np
import numpy.testing as npt
import pandas as pd
import pytest
from pygmt import grdtrack
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import GMTTempFile, data_kind
from pygmt.helpers.testing import load_static_earth_relief
TEST_DATA_DIR = os.... |
brew/utils/data.py | va26/brew | 344 | 110562 | <reponame>va26/brew
from sklearn import cross_validation
def split_data(X, y, t_size):
if len(X) != len(y):
return None
if hasattr(cross_validation, 'train_test_split'):
return cross_validation.train_test_split(X, y, test_size=t_size)
return None
|
tests/app/serializers.py | simiotics/djangorestframework-queryfields | 195 | 110597 | <reponame>simiotics/djangorestframework-queryfields
from rest_framework import serializers
from drf_queryfields import QueryFieldsMixin
from tests.app.fields import BoomField
from tests.app.models import Snippet
class QuoteSerializer(QueryFieldsMixin, serializers.Serializer):
character = serializers.CharField()... |
_build/jupyter_execute/content/c6/s2/bagging.py | curioushruti/mlbook | 970 | 110600 | # Bagging
Bagging can be used for regression or classification, though we will demonstrate a regression bagging model here. Since this model is based on decision tree regressors, we'll first import our {doc}`regression tree </content/c5/s2/regression_tree>` construction from the previous chapter. We'll also import num... |
asylo/platform/system_call/type_conversions/types_parse_functions.py | light1021/asylo | 890 | 110620 | #
#
# Copyright 2019 Asylo authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
nodes/1.x/python/Buckyball.ByOriginAndRadius.py | jdehotin/Clockworkfordynamo | 147 | 110660 | import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
points = IN[0]
almostzero = IN[1]
struts = list()
# this function recursively finds all the pairs of points of the buckyball struts
def BuckyballStruts(points,struts):
firstpoint = points[0]
restofpoints = points[1:]
# measur... |
build/lib/cort/analysis/plotting.py | leonardoboliveira/cort | 141 | 110670 | """ Plot error analysis statistics. """
from __future__ import division
from matplotlib import pyplot
from matplotlib import cm
import numpy
from pylab import rcParams
__author__ = 'martscsn'
def plot(data,
title,
xlabel,
ylabel,
filename=None):
""" Plot error analysis s... |
niftynet/engine/application_initializer.py | tdml13/NiftyNet | 1,403 | 110696 | # -*- coding: utf-8 -*-
"""
Loading modules from a string representing the class name
or a short name that matches the dictionary item defined
in this module
all classes and docs are taken from
https://github.com/tensorflow/tensorflow/blob/r1.3/tensorflow/python/ops/init_ops.py
"""
import tensorflow as tf
SEED = 42
... |
test/test_jpiarea.py | liujb/python-geohash | 284 | 110698 | <reponame>liujb/python-geohash
# coding: UTF-8
import unittest
import jpiarea
def dms(d,m,s):
return float(d) + (float(m) + float(s)/60)/60.0
class TestReference(unittest.TestCase):
# hash code examples from open iarea document
# http://www.nttdocomo.co.jp/service/imode/make/content/iarea/domestic/index.h... |
test/test_local_interpolation.py | FedericoV/diffrax | 377 | 110702 | <gh_stars>100-1000
import diffrax.local_interpolation
import jax
import jax.numpy as jnp
from helpers import shaped_allclose
def test_local_linear_interpolation():
t0 = 2.0
t1 = 3.3
t0_ = 2.8
t1_ = 2.9
for y0 in (2.1, jnp.array(2.1), jnp.array([2.1, 3.1])):
for y1 in (2.2, jnp.array(2.2),... |
libs/sqlobject/tests/test_sqlbuilder_importproxy.py | scambra/HTPC-Manager | 422 | 110713 | <reponame>scambra/HTPC-Manager
from sqlobject import *
from sqlobject.tests.dbtest import *
from sqlobject.views import *
from sqlobject.sqlbuilder import ImportProxy, Alias
def testSimple():
nyi = ImportProxy('NotYetImported')
x = nyi.q.name
class NotYetImported(SQLObject):
name = StringCol(dbNam... |
opy/__init__.py | nm17/Opy | 284 | 110718 | <reponame>nm17/Opy<filename>opy/__init__.py
'''_opy_Copyright 2014, 2015, 2016, 2017, 2018 <NAME>, GEATEC engineering, www.geatec.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.... |
nlu/components/classifiers/generic_classifier/generic_classifier.py | milyiyo/nlu | 480 | 110730 | <gh_stars>100-1000
from sparknlp_jsl.annotator import GenericClassifierModel, GenericClassifierApproach
from sparknlp_jsl.base import *
class GenericClassifier:
@staticmethod
def get_default_model():
return GenericClassifierModel.pretrained() \
.setInputCols("feature_vector") \
... |
tests/test_wd.py | alliance-genome/ontobio | 101 | 110735 | <reponame>alliance-genome/ontobio
from ontobio.ontol_factory import OntologyFactory
from ontobio.assoc_factory import AssociationSetFactory
from ontobio.assocmodel import AssociationSet
import ontobio.sparql.wikidata as wd
import logging
PTSD = 'DOID:2055'
def test_wd_sparql_ptsd():
"""
TODO
test using P... |
rest_registration/signers/register_email.py | psibean/django-rest-registration | 329 | 110766 | <gh_stars>100-1000
from rest_registration.settings import registration_settings
from rest_registration.utils.signers import URLParamsSigner
class RegisterEmailSigner(URLParamsSigner):
SALT_BASE = 'register-email'
USE_TIMESTAMP = True
def get_base_url(self):
return registration_settings.REGISTER_E... |
ghostwriter/reporting/migrations/0004_report_delivered.py | bbhunter/Ghostwriter | 601 | 110779 | # Generated by Django 2.2.3 on 2019-08-27 18:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reporting', '0003_findingnote'),
]
operations = [
migrations.AddField(
model_name='report',
name='delivered',
... |
tests/estimator/classifier/GaussianNB/GaussianNBJSTest.py | midhunexeter/sklearn-porter | 1,197 | 110789 | <reponame>midhunexeter/sklearn-porter<filename>tests/estimator/classifier/GaussianNB/GaussianNBJSTest.py<gh_stars>1000+
# -*- coding: utf-8 -*-
from unittest import TestCase
from sklearn.naive_bayes import GaussianNB
from tests.estimator.classifier.Classifier import Classifier
from tests.language.JavaScript import J... |
evaluation_scripts/2017-evaluation-script/program/task_2_preprocess.py | yolochai/scisumm-corpus | 198 | 110831 | import os
import sys
def process(input_file, output_file):
output_text = ""
if input_file.endswith("abstract.summary.txt") or input_file.endswith("community.summary.txt") or input_file.endswith("combined.summary.txt") or input_file.endswith("human.summary.txt"):
input_text = []
with open(input_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.