text
stringlengths
2
999k
# CubETL # Copyright (c) 2013-2019 Jose Juan Montes # 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...
#!/usr/bin/env python # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script from the root of the repository to update all translations from transifex. It will do the follo...
from django import forms from study.models import Student class EditProfile(forms.Form): first_name = forms.CharField(max_length=25) last_name = forms.CharField(max_length=25) email = forms.EmailField() graduation_year = forms.ChoiceField( choices=[(x, x) for x in range(2020, 2024)]) pict...
import cv2 import time import dlib import mtcnn import numpy as np ### THIS WILL BE DELETED ### class VideoProcessor: def __init__(self, video_source, cfg): self.video_source = video_source self.detector_type = cfg["face_detector"] self.dnn_detector_path = cfg["face_det_model_path"] ...
from decimal import Decimal as D from django.conf import settings from django.contrib.sites.models import Site from django.db import transaction from django.utils.translation import ugettext_lazy as _ from oscar.apps.order.signals import order_placed from oscar.core.compat import user_is_authenticated from oscar.core...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-17 19:19 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
import os import numpy as np import argparse import json import torch import torch.nn as nn from model.models import model_version from dataset.dataset import dataset from utils.optimizer import optimizer_function from utils.loss import loss_function parser = argparse.ArgumentParser(description="Trainin...
""" CamPy: Python-based multi-camera recording software. Integrates machine vision camera APIs with ffmpeg real-time compression. Outputs one MP4 video file for each camera and metadata files 'campy' is the main console. User inputs are loaded from config yaml file using a command line interface (CLI) into the 'param...
############################################################################## # # Copyright (c) 2009 Zope Foundation and Contributors. # # 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. # THIS SOFTWARE IS PROVIDED "AS I...
#Copyright (c) 2021 Sanjib Sharma """ A module for K2GAP target selection function Example: import k2gap insurvey=k2gap.sf(cno,ra,dec,jmag,hmag,kmag) or insurvey=k2gap.sf(cno,ra,dec,jmag,hmag,kmag,simulate_onsilicon=True) """ import numpy as np import json import os def read_json(filename): d=None with o...
import os import requests import json from urllib.parse import urlparse from bs4 import BeautifulSoup from .fs import verifyFilename from .units import Data, Progress DEFAULT_HEADERS = {'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/49.0'} DEFAULT_CHUNK_SIZE = 2048 class Resource: ...
""" Module: 'urandom' on micropython-v1.18-esp8266 """ # MCU: {'ver': 'v1.18', 'port': 'esp8266', 'arch': 'xtensa', 'sysname': 'esp8266', 'release': '1.18', 'name': 'micropython', 'mpy': 9733, 'version': '1.18', 'machine': 'ESP module with ESP8266', 'build': '', 'nodename': 'esp8266', 'platform': 'esp8266', 'family': '...
import threading import logging import struct import time from .network import CanError logger = logging.getLogger(__name__) NMT_STATES = { 0: 'INITIALISING', 4: 'STOPPED', 5: 'OPERATIONAL', 80: 'SLEEP', 96: 'STANDBY', 127: 'PRE-OPERATIONAL' } NMT_COMMANDS = { 'OPERATIONAL': 1, 'STOP...
# Copyright (c) 2017-present, Facebook, 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...
import re from grapheneapi.graphenewsrpc import GrapheneWebsocketRPC from grapheneapi.graphenehttprpc import GrapheneHTTPRPC from onegrambase.chains import known_chains from . import exceptions import logging log = logging.getLogger(__name__) class BitSharesNodeRPC(GrapheneWebsocketRPC, GrapheneHTTPRPC): def __i...
# Whenever you make any change here, you should update it in Amazon S3. # This function serves as glue between SNS and S3. # 1- Receives SNS message when Trebuchet release starts # 2- Extracts the message (which should be JSON) # 3- Writes the JSON to a file on disk # 4- Downloads models with the presigned URL # 5- Wri...
from django.apps import AppConfig class EmergencyservicesConfig(AppConfig): name = 'EmergencyServices'
# Copyright 2015 PerfKitBenchmarker 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...
#!/usr/bin/python2 ############################################################################### # Encoding: UTF-8 # # Name: main.py # # Description: Vertex ...
from datetime import datetime, timedelta from typing import List, Any, Union import numpy as np import pandas as pd from quantstats import stats import jesse.helpers as jh from jesse.models import CompletedTrade from jesse.store import store def candles_info(candles_array: np.ndarray) -> dict: period = jh.date_...
# Copyright 2013-2021 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 Arborx(CMakePackage): """ArborX is a performance-portable library for geometric search""" ...
# CodeGen.py -- code generator for trunnel. # # Copyright 2014, The Tor Project, Inc. # See license at the end of this file for copying information. import os import trunnel FILES = ["trunnel.c", "trunnel.h", "trunnel-impl.h"] def emit(target_dir=None): if target_dir == None: target_dir = '.' direct...
#!/usr/bin/python import itertools import multiprocessing import os import sys import shutil import subprocess from threading import Timer import sys from argparse import ArgumentParser from subprocess import Popen, PIPE, STDOUT, call def get_immediate_subdirectories(a_dir): return [(os.path.join(a_dir, name)) ...
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
r""" Compute invariants of quintics and sextics via ``Ueberschiebung''. REFERENCES:: .. [M] Mestre, Jean-Francois. Construction de courbes de genre $2$ a partir de leurs modules. (French) [Constructing genus-$2$ curves from their moduli] Effective methods in algebraic geometry (Castiglioncello, 1990)...
import json import types class TupleEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, tuple): return str(obj) if not isinstance(obj, (str, list, set, dict, bool, types.NoneType)): if hasattr(obj, 'as_JSON'): return obj.as_JSON() ...
import sys import unittest from unittest import TestCase from click.testing import CliRunner from hexagonal.infrastructure.cli import check, diagram from tests.integration_tests.utils.utils import get_sample_correct_test_clean_arch_project_path, \ get_sample_wrong_test_clean_arch_project_path, get_sample_correct_...
""" :mod:`lxml` -- Extractors for XML or HTML data extracting. ========================================================== """ # Standard Library from typing import List, Union # Local Folder from .core import AbstractSimpleExtractor from .exceptions import ExprError from .utils import Property, _missing_dependency tr...
# -*- coding: utf-8 -*- # Copyright (c) 2019, Si Hay Sistema and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class IFRSConfiguration(Document): pass
""" Galaxy Image Deconvolution ========================== Credit: S. Farrens In this tutorial we will deconvolve the PSF effects from an example galaxy image. Import astro data ----------------- The example galaxy image is convolved with the example PSF and random noise is added simulating an observation with SNR~5...
# 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...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
import time import numpy as np import psychopy.visual as pv import utils.logger as ulog import statemachine.machine as sm import statemachine.states as sms from psychopy.visual.circle import Circle from statemachine.states import TextMessage, Sequence import utils.soundfeedback as fbk from states.common import * cl...
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html class ScrapbookPipeline(object): def process_item(self, item, spider): return item
from picamera import PiCamera from time import sleep from gpiozero import Button button = Button(17) camera = PiCamera() camera.rotation = 0 camera.start_preview() button.wait_for_press() camera.capture('/home/pi/usbdrv/image2.jpg') camera.stop_preview()
from typing import Type, Tuple from ....core.component import ProcessorComponent from ....core.domain import DomainSpecifier from ....core.specifier import ProcessorStageSpecifier class PolygonDiscarderISPSpecifier(ProcessorStageSpecifier): """ Specifies the dimension-discarder. """ @classmethod ...
# coding=utf-8 # Copyright 2021 The HuggingFace 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 requir...
from django.contrib.auth.models import User from django.urls import reverse_lazy from ..utils.base_test import AuthenticationTestTemplate from ..utils.messages_tests import USER_CREATE_PASSWORD_LESS_THAN_8, USER_CREATE_REQUIRED_FIELDS, USER_ALREADY_EXISTS class UserListTestCase(AuthenticationTestTemplate): def _...
""" This file is licensed under the terms of the Apache License, Version 2.0. See the LICENSE file in the root of this repository for complete details. """ import copy import sys from typing import List, Set, Tuple, Union class DefaultLabels: """ Some pre-defined labels which can be used in conjunction with ...
from PyQt5 import QtCore, QtGui, QtWidgets import pyqtgraph as pg import time import datetime import serial import numpy as np import threading import os import configparser default_time = 5 # 3 <= default_time <= 20 default_ymin = 2.0 default_ymax = 3.5 default_port = 'COM3' default_b...
import typing as tp from enum import Enum import jax.numpy as jnp import numpy as np from elegy import initializers, module, types, utils, hooks from elegy.metrics.metric import Metric class Reduction(Enum): TRUE_POSITIVES = "true_positives" FALSE_POSITIVES = "false_positives" FALSE_NEGATIVES = "false_n...
# Copyright 2009 the V8 project authors. 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 conditi...
# Copyright 2019 PrivateStorage.io, 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 i...
# Copyright 2021 DengBoCong. 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 law or a...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Visualization interfaces.""" from pathlib import Path import numpy as np from nipype.interfaces.base import ( traits, TraitedSpec, File, BaseInterfaceInputSpec, isdefined, SimpleI...
#!/usr/bin/env python import Adafruit_ADS1x15 import time import rospy import numpy from std_msgs.msg import String,Int32MultiArray from rospy.numpy_msg import numpy_msg from rospy_tutorials.msg import Floats def talker(): pub = rospy.Publisher('line_follower_topic', numpy_msg(Floats),queue_size=10) rospy.ini...
# Copyright (c) 2013 OpenStack 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 # # Unless required by applicable law or agreed to ...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import import os import os.path as osp import unittest import sys import tempfile from glob import glob from traits.api import File, Undefined from capsul.study_config.study_config import StudyConfig, Process from capsul.su...
from app import App application = App.createApp() if __name__ == '__main__': from werkzeug import run_simple run_simple('localhost', 5000, application, use_reloader=True, use_debugger=True, use_evalex=True)
"""Client for the webdav.""" import locale import shutil import threading from contextlib import contextmanager, suppress from http import HTTPStatus from io import TextIOWrapper, UnsupportedOperation from typing import ( TYPE_CHECKING, Any, BinaryIO, Callable, Dict, Iterator, List, Opti...
# 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...
from dataclasses import dataclass, field from common.dataclass import BaseDataclass @dataclass class Skill(BaseDataclass): activation_type: String target_type: None type: None
# Generated by Django 2.1.5 on 2019-01-11 23:05 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Agent', fields=[ ('id', models.AutoField(au...
'''tzinfo timezone information for Antarctica/McMurdo.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class McMurdo(DstTzInfo): '''Antarctica/McMurdo timezone definition. See datetime.tzinfo for details''' zone = 'Antarctica/M...
from django.contrib import admin from .models import ToDoList, Item admin.site.register(ToDoList) admin.site.register(Item)
# Pyhon 2.7 Lambda Function # # Publish to an SNS topic if a running EC2 instance is using an unapproved AMI. # The EC2 ID, AMi ID, and AWS account number are published to SNS. # Whitelisted AMIs are listed in a DynamoDB table. # The DynamoDB table has an ami_id key, and an is_active boolean, # is_active must be True f...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft and contributors. 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 ...
import unittest from unittest import TestCase import pandas as pd from mynlpwrangler.cleaner import ArticleCleaner import pandas.testing as pd_testing class TestCleaner(TestCase): def setUp(self) -> None: self.data = {"id": ["10001", "11375", "23423"], "text": [ "Hello, https://www.google.com...
"""exmp URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
from abc import ABC, abstractmethod import asyncio from concurrent.futures import CancelledError from operator import attrgetter, itemgetter from random import randrange from typing import ( AsyncIterator, Callable, FrozenSet, Generic, Iterable, Optional, Sequence, Tuple, Type, ) fr...
from models.base import Base # Using the portuguese name in order to avoid conflict with reserved keyword 'class' class Turma(Base): primary_key = 'code' table_name = 'classes' column_names = [ 'code', 'course_code', 'schedule', 'vacancies', 'criterion', 'pr...
""" Contains the core parsing and indent functions of avwx """ # stdlib import re from calendar import monthrange from copy import copy from datetime import datetime, timedelta from itertools import permutations # library from dateutil.relativedelta import relativedelta # module from avwx.exceptions import BadStatio...
# -*- coding: UTF-8 -*- import os import sys DIR = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins')) from help import on_message import limbo def test_basic(): hooks = {"help": {"test": "!test help system"}} server = limbo.FakeServer(hooks=hooks) ret...
import pandas as pd import numpy as np from Matriz_esferica import Matriz_esferica from Individuo import Individuo import random from itertools import permutations import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap class Simulador(): def __init__( self, tamanho_matriz, ...
import math # general routine for normalizing probability distributions def normalize(d): rowsum = 0.0 for k in d.iterkeys(): rowsum = rowsum + d[k] if rowsum > 0.0: for k in d.iterkeys(): d[k] = d[k] / rowsum # general routine for converting a sequence to string def seq2str(seq): string = '' ...
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from torch.nn.utils.weight_norm import weight_norm from ..builder import BACKBONES @BACKBONES.register_module() class CAGRAPH_BACKBONE(nn.Module): def __init__(self, rnn_type, nlayers, ninp, nhid, dropout): ...
import threading import time def funct(steps, delay): print('thread functions start') for i in range(steps): time.sleep(delay) print(f'Step: {i}') print('thread function stop') print('Main thread start') # create threads t1 = threading.Thread(target=funct, args=(5,1,)) t2 = threading.Thr...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from queue import Queue, Full, Empty import msgpack import msgpack_numpy msgpack_numpy.patch() def dumps(obj): re...
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
"""contain methods to maintain GitHub hooks based on automatic deploy.""" import hashlib import hmac import json import subprocess from datetime import datetime, timedelta from functools import wraps from ipaddress import IPv4Address, IPv6Address, ip_address, ip_network from os import path from shutil import copyfile f...
import os import pyAesCrypt # For encryption purpose bufferSize = 64 * 1024 key_file = open("keyfile.txt", "r") key = key_file.readline()[1:-2] key_file.close() dir_file = open("dirfile.txt", "r") rootdir = dir_file.readline()[1:-2] dir_file.close() if(key == "abrakadabra"): os.remove("keyfile.tx...
# -*- coding: utf-8 -*- """ Created on Fri Feb 9 08:20:58 2018 @author: Christian Winkler """ import matplotlib.pyplot as plt from scipy import asarray as ar,exp from scipy.special import erf, gamma import numpy as np def NO(x,M,S): return 1/(np.sqrt(2*np.pi)*S)*exp(-(x-M)**2/(2*S**2)) def BCCG(x,M,S,L): # ...
#!/usr/bin/env python3 # Copyright (C) 2020 The Android Open Source Project # # 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 requ...
""" provide a generic structure to support window functions, similar to how we have a Groupby object """ from __future__ import division import warnings import numpy as np from collections import defaultdict from datetime import timedelta from pandas.core.dtypes.generic import ( ABCSeries, ABCDataFrame, ...
import os import re import subprocess from setuptools import setup, find_packages # type: ignore from pathlib import Path with open('README.md') as f: long_description = f.read() version_re = re.compile('^Version: (.+)$', re.M) package_name = 'django-sitemap-generate' def get_version(): """ Reads versi...
# Generated by Django 3.0.3 on 2020-03-17 02:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('LibreBadge', '0007_auto_20200317_0223'), ] operations = [ migrations.AlterField( model_name='badgetemplate', name='n...
#Functions package for creating and manipulating functions in dyex from .elementary import * from .function import * from .operator import *
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2019 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) import time import numpy as np from pymor.core.exceptions import ExtensionError from pymor.core....
#!/usr/bin/python3 """ Loop over a list of devices in a YAML inventory file and run all the the built in NAPALM getters against each device. Log the output to a per-device file as structed YAML data. sudo -H pip3 install napalm example inventory.yml: --- # required: hostname, os # optional: username, pas...
#!/usr/bin/env python import time import yaml from somecomfort_homie.somecomfort_homie import Somecomfort_Homie def start (): with open("somecomfort_homie.yml", 'r') as ymlfile: cfg = yaml.full_load(ymlfile) try: sch = Somecomfort_Homie(username=cfg['somecomfort'] ['username'],pas...
import asyncio import warnings from typing import Dict, Optional, Tuple from mitmproxy import command, controller, ctx, exceptions, flow, http, log, master, options, platform, tcp, websocket from mitmproxy.flow import Error, Flow from mitmproxy.proxy import commands, events, server_hooks from mitmproxy.proxy import se...
import joblib,copy import torch.backends.cudnn as cudnn from torch.utils.data import DataLoader import torch,sys from tqdm import tqdm from collections import OrderedDict from lib.visualize import save_img,group_images,concat_result import os import argparse from lib.logger import Logger, Print_Logger from lib.extract...
#coding:utf-8 import os import shutil import tempfile import unittest2 as unittest from cactus.config.file import ConfigFile from cactus.config.router import ConfigRouter class TestConfigRouter(unittest.TestCase): """ Test that the config router manages multiple files correctly. """ def setUp(self): ...
# coding: utf-8 import pytest import json from aiohttp import web async def test_nature_list(client): """Test case for nature_list """ params = [('limit', 56), ('offset', 56)] headers = { 'Accept': 'text/plain', } response = await client.request( me...
# --coding=utf-8-- _base_ = '../retinanet/retinanet_r50_fpn_1x_coco.py' model = dict( bbox_head=dict( num_classes=5, # TODO:注意修改 anchor_generator=dict(ratios=[0.25, 0.6, 1.0, 1.8, 3.0]), loss_bbox=dict(type='L1Loss', loss_weight=2.0) ), train_cfg=dict( assigner=dict(...
description = 'neutron camera' group = 'optional' includes = ['base'] tango_base = 'tango://miractrl.mira.frm2:10000/mira/' sysconfig = dict( datasinks = ['tifformat', 'camview'], ) devices = dict( camtimer = device('nicos.devices.tango.TimerChannel', description = 'timer for the Neutron camera', ...
""" This script uses data from the hessi mission to find the location (x, y, in arcsec) of flares and their dates, and the goes mission to find the class of flares and their dates, then it makes a new dataset with the date, class and location of each flare, the dataset is exported to a csv file so it can be read into a...
money = float(input('How much money is in the account initially?')) percent = float(input("What is the interest rate?")) years = int(input("How many years?")) interest = money * (1 + (percent/100))**years print interest, "This is your total amount after", years, "years."
#!/usr/bin/python3 # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. """ DIODE client using a command line interface. """ # Usage example: cat ../samples/simple/matmul.py | ./diode_client.py --code --compile import argparse, requests, json, sys if __name__ == '__main__': parser = argpars...
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ....testing import assert_equal from ..preprocess import TStat def test_TStat_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ignore_exception=dict(nohash=True, usedefault=True, ...
import numpy as np import tensorflow as tf from t3f.tensor_train import TensorTrain from t3f.tensor_train_batch import TensorTrainBatch from t3f.tensor_train_base import TensorTrainBase from t3f import shapes def _validate_input_parameters(is_tensor, shape, **params): """Internal function for validating input para...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class SouthwestConfig(AppConfig): name = 'southwest'
"""Supporting definitions for the Python regression tests.""" if __name__ != 'test.support': raise ImportError('support must be imported from the test package') import asyncio.events import collections.abc import contextlib import datetime import errno import faulthandler import fnmatch import functools import gc...
# python3 # pylint: disable=g-bad-file-header # Copyright 2019 DeepMind Technologies Limited. 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...
# Copyright (c) 2018 Cloudify Platform Ltd. 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 ap...
# Copyright 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://aws.amazon.com/apache2.0/ # # or in the "license" file accompany...
#! /usr/bin/env python3.9 from wizards_familiar import Engine from tkinter_gui import init_gui import logging logging.basicConfig(format='%(levelname)s:%(message)s', level = logging.DEBUG) def play(): a_game = Engine() a_game.play() root = init_gui(a_game) root.mainloop() play()
import _plotly_utils.basevalidators class SceneValidator(_plotly_utils.basevalidators.SubplotidValidator): def __init__(self, plotly_name="scene", parent_name="cone", **kwargs): super(SceneValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, dflt...
# BUILD FILE SYNTAX: SKYLARK SE_VERSION = "4.0.0-alpha04" ASSEMBLY_VERSION = "4.0.0.0" SUPPORTED_NET_FRAMEWORKS = ["net45", "net46", "net47"] ASSEMBLY_COMPANY = "Selenium Committers" ASSEMBLY_COPYRIGHT = "Copyright © Software Freedom Conservancy 2018" ASSEMBLY_INFORMATIONAL_VERSION = "4" ASSEMBLY_PRODUCT = "Selenium"...
import os import unittest from pymatgen.util.testing import PymatgenTest import maml.apps.gbe as gbe from maml.apps.gbe.utils import load_b0_dict, load_data, load_mean_delta_bl_dict, pjoin module_dir = os.path.dirname(gbe.__file__) REFS = pjoin(module_dir, "references") DATA = pjoin(module_dir, "data") class TestU...