text
stringlengths
475
200k
"""Support for Yeelight Sunflower color bulbs (not Yeelight Blue or WiFi).""" import logging import voluptuous as vol import yeelightsunflower from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_HS_COLOR, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, LightEntity, ) from ho...
# Natural Language Toolkit: TnT Tagger # # Copyright (C) 2001-2013 NLTK Project # Author: Sam Huston <[EMAIL]> # # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT ''' Implementation of 'TnT - A Statisical Part of Speech Tagger' by Thorsten Brants http://acl.ldc.upenn.edu/A/A00/A00-1031.pdf ''' ...
# # Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com # # This file is part of EigenD. # # EigenD is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) a...
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.event import event from flexget.utils import json from flexget.utils.template import RenderError from flexget.config_schema import one_or_more log = logging.getLogger("pushalot") pushalot_url = "...
def __boot(): import sys import os PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform == 'win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathsep) pic = getattr(sys, 'path_importer_cache', {}) stdpath = sys.pat...
# 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 OpenStack, LLC. # 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 # ...
from routersploit.modules.exploits.routers.mikrotik.winbox_auth_bypass_creds_disclosure import Exploit def test_check_success(tcp_target): command_mock1 = tcp_target.get_command_mock( b"\x68\x01\x00\x66\x4d\x32\x05\x00\xff\x01\x06\x00\xff\x09\x05\x07" b"\x00\xff\x09\x07\x01\x00\x00\x21\x35\x2f\x2f...
""" Created on May 17, 2013 @author: tanel """ import gi gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst GObject.threads_init() Gst.init(None) import logging import thread import os logger = logging.getLogger(__name__) import pdb class DecoderPipeline2(object): def __init__(self, conf=...
# (c) 2014 Michael DeHaan, <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # A...
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import re from . import _base from .. import ihatexml from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory tag_regexp = re.compile("{([^}]*)}(.*)") def getETreeBu...
#!/usr/bin/env python # # Build packages using spec files # # Copyright (C) 2005, Giovanni Bajo # Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as publishe...
import unittest from django.contrib.gis.gdal import HAS_GDAL if HAS_GDAL: from django.contrib.gis.gdal import Driver, GDALException valid_drivers = ( # vector 'ESRI Shapefile', 'MapInfo File', 'TIGER', 'S57', 'DGN', 'Memory', 'CSV', 'GML', 'KML', # raster 'GTiff', 'JPEG', 'MEM', 'PNG', ) in...
""" Extra HTML Widget classes """ from __future__ import unicode_literals import datetime import re from django.forms.widgets import Widget, Select from django.utils import datetime_safe from django.utils.dates import MONTHS from django.utils.safestring import mark_safe from django.utils.formats import get_format fro...
# -*- coding: utf-8 -*- from django.test import TestCase from .model_factories import DomainF from ..models import DomainArchive class TestModelDomainArchive(TestCase): def test_domainArchive_fields(self): self.assertListEqual( [fld.name for fld in DomainArchive._meta.fields], [ ...
#!/usr/bin/env python from nose.tools import * import networkx class TestDistance: def setUp(self): G=networkx.Graph() from networkx import convert_node_labels_to_integers as cnlti G=cnlti(networkx.grid_2d_graph(4,4),first_label=1,ordering="sorted") self.G=G def test_eccentric...
# $Id: cs.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Marek Blaha <[EMAIL]> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each lan...
# -*- coding: utf-8 -*- """ Tests for the single invoke invoker. """ # Future from __future__ import absolute_import, division, print_function, \ unicode_literals, with_statement # Third Party import nose from mock import Mock # First Party from metaopt.concurrent.invoker.singleprocess import SingleProcessInvoker...
import pandas as pd import numpy as np df = pd.read_csv('tweets.csv') target = df['is_there_an_emotion_directed_at_a_brand_or_product'] text = df['tweet_text'] fixed_text = text[pd.notnull(text)] fixed_target = target[pd.notnull(text)] from sklearn.feature_extraction.text import CountVectorizer from sklearn.naive_b...
from __future__ import nested_scopes def set_trace_in_qt(): import pydevd_tracing from pydevd_comm import GetGlobalDebugger debugger = GetGlobalDebugger() if debugger is not None: pydevd_tracing.SetTrace(debugger.trace_dispatch) _patched_qt = False def patch_qt(): ''' ...
from LogAnalyzer import Test,TestResult import DataflashLog # from ArduCopter/defines.h AUTOTUNE_INITIALISED = 30 AUTOTUNE_OFF = 31 AUTOTUNE_RESTART = 32 AUTOTUNE_SUCCESS = 33 AUTOTUNE_FAILED = 34 AUTOTUNE_REACHED_LIMIT = 35 AUTOTUNE_PILOT_TESTING = 36 AUTOTUN...
# # Test executable #2 to exercise the Gauss-Hermite class # Here, we fit a Gauss-Hermite expansion to an arbitrary profile. # The SciPy least squares method is used. # # Copyright (c) 2013 RadiaBeam Technologies. All rights reserved # # python imports import math # SciPy imports import numpy as np import matplotlib.p...
from __future__ import unicode_literals import re import base64 from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, int_or_none, ) class SharedIE(InfoExtractor): _VALID_URL = r'http://shared\.sx/(?P<id>[\da-...
from email.parser import FeedParser import os import imp import locale import re import sys import shutil import tempfile import textwrap import zipfile from distutils.util import change_root from pip.locations import (bin_py, running_under_virtualenv,PIP_DELETE_MARKER_FILENAME, write_delete...
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
# (c) 2013 Joost Yervante Damad <[EMAIL]> # License: GPL import os, os.path, glob import coffee.pycoffee as pycoffee class Meta: def __init__(self, meta): if not 'desc' in meta: meta['desc'] = '' if not 'parent' in meta: meta['parent'] = None self.meta = meta for k in meta: self....
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world, step from selenium.webdriver.common.keys import Keys from common import type_in_codemirror, get_codemirror_value from nose.tools import assert_in # pylint: disable=no-name-in-module @step(u'I go to the course updat...
"""Various utility functions.""" from collections import namedtuple, OrderedDict __unittest = True _MAX_LENGTH = 80 def safe_repr(obj, short=False): try: result = repr(obj) except Exception: result = object.__repr__(obj) if not short or len(result) < _MAX_LENGTH: retu...
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # # 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 # w...
""" Unit tests for cloning a course between the same and different module stores. """ import json from django.conf import settings from opaque_keys.edx.locator import CourseLocator from xmodule.modulestore import ModuleStoreEnum, EdxJSONEncoder from contentstore.tests.utils import CourseTestCase from contentstore.task...
# urllib3/_collections.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from collections import MutableMapping from threading import Lock try: # Python 2.7+ ...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Daniel Reis # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software...
import tempfile import os import errno from django.conf import settings from django.core.files import locks from django.core.files.move import file_move_safe from django.utils.text import get_valid_filename from django.core.files.storage import FileSystemStorage class OverwritingStorage(FileSystemStorage): """ ...
#! /usr/bin/env python2 # Copyright (c) 2009-2015, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
# This file is part of Py6S. # # Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file. # # Py6S is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, o...
import json from datetime import timedelta import pytest from django.utils.timezone import now from pretix.base.models import ( Event, EventPermission, Item, Order, OrderPosition, Organizer, Quota, User, ) from pretix.plugins.banktransfer.models import BankImportJob, BankTransaction @pytest.fixture def env(): ...
#!/usr/bin/env python """ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import os import re from lib.core.common import singleTimeWarnMessage from lib.core.enums import DBMS from lib.core.enums import PRIORITY __priority__ = PRIORITY.HIGHEST de...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import re import unittest """ # _-----=> irqs-off # / _----=> need-resched # | / _---...
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
from __future__ import unicode_literals import os import re from unittest import skipUnless from django.contrib.gis.db.models import Extent3D, Union from django.contrib.gis.db.models.functions import ( AsGeoJSON, AsKML, Length, Perimeter, Scale, Translate, ) from django.contrib.gis.gdal import HAS_GDAL from djang...
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # 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 ...
""" SIMBAD_report.py: CCP4 GUI Project This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. ...
""" SAX driver for the pyexpat C module. This driver works with pyexpat.__version__ == '2.22'. """ version = "0.20" from xml.sax._exceptions import * from xml.sax.handler import feature_validation, feature_namespaces from xml.sax.handler import feature_namespace_prefixes from xml.sax.handler import feature_external_...
"""Check for errs in the AST. The Python parser does not catch all syntax errors. Others, like assignments with invalid targets, are caught in the code generation phase. The compiler package catches some errors in the transformer module. But it seems clearer to write checkers that use the AST to detect error...
"""All Error Types pertaining to Enrollment.""" class CourseEnrollmentError(Exception): """Generic Course Enrollment Error. Describes any error that may occur when reading or updating enrollment information for a user or a course. """ def __init__(self, msg, data=None): super(CourseEnrollmen...
""" Test of rotation/positioning of simple cubic particle. Original particle is compared with the one obtained """ from __future__ import print_function import os, sys, unittest import utils from libBornAgainCore import * class RotationsCubeTest(unittest.TestCase): """ Test of rotations and translations of ...
#!/usr/bin/env python # Copyright 2013 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 tool to extract minidumps from dmp crash dumps.""" import os import sys from cgi import parse_multipart def ProcessDump(dump_fi...
"""Wraps layer1 api methods and converts layer1 dict responses to objects.""" from boto.beanstalk.layer1 import Layer1 import boto.beanstalk.response from boto.exception import BotoServerError import boto.beanstalk.exception as exception def beanstalk_wrapper(func, name): def _wrapped_low_level_api(*args, **kwarg...
#!/usr/bin/env python """ untangle Converts xml to python objects. The only method you need to call is parse() Partially inspired by xml2obj (http://code.activestate.com/recipes/149368-xml2obj/) Author: Christian Stefanescu (http://0chris.com) License: MIT License - http://www.opensource.org/licenses/mit-li...
""" Test CRUD for authorization. """ import copy from django.contrib.auth.models import User from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from contentstore.tests.utils import AjaxEnabledTestClient from opaque_keys.edx.locations import SlashSeparatedCourseKey from contentstore.utils import re...
# License: BSD 3 clause from operator import itemgetter import numpy as np import scipy.sparse as sps from scipy.sparse import csr_matrix from tick.base.simulation import Simu from tick.hawkes import SimuHawkesExpKernels, SimuHawkesMulti from tick.preprocessing import LongitudinalFeaturesLagger from itertools import p...
#! /usr/bin/env python # $Id: test_decorations.py 4667 2006-07-12 21:40:56Z wiemann $ # Author: David Goodger <[EMAIL]> # Copyright: This module has been placed in the public domain. """ Tests for the "header" & "footer" directives. """ from __init__ import DocutilsTestSupport def suite(): s = DocutilsTestSuppo...
# -*- coding: utf-8 -*- """ tests.views ~~~~~~~~~~~ Pluggable views. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import flask import flask.views from werkzeug.http import parse_set_header def common_test(app): c = app.test_client()...
############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## 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 ## ## ht...
import unittest from MuseParse.classes.Input import MxmlParser from MuseParse.classes.ObjectHierarchy.TreeClasses.PieceTree import PieceTree class testSetupPiece(unittest.TestCase): def setUp(self): self.handler = MxmlParser.SetupPiece self.tags = [] self.attrs = {} self.chars = ...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.db import models class People(models.Model): name = models.CharField(max_length=255) parent = models.ForeignKey('self', models.CASCADE) class Message(models.Model): from_field = models.ForeignKey(People, models.CASCADE, db_co...
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of the test suite of the Qt Toolkit. ## ## $QT_BEGIN_LICENSE:LGPL$ ## Commercial License...
# Copyright (c) 2003-2014 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:[EMAIL] # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your ...
#! /usr/bin/env python # $Id: test_figures.py 7062 2011-06-30 22:14:29Z milde $ # Author: David Goodger <[EMAIL]> # Copyright: This module has been placed in the public domain. """ Tests for images.py figure directives. """ from __init__ import DocutilsTestSupport def suite(): s = DocutilsTestSupport.ParserTest...
""" Intermediaries supporting GEOS topological operations These methods all take Shapely geometries and other Python objects and delegate to GEOS functions via ctypes. These methods return ctypes objects that should be recast by the caller. """ from ctypes import byref, c_double from shapely.geos import TopologicalE...
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'Y \m. E j \d.' TIME_FORMAT = 'H:...
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on Nov 7, 2011 @author: John Cornwell @contact: [EMAIL] @summary: File containing various classification fun...
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <[EMAIL]> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of the License...
# -*- coding: iso-8859-15 -*- """IP4 address range set implementation. Implements an IPv4-range type. Copyright (C) 2006, Heiko Wundram. Released under the MIT-license. """ # Version information # ------------------- __author__ = "Heiko Wundram <[EMAIL]>" __version__ = "0.2" __revision__ = "3" __date__ = "2006-01-2...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y' TIME_FORMAT = 'G:i' DATETIME_FORMAT = 'j. E Y G:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMA...
# Copyright (c) 2013 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 _winreg import os import shutil import subprocess import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) def IsExe(fpath): return ...
"""Exception classes. @sort: TLSError, TLSAbruptCloseError, TLSAlert, TLSLocalAlert, TLSRemoteAlert, TLSAuthenticationError, TLSNoAuthenticationError, TLSAuthenticationTypeError, TLSFingerprintError, TLSAuthorizationError, TLSValidationError, TLSFaultError """ from constants import AlertDescription, AlertLevel class ...
""" =========================================== Robust linear model estimation using RANSAC =========================================== In this example we see how to robustly fit a linear model to faulty data using the RANSAC algorithm. """ import numpy as np from matplotlib import pyplot as plt from sklearn import ...
import argparse import os from gittalk import GitTalk from gittalk.utils import which, make_sure_path_exists def run(): """ `run` drives the command line interface for Git Talk. It exposes a command line interface through which users can interact with Git Talk to configure or invoke various funct...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # Copyright 2012, Seth Vidal <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or...
#!/usr/bin/env python # Copyright 2015-2016 RethinkDB, all rights reserved. '''Test that a backfill will resume after restarting a cluster''' import os, pprint, sys, time sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common'))) import driver, scenario_common, utils, vcoptpa...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at you...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from helpers import Session from helpers import Record from openerp.workflow.instance import WorkflowInstance # import instance class WorkflowService(object): CACHE = {} @classmethod def clear_cache(cls, d...
# 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...
# ***************************************************************************** # Copyright (c) 2014 IBM Corporation and other Contributors. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution,...
# -*- coding: utf-8 -*- """ jinja2.nodes ~~~~~~~~~~~~ This module implements additional nodes derived from the ast base node. It also provides some node tree helper functions like `in_lineno` and `get_nodes` used by the parser and translator in order to normalize python and jinja nodes. :...
# encoding: utf-8 """ Tests for IPython.utils.traitlets. Authors: * Brian Granger * Enthought, Inc. Some of the code in this file comes from enthought.traits and is licensed under the BSD license. Also, many of the ideas also come from enthought.traits even though our implementation is very different. """ #---...
""" Push notifications are not meant to be actionable and should not be used for critical account functions like provisioning accounts. Use the receipt of a push notification to trigger an API query, validating both the push notification action and the details of the action. http://docs.recurly.com/push-notifications ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Matt Martz <[EMAIL]>, and others # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.core.checks import Error from django.db import connections, models from django.test import mock from .base import IsolatedModelsTestCase def dummy_allow_migrate(db, app_label, **hints): # Prevent checks from being run on the 'other' d...
from __future__ import absolute_import import logging log = logging.getLogger(__name__) from flask import request, jsonify from bokeh import protocol from .bbauth import ( handle_auth_error ) from ..app import bokeh_app from ..crossdomain import crossdomain from ..serverbb import get_temporary_docid, BokehServe...
"""Running tests""" import sys import time import unittest from unittest2 import result try: from unittest2.signals import registerResult except ImportError: def registerResult(_): pass __unittest = True class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'w...
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('http://python.org') >>> r.sta...
""" SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
from unittest import TestCase import os from tempfile import mktemp import gzip from blaze.utils import filetext, filetexts, tmpfile from blaze.data import * from blaze.py2help import skip class TestResource(TestCase): def setUp(self): self.filename = mktemp() def tearDown(self): if os.path.e...
from chainer.utils import argument PRIORITY_WRITER = 300 PRIORITY_EDITOR = 200 PRIORITY_READER = 100 class Extension(object): """Base class of trainer extensions. Extension of :class:`Trainer` is a callable object that takes the trainer object as the argument. It also provides some default configurati...
from flask import render_template, redirect, url_for, abort, flash, request,\ current_app, make_response from flask_login import login_required, current_user from . import main from .forms import EditProfileForm, EditProfileAdminForm, PostForm,\ CommentForm from .. import db from ..models import Permission, Rol...
# Symbolic constants for Tk # Booleans NO=FALSE=OFF=0 YES=TRUE=ON=1 # -anchor and -sticky N='n' S='s' W='w' E='e' NW='nw' SW='sw' NE='ne' SE='se' NS='ns' EW='ew' NSEW='nsew' CENTER='center' # -fill NONE='none' X='x' Y='y' BOTH='both' # -side LEFT='left' TOP='top' RIGHT='right' BOTTOM='bottom' # -relief RAISED='rai...
from django.utils import unittest import django.test from django.test.client import Client from lxml import html from cssselect import HTMLTranslator class NotOkay(Exception): def __init__(self, response): Exception.__init__(self, "%r: %r" % (response.status_code, response)) self.response = respon...
"""Drop-in replacement for the thread module. Meant to be used as a brain-dead substitute so that threaded code does not need to be rewritten for when the thread module is not present. Suggested usage is:: try: import _thread except ImportError: import _dummy_thread as _thread """ # Exports ...
import numpy as np from numpy.testing import (assert_allclose, assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal) from scipy.ndimage import convolve1d from scipy.signal import savgol_coeffs, savgol_filter from scipy.signal._savitzky_...
# Copyright (c) 2015, Nordic Semiconductor # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions ...
"""SCons The main package for the SCons software construction utility. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "S...
# Copyright 2015 Michael Rice <[EMAIL]> # # 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...
try: from sshtunnel import SSHTunnelForwarder except ImportError: from sshtunnel.sshtunnel import SSHTunnelForwarder from cm_api.api_client import ApiResource, ApiException from cm_api.endpoints.services import ApiService, ApiServiceSetupInfo import paramiko import json import yaml import requests import subpro...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models class FichePayeParser(models.AbstractModel): _name = 'report.l10n_fr_hr_payroll.report_l10n_fr_fiche_paye' def get_payslip_lines(self, objs): res = [] ids = [] ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
""" API v1 views. """ import logging from django.http import Http404 from edx_rest_api_client import exceptions from rest_framework.authentication import SessionAuthentication from rest_framework.views import APIView from rest_framework.generics import RetrieveUpdateAPIView, ListAPIView from rest_framework.permissions...