gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from tests.test_helper import *
class TestTransaction(unittest.TestCase):
def test_sale_returns_a_successful_result_with_type_of_sale(self):
result = Transaction.sale({
"amount": TransactionAmounts.Authorize,
"credit_card": {
"number": "4111111111111111",
... | |
__author__ = 'casey'
import ast
class AddressFactory(object):
@staticmethod
def from_db_str(st):
try:
if len(st) > 0 and ':::' in st:
s = st.split(":::")
if s[0] == BrickAddress.__name__:
return BrickAddress.from_db_str(st)
... | |
import pytest
import numpy as np
import scipy as sp
import openpnm as op
from numpy.testing import assert_allclose
class MultiPhaseTest:
def setup_class(self):
self.net = op.network.Cubic(shape=[10, 10, 10])
self.water = op.phases.Water(network=self.net, name="water")
self.air = op.phases.... | |
# Copyright 2013 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 agreed to in... | |
from ScopeFoundry.data_browser import DataBrowserView
import numpy as np
import h5py
import pyqtgraph as pg
import pyqtgraph.dockarea as dockarea
from qtpy import QtWidgets, QtGui
from scipy import optimize
from scipy.ndimage.filters import gaussian_filter, correlate1d
from scipy.signal import savgol_filter
from scipy ... | |
import re
import os
import shutil
import string
import logging
import subprocess
from subprocess import Popen, PIPE
from hashlib import sha1
from cStringIO import StringIO
from datetime import datetime
from glob import glob
import tg
import pysvn
import pylons
pylons.c = pylons.tmpl_context
pylons.g = pylons.app_globa... | |
# -*- coding: utf-8 -*-
from gluon import *
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
class S3MainMenu(default.S3MainMenu):
"""
Custom Application Main Menu:
The main menu consists of several sub-menus, each of ... | |
#########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... | |
# Copyright (c) 2009-2010, Cloud Matrix Pty. Ltd.
# All rights reserved; available under the terms of the BSD License.
from __future__ import with_statement
import sys
import os
import unittest
from os.path import dirname
import subprocess
import shutil
import zipfile
import threading
import tempfile
import urllib2... | |
import os
import re
import shutil
import urllib2
import templates
import setuptools
import subprocess
import zc.recipe.egg
from zc.buildout import UserError
from dist_installer import install
class Installer:
def __init__(self, options, buildout, log, name):
self.options = options
self.buildout =... | |
#!/usr/bin/python
import io # file streams library
import fcntl # I2C library
import time # sleep delay and timestamps library
import string # string parsing library
import smbus # I2C library
import Adafruit_DHT # DHT22 library
import numpy
# Google Cloud Pub Sub
from cloudconnec... | |
# Copyright 2014 Cloudera 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 writing, so... | |
# Program by Ankur Gupta
# www.github.com/agupta231
# Feb 2017
#
#
# 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,... | |
# -*- coding: utf-8 -*-
import datetime
import collections
from .config import Config
class Stmt(object):
"""Base class for all statement classes.
"""
def __init__(self, placeholder=None, quote_all_col_refs=None, quote_all_values=None, **kwargs):
"""Constructor
Keyword Arguments:
... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# https://stackoverflow.com/questions/13437727/python-write-to-excel-spreadsheet
#
import struct
import os
import sys
import gzip
import re
reload(sys)
sys.setdefaultencoding('utf8')
if (len(sys.argv) < 2):
print "Usage: ./parse.py filename.tsr ... "
sys.exit()
#FILE_NAM... | |
#!/usr/bin/env python
"""
Custom collections classes.
"""
__all__ = [
"ValidatedList",
"ValidatedDict",
]
# =====================================================================
# GLOBAL IMPORTS
# =====================================================================
from collections import abc
# ========... | |
# 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... | |
#!/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 copy
import base64
import mock
from webtest.app import TestRequest
import elasticsearch
from daybed import __version__ as VERSION, API_VERSION
from daybed.permissions import invert_permissions_matrix
from daybed.backends.exceptions import (
RecordNotFound, ModelNotFound
)
from daybed.tests.support import B... | |
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The ios_l2_interfaces class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessar... | |
# 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
import numpy as np
from .. import util
from ..constants import log
from ..constants import tol_path as tol
from ..constants import res_path as res
def arc_center(points, return_normal=True, return_angle=True):
"""
Given three points on a 2D or 3D arc find the center,
radius, normal, and angular span.
... | |
from pylab import find
import numpy as np
from numpy import linalg, zeros, array, vstack, ones, sum, power, uint32, insert, matrix
from warnings import catch_warnings, simplefilter
#skimage.transform
# http://stackoverflow.com/questions/11462781/fast-2d-rigid-body-transformations-in-numpy-scipy
# skimage.transform.fa... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# 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 compli... | |
from django.db import models
from django.contrib.auth.models import User
import calendar
import ipaddress
import uuid
from django.core.exceptions import ValidationError
import string
from Crypto.PublicKey import RSA
from uwsgi_it_api.config import UWSGI_IT_BASE_UID
import random
import datetime
import os.path
from djan... | |
from __future__ import absolute_import
import logging
from typing import Any, Set, Tuple, Optional, Text
from django.contrib.auth.backends import RemoteUserBackend
from django.conf import settings
from django.http import HttpResponse
import django.contrib.auth
from django_auth_ldap.backend import LDAPBackend, _LDAPU... | |
# coding: utf-8
"""
SystemMessageApi.py
Copyright 2016 SmartBear Software
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... | |
#!/usr/bin/env python3
r"""
This module provides functions which are useful to plug-in call point programs.
"""
import sys
import os
import re
import collections
import gen_print as gp
import gen_valid as gv
import gen_misc as gm
import gen_cmd as gc
import func_args as fa
PLUG_VAR_PREFIX = os.environ.get("PLUG_VAR... | |
from unittest.mock import patch, call
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from django.test import TestCase
from accounts.factories import UserFactory
from matches.factories import PastMatchFactory, FutureMatchFactory, BetFactory
from matches.models import Match, Bet... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 9 09:49:43 2017
NB 2013 had no surveys taken
NB 2014 AnswerIDs have not been matched to ProfileIDs
@author: SaintlyVi
"""
import pandas as pd
import os
from support import cdata_dir, emdata_dir, writeLog
import features.feature_socios as socio... | |
import sys
import unittest
from nose.tools import assert_true, assert_false, assert_is_not_none, \
assert_equals, assert_is_none
from robotide.robotapi import (
TestCaseFile, Resource, VariableTable, TestDataDirectory)
from robotide.context import IS_WINDOWS
from robotide.namespace.namespace import _VariableSt... | |
from __future__ import print_function
from typing import Any, Callable, Iterable, List, Optional, Set, Tuple
from django.test import TestCase
from django.test.runner import DiscoverRunner
from django.test.signals import template_rendered
from zerver.lib.cache import bounce_key_prefix_for_testing
from zerver.lib.sqla... | |
from yaml import load
from yaml import YAMLError
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
SETTINGS_FILE = 'settings.yaml'
SETTINGS_STRUCT = {
'client_config_backend': {
'type': str,
'required': True,
'default': 'file',
'dependency': [
... | |
import os
import numpy as np
from tests.test_utils import run_track_tests
from mirdata import annotations
from mirdata.datasets import cante100
from tests.test_utils import DEFAULT_DATA_HOME
TEST_DATA_HOME = "tests/resources/mir_datasets/cante100"
def test_track():
default_trackid = "008"
dataset = cante10... | |
# Copyright 2015 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
#!/usr/bin/env python
"""
Ansible Dynamic Inventory Script for Ubuntu MAAS.
This script fetches hosts data for Ansible from Ubuntu MAAS, using Tags to
identify groups and roles. It is expected that the script will be copied to
Tower within the new Inventory Scripts dialog offered within the interface,
where it will b... | |
#!/usr/bin/env python3
# Copyright (c) 2015-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 BIP65 (CHECKLOCKTIMEVERIFY).
Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) b... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
def impaint_mask(img, label_colors=None, init_mask=None, init_label=None):
r"""
CommandLine:
python -m plottool_ibeis.interact_impaint --test-impaint_mask
References:
http://docs.opencv.org/trunk/doc/py_tutorials/py_gui/py_mouse_handling/py_mouse_handling.html
TODO: Slider for transpa... | |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
import logging
import os
from pkg_resources import DefaultProvider, ZipProvider, get_provider
from .common import Chroot, chmod_plus_x, open_zip, ... | |
""" Module for IGM calculations
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import numpy as np
import os
from IPython import embed
from pkg_resources import resource_filename
from scipy.interpolate import interp1d
from scipy.interpolate import InterpolatedUnivariateSpline a... | |
"""Tools for manipulating of large commutative expressions. """
from __future__ import print_function, division
from sympy.core.add import Add
from sympy.core.compatibility import iterable, is_sequence, SYMPY_INTS, range
from sympy.core.mul import Mul, _keep_coeff
from sympy.core.power import Pow
from sympy.core.basi... | |
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | |
import sys
import string
from collections.abc import Sequence, Mapping
class SQLText:
__tuple__ = ('_segments',)
def __init__(self):
self._segments = []
def __bool__(self):
return bool(self._segments)
def __iadd__(self, sqltext):
if isinstance(sqltext, SQLText):
... | |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
from generate import generate
class VariantType:
def __init__(self,
variantType,
managedTyp... | |
from card import Card
def create_table_if_not_exists(conn, cursor):
query = """
CREATE TABLE IF NOT EXISTS cards (
front TEXT NOT NULL,
back TEXT NOT NULL,
score INTEGER NOT NULL,
last_viewed TIMESTAMP NOT NULL
)
"""
cursor.execute(query)
... | |
import ply.lex as lex
import ply.yacc as yacc
import re
# Classes
class Program(object):
def __init__(self, items):
self.items = items
def get_lookup(self):
return dict((item.name, item) for item in self.items
if isinstance(item, MacroDefinition))
def preprocess(self, lookup):
... | |
# Copyright 2020 Mycroft AI 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 writin... | |
from __future__ import absolute_import
from datetime import datetime, timedelta
from sentry.testutils import APITestCase, SnubaTestCase
from django.core.urlresolvers import reverse
class DiscoverQueryTest(APITestCase, SnubaTestCase):
def setUp(self):
super(DiscoverQueryTest, self).setUp()
self.... | |
from __future__ import unicode_literals
import datetime
from django.apps import apps
from django.contrib import admin
from django.contrib.auth.models import User as AuthUser
from django.contrib.contenttypes.models import ContentType
from django.core import checks, exceptions, management
from django.core.urlresolvers ... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test sky projections defined in WCS Paper II"""
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import os
import numpy as np
from numpy.testing import utils
from .. import projections
from .... | |
import types
import collections
# Base node
class SourceElement(object):
'''
A SourceElement is the base class for all elements that occur in a Java
file parsed by plyj.
'''
def __init__(self):
super(SourceElement, self).__init__()
self._fields = []
def __repr__(self):
... | |
# 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... | |
# 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... | |
"""
This is a convenient container gathering all the main
search methods for the various database tables.
It is intended to be used e.g. as
> from src.utils import search
> match = search.objects(...)
Note that this is not intended to be a complete listing of all search
methods! You need to refer to the respective ... | |
from __future__ import unicode_literals
import json
from moto.core.responses import BaseResponse
from .models import kinesis_backends
class KinesisResponse(BaseResponse):
@property
def parameters(self):
return json.loads(self.body)
@property
def kinesis_backend(self):
return kinesi... | |
"""
Nginx Blueprint
===============
**Fabric environment:**
.. code-block:: yaml
blueprints:
- blues.nginx
settings:
nginx:
source_version: 1.4.6-1ubuntu3.3 # Required if installed from source (see modules)
sites: # List of sites/templates in `sites-av... | |
valid_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_'
numbers = '0123456789'
candidates = ['Donald Trump', 'Secretary Hillary Clinton',
'Governor Gary Johnson', 'Dr. Jill Stein']
def extract_mentions(text):
''' (str) -> list of str
Returns a list of strings representing the twit... | |
#!/usr/bin/env python3
# tabletomallet_firstfic.py
# This script selects & prepares data for use by MALLET. It starts from the
# tabular data produced by jsontotable5.py, and slightly changes format.
# More importantly, it selects volumes distributed as evenly as possible across
# time, and ensures that the volumes f... | |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectiona... | |
# 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... | |
"""Server trace events.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import abc
import enum # pylint: disable=wrong-import-order
import logging
from .. import _events
_LOGGER = logging.getLogger(__name__)
... | |
#!/usr/bin/python
#
# File: FlightProfile.py
# Author: Ellery Chan
# Email: ellery@precisionlightworks.com
# Date: 7 Dec 2015
"""
Display the flight profile of a team's docking attempt.
"""
from __future__ import print_function, division
#from collections import namedtuple
import sys
import os.path
import math
im... | |
"""Command line functions for calling the root mfa command"""
from __future__ import annotations
import argparse
import atexit
import multiprocessing as mp
import sys
import time
from datetime import datetime
from typing import TYPE_CHECKING
from montreal_forced_aligner.command_line.adapt import run_adapt_model
from ... | |
''' Create rst documentation of the examples directory.
This uses screenshots in the screenshots_dir
(currently doc/sources/images/examples) along with source code and files
in the examples/ directory to create rst files in the generation_dir
(doc/sources/examples) gallery.rst, index.rst, and gen__*.rst
'''
import ... | |
"""
file_stream tests.
"""
from __future__ import print_function
from dataclasses import dataclass
import json
import pytest
import os
from wandb.sdk.internal.file_stream import CRDedupeFilePolicy
from wandb.sdk.lib import file_stream_utils
from wandb import util
def generate_history():
history = []
histor... | |
from math import sin, cos, pi
from core import SimpleSection, ComplexSection, Dimensions, cached_property
# ==============================================================================
# S I M P L E S E C T I O N S
# ==============================================================================
class Rectangle(... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
#!/usr/bin/env python
"""
CmpRuns - A simple tool for comparing two static analyzer runs to determine
which reports have been added, removed, or changed.
This is designed to support automated testing using the static analyzer, from
two perspectives:
1. To monitor changes in the static analyzer's reports on real co... | |
"""Utilities for assessing and repairing CouchDB corruption"""
import logging
from collections import defaultdict
from itertools import islice
from json.decoder import JSONDecodeError
from urllib.parse import urljoin, urlparse, urlunparse
import attr
from couchdbkit import Database
from couchdbkit.exceptions import Re... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import ujson
from typing import Any, Mapping, List
from six import string_types
from zerver.lib.emoji import emoji_name_to_emoji_code
from zerver.lib.request import JsonableError
from zerver.lib.test_helpers import tornado_redirected_to_list, get_display_... | |
import sympy
from sympy import Function, Derivative, Expr, Add, Subs, Symbol
from sympy import Matrix
def _func2der(expr):
'''Does the following:
u,xt(u(x, t), x, t) = Derivative(u(x, t), x, t)
'''
if expr.is_Matrix:
if expr.shape == (1, 1):
expr = expr[0,0]
else:
... | |
# Natural Language Toolkit: Texts
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
This module brings together a variety of NLTK functionality for
... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ChannelWidgetUi.ui'
#
# Created: Thu Aug 14 02:38:51 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
excep... | |
"""
Basic support for reading the AFNI BRIK/HEAD file format.
This is quite quick-and-dirty, so please use with caution.
Floris van Vugt, April 2017
"""
import re
import numpy as np
import os
def read_header(fname):
"""
Reads AFNI header file. That is, reads the HEAD from a BRIK/HEAD file pair.
... | |
#!/usr/bin/env python
# a base class other test classes inherit from - some shared functionality
import unittest
import string
import types
import ir
import fracttypes
class TestBase(unittest.TestCase):
def assertNearlyEqual(self,a,b,epsilon=1.0e-12):
# check that each element is within epsilon of expec... | |
"""
The channel handler, accessed from this module as CHANNEL_HANDLER is a
singleton that handles the stored set of channels and how they are
represented against the cmdhandler.
If there is a channel named 'newbie', we want to be able to just write
newbie Hello!
For this to work, 'newbie', the name of the channe... | |
# 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 os
from textw... | |
# 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... | |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from typi... | |
import sys
if sys.version_info < (3, 0):
import urllib2
urlopen = urllib2.urlopen
HTTPError = urllib2.HTTPError
else:
import urllib.request
import urllib.error
urlopen = urllib.request.urlopen
HTTPError = urllib.error.HTTPError
try:
import json
except ImportError:
import simplejson a... | |
import acm
import ael
import FHTI_EDD_OTC_Util
import HTI_ExcelReport2
import HTI_Util
import HTI_FeedTrade_EDD_Util
from shutil import copyfile
import os
ttSaveToFile = "Check this to save the report instead of showing it."
ttCSV = "Check this to export the report in CSV format"
ttFileName = "File name and path of th... | |
import contextlib
import time
import unittest
from datetime import date, datetime
from django.core.exceptions import FieldError
from django.db import connection, models
from django.test import TestCase, override_settings
from django.utils import timezone
from .models import Article, Author, MySQLUnixTimestamp
@cont... | |
from __future__ import unicode_literals
import unittest
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.utils import six
from wagtail.tests.utils import WagtailTestUtils
f... | |
"""Test component/platform setup."""
# pylint: disable=protected-access
import asyncio
import datetime
import os
import threading
from unittest.mock import AsyncMock, Mock, patch
import pytest
import voluptuous as vol
from homeassistant import config_entries, setup
import homeassistant.config as config_util
from home... | |
from .. import names
from ..builder import Builder
from ..ndtypes import (ScalarT, NoneT, NoneType, ArrayT, SliceT, TupleT, make_tuple_type,
Int64, PtrT, ptr_type, ClosureT, FnT, StructT,
TypeValueT)
from ..syntax import (Var, Tuple,
Index, TypedF... | |
# -*- coding: utf-8 -*-
"""
File related views, including view_file, view_history_file, view_trash_file,
view_snapshot_file, view_shared_file, file_edit, etc.
"""
import os
import hashlib
import json
import stat
import urllib2
import chardet
import logging
import posixpath
import re
from django.core.cache import cach... | |
from __future__ import print_function
import os
import re
import shutil
from ...workspace_factory import workspace_factory
from ....utils import in_temporary_directory
from ....utils import assert_cmd_success
from ....utils import assert_cmd_failure
from ....utils import assert_files_exist
from ....utils import catk... | |
# 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... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
import re
import datetime
from collections import defaultdict
import dateutil.parser
import pytz
from django import forms
from django.db.models import Count
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.utils.timezone import utc
from django.utils.safestring import mar... | |
#! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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
#
# Unles... | |
"""
@package mi.instrument.sunburst.sami2_pco2.pco2a.test.test_driver
@file marine-integrations/mi/instrument/sunburst/sami2_pco2/pco2a/driver.py
@author Christopher Wingard
@brief Test cases for pco2a driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/test_driver
$ bin/test_dri... | |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | |
# Copyright (c) 2016 Uber Technologies, 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 ... | |
from __future__ import print_function
from opencanary.modules import CanaryService
from opencanary.config import PY3
import twisted
from twisted.cred import portal, checkers, credentials, error
from twisted.conch import error, avatar, interfaces as conchinterfaces
from twisted.conch.checkers import SSHPublicKeyDatabas... | |
# 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 'Coordinator.job_properties'
db.add_column('oozie_coordinator', 'job_properties', self.gf('django.d... | |
import itertools
import re
from PIL import Image, ImageChops, ImageFilter
from easy_thumbnails import utils
def _compare_entropy(start_slice, end_slice, slice, difference):
"""
Calculate the entropy of two slices (from the start and end of an axis),
returning a tuple containing the amount that should be ... | |
# Copyright 2010 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, 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.apach... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.