content
string
{ 'name': '中国会计科目表 - Accounting', 'version': '1.0', 'category': 'Localization/Account Charts', 'author': 'openerp-china.org', 'maintainer':'openerp-china.org', 'website':'http://openerp-china.org', 'url': 'http://code.google.com/p/openerp-china/source/browse/#svn/trunk/l10n_cn', 'descrip...
#! /usr/bin/env python import yaml import random import roslib class Fluent(yaml.YAMLObject): yaml_tag='!Fluent' def __setstate__(self, state): """ PyYaml does not call __init__. this is an init replacement. """ self.properties = [] self.Class_Instance = state['Class_I...
import errno import re import os import sys import subprocess # Note that gcc uses unicode, which may depend on the locale. TODO: # force LANG to be set to en_US.UTF-8 to get consistent warnings. allowed_warnings = set([ "alignment.c:327", "mmu.c:602", "return_address.c:62", "swab.h:49", "SemaLambda....
# -*- coding: utf-8 -*- """ *************************************************************************** __init__.py --------------------- Date : July 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com ********************************...
# # Emulation of has_key() function for platforms that don't use ncurses # import _curses # Table mapping curses keys to the terminfo capability name _capability_names = { _curses.KEY_A1: 'ka1', _curses.KEY_A3: 'ka3', _curses.KEY_B2: 'kb2', _curses.KEY_BACKSPACE: 'kbs', _curses.KEY_BEG: 'kbeg', ...
# -*- encoding: utf-8 -*- from abjad import * def test_timespantools_Timespan_is_congruent_to_timespan_01(): timespan_1 = timespantools.Timespan(0, 15) timespan_2 = timespantools.Timespan(-10, -5) assert not timespan_1.is_congruent_to_timespan(timespan_2) def test_timespantools_Timespan_is_congruent_to_t...
'''Test cases for multiple inheritance''' import sys import unittest from sample import * class SimpleUseCase(ObjectType, Str): def __init__(self, name): ObjectType.__init__(self) Str.__init__(self, name) class SimpleUseCaseReverse(Str, ObjectType): def __init__(self, name): ObjectTy...
from __future__ import absolute_import from itertools import count from token import * from parso._compatibility import py_version _counter = count(N_TOKENS) # Never want to see this thing again. del N_TOKENS COMMENT = next(_counter) tok_name[COMMENT] = 'COMMENT' NL = next(_counter) tok_name[NL] = 'NL' # Sets the...
import fsui from fsbc.util import unused from launcher.ui.skin import Skin class SettingsHeader(fsui.Group): ICON_LEFT = 0 ICON_RIGHT = 1 def __init__( self, parent, icon, title, subtitle="", icon_position=ICON_RIGHT ): unused(subtitle) fsui.Group.__init__(self, parent) ...
""" Encoding Aliases Support This module is used by the encodings package search function to map encodings names to module names. Note that the search function normalizes the encoding names before doing the lookup, so the mapping will have to map normalized encoding names to module names. Con...
import sys import re from optparse import OptionParser from skype_api import * appname = 'chat_finder' class SkypeChat: def __init__(self, _chunk_size = 5, debug = False): self.ids = None self.chunk = 0 self.chunk_size = _chunk_size self.topics = {} self.members = {} self.friendlyname = {} self.api =...
from django import template from djangosaml2.conf import config_settings_loader register = template.Library() class IdPListNode(template.Node): def __init__(self, variable_name): self.variable_name = variable_name def render(self, context): conf = config_settings_loader() context[s...
""" High-level abstraction of an EC2 server """ import boto import boto.utils from boto.mashups.iobject import IObject from boto.pyami.config import Config, BotoConfigPath from boto.mashups.interactive import interactive_shell from boto.sdb.db.model import Model from boto.sdb.db.property import StringProperty import os...
"""Common resources used in the gRPC route guide example.""" import json import route_guide_pb2 def read_route_guide_database(): """Reads the route guide database. Returns: The full contents of the route guide database as a sequence of route_guide_pb2.Features. """ feature_list = [] with open("...
"""Tests REST events for /presence paths.""" from tests import unittest from twisted.internet import defer from mock import Mock from ....utils import MockHttpResource, setup_test_homeserver from synapse.api.constants import PresenceState from synapse.handlers.presence import PresenceHandler from synapse.rest.clien...
"""A basic FTP server which uses a DummyAuthorizer for managing 'virtual users', setting a limit for incoming connections. """ import os from pyftpdlib import ftpserver def main(): # Instantiate a dummy authorizer for managing 'virtual' users authorizer = ftpserver.DummyAuthorizer() # Define a new user...
# -*- coding: utf-8 -*- """The Apple System Log (ASL) file parser.""" import os from dfdatetime import posix_time as dfdatetime_posix_time from dfdatetime import semantic_time as dfdatetime_semantic_time from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions fr...
import unittest, sys from ctypes.test import need_symbol class SimpleTypesTestCase(unittest.TestCase): def setUp(self): import ctypes try: from _ctypes import set_conversion_mode except ImportError: pass else: self.prev_conv_mode = set_conversion...
# -*- coding: utf-8 -*- { '!langcode!': 'pt-br', '!langname!': 'Português (do Brasil)', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "campo1=\'novovalor\'". Você não pode atualizar ou apagar os resultados de u...
{ 'name': 'Signup', 'description': """ Allow users to sign up and reset their password =============================================== """, 'author': 'OpenERP SA', 'version': '1.0', 'category': 'Authentication', 'website': 'https://www.odoo.com', 'installable': True, 'auto_install': ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type HAVE_FUNC = False try: import func.overlord.client as fc HAVE_FUNC = True except ImportError: pass import os import tempfile import shutil from ansible.errors import AnsibleError from ansible.utils.display import Disp...
import dns.rdtypes.nsbase class CNAME(dns.rdtypes.nsbase.NSBase): """CNAME record Note: although CNAME is officially a singleton type, dnspython allows non-singleton CNAME rdatasets because such sets have been commonly used by BIND and other nameservers for load balancing.""" pass
{ "name": "Sale - Product variants", "version": "1.0", "depends": [ "product", "sale", "product_variants_no_automatic_creation", ], "author": "OdooMRP team," "AvanzOSC," "Serv. Tecnol. Avanzados - Pedro M. Baeza", "contributors": [ "Mik...
from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) def __unicode__(self): return u"Q: %s " % self.question class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(max_length=200) def __unicode__(self): r...
from gnuradio import gr, gr_unittest import digital_swig as digital class test_probe_density(gr_unittest.TestCase): def setUp(self): self.tb = gr.top_block() def tearDown(self): self.tb = None def test_001(self): src_data = [0, 1, 0, 1] expected_data = 1 src = gr....
""" Generator for uniformbuffers* tests. This file needs to be run in its folder. """ import sys _DO_NOT_EDIT_WARNING = """<!-- This file is auto-generated from uniformbuffers_test_generator.py DO NOT EDIT! --> """ _HTML_TEMPLATE = """<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=u...
""" Tests for credit courses on the student dashboard. """ import unittest import datetime from mock import patch import pytz from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from xmodule.modulestore.tests.django_utils import ModuleStoreTes...
import re from ansible.module_utils.shell import CliBase from ansible.module_utils.network import register_transport, to_list, Command from ansible.module_utils.netcfg import NetworkConfig, ConfigLine def get_config(module): contents = module.params['config'] if not contents: contents = module.confi...
""" Finds and returns the latest bitcoin price Usage Examples: - "What is the price of bitcoin?" - "How much is a bitcoin worth?" """ from athena.classes.module import Module from athena.classes.task import ActiveTask from athena import brain class QuitTask(ActiveTask): d...
import mock from neutron import manager from neutron.tests.unit.ryu import fake_ryu from neutron.tests.unit import test_db_plugin as test_plugin class RyuPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): _plugin_name = 'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2' def setUp(self): ...
import random import string from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class MyWrapper(object): def __init__(self, value): self.value = value def __repr__(self): return "<%s: %s>" % (sel...
"""Wrapper for mod_fcgid, for use as a CherryPy HTTP server when testing. To autostart fcgid, the "apache" executable or script must be on your system path, or you must override the global APACHE_PATH. On some platforms, "apache" may be called "apachectl", "apache2ctl", or "httpd"--create a symlink to them if needed. ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'new_dev.ui' # # by: pyside-uic 0.2.15 running on PySide 1.2.1 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectNa...
import numpy as np import matplotlib.pyplot as plt def plot_decision_function(classifier, fea, gnd, title): ''' plot the decision function in 2-d plane classifiers: the svm models fea: array like, shape = (smp_num, fea_num) gnd: array like, shape = (smp_num,) title: title ...
from siskin.openurl import openurl_parameters_from_intermediateschema def test_openurl_from_intermediateschema(): cases = ( ('empty doc', {}, {}), ( 'title only', { 'rft.atitle': 'empty doc' }, { 'ctx_enc': 'info:ofi/e...
"""Tests the Bigquery client.""" import mock import httplib2 from googleapiclient.errors import HttpError from google.apputils import basetest from google.cloud.security.common.gcp_api import bigquery as bq from google.cloud.security.common.gcp_api import _base_client as _base_client from google.cloud.security.commo...
from __future__ import print_function import json import os import os.path import re import sys import warnings from collections import defaultdict from distutils.command.build_scripts import build_scripts as BuildScripts from distutils.command.sdist import sdist as SDist try: from setuptools import setup, find_...
"""This module is deprecated. Please use `airflow.providers.amazon.aws.hooks.athena`.""" import warnings # pylint: disable=unused-import from airflow.providers.amazon.aws.hooks.athena import AWSAthenaHook # noqa warnings.warn( "This module is deprecated. Please use `airflow.providers.amazon.aws.hooks.athena`.",...
from mpi4py import MPI import mpiunittest as unittest from sys import getrefcount as getrc class BaseTestCommAttr(object): keyval = MPI.KEYVAL_INVALID def tearDown(self): self.comm.Free() if self.keyval != MPI.KEYVAL_INVALID: self.keyval = MPI.Comm.Free_keyval(self.keyval) ...
"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141. TODO: Fill out more detailed documentation on the operators.""" from __future__ import division from abc import ABCMeta, abstractmethod, abstractproperty __all__ = ["Number", "Complex", "Real", "Rational", "Integral"] class Number(object): """A...
"""MsgTypes module: contains distributed object message types""" from direct.showbase.PythonUtil import invertDictLossless MsgName2Id = { # 2 new params: passwd, char bool 0/1 1 = new account # 2 new return values: 129 = not found, 12 = bad passwd, 'CLIENT_LOGIN': 1, '...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.framework import tensor_shape from tensorflow.python.ops import array_ops from tensorflow.python.ops import math_ops fro...
import re import os import sys import warnings import platform import tempfile from subprocess import Popen, PIPE, STDOUT from numpy.distutils.cpuinfo import cpu from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import exec_command from numpy.distutils.misc_util import msvc_runtime_libr...
"""Inception Resnet v2 Faster R-CNN implementation. See "Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning" by Szegedy et al. (https://arxiv.org/abs/1602.07261) as well as "Speed/accuracy trade-offs for modern convolutional object detectors" by Huang et al. (https://arxiv.org/abs/1611.1...
from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """ Test file created by XlsxWriter against a file created by Excel. """ def setUp(self): self.maxDiff = None filename = 'fit_to_pages01.xlsx' ...
#!/bin/python import fnmatch import os import shutil import subprocess import sys line_nb = False for arg in sys.argv[1:]: if (arg == "--with-line-nb"): print("Enabling line numbers in the context locations.") line_nb = True else: os.sys.exit("Non supported argument '" + arg + "'. Aborting.") if (not os.p...
"""Exceptions used throughout package""" class PipError(Exception): """Base pip exception""" class InstallationError(PipError): """General exception during installation""" class UninstallationError(PipError): """General exception during uninstallation""" class DistributionNotFound(InstallationError)...
import json from django.contrib.postgres import forms, lookups from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, TextField, Transform from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['HStore...
from tempest.lib.common import http from tempest.tests import base class TestClosingHttp(base.TestCase): def setUp(self): super(TestClosingHttp, self).setUp() self.cert_none = "CERT_NONE" self.cert_location = "/etc/ssl/certs/ca-certificates.crt" def test_constructor_invalid_ca_certs_a...
from functools import wraps from django.utils.decorators import decorator_from_middleware_with_args, available_attrs from django.utils.cache import patch_cache_control, add_never_cache_headers from django.middleware.cache import CacheMiddleware def cache_page(*args, **kwargs): """ Decorator for views that tri...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python.schema import ( Struct, FetchRecord, NewRecord, FeedRecord, InitEmptyRecord) from caffe2.python import core, workspace from caffe2.python.session i...
# -*- coding: utf-8 -*- ## @package ivf.cmds.save_depth # # ivf.cmds.save_depth utility package. # @author tody # @date 2016/02/02 from PyQt4.QtGui import * from PyQt4.QtCore import * import os from ivf.cmds.base_cmds import BaseCommand from ivf.scene.gl3d.image_plane import ImagePlane from ivf.io_ut...
from . import model from . import tests
from trex_astf_lib.api import * # IPV6 tunable example # # ipv6.src_msb # ipv6.dst_msb # ipv6.enable # class Prof1(): def __init__(self): pass def get_profile(self, **kwargs): # ip generator ip_gen_c = ASTFIPGenDist(ip_range=["16.0.0.0", "16.0.0.255"], distribution="seq") ...
"""pex support for interacting with interpreters.""" from __future__ import absolute_import import os import re import subprocess import sys from collections import defaultdict from pkg_resources import Distribution, Requirement, find_distributions from .base import maybe_requirement from .compatibility import stri...
"""Issue a series of GetHash requests to the SafeBrowsing servers and measure the response times. Usage: $ ./gethash_timer.py --period=600 --samples=20 --output=resp.csv --period (or -p): The amount of time (in seconds) to wait between GetHash requests. Using a value of more than 300 (5 min...
from __future__ import division import numpy as np from .line import LineVisual from ..color import ColorArray from ..color.colormap import _normalize, get_colormap from ..geometry.isocurve import isocurve from ..testing import has_matplotlib # checking for matplotlib _HAS_MPL = has_matplotlib() if _HAS_MPL: fro...
# -*- coding: utf-8 -*- """ *************************************************************************** SagaAlgorithmsTests.py --------------------- Date : September 2017 Copyright : (C) 2017 by Alexander Bruy Email : alexander dot bruy at gmail dot com ***...
""" String algorithms """ def balanced_parens(s: str) -> bool: open = 0 for c in s: if c=='(': open += 1 if c==')': if open > 0: open -= 1 else: return False return open==0 assert balanced_parens('') assert balanced_parens('()') asser...
import numpy as np from .peak_finder import peak_finder from .. import pick_types, pick_channels from ..utils import logger, verbose from ..filter import band_pass_filter from ..epochs import Epochs @verbose def find_eog_events(raw, event_id=998, l_freq=1, h_freq=10, filter_length='10s', ch_name=...
#!/usr/bin/env python # file: launcher.py import os import sys import logging from optparse import OptionParser, OptionGroup from eventbrain.util.daemon import Daemon FORMAT = '%(asctime)-15s:%(name)s:%(process)d:%(levelname)s === %(message)s' logging.basicConfig(format=FORMAT, level=logging.INFO, stream=sys.stdout) ...
"""Tests for initializers.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from scipy import stats import tensorflow as tf class ExponentialTest(tf.test.TestCase): def testExponentialLogPDF(self): with tf.Session(): batc...
import unittest from bs4 import BeautifulSoup import re def justOne(ls): assert(len(ls) == 1) return ls[0] def scrapePage(html_doc): soup = BeautifulSoup(html_doc, 'html.parser') ratings = [s.get_text() for s in soup.find_all("span",attrs={ "class": re.compile(r"game_review_summary .*")})] assert(len(ratin...
import unittest from bet_calculator.bet_calculator import Bet_Calculator from decimal import * class Bet_Test_Case(unittest.TestCase): """Test the Bet_Calculator class""" def setUp(self): self.bet_calculator = Bet_Calculator() def test_if_is_calculating_that_odds_will_profit(self): """ ...
# -*- coding: utf-8 -*- """ tests.templating ~~~~~~~~~~~~~~~~ Template functionality :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import flask import logging from jinja2 import TemplateNotFound def test_context_processing(): app = f...
from matplotlib.patches import Circle import matplotlib.pyplot as plt import numpy as np import pytest from pysisyphus.calculators.AnaPot import AnaPot from pysisyphus.dynamics.velocity_verlet import md def test_velocity_verlet(): geom = AnaPot.get_geom((0.52, 1.80, 0)) x0 = geom.coords.copy() v0 = .1 * ...
""" This module implements a method to find Euler-Lagrange Equations for given Lagrangian. """ from itertools import combinations_with_replacement from sympy import Function, sympify, diff, Eq, S, Symbol, Derivative from sympy.core.compatibility import (iterable, range) def euler_equations(L, funcs=(), vars=()): ...
import datetime import time from openerp.osv import osv from openerp.tools.translate import _ from openerp.report import report_sxw from openerp.tools.safe_eval import safe_eval as eval # # Use period and Journal for selection or resources # class report_assert_account(report_sxw.rml_parse): def __init__(self, c...
"""Utilities for ImageNet data preprocessing & prediction decoding. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from keras_applications import imagenet_utils from tensorflow.python.keras.applications import keras_modules_injection from tensorflow.py...
#!/usr/bin/env python ######################################################################## # $HeadURL$ # File : dirac-wms-job-attributes ######################################################################## """ Retrieve attributes associated with the given DIRAC job """ __RCSID__ = "$Id$" import DIRAC from ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Simple built-in backend. """ __author__ = "Lluís Vilanova <<EMAIL>>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <<EMAIL>>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "<EMAI...
# -*- coding: utf-8 -*- import re from module.plugins.internal.MultiHoster import MultiHoster from module.plugins.internal.misc import json class RPNetBiz(MultiHoster): __name__ = "RPNetBiz" __type__ = "hoster" __version__ = "0.20" __status__ = "testing" __pattern__ = r'https?://.+rpnet\...
import unittest import theano from theano import tensor, function, Variable, Generic import numpy import os class T_load_tensor(unittest.TestCase): def setUp(self): self.data = numpy.arange(5, dtype=numpy.int32) self.filename = os.path.join( theano.config.compiledir, "_test...
import sys import unittest from test.support import run_unittest L = [ ('0', 0), ('1', 1), ('9', 9), ('10', 10), ('99', 99), ('100', 100), ('314', 314), (' 314', 314), ('314 ', 314), (' \t\t 314 \t\t ', 314), (repr(sys.maxsize...
import struct class BaseHash: def __init__(self, name): self.name = name def prepare(self, hash): if type(hash) is long: newhash = '' for i in range(56, -8, -8): newhash += chr((hash>>i)%256) hash = newhash return hash class HashMD5(...
# -*- coding: utf-8 -*- from __future__ import absolute_import from sentry.models import Project, User from sentry.services.udp import SentryUDPServer from sentry.testutils import TestCase, get_auth_header class SentryUDPTest(TestCase): def setUp(self): self.address = (('0.0.0.0', 0)) self.serve...
from unittest import TestCase from parsers.http_parser import * __author__ = 'kimothy' class TestHttpParser(TestCase): def test_parse_url(self): testList = parse_url("//foo/bar//") self.assertEqual(testList[0], "foo") self.assertEqual(testList[1], "bar") self.assertEqual(len(test...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # kashev.rocks # Kashev Dalmia - <EMAIL> from flask.ext.script import Manager from flask.ext.assets import ManageAssets from src.kashevrocks import app from src.assets import register_assets manager = Manager(app) assets_env = register_assets(app) manager.add_command("...
# -*- coding:ascii -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 9 _modified_time = 1397087641.387625 _enable_loop = True _template_filename = 'C:\\app\\account\\templates/password_reset.html' _template_uri = 'password_rese...
""" XX. Model inheritance Model inheritance exists in two varieties: - abstract base classes which are a way of specifying common information inherited by the subclasses. They don't exist as a separate model. - non-abstract base classes (the default), which are models in their own right with ...
""" eta^3 polynomials planner author: Joe Dinius, Ph.D (https://jwdinius.github.io) Atsushi Sakai (@Atsushi_twi) Ref: - [eta^3-Splines for the Smooth Path Generation of Wheeled Mobile Robots] (https://ieeexplore.ieee.org/document/4339545/) """ import numpy as np import matplotlib.pyplot as plt from scipy.i...
""" Sphinx documentation build configuration file. All configuration values have a default; values that are commented out serve to show the default. 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 r...
# # Unpacker for Dean Edward's p.a.c.k.e.r, a part of javascript beautifier # by Einar Lielmanis <<EMAIL>> # # written by Stefano Sanfilippo <<EMAIL>> # # usage: # # if detect(some_string): # unpacked = unpack(some_string) # """Unpacker for Dean Edward's p.a.c.k.e.r""" import re import string from jsbeautifie...
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re from markupsafe._compat import text_type, string_types, int_types, \ unichr, PY2 __all__ = ['Markup', 'soft_unicod...
#!/usr/bin/env python # -*- coding: utf-8 -*- import clr SWF = clr.AddReference("System.Windows.Forms") print (SWF.Location) import System.Windows.Forms as WinForms from System.Drawing import Size, Point class HelloApp(WinForms.Form): """A simple hello world app that demonstrates the essentials of winfor...
#!/usr/bin/env python # -*- coding: latin-1 -*- """ Copyright © 2003 Bogdan Sumanariu <<EMAIL>> This file 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 opti...
""" South Africa-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import CharField, RegexField from django.utils.checksums import luhn from django.utils.translation import gettext as _ import re from datetime import date id_re ...
"""this is the basis for any app that follows the fetch/transform/save model * the configman versions of the crash mover and the processor apps will derive from this class The form of fetch/transform/save, of course, in three parts 1) fetch - some iterating or streaming function or object fetches packets of ...
#!/usr/bin/env python """Fortran to Python Interface Generator. """ from __future__ import division, absolute_import, print_function __all__ = ['run_main', 'compile', 'f2py_testing'] import sys from . import f2py2e from . import f2py_testing from . import diagnose run_main = f2py2e.run_main main = f2py2e.main de...
"""Pyvot - Pythonic interface for data exploration in Excel The user-level API for the `xl` package follows. For interactive use, consider running the :ref:`interactive shell <interactive>`:: python -m xl.shell **Managing Excel workbooks**: - :class:`xl.Workbook() <xl.sheet.Workbook>` opens a new work...
from openerp.osv import fields, osv class account_tax_chart(osv.osv_memory): """ For Chart of taxes """ _name = "account.tax.chart" _description = "Account tax chart" _columns = { 'period_id': fields.many2one('account.period', \ 'Period', \ ...
from logbook import Logger from sqlalchemy.orm import reconstructor from eos.utils.stats import DmgTypes pyfalog = Logger(__name__) class FighterAbility(object): # We aren't able to get data on the charges that can be stored with fighters. So we hardcode that data here, keyed # with the fighter squadron r...
import os import tempfile import unittest import numpy as np from pymatgen.core.structure import Structure from pymatgen.io.abinit.inputs import ( BasicAbinitInput, BasicMultiDataset, ShiftMode, calc_shiftk, ebands_input, gs_input, ion_ioncell_relax_input, num_valence_electrons, ) from...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class GlideIE(InfoExtractor): IE_DESC = 'Glide mobile video messages (glide.me)' _VALID_URL = r'https?://share\.glide\.me/(?P<id>[A-Za-z0-9\-=_+]+)' _TEST = { 'url': 'http://share.glide.me/UZF8zlmuQbe4mr+7dC...
# -*- coding: utf-8 -*- """Contains helper functions for generating correctly formatted hgrid list/folders. """ import logging import hurry.filesize from django.utils import timezone from framework import sentry from framework.auth.decorators import Auth from django.apps import apps from website import settings fro...
import bencode import hashlib import json from datetime import datetime from itertools import chain from django.core.cache import cache from django.conf import settings from django.core.paginator import Paginator from django.db.models import Q from util import convert_to_utc, convert_to_dict from ..models import Stat...
from . import ServiceBase from ..cache import cachedmethod from ..language import language_set, Language from ..subtitles import get_subtitle_path, ResultSubtitle from ..utils import get_keywords from ..videos import Episode from bs4 import BeautifulSoup import logging import re logger = logging.getLogger(__name__) ...
"""Generates .msi from a .zip archive or an unpacked directory. The structure of the input archive or directory should look like this: +- archive.zip +- archive +- parameters.json The name of the archive and the top level directory in the archive must match. When an unpacked directory is used as the i...
""" This module is used to build queries for Postgresql. You shouldn't really need to import anything from this file because they can all be built using dictorm.Table. Sqlite queries are slightly different, but use these methods as their base. """ from copy import copy from typing import Union global sort_keys sort_...
#!/usr/bin/python -u # # this test exercise the XPath basic engine, parser, etc, and # allows to detect memory leaks # import sys import libxml2 # Memory debug specific libxml2.debugMemory(1) doc = libxml2.parseFile("tst.xml") if doc.name != "tst.xml": print "doc.name error" sys.exit(1); ctxt = doc.xpathNewC...