gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from __future__ import absolute_import from django.test import TestCase from django.utils import unittest from .models import (User, UserProfile, UserStat, UserStatResult, StatDetails, AdvancedUserStat, Image, Product, Parent1, Parent2, Child1, Child2, Child3, Child4) class ReverseSelectRelatedTestCase(Test...
# -*- coding: utf-8 -*- # # Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# -*- coding: utf-8 -*- import json import base64 import datetime import io import os import glob import pandas as pd import dash_core_components as dcc import dash_html_components as html from collections import OrderedDict from dash.dependencies import Input, Output, State from app import app, indicator from core im...
from UnitTest import UnitTest def aArgs(*args): return args def ftest(a, b): return [a, b] class ArgsTest(UnitTest): def testNaming1(self): values = ftest(1, 2) self.assertEquals(values[0], 1) self.assertEquals(values[1], 2) def testNaming2(self): values = ftest(a=1,...
#!/usr/bin/env python # Copyright 2017 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. """A script to replace a system app while running a command.""" import argparse import contextlib import logging import os import posix...
""" Django settings for the impart project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unicode_literals import environ...
#!/usr/bin/env python # # Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the MIT license. # See the LICENSE file in the project root for more information. # ########################################################################## ###################...
from __future__ import print_function from __future__ import absolute_import from __future__ import division from math import cos from math import pi from copy import deepcopy from compas.geometry import centroid_points from compas.geometry import offset_polygon from compas.utilities import iterable_like from compas...
import importlib import os import pickle import shutil import time from os import environ from socket import AF_INET import autobahn import chalk from twisted.application.internet import TCPServer, SSLServer from twisted.internet import reactor from twisted.internet.defer import DeferredLock from twisted.python.thread...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# 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...
#!/usr/bin/env python # # Azure Linux extension # # Copyright (c) Microsoft Corporation # All rights reserved. # MIT License # 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 restrictio...
""" Base class for testing syncing algorithm (c) 2013-2014 by Mega Limited, Wellsford, New Zealand This file is part of the MEGA SDK - Client Access Engine. Applications using the MEGA API must present a valid application key and comply with the the rules set forth in the Terms of Service. The MEGA SDK is dis...
""" @package mi.dataset.parser @file /mi/dataset/parser/vel3d_cd_dcl.py @author Emily Hahn @brief Parser for the vel3d instrument series c,d through dcl dataset driver """ __author__ = 'Emily Hahn' __license__ = 'Apache 2.0' import struct import re import binascii import base64 from mi.core.log import get_logger log...
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
from django.contrib.sites.shortcuts import get_current_site from django.http import Http404 from django.shortcuts import get_object_or_404 from django.template.defaultfilters import urlencode from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from django.views.ge...
#! /usr/bin/env python3 """This script labels the ORFs based on their exon transcript structure with respect to annotated coding sequences """ import argparse import logging import pbio.misc.logging_utils as logging_utils import pbio.utils.bed_utils as bed_utils from rpbp.defaults import default_num_cpus logger = ...
# # 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 us...
"""Common settings and globals.""" import os ugettext = lambda s: s ########## PATH CONFIGURATION # Absolute filesystem path to the Django project directory: WEBSITE_ROOT = os.path.dirname(os.path.dirname(__file__)) # Absolute filesystem path to the top-level project folder: PROJECT_ROOT = os.path.dirname(WEBSITE_RO...
import os import sqlite3 from collections import OrderedDict #TODO Copy memory db to file system #TODO: Dump sqlite database to .sql file class PreparedStatement: """ Wraper for a SQL statement and its parameters """ @staticmethod def standardize_params(params): if params is not None: ...
import time from conans.client.conanfile.configure import run_configure_method from conans.client.graph.graph import DepsGraph, Node, RECIPE_EDITABLE, CONTEXT_HOST, CONTEXT_BUILD from conans.errors import (ConanException, ConanExceptionInUserConanfileMethod, conanfile_exception_formatter) fr...
#!/usr/bin/env python """Configuration parameters for the client.""" from grr.lib import config_lib from grr.lib import rdfvalue from grr.lib.rdfvalues import crypto # General Client options. config_lib.DEFINE_string("Client.name", "GRR", "The name of the client. This will be used as a base "...
# -*- coding: utf-8 -*- from gluon import * from gluon.storage import Storage from s3 import * from s3theme import NAV, SECTION # ============================================================================= class S3MainMenuLayout(S3NavigationItem): """ Custom Main Menu Layout """ @staticmethod def layou...
#!/usr/bin/python3 -i # # Copyright (c) 2013-2015 The Khronos Group 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...
"""Test zha device switch.""" from datetime import timedelta import time from unittest import mock import pytest import zigpy.profiles.zha import zigpy.zcl.clusters.general as general import homeassistant.components.zha.core.device as zha_core_device from homeassistant.const import STATE_OFF, STATE_UNAVAILABLE import...
from klampt import * from klampt.vis.glrobotprogram import * from loaders.soft_hand_loader import SoftHandLoader from actuators.CompliantHandEmulator import CompliantHandEmulator import numpy as np import sys #The hardware name gripper_name = 'soft_hand' #The Klamp't model name klampt_model_name = 'data/robots/soft...
# 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 collections import namedtuple from inspect import isclass from django.utils.translation import gettext_lazy as _ __all__ = ( 'LOG', 'LOG_BY_ID', 'LOG_KEEP', ) class _LOG: action_class = None class CREATE_ADDON(_LOG): id = 1 action_class = 'add' format = _('{addon} was created.') ...
# Copyright 2011 Omniscale (http://omniscale.com) # # 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...
# coding=utf-8 # Copyright 2015 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 logging impor...
#!/usr/bin/env python3 # Copyright 2018 CMU and The HuggingFace Inc. team. # # 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 requir...
# 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2019, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: bigip_monitor_mysql sho...
# Natural Language Toolkit: Verbnet Corpus Reader # # Copyright (C) 2001-2013 NLTK Project # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT from __future__ import unicode_literals import re import textwrap from collections import defaultdi...
# # ElementTree # $Id: ElementTree.py 2326 2005-03-17 07:45:21Z fredrik $ # # light-weight XML support for Python 1.5.2 and later. # # history: # 2001-10-20 fl created (from various sources) # 2001-11-01 fl return root from parse method # 2002-02-16 fl sort attributes in lexical order # 2002-04-06 fl TreeBuilde...
# @lint-avoid-pyflakes2 # @lint-avoid-python-3-compatibility-imports import asyncio from collections import defaultdict import functools import logging from io import BytesIO import struct import warnings from .TServer import TServer, TServerEventHandler, TConnectionContext from thrift.Thrift import TProcessor, TMess...
"""Responses. responses serve both testing purpose aswell as dynamic docstring replacement """ responses = { "_v3_accounts_accountID_transactions": { "url": "v3/accounts/{accountID}/transactions", "params": { "pageSize": 200 }, "response": { "count": 2124, ...
# 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 'CreditAdjustment.related_credit' db.add_column(u'accounting_creditadjustment', 'related_cr...
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
from __future__ import unicode_literals import os from django.contrib.auth.models import User from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm, PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm) from django.core import mail from django.forms.fields import Field, Emai...
"""Test for possible quest conditions.""" import datetime # import os from django.test import TransactionTestCase from django.contrib.auth.models import User # from django.conf import settings # from django.core.files.images import ImageFile # from django.db.models import signals from apps.managers.challenge_mgr impo...
from __future__ import absolute_import import apsw # The default python slite implementatino is not threadsafe, so we use apsw import logging import time import threading import os import json from jsonschema import validate from ._connectordb import ConnectorDB, CONNECTORDB_URL, DATAPOINT_INSERT_LIMIT class Logg...
# Copyright (C) 2021 Nippon Telegraph and Telephone Corporation # 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/LICE...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains the transformation functions for getting to/from ITRS, TEME, GCRS, and CIRS. These are distinct from the ICRS and AltAz functions because they are just rotations without aberration corrections or offsets. """ import nu...
""" parquet compat """ from distutils.version import LooseVersion import io import os from typing import Any, AnyStr, Dict, List, Optional, Tuple from warnings import catch_warnings from pandas._typing import FilePathOrBuffer, StorageOptions from pandas.compat._optional import import_optional_dependency from pandas.e...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module contains the class describing the coordination geometries that can exist in a given structure. These "model" coordination geometries are described in the following articles : - Pure Appl. Chem...
# 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...
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
from __future__ import unicode_literals import sys import os import re import mimetypes from copy import copy from importlib import import_module from io import BytesIO from django.apps import apps from django.conf import settings from django.core import urlresolvers from django.core.handlers.base import BaseHandler ...
#!/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")...
import sys from distutils.util import strtobool from django.db import transaction from django.db.utils import IntegrityError from django.core import serializers from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django....
"""User input parameter validation. This module handles user input parameter validation against a provided input model. Note that the objects in this module do *not* mutate any arguments. No type version happens here. It is up to another layer to properly convert arguments to any required types. Validation Errors ...
from collections import namedtuple import six from parameterized import parameterized from conans.errors import ConanException from conans.model.ref import ConanFileReference from conans.model.requires import Requirements from conans.test.unittests.model.transitive_reqs_test import GraphTest from conans.test.utils.c...
# -*- coding: utf-8 -*- from __future__ import with_statement from cms import plugin_rendering from cms.api import create_page, add_plugin from cms.models.placeholdermodel import Placeholder from cms.models.pluginmodel import CMSPlugin from cms.plugin_rendering import (render_plugins, PluginContext, render_placeho...
# postgresql/base.py # Copyright (C) 2005-2011 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 """Support for the PostgreSQL database. For information on connecting using specif...
# This file is part of beets. # Copyright 2013, 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, ...
# Copyright (c) 2016 Cloudbase Solutions Srl # # 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...
# # 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...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import goldstone.utils import django.utils.timezone import django_extensions.db.fields import picklefield.fields class Migration(migrations.Migration): dependencies = [ ...
#!/usr/bin/env python import threading import logging import uuid from datetime import datetime import yaml import time log = logging.getLogger('scadasim') class InvalidDevice(Exception): """Exception thrown for bad device types """ def __init__(self, message): super(InvalidDevice...
# orm/attributes.py # Copyright (C) 2005-2013 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 """Defines instrumentation for class attributes and their interaction with instances...
#!/usr/bin/env python3 # Copyright (c) 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. from test_framework.blockstore import BlockStore from test_framework.test_framework import ComparisonTestFrame...
import re from datetime import ( date, datetime, ) from collections import namedtuple from webob.byterange import ( ContentRange, Range, ) from webob.compat import ( PY2, text_type, ) from webob.datetime_utils import ( parse_date, serialize_date, ) from webob.util i...
# # Copyright 2005 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 2, or (at your option) # any later version. #...
from __future__ import absolute_import, print_function, division import os import time import datetime import csv import pyModeS as pms class Stream(): def __init__(self, lat0, lon0, dumpto=None): self.acs = dict() self.lat0 = lat0 self.lon0 = lon0 self.t = 0 self.cache_t...
# -*- coding: utf-8 -*- import time from pokemongo_bot.human_behaviour import (normalized_reticle_size, sleep, spin_modifier) from pokemongo_bot.base_task import BaseTask class PokemonCatchWorker(BaseTask): BAG_FULL = 'bag_full' NO_POKEBALLS = 'no_pokeballs' def...
import sys import xml.etree.ElementTree as ET input_list = [] for arg in sys.argv[1:]: input_list.append(arg) if len(input_list) < 1: print("usage: makedoku.py <class_list.xml>") sys.exit(0) def validate_tag(elem,tag): if (elem.tag != tag): print("Tag mismatch, expected '"+tag+"', got "+elem.tag); ...
from __future__ import absolute_import import email.utils import mimetypes import re from .packages import six def guess_content_type(filename, default="application/octet-stream"): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`m...
# -*- coding: utf-8 -*- from collections import namedtuple from Common.domain import AggregateRoot """ The ScorableDefinition domain, centered around ScorableDefinitions and FactDefinitions. A ScorableDefinition defines the ScorableFlow, ValidationRules, FactDefinitions, ... A FactDefinition defines the ...
""" Support for MQTT Template lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.mqtt_template/ """ import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.components import mqtt from homeassistant.co...
#!/usr/bin/python # # Copyright (c) 2018 Juniper Networks, Inc. All rights reserved. # """ This file contains implementation of getting the swift download URL for the uploaded image file """ DOCUMENTATION = ''' --- module: Swift file util author: Juniper Networks short_description: Private module to get swift downl...
#!/usr/bin/env python """A class to read process memory on macOS. This code is based on the memorpy project: https://github.com/n1nj4sec/memorpy """ import ctypes import ctypes.util from grr_response_client import process_error from grr_response_core.lib.rdfvalues import memory as rdf_memory libc = ctypes.CDLL(cty...
# 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 ...
# Copyright 2016 NOKIA # # 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...
# 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. """Generic presubmit checks that can be reused by other presubmit checks.""" import os as _os _HERE = _os.path.dirname(_os.path.abspath(__file__)) # Ju...
from __future__ import unicode_literals, print_function, division import sys import glog import codecs import random from collections import defaultdict from feature_filter import * from instance import Instance class InstanceIterator(object): # This is a single instance iterator, with negative sampling # and...
"""Support for Rheem EcoNet water heaters.""" import datetime import logging import voluptuous as vol from homeassistant.components.water_heater import ( DOMAIN, PLATFORM_SCHEMA, STATE_ECO, STATE_ELECTRIC, STATE_GAS, STATE_HEAT_PUMP, STATE_HIGH_DEMAND, STATE_OFF, STATE_PERFORMANCE, SUPPORT_OPERATION_MODE,...
import os import uuid import zipfile from datetime import datetime, timedelta from celery.schedules import crontab from celery.task import periodic_task, task from celery.utils.log import get_task_logger from text_unidecode import unidecode from casexml.apps.case.xform import extract_case_blocks from couchforms.analy...
# Copyright 2013 Brocade Communications System, 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 # #...
""" peewee-async ============ Asynchronous interface for `peewee`_ ORM powered by `asyncio`_: https://github.com/05bit/peewee-async .. _peewee: https://github.com/coleifer/peewee .. _asyncio: https://docs.python.org/3/library/asyncio.html Licensed under The MIT License (MIT) Copyright (c) 2014, Alexey Kinev <rudy@0...
############################################################################### import os import logging from utils.exec_command import call_subprocess from utils.archive import unzip_files from utils.archive import untar_files from utils.archive import clone_files #################################################...
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import ( PreprintFactory, AuthUserFactory, PreprintProviderFactory, ) from osf.utils import permissions as osf_permissions @pytest.mark.django_db @pytest.mark.enable_quickfiles_creation class TestReviewActionCreateRoot...
from __future__ import print_function import argparse import time import sys import gzip import operator import functools # In order to support runs without bohrium installed, we need some import hacks. The result is: # * `np` will point to either Bohrium or Numpy # * `numpy` will point to Numpy # * `bohrium` wi...
import os import platform import re import sys import copy from collections import defaultdict from itertools import product import six from conans import tools from conans.client.conan_api import Conan from conans.client.runner import ConanRunner from conans.model.ref import ConanFileReference from conans.model.versi...
from decimal import Decimal from functools import partial from django.conf import settings from django.db import models from django.db.models import F, Q from django.utils import timezone from django.utils.translation import pgettext, pgettext_lazy from django_countries.fields import CountryField from django_prices.mo...
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from app.openapi_server.models.base_model_ import Model from app.openapi_server.models.pipeline_activityartifacts import PipelineActivityartifacts # noqa: F401,E501 fr...
# (c) Copyright 2013-2015 Hewlett Packard Enterprise Development LP # All Rights Reserved. # # Copyright 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 Licen...
""" routings for casting """ from datetime import datetime, timedelta import numpy as np from pandas._libs import lib, tslib, tslibs from pandas._libs.tslibs import NaT, OutOfBoundsDatetime, Period, iNaT from pandas.compat import PY3, string_types, text_type, to_str from .common import ( _INT64_DTYPE, _NS_DTYPE...
# for each AS: # find all IP blocks # for each IP block: # find all locations # find location that corresponds to largest total IP space import json import csv import random import ipaddress debug = False # Shows verbose debug prints if True debugMaxCounter = 50 # Set to limit number of iterations through ...
"""The IPython Controller Hub with 0MQ This is the master object that handles connections from engines and clients, and monitors traffic through the various queues. Authors: * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development ...
import datetime import json from django.core.cache import cache from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model from django.test.client import Client from django.utils import timezone from bulbs.promotion.models import PZone, PZoneHistory from bulbs.promotion.operations imp...
from models.contact import Contacts import re from selenium.webdriver.support.ui import Select from models.group import Group import random class ContactHelper: def __init__(self, app): self.app = app def open_contacts_page(self): wd = self.app.wd #if not (wd.current_url.endswith("/in...
from common import * # NOQA from gdapi import ApiError from requests.auth import AuthBase import requests from cattle import from_env class LocalAuth(AuthBase): def __init__(self, jwt, prj_id=None): # setup any auth-related data here self.jwt = jwt self.prj_id = prj_id def __call__(s...
import unittest import datetime import logging from io import BytesIO from tkp.testutil.decorators import requires_database import tkp.db from tkp.db.orm import DataSet, Image from tkp.db.database import Database from tkp.db.orm import ExtractedSource from tkp.testutil import db_subs from tkp.db.generic import columns_...
u''' Created on July 5, 2011 @author: Mark V Systems Limited (c) Copyright 2011 Mark V Systems Limited, All rights reserved. ''' try: import regex as re except ImportError: import re from arelle.PluginManager import pluginClassMethods from arelle import XPathContext from datetime import datetime class ixtFunc...
"""Unit tests for database components.""" import unittest import pyodbc from shared.utils import get_test_case_name class TestDb(unittest.TestCase): """Unit tests for database components.""" @classmethod def setUpClass(cls): """Execute this before the tests.""" cls.connection = TestDb.get...
# 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...
import sys import pickle import math import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np from subprocess import Popen, PIPE from collections import defaultdict def tree(): return defaultdict(tree) def run_command_with_params_and_get_output(command, args): # Compile first ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-08 22:37:13 import os import time import shutil import unittest2 as unittest import logging import logging.config logging.config.fileConfig("pyspid...
import os import pathlib from datetime import datetime from functools import partial from typing import Optional from pint import UnitRegistry from pint.errors import DimensionalityError, UndefinedUnitError from pyqtgraph.Qt import QtCore, QtGui, QtWidgets from graphysio import ui from graphysio.algorithms import fil...