text
stringlengths
2
999k
import _plotly_utils.basevalidators class HoverinfosrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="hoverinfosrc", parent_name="scattergl", **kwargs): super(HoverinfosrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_na...
#!/usr/bin/env python3 """Entropy and information theory related calculations. **Author: Jonathan Delgado** """ ######################## Imports ######################## import numpy as np import stp ######################## Helper functions ######################## def _eps_filter(x): """ Checks if the v...
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-07-25 22:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('upload', '0006_auto_20170725_2159'), ] operations = [ migrations.AddField( ...
from django.contrib import admin from .models import ( Club, ClubMeeting, ) @admin.register(Club) class ClubAdmin(admin.ModelAdmin): list_display = ('name', 'slug', 'telegram_group_link') search_fields = ('name', 'slug') autocomplete_fields = ('managers', 'members') prepopulated_fields = ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # michael a.g. aïvázis # orthologue # (c) 1998-2022 all rights reserved # """ Exercise the linker """ def test(): import pyre # get the linker linker = pyre.executive.linker # check the registered codecs assert tuple(linker.schemes.keys()) == ('i...
# # Author: Travis Oliphant 2002-2011 with contributions from # SciPy Developers 2004-2011 # from __future__ import division, print_function, absolute_import from scipy._lib.six import string_types, exec_ from scipy._lib._util import getargspec_no_self as _getargspec import sys import keyword import re imp...
import os from flask import url_for as real_url_for def url_for(*args, **kwargs): """ Static Url helpper for html pages """ return real_url_for(*args, **kwargs)
import numpy as np import cv2 import os import sys from lcd import LCD from imthread import CapThread import threading import time import RPi.GPIO as GPIO import math _threshold = 27000000 _div = 100000 ui_enable = False # LCD Pins LCD_RS = 7 LCD_E = 8 LCD_D4 = 25 LCD_D5 = 24 LCD_D6 = 23 LCD_D7 = ...
import unittest from linguine.corpus import Corpus from linguine.ops.remove_stopwords import RemoveStopwords from linguine.ops.word_tokenize import WordTokenizeWhitespacePunct class RemoveStopwordsTest(unittest.TestCase): def setUp(self): self.op = RemoveStopwords() def test_run(self): test...
import sys import random import avro.schema from avro.datafile import DataFileWriter from avro.io import DatumWriter NAME_POOL = ['george', 'john', 'paul', 'ringo'] OFFICE_POOL = ['office-%d' % _ for _ in xrange(4)] COLOR_POOL = ['black', 'cyan', 'magenta', 'yellow'] def main(argv): try: schema_fn = arg...
__version__ = "0.2.3a2"
from __future__ import print_function import torch import torch.nn as nn import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F import math import numpy as np from torch.nn import BatchNorm2d def convbn(in_planes, out_planes, kernel_size, stride, pad, dilation, gn=False, groups=32)...
from collections import deque from dagster import check from dagster.core.definitions.resource import ScopedResourcesBuilder from dagster.core.errors import ( DagsterResourceFunctionError, DagsterUserCodeExecutionError, user_code_error_boundary, ) from dagster.core.events import DagsterEvent from dagster.c...
import torch import torch.nn as nn import os import math from collections import deque from pathlib import Path from YOLACT.layers.interpolate import InterpolateModule class MovingAverage(): """ Keeps an average window of the specified number of items. """ def __init__(self, max_window_size=1000): sel...
import glob import re import sys import os import logging import warnings from traitlets.config import LoggingConfigurable, Config, get_config from traitlets import Instance, Enum, Unicode, observe from ..coursedir import CourseDirectory from ..converters import GenerateAssignment, Autograde, GenerateFeedback, Genera...
from flask import Flask from flask_cors import CORS from common import settings def create_app(): app = Flask(__name__, static_folder='../static', template_folder='../templates') app.config.from_object(settings) CORS(app) from api.index import home_blu app.register_blueprint(home_blu) return...
from nitorch.core.py import make_list from nitorch.tools.cli import commands from .main import crop from .parser import parse, help, ParseError import sys def cli(args=None): f"""Command-line interface for `nicrop` {help} """ # Exceptions are dealt with here try: _cli(args) ...
class TemplateDoesNotExistException(Exception): pass
#!C:\Users\Akash\Developer\School\HackUCI2020\venv\Scripts\python.exe # EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3.8' __requires__ = 'pip==19.0.3' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sy...
# -*- coding: utf-8 -*- # FLEDGE_BEGIN # See: http://fledge.readthedocs.io/ # FLEDGE_END """ Test system/python/test_e2e_coap_PI.py """ import os import subprocess import http.client import json import time import pytest import utils __author__ = "Vaibhav Singhal" __copyright__ = "Copyright (c) 2019 Dianomic Syste...
import copy import logging import os import random import shutil import sys import tempfile import time from argparse import Namespace from dataclasses import replace from pathlib import Path from typing import Callable, Dict, List, Optional, Tuple from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey from...
from typing import List from entities import Entity class Enemy(Entity): def __init__(self, pos_x: int, pos_y: int, tile: str, friendly_tile: str, enemy_tile: str): super().__init__("enemy", pos_x, pos_y, tile) self.friendly_tile = friendly_tile self.enemy_tile = enemy_tile class Battle...
#!/usr/bin/env python3 # Copyright (c) 2014-2020, Linus Östberg # 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 #...
# Generated by Django 3.0.7 on 2020-12-26 12:14 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
# Copyright 2018 Tensorforce Team. 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 la...
import sys from typing import Tuple, List import pytest from clizy import run from tests.utils import stdoutify, cli_print_dict @pytest.mark.parametrize("type_hint, value, expected_output", [ (Tuple[int, int], ['1', '2'], stdoutify(values=[1, 2])), (Tuple[str, str], ['a', 'b'], stdoutify(values=['a', 'b']))...
import json import os import traceback from typing import NamedTuple # pip install pyyaml import yaml # pip install jsonmerge import jsonmerge from pt_helper import debug, info, warn, error class ProxySettings(NamedTuple): enabled: bool host: str port: int class UserAgentSettings(NamedTuple): ena...
#!/usr/bin/env python import numpy as np import pandas as pd import click as ck from sklearn.metrics import classification_report from sklearn.metrics.pairwise import cosine_similarity import sys from collections import deque import time import logging from sklearn.metrics import roc_curve, auc, matthews_corrcoef from...
# coding: utf-8 """ convertapi Convert API lets you effortlessly convert file formats and types. # noqa: E501 OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class XmlFilterWithXPathResult(object...
"""Model descriptions. The model describes the components of a data structure, kind of like a struct in C, but there's no limitation of what type of data structure the model is, or what it's used for. A record (faust.models.record) is a model type that serialize into dictionaries, so the model describe the fields, an...
""" """ # this file was auto-generated from datetime import date, datetime from fairgraph.base_v3 import KGObjectV3, IRI from fairgraph.fields import Field class SoftwareFeature(KGObjectV3): """ """ default_space = "controlled" type = ["https://openminds.ebrains.eu/controlledTerms/SoftwareFe...
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Copyright (c) 2017 The Bitcoin developers # Copyright (c) 2019 Bitcoin Association # Distributed under the Open BSV software license, see the accompanying file LICENSE. """ This test checks simple acceptance of bigger blocks via p2p. It is d...
from unittest import TestCase import pytest from asks.response_objects import Response from many_requests.many_requests_ import ManyRequests from many_requests.common import BadResponse from .mock_server import web_server @pytest.mark.usefixtures("web_server") class TestManyRequest(TestCase): def test_request(s...
import numpy as np import unittest from chainer.dataset import DatasetMixin from chainer import testing from chainercv.utils import assert_is_bbox_dataset from chainercv.utils import generate_random_bbox class BboxDataset(DatasetMixin): def __init__(self, options=(), empty_bbox=False): self.options = o...
#Planning on how to break up a program #Ex: #Song #--- #Title #Artist #Music file #Play time #Genre #Album #--- #A list of songs #Artist(s) #Label #Year published #Functions #--- #Play a song #Play a random song of an Album #Play a random album #Including Modules from the File's Directory #books.py -> contains class...
from EXOSIMS.SurveySimulation.tieredScheduler_SLSQP import tieredScheduler_SLSQP import EXOSIMS, os import astropy.units as u import astropy.constants as const import numpy as np import itertools from scipy import interpolate try: import cPickle as pickle except: import pickle import time import copy from EXOSI...
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 import boto3 import logging import traceback logger = logging.getLogger() logger.setLevel(logging.INFO) client = boto3.client('sagemaker') def stop_training_job(trainingName): try: response = client....
# from django.conf import settings # from data_ocean.models import Register # # API_ADDRESS_FOR_DATASET = Register.objects.get( # source_register_id=settings.LOCATION_KOATUU_SOURCE_REGISTER_ID # ).source_api_address
#!/usr/bin/env python import argparse import math import os import random import sys # ###### # # Config # # ###### # # directory containing the images data_path = None # output file for the training data train_output = "output.txt" # output file for the test data test_output = None # ratio to split traning and ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 2019/8/20 # @Author : github.com/guofei9987 import numpy as np from sko.tools import func_transformer from .base import SkoBase from tqdm import trange class PSO(SkoBase): """ Do PSO (Particle swarm optimization) algorithm. This algorithm was ...
# coding: utf-8 """ Cherwell REST API Unofficial Python Cherwell REST API library. # noqa: E501 The version of the OpenAPI document: 9.3.2 Contact: See AUTHORS. Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from pycherwell.configuration imp...
"""Generated client library for cloudscheduler version v1alpha1.""" # NOTE: This file is autogenerated and should not be edited by hand. from __future__ import absolute_import from apitools.base.py import base_api from googlecloudsdk.third_party.apis.cloudscheduler.v1alpha1 import cloudscheduler_v1alpha1_messages as ...
from unittest import mock import datetime as dt from django.core.mail.message import EmailMessage import awx.main.notifications.grafana_backend as grafana_backend def test_send_messages(): with mock.patch('awx.main.notifications.grafana_backend.requests') as requests_mock: requests_mock.post.return_value...
from __future__ import print_function, division # requires Python >= 2.6 # numpy and scipy imports import numpy as np from scipy.sparse import kron, identity, lil_matrix from scipy.sparse.linalg import eigsh # Lanczos routine from ARPACK # We will use python's "namedtuple" to represent the Block and Enlarged...
""" Run the cross validation with line search for model selection using G-NMF on the Sanger dataset. """ import sys, os project_location = os.path.dirname(__file__)+"/../../../../../" sys.path.append(project_location) import numpy, random from BNMTF.code.models.bnmf_gibbs_optimised import bnmf_gibbs_optimised from BN...
import argparse # pragma: no cover from . import BaseClass, base_function # pragma: no cover def main() -> None: # pragma: no cover """ The main function executes on commands: `python -m signal_processing` and `$ signal_processing `. This is your program's entry point. You can change this fu...
# Matthieu Brucher # Last Change : 2007-08-26 19:43 import numpy class BacktrackingSearch(object): """ The backtracking algorithm for enforcing Armijo rule """ def __init__(self, rho = 0.1, alpha_step = 1., alpha_factor = 0.5, **kwargs): """ Can have : - a coefficient for the Armijo rule (rho =...
from django.shortcuts import render, get_object_or_404 from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.contrib.auth.models import User from django.views.generic import ( ListView, DetailView, CreateView, UpdateView, DeleteView ) from .models import Post cl...
"""Command-line interface.""" import click @click.command() @click.version_option() def main() -> None: """Pyproject2Sphinx.""" if __name__ == "__main__": main(prog_name="pyproject2sphinx") # pragma: no cover
############################################################################## # # Copyright (c) 2006-2008 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THI...
class Graph: def __init__(self, vertexes: int) -> None: self.vertexes = vertexes self.graph = [] def connect(self, u: int, v: int, w: int) -> None: self.graph.append([u, v, w]) def show(self, distances: list) -> None: print(distances) def fordbellman(self, start: int) ...
# qubit number=2 # total number=7 import cirq import qiskit from qiskit import IBMQ from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister from qiskit import BasicAer, execute, transpile from pprint import pprint from qiskit.test.mock import FakeVigo from math import log2,floor, sqrt, pi import numpy as...
import unittest import mock import six from six.moves import cPickle as pickle from smqtk.exceptions import ReadOnlyError from smqtk.representation.data_element.memory_element import ( BYTES_CONFIG_ENCODING, DataMemoryElement, ) from smqtk.representation.key_value.memory import MemoryKeyValueStore class Tes...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# overall python packages import glob import astropy.io.fits as fits import os import time import numpy as n import sys # specific functions from scipy.stats import norm # dedicated packages #import StellarMass meanSM= lambda Mh, z : n.log10(Mh * 2. * ( 0.0351 - 0.0247 * z/(1.+z)) / ((Mh/ (10**(11.79 + 1.5 * z/(1.+z)...
import asyncio import logging import os import shutil import warnings from types import TracebackType from typing import ( Any, Coroutine, Dict, List, Optional, Text, Type, TypeVar, Union, ContextManager, ) import rasa.utils.io from rasa.constants import DEFAULT_LOG_LEVEL_LIBRAR...
# diagram.py from diagrams import Cluster, Diagram, Edge from diagrams.aws.mobile import APIGateway graph_attr = { "fontsize": "28", "fontname": "Helvetica", "style": "rounded", "bgcolor": "transparent" } major_cluster ={ "fontsize": "24", "fontname": "Helvetica", "style": "rounded", "...
import matplotlib from plantcv.plantcv.fatal_error import fatal_error from plantcv.plantcv.classes import Params from plantcv.plantcv.classes import Outputs from plantcv.plantcv.classes import Spectral_data # Initialize an instance of the Params and Outputs class with default values # params and outputs are available w...
# encoding: utf-8 """ attribute.py Created by Thomas Mangin on 2009-11-05. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import pack from exabgp.bgp.message.notification import Notify from exabgp.util.cache import Cache # ===============================================================...
# 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 # distributed under t...
#!/usr/bin/env python3 import torch class SoftUpdate(torch.optim.Optimizer): def __init__(self, target_params, source_params, tau=0.1): """ Perform soft-update on target_params. Soft-update gradually blends source_params into target_params with this update equation: target_pa...
import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg import pickle # Read in an image image = mpimg.imread('../images/signs_vehicles_xygrad.png') def dir_threshold(img, sobel_kernel=3, thresh=(0, np.pi/2)): # Apply the following steps to img # 1) Convert to grayscal...
from .video import Video
#!/usr/bin/python3 import unittest, probabilityToFriendlyString, pathlib class TestPercentToFriendlyString(unittest.TestCase): def test_allCases(self): testCasesPath = pathlib.Path(__file__).parent.parent.joinpath("testCases.txt") with open(testCasesPath, 'r') as f: lineNumber = 0 for line in f.readlines():...
import argparse import os from multiprocessing import cpu_count from tqdm import tqdm from datasets import blizzard, ljspeech, chinspeech from hparams import hparams def preprocess_blizzard(args): in_dir = os.path.join(args.base_dir, 'Blizzard2012') out_dir = os.path.join(args.base_dir, args.output) os.makedirs...
# # Copyright 2013, Couchbase, 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 applicable l...
import abc import requests class Requestor(abc.ABC): @abc.abstractmethod def request(self, method, url, params={}, headers={}, cookies={}, **kwargs): pass Requestor.register(requests.Session)
import tkinter as tk import tktools from algs.astar import astar from algs.dijkstra import dijkstra import numpy as np import threading from tkinter import filedialog import random from grid import Grid class Frame(tk.Frame): def __init__(self, *args): tk.Frame.__init__(self, *args) def get_...
# Copyright (C) 2009-2012 Lars Wirzenius # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distribu...
"""Module of utilities for verifying test results.""" import difflib import filecmp import hashlib import io import logging import os import os.path import re import shutil import tempfile try: import pysam except ImportError: pysam = None from galaxy.util.compression_utils import get_fileobj from .asserts i...
# -*- coding: utf-8 -*- """ Unittests for tcping module """ import sys import unittest import os import time import tempfile import shutil import socket import errno from ioflo.aid.sixing import * from ioflo.aid.consoling import getConsole from ioflo.aio import wiring from ioflo.aio.tcp import serving, clienting from...
from __future__ import absolute_import import numpy from abopt.vmad2 import ZERO, Engine, statement, programme, CodeSegment, Literal from abopt.abopt2 import VectorSpace from pmesh.pm import ParticleMesh, RealField, ComplexField def nyquist_mask(factor, v): # any nyquist modes are set to 0 if the transfer functio...
# -*- coding: utf-8 -*- import os import re import sys import json import datetime as dt import time from argparse import ArgumentParser, Namespace from sklearn.model_selection import train_test_split import tensorflow as tf # TF 2.0 from utils import load_dataset, load_vocab, convert_vocab, select_optimizer, loss...
#!python3.6 import click import schedule import time from coinmarketcap import Market from states import ProfileStateSwap def getBTC_PercentChange(): market = Market() bitcoin = market.ticker(currency='bitcoin')[0] percent_change = float(bitcoin['percent_change_1h']) print('Checking BTC 1 Hour PCHG:...
""" sentry.models.projectoption ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function from celery.signals import task_postrun from django.core.signals import reques...
import logging import requests import time import urllib.parse OSMO_HISTORICAL_NODE = "https://api-osmosis.imperator.co" class OsmoHistoricalAPI: @classmethod def get_symbol(cls, ibc_address): uri = "/search/v1/symbol?denom={}".format(urllib.parse.quote(ibc_address)) data = cls._query(uri) ...
import logging from typing import TYPE_CHECKING import numpy as np from dask_sql.datacontainer import DataContainer from dask_sql.physical.rel.base import BaseRelPlugin if TYPE_CHECKING: import dask_sql from dask_sql.java import org logger = logging.getLogger(__name__) class SamplePlugin(BaseRelPlugin): ...
#!/usr/bin/env python3 import argparse from pathlib import Path import sys import blobconverter import cv2 import depthai as dai import numpy as np from classes import class_names # Get Argument First parser = argparse.ArgumentParser() parser.add_argument('-nd', '--no-debug', action="store_true", help="Prevent debug ...
import sys from dataclasses import dataclass, field from typing import Optional, Dict import inspect import os from .daemon import Daemon def _get_imported_packages() -> Dict[str, str]: """ Returns a list of packages that have been imported, as a {name: version} dict. """ try: # Should we ven...
from django.db import models class GameManual(models.Model): year = models.CharField(max_length=4) name = models.CharField(max_length=140,null=True) file = models.FileField(upload_to='files/') image = models.ImageField(upload_to='images/') def __str__(self): return self.year;
# # PySNMP MIB module JUNIPER-PFE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/JUNIPER-PFE-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:00:43 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27...
#!/bin/sh "exec" "$FIDASIM_DIR/deps/python" "$0" "$@" # -*- coding: utf-8 -*- #+#FIDASIM Utilities #+This file contains useful FIDASIM utilities #+*** from __future__ import print_function import os from os.path import dirname import subprocess import platform import numpy as np import copy import h5py import efit fro...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # File: gradproc.py # Author: Yuxin Wu <ppwwyyxx@gmail.com> import tensorflow as tf from abc import ABCMeta, abstractmethod import re import inspect from ..utils import logger from .symbolic_functions import rms from .summary import add_moving_summary __all__ = ['Gradient...
# Copyright 2018 IBM 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 writing, ...
# -*- coding: utf-8 -*- import struct import traceback from time import time as now from collections import namedtuple from ._keyboard_event import KeyboardEvent, KEY_DOWN, KEY_UP, normalize_name from ._canonical_names import all_modifiers from ._nixcommon import EV_KEY, aggregate_devices, ensure_root # TODO: start by...
#!/usr/bin/env python3 # Written by Stewart Nash (Aerobautics) November 2019 """This file contains the GID Picture class. This class holds all information related to an individual image. """ from tkinter import * import PIL from PIL import ImageTk from PIL import Image from xml.dom.minidom import parse import sys impor...
""" Django settings for elecciones project. Generated by 'django-admin startproject' using Django 2.2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os...
# -*- coding: utf-8 -*- #import sys import json class CinToJson(object): def __init__(self): pass def CinToJson(self): return self #def _file_get_contents(self,filename): # return open(filename).read() def _find_between(self, s, first, last ): start = s.index( first ) + len( first ) e...
from wingedsheep.carcassonne.objects.coordinate import Coordinate from wingedsheep.carcassonne.objects.side import Side class CoordinateWithSide: def __init__(self, coordinate: Coordinate, side: Side): self.coordinate = coordinate self.side = side def __eq__(self, other): return self...
# coding: utf-8 """ Cisco Intersight OpenAPI specification. The Cisco Intersight OpenAPI specification. OpenAPI spec version: 1.0.9-1461 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import sys import os import re # python 2 and p...
import math import rl WIDTH, HEIGHT = 80, 60 rl.init_display("Array image", WIDTH, HEIGHT) pixels = rl.Array(WIDTH, HEIGHT) angle = 0 def update(event): global angle pixels.random_2d(int(math.cos(angle) * 128), int(math.sin(angle) * 128)) image = rl.array_to_image(pixels) rl.draw_image(image, 0, 0...
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import mshoot fmupath = os.path.join('examples', 'tutorial', 'modelica', 'R3C3.fmu') # 1) Emulation model model_emu = mshoot.SimFMU( fmupath, outputs=['y', 'u1_y'], states=['heatCapacitor1.T', 'heatCapacitor2.T', 'heatCapac...
class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKCYAN = '\033[96m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' numero = int(input(bcolors.OKBLUE+ "Digite um numero ")) if numero % 2 == 0: print("O ...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange from ccxt.base.errors import ExchangeError from ccxt.base.errors import Authenticatio...
### imports import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras import initializers import src.utils as utils # import tensorflow.keras.backend as K import matplotlib.pyplot as plt from src.utils import finiteDiff, integrate, loadData, eva...
# Copyright 2022 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from django.conf import settings from django.shortcuts import render, get_object_or_404 from django.utils.decorators import method_decorator from django.views.generic.list import ListView from uw_saml.decorators import group_requi...
description = 'Monitors the status of the Forwarder' devices = dict( KafkaForwarder=device( 'nicos_ess.devices.forwarder.EpicsKafkaForwarder', description='Monitors the status of the Forwarder', statustopic='ymir_forwarder_status', brokers=['10.100.1.19:9092']), )
import os import sys from pkg_resources import resource_filename import importlib import inspect import textwrap from unittest import SkipTest class DelayImportError(ImportError, SkipTest): pass def get_fn(filename): """Get the full path to one of the reference files shipped for utils. In the source dis...
from __future__ import print_function, division from os.path import join, isdir, dirname, abspath from os import getcwd import os from sys import getfilesystemencoding from inspect import currentframe, getfile, getsourcefile from collections import OrderedDict from six import iteritems import pandas as pd from nilm_me...
# The MIT License (MIT) # # Copyright (c) 2019 Brent Rubell for Adafruit Industries # # 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 rig...