content
string
"""Supports checking WebKit style in png files.""" import os import re from webkitpy.common import checksvnconfigfile from webkitpy.common import read_checksum_from_png from webkitpy.common.system.systemhost import SystemHost from webkitpy.common.checkout.scm.detection import SCMDetector class PNGChecker(object): ...
try: raise MemoryError except Exception: print("Caught MemoryError via Exception") try: raise MemoryError except MemoryError: print("Caught MemoryError") try: raise NameError except Exception: print("Caught NameError via Exception") try: raise NameError except NameError: print("Caught...
"""Tests for 2D LSTMs.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys # TODO: #6568 Remove this hack that makes dlopen() not crash. if hasattr(sys, "getdlopenflags") and hasattr(sys, "setdlopenflags"): import ctypes sys.setdlopenflags(sy...
""" Test for get/setParameter in python -- these methods are syntactic sugar that allow you to access parameters without knowing their types, at a moderate performance penalty. """ import unittest2 as unittest # import for type comparison with Array. # (Seems we should be able to use nupic.engine.Array directly...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import time import re from ansible.module_utils._text import to_bytes, to_text from ansible.plugins.callback import CallbackBase try: from junit_xml import TestSuite, TestCase HAS_JUNIT_XML = True except ImportE...
""" docker_registry.drivers.file ~~~~~~~~~~~~~~~~~~~~~~~~~~ This is a simple filesystem based driver. """ import os import shutil from ..core import driver from ..core import exceptions from ..core import lru class Storage(driver.Base): supports_bytes_range = True def __init__(self, path=None, config=No...
from lib.hachoir_core.field import Field, BasicFieldSet, FakeArray, MissingField, ParserError from lib.hachoir_core.tools import makeUnicode from lib.hachoir_core.error import HACHOIR_ERRORS from itertools import repeat import lib.hachoir_core.config as config class RootSeekableFieldSet(BasicFieldSet): def __init_...
# $Id: TestSuperGlobal.py 1047 2009-01-15 14:48:58Z graham $ # # Unit testing for SuperGlobal module # See http://pyunit.sourceforge.net/pyunit.html # import sys import unittest sys.path.append("../..") from MiscLib.SuperGlobal import * class TestSuperGlobal(unittest.TestCase): def setUp(self): return ...
import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Slider, Button, RadioButtons fig, ax = plt.subplots() plt.subplots_adjust(left=0.25, bottom=0.25) t = np.arange(0.0, 1.0, 0.001) a0 = 5 f0 = 3 s = a0*np.sin(2*np.pi*f0*t) l, = plt.plot(t,s, lw=2, color='red') plt.axis([0, 1, -10, 10]) a...
from dogtail.predicate import GenericPredicate from dogtail.utils import doDelay from . import UITestCase class BasicStorageTestCase(UITestCase): def check_select_disks(self, spoke): # FIXME: This is a really roundabout way of determining whether a disk is # selected or not. For some reason when...
import logging from lxml import etree from pkg_resources import resource_string from xmodule.editing_module import EditingDescriptor from xmodule.x_module import XModule from xmodule.xml_module import XmlDescriptor from xblock.fields import Scope, Integer, String from .fields import Date log = logging.getLogger(__n...
""" The Spatial Reference class, represensents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print(srs) GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHOR...
# -*- coding: utf-8 -*- import random from decimal import Decimal from access.models import AccessType from access.utils import resolve_acl from django.core.exceptions import ValidationError from django.db import models, transaction from django.utils import timezone from django.utils.translation import ugettext_lazy a...
from __future__ import print_function HIDE_CURSOR = '\x1b[?25l' SHOW_CURSOR = '\x1b[?25h' class WriteMixin(object): hide_cursor = False def __init__(self, message=None, **kwargs): super(WriteMixin, self).__init__(**kwargs) self._width = 0 if message: self.message = messa...
# -*- coding: utf-8 -*- """ *************************************************************************** dinfdistdown_multi.py --------------------- Date : March 2015 Copyright : (C) 2015 by Alexander Bruy Email : alexander dot bruy at gmail dot com ********...
from .mbcharsetprober import MultiByteCharSetProber from .codingstatemachine import CodingStateMachine from .chardistribution import EUCTWDistributionAnalysis from .mbcssm import EUCTWSMModel class EUCTWProber(MultiByteCharSetProber): def __init__(self): MultiByteCharSetProber.__init__(self) self._...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest from mock import ANY from ansible.module_utils.network.fortios.fortios import FortiOSHandler try: from ansible.modules.network.fortios import fortios_vpn_ssl_web_user_group_bookmark except I...
from ..broker import Broker class IssueAdhocBroker(Broker): controller = "issue_adhocs" def generate_issue(self, **kwargs): """Generates an instance of a custom issue. **Inputs** | ``api version min:`` None | ``api version max:`` None | ``required:...
from django import forms from django.conf import settings from django.forms.models import modelformset_factory, BaseModelFormSet from django.db.models import Sum from django.utils.translation import ugettext_lazy as _ from oscar.core.loading import get_model from oscar.forms import widgets Line = get_model('basket', ...
#!/usr/bin/env python from shogun import StreamingVwFile from shogun import StreamingVwCacheFile from shogun import T_SVMLIGHT from shogun import StreamingVwFeatures from shogun import VowpalWabbit parameter_list=[['../data/fm_train_sparsereal.dat']] def streaming_vw_createcache (fname): # First creates a binary cac...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } from ansible.module_utils.utm_utils import UTM, UTMModule from ansible.module_utils._text import to_native def main(...
contents = """ {{ id }}{ background-color: {{ style.background }}; } {{ id }}path, {{ id }}line, {{ id }}rect, {{ id }}circle { -webkit-transition: {{ style.transition }}; -moz-transition: {{ style.transition }}; transition: {{ style.transition }}; } {{ id }}.graph > .background { fill: {{ style.background ...
""" Classes to represent the definitions of aggregate functions. """ from django.core.exceptions import FieldError from django.db.models.expressions import Func, Value from django.db.models.fields import FloatField, IntegerField __all__ = [ 'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance', ] ...
from pytest import fixture, raises from flask.ext.navigation.navbar import NavigationBar from flask.ext.navigation.item import Item, ItemReference @fixture def navbar(): navbar = NavigationBar('mybar', [ Item(u'Home', 'home'), Item(u'News', 'news'), ]) return navbar def test_attrs(navba...
from __future__ import division import math import itertools import _deriv class Variable(object): def __init__(self, v): self.v = v def __add__(self, other): if not isinstance(other, (Variable, int, long, float)): return NotImplemented if isinstance(other, Variable): other = oth...
""" r81: introduction of bank statement line state """ __name__ = ("account.bank.statement.line:: set new field 'state' to " "confirmed for all statement lines belonging to confirmed " "statements") def migrate(cr, version): cr.execute("UPDATE account_bank_statement_line as sl " ...
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xgettext. Ret...
#!/usr/bin/env python from __future__ import absolute_import, division from common import Model # TODO: Refinement needed. class TestSection(Model): def __init__(self, in_mach, in_area, in_p, in_t, p01, t01, ...
""" Tutorial - The default method Request handler objects can implement a method called "default" that is called when no other suitable method/object could be found. Essentially, if CherryPy2 can't find a matching request handler object for the given request URI, it will use the default method of the object located de...
import time from oonib import errors as e from datetime import datetime def utcDateNow(): """ Returns the datetime object of the current UTC time. """ return datetime.utcnow() def utcTimeNow(): """ Returns seconds since epoch in UTC time, it's of type float. """ return time.mktime(ti...
import maya.cmds as cmds import maya.mel import maya.OpenMaya import IECore import IECoreMaya ## Base class for objects which are able to create an Attribute Editor widget for a single IECore.Parameter # held on an IECoreMaya.ParameterisedHolder node. # \todo Separate control drawing from labelling and layout, so the...
{ 'name': 'Portal CRM', 'version': '0.1', 'category': 'Tools', 'complexity': 'easy', 'description': """ This module adds a contact page (with a contact form creating a lead when submitted) to your portal if crm and portal are installed. ===============================================================...
#!/usr/bin/env python # # Imports import sys from optparse import OptionParser import os import re # # Globals and constants EXCLUDE_BASE = [ 'MixedContainer', '_MemberSpec', ] PATTERN = "^class\s*(\w*)" RE_PATTERN = re.compile(PATTERN) # # Functions for external use def generate_coverage(outfile,...
from oslo_config import cfg from nova.tests.functional.api_sample_tests import api_sample_base CONF = cfg.CONF CONF.import_opt('osapi_compute_extension', 'nova.api.openstack.compute.legacy_v2.extensions') class NetworksAssociateJsonTests(api_sample_base.ApiSampleTestBaseV21): ADMIN_API = True ...
"""Test server mocking a REST based network ctrl. Used for QuantumRestProxy tests """ import json import re from wsgiref.simple_server import make_server class TestNetworkCtrl(object): def __init__(self, host='', port=8000, default_status='404 Not Found', default_response='40...
import essentia import numpy import sys from essentia import INFO from essentia.progress import Progress namespace = 'lowlevel' dependencies = None def is_silent_threshold(frame, silence_threshold_dB): p = essentia.instantPower( frame ) silence_threshold = pow(10.0, (silence_threshold_dB / 10.0)) if p < ...
""" Acceptance tests for Studio's Settings Details pages """ from unittest import skip from .base_studio_test import StudioCourseTest from ...fixtures.course import CourseFixture from ...pages.studio.settings import SettingsPage from ...pages.studio.overview import CourseOutlinePage from ...tests.studio.base_studio_te...
# -*- coding: utf-8 -*- """ Created on Sun Nov 3 13:07:55 2013 @author: jaime """ import web from web.contrib.template import render_mako from web import form import pymongo import feedparser import time from keys import * import tweepy render = render_mako( directories=['plantillas'], input_encodin...
from django.test import TestCase from .models import SlugPage class RestrictedConditionsTests(TestCase): def setUp(self): slugs = [ 'a', 'a/a', 'a/b', 'a/b/a', 'x', 'x/y/z', ] SlugPage.objects.bulk_create([SlugPage(sl...
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
import sys from collections import Counter def loadFile( filename ): words = [] with open(filename) as file: for line in file: # Kvůli poslednímu slovu line += " " word = "" for char in line: if not char.isalpha(): ...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import str from d_utils import * def clog(s): s= str(s) print('\033[%96m'+strfti...
from SysPaths import script, disk, binary from os import environ as env from m5.defines import buildEnv class SysConfig: def __init__(self, script=None, mem=None, disk=None): self.scriptname = script self.diskname = disk self.memsize = mem def script(self): if self.scriptname: ...
# -*- coding: utf-8 -*- import openerp from openerp import http from openerp.http import request import openerp.addons.website_sale.controllers.main class website_sale(openerp.addons.website_sale.controllers.main.website_sale): @http.route(['/shop/payment'], type='http', auth="public", website=True) def paym...
# -*- coding: utf-8 -*- r""" werkzeug.contrib.securecookie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module implements a cookie that is not alterable from the client because it adds a checksum the server checks for. You can use it as session replacement if all you have is a user id or something to mark ...
import datetime import os import re import sys import unittest sys.path.insert(0, '..') import todo todotxt = todo.CONFIG["TODO_FILE"] = "test_todo.txt" donetxt = todo.CONFIG["DONE_FILE"] = "test_done.txt" class BaseTest(unittest.TestCase): num = 50 def default_config(self): pass def setUp(sel...
import os import os.path as op from flask import Flask from flask_sqlalchemy import SQLAlchemy import flask_admin as admin from flask_admin.contrib.sqla import ModelView # Create application app = Flask(__name__) # Create dummy secrey key so we can use sessions app.config['SECRET_KEY'] = '123456790' # Create in-me...
""" Module implementing a window for showing the QtHelp index. """ from __future__ import unicode_literals from PyQt5.QtCore import pyqtSignal, Qt, QEvent, QUrl from PyQt5.QtWidgets import QWidget, QVBoxLayout, QTextBrowser, QApplication, \ QMenu class HelpSearchWidget(QWidget): """ Class implementing a...
# -*- coding: utf-8 -*- from odoo import fields, models, api import odoo.addons.decimal_precision as dp import datetime class SellSummaryGoods(models.Model): _name = 'sell.summary.goods' _inherit = 'report.base' _description = u'销售汇总表(按商品)' id_lists = fields.Text(u'移动明细行id列表') goods_categ = fiel...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, compat_str, determine_ext, ExtractorError, ) class DisneyIE(InfoExtractor): _VALID_URL = r'''(?x) https?://(?P<domain>(?:[^/]+\.)?(?...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'DocumentAttachment' db.create_table('wiki_documentattachment', ( ('id', self.gf('djang...
""" .. dialect:: postgresql+zxjdbc :name: zxJDBC for Jython :dbapi: zxjdbc :connectstring: postgresql+zxjdbc://scott:tiger@localhost/db :driverurl: http://jdbc.postgresql.org/ """ from ...connectors.zxJDBC import ZxJDBCConnector from .base import PGDialect, PGExecutionContext class PGExecutionContex...
# Magic utility that "redirects" to pywintypesxx.dll import imp, sys, os def __import_pywin32_system_module__(modname, globs): # This has been through a number of iterations. The problem: how to # locate pywintypesXX.dll when it may be in a number of places, and how # to avoid ever loading it twice. This...
#!/usr/bin/env python """ An example of how to use wx or wxagg in an application with the new toolbar - comment out the setA_toolbar line for no toolbar """ # Used to guarantee to use at least Wx2.8 import wxversion wxversion.ensureMinimal('2.8') from numpy import arange, sin, pi import matplotlib # uncomment the f...
""" Copyright (C) 2017 Charles Schaff, David Yunis, Ayan Chakrabarti, Matthew R. Walter. See LICENSE.txt for details. """ # Beacon model 10: fixed beacons of 8 channels in alternating clusters (of different subsets of 16) import tensorflow as tf import numpy as np # Use with 8 channels wn=1 def beacon(self): N...
""" ActivateAccountView.py This file ... """ from django.views.generic import TemplateView from signetsim.views.HasUserLoggedIn import HasUserLoggedIn from signetsim.models import User from django.core.mail import send_mail from django.conf import settings class ActivateAccountView(TemplateView, HasUserLoggedIn): ...
#!/usr/bin/env python # *- coding: utf-8 -*- PUNCTUATIONS = (set(u'''`~!@#$%^&*()_+-={}[]|\:";'<>?,./ ''') | set(u'''~`!@#¥%……&*()——+-=『』【】、‘’“”:;《》?,。/''')) - \ set(u'''_''') # not punctuation class WordDict(dict): def __init__(self, *args, **kwargs): dict.__init__(self, ...
# -*- coding: utf-8 -*- # Adadpted from here: http://acdx.net/calculating-the-flesch-kincaid-level-in-python/ # See here for details: http://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_test from __future__ import division import re def mean(seq): return sum(seq) / len(seq) def syllables(word): ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'previewer.ui' # # by: PyQt4 UI code generator snapshot-4.8.2-241fbaf4620d # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: ...
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation setOutDir(__name__) import os,unittest from reportlab.platypus import Spacer, SimpleDocTemplate, Table, TableStyle, LongTable from reportlab.platypus.doctemplate import PageAccumulator from reportlab.platypus.paragraph import P...
import os import sys import install_venv_common as install_venv # noqa def print_help(venv, root): help = """ Designate development environment setup is complete. Designate development uses virtualenv to track and manage Python dependencies while in development and testing. To activate the Des...
import six class LogConfigTypesEnum(object): _values = ( 'json-file', 'syslog', 'journald', 'gelf', 'fluentd', 'none' ) JSON, SYSLOG, JOURNALD, GELF, FLUENTD, NONE = _values class DictType(dict): def __init__(self, init): for k, v in six.iterit...
import warnings from starcluster.logger import log from starcluster.commands.completers import ClusterCompleter class CmdRemoveNode(ClusterCompleter): """ removenode [options] <cluster_tag> Terminate one or more nodes in the cluster Examples: $ starcluster removenode mycluster This wi...
class gpio: dir = '0' set = '0' clr = '0' alt = '0' desc = '' def __init__(self, dir=0, set=0, clr=0, alt=0, desc=''): self.dir = dir self.set = set self.clr = clr self.alt = alt self.desc = desc # the following is a dictionary of all GPIOs in the system # the key is the GPIO number pxa255_alt_fu...
#coding:utf-8 import urllib from django.template import loader from django.core.cache import cache from django.utils.translation import ugettext as _ from xadmin.sites import site from xadmin.models import UserSettings from xadmin.views import BaseAdminPlugin, BaseAdminView from xadmin.util import static, json THEME_C...
""" Modules migration handling. """ import imp import logging import os from os.path import join as opj import openerp import openerp.release as release import openerp.tools as tools from openerp.tools.parse_version import parse_version _logger = logging.getLogger(__name__) class MigrationManager(object): """ ...
"""Tests for the testing base code.""" from oslo.config import cfg from nova.openstack.common import rpc from nova import test CONF = cfg.CONF CONF.import_opt('use_local', 'nova.conductor.api', group='conductor') class IsolationTestCase(test.TestCase): """Ensure that things are cleaned up after failed tests. ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ################################################################################ # Documentation ################################################################################ ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu...
# coding=utf-8 """ InaSAFE Disaster risk assessment tool developed by AusAid and World Bank - *Flood Vector on Population Test Cases.** Contact : <EMAIL> .. note:: 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 Fr...
"""Tests for tf.subscribe.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow....
import pytest import sh from molecule.verifier import ansible_lint @pytest.fixture() def ansible_lint_instance(molecule_instance): return ansible_lint.AnsibleLint(molecule_instance) def test_execute(monkeypatch, patched_run_command, ansible_lint_instance): monkeypatch.setenv('HOME', '/foo/bar') ansible...
"""qos db changes Revision ID: 48153cb5f051 Revises: 1b4c6e320f79 Create Date: 2015-06-24 17:03:34.965101 """ # revision identifiers, used by Alembic. revision = '48153cb5f051' down_revision = '1b4c6e320f79' from alembic import op import sqlalchemy as sa from neutron.api.v2 import attributes as attrs def upgrade...
import sys # Find right direction when running from source tree sys.path.insert(0, "bin/python") import samba.getopt as options from optparse import OptionParser from samba.dcerpc import drsuapi, drsblobs, misc from samba.ndr import ndr_pack, ndr_unpack, ndr_print import binascii import hashlib import Crypto.Cipher...
#!/usr/bin/env python """PySlices is a python block code editor / shell and namespace browser application.""" # The next two lines, and the other code below that makes use of # ``__main__`` and ``original``, serve the purpose of cleaning up the # main namespace to look as much as possible like the regular Python # she...
import xorn.storage, Setup def assert_cannot_get(rev, ob): try: rev.get_object_data(ob) except KeyError: pass else: raise AssertionError rev0, rev1, rev2, rev3, ob0, ob1a, ob1b = Setup.setup() assert_cannot_get(rev0, ob0) assert_cannot_get(rev0, ob1a) assert_cannot_get(rev0, ob1b)...
""" Support to use FortiOS device like FortiGate as device tracker. This component is part of the device_tracker platform. """ import logging from fortiosapi import FortiOSAPI import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA, DeviceScanner, ) from hom...
from __future__ import absolute_import, division, unicode_literals from xml.dom import Node from . import _base class TreeWalker(_base.NonRecursiveTreeWalker): def getNodeDetails(self, node): if node.nodeType == Node.DOCUMENT_TYPE_NODE: return _base.DOCTYPE, node.name, node.publicId, node.sy...
import gdb def isnull(ptr): return ptr == gdb.Value(0).cast(ptr.type) def int128(p): return long(p['lo']) + (long(p['hi']) << 64) class QemuCommand(gdb.Command): '''Prefix for QEMU debug support commands''' def __init__(self): gdb.Command.__init__(self, 'qemu', gdb.COMMAND_DATA, ...
import StringIO import os, sys, re, types from zope.interface import Interface, interface import conf PATH = '../../../indico/' from MaKaC import common from indico.core.extpoint import IListener, IContributor def iterate_sources(dir, exclude=[]): """ iterates through all *.py files inside a dir, recursiv...
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): # def sumOfLeftLeaves(self, root): # """ # :type root: TreeNode # :rtype: int # """ #...
from django.utils.translation import ugettext as _ from django.conf import settings from taiga.base.api import viewsets from taiga.base import response from taiga.base import exceptions as exc from taiga.base.decorators import list_route from taiga.users.services import get_user_photo_url from taiga.users.gravatar imp...
from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' # '25 Hydref 2006' TIME_FORMAT = 'P' # '2:30 y.b.' DATETIME_FORMAT = 'j F Y, P' ...
import sigrokdecode as srd ''' OUTPUT_PYTHON format: Packet: [<ptype>, <pdata>] <ptype>, <pdata>: - 'SYNC', <sync> - 'PID', <pid> - 'ADDR', <addr> - 'EP', <ep> - 'CRC5', <crc5> - 'CRC16', <crc16> - 'EOP', <eop> - 'FRAMENUM', <framenum> - 'DATABYTE', <databyte> - 'HUBADDR', <hubaddr> - 'SC', <sc> - 'PORT'...
from __future__ import print_function import sys sys.path.insert(1,"../../") import h2o import time from tests import pyunit_utils #---------------------------------------------------------------------- # This test is used to show what happens if we split the same datasets # into one part csv, one part orc #-----------...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import model_utils.fields import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('contributions', '0029_auto_20150514_1331'), ] operations = [ migratio...
import crm_forward_to_partner import crm_channel_interested
from django import forms from django.utils.translation import ugettext_lazy as _ from compta.models import Budget, OperationEpargne, Operation, CategorieEpargne class BudgetForm(forms.ModelForm): class Meta: model = Budget fields = ['categorie', 'compte_associe', 'budget', 'solde_en_une_fois'] ...
''' ''' # 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");...
""" oVirt dynamic inventory script ================================= Generates dynamic inventory file for oVirt. Script will return following attributes for each virtual machine: - id - name - host - cluster - status - description - fqdn - os_type - template - tags - statistics - devices When run in --li...
from openerp.osv import fields, osv class account_analytic_chart(osv.osv_memory): _name = 'account.analytic.chart' _description = 'Account Analytic Chart' _columns = { 'from_date': fields.date('From'), 'to_date': fields.date('To'), } def analytic_account_chart_open_window(self, cr...
'''The 'grit sdiff' tool. ''' import os import getopt import tempfile from grit.node import structure from grit.tool import interface from grit import constants from grit import util # Builds the description for the tool (used as the __doc__ # for the DiffStructures class). _class_doc = """\ Allows you to view the ...
from pyflink.java_gateway import get_gateway from pyflink.table.types import DataType, _to_java_type from pyflink.util import utils __all__ = ['TableSource', 'CsvTableSource'] class TableSource(object): """ Defines a table from an external system or location. """ def __init__(self, j_table_source): ...
import netrc, os, unittest, sys, textwrap from test import test_support temp_filename = test_support.TESTFN class NetrcTestCase(unittest.TestCase): def make_nrc(self, test_data): test_data = textwrap.dedent(test_data) mode = 'w' if sys.platform != 'cygwin': mode += 't' ...
"Módulo para manejo de archivos SQL" __author__ = "Mariano Reingart (<EMAIL>)" __copyright__ = "Copyright (C) 2014 Mariano Reingart" __license__ = "GPL 3.0" from decimal import Decimal DEBUG = False CAE_NULL = None FECHA_VTO_NULL = None RESULTADO_NULL = None NULL = None def esquema_sql(tipos_registro, conf={}): ...
import edi import res_partner import res_company import res_currency # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
''' Created on Oct 25, 2011 @author: mmornati ''' from webui.servers.models import Server from guardian.shortcuts import get_objects_for_user import logging from webui.platforms.oc4j.utils import extract_appli_info, check_contains,\ extract_appli_details from webui.platforms.abstracts import Application from webui...
#!/opt/dionaea/bin/python3 # sudo su postgres # createdb --owner=xmpp logsql # psql -U xmpp logsql < modules/python/util/xmpp/pg_schema.sql import sqlite3 import postgresql.driver as pg_driver import optparse def copy(name, lite, pg, src, dst): print("[+] {0}".format(name)) pg.execute("DELETE FROM {0}".form...
import shutil from profile_creators import extension_profile_extender from profile_creators import profile_generator from telemetry.page import shared_page_state class ExtensionProfileSharedState(shared_page_state.SharedPageState): """Shared state tied with extension profile. Generates extension profile on init...
import inspect import collections from gnuradio import gr import pmt TYPE_MAP = { 'complex64': 'complex', 'complex': 'complex', 'float32': 'float', 'float': 'float', 'int32': 'int', 'uint32': 'int', 'int16': 'short', 'uint16': 'short', 'int8': 'byte', 'uint8': 'byte', } BlockIO = collections.nam...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import remove_start class TeleMBIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?telemb\.be/(?P<display_id>.+?)_d_(?P<id>\d+)\.html' _TESTS = [ { 'url': 'http://www.telemb...