text
stringlengths
475
200k
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
"""Support code for working with Shippable.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import re import time from .. import types as t from ..config import ( CommonConfig, TestConfig, ) from ..git import ( Git, ) from ..http import ( HttpCli...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
import numpy as np import pandas as pd def normalize_address(raw_address): for c in ["'", ",", "°", "•", "`", '"', "‘", "-"]: raw_address = raw_address.replace(c, "") raw_address = raw_address.lower() if "<" in raw_address: prefix = raw_address[:raw_address.index("<")].strip() if ...
#!/usr/bin/env python # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script every time you change one of the png files. Using pngcrush, it will optimize the png fi...
## # Copyright 2013-2019 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'WmsServer.js_popup_class' db.add_column('lizard_workspace_wmsserver', 'js_popup_class', se...
from unittest import TestCase from Data_Production.sem_extract_pipeline import SemPipeline, ParamTester from collections import Counter import re import os import shutil import numpy as np __author__ = 'matt' class TestInit(TestCase): def test_sim_algo_reset(self): """ Tests whether an incorrect value fo...
""" This module contains general purpose URL functions not found in the standard library. Some of the functions that used to be imported from this module have been moved to the w3lib.url module. Always import those from there instead. """ import posixpath from six.moves.urllib.parse import (ParseResult, urlunparse, ur...
from __future__ import absolute_import import logging import os import re import shutil import sys import tempfile import warnings import zipfile from distutils.util import change_root from distutils import sysconfig from email.parser import FeedParser from pip._vendor import pkg_resources, six from pip._vendor.dist...
import unittest from django.test import TestCase from operating_system.public import OperatingSystem from remote_host.public import RemoteHost from ..operating_system_support import OperatingSystemRelations, AbstractedRemoteHostOperator RELATION_MOCK = { '1': { '2': { '3': { ...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [EMAIL], All rights reserved. # LLNL-CODE-647188 # # F...
# sqlalchemy/events.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Core event interfaces.""" from . import event, exc from .pool import Pool f...
import sys import unittest from django.db import connection from django.test import TestCase from django.test.runner import DiscoverRunner from django.utils import six from django.utils.encoding import force_text from .models import Person @unittest.skipUnless(connection.vendor == 'sqlite', 'Only run on sqlite so w...
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [EMAIL], All rights reserved. # LLNL-CODE-647188 # # F...
from __future__ import print_function from .segments import reg_helpersegment, decoratorsegment from .types import parse_parameters from .beewrapper import beewrapper, reg_beehelper import inspect import libcontext import functools from . import emptyclass, mytype from .event import exception from .resolve import reso...
from django import template, templatetags from django.template import RequestContext from django.conf import settings from django.contrib.admin.views.decorators import staff_member_required from django.db import models from django.shortcuts import render_to_response from django.core.exceptions import ImproperlyConfigur...
try: import unittest2 as ut assert ut # Suppress pyflakes warning about redefinition of unused ut except ImportError: import unittest as ut from builders import arange_spikes from numpy.testing import assert_array_equal, assert_array_almost_equal from spykeutils import tools import neo import neo.io.tools...
import pygame import numpy import opencv #this is important for capturing/displaying images from opencv import highgui def list_cameras(): """ """ # -1 for opencv means get any of them. return [-1] def init(): pass def quit(): pass class Camera: def __init__(self, device =0, size =...
"""Fix UserDict. Incomplete! TODO: base this on fix_urllib perhaps? """ # Local imports from lib2to3 import fixer_base from lib2to3.fixer_util import Name, attr_chain from lib2to3.fixes.fix_imports import alternates, build_pattern, FixImports MAPPING = {'UserDict': 'collections', } # def alternates(members): # ...
from openerp.http import request from openerp.addons.website_product_configurator.controllers.main import ( WebsiteProductConfig ) class WebsiteProductConfigMrp(WebsiteProductConfig): def cart_update(self, product, post): if post.get('assembly') == 'kit': attr_products = product.attribut...
#!/usr/bin/env python3 # Copyright (c) 2019 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 the wallet implicit segwit feature.""" import test_framework.address as address from test_framework.te...
# failed system call counts, by pid # (c) 2010, Tom Zanussi <[EMAIL]> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(o...
#!/usr/bin/env python # -*- coding: utf-8 -*- ## ## This file is part of Harvesting Kit. ## Copyright (C) 2014 CERN. ## ## Harvesting Kit 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 t...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [EMAIL], All rights reserved. # LLNL-CODE-647188 # # F...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack 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 # ...
import json class RestAPI: def __init__(self, database=None): self.database = database or {'users': []} def update(self): for user in self.database['users']: owed_by = user['owed_by'] owes = user['owes'] for debtor in list(owed_by.keys()): i...
'''"Executable documentation" for the pickle module. Extensive comments about the pickle protocols and pickle-machine opcodes can be found here. Some functions meant for external use: genops(pickle) Generate all the opcodes in a pickle, as (opcode, arg, position) triples. dis(pickle, out=None, memo=None,...
# Copyright (C) 2007 Sadique Puthen <[EMAIL]> # This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # S...
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito ([EMAIL]) # # Jockey 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. # # Jockey ...
# -*- 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) 2013 Hesky Fisher # See LICENSE.txt for details. import sys if sys.platform.startswith('win32'): import win32gui GetForegroundWindow = win32gui.GetForegroundWindow SetForegroundWindow = win32gui.SetForegroundWindow def SetTopApp(): # Nothing else is necessary for windows. ...
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the common.py file.""" import gyp.common import unittest import sys class TestTopologicallySorted(unittest.TestCase): ...
""" Daemon (aka Ziplick) - Filesystem queue daemon functions. They're all called from inside the twisted reactor loop, except for initialization functions (c) Copyright 2005 Ben Bangert, Philip Jenvey [See end of file] """ import os, re, sys, time, Hellanzb, PostProcessor, PostProcessorUtil from shutil import copy, m...
# -*- coding: utf-8 -*- ############################################################################### # # CSW Client # --------------------------------------------------------- # QGIS Catalog Service client. # # Copyright (C) 2014 Tom Kralidis ([EMAIL]) # # This source is free software; you can redistribute it and/or...
"""An implementation of tabbed pages using only standard Tkinter. Originally developed for use in IDLE. Based on tabpage.py. Classes exported: TabbedPageSet -- A Tkinter implementation of a tabbed-page widget. TabSet -- A widget containing tabs (buttons) in one or more rows. """ from tkinter import * class InvalidN...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Gramps # # 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 late...
# ScratchABlock - Program analysis and decompilation framework # # Copyright (c) 2015-2018 Paul Sokolovsky # # 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 #...
from parsl.config import Config from parsl.launchers import SrunLauncher from parsl.providers import SlurmProvider from parsl.executors import HighThroughputExecutor from .user_opts import user_opts def fresh_config(): return Config( executors=[ HighThroughputExecutor( label='C...
from . import utils from .path import * from .pathFinder import * import copy class ConnectivityMatrix: def __init__(self, graph): self._graph = graph self._paths = [] self._nodes = [] self._initialMatrix = [] self._matrix = [] self._rowLabels = [] self._...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<[EMAIL]> # http://binux.me # Created on 2014-02-15 22:10:35 import os import json import copy import time import umsgpack import subprocess import unittest2 as unittest from multiprocessing import Q...
# 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 ...
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import difflib import os from matplotlib import rcParams, rcdefaults, use _multiprocess_can_split_ = True # Check that the test directories exist if not os.path.exists(os.path.join( os....
#!/usr/bin/env python """Tests for Windows Volume Shadow Copy flow.""" import stat from grr.lib import aff4 from grr.lib import flags from grr.lib import test_lib # needed for ListVolumeShadowCopies pylint: disable=unused-import from grr.lib.flows.general import windows_vsc # pylint: enable=unused-import from grr.lib....
import os, subprocess, logging from i18n.config import BASE_DIR LOG = logging.getLogger(__name__) def execute(command, working_directory=BASE_DIR): """ Executes shell command in a given working_directory. Command is a string to pass to the shell. Output is ignored. """ LOG.info("Executing in ...
# -*- coding: UTF-8 -*- """ Title: Dumpscript management command Project: Hardytools (queryset-refactor version) Author: Will Hardy (http://willhardy.com.au) Date: June 2008 Usage: python manage.py dumpscript appname > scripts/scriptname.py $Revision: 217 $ Description: Generates a Py...
""" Cookbook recipe 500261, Raymond Hettinger, planned for inclusion in 2.6 : http://docs.python.org/dev/library/collections.html#collections.namedtuple """ from operator import itemgetter as _itemgetter from keyword import iskeyword as _iskeyword import sys as _sys __all__ = ['namedtuple'] def namedtuple(typenam...
""" Example producer that sends a single message and exits. You can use `complete_receive.py` to receive the message sent. """ from kombu import Connection, Producer, Exchange, Queue #: By default messages sent to exchanges are persistent (delivery_mode=2), #: and queues and exchanges are durable. exchange = Exchan...
import re import os import requests from urllib.parse import urlparse from django.core.management.base import BaseCommand from django.conf import settings from django.core.files import File from ...models import Page, Image, page_image_path class Command(BaseCommand): """ Fix success story page images """ ...
import theano from theano import tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import numpy as np from load import mnist from theano.tensor.nnet.conv import conv2d from theano.tensor.signal.downsample import max_pool_2d import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 imp...
""" Maps Symbol typeface to Unicode, extracted from http://en.wikipedia.org/wiki/Symbol_(typeface) """ from __future__ import absolute_import import codecs import six from six.moves import map decodeTable = { 32: 32, 33: 33, 34: 8704, 35: 35, 36: 8707, 37: 37, 38: 38, 39: 8717, 40: 40, 41: 41, 42: 42, 43: 43...
import warnings from unittest import skipIf from django.test import SimpleTestCase from ..utils import setup try: import numpy except ImportError: numpy = False @skipIf(numpy is False, "Numpy must be installed to run these tests.") class NumpyTests(SimpleTestCase): # Ignore numpy deprecation warnings (...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Support for interactive mode to allow VisPy's event loop to be run alongside a console terminal, without using threads. This code relies on inputhooks built-in to the Pyth...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """docfield utililtes""" import frappe def rename(doctype, fieldname, newname): """rename docfield""" df = frappe.db.sql("""select * from tabDocField where parent=%s and field...
# Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009,2015 Advanced Micro Devices, Inc. # Copyright (c) 2013 Mark D. Hill and David A. Wood # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
# -*- coding: utf-8 -*- import document import interface import package import rulegenerator import testgenerator class ArgumentVisitorBase(interface.ArgumentVisitor): def visitReturnValue(self, retValue): self.visitAllocation(retValue) class SingleArgumentVisitor(ArgumentVisitorBase): """ V...
"""Word completion for GNU readline. The completer completes keywords, built-ins and globals in a selectable namespace (which defaults to __main__); when completing NAME.NAME..., it evaluates (!) the expression up to the last dot and completes its attributes. It's very cool to do "import sys" type "sys.", hit the com...
#!/usr/bin/python # # 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 distribut...
#!/usr/bin/python # Python modules import sys, os, shutil, glob, io # Aion modules from Aion.utils.graphics import * from Aion.utils.data import * from Aion.shared.constants import * # Third-party libraries from androguard.session import Session from androguard.misc import AXMLPrinter class Garfield(): """ Gar...
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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...
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
# Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
import sys import os helpers_dir = os.getenv("PYCHARM_HELPERS_DIR", sys.path[0]) if sys.path[0] != helpers_dir: sys.path.insert(0, helpers_dir) from nose_utils import TeamcityPlugin from pycharm_run_utils import debug, import_system_module from pycharm_run_utils import adjust_sys_path adjust_sys_path(False) sh...
''' Demonstrate use of a log color scale in contourf ''' from matplotlib import pyplot as P import numpy as np from numpy import ma from matplotlib import colors, ticker, cm from matplotlib.mlab import bivariate_normal N = 100 x = np.linspace(-3.0, 3.0, N) y = np.linspace(-2.0, 2.0, N) X, Y = np.meshgrid(x, y) # A ...
#@ignore #@language python #@ignore #@language python """ Package: Karrigell_QuickForm-1.0.1-alpha Requirements: Karrigell HTTP Server - http://karrigell.sourceforge.net Description: - A simple class that generates html forms with some basic javascript validations. - It is similar to HTML_QuickForm...
# -*- coding: utf-8 -*- """ *************************************************************************** pyuic-wrapper.py --------------------- Date : March 2016 Copyright : (C) 2016 by Juergen E. Fischer Email : jef at norbit dot de ************************...
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import numpy as np from matplotlib.testing.decorators import image_comparison, cleanup import matplotlib.pyplot as plt import matplotlib.patheffects as path_effects try: # mock in python 3.3+ ...
import web from web import form import socket import RPi.GPIO as GPIO import time from threading import Thread from threading import Lock localhost = "http://" + socket.gethostbyname(socket.gethostname()) + ":8080" print(localhost) global infrared, ultrasonic, servomotor, motor_L1, motor_L2, motor_R1, motor_R2...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2007-2009,2011 Zuza Software Foundation # # This file is part of translate. # # translate 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 vers...
# Copyright 2010 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). from random import randint from identityprovider.models.account import Account, LPOpenIdIdentifier from identityprovider.models.const import ( AccountCreationRationale, Acc...
#!/usr/bin/env python from __future__ import division __author__ = "Jai Ram Rideout" __copyright__ = "Copyright 2013, The QIIME Project" __credits__ = ["Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Jai Ram Rideout" __email__ = "[EMAIL]" """Test suite for the estimate_observation_r...
# -*- coding: utf-8 -*- # taken from requests library: https://github.com/kennethreitz/requests """ pythoncompat """ import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and...
# (c) 2016 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...
import logging import time import pystache from flask import request from authentication import current_org from flask_login import current_user, login_required from flask_restful import abort from redash import models, utils from redash.handlers import routes from redash.handlers.base import (get_object_or_404, org_...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from django.contrib.auth.models import Group from django.core import urlresolvers from django.template import Context, Engine, TemplateSyntaxError from django.template.base import UNKNOWN_SOURCE from django.test import SimpleTestCase, override...
data = ( 'Po ', # 0x00 'Feng ', # 0x01 'Zhuan ', # 0x02 'Fu ', # 0x03 'She ', # 0x04 'Ke ', # 0x05 'Jiang ', # 0x06 'Jiang ', # 0x07 'Zhuan ', # 0x08 'Wei ', # 0x09 'Zun ', # 0x0a 'Xun ', # 0x0b 'Shu ', # 0x0c 'Dui ', # 0x0d 'Dao ', # 0x0e 'Xiao ', # 0x0f 'Ji ', # 0x10...
# -*- coding: utf-8 -*- # Authors: Olivier Grisel <[EMAIL]> # Mathieu Blondel <[EMAIL]> # Lars Buitinck <[EMAIL]> # Robert Layton <[EMAIL]> # Jochen Wersdörfer <[EMAIL]> # Roman Sinayev <[EMAIL]> # # License: BSD 3 clause """ The :mod:`sklearn.feature_extraction.text` submod...
# (c) 2016 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...
""" Test the various password reset flows """ import json import re import unittest from django.core.cache import cache from django.conf import settings from django.test import TestCase from django.test.client import RequestFactory from django.contrib.auth.models import User from django.contrib.auth.hashers import UNU...
import json from django.contrib.messages import constants from django.contrib.messages.tests.base import BaseTest from django.contrib.messages.storage.cookie import (CookieStorage, MessageEncoder, MessageDecoder) from django.contrib.messages.storage.base import Message from django.test.utils import override_settin...
# -*- coding: utf-8 -*- """ werkzeug.routing ~~~~~~~~~~~~~~~~ When it comes to combining multiple controller or view functions (however you want to call them) you need a dispatcher. A simple way would be applying regular expression tests on the ``PATH_INFO`` and calling registered callback fun...
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2009-2010 Soluciones Tecnologócias Prisma S.A. All Rights Reserved. # José Rodrigo Fernández Menegazzo, Soluciones Tecnologócias Prisma S.A. # (http://www.solucionesprisma.com) # # This prog...
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import links from chainer import testing from chainer.testing import attr class TestHighway(unittest.TestCase): in_out_size = 3 def setUp(self): ...
# -*- 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): # Adding model 'Category' db.create_table(u'sampleapp_category', ( ...
def __boot(): import sys import os PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathsep) pic = getattr(sys,'path_importer_cache',{}) stdpath = sys.path[le...
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2018-2021 Florian Bruhin (The Compiler) <[EMAIL]> # # This file is part of qutebrowser. # # qutebrowser 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 Found...
# 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 sys import unittest from cStringIO import StringIO import pytest from .. import parser, serializer class Tok...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
# -*- coding: utf-8 -*- # Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. from pyoko.db.adapter.db_riak import BlockSave from ulakbus.models import User, DersEtkinligi, SinavEtkinligi, Donem, Room from zengine.lib.test_utils imp...
# -*- coding: utf-8 -*- from aiohttp.web_exceptions import HTTPMethodNotAllowed from aiohttp.web_exceptions import HTTPNotFound from aiohttp.web_exceptions import HTTPUnauthorized from dateutil.tz import tzlocal from plone.server import app_settings from plone.server import configure from plone.server import _ from plo...
from wtforms.widgets import HTMLString, TextArea pagedown_pre_html = '<div class="flask-pagedown">' pagedown_post_html = '</div>' preview_html = ''' <div class="flask-pagedown-preview" id="flask-pagedown-%(field)s-preview"></div> <script type="text/javascript"> f = function() { if (typeof flask_pagedown_converter ...
import test.support, unittest class PowTest(unittest.TestCase): def powtest(self, type): if type != float: for i in range(-1000, 1000): self.assertEqual(pow(type(i), 0), 1) self.assertEqual(pow(type(i), 1), type(i)) self.assertEqual(pow(type(0), ...
""" Testing for the approximate neighbor search using Locality Sensitive Hashing Forest module (sklearn.neighbors.LSHForest). """ # Author: Maheshakya Wijewardena, Joel Nothman import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_a...
# -*- coding: utf-8 -*- """ jinja2.testsuite.utils ~~~~~~~~~~~~~~~~~~~~~~ Tests utilities jinja uses. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import gc import pytest import pickle from jinja2.utils import LRUCache, escape, object_type_repr @pyt...
""" Copyright (c) 2015-2020 Raj Patel([EMAIL]), StopStalk 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, c...
#!/usr/bin/env python # # Copyright 2008,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
import importlib import json import os import gettext as gettext_module from django import http from django.apps import apps from django.conf import settings from django.template import Context, Template from django.utils.translation import check_for_language, to_locale, get_language, LANGUAGE_SESSION_KEY from django....
""" Classes representing uploaded files. """ import os from io import BytesIO from django.conf import settings from django.core.files.base import File from django.core.files import temp as tempfile from django.utils.encoding import force_str __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',...