gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" Tests for L{eliot._traceback}. """ from __future__ import unicode_literals from unittest import TestCase, SkipTest from warnings import catch_warnings, simplefilter import traceback import sys try: from twisted.python.failure import Failure except ImportError: Failure = None from .._traceback import wri...
#!/usr/bin/env python # Copyright (c) 2011 Stanford University # # Permission to use, copy, modify, and distribute this software 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 "AS IS" AND ...
# 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 'Perspective.created' db.add_column('avocado_perspective', 'created', self.gf('django.db.mo...
from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy import asarray_chkfinite from scipy._lib.six import callable from .lapack import get_lapack_funcs from .misc import LinAlgError, _datacopied __all__ = ['qz', 'ordqz'] _double_precision = ['i', 'l', 'd'] ...
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright 2013 Canonical Corp. # 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 # # htt...
import numpy from six import moves import chainer from chainer import backend from chainer.backends import cuda from chainer import configuration from chainer import function_node from chainer.functions.connection import convolution_2d from chainer.utils import conv from chainer.utils import conv_nd from chainer.utils...
import numpy as np import ms import shifter import sampler import numpy as np import scipy.optimize as op from scipy import ndimage import time import terminator f = .05 g = .01 #fl = 1e-5 class stuff(object): def __init__(self, data, cx, cy, mask, H = 3, epsilon = .01 , min_iter=5, max_iter=10, check_iter=...
import collections import keyword import re import types from k.config import Config def _validate(config_dict, config_fields): """Validate a parsed config dictionary Validates the contents of config_dict against the fields defined in this CheckedConfig. Makes sure that all required fields are present and have a...
# Copyright (c) 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 required by applicable law or agreed to in writ...
# -*- coding: utf-8 -*- ''' Build entity grid using StanfordCoreNLP Reference: Barzilay, R., & Lapata, M. (2008). Modeling local coherence: An entity-based approach. Computational Linguistics, 34(1), 1-34. ''' from __future__ import print_function, division from collections import defaultdict from functools imp...
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file ... # # Created: Fri May 08 16:50:11 2015 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_projectManager(object): def setupUi(self, ...
# Copyright 2015-2016 OpenMarket Ltd # Copyright 2017-2018 New Vector Ltd # Copyright 2019 The Matrix.org Foundation C.I.C. # # 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....
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import pkg_resources import requests import unittest from six.moves import urllib from mock import patch from mock import MagicMock as Mock import pyrax import pyrax.utils as utils import pyrax.exceptions as exc from pyrax import cl...
"""Message class.""" import sys from .compression import decompress from .exceptions import reraise, MessageStateError from .serialization import loads from .utils.functional import dictfilter __all__ = ('Message',) ACK_STATES = {'ACK', 'REJECTED', 'REQUEUED'} IS_PYPY = hasattr(sys, 'pypy_version_info') class Mes...
# Copyright (c) 2010-2012 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 a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
import numpy import six import chainer import chainerx from chainer import backend from chainer.backends import cuda from chainer.backends import intel64 from chainer import function from chainer import function_node from chainer.utils import type_check def _extract_gates(x): r = x.reshape((len(x), x.shape[1] //...
from django.db import models from django.contrib.auth.models import User, Group from django.dispatch import receiver from django.db.models.signals import post_save, post_delete, pre_save,\ m2m_changed from django.db.models import Q from django.conf import settings import os from django.utils.html import strip_tags ...
import ctypes import json import pickle import random from binascii import a2b_hex, b2a_hex from io import BytesIO from unittest import mock from django.contrib.gis import gdal from django.contrib.gis.geos import ( GeometryCollection, GEOSException, GEOSGeometry, LinearRing, LineString, MultiLineString, MultiP...
# Copyright (c) 2018 PaddlePaddle 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 app...
# -*- coding:Utf-8 -*- import numpy as np import scipy as sp import matplotlib.pylab as plt import scipy.linalg as la def dist_nonvectorized(A,B,C,D,alpha,beta): """ Parameters ---------- A B C D alpha beta Return ------ distance f ( =g <= comuted from another way...
# 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, software # d...
from distutils.version import LooseVersion import json import warnings from pandas import DataFrame from geopandas._compat import import_optional_dependency from geopandas.array import from_wkb from geopandas import GeoDataFrame import geopandas from .file import _expand_user METADATA_VERSION = "0.1.0" # reference: ...
# -*- coding: utf-8 -*- """ On the Subject of Keypads :Copyright: 2015 Jochen Kupperschmidt :License: MIT, see LICENSE for details. """ from collections import Counter from itertools import chain, zip_longest from tkinter import ttk from tkinter import E, N, S, W COPYRIGHT_SIGN = ...
"""Support for DoorBird devices.""" from __future__ import annotations from http import HTTPStatus import logging from typing import Any from aiohttp import web from doorbirdpy import DoorBird import requests import voluptuous as vol from homeassistant.components import persistent_notification from homeassistant.com...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import urllib import xbmcplugin import xbmc import xbmcgui import common import database_tv as tv_db import database_common pluginhandle = common.pluginHandle # 501-POSTER WRAP 503-MLIST3 504=MLIST2 508-FANARTPOSTER confluence_views = [500, 501, 502, 503, 50...
from itertools import product import datetime import os.path as op import numpy as np from numpy.testing import (assert_array_equal, assert_equal, assert_allclose) import pytest import matplotlib.pyplot as plt import mne from mne import (Epochs, read_events, pick_types, create_info, EpochsArray, Info...
""" Calculates mold growth indication from temperature and humidity. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.mold_indicator/ """ import logging import math import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHE...
# ============================================================================= # PROJECT CHRONO - http:#projectchrono.org # # Copyright (c) 2014 projectchrono.org # All right reserved. # # Use of this source code is governed by a BSD-style license that can be found # in the LICENSE file at the top level of the distrib...
""" Classes and subroutines dealing with network connections and related topics. """ from __future__ import with_statement from functools import wraps import getpass import re import threading import select import socket import sys from fabric.auth import get_password, set_password from fabric.utils import abort, ha...
import numpy as np import pandas as pd import CoolProp as CP import matplotlib.pyplot as plt import warnings from copy import copy from scipy.optimize import newton from prf.state import * __all__ = ['Point', 'Curve', 'convert_to_base_units'] class Point: """Point. A point in the compressor map that can be...
# Copyright (c) 2020 Evalf # # 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, distribute, s...
########################################################################## # # Copyright (c) 2016, Image Engine Design 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: # # * Redistrib...
""" Tests for the Feature Provider """ import numpy as np import os import sys import unittest import warnings path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") sys.path.insert(0, path) import senses.dataproviders.featureprovider as fp # pylint: disable=locally-disabled, import-error class TestFeat...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import itertools imp...
#!/usr/bin/env python """ -------------------------------------------------------------------------------- Created: Jackson Lee 9/29/14 This script reads in a tab delimited combined coverage file from consolidate_coverage.py of phylogeny, protein classifications, and annotations uses the biopython KGML libraries to ...
# Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module defines classes for reading/manipulating/writing the main sections of FEFF input file(feff.inp), namely HEADER, ATOMS, POTENTIAL and the program control tags. XANES and EXAFS input files, are available, for no...
#!/usr/bin/env python3 import ssl import socket from time import sleep from functools import reduce MODE_COMMAND = 0 MODE_DATA = 1 DEBUG_HEXDUMP = 0b0001 DEBUG_COMMAND = 0b0010 DEBUG_PROTOCOL = 0b0100 DEBUG_ALL = 0b1111 RECOVER_TIME = 1 _FRAME_COUNT = 9 _HIGHEST_BIT = 0x7F _FILTER = ''.join([(len(repr(chr(x))) == 3...
# # 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...
# 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, software # distributed under the Li...
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import requests import googleapiclient.discovery import google.oauth2.credentials import os from frappe import _ from googleapiclie...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from collections import OrderedDict from importlib import import_module import itertools import traceback from django.apps import apps from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError from ...
# -*- coding: utf-8 -*- """ Package :mod:`~xrt.backends.raycing` provides the internal backend of xrt. It defines beam sources in the module :mod:`~xrt.backends.raycing.sources`, rectangular and round apertures in :mod:`~xrt.backends.raycing.apertures`, optical elements in :mod:`~xrt.backends.raycing.oes`, material pro...
import os import shutil import tempfile import uuid import bcolz import numpy as np from bquery import ctable_ext def rm_file_or_dir(path, ignore_errors=True): """ Helper function to clean a certain filepath Parameters ---------- path Returns ------- """ if os.path.exists(path...
# Copyright 2017 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...
#!/usr/bin/env python # # Copyright 2017 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 ...
# Copyright IBM Corp. 2016 All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Demonstrate basic message operations in Amazon Simple Queue Service (Amazon SQS). """ # snippet-start:[python.example_code.sqs.message_wrapper_imports] import logging import sys import boto3 from b...
# coding=utf-8 # Copyright 2022 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...
# Copyright (c) 2016 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging from telemetry.core import util from telemetry.page import gtest_test_results from telemetry.page import page_test_results from telemetry....
#!/usr/bin/env python from __future__ import absolute_import, division, print_function from tornado.escape import utf8, _unicode from tornado import gen from tornado.httpclient import HTTPResponse, HTTPError, AsyncHTTPClient, main, _RequestProxy from tornado import httputil from tornado.http1connection import HTTP1Con...
from functools import wraps from flask import Blueprint, render_template, abort, g from flask.ext.admin import babel from flask.ext.admin._compat import with_metaclass from flask.ext.admin import helpers as h # For compatibility reasons import MenuLink from flask.ext.admin.menu import MenuCategory, MenuView, MenuLink...
#!/usr/bin/python # # sslsniff Captures data on read/recv or write/send functions of OpenSSL, # GnuTLS and NSS # For Linux, uses BCC, eBPF. # # USAGE: sslsniff.py [-h] [-p PID] [-u UID] [-x] [-c COMM] [-o] [-g] [-n] [-d] # [--hexdump] [--max-buffer-size SIZE] [-l] [--handshake] #...
#!/usr/bin/env python """ 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");...
from datetime import datetime from functools import partial import numpy as np from unittest.mock import Mock from unittest.mock import call from unittest.mock import patch from dateutil.parser import parse import pytest class TestFit: @pytest.fixture def fit(self): from palladium.fit import fit ...
import datetime import itertools import logging import os import six import sys import threading from collections import deque from pkg_resources import parse_version from rbtools.api.errors import APIError from rbtools.clients import SCMClient, RepositoryInfo from rbtools.clients.errors import InvalidRevisionSpecErr...
from myhdl import * import numpy as np from math import e, pi, log import matplotlib.pyplot as plt t_state = enum('INIT', 'DATA_IN', 'COMPUTE', 'COMPUTE_INDEX', 'COMPUTE_MULT', 'DATA_OUT') #########################CHANGES NEEDED IF N!=8############################### def FFT(clk, reset, start, data_valid, ...
# -*- coding: utf-8 -*- """ args ~~~~ """ import os import sys from sys import argv from glob import glob from collections import OrderedDict # Python 3 if sys.version_info[0] == 3: string_type = str else: string_type = basestring def _expand_path(path): """Expands directories and globs in given path."...
# -*- coding: utf-8 -*- import unittest import copy from music21 import key from music21 import metadata from music21 import interval from music21 import pitch from music21 import chord from music21 import stream from music21 import harmony from music21 import scale from music21.alpha.theoryAnalysis import theoryAnaly...
############################################################################################# # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU Gen...
# Copyright 2021 The ParallelAccel 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 appl...
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
"""Support for Copy Number Variations (CNVs) with GATK4 https://software.broadinstitute.org/gatk/documentation/article?id=11682 https://gatkforums.broadinstitute.org/dsde/discussion/11683/ """ import glob import os import shutil import numpy as np import toolz as tz from bcbio import broad, utils from bcbio.distribu...
"""Test the onboarding views.""" import asyncio import os from unittest.mock import patch import pytest from homeassistant.components import onboarding from homeassistant.components.onboarding import const, views from homeassistant.const import HTTP_FORBIDDEN from homeassistant.helpers import area_registry as ar from...
from collections import Counter import numpy as np import random from ..parser import tokenize import codecs import os from itertools import chain from scipy.spatial import distance # Data types - Filled in by sub modules dtypes = { } class Dataset(object): def __init__(self, vocabulary_size=50000, store_data=True)...
import dask.dataframe as dd import numpy as np import pandas as pd import pandas.util.testing as tm from dask.async import get_sync from dask.dataframe.core import _Frame from dask.dataframe.methods import concat from dask.dataframe.multi import (align_partitions, merge_indexed_dataframes, ...
import unittest from test import support import binascii import random import sys from test.support import bigmemtest, _1G, _4G zlib = support.import_module('zlib') try: import mmap except ImportError: mmap = None class ChecksumTestCase(unittest.TestCase): # checksum test cases def test_crc32start(s...
#!/usr/bin/python # -*- coding: utf-8 -*- from mock import Mock, call from preggy import expect import lxml.html from holmes.config import Config from holmes.reviewer import Reviewer from holmes.validators.css_requests import CSSRequestsValidator from tests.unit.base import ValidatorTestCase from tests.fixtures impor...
# # # # # # # # # # # # # # # # # # Self-Care Bot 0.3a # # Designed by Kelly Maere # # Programmed by Colin Diener # # # # # # # # # # # # # # # # # # """ TODO: Update code to reflect new Telegram API 2.0 Update code to reflect new version of telepot Remove threading, replace with asynchronous calling """ import...
#!/usr/bin/env python # @package update_storage_schemas.py # Correct/Update storage schemas\n # @code # # Usage example for update_storage_schemas.py # sudo ./update_storage_schemas.py --path /opt/graphite/whisper --cfg /opt/graphite/conf/schemas # @endcode import sys import os import logging import subprocess imp...
import asyncio import logging from PyQt5.QtCore import QObject, Qt from aiohttp import ClientError from asyncio import TimeoutError from sakia.gui.widgets.dialogs import dialog_async_exec, QAsyncFileDialog, QMessageBox from duniterpy.api.errors import DuniterError from duniterpy.documents import MalformedDocumentErro...
# Copyright (c) 2015, Vienna University of Technology, # Department of Geodesy and Geoinformation # 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 th...
#!/usr/bin/kivy ''' Showcase of Kivy Features ========================= This showcases many features of Kivy. You should see a menu bar across the top with a demonstration area below. The first demonstration is the accordion layout. You can see, but not edit, the kv language code for any screen by pressing the bug or ...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import datetime import arrow from django.db import models from django.utils.translation import ugettext_lazy as _ from common.models import Address, User, Org from common.utils import CURRENCY_CODES from accounts.models import Account from phonenumber_field.modelfields import PhoneNumberField from teams.models import T...
# examples of python print [i for i in range(10) if i % 2 == 0] # [0, 2, 4, 6, 8] print "---- Tuples" tup1 = ('physics', 'chemistry', 1997, 2000); print "tup1[1:5]: ", tup1[1:5] tuple1, tuple2 = (123, 'xyz'), (456, 'abc') print "compare tuples: %s " % cmp(tuple1, tuple2); # -1 different tuple1, ...
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin class TestListInterface(object): config = """ templates: global: disable: [seen] tasks: list_get: entry_list: t...
# Copyright (c) 2019-2020, Manfred Moitzi # License: MIT License import math from ezdxf.math import ConstructionBox, ConstructionLine class TestTextBox: def test_defaults(self): box = ConstructionBox() assert box.center.isclose((0, 0)) assert box.width == 1 assert box.height == 1 ...
from py2neo import Graph from django.test import TestCase from cognitive.apps.atlas.query import ( Node, Task, Condition, Concept, Contrast, search, get, cypher_node, cypher_relation ) from cognitive.settings import graph class NodeTest(TestCase): def setUp(self): self.node = Node() self...
""" ********* Shapefile ********* Generates a networkx.DiGraph from point and line shapefiles. "The Esri Shapefile or simply a shapefile is a popular geospatial vector data format for geographic information systems software. It is developed and regulated by Esri as a (mostly) open specification for data interoperabil...
# Copyright 2011-2015 Isotoma Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
# Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # unless required by applicable law or a...
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) ''' As of zookeeper 3.4.0, the `mntr` admin command is provided for easy parsing of zookeeper stats. This check first parses the `stat` admin command for a version number. If the zookeeper version supports `mntr`,...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
from __future__ import division, print_function from hscom import __common__ (print, print_, print_on, print_off, rrr, profile) = __common__.init(__name__, '[vr2]') # Python from itertools import izip # Scientific import pandas as pd import numpy as np from numpy.linalg import svd #from numba import autojit # HotSpott...
# This file is part of beets. # Copyright 2014, Adrian Sampson. # # 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, ...
from django import forms import django from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse, NoReverseMatch from django.db import models from django.db.models.base import ModelBase from django.forms.forms import DeclarativeFieldsMetaclass from django.forms.utils import flatat...
#!/usr/bin/env python # # Copyright 2007 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 o...
import itertools import sys from peewee import ModelQueryResultWrapper from peewee import NaiveQueryResultWrapper from playhouse.tests.base import ModelTestCase from playhouse.tests.base import skip_test_if from playhouse.tests.base import test_db from playhouse.tests.models import * class TestQueryResultWrapper(Mod...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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.apach...
# 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 ...
""" My standard utilities. Intended to be included in all projects Obviously everything included here needs to be in the standard library (or numpy) """ import contextlib import fractions import operator import os import re import shutil import string import sys import tempfile import threading from cStringIO import St...
from future.standard_library import hooks from lxml import etree, html import binascii import collections import hmac import json import random import time from hashlib import sha1 from builtins import str from builtins import range try: from http.cookiejar import CookieJar except: from future.backports.ht...
from pybench import Test class SimpleListManipulation(Test): version = 2.0 operations = 5* (6 + 6 + 6) rounds = 130000 def test(self): l = [] append = l.append for i in xrange(self.rounds): append(2) append(3) append(4) append...
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals import mimetypes import os import random import time from cString...
"""Script used to test all API views""" import os from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile from django.core.urlresolvers import reverse_lazy import PIL from rest_framework import status from photo_editor.image_utils import ImageProcessor from photo_editor.models ...
# -*- coding: utf-8 -*- """ sphinx.theming ~~~~~~~~~~~~~~ Theming support for HTML builders. :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import shutil import zipfile import tempfile from os import path from six import str...
import logging from bson.codec_options import CodecOptions from inspect import currentframe, getframeinfo from pymongo import ASCENDING, DESCENDING, CursorType, MongoClient from pymongo.errors import ConfigurationError, ConnectionFailure, OperationFailure, ServerSelectionTimeoutError from ssl import CERT_REQUIRED, CER...