text
stringlengths
475
200k
from django.db.models import Q __all__ = ('AutocompleteModel', ) class AutocompleteModel(object): """ Autocomplete which considers choices as a queryset. choices A queryset. limit_choices Maximum number of choices to display. search_fields Fields to search in, configurabl...
"""Test case implementation""" import collections import sys import functools import difflib import pprint import re import warnings from . import result from .util import ( strclass, safe_repr, unorderable_list_difference, _count_diff_all_purpose, _count_diff_hashable ) __unittest = True ...
try: import _winreg as winreg except ImportError: import winreg from tzlocal.windows_tz import win_tz import pytz _cache_tz = None def valuestodict(key): """Convert a registry key's values to a dictionary.""" dict = {} size = winreg.QueryInfoKey(key)[1] for i in range(size): data = wi...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from flask import session from indico.core import signals from indico.core.logger import Logger from indi...
# Author: mozman # Purpose: test convex_hull_2d # Created: 28.02.2010 # License: MIT License import pytest from ezdxf.math import convex_hull_2d from io import StringIO def import_asc_coords(file_obj): """ Import allplan asc-format point file. returns: a dictionary of Coordinates ('name': Coordinate) ""...
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
# 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...
from __future__ import nested_scopes """ ################################################################################ # # SOAPpy - Cayce Ullman ([EMAIL]) # Brian Matthews ([EMAIL]) # Gregory Warnes ([EMAIL]) # Christopher Blunck ([EMAIL]) # #################################...
"""Matplotlib based plotting of quantum circuits. Todo: * Optimize printing of large circuits. * Get this to work with single gates. * Do a better job checking the form of circuits to make sure it is a Mul of Gates. * Get multi-target gates plotting. * Get initial and final states to plot. * Get measurements to plo...
""" We perform uniqueness checks explicitly on the serializer class, rather the using Django's `.full_clean()`. This gives us better separation of concerns, allows us to use single-step object creation, and makes it possible to switch between using the implicit `ModelSerializer` class and an equivalent explicit `Seria...
#!/usr/bin/python from Aion.data_generation.reconstruction.Numerical import * from Aion.data_inference.visualization.visualizeData import * from Aion.utils.graphics import * from Aion.utils.data import * import pickledb import glob, sys, time, os, argparse, hashlib def defineArguments(): parser = argparse.Argum...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # serves the twitter files in redis via REST API on URL:8088 from cgi import parse_qs import requests import datetime import os import os.path import redis import json REDIS = redis.Redis() # Format: # HOUR = HH (str) # DATE = DD-MM-YYYY (str) # ARRAY = key for keywords...
#!/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. # This is used to test the findbugs plugin, it calls # build/android/pylib/utils/findbugs.py to analyze the classes in # org.chro...
#--------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. #---------------------------------------------------------------------...
from django.conf.urls import include, url from django.contrib import admin from django.contrib.auth import views from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.urls import urlpatterns from django.contrib.messages.api import inf...
#!/usr/bin/env python # ---------------------------------------------------------------------- # 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 ...
# -*- coding: utf-8 -*- """ Created on Mon Dec 07 11:30:17 2015 @author: AkishinoShiame """ import cPickle, gzip, theano.tensor ### file out put code below try: out1 = open("CR_data-train_set.pic.txt","w") out2 = open("CR_data-train_set.lab.txt","w") out3 = open("CR_data-valid_set.pic.txt","w") out4 ...
"""Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os.path import abspath import fnmatch import collections import errno import tarfile try: import bz2 del bz2 _...
#!/usr/bin/python #import Libraries import cgi import cgitb import time import thread import subprocess # Create instance of FieldStorage form = cgi.FieldStorage() # Get data from fields wifif = form.getvalue('wifi') wifif = '"%s"'%wifif passwordf = form.getvalue('password') passwordf = '"%s"'%passwordf sudo = '/us...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
#!/usr/bin/env python # ---------------------------------------------------------------------- # 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 ...
try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.core import management from django.contrib.auth.models import User from django.test import TestCase from models import (Person, Group, Membership, UserMembership, Car, Driver, CarDriver) cla...
# Load the AlchemyAPI module code. import AlchemyAPI # Create an AlchemyAPI object. alchemyObj = AlchemyAPI.AlchemyAPI() # Load the API key from disk. alchemyObj.loadAPIKey("api_key.txt"); ''' # Extract a title from a web URL. result = alchemyObj.URLGetTitle("http://www.techcrunch.com/"); print result ''' # Ex...
from openerp import tools, models, fields from openerp.addons.decimal_precision import decimal_precision as dp class hr_timesheet_report(models.Model): _name = "hr.timesheet.report" _description = "Timesheet" _auto = False _rec_name = "date" date = fields.Date('Date', readonly=True) product_...
import time from fabric.api import run, execute, env environment = "production" env.use_ssh_config = True env.hosts = ["shaaaaa"] branch = "master" repo = "[EMAIL]:konklone/shaaaaaaaaaaaaa.git" username = "shaaaaa" home = "/home/%s/%s" % (username, username) shared_path = "%s/shared" % home versions_path = "%s/vers...
from __future__ import unicode_literals from django.conf import settings from django.contrib.flatpages.forms import FlatpageForm from django.contrib.flatpages.models import FlatPage from django.test import TestCase from django.test.utils import override_settings from django.utils import translation @override_settings...
# 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: utf-8 -*- # Copyright: (c) 2018, Ansible Project # 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 DOCUMENTATION = """ name: runas short_description: Run As user ...
""" Functions for reversing a regular expression (used in reverse URL resolving). Used internally by Django and not intended for external use. This is not, and is not intended to be, a complete reg-exp decompiler. It should be good enough for a large class of URLS, however. """ from __future__ import unicode_literals ...
import re from inspect import getmembers, signature from coala_utils.decorators import generate_repr from .base import aspectbase from .docs import Documentation from .exceptions import AspectTypeError from .taste import Taste class aspectclass(type): """ Metaclass for aspectclasses. Root aspectclass ...
from ..Qt import QtCore, QtGui from ..python2_3 import asUnicode from .Parameter import Parameter, registerParameterType from .ParameterItem import ParameterItem from ..widgets.SpinBox import SpinBox from ..widgets.ColorButton import ColorButton from ..colormap import ColorMap from .. import pixmaps as pixmaps from .. ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from itertools import chain import time from openerp import tools from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.osv import fields, osv from openerp.tools.translate import _ import openerp.addons.dec...
#!/usr/bin/env python # ============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of th...
import kfp from kfp import components chicago_taxi_dataset_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/e3337b8bdcd63636934954e592d4b32c95b49129/components/datasets/Chicago%20Taxi/component.yaml') convert_csv_to_apache_parquet_op = components.load_component_from_url('h...
""" Module defines exceptions used by gsmmodem """ class GsmModemException(Exception): """ Base exception raised for error conditions when interacting with the GSM modem """ class TimeoutException(GsmModemException): """ Raised when a write command times out """ def __init__(self, data=None): ...
""" Admin site models for managing :class:`.ConfigurationModel` subclasses """ from django.forms import models from django.contrib import admin from django.contrib.admin import ListFilter from django.core.cache import caches, InvalidCacheBackendError from django.core.urlresolvers import reverse from django.http import...
# -*- 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 2014 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import tarfile import logging import os import hashlib import tempfile import shutil import functools import random import errno # version, , represent versions and specifica...
import json import re from .common import InfoExtractor from ..utils import determine_ext class NewgroundsIE(InfoExtractor): _VALID_URL = r'(?:https?://)?(?:www\.)?newgrounds\.com/audio/listen/(?P<id>\d+)' _TEST = { u'url': u'http://www.newgrounds.com/audio/listen/549479', u'file': u'549479.m...
import getpass from urllib import urlencode from urllib2 import urlopen from geopy.geocoders.base import Geocoder from geopy import util import csv class GeocoderDotUS(Geocoder): def __init__(self, username=None, password=None, format_string='%s'): if username and (password is None): password =...
#!/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. ...
import unittest import subprocess import sys from numba.tests.support import TestCase class TestNumbaImport(TestCase): """ Test behaviour of importing Numba. """ def run_in_subproc(self, code, flags=None): if flags is None: flags = [] cmd = [sys.executable,] + flags + ["-...
import pickle, os import thorpy from PyWorld2D.mapobjects.objects import MapObject def ask_save(me): choice = thorpy.launch_binary_choice("Do you want to save this map ?") default_fn = me.get_fn().replace(".map","") if choice: fn = thorpy.get_user_text("Filename", default_fn, size=(me.W//2,40)) ...
""" Functions for creating and restoring url-safe signed JSON objects. The format used looks like this: >>> signing.dumps("hello") 'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk' There are two components here, separated by a ':'. The first component is a URLsafe base64 encoded JSON of the object passed to dumps(). T...
# Copyright 2009, 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...
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. from .compat import * import binascii #This code is shared with tackpy (somewhat), so I'd rather make minimal #changes, and preserve the use of a2b_base64 throughout. def dePem(s, name): """Decode a PEM string into a...
# Copyright 2014 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 itertools import telemetry.timeline.event_container as event_container import telemetry.timeline.sample as tracing_sample import telemetry.timeline.sl...
# Standard Python packages import math import numbers import time # Special dependencies import numpy # Cassius interdependencies import mathtools def unicode_number(x): """Convert a number to unicode, with appropriate substitutions.""" output = u"%g" % x if output[0] == u"-": output = u"\u2012" + output...
import re class asm6502(): def __init__(self, debug=0): # print "65C02 Assembler" self.debuglevel = debug self.text_of_lines = list() # of strings self.lines = list() # parsed lines (symbol, opcode, addrmode, value self.symbols = list() # of (name,line#) tuples ...
"""Implements basics of Capa, including class CapaModule.""" import json import logging import sys from lxml import etree from pkg_resources import resource_string import dogstats_wrapper as dog_stats_api from .capa_base import CapaMixin, CapaFields, ComplexEncoder from capa import responsetypes from .progress import...
""" Hangman Game (v1.0) Name: Joe Young Date: 24/09/2016 """ #Joe Young #06/09/2016 import sys import platform if "windows" == platform.system(): sys.path.append(sys.path[0]+'\\Extra') else: sys.path.append(sys.path[0]+'//Extra') from random import * from time import * import hangmanp def load_file...
from __future__ import absolute_import, print_function, division import itertools import traceback import click from mitmproxy import contentviews from mitmproxy import ctx from mitmproxy import exceptions from mitmproxy import filt from netlib import human from netlib import strutils def indent(n, text): l = ...
# This class will represent the checkers board. """ ~ 1 2 3 4 5 6 7 8 __________________ a | O O O O | a b | O O O O | b c | O O O O | c d | - - - - | d e | - - - - | e f | x x x x | f g | x x x x | g h | x x x x | h ------------------ ~ 1 2 3 4 5...
# -*- coding: utf-8 -*- """ Author: Bernhard Scheirle """ from __future__ import unicode_literals import os from pelican.contents import Content from pelican.utils import slugify from . import avatars class Comment(Content): mandatory_properties = ('author', 'date') default_template = 'None' def __init...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> from utilities import css_styles css_styles() # <markdowncell> # # IOOS System Test - Theme 3 - Scenario A - [Description](https://github.com/ioos/system-test/wiki/Development-of-Test-Themes#scenario-3a-assessing-seabird-vulnerability-in-the-bering-sea...
from __future__ import unicode_literals import re from .common import InfoExtractor from .vimeo import VimeoIE from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, merge_dicts, try_get, unescapeHTML, unified_timestamp, urljoin, ) class RayWenderlichIE(InfoEx...
#!/usr/bin/python # -*- coding: utf-8 -*- # Ansible module to manage Big Monitoring Fabric service chains # (c) 2016, Ted Elhourani <[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 # th...
from sympy import I, Matrix, symbols, conjugate, Expr, Integer from sympy.physics.quantum.dagger import adjoint, Dagger from sympy.external import import_module from sympy.utilities.pytest import skip def test_scalars(): x = symbols('x', complex=True) assert Dagger(x) == conjugate(x) assert Dagger(I*x) =...
# Copyright 2017 Janos Czentye, Balazs Nemeth, Balazs Sonkoly # # 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...
# Copyright 2013 IBM Corp. # # 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 agree...
""" Modules that get shown to the users when an error has occurred while loading or rendering other modules """ import hashlib import logging import json import sys from lxml import etree from xmodule.x_module import XModule, XModuleDescriptor from xmodule.errortracker import exc_info_to_str from xmodule.modulestore ...
#!/usr/bin/env python "Makes working with XML feel like you are working with JSON" from xml.parsers import expat from xml.sax.saxutils import XMLGenerator from xml.sax.xmlreader import AttributesImpl try: # pragma no cover from cStringIO import StringIO except ImportError: # pragma no cover try: from...
import httplib import logging import unittest import urllib2 import testsetup import transferclient import moreasserts M = 1024 * 1024 def assertVdiZero(self, ip, port, record, vdi_mb): # Make a new record with the IP and port fields updated r = dict(record, ip=ip, port=port) moreasserts.assertVdiIsZero...
# -*- 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...
#!/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 ...
# -*- encoding: utf-8 -*- ############################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (c) 2013 Vauxoo C.A. (http://openerp.com.ve/) # All Rights Reserved ############# Credits ###########################################...
""" shared options and groups The principle here is to define options once, but *not* instantiate them globally. One reason being that options with action='append' can carry state between parses. pip parses general options twice internally, and shouldn't pass on state. To be consistent, all options will follow this de...
############################################################################## # # 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 Affero General Public L...
""" :synopsis: remaining "secondary" views for askbot This module contains a collection of views displaying all sorts of secondary and mostly static content. """ from django.shortcuts import render_to_response, get_object_or_404 from django.core.urlresolvers import reverse from django.core.paginator import Paginator, ...
from StringIO import StringIO from libcloud.storage.types import Provider from libcloud.storage.providers import get_driver CloudFiles = get_driver(Provider.CLOUDFILES_US) driver = CloudFiles('username', 'api key') container = driver.create_container(container_name='my_website') iterator1 = StringIO('<p>Hello Worl...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, 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...
import hashlib import datetime from flask_login import UserMixin, AnonymousUserMixin import mediacloud as mcapi import app from app.core import db, mc # User class class User(UserMixin): def __init__(self, username, key, active=True, profile=None): self.name = username self.id = key self...
# Copyright 2016 gRPC authors. # # 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...
# -*- coding: utf-8 -*- # # papyon - a python client library for Msn # # Copyright (C) 2009 Collabora Ltd. # # 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 #...
"""Http client functional tests.""" import binascii import gc import io import os.path import json import http.cookies import asyncio import unittest from unittest import mock import aiohttp from aiohttp import client, helpers from aiohttp import test_utils from aiohttp.multidict import MultiDict from aiohttp.multipa...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Simon Dodsley ([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', ...
# This file is part of EventGhost. # Copyright (C) 2005 Lars-Peter Voss <[EMAIL]> # # EventGhost 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...
import json try: from urllib.request import urlopen # Python 3 from urllib.parse import urlencode except ImportError: from urllib import urlopen # Python 2 from urllib import urlencode import socket import math from . import vehicles, log from . import EmissionsJsonParser from .exceptions import Rout...
import argparse import sys from .. import handlers, commandline, reader def get_parser(add_help=True): parser = argparse.ArgumentParser("format", description="Format a structured log stream", add_help=add_help) parser.add_argument("--input", action="store", default=None, ...
#!/usr/bin/env python """ txXBee installation script """ from setuptools import setup import os import sys import subprocess import txXBee setup( name = "txXBee", version = txXBee.__version__, author = "Wagner Sartori Junior", author_email = "[EMAIL]", url = "http://github.com/trunet/txxbee", d...
# Copyright (C) 2010 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
# 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 ...
from paste.httpheaders import * import time def _test_generic(collection): assert 'bing' == VIA(collection) REFERER.update(collection,'internal:/some/path') assert 'internal:/some/path' == REFERER(collection) CACHE_CONTROL.update(collection,max_age=1234) CONTENT_DISPOSITION.update(collection,filena...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # Author : Nicolas Bessi (Camptocamp) from openerp.tools import convert original_xml_import = convert.xml_import class WebkitXMLImport(original_xml_import...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2002 Gary Shao # Copyright (C) 2007 Brian G. Matherly # Copyright (C) 2009 Benny Malengier # Copyright (C) 2009 Gary Burton # # This program is free software; you can redistribute i...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006 (ita) """ Batched builds - compile faster instead of compiling object files one by one, c/c++ compilers are often able to compile at once: cc -c ../file1.c ../file2.c ../file3.c Files are output on the directory where the compiler is called, and dependencies...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<[EMAIL]> # http://binux.me # Created on 2014-10-08 15:04:08 import urlparse def connect_database(url): """ create database object by url mysql: mysql+type://user:passwd@host:p...
from ctypes.util import find_library from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.base import ( _sqlite_extract, _sqlite_date_trunc, _sqlite_regexp, _sqlite_format_dtdelta, connection_created, Database, DatabaseWrapper as SQLiteDatabas...
#-------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
#!/usr/bin/python # -*- coding: utf-8 -*- """ raven.contrib.zope ~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from inspect import getouterframes, currentframe, getinnerframes from ...
# -*- encoding: utf-8 -*- from abjad import * def test_scoretools_Note_grace_01(): r'''Attach one grace note. ''' note = Note("c'4") grace_container = scoretools.GraceContainer([Note(2, (1, 16))]) attach(grace_container, note) assert systemtools.TestManager.compare( note, r''...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from abc import abst...
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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...
"""This module implements a loader and dumper for the svmlight format This format is a text-based format, with one sample per line. It does not store zero valued features hence is suitable for sparse dataset. The first element of each line can be used to store a target variable to predict. This format is used as the...
# __init__.py # The toplevel DNF package. # # Copyright (C) 2012-2016 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This prog...
# source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget import sys, os, re import traceback, platform from PyQt4 import QtCore from PyQt4 import QtGui from chainkey import util if platform.system() == 'Windows': MONOSPACE_FONT = 'Lucida Console' elif platform.syste...
# WSGI Handler sample configuration file. # # Change the appropriate settings below, in order to provide the parameters # that would normally be passed in the command-line. # (at least conf['addons_path']) # # For generic wsgi handlers a global application is defined. # For uwsgi this should work: # $ uwsgi_python --...
# This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This file follows the # PEP8 Python style guide and uses a max-width of 120 characters per line. # # Author(s): # Cedric Nugteren <www.cedricnugteren.nl> import sys import database.clblast as clblast def get_best_result...
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...