text
stringlengths
2
999k
from __future__ import absolute_import, print_function, unicode_literals import re IGNORE_PATTERNS = (re.compile(I) for I in [r'.+\.hot-update.js', r'.+\.map'])
""" A ``TokenEmbedder`` which uses one of the BERT models (https://github.com/google-research/bert) to produce embeddings. At its core it uses Hugging Face's PyTorch implementation (https://github.com/huggingface/pytorch-pretrained-BERT), so thanks to them! """ from typing import Dict import logging import torch impo...
""" A pipeline example that uses several interfaces to perform analysis on diffusion weighted images using FSL FDT tools. This tutorial is based on the 2010 FSL course and uses data freely available at the FSL website at: http://www.fmrib.ox.ac.uk/fslcourse/fsl_course_data2.tar.gz More details can be found at http:/...
# Copyright (C) 2018 Adam Gibson (waxwing) # Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php # Derived from https://gist.github.com/AdamISZ/046d05c156aaeb56cc897f85eecb3eb8 import hashlib...
import argparse from datetime import datetime from keras.models import model_from_json, load_model, save_model from keras.datasets import cifar100 import tensorflow as tf from utils import load_MNIST, load_CIFAR from utils import filter_val_set, get_trainable_layers from utils import save_layerwise_relevances, load_la...
from machine import Pin from utime import ticks_diff,ticks_ms class Sensor: def __init__(self, socket, irSender, sound_pin = 14): self.socket = socket self.irSender = irSender self.sound_pin = Pin(sound_pin, Pin.IN) self.sound_pin.irq(trigger=Pin.IRQ_RISING, handler=lambda p: self.c...
# pylint: disable=redefined-outer-name, unused-argument, invalid-name, missing-docstring, too-many-arguments import json import time import urllib.parse import jwt import pytest import requests from httmock import urlmatch, HTTMock from cryptography.hazmat.primitives import serialization from authlib.jose import jw...
class xcmd(object): def __init__(self): self.args: [] = None self.info: str = "" def setArgs(self, args): self.args = args def run(self): print(self.info) def parse(self): pass
#!/usr/bin/python # # Copyright 2018-2020 Polyaxon, 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 ...
###################################################################### # # File: b2/account_info/exception.py # # Copyright 2016 Backblaze Inc. All Rights Reserved. # # License https://www.backblaze.com/using_b2_code.html # ###################################################################### from abc import (ABCMeta...
import warnings import pandas as pd import matplotlib import matplotlib.pyplot as plt import plotly.express as px import statsmodels.tsa.arima.model as smt import yfinance as yf import streamlit as st from src.tools import functions as f0 warnings.filterwarnings("ignore", "statsmodels.tsa.arima_model.ARMA", FutureWar...
"""Registering a Prefect Flow downloading a zipped folder containing csv files. """ # the config object must be imported from config.py before any Prefect imports from pathlib import Path from prefect import Flow, unmapped, Parameter, flatten, case, apply_map from prefect.tasks.shell import ShellTask from prefect.trig...
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Helpful routines for regression testing.""" from base64 import b64encode from binascii import hexlify,...
# 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...
from __future__ import unicode_literals from django.db import models class Foo(models.Model): bar = models.CharField(max_length=100)
import os """ Shaker configuration """ from jinja2 import Template import yaml import shaker.ami import shaker.log LOG = shaker.log.getLogger(__name__) DEFAULTS = { # These values will be overridden in profile/default or # a user profile, or command-line options. 'hostname': None, 'domain': None, ...
import argparse import torch import numpy as np import sys import os,shutil import dlib sys.path.append(".") sys.path.append("..") from configs import data_configs, paths_config from datasets.inference_dataset import InferenceDataset from torch.utils.data import DataLoader from utils.model_utils import setup...
import pytest from django.template import Template from django.utils.html import format_html from iommi import ( Form, Fragment, Header, html, Page, ) from iommi.attrs import Attrs from iommi.fragment import ( build_and_bind_h_tag, fragment__render, ) from tests.helpers import req def tes...
from __future__ import division import os import cv2 import numpy as np import sys import pickle from optparse import OptionParser import time from keras_frcnn import config from keras import backend as K from keras.layers import Input from keras.models import Model from keras_frcnn import roi_helpers import re import ...
# Contains functions and helpers to obtain and interact with REDCap API data. import json import requests ################################################################ #### Metadata behavior ################################################################ def _request_metadata(secrets_dict: dict) -> str: '''M...
import dj_database_url SECRET_KEY = 'django-pgpubsub' # Install the tests as an app so that we can make test models INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'pgpubsub', 'pgpubsub.tests', 'pgtrigger', ] # Database url comes from the DATABASE_URL env var DATABASES = {'...
from terrascript import _resource class cloudflare_record(_resource): pass record = cloudflare_record
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ExecutionPlan.field_to_check_value' db.add_column(u'analy...
import os import time import configparser as cp import run_nets as r from absl import flags from absl import app FLAGS = flags.FLAGS #name of flag | default | explanation flags.DEFINE_string("arch_config","./configs/scale.cfg","file where we are getting our architechture from") flags.DEFINE_string("network","./topolog...
from builtins import object class Module(object): def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'Webcam', # list of one or more...
# # Copyright 2021 Splunk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
import os import pandas as pd import numpy as np from typing import Any, Type, Union, List import pickle from sklearn import preprocessing from zenml.materializers.base_materializer import BaseMaterializer from zenml.artifacts import ModelArtifact from zenml.steps.step_output import Output from zenml.io import fileio ...
# MIT License # Copyright (c) 2020, 0b10 # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
# -*- coding: utf-8 -*- from zvt.utils.pd_utils import pd_is_not_null, fill_with_same_index, normal_index_df, is_normal_df class NormalData(object): table_type_sample = None def __init__(self, df, category_field='entity_id', time_field='timestamp', ...
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed # under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
from django.contrib.sites.models import Site from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404, render from django.utils.translation import ugettext_lazy as _ from django.views.generic import ListView, DetailView from product import signals from product.models import Product ...
# Copyright (c) 2022. Harvard University # # Developed by Harvard T.H. Chan School of Public Health # (HSPH) and Research Software Engineering, # Faculty of Arts and Sciences, Research Computing (FAS RC) # Author: Ben Sabath (https://github.com/mbsabath) # # Licensed under the Apache License, Version 2.0 (the "Li...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Miranda(AutotoolsPackage): """miRanda is an algorithm for finding genomic targets for micr...
import os from datetime import datetime from waitress import serve from time import sleep from flask import Flask, request, render_template, render_template_string from jinja2 import Environment, select_autoescape import appsupport app = Flask(__name__) env = Environment( # jinja2 autoescape=select_autoesc...
import inspect import unittest from unittest.mock import MagicMock import hypothesis from traitlite import traits def magic_mock_with_no_arguments(*args, **kwargs): mock = MagicMock(*args, **kwargs) mock.__signature__ = inspect.signature(lambda: None) # pragma: no branch return mock def magic_mock_wit...
# The MIT License (MIT) # # Copyright (c) 2014 Louis Marchand # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mo...
import unittest import tempfile import os import six import caffe class SimpleLayer(caffe.Layer): """A layer that just multiplies by ten""" def setup(self, bottom, top): pass def reshape(self, bottom, top): top[0].reshape(*bottom[0].data.shape) def forward(self, bottom, top): ...
#!/usr/bin/env python # Copyright 2010 Yoav Goldberg ## # This 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 3 of the License, or # (at your option) any later version. ## # This software is di...
''' Created on Nov 7, 2017 @author: Salim ''' from abc import abstractmethod, ABCMeta class ProviderLoadBalancer(): __metaclass__ = ABCMeta @abstractmethod def select(self, service, supports): pass
import unittest from dbt.clients.jinja import get_template from dbt.clients.jinja import extract_toplevel_blocks from dbt.exceptions import CompilationException class TestJinja(unittest.TestCase): def test_do(self): s = '{% set my_dict = {} %}\n{% do my_dict.update(a=1) %}' template = get_templa...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
from collections.abc import Mapping import firebase_admin from firebase_admin import credentials from firebase_admin import firestore # Use a service account cred = credentials.Certificate('./service-account-key.json') firebase_admin.initialize_app(cred) db = firestore.client() #get all subject collections (just f...
# coding: utf-8 from __future__ import unicode_literals import hashlib import hmac import time import uuid from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_str, ) from ..utils import ( determine_ext, ExtractorError, int_or_none, str_or_none, try_get, ur...
from apiclient.discovery import build import httplib2, logging, re, time from oauth2client.django_orm import Storage from http_handler.settings import BASE_URL from schema.models import CredentialsModel def untrash_message(service_mail, sender_addr, subject, rejected=False, tags=[]): messages = service_...
from models.shared.person import Person class Villain(object): def __init__(self, person: Person, alias, publisher, crimes): self.realname = person.name self.charaters = person.characters self.alias = alias self.publisher = publisher self.crimes = crimes
from typing import Callable, Optional class ListNode: def __init__(self, x: int) -> None: self.val = x self.next: Optional[ListNode] = None def create_node_list(values: list[int], val: int) -> tuple[ListNode, ListNode]: """Creates a ListNode out of a list of values""" head = ListNode(val...
from __future__ import annotations import re from typing import TYPE_CHECKING import parsy as p if TYPE_CHECKING: from ibis.expr.datatypes import DataType from ibis.expr.datatypes import ( Array, Decimal, Interval, Map, Struct, Timestamp, binary, boolean, date, float32, ...
import os import sys import traceback from flask import Flask, redirect, render_template, request, url_for from flask.ext.cqlengine import CQLEngine from datetime import datetime import settings # Initialize simple Flask application app = Flask(__name__) app.config.from_object(settings) # This engages cqlengine so...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class GetSha...
#!/usr/bin/python import os import sys import Image try : arg = sys.argv[1] except IndexError : print "Usage: format17.py <file|dir>" sys.exit(1) skins = [arg] success = 0 failure = 0 path = "" pl = "s" if os.path.isdir(arg) : path = arg skins = os.listdir(arg) for sfile in skins : sfile = os.path.join(path,...
import os, subprocess, pickle, glob, random, time from termcolor import colored import numpy as np import itertools import multiprocessing as mp from datetime import datetime # from qiskit_helper_functions.non_ibmq_functions import evaluate_circ, read_dict, find_process_jobs # from qiskit_helper_functions.schedule imp...
# Copyright 2020 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...
n, m = input().split() n, m = int(n), int(m) first_set = {input() for _ in range(n)} second_set = {input() for _ in range(m)} unique_set = first_set.intersection(second_set) [print(el) for el in unique_set]
""" Library module. """ def add_two_numbers(x: int, y: int) -> int: """ Add two numbers. :param x: first whole number :param y: second whole number """ return x + y def multiply_two_numbers(x: int, y: int) -> int: """ Multiply two numbers. :param x: first whole number :...
import sys import os import datetime import pickle import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib.colors as colors from pprint import pprint import sqlite3 import calendar from datetime import datetime from datetime import timedelta import math import numpy.polynomial.po...
""" Support for monitoring the local system. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.systemmonitor/ """ import logging import os import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const...
# Pytorch imports import torch # Cyphercat imports from .train import train, train_attacker from .metrics import eval_membership_inference, eval_attack_model # Device to run on device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") def ml_leaks1(target=None, shadow_model=None, attacker_model=None, ...
import numpy as np import matplotlib.pyplot as plt t, U = np.genfromtxt('werte.txt', unpack=True) t *= 1e-6 # die X-Achse U *= 1e-3 lnu = np.log(U/928*10**3) # unsere Y-Achse tlnu = t*lnu dt = t**2 mt = np.mean(t) # x mU = np.mean(U) mlnu = np.mean(lnu) # y mtlnu = np.mean(tlnu) # xy mdt = np.mean(dt) ...
"""CPStats, a package for collecting and reporting on program statistics. Overview ======== Statistics about program operation are an invaluable monitoring and debugging tool. Unfortunately, the gathering and reporting of these critical values is usually ad-hoc. This package aims to add a centralized place for gather...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2017, Jianping Zhao # # Licensed under the BSD 3-Clause License # You may obtain a copy of the License at # https://opensource.org/licenses/BSD-3-Clause from aes.keyexpansion import generator from aes.roundkey import round_key from aes.subbytes import sub_...
import gzip import os import glob import concurrent.futures def _map(arr): index, names = arr for name in names: c = open(name, 'rb').read() try: gzip.decompress(c) except Exception as ex: print(ex) s = gzip.compress(c) open(name, 'wb').write(s) arrs = {} for index, name in ...
import numpy as np import scipy.spatial.distance as distance import scipy.cluster.hierarchy as sch import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import seaborn as sns from .table_condition import ConditionTable class HierarchicalClusteringTable(ConditionTable): def ...
#!/usr/bin/env python3 """ eGenix Antispam Bot for Telegram Challenges Written by Marc-Andre Lemburg in 2022. Copyright (c) 2022, eGenix.com Software GmbH; mailto:info@egenix.com License: MIT """ import random import re from telegram_antispam_bot.config import ( CHALLENGE_CHARS, CHALLENGE...
import math from pypy.lang.js.jsparser import parse, ParseError from pypy.lang.js.astbuilder import ASTBuilder from pypy.lang.js.operations import * from pypy.lang.js.jsobj import ThrowException from pypy.rlib.objectmodel import we_are_translated from pypy.rlib.streamio import open_file_as_stream ASTBUILDER = ASTBuil...
""" 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 use this ...
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
from __future__ import print_function, division import sys try: import cPickle as pickle # python 2 except ImportError: import pickle as pickle # python 3 class OutputStream(): "An output stream, for redirecting print statements. Contains a file object and flushes after each write" def __init__(s...
from typing import TypeVar, Union, Generic, Optional, cast, List from pyspark.sql import Column, DataFrame from pyspark.sql.functions import when from spark_auto_mapper.data_types.literal import AutoMapperDataTypeLiteral from spark_auto_mapper.data_types.data_type_base import AutoMapperDataTypeBase from spark_auto_m...
# Please modify this file in order to match your need predefined = {} predefined['id_username'] = "user" predefined['id_password'] = "pass" # define local javascript for loading the file from local predefined['local_javascript_url'] = "javascript/local_perf.js" # define the login page predefined['login_url'] = "http...
import pymel.core as pm from Luna import Logger from Luna.core.config import Config from Luna import LunaVars from Luna.core import callbacks Logger.set_level(Config.get(LunaVars.logging_level, default=10)) try: from Luna.static import directories from Luna.interface.menu import LunaMenu from Luna.interfac...
### tensorflow==2.3.0-rc2 import tensorflow as tf # Float16 Quantization - Input/Output=float32 converter = tf.lite.TFLiteConverter.from_saved_model('saved_model') converter.optimizations = [tf.lite.Optimize.DEFAULT] converter.target_spec.supported_types = [tf.float16] tflite_quant_model = converter.convert() with op...
# -*- coding: utf-8 -*- import datetime from jinja2 import Markup import pytest from h import jinja_extensions as ext @pytest.mark.parametrize("value_in,json_out", [ ({"foo": 42}, "{\"foo\": 42}") ]) def test_to_json(value_in, json_out): result = str(ext.to_json(value_in)) assert result == json_out @...
#!/usr/bin/env python # Copyright 2019 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. """Clobbers all builder caches for a specific builder. Note that this currently does not support windows. """ import argparse import ...
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 OpenAPI spec version: v1.13.5 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import kube...
# coding:utf-8 from nose.tools import raises from stellar_base.memo import * from stellar_base.operation import * from stellar_base.asset import Asset from stellar_base.transaction_envelope import TransactionEnvelope as Te class TestOp: def __init__(self): self.source = 'GDJVFDG5OCW5PYWHB64MGTHGFF57DRRJE...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Hoverlabel(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scatterternary" _path_str = "scatterternary.hoverlabel" _valid_props = { "align"...
#!/usr/bin/env python2.6 ''' 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 "Licens...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BTSTestFramework from test_framework.util import * import decim...
# tests/test_lig.py from kallisto.rmsd import recursiveGetSubstructures from tests.store import neopentane def test_lig_neopentane(): center = 0 mol = neopentane() nat = mol.get_number_of_atoms() bonds = mol.get_bonds() substructures = recursiveGetSubstructures(nat, bonds, center) # type: ignore...
import os from contextlib import contextmanager from collections import OrderedDict import numpy as np from gala import imio, features, agglo, classify from asv.extern.asizeof import asizeof rundir = os.path.dirname(__file__) ## dd: the data directory dd = os.path.abspath(os.path.join(rundir, '../tests/example-dat...
from utils import constants from utils.data_structures import BaseStack, BaseBuffer import numpy as np import itertools def break_two_way(heads): for i in range(len(heads)): for j in range(len(heads)): if heads[i] == j and heads[j] == i: heads[i] = i return heads def get...
#!/usr/bin/python # -*- coding: utf-8 -*- """ author: bookerbai create:2017/11/22 """ class TestTokenizer(object): """ test tokenizer components """ def test_char_tokenizer(self): from chi_annotator.algo_factory.components import ComponentBuilder from chi_annotator.algo_factory.comm...
from __future__ import annotations from datetime import ( datetime, timedelta, ) import operator from typing import ( TYPE_CHECKING, Any, Callable, Literal, Sequence, TypeVar, Union, cast, overload, ) import warnings import numpy as np from pandas._libs import ( algos,...
#!/usr/bin/env python # -*- coding: utf-8 -*- # """ """ import numpy as np class TrainingLabeler: def __init__(self): pass def label(self, metrics): return metrics.apply(self.label_row, axis=1) def label_row(self, row): return 'Unlabeled' class BAF1TrainingLabeler(TrainingLa...
from tkinter import * from tkinter import ttk import drawer def inst(): w = window w.init(w) return w class window: def init(self): self.init_main_window(self) self.init_buttons(self) self.root.mainloop() def init_main_window(self): print('todo') # set window ...
from frostsynth import * from frostsynth.interpolation import * def resampler0_gen(source, ratio): """Dynamic resampling of 'source' by variable ratio. Constant interpolation.""" ratio = to_iterable(ratio) sample = next(source) index = 0.0 source_index = 1 while True: yield sample ...
# -*- coding: utf-8 -*- """Time series forecasting module. This module provides access to forecasters that can be fit multivariate time series given as numpy arrays. """ from inspect import getargspec import numpy as np import keras.optimizers from .models import SharedLayerModel from .topologies import get_topolog...
""" Copyright (c) 2019-2020 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 w...
import requests, sys, os, random import time from selenium_utils import start_driver, write_to_field SERVER = sys.argv[1] # SERVER = 'http://d39e092608f9769e2696bf07d987072b4b2dd1dc9bce5e0151910fc276ae.project.ssof.rnl.tecnico.ulisboa.pt' session = requests.session() # Random users credentials attacker_user = str(r...
import pandas as pd import glob from string import ascii_uppercase from functools import partial ## Environmental Variables + Medical condition from ..processing.base_processing import read_ethnicity_data from ..environment_processing.base_processing import path_features , path_predictions, path_inputs_env, path_targe...
from __future__ import with_statement from sandbox import Sandbox, SandboxError, SandboxConfig, Timeout from sandbox.test import createSandbox, createSandboxConfig, SkipTest from sandbox.test.tools import capture_stdout def test_valid_code(): def valid_code(): assert 1+2 == 3 createSandbox().call(valid...
import numpy as np class Tensor(np.ndarray): """Derived Class of np.ndarray.""" def __init__(self, *args, **kwargs): self.grad = None def tensor(shape): """Return a tensor with a normal Gaussian distribution.""" return random(shape) def from_array(arr): """Convert the input array-like ...
""" Modified from django.utils.translation.trans_real """ from __future__ import unicode_literals import re from django.conf import settings from django.core.cache import cache from django.urls import resolve from django.urls import Resolver404 from django.urls.resolvers import RegexURLResolver from django.utils.tran...
#!/usr/bin/env python3 # Copyright © 2018 Broadcom. All rights reserved. The term "Broadcom" # refers to Broadcom Inc. and/or its subsidiaries. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may also obtain a copy of the Lice...
""" """ from django.db import models from django.contrib.auth.models import AbstractUser from django.utils.translation import ugettext_lazy as _ from django import forms from django.contrib.auth.tokens import default_token_generator from django.utils.http import urlsafe_base64_decode, urlsafe_base64_encode from rest_fr...
import logging import re from austlang import constants logging.basicConfig(level=logging.DEBUG) class SilRcemAdapter(object): """SIL Retired Core Element Mappings""" SOURCE_NAME = constants.SIL_RCEM_SOURCE_ABBREV # Mappings defined the in schema RETIREMENT_TYPE_CHANGE = "C" RETIREMENT_TYPE_DUPLI...
import config from distexprunner import * NUMBER_NODES = 6 parameter_grid = ParameterGrid( dramGB=[50], numberNodes= [NUMBER_NODES], # zipf= [0], zipf= range(0,100,10), readRatio=[50,95,100], # A, B, C workloads fillDegree= range(10,100,10), # from 5 to 90 percent filled per node p...
import time from django.urls import include, path from django.contrib import admin from django.conf import settings from django.conf.urls.static import static from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import redirect from django.views.generic.base import RedirectView from django....
#!/usr/bin/env python from __future__ import print_function import rospy from race.msg import drive_param from std_msgs.msg import Float64 from race.msg import pid_input import math import numpy as np import sys #from os import system, name from time import sleep KP = 20 KD = 0.01 limit_ang = 20 prev_error = 0.0 pub...