text
stringlengths
475
200k
""" Since this file contains Python 3 specific syntax, it's named without a test_ prefix so the test runner won't try to import it. Instead, the test class is imported in test_debug.py, but only on Python 3. This filename is also in setup.cfg flake8 exclude since the Python 2 syntax error (raise ... from ...) can't be...
# -*- coding: utf-8 -*- # Django settings for the mozillians project. import logging import os.path import sys from funfactory.manage import path from funfactory.settings_base import * # noqa from funfactory.settings_base import JINJA_CONFIG as funfactory_JINJA_CONFIG from urlparse import urljoin from django.utils....
# (c) 2012-2014, Michael DeHaan <[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 your option) any later version. ...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer WMS GetLegendGraphic. From build dir, run: ctest -R PyQgsServerWMSGetLegendGraphic -V .. 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 Free Software Foundati...
# pylint: disable=missing-docstring from lettuce import world, step from selenium.webdriver.common.keys import Keys from xmodule.modulestore.django import modulestore VIDEO_BUTTONS = { 'CC': '.hide-subtitles', 'volume': '.volume', 'play': '.video_control.play', 'pause': '.video_control.pause', 'ha...
# -*- coding: UTF-8 -*- ############################################################################## # # OERPLib # Copyright (C) 2013 Sébastien Alix. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by ...
# -*- coding: utf-8 -*- import rospy import numpy as np import cv2 import os.path import rospy from tensorflow_node.input import InputLayer class OpenCVInputLayer(InputLayer): """ Contains OpenCV to feed in video feeds to TF. """ def __init__(self, batch_size=1, output_size=[28, 28], input="", numb...
# 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 ...
# Copyright (C) 2011 REES Marche <http://www.reesmarche.org> # # This file is part of ``django-flexi-auth``. # ``django-flexi-auth`` 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, version 3 of the Lic...
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <[EMAIL]> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # vers...
import sys import config import os.path global have_gtk have_gtk = False #if not sys.executable.endswith("pythonw.exe"): # print "PYTHON PATH =",sys.path try: import pygtk pygtk.require('2.0') import gtk have_gtk = True except Exception,e: if sys.platform=="win32": try: from ctypes import c_int, WINFUNC...
# -*- coding: utf-8 -*- from .baseapi import BaseAPI, GET, POST, DELETE class StickySesions(object): """ An object holding information on a LoadBalancer's sticky sessions settings. Args: type (str): The type of sticky sessions used. Can be "cookies" or "none" cookie_name (str,...
# postgresql/pypostgresql.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Support for the PostgreSQL database via py-postgresql. Connecting -----...
# -*- coding: utf-8 -*- from tw.api import WidgetsList from tw.forms import TableForm from tw.forms.fields import HiddenField from budget.model import DBSession from budget.model import * from budget.widgets.components import * #class SearchForm(RPACForm): # # group_options = DBSession.query(Group.group_id,...
# -*- 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 field 'PaidCourseRegistration.mode' db.add_column('shoppingcart_paidcourseregistration', 'mode', ...
# $Id: __init__.py 6433 2010-09-28 08:21:25Z milde $ # Authors: David Goodger <[EMAIL]>; Ueli Schlaepfer # Copyright: This module has been placed in the public domain. """ This package contains modules for standard tree transforms available to Docutils components. Tree transforms serve a variety of purposes: - To tie...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
from django.db.models import signals from django.utils.functional import curry from django.conf import settings from audit_log import registration from audit_log.models import fields from audit_log.models.managers import AuditLogManager def _disable_audit_log_managers(instance): for attr in dir(instance): ...
""" Tests for `backfill_course_outlines` Studio (cms) management command. """ from django.core.management import call_command from opaque_keys.edx.keys import CourseKey from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from openedx.core.djangoapps.content.learning_sequences.api import ...
# -*- coding: utf-8 -*- # # SelfTest/Hash/test_SHA256.py: Self-test for the SHA-256 hash function # # Written in 2008 by Dwayne C. Litzenberger <[EMAIL]> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedicat...
from .primitive import * from ..rect import Rect from .unicode import NAME_TO_UNICODE import re import time as ti class Text(Primitive): def __init__(self, text, font_path, size, align="center"): super(Text, self).__init__() self.text = text self.size = int(size) self.align = align # Test if icon icon =...
#!/usr/bin/python # (c) 2016, Leandro Lisboa Penz <lpenz at lpenz.org> # # 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 yo...
# Copyright 2010 Google Inc. # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Eucalyptus Systems, Inc. # # 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 re...
import numpy as np from learning.dataset import CalTechSilhouettes from learning.preproc import PermuteColumns from learning.termination import LogLikelihoodIncrease, EarlyStopping from learning.monitor import MonitorLL, DLogModelParams, SampleFromP from learning.training import Trainer from learning.models.rws imp...
import os import subprocess import sys import time from multiprocessing import cpu_count, Queue, Process from test import Test class Message(object): "Message exchanged in the TestSet message queue" pass class MessageTaskNew(Message): "Stand for a new task" def __init__(self, task): self...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
import copy import inspect from importlib import import_module from django.db import router from django.db.models.query import QuerySet from django.utils import six from django.utils.encoding import python_2_unicode_compatible def ensure_default_manager(cls): """ Ensures that a Model subclass contains a defa...
import data_utils import numpy as np PATH = '../data/twitter/' class Twitter(object): def __init__(self, path=PATH): # data metadata, idx_q, idx_a = data_utils.load_data('../data/') # get dictionaries i2w = metadata['idx2w'] w2i = metadata['w2idx'] ...
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. # All rights reserved. # # 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 # without limitation the right...
import adddeps #fix sys.path import argparse import logging import opentuner from opentuner.search.manipulator import (ConfigurationManipulator, IntegerParameter, FloatParameter) from opentuner.search.objective import MinimizeTime fro...
from frappe import _ def get_data(): return { "Accounts": { "color": "#3498db", "icon": "icon-money", "type": "module" }, "Activity": { "color": "#e67e22", "icon": "icon-play", "label": _("Activity"), "link": "activity", "type": "page" }, "Buying": { "color": "#c0392b", "icon":...
"""Generic MIME writer. This module defines the class MimeWriter. The MimeWriter class implements a basic formatter for creating MIME multi-part files. It doesn't seek around the output file nor does it use large amounts of buffer space. You must write the parts out in the order that they should occur in the final f...
# Authors: Tal Linzen <[EMAIL]> # Teon Brooks <[EMAIL]> # Denis A. Engemann <[EMAIL]> # Jona Sassenhagen <[EMAIL]> # Marijn van Vliet <[EMAIL]> # # License: BSD (3-clause) from collections import namedtuple from inspect import isgenerator import warnings from ..externals.six import ...
import os from setuptools import find_packages, setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() def requirements(fname): return [line.strip() for line in open(os.path.join(os.path.dirname(__file__), fname))] setup( name = "mwmetrics", version = ...
""" This encapsulates the logic for displaying filters in the Django admin. Filters are specified in models with the "list_filter" option. Each filter subclass knows how to display a filter for a field that passes a certain test -- e.g. being a DateField or ForeignKey. """ import datetime from django.contrib.admin.op...
"""The tests for the Scene component.""" import io import unittest from homeassistant.setup import setup_component from homeassistant import loader from homeassistant.components import light, scene from homeassistant.util import yaml from tests.common import get_test_home_assistant class TestScene(unittest.TestCase...
import os import unittest import shelve import glob from test import test_support class TestCase(unittest.TestCase): fn = "shelftemp" + os.extsep + "db" def test_close(self): d1 = {} s = shelve.Shelf(d1, protocol=2, writeback=False) s['key1'] = [1,2,3,4] self.assertEqual(s['ke...
################################################################# # seMopathRecorder.py # Originally from MopathRecorder.py # Altered by Yi-Hong Lin, [EMAIL], 2004 # # We have to change something about data flow and UI # so the curves data can be saved into our dataHolder. # Other things we have changed here is that we...
from __future__ import division import pytest import numpy as np from numpy.testing import assert_allclose from keras.models import Model, Sequential from keras.layers import Input, Dense, Concatenate from keras.optimizers import SGD import keras.backend as K from rl.util import clone_optimizer, clone_model, huber_lo...
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
from nose.tools import assert_equal, assert_raises, assert_not_equal import networkx as nx import io import tempfile import os from networkx.readwrite.p2g import * from networkx.testing import * class TestP2G: def setUp(self): self.G=nx.Graph(name="test") e=[('a','b'),('b','c'),('c','d'),('d','e'...
####################################################################### # # Renderer for Dreambox-Enigma2 # Coded by shamann (c)2010 # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundati...
import unittest from unittest.mock import ( call, _Call, create_autospec, MagicMock, Mock, ANY, _CallList, patch, PropertyMock ) from datetime import datetime class SomeClass(object): def one(self, a, b): pass def two(self): pass def three(self, a=None): pass class AnyT...
"""Loading unittests.""" import os import re import sys import traceback import types import functools from fnmatch import fnmatch from . import case, suite, util __unittest = True # what about .pyc or .pyo (etc) # we would need to avoid loading the same tests multiple times # from '.py', '.pyc' *and* '.pyo' VALID...
"""Unit tests for numbers.py.""" import math import operator import unittest from numbers import Complex, Real, Rational, Integral class TestNumbers(unittest.TestCase): def test_int(self): self.assertTrue(issubclass(int, Integral)) self.assertTrue(issubclass(int, Complex)) self.assertEqua...
# 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...
import sys from django.conf import settings from django.core.exceptions import MiddlewareNotUsed from django.core.signals import got_request_exception from django.http import HttpResponse from django.template import engines from django.template.response import TemplateResponse from django.test import RequestFactory, S...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import threading import contextlib from socorro.external.hbase import hbase_client from configman.config_manager import...
#!/usr/bin/env python ''' This is a sample for histogram plotting for RGB images and grayscale images for better understanding of colour distribution Benefit : Learn how to draw histogram of images Get familier with cv2.calcHist, cv2.equalizeHist,cv2.normalize and some drawing functions Level : Beginner or...
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import AuthProvider from sentry.testutils import TestCase, PermissionTestCase class OrganizationHomePermissionTest(PermissionTestCase): def setUp(self): super(OrganizationHomePermissionTest, self).setU...
r"""UUID objects (universally unique identifiers) according to RFC 4122. This module provides immutable UUID objects (class UUID) and the functions uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 UUIDs as specified in RFC 4122. If all you want is a unique ID, you should probably call uuid1() ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable-all import os import re import sys import codecs import shutil import argparse from textwrap import dedent from chardet import detect from pysrt import SubRipFile, SubRipTime, VERSION_STRING def underline(string): return "\033[4m%s\033[0m" % string...
"""Base geometry class and utilities """ from functools import wraps import sys import warnings from shapely.coords import CoordinateSequence from shapely.geos import lgeos from shapely.impl import DefaultImplementation from shapely import wkb, wkt GEOMETRY_TYPES = [ 'Point', 'LineString', 'LinearRing', 'Poly...
"""Blocking and non-blocking HTTP client interfaces. This module defines a common interface shared by two implementations, ``simple_httpclient`` and ``curl_httpclient``. Applications may either instantiate their chosen implementation class directly or use the `AsyncHTTPClient` class from this module, which selects an...
from importlib import util from . import util as test_util import imp import sys import types import unittest class ModuleForLoaderTests(unittest.TestCase): """Tests for importlib.util.module_for_loader.""" def return_module(self, name): fxn = util.module_for_loader(lambda self, module: module) ...
# Copyright 2020 IBM Corp. 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 or agre...
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # 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 -*- from __future__ import unicode_literals import os PRJ_PATH = os.path.abspath(os.path.curdir) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Alice Bloggs', '[EMAIL]'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ...
#!/usr/bin/env python #===- cindex-includes.py - cindex/Python Inclusion Graph -----*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===---------------------------------------...
# A module to expose various thread/process/job related structures and # methods from kernel32 # # The MIT License # # Copyright (c) 2006 the Mozilla Foundation <http://www.mozilla.org> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files...
""" Helper functions for loading environment settings. """ from __future__ import print_function import os import sys import json from lazy import lazy from path import Path as path import memcache class Env(object): """ Load information about the execution environment. """ # Root of the git reposito...
# Taken from Python 2.7 with permission from/by the original author. import warnings import sys from django.utils import six from django.utils.deprecation import RemovedInDjango19Warning warnings.warn("django.utils.importlib will be removed in Django 1.9.", RemovedInDjango19Warning, stacklevel=2) def _resolve_...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006 (ita) "TeX/LaTeX/PDFLaTeX support" import os, re import Utils, TaskGen, Task, Runner, Build from TaskGen import feature, before from Logs import error, warn, debug re_tex = re.compile(r'\\(?P<type>include|input|import|bringin|lstinputlisting){(?P<file>[^{}]...
from neuron import h h.load_file('mitral.hoc') from getmitral import getmitral def mkmitral(gid): nrn = getmitral(gid) m = h.Mitral() m.createsec(len(nrn.dend), len(nrn.tuft)) m.subsets() m.topol(0) # need to connect secondary dendrites explicitly for i, d in enumerate(nrn.dend): # <<< check m...
# Copyright (C) 2011 Google Inc. 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 # notice, this list of conditions and the f...
"""Bounded-Variable Least-Squares algorithm.""" from __future__ import division, print_function, absolute_import import numpy as np from numpy.linalg import norm, lstsq from scipy.optimize import OptimizeResult from .common import print_header_linear, print_iteration_linear def compute_kkt_optimality(g, on_bound): ...
#!/usr/bin/env python """ This program generates a pkl file containing a list of dictionaries. Each dictionary in the list represents a condensedlet. The dictionaries have the structure: {'core': array of ints of core points, 'condensed': array of ints of condensed points, 'plume': array of ints of plume points, 'u_con...
import weakref from PySide import QtGui, QtCore from resources import HEX_COLOUR_NONE, HEX_COLOUR_RED, HEX_COLOUR_GREEN, HEX_COLOUR_BLUE class BaseKey(QtGui.QPushButton): KEY_TYPE = "default" KEY_CLICKED = QtCore.Signal(weakref.ReferenceType) BG_COLOUR = HEX_COLOUR_NONE def __init__(self, *args, **kw...
#!/usr/bin/env python2.7 # # Copyright (C) 2016 INRA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program ...
""" Content library unit tests that require the CMS runtime. """ from django.test.client import RequestFactory from django.test.utils import override_settings from contentstore.tests.utils import AjaxEnabledTestClient, parse_json, switch_ga_global_course_creator from contentstore.utils import reverse_url, reverse_usage...
# -*- coding: iso-8859-15 -*- # ============================================================================= # Copyright (c) 2004, 2006 Sean C. Gillies # Copyright (c) 2005 Nuxeo SARL <http://nuxeo.com> # # Authors : Sean Gillies <[EMAIL]> # Julien Anguenot <[EMAIL]> # # Contact email: [EMAIL] # ============...
import functools import itertools import numpy import dask import dask.array from . import _compat from . import _pycompat def _broadcast_uv(u, v): U = _compat._atleast_2d(u) V = _compat._atleast_2d(v) if U.ndim != 2: raise ValueError("u must be a 1-D or 2-D array.") if V.ndim != 2: ...
# -*- coding: utf-8 -*- """ Simple transfomer: handle OpenID elements. Ie: an openid namespace is added and the usual 'link' elements for openid are exchanged against a namespaced version. @summary: OpenID transformer module. @requires: U{RDFLib package<http://rdflib.net>} @organization: U{World Wide Web Consortium<ht...
# -*- coding: UTF-8 -*- """ This is a HTTP/REST client library, primarily designed for use as a `Robot Framework <http://robotframework.org/>`_ test library. It provides keywords for calling REST-style services and inspecting the response. Copyright (c) 2008 Niklas Lindström <[EMAIL]>, all rights reserved. """ __auth...
# -*- coding: utf-8 -*- # 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 Apach...
from django.db.models.fields import NOT_PROVIDED from django.utils.functional import cached_property from .base import Operation class FieldOperation(Operation): def __init__(self, model_name, name): self.model_name = model_name self.name = name @cached_property def model_name_lower(self...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # Copyright (C) 2011 University of Dundee & Open Microscopy Environment. # All rights reserved. # # 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 Fou...
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestMethods { void basic(); static void basicStatic(); void basicWithSimpleArgs(boolean arg1, byte arg2, unsigned long arg3); boolean basicBoolean(); static boolean basicStaticBoolean...
#!/usr/bin/env python #-*- coding:utf-8 -*- """ disable highlight focused widget Tested environment: Mac OS X 10.6.8 http://stackoverflow.com/questions/1987546/qt4-stylesheets-and-focus-rect """ import sys try: from PySide import QtCore from PySide import QtGui except ImportError: from PyQt4 import Q...
import os, time import zmq from message_pb2 import Container from types_pb2 import * from optparse import OptionParser parser = OptionParser() parser.add_option("-c", "--cmd", dest="cmduri", default="tcp://127.0.0.1:5571", help="command URI") parser.add_option("-r", "--response", dest="responseuri"...
import subprocess, sys # gets the first link on any webpage def get_next_target(page): copy = page repl = ['= ', ' =', ' = '] for i in range(0, len(repl)): copy = copy.replace(repl[i], "=") first_link_start = copy.find("<a") if (first_link_start == -1): return None else: ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
#!/usr/bin/env python # (c) 2015, Marc Abramowitz <[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 your option)...
# # Kiwi: a Framework and Enhanced Widgets for Python # # Copyright (C) 2006 Johan Dahlin <[EMAIL]> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, ...
# -*- 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 ...
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.core.exceptions import FieldError from django.db.models.fields import DateField, FieldDoesNotExist from django.db.models.sql.constants import * from django.db.models.sql.datastructures import Date from django.db.models...
from confluent_kafka import avro from confluent_kafka.avro import AvroProducer from lipsum import generate_words import os import random SCHEMA_REGISTRY_URL = 'http://172.17.0.5:8081' BOOTSTRAP_SERVERS = '172.17.0.4' AVSC_DIR = os.path.dirname(os.path.realpath(__file__)) KEY_SCHEMA = avro.load(os.path.join(AVSC_DIR, ...
#!/usr/bin/env python # Copyright (c) 2009 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 building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output b...
from __future__ import absolute_import from __future__ import with_statement import socket from celery import events from celery.app import app_or_default from celery.tests.utils import unittest class MockProducer(object): raise_on_publish = False def __init__(self, *args, **kwargs): self.sent = []...
# -*- coding: utf-8 -*- """The operating system path specification resolver helper implementation.""" from dfvfs.file_io import os_file_io from dfvfs.lib import definitions from dfvfs.resolver_helpers import manager from dfvfs.resolver_helpers import resolver_helper from dfvfs.vfs import os_file_system class OSResol...
# Copyright 2013-2014 MongoDB, Inc. # # 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 writin...
# -*- coding: utf-8 -*- # # (c) 2015, René Moser <[EMAIL]> # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the ...
# Copyright 2012 Google 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 applicable law or a...
##################################################################### # -*- coding: iso-8859-1 -*- # # # # Frets on Fire X (FoFiX) # # Copyright (C) 2009-2010 John Stumpo ...
# Copyright 2012 Nebula, 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 applicable law o...
import sys import os """ For this script to work you need the jack.mesh from /media/models in /data/assets You will have to manually put your txml file name down in the __main__ func to: --> fileName = "putFileNameHere.txml" <-- 1. Run this script on your tundra 1.x txml 2. This will create a...
import sys, datetime from amara.writers.struct import * from amara.namespaces import * tags = [u"xml", u"python", u"atom"] w = structwriter(indent=u"yes") w.feed( ROOT( E((ATOM_NAMESPACE, u'feed'), {(XML_NAMESPACE, u'xml:lang'): u'en'}, E(u'id', u'urn:bogus:myfeed'), E(u'title', u'MyFeed'), ...
# Copyright 2015 Google Inc. # # 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...
from __future__ import absolute_import, division, unicode_literals from six import text_type from ..constants import scopingElements, tableInsertModeElements, namespaces # The scope markers are inserted when entering object elements, # marquees, table cells, and table captions, and are used to prevent formatting # fr...
''' Code by Richard Jones, released into the public domain. Beginnings of something like http://en.wikipedia.org/wiki/Thrust_(video_game) ''' import sys import math import euclid import primitives import pyglet from pyglet.window import key from pyglet.gl import * window = pyglet.window.Window(fullscreen='-fs' in ...