text
stringlengths
475
200k
''' ''' # 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");...
# base class for tk common dialogues # # this module provides a base class for accessing the common # dialogues available in Tk 4.2 and newer. use tkFileDialog, # tkColorChooser, and tkMessageBox to access the individual # dialogs. # # written by Fredrik Lundh, May 1997 # from Tkinter import * class Dialog: com...
from kivy.uix.widget import Widget class TreeException(Exception): pass class TreeNode(object): '''TreeNode class for representing information of Widgets ''' def __init__(self): super(TreeNode, self).__init__() self.parent_node = None self.list_children = [] self.cl...
""" cclib (http://cclib.sf.net) is (c) 2006, the cclib development team and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html). """ __revision__ = "$Revision: 837 $" import random import numpy from population import Population class LPA(Population): """The Lowdin population analysis""" def __...
# 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 (c) 2011 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 requi...
"""Creates a new instance with default configuration files this script creates a new instance with the default configuration files from the ``demo/config`` directory, asking the user for MySQL credentials, and also creating a temporary password that has to be used for first login """ import sys, ConfigParser, os, os....
# this is a virtual module that is entirely implemented server side # 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 op...
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible class MyFileField(models.FileField): pass @python_2_unicode_compatible class Member(models.Model): name = models.CharField(max_lengt...
#! /usr/bin/env python # encoding: utf-8 import os,re import TaskGen,Utils,Runner,Task,Build,Options,Logs import cc from Logs import error from TaskGen import taskgen,before,after,feature n1_regexp=re.compile('<refentrytitle>(.*)</refentrytitle>',re.M) n2_regexp=re.compile('<manvolnum>(.*)</manvolnum>',re.M) def posti...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chatham Financial <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
#!/usr/bin/env python import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='wedo', version='1.1.0', packages=find_packages(), install_requires=['pyusb'], zip_safe=False, include_package_data=...
# Copyright 2013 IBM Corp. # 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 app...
def my_function(): print "Hello From My Function!" def my_function_with_args(username, greeting): print "Hello, %s , From My Function!, I wish you %s"%(username, greeting) def sum_two_numbers(a, b): return a + b # print a simple greeting my_function() #prints - "Hello, John Doe, From My Function!, I wish...
#!/usr/bin/env python3 import sys import os from tkinter import * from idlelib.Percolator import Percolator from idlelib.ColorDelegator import ColorDelegator from idlelib.textView import view_file # TextViewer from imp import reload import turtle import time demo_dir = os.path.dirname(os.path.abspath(__file__)) STA...
from asposewords import Settings from com.aspose.words import Document from com.aspose.words import DocumentBuilder from com.aspose.words import HeaderFooterType from com.aspose.words import ControlChar from com.aspose.words import SectionStart from com.aspose.words import TabAlignment from com.aspose.words import TabL...
# Copyright 2011 James McCauley # # This file is part of POX. # # POX 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. # # POX is distri...
""" Middleware that profiles the request with cProfile and displays profiling information at the bottom of each page. """ import sys import os import threading import cgi import time from cStringIO import StringIO from paste import response try: # Included in Python 2.5 import cProfile except: try: ...
# 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, print_function) __metaclass__ = type import os import time from ansible import constants as C from ansible.executor.module_common import...
# coding: utf-8 # # This file is part of Progdupeupl. # # Progdupeupl 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 Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Progdu...
from django.core.files.uploadedfile import SimpleUploadedFile from pamietacz.models import Shelf, Deck, Card from test_utils import (add_shelf, add_deck, add_card, TransactionTestCaseWithAuthentication) class DumpLoadTests(TransactionTestCaseWith...
# 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...
# 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, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.c...
""" Read temperature information from Eddystone beacons. Your beacons must be configured to transmit UID (for identification) and TLM (for temperature) frames. """ import logging # pylint: disable=import-error from beacontools import BeaconScanner, EddystoneFilter, EddystoneTLMFrame import voluptuous as vol from hom...
""" Tests of ModelAdmin validation logic. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible class Album(models.Model): title = models.CharField(max_length=150) @python_2_unicode_compatible class Song(models.Model): title = models.CharField(max_length=150) al...
# encoding: utf-8 from setuptools import setup, find_packages, Command import sys, os version = '0.7.2' class Unit2Discover(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): import sys, subprocess basecmd...
# -*- coding: utf-8 -*- # Writer (c) 2019, dandy # Rev. 1.0.0 # Licence: GPL v.3: http://www.gnu.org/copyleft/gpl.html import xbmc import xbmcaddon import xbmcplugin import xbmcgui import XbmcHelpers as common import resources.lib.SearchHistory as history ID = 'script.module.dandy.search.history' ADDON = xbmcaddon....
#!/usr/bin/python2.6 import os import sys import Queue import threading from subprocess import Popen, PIPE, STDOUT import copy import time import re import logging class ExecutionError(Exception): pass class Shell: @classmethod def sh(cls, cmd, host=None, username=None): '''Execute a command locally or remot...
#!/usr/bin/python # # The intention of this Python script is to provide # MarkUs users with a tool which is able to generate HTTP's # GET, PUT, DELETE and POST requests. This may be handy for # users planning to use MarkUs' Web API. # ## DISCLAIMER # # This script is made available under the OSI-approved # MIT license...
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
from __future__ import unicode_literals import copy import datetime from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class RevisionableModel(models.Model): base = models.ForeignKey('self', models.S...
from test.test_support import TESTFN, run_unittest import os import wave import unittest nchannels = 2 sampwidth = 2 framerate = 8000 nframes = 100 class TestWave(unittest.TestCase): def setUp(self): self.f = None def tearDown(self): if self.f is not None: self.f.close() ...
# PermWrapper and PermLookupDict proxy the permissions system into objects that # the template system can understand. class PermLookupDict(object): def __init__(self, user, app_label): self.user, self.app_label = user, app_label def __repr__(self): return str(self.user.get_all_permissions()) ...
""" Block Structure Transformer Registry implemented using the platform's PluginManager. """ from base64 import b64encode from hashlib import sha1 import six from openedx.core.lib.cache_utils import process_cached from openedx.core.lib.plugins import PluginManager class TransformerRegistry(PluginManager): """...
# # Copyright (C) 2019 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV 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 hope...
#!/usr/bin/env python import sys import serial import time print('Opening port') arduino = serial.Serial('/dev/ttyACM0', 115200, timeout=1, dsrdtr=False) time.sleep(3) print('Flushing the buffer') arduino.readline() def a2s(arr): """ Array of integer byte values --> binary string """ return ''.join(chr(b...
import sys import re import functools import distutils.core import distutils.errors import distutils.extension from .dist import _get_unpatched from . import msvc9_support _Extension = _get_unpatched(distutils.core.Extension) msvc9_support.patch_for_specialized_compiler() def have_pyrex(): """ Return True i...
# Copyright (c) 2015-2021 Vector 35 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 limitation the # rights to use, copy, modify, merge, publish, ...
import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request class MassMailController(http.Controller): @http.route('/mail/track/<int:mail_id>/blank.gif', type='http', auth='none') def track_mail_open(self, mail_id, **post): """ Email tracking. """ mail_mail_stats...
# Test some Unicode file name semantics # We dont test many operations on files other than # that their names can be used with Unicode characters. import os, glob, time, shutil import unicodedata import unittest from test.test_support import run_unittest, TESTFN_UNICODE from test.test_support import TESTFN_ENCODING, T...
#!/usr/bin/python # 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. import collections import hashlib import operator import os import re import sys RESOURCE_EXTRACT_REGEX = re.compile('^#define (\S*) (\d*...
import os import sys from setuptools import setup, find_packages version = '0.1.5' def read(f): return open(os.path.join(os.path.dirname(__file__), f)).read().strip() setup(name='android-resource-remover', version=version, description=('Android resource remover'), long_description='\n\n'.join...
import unittest from collections import namedtuple from Vintageous.vi.utils import modes from Vintageous.tests import set_text from Vintageous.tests import add_sel from Vintageous.tests import get_sel from Vintageous.tests import first_sel from Vintageous.tests import ViewTest def get_text(test): return test.vi...
# 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 applicable ...
from django.shortcuts import render, Http404 from blog.models import * from django.contrib.auth.decorators import login_required def user_or_challenger(request): user_id = request.user.id chexist = False uexist = False try: user = User.objects.get(id=user_id) uexist = True try:...
# $Id: tables.py 6107 2009-08-31 02:29:08Z goodger $ # Authors: David Goodger <[EMAIL]>; David Priest # Copyright: This module has been placed in the public domain. """ Directives for table elements. """ __docformat__ = 'reStructuredText' import sys import os.path import csv from docutils import io, nodes, statema...
#!/usr/bin/env python import json import config import sys import re from flask_cors import CORS from gevent.pywsgi import WSGIServer from flask import Flask, request from werkzeug.exceptions import NotFound, Unauthorized, BadRequest from models import * app = Flask(__name__) app.debug = True app.config['CORS_HEADERS'...
#!/usr/bin/python # -*- coding: utf-8 -*- import gobject import gtk import pango import re import os import keybinder import logging import time import pynotify import ConfigParser import multiprocessing import cover import config UI_FILE = "data/player.ui" class player: def __init__(self, xmms): se...
# 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 django.core.mail import EmailMessage from django.template.loader import render_to_string from django.utils.decorato...
# # (c) 2016 Red Hat Inc. # # (c) 2017 Dell EMC. # # 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 ve...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2009 Gary Burton # Copyright (C) 2011 Tim G L Lyons # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
import os from twisted.python.failure import Failure from twisted.internet import defer, reactor, protocol, error from twisted.protocols.basic import LineOnlyReceiver class FakeTransport: disconnecting = False class BuildmasterTimeoutError(Exception): pass class BuildslaveTimeoutError(Exception): pass cl...
# Authors: Alexandre Gramfort <[EMAIL]> # Mathieu Blondel <[EMAIL]> # Olivier Grisel <[EMAIL]> # Andreas Mueller <[EMAIL]> # Eric Martin <[EMAIL]> # Giorgio Patrini <[EMAIL]> # License: BSD 3 clause import numbers import warnings from itertools import chain, combinations i...
#!/usr/bin/env python from nose.tools import * from nose import SkipTest from nose.plugins.attrib import attr import networkx # Example from # A. Langville and C. Meyer, "A survey of eigenvector methods of web # information retrieval." http://citeseer.ist.psu.edu/713792.html class TestHITS: def setUp(self): ...
# -*- coding: utf-8 -*- # try: import xbmcaddon __settings__ = xbmcaddon.Addon("script.myshows") __myshows__ = xbmcaddon.Addon("plugin.video.myshows") try: debug = __myshows__.getSetting("debug") except: debug = __settings__.getSetting("debug") except: debug='true' def Log(msg,...
import logging, time, os, signal from autotest.client.shared import error from virttest import utils_test def run_timedrift_with_stop(test, params, env): """ Time drift test with stop/continue the guest: 1) Log into a guest. 2) Take a time reading from the guest and host. 3) Stop the running of t...
# Copyright (c) 2012 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. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
""" Course Advanced Settings page """ from bok_choy.promise import EmptyPromise from common.test.acceptance.pages.studio.course_page import CoursePage from common.test.acceptance.pages.studio.utils import ( get_codemirror_value, press_the_notification_button, type_in_codemirror ) KEY_CSS = '.key h3.title...
''' Created on Jun 4, 2011 @author: mkiyer chimerascan: chimeric transcript discovery using RNA-seq Copyright (C) 2011 Matthew Iyer 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 ...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- """ A collection is a...
#!/usr/bin/env python # # Used for quickly measuring how long the solver takes to run. # # Hazen 08/19 # import numpy import pycuda.autoinit import pycuda.driver as drv from pycuda.compiler import SourceModule import time # python3 and C NCS reference version. import pyCNCS.ncs_c as ncsC # OpenCL version (for the OTF...
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation # # 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 ...
import os import unittest from conans.paths import (BUILD_FOLDER, PACKAGES_FOLDER, EXPORT_FOLDER, SimplePaths, CONANINFO) from conans.model.ref import ConanFileReference from conans.test.utils.test_files import temp_folder from conans.search.search import DiskSearchManager, DiskSearchAdapter from conans.util.files impo...
import copy import pickle from random import shuffle import unittest from collections import OrderedDict from collections import MutableMapping from test import mapping_tests, test_support class TestOrderedDict(unittest.TestCase): def test_init(self): with self.assertRaises(TypeError): Ordere...
# Copyright 2009 The Closure Library 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 a...
"""Defines access permissions for the API.""" from __future__ import absolute_import from rest_framework import permissions from readthedocs.core.permissions import AdminPermission class IsOwner(permissions.BasePermission): """Custom permission to only allow owners of an object to edit it.""" def has_obj...
#! /usr/bin/env python # xxci # # check in files for which rcsdiff returns nonzero exit status import sys import os from stat import * import fnmatch EXECMAGIC = '\001\140\000\010' MAXSIZE = 200*1024 # Files this big must be binaries and are skipped. def getargs(): args = sys.argv[1:] if args: retu...
# Copyright (C) 2009 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 f...
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) response.headers.set("Content...
import cherrypy # 這是 MAN 類別的定義 ''' # 在 application 中導入子模組 import programs.cdag1.remsub6 as cdag1_remsub6 # 加入 cdag1 模組下的 remsub6.py 且以子模組 remsub6 對應其 remsub6() 類別 root.cdag1.remsub6 = cdag1_remsub6.remsub6() # 完成設定後, 可以利用 /cdag1/remsub6 # 呼叫 man.py 中 MAN 類別的 assembly 方法 ''' class remsub6(object): # 各組利用 index 引...
# -*- coding: UTF-8 -*- """ win32timezone: Module for handling datetime.tzinfo time zones using the windows registry for time zone information. The time zone names are dependent on the registry entries defined by the operating system. This module may be tested using the doctest module. Written by Jason R. Coombs...
# -*- coding: iso-8859-1 -*- # Copyright (C) 2000-2014 Bastian Kleineidam # # 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 versi...
# -*- coding: utf-8 -*- """ Copyright (c) 2003-2005 Gustavo Niemeyer <[EMAIL]> This module offers extensions to the standard Python datetime module. """ from dateutil.tz import tzfile from tarfile import TarFile import os __author__ = "Tomi Pieviläinen <[EMAIL]>" __license__ = "Simplified BSD" __all__ = ["setcaches...
#!/usr/bin/python # Copyright 2007-2010 Mike Perry. See LICENSE file. """ Support classes for path construction The PathSupport package builds on top of TorCtl.TorCtl. It provides a number of interfaces that make path construction easier. The inheritance diagram for event handling is as follows: TorCtl.EventHandler ...
# -*- coding: utf-8 -*- # # Group off # Copyright © 2020 Dave Hocker # # 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, version 3 of the License. # # See the LICENSE file for more details. # fr...
# from https://gist.github.com/jalavik/976294 # original XML at http://www.w3.org/Math/characters/unicode.xml # XSL for conversion: https://gist.github.com/798546 unicode_to_latex = { u"\u0020": "\\space ", u"\u0023": "\\#", u"\u0024": "\\textdollar ", u"\u0025": "\\%", u"\u0026": "\\&amp;", u...
#!/usr/bin/env python # Copyright (c) 2001 actzero, inc. All rights reserved. import sys sys.path.insert(1, "..") from SOAPpy import * from SOAPpy import Parser # Uncomment to see outgoing HTTP headers and SOAP and incoming #Config.debug = 1 if len(sys.argv) > 1 and sys.argv[1] == '-s': server = SOAPProxy("ht...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# Copyright (c) 2012 The Chromium OS Authors. # # See file CREDITS for list of people who contributed to this # project. # # 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 # t...
# 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 requ...
"""Here lies still breathing and only renderer implementation.""" from docutils.parsers.rst import directives from . import abc from .. import openapi20, openapi30, utils class HttpdomainOldRenderer(abc.RestructuredTextRenderer): option_spec = { # A list of endpoints to be rendered. Endpoints must be w...
# pylint: skip-file # flake8: noqa # pylint: disable=too-many-instance-attributes class OCProcess(OpenShiftCLI): ''' Class to wrap the oc command line tools ''' # pylint allows 5. we need 6 # pylint: disable=too-many-arguments def __init__(self, namespace, tname=None...
#!/usr/bin/env python import sys def gen_test(n): print "CREATE TABLE t (a CHAR(%d));" % (n) for v in [ 'hi', 'there', 'people' ]: print "INSERT INTO t VALUES ('%s');" % (v) for i in range(2,256): if i < n: print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/" print "--e...
from .functions import defun, defun_wrapped @defun_wrapped def _erf_complex(ctx, z): z2 = ctx.square_exp_arg(z, -1) #z2 = -z**2 v = (2/ctx.sqrt(ctx.pi))*z * ctx.hyp1f1((1,2),(3,2), z2) if not ctx._re(z): v = ctx._im(v)*ctx.j return v @defun_wrapped def _erfc_complex(ctx, z): if ctx.re(...
# 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...
from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises import boto import boto3 from boto.exception import EC2ResponseError import sure # noqa from moto import mock_ec2_deprecated, mock_ec2 @mo...
#!/usr/bin/python # ----------------------------------------------------------- # demonstrates how to work with commandline arguments using # docopt (http://docopt.org/) # # example fileinfo program # based my blog post here: # http://www.stackabuse.com/python-list-files-in-a-directory/ #o # (C) 2017 Frank Hofmann, B...
# (c) 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. # # A...
""" Contains structural classes ie binary, star, planet etc which mimic the xml structure with objects """ import sys import math from pkg_resources import resource_stream import logging import numpy as np import astropy.coordinates import astropy.units as u from . import equations as eq from . import astroquantities...
import os import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('../../')) sys.path.inser...
"""Various utility functions.""" from collections import namedtuple, OrderedDict __unittest = True _MAX_LENGTH = 80 def safe_repr(obj, short=False): try: result = repr(obj) except Exception: result = object.__repr__(obj) if not short or len(result) < _MAX_LENGTH: return result ...
import contextlib import difflib import pprint import pickle import re import sys import logging import warnings import weakref import inspect from copy import deepcopy from test import support import unittest from unittest.test.support import ( TestEquality, TestHashing, LoggingResult, LegacyLoggingResult, ...
#!/usr/bin/python2 import os import sys import traceback import fcntl from xml.dom import minidom try: # 3.0 compat import libvirtconnection libvirtconnection except ImportError: # 3.1 compat from vdsm import libvirtconnection ''' Placed in before_vm_migrate_destination vmfex hook on migration de...
#!/usr/bin/env python # coding UTF-8 # Copyright 2013 Constantin Kulikov # # Author: Constantin Kulikov (Bad_ptr) <[EMAIL]> # Date: 2013/06/21 11:21:11 # License: GPL either version 2 or any later version import sys def SetRecursionLimit(n=5000): sys.setrecursionlimit(n) def _or(smth, defv): if None is sm...
import tempfile from pele.systems import AtomicCluster from pele.potentials import LJ from pele.utils.xyz import write_xyz __all__ = ["LJCluster"] class LJCluster(AtomicCluster): """ define the System class for a Lennard-Jones cluster Parameters ---------- natoms : int See Also ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from decimal import Decimal, localcontext from unittest import expectedFailure from django.template.defaultfilters import floatformat from django.test import SimpleTestCase from django.utils import six from django.utils.safestring import mark_safe from ...
""" ****** Layout ****** Node positioning algorithms for graph drawing. """ # Copyright (C) 2004-2015 by # Aric Hagberg <[EMAIL]> # Dan Schult <[EMAIL]> # Pieter Swart <[EMAIL]> # All rights reserved. # BSD license. import collections import networkx as nx __author__ = """Aric Hagberg ([EMAIL])\nDan ...
#!/usr/bin/env python ########################################################################## # # Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files ...
from django.db.backends.base.features import BaseDatabaseFeatures from django.db.utils import InterfaceError try: import pytz except ImportError: pytz = None class DatabaseFeatures(BaseDatabaseFeatures): empty_fetchmany_value = () interprets_empty_strings_as_nulls = True uses_savepoints = True ...