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 |
|---|---|---|---|---|
parsl/tests/test_checkpointing/test_python_checkpoint_1.py | vkhodygo/parsl | 323 | 12615504 | <filename>parsl/tests/test_checkpointing/test_python_checkpoint_1.py
import argparse
import os
import pytest
import parsl
from parsl import python_app
from parsl.tests.configs.local_threads import config
@python_app(cache=True)
def random_app(i):
import random
return random.randint(i, 100000)
def launch_n_... |
flexget/plugins/operate/max_reruns.py | Jeremiad/Flexget | 1,322 | 12615507 | from loguru import logger
from flexget import plugin
from flexget.event import event
from flexget.task import Task
logger = logger.bind(name='max_reruns')
class MaxReRuns:
"""Overrides the maximum amount of re-runs allowed by a task."""
schema = {'type': 'integer'}
def __init__(self):
self.def... |
2021_03_17/dojo_test.py | devppjr/dojo | 114 | 12615531 | <filename>2021_03_17/dojo_test.py
import unittest
from dojo import separate_names, get_bigger_name, ordenados
entrada = [['Joao', 'NO'], ['Carlos', 'YES'], ['Abner', 'NO'], ['Samuel', 'YES'], ['Ricardo', 'NO'], ['Abhay', 'YES'], ['Samuel', 'YES'], ['Andres', 'YES']]
class DojoTest(unittest.TestCase):
def test_sepa... |
3rd_party_software/pyca/Testing/CpuGpuUnitTest.py | ninamiolane/quicksilver | 126 | 12615543 | <reponame>ninamiolane/quicksilver<filename>3rd_party_software/pyca/Testing/CpuGpuUnitTest.py
#
# This file contains testing where PyCA results are compared to
# results from numpy. All tests can be run from the command line by:
#
# > python -m unittest discover -v -p '*UnitTest.py'
#
# To run an individual test with g... |
dface/prepare_data/assemble_onet_imglist.py | Clock966/Face_recognition | 1,161 | 12615547 | <filename>dface/prepare_data/assemble_onet_imglist.py
import os
import dface.config as config
import dface.prepare_data.assemble as assemble
if __name__ == '__main__':
anno_list = []
net_landmark_file = os.path.join(config.ANNO_STORE_DIR,config.ONET_LANDMARK_ANNO_FILENAME)
net_postive_file = os.path.joi... |
tests/asgi/_asgi_test_app.py | the-bets/falcon | 8,217 | 12615552 | import asyncio
from collections import Counter
import hashlib
import platform
import sys
import time
import falcon
import falcon.asgi
import falcon.errors
import falcon.util
SSE_TEST_MAX_DELAY_SEC = 1
_WIN32 = sys.platform.startswith('win')
_X86_64 = platform.machine() == 'x86_64'
class Things:
def __init__(sel... |
webdriver/tests/new_session/platform_name.py | ziransun/wpt | 14,668 | 12615553 | <reponame>ziransun/wpt<filename>webdriver/tests/new_session/platform_name.py
import pytest
from tests.support import platform_name
from tests.support.asserts import assert_success
@pytest.mark.skipif(platform_name is None, reason="Unsupported platform {}".format(platform_name))
def test_corresponds_to_local_system(n... |
examples/pandocfilters/tikz.py | jacobwhall/panflute | 361 | 12615559 | <filename>examples/pandocfilters/tikz.py<gh_stars>100-1000
#!/usr/bin/env python
"""
Pandoc filter to process raw latex tikz environments into images.
Assumes that pdflatex is in the path, and that the standalone
package is available. Also assumes that ImageMagick's convert
is in the path. Images are put in the tikz-... |
opytimizer/optimizers/evolutionary/ga.py | anukaal/opytimizer | 528 | 12615575 | """Genetic Algorithm.
"""
import copy
import numpy as np
import opytimizer.math.distribution as d
import opytimizer.math.general as g
import opytimizer.math.random as r
import opytimizer.utils.constant as c
import opytimizer.utils.exception as e
import opytimizer.utils.logging as l
from opytimizer.core import Optimi... |
homeassistant/components/demo/siren.py | mtarjoianu/core | 30,023 | 12615593 | """Demo platform that offers a fake siren device."""
from __future__ import annotations
from typing import Any
from homeassistant.components.siren import SirenEntity, SirenEntityFeature
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_... |
examples/hello-world/scripts/plot-hist.py | graingert/snakemake | 1,326 | 12615596 | <reponame>graingert/snakemake
import matplotlib.pyplot as plt
import pandas as pd
cities = pd.read_csv(snakemake.input[0])
plt.hist(cities["Population"], bins=50)
plt.savefig(snakemake.output[0])
|
whatsapp-bot-venv/Lib/site-packages/twilio/rest/taskrouter/__init__.py | RedaMastouri/ConversationalPythonicChatBot | 1,362 | 12615603 | <gh_stars>1000+
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base.domain import Domain
from twilio.rest.taskrouter.v1 import V1
class Taskrouter(Domain):
def __init__(self, twilio):
"""
Initialize the Taskrout... |
test/test_parser_equivalence.py | bookofproofs/TatSu | 259 | 12615614 | <gh_stars>100-1000
import importlib
from pathlib import Path
import pytest # noqa
from tatsu.exceptions import FailedParse
from tatsu.tool import compile, gencode
INPUT = """
1d3
"""
OUTPUT = {'number_of_dice': '1', 'sides': '3'}
GRAMMAR = """
start = expression $;
int = /-?\d+/ ;
dice = number_... |
python/src/nnabla/core/modules.py | daniel-falk/nnabla | 2,792 | 12615628 | <reponame>daniel-falk/nnabla<gh_stars>1000+
# Copyright 2020,2021 Sony 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://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
tools/python/util/convert_onnx_models_to_ort.py | mszhanyi/onnxruntime | 669 | 12615641 | #!/usr/bin/env python3
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import argparse
import contextlib
import enum
import os
import pathlib
import tempfile
import typing
import onnxruntime as ort
from .file_utils import files_from_file_or_dir, path_match_suffix_ignore_... |
tests/test_0046-histograms-bh-hist.py | eic/uproot4 | 133 | 12615668 | <filename>tests/test_0046-histograms-bh-hist.py<gh_stars>100-1000
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE
from __future__ import absolute_import
import numpy
import pytest
import skhep_testdata
import uproot
def test_numpy_1d():
with uproot.open(skhep_testdata.data_p... |
akshare/stock_fundamental/stock_register.py | NovelResearchInvestment/akshare | 721 | 12615706 | # -*- coding:utf-8 -*-
#!/usr/bin/env python
"""
Date: 2022/1/7 17:19
Desc: 东方财富网-数据中心-新股数据-注册制审核
http://data.eastmoney.com/kcb/?type=nsb
"""
import pandas as pd
import requests
def stock_register_kcb() -> pd.DataFrame:
"""
东方财富网-数据中心-新股数据-注册制审核-科创板
http://data.eastmoney.com/kcb/?type=nsb
:return: 科创板... |
source/tomopy/misc/phantom.py | WilliamJudge94/tomopy | 229 | 12615726 | <filename>source/tomopy/misc/phantom.py<gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2015-2019, UChicago Argonne, LLC. All rights reserved. #
# ... |
riddle/feature_importance.py | LaudateCorpus1/RIDDLE-1 | 110 | 12615741 | """feature_importance.py
Computes feature contribution scores via DeepLIFT (Shrikumar et al., 2016) &
determines most important features via paired t-test with adjustment
for multiple comparisons (Bonferroni correction) using said scores.
Requires: NumPy, SciPy, DeepLIFT (and their dependencies)
Author: <NAME>... |
calliope/test/common/util.py | FraSanvit/calliope | 180 | 12615743 | <reponame>FraSanvit/calliope
import os
import sys
import ast
import pytest
from pyomo.core.expr.current import identify_variables
import pyomo.core as po
import calliope
from calliope import AttrDict
constraint_sets = {
k: [ast.literal_eval(i) for i in v]
for k, v in AttrDict.from_yaml(
os.path.join... |
leetcode.com/python/1288_Remove_Covered_Intervals.py | vansh-tiwari/coding-interview-gym | 713 | 12615804 | <reponame>vansh-tiwari/coding-interview-gym<filename>leetcode.com/python/1288_Remove_Covered_Intervals.py
class Solution(object):
def removeCoveredIntervals(self, intervals):
"""
:type intervals: List[List[int]]
:rtype: int
"""
# Sort by start point.
# If two interval... |
events/swagger_params.py | jordanm88/Django-CRM | 1,334 | 12615810 | <reponame>jordanm88/Django-CRM<gh_stars>1000+
from drf_yasg import openapi
organization_params_in_header = openapi.Parameter(
"org", openapi.IN_HEADER, required=True, type=openapi.TYPE_INTEGER
)
organization_params = [
organization_params_in_header,
]
event_list_get_params = [
organization_params_in_head... |
pypy/module/_cffi_backend/realize_c_type.py | m4sterchain/mesapy | 381 | 12615820 | <reponame>m4sterchain/mesapy
import sys
from rpython.rlib import jit
from rpython.rlib.rarithmetic import intmask
from rpython.rlib.objectmodel import specialize
from rpython.rtyper.lltypesystem import lltype, rffi
from pypy.interpreter.error import oefmt
from pypy.interpreter.baseobjspace import W_Root
from pypy.modul... |
plexapi/server.py | phrawzty/python-plexapi | 749 | 12615831 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from urllib.parse import urlencode
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_CONTAINER_SIZE, log,
logfilter)
from plexapi import utils
from plexapi.alert import AlertListener
from plexapi.... |
office365/sharepoint/server_settings.py | vgrem/Office365-REST-Python-Client | 544 | 12615895 | <filename>office365/sharepoint/server_settings.py
from office365.runtime.client_result import ClientResult
from office365.runtime.client_value_collection import ClientValueCollection
from office365.runtime.queries.service_operation_query import ServiceOperationQuery
from office365.runtime.paths.resource_path import Res... |
2-Bring-Your-Own/lambda-code/MLOps-BYO-DeployModel.py | VaibhavSingh98/mlops-amazon-sagemaker-devops-with-ml | 108 | 12615914 | import boto3
import os
import tempfile
import json
from boto3.session import Session
sagemaker = boto3.client('sagemaker')
code_pipeline = boto3.client('codepipeline')
def lambda_handler(event, context):
try:
# Read in information from previous get_status job
previousStepEvent = read_job_info(even... |
bayespy/utils/tests/test_linalg.py | dungvtdev/upsbayescpm | 622 | 12615929 | ################################################################################
# Copyright (C) 2013 <NAME>
#
# This file is licensed under the MIT License.
################################################################################
"""
Unit tests for bayespy.utils.linalg module.
"""
import numpy as np
from .... |
recipes/Python/577629_namedtupleabc__abstract_base_class__mixnamed/recipe-577629.py | tdiprima/code | 2,023 | 12615930 | <filename>recipes/Python/577629_namedtupleabc__abstract_base_class__mixnamed/recipe-577629.py
#!/usr/bin/env python
# Copyright (c) 2011 <NAME> (zuo). Available under the MIT License.
"""
namedtuple_with_abc.py:
* named tuple mix-in + ABC (abstract base class) recipe,
* works under Python 2.6, 2.7 as well as 3.x.
Imp... |
examples/ngcf/utils.py | zbmain/PGL | 1,389 | 12615938 | # Copyright (c) 2021 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... |
rest-service/manager_rest/test/endpoints/test_deployment_labels_dependencies.py | cloudify-cosmo/cloudify-manager | 124 | 12615954 |
from mock import patch
from cloudify_rest_client.exceptions import CloudifyClientError
from cloudify.models_states import DeploymentState
from manager_rest.rest.rest_utils import RecursiveDeploymentLabelsDependencies
from manager_rest.test import base_test
from manager_rest.test.attribute import attr
from manager_re... |
alipay/aop/api/response/AlipayCommerceEducateTuitioncodeApplySendResponse.py | antopen/alipay-sdk-python-all | 213 | 12615956 | <reponame>antopen/alipay-sdk-python-all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayCommerceEducateTuitioncodeApplySendResponse(AlipayResponse):
def __init__(self):
super(AlipayCommerceEducateTuitioncodeApplySend... |
observations/r/wood.py | hajime9652/observations | 199 | 12615964 | # -*- 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 wood(path):
"""Modified Data on Wood Specific Gravity
The original... |
tests/test_discriminator.py | dustymugs/PynamoDB | 1,586 | 12615977 | <reponame>dustymugs/PynamoDB<filename>tests/test_discriminator.py
import pytest
from pynamodb.attributes import DiscriminatorAttribute
from pynamodb.attributes import DynamicMapAttribute
from pynamodb.attributes import ListAttribute
from pynamodb.attributes import MapAttribute
from pynamodb.attributes import NumberAtt... |
lingua_franca/lang/common_data_cs.py | NeonDaniel/lingua-franca | 191 | 12616033 | <reponame>NeonDaniel/lingua-franca
#
# Copyright 2017 Mycroft AI 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 ... |
tests/test_runner_apps/databases/tests.py | KaushikSathvara/django | 61,676 | 12616041 | import unittest
class NoDatabaseTests(unittest.TestCase):
def test_nothing(self):
pass
class DefaultDatabaseTests(NoDatabaseTests):
databases = {'default'}
class DefaultDatabaseSerializedTests(NoDatabaseTests):
databases = {'default'}
serialized_rollback = True
class OtherDatabaseTests(N... |
src/ecdsa/test_ecdsa.py | kianmeng/python-ecdsa | 616 | 12616067 | <reponame>kianmeng/python-ecdsa<gh_stars>100-1000
from __future__ import print_function
import sys
import hypothesis.strategies as st
from hypothesis import given, settings, note, example
try:
import unittest2 as unittest
except ImportError:
import unittest
import pytest
from .ecdsa import (
Private_key,
... |
tools/accuracy_checker/openvino/tools/accuracy_checker/representation/nlp_representation.py | TolyaTalamanov/open_model_zoo | 2,201 | 12616128 | """
Copyright (c) 2018-2022 Intel 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://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... |
application/operator/NGSI-LD-Adapter/module/common_utilities/user.py | jason-fox/fogflow | 102 | 12616142 | <gh_stars>100-1000
import requests
USERS_URL = 'http://jsonplaceholder.typicode.com/use'
def get_users():
"""Get list of users"""
response = requests.get(USERS_URL)
print(response.status_code)
if response.ok:
return response
else:
return None
|
baseline/tf/classify/train.py | shar999/mead-baseline | 241 | 12616159 | <gh_stars>100-1000
"""Train a classifier with TensorFlow
This module supports several different ways of training a model
1. eager mode (`default` for eager)
2. distributed eager mode (`distributed`)
"""
from baseline.tf.classify.training import *
|
openbb_terminal/cryptocurrency/defi/cryptosaurio_view.py | joshuabuildsthings/GamestonkTerminal | 255 | 12616160 | """Cryptosaurio View"""
__docformat__ = "numpy"
import logging
import os
from typing import List, Optional
import matplotlib.pyplot as plt
from openbb_terminal import config_terminal as cfg
from openbb_terminal.config_plot import PLOT_DPI
from openbb_terminal.cryptocurrency.defi import cryptosaurio_model
from openbb_t... |
tests/test_feature_conversion.py | vishalbelsare/superintendent | 157 | 12616173 | <filename>tests/test_feature_conversion.py<gh_stars>100-1000
import pytest # noqa
import numpy as np
import pandas as pd
from hypothesis import given, settings
from hypothesis.strategies import (
booleans,
floats,
integers,
lists,
tuples,
one_of,
sampled_from,
text,
composite,
)
f... |
slack_bolt/middleware/url_verification/async_url_verification.py | hirosassa/bolt-python | 504 | 12616218 | <filename>slack_bolt/middleware/url_verification/async_url_verification.py<gh_stars>100-1000
from typing import Callable, Awaitable
from slack_bolt.logger import get_bolt_logger
from .url_verification import UrlVerification
from slack_bolt.middleware.async_middleware import AsyncMiddleware
from slack_bolt.request.asyn... |
tests/onnx_test_runner.py | kendryte/nncase | 510 | 12616226 | from onnx import version_converter, helper
import onnxsim
import onnxruntime as ort
import onnx
import torch
import shutil
import os
import numpy as np
from test_runner import *
class OnnxTestRunner(TestRunner):
def __init__(self, case_name, targets=None, overwrite_configs: dict = None):
super().__init__(... |
demos/kitchen_sink/libs/baseclass/dialog_change_theme.py | Jonypr-code/KivyMD | 1,111 | 12616241 | import os
from kivy.properties import StringProperty
from kivy.uix.modalview import ModalView
from kivy.utils import get_color_from_hex, get_hex_from_color
from kivymd.color_definitions import colors, palette
from kivymd.theming import ThemableBehavior
class KitchenSinkBaseDialog(ThemableBehavior, ModalView):
p... |
testing/kfctl/kfctl_delete_test.py | fyuan1316/kubeflow | 2,527 | 12616264 | <gh_stars>1000+
"""Run kfctl delete as a pytest.
We use this in order to generate a junit_xml file.
"""
import datetime
import logging
import os
import subprocess
import tempfile
import uuid
from retrying import retry
import pytest
from kubeflow.testing import util
from googleapiclient import discovery
from oauth2cl... |
examples/advanced/skeletonize.py | hadivafaii/vedo | 836 | 12616291 | <reponame>hadivafaii/vedo<filename>examples/advanced/skeletonize.py
"""Using 1D Moving Least Squares to skeletonize a surface"""
print(__doc__)
from vedo import *
N = 9 # nr of iterations
f = 0.2 # fraction of neighbours
pts = Mesh(dataurl+"man.vtk").clean(tol=0.02).points()
pc = Points(pts)
for i in range(N):
... |
docs/sphinx_keras2onnx_extension.py | TomWildenhain-Microsoft/keras-onnx | 362 | 12616295 | # SPDX-License-Identifier: Apache-2.0
"""
Extension for sphinx.
"""
import sphinx
from docutils import nodes
from docutils.parsers.rst import Directive
import keras2onnx
import onnxruntime
def kerasonnx_version_role(role, rawtext, text, lineno, inliner, options=None, content=None):
"""
Defines custom role *k... |
threat_intel/alexaranking.py | Yelp/threat_intel | 264 | 12616296 | # -*- coding: utf-8 -*-
#
# AlexaRankingsAPI makes calls to the Alexa Ranking API
#
from threat_intel.util.api_cache import ApiCache
from threat_intel.util.http import MultiRequest
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import ParseError
class AlexaRankingApi(object):
BASE_URL = u'https://... |
src/tests/test_eeil.py | francesco-p/FACIL | 243 | 12616306 | from tests import run_main_and_assert
FAST_LOCAL_TEST_ARGS = "--exp-name local_test --datasets mnist" \
" --network LeNet --num-tasks 3 --seed 1 --batch-size 32" \
" --nepochs 3" \
" --num-workers 0" \
" --approach eeil"
def ... |
nltk/corpus/reader/plaintext.py | Bharat123rox/nltk | 9,747 | 12616315 | # Natural Language Toolkit: Plaintext Corpus Reader
#
# Copyright (C) 2001-2021 NLTK Project
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
A reader for corpora that consist of plaintext documents.
"""
impo... |
scripts/bed_merge_overlapping.py | lldelisle/bx-python | 122 | 12616326 | #!/usr/bin/env python
"""
Merge any overlapping regions of bed files. Bed files can be provided on the
command line or on stdin. Merged regions are always reported on the '+'
strand, and any fields beyond chrom/start/stop are lost.
usage: %prog bed files ...
"""
import fileinput
import sys
from bx.bitset_builders i... |
vimfiles/bundle/vim-python/submodules/rope/ropetest/contrib/finderrorstest.py | ciskoinch8/vimrc | 463 | 12616327 | try:
import unittest2 as unittest
except ImportError:
import unittest
from rope.contrib import finderrors
from ropetest import testutils
class FindErrorsTest(unittest.TestCase):
def setUp(self):
super(FindErrorsTest, self).setUp()
self.project = testutils.sample_project()
self.m... |
dace/transformation/interstate/multistate_inline.py | jnice-81/dace | 227 | 12616330 | <gh_stars>100-1000
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
""" Inline multi-state SDFGs. """
import ast
from collections import defaultdict
from copy import deepcopy as dc
from dace.frontend.python.ndloop import ndrange
import itertools
import networkx as nx
from typing import Calla... |
scripts/ci/util.py | haroonf/azure-cli-extensions | 207 | 12616334 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
app/apiv2/plans/plan.py | Joey-Wondersign/Staffjoy-suite-Joey | 890 | 12616339 | <gh_stars>100-1000
from flask_restful import abort, Resource
from app.constants import API_ENVELOPE
from app.plans import plans
from app.constants import PLAN_PUBLIC_KEYS
class PlanApi(Resource):
# Any authenticated users can access
def get(self, plan_id):
if plan_id not in plans.keys():
... |
tests/brevitas/test_brevitas_non_scaled_QuantHardTanh_export.py | AlexMontgomerie/finn | 283 | 12616347 | # Copyright (c) 2020, Xilinx
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the follow... |
braindecode/models/shallow_fbcsp.py | sylvchev/braindecode | 260 | 12616353 | <reponame>sylvchev/braindecode<gh_stars>100-1000
import numpy as np
from torch import nn
from torch.nn import init
from braindecode.models.base import BaseModel
from braindecode.torch_ext.modules import Expression
from braindecode.torch_ext.functions import safe_log, square
from braindecode.torch_ext.util import np_to... |
locations/spiders/goddard_school.py | davidchiles/alltheplaces | 297 | 12616404 | <reponame>davidchiles/alltheplaces
# -*- coding: utf-8 -*-
import scrapy
import re
from locations.items import GeojsonPointItem
class GoddardSchoolSpider(scrapy.Spider):
name = "goddard_school"
item_attributes = { 'brand': "Goddard School" }
allowed_domains = ["www.goddardschool.com"]
start_urls = (
... |
pxr/usd/usdGeom/testenv/testUsdGeomConsts.py | DougRogers-DigitalFish/USD | 3,680 | 12616434 | #!/pxrpythonsubst
#
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... |
Anaconda-files/Program_14c.py | arvidl/dynamical-systems-with-applications-using-python | 106 | 12616442 | <gh_stars>100-1000
# Program 14c: Lyapunov exponents of the logistic map.
# See Figure 14.18.
import numpy as np
import matplotlib.pyplot as plt
num_points = 16000
result = []
lambdas = []
maps = []
xmin, xmax = 3, 4
mult = (xmax - xmin) * num_points
mu_values = np.arange(xmin, xmax, 20/num_points)
for r in mu_valu... |
pc_software/build_linux.py | joelnb/duckyPad | 578 | 12616462 | import os
import sys
import shutil
os.system('rm -rfv ./__pycache__')
os.system('rm -rfv ./build')
os.system('rm -rfv ./dist')
os.system('rm -rfv ./*.zip')
THIS_VERSION = None
try:
mainfile = open('duckypad_config.py')
for line in mainfile:
if "THIS_VERSION_NUMBER =" in line:
THIS_VERSION = line.replace('\n', ... |
finrl_meta/env_future_trading/wt4elegantrl/wtpy/apps/datahelper/DHFactory.py | eitin-infant/FinRL-Meta | 214 | 12616469 | <reponame>eitin-infant/FinRL-Meta<filename>finrl_meta/env_future_trading/wt4elegantrl/wtpy/apps/datahelper/DHFactory.py
from wtpy.apps.datahelper.DHDefs import BaseDataHelper
from wtpy.apps.datahelper.DHBaostock import DHBaostock
from wtpy.apps.datahelper.DHTushare import DHTushare
from wtpy.apps.datahelper.DHRqData im... |
atlas-examples/sample-app/src/main/python/lineage_example.py | mario-renau-alstom/atlas | 1,248 | 12616470 | #!/usr/bin/env/python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# ... |
src/transformers/models/fsmt/convert_fsmt_original_pytorch_checkpoint_to_pytorch.py | dctelus/transformers | 8,028 | 12616528 | <reponame>dctelus/transformers<gh_stars>1000+
# coding=utf-8
# Copyright 2018 The HuggingFace Inc. 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/licenses... |
gaiadet/models/utils/__init__.py | zengming16/GAIA-det | 149 | 12616534 | <filename>gaiadet/models/utils/__init__.py
from .dynamic_res_layer import DynamicResLayer
|
RecoEgamma/EgammaTools/python/lowPtElectronModifier_cfi.py | Purva-Chaudhari/cmssw | 852 | 12616543 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
lowPtElectronModifier = cms.PSet(
modifierName = cms.string('LowPtElectronModifier'),
beamSpot = cms.InputTag('offlineBeamSpot'),
conversions = cms.InputTag('gsfTracksOpenConversions:gsfTracksOpenConversions'),
addExtraUserVars = cms.bool(True... |
ironic/db/sqlalchemy/alembic/versions/9cbeefa3763f_add_port_is_smartnic.py | yanndegat/ironic | 350 | 12616554 | # 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, software
# d... |
examples/hyperloglog_examples.py | yrik/datasketch | 1,771 | 12616568 | '''
Some examples for MinHash
'''
from datasketch.hyperloglog import HyperLogLog
data1 = ['hyperloglog', 'is', 'a', 'probabilistic', 'data', 'structure', 'for',
'estimating', 'the', 'cardinality', 'of', 'dataset', 'dataset', 'a']
data2 = ['hyperloglog', 'is', 'a', 'probabilistic', 'DATA', 'structure', 'for',... |
tests/test_operators_spherical.py | vaishnavtv/neurodiffeq | 202 | 12616575 | import pytest
import torch
import torch.nn as nn
from torch import sin, cos
import numpy as np
from neurodiffeq import diff
from neurodiffeq.generators import GeneratorSpherical
from neurodiffeq.function_basis import ZonalSphericalHarmonics
from neurodiffeq.networks import FCNN
from neurodiffeq.operators import spheric... |
folium/elements.py | iwpnd/folium | 5,451 | 12616597 | <filename>folium/elements.py
from branca.element import Figure, Element, JavascriptLink, CssLink
class JSCSSMixin(Element):
"""Render links to external Javascript and CSS resources."""
default_js = []
default_css = []
def render(self, **kwargs):
figure = self.get_root()
assert isinst... |
src/sqlacodegen/utils.py | randallk/sqlacodegen | 960 | 12616611 | from typing import List, Set
from sqlalchemy import CheckConstraint
from sqlalchemy.engine import Connectable
from sqlalchemy.sql import ClauseElement
from sqlalchemy.sql.schema import (
ColumnCollectionConstraint, Constraint, ForeignKeyConstraint, Table)
def get_column_names(constraint: ColumnCollectionConstrai... |
a02_TextCNN/other_experiement/p7_TextCNN_predict_ensemble.py | sunshinenum/text_classification | 7,723 | 12616620 | <reponame>sunshinenum/text_classification
from p7_TextCNN_predict import get_logits_with_value_by_input
from p7_TextCNN_predict_exp import get_logits_with_value_by_input_exp
import tensorflow as tf
def main(_):
for start in range(217360):
end=start+1
label_list,p_list=get_logits_with_value_by_input... |
anuga/file/__init__.py | samcom12/anuga_core | 136 | 12616640 | <reponame>samcom12/anuga_core
"""Common file modules.
Here you will find modules to load, save, and extract information in a
variety of different file formats.
This module takes care of reading and writing datafiles such as topograhies,
model output, etc
Formats used within AnuGA:
.sww: Netcdf format f... |
firestore/generate_android_test.py | oliwilkinsonio/firebase-cpp-sdk | 193 | 12616672 | #!/usr/grte/v4/bin/python2.7
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
recipes/Python/473851_Compose_HTML_Mail_embedded_images_URL_or_local/recipe-473851.py | tdiprima/code | 2,023 | 12616677 | # HtmlMail python class
# Compose HTML mails from URLs or local files with all images included
#
# Author: <NAME> <<EMAIL>>
import sys, os, urllib2, urlparse
from email.MIMEText import MIMEText
from email.MIMEImage import MIMEImage
from email.MIMEMultipart import MIMEMultipart
import email, re
class HtmlMail:
def __... |
dca/hyper.py | mjheid/dca | 193 | 12616710 | import os
import pickle
import json
import numpy as np
from kopt import CompileFN, test_fn
from hyperopt import fmin, tpe, hp, Trials
import keras.optimizers as opt
from . import io
from .network import AE_types
def hyper(args):
adata = io.read_dataset(args.input,
transpose=args.tran... |
demo/json-model/json_parser.py | bclehmann/xgboost | 23,866 | 12616731 | '''Demonstration for parsing JSON tree model file generated by XGBoost. The
support is experimental, output schema is subject to change in the future.
'''
import json
import argparse
class Tree:
'''A tree built by XGBoost.'''
# Index into node array
_left = 0
_right = 1
_parent = 2
_ind = 3
... |
tests/test_issues/test_708.py | leonardt/magma | 167 | 12616750 | <gh_stars>100-1000
import magma as m
from magma.testing import check_files_equal
import os
import pytest
import tempfile
@pytest.mark.parametrize("inline", [False, True])
def test_708(inline):
class A(m.Product):
x = m.UInt[8]
@m.sequential2()
class Test:
def __init__(self):
s... |
tensorflow/python/profiler/profile_context_test.py | abhaikollara/tensorflow | 848 | 12616751 | # Copyright 2016 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... |
pyquante2/utils.py | berquist/pyquante2 | 107 | 12616753 | <reponame>berquist/pyquante2
"""
utils.py - Simple utilility funtions used in pyquante2.
"""
import numpy as np
from math import factorial,lgamma
from itertools import combinations_with_replacement,combinations
from functools import reduce
def pairs(it): return combinations_with_replacement(it,2)
def upairs(it): retur... |
examples/upload_file_test.py | mdmintz/seleniumspot | 2,745 | 12616755 | """ Testing the self.choose_file() and self.assert_attribute() methods. """
import os
from seleniumbase import BaseCase
class FileUploadButtonTests(BaseCase):
def test_file_upload_button(self):
self.open("https://seleniumbase.io/w3schools/file_upload")
self.switch_to_frame("iframeResult")
... |
tests/unit/tuner/pytorch/test_dist.py | rizwandel/finetuner | 270 | 12616761 | import numpy as np
import pytest
import torch
from scipy.spatial.distance import pdist, squareform
from finetuner.tuner.pytorch.losses import get_distance
N_BATCH = 10
N_DIM = 128
@pytest.mark.parametrize('distance', ['cosine', 'euclidean', 'sqeuclidean'])
def test_dist(distance):
embeddings = np.random.rand(N... |
tests/console/commands/test_search.py | zEdS15B3GCwq/poetry | 7,258 | 12616771 | from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
import httpretty
from cleo.testers.command_tester import CommandTester
from tests.types import CommandTesterFactory
TESTS_DIRECTORY = Path(__file__).parent.parent.parent
FIXTUR... |
bounter/tests/cms/test_cms_quality.py | BenLangmead/bounter | 987 | 12616793 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: <NAME> <<EMAIL>>
# Copyright (C) 2017 Rare Technologies
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
import unittest
from bounter import CountMinSketch
class CountMinSketchQualityCommonTest(unittest.TestCase):
... |
byt5/sigmorphon.py | onlyrico/byt5 | 377 | 12616796 | # Copyright 2021 The ByT5 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
examples/applications/mercury_solarsystem3.py | rknop/amuse | 131 | 12616797 | # import numpy
from amuse.community.mercury.interface import MercuryWayWard
from amuse.community.sse.interface import SSE
from amuse.ext.solarsystem import new_solar_system_for_mercury
from amuse.units import units
from amuse.units.quantities import VectorQuantity
from amuse.plot import (
plot, native_plot,
... |
app/src/thirdparty/telemetry/value/histogram_unittest.py | ta2edchimp/big-rig | 925 | 12616800 | <gh_stars>100-1000
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
from telemetry import story
from telemetry import page as page_module
from telemetry import value
from telemetry... |
test-framework/test-suites/integration/tests/remove/test_remove_environment_route.py | knutsonchris/stacki | 123 | 12616807 | <gh_stars>100-1000
import json
from textwrap import dedent
class TestRemoveEnvironmentRoute:
def test_no_args(self, host):
result = host.run('stack remove environment route')
assert result.rc == 255
assert result.stderr == dedent('''\
error - "environment" argument is required
{environment ...} {address=... |
src/visions/typesets/typeset.py | bhumikapahariapuresoftware/visions | 142 | 12616811 | <filename>src/visions/typesets/typeset.py
import warnings
from functools import singledispatch
from pathlib import Path
from typing import (
Any,
Dict,
Iterable,
List,
Optional,
Sequence,
Set,
Tuple,
Type,
TypeVar,
Union,
)
import networkx as nx
import pandas as pd
from vis... |
docs/core/examples/pbecho.py | Khymeira/twisted | 4,612 | 12616834 | <filename>docs/core/examples/pbecho.py<gh_stars>1000+
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
if __name__ == "__main__":
# Avoid using any names defined in the "__main__" module.
from pbecho import main
raise SystemExit(main())
from zope.interface import implementer
from ... |
proxy/python/proxy.py | kuchaguangjie/go-micro-examples | 132 | 12616846 | import uuid
import requests
import json
registry_uri = "http://localhost:8081/registry"
call_uri = "http://localhost:8081"
headers = {'content-type': 'application/json'}
def register(service):
return requests.post(registry_uri, data=json.dumps(service), headers=headers)
def deregister(service):
return reques... |
authlib/common/encoding.py | minddistrict/authlib | 3,172 | 12616854 | import json
import base64
import struct
def to_bytes(x, charset='utf-8', errors='strict'):
if x is None:
return None
if isinstance(x, bytes):
return x
if isinstance(x, str):
return x.encode(charset, errors)
if isinstance(x, (int, float)):
return str(x).encode(charset, e... |
example/run_sac.py | krish-dx/machina | 302 | 12616863 | <filename>example/run_sac.py
"""
An example of Soft Actor Critic.
"""
import argparse
import copy
import json
import os
from pprint import pprint
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import gym
import machina as mc
from machina.pols import GaussianPol
from machina.alg... |
scitbx/lbfgs/__init__.py | dperl-sol/cctbx_project | 155 | 12616874 | <reponame>dperl-sol/cctbx_project<filename>scitbx/lbfgs/__init__.py
from __future__ import absolute_import, division, print_function
from scitbx.array_family import flex
import boost_adaptbx.boost.python as bp
ext = bp.import_ext("scitbx_lbfgs_ext")
from scitbx_lbfgs_ext import *
from libtbx import adopt_init_args
r... |
data/transcoder_evaluation_gfg/python/MAXIMUM_PRODUCT_INCREASING_SUBSEQUENCE.py | mxl1n/CodeGen | 241 | 12616875 | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( arr , n ) :
mpis = [ 0 ] * ( n )
for i in range ( n ) :
mpis [ i ] = arr [ i ]
for i in range (... |
pyscf/agf2/_agf2.py | QuESt-Calculator/pyscf | 501 | 12616882 | <filename>pyscf/agf2/_agf2.py<gh_stars>100-1000
# Copyright 2014-2020 The PySCF Developers. 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/... |
datadog_checks_dev/tests/tooling/manifest_validator/input_constants.py | abraham-leal/integrations-core | 663 | 12616883 | <reponame>abraham-leal/integrations-core
# (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from datadog_checks.dev.tooling.datastructures import JSONDict
# This file contains the constants used for V2 manifest validator testing
ORACLE_METADATA_CSV_EXAMP... |
model/cls/loss/lifted_structure_loss.py | qrsforever/torchcv | 171 | 12616907 | <filename>model/cls/loss/lifted_structure_loss.py
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: <NAME>(<EMAIL>)
# Loss function for Image Classification.
import torch
import torch.nn as nn
import torch.nn.functional as F
class LiftedStructureLoss(nn.Module):
def __init__(self, configer):
... |
helpers_cntk.py | cubean/ImageSimilarityUsingCntk | 130 | 12616921 | <filename>helpers_cntk.py
# -*- coding: utf-8 -*-
import os, random, pdb
import matplotlib.pyplot as plt
from cntk import constant, use_default_device, cross_entropy_with_softmax, classification_error
from cntk import load_model, Trainer, UnitType
from cntk.io import MinibatchSource, ImageDeserializer, StreamDefs, Str... |
geosnap/tests/test_dynamics.py | WawNun/geosnap | 148 | 12616930 | <gh_stars>100-1000
import numpy as np
import os
from geosnap import Community
from geosnap.analyze import sequence, transition
RTOL = 0.00001
import pytest
try:
LTDB = os.environ["LTDB_SAMPLE"]
except:
LTDB=None
@pytest.mark.skipif(not LTDB, reason="unable to locate LTDB data")
def test_transition():
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.