text
stringlengths
475
200k
# 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...
import unittest from proboscis.asserts import assert_equal from proboscis.asserts import assert_false from proboscis.asserts import assert_raises from proboscis.asserts import assert_true from proboscis import after_class from proboscis import before_class from proboscis import SkipTest from proboscis import test impo...
import unittest class TrueCodePaths(unittest.TestCase): def setUp(self): vars = request.vars vars["lat"] = 0 vars["lon"] = 0 vars["zoom"] = 1 self.old_s3roles = list(session.s3.roles) session.s3.roles.append(1) def tearDown(self): ...
import logging from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from six.moves import configparser, input from django_extensions.management.utils import signalcommand try: from django.db.backends.base.creation import TEST_DATABASE...
import sys import imp import os import subprocess USER_TESTS = "userTests" TEST_FAILED = "FAILED" TEST_PASSED = "PASSED" INPUT = "input" OUTPUT = "output" def get_index(logical_name, full_name): logical_name_len = len(logical_name) if full_name[:logical_name_len] == logical_name: return int(full_n...
#Software to encode binary information to DNA nucleotides import binascii import re class DNAEncoder: def __init__(self): self.binaryArray = [] self.nucleotideArray = [] #This section of code is used for the express purpose of encoding binary information #Creates a demilited binary array ...
#!/bin/env python #Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __version__=''' $Id: test_platypus_tables.py 3959 2012-09-27 14:39:39Z robin $ ''' __doc__='Test script for reportlab.tables' from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocatio...
############################ Copyrights and license ############################ # # # Copyright 2019 Olof-Joachim Frahm <[EMAIL]> # # # # This...
# This is a Python code using OpenCV to print the probabilities and predictions on videos # # I am working for a deadline. It's still messed up... # # Contact: Chih-Yao Ma at [EMAIL] import numpy as np import cv2 import random import re n = 3 # number of predictions per video nVideo = 3754 # number of total videos...
from __future__ import print_function, division import numpy as np from msmbuilder.hmm import VonMisesHMM from msmbuilder.example_datasets import AlanineDipeptide from msmbuilder.featurizer import DihedralFeaturizer from scipy.stats.distributions import vonmises from itertools import permutations import random def t...
# -*- 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...
""" Run through comments in a specified list of subreddits, look for typos, and if a typo is found, post a new comment with the corrected spelling. """ import praw import time import logging from . import ap_config logger = logging.getLogger(__name__) # User agent info so Reddit can track the bot r = pra...
from __future__ import division, print_function import os import subprocess import shutil from os.path import join as pjoin, split as psplit, dirname from zipfile import ZipFile import re def get_sdist_tarball(): """Return the name of the installer built by wininst command.""" # Yeah, the name logic is harcod...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Matt Makai <[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 # (a...
""" Diffusion 2: jump diffusion, stochastic volatility, stochastic time Created on Tue Dec 08 15:03:49 2009 Author: josef-pktd following Meucci License: BSD contains: CIRSubordinatedBrownian Heston IG JumpDiffusionKou JumpDiffusionMerton NIG VG References ---------- Attilio Meucci, Review of Discrete and Contin...
# -*- coding: utf-8 -*- from django.test import TestCase, RequestFactory from django.core import exceptions from django.contrib.auth.models import AnonymousUser from .utils import get_payway_class, begin_transaction, format_amount, PayWay from .models import Transaction from decimal import Decimal, InvalidOperation ...
#Copyright (c) 2011 Erich Schubert [EMAIL] #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, di...
#!/usr/bin/env python # -*- coding: utf-8 -*- '''! Created on 5/2/2015 @author: Antonio Hermosilla Rodrigo. @contact: [EMAIL] @organization: Antonio Hermosilla Rodrigo. @copyright: (C) 2015 by Antonio Hermosilla Rodrigo @version: 1.0.0 ''' from Geometrias.Angulo import Angulo class PuntoGeodesico(object): '''! ...
"""$Id: channel.py 711 2006-10-25 00:43:41Z rubys $""" __author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>" __version__ = "$Revision: 711 $" __date__ = "$Date: 2006-10-25 00:43:41 +0000 (Wed, 25 Oct 2006) $" __copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim" from ...
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
"""Test the helper objects in letsencrypt_nginx.obj.""" import unittest class AddrTest(unittest.TestCase): """Test the Addr class.""" def setUp(self): from letsencrypt_nginx.obj import Addr self.addr1 = Addr.fromstring("192.168.1.1") self.addr2 = Addr.fromstring("192.168.1.1:* ssl") ...
# Tests for Sensor # # Copyright (c) 2014 Charles Weir. Shared under the MIT Licence. import unittest from BrickPython.BrickPi import PORT_1 from BrickPython.Sensor import Sensor, TouchSensor, UltrasonicSensor, LightSensor import TestScheduler class TestSensor(unittest.TestCase): 'Tests for the Sensor classes' ...
import logging from django.db import models from django.contrib.auth.models import User from django.dispatch import receiver from django.db.models.signals import post_save from django.utils.translation import ugettext_noop from student.models import CourseEnrollment from xmodule.modulestore.django import modulestore...
# 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 -*- ############################################################################## # # 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 (c) 2016 Georgia Institute of Technology # 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 conditi...
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requi...
# 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...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
#!/usr/bin/env python2.7 -E # -*- coding: utf-8 -*- # Launch script for Jython. It may be wrapped as an executable with # tools like PyInstaller, creating jython.exe, or run directly. The # installer will make this the default launcher under the name # bin/jython if CPython 2.7 is available with the above shebang # in...
from ctypes import POINTER, c_double, c_int, c_uint from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import ( GEOSException, last_arg_byref, ) # ## Error-checking routines specific to coordinate sequences. ## def check_cs_op(result, fu...
# Copyright (c) 2012 OpenStack Foundation. # Administrator of the National Aeronautics and Space Administration. # 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 a...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Johan Wiren <[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.0', ...
# Adapted from test_file.py by Daniel Stutzbach import sys import os import io import errno import unittest from array import array from weakref import proxy from functools import wraps from test.support import TESTFN, check_warnings, run_unittest, make_bad_fd, cpython_only from collections import UserList from _io ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- from collections import defaultdict import random import sys sys.path.insert(1, "../../") import h2o from h2o.exceptions import H2OValueError from h2o.utils.compatibility import viewvalues from tests import pyunit_utils def create_frame_test(): """Test `h2o.create_fr...
from .bases import _ScandinavianStemmer from whoosh.compat import u class SwedishStemmer(_ScandinavianStemmer): """ The Swedish Snowball stemmer. :cvar __vowels: The Swedish vowels. :type __vowels: unicode :cvar __s_ending: Letters that may directly appear before a word final 's'. :type __s...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Ri...
from io import BytesIO class CallbackFileWrapper(object): """ Small wrapper around a fp object which will tee everything read into a buffer, and when that file is closed it will execute a callback with the contents of that buffer. All attributes are proxied to the underlying file object. Thi...
# -*- coding: utf-8 -*- from setuptools import find_packages, setup DESCRIPTION = "A MongoEngine MapField that allows and requires ObjectIds as " \ "keys." try: LONG_DESCRIPTION = open('README.md').read() except: LONG_DESCRIPTION = DESCRIPTION setup( name='mongoengine-objectidmapfield', ...
# Pretty-printers for libstdc++. # Copyright (C) 2008-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option)...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
from setuptools import setup, find_packages setup( name="XModule", version="0.1", packages=find_packages(exclude=["tests"]), install_requires=[ 'distribute', 'docopt', 'capa', 'path.py', ], package_data={ 'xmodule': ['js/module/*'] }, # See http:...
# -*- coding: utf-8 -*- from website.util import rubeus from ..api import Figshare def figshare_hgrid_data(node_settings, auth, parent=None, **kwargs): node = node_settings.owner if node_settings.figshare_type == 'project': item = Figshare.from_settings(node_settings.user_settings).project(node_setti...
#*************************************************************************** #* * #* Copyright (c) 2012 Sebastian Hoogen <[EMAIL]> * #* * #* This program is free soft...
#!/usr/bin/python """ PN CLI show commands """ # # 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 ver...
# 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...
""" Module for checking permissions with the comment_client backend """ import logging from types import NoneType from django.core import cache from opaque_keys.edx.keys import CourseKey CACHE = cache.get_cache('default') CACHE_LIFESPAN = 60 def cached_has_permission(user, permission, course_id=None): """ C...
# -*- coding: utf-8 -*- ############################################################################### # # GetZestimate # Retrieve estimate information for a specified property. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you ...
""" Views for support dashboard """ import logging from django.contrib.auth.models import User from django.views.generic.edit import FormView from django.views.generic.base import TemplateView from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect from django.contrib import mes...
# Copyright 2012 Andrew Bogott for the Wikimedia Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import numpy as np from numpy.testing import assert_array_equal, assert_allclose from vispy.testing import run_tests_if_main from vispy.geometry import (create_box, create_cub...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 Stephane Caron <[EMAIL]> # # This file is part of pymanoid. # # pymanoid 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...
import asyncio import datetime import logging import logging.handlers import sys from aiohttp.web_log import AccessLogger from utilities.database import create_database_connection sys.path.insert(0, "..") from units.files import create_folder sys.path.pop(0) class ConsoleLogger(object): '''Console Logger''' ...
"""Management command for backpopulating missing program credentials.""" import logging from collections import namedtuple from django.contrib.sites.models import Site from django.core.management import BaseCommand from django.db.models import Q from opaque_keys.edx.keys import CourseKey from lms.djangoapps.certifica...
# Copyright (c) 2013 Rackspace Hosting # 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 req...
# 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...
from __future__ import absolute_import import responses from six.moves.urllib.parse import urlencode from sentry.models import Integration from sentry.integrations.msteams.client import MsTeamsClient from sentry.testutils import TestCase from sentry.utils.compat.mock import patch class MsTeamsClientTest(TestCase):...
import numpy as np from opentrons import config from opentrons.calibration_storage import file_operators as io from opentrons.hardware_control import robot_calibration from opentrons.util.helpers import utc_now from opentrons.types import Mount def test_migrate_affine_xy_to_attitude(): affine = [[1.0, 2.0, 3.0, ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2020-02-03 22:32 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): # This flag is used to mark that a migration shouldn't be automatically run in # production. We set this to True for operat...
#!/usr/bin/env python # # metadataPDF.py - dump pdf metadata # # Copy of Yusuke's dumppdf to add dumpmeta import sys, re from pdfminer.psparser import PSKeyword, PSLiteral from pdfminer.pdfparser import PDFDocument, PDFParser from pdfminer.pdftypes import PDFStream, PDFObjRef, resolve1, stream_value # dumpmeta class...
from django.test import TestCase from famille import models from famille.templatetags import helpers, users __all__ = ["TemplateTagsTestCase", ] class TemplateTagsTestCase(TestCase): def test_get_class_name(self): obj = models.Prestataire() self.assertEqual(helpers.get_class_name(obj), "Presta...
""" Provide tests for git_add_course management command. """ import logging import os import shutil import StringIO import subprocess import unittest from uuid import uuid4 from nose.plugins.attrib import attr from django.conf import settings from django.core.management import call_command from django.core.management....
from . import wgwidget from .wgtextbox import Textfield class AnnotateTextboxBase(wgwidget.Widget): """A base class intented for customization. Note in particular the annotationColor and annotationNoColor methods which you should override.""" ANNOTATE_WIDTH = 5 def __init__(self, screen, value =...
# 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 -*- """ werkzeug.debug.tbtools ~~~~~~~~~~~~~~~~~~~~~~ This module provides various traceback related utility functions. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import re import os import sys import inspect import traceback imp...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.loader import MigrationLoader class Command(BaseCommand): help = "Shows all available migrations for the ...
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
from tornado import testing from mainWebserver import make_app import json from echo.feeds.feed import Feed HTTP_SUCCESS_CODE = 200 HTTP_NOT_FOUND_CODE = 404 class CustomFeedTest(testing.AsyncHTTPTestCase): def get_app(self): return make_app() def test_crud_feed(self): payload = { ...
__author__ = 'jgressmann' from datetime import date import pickle import sys import traceback import urllib import urlparse #import urlresolver import xbmc import xbmcaddon import xbmcgui import xbmcplugin import zlib import resources.lib.sc2links as sc2links addon = xbmcaddon.Addon() #__addonname__ = addon.getAddon...
#!/usr/bin/env python2 """Some validation for proc_doc.Proc*""" __author__ = 'Manuel Holtgrewe <[EMAIL]>' class ProcDocValidator(object): """Validate proc_doc.Proc* objects. Implements the visitor pattern. """ def __init__(self, msg_printer): self.msg_printer = msg_printer def validate(...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 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...
from __future__ import unicode_literals import collections import getpass import optparse import os import re import shutil import socket import subprocess import sys try: import urllib.request as compat_urllib_request except ImportError: # Python 2 import urllib2 as compat_urllib_request try: import u...
"""Testing for Spectral Clustering methods""" from sklearn.externals.six.moves import cPickle dumps, loads = cPickle.dumps, cPickle.loads import numpy as np from scipy import sparse from sklearn.utils import check_random_state from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_a...
# Test the functions and main class method of FormatParagraph.py import unittest from idlelib import FormatParagraph as fp from idlelib.EditorWindow import EditorWindow from tkinter import Tk, Text from test.support import requires class Is_Get_Test(unittest.TestCase): """Test the is_ and get_ functions""" te...
#!/usr/bin/env python # 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 argparse import os.path import sys from filecmp import dircmp from shutil import rmtree from tempfile import mkdtemp from mopy.p...
# -*- coding: utf-8 -*- # (c) 2016, Adrian Likins <[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) a...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding unique constraint on 'MetaData', fields ['xform', 'data_type', 'data_value'] db.create_unique(u'mai...
import numpy import six from chainer import cuda from chainer import function from chainer import utils from chainer.utils import type_check class TheanoFunction(function.Function): def __init__(self, forward_func, backward_func): utils.experimental('chainer.functions.TheanoFunction') self.forwa...
# # Copyright 2012 eNovance <[EMAIL]> # Copyright 2012 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2006-2010 1&1 Internet AG, Germany, http://www.1und1.de # # License: # LGPL: http://www.gnu.org/li...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from argparse import ArgumentParser from datetime import datetime from dateutil.rrule import rrulestr import os import sys from textwrap import dedent from .config import ConfigHandler from .errors import AnswerError CONFIG_LOCATION =...
# -*- test-case-name: openid.test.test_fetchers -*- """ This module contains the HTTP fetcher interface and several implementations. """ __all__ = ['fetch', 'getDefaultFetcher', 'setDefaultFetcher', 'HTTPResponse', 'HTTPFetcher', 'createHTTPFetcher', 'HTTPFetchingError', 'HTTPError'] import urll...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # 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 late...
import hashlib import Crypto.Hash.SHA256 as sha256 import binascii from bitcoin import key as ecdsa from bitcoin import base58 from baseconv import dice_to_10 def dsha256(s): return sha256.new(sha256.new(s).digest()).digest() def rhash(s): h1 = hashlib.new('ripemd160') h1.update(hashlib.sha256(s).digest()) retu...
# -*- coding: utf-8 -*- import sys import os reload(sys) sys.setdefaultencoding("utf-8") from sqlalchemy import Table from yaml import load,dump try: from yaml import CSafeLoader as SafeLoader print "Using CSafeLoader" except ImportError: from yaml import SafeLoader print "Using Python SafeLoader" distribution={...
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2018 Sébastien Helleu <[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 License, or # (at your option) any later ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
# 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...
from numpy.testing import * from numpy import array from numpy.compat import asbytes import util class TestReturnCharacter(util.F2PyTest): def check_function(self, t): tname = t.__doc__.split()[0] if tname in ['t0','t1','s0','s1']: assert t(23)==asbytes('2') r = t('ab');asse...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [EMAIL], All rights reserved. # LLNL-CODE-647188 # # F...
"""Implementation of the JSON adaptation objects This module exists to avoid a circular import problem: pyscopg2.extras depends on psycopg2.extension, so I can't create the default JSON typecasters in extensions importing register_json from extras. """ # psycopg/_json.py - Implementation of the JSON adaptation object...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Michael J. Schultz <[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,...
#!/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 node responses to invalid transactions. In this test we connect to one node over p2p, and test tx...
"""Exceptions raised by the credit API. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from rest_framework import status from rest_framework.exceptions import APIException # TODO: Cleanup this mess! ECOM-2908 class CreditApiBadRequest(Exception): """ Could...
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer [EMAIL] # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # Li...
"""Implementation of JSONEncoder """ import re try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from _json import encode_basestring as c_encode_basestring except ImportError: c_encode_basestring = None try: from _j...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 XCG Consulting # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import unittest from openerp.tools.translate import quote, unquote, xml_translate class TranslationToolsTestCase(unittest.TestCase): def test_quote_unquote(self): def test_string(str): quoted =...