text
stringlengths
1
927k
# SPDX-License-Identifier: Apache-2.0 import numpy as np # type: ignore import onnx from ..base import Base from . import expect class Mean(Base): @staticmethod def export() -> None: data_0 = np.array([3, 0, 2]).astype(np.float32) data_1 = np.array([1, 3, 4]).astype(np.float32) dat...
from .._tier0 import execute from .._tier0 import plugin_function from .._tier0 import Image from .._tier0 import create_2d_zx @plugin_function(output_creator=create_2d_zx, categories=['projection']) def mean_y_projection(source : Image, destination : Image = None) -> Image: """Determines the mean average intensit...
# Space - O(1) ; Time - O(n logn) class Solution: def maxOperations(self, nums: List[int], k: int) -> int: nums.sort() i = 0 j = len(nums)-1 op = 0 while i<j: val = nums[i] + nums[j] if val == k: op += 1 i += 1 ...
import numpy as np import pandas as pd import matplotlib.pyplot as plt class PID(): def __init__(self, P,I,D, bias): self.P = P self.I = I self.D = D self.bias = bias def adjust(self,data:np.array): output = self.P*self.prop(data) + self.I*self.inte(data) + self.D*self....
import sys import os import pathlib fbrd = os.getenv('fbrd') exp_path = pathlib.Path(f'{fbrd}/experiments') [sys.path.insert(1,str(exp)) for exp in exp_path.iterdir() if exp.is_dir()]
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import os from setuptools import setup def get_version(package): """ Return package version as listed in `__version__` in `init.py`. """ init_py = open(os.path.join(package, '__init__.py')).read() return re.search("__version__ = ['\"]([^'\"]+...
from BrokerManager import BrokerManager from MessageMonitor import MessageMonitor from MultiTopicConsumer import MultiTopicConsumer from printer import console_out import random from random import shuffle import time import threading from printer import console_out_exception class ConsumerManager: def __init__(sel...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/DeviceMetric) on 2019-05-14. # 2019, SMART Health IT. from . import (backboneelement, codeableconcept, domainresource, fhirdate, fhirreference, identifier, timing) class DeviceM...
from django.contrib.auth.models import User from pytest import mark from rest_framework.test import APIClient from rest_framework_api_key.models import APIKey @mark.usefixtures("authorization_required") def test_anonymous_client_cannot_access_api_without_api_key(): api_client = APIClient() response = api_clie...
import datetime import pytest import unittest from quickbooks import QuickBooks from quickbooks.objects.preferences import Preferences def check_valid_date(date_text): try: datetime.datetime.strptime(date_text, '%Y-%m-%d') return True except ValueError: raise ValueError("Incorrect data form...
#!/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: # ...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# Copyright (c) 2018-2022 Micro Focus or one of its affiliates. # Copyright (c) 2018 Uber Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
__version__ = "1.1.3"
from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * from math import * from Vector3 import * from Vector2 import * import sys,os import GlobalData pyHyperNEATPath = os.path.split(os.path.split(os.getcwd())[0])[0] + '/out' print 'Looking for PyHyperNEAT DLL at', pyHyperNEATPath if pyHyperNEATP...
# Copyright 2021 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 law or agreed to in writing, ...
import os from keep_alive import keep_alive import discord import nacl from discord import FFmpegPCMAudio import youtube_dl import discord.utils from discord.utils import find from discord.ext import commands, tasks from itertools import cycle from youtubesearchpython import VideosSearch import numpy as np #initializi...
from flask_wtf import FlaskForm from wtforms import StringField, TextAreaField, SubmitField from wtforms.validators import Length, DataRequired from anon_scriber import datetime class PostForm(FlaskForm): title = StringField(label='Title: ', validators=[Length(min=1, max=60), DataRequired()]) post_text = TextA...
"""Function to extract random entries (lines) from a CSV file The function, randomSelectFromCSV, allows the user to specify the desired number of entries to obtain from a comma-separated values (CSV) file which contains data extracted from the STScI archive for ACS, WFC3, and WFPC2 instruments. The data are comprise...
class ToolStripContentPanelRenderEventHandler(MulticastDelegate,ICloneable,ISerializable): """ Represents the method that will handle the System.Windows.Forms.ToolStripContentPanel.RendererChanged event of a System.Windows.Forms.ToolStripContentPanel. ToolStripContentPanelRenderEventHandler(object: object,method...
#!/usr/bin/python # Copyright: (c) 2018, Pluribus Networks # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.12.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys i...
# Copyright 2017-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. import torch from torch.autograd import Variable from convlab2.e2e.rnn_rollout.engines import EngineBase, Criterion class Selectio...
# DO NOT EDIT THIS FILE! # # This file is generated from the CDP specification. If you need to make # changes, edit the generator and regenerate all of the modules. # # CDP domain: Log from __future__ import annotations from .util import event_class, T_JSON_DICT from dataclasses import dataclass import enum import typi...
# SPDX-FileCopyrightText: 2020 SAP SE # # SPDX-License-Identifier: Apache-2.0 # From https://github.com/openai/improved-gan/blob/master/inception_score/model.py # Code derived from tensorflow/tensorflow/models/image/imagenet/classify_image.py from __future__ import absolute_import from __future__ import division from ...
# -*- coding: utf-8 -*- # # Copyright 2018-2020- Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in co...
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
import torch.nn as nn import torch from typing import List, Tuple, Optional, overload, Union, cast from torch import Tensor from transformers import BertModel from pytree.data.packed_tree import PackedTree class TreeEmbeddings(nn.Module): def __init__(self, config): super(TreeEmbeddings, self).__init__()...
from django.contrib import admin from .models import UserProfile # Register your models here. class UserProfileAdmin(admin.AdminSite): list_display = ('username', 'email', 'mobile', 'is_superuser', 'date_joined') search_fields = ('username', 'email', 'mobile',) list_filter = ('date_joined',) admin.site.re...
#!/usr/bin/env python3 # Copyright (c) 2013-2018, Rethink Robotics 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...
# Copyright (c) OpenMMLab. All rights reserved. import argparse import os import os.path as osp import shutil import cv2 import mmcv import numpy as np import torch from mmcv import DictAction from mmaction.apis import inference_recognizer, init_recognizer try: from mmdet.apis import inference_detector, init_det...
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html class PaperSpiderPipeline(object): def process_item(self, item, spider): return item
"""Defines exceptions that can occur when interacting with interface data values""" from util.exceptions import ValidationException class InvalidData(ValidationException): """Exception indicating that the data is invalid""" def __init__(self, name, description): """Constructor :param name: T...
from theplease.rules.ls_all import match, get_new_command from theplease.types import Command def test_match(): assert match(Command('ls', '')) assert not match(Command('ls', 'file.py\n')) def test_get_new_command(): assert get_new_command(Command('ls empty_dir', '')) == 'ls -A empty_dir' assert get...
import sys from django.conf import settings settings.configure( DEBUG=True, DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', } }, ROOT_URLCONF='whisk_tutorial.urls', INSTALLED_APPS=( 'django.contrib.auth', 'django.contrib.content...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
"""Set the default for the app.""" from pyramid.view import view_config from learning_journal.data.entry_data import ENTRIES from datetime import datetime from pyramid.httpexceptions import HTTPNotFound, HTTPFound, HTTPBadRequest from learning_journal.models.mymodel import Journal @view_config(route_name="home", rend...
''' Created on May 6, 2012 @author: Charlie Calvert Some examples of how to use a Python Dictionary ''' myDictionary = { "one": 1, "two": 2} print myDictionary["one"] print myDictionary["two"] class TestField(object): def __init__(self, value): self.value = value field = TestField(3) myDict...
import os import pytest import numpy as np import astropy.units as u from astropy.coordinates import SkyCoord from astropy.coordinates import Longitude from astropy.tests.helper import assert_quantity_allclose from astropy.time import TimeDelta from sunpy.coordinates import frames from sunpy.coordinates.ephemeris imp...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # pactools documentation build configuration file, created by # sphinx-quickstart on Thu Mar 23 10:56:51 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # a...
r""" Morphisms and homsets for simplicial sets .. NOTE:: Morphisms with infinite domain are not implemented in general: only constant maps and identity maps are currently implemented. AUTHORS: - John H. Palmieri (2016-07) This module implements morphisms and homsets of simplicial sets. """ # *************...
class FilterBackendViewMixin: filter_backends = None def get_queryset(self): result = super(FilterBackendViewMixin, self).get_queryset() for filter_backend in self.filter_backends: filter_instance = filter_backend(request=self.request, view=self) result = filter_instance...
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from .constants import Holiday, holidays, in_lieu_days, workdays from .utils import ( find_workday, get_dates, get_holiday_detail, get_holidays, get_workdays, is_holiday, is_in_lieu, is_workday, ) __versio...
"""Coverage plugin for nose.""" import logging from nose.plugins.base import Plugin log = logging.getLogger(__name__) class Cov(Plugin): """Activate cov plugin to generate coverage reports""" score = 200 status = {} def options(self, parser, env): """Add options to control coverage.""" ...
""" Utility file to select GraphNN model as selected by the user """ from nets.molecules_graph_regression.gated_gcn_net import GatedGCNNet from nets.molecules_graph_regression.gcn_net import GCNNet from nets.molecules_graph_regression.gat_net import GATNet from nets.molecules_graph_regression.graphsage_net imp...
import sys from PyQt4 import QtGui, QtCore from PyQt4.QtCore import Qt import pywapi class Main(QtGui.QMainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) self.initUI() def initUI(self): self.line = QtGui.QLineEdit(self) self.line.move(90,35) self....
from subprocess import call from os import path import hitchpostgres import hitchselenium import hitchpython import hitchserve import hitchredis import hitchtest import hitchsmtp # Get directory above this file PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..')) class ExecutionEngine(hitchtest...
import datetime import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import linear_model from sklearn.metrics import mean_squared_error from exp_data import * from exp_data_utils import RegressionRecord from read_data.utils import dfTypePair, toSingleRowDF import global_config def compu...
""" pysubs2.formats.tmp tests """ from __future__ import unicode_literals from textwrap import dedent from pysubs2 import SSAFile, SSAEvent, make_time def test_simple_write(): subs = SSAFile() e1 = SSAEvent() e1.start = 0 e1.end = 60000 e1.text = "ten--chars" e2 = SSAEvent() e2.start = ...
""" Double DQN """ import argparse from collections import OrderedDict from typing import Tuple import pytorch_lightning as pl import torch from pl_bolts.losses.rl import double_dqn_loss from pl_bolts.models.rl.dqn_model import DQN class DoubleDQN(DQN): """ Double Deep Q-network (DDQN) PyTorch Lightning...
class Calculadora: def sumar(self, cadena): if cadena == "": return 0 elif "," in cadena or "&" in cadena or ":" in cadena: cadena=cadena.replace("&",",") cadena=cadena.replace(":",",") numeros = cadena.split(",") suma = 0 for ...
from loader import a2d_dataset import argparse import torch import torch.nn as nn import numpy as np import os os.environ["CUDA_VISIBLE_DEVICES"] = "0" # GPU ID from torch.utils.data import Dataset, DataLoader from cfg.deeplab_pretrain_a2d import train as train_cfg from cfg.deeplab_pretrain_a2d import val as val_cfg fr...
########################################################################## # # Copyright (c) 2011-2013, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
# Made By @Kraken_The_BadASS # Keep Credits else gay.... """Create Private Groups Available Commands: .create (b|g) GroupName""" from telethon.tl import functions from telethon.tl.types import MessageEntityMentionName from userbot import CMD_HELP from mafiabot.utils import admin_cmd, edit_or_reply, sudo_cmd from user...
# Copyright (c) 2018 Dow Jones & Company, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
#!/usr/bin/env python # # Copyright 2019 Open Source Robotics Foundation, 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 re...
"""geohunter.osm This module wraps requests to OpenStreetMap's Overpass API with an interface for the GeoPandas data structures. The OpenStreetMap has a data model based on nodes, ways and relations. The geometric data structures available in geopandas are points, lines and polygons (but also multipoints, multilines a...
""" Evaluation class that performs forward pass through trained models """ import os import cv2 import numpy as np from pocovidnet import MODEL_FACTORY DIR_PATH = os.path.dirname(os.path.realpath(__file__)) NUM_FOLDS = 5 class Evaluator(object): def __init__(self, ensemble=True, split=None, model_id=None): ...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/core.ipynb (unless otherwise specified). __all__ = ['TrainerBase'] # Cell class TrainerBase(object): "Base class for GANs trainer" def __init__(self): self.has_trained = False def set_training_parameters(self, epochs=...
from .models import Post, Comment from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.models import User from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.db.models import Q from django.contrib.auth.decorators import login_required from djan...
from composo_py import ioc def init(config): ioc.Config.config.from_dict(config) app = ioc.Plugin.plugin() return app def test(): app = ioc.Plugin.plugin() app.run("test") if __name__ == "__main__": test()
def transpose(grid): return [''.join(line) for line in zip(*grid)] def chk_hori(grid): for line in grid: if all(c in 'XT' for c in line): return 'X won' if all(c in 'OT' for c in line): return 'O won' def chk_diag(grid): if all(grid[i][i] in 'XT' for i in range(len(...
import json from uuid import uuid1 import pytest from click.testing import CliRunner from flask_jsondash.data_utils import filetree def test_path_hierarchy(tmpdir): uid = uuid1() tmp = tmpdir.mkdir('{}'.format(uid)) data = filetree.path_hierarchy(tmp.strpath) assert json.dumps(data) for key in...
# coding: utf-8 import pprint import re import six class ListKeyDetailRequest: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the val...
# coding=utf-8 # *** WARNING: this file was generated by pulumigen. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Dict, List, Mapping, Optional, Tuple, Union from ... import _utilities, _tables from . imp...
from setuptools import setup setup( name='avwx', version='1.0.0', description="A tool to grab aviation-related weather", url="https://github.com/cloudrave/avwx", author="Nick Merrill", author_email="public@nickmerrill.co", license='MIT', packages=['avwx'], install_requires=[ ...
# Copyright 2017 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...
import myrequests class GoogleError(myrequests.RequestError): pass def google_geocode(address, components='locality:riga|country:LV', language='ru', key=''): response = myrequests.requests.get( f'https://maps.googleapis.com/maps/api/geocode/json?address={address}&components={components}&language={la...
"""Cogeo_mosaic.""" __version__ = "3.0.0rc2"
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re from .common import fact, _copyB from telegram_util import matchKey def isCaption(item): if not item: return False return 'caption' in str(item.attrs).lower() and item.name != 'img' def _getCaption(item): if isCaption(item.find_next()): return item.find...
from pathlib import Path import pytest import numpy as np from datetime import datetime from unittest.mock import patch, MagicMock import pandas as pd from wetterdienst.dwd.metadata.column_map import METADATA_DTYPE_MAPPING from wetterdienst.util.geo import derive_nearest_neighbours from wetterdienst.util.geo import C...
# Copyright (c) 2015 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
# -*- coding: utf-8 -*- import logging import requests # import json from modules import cbpi from thread import start_new_thread headers = {'content-type': '"application/json; charset=utf-8"'} unit = "F" @cbpi.initalizer(order=999) def init(cbpi): # Setup BrewFather telemetry (optional) global unit unit = ...
from typing import Optional ################################################################ # Zulip Server settings. # # This file controls settings that affect the whole Zulip server. # See our documentation at: # https://zulip.readthedocs.io/en/latest/production/settings.html # # For developer documentation on th...
# 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...
### following code example shows how code to generate and upload a model explanation can be incorporated into an experiment script. Thisi explanation can be viewed in ### terms of graphs and charts in AML studio. # Import Azure ML run library from azureml.core.run import Run from azureml.contrib.interpret.explanatio...
from os.path import exists from os import remove as delete_file from pyttsx3 import init import wave import soundfile au_print = wave.open("print.wav", "rb") au_let = wave.open("let.wav", "rb") au_main = wave.open("main.wav", "rb") au_if = wave.open("if.wav", "rb") au_end = wave.open("end.wav", "rb") au_break = wave.o...
""" {{ cookiecutter.application_name }} Application """ default_app_config = '{{ cookiecutter.application_module }}.apps.Config'
from unittest import TestCase import simplejson as json class TestBigintAsString(TestCase): values = [(200, 200), ((2 ** 53) - 1, 9007199254740991), ((2 ** 53), '9007199254740992'), ((2 ** 53) + 1, '9007199254740993'), (-100, -100), ((-2 ** 53)...
# coding: utf-8 """ Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at http://www.apache.org/licenses/LICENSE-2.0 or in ...
from http.cookiejar import FileCookieJar from http.cookiejar import http2time # type: ignore from http.cookies import SimpleCookie from urllib.parse import parse_qs from urllib.parse import urlparse import pytest from oic.exception import UnSupported from oic.oauth2 import util from oic.oic import AuthorizationReque...
# coding: utf-8 """ Tradenity API Tradenity eCommerce Rest API Contact: support@tradenity.com """ from __future__ import absolute_import import io import json import logging import re import ssl import certifi # python 2 and python 3 compatibility library import six from six.moves.urllib.parse impor...
# Generated by Django 2.2.11 on 2020-04-01 17:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djpmp', '0002_auto_20200401_1607'), ] operations = [ migrations.AlterModelOptions( name='hrcalendar', options={'ver...
import sys import datetime import argparse import os import csv import numpy as np import os.path as path from builtins import isinstance sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) import fnc.refs.fnc1.scorer as scorer import fnc.utils.score_calculation as score_calculation import fnc.utils.est...
# -*- coding: utf-8 -*- from urllib.parse import urljoin from edn import loads import requests class Database(object): def __init__(self, name, conn): self.name = name self.conn = conn def __getattr__(self, name): def f(*args, **kwargs): return getattr(self.conn, name)(self.name, *args, **kwargs) return ...
from functools import reduce from sys import stdin, stdout from itertools import combinations from .constants import * from .parse import * def transpile(src, dst): w = dst.write def unindent(previously, now): if previously == now and now == 0: return if previously < no...
# Copyright 2015 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...
import logging log = logging.getLogger('baseagent') from abc import ABC, abstractmethod from enforce_typing import enforce_types import typing from engine import AgentWallet from web3engine import bpool, datatoken, globaltokens from util.constants import SAFETY from util.strutil import StrMixin from web3tools.web3uti...
# Copyright (c) 2013-2016 Hewlett Packard Enterprise Development LP # # Redistribution and use of this software 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, # thi...
''' Created on 2021-07-26 @author: wf ''' from typing import Callable from corpus.config import EventDataSourceConfig from lodstorage.csv import CSV from lodstorage.entity import EntityManager from lodstorage.jsonable import JSONAble from lodstorage.lod import LOD from lodstorage.sql import SQLDB from lodstorage.stora...
"""Test the successful creation of Pyomo 0-degree models in RBFOpt. This module contains unit tests for the module rbfopt_degree0_models. Licensed under Revised BSD license, see LICENSE. (C) Copyright International Business Machines Corporation 2016. """ from __future__ import print_function from __future__ import ...
from typing import Any from checkov.common.models.enums import CheckCategories from checkov.cloudformation.checks.resource.base_resource_value_check import BaseResourceValueCheck from checkov.common.models.consts import ANY_VALUE class SQSQueueEncryption(BaseResourceValueCheck): def __init__(self) -> None: ...
from __future__ import absolute_import import numpy as np import sunpy.sun as sun import astropy.units as u rsun_meters = sun.constants.radius.si.value __all__ = ['_convert_angle_units', 'convert_pixel_to_data', 'convert_hpc_hg', 'convert_data_to_pixel', 'convert_hpc_hcc', 'convert_hcc_hpc', '...
__author__ = 'Michael Andrew michael@hazardmedia.co.nz' from nz.co.hazardmedia.sgdialer.models.ChevronModel import ChevronModel class ChevronController(object): chevron_model = None id = 0 def __init__(self, id): self.id = id if id == 1: name = "Chevron 1" elif id ==...
import pytest from sanic import Sanic from sanic.response import json, text from sanic_jwt import exceptions, Initialize from sanic_jwt.decorators import protected, scoped class User: def __init__(self, id, username, password, scopes): self.id = id self.username = username self.password ...
import socket import numpy as np # pip install numpy socketUDP = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) transmissor = ("127.0.0.1", 2020) receptor = ("127.0.0.1", 3030) socketUDP.bind(transmissor) buff_size = 10000 next_sequence_number = 0 def calculate_checksum(data): data_sum = np.uint16(0) fo...
# SPDX-FileCopyrightText: 2021 Sandy Macdonald # # SPDX-License-Identifier: MIT """ `Keybow 2040 CircuitPython library` ==================================================== CircuitPython driver for the Pimoroni Keybow 2040. Drop the keybow2040.py file into your `lib` folder on your `CIRCUITPY` drive. * Author: Sand...
from typing import Union import numpy as np import pandas as pd from oolearning.converters.TwoClassConverterBase import TwoClassConverterBase from oolearning.enums.Metric import Metric from oolearning.evaluators.TwoClassConfusionMatrix import TwoClassConfusionMatrix from oolearning.evaluators.ScoreActualPredictedBase...