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 |
|---|---|---|---|---|---|---|---|---|---|---|
calamari_ocr/ocr/savedmodel/migrations/loadweights.py | jacektl/calamari | 922 | 158657 | <filename>calamari_ocr/ocr/savedmodel/migrations/loadweights.py
def load_and_convert_weights(ckpt, dry_run=True):
import tensorflow as tf
tf.compat.v1.reset_default_graph()
with tf.compat.v1.Session() as sess:
available_vars = tf.compat.v1.train.list_variables(ckpt)
available_var_names = [v... | 0 | 0 | 0 | 0 | 0 | 0 |
wagtail/tests/routablepage/__init__.py | brownaa/wagtail | 8,851 | 158659 | <reponame>brownaa/wagtail
default_app_config = 'wagtail.tests.routablepage.apps.WagtailRoutablePageTestsAppConfig'
| 0 | 0 | 0 | 0 | 0 | 0 |
elegantrl/AgentZoo/ElegantRL-Isaac/utils/torch_jit_utils.py | ludel/ElegantRL | 759 | 158660 | <gh_stars>100-1000
# 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
# distribution of this... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/core/tests/test_sanity_path.py | valeriodigregorio/ydk-gen-0.8.5 | 125 | 158680 | <reponame>valeriodigregorio/ydk-gen-0.8.5
# ----------------------------------------------------------------
# Copyright 2016 Cisco Systems
#
# 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
#
... | 0 | 0 | 0 | 0 | 0 | 0 |
pixloc/pixlib/models/__init__.py | jmorlana/pixloc | 457 | 158702 | <reponame>jmorlana/pixloc<filename>pixloc/pixlib/models/__init__.py
from ..utils.tools import get_class
from .base_model import BaseModel
def get_model(name):
return get_class(name, __name__, BaseModel)
| 0 | 0 | 0 | 0 | 0 | 0 |
ScanObjectNN/3DmFV-Net/utils/EMD/tf_auctionmatch.py | OolongQian/SimpleView | 172 | 158727 | <reponame>OolongQian/SimpleView<gh_stars>100-1000
import tensorflow as tf
import sys
import os
from tensorflow.python.framework import ops
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, 'EMD'))
auctionmatch_module=tf.load_op_library('./EMD/tf_auct... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/gui_eventloop/gui_threads.py | brubbel/Pyro4 | 638 | 158731 | <reponame>brubbel/Pyro4
"""
This example shows a Tkinter GUI application that uses a worker thread to
run Pyro's event loop.
Usually, the GUI toolkit requires that GUI operations are done from within
the GUI thread. So, if Pyro interfaces with the GUI, it cannot do that
directly because the method calls are done from ... | 0 | 0 | 0 | 0 | 0 | 0 |
zqxt/config.py | Imshuaige/zqxt | 318 | 158733 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
__author__ = "WeizhongTu"
__date__ = '2014.08.01'
# ************************************************
# ---- 网站相关 ----
# URL显示方式
URL_STYLE = 'recommand'
# ---- 文章相关 ----
# ************************************************
#
# 后台文章编辑器样式
# 从这些中选择 'besttome', 'mini', 'normal',... | 0 | 0 | 0 | 0 | 0 | 0 |
nazurin/database/local.py | amber6hua/nazurin | 170 | 158763 | from __future__ import annotations
from os import path
from tinydb import Query, TinyDB
from nazurin.config import DATA_DIR
class Local(object):
"""Local database driver using TinyDB."""
def collection(self, key) -> object:
self.db = TinyDB(path.join(DATA_DIR, key + '.json'))
return self
... | 0 | 6 | 0 | 0 | 6 | 0 |
python/paddle/fluid/tests/unittests/mkldnn/test_flags_use_mkldnn.py | zmxdream/Paddle | 17,085 | 158769 | # Copyright (c) 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 0 | 2 | 0 | 0 | 2 | 0 |
Packs/Pcysys/Integrations/Pcysys/Pcysys_test.py | diCagri/content | 799 | 158790 | import demistomock as demisto
import jwt
from Pcysys import Client, pentera_run_template_command, pentera_get_task_run_status_command, \
pentera_get_task_run_full_action_report_command, pentera_authentication
MOCK_PENTERA_FULL_ACTION_REPORT = 'penterascan-5e4530961deb8eda82b08730.csv'
MOCK_CSV = open('TestData/m... | 0 | 0 | 0 | 0 | 0 | 0 |
hfc/util/archive.py | roviso/hyberledger-py | 389 | 158809 | # https://jira.hyperledger.org/browse/FAB-7065
# ?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment
# -tabpanel&showAll=true
from __future__ import annotations
import io
import json
import logging
import os
import tarfile
import time
from hfc.util.consts import CC_TYPE_GOLANG, CC_TYPE_NODE
_logger = logg... | 1 | 5 | 0 | 0 | 6 | 0 |
model/__init__.py | stromguy/super-resolution | 1,230 | 158833 | <filename>model/__init__.py<gh_stars>1000+
from model.common import resolve
from model.common import resolve_single
from model.common import evaluate
| 0 | 0 | 0 | 0 | 0 | 0 |
semantic_text_similarity/models/string_similarity/lexical_similarity_metrics.py | anwar1103/semantic-text-similarit | 167 | 158866 | import similarity
from similarity.normalized_levenshtein import NormalizedLevenshtein
from similarity.jarowinkler import JaroWinkler
from similarity.metric_lcs import MetricLCS
from similarity.qgram import QGram
from similarity.jaccard import Jaccard
from similarity.cosine import Cosine
from fuzzywuzzy import fuzz
from... | 2 | 2 | 0 | 0 | 4 | 0 |
tests/numpy/sigmoid.py | MoonStarCZW/py2rb | 124 | 158874 | <gh_stars>100-1000
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
x = np.arange(-5.0, 5.0, 0.1)
y = sigmoid(x)
def print_array(data):
datas = []
for i in data:
if float("%.3f" % abs(i)) == 0:
datas.append(float("%.3f" % abs(i)))
else:
datas.appe... | 0 | 0 | 0 | 0 | 0 | 0 |
hcec/edwards/testdata/encodepoint.py | duwu/hcd | 131 | 158880 | <reponame>duwu/hcd<filename>hcec/edwards/testdata/encodepoint.py
import sys
from ed25519 import *
P = []
x = int(sys.argv[1])
P.append(x)
y = int(sys.argv[2])
P.append(y)
encodepointhex(P)
| 0 | 0 | 0 | 0 | 0 | 0 |
codigo/Live177/newprojectapp.py | BrunoPontesLira/live-de-python | 572 | 158934 | from __future__ import annotations
import os
import tkinter as tk
import tkinter.ttk as ttk
import pygubu
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
PROJECT_UI = os.path.join(PROJECT_PATH, "newproject")
class NewprojectApp:
def __init__(self, master: object | None=None):
# build ui
... | 1 | 0 | 0 | 0 | 1 | 0 |
research/dp-flows/train.py | telegraphroad/jax-flows | 198 | 158941 | <reponame>telegraphroad/jax-flows<filename>research/dp-flows/train.py
import os
import sys
sys.path.insert(0, '../../')
from datetime import datetime
from jax import jit, grad, partial, random, tree_util, vmap, lax, ops
from jax import numpy as np
from jax.tree_util import tree_flatten, tree_unflatten
from sklearn im... | 0 | 0 | 0 | 0 | 0 | 0 |
src/programy/services/rest/cocktaildb/service.py | RonKhondji/program-y | 345 | 158943 | """
Copyright (c) 2016-2020 <NAME> http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, m... | 0 | 16 | 3 | 3 | 22 | 0 |
torch2trt_dynamic/plugins/create_meshgrid_plugin.py | jinfagang/torch2trt_dynamic | 155 | 158944 | <filename>torch2trt_dynamic/plugins/create_meshgrid_plugin.py
import numpy as np
import tensorrt as trt
def create_meshgrid_plugin(layer_name,
num_inputs,
slice_dims=[2, 3],
starts=[0., 0.],
strides=[1., 1.]):
... | 0 | 0 | 0 | 0 | 0 | 0 |
fastrunner/migrations/0019_auto_20210411_2040.py | FuxiongYang/faster | 227 | 158951 | <filename>fastrunner/migrations/0019_auto_20210411_2040.py
# Generated by Django 2.2 on 2021-04-11 20:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fastrunner', '0018_auto_20210410_1950'),
]
operations = [
migrations.AddField(
... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/matrix/octahedral.py | fding253/nxviz | 385 | 158967 | """
Displays a NetworkX octahedral graph to screen using a MatrixPlot.
"""
import matplotlib.pyplot as plt
import networkx as nx
from nxviz.plots import MatrixPlot
G = nx.octahedral_graph()
c = MatrixPlot(G)
c.draw()
plt.show()
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/grab_deprecated.py | dimichxp/grab | 2,266 | 158972 | <reponame>dimichxp/grab
# coding: utf-8
import re
from weblib.error import DataNotFound
from tests.util import build_grab, temp_file
from tests.util import BaseGrabTestCase
from grab.error import GrabMisuseError
class GrabApiTestCase(BaseGrabTestCase):
@classmethod
def setUpClass(cls):
import grab.u... | 0 | 0 | 0 | 0 | 0 | 0 |
opytimizer/optimizers/population/hho.py | anukaal/opytimizer | 528 | 158992 | <reponame>anukaal/opytimizer<gh_stars>100-1000
"""Harris Hawks Optimization.
"""
import numpy as np
import opytimizer.math.distribution as d
import opytimizer.math.random as r
import opytimizer.utils.logging as l
from opytimizer.core import Optimizer
logger = l.get_logger(__name__)
class HHO(Optimizer):
"""An ... | 0 | 0 | 0 | 0 | 0 | 0 |
easy_rec/python/test/csv_input_test.py | xia-huang-411303/EasyRec | 285 | 159012 | # -*- encoding:utf-8 -*-
# Copyright (c) Alibaba, Inc. and its affiliates.
"""Define cv_input, the base class for cv tasks."""
import tensorflow as tf
from google.protobuf import text_format
from easy_rec.python.input.csv_input import CSVInput
from easy_rec.python.input.csv_input_ex import CSVInputEx
from easy_rec.py... | 1 | 0 | 0 | 2 | 3 | 0 |
sling/nlp/wikicat/server.py | JDzvonik/sling | 2,023 | 159025 | <gh_stars>1000+
# Copyright 2017 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 or agreed ... | 0 | 0 | 0 | 0 | 0 | 0 |
platypush/backend/sensor/mcp3008/__init__.py | BlackLight/platypush | 228 | 159046 | <gh_stars>100-1000
from platypush.backend.sensor import SensorBackend
class SensorMcp3008Backend(SensorBackend):
"""
Backend to poll analog sensor values from an MCP3008 chipset
(https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters/mcp3008)
Requires:
* ``adafruit-mcp3008`` (`... | 0 | 0 | 0 | 0 | 0 | 0 |
deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/EXT/texture_snorm.py | ShujaKhalid/deep-rl | 210 | 159078 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/components/elmax/conftest.py | MrDelik/core | 30,023 | 159133 | """Configuration for Elmax tests."""
import json
from elmax_api.constants import (
BASE_URL,
ENDPOINT_DEVICES,
ENDPOINT_DISCOVERY,
ENDPOINT_LOGIN,
)
from httpx import Response
import pytest
import respx
from tests.common import load_fixture
from tests.components.elmax import MOCK_PANEL_ID, MOCK_PANEL_... | 0 | 0 | 0 | 0 | 0 | 0 |
test/fixture/python_scanner/from_import_simple_package_modules_no_space.py | Valkatraz/scons | 1,403 | 159148 | <reponame>Valkatraz/scons
from simple_package import module1,module2
| 0 | 0 | 0 | 0 | 0 | 0 |
jax_dft/jax_dft/losses_test.py | deepneuralmachine/google-research | 23,901 | 159153 | <filename>jax_dft/jax_dft/losses_test.py
# coding=utf-8
# Copyright 2021 The Google Research 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/LI... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/pot/openvino/tools/pot/samplers/creator.py | pazamelin/openvino | 2,406 | 159183 | <filename>tools/pot/openvino/tools/pot/samplers/creator.py
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import random
from openvino.tools.pot.engines.ac_engine import ACEngine
from openvino.tools.pot.samplers.batch_sampler import BatchSampler
from openvino.tools.pot.samplers.index... | 0 | 0 | 0 | 0 | 0 | 0 |
models/__init__.py | heathher/neural_sequence_labeling | 240 | 159195 | <reponame>heathher/neural_sequence_labeling
from models.base_model import *
from models.nns import *
| 0 | 0 | 0 | 0 | 0 | 0 |
probe-builder/oracle-kernel-crawler.py | 6un9-h0-Dan/sysdig | 5,167 | 159200 | #!/usr/bin/python
#
# Copyright (C) 2013-2018 Draios Inc dba Sysdig.
#
# This file is part of sysdig .
#
# 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/L... | 0 | 0 | 0 | 0 | 0 | 0 |
example/python/model.py | nirgal/xgcalendar | 192 | 159221 | <reponame>nirgal/xgcalendar
# -*- coding: utf-8 -*-
import datetime
from google.appengine.ext import db
#Subject 主题
#Location 地点
#TimeZone 时区
#Description 说明
#CalendarType 日程类型,1 个人,2 单位,3 系统
#StartTime 开始时间
#EndTime 结束时间
#IsAllDayEvent 是否全天日程
#HasAttachment 是否有附件
#C... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/midi_sine_numpy.py | SpotlightKid/jackclient-python | 120 | 159226 | #!/usr/bin/env python3
"""Very basic MIDI synthesizer.
This does the same as midi_sine.py, but it uses NumPy and block
processing. It is therefore much more efficient. But there are still
many allocations and dynamically growing and shrinking data structures.
"""
import jack
import numpy as np
import threading
# F... | 0 | 2 | 0 | 0 | 2 | 0 |
2_tensor_network/kacward.py | Ben1008611/SSSS | 165 | 159252 | <filename>2_tensor_network/kacward.py
import numpy as np
'''
<NAME> Ising
See Theorem 1 of https://arxiv.org/abs/1011.3494
'''
phi = np.array([[0., np.pi/2, -np.pi/2, np.nan ],
[-np.pi/2, 0.0, np.nan, np.pi/2],
[np.pi/2, np.nan, 0.0, -np.pi/2],
[np.nan, -np.pi/2, np.p... | 0 | 0 | 0 | 0 | 0 | 0 |
WebMirror/management/rss_parser_funcs/feed_parse_extractOneManArmy.py | fake-name/ReadableWebProxy | 193 | 159260 | <gh_stars>100-1000
def extractOneManArmy(item):
"""
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or 'preview' in item['title'].lower():
return None
if 'DBWG – Chapter' in item['title'] or 'Dragon-Blooded War God' in item['tags']:
return buildReleaseMessageW... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/opytimizer/optimizers/swarm/test_mfo.py | anukaal/opytimizer | 528 | 159262 | <gh_stars>100-1000
import numpy as np
from opytimizer.optimizers.swarm import mfo
from opytimizer.spaces import search
def test_mfo_params():
params = {
'b': 1
}
new_mfo = mfo.MFO(params=params)
assert new_mfo.b == 1
def test_mfo_params_setter():
new_mfo = mfo.MFO()
try:
... | 0 | 0 | 0 | 0 | 0 | 0 |
changes/models/testresult.py | vault-the/changes | 443 | 159273 | <reponame>vault-the/changes
from __future__ import absolute_import, division
import hashlib
import logging
import random as insecure_random
import re
from datetime import datetime
from flask import current_app
from sqlalchemy.exc import IntegrityError
from sqlalchemy.sql import func
from changes.config import db
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
programming-language/cases/python/examples/py.test/example1.py | wdv4758h/notes | 136 | 159292 | #!/usr/bin/env python
'''
you can use this command to run specific Python code:
..code-block:: python
py.test example1.py
'''
def f(x) -> object:
return x + 1
def test_f():
assert f(0) == 1
| 0 | 1 | 0 | 0 | 1 | 0 |
examples/implicit_orientation_learning/demo.py | niqbal996/paz | 300 | 159301 | import os
import json
import argparse
from tensorflow.keras.utils import get_file
from sklearn.metrics.pairwise import cosine_similarity as measure
from paz.backend.camera import VideoPlayer, Camera
from scenes import DictionaryView
from model import AutoEncoder
from pipelines import ImplicitRotationPredictor
pars... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/fugue/column/test_expressions.py | kvnkho/fugue | 547 | 159333 | <filename>tests/fugue/column/test_expressions.py
import pyarrow as pa
from fugue.column import col, function, lit, null
from fugue.column.expressions import _get_column_mentions
from fugue.column.functions import coalesce
from pytest import raises
from triad import Schema, to_uuid
def test_named_col():
assert "*"... | 0 | 0 | 0 | 0 | 0 | 0 |
nmigen/vendor/lattice_ice40.py | psumesh/nmigen | 528 | 159352 | from amaranth.vendor.lattice_ice40 import *
from amaranth.vendor.lattice_ice40 import __all__
import warnings
warnings.warn("instead of nmigen.vendor.lattice_ice40, use amaranth.vendor.lattice_ice40",
DeprecationWarning, stacklevel=2)
| 0 | 0 | 0 | 0 | 0 | 0 |
eth_tester/utils/transactions.py | kclowes/eth-tester | 234 | 159363 | <reponame>kclowes/eth-tester
# TODO: Should this be moved to a common package like eth-utils?
from eth_utils import (
to_list,
)
VALID_TRANSACTION_PARAMS = [
'type',
'chain_id',
'from',
'to',
'gas',
'gas_price',
'max_fee_per_gas',
'max_priority_fee_per_gas',
'value',
'data'... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/r/test_pneumon.py | hajime9652/observations | 199 | 159414 | <reponame>hajime9652/observations<filename>tests/r/test_pneumon.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.pneumon import pneumon
def test_pneumon():
"""Test module pneumon.py by downl... | 0 | 0 | 0 | 0 | 0 | 0 |
influx-test/mytime.py | 1514louluo/influx-proxy | 130 | 159419 | <reponame>1514louluo/influx-proxy
import time
class mytime:
def fz(self, x):
# front zero
if x / 10 >= 1:
return str(x)
else:
return '0'+str(x)
def __init__(self, Y, M, D, h, m, s, ms=0, us=0, ns=0):
self.format_time = str(Y) + '-' + self.fz(M) + '-' + ... | 0 | 0 | 0 | 0 | 0 | 0 |
amla/train_eval/tf/evaluate.py | tremblerz/amla | 118 | 159431 | <filename>amla/train_eval/tf/evaluate.py
# Copyright 2018 Cisco Systems 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
#
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
openbox/utils/fanova/__version__.py | Dee-Why/lite-bo | 184 | 159446 | <gh_stars>100-1000
# License: MIT
"""
https://github.com/automl/fanova
"""
__version__ = "2.0.20.dev"
| 0 | 0 | 0 | 0 | 0 | 0 |
src/pretix/base/migrations/0188_delete_requiredaction.py | fabm3n/pretix | 1,248 | 159486 | <reponame>fabm3n/pretix<gh_stars>1000+
# Generated by Django 3.2.2 on 2021-05-13 18:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pretixbase', '0187_normalize_salutation'),
]
operations = [
migrations.DeleteModel(
name='Require... | 0 | 0 | 0 | 0 | 0 | 0 |
maha/constants/persian/compound.py | TRoboto/Maha | 152 | 159501 | <gh_stars>100-1000
"""List of Persian constant definitions."""
from __future__ import annotations
from .simple import *
PERSIAN_NUMBERS: list[str] = [
PERSIAN_ZERO,
PERSIAN_ONE,
PERSIAN_TWO,
PERSIAN_THREE,
PERSIAN_FOUR,
PERSIAN_FIVE,
PERSIAN_SIX,
PERSIAN_SEVEN,
PERSIAN_EIGHT,
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/interpolation/built_in_resolvers/test_legacy_env.py | sugatoray/omegaconf | 1,091 | 159527 | import re
from typing import Any
from pytest import mark, warns
from omegaconf import OmegaConf
def test_legacy_env_is_cached(monkeypatch: Any) -> None:
monkeypatch.setenv("FOOBAR", "1234")
c = OmegaConf.create({"foobar": "${env:FOOBAR}"})
with warns(UserWarning):
before = c.foobar
monke... | 4 | 2 | 0 | 0 | 6 | 0 |
tools/kapture_compute_distance_pairs.py | jkabalar/kapture-localization | 118 | 159534 | #!/usr/bin/env python3
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
import argparse
import logging
import os
import pathlib
from typing import Optional
import math
from tqdm import tqdm
import path_to_kapture_localization # noqa: F401
import kapture_localization.utils.logging
from kapture_localiza... | 10 | 0 | 0 | 0 | 10 | 0 |
libreasr/lib/layers/haste/lstm.py | johnpaulbin/LibreASR | 680 | 159563 | <reponame>johnpaulbin/LibreASR<filename>libreasr/lib/layers/haste/lstm.py<gh_stars>100-1000
# Copyright 2020 LMNT, 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
#
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_compat.py | sarah-vanderlaan/pyjwt | 5,079 | 159603 | from jwt.compat import constant_time_compare
from jwt.utils import force_bytes
class TestCompat:
def test_constant_time_compare_returns_true_if_same(self):
assert constant_time_compare(
force_bytes('abc'), force_bytes('abc')
)
def test_constant_time_compare_returns_false_if_diff_l... | 0 | 0 | 0 | 0 | 0 | 0 |
app_metrics/tests/settings.py | bencann-bubble/django-app-metrics | 121 | 159654 | import os
import django
BASE_PATH = os.path.dirname(__file__)
if django.VERSION[:2] >= (1, 3):
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
else:
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = ':memory:'
SITE_ID = 1
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_jsane.py | Mumbleskates/jsane | 131 | 159667 | <reponame>Mumbleskates/jsane
import json
import os
import sys
import pytest
import pep8
sys.path.insert(0, os.path.abspath(__file__ + "/../.."))
from jsane import loads, dumps, JSaneException, from_dict, from_object, new
from jsane.traversable import Traversable
class TestClass:
@pytest.fixture(autouse=True)
... | 0 | 0 | 0 | 0 | 0 | 0 |
engine/__init__.py | donnyyou/centerX | 350 | 159704 | from .defaults import CenterTrainer | 0 | 0 | 0 | 0 | 0 | 0 |
visualDet3D/networks/detectors/yolomono3d_core.py | jovialio/visualDet3D | 250 | 159713 | import numpy as np
import torch.nn as nn
import torch
import math
import time
from visualDet3D.networks.backbones import resnet
class YoloMono3DCore(nn.Module):
"""Some Information about YoloMono3DCore"""
def __init__(self, backbone_arguments: dict[object,object]=dict()):
super(YoloMono3DCore, self)._... | 1 | 1 | 0 | 0 | 2 | 0 |
custom_properties/03_FlowRegexProperties.py | IBM/api-samples | 172 | 159738 | #!/usr/bin/env python3
# This sample script demonstrates how to
# 1. get a list of flow regex properties
# 2. create a new flow regex property
# 3. get a flow regex property by id
# 4. update an existing flow regex property
# 5. start a find dependents task and check results when completed
# 6. start a deletion task to... | 0 | 0 | 0 | 0 | 0 | 0 |
biscuit/src/kernel/elfutil.py | whakapapa/biscuit | 2,062 | 159744 | #!/usr/bin/env python
import subprocess
class Seg:
def __init__(self, offset, va, filesz):
self.offset, self.va, self.filesz = offset, va, filesz
def contains(self, va):
if self.va <= va and self.va + self.filesz >= va:
return True
return False
class Pheads:
def __init__(self):
self.segs = []
def add(s... | 0 | 0 | 0 | 0 | 0 | 0 |
core/aliases.py | deathaxe/sublime-a-file-icon | 204 | 159746 | <filename>core/aliases.py
import os
import shutil
import sublime
from textwrap import dedent
from .icons import icons_json_content
from .utils import path
from .utils.logging import log, dump
__all__ = ["check", "enable", "disable"]
HAS_FIND_SYNTAX = hasattr(sublime, "list_syntaxes")
EMPTY_TEMPLATE = dedent(
"... | 0 | 0 | 0 | 0 | 0 | 0 |
Sorting/Pancake Sorting/Python3/pancake.py | iabhimanyu/Algorithms | 715 | 159749 | tutor = False
def pancakesort(array):
if len(array) <= 1:
return array
if tutor:
print()
for size in range(len(array), 1, -1):
maxindex = max(range(size), key=lamdba i: array[i])
if maxindex+1 != size:
if maxindex != 0:
if tutor:
... | 0 | 0 | 0 | 0 | 0 | 0 |
romp/lib/models/smpl_regressor.py | iory/ROMP | 385 | 159759 | import sys,os
import torch
import torch.nn as nn
import config
import numpy as np
from .smpl import SMPL
sys.path.append(os.path.abspath(__file__).replace('models/smpl_regressor.py',''))
from config import args
class SMPLR(nn.Module):
def __init__(self, use_gender: bool=False):
super(SMPLR, self).__init__... | 2 | 1 | 0 | 2 | 5 | 0 |
reviewboard/accounts/tests/test_privacy_form.py | amalik2/reviewboard | 921 | 159769 | <filename>reviewboard/accounts/tests/test_privacy_form.py
"""Unit tests for reviewboard.accounts.forms.pages.PrivacyForm."""
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from reviewboard.accounts.forms.pages import PrivacyForm
from ... | 0 | 0 | 0 | 0 | 0 | 0 |
sc2/cache.py | awesome-archive/python-sc2 | 621 | 159773 | <gh_stars>100-1000
from functools import wraps
def cache_forever(f):
f.cache = {}
@wraps(f)
def inner(*args):
if args not in f.cache:
f.cache[args] = f(*args)
return f.cache[args]
return inner
def property_cache_forever(f):
f.cached = None
@wraps(f)
def inn... | 0 | 0 | 0 | 0 | 0 | 0 |
3_A2C_DDPG/ddpg/model.py | dongminlee94/Samsung-DRL-Code | 116 | 159807 | import torch
import torch.nn as nn
class Actor(nn.Module):
def __init__(self, state_size, action_size, args):
super(Actor, self).__init__()
self.fc1 = nn.Linear(state_size, args.hidden_size)
self.fc2 = nn.Linear(args.hidden_size, args.hidden_size)
self.fc3 = nn.Linear(args.hidden_si... | 0 | 2 | 0 | 0 | 2 | 0 |
.github/workflows/update-tests/update.py | saschanaz/bikeshed | 775 | 159828 | <filename>.github/workflows/update-tests/update.py
import base64
import fnmatch
import os
import re
import time
from datetime import datetime
from github import Github
from github.GithubException import GithubException
this_dir = os.path.dirname(__file__)
root_dir = os.path.join(
this_dir,
"..",
"..",
... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/core/minos-microservice-networks/minos/networks/brokers/subscribers/filtered/validators/duplicates/database/impl.py | minos-framework/minos-python | 247 | 159841 | <reponame>minos-framework/minos-python
from __future__ import (
annotations,
)
from typing import (
Optional,
)
from uuid import (
UUID,
)
from minos.common import (
Builder,
Config,
DatabaseMixin,
IntegrityException,
)
from ..abc import (
BrokerSubscriberDuplicateValidator,
)
from .f... | 0 | 0 | 0 | 0 | 0 | 0 |
ipypublish/tests/test_convert_with_ipywidget.py | parmentelat/ipypublish | 220 | 159855 | <gh_stars>100-1000
import sys
import pytest
@pytest.mark.skipif(
sys.version_info[:2] == (3, 5), reason="json_dumps puts keys in different order"
)
@pytest.mark.ipynb("nb_with_ipywidget") # , out_to_temp=False)
def test_ipywidget_sphinx_rst(ipynb_app):
"""The notebook contains an ipywidgets and the widget s... | 0 | 0 | 0 | 0 | 0 | 0 |
graphconv/util.py | DomhnallBoyle/octopus | 213 | 159862 | <filename>graphconv/util.py
import numpy as np
import tensorflow as tf
import scipy.sparse as sp
from scipy.sparse.linalg.eigen.arpack import eigsh
# Code partly taken from https://github.com/tkipf/gcn.
# The following license applies:
#
# The MIT License
#
# Copyright (c) 2016 <NAME>
#
# Permission is hereby granted,... | 0 | 0 | 0 | 0 | 0 | 0 |
helios/datatypes/core.py | thiagosfs/helios-server | 525 | 159875 | <filename>helios/datatypes/core.py
"""
core data types
"""
from helios.datatypes import LDObject
class BigInteger(LDObject):
"""
A big integer is an integer serialized as a string.
We may want to b64 encode here soon.
"""
WRAPPED_OBJ_CLASS = int
def toDict(self, complete=False):
i... | 0 | 0 | 0 | 0 | 0 | 0 |
library/Box2D/examples/conveyor_belt.py | jarl-haggerty/pybox2d | 421 | 159911 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# C++ version Copyright (c) 2006-2007 <NAME> http://www.box2d.org
# Python version by <NAME> / sirkne at gmail dot com
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising ... | 0 | 0 | 1 | 1 | 2 | 0 |
bindings/pydeck/examples/grid_layer.py | StijnAmeloot/deck.gl | 7,702 | 159912 | <reponame>StijnAmeloot/deck.gl<gh_stars>1000+
"""
GridLayer
============
Locations of bike parking within San Francisco.
Adapted from the deck.gl documentation.
"""
import pydeck as pdk
import pandas as pd
CPU_GRID_LAYER_DATA = (
"https://raw.githubusercontent.com/uber-common/" "deck.gl-data/master/website/sf-b... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/st/pynative/test_pynative_mindarmour.py | GuoSuiming/mindspore | 3,200 | 159940 | <reponame>GuoSuiming/mindspore<gh_stars>1000+
# 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
#
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_html_parser.py | isarth/sumy | 2,880 | 159946 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from sumy._compat import to_unicode
from sumy.nlp.tokenizers import Tokenizer
from sumy.parsers.html import HtmlParser
from .utils import expand_resource_path
def test_annotated_text():
path = expand_resou... | 0 | 0 | 0 | 0 | 0 | 0 |
learntools/python/luigi_analysis.py | roannav/learntools | 359 | 159948 | full_dataset = [
{'name': 'Peach', 'items': ['green shell', 'banana', 'green shell',], 'finish': 3},
{'name': 'Peach', 'items': ['green shell', 'banana', 'green shell',], 'finish': 1},
{'name': 'Bowser', 'items': ['green shell',], 'finish': 1},
{'name': None, 'items': ['green shell',], 'finish': 2},
... | 0 | 0 | 0 | 0 | 0 | 0 |
viseron/motion/background_subtractor/config.py | dadaloop82/viseron | 399 | 159949 | """Background subtractor motion detection config."""
from voluptuous import All, Any, Coerce, Optional, Range
from viseron.motion import AbstractMotionDetectionConfig
from .const import ALPHA, AREA, THRESHOLD
SCHEMA = AbstractMotionDetectionConfig.SCHEMA.extend(
{
Optional("area", default=AREA): All(
... | 0 | 3 | 0 | 0 | 3 | 0 |
tools/perf/page_sets/rendering/key_desktop_move_cases.py | zealoussnow/chromium | 14,668 | 159952 | # Copyright 2015 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.
from __future__ import annotations
from telemetry.page import shared_page_state
from page_sets.login_helpers import google_login
from page_sets.rendering imp... | 6 | 1 | 8 | 1 | 16 | 0 |
heat/engine/resources/openstack/sahara/image.py | noironetworks/heat | 265 | 159957 | <reponame>noironetworks/heat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 0 | 0 | 0 | 0 | 0 | 0 |
arm/migrations/versions/9cae4aa05dd7_create_settingsui_table.py | charmarkk/automatic-ripping-machine | 123 | 159963 | """create settingsui table
Revision ID: 9cae4aa05dd7
Revises: <PASSWORD>
Create Date: 2021-03-11 23:55:12.428608
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9cae4aa05dd7'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
... | 0 | 0 | 0 | 0 | 0 | 0 |
ptsites/sites/ptsbao.py | kbnq/flexget_qbittorrent_mod | 202 | 160008 | <reponame>kbnq/flexget_qbittorrent_mod<gh_stars>100-1000
from ..schema.nexusphp import VisitHR
from ..utils.net_utils import NetUtils
class MainClass(VisitHR):
URL = 'https://ptsbao.club/'
USER_CLASSES = {
'downloaded': [805306368000, 3298534883328],
'share_ratio': [3.05, 4.55],
'days':... | 0 | 0 | 0 | 0 | 0 | 0 |
applications/graph/node2vec/data/data_readers.py | jonesholger/lbann | 194 | 160020 | <gh_stars>100-1000
import os.path
import lbann
def make_online_data_reader(
graph_file,
epoch_size,
walk_length=80,
return_param=0.25,
inout_param=0.25,
num_negative_samples=5,
):
reader = lbann.reader_pb2.DataReader()
_reader = reader.reader.add()
_reader.n... | 0 | 0 | 0 | 0 | 0 | 0 |
hand_detector/yolo/utils/info.py | congtranv/Unified-Gesture-and-Fingertip-Detection | 200 | 160037 | import os
def data_info(type: str='train') -> object:
dataset_directory = '../../../EgoGesture Dataset/'
folder_names = ['SingleOne', 'SingleTwo', 'SingleThree', 'SingleFour', 'SingleFive', 'SingleSix', 'SingleSeven',
'SingleEight']
if type is 'train':
nTrain = 0
for f... | 1 | 1 | 0 | 0 | 2 | 0 |
rotkehlchen/tests/unit/accounting/test_transactions.py | rotkehlchenio/rotkehlchen | 137 | 160055 | """This file should probably be split into basic & per protocol accounting test files if too big"""
import pytest
from rotkehlchen.accounting.ledger_actions import LedgerAction, LedgerActionType
from rotkehlchen.accounting.mixins.event import AccountingEventType
from rotkehlchen.accounting.pnl import PNL, PnlTotals
f... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/core_symbol.py | pokerman9527/eos | 191 | 160061 | CORE_SYMBOL='SYS'
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/text.py | pzahemszky/guizero | 320 | 160068 | from guizero import App, Text
a = App()
a.font = "courier new"
t1 = Text(a)
t1.value = "{}, {}, {}".format(t1.font, t1.text_size, t1.text_color)
t2 = Text(a, font="arial")
t2.value = "{}, {}, {}".format(t2.font, t2.text_size, t2.text_color)
t3 = Text(a, color="red", size=8, font="verdana")
t3.value = "{}, {}, {}".f... | 0 | 0 | 0 | 0 | 0 | 0 |
geolocations_service/service/brumadinho/migrations/0002_auto_20190129_2219.py | JBezerra/brumadinho_location | 666 | 160118 | # Generated by Django 2.1.3 on 2019-01-29 22:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('brumadinho', '0001_initial'),
]
operations: list[object] = [
migrations.CreateModel(... | 0 | 0 | 2 | 0 | 2 | 0 |
python/re-group-groups.py | gajubadge11/HackerRank-1 | 340 | 160128 | #!/usr/bin/env python3
import re
if __name__ == "__main__":
string = input()
match = re.search(r'([a-zA-Z0-9])\1+', string)
print(match.group(1) if match else -1)
| 0 | 0 | 0 | 0 | 0 | 0 |
qf_lib/data_providers/bloomberg/tabular_data_provider.py | webclinic017/qf-lib | 198 | 160132 | <gh_stars>100-1000
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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 |
src/functions/test_lambda_expressions.py | ckr0/learn-python | 12,869 | 160136 | """Lambda Expressions
@see: https://docs.python.org/3/tutorial/controlflow.html#lambda-expressions
Small anonymous functions can be created with the lambda keyword. Lambda functions can be used
wherever function objects are required. They are syntactically restricted to a single expression.
Semantically, they are jus... | 0 | 2 | 0 | 0 | 2 | 0 |
django_slowtests/testrunner.py | drewbrew/django-slow-tests | 177 | 160145 | <reponame>drewbrew/django-slow-tests
import glob
import json
import time
import os
import os.path
from unittest import TestSuite, TestLoader
from unittest.runner import TextTestRunner, registerResult
from unittest.suite import _isnotsuite
from django.test.runner import DiscoverRunner
from django.conf import settings
... | 0 | 0 | 0 | 0 | 0 | 0 |
idaes/dmf/propdata.py | carldlaird/idaes-pse | 112 | 160157 | #################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | 10 | 17 | 3 | 1 | 31 | 0 |
server/plugins/ardinfo/ard_info.py | nathandarnell/sal | 215 | 160176 | from server.models import PluginScriptRow
import sal.plugin
class ARDInfo(sal.plugin.DetailPlugin):
description: str = "Apple Remote Desktop's Computer Information Fields"
supported_os_families: list[object] = [sal.plugin.OSFamilies.darwin]
def get_context(self, machine, **kwargs) -> object:
c... | 0 | 1 | 2 | 0 | 3 | 0 |
opy/_regtest/src/build/testdata/future_import.py | Schweinepriester/oil | 2,209 | 160207 | <filename>opy/_regtest/src/build/testdata/future_import.py
#!/usr/bin/env python
"""
future_import.py
"""
from __future__ import print_function
print('future print')
| 0 | 0 | 0 | 0 | 0 | 0 |
components/espcoredump/corefile/soc_headers/esp32s2.py | lovyan03/esp-idf | 8,747 | 160236 | SOC_IRAM_LOW = 0x40020000
SOC_IRAM_HIGH = 0x40070000
SOC_DRAM_LOW = 0x3ffb0000
SOC_DRAM_HIGH = 0x40000000
SOC_RTC_DRAM_LOW = 0x3ff9e000
SOC_RTC_DRAM_HIGH = 0x3ffa0000
SOC_RTC_DATA_LOW = 0x50000000
SOC_RTC_DATA_HIGH = 0x50002000
| 0 | 0 | 0 | 0 | 0 | 0 |
crane/exc.py | dmksnnk/crane | 102 | 160239 | class UpgradeFailed(Exception):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
data/migrations/deb/1_3_433_to_1_3_434.py | Rob-S/indy-node | 627 | 160266 | <reponame>Rob-S/indy-node
#!/usr/bin/python3.5
import sys
import traceback
from stp_core.common.log import getlogger
logger = getlogger()
ENV_FILE_PATH = "/etc/indy/indy.env"
node_ip_key = 'NODE_IP'
client_ip_key = 'NODE_CLIENT_IP'
def are_ips_present_in_env():
node_ip_present = False
client_ip_present = ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/nonrealtime/test_nonrealtime_Node_get_parent.py | butayama/supriya | 191 | 160303 | <gh_stars>100-1000
import pytest
import supriya.nonrealtime
def test_01():
"""
With Session.at(...) context manager.
"""
session = supriya.nonrealtime.Session()
with session.at(0):
group_one = session.add_group()
group_two = session.add_group()
node = group_one.add_synth()... | 0 | 0 | 0 | 0 | 0 | 0 |
Examples/Space Frame - Nodal Loads 2.py | geosharma/PyNite | 199 | 160310 | # A First Course in the Finite Element Method, 4th Edition
# <NAME>
# Problem 5.58
# Units for this model are kips and inches
# Import 'FEModel3D' and 'Visualization' from 'PyNite'
from PyNite import FEModel3D
from PyNite import Visualization
# Create a new model
frame = FEModel3D()
# Define the nodes
frame.add_node... | 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.