text
stringlengths
475
200k
""" MagPy Auxiliary input filter - Write AUTODIF read-in data for F (also read) Written by Rachel Bailey - contains test and read function, toDo: write function """ from magpy.stream import * def isAUTODIF_FREAD(filename): """ Checks whether a file is text POS-1 file format. """ try: line = op...
# -*- coding: utf-8 -*- """ *************************************************************************** DeleteDuplicateGeometries.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com ***********...
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2011 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists...
""" :Author: M. Simionato :Date: April 2004 :Title: A much simplified interface to optparse. You should use optionparse in your scripts as follows. First, write a module level docstring containing something like this (this is just an example):: '''usage: %prog files [options] -d, --delete: delete all files...
# Standard library import unittest def decompose_number_on_base(number, base): """ Returns a number's decomposition on a defined base :param number: The number to decompose :param base: list representing the base. It must be sorted and each element must be a multiple of its predecessor. First element must be 1...
#! /usr/bin/env python # Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
# -*- coding: utf-8 -*- """ Copyright (C) 2014 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib from contextlib import closing from time import time from uuid import uu...
from django.contrib import messages from django.contrib.auth.models import Permission from django.core.urlresolvers import reverse_lazy, reverse from django.shortcuts import get_object_or_404, redirect from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string from djang...
from datetime import timedelta import json import logging import re import sys from modularodm import Q from modularodm.storage.base import KeyExistsException from modularodm.exceptions import NoResultsFound from framework.mongo import database from framework.transactions.context import TokuTransaction from scripts i...
""" Support for inheritance of fields down an XBlock hierarchy. """ from __future__ import absolute_import from datetime import datetime from pytz import UTC from xmodule.partitions.partitions import UserPartition from xblock.fields import Scope, Boolean, String, Float, XBlockMixin, Dict, Integer, List from xblock.run...
# -*- coding: utf-8 -*- import unittest import boto TABLE_NAME = 'Table-HR' TABLE_NAME_404 = 'Waldo' TABLE_RT = 45 TABLE_WT = 123 TABLE_RT2 = 10 TABLE_WT2 = 10 TABLE_HK_NAME = u'hash_key' TABLE_HK_TYPE = u'N' TABLE_RK_NAME = u'range_key' TABLE_RK_TYPE = u'S' HK_VALUE = u'123' HK_VALUE_404 = u'404' RK_VALUE1 = u'Wald...
""" SciDB query generation and execution. The query building themselves are fairly low-level, since their only concern is whether to generate temporary arrays or not. """ from __future__ import absolute_import, division, print_function import uuid from itertools import chain #----------------------------------------...
# Copyright 2011, VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
# (c) 2012, Michael DeHaan <[EMAIL]> # (c) 2013, Steven Dossett <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at ...
# -*- coding: utf-8 -*- import openerp from openerp import http, SUPERUSER_ID from openerp.http import request import time GENGO_DEFAULT_LIMIT = 20 class website_gengo(http.Controller): @http.route('/website/get_translated_length', type='json', auth='user', website=True) def get_translated_length(self, tran...
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
'''Copyright 2015 Chris Young Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dis...
# # big5hkscs.py: Python Unicode Codec for BIG5HKSCS # # Written by Hye-Shik Chang <[EMAIL]> # import _codecs_hk, codecs import _multibytecodec as mbc codec = _codecs_hk.getcodec('big5hkscs') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncreme...
from __future__ import absolute_import from optparse import make_option from django.core.management.base import BaseCommand from zerver.lib.actions import create_stream_if_needed, do_add_subscription from zerver.models import Realm, UserProfile, get_user_profile_by_email class Command(BaseCommand): help = """Ad...
import string from tkinter import * from idlelib.Delegator import Delegator #$ event <<redo>> #$ win <Control-y> #$ unix <Alt-z> #$ event <<undo>> #$ win <Control-z> #$ unix <Control-z> #$ event <<dump-undo-state>> #$ win <Control-backslash> #$ unix <Control-backslash> class UndoDelegator(Delegator): max_und...
# -*- coding: utf-8 -*- #from compat import unicode, bytes # TODO: round-tripping tests import pytest from hematite.url import URL, _URL_RE, parse_authority TEST_URLS = [ '*', # e.g., OPTIONS * 'http://googlewebsite.com/e-shops.aspx', 'http://example.com:8080/search?q=123&business=Nothing%20Special',...
# This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number of threads into # trying to import the same module "at the same time". # There are no pleasant failure modes -- most likely is that Python # complains several times about module random having no attribute # randran...
import tweepy from zope import interface from twisted.application import service from twisted.internet import defer, threads, reactor from piped import exceptions, log, resource, util class MyTwitterProvider(object): # state that we are a resource provider, so that the piped plugin system finds us interface....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Functions to format apertium style analyses from omorfi data.""" # Author: Omorfi contributors <[EMAIL]> 2015 # 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...
# -*- coding: utf-8 -*- from __future__ import with_statement from cms.models import Page from cms.test_utils.fixtures.navextenders import NavextendersFixture from cms.test_utils.testcases import SettingsOverrideTestCase from cms.test_utils.util.menu_extender import TestMenu from django.conf import settings from django...
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
from __future__ import absolute_import import copy from django.conf import settings from django.db import models from django.db.models.loading import cache from django.test import TestCase from django.test.utils import override_settings from .models import ( Child1, Child2, Child3, Child4, Child5,...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os from metrics import Metric class MediaMetric(Metric): """MediaMetric class injects and calls JS responsible for recording metric...
# export-to-postgresql.py: export perf data to a postgresql database # Copyright (c) 2014, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # Thi...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
# -*- coding: utf-8 -*- # pylint: skip-file """Manual tests""" import pytest from cfme import test_requirements pytestmark = [ pytest.mark.ignore_stream('upstream'), pytest.mark.manual, test_requirements.retirement ] @pytest.mark.tier(2) def test_retire_infra_vms_folder(): """ test the retire fu...
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that when multiple values are supplied for a gyp define, the last one is used. """ import os import TestGyp test = TestGyp.Te...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # _build.py : Tools to make packages for different platforms # # Copyleft (C) 2014 - huhamhire hosts team <[EMAIL]> # ===================================================================== # Licensed under the GNU General Public License, version 3. You should # have recei...
from django import template register = template.Library() @register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True) def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for the prepopulated fields for both the admin form and in...
# -*- coding: utf8 -*- # # Copyright (C) 2017 NDP Systèmes (<http://www.ndp-systemes.fr>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # Licen...
#!/usr/bin/python # Copyright (c) 2018 Loic BLOT <[EMAIL]> # This module is sponsored by E.T.A.I. (www.etai.fr) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'sup...
import json import os from ctypes import addressof, byref, c_double, c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.driver import Driver from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import raster as capi from django.contrib.gis...
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Uploads the results to the flakiness dashboard server.""" # pylint: disable=E1002,R0201 import logging import os import shutil import sys import temp...
############################################################################# ## ## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this f...
# ---------------------------------------------------------------------- # Copyright (c) 2015 Rafael Gonzalez. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including...
#!/usr/bin/env python # -*- coding: utf-8 -*- ## ## Copyright (C) 2015-2018 João Ricardo Lourenço <[EMAIL]> ## ## Github: https://github.com/Jorl17 ## ## Project main repository: https://github.com/Jorl17/jar2app ## ## This file is part of jar2app. ## ## jar2app is free software: you can redistribute it and/or modify #...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
# Module related with dataset import os import urllib import zipfile import numpy as np def download(dataset_name = 'UCI HAR'): """"Download database to local folder """ # Init dataset_valid = False dataset_folder = "./" download_folder = os.path.abspath("../dataset/donwload/") + "...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2014 The RySim Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'DocumentPermission.perms' db.alter_column(u'desktop_do...
# -*- coding: utf-8 -*- """ flask.templating ~~~~~~~~~~~~~~~~ Implements the bridge to Jinja2. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import posixpath from jinja2 import BaseLoader, Environment as BaseEnvironment, \ TemplateNotFound from .glo...
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
""" pip install m3u8 first, please """ import sys import m3u8 import time import urllib2 import os url = "http://localhost:20119/cctv21/encoder/0/playlist.m3u8" media_sequence = 0 playlist = m3u8.load(url) while playlist.is_variant: url = playlist.base_uri + "/" + playlist.playlists[0].uri playlist = m3u8.l...
import copy class Lambda(object): """ Lambda lambda-like class Acts like a lambda function, but its string representation is Python code that yields the object when executed. >>> f = Lambda('x : x**2') >>> f(1.41) 1.9880999999999998 >>> g = eval(str(f)) >>> g(2.82) 7.95239999...
import types import unittest import arff class ConversorStub(object): def __init__(self, r_value): self.r_value = r_value def __call__(self, value): return self.r_value(value) class COOStub(object): def __init__(self, data, row, col): self.data = data self.row = row ...
# Django settings for minha_grade_fisl project. import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '[EMAIL]'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.pa...
from __future__ import unicode_literals from datetime import date, datetime from django.test import SimpleTestCase, override_settings from django.test.utils import TZ_SUPPORT, requires_tz_support from django.utils import dateformat, translation from django.utils.dateformat import format from django.utils.timezone imp...
""" Url Length Spider Middleware See documentation in docs/topics/spider-middleware.rst """ import logging from scrapy.http import Request from scrapy.exceptions import NotConfigured logger = logging.getLogger(__name__) class UrlLengthMiddleware(object): def __init__(self, maxlength): self.maxlength ...
# -*- coding: utf-8 -*- """ jinja2.runtime ~~~~~~~~~~~~~~ Runtime helpers. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ import sys from itertools import chain from jinja2.nodes import EvalContext, _context_function_types from jinja2.utils import Markup, soft_unicode, escape, missing...
# -*- coding: utf-8 -*- #! \file ./doit/support/app/errors.py #! \author Jiří Kučera, <[EMAIL]> #! \stamp 2016-09-03 14:38:52 (UTC+01:00, DST+01:00) #! \project DoIt!: Tools and Libraries for Building DSLs #! \license MIT #! \version 0.0.0 #! \fdesc @pyfil...
import cv2 import Tool from scipy import ndimage class Denoise(Tool.Tool): def on_init(self): self.id = "denoise" self.name = "Denoise" self.icon_path = "ui/PF2_Icons/Denoise.png" self.properties = [ # Detailer Tool.Property("enabled", "Denoise", "Header", F...
# $Id: __init__.py 7648 2013-04-18 07:36:22Z milde $ # Authors: David Goodger <[EMAIL]>; Ueli Schlaepfer # Copyright: This module has been placed in the public domain. """ This package contains Docutils Reader modules. """ __docformat__ = 'reStructuredText' import sys from docutils import utils, parsers, Component ...
from django import template from django.apps import apps from django.utils.encoding import iri_to_uri from django.utils.six.moves.urllib.parse import urljoin register = template.Library() class PrefixNode(template.Node): def __repr__(self): return "<PrefixNode for %r>" % self.name def __init__(self...
"Implementation of tzinfo classes for use with datetime.datetime." from __future__ import unicode_literals import time from datetime import timedelta, tzinfo from django.utils.encoding import force_str, force_text, DEFAULT_LOCALE_ENCODING # Python's doc say: "A tzinfo subclass must have an __init__() method that ca...
""" ======================= MNIST dataset benchmark ======================= Benchmark on the MNIST dataset. The dataset comprises 70,000 samples and 784 features. Here, we consider the task of predicting 10 classes - digits from 0 to 9 from their raw images. By contrast to the covertype dataset, the feature space is...
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError...
# Copyright (c) 2020 Dell Inc. or its subsidiaries. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ def execute(filters=None): if not filters: filters = {} columns = get_columns() employees = get_employees(filters) depar...
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions shared amongst the Windows generators.""" import copy import os # A dictionary mapping supported target types to extensions. TARGET_TYPE_EX...
import logging import os import platform import requests import socket import fcntl import struct logger = logging.getLogger(__name__) def address_by_route(): logger.debug("Finding address by querying local routing table") addr = os.popen("/sbin/ip route get 8.8.8.8 | awk '{print $NF;exit}'").read().strip() ...
import re from livestreamer.plugin import Plugin, PluginError, PluginOptions from livestreamer.plugin.api import http, validate from livestreamer.stream import HLSStream LOGIN_PAGE_URL = "http://www.livestation.com/en/users/new" LOGIN_POST_URL = "http://www.livestation.com/en/sessions.json" _csrf_token_re = re.compi...
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- ''' retain - Command-line utility that removes all files except the ones specified on the command line. Usage: ------ retain [-fnrsv] [-d directory] filename [...] Options: -------- --directory <dir> The directory to operate on. Defaults to the current ...
#======================================================================= # # Python Lexical Analyser # # Traditional Regular Expression Syntax # #======================================================================= from Regexps import Alt, Seq, Rep, Rep1, Opt, Any, AnyBut, Bol, Eol, Char from Errors import Plex...
from otp.ai.AIBaseGlobal import * from direct.task.Task import Task from pandac.PandaModules import * from DistributedNPCToonBaseAI import * from toontown.estate import BankGlobals class DistributedNPCBankerAI(DistributedNPCToonBaseAI): FourthGagVelvetRopeBan = config.GetBool('want-ban-fourth-gag-velvet-rope', 0) ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
import unittest import numpy import chainer from chainer.backends import cuda import chainer.functions as F from chainer import gradient_check from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'func_name': ['cos', 'sin', 'tan'], 'shape': [(3, 2), ()], ...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- """ ipcai2016 Copyright (c) German Cancer Research Center, Computer Assisted Interventions. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE for details """ """ Crea...
# Copyright (c) 2018 Red Hat # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible i...
import datetime from django.conf import settings from django.core.exceptions import FieldError from django.db.backends.util import truncate_name from django.db.models.constants import LOOKUP_SEP from django.db.models.query_utils import select_related_descend, QueryWrapper from django.db.models.sql.constants import (SI...
"""Compressed Sparse Row matrix format""" from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['csr_matrix', 'isspmatrix_csr'] import numpy as np from scipy._lib.six import xrange from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \ ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
#!/usr/bin/python #-*- coding: iso-8859-15 -*- # SADR METEOLLSKY # http://www.sadr.fr # SEBASTIEN LECLERC 2018 # Inspired by Marcus Degenkolbe # http://indilib.org/develop/tutorials/151-time-lapse-astrophotography-with-indi-python.html # allsky frame script import sys, time, logging import PyIndi import pyfits import ...
# Copyright 2014 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
# -*- 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): # Adding model 'AnonymousUserId' db.create_table('student_anonymoususerid', ( ('id', self.gf('dj...
# -*- coding: utf-8 -*- # Description: # Author: Pawel Krupa (paulfantom) # Author: Ilya Mashchenko (ilyam8) # SPDX-License-Identifier: GPL-3.0-or-later import os from subprocess import Popen, PIPE from bases.FrameworkServices.SimpleService import SimpleService from bases.collection import find_binary class Execut...
#!/usr/bin/env python """ Helper script to update sampleproject's translation catalogs. When a bug has been identified related to i18n, this helps capture the issue by using catalogs created from management commands. Example: The string "Two %% Three %%%" renders differently using trans and blocktrans. This issue i...
''' Created on Nov 9, 2011 @author: sean ''' from graphlab.meta.testing import py2only from graphlab.meta.decompiler.tests import Base import unittest class Simple(Base): def test_assign(self): 'a = b' self.statement('a = b') def test_assign2(self): 'a = b = c' self.statemen...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.callback.default import CallbackModule as CallbackModule_default class CallbackModule(CallbackModule_default): # pylint: disable=too-few-public-methods,no-init ''' Override for the default callback m...
# Copyright 2013 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
""" These integration tests exist solely to test the interaction between pyggybank and GPG on the CLI. All attempts should be made to avoid extending these tests in preference for unit tests of the functions themselves (where necessary, mocking out the GPG interactions). TODO: It would be great to bring these tests in...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
''' Distribution function module for Barnes-Hutt n-body simulation developed by Matt Griffiths and James Archer. Example distribution written by Matt Griffiths, list idea concieved by James Archer. Special thanks to Matt Sanderson for ideas regarding distribution implementation. Avaliable for use under a GPL v3 licenc...
import os from importlib import import_module from django.core.exceptions import ImproperlyConfigured from django.utils._os import upath from django.utils.module_loading import module_has_submodule MODELS_MODULE_NAME = 'models' class AppConfig(object): """ Class representing a Django application and its con...
#!/usr/bin/env python '''Pygame module to control the display window and screen. This module offers control over the pygame display. Pygame has a single display Surface that is either contained in a window or runs full screen. Once you create the display you treat it as a regular Surface. Changes are not immediately ...
from decimal import Decimal from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.sql import AreaField from django.contrib.gis.measure import ( Area as AreaMeasure, Distance as DistanceMeasure, ) from django.core.exceptions import FieldError from django.db.models import Fl...
from Screens.Screen import Screen from Screens.HelpMenu import HelpableScreen from Components.FileList import FileList from Components.Sources.StaticText import StaticText from Components.MediaPlayer import PlayList from Components.config import config, getConfigListEntry, ConfigSubsection, configfile, ConfigText, Conf...
import agents as ag import envgui as gui import random # ______________________________________________________________________________ loc_A, loc_B = (1, 1), (2, 1) # The two locations for the Vacuum world def RandomVacuumAgent(): "Randomly choose one of the actions from the vacuum environment." p = ag.Ra...
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
#!/usr/bin/python from .main import * from .transaction import * from .bci import * from .deterministic import * from .blocks import * # Takes privkey, address, value (satoshis), fee (satoshis) def send(frm, to, value, fee=10000): return sendmultitx(frm, to + ":" + str(value), fee) # Takes privkey, "address1:va...
""" Parser that converts (C style) binary structs named tuples. The struct can be read from a file or a byte string. """ import struct import collections def _make_struct_class(name, names): class Struct(object): _names = names def __init__(self, **kwargs): vars(self).update(kwargs) ...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
#ImportModules import ShareYourSystem as SYS #ImportModules import ShareYourSystem as SYS LateralWeightVariablesList=[ [[-100.]] ] #Check for __LateralWeightVariable in LateralWeightVariablesList: #Define MyStabilizer=SYS.StabilizerClass( ).stationarize( _MeanWeightVariable=__Lateral...