text
stringlengths
475
200k
#!/usr/bin/python ### # Copyright (c) 2002-2005, Jeremiah Fincher # 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, # ...
from collections import defaultdict from django.core.exceptions import ImproperlyConfigured from django.template import TemplateSyntaxError, Variable from django.template.loader import get_template from django.utils.translation import gettext_lazy as _ from mezzanine import template from mezzanine.pages.models import...
import types from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django import template from django.db.models.query import QuerySet import re from django.core import serializers class ViewHandler(object): def __init__(self, func, param_validator=None): ...
""" Class for manipulating groups configuration on a course object. """ import json import logging from util.db import generate_int_id, MYSQL_MAX_INT from django.utils.translation import ugettext as _ from contentstore.utils import reverse_usage_url from xmodule.partitions.partitions import UserPartition from xmodule...
# -*- coding: utf-8 -*- """ werkzeug.datastructures ~~~~~~~~~~~~~~~~~~~~~~~ This module provides mixins and classes with an immutable interface. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import codecs import ...
# coding=utf-8 from __future__ import absolute_import, division, print_function __author__ = "Gina Häußge <[EMAIL]>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License" import un...
""" Django's support for templates. The django.template namespace contains two independent subsystems: 1. Multiple Template Engines: support for pluggable template backends, built-in backends and backend-independent APIs 2. Django Template Language: Django's own template engine, including its built-in loaders, ...
""" :mod: GFAL2_XROOTStorage ================= .. module: python :synopsis: XROOT module based on the GFAL2_StorageBase class. """ # from DIRAC from DIRAC import gLogger from DIRAC.Resources.Storage.GFAL2_StorageBase import GFAL2_StorageBase class GFAL2_XROOTStorage( GFAL2_StorageBase ): """ .. class:...
# # Secret Labs' Regular Expression Engine # # various symbols used by the regular expression engine. # run this script to update the _sre include files! # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support modul...
from unittest import TestCase from chess_py.core.algebraic import notation_const from chess_py.core import Board from chess_py.core.algebraic import Location, Move from chess_py.pieces import Queen, Rook, Bishop, Knight, Pawn from chess_py import color class TestPawn(TestCase): def setUp(self): self.posi...
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
"""This tests sympy/core/basic.py with (ideally) no reference to subclasses of Basic or Atom.""" from sympy.core.basic import Basic, Atom, preorder_traversal from sympy.core.singleton import S, Singleton from sympy.core.symbol import symbols from sympy.core.compatibility import default_sort_key, with_metaclass from s...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse_unquote, ) from ..utils import ( determine_ext, float_or_none, get_element_by_id, int_or_none, parse_iso8601, str_to_int, ) class IzleseneIE...
#!/usr/bin/python # # Copyright (c) 2019 Liu Qingyi, (@smile37773) # # 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', 's...
# # Copyright 2015 The AMP HTML 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 applic...
"""OpenSSL/M2Crypto 3DES implementation.""" from cryptomath import * from TripleDES import * if m2cryptoLoaded: def new(key, mode, IV): return OpenSSL_TripleDES(key, mode, IV) class OpenSSL_TripleDES(TripleDES): def __init__(self, key, mode, IV): TripleDES.__init__(self, key, mo...
#!/usr/bin/python # -*- coding: utf-8 -*- ''' PyChess blunder finder script. This scripts allows you to analyze a played pgn file for blunders, using the engine of your choice. PYTHONPATH=lib/ python blunders.py game.pgn ''' ############################################################################...
# -*- coding: utf-8 -*- from pyqtgraph.Qt import QtCore, QtGui if not hasattr(QtCore, 'Signal'): QtCore.Signal = QtCore.pyqtSignal import weakref class CanvasManager(QtCore.QObject): SINGLETON = None sigCanvasListChanged = QtCore.Signal() def __init__(self): if CanvasManager.SINGLETON...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os from lib.symbol import FUNCTION_SYMBOLS, SOURCEFILE_SYMBOLS, TYPEINFO_SYMBOLS LOGGER = logging.getLogger('dmprof') class Bucket...
# # This file is part of GNU Enterprise. # # GNU Enterprise 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, or (at your option) any later version. # # GNU Enterprise is distributed ...
#!/usr/bin/python import os, sys, string, pdb import re, fileinput import ctypes import struct import json import sys def main(): # arguments, print an example of correct usage. if len(sys.argv) - 1 != 1: print("********************") print("Usage suggestion:") print("python " + sys.a...
# Copyright (c) 2008 Agostino Russo # # Written by Agostino Russo <[EMAIL]> # # This file is part of Wubi the Win32 Ubuntu Installer. # # Wubi is free software; you can redistribute it and/or modify # it under 5the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either ver...
import urllib import hashlib from django import template from django.conf import settings from django.utils.safestring import mark_safe from django.utils.encoding import force_bytes, force_text from readthedocs.builds.models import Version from readthedocs.projects.models import Project register = template.Library()...
# Authors: Robert Luke <[EMAIL]> # Eric Larson <[EMAIL]> # Alexandre Gramfort <[EMAIL]> # # License: BSD (3-clause) import os.path as op import pytest as pytest import numpy as np from numpy.testing import assert_allclose from mne.datasets.testing import data_path from mne.io import read_raw_nirx, B...
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends.base.base import BaseDatabas...
# -*- coding: UTF-8 -*- import basic from functions import prettyItemBonus, formatTextareaInput import re from sets import Set from misc import miscController import time class creationCenterController(basic.defaultController): DIR = './ugc/' RE_CHECK_NAME = re.compile('^[a-zA-Z0-9\s\-\+\']+$', re.U+re...
#!/usr/bin/env python3 # -*- coding: ascii -*- from __future__ import unicode_literals, division, with_statement Node = r"""(function(program, execJS) { execJS(program) })(function() { #{source} }, function(program) { var output; var print = function(string) { process.stdout.write('' + string + '\n'); }; ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """.. currentmodule:: migrate.versioning.util""" import warnings import logging from decorator import decorator from pkg_resources import EntryPoint import six from sqlalchemy import create_engine from sqlalchemy.engine import Engine from sqlalchemy.pool import StaticPool...
#!/usr/bin/env python # # Copyright 2008, 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...
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi ([EMAIL]), University of Szeged # Copyright (C) 2011 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 ...
from django.db import models from django.core.urlresolvers import reverse import datetime # Create your models here. class Team(models.Model): short_name = models.CharField(max_length=25) name = models.CharField(max_length=50, null=True, blank=True) my_team = models.BooleanField(default = False) city ...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio 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...
import copy import logging import os.path import unittest import mock import okaara from pulp.bindings.bindings import Bindings from pulp.bindings.server import PulpConnection from pulp.client.extensions.core import PulpPrompt, ClientContext, PulpCli from pulp.client.extensions.exceptions import ExceptionHandler from...
# Raspberry Pi Face Recognition Treasure Box Configuration # Copyright 2013 Tony DiCola # Edit the values below to configure the training and usage of the # face recognition box. # Pi GPIO port which is connected to the lock servo signal line. LOCK_SERVO_PIN = 18 # Pulse width value (in microseconds) for the servo a...
"""Simple text browser for IDLE """ from Tkinter import * import tkMessageBox class TextViewer(Toplevel): """ simple text viewer dialog for idle """ def __init__(self, parent, title, fileName, data=None): """If data exists, load it into viewer, otherwise try to load file. fileName - ...
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
# -*- coding: utf-8 -*- """ Tests for auth manager Password access to postgres. This is an integration test for QGIS Desktop Auth Manager postgres provider that checks if QGIS can use a stored auth manager auth configuration to access a Password protected postgres. It uses a docker container as postgres/postgis serve...
# -*- coding: utf-8 -*- """ *************************************************************************** voronoi.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *******************************...
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <[EMAIL]> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # vers...
# Copyright (C) 2003 John Goerzen # <[EMAIL]> # # 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 ...
import unittest from hieroglyph.nodes import Node, Arg, Raises, Except, Returns, Warning, Note __author__ = 'Robert Smallshire' class NodeTests(unittest.TestCase): def test_create_default_node(self): node = Node() self.assertEqual(node.indent, 0) self.assertEqual(node.lines, [])...
#!/usr/bin/env python # portable serial port access with python # this is a wrapper module for different platform implementations # # (C) 2001-2010 Chris Liechti <[EMAIL]> # this is distributed under a free software license, see license.txt VERSION = '2.5' import sys if sys.platform == 'cli': from serialcli im...
from django.conf import settings from django.db import models from django.db.models.fields import FieldDoesNotExist class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the current site." def __init__(self, field_name=None): super(CurrentSiteManager, self).__ini...
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # """ Layer that transforms VNC config objects to ifmap representation """ from gevent import ssl, monkey monkey.patch_all() import sys import time from pprint import pformat from lxml import etree, objectify import StringIO import re import socket i...
"""The tests for the openalpr cloud platform.""" import asyncio from unittest.mock import patch, PropertyMock from homeassistant.core import callback from homeassistant.setup import setup_component from homeassistant.components import camera, image_processing as ip from homeassistant.components.image_processing.openal...
#!/usr/bin/python # # Copyright (c) 2015, Arista Networks, 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, # t...
from random import randint from sympy import Matrix, zeros, ones, Integer from sympy.physics.quantum.matrixutils import ( to_sympy, to_numpy, to_scipy_sparse, matrix_tensor_product, matrix_to_zero, matrix_zeros, numpy_ndarray, scipy_sparse_matrix ) from sympy.core.compatibility import range from sympy.extern...
# Copyright 2016 Cisco Systems, 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Ivan Vanderbyl <[EMAIL]> # # This module 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 ...
import unittest from typing import List import utils # O(n) time. O(1) space. Floyd's tortoise and hare cycle detection algorithm. class Solution: def circularArrayLoop(self, nums: List[int]) -> bool: n = len(nums) for start, move in enumerate(nums): if move == 0: con...
""" Caching utilities for robotic browsers. Credit to https://github.com/Lukasa/httpcache """ import logging import datetime from requests.adapters import HTTPAdapter from robobrowser.compat import OrderedDict, iteritems logger = logging.getLogger(__name__) # Modified from https://github.com/Lukasa/httpcache/blob/m...
# Collect facts related to apparmor # # 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. # # An...
# (c) 2017 Red Hat Inc. # # 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 dis...
# Copyright 2010 Google Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, dis- # trib...
import requests from flask import current_app from requests.auth import AuthBase class Auth(AuthBase): """ Handles the authorization method. If there is no available token for us, it logs-in and stores the token. Appends the token to the header accordingly. """ def __init__(self, domain: str, em...
from __future__ import unicode_literals __all__ = ( 'InputMode', 'CharacterFind', 'ViState', ) class InputMode(object): INSERT = 'vi-insert' INSERT_MULTIPLE = 'vi-insert-multiple' NAVIGATION = 'vi-navigation' REPLACE = 'vi-replace' class CharacterFind(object): def __init__(self, cha...
from django.conf import settings from django.core.management.base import BaseCommand from django.db import connection import silk.models class Command(BaseCommand): help = "Clears silk's log of requests." @staticmethod def delete_model(model): engine = settings.DATABASES['default']['ENGINE'] ...
import os from numpy import * from scipy import * from scipy import optimize from string import * from numpy.linalg import * class CRBLocation(object): """ A CRBLocation contains: 1- a set of RadioNodes (RN) with associated position accuracies (RNQoS), 2- a set of measurements (RSS, TOA, TDOA) with as...
# -*- coding: utf-8 -*- """ werkzeug.datastructures ~~~~~~~~~~~~~~~~~~~~~~~ This module provides mixins and classes with an immutable interface. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import codecs import ...
from flask import Flask, request, abort import json import ndb_util from model import User from google.appengine.api import users from google.appengine.ext import ndb from google.appengine.api import app_identity from google.appengine.api import mail from flask_restful import Resource from google.appengine.runtime i...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Command-line wrapper for the tracetool machinery. """ __author__ = "Lluís Vilanova <[EMAIL]>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <[EMAIL]>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi...
#!/usr/bin/env python3 ########################################################################################## # Author: Jared L. Ostmeyer # Date Started: 2017-01-01 # Purpose: Load dataset and create interfaces for piping the data to the model ########################################################################...
class Token(object): def __init__(self, start_mark, end_mark): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in self.__dict__ if not key.endswith('_mark')] attributes.sort() arguments = ', '.join(['%s=...
#!/usr/bin/env python ### # (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP # # 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 limita...
# -*- coding: utf-'8' "-*-" import base64 try: import simplejson as json except ImportError: import json from hashlib import sha1 import hmac import logging import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment_adyen.controllers.main import Adye...
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, ) class ExpoTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?expotv\.com/videos/[^?#]*/(?P<id>[0-9]+)($|[?#])' _TEST = { 'url': 'http://www.expotv.com/videos/rev...
#!/usr/bin/env python3 # Copyright (c) 2015-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. """Test processing of unrequested blocks. Since behavior differs when receiving unrequested blocks from w...
# pylint: disable=g-bad-file-header # 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/LICENS...
from __future__ import absolute_import from django.core.management.base import BaseCommand from zerver.lib.actions import do_rename_stream from zerver.models import Realm, get_realm import sys class Command(BaseCommand): help = """Change the stream name for a realm.""" def add_arguments(self, parser): ...
""" CherryPy implements a simple caching system as a pluggable Tool. This tool tries to be an (in-process) HTTP/1.1-compliant cache. It's not quite there yet, but it's probably good enough for most sites. In general, GET responses are cached (along with selecting headers) and, if another request arrives for the same r...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsRelationManager. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ""...
# -*- coding: utf-8 -*- # Copyright 2020 Google 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 required by applicable law or...
# -*- coding: utf-8 -*- """ *************************************************************************** peukerdouglas.py --------------------- Date : October 2012 Copyright : (C) 2012 by Alexander Bruy Email : alexander dot bruy at gmail dot com ***********...
# Copyright (c) 2010 Philip Taylor # Released under the BSD license and W3C Test Suite License: see LICENSE.txt # Current code status: # # This was originally written for use at # http://philip.html5.org/tests/canvas/suite/tests/ # # It has been adapted for use with the Web Platform Test Suite suite at # https://githu...
""" Read temperature information from Eddystone beacons. Your beacons must be configured to transmit UID (for identification) and TLM (for temperature) frames. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.eddystone_temperature/ """ import loggi...
# The MIT License # # Copyright (c) 2009-2011 Andreas Stuehrk # # 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, mo...
# pylint: disable=missing-docstring from lettuce import step from lettuce import world from lettuce import before from pymongo import MongoClient from nose.tools import assert_equals from nose.tools import assert_in REQUIRED_EVENT_FIELDS = [ 'agent', 'event', 'event_source', 'event_type', 'host', ...
import collections import string import numpy import six import cupy from cupy import carray from cupy import elementwise from cupy import util six_range = six.moves.range six_zip = six.moves.zip _broadcast = elementwise._broadcast _check_args = elementwise._check_args _decide_params_type = elementwise._decide_par...
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
"""Provides a common base for Apache proxies""" import re import os import subprocess import mock import zope.interface from letsencrypt import configuration from letsencrypt import errors as le_errors from letsencrypt_apache import configurator from letsencrypt_compatibility_test import errors from letsencrypt_compa...
# # (c) 2017, Red Hat, Inc. # # 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...
# Copyright 2017 Josh Karlin. All rights reserved. # Use of this source code is governed by the Apache license found in the LICENSE # file. import argparse import datetime import getopt import json import sys import tempfile import threading import time import urllib.request import urllib.parse gFileCache = None; # ...
#!/usr/bin/env python # -*- coding: UTF-8 -*- __description__ = 'A companion tool to autoXLIFF.py. Helps batch-add translation strings to existing XLIFF documents (useful to add arbitrary strings like those that appear in files other than twig templates, since those are not picked-up automatically by autoXLIFF. Exampl...
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
"""Tests for polynomial module. """ from functools import reduce import numpy as np import numpy.polynomial.polynomial as poly from numpy.testing import ( assert_almost_equal, assert_raises, assert_equal, assert_, assert_warns, assert_array_equal, assert_raises_regex) def trim(x): return poly.polytrim(x...
# Author: Nic Wolfe <[EMAIL]> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Licen...
from django.conf.urls import * from individuals.views import IndividualDeleteView, GroupDeleteView from django.contrib.admin.views.decorators import staff_member_required from . import views urlpatterns = [ url(r'^create/$', views.create, name='individual_create'), url(r'^edit/(?P<individual_id>[0-9]+)/$', v...
# Copyright 2015, 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...
""" termcolors.py """ from django.utils import six color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white') foreground = dict([(color_names[x], '3%s' % x) for x in range(8)]) background = dict([(color_names[x], '4%s' % x) for x in range(8)]) RESET = '0' opt_dict = {'bold': '1', 'undersco...
# -*- coding: utf-8 -*- ## ## Some functions about dates ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Fr...
from __future__ import absolute_import from .fixtures import * from blitzdb.tests.helpers.movie_data import Actor, Director, Movie import blitzdb def test_basic_delete(backend, small_test_data): backend.filter(Actor, {}).delete() backend.commit() assert len(backend.filter(Actor, {})) == 0 def test_b...
# Copyright 2020 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
""" tests for quantecon.models.optgrowth @author : Spencer Lyon @date : 2014-08-05 10:20:53 TODO: I'd really like to see why the solutions only match analytical counter part up to 1e-2. Seems like we should be able to do better than that. """ from __future__ import division from math import log import num...
import generator from parser import Parser from compiler import SyntaxCompiler def compile_string(syntax): """ Builds a converter from the given syntax and returns it. @type syntax: str @param syntax: A Gelatin syntax. @rtype: compiler.Context @return: The compiled converter. """ r...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import datetime from nose.tools import eq_, ok_, assert_raises from configman import ConfigurationManager, Namespace f...
# -*- coding: utf-8 -*- from module.plugins.internal.MultiAccount import MultiAccount from module.plugins.internal.misc import json class RPNetBiz(MultiAccount): __name__ = "RPNetBiz" __type__ = "account" __version__ = "0.19" __status__ = "testing" __config__ = [("mh_mode" , "all;liste...
from django.db.backends.oracle.creation import DatabaseCreation from django.db.backends.util import truncate_name class OracleCreation(DatabaseCreation): def sql_indexes_for_field(self, model, f, style): "Return any spatial index creation SQL for the field." from django.contrib.gis.db.models.field...
import numpy as np import seaborn as sns from matplotlib import patches import matplotlib.pyplot as plt from scipy.signal import gaussian from scipy.spatial import distance XY_CACHE = {} STATIC_DIR = "_static" plt.rcParams["savefig.dpi"] = 300 def poisson_disc_sample(array_radius, pad_radius, candidates=100, d=2, ...
"""Ugly graph drawing tools""" import matplotlib.pyplot as plt import matplotlib.cm as cmap #import numpy as np from matplotlib import cbook # http://stackoverflow.com/questions/4652439/is-there-a-matplotlib-equivalent-of-matlabs-datacursormode class DataCursor(object): """A simple data cursor widget that displays...
# Copyright 2015 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 writin...