max_stars_repo_path string | max_stars_repo_name string | max_stars_count int64 | id string | content string | add_param_types int64 | add_return_types int64 | add_class_field_types int64 | add_instance_field_types int64 | add_total int64 | add_error int64 |
|---|---|---|---|---|---|---|---|---|---|---|
pykeops/benchmarks/plot_benchmarks_convolutions_3D.py | mdiazmel/keops | 695 | 3202104 | """
Scaling up Gaussian convolutions on 3D point clouds
===========================================================
Let's compare the performances of PyTorch and KeOps on
simple Gaussian RBF kernel products,
as the number of samples grows from 100 to 1,000,000.
.. note::
In this demo, we use exact **bruteforce**... | 5 | 5 | 0 | 0 | 10 | 0 |
modules/dbnd/src/dbnd/tasks/basics/export.py | busunkim96/dbnd | 224 | 3202108 | import logging
import os.path
import subprocess
import tarfile
import tempfile
from dbnd import output, task
from dbnd._core.constants import CloudType
from dbnd._core.errors import DatabandRuntimeError
from dbnd._core.utils.timezone import utcnow
from targets.types import Path
logger = logging.getLogger(__name__)
... | 0 | 0 | 0 | 0 | 0 | 0 |
ch12-ann/mlp.py | GaoX2015/intro_ds | 314 | 3202123 | # -*- coding: UTF-8 -*-
"""
此脚本用于展示如何利用tensorflow来实现MLP
"""
import numpy as np
import tensorflow as tf
class ANN(object):
def __init__(self, size, logPath):
"""
创建一个神经网络
"""
# 重置tensorflow的graph,确保神经网络可多次运行
tf.reset_default_graph()
tf.set_random_seed(1908)
... | 3 | 4 | 0 | 0 | 7 | 0 |
cea/datamanagement/data_migrator.py | architecture-building-systems/cea-toolbox | 121 | 3202141 | """
This script checks a scenario for v2.29.0 format and migrates the input tables it to the v2.31.1 format.
NOTE: You'll still need to run the archetypes-mapper after this script has run.
"""
import os
import cea
import pandas as pd
import collections
import cea.config
import cea.inputlocator
from cea.utilities... | 0 | 10 | 0 | 0 | 10 | 0 |
losses/correspondence_loss.py | RerRayne/learn3d | 335 | 3202144 | <gh_stars>100-1000
import torch
class CorrespondenceLoss(torch.nn.Module):
def forward(self, template, source, corr_mat_pred, corr_mat):
# corr_mat: batch_size x num_template x num_source (ground truth correspondence matrix)
# corr_mat_pred: batch_size x num_source x num_template (predicted correspondence matri... | 0 | 0 | 0 | 0 | 0 | 0 |
Stephanie/TextProcessor/text_processor.py | JeremyARussell/stephanie-va | 866 | 3202148 | <filename>Stephanie/TextProcessor/text_processor.py
from Stephanie.TextProcessor.text_sorter import TextSorter
from Stephanie.TextProcessor.text_learner import TextLearner
from Stephanie.TextProcessor.module_router import ModuleRouter
from Stephanie.configurer import config
class TextProcessor:
def __init__(self,... | 0 | 0 | 0 | 0 | 0 | 0 |
rls/algorithms/multi/maddpg.py | StepNeverStop/RLs | 371 | 3202149 | #!/usr/bin/env python3
# encoding: utf-8
from collections import defaultdict
from typing import Dict
import torch as th
import torch.distributions as td
import torch.nn.functional as F
from rls.algorithms.base.marl_off_policy import MultiAgentOffPolicy
from rls.common.data import Data
from rls.common.dec... | 8 | 2 | 1 | 0 | 11 | 0 |
ztag/transforms/upnp.py | justinbastress/ztag | 107 | 3202207 | <reponame>justinbastress/ztag
from ztag.transform import ZMapTransform, ZMapTransformOutput, Transformable
from ztag import protocols, errors
class UPnPTransform(ZMapTransform):
name = "UPnP/generic"
port = None
protocol = protocols.UPNP
subprotocol = protocols.UPNP.DISCOVERY
KEYS = [
"... | 0 | 0 | 0 | 0 | 0 | 0 |
core/feed_managers.py | vlafranca/stream_framework_example | 102 | 3202237 | <reponame>vlafranca/stream_framework_example
from stream_framework.feed_managers.base import Manager
from stream_framework.feed_managers.base import FanoutPriority
from core.models import Follow
from core.pin_feed import AggregatedPinFeed, PinFeed, \
UserPinFeed
class PinManager(Manager):
# this example has b... | 0 | 0 | 0 | 0 | 0 | 0 |
testData/mock/pydanticv1/dataclasses.py | alek-sun/pydantic-pycharm-plugin | 238 | 3202264 | def dataclass():
pass | 0 | 0 | 0 | 0 | 0 | 0 |
nuplan/common/utils/test/test_helpers.py | motional/nuplan-devkit | 128 | 3202286 | import unittest
from typing import Any, Dict, List
from unittest.mock import Mock, call, patch
from nuplan.common.utils.helpers import keep_trying, try_n_times
class HelperTestingSetup:
"""Helper configuration class for testing"""
def __init__(self) -> None:
"""Initializes with mock values"""
... | 1 | 9 | 0 | 3 | 13 | 0 |
research/multi_representation_adversary/multi_representation_adversary/trainer.py | srihari-humbarwadi/neural-structured-learning | 939 | 3202311 | <filename>research/multi_representation_adversary/multi_representation_adversary/trainer.py
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apa... | 0 | 0 | 0 | 0 | 0 | 0 |
io/send-to-ftp-bytesio-text-or-html.py | whitmans-max/python-examples | 140 | 3202415 | <reponame>whitmans-max/python-examples
#!/usr/bin/env python3
# date: 2019.10.30
# https://stackoverflow.com/questions/58628006/how-to-upload-data-from-memory-via-ftp-in-python-3
from ftplib import FTP
import io
text = '<head><title>Example</title></head><body>Hello World!</body></html>'
bio = io.BytesIO()
bio.writ... | 0 | 0 | 0 | 0 | 0 | 0 |
hpccm/__init__.py | robertmaynard/hpc-container-maker | 340 | 3202422 | # Copyright (c) 2018, NVIDIA 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unittests/http_functions/remapped_context/main.py | gohar94/azure-functions-python-worker | 277 | 3202443 | <gh_stars>100-1000
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
def main(context):
return context.method
| 0 | 0 | 0 | 0 | 0 | 0 |
src/core/layers/common.py | yuanqidu/IDGL | 153 | 3202449 | <reponame>yuanqidu/IDGL
'''
Created on Nov, 2018
@author: hugo
'''
from typing import List
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
import torch.nn.functional as F
from ..utils.generic_utils import to_cuda
from ..utils.constants import VERY_SMALL_NUM... | 0 | 0 | 0 | 0 | 0 | 0 |
src/visions/backends/numpy/types/string.py | bhumikapahariapuresoftware/visions | 142 | 3202460 | from __future__ import annotations
import numpy as np
from visions.backends.numpy.array_utils import array_handle_nulls, array_not_empty
from visions.types.string import String
@array_handle_nulls
def _is_string(array: np.ndarray, state: dict) -> bool | object:
if not all(isinstance(v, str) for v in array[0:5]):... | 4 | 2 | 0 | 0 | 6 | 0 |
py_cui/statusbar.py | VivumLab/py_cui | 654 | 3202477 | <reponame>VivumLab/py_cui
"""File containing class for the status bar
TODO: File can probably be abstracted away - probably doesn't need a class
"""
# Author: <NAME>
# Created: 12-Aug-2019
import py_cui
class StatusBar:
"""Very simple class representing a status bar
Attributes
----------
text :... | 0 | 0 | 0 | 0 | 0 | 0 |
h2o-py/tests/testdir_munging/slice/pyunit_concat.py | ahmedengu/h2o-3 | 6,098 | 3202480 | import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
def concat():
df1 = h2o.create_frame(integer_fraction=1,binary_fraction=0,categorical_fraction=0,seed=1)
df2 = h2o.create_frame(integer_fraction=1,binary_fraction=0,categorical_fraction=0,seed=2)
df3 = h2o.create_frame(inte... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/relative-import.test/foo/bar.py | nanolikeyou/pysonar2 | 2,574 | 3202492 | <reponame>nanolikeyou/pysonar2<filename>tests/relative-import.test/foo/bar.py
def f(x):
return 0
| 0 | 0 | 0 | 0 | 0 | 0 |
questions/53964703/navigation/python/create_db.py | sesu089/stackoverflow | 302 | 3202498 | def create_connection(db_file):
try:
connection = sqlite3.connection(db_file)
return connection
except Error as database_error_connection:
print (database_error_connection)
return None
def create_coordinates_table(connection, create_table_sql):
try:
c = connect... | 0 | 0 | 0 | 0 | 0 | 0 |
pynubank/utils/discovery.py | danizord/pynubank | 744 | 3202508 | from pynubank.exception import NuException
from pynubank.utils.http import HttpClient
DISCOVERY_URL = 'https://prod-s0-webapp-proxy.nubank.com.br/api/discovery'
DISCOVERY_APP_URL = 'https://prod-s0-webapp-proxy.nubank.com.br/api/app/discovery'
class Discovery:
def __init__(self, client: HttpClient):
self... | 5 | 3 | 0 | 2 | 10 | 0 |
src/ad/azext_ad/generated/_help.py | Mannan2812/azure-cli-extensions | 207 | 3202531 | <filename>src/ad/azext_ad/generated/_help.py
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoR... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/pyright-internal/src/tests/samples/super9.py | Microsoft/pyright | 3,934 | 3202569 | <reponame>Microsoft/pyright
# This sample tests the case where a super() call is used with a class
# whose constructor uses a default argument value with a parameter
# whose type is a specialized TypeVar.
from typing import Generic, TypeVar
_T = TypeVar("_T")
class Foo(Generic[_T]):
def __init__(self, x: _T = 1... | 0 | 0 | 0 | 0 | 0 | 0 |
app/unit_test_file_manager.py | nthparameter/ci_edit | 229 | 3202609 | # -*- coding: utf-8 -*-
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 0 | 0 | 0 | 0 | 0 | 0 |
reagent/test/prediction/test_prediction_utils.py | dmitryvinn/ReAgent | 1,156 | 3202618 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import torch
from reagent.preprocessing.identify_types import CONTINUOUS, CONTINUOUS_ACTION
from reagent.preprocessing.normalization import NormalizationParameters
def _cont_norm() -> object:
return NormalizationParame... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/test_chunk.py | adebarbara/lastpass-python | 159 | 3202645 | # coding: utf-8
import unittest
from lastpass.chunk import Chunk
class ChunkTestCase(unittest.TestCase):
def setUp(self):
self.id = 'IDID'
self.payload = 'Payload'
self.chunk = Chunk(self.id, self.payload)
def test_id_returns_the_correct_value(self):
self.assertEqual(self.chu... | 0 | 0 | 0 | 0 | 0 | 0 |
toollib/tcli/commands/_set_sshkey.py | atpuxiner/toollib | 113 | 3202652 | """
@author axiner
@version v1.0.0
@created 2022/5/4 9:17
@abstract
@description
@history
"""
import re
import sys
from pathlib import Path
from toollib import utils, regexp
from toollib.decorator import sys_required
from toollib.tcli import here
from toollib.tcli.base import BaseCmd
from toollib.tcli.option import Op... | 0 | 2 | 0 | 0 | 2 | 0 |
third_party/gsutil/third_party/crcmod/python3/crcmod/_crcfunpy.py | tingshao/catapult | 2,151 | 3202653 | <reponame>tingshao/catapult
#-----------------------------------------------------------------------------
# Low level CRC functions for use by crcmod. This version is implemented in
# Python for a couple of reasons. 1) Provide a reference implememtation.
# 2) Provide a version that can be used on systems where a C c... | 0 | 0 | 0 | 0 | 0 | 0 |
geocoder/uscensus_reverse.py | termim/geocoder | 1,506 | 3202688 | <filename>geocoder/uscensus_reverse.py
#!/usr/bin/python
# coding: utf8
from __future__ import absolute_import
import logging
from geocoder.location import Location
from geocoder.base import OneResult
from geocoder.uscensus import USCensusQuery
class USCensusReverseResult(OneResult):
@property
def ok(self)... | 0 | 0 | 0 | 0 | 0 | 0 |
Dataset_Reader/readCaltech101.py | shekkizh/TensorflowProjects | 204 | 3202720 | <gh_stars>100-1000
__author__ = 'charlie'
# Incomplete
import numpy as np
import os, sys, inspect
from six.moves import cPickle as pickle
utils_path = os.path.abspath(
os.path.realpath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], "..")))
if utils_path not in sys.path:
sys.path.insert... | 0 | 0 | 0 | 0 | 0 | 0 |
src/sco/code_gen/generate_fwd_header.py | HARPLab/trajopt | 250 | 3202745 | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("headers", nargs="*")
parser.add_argument("--out")
parser.add_argument("--ns", nargs="*")
args = parser.parse_args()
assert args.out is not None
import os.path as osp
import source_analysis
source_analysis.make_fwd_header(args.headers, args.out, ... | 0 | 0 | 0 | 0 | 0 | 0 |
pwnypack/shellcode/ops.py | iksteen/dpf | 133 | 3202762 | __all__ = ['LoadRegister']
class LoadRegister(object):
def __init__(self, register, value):
self.register = register
self.value = value
def __repr__(self) -> object:
return 'LoadRegister(%r, %r)' % (self.register, self.value)
class SyscallInvoke(object):
def __init__(self, sysca... | 0 | 2 | 0 | 0 | 2 | 0 |
tests/test_localdoc.py | weijia/couchapp | 224 | 3202781 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import json
import os
from shutil import rmtree
from tempfile import mkdtemp
from couchapp.localdoc import LocalDoc
def test_load_ignores_non_exist():
doc = LocalDoc('/mock/app', create=False)
assert doc.ignores == []
class testIgnores(object):
def setUp(sel... | 0 | 0 | 0 | 0 | 0 | 0 |
advanced_filters/tests/conftest.py | cagerber/django-advanced-filters | 572 | 3202792 | <filename>advanced_filters/tests/conftest.py
import pytest
from tests.factories import SalesRepFactory
@pytest.fixture
def user(db):
return SalesRepFactory()
@pytest.fixture()
def client(client, user):
client.force_login(user)
return client
| 0 | 0 | 0 | 0 | 0 | 0 |
content/test/data/accessibility/PRESUBMIT_test.py | zealoussnow/chromium | 14,668 | 3202809 | #!/usr/bin/env python
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import unittest
import PRESUBMIT
sys.path.append(
os.path.join(os.path.dirname(os.path.abspath(__file__)), '... | 0 | 0 | 0 | 0 | 0 | 0 |
net/vqvae.py | jawadMansoor/Diverse-Structure-uncropping-VQVAE | 139 | 3202811 | from __future__ import annotations
import numpy as np
import tensorflow as tf
from tensorflow.contrib.framework.python.ops import arg_scope
import net.nn as nn
def vq_encoder_spec(x, ema: object | None=None, nr_channel: int=128, nr_res_block: int=2, nr_res_channel: int=64, embedding_dim: int=64,
n... | 14 | 2 | 0 | 0 | 16 | 0 |
src/solving_objects/SudokuVideo.py | shubhk97/sudoku-solver | 615 | 3202814 | import numpy as np
from settings import same_grid_dist_ratio
class SudokuVideo:
def __init__(self, grid):
self.grid_raw = grid
self.grid = np.zeros((9, 9), dtype=int)
self.init_grid(grid)
self.grid_solved = np.zeros((9, 9), dtype=int)
self.isConfident: bool = False
... | 0 | 5 | 0 | 10 | 15 | 0 |
src/run_binary_depth_estimation.py | sunshuofeng/Bi3D | 145 | 3202822 | <reponame>sunshuofeng/Bi3D
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distributi... | 0 | 0 | 0 | 0 | 0 | 0 |
pihat.py | jamesbowman/cuflow | 159 | 3202866 | import cuflow as cu
import dip
import sot
__VERSION__ = "1.0.0"
"""
RPi dimensions:
https://www.raspberrypi.org/documentation/hardware/raspberrypi/mechanical/rpi_MECH_4b_4p0.pdf
| GPIO | pin | color | function |
| ---- | --- | ------ | ------------------- |
| 14 | 8 | yellow | C2C: RESET |... | 1 | 0 | 0 | 0 | 1 | 0 |
deepinsight/util/__init__.py | SynapticSage/DeepInsight | 157 | 3202890 | <reponame>SynapticSage/DeepInsight
from . import hdf5
from . import tetrode
from . import stats
from . import custom_losses
from . import wavelet_transform
from . import opts
from . import data_generator
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/show_matplotlib.py | weurus/PythonPyrealsense | 128 | 3202893 | <gh_stars>100-1000
import logging
logging.basicConfig(level=logging.INFO)
import matplotlib.pyplot as plt
import pyrealsense as pyrs
with pyrs.Service() as serv:
with serv.Device() as dev:
dev.wait_for_frames()
plt.imshow(dev.color) # rgb by default
plt.show()
| 0 | 0 | 0 | 0 | 0 | 0 |
galileo/framework/tf/python/estimator_trainer.py | YaoPu2021/galileo | 115 | 3202936 | <filename>galileo/framework/tf/python/estimator_trainer.py
# 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://w... | 0 | 0 | 0 | 0 | 0 | 0 |
samcli/commands/logs/puller_factory.py | praneetap/aws-sam-cli | 2,285 | 3202977 | """
File keeps Factory method to prepare required puller information
with its producers and consumers
"""
import logging
from typing import List, Optional
from botocore.exceptions import ClientError
from samcli.commands.exceptions import UserException
from samcli.commands.logs.console_consumers import CWConsoleEventC... | 10 | 4 | 1 | 0 | 15 | 0 |
bookwyrm/status.py | mouse-reeve/fedireads | 270 | 3202998 | from __future__ import annotations
""" Handle user activity """
from django.db import transaction
from bookwyrm import models
from bookwyrm.sanitize_html import InputHtmlParser
def create_generated_note(user, content, mention_books: object | None=None, privacy: str="public") -> object:
"""a note created by the a... | 2 | 1 | 0 | 0 | 3 | 0 |
queue/library/queue.py | x899/algorithms | 472 | 3203001 | """ Implementation for Queue Data Structure """
class Queue:
""" Queue is a collection of entities that are maintained in a sequence
and can be modified by the addition of entities at one end of the
sequence and removal from the other end of the sequence.
The order in which elements come off of a queu... | 0 | 4 | 0 | 1 | 5 | 0 |
manul_network.py | DigitalAlchemist/fuzzwatch | 326 | 3203038 | <gh_stars>100-1000
# Manul - network file
# -------------------------------------
# <NAME> <<EMAIL>> <<EMAIL>>
#
# Copyright 2019 Salesforce.com, 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.
#... | 0 | 0 | 0 | 0 | 0 | 0 |
py/src/ai/h2o/sparkling/ml/params/HasInitialWeights.py | krmartin/sparkling-water | 990 | 3203091 | #
# 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 us... | 0 | 2 | 0 | 0 | 2 | 0 |
tests/python/config_path.py | noob20000405/casbin-cpp | 178 | 3203110 | <reponame>noob20000405/casbin-cpp<gh_stars>100-1000
# Copyright 2021 The casbin 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... | 0 | 0 | 0 | 0 | 0 | 0 |
data/collate_fns/__init__.py | apple/ml-cvnets | 209 | 3203131 | <gh_stars>100-1000
#
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
import os
import importlib
import argparse
COLLATE_FN_REGISTRY = {}
def register_collate_fn(name):
def register_collate_fn_method(f):
if name in COLLATE_FN_REGISTRY:
rai... | 0 | 0 | 0 | 0 | 0 | 0 |
Codes/gracekoo/76_minimum-window-substring.py | liuxiaohui1221/algorithm | 256 | 3203137 | # -*- coding: utf-8 -*-
# @Time: 2020/3/21 22:48
# @Author: GraceKoo
# @File: 76_minimum-window-substring.py
# @Desc:https://leetcode-cn.com/problems/minimum-window-substring
from collections import Counter
from collections import defaultdict
class Solution:
def minWindow(self, s: str, t: str) -> str:
lef... | 2 | 2 | 0 | 0 | 4 | 0 |
translator_data/merge.py | ttslr/gtos | 172 | 3203149 | <gh_stars>100-1000
def merge_files(dep_file, head_file, tok_file, tgt_file, out_file):
drop = 0
dep = open(dep_file).readlines()
head = open(head_file).readlines()
tok = open(tok_file).readlines()
tgt = open(tgt_file).readlines()
assert len(dep) == len(head) == len(tok) == len(tgt), (len(dep), l... | 0 | 0 | 0 | 0 | 0 | 0 |
CTFd/plugins/ctfd_glowworm/docker_utils.py | Threezh1/H1ve | 501 | 3203171 | <reponame>Threezh1/H1ve
import os, uuid, subprocess, logging, time, re
from .db_utils import DBUtils
from CTFd import utils
from .models import ADAChallenge, GlowwormContainers, GlowwormCheckLog, GlowwormAttacks
from .extensions import get_round
from CTFd.utils.logging import log
from CTFd.models import db, Users, Team... | 0 | 0 | 0 | 0 | 0 | 0 |
bcs-ui/backend/tests/resources/namespace/test_utils.py | laodiu/bk-bcs | 599 | 3203216 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 TH<NAME>, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in complianc... | 0 | 0 | 0 | 0 | 0 | 0 |
hubspot/automation/actions/api/functions_api.py | Ronfer/hubspot-api-python | 117 | 3203229 | # coding: utf-8
from __future__ import annotations
"""
Custom Workflow Actions
Create custom workflow actions # noqa: E501
The version of the OpenAPI document: v4
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python... | 1 | 14 | 0 | 0 | 15 | 0 |
osf/migrations/0043_set_share_title.py | gaybro8777/osf.io | 628 | 3203246 | <filename>osf/migrations/0043_set_share_title.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-08-03 15:07
"""Sets the share_title field on production PreprintProviders. Makes no
updates if the listed providers don't exist in the current envirionment.
"""
from __future__ import unicode_... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/bin/pythonSrc/pychecker-0.8.18/test_input/test98.py | YangHao666666/hawq | 450 | 3203256 | # -*- encoding: latin-1 -*-
__doc__ = 'return value from init reports proper file names'
from import98 import BaseGood, BaseBad
class GoodGood(BaseGood):
'doc'
def __init__(self):
BaseGood.__init__(self)
class GoodBad(BaseGood):
'doc'
def __init__(self) -> object:
return BaseGood.__i... | 0 | 2 | 0 | 0 | 2 | 0 |
docs/tutorials/depth/test_monodepth2_posenet.py | Kh4L/gluon-cv | 5,447 | 3203257 | """04. Testing PoseNet from image sequences with pre-trained Monodepth2 Pose models
===========================================================================
This is a quick demo of using the GluonCV Monodepth2 model for KITTI on real-world images.
Please follow the `installation guide <../../index.html#installation... | 0 | 0 | 0 | 0 | 0 | 0 |
NLP/EMNLP2019-MAL/src/reader.py | pkulzb/Research | 1,319 | 3203259 | <reponame>pkulzb/Research<filename>NLP/EMNLP2019-MAL/src/reader.py
# Copyright (c) 2019 PaddlePaddle 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
#
# ht... | 0 | 0 | 0 | 0 | 0 | 0 |
gryphon/dashboards/util/store_calculations.py | qiquanzhijia/gryphon | 1,109 | 3203346 | import cdecimal
import functools
import simplejson as json
from cdecimal import Decimal
from delorean import Delorean
from gryphon.lib import gryphon_json_serialize
from gryphon.lib.logger import get_logger
from gryphon.lib.session import get_a_redis_connection
logger = get_logger(__name__)
"""
A decorator which ... | 0 | 4 | 0 | 0 | 4 | 0 |
tests/roots/test-ext-autodoc/target/overload2.py | samdoran/sphinx | 4,973 | 3203367 | from target.overload import Bar
class Baz(Bar):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
pqkmeans/evaluation.py | Hi-king/pqkmeans | 224 | 3203388 | <filename>pqkmeans/evaluation.py<gh_stars>100-1000
import collections
import numpy
import os
import six.moves.urllib
import tarfile
import texmex_python
def get_gmm_random_dataset(k, dimension=100, test_size=5000, train_size=500):
def random_gmm(k, n_sample):
result = numpy.zeros((n_sample, dimension))
... | 0 | 0 | 0 | 0 | 0 | 0 |
merged_depth/nets/SGDepth/dataloader/pt_data_loader/dataset_parameterset.py | mmurray/merged_depth | 150 | 3203389 | # MIT License
#
# Copyright (c) 2020 <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, merge, publi... | 0 | 6 | 0 | 3 | 9 | 0 |
dlt/__init__.py | dmarnerides/pydlt | 236 | 3203390 | <filename>dlt/__init__.py
from . import config
from . import util
from . import viz
from . import train
from . import hdr
from .version import __version__
def _make_log():
import sys
import logging
logger = logging.getLogger('dlt')
logger.setLevel(logging.INFO)
logger.propagate = False
sh = log... | 0 | 0 | 0 | 0 | 0 | 0 |
landlab/graph/voronoi/voronoi.py | amanaster2/landlab | 257 | 3203422 | from __future__ import annotations
import numpy as np
from ..graph import Graph
from .voronoi_to_graph import VoronoiDelaunayToGraph
class DelaunayGraph(Graph):
"""Graph of a voronoi grid.
Examples
--------
>>> from landlab.graph import DelaunayGraph
"""
def __init__(
self, node_y_... | 3 | 0 | 0 | 0 | 3 | 0 |
protobuf/internal/github_archive.bzl | bowlofstew/rules_protobuf | 252 | 3203441 | <gh_stars>100-1000
def github_archive(name, org, repo, commit, **kwargs):
url = "https://github.com/{org}/{repo}/archive/{commit}.zip".format(
org = org,
repo = repo,
commit = commit,
)
strip_prefix = "{repo}-{commit}".format(
repo = repo,
commit = commit,
)
i... | 0 | 0 | 0 | 0 | 0 | 0 |
alibi_detect/cd/fet_online.py | sugatoray/alibi-detect | 1,227 | 3203460 | <filename>alibi_detect/cd/fet_online.py
from tqdm import tqdm
import numpy as np
from typing import Any, Callable, List, Optional, Union
from alibi_detect.cd.base_online import BaseUniDriftOnline
from alibi_detect.utils.misc import quantile
from scipy.stats import hypergeom
import numba as nb
import warnings
class FE... | 0 | 0 | 0 | 0 | 0 | 0 |
on-box-python/event-scripts/check_syslog_severity.py | rsmekala/junosautomation | 117 | 3203471 | #!/usr/bin/env python
#
# Copyright (c) 1999-2018, Juniper Networks Inc.
#
# All rights reserved.
#
# Script to log syslog severity for an triggered event of a configured event policy
# Sample configuration:
# $# show event-options
# policy SYSLOG_SEVERITY {
# events SYSLOG_SEVERITY_EVENT;
# then {... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/_test_helpers.py | Rui-Ren/ort | 181 | 3203476 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
import torch
def assert_values_are_close(input, other, rtol: float=1e-... | 2 | 0 | 0 | 0 | 2 | 0 |
data_utils/intent_scripts/get_banking_data.py | wise-east/dialoglue | 205 | 3203535 | <reponame>wise-east/dialoglue
"""Gets banking data from:
https://github.com/PolyAI-LDN/task-specific-datasets/tree/master/banking_data
Dataset paper: https://arxiv.org/abs/2003.04807
Copyright PolyAI Limited.
"""
import argparse
import os
import requests
_GITHUB_URL_BASE = ("https://raw.githubusercontent.com/Poly... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/examples/global-bootstrap.py | yrtf/QuantLib-SWIG | 231 | 3203603 | # ---
# jupyter:
# jupytext:
# formats: py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
# # Global ... | 0 | 0 | 0 | 0 | 0 | 0 |
mindsdb/integrations/kafka/kafkadb.py | mindsdb/main | 261 | 3203606 | import json
from copy import deepcopy
import kafka
from mindsdb.integrations.base import StreamIntegration
import mindsdb.interfaces.storage.db as db
from mindsdb_streams import KafkaStream, StreamController, StreamLearningController
class KafkaConnectionChecker:
def __init__(self, **params):
self.conne... | 1 | 2 | 0 | 0 | 3 | 0 |
cvxportfolio/utils.py | Andreas237/cvxportfolio | 472 | 3203625 | <gh_stars>100-1000
"""
Copyright 2017 <NAME>, <NAME>, <NAME>, BlackRock 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 appli... | 0 | 0 | 0 | 0 | 0 | 0 |
qt__pyqt__pyside__pyqode/pyqt5__QFileSystemModel__append_selected_files_and_dirs.py | gil9red/SimplePyScripts | 117 | 3203636 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from PyQt5.QtWidgets import (
QWidget, QFileSystemModel, QTreeView, QListWidget, QPushButton, QSplitter,
QVBoxLayout, QApplication
)
from PyQt5.QtCore import QDir, Qt
class Widget(QWidget):
def __init__(self):
super().__init... | 0 | 0 | 0 | 0 | 0 | 0 |
icevision/models/ross/efficientdet/lightning/__init__.py | ai-fast-track/mantisshrimp | 580 | 3203673 | from icevision.models.ross.efficientdet.lightning.model_adapter import *
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/pytorch/semantic_parsing/graph2seq/args.py | cminusQAQ/graph4nlp | 1,269 | 3203683 | import argparse
from graph4nlp.pytorch.modules.config import get_basic_args
from graph4nlp.pytorch.modules.utils.config_utils import get_yaml_config, update_values
def get_args() -> object:
parser = argparse.ArgumentParser()
parser.add_argument(
"--dataset_yaml",
type=str,
default="ex... | 0 | 1 | 0 | 0 | 1 | 0 |
modules/data.remote/inst/RpTools/RpTools/process_remote_data.py | CFranc22/pecan | 151 | 3203746 | <filename>modules/data.remote/inst/RpTools/RpTools/process_remote_data.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
process_remote_data controls functions which perform further computation on the data.
Requires Python3
Author: <NAME>
"""
from RpTools.merge_files import nc_merge
from importlib import import_mo... | 0 | 0 | 0 | 0 | 0 | 0 |
igibson/test/test_vr_renderer_ohoopee.py | suresh-guttikonda/iGibson | 360 | 3203756 | <gh_stars>100-1000
import time
from igibson import dataset_path
from igibson.core.render.mesh_renderer.mesh_renderer_cpu import MeshRenderer
from igibson.core.render.mesh_renderer.mesh_renderer_vr import MeshRendererVR
renderer = MeshRendererVR(MeshRenderer, msaa=True)
# Note that it is necessary to load the full pat... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_meta.py | jGaboardi/Fiona | 778 | 3203760 | <filename>tests/test_meta.py
import pytest
import fiona
import fiona.drvsupport
import fiona.meta
from fiona.drvsupport import supported_drivers
from fiona.errors import FionaValueError
from .conftest import requires_gdal2, requires_gdal23, requires_gdal31
from six import string_types
@requires_gdal31
@pytest.mark.pa... | 0 | 0 | 0 | 0 | 0 | 0 |
src/billing/models.py | damansinghh/digital-marketplace | 104 | 3203767 | <reponame>damansinghh/digital-marketplace
from django.conf import settings
from django.db import models
# Create your models here.
from products.models import Product
class Transaction(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL)
product = models.ForeignKey(Product)
price = models.DecimalFiel... | 0 | 0 | 0 | 0 | 0 | 0 |
extras/gltraces/example.py | asnt/moderngl | 916 | 3203788 | import moderngl.experimental as mgl
import gltraces
ctx = mgl.create_context(standalone=True, debug=True)
mglprocs = mgl.glprocs(ctx)
gltraces.glprocs[:] = mglprocs
mglprocs[:] = gltraces.gltraces
prog = ctx.program(
vertex_shader='''
#version 130
in vec2 in_vert;
out vec2 v_vert;
... | 0 | 0 | 0 | 0 | 0 | 0 |
source/common/client_mq.py | playboy8/starquant | 322 | 3203803 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from threading import Thread
from nanomsg import Socket, SUB, PUSH, SUB_SUBSCRIBE, SOL_SOCKET, RCVTIMEO
from datetime import datetime
import os
from .datastruct import Event
class ClientMq(object):
def __init__(self, config, ui_event_engine, outgoing_queue):
... | 1 | 0 | 0 | 1 | 2 | 0 |
odps/tunnel/tests/test_volumetunnel.py | Emersonxuelinux/aliyun-odps-python-sdk | 412 | 3203826 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | 0 | 3 | 0 | 0 | 3 | 0 |
histomicstk/saliency/__init__.py | basanto/HistomicsTK | 249 | 3203834 | <reponame>basanto/HistomicsTK
"""This module contains various tools to detect tissue.
Included functionality includes methods to detect tissue in a whole-slide image
(i.e. segment foreground from white space), as well as specific workflows
that detect artifacts, specific components (eg blood), and
highly-cellular regi... | 0 | 0 | 0 | 0 | 0 | 0 |
pygmt/tests/test_grdproject.py | weiji14/gmt-python | 168 | 3203860 | """
Tests for grdproject.
"""
import os
import pytest
import xarray as xr
from pygmt import grdproject, load_dataarray
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import GMTTempFile
from pygmt.helpers.testing import load_static_earth_relief
@pytest.fixture(scope="module", name="grid")
def fixture... | 0 | 2 | 0 | 0 | 2 | 0 |
src/pyinfrabox/tests/test_testresult.py | agu3rra/InfraBox | 265 | 3203869 | <gh_stars>100-1000
import unittest
from pyinfrabox.testresult import validate_result
from pyinfrabox import ValidationError
class TestDockerCompose(unittest.TestCase):
def raises_expect(self, data, expected):
try:
validate_result(data)
assert False
except ValidationError as... | 0 | 0 | 0 | 0 | 0 | 0 |
release/stubs.min/Tekla/Structures/ModelInternal_parts/Operation.py | htlcnn/ironpython-stubs | 182 | 3203887 | class Operation(object):
# no doc
@staticmethod
def AddToPourUnit(inputPour,objectsToBeAdded):
""" AddToPourUnit(inputPour: PourObject,objectsToBeAdded: List[ModelObject]) -> bool """
pass
@staticmethod
def CreateBasePoint(basePoint):
""" CreateBasePoint(basePoint: BasePoint) -> bool """
pass
@s... | 0 | 0 | 12 | 0 | 12 | 0 |
tests/__init__.py | azadoks/aiida-core | 180 | 3203894 | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
code/exercises/ex_5_10/analyse.py | ElliotMunro200/reinforcement_learning_an_introduction | 234 | 3203963 | <filename>code/exercises/ex_5_10/analyse.py
#!/usr/bin/env python
"""
--------------------------------
project: code
created: 12/06/2018 13:41
---------------------------------
"""
import pickle
import os
from matplotlib import colors, use; use("TkAgg")
import matplotlib.pyplot as plt
import numpy as np
import const... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/feedserver/main.py | zuzhi/rssant | 1,176 | 3203976 | <reponame>zuzhi/rssant<filename>tests/feedserver/main.py<gh_stars>1000+
from flask import Flask, redirect
app = Flask(__name__)
@app.route('/feed/302')
def do_redirect():
target = 'http://blog.guyskk.com/feed.xml'
return redirect(target, 302)
if __name__ == "__main__":
app.run()
| 0 | 0 | 0 | 0 | 0 | 0 |
.flexci/gen_config.py | pfnet/chainerchem | 184 | 3203982 | <reponame>pfnet/chainerchem
"""Config generator for Flex CI
Usage:
$ python gen_config.py > config.pbtxt
"""
from __future__ import print_function
from collections import OrderedDict
import itertools
def test_config(python, chainer, target, chainerx):
if chainerx:
s_chainerx = '.chx'
else:
... | 0 | 0 | 0 | 0 | 0 | 0 |
premium/backend/src/baserow_premium/row_comments/recievers.py | ashishdhngr/baserow | 839 | 3203990 | from django.dispatch import receiver
from baserow.core.trash.signals import permanently_deleted
from baserow_premium.row_comments.models import RowComment
@receiver(permanently_deleted, sender="row", dispatch_uid="row_comment_cleanup")
def permanently_deleted(sender, **kwargs):
table_id = kwargs["parent_id"]
... | 0 | 0 | 0 | 0 | 0 | 0 |
util/metrics_compute.py | segcv/CascadePSP | 606 | 3204020 | import torch.nn.functional as F
from util.util import compute_tensor_iu
def get_new_iou_hook(values, size) -> tuple[object, object]:
return 'iou/new_iou_%s'%size, values['iou/new_i_%s'%size]/values['iou/new_u_%s'%size]
def get_orig_iou_hook(values) -> tuple[str, object]:
return 'iou/orig_iou', values['iou/or... | 3 | 4 | 0 | 0 | 7 | 0 |
test/run/t94.py | timmartin/skulpt | 2,671 | 3204036 | <reponame>timmartin/skulpt
x = 'OK'
print x[0]
| 0 | 0 | 0 | 0 | 0 | 0 |
fabric_bolt/core/__init__.py | naphthalene/fabric-bolt | 219 | 3204053 | # Sept. 27, 2013
| 0 | 0 | 0 | 0 | 0 | 0 |
retro/cores/gba/src/platform/python/cinema/__init__.py | MatPoliquin/retro | 2,706 | 3204183 | <filename>retro/cores/gba/src/platform/python/cinema/__init__.py
from PIL.ImageChops import difference
from PIL.ImageOps import autocontrast
from PIL.Image import open as PIOpen
class VideoFrame(object):
def __init__(self, pilImage):
self.image = pilImage.convert('RGB')
@staticmethod
def diff(a, b... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/echo/tests.py | PyCN/pulsar | 1,410 | 3204199 | <gh_stars>1000+
import unittest
from asyncio import gather, get_event_loop
from pulsar.api import send, get_application
from pulsar.apps.test import run_test_server
from examples.echo.manage import server, Echo, EchoServerProtocol
class TestEchoServer(unittest.TestCase):
concurrency = 'process'
app_cfg = No... | 0 | 0 | 0 | 0 | 0 | 0 |
lldb/test/API/lang/cpp/bitfields/TestCppBitfields.py | mkinsner/llvm | 605 | 3204238 | <reponame>mkinsner/llvm
"""Show bitfields and check that they display correctly."""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class CppBitfieldsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@no_debug_info_tes... | 0 | 0 | 0 | 0 | 0 | 0 |
homeassistant/components/fjaraskupan/const.py | MrDelik/core | 30,023 | 3204255 | """Constants for the Fjäråskupan integration."""
DOMAIN = "fjaraskupan"
DISPATCH_DETECTION = f"{DOMAIN}.detection"
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/checks/test_pattern_constraint.py | jdaviscooke/goodtables-py | 243 | 3204259 | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from goodtables.checks.pattern_constraint import pattern_constraint
# Check
def test_check_pattern_constraint(log):
cells = []
errors =... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.