gt
stringclasses
1 value
context
stringlengths
2.49k
119k
"""Tests the state module of pyexperiment Written by Peter Duerr """ from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import import unittest import tempfile import os import io import six import shutil import multiprocessing ...
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # Copyright 2013 Red Hat, 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/license...
import py, sys, platform import pytest from testing.cffi0 import backend_tests, test_function, test_ownlib from cffi import FFI import _cffi_backend class TestFFI(backend_tests.BackendTests, test_function.TestFunction, test_ownlib.TestOwnLib): TypeRepr = "<ctype '%s'>" @staticmeth...
import json import xml.etree.ElementTree as ET import re import os import datetime import mimetypes from StringIO import StringIO from urlparse import parse_qs as parse_querystring import tornado.web from tornado import gen import authorization from epub import EPUB from epub.utils import listFiles from data.utils i...
# Copyright (c) 2016-2017, Matteo Cafasso # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and ...
#!/usr/bin/env python from pytest import fixture, skip, PLATFORM from circuits.core import Value from circuits.node.utils import dump_event, dump_value if PLATFORM == 'win32': skip('Broken on Windows') from circuits import Component, Event from circuits.node.protocol import Protocol class return_value(Event...
#! /usr/bin/env python """A Python debugger.""" # (See pdb.doc for documentation.) import sys import linecache import cmd import bdb from reprlib import Repr import os import re import pprint import traceback class Restart(Exception): """Causes a debugger to be restarted for the debugged python program.""" ...
import pytest from insights.core.dr import SkipComponent from insights.tests import context_wrap from insights.combiners.httpd_conf import _HttpdConf, HttpdConfTree from insights.combiners.nginx_conf import _NginxConf, NginxConfTree from insights.parsers.mssql_conf import MsSQLConf from insights.specs.datasources.ssl_...
# Lint as: python2, python3 # Copyright 2019 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 l...
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
import datetime import pandas as pd from xlsxwriter.workbook import Workbook from paperpusher import spreadsheet class SummaryVariable(): """Directions for how to summarize a given varaible Attributes: name: The summary variable's name variables: a list of variables methods: [list] A list of string met...
# 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 # d...
#!/usr/bin/python # ---------------------------------------------------------------------------- # cocos "install" plugin # # Authr: Luis Parravicini # # License: MIT # ---------------------------------------------------------------------------- ''' "run" plugin for cocos command line tool ''' __docformat__ = 'restruc...
import json from abc import ABCMeta, abstractmethod from collections import defaultdict from enum import Enum import regex from dash.orgs.models import Org from dash.utils import get_obj_cacheable from django.db import models from django.utils.translation import ugettext_lazy as _ from casepro.contacts.models import ...
# coding=utf-8 # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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/li...
#!/usr/bin/env python """ pid_velocity - takes messages on wheel_vtarget target velocities for the wheels and monitors wheel for feedback Copyright (C) 2012 Jon Stephan. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public ...
# coding=utf-8 # Copyright 2015 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 builtins import filter, object from pants.backend.jvm.targets.java_library import J...
from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises # noqa from nose.tools import assert_raises import boto import boto3 import boto.ec2 import boto3 from boto.exception import EC2ResponseError, EC2ResponseError import sure # no...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may ...
import numpy as np from ..utils import check_random_state # Maze state is represented as a 2-element NumPy array: (Y, X). Increasing Y is South. # Possible actions, expressed as (delta-y, delta-x). maze_actions = { 'N': np.array([-1, 0]), 'S': np.array([1, 0]), 'E': np.array([0, 1]), 'W': np.array([0...
# Copyright 2011 Justin Santa Barbara # 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 requ...
import os import shutil import sys from io import StringIO import pytest from zorn import errors, tasks def test_task(): task = tasks.Task() assert task.verbosity == 1 def test_task_run(): task = tasks.Task() with StringIO() as stream: sys.stdout = stream task.run() assert ...
""" Copyright [2009-2017] EMBL-European Bioinformatics Institute 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...
import base64, re, traceback, os from prompt_toolkit import PromptSession from prompt_toolkit.history import FileHistory from prompt_toolkit.auto_suggest import AutoSuggestFromHistory from prompt_toolkit.styles import Style from poshc2.client.Alias import ps_alias from poshc2.Colours import Colours from poshc2.Utils i...
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com> # # 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 applicabl...
""" This module defines exporters for the SWF fileformat. """ from __future__ import absolute_import from .consts import * from .geom import * from .utils import * from .data import * from .tag import * from .filters import * from lxml import objectify from lxml import etree import base64 from six.moves import map from...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import warnings import pandas as pd from . import utils from .alignment import align from .merge import merge from .pycompat import iteritems, OrderedDict, basestring from .variable import Variable, as_variabl...
""" Parser for DBF fields. """ import sys import datetime import struct from decimal import Decimal from .memo import BinaryMemo PY2 = sys.version_info[0] == 2 if PY2: decode_text = unicode else: decode_text = str class InvalidValue(bytes): def __repr__(self): text = bytes.__repr__(self) ...
import numpy as np from scipy import linalg from copy import deepcopy from ..io.constants import FIFF from ..io.pick import pick_types, pick_info from ..surface import get_head_surf, get_meg_helmet_surf from ..io.proj import _has_eeg_average_ref_proj, make_projector from ..transforms import transform_surface_to, read...
from contextlib import contextmanager from typing import ( cast, Any, Callable, Dict, Generator, Iterable, Iterator, List, Mapping, Optional, Set, Sized, Tuple, Union, IO, Text, TypeVar ) from django.core import signing from django.core.urlresolvers import LocaleRegexURLResolver from django.conf import setting...
''' Taken from https://github.com/fchollet/deep-learning-models ResNet50 model for Keras. # Reference: - [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385) Adapted from code contributed by BigMoyan. ''' from __future__ import print_function import numpy as np import warnings from ke...
import numpy as np from numpy.testing import ( assert_, assert_equal, assert_array_equal, assert_raises ) from numpy.lib.type_check import ( common_type, mintypecode, isreal, iscomplex, isposinf, isneginf, nan_to_num, isrealobj, iscomplexobj, asfarray, real_if_close ) def assert_all(x): assert...
#Copyright 2013 Cloudbase Solutions SRL #Copyright 2013 Pedro Navarro Perez #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/li...
""" SoftLayer.load_balancer ~~~~~~~~~~~~~~~~~~~~~~~ Load Balancer Manager/helpers :license: MIT, see LICENSE for more details. """ from SoftLayer import exceptions from SoftLayer.managers import ordering from SoftLayer import utils class LoadBalancerManager(utils.IdentifierMixin, object): """Mana...
# -*- coding: utf-8 -*- # # Electrum - lightweight Bitcoin client # Copyright (C) 2018 The Electrum developers # # 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, # includi...
# -*- coding: utf-8 -*- # Copyright (C) 2019 Philipp Wolfer # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. """Pure ...
from django.test import TransactionTestCase from django.core.exceptions import ValidationError from django.core.management import call_command from .. import models class ServiceTests(TransactionTestCase): def setUp(self): call_command('registerplugins') self.http = models.Plugin.objects.get(name='...
# 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. """A bare-bones test server for testing cloud policy support. This implements a simple cloud policy test server that can be used to test chrome's device...
"""Enables retreival of train departure information from Trafikverket API.""" import typing from datetime import datetime, timedelta from enum import Enum import aiohttp from pytrafikverket.trafikverket import ( FieldFilter, FieldSort, FilterOperation, NodeHelper, OrFilter, SortOrder, Trafikverket) class Sta...
from django.contrib.auth.models import User from ummeli.vlive.tests.utils import VLiveClient, VLiveTestCase from ummeli.opportunities.models import * from django.core.urlresolvers import reverse from datetime import datetime, timedelta from django.contrib.sites.models import Site class OpportunitiesTest(VLiveTestCase...
# -*- coding: utf-8 -*- from rest_framework import status as http_status import mock import datetime import pytest import unittest from json import dumps from nose.tools import * # noqa (PEP8 asserts) from tests.base import OsfTestCase, get_default_metaschema from osf_tests.factories import ProjectFactory, UserFacto...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2015 Kitware 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 cop...
# # The Python Imaging Library # $Id$ # # Adobe PSD 2.5/3.0 file handling # # History: # 1995-09-01 fl Created # 1997-01-03 fl Read most PSD images # 1997-01-18 fl Fixed P and CMYK support # 2001-10-21 fl Added seek/tell support (for layers) # # Copyright (c) 1997-2001 by Secret Labs AB. # Copyright (c) 1995-20...
#!/usr/bin/env python3 import itertools from collections import defaultdict import logging import networkx as nx import numpy as np import pandas as pd from pgmpy.base import DirectedGraph from pgmpy.factors import TabularCPD from pgmpy.independencies import Independencies from pgmpy.extern.six.moves import range ...
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """upgradewallet RPC functional test Test upgradewallet RPC. Download node binaries: Requires previous r...
# 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...
""" Python Builtins --------------- Most buildin functions (that make sense in JS) are automatically translated to JavaScript: isinstance, issubclass, callable, hasattr, getattr, setattr, delattr, print, len, max, min, chr, ord, dict, list, tuple, range, pow, sum, round, int, float, str, bool, abs, divmod, all, any, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2018 Piero Dalle Pezze # # 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 ...
#!/usr/bin/env python import glob import os import re import shutil import subprocess import sys import stat from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \ get_target_arch, get_chromedriver_version, \ get_platform_key from lib.util import scoped_c...
# 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/python3 # # Copyright (c) 2012 Mikkel Schubert <MikkelSch@gmail.com> # # 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 ...
import sys import os import io from jinja2 import Environment, FileSystemLoader, FunctionLoader import urllib import base64 import copy import gc import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.image as mpimg import seaborn as sns import scipy.stats as ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Imports from collections import OrderedDict import os import StringIO from lxml import etree import process_includes # # Globals and constants SchemaNS = 'http://www.w3.org/2001/XMLSchema' Nsmap = OrderedDict({ 'xs': SchemaNS, }) # # Functions for exte...
#!/usr/bin/env python """ Pegasus DAX generator for the Montage toolkit. The generated workflow will support multiple bands and colors to produce a color image. # Copyright 2016 University Of Southern California # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except ...
from models import User, Message, Contribution, Program from time import gmtime, strftime import mandrill import exceptions import access import mailContent KEY = access.mandrill_key #sending an outbound mail. From entrepreneur to mentor or job applicant def outBoundMail(message): from_email = message.get("send...
# Copyright (C) 2010 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 ...
# 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 # d...
import copy from datetime import datetime, timezone import pytest from CommonServerPython import DemistoException import demistomock as demisto from ArcherV2 import Client, extract_from_xml, generate_field_contents, get_errors_from_res, generate_field_value, \ fetch_incidents, get_fetch_time, parser, OCCURRED_FORM...
from django.conf.urls import url from .views import ( research_nitrogen_applied_views, nitrogen_applied_views, research_measurement_year_views, measurement_duration_views, measurement_season_views, measurement_year_views, research_diversity_views, diversity_views, research_experiment...
#!/usr/bin/env python # # Copyright 2010 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...
# Copyright 2012 majgis Contributors # # Individuals comprising majgis Contributors are identified in # the NOTICE file found in the root directory of this project. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Y...
# # Author: Henrique Pereira Coutada Miranda # Run a Silicon groundstate calculation using Quantum Espresso # from __future__ import print_function, division import sys import argparse from qepy import * from schedulerpy import * from math import sqrt kpoints = [6,6,1] kpoints_nscf = [6,6,1] kpoints_double = [24,...
#!/usr/bin/python # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
""" Tests for Timestamp timezone-related methods """ from datetime import ( date, datetime, timedelta, ) import dateutil from dateutil.tz import ( gettz, tzoffset, ) import pytest import pytz from pytz.exceptions import ( AmbiguousTimeError, NonExistentTimeError, ) from pandas._libs.tslibs...
#!/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...
import re import unicodedata import json from django.core.exceptions import ImproperlyConfigured from django.core.validators import validate_email, ValidationError from django.core import urlresolvers from django.db.models import FieldDoesNotExist from django.db.models.fields import (DateTimeField, DateField, ...
"""This module holds all the functions that deal with starting up Fjord for both the developer and server environments. These functions shouldn't be used after startup is completed. """ import logging import os import sys from itertools import chain from fjord import path log = logging.getLogger(__name__) # Denot...
""" Copyright 2015 Brocade Communications Systems, 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 t...
# 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 collections import deque from contextlib import contextmanager import json from jsonschema import FormatChecker, ValidationError from jsonschema.tests.compat import mock, unittest from jsonschema.validators import ( RefResolutionError, UnknownType, Draft3Validator, Draft4Validator, RefResolver, create, ex...
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread 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: # 1. Redistributions of source code must retain the above copyright # ...
# Copyright The PyTorch Lightning team. # # 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...
# # 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 2017,2018 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 by applicable law or agr...
#!/usr/bin/env python import collections import json import os from os import path import subprocess import sys import unittest import yaml INV_DIR = 'playbooks/inventory' SCRIPT_FILENAME = 'dynamic_inventory.py' INV_SCRIPT = path.join(os.getcwd(), INV_DIR, SCRIPT_FILENAME) sys.path.append(path.join(os.getcwd(), INV...
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import httplib import os import shutil import socket import urllib2 import xml.dom.minidom from operator import itemgetter from slugify import slugify from code.db_handler import DbHandler from code.settings import settings from mailer import mail_updates...
import re import requests from bs4 import BeautifulSoup from pymods import OAIReader # custom functions and variables import assets from citrus_config import VERBOSE nameSpace_default = { None: '{http://www.loc.gov/mods/v3}', 'oai_dc': '{http://www.openarchives.org/OAI/2.0/oai_dc/}', ...
# 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...
# Copyright 2015 Cisco Systems, 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 requi...
# 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 agr...
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange 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 applic...
# Copyright 2017 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. import unittest from typ import expectations_parser from typ import json_results ConflictResolutionTypes = expectations_parser.ConflictResolutionTypes Resu...
#!/usr/bin/python import sys from os.path import join,exists,dirname import random import numpy as np from numpy.random import randint, choice from sklearn.datasets import load_svmlight_file from torch.autograd import Function, Variable import torch.nn as nn import torch.optim as optim import torch from torch import F...
# 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...
from ..base import OptionsGroup from ..exceptions import ConfigurationError from ..utils import KeyValue, filter_locals from .subscriptions_algos import * class Subscriptions(OptionsGroup): """ This allows some uWSGI instances to announce their presence to subscriptions managing server, which in its turn ...
from __future__ import absolute_import, print_function, unicode_literals import re import six from attr import attrib, attrs from attr.validators import instance_of, optional, provides from automat import MethodicalMachine from twisted.python import log from zope.interface import implementer from . import _interface...
# 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...
import os import base64 from django.db import models from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.core.files.storage import FileSystemStorage from django.utils.timezone import now from django.core.urlresolvers import reverse try: from PIL import Image except...
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. ## ## Testing IronPython Compiler ## from iptest.assert_util import * skiptest("win32") from iptest.file_util ...
import pprint import random import socket import string import struct import subprocess from logging import getLogger from os import urandom from time import time from urllib.parse import urlparse, urlencode from dns import resolver from dns.exception import DNSException import requests from newTrackon.bdecode import...
from datetime import datetime import numpy as np import pandas.util.testing as tm from pandas import Series, date_range, NaT class SeriesConstructor(object): params = [None, 'dict'] param_names = ['data'] def setup(self, data): self.idx = date_range(start=datetime(2015, 10, 26), ...
import os from urlparse import urlparse from ceph_deploy.lib import remoto from ceph_deploy.util import templates def apt(conn, packages, *a, **kw): if isinstance(packages, str): packages = [packages] cmd = [ 'env', 'DEBIAN_FRONTEND=noninteractive', 'apt-get', 'install...
import collections import warnings from pprint import pformat import jnpr.junos.facts from jnpr.junos.facts import __doc__ as facts_doc import jnpr.junos.exception class _FactCache(collections.MutableMapping): """ A dictionary-like object which performs on-demand fact gathering. This class should not be...
# 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...
# =============================================================================== # Copyright 2011 Jake Ross # # 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/licens...
#!/usr/bin/env python ## ## Copyright 2016 SRI International ## See COPYING file distributed along with the package for the copyright and license terms. ## import os import re import glob import time import filecmp import pandas # Truncate age to 2 digits for increased identity protection def truncate_age(age_in...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base...
# -*- coding: utf-8 -*- import json from os import path from gluon import current, URL from gluon.html import * from gluon.storage import Storage from gluon.sqlhtml import SQLFORM from s3 import S3FilterForm, S3CustomController, S3OptionsFilter, S3Request, \ S3SQLCustomForm THEME = "historic.SSF" #...
# coding: utf-8 # In[62]: import mxnet as mx import numpy as np import scipy.io as sio # In[63]: symbol_string = "import mxnet as mx\ndata= mx.symbol.Variable(name='data')\n" # In[64]: matpath='./hr_res101.mat' # In[65]: f = sio.loadmat(matpath) net = f['net'] # In[66]: data = mx.symbol.Variable(name='da...
""" Query suggestion hierarchical encoder-decoder code. The code is inspired from nmt encdec code in groundhog but we do not rely on groundhog infrastructure. """ __docformat__ = 'restructedtext en' __authors__ = ("Alessandro Sordoni") __contact__ = "Alessandro Sordoni <sordonia@iro.umontreal>" import theano import th...