max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 7 115 | max_stars_count int64 101 368k | id stringlengths 2 8 | content stringlengths 6 1.03M |
|---|---|---|---|---|
Introducing_Trinket_M0/Trinket_AnalogIn.py | joewalk102/Adafruit_Learning_System_Guides | 665 | 11078855 | # Trinket IO demo - analog inputs
import time
import board
from analogio import AnalogIn
analog0in = AnalogIn(board.D0)
analog1in = AnalogIn(board.D1)
analog2in = AnalogIn(board.D2)
analog3in = AnalogIn(board.D3)
analog4in = AnalogIn(board.D4)
def getVoltage(pin):
return (pin.value * 3.3) / 65536
while True:... |
automl/cvt_hparam_file.py | HatsuneMiku4/PocketFlow | 2,724 | 11078871 | # Tencent is pleased to support the open source community by making PocketFlow available.
#
# Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... |
deep-rl/lib/python2.7/site-packages/OpenGL/raw/GLES2/NV/non_square_matrices.py | ShujaKhalid/deep-rl | 210 | 11078884 | <reponame>ShujaKhalid/deep-rl
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES2 import _types as _cs
# End users want this...
from OpenGL.raw.GLES2._types import *
from OpenGL.raw.GLES2 import _errors
from OpenGL.constant... |
Chapter10/unittest_demo/test_mycalc.py | JTamarit/Tkinter_libro | 173 | 11078915 | <reponame>JTamarit/Tkinter_libro<filename>Chapter10/unittest_demo/test_mycalc.py<gh_stars>100-1000
import mycalc
import unittest
from unittest.mock import Mock, patch
class TestMyCalc(unittest.TestCase):
def setUp(self):
self.mycalc1_0 = mycalc.MyCalc(1, 0)
self.mycalc36_12 = mycalc.MyCalc(36, 12)... |
tests/test_bigoven.py | mathiazom/recipe-scrapers | 811 | 11078962 | from recipe_scrapers.bigoven import BigOven
from tests import ScraperTest
class TestBigOven(ScraperTest):
scraper_class = BigOven
def test_host(self):
self.assertEqual("bigoven.com", self.harvester_class.host())
def test_canonical_url(self):
self.assertEqual(
"https://www.bi... |
mindinsight/mindconverter/forward_call.py | fapbatista/mindinsight | 216 | 11079000 | <gh_stars>100-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
#
# Unless required by applicab... |
peering/migrations/0060_auto_20200718_0023.py | schiederme/peering-manager | 173 | 11079035 | <filename>peering/migrations/0060_auto_20200718_0023.py<gh_stars>100-1000
# Generated by Django 3.0.8 on 2020-07-17 22:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("peering", "0059_router_last_deployment_id")]
operations = [
migrations.AlterFie... |
carball/analysis/stats/possession/turnovers.py | unitedroguegg/carball | 119 | 11079095 | from typing import Dict
import pandas as pd
from carball.generated.api.stats.events_pb2 import Hit
from ....analysis.constants.field_constants import FieldConstants
from ....analysis.stats.stats import HitStat
from ....generated.api import game_pb2
from ....generated.api.player_pb2 import Player
from ....json_parser.... |
utils/lrn_rate_utils.py | siddsax/PocketFlow | 2,724 | 11079096 | # Tencent is pleased to support the open source community by making PocketFlow available.
#
# Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... |
packages/fetchai/skills/http_echo/handlers.py | bryanchriswhite/agents-aea | 126 | 11079127 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... |
tests/r/test_quakes.py | hajime9652/observations | 199 | 11079131 | <filename>tests/r/test_quakes.py<gh_stars>100-1000
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.quakes import quakes
def test_quakes():
"""Test module quakes.py by downloading
quakes.csv... |
simulation/decai/simulation/contract/incentive/tests/test_prediction_market.py | boost-entropy-python/0xDeCA10B | 445 | 11079135 | import unittest
from collections import defaultdict
from typing import cast
from injector import Injector
from decai.simulation.contract.balances import Balances
from decai.simulation.contract.classification.perceptron import PerceptronModule
from decai.simulation.contract.data.data_handler import StoredData
from dec... |
sdk/search/azure-search-documents/azure/search/documents/aio/_timer.py | rsdoherty/azure-sdk-for-python | 2,728 | 11079137 | <reponame>rsdoherty/azure-sdk-for-python
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------... |
qt4i/driver/tools/dt.py | beijixing0202/QT4i | 209 | 11079144 | # -*- coding:utf-8 -*-
#
# Tencent is pleased to support the open source community by making QTA available.
# Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the BSD 3-Clause License (the "License"); you may not use this
# file except in compliance with the License. You may ... |
unfurl/parsers/parse_ksuid.py | jakuta-tech/unfurl | 449 | 11079152 | <reponame>jakuta-tech/unfurl<filename>unfurl/parsers/parse_ksuid.py
# Copyright 2019 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.apache.org/licenses/LICENSE... |
observations/r/nwtco.py | hajime9652/observations | 199 | 11079190 | <filename>observations/r/nwtco.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def nwtco(path):
"""Data from the Natio... |
tests/test_02_dxf_graphics/test_223_ray.py | jkjt/ezdxf | 515 | 11079205 | # Copyright (c) 2019 <NAME>
# License: MIT License
# created 2019-03-05
import pytest
from ezdxf.entities.xline import Ray
from ezdxf.lldxf.tagwriter import TagCollector, basic_tags_from_text
RAY = """0
RAY
5
0
330
0
100
AcDbEntity
8
0
100
AcDbRay
10
0.0
20
0.0
30
0.0
11
1.0
21
0.0
31
0.0
"""
@pytest.fixture
def en... |
lyvi/metadata.py | randrej/lyvi | 127 | 11079219 | <reponame>randrej/lyvi
# Copyright (c) 2013 <NAME> <ok100 at openmailbox dot org>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See the COPYING file for more details.
"""Metadata-related code... |
blender/arm/logicnode/deprecated/LN_pause_action.py | onelsonic/armory | 2,583 | 11079225 | from arm.logicnode.arm_nodes import *
@deprecated('Set Action Paused')
class PauseActionNode(ArmLogicTreeNode):
"""Pauses the given action."""
bl_idname = 'LNPauseActionNode'
bl_label = 'Pause Action'
bl_description = "Please use the \"Set Action Paused\" node instead"
arm_category = 'Animation'
... |
benchmark/sudoku/or-tools.py | matbesancon/ConstraintSolver.jl | 120 | 11079238 | <gh_stars>100-1000
import sys
import time
import numpy as np
from ortools.sat.python import cp_model
def from_file(filename, sep='\n'):
"Parse a file into a list of strings, separated by sep."
lines = open(filename).read().strip().split(sep)
grids = []
for line in lines:
line = line.replace(".","0")
g... |
scripts/data_acquisition.py | judexzhu/dzhops | 202 | 11079262 | <reponame>judexzhu/dzhops
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Guibin created on 2015/10/21
# version: 0.01
from __future__ import division
import MySQLdb
import subprocess
import math
from decimal import Decimal
# mysql
host = '数据库地址'
db = '库名'
user = '用户'
pw = '密码'
port = 端口
# snmp command
sysone = "snmpget... |
tests/test_recurrence.py | mraihan19/AgentNet | 337 | 11079271 | """
tests for recurrence class
"""
import numpy as np
import theano
import agentnet
from agentnet.memory import RNNCell,GRUCell, LSTMCell
import lasagne
from lasagne.layers import *
def test_recurrence():
"""minimalstic test"""
sequence = InputLayer((None, None, 3), name='input sequence')
initial = InputL... |
tests/forte/processors/stave_processor_test.py | zhanyuanucb/forte | 163 | 11079294 | # Copyright 2021 The Forte Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
py/tests/test_crashprobe.py | unclead/symbolic | 300 | 11079302 | <filename>py/tests/test_crashprobe.py
import os
import json
import pprint
import pytest
from symbolic import arch_get_ip_reg_name
TEST_PARAMETER = [
("1.4.1", "release", "arm64"),
("1.4.1", "release", "armv7"),
("1.4.1", "release", "x86_64"),
("1.4.1", "debug", "arm64"),
("1.4.1", "debug", "armv7... |
codeformatter/scssformatter.py | ephenyxshop/sublimetext-codeformatter | 676 | 11079358 | <filename>codeformatter/scssformatter.py
# @author <NAME>
# @copyright No Copyright, use it and modify for betterment
# This is a modified version of cssformatter.py
import re
import scssbeautifier
class ScssFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.op... |
tests/unit_tests/explainer/test_smart_state.py | amnaabbassi/shapash | 1,665 | 11079402 | <reponame>amnaabbassi/shapash<filename>tests/unit_tests/explainer/test_smart_state.py<gh_stars>1000+
"""
Unit test smart state
"""
import unittest
from unittest.mock import patch, Mock
import pandas as pd
import numpy as np
from shapash.explainer.smart_state import SmartState
class TestSmartState(unittest.TestCase):
... |
docs/tutorials/notebook_tests.py | RdecKa/bark | 174 | 11079411 | import unittest
import glob
import os
import os.path
class NotebookTests(unittest.TestCase):
@unittest.skip
def test_run_converted_notebook(self):
notebook_list = glob.glob("docs/tutorials/*.ipynb")
exclude_notebooks_list = ["02_maps", "05_Benchmarking"]
for full_notebook_name in notebook_list:
... |
src/bindings/build.py | isabella232/pynacl | 756 | 11079427 | # Copyright 2013 <NAME> and individual contributors
#
# 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 agr... |
corehq/apps/userreports/transforms/custom/numeric.py | dimagilg/commcare-hq | 471 | 11079477 | def get_short_decimal_display(num):
try:
if num % 1 == 0:
return int(num)
return round(num, 2)
except:
return num
|
flash/pointcloud/segmentation/open3d_ml/sequences_dataset.py | Actis92/lightning-flash | 1,457 | 11079492 | <filename>flash/pointcloud/segmentation/open3d_ml/sequences_dataset.py
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/li... |
ritsar/phsTools.py | mtho1/RITSAR | 133 | 11079516 | #Include dependencies
import numpy as np
from numpy import exp, pi
from numpy.linalg import norm
from . import signal as sig
from . signal import RECT
def simulate_phs(platform, points = [[0,0,0]], amplitudes = [1]):
##############################################################################
# ... |
release/stubs.min/Autodesk/__init__.py | htlcnn/ironpython-stubs | 182 | 11079536 | <gh_stars>100-1000
# encoding: utf-8
# module Autodesk
# from RevitAPI,Version=172.16.31.10,Culture=neutral,PublicKeyToken=null,RevitAPIUI,Version=172.16.31.10,Culture=neutral,PublicKeyToken=null
# by generator 1.145
# no doc
# no imports
# no functions
# no classes
# variables with complex values
|
milano/search_algorithms/gp/spearmint/utils.py | NVIDIA/Milano | 145 | 11079580 | <gh_stars>100-1000
# ##
# # Copyright (C) 2012 <NAME>, <NAME> and <NAME>
# #
# # This code is written for research and educational purposes only to
# # supplement the paper entitled "Practical Bayesian Optimization of
# # Machine Learning Algorithms" by Snoek, Larochelle and Adams Advances
# # in Neural Information Pro... |
gaphor/ui/tests/test_notifier.py | bertob/gaphor | 867 | 11079584 | import pytest
from gaphor.ui.event import Notification
from gaphor.ui.mainwindow import new_builder
from gaphor.ui.notification import InAppNotifier
@pytest.fixture
def builder():
return new_builder()
@pytest.fixture
def in_app_notifier(builder):
return InAppNotifier(builder)
def test_notifier_has_widget... |
parl/remote/zmq_utils.py | lp2333/PARL | 3,172 | 11079585 | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
setup.py | teleological/bulbs | 234 | 11079605 | """
Bulbs
-----
Bulbs is a Python persistence framework for graph databases that
connects to Neo4j Server, Rexster, OrientDB, Lightsocket, and more.
"""
import sys
from setuptools import Command, setup, find_packages
class run_audit(Command):
"""Audits source code using PyFlakes for following issues:
- N... |
infra/bots/assets/mockery/create.py | travisleithead/skia | 6,304 | 11079615 | #!/usr/bin/env python
#
# Copyright 2020 Google LLC.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Create the asset."""
import argparse
import subprocess
import os
URL = "https://github.com/vektra/mockery/releases/download/v2.4.0/mockery_2.4.0_Linux_x86... |
convlab2/policy/vhus/util.py | Malavikka/ConvLab-2 | 339 | 11079653 | <reponame>Malavikka/ConvLab-2
from copy import deepcopy
import numpy as np
import torch
def padding(old, l):
"""
pad a list of different lens "old" to the same len "l"
"""
new = deepcopy(old)
for i, j in enumerate(new):
new[i] += [0] * (l - len(j))
new[i] = j[:l]
return new
def... |
service/provider/TextImgProvider.py | BboyHanat/TextGenerator | 166 | 11079661 | <reponame>BboyHanat/TextGenerator
import os
import time
from typing import List
from constant import const
from utils.decorator import singleton
from utils.random_tools import Random
from core.element.CharImg import CharImg
from core.element.TextImg import create, gen_batch_char_obj, TYPE_ORIENTATION_HORIZONTAL, TYPE_O... |
plugin.py | leontrolski/dnjs | 125 | 11079667 | <reponame>leontrolski/dnjs
import icdiff
from prettyprinter import install_extras, pformat
install_extras()
def pretty_compare(config, op, left, right):
very_verbose = config.option.verbose >= 2
if not very_verbose:
return None
if op != "==":
return None
try:
if abs(left + r... |
lldb/packages/Python/lldbsuite/test/functionalities/postmortem/wow64_minidump/TestWow64MiniDump.py | dan-zheng/llvm-project | 765 | 11079673 | """
Test basics of a mini dump taken of a 32-bit process running in WoW64
WoW64 is the subsystem that lets 32-bit processes run in 64-bit Windows. If you
capture a mini dump of a process running under WoW64 with a 64-bit debugger, you
end up with a dump of the WoW64 layer. In that case, LLDB must do extra work to
ge... |
jmilkfansblog/api/wsgi_app.py | xiaoyh121/program | 176 | 11079694 | import pecan
from jmilkfansblog.api import config as api_config
def get_pecan_config():
"""Load the Pecan config from config.py."""
filename = api_config.__file__.replace('.pyc', '.py')
return pecan.configuration.conf_from_file(filename)
def setup_app(config=None):
"""Create a WSGI application obj... |
sentence_lstm.py | msi1427/sentence-classification | 204 | 11079711 | <reponame>msi1427/sentence-classification
'''
Written by <NAME>
Last Edit: January 2, 2018
For use on austingwalters.com
An LSTM based RNN to classify
of the common sentance types:
Question, Statement, Command, Exclamation
'''
from __future__ import print_function
import numpy as np
import keras
from sentence_typ... |
recognition/arcface_paddle/static/backbones/iresnet.py | qaz734913414/insightface | 12,377 | 11079726 | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
__scraping__/steamdb.info/main.py | whitmans-max/python-examples | 140 | 11079737 | #!/usr/bin/env python3
# date: 2020.05.17
import requests
from bs4 import BeautifulSoup
headers = {
"User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0",
}
result = requests.get("https://steamdb.info/upcoming/free/", headers=headers)
soup = BeautifulSoup(result.content, 'lxml')
#... |
tools/perf/benchmarks/wasmpspdfkit.py | zealoussnow/chromium | 14,668 | 11079740 | # 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.
"""The WebAssembly benchmark of PSPDFKit
The PSPDFKit benchmark measures rendering of and interactions on a pdf file.
"""
from telemetry import benchmark
fro... |
starry/_core/ops/limbdark/base_op.py | shashankdholakia/starry | 116 | 11079748 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from ....compat import COp
from ....starry_version import __version__
import sys
import pkg_resources
__all__ = ["LimbDarkBaseOp"]
class LimbDarkBaseOp(COp):
__props__ = ()
func_file = None
func_name = None
def __init__(self):
super(LimbDarkBaseOp... |
nimfa/methods/factorization/lfnmf.py | askerdb/nimfa | 325 | 11079760 | <filename>nimfa/methods/factorization/lfnmf.py
"""
#######################################
Lfnmf (``methods.factorization.lfnmf``)
#######################################
**Fisher Nonnegative Matrix Factorization for learning Local features (LFNMF)**
[Wang2004]_.
LFNMF is based on nonnegative matrix factorization (N... |
scripts/automation/trex_control_plane/interactive/trex/wireless/trex_wireless_traffic_handler_rpc.py | timgates42/trex-core | 956 | 11079763 | <reponame>timgates42/trex-core<filename>scripts/automation/trex_control_plane/interactive/trex/wireless/trex_wireless_traffic_handler_rpc.py
from .trex_wireless_rpc_message import *
class TrafficHandlerCall(RPCMessage):
"""Represents a Remote Call from WirelessManager to a WirelessWorker."""
TYPE = "cmd"
... |
catalyst/metrics/__init__.py | tadejsv/catalyst | 206 | 11079770 | <gh_stars>100-1000
# flake8: noqa
# import order:
# functional
# core metrics
# metrics
from catalyst.metrics.functional import *
from catalyst.metrics._metric import (
ICallbackBatchMetric,
ICallbackLoaderMetric,
IMetric,
)
from catalyst.metrics._accumulative import AccumulativeMetric
from catalyst.metri... |
tempest/api/compute/admin/test_networks.py | rishabh20111990/tempest | 254 | 11079791 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... |
tests/http_parser_test.py | Adrijaned/weechat-matrix | 773 | 11079792 | <reponame>Adrijaned/weechat-matrix
import html.entities
from hypothesis import given
from hypothesis.strategies import sampled_from
from matrix.colors import MatrixHtmlParser
try:
# python 3
html_entities = [(name, char, ord(char))
for name, char in html.entities.html5.items()
... |
scripts/external_libs/scapy-2.4.5/scapy/config.py | dariusgrassi/trex-core | 250 | 11079794 | <filename>scripts/external_libs/scapy-2.4.5/scapy/config.py
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) <NAME> <<EMAIL>>
# This program is published under a GPLv2 license
"""
Implementation of the configuration object.
"""
from __future__ import absolut... |
qiskit/transpiler/passes/layout/vf2_post_layout.py | t-imamichi/qiskit-core | 1,456 | 11079807 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
DQMOffline/JetMET/python/METAnalyzer_cff.py | ckamtsikis/cmssw | 852 | 11079809 | <reponame>ckamtsikis/cmssw
import FWCore.ParameterSet.Config as cms
from DQMOffline.JetMET.metDQMConfig_cfi import *
METAnalyzerSequence = cms.Sequence(METAnalyzer)
|
src/genie/libs/parser/iosxe/tests/ShowSpanningTreeSummary/cli/equal/golden_output_mstp_single_mst_expected.py | balmasea/genieparser | 204 | 11079822 | <reponame>balmasea/genieparser<filename>src/genie/libs/parser/iosxe/tests/ShowSpanningTreeSummary/cli/equal/golden_output_mstp_single_mst_expected.py
expected_output = {
"backbone_fast": False,
"bpdu_filter": False,
"bpdu_guard": False,
"bridge_assurance": True,
"configured_pathcost": {"method": "sh... |
overloading.py | gimntut/overloading.py | 122 | 11079827 | <filename>overloading.py<gh_stars>100-1000
"""
--------------
overloading.py
--------------
Function overloading for Python 3
* Project repository: https://github.com/bintoro/overloading.py
* Documentation: https://overloading.readthedocs.org/
Copyright © 2014–2016 <NAME>. Released under the MIT License.
"""
__ver... |
code/create_ppt.py | solicia-xu/pbpython | 1,846 | 11079901 | """
See http://pbpython.com/creating-powerpoint.html for details on this script
Requires https://python-pptx.readthedocs.org/en/latest/index.html
Example program showing how to read in Excel, process with pandas and
output to a PowerPoint file.
"""
from __future__ import print_function
from pptx import Presentation
f... |
contrib/AutoNUE/tools/IDD_labeling.py | JamesLim-sy/PaddleSeg | 4,708 | 11079957 | import os
import numpy as np
import cv2
from PIL import Image
from paddleseg import utils
import xml.dom.minidom
def mkdir(path):
sub_dir = os.path.dirname(path)
if not os.path.exists(sub_dir):
os.makedirs(sub_dir)
def get_image_list(image_path):
"""Get image list"""
valid_suffix = [
... |
Python/Tests/TestData/SendToInteractive/Delayed.py | techkey/PTVS | 404 | 11079961 | <gh_stars>100-1000
import time
if True:
time.sleep(5)
pass
if True:
x = 1
y = 2
print('hi')
|
vumi/transports/cellulant/tests/test_cellulant.py | seidu626/vumi | 199 | 11079969 | <reponame>seidu626/vumi<filename>vumi/transports/cellulant/tests/test_cellulant.py
from urllib import urlencode
from twisted.internet.defer import inlineCallbacks
from vumi.tests.helpers import VumiTestCase
from vumi.transports.cellulant import CellulantTransport, CellulantError
from vumi.message import TransportUser... |
compiler/verify/none.py | im-world/OpenRAM | 335 | 11079972 | <reponame>im-world/OpenRAM<filename>compiler/verify/none.py
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights ... |
jointD/test.py | thunlp/JointNRE | 186 | 11079974 | <filename>jointD/test.py
import tensorflow as tf
import numpy as np
import time
import datetime
import os
import network
import json
import sys
from sklearn.metrics import average_precision_score
import ctypes
export_path = "../data/"
word_vec = np.load(export_path + 'vec.npy')
f = open(export_path + "config", 'r')
c... |
CalibTracker/SiStripCommon/test/testProduceCalibrationTree_cfg.py | ckamtsikis/cmssw | 852 | 11079984 | from __future__ import print_function
import FWCore.ParameterSet.Config as cms
from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpGENSIMRECO
import FWCore.ParameterSet.VarParsing as VarParsing
from CalibTracker.SiStripCommon.shallowTree_test_template import *
####################################... |
rmgpy/test_data/testing_database/kinetics/families/Singlet_Val6_to_triplet/training/reactions.py | tza0035/RMG-Py | 250 | 11080015 | #!/usr/bin/env python
# encoding: utf-8
name = "Singlet_Val6_to_triplet/training"
shortDesc = "Kinetics used to train group additivity values"
longDesc = """
"""
entry(
index = 1,
label = "O2(S) => O2(T)",
degeneracy = 1,
reversible = False,
kinetics = Arrhenius(A=(4.5E+10, 's^-1'), n=0, Ea=(397, ... |
tests/test_io.py | natphi/eemeter | 161 | 11080022 | <reponame>natphi/eemeter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2014-2019 OpenEEmeter contributors
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://ww... |
aiogram/types/mixins.py | twistfire92/aiogram | 2,744 | 11080042 | import os
import pathlib
from io import IOBase
from typing import Union, Optional
from aiogram.utils.deprecated import warn_deprecated
class Downloadable:
"""
Mixin for files
"""
async def download(
self,
destination=None,
timeout=30,
chunk_size=65536,... |
astroquery/hitran/__init__.py | hdevillepoix/astroquery | 577 | 11080063 | <gh_stars>100-1000
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
HITRAN Catalog Query Tool
-------------------------
:Author: <NAME> (<EMAIL>)
"""
import os
from astropy import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.hitran`.
... |
test_regression.py | morenoh149/deeplearning | 122 | 11080094 | <gh_stars>100-1000
from unittest import TestCase
from regression import *
class TestRegression(TestCase):
def test_train_linear_regression(self):
# Without bias
X = np.array([[-1.0], [1.0]])
y = np.array([-1.5, 1.5])
linear_regression = LinearRegression(X, y, False)
np.test... |
ursina/shaders/screenspace_shaders/camera_vertical_blur.py | bt530/ursina | 1,431 | 11080098 | <gh_stars>1000+
from ursina import Shader
camera_vertical_blur_shader = Shader(
fragment='''
#version 430
uniform sampler2D tex;
in vec2 uv;
uniform float blur_size;
out vec4 color;
void main() {
color = texture(tex, uv).rgba;
vec4 col = vec4(0.);
for(float index=0; index<10; index++) {
// add ... |
pipeline/elastic.py | cqkenuo/w12scan | 864 | 11080119 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2019/1/28 6:14 PM
# @Author : w8ay
# @File : elastic.py
import os
import sys
import time
from datetime import datetime
import requests
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Date, Integer, Keyword, Text, Document, InnerDoc, ... |
tests/syntax/test_basic.py | abol-karimi/Scenic | 141 | 11080134 |
import pytest
import scenic
from scenic.core.errors import InvalidScenarioError, RuntimeParseError
from scenic.core.object_types import Object
from tests.utils import compileScenic, sampleScene, sampleEgo, sampleParamPFrom
def test_empty():
with pytest.raises(InvalidScenarioError):
compileScenic('')
def... |
scripts/gen_crops_from_obj_tracker_logs.py | mageofboy/pylot | 231 | 11080136 | <filename>scripts/gen_crops_from_obj_tracker_logs.py<gh_stars>100-1000
"""
Takes in a folder of observations (center-[timestep].png images,
mot-[timestep].txt tracker logs) and creates and saves crops of the bounding
boxes. Useful for training the feature extractor model for DeepSORT tracker.
Example usage:
python gen... |
tests/test_swagger.py | Vitalts/sanic-openapi | 236 | 11080151 | <filename>tests/test_swagger.py<gh_stars>100-1000
import pytest
from sanic import Blueprint
from sanic.constants import HTTP_METHODS
from sanic.response import text
from sanic.views import CompositionView, HTTPMethodView
METHODS = [method.lower() for method in HTTP_METHODS]
class SimpleView(HTTPMethodView):
def ... |
awacs/ecr.py | cloudtools/awacs | 358 | 11080165 | <reponame>cloudtools/awacs
# Copyright (c) 2012-2021, <NAME> <<EMAIL>>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "Amazon Elastic Container Registry"
prefix = "ecr"
class Action(BaseAction):
def __init__(self, actio... |
example/dotenv_loaded_if_enabled/app.py | RonnyPfannschmidt/dynaconf | 2,293 | 11080166 | from dynaconf import Dynaconf
settings = Dynaconf(settings_file="settings.toml", load_dotenv=True)
assert settings.name == "Bruno"
assert "FOO" in settings
assert settings.foo == "NAR"
|
mediasoup-client/deps/webrtc/src/build/fuchsia/update_sdk.py | skgwazap/mediasoup-client-android | 128 | 11080201 | <filename>mediasoup-client/deps/webrtc/src/build/fuchsia/update_sdk.py
#!/usr/bin/env python
# Copyright 2017 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.
"""Updates the Fuchsia SDK to the given revision. Should be used... |
shared/small_roots/ernst.py | jvdsn/crypto-attacks | 139 | 11080212 | import logging
from math import gcd
from sage.all import RR
from sage.all import ZZ
from shared import small_roots
def integer_trivariate_1(f, m, t, W, X, Y, Z, check_bounds=True, roots_method="resultants"):
"""
Computes small integer roots of a trivariate polynomial.
More information: Ernst M. et al., ... |
cumulusci/robotframework/pageobjects/PageObjects.py | SalesforceFoundation/CumulusCI | 109 | 11080225 | <reponame>SalesforceFoundation/CumulusCI
import inspect
import sys
from pathlib import Path
import robot.utils
from robot.api import logger
from robot.libraries.BuiltIn import BuiltIn, RobotNotRunningError
from cumulusci.robotframework.pageobjects.baseobjects import BasePage
from cumulusci.robotframework.utils import... |
tests/test_update_face_name.py | starenka/xhtml2pdf | 1,016 | 11080229 | <reponame>starenka/xhtml2pdf<gh_stars>1000+
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import io
import os
from unittest import TestCase
import html5lib
from xhtml2pdf.document import pisaDocument
from xhtml2pdf.w3c.cssDOMElementInterface import CSSDOMElementInterface
__doc__ = """
TTFW... |
tests/apps/good_flow_app/migrations/0042_add_hash_index.py | 15five/django-pg-zero-downtime-migrations | 376 | 11080235 | # Generated by Django 3.0a1 on 2019-10-14 19:48
import django.contrib.postgres.indexes
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('good_flow_app', '0041_drop_gist_index_with_condition'),
]
operations = [
migrations.AddIndex(
mod... |
wordai/api/apis.py | senghoo/wordai | 115 | 11080276 | import hashlib
import json
from datetime import datetime, timedelta
import wordai.models as models
from flask import Blueprint
from flask_jwt_extended import (JWTManager, create_access_token,
create_refresh_token, get_jwt_identity,
get_raw_jwt, jwt_refres... |
pyne/dbgen/ndsfpy.py | nsryan2/pyne | 182 | 11080306 | """This module provides a way to grab and store raw data for fission product yeilds
from the NDS library at the IAEA. For more information, please visit their website:
https://www-nds.iaea.org/sgnucdat/index.htm or
https://www-nds.iaea.org/sgnucdat/c2.htm. Please contact the NDS at
<EMAIL> with questions about the data... |
tinyquery/repeated_util.py | graingert/tinyquery | 104 | 11080342 | <gh_stars>100-1000
"""Helper functions for dealing with repeated fields.
It comes up in a few places that we need to flatten or unflatten repeated
columns when using them in conjunction with other repeated or scalar fields.
These functions allow us to flatten into non-repeated columns to apply various
operations and t... |
ForgeSVN/forgesvn/tests/model/test_repository.py | rohankumardubey/allura | 113 | 11080349 | # coding: utf-8
# 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... |
mindsdb/api/http/namespaces/configs/datasources.py | yarenty/mindsdb | 261 | 11080395 | <gh_stars>100-1000
from flask_restx import Namespace
ns_conf = Namespace('datasources', description='Data sources')
|
RecoLuminosity/LumiProducer/test/analysis/test/crab3_template.py | ckamtsikis/cmssw | 852 | 11080400 | <filename>RecoLuminosity/LumiProducer/test/analysis/test/crab3_template.py
from WMCore.Configuration import Configuration
config = Configuration()
#name='Pt15to30'
config.section_("General")
config.General.requestName = 'PCC_ZeroBias_DataCert_150820'
config.General.workArea = 'taskManagement'
config.section_("JobTyp... |
Chapter05/Ch5/ttk_inheritance.py | henrryyanez/Tkinter-GUI-Programming-by-Example | 127 | 11080401 | <gh_stars>100-1000
import tkinter as tk
import tkinter.ttk as ttk
win = tk.Tk()
regular_button = ttk.Button(win, text="regular button")
small_button = ttk.Button(win, text="small button", style="small.TButton")
big_button = ttk.Button(win, text="big button", style="big.TButton")
big_dangerous_button = ttk.Button(win,... |
Chapter04/tf2/autograph.py | PacktPublishing/Hands-On-Neural-Networks-with-TensorFlow-2.0 | 112 | 11080415 | <filename>Chapter04/tf2/autograph.py
import tensorflow as tf
@tf.function
def f():
for i in range(10):
print(i)
f()
f()
|
mpf/platforms/lisy/__init__.py | Scottacus64/mpf | 163 | 11080419 | """LISY System 1/80 platform."""
|
language/serene/training.py | Xtuden-com/language | 1,199 | 11080423 | <gh_stars>1000+
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
iot/api-client/end_to_end_example/cloudiot_pubsub_example_server.py | yshalabi/python-docs-samples | 5,938 | 11080435 | <gh_stars>1000+
# Copyright 2017 Google 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 applic... |
pontoon/terminology/views.py | foss4/pontoon | 1,145 | 11080449 | from django.http import JsonResponse, StreamingHttpResponse
from django.shortcuts import get_object_or_404
from django.utils.datastructures import MultiValueDictKeyError
from django.utils.decorators import method_decorator
from django.views.decorators.http import condition
from django.views.generic import ListView
fro... |
src/nsupdate/main/migrations/0011_auto_20170526_2113.py | mirzazulfan/nsupdate.info | 774 | 11080456 | <filename>src/nsupdate/main/migrations/0011_auto_20170526_2113.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('main', '0010_auto_20151229_1717'),
]
... |
tensorflow2/tf2cv/models/inceptionresnetv1.py | naviocean/imgclsmob | 2,649 | 11080476 | """
InceptionResNetV1 for ImageNet-1K, implemented in TensorFlow.
Original paper: 'Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning,'
https://arxiv.org/abs/1602.07261.
"""
__all__ = ['InceptionResNetV1', 'inceptionresnetv1', 'InceptionAUnit', 'InceptionBUnit', 'InceptionCUn... |
validation_tests/analytical_exact/transcritical_without_shock/analytical_without_shock.py | samcom12/anuga_core | 136 | 11080478 | """
Transcritical flow over a bump without a shock.
Ref1: Houghton & Kasahara, Nonlinear shallow fluid flow over an isolated ridge.
Comm. Pure and Applied Math. DOI:10.1002/cpa.3160210103
Ref2: Delestre et al, 2012, SWASHES: a compilation of shallow water
analytic solutions..., Int J Numer Meth Fluids, DOI:10.10... |
homeassistant/components/lutron/switch.py | learn-home-automation/core | 22,481 | 11080487 | """Support for Lutron switches."""
from homeassistant.components.switch import SwitchEntity
from . import LUTRON_CONTROLLER, LUTRON_DEVICES, LutronDevice
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Lutron switches."""
devs = []
# Add Lutron Switches
for (area_n... |
884 Uncommon Words from Two Sentences.py | krishna13052001/LeetCode | 872 | 11080502 | #!/usr/bin/python3
"""
We are given two sentences A and B. (A sentence is a string of space separated
words. Each word consists only of lowercase letters.)
A word is uncommon if it appears exactly once in one of the sentences, and does
not appear in the other sentence.
Return a list of all uncommon words.
You may ... |
src/pytorch_adapt/layers/plus_residual.py | KevinMusgrave/pytorch-adapt | 131 | 11080521 | import torch
class PlusResidual(torch.nn.Module):
"""
Wraps a layer such that the forward pass returns
```x + self.layer(x)```
"""
def __init__(self, layer: torch.nn.Module):
"""
Arguments:
layer: The layer to be wrapped.
"""
super().__init__()
... |
neurokit/materials/__init__.py | ucohen/NeuroKit.py | 338 | 11080532 | """
materials submodule.
"""
import inspect
class Path:
def materials():
return(inspect.getfile(Path).split("__init__")[0]) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.