content
stringlengths
4
20k
from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.models import NOT_PROVIDED class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s" sql_alter_column_null = "MODIFY %(column)s %(type)s NULL" sql_alter_column_...
#encoding=utf8 ''' Created on 2014��5��7�� @author: cc ''' import traceback from my_test import print_to_file import urllib2 from StringIO import StringIO import gzip try: import threading import re import time from lxml import etree # @UnresolvedImport import requests # @UnresolvedImport imp...
"""File wrangling.""" from coverage.backward import to_string from coverage.misc import CoverageException import fnmatch, os, os.path, re, sys import ntpath, posixpath class FileLocator(object): """Understand how filenames work.""" def __init__(self): # The absolute path to our current directory. ...
import json import logging from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_variables # noqa from oslo_utils import strutils import six from horizon import exceptions from horizon import forms from horizon import messages from openstack_dashboard import ap...
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from resources.datatables import FactionStatus from java.util import Vector def addTemplate(cor...
from django.db.backends.mysql.base import DatabaseOperations from django.contrib.gis.db.backends.adapter import WKTAdapter from django.contrib.gis.db.backends.base import BaseSpatialOperations class MySQLOperations(DatabaseOperations, BaseSpatialOperations): compiler_module = 'django.contrib.gis.db.backends.mys...
import xml.sax from boto.compat import StringIO class XmlHandler(xml.sax.ContentHandler): def __init__(self, root_node, connection): self.connection = connection self.nodes = [('root', root_node)] self.current_text = '' def startElement(self, name, attrs): self.current_text ...
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import getpass import argparse import re import uuid import os import json from datetime import datetime, timedelta from . import config from exceptions import APIKeyException def parse_unicode(bytestring): decoded_string = bytestring.decode(sys.getfilesystem...
# -*- coding: utf-8 -*- """ tablib.compat ~~~~~~~~~~~~~ Tablib compatiblity module. """ import sys is_py3 = (sys.version_info[0] > 2) try: from collections import OrderedDict except ImportError: from tablib.packages.ordereddict import OrderedDict if is_py3: from io import BytesIO import tablib...
#!/usr/bin/python # QUCS->Python+pylab converter ver.1.0 # Public domain code, writter by Wojciech M. Zabolotny # ( wzab<at>ise.pw.edu.pl ) 20.01.2009 import sys import pylab class qucs_dep_var: def __init__(this,vals,ind_vars): this.val=vals this.ind_vars=ind_vars class qucs_data: def __init__(this,fname=...
"""Tests for common shapes.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import common_shapes from tensorflow.python.framework import tensor_shape from tensorflow.python.framework import test_util fr...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.bin.options_initializer import OptionsInitializer from pants.build_graph.intermediate_target_factory import IntermediateTargetFactoryBase from pants.goal.go...
import sys, os import argparse import mxnet as mx import numpy as np import logging import symbol_fcnxs import init_fcnxs from data import FileIter from solver import Solver logger = logging.getLogger() logger.setLevel(logging.INFO) ctx = mx.gpu(0) def main(): fcnxs = symbol_fcnxs.get_fcn32s_symbol(numclass=21, w...
from color import Coloring from command import PagedCommand class Prune(PagedCommand): common = True helpSummary = "Prune (delete) already merged topics" helpUsage = """ %prog [<project>...] """ def Execute(self, opt, args): all = [] for project in self.GetProjects(args): all.extend(project.Prun...
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.pycompat24 import get_exception try: import ldap import ldap.modlist import ldap.sasl HAS_LDAP = True except ImportError: HAS_LDAP = False class LdapEntry(object): def __init__(self, module): # Shortcuts ...
#!/usr/bin/env python import sys, os, pwd, grp, signal, time from resource_management import * from resource_management.core.exceptions import Fail from resource_management.core.logger import Logger from resource_management.core.resources.system import Execute, Directory, File from resource_management.core.shell import...
#!/usr/bin/env python """ @package mi.idk.test.test_result_set @file mi.idk/test/test_result_set.py @author Bill French @brief Read a result set file and test the verification methods """ __author__ = 'Bill French' __license__ = 'Apache 2.0' import os import re from nose.plugins.attrib import attr from mock import ...
from __future__ import absolute_import, division, unicode_literals import os import sys import unittest import warnings from difflib import unified_diff try: unittest.TestCase.assertEqual except AttributeError: unittest.TestCase.assertEqual = unittest.TestCase.assertEquals from .support import get_data_files...
#!/usr/bin/env python """ FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2008 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http:...
import os import unittest from pathlib import Path from monty.serialization import dumpfn, loadfn from pymatgen.core.periodic_table import Element from pymatgen.entries.entry_tools import EntrySet, group_entries_by_structure from pymatgen.util.testing import PymatgenTest class FuncTest(unittest.TestCase): def t...
import sys from StringIO import StringIO from django.core import management from django.core.management.base import CommandError from django.test import TestCase from django.utils import translation class CommandTests(TestCase): def test_command(self): out = StringIO() management.call_command('da...
from __future__ import absolute_import from functools import update_wrapper from django.db import connection from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature from .models import Reporter, Article # # The introspection module is optional, so methods tested here might raise # NotImplementedError...
import operator from ..sql import operators class UnevaluatableError(Exception): pass _straight_ops = set(getattr(operators, op) for op in ('add', 'mul', 'sub', 'div', 'mod', 'truediv', 'lt', 'le', ...
""" flexx.ui client serving a web page using Tornado. """ import sys import os import logging import urllib import traceback import tornado.web import tornado.websocket from ..webruntime.common import default_icon from .proxy import manager, call_later from .clientcode import clientCode THIS_DIR = os.path.abspath(...
import survey import wizard import report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
"""Common code used for testing `Predictor`s.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.learn.python.learn.estimators import constants from tensorflow.contrib.learn.python.learn.estimators import estimator as contrib_estimat...
""" Verifies build of a static_library with the standalone_static_library flag set. """ import os import subprocess import sys import TestGyp test = TestGyp.TestGyp() # Verify that types other than static_library cause a failure. test.run_gyp('invalid.gyp', status=1, stderr=None) target_str = 'invalid.gyp:bad#target...
""" Django settings for rendering_resource_manager_service project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os....
# -*- coding: utf-8 -*- import time class Msg(object): def __init__(self): pass def send(self): return "success" class TextMsg(Msg): def __init__(self, toUserName, fromUserName, content): self.__dict = dict() self.__dict['ToUserName'] = toUserName self.__dict['FromUserName'] = fromUserName ...
# -*- coding: utf-8 -*- """ A Theil-Sen Estimator for Multiple Linear Regression Model """ # # License: BSD 3 clause from __future__ import division, print_function, absolute_import import warnings from itertools import combinations import numpy as np from scipy import linalg from scipy.special import binom from sc...
import numpy as np import mxnet as mx, math import argparse, math import logging from data import Corpus, CorpusIter from model import * from module import * from mxnet.model import BatchEndParam parser = argparse.ArgumentParser(description='PennTreeBank LSTM Language Model') parser.add_argument('--data', type=str, de...
"""Dataset sampler.""" __all__ = ['Sampler', 'SequentialSampler', 'RandomSampler', 'BatchSampler'] import random class Sampler(object): """Base class for samplers. All samplers should subclass `Sampler` and define `__iter__` and `__len__` methods. """ def __iter__(self): raise NotImplemen...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} import re try: from BeautifulSoup import BeautifulSoup except ImportError: HAS_BEAUTIFULSOUP = False else: HAS_BEAUTIFULSOUP = True # balancer member attributes extraction reg...
"""Enhance nose with extra options and behaviors for running SQLAlchemy tests. Must be run via ./sqla_nose.py so that it is imported in the expected way (e.g. as a package-less import). """ try: # installed by bootstrap.py import sqla_plugin_base as plugin_base except ImportError: # assume we're a packag...
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <<EMAIL>>' __docformat__ = 'restructuredtext en' from functools import partial import textwrap from collections import OrderedDict from calibre.gui2.preferences import ConfigWidgetBas...
import frappe def execute(): frappe.reload_doctype('Salary Slip', 'Salary Component') salary_components = [['Arrear', "ARR"], ['Leave Encashment', 'LENC']] for salary_component, salary_abbr in salary_components: if not frappe.db.exists('Salary Component', salary_component): sal_comp = frappe.get_doc({ "doc...
#!/usr/bin/env python #output a pdb file of just the residues between the membrane barrier import string import sys import comparePaths import os import pdb import geometry def getJustMembranePdb(inputFileName, outputFileName): pdbBarriers = pdb.pdbData(inputFileName) #get the barriers read in and defined barr...
import webnotes, unittest class TimeLogBatchTest(unittest.TestCase): def test_time_log_status(self): from projects.doctype.time_log.test_time_log import test_records as time_log_records time_log = webnotes.bean(copy=time_log_records[0]) time_log.doc.fields.update({ "from_time": "2013-01-02 10:00:00", "to_...
from unittest import mock from testtools.matchers import Contains, Equals from snapcraft.integrations import travis from . import CommandBaseTestCase class EnableCITestCase(CommandBaseTestCase): def test_enable_ci_empty(self): result = self.run_command(['enable-ci']) self.assertThat(result.exi...
import threading import time import cherrypy import libvirt from kimchi.utils import kimchi_log class LibvirtConnection(object): _connections = {} _connectionLock = threading.Lock() def __init__(self, uri): self.uri = uri if self.uri not in LibvirtConnection._connections: Li...
# -*- coding: utf-8 -*- import gpxpy import gpxpy.gpx import json import time from pokemongo_bot.base_task import BaseTask from pokemongo_bot.cell_workers.utils import distance, i2f, format_dist from pokemongo_bot.human_behaviour import sleep from pokemongo_bot.walkers.walker_factory import walker_factory from pokemon...
# -*- coding: utf-8 -*- from datetime import datetime, date from dateutil.parser import parse from dateutil.tz import tzutc import pyproj from wms.utils import DotDict, split from wms import logger def get_bbox(request): """ Return the [lonmin, latmin, lonmax, lonmax] - [lower (x,y), upper(x,y)] Units ...
#!/usr/bin/env python # coding:utf-8 import sys, os from twisted.internet import reactor from bottle import Bottle from bottle import request from bottle import response from bottle import redirect from bottle import static_file from bottle import abort from hashlib import md5 from urlparse import urljoin from toughrad...
""" Contains classes for transport options. """ from suds.transport import * from suds.properties import * class Options(Skin): """ Options: - B{proxy} - An http proxy to be specified on requests. The proxy is defined as {protocol:proxy,} - type: I{dict} ...
# coding: utf-8 from __future__ import unicode_literals import re import time import hmac import binascii import hashlib from .once import OnceIE from .adobepass import AdobePassIE from ..compat import ( compat_parse_qs, compat_urllib_parse_urlparse, ) from ..utils import ( determine_ext, ExtractorEr...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} try: import os import tower_cli import tower_cli.utils.exceptions as exc from tower_cli.conf import settings from ansible.module_utils.ansible_tower import to...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, sanitized_Request, std_headers, urlencode_postdata, update_url_query, ) class SafariBaseIE(InfoExtractor): _LOGIN_URL = 'https://www.safaribooksonline.co...
from django.db import models from django.urls import reverse from django.contrib.auth import get_user_model from django.conf import settings from django.utils.text import slugify from wypok.validators import FileValidator from wypok.utils.markup import markup from sections.validators import section_name_validator de...
from __future__ import (absolute_import, division) __metaclass__ = type import sys import time import pytest from ansible.module_utils.facts import timeout @pytest.fixture def set_gather_timeout_higher(): default_timeout = timeout.GATHER_TIMEOUT timeout.GATHER_TIMEOUT = 5 yield timeout.GATHER_TIMEO...
import os import re import sys from lettuce import core from lettuce import strings from lettuce import terminal from lettuce.terrain import after from lettuce.terrain import before from lettuce.terrain import world def wrt(what): if isinstance(what, unicode): what = what.encode('utf-8') sys.stdout....
import operator from ..util import decorator from . import config from .. import util import inspect import contextlib from sqlalchemy.util.compat import inspect_getargspec def skip_if(predicate, reason=None): rule = compound() pred = _as_predicate(predicate, reason) rule.skips.add(pred) return rule ...
from BrickPi import * #Generic (functional) API for brickpi operations #Originally created: June.13.2015 # NO_SENSOR = -1 def setup(sensor1 = NO_SENSOR, sensor2 = NO_SENSOR, sensor3 = NO_SENSOR, sensor4 = NO_SENSOR): BrickPiSetup() if(sensor1 != NO_SENSOR): BrickPi.SensorType[PORT_1] = sensor1 if(s...
from __future__ import unicode_literals import frappe def get_notification_config(): return { "for_doctype": { "Support Ticket": {"status":"Open"}, "Customer Issue": {"status":"Open"}, "Task": {"status":"Open"}, "Lead": {"status":"Open"}, "Contact": {"status":"Open"}, "Opportunity": {"docstatus":...
import os import bpy import json import pprint D = bpy.data C = bpy.context file = D.filepath file = os.path.split( file )[1] file = file.split('.')[0] vrscene_directory = '//vraymaterials/{0}/'.format(file) print (file) material_tree = {} files2open = [] material_tree_file = os.path.join(os.path.split(D.filepath...
import pytest from msibi.optimize import MSIBI from msibi.tests.test_pair import init_state n_bins = 151 def test_msibi_init_single_cutoff(): opt = MSIBI(2.5, n_bins) assert opt.pot_cutoff == opt.rdf_cutoff assert opt.n_rdf_points == n_bins assert opt.rdf_n_bins == n_bins assert opt.r_switch == ...
from core.logger import Logger import time class MappingDal(object): def __init__(self, connection_pool): self.logger = Logger(self.__class__.__name__).get() self.connection_pool = connection_pool def style_family_mapping_exists(self, style_id, family_id): mapping_id = self.get_style_...
from csv import writer from optparse import make_option from sys import stdout import six from django.contrib.auth.models import Group from django.core.management.base import BaseCommand, CommandError from django_extensions.compat import get_user_model from django_extensions.management.utils import signalcommand FOR...
import os def cleanup(filename): if os.path.exists(filename): os.remove(filename) if __name__ == "__main__": cleanup("tokens.txt") cleanup("results.csv")
import logging.config import os import warnings import sys import traceback EXT_STDERR = 'ext://stderr' DEFAULT_FORMATTER = logging.Formatter( '%(asctime)s.%(msecs)03d %(name)-6s %(levelname)-8s %(message)s', '%b %d %H:%M:%S') STDERR_HANDLER = logging.StreamHandler(sys.stderr) STDERR_HANDLER.setFormatter(DEF...
"""Partial dependence plots for tree ensembles. """ # Authors: Peter Prettenhofer # License: BSD 3 clause from itertools import count import numbers import numpy as np from scipy.stats.mstats import mquantiles from ..utils.extmath import cartesian from ..externals.joblib import Parallel, delayed from ..externals im...
import mock from olympia.amo.tests import TestCase from olympia.users.models import UserProfile from ..models import APIKey, SYMMETRIC_JWT_TYPE class TestAPIKey(TestCase): fixtures = ['base/addon_3615', 'base/users'] def setUp(self): super(TestAPIKey, self).setUp() self.user = UserProfile.o...
#!/usr/bin/env python '''Testing mouse interaction The cell the mouse is hovering over should highlight in red. Clicking in a cell should highliht that cell green. Clicking again will clear the highlighting. Clicking on the ball sprite should highlight it and not underlying cells. You may press the arrow keys to s...
""" Various utility functions """ from __future__ import print_function import traceback import struct import sys import os import time import socket #FIXME: ugh, why can't I make importing pox.core work here? import logging log = logging.getLogger("util") class DirtyList (list): #TODO: right now the callback ma...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('comm', '0025_auto_20150224_1330'), ] operations = [ migrations.AlterModelOptions( name='branch', opt...
from setuptools import setup, find_packages NAME = "autorestazurespecialparameterstestclient" VERSION = "2015-07-01-preview" # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools REQUIRES = ["msrestazure>=0.4.7"] setup( name...
#!/usr/bin/env python """rna_filter.py - calculate distances based on given restrants on PDB files or SimRNA trajectories. Changes: weight is always 1 (at least for now). ,>,=,>=,<= . [PREVIOUS DOCUMENTATION - TO BE REMOVED] rna_filter.py -s 4gxy_rpr.pdb -r rp06_MohPairs.rfrestrs d:A5-A42 100.0 measured: 26...
from django.contrib.gis.gdal.error import OGRException from django.utils import six #### OGRGeomType #### class OGRGeomType(object): "Encapulates OGR Geometry Types." wkb25bit = -2147483648 # Dictionary of acceptable OGRwkbGeometryType s and their string names. _types = {0 : 'Unknown', ...
import json from eve.utils import ParsedRequest import superdesk import logging from copy import deepcopy from flask import current_app as app from superdesk import get_resource_service, config from superdesk.errors import SuperdeskApiError from superdesk.media.media_operations import crop_image, process_file_from_st...
""" An auto-completion window for IDLE, used by the AutoComplete extension """ from Tkinter import * from idlelib.MultiCall import MC_SHIFT from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>" HIDE_SEQUENCES = ("<FocusOut>", "<ButtonPress>") KEYPR...
import os import struct import logging from primitives import * from constants import * from astypes import MalformedFLV from astypes import get_script_data_variable, make_script_data_variable log = logging.getLogger('flvlib.tags') STRICT_PARSING = False def strict_parser(): return globals()['STRICT_PARSING'] ...
""" YAML serializer. Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__. """ from StringIO import StringIO import yaml from django.db import models from django.core.serializers.python import Serializer as PythonSerializer from django.core.serializers.python import Deserializer as PythonDeserial...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Ftrace built-in backend. """ __author__ = "Eiichi Tsukata <<EMAIL>>" __copyright__ = "Copyright (C) 2013 Hitachi, Ltd." __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "<EMAIL>" from tr...
from os.path import join from jsonpickle import encode, set_encoder_options import codecs def produce_json (filename, data, compact = True): """Produce JSON content (data) into a file (filename). Parameters ---------- filename: string Name of file to write the content. data: any Con...
# -*- coding: utf-8 -*- import classes.level_controller as lc import classes.game_driver as gd import classes.extras as ex import classes.simple_vector as sv import pygame import copy import classes.board import random from math import pi,cos,acos,sin,asin,sqrt class Board(gd.BoardGame): def __init__(self, mainl...
"""Utility functions shared amongst the Windows generators.""" import copy import os _TARGET_TYPE_EXT = { 'executable': '.exe', 'shared_library': '.dll' } def _GetLargePdbShimCcPath(): """Returns the path of the large_pdb_shim.cc file.""" this_dir = os.path.abspath(os.path.dirname(__file__)) src_dir = os...
import glob import json import os import pipes import shutil import subprocess import sys script_dir = os.path.dirname(os.path.realpath(__file__)) chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) SRC_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.join(chr...
"""Checks for proguard configuration rules that cannot be combined across libs. The only valid proguard arguments for a library are -keep, -assumenosideeffects, and -dontnote and -dontwarn and -checkdiscard when they are provided with arguments. """ import re import sys from third_party.py import gflags gflags.DEFI...
"""The choreographer for awaiting books.""" import asyncio from math import ceil from itertools import chain class Choreographer: """Choreograph for awaiting books.""" def __init__(self, config, loop, aname_to_runners): """Prepare this choreographer.""" self.loop = loop self.total_...
"""Config options available for the CloudStack metadata service.""" from oslo_config import cfg from cloudbaseinit.conf import base as conf_base class CloudStackOptions(conf_base.Options): """Config options available for the CloudStack metadata service.""" def __init__(self, config): super(CloudSt...
# -*- 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): # Deleting model 'TaskResult' db.delete_table(u'grabstat_taskresult') # Adding model 'Task' ...
from __future__ import division import sys import cvxopt import numpy as np from pylab import * import math from cvxpy import * # Taken from CVX website http://cvxr.com/cvx/examples/ # Figure 6.2: Penalty function approximation # Ported from cvx matlab to cvxpy by Misrab Faizullah-Khan # Original comments below # S...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['deprecated'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native try: import pan.xapi from pan.xapi import PanXapiError HAS_LI...
""" Python interface to contents of doxygen xml documentation. Example use: See the contents of the example folder for the C++ and doxygen-generated xml used in this example. >>> # Parse the doxygen docs. >>> import os >>> this_dir = os.path.dirname(globals()['__file__']) >>> xml_path = this_dir + "/example/xml/" >>>...
import logging import os import sys from django.conf import settings from django.core.management.base import BaseCommand from django.test.utils import get_runner class Command(BaseCommand): help = 'Discover and run tests in the specified modules or the current directory.' requires_system_checks = False ...
import argparse import json import os import jsone import yaml here = os.path.dirname(__file__) root = os.path.abspath(os.path.join(here, "..", "..")) def create_parser(): return argparse.ArgumentParser() def run(venv, **kwargs): with open(os.path.join(root, ".taskcluster.yml")) as f: template = y...
""" Scrapy - a web crawling and web scraping framework written for Python """ __all__ = ['__version__', 'version_info', 'optional_features', 'twisted_version', 'Spider', 'Request', 'FormRequest', 'Selector', 'Item', 'Field'] # Scrapy version import pkgutil __version__ = pkgutil.get_data(__package__, 'VERSI...
from spack import * class PerlMathMatrixreal(PerlPackage): """Implements the data type "matrix of real numbers" (and consequently also "vector of real numbers").""" homepage = "http://search.cpan.org/~leto/Math-MatrixReal/lib/Math/MatrixReal.pm" url = "http://search.cpan.org/CPAN/authors/id/L/LE...
#!/usr/bin/env python ''' Add git hashes to .px4 file for PX4/Pixhawk build Written by Jon Challinger January 2015 ''' import json import sys import os import subprocess import argparse parser = argparse.ArgumentParser() parser.add_argument('input_file') parser.add_argument('output_file') parser.add_argument('--ard...
from FIAT import finite_element, polynomial_set, dual_set, functional def _initialize_entity_ids(topology): entity_ids = {} for (i, entity) in list(topology.items()): entity_ids[i] = {} for j in entity: entity_ids[i][j] = [] return entity_ids class CrouzeixRaviartDualSet(dual...
from msrest.serialization import Model class StorageQueueMessage(Model): """StorageQueueMessage. :param storage_account: Gets or sets the storage account name. :type storage_account: str :param queue_name: Gets or sets the queue name. :type queue_name: str :param sas_token: Gets or sets the S...
""" This module contains experimental code for using the (extend) UHSDR API 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 License, or (at your option) any later version. Th...
import datetime from haystack import indexes from celery_haystack.indexes import CelerySearchIndex from models import Question, Answer class AnswerIndex(CelerySearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) author = indexes.CharField(model_attr='author') created_...
"""EasyEngine shell executaion functions.""" from ee.core.logging import Log import os import sys import subprocess class CommandExecutionError(Exception): """custom Exception for command execution""" pass class EEShellExec(): """Method to run shell commands""" def __init__(): pass def ...
import time from collections import defaultdict from openerp import pooler from openerp.report import report_sxw class report_rappel(report_sxw.rml_parse): _name = "account_followup.report.rappel" def __init__(self, cr, uid, name, context=None): super(report_rappel, self).__init__(cr, uid, name, cont...
#!/usr/bin/env python """ @package mi.dataset.parser.wfp_eng__stc_imodem_particles @file marine-integrations/mi/dataset/parser/wfp_eng__stc_imodem_particles.py @author Mark Worden @brief Particles for the WFP_ENG__STC_IMODEM dataset driver Release notes: initial release """ __author__ = 'Mark Worden' __...
from oslo_db import exception as db_exc from oslo_log import log as logging from sqlalchemy import func import sqlalchemy.orm as sa_orm from glance.common import exception as exc from glance.db.sqlalchemy.metadef_api import namespace as namespace_api from glance.db.sqlalchemy.metadef_api import utils as metadef_utils ...
# This is a backport of Python-2.4's threading.local() implementation """Thread-local objects (Note that this module provides a Python version of thread threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the local class from threa...
from __future__ import unicode_literals import unittest from django.core.exceptions import ImproperlyConfigured from django.core.servers.basehttp import get_internal_wsgi_application from django.core.signals import request_started from django.core.wsgi import get_wsgi_application from django.db import close_old_conne...
#!/usr/bin/env python """ cythonize Cythonize pyx files into C files as needed. Usage: cythonize [root_dir] Default [root_dir] is 'statsmodels'. Checks pyx files to see if they have been changed relative to their corresponding C files. If they have, then runs cython on these files to recreate the C files. The scr...
''' Polymorphic Types. The type can really be used to store anything, but also has simple conversion methods for common data types such as bool, long, or a vector. The polymorphic type simplifies message passing between blocks, as all of the data is of the same type, including the message. Tags also use PMTs as data ...