gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import string from functools import partial from inspect import signature from typing import Any, Callable, Dict, List, Optional from django.http import HttpRequest, HttpResponse from zerver.decorator import api_key_only_webhook_view from zerver.lib.request import REQ, has_request_variables from zerver.lib.response i...
"""The tests for Fan device triggers.""" from datetime import timedelta import pytest import homeassistant.components.automation as automation from homeassistant.components.device_automation import DeviceAutomationType from homeassistant.components.fan import DOMAIN from homeassistant.const import STATE_OFF, STATE_ON...
import numpy as np import pytest from taichi.lang import impl from taichi.lang.util import has_pytorch import taichi as ti from tests import test_utils if has_pytorch(): import torch @pytest.mark.skipif(not has_pytorch(), reason='Pytorch not installed.') @test_utils.test(exclude=[ti.opengl, ti.vulkan]) def test...
#!/usr/bin/env python """ @package ion.agents.data.test.test_external_dataset_agent_slocum @file ion/agents/data/test/test_external_dataset_agent_slocum.py @author Christopher Mueller @brief """ # Import pyon first for monkey patching. from pyon.public import log, IonObject from pyon.ion.resource import PRED, RT from...
# -*- coding: utf-8 -*- # # Copyright 2019-2021 BigML # # 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 ...
# Copyright 2011 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/licenses/LICENSE-2.0 # # Unless req...
from __future__ import absolute_import import abc class MinHashIndexBackendTestMixin(object): __meta__ = abc.ABCMeta @abc.abstractproperty def index(self): pass def test_basic(self): self.index.record('example', '1', [('index', 'hello world')]) self.index.record('example', '...
import theano import theano.tensor as T from .theano_utils import floatX from .ops import l2norm def clip_norm(g, c, n): if c > 0: g = T.switch(T.ge(n, c), g * c / n, g) return g def clip_norms(gs, c): norm = T.sqrt(sum([T.sum(g**2) for g in gs])) return [clip_norm(g, c, norm) for g in gs] ...
''' altgraph.Dot - Interface to the dot language ============================================ The :py:mod:`~altgraph.Dot` module provides a simple interface to the file format used in the `graphviz <http://www.research.att.com/sw/tools/graphviz/>`_ program. The module is intended to offload the most tedious part of th...
# Copyright 2017-2018 Capital One Services, 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 ...
# 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...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'ProductoFinca.area' db.alter_column(u'produccion_finca_productofinca', 'area', self.gf('d...
# -*- coding: UTF-8 -*- from lexis import * import model import helper import ply.yacc as yacc import os # 1 def p_Definitions(p): """Definitions : Definitions ExtendedAttributeList Definition""" p[3].extended_attributes = p[2] p[0] = p[1] + [p[3]] # 1 def p_Definitions_empty(p): """Definitions : """ ...
# coding=utf-8 # Copyright 2022 The Tensor2Tensor 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...
import io import itertools import json import logging import os import shutil import uuid import zipfile from collections import defaultdict from datetime import datetime from mimetypes import guess_all_extensions, guess_type from django.conf import settings from django.contrib import messages from django.contrib.auth...
#!/usr/bin/python # Copyright (c) 2009-2011 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Package builder for the dev server.""" import os import subprocess import tempfile from portage import dbapi from portage...
# Memory Puzzle # By Al Sweigart al@inventwithpython.com # http://inventwithpython.com/pygame # Released under a "Simplified BSD" license import random, pygame, sys from pygame.locals import * FPS = 30 # frames per second, the general speed of the program WINDOWWIDTH = 640 # size of window's width in pixels WINDOWHEI...
import numpy as np from collections import Sequence, Counter from abc import ABCMeta, abstractmethod from gtd.chrono import verboserate from gtd.utils import flatten from strongsup.parse_case import ParseCase, ParsePath from strongsup.utils import epsilon_greedy_sample, softmax from strongsup.utils import sample_wit...
# Copyright 2018 The TensorFlow Probability 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 o...
"""Tests for letsencrypt.renewer.""" import datetime import os import tempfile import shutil import unittest import configobj import mock import pytz from letsencrypt import configuration from letsencrypt import errors from letsencrypt.storage import ALL_FOUR from letsencrypt.tests import test_util CERT = test_uti...
"""The hunk block types defined as data classes""" from __future__ import print_function import struct from Hunk import * class HunkParseError(Exception): def __init__(self, msg): self.msg = msg def __str__(self): return self.msg class HunkBlock: """Base class for all hunk block types""" blk_id ...
# 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...
# 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...
import shm from mission.framework.search import SearchFor, SwaySearch, SpiralSearch from mission.framework.combinators import Sequential, MasterConcurrent, While, Conditional from mission.framework.primitive import Zero, Log, AlwaysLog, FunctionTask, Fail, Succeed from mission.framework.targeting import DownwardTarget...
# Copyright 2014-2015 Canonical Limited. # # This file is part of charm-helpers. # # charm-helpers is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 as # published by the Free Software Foundation. # # charm-helpers is distributed in the hope ...
# # Author: Pearu Peterson, March 2002 # # w/ additions by Travis Oliphant, March 2002 # and Jake Vanderplas, August 2012 from __future__ import division, print_function, absolute_import __all__ = ['solve', 'solve_triangular', 'solveh_banded', 'solve_banded', 'solve_toeplitz', 'solve_circulant...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
# -*- encoding: utf-8 -*- # # 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...
# pyOCD debugger # Copyright (c) 2016-2020 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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 itertools import numpy as np from .._shared.utils import warn from .. import img_as_float from . import rgb_colors from .colorconv import rgb2gray, gray2rgb import six from six.moves import zip __all__ = ['color_dict', 'label2rgb', 'DEFAULT_COLORS'] DEFAULT_COLORS = ('red', 'blue', 'yellow', 'magenta', 'g...
# 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...
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Run Regression Test Suite This module calls down into individual test cases via subprocess. It will ...
# Copyright 2012 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 a...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for Deferred handling by L{twisted.trial.unittest.TestCase}. """ from twisted.trial import unittest from twisted.internet import defer, threads, reactor class DeferredSetUpOK(unittest.TestCase): def setUp(self): d = defer....
import re from sphinx.util.compat import Directive from docutils.statemachine import StringList from docutils import nodes, utils import textwrap import itertools import collections import md5 def _comma_list(text): return re.split(r"\s*,\s*", text.strip()) def _parse_content(content): d = {} d['text'] = ...
#!/usr/bin/env python # # # 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 #...
import settings import csv import os import trainer.sentan as st from datetime import timedelta, date logger = settings.get_logger(os.path.realpath(__file__)) def daterange(start_date, end_date): for n in range(int ((end_date - start_date).days + 1)): yield start_date + timedelta(n) class Counter: d...
import json from base64 import urlsafe_b64encode, urlsafe_b64decode from functools import wraps from urllib import quote import logging from flask import Response, request from flask.ext.sqlalchemy import get_debug_queries from flask.ext.restful import Resource from changes.api.serializer import serialize as seria...
#!/usr/bin/env python # Source: http://code.activestate.com/recipes/475116/, with # modifications by Daniel Dunbar. import sys, re, time def to_bytes(str): # Encode to UTF-8 to get binary data. return str.encode('utf-8') class TerminalController: """ A class that can be used to portably generate for...
# Copyright 2015 Internap. # # 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...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2005-2010 (ita) """ Configuration system A :py:class:`waflib.Configure.ConfigurationContext` instance is created when ``waf configure`` is called, it is used to: * create data dictionaries (ConfigSet instances) * store the list of modules to import * hold config...
################################# LICENSE ################################## # Copyright (c) 2009, South African Astronomical Observatory (SAAO) # # All rights reserved. # # # # Redistribu...
# 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...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
from django.db import models from django.forms import ModelForm from django.contrib import admin import datetime from django.utils import timezone from django.core.validators import RegexValidator from django.contrib.auth.models import User, UserManager, AbstractUser from django.forms import ValidationError from . impo...
from vncdotool import command import unittest import mock class TestBuildCommandList(unittest.TestCase): def setUp(self): super(TestBuildCommandList, self).setUp() self.isolation = mock.isolate.object(command.build_command_list) self.isolation.start() self.factory = mock.Mock()...
from tcga_encoder.utils.helpers import * from tcga_encoder.data.data import * #from tcga_encoder.data.pathway_data import Pathways from tcga_encoder.data.hallmark_data import Pathways from tcga_encoder.definitions.tcga import * #from tcga_encoder.definitions.nn import * from tcga_encoder.definitions.locations import * ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Arne Neumann """ The ``exmaralda`` module converts a ``DiscourseDocumentGraph`` (possibly containing multiple annotation layers) into an Exmaralda ``*.exb`` file and vice versa. """ import os import sys from collections import defaultdict from lxml import etree ...
""" Tests for pubswh blueprint's utility functions """ import unittest from unittest.mock import MagicMock, patch import arrow import requests as r import requests_mock from .test_data import ( crossref_200_ok, crossref_200_not_ok, crossref_200_ok_2_date_parts, crossref_200_ok_1_date_part, crossref_200_ok_mes...
from __future__ import with_statement import os import re import urllib from django.conf import settings from django.contrib.sites.models import Site, RequestSite from django.contrib.auth.models import User from django.core import mail from django.core.exceptions import SuspiciousOperation from django.core.urlresolver...
# Copyright 2016 Google LLC 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...
# regression y=Xw using block sparse Bayesian learning framework # # {y,X} are known, and w is assumed to be 'sparse' or 'block sparse' # the indices of the non-zero blocks can be either known or unknown # # Authors: Benyuan Liu <liubenyuan@gmail.com> # License: BSD 3 Clause # # For the BSBL-BO algorithm: # # @article{...
""" GridFrame -- subclass of wx.Frame. Contains grid and buttons to manipulate it. GridBuilder -- data methods for GridFrame (add data to frame, save it, etc.) """ import wx import pandas as pd import numpy as np from dialogs import drop_down_menus3 as drop_down_menus from dialogs import pmag_widgets as pw from dialog...
# # -*- py-indent-offset:2 -*- from logging import ERROR, WARN, INFO, DEBUG import copy import re from block import * from block_cfg_utils import * query_var_re = re.compile('^\\$\\{(.+)\\}$') PROPERTIES = [ required_prop('database', validator=str, help='The name of the mongo db database'), req...
# Copyright (c) 2014 Tycho Andersen # Copyright (c) 2014 dequis # Copyright (c) 2014-2015 Joseph Razik # Copyright (c) 2014 Sean Vig # Copyright (c) 2015 reus # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal ...
import asyncio import aiopg import gc import psycopg2 import psycopg2.extras import socket import random import unittest import time import sys from aiopg.connection import Connection, TIMEOUT from aiopg.cursor import Cursor from unittest import mock PY_341 = sys.version_info >= (3, 4, 1) class TestConnection(unit...
import sys import threading import time from unittest import skipIf, skipUnless from django.db import ( DatabaseError, Error, IntegrityError, OperationalError, connection, transaction, ) from django.test import ( TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature, ) from .models import Reporter @...
from sympy.utilities.pytest import XFAIL, raises from sympy import (symbols, lambdify, sqrt, sin, cos, pi, atan, Rational, Float, Matrix, Lambda, exp, Integral, oo, I, Abs) from sympy.printing.lambdarepr import LambdaPrinter from sympy import mpmath from sympy.utilities.lambdify import implemented_function from...
#!/usr/bin/env python # pylint: disable=broad-except # from http://code.activestate.com/recipes/577466-cron-like-triggers/ import time import datetime import calendar DAY_NAMES = zip(('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'), xrange(7)) MONTH_NAMES = zip(('jan', 'feb', 'mar', 'apr', 'may', 'jun', ...
""" Preprocess the dataset """ # import module import pandas as pd import os from datetime import datetime, timedelta from dateutil.rrule import rrule, DAILY import requests import random import urllib ################################################################################################################# #...
# -*- coding: utf-8 -*- # # 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 #...
''' Created on Mar 14, 2014 @author: Stephen Theodore ''' from mGui.bindings import BindableObject, bind from mGui.observable import ObservableCollection, ViewCollection, ImmediateObservableCollection from unittest import TestCase, main class TestTarget(BindableObject): _BIND_TGT = 'values' def __init__(sel...
import os import json try: from urllib.parse import parse_qs except ImportError: from urlparse import parse_qs import boto3.session from chalice import Chalice, BadRequestError, NotFoundError, Response,\ CORSConfig, UnauthorizedError, AuthResponse, AuthRoute # This is a test app that is used by integrat...
#!/usr/bin/env python import sys stderr = sys.stderr from struct import pack, unpack #from pdflib.utils import choplist, nunpack from utils import choplist, nunpack #from pdflib.psparser import PSException, PSSyntaxError, PSTypeError, PSEOF, \ from psparser import PSException, PSSyntaxError, PSTypeError, PSEOF, \ ...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
# 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 the...
# Copyright 2013 NEC Corporation # 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 ...
# Copyright (C) 2013-2014 SignalFuse, Inc. # Copyright (C) 2015-2018 SignalFx, Inc. # # Docker container orchestration utility. from __future__ import print_function import collections try: from docker.errors import APIError except ImportError: # Fall back to <= 0.3.1 location from docker.client import A...
#!/usr/bin/env python3 # Communicates with the smart electricity meter [KAMSTRUP]. # This is all singular data, no averaging needed. import configparser import os import re import serial import sys import syslog import time import traceback from mausy5043libs.libdaemon3 import Daemon import mausy5043funcs.fileops3 a...
# Copyright 2012-2014 MongoDB, 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 writin...
import gzip import inspect import warnings from scrapy.utils.trackref import object_ref from io import BytesIO from twisted.trial import unittest from scrapy.spider import Spider, BaseSpider from scrapy.http import Request, Response, TextResponse, XmlResponse, HtmlResponse from scrapy.contrib.spiders.init import Init...
""" Summary ======== Helper file to generate package version numbers for you Notes ===== You're probably already using git tags to tag releases of your project. If you aren't, you really should. Wouldn't it be great if your python package automatically updated its version number using ``git describe``? You know, so yo...
""" Types used on a per-build basis. """ from __future__ import absolute_import, division, print_function from mybuild._compat import * import logging from collections import deque from functools import partial from itertools import product, starmap from mybuild.core import InstanceError from mybuild.req.pgraph impor...
# Copyright 2013 OpenStack Foundation # Copyright 2013 Spanish National Research Council. # 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://ww...
from trump.orm import Symbol, SetupTrump, SymbolManager, ConversionManager, \ SymbolLogEvent from trump.templating.templates import GoogleFinanceFT, YahooFinanceFT,\ SimpleExampleMT, CSVFT, FFillIT, FeedsMatchVT, DateExistsVT, PctChangeMT import pandas as pd import pytest from pytest import mark...
# 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...
def makeflat(lista): # print "LOGX:: Entering `makeflat` method/function in %(__file__)s" % # globals() flat = '' import datetime import glob import os import ntt from ntt.util import readhdr, readkey3, delete, name_duplicate, updateheader, correctcard from pyraf import iraf iraf...
''' Process URA data by SQLite. Update log: (date / version / author : comments) 2020-06-07 / 1.0.0 / Du Jiang : Creation Support Transaction and Rental data ''' import csv import getopt import math from os import path import os import sqlite3 import sys from time import localtime, str...
from django import forms from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.utils.safestring import mark_safe from dcim.models import DeviceRole, Platform, Region, Site from tenancy.models import Tenant, TenantGroup from utilities.forms import ( add_b...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from matplotlib.pyplot import axes import hickle as hkl import numpy as np np.random.seed(2 ** 10) import tensorflow as tf from keras import backend as K K.set_image_dim_ordering('tf') from keras import regul...
# -*- coding: utf-8 -*- """ sphinx.builders.qthelp ~~~~~~~~~~~~~~~~~~~~~~ Build input files for the Qt collection generator. :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import re import codecs import posixpath from os impo...
import os import subprocess import sys from shutil import rmtree from subprocess import CalledProcessError from tempfile import mkdtemp from unittest.mock import patch from djangocms_installer import config, install, main from .base import IsolatedTestClass, get_stable_django class TestMain(IsolatedTestClass): ...
"""Unit tests for goppy module.""" from hamcrest import assert_that, close_to, contains_inanyorder, is_ import numpy as np from numpy.testing import assert_almost_equal, assert_equal from mock import ANY, call, MagicMock from ..core import _LazyVarCollection, OnlineGP from ..kernel import SquaredExponentialKernel c...
from django.shortcuts import render from django.http import HttpResponseForbidden, HttpResponse from django.core.exceptions import PermissionDenied from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST, require_safe from django.http import Http404 from jsonview.decor...
from __future__ import division from pylab import * from scipy.optimize import curve_fit from scipy import stats import tables import matplotlib.cm as mplcm import matplotlib.colors as colors import sys sys.path.insert(0,"..") import os import utils utils.backup(__file__) import cPickle as pickle import gzip from com...
from __future__ import unicode_literals import datetime from django.contrib.admin import (site, ModelAdmin, SimpleListFilter, BooleanFieldListFilter, AllValuesFieldListFilter) from django.contrib.admin.views.main import ChangeList from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models imp...
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
"""Unit tests for contextlib.py, and other context managers.""" import sys import os import decimal import tempfile import unittest import threading from contextlib import * # Tests __all__ from test import support import warnings class ContextManagerTestCase(unittest.TestCase): def test_contextmanager_plain(s...
# -*- coding: utf-8 -*- import os from anima import logger from anima.dcc.base import DCCBase external_dccs = { "MudBox": { "name": "MudBox", "icon": "mudbox.png", "executable": { "linux": "mudbox", "windows": "mudbox.exe", }, "extensions": [".mud"...
#!/usr/bin/env python from __future__ import print_function import argparse import math import os import os.path import re import subprocess import sys # Runs the benchmarks. # # It runs several benchmarks across several languages. For each # benchmark/language pair, it runs a number of trials. Each trial is one run...
# # 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...
# Copyright (C) 2011 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 the ...
#! /usr/bin/env python """ Copyright 2015 Akamai Technologies, 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 Unles...
"""The tests for the notify demo platform.""" import unittest from unittest.mock import patch import pytest import voluptuous as vol import homeassistant.components.notify as notify from homeassistant.setup import setup_component import homeassistant.components.demo.notify as demo from homeassistant.core import callb...
# 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...
"""Objects and functions for working with probability distributions and related properties. Internally, we often deal with the logarithm of the probability distribution along a path of interest instead of the free energy differences, which differ only by a minus sign. In gchybrid, we refer to the logarithm of the ord...
# # 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 us...
# Copyright (c) 2005-2009 Jaroslav Gresula # # Distributed under the MIT license (See accompanying file # LICENSE.txt or copy at http://jagpdf.org/LICENSE.txt) # import os import jag.imagemanip as imagemanip import jag.testlib as testlib import jagpdf import tempfile import sys import md5 #mask interpolation - it see...
from django.db.models import Q from contacts.models import Contact from contacts.serializer import ContactSerializer from common.models import User, Attachments, Comment, Profile from common.custom_auth import JSONWebTokenAuthentication from common.serializer import ( ProfileSerializer, CommentSerializer, ...