text
stringlengths
475
200k
""" Helper functions for creating Form classes from Django models and database field objects. """ from django.utils.encoding import smart_unicode, force_unicode from django.utils.datastructures import SortedDict from django.utils.text import get_text_list, capfirst from django.utils.translation import ugettext_lazy as...
#!/usr/bin/python24 import cgi import time import MySQLdb from traceback import format_exception from sys import exc_info from string import split from string import strip from sys import exit from urllib import urlencode import urllib2 DATADIR = "/home/user/data/" PP_URL = "https://www.sandbox.paypal.com/cgi-bin/we...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
""" Mappings from Adobe glyph names to Unicode characters. In some CMap tables, Adobe glyph names are used for specifying Unicode characters instead of using decimal/hex character code. The following data was taken by $ wget https://partners.adobe.com/public/developer/en/opentype/glyphlist.txt $ python tools/c...
#***************************************************************************** # blacktie_pipeline.py (part of the blacktie package) # # (c) 2013 - Augustine Dunn # James Laboratory # Department of Biochemistry and Molecular Biology # University of California Irvine # [EMAIL] # # Licenced under the GNU General P...
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # 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 # ...
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <[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, eit...
from django.core.management.base import BaseCommand from optparse import make_option from geonode.services.models import Service from geonode.services.views import _register_cascaded_service, _register_indexed_service, \ _register_harvested_service, _register_cascaded_layers, _register_indexed_layers import json fr...
# Copyright (C) 2014, Red Hat, 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...
# Scraper for the United States Court of Appeals for the Seventh Circuit # CourtID: ca7 # Court Short Name: 7th Cir. import time from datetime import date, timedelta import urllib from dateutil.rrule import rrule, DAILY from lxml import html from juriscraper.OpinionSite import OpinionSite class Site(OpinionSite): ...
""" exynos_checkpatch_helper.py - a helper script for exynos_checkpatch.sh Dept : S/W Solution Dev Team Author : Solution3 Power Part Update : 2014.12.08 """ import subprocess as sp import sys def print_log(color, log): colored_log = '' if color == 'r': colored_log = "\033[31m" + log + "\033...
#!/usr/bin/python # Copyright 2012 Cory Koch # # This file is part of PrayerTimes. # # PrayerTimes 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 la...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import contextlib import logging import sys import string import uuid import...
""" @name: Modules/House/rooms.py @author: D. Brian Kimmel @contact: [EMAIL] @copyright: (c) 2013-2020 by D. Brian Kimmel @license: MIT License @note: Created on Apr 10, 2013 @summary: Handle the rooms information for a house. """ __updated__ = '2020-02-17' __version_info__ = (19, 10, 5) __version_...
# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt class ModuleDocFragment(object): # Documentation fragment for ProxySQL connectivity CONNECTIVITY = ''' options: login_user: description: - The username used to authen...
#!/usr/bin/env python3 import contextlib import inspect import textwrap from pathlib import Path from typing import List, Type import mitmproxy.addons.next_layer # noqa from mitmproxy import hooks, log, addonmanager from mitmproxy.proxy import server_hooks, layer from mitmproxy.proxy.layers import http, tcp, tls, web...
# -*- coding: utf-8 -*- """ *************************************************************************** TextToFloat.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com *************************...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ A set of tests for the util.py module """ # LOCAL from astropy.io.votable import util from astropy.tests.helper import raises def test_range_list(): assert util.coerce_range_list_param((5,)) == ("5.0", 1) def test_range_list2(): assert ut...
# Copyright 2018 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...
# Volatility # Copyright (C) 2009-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
"""This demo program solves Poisson's equation - div C grad u(x, y) = f(x, y) on the unit square with source f given by f(x, y) = 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02) and boundary conditions given by u(x, y) = 0 for x = 0 or x = 1 du/dn(x, y) = 0 for y = 0 or y = 1 The conductivity C is a sym...
import scipy import numpy import sys from astropy import time as aptime sys.path.append('../') import CIAO_DatabaseTools import Graffity import tkinter def getGRAVITY_OBS(GRAVITY_values, frame): tkinter.Label(frame, text="GRAVITY Observations", width = 3, borderwidth="1", relief="solid").grid(row=0, ...
import unittest import sys from test.support import import_fresh_module, run_unittest TESTS = 'test.datetimetester' # XXX: import_fresh_module() is supposed to leave sys.module cache untouched, # XXX: but it does not, so we have to save and restore it ourselves. save_sys_modules = sys.modules.copy() try: pure_tests...
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
""" Tests for the course completion helper functions. """ from datetime import datetime from badges.events import course_complete from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory class ...
import sys, os import unittest try: sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) except: sys.path.insert(0, os.path.dirname(os.path.abspath("."))) from bx.intervals.intersection import Interval from bx.intervals.intersection import IntervalNode from bx.intervals.intersection import IntervalTr...
# # Secret Labs' Regular Expression Engine # # convert re-style regular expression to sre pattern # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" # XXX: show string offset and offending ch...
""" Support for SCSGate components. For more details about this component, please refer to the documentation at https://home-assistant.io/components/scsgate/ """ import logging from threading import Lock from blumate.core import EVENT_BLUMATE_STOP REQUIREMENTS = ['scsgate==0.1.0'] DOMAIN = "scsgate" SCSGATE = None _...
#!/usr/bin/env python import logging import optparse import traceback import unittest import sys import os import utils import framework from queryservice_tests import cache_tests from queryservice_tests import nocache_tests from queryservice_tests import stream_tests from queryservice_tests import status_tests from...
# 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. """Runs Chromium's IndexedDB performance test. These test: Databases: create/delete Keys: create/delete Indexes: create/delete Data access: Random r...
# Copyright (c) 2010-2013 by Yaco Sistemas <[EMAIL]> or <[EMAIL]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
import json from django import template from django.template.context import Context register = template.Library() @register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True) def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for ...
# Unit tests for typecast functions in django.db.backends.util import datetime import unittest from django.db.backends import utils as typecasts from django.utils import six TEST_CASES = { 'typecast_date': ( ('', None), (None, None), ('2005-08-11', datetime.date(2005, 8, 11)), ('1...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
SOCIAL_AUTH_SETTINGS = { 'SOCIAL_AUTH_LOGIN_URL': '/', 'SOCIAL_AUTH_LOGIN_REDIRECT_URL': '/done', 'SOCIAL_AUTH_USER_MODEL': 'example.models.User', 'SOCIAL_AUTH_LOGIN_FUNCTION': 'example.auth.login_user', 'SOCIAL_AUTH_LOGGEDIN_FUNCTION': 'example.auth.login_required', 'SOCIAL_AUTH_AUTHENTICATION_...
""" Note that sometimes you will get duplicate signals emitted, depending on configuration of your systems. If you do encounter this, you will need to add the "dispatch_uid" to your connect handlers: http://code.djangoproject.com/wiki/Signals#Helppost_saveseemstobeemittedtwiceforeachsave """ from django.dispatch impor...
#!/usr/bin/env python # # Copyright 2013 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...
# # Module implementing synchronization primitives # # multiprocessing/synchronize.py # # Copyright (c) 2006-2008, R Oudkerk # 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. Redistribution...
from __future__ import unicode_literals from django.contrib import admin from django.contrib.messages import info from django.http import HttpResponseRedirect from django.utils.translation import ugettext_lazy as _ try: from django.utils.encoding import force_text except ImportError: # Backward compatibility f...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '0001_init...
""" Convenience routines for creating non-trivial Field subclasses, as well as backwards compatibility utilities. Add SubfieldBase as the metaclass for your Field subclass, implement to_python() and the other necessary methods and everything will work seamlessly. """ import warnings from django.utils.deprecation imp...
# See http://technet.microsoft.com/en-us/library/ee913589(v=ws.10).aspx # for information regarding the default claim types supported by # Microsoft ADFS v2.0. MAP = { "identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified", "fro": { 'http://schemas.xmlsoap.org/ws/2005/05/identity/claim...
""" Utilities for django models. """ import unicodedata import re from eventtracking import tracker from django.conf import settings from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from django_countries.fields import Country # The setting name used for events when "sett...
"""Module containing non-deprecated functions borrowed from Numeric. """ from __future__ import division, absolute_import, print_function import types import warnings import numpy as np from .. import VisibleDeprecationWarning from . import multiarray as mu from . import umath as um from . import numerictypes as nt ...
# Copyright 2011 James McCauley # # This file is part of POX. # # POX 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. # # POX is distri...
import unittest from app.validation.abstract_validator import AbstractValidator from app.validation.textarea_type_check import TextAreaTypeCheck class TextAreaTest(unittest.TestCase): def test_textarea_validator(self): textarea = TextAreaTypeCheck() # validate integer result = textarea....
from test_env import TestEnv from textwrap import dedent import pythran class TestImportAll(TestEnv): def test_import_all(self): self.run_test("from math import *\ndef import_all(l): return cos(l)", 3.3, import_all=[float]) def test_import_cmath_all(self): self.run_test("from cmath import *\n...
#!/usr/bin/env python import xmlrpclib from xen.xend.XendClient import server from xen.xend import sxp, osdep from xen.lowlevel.xc import xc import vif import blkdev # need a nicer way to load disk drivers import vbd class VMException(Exception): pass class VM(object): "Representation of a virtual machine" ...
"""Tests for input validation functions""" import warnings from tempfile import NamedTemporaryFile from itertools import product import numpy as np from numpy.testing import assert_array_equal import scipy.sparse as sp from nose.tools import assert_raises, assert_true, assert_false, assert_equal from sklearn.utils....
# botos/modules/voting/views.py # Copyright (C) 2016 Sean Francis N. Ballais # # This module is part of Botos and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Views for voting. """ import json import collections from flask import render_template from flask import flas...
#!/usr/bin/env python3 # Copyright (c) 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.test_framework import BitcoinTestFramework from test_framework.util import (start_nodes, s...
import nipype.pipeline.engine as pe import nipype.interfaces.utility as util def create_func_datasource(rest_dict, wf_name='func_datasource'): import nipype.pipeline.engine as pe import nipype.interfaces.utility as util wf = pe.Workflow(name=wf_name) inputnode = pe.Node(util.IdentityInterface( ...
# -*- coding: utf-8 -*- """ *************************************************************************** test_qgsnullsymbolrenderer.py ----------------------------- Date : April 2016 Copyright : (C) 2016 by Nyall Dawson Email : nyall dot dawson at gmail dot ...
import io import pytest from pathod import language from pathod.language import http, base from .. import tservers def parse_request(s): return next(language.parse_pathoc(s)) def test_make_error_response(): d = io.BytesIO() s = http.make_error_response("foo") language.serve(s, d, {}) class TestR...
# (c) 2012, Michael DeHaan <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # A...
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt4 (Qt v4.8.7) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = b"\ \x00\x00\x11\x43\ \x00\ \x00\x5f\xaa\x78\x9c\xc5\x1c\xdb\x72\xdb\xb6\xf2\x5d\x5f\x81\x3a\ \x2f\x49\x8e\x9...
#!/usr/bin/env python3 import unittest from test import support import errno import io import socket import select import time import traceback import queue import sys import os import array import platform import contextlib from weakref import proxy import signal import math try: import fcntl except ImportError:...
from django.http import HttpResponse, Http404 from django.template import loader from django.contrib.sites.models import get_current_site from django.core import urlresolvers from django.core.paginator import EmptyPage, PageNotAnInteger from django.contrib.gis.db.models.fields import GeometryField from django.db import...
#!/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. ...
""" urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov ([EMAIL])' __license__ = 'MIT' __version__ = '1.10.4' from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encode_multipart_fo...
from unittest import TestCase import json # Fri Dec 30 18:57:26 2005 JSONDOCS = [ # http://json.org/JSON_checker/test/fail1.json '"A JSON payload should be an object or array, not a string."', # http://json.org/JSON_checker/test/fail2.json '["Unclosed array"', # http://json.org/JSON_checker/test/f...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Bruce Pennypacker <[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 Lice...
# RPCProxyApplication.py -- OpenChange RPC-over-HTTP implementation # # Copyright (C) 2012 Wolfgang Sourdeau <[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 3 of the ...
# -*- coding: utf-8 -*- import sphinx.roles import sphinx.environment from sphinx.writers.html import HTMLTranslator from docutils.writers.html4css1 import HTMLTranslator as DocutilsTranslator def patch(): # navify toctree (oh god) @monkey(sphinx.environment.BuildEnvironment) def resolve_toctree(old_resolv...
"""SCons.Tool.PharLapCommon This module contains common code used by all Tools for the Phar Lap ETS tool chain. Right now, this is linkloc and 386asm. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # Permission is hereby granted, free of charge, to any ...
""" Tests asserting that ModelTypes convert to and from json when working with ModelDatas """ # Allow inspection of private class members # pylint: disable=W0212 from mock import Mock from xblock.core import XBlock from xblock.fields import Field, Scope from xblock.field_data import DictFieldData from xblock.test.too...
import unittest from .testcase import BulbsTestCase from bulbs.model import Node, NodeProxy, Relationship, RelationshipProxy from bulbs.property import Integer, String, DateTime, Bool from bulbs.utils import current_datetime class Knows(Relationship): label = "knows" timestamp = DateTime(default=current_datet...
# coding: utf8 # Author: Rodrigo Bistolfi # Date: 03/2013 """ Test cases for Nikola ReST extensions. A base class ReSTExtensionTestCase provides the tests basic behaivor. Subclasses must override the "sample" class attribute with the ReST markup. The sample will be rendered as HTML using publish_parts() by setUp(). O...
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This prog...
"""Indexer objects for computing start/end window bounds for rolling operations""" from datetime import timedelta from typing import ( Dict, Optional, Tuple, Type, ) import numpy as np from pandas._libs.window.indexers import calculate_variable_window_bounds from pandas.util._decorators import Appende...
import logging from django.core.management.base import BaseCommand from django.db.models import Count from pontoon.base.models import ( Project, TranslatedResource, ) log = logging.getLogger(__name__) class Command(BaseCommand): help = """ Re-calculate statistics for all translated resources a...
""" This platform allows several cover to be grouped into one cover. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/cover.group/ """ import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.components.cover imp...
from identity.registration.backend.views import ActivationView from identity.registration.backend.views import RegistrationView from identity.registration.backend.views import ApproveView from identity.registration.backend.forms import LoginForm from django.contrib.auth import views as auth_views from django.views.gene...
""" homeassistant.helpers.state ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Helpers that help with state related things. """ import logging from homeassistant import State import homeassistant.util.dt as dt_util from homeassistant.const import ( STATE_ON, STATE_OFF, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID) _LOGGER = l...
""" Built-in, globally-available admin actions. """ from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.utils import get_deleted_objects, model_ngettext from django.core.exceptions import PermissionDenied from django.db import router from django.template.response impo...
"""This module provides access to operating system functionality that is standardized by the C Standard and the POSIX standard (a thinly disguised Unix interface). Refer to the library manual and corresponding Unix manual entries for more information on calls.""" import datetime F_OK = 0 O_APPEND = 8 O_BINARY = 32...
# 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/bin/python import pprint import re import argparse from datetime import datetime from statsd import StatsClient from utils import failureReasons, JenkinsClient def is_build_failed(job): if 'lastBuild' in job and job['lastBuild'] is not None and 'result' in job['lastBuild']: if job['lastBuild']...
from __future__ import absolute_import from typing import Dict, Any from django.http import HttpRequest from django.conf import settings from zerver.models import UserProfile, get_realm_by_string_id from zproject.backends import (password_auth_enabled, dev_auth_enabled, google_auth_enab...
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref __all__ = ['WeakSet'] class _IterationGuard(object): # This context manager registers itself in the current iterators of the # weak containe...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from past.builtins import basestring import logging import re from path import Path from flexget import plugin from flexget.config_schema import one_or_more from flexget....
# coding: utf-8 # from rest_framework import viewsets, generics, status from rest_framework.response import Response from django.utils.translation import ugettext_lazy as _ from common.permissions import IsSuperUser from ..models import CommandStorage, ReplayStorage from ..serializers import CommandStorageSerializer,...
# -*- 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...
# -*- coding: utf-8 -*- from mako.template import Template import unittest from test import TemplateTest, eq_, requires_python_2 from test.util import result_lines, flatten_result from mako.compat import u class FilterTest(TemplateTest): def test_basic(self): t = Template(""" ${x | myfilter} """) ...
import inspect import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module DEFAULT_DB_ALIAS = 'default' # Define some exceptions that mirror the PEP249 interface. # We will rethrow any backend-specific errors using these # commo...
doctests = """ Basic class construction. >>> class C: ... def meth(self): print("Hello") ... >>> C.__class__ is type True >>> a = C() >>> a.__class__ is C True >>> a.meth() Hello >>> Use *args notation for the bases. >>> class A: pass >>> class B: pass >>>...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. # """ CNI plugin parameters processing module Parameters are defined in 3 different classes - ContrailParams : Contains contrain specific parameters - K8SParams : Contains kubernetes specific parameters - Cni...
#!/usr/bin/env python # Setup script for PyPI; use CMakeFile.txt to build extension modules from setuptools import setup from distutils.command.install_headers import install_headers from pybind11 import __version__ import os # Prevent installation of pybind11 headers by setting # PYBIND11_USE_CMAKE. if os.environ.g...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe, frappe.utils, frappe.utils.scheduler import unittest test_records = frappe.get_test_records('Email Alert') class TestEmailAlert(unittest.TestCase): def setUp(self): frappe....
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
# -*- test-case-name: twisted.python.test.test_win32 -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Win32 utilities. See also twisted.python.shortcut. @var O_BINARY: the 'binary' mode flag on Windows, or 0 on other platforms, so it may safely be OR'ed into a mask for os...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'CreditProvider', fields ['provider_url'] ...
import unittest from test import test_support # Skip this test if the _testcapi module isn't available. test_support.import_module('_testcapi') from _testcapi import getargs_keywords import warnings """ > How about the following counterproposal. This also changes some of > the other format codes to be a little more re...
from pycap import Observer, ECLabAsciiFile from IPython import display from numpy import real, imag, absolute, angle from matplotlib import pyplot from sys import stdout, exit from os import remove class PrintColumns(Observer): def __new__(cls, *args, **kwargs): return object.__new__(PrintColumns) d...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
from coilsnake.model.common.table import TableEntry, LittleEndianIntegerTableEntry, RowTableEntry from coilsnake.model.eb.table import EbEventFlagTableEntry MapMusicSubTableEntry = RowTableEntry.from_schema( name="Map Music Sub Table Entry", schema=[EbEventFlagTableEntry, type("Music", (LittleEndi...