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 |
|---|---|---|---|---|---|---|---|---|---|---|
examples/dynamic_plug_names.py | osynge/flowpipe | 139 | 1618761 | <filename>examples/dynamic_plug_names.py
"""Showing a programming pattern that defines plug names at runtime.
In some applications it will be useful to re-use the same node definition for
different inputs/output - our working example will be to compute a face match.
To do so, we use an `EmbeddingNode` to compute featu... | 0 | 0 | 0 | 0 | 0 | 0 |
Hello World Programs/Python/hello_world_program.py | TeacherManoj0131/HacktoberFest2020-Contributions | 256 | 1618786 | <reponame>TeacherManoj0131/HacktoberFest2020-Contributions
# Simple program that personally greets user by name
def hello_world():
user = input('Hi, what is your name?: ')
print(f'Hello {user}. Greetings from the United States =]')
hello_world()
| 0 | 0 | 0 | 0 | 0 | 0 |
dfirtrack_config/tests/system/test_system_importer_file_csv_config_form_csv_vs_db.py | thomas-kropeit/dfirtrack | 273 | 1618869 | from django.contrib.auth.models import User
from django.test import TestCase
from dfirtrack_config.forms import SystemImporterFileCsvConfigForm
from dfirtrack_main.models import (
Analysisstatus,
Case,
Company,
Dnsname,
Domain,
Location,
Os,
Reason,
Recommendation,
Serviceprovid... | 0 | 0 | 0 | 0 | 0 | 0 |
dataset/preprocessing-scripts/to_lmdb.py | mitra052/ViewAL | 126 | 1618941 | import pickle
import lmdb
import os
import glob
from PIL import Image
from pathlib import Path
from tqdm import tqdm
import numpy as np
from scipy import ndimage
def to_lmdb(root_path, lmdb_path):
image_paths = [x.split(".")[0] for x in os.listdir(os.path.join(root_path, "color"))]
print('#images: ', len(ima... | 0 | 0 | 0 | 0 | 0 | 0 |
genrl/agents/bandits/contextual/fixed.py | mehulrastogi/genrl | 390 | 1618949 | <reponame>mehulrastogi/genrl<gh_stars>100-1000
from typing import List
import numpy as np
import torch
from genrl.agents.bandits.contextual.base import DCBAgent
from genrl.utils.data_bandits.base import DataBasedBandit
class FixedAgent(DCBAgent):
def __init__(
self, bandit: DataBasedBandit, p: List[floa... | 0 | 0 | 0 | 0 | 0 | 0 |
ocr/utils/encoder_decoder.py | vee51/Hand | 435 | 1618963 | <gh_stars>100-1000
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Encoder and decoder usded in sequence-to-sequence learning."""
__all__ = ['TransformerEncoder', 'TransformerDecoder',
'get_transformer_encoder_decoder']
from functools impor... | 0 | 0 | 0 | 0 | 0 | 0 |
omniduct/utils/dependencies.py | gridgentoo/omniduct | 235 | 1618978 | from __future__ import annotations
import importlib
import re
import pkg_resources
from pkg_resources import VersionConflict
from omniduct._version import __optional_dependencies__
from omniduct.utils.debug import logger
def check_dependencies(protocols, message: object | None=None) -> None:
if protocols is Non... | 1 | 1 | 0 | 0 | 2 | 0 |
www/src/Lib/site-packages/simpleaio/http.py | raspberrypieman/brython | 5,926 | 1618979 | from __future__ import annotations
try:
from browser import timer
except:
class ajax:
pass
from . import futures
class HTTPException(Exception):
"""
A class representing a HTTPRequest error
"""
def __init__(self, request):
super(HTTPException, self).__init__()
self.... | 2 | 0 | 2 | 0 | 4 | 0 |
examples/kvstorage_http.py | kaxap/PySyncObj | 602 | 1618990 | <reponame>kaxap/PySyncObj
#!/usr/bin/env python
from __future__ import print_function
import sys
try:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
except ImportError:
from http.server import BaseHTTPRequestHandler, HTTPServer
sys.path.append("../")
from pysyncobj import SyncObj, SyncObjConf, r... | 0 | 0 | 0 | 0 | 0 | 0 |
py/ztools/mtp/mtpxci_gen.py | HerrTrigger/NSC_BUILDER | 828 | 1619008 | from __future__ import annotations
import aes128
import Print
import os
import shutil
import json
import listmanager
from Fs import Nsp as squirrelNSP
from Fs import Xci as squirrelXCI
from Fs import factory
from Fs.Nca import NcaHeader
from Fs import Nca
from Fs.File import MemoryFile
from Fs import Ticke... | 14 | 4 | 0 | 0 | 18 | 0 |
azure-kusto-data/azure/kusto/data/aio/client.py | Azure/azure-kusto-python | 134 | 1619041 | import io
from datetime import timedelta
from typing import Union, Optional
from .response import KustoStreamingResponseDataSet
from .._decorators import documented_by, aio_documented_by
from ..aio.streaming_response import StreamingDataSetEnumerator, JsonTokenReader
from ..client import KustoClient as KustoClientSync... | 31 | 8 | 0 | 0 | 39 | 0 |
misc/vgg16.py | YinTaiChen/NeuralBabyTalk | 554 | 1619042 | # --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ import pri... | 1 | 1 | 0 | 0 | 2 | 0 |
classification_training/imagenet/efficientnet_train_example/train_config.py | LANCEREN/simpleAICV-pytorch-ImageNet-COCO-training | 154 | 1619082 | import os
import sys
BASE_DIR = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)))))
sys.path.append(BASE_DIR)
from tools.path import ILSVRC2012_path
from simpleAICV.classification import backbones
from simpleAICV.classification import losses
import torchvision... | 0 | 0 | 21 | 0 | 21 | 0 |
kuwala/common/python_utils/src/spark_udfs.py | bmahmoudyan/kuwala | 381 | 1619087 | <filename>kuwala/common/python_utils/src/spark_udfs.py
import h3
import json
from fuzzywuzzy import fuzz
from pyspark.sql.functions import udf
from pyspark.sql.types import ArrayType, DoubleType, FloatType, IntegerType, StringType, StructField, StructType
from shapely.geometry import shape
DEFAULT_RESOLUTION = 11
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
scvi/external/stereoscope/_model.py | cane11/scvi-tools | 398 | 1619111 | import logging
from typing import Optional, Tuple, Union
import numpy as np
import pandas as pd
import torch
from anndata import AnnData
from scvi import REGISTRY_KEYS
from scvi._compat import Literal
from scvi.data import AnnDataManager
from scvi.data.fields import CategoricalObsField, LayerField, NumericalObsField
... | 28 | 3 | 0 | 0 | 31 | 0 |
mtgjson5/utils.py | staghouse/mtgjson | 512 | 1619118 | <reponame>staghouse/mtgjson<filename>mtgjson5/utils.py
"""
MTGJSON simple utilities
"""
import collections
import hashlib
import inspect
import itertools
import json
import logging
import os
import pathlib
import time
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
import gevent.pool
imp... | 0 | 0 | 0 | 0 | 0 | 0 |
insights/parsers/openshift_configuration.py | mglantz/insights-core | 121 | 1619120 | """
openshift configuration files
=============================
``/etc/origin/node/node-config.yaml`` and
``/etc/origin/master/master-config.yaml`` are configuration files of
openshift Master node and Node node. Their format are both ``yaml``.
OseNodeConfig - file ``/etc/origin/node/node-config.yaml``
---------------... | 0 | 0 | 0 | 0 | 0 | 0 |
multi_script_editor/jedi/api/interpreter.py | paulwinex/pw_multiScriptEditor | 142 | 1619196 | <gh_stars>100-1000
import inspect
import re
from jedi._compatibility import builtins
from jedi import debug
from jedi.common import source_to_unicode
from jedi.cache import underscore_memoization
from jedi.evaluate import compiled
from jedi.evaluate.compiled.fake import get_module
from jedi.parser import representatio... | 0 | 0 | 0 | 0 | 0 | 0 |
bitshares/aio/memo.py | silverchen0402/python-bitshares | 102 | 1619235 | <reponame>silverchen0402/python-bitshares<filename>bitshares/aio/memo.py
# -*- coding: utf-8 -*-
from graphenecommon.aio.memo import Memo as GrapheneMemo
from bitsharesbase.account import PrivateKey, PublicKey
from .account import Account
from .instance import BlockchainInstance
@BlockchainInstance.inject
class Memo... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/ut/lineagemgr/common/validator/test_validate.py | fapbatista/mindinsight | 216 | 1619238 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 0 | 0 | 0 | 0 | 0 | 0 |
platypush/plugins/tv/samsung/ws.py | RichardChiang/platypush | 228 | 1619242 | <filename>platypush/plugins/tv/samsung/ws.py
import os
import time
from typing import Optional, Tuple, Union, Dict, Callable, Any
from samsungtvws import SamsungTVWS
from platypush.config import Config
from platypush.plugins import Plugin, action
class TvSamsungWsPlugin(Plugin):
"""
Control a Samsung smart ... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/chrome_proxy/webdriver/examples.py | google-ar/chromium | 777 | 1619277 | <filename>tools/chrome_proxy/webdriver/examples.py<gh_stars>100-1000
# Copyright 2016 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 sys
import time
import common
from common import TestDriver
from common import I... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/response/AlipayOpenAppServiceStatusModifyResponse.py | antopen/alipay-sdk-python-all | 213 | 1619301 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenAppServiceStatusModifyResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenAppServiceStatusModifyResponse, self).__init__()
self._service_code: Non... | 0 | 1 | 0 | 1 | 2 | 0 |
examples/miscellaneous/plot_multioutput_face_completion.py | MaiRajborirug/scikit-learn | 50,961 | 1619307 | """
==============================================
Face completion with a multi-output estimators
==============================================
This example shows the use of multi-output estimator to complete images.
The goal is to predict the lower half of a face given its upper half.
The first column of images sho... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/parser.py | umautobots/pytorch_wavelets | 452 | 1619319 | <gh_stars>100-1000
# coding: utf-8
import pandas as pd
import numpy as np
import argparse
from io import StringIO
parser = argparse.ArgumentParser(description='Prof parser')
parser.add_argument('file', type=str)
# Strip the whitespace on reading
def strip(text):
try:
return text.strip()
except Attribut... | 0 | 0 | 0 | 0 | 0 | 0 |
test/web/coursemanager/test_Jcourse.py | jeanqasaur/jeeves | 253 | 1619351 | <gh_stars>100-1000
# -*- coding: iso-8859-15 -*-
"""Conf FunkLoad test
$Id$
"""
import unittest
from random import random
from funkload.FunkLoadTestCase import FunkLoadTestCase
from funkload.utils import extract_token
from funkload.utils import xmlrpc_get_credential
class Jcourse(FunkLoadTestCase):
"""This test u... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/rainbow.py | paddywwoof/python-sense-hat | 104 | 1619361 | <reponame>paddywwoof/python-sense-hat
#!/usr/bin/python
import time
from sense_hat import SenseHat
sense = SenseHat()
pixels = [
[255, 0, 0], [255, 0, 0], [255, 87, 0], [255, 196, 0], [205, 255, 0], [95, 255, 0], [0, 255, 13], [0, 255, 122],
[255, 0, 0], [255, 96, 0], [255, 205, 0], [196, 255, 0], [87, 255, 0... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/Examples/Macros/TCP_Set_Relative_All_Len.py | archformco/RoboDK-API | 161 | 1619377 | # This macro will update all tools that have a Length flag in the tool name (Tool L220.551) with respect to a reference tool.
# The reference tool must have a reference Length (example: Calib Point L164.033).
# This is useful to specify a standoff or define a specific milling tool with respect to a reference tool.
#
# ... | 0 | 1 | 0 | 0 | 1 | 0 |
oktaawscli/okta_auth_mfa_app.py | jonjohnston/okta-awscli | 212 | 1619381 | from __future__ import annotations
import time
import sys
from urllib.parse import parse_qs
from urllib.parse import urlparse
from oktaawscli.version import __version__
class OktaAuthMfaApp():
""" Handles per-app Okta MFA """
def __init__(self, logger, session, verify_ssl, auth_url):
self.session = ses... | 2 | 12 | 0 | 2 | 16 | 0 |
ph5lt/stats.py | jessedp/pihole5-list-tool | 277 | 1619392 | <filename>ph5lt/stats.py
""" variaous stats and stat displays """
from terminaltables import AsciiTable, SingleTable
from colors import color
from ph5lt import utils
stats = {
"total_adlist": "SELECT COUNT(*) FROM adlist",
"total_adlist_enabled": "SELECT COUNT(*) FROM adlist WHERE enabled = 1",
"total_ad... | 0 | 0 | 0 | 0 | 0 | 0 |
configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_200ep_LSJ.py | mmabrouk/detectron2 | 21,274 | 1619398 | <reponame>mmabrouk/detectron2
from .mask_rcnn_regnetx_4gf_dds_FPN_100ep_LSJ import (
dataloader,
lr_multiplier,
model,
optimizer,
train,
)
train.max_iter *= 2 # 100ep -> 200ep
lr_multiplier.scheduler.milestones = [
milestone * 2 for milestone in lr_multiplier.scheduler.milestones
]
lr_multipl... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/conftest.py | andersk/nixpkgs-review | 101 | 1619408 | <filename>tests/conftest.py
#!/usr/bin/env python3
import pytest
import sys
import os
import json
import subprocess
from pathlib import Path
from typing import Type, Iterator, List, Union, Dict, Any, cast
import shutil
import tempfile
from contextlib import contextmanager
from dataclasses import dataclass
TEST_ROOT ... | 0 | 0 | 0 | 0 | 0 | 0 |
factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/camera_tasks/migrations/0002_cameratask_send_video_to_cloud_threshold.py | kaka-lin/azure-intelligent-edge-patterns | 176 | 1619429 | # Generated by Django 3.0.8 on 2020-10-28 05:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
("camera_tasks", "0001_initial"),
]
operations: list[object] = [
migrations.AddField(
model_name="cameratas... | 0 | 0 | 2 | 0 | 2 | 0 |
alipay/aop/api/domain/AlipayEbppInspectNotifyModel.py | antopen/alipay-sdk-python-all | 213 | 1619431 | <reponame>antopen/alipay-sdk-python-all<filename>alipay/aop/api/domain/AlipayEbppInspectNotifyModel.py<gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayEbppInspectNotifyModel(object):
def __init__(self):
self._fu... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/providers/test_list_py2_py3.py | whysage/python-dependency-injector | 1,997 | 1619441 | <reponame>whysage/python-dependency-injector
"""Dependency injector list provider unit tests."""
import sys
import unittest
from dependency_injector import providers
class ListTests(unittest.TestCase):
def test_is_provider(self):
self.assertTrue(providers.is_provider(providers.List()))
def test_p... | 0 | 0 | 0 | 0 | 0 | 0 |
NVLL/framework/train_eval_nvdm.py | jennhu/vmf_vae_nlp | 159 | 1619448 | <filename>NVLL/framework/train_eval_nvdm.py
"""
Runner is responsible for basically everything bef, during and after training and testing.
"""
import logging
import math
import os
import random
import time
import torch
from NVLL.util.gpu_flag import device
from NVLL.data.ng import DataNg
# from NVLL.util.util import ... | 0 | 0 | 0 | 0 | 0 | 0 |
bindings/python/cntk/debugging/__init__.py | shyamalschandra/CNTK | 17,702 | 1619454 | <gh_stars>1000+
# ==============================================================================
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==================================================================... | 0 | 0 | 0 | 0 | 0 | 0 |
src/network.py | viswanathgs/dist-dqn | 206 | 1619475 | <filename>src/network.py<gh_stars>100-1000
from functools import partial
from six.moves import zip
import tensorflow as tf
# Base-class for the Deep Q-Network architecture. Constructs the TensorFlow
# graph with layers, weights, biases, loss-function, optimizer, etc. for
# a network of given type. Currently, a simple... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/parallel/run_parallel_boyd_box_op.py | samcom12/anuga_core | 136 | 1619487 | import os.path
import sys
import anuga
from anuga import myid, numprocs, finalize, barrier
from anuga import Inlet_operator, Boyd_box_operator
"""
This test exercises the parallel culvert
"""
verbose = True
length = 40.
width = 16.
dx = dy = 2 # Resolution: Length of subdivisions on both axes
#---... | 0 | 1 | 0 | 0 | 1 | 0 |
tests_toplevel/test_config.py | admariner/datapane | 481 | 1619501 | import os
from pathlib import Path
from unittest import mock
@mock.patch("click.get_app_dir", autospec=True)
def test_new_config(gad, tmp_path: Path, monkeypatch):
# TODO - is there a way to run this within the normal test framework, i.e. perhaps unloading/reloading datapane module so we can
# setup our mock... | 1 | 0 | 0 | 0 | 1 | 0 |
utest/controller/test_extract_var_commands.py | guojiajiaok/RIDE | 775 | 1619504 | <reponame>guojiajiaok/RIDE
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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.apach... | 0 | 0 | 0 | 0 | 0 | 0 |
data_augmentation/MixedDataLearning.py | AaratiAkkapeddi/nnabla-examples | 228 | 1619506 | <filename>data_augmentation/MixedDataLearning.py
# Copyright 2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:... | 0 | 0 | 0 | 0 | 0 | 0 |
conv.py | xuhao1/taichi_three | 152 | 1619521 | import taichi as ti
import numpy as np
A = np.array([
[0, 1, 0],
[1, 0, 1],
[0, 1, 0],
])
def conv(A, B) -> object:
m, n = A.shape
s, t = B.shape
C = np.zeros((m + s - 1, n + t - 1), dtype=A.dtype)
for i in range(m):
for j in range(n):
for k in range(s):
for l in ... | 0 | 1 | 0 | 0 | 1 | 0 |
ncm2-plugin/float_preview.py | ncm2/float-preview | 257 | 1619559 | <reponame>ncm2/float-preview
# -*- coding: utf-8 -*-
# Remove `menu` and prepend it to `info` field of items for ncm2
def wrap():
from ncm2_core import ncm2_core
from ncm2 import getLogger
import vim
if vim.vars['float_preview#docked']:
return
old_matches_decorate = ncm2_core.matches_dec... | 0 | 0 | 0 | 0 | 0 | 0 |
res/TensorFlowPythonExamples/examples/instance_norm/__init__.py | juitem/ONE | 255 | 1619591 | <gh_stars>100-1000
import tensorflow as tf
sess = tf.Session()
in_ = tf.compat.v1.placeholder(dtype=tf.float32, shape=(3, 3), name="Hole")
norm_ = tf.contrib.layers.instance_norm(in_)
# we need to save checkpoint to freeze dropped model
init = tf.initialize_all_variables()
sess.run(init)
saver = tf.train.Saver()
sa... | 0 | 0 | 0 | 0 | 0 | 0 |
configs/gcpr/fdf/gcpr_B.py | skoskjei/DP-ATT | 1,128 | 1619603 | <filename>configs/gcpr/fdf/gcpr_B.py<gh_stars>1000+
_base_config_ = "../../fdf/base.py"
| 0 | 0 | 0 | 0 | 0 | 0 |
challenge_9/python/wost/src/main.py | rchicoli/2017-challenges | 271 | 1619604 | <gh_stars>100-1000
"""
Takes a list of sorted integers, squares all the numbers and sorts the new list.
Ex.
Input = [-2, 0, 4, 7]
Output = [0, 4, 16, 49]
"""
def square_sort(inp: list) -> list:
pos, neg = [], []
for i in inp:
pos.append(i**2) if i >= 0 else neg.append(i ** 2)
neg.reverse()
re... | 0 | 0 | 0 | 0 | 0 | 0 |
ironic/tests/unit/drivers/modules/xclarity/test_common.py | yanndegat/ironic | 350 | 1619626 | # Copyright 2017 Lenovo, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 0 | 0 | 0 | 0 | 0 | 0 |
Joy_QA_Platform/ApiManager/utils/utils.py | bzc128/Joy_QA_Platform | 123 | 1619630 | <reponame>bzc128/Joy_QA_Platform
import logging
def pagination_for_objects(objects, index):
"""
分页返回查询结果
"""
if index < 1:
pass
elif index >= 1:
start = (index - 1) * 10
objects = objects[start:start + 10]
return objects
def getLogger():
"""
获取 mLogger,在 settings.py 中配置
所有级别日志均输出到控制... | 0 | 0 | 0 | 0 | 0 | 0 |
src/main/resources/resource/Blocks/Blocks.py | holgerfriedrich/myrobotlab | 179 | 1619638 | <reponame>holgerfriedrich/myrobotlab
#########################################
# Blocks.py
# description: basic block programming interface
# categories: programming
# more info @: http://myrobotlab.org/service/Blocks
#########################################
# start the service
blocks = Runtime.start('blocks','Blocks... | 0 | 0 | 0 | 0 | 0 | 0 |
karlooper/config/config.py | karldoenitz/karlooper | 161 | 1619659 | # -*-coding:utf-8-*-
__author__ = '<EMAIL>'
RESPONSE_HEAD_MESSAGE = "HTTP/1.1 %(status)s %(status_msg)s\r\n" \
"Date: %(date)s\r\n" \
"Host: %(host)s\r\n" \
"Content-Length: %(content_length)s\r\n\r\n"
SOCKET_RECEIVE_SIZE = 1024 * 64
DEFAULT_POR... | 0 | 0 | 24 | 0 | 24 | 0 |
setup.py | vishalbelsare/event-registry-python | 160 | 1619665 | <reponame>vishalbelsare/event-registry-python
from setuptools import setup
import re
VERSIONFILE = "eventregistry/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError("U... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/response/AlipayTradeCreditFinanceRefundResponse.py | antopen/alipay-sdk-python-all | 213 | 1619669 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayTradeCreditFinanceRefundResponse(AlipayResponse):
def __init__(self):
super(AlipayTradeCreditFinanceRefundResponse, self).__init__()
self._amount: None = None
... | 0 | 7 | 0 | 7 | 14 | 0 |
data/diffusion_model_flags.py | clintonjwang/clip-guided-diffusion | 291 | 1619704 | <reponame>clintonjwang/clip-guided-diffusion<filename>data/diffusion_model_flags.py
DIFFUSION_LOOKUP = {
'cond': {
64: {
'url': 'https://openaipublic.blob.core.windows.net/diffusion/jul-2021/64x64_diffusion.pt',
"filename": '64x64_diffusion.pt',
'model_flags': {
... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/quickflat/plot_cutouts.py | mvdoc/pycortex | 423 | 1619718 | <gh_stars>100-1000
"""
===========================
Plot cutouts on the flatmap
===========================
Cutouts are manually generated cuts of the cortical surface to highlight
a region of interest.
Cutouts are defined as sub-layers of the `cutouts` layer
in <filestore>/<subject>/overlays.svg.
The parameter `cuto... | 0 | 0 | 0 | 0 | 0 | 0 |
labgraph/websockets/ws_client/api_message_constructor.py | Yunusbcr/labgraph | 124 | 1619723 | #!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import json
from typing import Dict, Any
def get_start_stream_request(
target: str, stream_id: str, request_id: int, api_version: str, app_id: str = ""
) -> str:
"""
Parameters
----------
target:
Type of data s... | 8 | 2 | 1 | 0 | 11 | 0 |
betfairlightweight/streaming/__init__.py | blake3/betfair | 300 | 1619741 | from .betfairstream import BetfairStream, HistoricalStream, HistoricalGeneratorStream
from .listener import BaseListener, StreamListener
from .stream import MarketStream, OrderStream
| 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow/lite/tools/accuracy/ilsvrc/generate_validation_labels.py | abhaikollara/tensorflow | 848 | 1619747 | # 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... | 0 | 3 | 0 | 0 | 3 | 0 |
demo.py | uday701/DepthEstimation | 139 | 1619748 | #!/usr/bin/env python
# coding: utf-8
# demo
"""
Author: <NAME>
Email: <EMAIL>
Create_Date: 2019/05/21
"""
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
torch.backends.cudnn.deterministic = True
torch.manual_seed(123)
import os, argparse, sys
... | 0 | 0 | 0 | 0 | 0 | 0 |
code/Attentive_BiLSTM/train_so.py | jeniyat/Bert-OverFlow | 116 | 1619753 | <reponame>jeniyat/Bert-OverFlow
# coding=utf-8
from __future__ import print_function
import optparse
import itertools
from collections import OrderedDict
import torch
import time
import pickle
from torch.optim import lr_scheduler
from torch.autograd import Variable
# import matplotlib.pyplot as plt #JT: commented ... | 0 | 0 | 0 | 0 | 0 | 0 |
release/scripts/freestyle/modules/freestyle/__init__.py | MarkC-b3d/blender-mc3d | 365 | 1619768 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/blobs/migrations/0006_restrict_form_attachments.py | dimagilg/commcare-hq | 471 | 1619795 | <filename>corehq/blobs/migrations/0006_restrict_form_attachments.py
# Generated by Django 1.11.14 on 2018-07-26 15:11
from django.db import migrations
from corehq.sql_db.operations import RawSQLMigration
from corehq.sql_db.migrations import partitioned
migrator = RawSQLMigration(('corehq', 'blobs', 'sql_templates')... | 0 | 0 | 0 | 0 | 0 | 0 |
angr/engines/soot/expressions/binop.py | Kyle-Kyle/angr | 6,132 | 1619799 | <gh_stars>1000+
import operator
from .base import SimSootExpr
class SimSootExpr_Binop(SimSootExpr):
def _execute(self):
v1 = self._translate_expr(self.expr.value1)
v2 = self._translate_expr(self.expr.value2)
operator_func = SimSootExpr_Binop.binop_str_to_function[self.expr.op]
se... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/functions.py | aditiapratama/blender-tools | 311 | 1619807 | <reponame>aditiapratama/blender-tools
"""General-use shared functions for the Embark Addon."""
from math import sin, cos, pi
from re import split
import bpy
from mathutils import Vector
from ..exporter import constants
from . import get_preferences
TWO_PI = pi * 2
class SceneState(): # pylint: disable=too-few-pu... | 0 | 0 | 0 | 0 | 0 | 0 |
external/ORB_SLAM2/compute_poses.py | tobiasfshr/MOTSFusion | 154 | 1619815 | <filename>external/ORB_SLAM2/compute_poses.py
from subprocess import call
import pickle
import numpy as np
import os
def compute_poses_orb(sequence, calib_params, save_path, data_path, model_path, vocab_path):
if not os.path.exists(save_path):
os.makedirs(save_path)
template_file = open(model_path + ... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/tutorial/perf_fp32_int8_tf/compare_result.py | intel/neural-compressor | 172 | 1619826 | import json
import matplotlib.pyplot as plt
def autolabel(ax, rects):
"""
Attach a text label above each bar displaying its height
"""
for rect in rects:
height = rect.get_height()
ax.text(rect.get_x() + rect.get_width()/2., 1.05*height,
'%0.4f' % float(height),
... | 1 | 2 | 0 | 0 | 3 | 0 |
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py | Polidea/SiriusObfuscator | 427 | 1619840 | <reponame>Polidea/SiriusObfuscator<gh_stars>100-1000
"""
Tests that frame variable looks into anonymous unions
"""
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class FrameVariableAnonymousUnionsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def t... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/eigenvalue_concentration.py | jafluri/pygsp | 341 | 1619844 | r"""
Concentration of the eigenvalues
================================
The eigenvalues of the graph Laplacian concentrates to the same value as the
graph becomes full.
"""
import numpy as np
from matplotlib import pyplot as plt
import pygsp as pg
n_neighbors = [1, 2, 5, 8]
fig, axes = plt.subplots(3, len(n_neighbors... | 0 | 0 | 0 | 0 | 0 | 0 |
course/page/code_run_backend.py | inducer/courseflow | 284 | 1619846 | <filename>course/page/code_run_backend.py
__copyright__ = "Copyright (C) 2014 <NAME>"
__license__ = """
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 limit... | 0 | 0 | 0 | 0 | 0 | 0 |
epitran/test/test_sinhala.py | dwijap/epitran | 422 | 1619867 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
import unicodedata
import epitran
class TestSinhalaGeneral(unittest.TestCase):
def setUp(self):
self.epi = epitran.Epitran(u'sin-Sinh')
def _assert_trans(self, src, tar):
trans = self.epi.transliterate(src)
... | 0 | 0 | 0 | 0 | 0 | 0 |
docs_src/launch/tutorial002.py | madkinsz/typer | 7,615 | 1619882 | from pathlib import Path
import typer
APP_NAME = "my-super-cli-app"
def main():
app_dir = typer.get_app_dir(APP_NAME)
app_dir_path = Path(app_dir)
app_dir_path.mkdir(parents=True, exist_ok=True)
config_path: Path = Path(app_dir) / "config.json"
if not config_path.is_file():
config_path.w... | 0 | 0 | 1 | 0 | 1 | 0 |
kgtk/join/kgtkmergecolumns.py | vishalbelsare/kgtk | 222 | 1619891 | import attr
import typing
from kgtk.kgtkformat import KgtkFormat
@attr.s(slots=True, frozen=False)
class KgtkMergeColumns:
"""Merge columns from multiple KgtkReaders, respecting predefined column
names with aliases.
"""
# For attrs 19.1.0 and later:
column_names: typing.List[str] = attr.ib(valid... | 2 | 1 | 11 | 0 | 14 | 0 |
demos/depth_completion.py | SWALS-MT/ip_basic | 345 | 1619905 | import glob
import os
import sys
import time
import cv2
import numpy as np
import png
from ip_basic import depth_map_utils
from ip_basic import vis_utils
def main():
"""Depth maps are saved to the 'outputs' folder.
"""
##############################
# Options
##############################
... | 0 | 0 | 0 | 0 | 0 | 0 |
macro_generator.py | scottctaylor12/MacC2 | 106 | 1619913 | import optparse
from optparse import OptionParser
import sys
import base64
import binascii
import os
import random
from random import randrange
if ((len(sys.argv) < 5 or len(sys.argv) > 5) and '-h' not in sys.argv):
print("Usage: %s -s <C2 Server IP/domain> -p <C2 Server Port>" % sys.argv[0])
sys.exit(1)
pars... | 0 | 0 | 0 | 0 | 0 | 0 |
third-party/llvm/llvm-src/utils/lit/tests/unparsed-requirements.py | jhh67/chapel | 2,338 | 1619922 | <reponame>jhh67/chapel
# RUN: %{python} %s %{inputs}/unparsed-requirements
import sys
from lit.Test import Result, Test, TestSuite
from lit.TestRunner import parseIntegratedTestScript
from lit.TestingConfig import TestingConfig
config = TestingConfig(None, "config", [".txt"], None, [], [], False, sys.argv[1], sys.arg... | 0 | 0 | 0 | 0 | 0 | 0 |
dddpy/domain/book/isbn.py | tamanobi/dddpy | 170 | 1619932 | import re
from dataclasses import dataclass
regex = r"978[-0-9]{10,15}"
pattern = re.compile(regex)
@dataclass(init=False, eq=True, frozen=True)
class Isbn:
"""Isbn represents an ISBN code as a value object"""
value: str
def __init__(self, value: str):
if pattern.match(value) is None:
... | 1 | 0 | 1 | 0 | 2 | 0 |
cctbx/examples/structure_factor_derivatives_4.py | dperl-sol/cctbx_project | 155 | 1619939 | from __future__ import absolute_import, division, print_function
from scitbx.math import tensor_rank_2_gradient_transform_matrix
from scitbx import matrix
from scitbx.array_family import flex
import cmath
import math
from six.moves import zip
mtps = -2 * math.pi**2
class structure_factor:
def __init__(self, xray_s... | 0 | 10 | 0 | 0 | 10 | 0 |
solutions/UpdateLocalizationFiles.py | hannest03/tModLoader | 438 | 1619949 | <filename>solutions/UpdateLocalizationFiles.py
# Run this script after updating en-US.tModLoader.json with new keys. python 3.
# Also make sure the file encodings are UTF-8 not UTF-8-BOM.
filename = '../src/tModLoader/Terraria/Localization/Content/{0}/tModLoader.json'
languages = ['zh-Hans', 'ru-RU', 'pt-BR', 'pl-PL... | 0 | 0 | 0 | 0 | 0 | 0 |
pennylane/tape/stop_recording.py | therooler/pennylane | 539 | 1619957 | # Copyright 2018-2021 Xanadu Quantum Technologies 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 applicabl... | 0 | 1 | 0 | 0 | 1 | 0 |
docs/examples/spectrum/plot_spectrl2_fig51A.py | JackKelly/pvlib-python | 695 | 1619979 | """
Modeling Spectral Irradiance
============================
Recreating Figure 5-1A from the SPECTRL2 NREL Technical Report.
"""
# %%
# This example shows how to model the spectral distribution of irradiance
# based on atmospheric conditions. The spectral distribution of irradiance is
# the power content at each wav... | 0 | 0 | 0 | 0 | 0 | 0 |
Social_Aggregators.py | martin503/GraphRec-WWW19 | 266 | 1619985 | <reponame>martin503/GraphRec-WWW19
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import random
from Attention import Attention
class Social_Aggregator(nn.Module):
"""
Social Aggregator: for aggregating embeddings of social neighbors.
"""
def __init__(self, ... | 0 | 0 | 0 | 0 | 0 | 0 |
tencentcloud/cws/v20180312/cws_client.py | PlasticMem/tencentcloud-sdk-python | 465 | 1619998 | <filename>tencentcloud/cws/v20180312/cws_client.py
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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 t... | 0 | 0 | 0 | 0 | 0 | 0 |
more_autograding_examples/cpp_random_input_output/config/instructor_solution/solution.py | elihschiff/Submitty | 411 | 1620007 | import sys
days_in_month = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
def is_leap_year ( year ) -> object:
return year % 4 == 0 and ( year % 100 != 0 or year % 400 == 0 )
def julian_day (month, day, year) -> object:
jday = 0
for m in range(month):
jday += days_in_month[m]
if m ==... | 0 | 3 | 0 | 0 | 3 | 0 |
darkctf2020/jack/sol.py | nhtri2003gmail/ctf-write-ups | 101 | 1620018 | <filename>darkctf2020/jack/sol.py
#!/usr/bin/env python3
import angr, time, claripy
t=time.time()
BINARY='./jack'
proj = angr.Project(BINARY, auto_load_libs=False)
print("Entry: 0x%x" % proj.entry)
FIND=0x00401489
input_len=16
flag_chars = [claripy.BVS('flag_%d' % i, 8) for i in range(input_len)]
flag = claripy.Conca... | 0 | 0 | 0 | 0 | 0 | 0 |
hs_core/views/user_rest_api.py | hydroshare/hydroshare | 178 | 1620032 | <reponame>hydroshare/hydroshare
from rest_framework.decorators import api_view
from rest_framework.views import APIView
from rest_framework.response import Response
from theme.models import UserProfile
class UserInfo(APIView):
def get(self, request):
if not request.user.is_authenticated():
re... | 0 | 0 | 0 | 0 | 0 | 0 |
parsl/data_provider/file_noop.py | cylondata/parsl | 323 | 1620037 | <gh_stars>100-1000
import logging
from parsl.utils import RepresentationMixin
from parsl.data_provider.staging import Staging
logger = logging.getLogger(__name__)
class NoOpFileStaging(Staging, RepresentationMixin):
def can_stage_in(self, file):
logger.debug("NoOpFileStaging checking file {}".format(r... | 0 | 0 | 0 | 0 | 0 | 0 |
libs/boxes/cython_nms.py | wesen/FastMaskRCNN | 3,509 | 1620040 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys, pkg_resources, imp
def __bootstrap__():
global __bootstrap__, __loader__, __file__
__file__ = pkg_resources.resource_filename(__name__, 'cython_nms.so')
__loader__ = None
del __bootstrap__,... | 0 | 0 | 0 | 0 | 0 | 0 |
fastapi_admin/app.py | myWorkshop123/fastapi-admin | 636 | 1620073 | <reponame>myWorkshop123/fastapi-admin<filename>fastapi_admin/app.py
from typing import Dict, List, Optional, Type
from aioredis import Redis
from fastapi import FastAPI
from pydantic import HttpUrl
from starlette.middleware.base import BaseHTTPMiddleware
from tortoise import Model
from fastapi_admin import i18n
from... | 0 | 0 | 0 | 0 | 0 | 0 |
habitat_sim/attributes.py | vauduong/habitat-sim | 1,457 | 1620077 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from habitat_sim._ext.habitat_sim_bindings import (
CapsulePrimitiveAttributes,
ConePrimitiveAttributes,
CubePrimitiveAttributes,
... | 0 | 0 | 0 | 0 | 0 | 0 |
stonesoup/tracker/base.py | Red-Portal/Stone-Soup-1 | 157 | 1620081 | # -*- coding: utf-8 -*-
from abc import abstractmethod
from ..base import Base
from ..buffered_generator import BufferedGenerator
class Tracker(Base, BufferedGenerator):
"""Tracker base class"""
@property
def tracks(self) -> object:
return self.current[1]
@abstractmethod
@BufferedGenera... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/__init__.py | carleeno/tesla | 108 | 1620091 | """Tests for Tesla Custom Integration."""
| 0 | 0 | 0 | 0 | 0 | 0 |
nfspy/__init__.py | SKsample/NfSpy | 254 | 1620106 | #!/usr/bin/env python
from nfspy import *
| 0 | 0 | 0 | 0 | 0 | 0 |
HLTriggerOffline/Btag/test/testSequences.py | ckamtsikis/cmssw | 852 | 1620122 | import FWCore.ParameterSet.Config as cms
process = cms.Process("HLTBTAG")
process.load("L1TriggerConfig.L1GtConfigProducers.L1GtConfig_cff")
process.load("DQMServices.Components.EDMtoMEConverter_cff")
process.load("HLTriggerOffline.Btag.HltBtagValidation_cff")
#process.load("HLTriggerOffline.Btag.HltBtagValidationFast... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/blink/renderer/bindings/scripts/validator/framework/validator.py | zealoussnow/chromium | 14,668 | 1620128 | <reponame>zealoussnow/chromium
# 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 web_idl
from . import target
from .rule_base import RuleBase
from .rule_store import RuleStore
from .target_store impor... | 0 | 0 | 0 | 0 | 0 | 0 |
ospybook/ospybook/simplevectorplotter.py | hohsieh/osgeopy-code | 160 | 1620134 | from __future__ import annotations
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.path import Path
from matplotlib.patches import PathPatch
import numpy as np
try:
numeric_types = (int, float, long)
except NameError:
numeric_types = (int, float)
class SimpleVectorPlotter(object):
... | 17 | 15 | 0 | 1 | 33 | 0 |
appium/webdriver/extensions/session.py | salabogdan/python-client | 1,383 | 1620148 | <filename>appium/webdriver/extensions/session.py
#!/usr/bin/env python
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
Packs/ApiModules/Scripts/AnsibleApiModule/AnsibleApiModule.py | diCagri/content | 799 | 1620187 | from CommonServerPython import * # noqa: F403
from CommonServerUserPython import * # noqa: F403
import ansible_runner # pylint: disable=E0401
import json
from typing import Dict, cast, List, Union, Any
# Dict to Markdown Converter adapted from https://github.com/PolBaladas/torsimany/
def dict2md(json_block: Unio... | 24 | 11 | 1 | 0 | 36 | 0 |
problems/sum-of-array-plus-one/sum-of-array-plus-one.py | vidyadeepa/the-coding-interview | 1,571 | 1620206 | <filename>problems/sum-of-array-plus-one/sum-of-array-plus-one.py
def sum_plus_one(arr):
return sum(arr) + len(arr)
print sum_plus_one([1, 2, 3, 4]) # 14
| 0 | 0 | 0 | 0 | 0 | 0 |
docs_src/signals/docs002.py | naterenegar/ormar | 905 | 1620230 | <reponame>naterenegar/ormar<filename>docs_src/signals/docs002.py
from ormar import pre_update
@pre_update(Album)
async def before_update(sender, instance, **kwargs):
if instance.play_count > 50 and not instance.is_best_seller:
instance.is_best_seller = True
# here album.play_count ans is_best_seller get... | 0 | 0 | 0 | 0 | 0 | 0 |
src/falconpy/prevention_policy.py | CrowdStrike/falconpy | 111 | 1620231 | <reponame>CrowdStrike/falconpy<filename>src/falconpy/prevention_policy.py<gh_stars>100-1000
"""CrowdStrike Falcon Prevention Policy API interface class
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1... | 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.