code
stringlengths
1
199k
""" Module for parsing & validation of EPICS database definition (dbd) files. Copyright 2012 Australian National University. Licensed under the new BSD License, as specified in the LICENSE file. """ from pyparsing import * from parserutils import * import os import re import dbparser import pickle import traceback name...
from django.http import HttpResponse def hello_world(request): return HttpResponse("Hello, world.")
import os from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from easy_thumbnails.fields import ThumbnailerImageField class VisibilityModel(models.Model): is_active = models.BooleanField(_('is active'), ...
import os from operator import itemgetter from collections import OrderedDict from yambopy import * def pack_files_in_folder(folder,save_folder=None,mask='',verbose=True): """ Pack the output files in a folder to json files """ if not save_folder: save_folder = folder #pack the files in .json files ...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 12, transform = "Quantization", sigma = 0.0, exog_count = 0, ar_order = 12);
from cms.plugin_pool import plugin_pool from cms.plugin_base import CMSPluginBase from django.template import loader from django.template.loader import select_template from django.utils.translation import ugettext_lazy as _ from . import models from .conf import settings from filer.models.imagemodels import Image class...
from lambdaimage import preprocess as prep from lambdaimage import registration as reg from lambdaimage import fusion as fus from pyspark import SparkContext, SparkConf from lambdaimage import lambdaimageContext from lambdaimage.utils.tool import exeTime, log, showsize from parseXML import load_xml_file, get_function i...
import os import io import shutil import tempfile import unittest from functools import partial from pathlib import Path from nbformat import validate try: from unittest.mock import patch except ImportError: from mock import patch from .. import engines from ..log import logger from ..iorw import load_notebook_...
""" This file contains the sample code for XXX. Search for the string CONTENT to skip directly to it. Executing this file will begin an enhanced interactive Python session. You can step through each slide of sample code and explore the results. If your explorations hose the environment, just quit, restart and jump d...
import shutil import tempfile import unittest from numpy import vstack from pyspark import SparkContext class PySparkTestCase(unittest.TestCase): def setUp(self): class_name = self.__class__.__name__ self.sc = SparkContext('local', class_name) self.sc._jvm.System.setProperty("spark.ui.showCo...
import factory from questionnaire.models import Theme class ThemeFactory(factory.DjangoModelFactory): class Meta: model = Theme name = "A title" description = 'Description'
def extractTranslasiSanusiMe(item): ''' Parser for 'translasi.sanusi.me' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ('Loiterous', 'Loi...
__author__ = 'frank' import os os.environ['NETKI_ENV'] = 'test' from unittest import TestCase from netki.api.domain import * from mock import patch, Mock class TestWalletLookup(TestCase): # This is the open wallet name lookup API def setUp(self): self.patcher1 = patch("netki.api.domain.InputValidation")...
import base64 import re import os URL_FINDER = re.compile('url\(.*?\)') STRIP_URL = re.compile('url\(|\)|\'|"') file_extensions_to_types = { "png": "image/png", "jpg": "image/jpg", "gif": "image/gif", } def _extract_image_urls_from_css(css): return URL_FINDER.findall(css) def _extract_image_urls_from_cs...
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-faq-views', version='0.1', packages=['faq'], include_package_da...
import re import os import time import sys import unittest import ConfigParser from setuptools import setup, Command def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() class SQLiteTest(Command): """ Run the tests on SQLite """ description = "Run tests on SQLite" ...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 30, transform = "RelativeDifference", sigma = 0.0, exog_count = 0, ar_order = 12);
from preggy import expect import click from click.testing import CliRunner from terrible.run import compile_template from tests.base import TestCase import os class CompileTemplateTestCase(TestCase): def test_compile_template(self): base_dir = os.path.dirname(os.path.realpath(__file__)) + "/../" tem...
"""ADMM algorithm for the CMOD problem""" from __future__ import division from __future__ import absolute_import import copy import numpy as np from scipy import linalg from sporco.admm import admm import sporco.linalg as sl __author__ = """Brendt Wohlberg <brendt@ieee.org>""" class CnstrMOD(admm.ADMMEqual): r"""**...
"""Model unit tests.""" import datetime as dt import pytest from phonedusk.user.models import User, Role from .factories import UserFactory @pytest.mark.usefixtures('db') class TestUser: def test_get_by_id(self): user = User('foo', 'foo@bar.com') user.save() retrieved = User.get_by_id(user.i...
from robofab.pens.pointPen import BasePointToSegmentPen from ufoLib.pointPen import AbstractPointPen """ Printing pens print their data. Useful for demos and debugging. """ __all__ = ["PrintingPointPen", "PrintingSegmentPen", "SegmentPrintingPointPen"] class PrintingPointPen(AbstractPointPen): """A PointPen that prin...
""" LICENCE ------- Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. """ import flask from functools import wraps from flask import Blueprint, redirect, render_templa...
""" Registration tests """ import os from shutil import copy import pytest from tempfile import TemporaryDirectory from nipype.pipeline import engine as pe from ..interfaces.reportlets.registration import ( FLIRTRPT, SpatialNormalizationRPT, ANTSRegistrationRPT, BBRegisterRPT, MRICoregRPT, Apply...
from __future__ import (absolute_import, division, print_function, unicode_literals) import os import six import argparse from . import Command from .run import Run from .compare import Compare from ..repo import get_repo, NoSuchNameError from ..console import color_print, log from .. import res...
""" {{ project_name }}.libs.common.models ~~~~~~~~~~~~~~~~~~~~~~~~~ This module contains all models that can be used across apps :copyright: (c) 2015 """ from django.db import models from django.utils.translation import ugettext_lazy as _ from .utils.text import slugify class SlugModel(models.Model): ...
from impedance_map.sphere import correlation_coefficient, form_factor, \ pair_distribution_function_PY, structure_factor_function_PY, \ cross_section_dimension, fit_correlation_coefficient_nls, \ fit_form_factor_nls import numpy as np import math import unittest class TestCode(unittest.TestCase): def te...
from __future__ import with_statement import sys try: import cStringIO as StringIO except ImportError: try: import StringIO except ImportError: import io as StringIO FLAG = ['DropTail', 'RED', 'CBQ', 'FQ', 'SFQ', 'DRR'] def fix(filename, overwrite=False): """Will append a `Off` flag into...
from ._compat import unittest from ._adapt import DEFAULT_URI, drop, IS_MSSQL, IS_IMAP, IS_GAE, IS_TERADATA, IS_ORACLE from pydal import DAL, Field from pydal._compat import PY2 @unittest.skipIf(IS_IMAP, "Reference not Null unsupported on IMAP") @unittest.skipIf(IS_ORACLE, "Reference Not Null unsupported on Oracle") cl...
from __future__ import absolute_import, unicode_literals from .premailer import Premailer, transform __version__ = '2.9.4'
from nipype.testing import assert_equal from nipype.interfaces.broccoli.preprocess import MotionCorrection def test_MotionCorrection_inputs(): input_map = dict(args=dict(argstr='%s', ), device=dict(argstr='-device %d', ), environ=dict(nohash=True, usedefault=True, ), ignore_exception=dic...
from .subject import Subject class Music(Subject): target = 'music' def __repr__(self): return '<DoubanAPI Music>'
"""Delete files from the temporary directory on a Swarming bot.""" import os import sys if sys.platform == 'win32': os.system(r'forfiles /P c:\users\chrome~1\appdata\local\temp ' r'/M * /C "cmd /c if @isdir==FALSE del @file"') os.system(r'forfiles /P c:\users\chrome~1\appdata\local\temp ' r'/M * /C "cmd...
""" soupselect.py - https://code.google.com/p/soupselect/ CSS selector support for BeautifulSoup. soup = BeautifulSoup('<html>...') select(soup, 'div') - returns a list of div elements select(soup, 'div#main ul a') - returns a list of links inside a ul inside div#main """ import re from bs4 import BeautifulSoup tag_re ...
def extractEmergencyExitsReleaseBlog(item): """ """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None return False
import pytest import textwrap import ctypes import os import windows import windows.debug import windows.generated_def as gdef import windows.native_exec.simple_x86 as x86 import windows.native_exec.simple_x64 as x64 from .conftest import generate_pop_and_exit_fixtures, pop_proc_32, pop_proc_64 from .pfwtest import * p...
from collections import defaultdict from django.conf import settings from mongodbforms.documentoptions import DocumentMetaWrapper, LazyDocumentMetaWrapper from mongodbforms.fieldgenerator import MongoDefaultFormFieldGenerator try: from django.utils.module_loading import import_by_path except ImportError: # this...
from __future__ import absolute_import import logging import re from django.core.urlresolvers import RegexURLResolver, RegexURLPattern from django.conf.urls import patterns, include, url from sentry.plugins import plugins logger = logging.getLogger("sentry.plugins") def ensure_url(u): if isinstance(u, (tuple, list)...
from twisted.application.service import Application from twisted.application.internet import TimerService, TCPServer from twisted.web import server from twisted.python import log from scrapy.utils.misc import load_object from .interfaces import IEggStorage, IPoller, ISpiderScheduler, IEnvironment from .launcher import ...
import decimal import os from contextlib import contextmanager from django.test import TestCase from django.core.exceptions import ImproperlyConfigured from mock import patch from configurations.values import (Value, BooleanValue, IntegerValue, FloatValue, DecimalValue, ListValue, ...
""" @authors: Sergei Garbuzov @status: Development @version: 1.1.0 """ import time import json from pybvc.controller.controller import Controller from pybvc.openflowdev.ofswitch import (OFSwitch, FlowEntry, Instruction, ...
import os import sys sys.path.append(os.path.abspath('../../')) from tornadowebapi import __version__ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode', ] templates_path = ['_templates'] source_su...
try: from ttag.args import Arg, BasicArg, BooleanArg, ConstantArg, DateArg, \ DateTimeArg, IntegerArg, IsInstanceArg, KeywordsArg, \ ModelInstanceArg, StringArg, TimeArg, MultiArg from ttag.core import Tag from ttag.exceptions import TagArgumentMissing, TagValidationError from ttag impor...
from django.core.cache import cache def pytest_runtest_setup(item): # Clear the cache before every test cache.clear()
from django import template from django.template.base import Node, Template, TemplateSyntaxError from django.conf import settings register = template.Library() class PlugItIncludeNode(Node): def __init__(self, action): self.action = action def render(self, context): action = self.action.resolve(...
"""The WaveBlocks Project Compute some observables like norm, kinetic and potential energy of Hagedorn wavepackets. This class implements the mixed case where the bra does not equal the ket. @author: R. Bourquin @copyright: Copyright (C) 2014, 2016 R. Bourquin @license: Modified BSD License """ from functools import pa...
import os, sys sys.path.insert(0, os.path.join("..","..")) from nodebox.graphics import * from nodebox.gui.controls import * panel1 = Panel("Panel 1", x=30, y=350) panel1.append( Rows([ Field(value="", hint="subject"), Field(value="", hint="message", height=70, id="field_msg1", wrap=True), B...
from __future__ import absolute_import from datetime import timedelta from django.utils import timezone from rest_framework.response import Response from sentry.api.base import Endpoint from sentry.api.permissions import assert_perm from sentry.api.serializers import serialize from sentry.models import Group, GroupStat...
""" Checking for connected components in a graph. """ __author__ = "Sergio J. Rey <srey@asu.edu>" __all__ = ["check_contiguity"] from operator import lt def is_component(w, ids): """Check if the set of ids form a single connected component Parameters ---------- w : spatial weights boject ids : lis...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "devault.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
"""A collection of classes and methods to deal with collections of rates that together make up a network.""" import warnings import functools import math import os from operator import mul from collections import OrderedDict from ipywidgets import interact import numpy as np import matplotlib as mpl import matplotlib.p...
from __future__ import absolute_import from mayavi.filters.api import *
""" Version code adopted from Django development version. https://github.com/django/django """ VERSION = (0, 7, 2, 'final', 0) def get_version(version=None): """ Returns a PEP 386-compliant version number from VERSION. """ if version is None: from modeltranslation import VERSION as version e...
import os from pkg_resources import resource_filename __all__ = [ 'get_filepath', ] def get_filepath(name='sherpa_wz.hepmc'): return resource_filename('deepjets', os.path.join('testdata', name))
from __future__ import unicode_literals import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponsePermanentRedirect from django.middleware.locale import LocaleMiddleware from django.template import Context, Template from django.test import Sim...
""" This module contain solvers for all kinds of equations, algebraic or transcendental. """ import warnings from collections import defaultdict from types import GeneratorType from ..core import (Add, Dummy, E, Equality, Expr, Float, Function, Ge, I, Integer, Lambda, Mul, Symbol, expand_log, expand...
""" channel.py :copyright: (c) 2015 by Fulfil.IO Inc. :license: see LICENSE for more details. """ from trytond.pool import PoolMeta from trytond.model import fields __all__ = ['Channel'] __metaclass__ = PoolMeta def submit_to_google(url, data): import requests import json return requests.post( ...
""" DBSCAN: Density-Based Spatial Clustering of Applications with Noise """ import warnings import numpy as np from ..base import BaseEstimator from ..metrics import pairwise_distances from ..utils import check_random_state def dbscan(X, eps=0.5, min_samples=5, metric='euclidean', random_state=None): """...
from __future__ import absolute_import __all__ = [] import os import sys import socket import threading from . import current_process from ._ext import _billiard, win32 from .forking import Popen, duplicate, close, ForkingPickler from .util import register_after_fork, debug, sub_debug from .connection import Client, Li...
"""Unittests for the txrecaptcha.resources module.""" from __future__ import print_function import logging import ipaddr import random from BeautifulSoup import BeautifulSoup from twisted.internet import reactor from twisted.internet import task from twisted.internet.error import AlreadyCalled from twisted.internet.err...
from django.db import models from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db.models.signals import pre_save from django.dispatch import receiver try: from django.utils.timezone import now except ImportError: import datetime now = datetime.datetime.now ...
from catkin_pkg.python_setup import generate_distutils_setup from setuptools import setup d = generate_distutils_setup( packages=['catkin'], package_dir={'': 'python'}, scripts=[ 'bin/catkin_find', 'bin/catkin_init_workspace', 'bin/catkin_make', 'bin/catkin_make_isolated', ...
''' Authentication by token for the serverland dashboard Web API. Project: MT Server Land prototype code Author: Will Roberts <William.Roberts@dfki.de> ''' from piston.utils import rc, translate_mime, MimerDataException from serverland.dashboard.api.models import AuthToken from django.core.exceptions import MultipleOb...
class MailgunException(Exception): pass
"""Package contenant la commande 'oedit'.""" from primaires.interpreteur.commande.commande import Commande from primaires.interpreteur.editeur.presentation import Presentation from primaires.interpreteur.editeur.uniligne import Uniligne from primaires.objet.editeurs.oedit.presentation import EdtPresentation from primai...
import os, sygnal, sys import argparse import math
from django.conf.urls import url import logging logger = logging.getLogger(__name__) from argo import views local_urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^filter/$',views.filter,name='filter'), url(r'^job_display/(?P<job_num>\w+)/$',views.job_display,name='job_display'), ] urlpatter...
from __future__ import absolute_import, unicode_literals from django.db.models.lookups import Lookup from django.db.models.query import QuerySet from django.db.models.sql.where import SubqueryConstraint, WhereNode from django.utils.six import text_type class FilterError(Exception): pass class FieldError(Exception):...
''' Provide the JSON property. ''' import logging # isort:skip log = logging.getLogger(__name__) from .primitive import String __all__ = ( 'JSON', ) class JSON(String): ''' Accept JSON string values. The value is transmitted and received by BokehJS as a *string* containing JSON content. i.e., you must u...
from imaplib import ParseFlags """ mockimaplib allows you to test applications connecting to a dummy imap service. For more details on the api subset implemented, refer to the imaplib docs. The client should configure a dictionary to map imap string queries to sets of entries stored in a message dummy storage dictionar...
import re from .. import irc, var, ini from ..tools import is_identified def ident (f): def check (user, channel, word): if is_identified(user): f(user, channel, word) else: irc.msg(channel, "{}: Identify with NickServ first.".format(user)) return check def ins_monitor (line_obj): if line_obj.event in ["JO...
from __future__ import absolute_import, unicode_literals from celery.bin import celery from djcelery.app import app from djcelery.management.base import CeleryCommand base = celery.CeleryCommand(app=app) class Command(CeleryCommand): """The celery command.""" help = 'celery commands, see celery help' requir...
from __future__ import absolute_import, unicode_literals import datetime import pytz import six ISO8601_DATE_FORMAT = '%Y-%m-%d' ISO8601_DATETIME_FORMAT = ISO8601_DATE_FORMAT + 'T' + '%H:%M:%S' def parse_iso8601(value): """ Parses a datetime as a UTC ISO8601 date """ if not value: return None ...
import getopt import os import os.path import re import socket import subprocess import sys import threading import time import tokenize import traceback import types import linecache from code import InteractiveInterpreter try: from tkinter import * except ImportError: print("** IDLE can't import Tkinter. " \...
from unittest import TestCase from mock import Mock, patch from qrl.core.misc import logger from qrl.core.processors.TxnProcessor import TxnProcessor from qrl.core.ChainManager import ChainManager from qrl.core.State import State from qrl.core.OptimizedAddressState import OptimizedAddressState from qrl.core.txs.Transfe...
import json import sys data = json.load(sys.stdin) for e in data.itervalues(): if e['senses'] and e['senses'][0]['definition']: print u"{0}\t{1}".format( e['hw'], e['senses'][0]['definition']['sen']).encode('utf-8')
from numbers import Integral, Real from itertools import chain import string import numpy as np import openmc.checkvalue as cv import openmc.data PLOT_TYPES = ['total', 'scatter', 'elastic', 'inelastic', 'fission', 'absorption', 'capture', 'nu-fission', 'nu-scatter', 'unity', 'slowing-down p...
import re from markdown.extensions import Extension from markdown.preprocessors import Preprocessor from markdown.postprocessors import Postprocessor def makeExtension(configs=[]): return ChecklistExtension(configs=configs) class ChecklistExtension(Extension): def extendMarkdown(self, md, md_globals): m...
""" QoS Specs interface. """ from cinderclient import base class QoSSpecs(base.Resource): """QoS specs entity represents quality-of-service parameters/requirements. A QoS specs is a set of parameters or requirements for quality-of-service purpose, which can be associated with volume types (for now). In fut...
def parse_poscar_header(inp_fh): import sys from math import sqrt # inp_fh.seek(0) # just in case poscar_header = "" vol = 0.0 b = [] atom_numbers = [] # inp_fh.readline() # skip title scale = float(inp_fh.readline()) for i in range(3): b.append( [float(s) for s in inp_fh...
def load_text_file(text_file: str) -> str: with open(text_file, 'r') as f: return f.read()
""" WSGI config for bangkok project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_...
from struct import pack, unpack from time import time from communication.ComAPI.packet import Packet class PacketLogin(Packet): """Class for constructing binary data based on a common API between client / server.""" def __init__(self): super().__init__() self.packetID = 3 def encode(self, username, avatar, pos...
import hashlib import requests import threading import json import sys import traceback import base64 import electrum_vtc as electrum from electrum_vtc.plugins import BasePlugin, hook from electrum_vtc.i18n import _ class LabelsPlugin(BasePlugin): def __init__(self, parent, config, name): BasePlugin.__init_...
from argparse import ArgumentParser parser = ArgumentParser() args = parser.parse_args() from sys import exit from subtlenet.models import cluster as train import numpy as np from subtlenet.utils import mpl, plt from mpl_toolkits.mplot3d import Axes3D train.NEPOCH = 10 train.encoded_size=2 dims = train.instantiate('Rad...
"""Blocking and non-blocking HTTP client implementations using pycurl.""" import io import collections import logging import pycurl import threading import time from tornado import httputil from tornado import ioloop from tornado import stack_context from tornado.escape import utf8 from tornado.httpclient import HTTPRe...
from threading import Thread from subprocess import Popen, PIPE class PlaySound(Thread): def __init__(self, filename, volume): Thread.__init__(self) self.filename = filename self.volume = volume def run(self): cmd = 'play -v ' + self.volume + ' ' + self.filename p = Popen(cmd, shell=True, stderr...
"""SciPy: Scientific Library for Python SciPy (pronounced "Sigh Pie") is open-source software for mathematics, science, and engineering. The SciPy library depends on NumPy, which provides convenient and fast N-dimensional array manipulation. The SciPy library is built to work with NumPy arrays, and provides many user-f...
from django.conf.urls import patterns, include, url import views urlpatterns = patterns('', url(r'^$', views.TopicModelIndexView.as_view(), name='topics_models'), url(r'^model/(?P<model_id>\d+)/$', views.TopicModelDetailView.as_view(), name='topics_model'), url(r'^model/(?P<model_id>\d+)/topic/(?P<topic_id>...
from runner.koan import * class AboutMonkeyPatching(Koan): class Dog: def bark(self): return "WOOF" def test_as_defined_dogs_do_bark(self): fido = self.Dog() self.assertEqual('WOOF', fido.bark()) # ------------------------------------------------------------------ # A...
import os, glob, shutil from pathos import multiprocessing as mp import pandas as pd import numpy as np base_path = '/Data/malindgren/cru_november_final/IEM/ar5' output_base_path = '/Data/malindgren/cru_november_final/IEM/ar5' models = [ 'IPSL-CM5A-LR', 'GISS-E2-R', 'MRI-CGCM3', 'CCSM4', 'GFDL-CM3' ] for model in model...
""" Color definitions are used as per CSS3 specification: http://www.w3.org/TR/css3-color/#svg-color A few colors have multiple names referring to the sames colors, eg. `grey` and `gray` or `aqua` and `cyan`. In these cases the LAST color when sorted alphabetically takes preferences, eg. Color((0, 255, 255)).as_named(...
import os, glob os.chdir( '/workspace/Shared/Tech_Projects/ALFRESCO_Inputs/project_data/CODE/tem_ar5_inputs' ) base_dir = '/workspace/Shared/Tech_Projects/ESGF_Data_Access/project_data/data/prepped' output_base_dir = '/workspace/Shared/Tech_Projects/ALFRESCO_Inputs/project_data/TEM_Data/downscaled' cru_base_dir = '/wor...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ ...
ADL_TRUE = 1 # ADL_SDK_3.0/include/adl_defines.h:52 ADL_FALSE = 0 # ADL_SDK_3.0/include/adl_defines.h:55 ADL_MAX_CHAR = 4096 # ADL_SDK_3.0/include/adl_defines.h:59 ADL_MAX_PATH = 256 # ADL_SDK_3.0/include/adl_defines.h:62 ADL_MAX_ADAPTERS = 150 # ADL_SDK_3.0/include/adl_defines.h:65 ADL_MAX_DISPLAYS...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_space_rebel_tier3_ezkiel.iff" result.attribute_template_id = 9 result.stfName("npc_name","ishi_tib_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
import ConfigParser import StringIO from test_support import TestFailed, verify def basic(src): print "Testing basic accessors..." cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) cf.readfp(sio) L = cf.sections() L.sort() verify(L == [r'Commented Bar', r'Foo Bar...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/space/chassis/shared_hutt_medium_s02.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
#Find out how to split a string using matches of a regular expression as the separator. from pyparsing import OneOrMore, nestedExpr import re def splitParameterString(theString): toFilter = re.compile("(<<(?:[^\s]+)>>)").split(theString) return filter(lambda a: a != '', toFilter) def getRegexFromString(theString): ...
from __future__ import unicode_literals, division, absolute_import import copy import datetime from math import ceil from flask import jsonify from flask import request from flask_restplus import inputs from sqlalchemy.orm.exc import NoResultFound from flexget.api import api, APIResource, ApiClient from flexget.event i...
"""A few convenience functions to setup the Ising model in a TF. TFIM stands for Ising model in a transverse field, i.e.: .. math:: H=\sum_{i}\left[S^{z}_{i}S^{z}_{i+1} + h S^{x}_{i}\right)\right] """ class TranverseFieldIsingModel(object): """Implements a few convenience functions for the TFIM. Does exactl...