gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Copyright 2016-2017 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 ...
# -*- coding: utf-8 -*- # (C) Copyright 2014 Voyager Search # # 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...
# 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...
"""Test list, dict, etc.""" import unittest from pytype.pytd import pytd from pytype.tests import test_inference class ContainerTest(test_inference.InferenceTest): def testTuplePassThrough(self): with self.Infer(""" def f(x): return x f((3, "str")) """, deep=False, solve_unknowns=False...
# -*- coding: utf-8 -*- """Django settings for kitsune project.""" import logging import os import platform import re from datetime import date from bundles import MINIFY_BUNDLES from kitsune.lib.sumo_locales import LOCALES DEBUG = True TEMPLATE_DEBUG = DEBUG STAGE = False LOG_LEVEL = logging.INFO SYSLOG_TAG = 'htt...
import unittest from unittest import mock from . make import make from bibliopixel.animation import animation from bibliopixel.colors import gamma, tables from bibliopixel.drivers.ledtype import LEDTYPE BAD_JSON_ERROR = """ while parsing a flow node expected the node content, but found ']' in "<unicode string>", li...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Interface with command line GULP. http://projects.ivec.org WARNING: you need to have GULP installed on your system. """ __author__ = "Bharat Medasani, Wenhao Sun" __copyright__ = "Copyright 2013, The Mate...
# # Data for analyzing causality. # By Nick Cortale # # Classes: # ccm # embed # # Paper: # Detecting Causality in Complex Ecosystems # George Sugihara et al. 2012 # # Thanks to Kenneth Ells and Dylan McNamara # # Notes: # Originally I thought this can be made way faster by only calculting the # distances once and t...
# BSD 3-Clause License # # Copyright (c) 2016-21, University of Liverpool # 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 notic...
import functools import tensorflow as tf import numpy as np import time def lazy_property(function): attribute = '_' + function.__name__ @property @functools.wraps(function) def wrapper(self): if not hasattr(self, attribute): setattr(self, attribute, function(self)) return...
import io import os import sys import imp import time import shutil import struct import zipfile import unittest from tempfile import TemporaryFile from random import randint, random, getrandbits from test.support import (TESTFN, findfile, unlink, requires_zlib, requires_bz2, requires_lzma,...
from __future__ import print_function EXTENDED = 'Ext' TRIGGERS = { 'P': '"Push"', 'S': '"Switch"', 'W': '"WalkOver"', 'G': '"Gun"', } SPEEDS = { '----': 0, 'Slow': 8, 'Normal': 16, 'Fast': 32, 'Turbo': 64, 'Inst': 16384, } LOCKS = { 'No': None, 'Blue': 0, 'Red': 1...
# 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 agreed to in...
#---------------------------------------------------------------------- # Copyright (c) 2008 Board of Trustees, Princeton University # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, i...
# Copyright (c) 2013-2016 Christian Geier et al. # # 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, ...
import os import pickle import time import warnings import matplotlib.pyplot as plt import numpy as np from algorithms import create_index, compute_feature_array, extract_pixel_feature, best_approximate_match, \ best_coherence_match, compute_distance from config import setup_vars, save_metadat...
import pytest import numpy as np import pandas as pd from dateutil.parser import parse as parse_date from pdutils import df_compare, ndarray_compare, ts_compare, assert_, assert_not # Example pandas DataFrame objects that are expected to be equal. TEST_DF_SAME = [ ( pd.DataFrame({'a': [1., 2., 3.], 'b...
# -*- coding: utf-8 -*- from urllib.request import urlopen from ipaddress import ip_address from collections import deque from .dcc import DCCManager from .dcc import DCCChat from .dec import dcc_event from .dec import event from .dec import extend from .dec import plugin from . import config from . import utils from ....
from __future__ import unicode_literals import re import tempfile from django.contrib.gis import gdal from django.contrib.gis.db.models import Extent, MakeLine, Union from django.contrib.gis.geos import ( GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon, fromstr, ) from django.core.man...
# 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 # not use this file except in compliance with the License. You may obtain # a ...
"""Undocumented Module""" __all__ = ['MetaInterval', 'Sequence', 'Parallel', 'ParallelEndTogether', 'Track'] from panda3d.core import * from panda3d.direct import * from direct.directnotify.DirectNotifyGlobal import * from .IntervalManager import ivalMgr from . import Interval from direct.task.Task import TaskManager...
#!/usr/bin/python """ This module specifically deals with the dynamical quantities related to Multi Gaussian Expansion models (Monnet et al. 1992, Emsellem et al. 1994). It includes the derivation of projected and deprojected photometry, and the derivation of velocity moments via the Jeans Equations. """ """ Importi...
from __future__ import absolute_import from .fixtures import * from blitzdb.tests.helpers.movie_data import Actor, Director, Movie import blitzdb def test_basic_delete(backend, small_test_data): backend.filter(Actor, {}).delete() backend.commit() assert len(backend.filter(Actor, {})) == 0 def test_b...
#!/usr/bin/python # TODO: issues with new oauth2 stuff. Keep using older version of Python for now. # #!/usr/bin/env python from participantCollection import ParticipantCollection import re import datetime import pyperclip # Edit Me! currentMonthTotalDays = 29 currentMonthIndex = datetime.date.today().month currentM...
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
import shutil import os import pwd import json from urlparse import urljoin os.getlogin = lambda: pwd.getpwuid(os.getuid())[0] # noqa import requests from django.db import models from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.db.models.signals import post_save f...
# This file is part of fesom_viz # ################################################################################ # # Interpolates FESOM data to regular grid. The output is netCDF4 files # with CMOR complient attributes. # # Original code by Nikolay Koldunov, 2016 # # TODO: # Add possibility to define curvi...
"""setuptools.command.bdist_egg Build .egg distributions""" # This module should be kept compatible with Python 2.3 import sys, os, marshal from setuptools import Command from distutils.dir_util import remove_tree, mkpath try: # Python 2.7 or >=3.2 from sysconfig import get_path, get_python_version def _g...
""" Inception V4, suitable for images with around 299 x 299 (original) Implemented the following paper: Szegedy C, Ioffe S, Vanhoucke V. Inception-v4, inception-resnet and the impact of residual connections on learning[J]. arXiv preprint arXiv:1602.07261, 2016. Jie Hu, Li Shen, Gang Sun. "Squeeze-and-Excitation Networ...
# Copyright 2014 The Oppia 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 ...
#!/usr/bin/env python2 # coding: utf-8 # RSHELL is a remote interactive access to Stash (a bash like shell for Pythonista). # It's based on the Guido Wesdorp's work for its remote interactive shell (ripshell). from __future__ import print_function import socket import sys import traceback import thread import time ...
# Copyright 2014 The Oppia 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 ...
# Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This script is intended for use as a GYP_GENERATOR. It takes as input (by way of the generator flag config_path) the path of a json file that dictates the file...
#!/usr/local/bin/python # -*- coding: utf-8 -*- import unittest import requests_mock from mock import Mock from urlparse import urlparse, parse_qs from cartodb_services.here import HereMapsRoutingIsoline from cartodb_services.here.exceptions import BadGeocodingParams from cartodb_services.here.exceptions import NoGeo...
# Copyright 2015-2017 Capital One Services, LLC # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import importlib import json import logging import os import platform import py_compile import shutil import site import sys import tempfile import time import unittest import zipfile import m...
# vim: set et sw=4 sts=4 fileencoding=utf-8: # # An alternate Python Minecraft library for the Rasperry-Pi # Copyright (c) 2013-2015 Dave Jones <dave@waveform.org.uk> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # ...
# coding:utf-8 # GANs model import random import numpy as np from ...configure import BACKEND class WGAN_TF: def __init__(self, x_size, z_size, net_G, net_D, lr=5e-5, clip=0.01, d_loss_addition=0, g_loss_addition=0, batch_size=32): """ :param x_size: the size of every input sam...
# Standard Python packages import subprocess, os try: import xml.etree.cElementTree as ElementTree except ImportError: import xml.etree.cElementTree as ElementTree # Special dependencies import numpy # sudo apt-get install python-numpy # Cassius interdependencies import cassius.mathtools import cassius.utilit...
# -*- coding: utf-8 -*- # # This file is part of Karesansui. # # Copyright (C) 2009-2012 HDE, Inc. # # 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 lim...
# Copyright 2014 Mellanox Technologies, Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
from .element import Element from .constants import LABEL_CLASS_MARK, ALIGN_JUSTIFY class TextAtom(Element): def init(self): self.content = self._params.get('content', '') self.font_family = self._params.get('font-family') self.font_style = self._params.get('font-style') self.font_...
# # Copyright 2019 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 agreed to in writing,...
import time import xbmc import xbmcaddon import denon from datetime import datetime from datetime import timedelta __PLUGIN_ID__ = "plugin.audio.denon-dra-f109-remote" settings = xbmcaddon.Addon(id=__PLUGIN_ID__); addon_dir = xbmc.translatePath( settings.getAddonInfo('path') ) class XBMCPlayer(xbmc.Player): __M...
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import itertools import json import os import re import shutil import tempfile import time import unittest import urllib # Find the best implementation available try: from cStringIO import StringIO except I...
import os import sys import glob import shutil import errno import logging from contextlib import contextmanager from plumbum.lib import _setdoc, IS_WIN32 from plumbum.path.base import Path, FSUser from plumbum.path.remote import RemotePath try: from pwd import getpwuid, getpwnam from grp import getgrgid, getgr...
import os import re import random import hashlib import hmac import string from collections import namedtuple from time import sleep from functools import wraps import webapp2 import jinja2 from google.appengine.ext import db template_dir = os.path.join(os.path.dirname(__file__), 'templates') jinja_env = jinja2.Envi...
#! /usr/local/bin/python """ See LICENSE file for copyright and license details. """ from decimal import Decimal from database.databaseaccess import DatabaseAccess from database.mappings import * from modules.core_module import CoreModule from modules.statement import Statement from modules.constant import * from...
# Natural Language Toolkit: Text Segmentation Metrics # # Copyright (C) 2001-2015 NLTK Project # Author: Edward Loper <edloper@gmail.com> # Steven Bird <stevenbird1@gmail.com> # David Doukhan <david.doukhan@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Text Segme...
#-*- coding:utf-8 -*- from __future__ import division from __future__ import absolute_import from __future__ import with_statement from __future__ import print_function from __future__ import unicode_literals from UserDict import IterableUserDict from contextlib import contextmanager from datetime import datetime fro...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import threading imp...
import utils.decisions_constants as log from game.ai.strategies.main import BaseStrategy from mahjong.constants import HONOR_INDICES, TERMINAL_INDICES from mahjong.tile import TilesConverter from mahjong.utils import is_honor, is_tile_strictly_isolated from utils.test_helpers import tiles_to_string class TanyaoStrate...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 3 of the Lic...
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Kiall Mac Innes <kiall@hpe.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/...
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # Copyright (c) 2014 TrilioData, Inc # Copyright (c) 2015 EMC Corporation # Copyright (C) 2015 Kevin Fox <kevin@efox.cc> # Copyright (C) 2015 Tom Barron <tpb@dyncloud.net> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "Li...
import ast import json import threading import os import shutil from copy import deepcopy from util import user_dir, print_error, print_msg, print_stderr, PrintError from bitcoin import MAX_FEE_RATE, FEE_TARGETS SYSTEM_CONFIG_PATH = "/etc/electron-cash.conf" config = None def get_config(): global config r...
""" Introduce some basic refactoring functions to |jedi|. This module is still in a very early development stage and needs much testing and improvement. .. warning:: I won't do too much here, but if anyone wants to step in, please do. Refactoring is none of my priorities It uses the |jedi| `API <plugin-a...
# -*- coding: utf-8 -*- from ccxt.async.base.exchange import Exchange import math from ccxt.base.errors import ExchangeError class bitstamp (Exchange): def describe(self): return self.deep_extend(super(bitstamp, self).describe(), { 'id': 'bitstamp', 'name': 'Bitstamp', ...
# 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...
# 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...
"""Posts JSON with basic information for each completed build to the URL specified in the config variable ANALYTICS_POST_URL, if that value is set. The data posted to ANALYTICS_POST_URL will be a JSON array of objects, with each object representing a completed build. """ import logging import json import re import re...
# # wcsmod.py -- module wrapper for WCS calculations. # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # """ We are fortunate to have several possible choices for a python...
# # Test script for the curses module # # This script doesn't actually display anything very coherent. but it # does call (nearly) every method and function. # # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(), # init_color() # Only called, not tested: getmouse(), ungetmouse() # import os import...
#------------------------------------------------------------------------------- # Name: socks.py # Purpose: This module handle SOCKS messages parsing and generating. # # # Author: Nethanel Coppenhagen # #------------------------------------------------------------------------------- import socket fr...
''' datetime.tzinfo timezone definitions generated from the Olson timezone database: ftp://elsie.nci.nih.gov/pub/tz*.tar.gz See the datetime section of the Python Library Reference for information on how to use these modules. ''' # The IANA (nee Olson) database is updated several times a year. OLSON_VERSION = '2...
import lexeme.Library as Library import csv import lexeme.IOHelper as IOHelper import sys import os from tabulate import tabulate wordgensettings = {} formrules = {} phonotactics = {} formatString = "" def add(): '''Interface for addWord().''' word = {} word['english'] = input("Enter meaning in English: ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2011, Nicolas Clairon # 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 abov...
""" Created on Tue Jan 03 10:55:39 2017 @author: Ricky """ ##################################################################### """ Importing program modules """ ##################################################################### import numpy as np import matplotlib.pyplot as plt import matplotlib.dates as mdates...
# Copyright (c) 2017 pandas-gbq Authors All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # -*- coding: utf-8 -*- import copy import datetime from unittest import mock import numpy import pandas from pandas import DataFrame import pytest from ...
# 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 by applicable law or agreed...
""" Entrainment of a single biophysical neuron by a periodic pulse train. Cf. Chapter 10 of Izhikevich. """ from __future__ import division from PyDSTool import * from common_lib import * gentype='dopri' # dopri, euler, etc. def makeHHneuron(name, excit_type, par_args, ic_args, Istim_dict=None, gent...
from future_builtins import zip from django.core.exceptions import FieldError from django.db import transaction from django.db.backends.util import truncate_name from django.db.models.query_utils import select_related_descend from django.db.models.sql.constants import * from django.db.models.sql.datastructures import ...
from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.db.models import Q from django.http import HttpResponseRedirect from django.shortcuts import render from django.views.generic import TemplateView from .models import * @login_required(login_...
# -*- 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): # Adding field 'Post.pic_25' db.add_column('blogs_post', 'pic_25', self.gf('sorl.thumb...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import os import shlex import sys from subprocess import Popen, PIPE, \ check_call, CalledProcessError # The name of environmental variable # for branch name on which count unmerged commits count. ENV_MERGE_BRANCH = 'ZSH_VCS_PRO...
from unittest import TestCase from os.path import dirname, join import dark from dark.genomes import GenomeProteinInfo from dark.civ.proteins import SqliteIndex TOP = dirname(dirname(dark.__file__)) DB = SqliteIndex(join(TOP, 'test', 'data', 'hbv', 'hbv-proteins.db')) BAM1 = join(TOP, 'test', 'data', 'hbv', 'query1...
# -*- coding: utf-8 -*- """ Request Management """ module = request.controller resourcename = request.function if not deployment_settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ----------------------------------------------------------------------------- def index(): ...
"""Functions to make 3D plots with M/EEG data """ from __future__ import print_function # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # ...
import os import numpy as np import tensorflow as tf from SVHN_dataset import SVHNDataset from SVHN_recognition.deep_localization_weighted_loss_variable_length import DeepLocalizationWeightedLossVariableLength from SVHN_recognition.svhn_paper_convolution import SVHNPaperConvolution from SVHN_recognition.svhn_paper_co...
# Copyright 2016 The Kubernetes 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 agreed to ...
# -*- encoding: utf-8 -*- """API/Interface to the SQLAlchemy backend. """ import copy from oslo_config import cfg from oslo_db import exception as db_exc from oslo_db.sqlalchemy import session as db_session from oslo_log import log from sqlalchemy.orm import exc as sqla_exc from ironic_inventory.common import excepti...
# 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...
#!/usr/bin/python # # Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es) # # 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 bz2 import BZ2File import gzip from io import BytesIO import numpy as np import scipy.sparse as sp import os import shutil from tempfile import NamedTemporaryFile from sklearn.externals.six import b from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.u...
#!/usr/bin/python # # Copyright (C) 2013 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of...
# Copyright (c) 2014 Hitachi Data 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 # # U...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from datetime import datetime, timedelta from uuid import uuid4 from pytz import UTC from twisted.python import log from twisted.internet.defer import maybeDeferred from twisted.web.resource import Resource from twisted.web.server import NOT_DONE_YET from txaws.ec2.client import Signature from txaws.service import AW...
import datetime from sqlalchemy import Column from sqlalchemy import create_engine from sqlalchemy import DateTime from sqlalchemy import Float from sqlalchemy import ForeignKey from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import String from sqlalchemy import Table from sqlalchemy.ext....
import numpy as np import pytest import pandas as pd from pandas import DataFrame, Index, MultiIndex, Series, Timestamp, isna import pandas._testing as tm def test_first_last_nth(df): # tests for first / last / nth grouped = df.groupby("A") first = grouped.first() expected = df.loc[[1, 0], ["B", "C",...
import os import datetime # No set literals because we support Python 2.6. TRUE_VALUES = set(( True, 'True', 'true', )) class empty(object): """ We use this sentinel object, instead of None, as None is a plausible value for a default in real Python code. """ pass def get_env_value(...
# ST2/ST3 compat from __future__ import print_function import sublime if sublime.version() < '3000': # we are on ST2 and Python 2.X _ST3 = False else: _ST3 = True import re import sys import os.path # To accommodate both Python 2 and 3 def advance_iterator(it): if not _ST3: return it.next() else: ...
# 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 unde...
# Copyright 2019 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 random import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from sklearn.utils import shuffle from tensorflow.contrib.layers import flatten from tensorflow.examples.tutorials.mnist import input_data def LeNet(x): """ **Input** The LeNet architecture accepts a 32x32xC image a...
#!/usr/bin/python # -*- coding: utf-8 -*- # Zinc grammar specification. # (C) 2016 VRT Systems # # vim: set ts=4 sts=4 et tw=78 sw=4 si: import datetime import logging import re import sys import iso8601 import pyparsing as pp import six # Bring in special Project Haystack types and time zones from .datatypes import ...
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2017, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
# # Channel.py -- Channel class for the Ginga reference viewer. # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import time from ginga.misc import Bunch, Datasrc, Callback, Future, Settings from ginga.util import viewer as gviewer class ChannelError(Exc...
# adalink STLink V2 Programmer (using OpenOCD). # # Python interface to control the STLink V2 programmer using OpenOCD. # # Note you MUST have OpenOCD installed. # # Author: Tony DiCola import logging import os import platform import re import sys import subprocess import threading import time from .base import Progra...
import csb.test as test from csb.bio.io import ClansParser from csb.bio.io.clans import Clans, ClansEntry, ClansParams, ClansSeqgroup,\ Color, ClansEntryCollection, ClansSeqgroupCollection, DuplicateEntryError,\ DuplicateEntryNameError @test.unit class TestClansColor(test.Case): def setUp(self): ...
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # project from checks import AgentCheck from checks.libs.wmi.sampler import WMISampler from collections import namedtuple WMIMetric = namedtuple('WMIMetric', ['name', 'value', 'tags']) class InvalidWMIQuery(E...