text
stringlengths
475
200k
#!/usr/bin/env python from collections import defaultdict import re import xml.etree.ElementTree as ET import yaml def etna_to_yml(xml): defs = xml.find('functions') functions = defaultdict(dict) for f in defs.findall('function'): name = f.get('name') ret = f.find('return') if ret ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import pip from setuptools import setup, find_packages from pip.req import parse_requirements import fabrik_cli if sys.argv[-1] == "publish": os.system("python setup.py sdist upload") sys.exit() package_exclude = ("tests*", "examples*") pac...
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-12 01:45 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migration...
# Copyright 2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Tests for our graceful daemon shutdown support.""" __metaclass__ = type from twisted.application import service from twisted.internet.defer import Deferred from twisted.intern...
# -*- coding: utf-8 -*- # Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # 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 # # ...
#!/usr/bin/env python2 ## -*- coding: utf-8 -*- ## ## Jonathan Salwan - 2014-05-17 - ROPgadget tool ## ## http://twitter.com/JonathanSalwan ## http://shell-storm.org/project/ROPgadget/ ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public Licen...
# Copyright 2018 Open Source Robotics Foundation, 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...
"""This module contains the quick sort method (quick_srt), which performs an in-place sort on a passed in list. Quick sort has a best case time complexity of O(n log n) when all elements are equal, and a worst case of O(n2). Quick sort is not stable or adaptive, but it is robust and has low overhead. This module was c...
'''Arsenal API IpAddresses.''' # Copyright 2015 CityGrid Media, LLC # # 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...
import logging import gi; gi.require_version('Gtk', '3.0') from gi.repository import Gtk from src.gui_constants import BOX_SPACING, PADDING # This class is a container that will hold the material information class MaterialWidget(Gtk.Box): def __init__(self): logging.debug("Initializing Material Widget") ...
from app import app from app import db from flask import request, Response, abort, \ render_template, redirect, url_for, session from json import dumps, loads from werkzeug import secure_filename import os import re from app.models import * from app.forms import * PER_PAGE = 5 @app.route('/') @app.route('/index')...
import mock import pytest from pyramid_swagger import load_schema @pytest.fixture def mock_validator(): return mock.Mock(spec=['validate', 'is_type']) def test_required_validator_bool_is_missing(): schema = {'paramType': 'body', 'name': 'body'} errors = list(load_schema.required_validator(None, True, {...
#!/usr/bin/env python # =================================== # Copyright (c) Microsoft Corporation. All rights reserved. # See license.txt for license information. # =================================== from contextlib import contextmanager import os import sys import imp protocol = imp.load_source('protocol', '../prot...
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of GNUHAWK. # # GNUHAWK is free software: you can redistribute it and/or modify is under the # terms of the GNU General Public License as published by ...
# Copyright 2012 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...
""" dice.py: written by Scaevolus 2008, updated 2009 simulates dicerolls This is from skybot. """ NAME="Dice roll generator" DESC="Sumilates dice rolls" import re import random whitespace_re = re.compile(r'\s+') valid_diceroll = r'^([+-]?(?:\d+|\d*d(?:\d+|F))(?:[+-](?:\d+|\d*d(?:\d+|F)))*)( .+)?$' valid_diceroll_re...
# Portions Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # Copyright (C) 2007 Daniel Holth <[EMAIL]> # This is a stripped-down version of the original bzr-svn transport.py, # Copyright (C) 2006 Jelmer...
# 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 use ...
from pygraph import * node1 = Node(1) node2 = Node(2) node3 = Node(3) node4 = Node(4) node5 = Node(5) edge12 = Edge(node1, node2) edge15 = Edge(node1, node5) edge31 = Edge(node3, node1) my_graph = Graph() my_graph.add_node(node1) my_graph.add_node(node2) my_graph.add_node(node3) my_graph.add_node(node4) my_graph.ad...
# 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 # distributed unde...
# This file is part of rhizi, a collaborative knowledge graph editor. # Copyright (C) 2014-2015 Rhizi # # 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...
# -*- 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...
from __future__ import print_function from six.moves.urllib.parse import urljoin from twisted.internet import reactor from twisted.web import server, resource, static, util class SiteTest(object): def setUp(self): super(SiteTest, self).setUp() self.site = reactor.listenTCP(0, test_site(), interf...
from homecon.tests import common from homecon.core.state import State from homecon.core.event import Event from homecon.plugins.shading import Shading class TestShading(common.TestCase): def test_listen_add_shading(self): plugin = Shading() s = State.add('my_shading', parent=None, type='screen')...
""" Implement some datastore based on SQL databases """ import sqlite3 from werkzeug.exceptions import NotFound, BadRequest from .base import DataStore from rest_api_framework.models import PkField class SQLiteDataStore(DataStore): """ Define a sqlite datastore for your ressource. you have to give __ini...
""" In this module, we define the coordinate representation classes, which are used to represent low-level cartesian, spherical, cylindrical, and other coordinates. """ import abc import functools import operator import inspect import warnings import numpy as np import astropy.units as u from erfa import ufunc as erf...
import numpy as np from nose.tools import assert_true, assert_false, assert_equal, assert_almost_equal from numpy.testing import assert_array_equal, assert_array_almost_equal import fos.core.collision as cll def test_mindistance_segment2track(): print 'touching one segment only' print cll.mindistance_seg...
# http://www.pgroup.com from __future__ import division, absolute_import, print_function import sys from numpy.distutils.fcompiler import FCompiler, dummy_fortran_file from sys import platform from os.path import join, dirname, normpath compilers = ['PGroupFCompiler', 'PGroupFlangCompiler'] class PGroupFCompiler(F...
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='DjangoBlog', description='A generic...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './UI/SearchWidget.ui' # # Created: Tue Nov 18 17:53:58 2014 # by: PyQt5 UI code generator 5.3.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_SearchWidget(object): def...
import os import re from opsbro.collector import Collector # DMI have lot of useful information that detectors can use to know lot about the platform/hardware class Dmidecode(Collector): def launch(self): logger = self.logger logger.debug('getDmidecode: start') res = {} #...
# # Copyright (C) 2003 Rational Discovery LLC # All Rights Reserved """ unit testing code for knn models """ from rdkit import RDConfig import unittest from rdkit.ML.Data import DataUtils, MLData from rdkit.ML.KNN import CrossValidate, DistFunctions from rdkit.ML.KNN import KNNModel, KNNClassificationModel, KNNRegr...
from satchmo.configuration import * from django.utils.translation import ugettext_lazy as _ import logging log = logging.getLogger('purchaseorder.config') PAYMENT_MODULES = config_get('PAYMENT', 'MODULES') PAYMENT_MODULES.add_choice(('PAYMENT_PURCHASEORDER', _('Purchase Order'))) log.debug('added purchase order payme...
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Energi Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the...
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 VMware, 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/lic...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [EMAIL], All rights reserved. # LLNL-CODE-647188 # # F...
import argparse import os from utils import load_recon_error, calc_metric import csv import numpy as np import progressbar """ # ============================================================================= # OPTIONS # ============================================================================= parser = argparse.Argu...
from app.API_Rest.GeneradorPlanCarreras.Constantes import * from app.API_Rest.GeneradorPlanCarreras.my_utils import get_str_cuatrimestre, es_horario_valido_para_el_cuatrimestre LINEA_GUARDAR = """ arch.write("{};{}".format(int(value({}))) + "\\n")""" def guardar_variable_materia_i_en_cuatri_j(arch, parametros): ...
import os import sys import struct import socket import enum import pnet from binascii import unhexlify from pnet.bpf import bpf, bpf_stmt, bpf_jump, Op from .options import DHCPOption, Options COOKIE = b'c\x82Sc' # [0x63, 0x82, 0x53, 0x63]) if sys.version_info >= (3, 0): ord = lambda x: x class DHCPOpCode(e...
# Copyright 2007 John Kasunich and Jeff Epler # # 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) any later version. # # Th...
from __future__ import division, absolute_import, print_function import numpy as np import numpy.matlib from numpy.testing import assert_array_equal, assert_ def test_empty(): x = numpy.matlib.empty((2,)) assert_(isinstance(x, np.matrix)) assert_(x.shape, (1, 2)) def test_ones(): assert_array_equal(n...
from __future__ import print_function import os import httplib2 from apiclient import discovery import logging from functools import wraps import creds # time to stop _MAX_COUNT = 10000 # Page size for API list call _PAGE_SIZE = 500; _LOG_FILENAME = 'listfiles.log' _LOG_FILE_PATH = 'log' if not os.path.exists(_L...
# 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...
# # Copyright (C) 2004 SIPfoundry Inc. # Licensed by SIPfoundry under the GPL license. # # Copyright (C) 2004 SIP Forum # Licensed to SIPfoundry under a Contributor Agreement. # # # This file is part of SIP Forum Test Framework. # # SIP Forum Test Framework is free software; you can redistribute it # and/or modify it ...
import src.gen as gen import src.network as ann import cv2 import src.util as util import numpy as np import argparse parser = argparse.ArgumentParser() parser.add_argument("--plot", help="run plot", action="store_true") parser.add_argument("--test", help="run test", action="store_true") parser.add_argument("--cont", ...
from functools import wraps from pycloudia.utils.defer import inline_callbacks, return_value, maybe_deferred from pycloudia.cluster.consts import HEADER, STATUS from pycloudia.cluster.interfaces import IRequestPackage __all__ = [ 'ResolverMeta', 'resolve_errors', 'resolve_method', ] class ResolverMeta(...
# # Copyright 2012-2016 Red Hat, 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 2 of the License, or # (at your option) any later version. # # This program is distributed ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2019, 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', ...
''' Model of the FeS eutectic liquidus courtousy of Nicholas Knezek with slight modifications. ''' import numpy as np import matplotlib.pyplot as plt import scipy as sp import burnman import burnman.minerals as minerals import burnman.mineral_helpers as bmb import burnman.composite as composite from scipy.interpolat...
from util import text def format_time(seconds, count=3, accuracy=6, simple=False): """ Takes a length of time in seconds and returns a string describing that length of time. This function has a number of optional arguments that can be combined: SIMPLE: displays the time in a simple format >>> form...
from Screens.Screen import Screen from Components.ConfigList import ConfigListScreen, ConfigList from Components.ActionMap import ActionMap from Components.Sources.FrontendStatus import FrontendStatus from Components.Sources.StaticText import StaticText from Components.config import config, configfile, getConfigListEnt...
# -*- 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...
# 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. from __future__ import absolute_import from telemetry.internal.actions import page_action from telemetry.internal.actions import utils from telemetry.util im...
from __future__ import unicode_literals import json import time from .common import InfoExtractor from ..compat import compat_urllib_parse from ..utils import ( ExtractorError, sanitized_Request, ) class HypemIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?hypem\.com/track/(?P<id>[^/]+)/' _TEST =...
# Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of the G...
"""The tests for the Demo vacuum platform.""" import unittest from homeassistant.components import vacuum from homeassistant.components.vacuum import ( ATTR_BATTERY_LEVEL, ATTR_COMMAND, ATTR_ENTITY_ID, ATTR_FAN_SPEED, ATTR_FAN_SPEED_LIST, ATTR_PARAMS, ATTR_STATUS, DOMAIN, ENTITY_ID_ALL_VACUUMS, SERVICE...
# 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 use ...
#!/usr/env/python # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.join(os.environ['SPARK_HOME'], "python")) sys.path.append(os.path.join(os.environ['SPARK_HOME'], "python/lib/py4j-0.8.2.1-src.zip")) import argparse import pyspark from pyspark import SparkContext # return the pair: ("product_id", ...
from adhoc import AdHoc import math import random class AdHocTD(AdHoc): #Enum for importance metrics VISIT_IMPORTANCE, Q_IMPORTANCE = range(2) def __init__(self, budgetAsk=1000, budgetAdvise=1000,stateImportanceMetric=VISIT_IMPORTANCE,seed=12345, port=12345, epsilon=0.1, alpha=0.1, gamma=0.9, decay...
#!/usr/bin/env python3 """ Demo of reading raw Bayer 10-bit data from Raspberry Pi camera chip using PiCamera module. Notes: 1) can only read full chip, no binning or ROI: 2592x1944 pixel image with current imaging chip 2) captures a single image 3) sudo apt-get install python3-picamera python3-scipy Michael Hirsch ht...
# From https://git.geekli.st/daveyoon/khan-academy-lite/blob/14ab3615f66bcdd737909e7951a250da8a10646b/python-packages/memory_profiler.py # LICENCE: MIT """Profile the memory usage of a Python program""" __version__ = '0.26' _CMD_USAGE = "python -m memory_profiler script_file.py" import time, sys, os, pdb import war...
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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...
import base64 import json import os import sys import pytest from flask import request from flump import MIMETYPE from flump.web_utils import get_json sys.path.append(os.path.join(os.path.join(sys.path[0], 'docs'), 'examples')) print(sys.path) example = __import__('sqlalchemy-auth') @pytest.fixture(scope='module')...
import StringIO from gzip import GzipFile """ author: Evan Fosmark source: http://www.evanfosmark.com/2008/12/python-wsgi-middleware-for-automatic-gzipping/2/ A WSGI middleware application that automatically gzips output to the client. Before doing any gzipping, it first checks the environ to see ...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
# -*- coding: utf-8 -*- import logging from django.conf import settings from django.core.management.base import BaseCommand, CommandError import MySQLdb as mysql class Command(BaseCommand): """Based on django_extension's reset_db command but simplifed and with support for all character sets defined in setti...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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 re import logging import datetime import json from json.encoder import JSONEncoder from xmodule.modulestore import Location from xmodule.modulestore.exceptions import ItemNotFoundError from contentstore.utils import get_modulestore, course_image_url from models.settings import course_grading from xmodule.fields...
#!/usr/bin/env python3 import socket, threading, pickle, sys ################################################################################ # Message content classes ################################################################################ class Message( object ): def __init__( self, message ): ...
#!/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)...
from pysal.cg import Point, LineSegment, Line, Ray, Chain, Rectangle, Polygon import doctest import unittest class test_Point(unittest.TestCase): def test___init__1(self): """ Tests whether points are created without issue. Test tag: <tc>#tests#Point.__init__</tc> """ for...
# encoding: 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 'Notification.notification_type' db.add_column('notifications_notification', 'notification_...
import unittest import warnings import numpy import chainer from chainer import cuda from chainer import functions as F from chainer import testing from chainer.testing import attr from chainer.testing import condition def recall(preds, ts, dtype, label_num, ignore_label): tp = numpy.zeros((label_num,), dtype=n...
import time from bartendro.router import driver import logging import logging.handlers import os LOG_SIZE = 1024 * 500 # 500k maximum log file size LOG_FILES_SAVED = 3 # number of log files to compress and save software_only = False handler = logging.handlers.RotatingFileHandler(os.path.join("logs", "artificial_...
from cosmo_tester.test_suites.cli import ( _cleanup_profile, LINUX_OSES, _prepare, _test_cfy_install, _test_cfy_logs, _test_logs_context, _test_teardown, _test_upload_and_install, WINDOWS_OSES, ) def test_cli_deployment_flow(cli_tester, logger): for os in LINUX_OSES + WINDOWS_O...
import matplotlib as mpl import matplotlib.ticker as ticker from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt import os import string scale_pow = 5 def main(): #Get data from all sets using this list: #temps = [80,120,150,180,210,240,270,298] temps = [298,270,2...
# Copyright (c) 2012 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...
# Copyright 2008-2015 Nokia Solutions and Networks # # 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...
#!/usr/bin/python # # Copyright 2013 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 a...
#!/usr/bin/env python # Copyright (c) 2011 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. """Android system-wide tracing utility. This is a tool for capturing a trace that includes data from both userland and the kernel...
# # Copyright (C) 2008-2012, 2016 UNINETT # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # This program is distributed in ...
""" DotnetCoreBuild This tool run the 'dotnet' tool in 'build' mode for use with .Net Core """ # See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build?tabs=netcore2x # TODO add scanner import os, sys, os.path as path import SCons.Script from SCons.Environment import Environment from SCons...
from electrum.plugin import hook from electrum.util import print_msg, raw_input, print_stderr from electrum.logging import get_logger from .coldcard import ColdcardPlugin _logger = get_logger(__name__) class ColdcardCmdLineHandler: def get_passphrase(self, msg, confirm): raise NotImplementedError ...
""" Copyright (c) 2015, Liron Schif Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES...
from datetime import timedelta from django.conf import settings ICEKIT_EVENTS = getattr(settings, 'ICEKIT_EVENTS', {}) # Colors to show in admin drop-down. Users can choose other colors. # These are fairly randomly chosen - intention is to have a bright shade # and a dark shade, around the colour wheel, that is legi...
""" Provide a class to manage related record-based file. """ class Element(object): """ This is the base class for defining objects found in **record-based files** (rbf). It can be viewed as an atomic structure, a cinder block upon which rbf data structures are based. :param str name: n...
# -*- coding: utf-8 -*- import re from django.conf import settings from django.core.urlresolvers import reverse from django.utils.encoding import force_text from django.utils.http import urlencode from django.utils.six.moves.urllib.parse import urlparse import cms from cms.utils.conf import get_cms_setting # checks...
"""file_handler.py - File handler that takes care of opening archives and images.""" from __future__ import with_statement import os import shutil import tempfile import threading import re import cPickle import gtk from mcomix.preferences import prefs from mcomix import archive_extractor from mcomix import archive_t...
"""SCons.Platform.os2 Platform-specific initialization for OS/2 systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, ...
# coding=utf-8 # Author: CristianBB # Greetings to Mr. Pine-apple # URL: https://sickchill.github.io # # This file is part of SickChill. # # SickChill 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 ver...
from __future__ import unicode_literals import gzip from io import BytesIO from django.contrib.staticfiles.storage import CachedStaticFilesStorage, StaticFilesStorage from django.contrib.staticfiles.utils import matches_patterns from django.core.files.base import File class PipelineMixin(object): packing = Tr...
from plumber import ( plumbing, finalize, default, Behavior, ) from zope.interface import implementer from ..interfaces import IAttributes from ..utils import AttributeAccess from .common import ( Adopt, NodeChildValidate, ) from .nodify import Nodify from .storage import OdictStorage @plumbin...
from argparse import ArgumentParser from flask import Flask, render_template from database import DatabaseWrapper from stats import Stats from jira import JiraSettings from settings import SPRINT_NAME from time import strftime app = Flask(__name__) app.debug = True @app.route('/') def home_page(): return 'Homep...
#!/usr/bin/env python """Docker rpmbuild. Usage: docker-rpmbuild build [--config=<file>] [--docker-base_url=<url>] [--docker-timeout=<seconds>] [--docker-version=<version>] [--define=<option>...] ...
# -*- encoding: utf-8 -*- from abjad import * def test_selectiontools_ContiguousSelection__give_dominant_spanners_01(): r'''Find spanners that dominate donor_components. Apply dominant spanners to recipient_components. Withdraw donor_components from spanners. The operation can mangle spanners. Rem...
from lib.settings import db from lib.language.en import user_already_exist, user_pass_not_match from utils import make_password, check_password, clean_input, make_token, now #settings for table USERS = 'users' PROJECTS = 'projects' XSS_CORE = 'xss_core' PROJECT_RESULTS = 'project_results' def unique(table, field, va...
#!/usr/bin/python2.7 # Copyright 2010 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 requi...
# -*- coding: utf-8 -*- import os import re import random import hashlib import hmac from string import letters from google.appengine.ext import db import webapp2 import jinja2 from handler import * from user import * #menu_group def menu_groups_key(group = 'default'): return db.Key.from_path('menu_groups', gr...
# 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 # d...