gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from __future__ import unicode_literals from django.contrib import admin from django.contrib.auth import get_user_model from django.contrib.auth.admin import UserAdmin from django.forms import ValidationError, ModelForm from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User...
import os import re import unittest from socket import AF_INET, AF_INET6 from unittest.mock import Mock, call, patch from requests.packages.urllib3.util.connection import allowed_gai_family from streamlink import NoPluginError, Streamlink from streamlink.plugin import HIGH_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY, NO_...
# Copyright 2021 The Distla 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 applicable ...
# -*- coding: utf-8 -*- # # Copyright (c) 2008-2012 the MansOS team. 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, # ...
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
# Copyright 2020-2021 The MediaPipe Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
import pytest from cedar import ParseError, parse from cedar.ast import ( Enum, Tag, Record, Attribute, Function, Parameter, Type, Union, Dict, List, Nullable ) from .common import Module, table def test_parse_errors_can_halt_execution(): with pytest.raises(ParseError) as e: parse("recor...
# Copyright The IETF Trust 2007, All Rights Reserved import codecs import re import os.path import django.utils.html from django.shortcuts import render_to_response as render from django.template import RequestContext from django.conf import settings from django.http import Http404 from ietf.idtracker.models import IE...
import time import os import os.path from nose.tools import ok_, eq_, raises from concurrent.futures import ThreadPoolExecutor from carpool import Carpool from carpool.hooks import Carhook def create_temp_file(fname, msg = 'something', sleep_time=0.2): if os.path.isfile(fname): raise Exception("File alrea...
import copy from django.db.models.aggregates import Aggregate from django.db.models.base import ModelBase from django.db.models.manager import Manager from django.db.models.query import QuerySet from .exceptions import APIInputError def _validate_field_lookup_term(model, term): """Checks whether the term is a v...
# Copyright (c) 2017 Huawei, 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 a...
# Fed # # A portal for federated access to AWS console and resources # # # so many imports import os import base64 from io import BytesIO from flask import ( Flask, render_template, redirect, url_for, flash, session, abort, request, send_from_directory, ) from werkzeug.security impo...
# -*- coding: utf-8 -*- ''' Support for OSQuery - https://osquery.io. .. versionadded:: 2015.8.0 ''' from __future__ import absolute_import # Import python libs import json # Import Salt libs import salt.utils import logging log = logging.getLogger(__name__) __func_alias__ = { 'file_': 'file', 'hash_': 'h...
import json import traceback from typing import Dict, cast import ansible_runner import demistomock as demisto # noqa: F401 import ssh_agent_setup from CommonServerPython import * # noqa: F401 # Dict to Markdown Converter adapted from https://github.com/PolBaladas/torsimany/ def dict2md(json_block, depth=0): m...
import copy import datetime from django.core.exceptions import EmptyResultSet, FieldError from django.db.backends import utils as backend_utils from django.db.models import fields from django.db.models.query_utils import Q from django.utils import six from django.utils.functional import cached_property class Combina...
from optparse import OptionParser import os import sys import gensim import random from collections import OrderedDict import numpy as np import theano from theano import tensor as T from theano.tensor.shared_randomstreams import RandomStreams from ..util import file_handling as fh from ..dataset_scripts.sst.read_da...
# Copyright 2015 CloudByte 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 b...
#!/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...
import fnmatch import glob import os import re import tempfile from datetime import datetime from gppylib import gplog from gppylib.commands.base import WorkerPool, Command, REMOTE from gppylib.commands.unix import Scp from gppylib.db import dbconn from gppylib.db.dbconn import execSQL from gppylib.gparray import GpArr...
# 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...
# coding=utf-8 """ Module containing evaluation functions suitable for judging the performance of a fitted LightFM model. """ import numpy as np from ._lightfm_fast import CSRMatrix, calculate_auc_from_rank __all__ = ["precision_at_k", "recall_at_k", "auc_score", "reciprocal_rank"] def precision_at_k( model, ...
""" Manage Windows features via the ServerManager powershell module. Can install and remove roles/features. :maintainer: Shane Lee <slee@saltstack.com> :platform: Windows Server 2008R2 or greater :depends: win_servermanager.install :depends: win_servermanager.remove """ # Import salt modules impor...
# !/usr/bin/python3 # Filename: simRobot_grid.py # This is the main file used to simulate a Robot in a grid world. __author__ = 'Siddharth Pramod' __email__ = 'spramod1@umbc.edu' import random import gui_grid from math import pi, sin, cos from collections import deque from pprint import pprint from scipy import io...
"""Config flow for the Huawei LTE platform.""" from collections import OrderedDict import logging from typing import Optional from urllib.parse import urlparse from huawei_lte_api.AuthorizedConnection import AuthorizedConnection from huawei_lte_api.Client import Client from huawei_lte_api.Connection import Connection...
from __future__ import division,print_function import sys,re,os import logging on_rtd = os.environ.get('READTHEDOCS') == 'True' if not on_rtd: import numpy as np from astropy.coordinates import SkyCoord,Angle import numpy.random as rand import matplotlib.pyplot as plt import pandas as pd fr...
# pylint: disable=invalid-name """ Model domains ============= Regular latitude/longitude -------------------------- For regular latitude/longitude grids a simple bounding box test is all that is required to determine if a point lies inside the domain. Irregular boundaries -------------------- Regional ocean models...
from gym.envs.registration import registry, register, make, spec # Algorithmic # ---------------------------------------- register( id='Copy-v0', entry_point='gym.envs.algorithmic:CopyEnv', max_episode_steps=200, reward_threshold=25.0, ) register( id='RepeatCopy-v0', entry_point='gym.envs.alg...
# # 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...
# orm/loading.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """private module containing functions used to convert database rows into object inst...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals from abc import abstractmethod from builtins import object from hashlib import sha1 from...
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
from __future__ import unicode_literals import os import unittest import tempfile import shutil import time import mock import webtest from pyramid.config import Configurator NOT_SET = object() class TestGenshiTemplateRendererIntegration(unittest.TestCase): def make_app(self, config_decorator=None, settings=No...
""" Support and standalone functions for Robust Linear Models References ---------- PJ Huber. 'Robust Statistics' John Wiley and Sons, Inc., New York, 1981. R Venables, B Ripley. 'Modern Applied Statistics in S' Springer, New York, 2002. """ import numpy as np from scipy.stats import norm as Gaussian import nor...
""" Wireless Sensor Tags platform support. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/wirelesstag/ """ import logging from requests.exceptions import HTTPError, ConnectTimeout import voluptuous as vol from homeassistant.const import ( ATTR_BATT...
# coding: utf-8 """ Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud...
from __future__ import print_function import numpy as np from numba.compiler import compile_isolated, Flags from numba import types, from_dtype, errors, typeof import numba.unittest_support as unittest from numba.tests.support import TestCase, MemoryLeakMixin enable_pyobj_flags = Flags() enable_pyobj_flags.set("enabl...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Authors : Alexandre Gramfort, alexandre.gramfort@inria.fr (2011) # Denis A. Engemann <denis.engemann@gmail.com> # License : BSD 3-clause from functools import partial import numpy as np from ..parallel import parallel_func from ..io.pick import _picks_to_idx from ..utils import logger, verbose, _time_mask...
# -*- coding: utf-8 -*- import datetime from typing import Optional, List, Any from owlmixin import OwlMixin, TOption, TList, TDict, OwlEnum from requests.structures import CaseInsensitiveDict as RequestsCaseInsensitiveDict from requests_toolbelt.utils import deprecated from jumeaux.addons.models import Addons from j...
import re import pytest from django.core.exceptions import ValidationError from share.models.validators import JSONLDValidator class TestJSONLDValidator: CASES = [{ 'out': "'@graph' is a required property at /", 'in': {}, }, { 'out': "Additional properties are not allowed ('foo' was ...
import time import numpy as nm import numpy.linalg as nla from sfepy.base.base import output, get_default, Struct from sfepy.base.log import Log, get_logging_conf from sfepy.solvers.solvers import SolverMeta, NonlinearSolver from nls import conv_test class StabilizationFunction(Struct): """ Definition of sta...
''' Purpose for this file is to verify functions associated with Manager._groups dictionary. ''' import unittest import c3d import numpy as np import test.verify as verify from test.zipload import Zipload from test.base import Base class GroupSample(): ''' Helper object to verify group entries persist or terminate...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # MIT License. See license.txt # Database Module # -------------------- from __future__ import unicode_literals import MySQLdb import webnotes import conf import datetime class Database: """ Open a database connection with the given parmeters, if use_defau...
#!/usr/bin/env python # coding=utf-8 ################################################################################ import os import sys import optparse import configobj import traceback import tempfile sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'src'))) def getIncludePaths(path): ...
# Author: Christopher M. Shymansky <CMShymansky@gmail.com>, # License: ALv2 # Date created: 2016-11-25 import sys sys.path.append("../code") import pyplearnr as ppl import pandas as pd import itertools import unittest class AugmentedTestCase(unittest.TestCase): """ unittest.TestCase class with an extra h...
# -*- coding: utf-8 -*- """ Contains Definitions of setup_vgg_1, setup_vgg_1_xzt, setup_vgg_1_xzt_max, setup_vgg_1_xzt_stride autoencoder_stage: Type of training/network 0: autoencoder 1: encoder+ from autoencoder w/ frozen layers 2: encoder+ from scratch, completely unfrozen If autoencoder_stage==1 o...
#!/usr/bin/env python # Copyright 2015 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. """A utility script that can extract and edit resources in a Windows binary. For detailed help, see the script's usage by invoking it ...
import genepy import numpy as np import os from Bio import SeqRecord # NEXT TIME : # Two errors to deal with : # - Err.: one or more missing sequences in block 2 # --- solutions - Guindon ? # --- solutions - read .phy generated by ClustalO, and rewrite it using BioPython # - Duplicate names in PHYLIP files due to...
"""The stomp.py command line client (used for testing or simple STOMP command scripting). """ import base64 from cmd import Cmd from optparse import OptionParser import os import sys import time from stomp.adapter.multicast import MulticastConnection import stomp.colors from stomp.connect import StompConnection10, S...
# Copyright 2021 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...
#!/usr/bin/env python3 # Standard library imports from subprocess import Popen, PIPE from sys import argv import warnings with warnings.catch_warnings(): warnings.filterwarnings("ignore",category=DeprecationWarning) from imp import load_source from os.path ...
# Copyright (C) 2014 New York University # This file is part of ReproZip which is released under the Revised BSD License # See file LICENSE for full license details. from qtpy import QtCore, QtWidgets import yaml import reprounzip_qt.reprounzip_interface as reprounzip from reprounzip_qt.gui.common import ROOT, Resiza...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: shlex.py """A lexical analyzer class for simple shell-like syntaxes.""" import os.path import sys from collections import deque try: from cString...
''' This module provides database interfaces to postgres SQL (c) Copyright 2013 Mark V Systems Limited, California US, All rights reserved. Mark V copyright applies to this software, which is licensed according to the terms of Arelle(r). ''' import sys, os, io, time, re, datetime from math import isnan, isinf from d...
# Copyright (c) 2012 NetApp, Inc. # Copyright (c) 2012 OpenStack Foundation # 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/l...
# 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 collections import io import multiprocessing import time from fooster.web import web import mock test_message = b'More test time!' test_string = test_message.decode('utf-8') class MyHandler(web.HTTPHandler): reader = True def respond(self): self.comm['handled'].value = True return...
import iInfo import iSequence import iCheck import iBam def iHeader(Header_File, H_CHR, opts): with open(opts.input) as vcf: for line in vcf: line = line.rstrip() if line.startswith('##'): Header_File += [line] elif line.startswith('#CHROM'): H_CHR += [line] break if opts.SimpleRepeat: Hea...
from datetime import datetime from hashlib import md5 from itertools import izip_longest import json import os from urllib import urlencode from StringIO import StringIO from aludel.database import MetaData from twisted.internet import reactor from twisted.internet.defer import inlineCallbacks from twisted.trial.unitt...
"""Simple distance, velocity, and angle support for Skyfield. """ from __future__ import print_function import numpy as np import sys from numpy import abs, array, copysign, isnan from .constants import AU_KM, AU_M, DAY_S, tau def _auto_convert(value): """As a convenience, turn Python lists and tuples into NumPy...
# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and ...
#!/usr/bin/env python from __future__ import absolute_import import collections import numpy from scipy.ndimage import map_coordinates from eotools.coordinates import convert_coordinates from eotools.drivers.stacked_dataset import StackedDataset def x_profile(stacked_dataset, xy, raster_band=1, from_map=False): ...
"""TensorBoard server handler logic. TensorboardHandler contains all the logic for serving static files off of disk and for handling the API calls to endpoints like /tags that require information about loaded events. """ import BaseHTTPServer import csv import gzip import imghdr import json import mimetypes import os...
# Copyright 2016 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...
from __future__ import division, print_function, absolute_import import os from ...tools.log import LoggingMgr from ...planners.explorers.discrete import DiscreteExplorer from ...mdp.discrete import DiscreteModel from . import IOnlineLearner __all__ = ['RLLearner', 'QLearner', 'RLDTLearner'] # noinspection PyAbstr...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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 witho...
# -------------------------------------------------------- # Fast/er R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Bharath Hariharan # -------------------------------------------------------- import xml.etree.ElementTree as ET import os import cPickle import numpy as np def parse_rec(f...
"""Tests which check the various ways you can set DJANGO_SETTINGS_MODULE If these tests fail you probably forgot to run "python setup.py develop". """ import django import pytest BARE_SETTINGS = ''' # At least one database must be configured DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlit...
"""A friendly Python SFTP interface.""" from __future__ import print_function import os from contextlib import contextmanager import socket from stat import S_IMODE, S_ISDIR, S_ISREG import tempfile import paramiko from paramiko import SSHException # make available from paramiko import AuthenticationExce...
import calendar from collections import OrderedDict import datetime import importlib from itertools import chain from operator import itemgetter import os import re import time from django.apps import apps from django.contrib.auth import get_user_model from django.core.management import call_command from django.http i...
import sys from landsat.downloader import Downloader from landsat.landsat import Process from boto.s3.key import Key from shutil import rmtree from datetime import datetime from boto import utils import socket from models import UserJob_Model, WorkerLog from sqs import (make_SQS_connection, get_queue, get_message, ...
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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...
# # Copyright (c) SAS Institute 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 w...
#!/usr/bin/python # Copyright 2016 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 a...
from __future__ import division from pdb import set_trace from os import environ, getcwd from os import walk from os.path import expanduser from pdb import set_trace import sys # Update PYTHONPATH HOME = expanduser('~') axe = HOME + '/git/axe/axe/' # AXE pystat = HOME + '/git/pystats/' # PySTAT cwd = getcwd() # Cur...
"""Useful utility decorators. """ from __future__ import print_function, division import sys import types import inspect from sympy.core.decorators import wraps from sympy.core.compatibility import class_types, get_function_globals, get_function_name, iterable from sympy.utilities.runtests import DependencyError, Sy...
# The following comment should be removed at some point in the future. # mypy: strict-optional=False from __future__ import absolute_import import logging from collections import OrderedDict from pip._vendor.packaging.utils import canonicalize_name from pip._internal import pep425tags from pip._internal.exceptions ...
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists...
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
"""Tradfri lights platform tests.""" from copy import deepcopy from unittest.mock import Mock, MagicMock, patch, PropertyMock import pytest from pytradfri.device import Device, LightControl, Light from homeassistant.components import tradfri from tests.common import MockConfigEntry DEFAULT_TEST_FEATURES = {'can_s...
from __future__ import division, absolute_import, print_function import functools import warnings import numpy.core.numeric as _nx from numpy.core.numeric import ( asarray, zeros, outer, concatenate, array, asanyarray ) from numpy.core.fromnumeric import product, reshape, transpose from numpy.core.multiarray ...
#! /usr/bin/env/python 3.0 # # Contains common functions necessary for various python testcase scripts. # import os, re, csv, datetime, subprocess, glob, sys, time, shutil def is_generated_file(fullfilepath): """ Determines if the first line of a file contains the autogenerated signature string. """ with open(ful...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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...
#!/usr/bin/env python3 # Copyright (c) 2016-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test compact blocks (BIP 152). Version 1 compact blocks are pre-segwit (txids) Version 2 compact block...
"""Support for MQTT message handling.""" import asyncio from functools import partial, wraps import inspect from itertools import groupby import json import logging from operator import attrgetter import os import socket import ssl import time from typing import Any, Callable, List, Optional, Union import attr import ...
# Copyright 2015. 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...
"""Extract and relay messages from the systemd journal """ from __future__ import print_function import argparse import errno import datetime import json import os import os.path import re #import select import smtplib import sys from email.mime.text import MIMEText from socket import gethostname from systemd import ...
import pickle from ..math.matrix import Matrix from ..math.text2matrix import Text2Matrix from ..nlp.segmenter import Segmenter from ..common.global_info import GlobalInfo from ..common.configuration import Configuration class ChiSquareFilter: def __init__(self, config, nodeName, loadFromFile = False): se...
#!/usr/bin/env python # Copyright (c) 2012 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. '''Base types for nodes in a GRIT resource tree. ''' import os import sys import types from xml.sax import saxutils from grit imp...
# Copyright (C) 2014 Parker Michaels # # 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,...
#!/usr/bin/python3 import numpy as np from datetime import datetime import sys from sys import argv def softmax(x): # print('softmax x dim:' + str(x.shape)) exp_scores = np.exp(x) probs = exp_scores / np.sum(exp_scores, axis=0, keepdims=True) return probs class RNN: def __init__(self, vocab_dim, hidden_dim=100)...
# Copyright 2020 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains functions to determine where configuration and data/cache files used by Astropy should be placed. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from ..extern impor...
import nef.nef_theano as nef from __future__ import generators import sys import space from ca.nengo.math.impl import * from ca.nengo.model.plasticity.impl import * from ca.nengo.util import * from ca.nengo.plot import * from com.bulletphysics import * from com.bulletphysics.linearmath import * from com.bulletphysic...
# Copyright 2016 Huawei Technologies India Pvt. 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 # #...
from copy import deepcopy import numpy as np from menpo.base import Vectorizable from menpo.model import Similarity2dInstanceModel from menpo.transform.base import Alignable, VComposableTransform, VInvertible class ModelDrivenTransform(Vectorizable, VComposableTransform, VInvertible, Aligna...
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. """ Arduino Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences. http://arduino.cc/e...
# 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...
"""fiber_center.py was written by Ryan Petersburg for use with fiber characterization on the EXtreme PREcision Spectrograph The functions in this module calculate the center and various dimensions of a FiberImage object """ from .numpy_array_handler import circle_array, remove_circle, sum_array, mesh_grid_from_array f...
# -*- coding: utf-8 -*- # Django settings for intranet project. import os.path import posixpath import pinax PINAX_ROOT = os.path.abspath(os.path.dirname(pinax.__file__)) PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) # tells Pinax to use the default theme PINAX_THEME = "default" DEBUG = True TEMPLATE_DE...