text
stringlengths
475
200k
# Copyright 2016 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...
from __future__ import unicode_literals import os.path from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlparse, ) from ..utils import ( ExtractorError, ) class MySpassIE(InfoExtractor): _VALID_URL = r'http://www\.myspass\.de/.*' _TEST = { 'url': 'http://www.myspa...
from __future__ import absolute_import, unicode_literals from django.http import HttpResponseBadRequest from django.shortcuts import render_to_response from django.template import TemplateDoesNotExist from django.template.engine import Engine from django.utils.safestring import mark_safe try: from django.template...
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <[EMAIL]>' __docformat__ = 'restructuredtext en' import sys from xml.sax.saxutils import escape from lxml import etree from calibre import guess_...
from __future__ import unicode_literals import boto from boto.exception import S3ResponseError from boto.s3.lifecycle import Lifecycle, Transition, Expiration, Rule import sure # noqa from moto import mock_s3 @mock_s3 def test_lifecycle_create(): conn = boto.s3.connect_to_region("us-west-1") bucket = conn...
œœdef kthlargest(arr1, arr2, k): if len(arr1) == 0: return arr2[k] elif len(arr2) == 0: return arr1[k] mida1 = len(arr1)/2 mida2 = len(arr2)/2 if mida1+mida2<k: if arr1[mida1]>arr2[mida2]: return kthlargest(arr1, arr2[mida2+1:], k-mida2-1) else: ...
# Copyright 2015-2016 NEC Corporation. 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 requ...
__author__ = 'Neil Butcher' from PyQt4 import QtCore, QtGui from model_population import PopulationModel from Rota_System.UI.widget_addDel_list import AddDelListWidget from widget_person import PersonWidget class PopulationWidget(QtGui.QWidget): commandIssued = QtCore.pyqtSignal(QtGui.QUndoCommand) criticalC...
import sqlalchemy as sa from .exceptions import ImproperlyConfigured def coercion_listener(mapper, class_): """ Auto assigns coercing listener for all class properties which are of coerce capable type. """ for prop in mapper.iterate_properties: try: listener = prop.columns[0]....
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
""" lockfile.py - Platform-independent advisory file locks. Requires Python 2.5 unless you apply 2.4.diff Locking is done on a per-thread basis instead of a per-process basis. Usage: >>> lock = LockFile('somefile') >>> try: ... lock.acquire() ... except AlreadyLocked: ... print 'somefile', 'is locked already...
#!/usr/bin/env python # Try to determine how much RAM is currently being used per program. # Note per _program_, not per process. So for example this script # will report RAM used by all httpd process together. In detail it reports: # sum(private RAM for program processes) + sum(Shared RAM for program processes) # The...
import math, pygame from pygame.locals import * ############################################# ## Standard colors (RGB) BLACK = (20, 20, 40) WHITE = (255, 255, 255) BLUE = (0, 0, 255) GREEN = (0, 255, 0) RED = (255, 0, 0) ############################################# ## Customize plot here def function_to_print(x): ...
from sys import argv, stdout, stderr, exit from subprocess import call, PIPE from os import path, chdir import optparse import time def run(): parser = optparse.OptionParser() parser.add_option("-d", "--directory", type="str", dest="directory", default=".", help="Specify the directory th...
"""MAR (Mozilla ARchive) parser Author: Robert Xiao Creation date: July 10, 2007 """ from hachoir_core.endian import BIG_ENDIAN from hachoir_core.field import (RootSeekableFieldSet, FieldSet, String, CString, UInt32, RawBytes) from hachoir_core.text_handler import displayHandler, filesizeHandler from hachoir_cor...
try: unicode except NameError: raise ImportError from pybench import Test class ConcatUnicode(Test): version = 2.0 operations = 10 * 5 rounds = 60000 def test(self): # Make sure the strings are *not* interned s = unicode(u''.join(map(str,range(100)))) t = unicode(u''...
#!/usr/bin/env python # -*- coding: utf-8 -*- # author igor # Created by iFantastic on 16-6-3 import re import tarfile from functools import reduce import numpy as np import nltk from keras.preprocessing.sequence import pad_sequences from keras.layers.embeddings import Embedding from keras.layers.core import Dense, M...
from numpy.testing import assert_array_equal, assert_raises, run_module_suite from skimage import data from skimage.transform import pyramids image = data.astronaut() image_gray = image[..., 0] def test_pyramid_reduce_rgb(): rows, cols, dim = image.shape out = pyramids.pyramid_reduce(image, downscale=2) ...
from django import forms from .models import Company, SpecialOffer EXPEDITED_CHOICES = ( (0, 'No, we do not offer any expedited shipping options.'), (1, 'Yes we offer an expedited process for a fee.') ) class AddCompanyForm(forms.ModelForm): class Meta: model = Company fields = ['name'...
import sys from PyQt4 import QtGui, QtCore, QtNetwork from PyQt4.QtCore import SLOT, SIGNAL CAPTCHA_URL = 'http://www.titulky.com/captcha/captcha.php' MAX_CAPTCHA_LEN = 8 class CaptchaDialog(QtGui.QDialog): # Signal is emmited if captcha code is sucessfuly re-typed codeRead = QtCore.pyqtSignal() def...
# Copyright 2013 Intel Corporation # 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 require...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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 versio...
# getAllSubjectsCX import re import xmlrpclib import cx_Oracle Kim_Nguyen_G5 = '192.168.0.1' Kim_Nguyen_iMac = '192.168.0.1' Kim_Nguyen_MacBook = '192.168.0.1' Plone1 = '192.168.0.1' Plone3 = '192.168.0.1' def getAllSubjectsCX (self, usexml): request = self.REQUEST RESPONSE = request.RESPONSE remote_ad...
# Copyright (c) 2019, CRS4 # # 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 rights to # use, copy, modify, merge, publish, distribu...
# NamedType specification for constructed types import sys from pyasn1.type import tagmap from pyasn1 import error class NamedType: isOptional = 0 isDefaulted = 0 def __init__(self, name, t): self.__name = name; self.__type = t def __repr__(self): return '%s(%s, %s)' % ( self.__class__....
#!/usr/bin/python # 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 is distributed...
# Copyright 2014 OpenStack Foundation # # 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 ...
## ## NetApp Filer 'options' Module ## ## Copyright 2008, Red Hat, Inc ## John Eckersberg <[EMAIL]> ## ## This software may be freely redistributed under the terms of the GNU ## general public license. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to t...
# -*- coding: utf-8 -*- # streamtologger.py # Copyright (C) 2013 LEAP # # 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. ...
# -*- coding: utf-8 -*- from . import TaggerStorageAdapter import unittest import os import codecs class TaggerStorageAdapterTestCase(unittest.TestCase): taggerStorage = TaggerStorageAdapter() currentDirectory = "%s" % (os.path.dirname(os.path.realpath(__file__)), ) testTextsDirectory = "%s/../../../../d...
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
# Copyright 2010-2011 OpenStack Foundation # 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 ap...
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" enum TestEnum { "", "foo", "bar" }; interface TestEnumInterface { TestEnum doFoo(boolean arg); readonly attribute TestEnum foo; }; """) results = parser.finish...
# encoding: utf-8 """Utilities for working with data structures like lists, dicts and tuples. """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the f...
'''OpenGL extension ATI.text_fragment_shader This module customises the behaviour of the OpenGL.raw.GL.ATI.text_fragment_shader to provide a more Python-friendly API Overview (from the spec) The ATI_fragment_shader extension exposes a powerful fragment processing model that provides a very general means of expr...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2016 Alex Forencich 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...
# Copyright 2002-2009, Distributed Systems Architecture Group, Universidad # Complutense de Madrid (dsa-research.org) # # 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 ...
#-*-coding:utf-8-*- """ Copyright (c) 2012 wgx731 <[EMAIL]> 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 rights to use, copy, modify, merg...
# 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...
# -*- coding: utf-8 -*- """ werkzeug.testsuite.compat ~~~~~~~~~~~~~~~~~~~~~~~~~ Ensure that old stuff does not break on update. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest import warnings from werkzeug.testsuite import WerkzeugTestCase ...
from mirte.core import Module from six.moves import range import logging import threading try: import prctl except ImportError: prctl = None class ThreadPool(Module): class Worker(threading.Thread): def __init__(self, pool, l): self._name = None threading.Thread.__init...
# # This file is part of pysnmp software. # # Copyright (c) 2005-2016, Ilya Etingof <[EMAIL]> # License: http://pysnmp.sf.net/license.html # class ErrorIndication: """SNMPv3 error-indication values""" def __init__(self, descr=None): self.__value = self.__descr = self.__class__.__name__[0].lower() + self...
#!/usr/bin/env python # # Copyright 2018 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 require...
# Copyright 2016 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: utf8 -*- # This will create a dist directory containing the executable file, all the data # directories. All Libraries will be bundled in executable file. # # Run the build process by entering 'pygame2exe.py' or # 'python pygame2exe.py' in a console prompt. # # To build exe, python, pygame, and py2exe ha...
# Copyright 2011 OpenStack Foundation # # 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 ...
"""The tests for the input_boolean component.""" # pylint: disable=protected-access import unittest import logging from tests.common import get_test_home_assistant from homeassistant.bootstrap import setup_component from homeassistant.components.input_boolean import ( DOMAIN, is_on, toggle, turn_off, turn_on) fro...
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Scientific Package. This package holds all simulators, and # analysers necessary to run brain-simulations. You can use it stand alone or # in conjunction with TheVirtualBrain-Framework Package. See content of the # documentation-folder for more details. See also http://ww...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Benny Malengier # # 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 2 of the License, or # (at your option) ...
from enum import IntEnum import src.irulez.util as util from abc import ABC, abstractmethod import src.irulez.log as log from datetime import time from typing import List, Dict, Optional import src.irulez.constants as constants from threading import Timer logger = log.get_logger('button_domain') class ArduinoPinType...
# -*- coding: utf-8 -*- """ .. _tut-brainstorm-elekta-phantom: ========================================== Brainstorm Elekta phantom dataset tutorial ========================================== Here we compute the evoked from raw for the Brainstorm Elekta phantom tutorial dataset. For comparison, see :footcite:`TadelEt...
#!/usr/bin/env python ''' Copyright (c) 2013-2015, Joshua Pitts All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this li...
import numpy as np import itertools from collections import defaultdict import numpy as np import networkx as nx def is_op(thing): try: return thing._is_sigops_operator except AttributeError: return False class Operator(object): """Base class for operator instances understood by nengo....
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
from __future__ import print_function import find_mxnet import mxnet as mx import importlib import argparse import sys parser = argparse.ArgumentParser(description='network visualization') parser.add_argument('--network', type=str, default='vgg16_ssd_300', choices = ['vgg16_ssd_300', 'vgg16_ssd_512...
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Team-XBMC # # 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 versio...
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
# -*- coding: utf-8 -*- """ celery.utils.threads ~~~~~~~~~~~~~~~~~~~~ Threading utilities. """ from __future__ import absolute_import, print_function import os import socket import sys import threading import traceback from contextlib import contextmanager from celery.local import Proxy from celery.fiv...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
from __future__ import absolute_import from ..model import Model from ..core.properties import Any, Dict, Float, String, Int, Bool, Override class TileSource(Model): """ A base class for all tile source types. ``TileSource`` is not generally useful to instantiate on its own. In general, tile sources are used ...
#www.stuffaboutcode.com #Raspberry Pi, Minecraft Analogue Clock #import the minecraft.py module from the minecraft directory import minecraft.minecraft as minecraft #import minecraft block module import minecraft.block as block #import time, so delays can be used import time #import datetime, to get the time! import d...
# mssql/adodbapi.py # Copyright (C) 2005-2015 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 """ .. dialect:: mssql+adodbapi :name: adodbapi :dbapi: adodbapi :conn...
""" SmartCameraConfig class : handles config for the smart_camera project smart_camera.cnf file is created in the local directory other classes or files wishing to use this class should add import sc_config """ from os.path import expanduser import ConfigParser class SmartCameraConfig(object): def __init_...
""" Specific overrides to the base prod settings to make development easier. """ from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import # Don't use S3 in devstack, fall back to filesystem del DEFAULT_FILE_STORAGE MEDIA_ROOT = "/edx/var/edxapp/uploads" DEBUG = True USE_I18N = True TEMPLATE_DEB...
__all__ = ['imread', 'imread_collection'] import skimage.io as io try: from astropy.io import fits as pyfits except ImportError: try: import pyfits except ImportError: raise ImportError( "PyFITS could not be found. Please refer to\n" "http://www.stsci.edu/resources/...
""" Creates permissions for all installed apps that need permissions. """ from django.contrib.auth import models as auth_app from django.db.models import get_models, signals def _get_permission_codename(action, opts): return u'%s_%s' % (action, opts.object_name.lower()) def _get_all_permissions(opts): "Retu...
# Copyright (C) 2011 Google Inc. All rights reserved. # Copyright (C) 2011 Code Aurora Forum. 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 th...
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details """ Tests for TypedPropertyCollection class. """ __version__='''$Id$''' from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, printLocation setOutDir(__name__) import os, sys, copy from os.path import join, basename, splitext i...
import json import logging from time import time from celery import current_task from django.db import reset_queries import dogstats_wrapper as dog_stats_api from lms.djangoapps.instructor_task.models import PROGRESS, InstructorTask from util.db import outer_atomic TASK_LOG = logging.getLogger('edx.celery.task') c...
from django.db.models.expressions import RawSQL def get_value(keys, dict_, default=None): """ Given a list of keys, search in a dict for the first matching keys (case insensitive) and return the value Note: the search is case insensitive. :param keys: list of possible keys :param dict_: :param...
from setuptools import setup setup( name='flask_signedcookies', version='1.0.0', url='https://github.com/lovette/flask_signedcookies', download_url = 'https://github.com/lovette/flask_signedcookies/archive/master.tar.gz', license='BSD', author='Lance Lovette', author_email='[EMAIL]', descr...
""" This tutorial introduces stacked denoising auto-encoders (SdA) using Theano. Denoising autoencoders are the building blocks for SdA. They are based on auto-encoders as the ones used in Bengio et al. 2007. An autoencoder takes an input x and first maps it to a hidden representation y = f_{\theta}(x) = s(Wx+b),...
# -*- coding: utf-8 -*- """ pygments.lexers._phpbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file loads the function names and their modules from the php webpage and generates itself. Do not alter the MODULES dict by hand! WARNING: the generation transfers quite much data over your ...
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
from __future__ import division, absolute_import, print_function r''' Test the .npy file format. Set up: >>> import sys >>> from io import BytesIO >>> from numpy.lib import format >>> >>> scalars = [ ... np.uint8, ... np.int8, ... np.uint16, ... np.int16, ... ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Matt Makai <[EMAIL]> # 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', ...
from __future__ import absolute_import, division, unicode_literals try: chr = unichr # flake8: noqa except NameError: pass from collections import deque from .constants import spaceCharacters from .constants import entities from .constants import asciiLetters, asciiUpper2Lower from .constants import digits, ...
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-26 04:10 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('orders', '0006_auto_20170424_2037'), ] operations ...
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2009 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://genshi.edgewall.org/wiki/License. # # This software consist...
"""The jewish_calendar component.""" import logging import hdate import voluptuous as vol from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME import homeassistant.helpers.config_validation as cv from homeassistant.helpers.discovery import async_load_platform _LOGGER = logging.getLogger(__name__)...
#!/usr/bin/env python # 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. import hashlib import json import logging import os import re import shutil import subprocess import sys import tempfile from proc...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2011 BAAMTU SARL (<http://www.baamtu.sn>). # contact: [EMAIL] # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General ...
""" The Tornado Framework By Ali Pesaranghader University of Ottawa, Ontario, Canada E-mail: apesaran -at- uottawa -dot- ca / alipsgh -at- gmail -dot- com """ import os import zipfile from os.path import basename class Archiver: """ This class stores results of experiments in .zip files for fut...
""" This is our testing framework. Goals: * it should be compatible with py.test and operate very similarly (or identically) * doesn't require any external dependencies * preferably all the functionality should be in this file only * no magic, just import the test file and execute the test functions, that's it * port...
import os, unittest from django.db import settings from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis.utils import GeoIP, GeoIPException # Note: Requires use of both the GeoIP country and city datasets. # The GEOIP_DATA path should be the only setting set (the directory # should contain links or ...
# 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 ...
# Copyright 2011 OpenStack Foundation # 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 requ...
# $HeadURL$ __RCSID__ = "$Id$" import urllib2, re, tarfile, os, types, sys, subprocess, urlparse, tempfile from DIRAC import gLogger, S_OK, S_ERROR from DIRAC.Core.Utilities import CFG, File, List class Distribution: cernAnonRoot = 'http://svn.cern.ch/guest/dirac' googleAnonRoot = 'http://dirac-grid.googlecode....
# -*- encoding: utf-8 -*- # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
# 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. import asn1 import hashlib import os # This file implements very minimal certificate and OCSP generation. It's # designed to test revocation checking. ...
import itertools from hachoir_core.field import MissingField class FakeArray: """ Simulate an array for GenericFieldSet.array(): fielset.array("item")[0] is equivalent to fielset.array("item[0]"). It's possible to iterate over the items using:: for element in fieldset.array("item"): ...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """Ensure that rate limiting is enabled by default. """ orm['util.RateLimitConfiguration'].objects.create(enable...
class FileProxyMixin(object): """ A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file """ encoding = property(la...
#!/usr/bin/python # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # 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', ...
''' Mesh Manipulation Example ========================= This demonstrates creating a mesh and using it to deform the texture (the kivy log). You should see the kivy logo with a five sliders to right. The sliders change the mesh points' x and y offsets, radius, and a 'wobble' deformation's magnitude and speed. This ex...
from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class City3D(models.Model): name = models.CharField(max_length=30) point = models.PointField(dim=3) objects = models.GeoManager() def __str__(self): return self.n...
from google.appengine.ext import db from google.appengine.api import users from json import JSONDecoder class DictModel(db.Model): def to_dict(self): decoder = JSONDecoder() result = dict( [ (p[:-len('_json')], decoder.decode(getattr(self, p))) if p.endswith('_json') el...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Matt Martz <[EMAIL]>, and others # # 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 Lice...
#!/usr/bin/env python3 """ # OpenWrt download directory cleanup utility. # Delete all but the very last version of the program tarballs. # # Copyright (C) 2010-2015 Michael Buesch <[EMAIL]> # Copyright (C) 2013-2015 OpenWrt.org """ from __future__ import print_function import sys import os import re import getopt # ...