text
stringlengths
475
200k
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <[EMAIL]> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software ...
# -*- Mode: Python; test-case-name: flumotion.test.test_flavors -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified un...
# # # Copyright (C) 2006, 2007, 2012 Google 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 2 of the License, or # (at your option) any later version. # # This program is ...
"""Utilities to evaluate models with respect to a variable """ # Author: Alexander Fabisch <[EMAIL]> # # License: BSD 3 clause import warnings import numpy as np from .base import is_classifier, clone from .cross_validation import check_cv from .externals.joblib import Parallel, delayed from .cross_validation import...
#!/usr/bin/python3 import codecs ########################################################################################################## # # # Based on: ...
from flask.ext.wtf import Form from wtforms import TextField, PasswordField, BooleanField, IntegerField from wtforms.validators import Required, Email, EqualTo class LoginForm(Form): user_name = TextField('user_name', validators = [Required(), Email(message=u'Invalid email address')]) #Not an encrypted password pas...
#!/usr/bin/env python3 # Copyright (c) 2016 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. import argparse import os import signal import ...
from itertools import izip from warnings import warn import numpy from tractography import Tractography from nibabel import trackvis def tractography_to_trackvis_file(filename, tractography, affine=None, image_dimensions=None): trk_header = trackvis.empty_header() if affine is not None: pass e...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, ...
import traceback import imp class Module(): def __init__(self, module_filename): # the filename e.g. mod_list.py self.filename = module_filename # the filename without extension self.name = module_filename[:-3] # start marked as unloaded, so this will hold true if anything...
#!/usr/bin/python import unittest import optparse from common import check_env from regressionc import TestOpenmamac from regressioncpp import TestOpenmamacpp import globals if __name__ == '__main__': parser = optparse.OptionParser() parser.add_option("--tport", dest="transport",nargs=2,help='Name of pub and...
from __future__ import absolute_import from contextlib import contextmanager import pkg_resources import time import logging import stat import os import json import tempfile import shutil import threading import six logger = logging.getLogger(__name__) def first_entry_point(group, name=None): for ep in pkg_reso...
# Copyright 2014 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class MseCasesPage(page_module.Page): def __init__(...
# Copyright 2016 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 or agreed to in writing, ...
# FreeCAD init script of the Web module # (c) 2001 Juergen Riegel #*************************************************************************** #* (c) Juergen Riegel ([EMAIL]) 2002 * #* * #* This file is part of...
import datetime from django.db import models from django.utils import timezone from django.contrib.auth.models import User class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __str__(self): # __unicode__ on Pytho...
# Copyright (c) 2013 OpenStack, 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 req...
# Copyright 2014 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. """Holds the constants for pretty printing histograms.xml.""" import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))...
# 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...
""" Generate samples of synthetic data sets. """ # Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel, # G. Louppe, J. Nothman # License: BSD 3 clause import numbers import warnings import array import numpy as np from scipy import linalg import scipy.sparse as sp from ..preprocessing impo...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
""" Django settings for website project. Generated by 'django-admin startproject' using Django 1.11.6. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os...
# Copyright 2013 Intel Corporation # # 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 ...
import argparse import logging import os import sys from Bio import SeqIO from setuptools import glob L = logging.getLogger(__name__) def read_fastq_file(file_name): # type: (str) -> List[str] reads = [] with open(file_name, "rU") as handle: for record in SeqIO.parse(handle, "fastq"): ...
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.select import Select from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys import selenium.webdriver.chrome.service as service import inspect ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logit function ========================================================= Show in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or two, u...
import torch import torch.utils.data as data import torchvision.transforms as transforms import os import nltk from PIL import Image # from pycocotools.coco import COCO import numpy as np import json as jsonmod def get_paths(path, name='coco', use_restval=False): """ Returns paths to images and annotations fo...
#begin: 26th March 2012 #copyright: (c) 2012 by John Gitau #email: [EMAIL] #about: Wrapper class for writing PostgreSQL/PostGIS tables to user-defined OGR formats import sys, logging from PyQt4.QtCore import * from PyQt4.QtGui import * try: from osgeo import gda...
# -*- coding: UTF-8 -*- import wx import pmt from gnuradio import gr, blocks wxDATA_EVENT = wx.NewEventType() def EVT_DATA_EVENT(win, func): win.Connect(-1, -1, wxDATA_EVENT, func) class DataEvent(wx.PyEvent): def __init__(self, data): wx.PyEvent.__init__(self) self.SetEventType (wxDATA_EVENT) self.data = da...
# # Copyright 2012 ibiblio # # 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.txt # # Unless required by applicable law or agreed to in writing...
'''A node that groups members for control propagation and status monitoring - see script.py for notes''' # For disappearing member support: # (see readme, requires at least Nodel Host rev. 322 or later) # # - remote "Disappearing" signals should be wired to the actual signals # - the usual remote signals shou...
from __future__ import absolute_import import hashlib import logging import sys from pip.basecommand import Command from pip.status_codes import ERROR from pip.utils import read_chunks from pip.utils.hashes import FAVORITE_HASH, STRONG_HASHES logger = logging.getLogger(__name__) class HashCommand(Command): ""...
#!/usr/bin/python # # Copyright (c) 2008 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have ...
"""Cluster _support which are method independant. Routines which calculate _support for data and clustering results. _support in this package do not care what the particluar clustering methodology is. A complete version history and licence and copyright information are located in the source code. """ import numpy fr...
# -*- coding: utf-8 -*- # 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...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # # 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. ...
"""Describe Shelly logbook events.""" from homeassistant.const import ATTR_DEVICE_ID from homeassistant.core import callback from .const import ( ATTR_CHANNEL, ATTR_CLICK_TYPE, ATTR_DEVICE, DOMAIN, EVENT_SHELLY_CLICK, ) from .utils import get_device_name, get_device_wrapper @callback def async_d...
from django.contrib.messages.storage.base import BaseStorage class SessionStorage(BaseStorage): """ Stores messages in the session (that is, django.contrib.sessions). """ session_key = '_messages' def __init__(self, request, *args, **kwargs): assert hasattr(request, 'session'), "The sessi...
# Copyright (c) 2013 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 ...
from tastypie.serializers import Serializer from tastypie.authentication import Authentication from tastypie.http import HttpUnauthorized from django.utils.timezone import is_naive class ISOSerializer(Serializer): """ Our own serializer to format datetimes in ISO 8601 but with timezone offset. """ ...
# (c) 2014, Will Thames <[EMAIL]> # # 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. # # Ansi...
# # The Python Imaging Library # $Id: BufrStubImagePlugin.py 2134 2004-10-06 08:55:20Z fredrik $ # # BUFR stub adapter # # Copyright (c) 1996-2003 by Fredrik Lundh # # See the README file for information on usage and redistribution. # import Image, ImageFile _handler = None ## # Install application-specific BUFR ima...
""" urllib3 - Thread-safe connection pooling and re-using. """ from __future__ import absolute_import import warnings from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encode_multipart_formdata from .poolmanager imp...
# Copyright (C) 2015 - 2019 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or any later version. # # This library is distributed in t...
# -*- coding: utf-8 -*- """ pygments.lexers._lassobuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Built-in Lasso types, traits, methods, and members. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ BUILTINS = { 'Types': [ 'null', ...
from django.template import Library, Node, TemplateSyntaxError from django.utils import formats from django.utils.encoding import force_text register = Library() @register.filter(is_safe=False) def localize(value): """ Forces a value to be rendered as a localized value, regardless of the value of ``setti...
#! /usr/bin/env python # # PyBorg MSN module # # Copyright (c) 2006 Sebastien Dailly # # # 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) an...
# 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...
"""Support for Z-Wave covers.""" import logging from homeassistant.core import callback from homeassistant.components.cover import ( DOMAIN, SUPPORT_OPEN, SUPPORT_CLOSE, ATTR_POSITION) from homeassistant.components.cover import CoverDevice from homeassistant.helpers.dispatcher import async_dispatcher_connect from ....
# 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. """Unit Tests for bug hunter.""" import logging from optparse import Values import smtplib import sys import unittest from bug_hunter import BugHunter ...
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short script, let tool...
from django.core.management.base import NoArgsCommand from django_mailer import models from django_mailer.management.commands import create_handler from optparse import make_option import logging class Command(NoArgsCommand): help = 'Place deferred messages back in the queue.' option_list = NoArgsCommand.opti...
#!/usr/bin/python # art3d.py, original mplot3d version by John Porter # Parts rewritten by Reinier Heeres <[EMAIL]> # Minor additions by Ben Axelrod <[EMAIL]> ''' Module containing 3D artist code and functions to convert 2D artists into 3D versions which can be added to an Axes3D. ''' from __future__ import (absolute_...
# -*- coding: latin-1 -*- # Author: Raver2046 <[EMAIL]> # based on tpi.py # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Foun...
#!/usr/bin/python3 """ Clone all Git repositories for a GitHub user or organisation. """ from __future__ import print_function import argparse import fnmatch import os import subprocess import sys import threading from concurrent import futures from operator import attrgetter try: # Python 2 from ConfigPars...
import asyncio from pulsar import HAS_C_EXTENSIONS from pulsar.apps.test import check_server from pulsar.apps.data import RedisScript from .pulsards import unittest, RedisCommands, create_store from .lock import RedisLockTests OK = check_server('redis') @unittest.skipUnless(OK, 'Requires a running Redis server') ...
from os import mkdir from os.path import exists import numpy as np import pandas as pd from old.project import CassandraUtils from old.project import get_time RTD_STS_KEY = 'retweetedStatus' MT_STS_KEY = 'userMentionEntities' PATH = '/home/joao/Dev/Data/Twitter/' FRIENDS_PATH = '/home/joao/Dev/Data/Twitter/friendshi...
from django.db import models from django.utils.translation import ugettext_lazy as _ SITE_CACHE = {} class SiteManager(models.Manager): def get_current(self): """ Returns the current ``Site`` based on the SITE_ID in the project's settings. The ``Site`` object is cached the first ...
# 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...
#Copyright 2007-2009 WebDriver committers #Copyright 2007-2009 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 b...
# 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...
#!/usr/bin/env python """ Allow you smoothly surf on many websites blocking non-mainland visitors. Copyright (C) 2012, 2013 Bo Zhu http://zhuzhu.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the ...
data = ( 'Zhi ', # 0x00 'Liu ', # 0x01 'Mei ', # 0x02 'Hoy ', # 0x03 'Rong ', # 0x04 'Zha ', # 0x05 '[?] ', # 0x06 'Biao ', # 0x07 'Zhan ', # 0x08 'Jie ', # 0x09 'Long ', # 0x0a 'Dong ', # 0x0b 'Lu ', # 0x0c 'Sayng ', # 0x0d 'Li ', # 0x0e 'Lan ', # 0x0f 'Yong ', # 0x10...
""" This file is part of Ojota. Ojota is free software: you can redistribute it and/or modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Ojota is distributed in th...
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gener...
from __future__ import print_function, division from time import time import argparse import numpy as np from sklearn.dummy import DummyClassifier from sklearn.datasets import fetch_20newsgroups_vectorized from sklearn.metrics import accuracy_score from sklearn.utils.validation import check_array from sklearn.ensemb...
# Copyright 2014 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 ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Stephen Fromm <[EMAIL]> # Copyright: (c) 2016, Toshio Kuratomi <[EMAIL]> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division...
# -*- coding: utf-8 -*- ############################################################################### # # AddPermission # Adds a permission to a queue for a specific principal user. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); #...
# # (c) 2015, Peter Sprygada <[EMAIL]> # # 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. # #...
""" Python Blueprint ================ Does not install python itself, only develop and setup tools. Contains pip helper for other blueprints to use. **Fabric environment:** .. code-block:: yaml blueprints: - blues.python """ from fabric.decorators import task from refabric.api import run, info from refa...
#!/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 distributed...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
from mini import app from mini.util import AnonymousUser from mini.models import User, Email from datetime import datetime as dt, date as d, timedelta as td from flask import Markup import time, os, pygments, pygments.lexers, pygments.formatters, git, re from os.path import * from json import dumps # UTILITY to wrap a...
import unittest, sys, time sys.path.extend(['.','..','../..','py']) import h2o2 as h2o import h2o_cmd, h2o_import as h2i from h2o_test import dump_json, verboseprint, OutputObj import h2o_jobs DO_CLASSIFICATION = True DO_FAIL_CASE = False DO_FROM_TO_STEP = False class Basic(unittest.TestCase): def tearDown(self):...
#!/usr/bin/env python # Author: Andrew Jewett (jewett.aij at g mail) # http://www.chem.ucsb.edu/~sheagroup # License: 3-clause BSD License (See LICENSE.TXT) # Copyright (c) 2012, Regents of the University of California # All rights reserved. import sys from collections import defaultdict #from collections...
# -*- test-case-name: buildbot.test.test_steps,buildbot.test.test_properties -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from buildbot.steps.shell import Shell...
# Copyright 2011 Eldar Nugaev # 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 ...
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from fabric.state import env from fabric.utils import puts from .base import ConnectionDict, get_local_port from .tunnel import LocalTunnel class SocketTunnels(ConnectionDict): """ Cache for **socat** tunnels to the remote machine. Instant...
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <[EMAIL]> # # This module 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. #...
from django.test import SimpleTestCase, override_settings from django.test.utils import require_jinja2 @override_settings(ROOT_URLCONF='shortcuts.urls') class RenderTests(SimpleTestCase): def test_render(self): response = self.client.get('/render/') self.assertEqual(response.status_code, 200) ...
# orm/interfaces.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Contains various base classes used throughout the ORM. Defines the now depreca...
# orm/mapper.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Logic to map Python classes to and from selectables. Defines the :class:`~sqlalche...
"""Representing and manipulating email headers via custom objects. This module provides an implementation of the HeaderRegistry API. The implementation is designed to flexibly follow RFC5322 rules. Eventually HeaderRegistry will be a public API, but it isn't yet, and will probably change some before that happens. ""...
# -*- coding: utf-8 -*- # # This file is part of CERN Analysis Preservation Framework. # Copyright (C) 2016, 2017 CERN. # # CERN Analysis Preservation Framework 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; ...
import datetime from six import string_types from ._generalslice import OPEN_OPEN, CLOSED_CLOSED, OPEN_CLOSED, CLOSED_OPEN, GeneralSlice from ._parse import parse INTERVAL_LOOKUP = {(True, True): OPEN_OPEN, (False, False): CLOSED_CLOSED, (True, False): OPEN_CLOSED, ...
from tests.compat import unittest from boto.ec2.connection import EC2Connection from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping from tests.compat import OrderedDict from tests.unit import AWSMockServiceTestCase class BlockDeviceTypeTests(unittest.TestCase): def setUp(self): s...
#!/usr/bin/env python # 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 ma...
"""Add FailureReason Revision ID: 1c5907e309f1 Revises: 4a12e7f0159d Create Date: 2014-06-02 15:31:02.991394 """ # revision identifiers, used by Alembic. revision = '1c5907e309f1' down_revision = '4a12e7f0159d' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembi...
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Manages cached OAuth2 tokens used by other depot_tools scripts. Usage: depot-tools-auth login codereview.chromium.org depot-too...
# -*- coding: utf-8 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import os import sys import posixpath import mimetypes from itert...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
"""Add support for the Xiaomi TVs.""" import logging import pymitv import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity from homeassistant.components.media_player.const import ( SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_STEP, ) from homeassi...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # # 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. ...
import forms from flask import current_app as app from generic.editor import GenericEditor from bson import ObjectId class ConsumeEditor(GenericEditor): def __init__(self, *args, **kwargs): super(ConsumeEditor, self).__init__(*args, **kwargs) def _create_form(self, *args, **kwargs): return f...
#!/usr/bin/env python import contextlib import download import os import shutil import sys import tarfile if os.environ.get('BITS') == '32': host_bits = 'i686' extra_bits = 'x86_64' else: host_bits = 'x86_64' extra_bits = 'i686' extra = None libdir = 'lib' # Figure out our target triple if sys.platf...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [EMAIL], All rights reserved. # LLNL-CODE-647188 # # F...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
import logging from app import db from app.models import ContactGroup, ContactSubGroup, Gender, Contact import random from datetime import datetime log = logging.getLogger(__name__) def get_random_name(names_list, size=1): name_lst = [ names_list[random.randrange(0, len(names_list))].decode("utf-8").capi...