text
stringlengths
475
200k
import unittest from .support import LoggingResult class Test_TestSkipping(unittest.TestCase): def test_skipping(self): class Foo(unittest.TestCase): def test_skip_me(self): self.skipTest("skip") events = [] result = LoggingResult(events) test = Foo("t...
# -*- coding: utf-8 -*- """ requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import copy import time import calendar import collections from ._internal_utils import to_native_string from .co...
import py, pytest from _pytest.recwarn import WarningsRecorder def test_WarningRecorder(recwarn): showwarning = py.std.warnings.showwarning rec = WarningsRecorder() assert py.std.warnings.showwarning != showwarning assert not rec.list py.std.warnings.warn_explicit("hello", UserWarning, "xyz", 13) ...
# -*- coding: utf-8 -*- """ flask.logging ~~~~~~~~~~~~~ Implements the logging support for Flask. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from logging import getLogger, StreamHandler, Formatter, getLoggerClas...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import import os import glob import math import imageio import scipy.misc as misc import numpy as np from PIL import Image def pad_seq(seq, batch_size): # pad the sequence to be the multiples of batch_size seq_len ...
from __future__ import division, absolute_import, print_function import sys import numpy as np from numpy.core.test_rational import rational from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_raises, dec ) def assert_dtype_equal(a, b): assert_equal(a, b) assert_equa...
"""CPStats, a package for collecting and reporting on program statistics. Overview ======== Statistics about program operation are an invaluable monitoring and debugging tool. Unfortunately, the gathering and reporting of these critical values is usually ad-hoc. This package aims to add a centralized place for gather...
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the 'context_processors' option of the configuration of a DjangoTemplates backend and use...
# 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 compliance with the License. You may obtain # 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) class ZincLanguageM...
# coding=utf-8 """ Diamond handler that check if values are too high or too low, if so send an alert to a Sentry server This handler requires the Python module Raven: http://raven.readthedocs.org/en/latest/index.html To work this handler need a similar configuration: [[SentryHandler]] # Create a new project in Sen...
#!/usr/bin/env python """Doxygen XML to SWIG docstring converter. Converts Doxygen generated XML files into a file containing docstrings that can be used by SWIG-1.3.x. Note that you need to get SWIG version > 1.3.23 or use Robin Dunn's docstring patch to be able to use the resulting output. Usage: doxy2swig.py i...
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Ord...
import re import socket from sauna.plugins import (Plugin, bytes_to_human, human_to_bytes, PluginRegister) my_plugin = PluginRegister('Memcached') @my_plugin.plugin() class Memcached(Plugin): def __init__(self, config): super().__init__(config) self.config = { ...
# Copyright (c) 2010-2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010-2011, 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, includin...
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsError, DistutilsOptionError import os import glob from pkg_resources import Distribution, PathMetadata, normalize_path from setuptools.command.easy_install import easy_install from setuptools.compat import PY3 impor...
# Copyright (c) 2016 Red Hat, 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 is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
# Copyright (C) 2014 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "Brazilian Localization WMS Accounting", "category": "Localisation", "license": "AGPL-3", "author": "Akretion, Odoo Community Association (OCA)", "website": "https://github.com/OC...
""" Tests of the LMS XBlock Mixin """ import ddt from nose.plugins.attrib import attr from lms_xblock.mixin import ( INVALID_USER_PARTITION_GROUP_VALIDATION_COMPONENT, INVALID_USER_PARTITION_GROUP_VALIDATION_UNIT, INVALID_USER_PARTITION_VALIDATION_COMPONENT, INVALID_USER_PARTITION_VALIDATION_UNIT, ...
''' common XBMC Module Copyright (C) 2011 t0mm0 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. Th...
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of ...
"""Support for the Hitron CODA-4582U, provided by Rogers.""" import logging from collections import namedtuple import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA, DeviceScanner) from homeassist...
""" Regression tests for Django built-in views. """ from django.db import models class Author(models.Model): name = models.CharField(max_length=100) def __unicode__(self): return self.name def get_absolute_url(self): return '/views/authors/%s/' % self.id class BaseArticle(models.Model):...
# -*- encoding: utf-8 -*- # # Copyright 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
""" API Serializers """ from rest_framework import serializers class GradingPolicySerializer(serializers.Serializer): """ Serializer for course grading policy. """ assignment_type = serializers.CharField(source='type') count = serializers.IntegerField(source='min_count') dropped = serializers.IntegerF...
from __future__ import absolute_import import theano.tensor as T class Regularizer(object): def set_param(self, p): self.p = p def set_layer(self, layer): self.layer = layer def __call__(self, loss): return loss def get_config(self): return {"name": self.__class__.__...
from __future__ import (absolute_import, division, print_function) import mantid import io import six import sys import unittest from isis_powder.routines import sample_details from six_shim import assertRaisesRegex, assertRegex class ISISPowderSampleDetailsTest(unittest.TestCase): def test_constructor(self): ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <[EMAIL]> # 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 ANSIBLE...
# -*- test-case-name: twisted.news.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ News server backend implementations. """ import getpass, pickle, time, socket import os import StringIO from hashlib import md5 from email.Message import Message from email.Generator import Generato...
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013 CERN. # # Invenio 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, ...
from booty import BootyNoKernelWarning from bootloaderInfo import * class ia64BootloaderInfo(efiBootloaderInfo): def getBootloaderConfig(self, instRoot, bl, kernelList, chainList, defaultDev): config = bootloaderInfo.getBootloaderConfig(self, instRoot, ...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
import Tkinter as tk import tkFont import tkMessageBox from pomodoro import Pomodoro from datetime import timedelta, datetime from Queue import Queue, Empty from rest_break import Break as ShortBreak from rest_break import Break as LongBreak from timer_log import TimerLog class NativeUI(tk.Tk): def __init__(s...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # TSVEditWindow.py # # The edit windows for Biblelator TSV table editing # # Copyright (C) 2020 Robert Hunt # Author: Robert Hunt <[EMAIL]> # License: See gpl-3.0.txt # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
# -*- coding: utf-8 -*- """ pygments.lexers.parsers ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for parser generators. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, \ include...
'''Copyright (c) 2015 HG,DL,UTA Python program runs on local host, uploads, downloads, encrypts local files to google. Please use python 2.7.X, pycrypto 2.6.1 and Google Cloud python module ''' #import statements. import argparse import httplib2 import os import sys import json import time import datetime impor...
import json from django.contrib.auth.models import User, Group from django.http import JsonResponse from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from rest_framework import viewsets from yelo.lib.elo_utils import play_match from yelo.lib.http import api_error from yelo.models ...
# Copyright 2013 Dean Gardiner <[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 agreed to in w...
"""Copyright 2008 Orbitz WorldWide 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...
#!/usr/bin/python # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # This module 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 late...
""" Convert use of sys.exitfunc to use the atexit module. """ # Author: Benjamin Peterson from lib2to3 import pytree, fixer_base from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms class FixExitfunc(fixer_base.BaseFix): keep_line_order = True BM_compatible = True PATTERN = """ ...
#!/usr/bin/env python # Created by Pearu Peterson, September 2002 from __future__ import division, print_function, absolute_import __usage__ = """ Build fftpack: python setup_fftpack.py build Run tests if scipy is installed: python -c 'import scipy;scipy.fftpack.test(<level>)' Run tests if fftpack is not installe...
"""Ecuaciones termodinamicas ideales para el calculo de propiedades termodinamicas del Manual del ingeniero quimico Perry""" from math import sinh, cosh from scipy import integrate import numpy as np def antoine(T, C1, C2, C3, C4, C5): """Ecuación para calculo de presión de vapor (Pa)""" return np.exp(C1 + ...
# encoding: utf-8 import sublime, sublime_plugin try: from . import util except ValueError: import util class PerformEventListener(sublime_plugin.EventListener): """Suggest subroutine completions for the perform statement.""" def on_query_completions(self, view, prefix, points): if not util....
#!/usr/bin/python # scriptlib.py by Ambrosa http://www.ambrosa.net # derived from E2_LOADEPG # 22-Dec-2011 __author__ = "ambrosa http://www.ambrosa.net" __copyright__ = "Copyright (C) 2008-2011 Alessandro Ambrosini" __license__ = "CreativeCommons by-nc-sa http://creativecommons.org/licenses/by-nc-sa/3.0/" import os...
#=============================================================================== # Copyright 2009 Matt Chaput # # 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/li...
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # makedocs.py: Generate documentation for Open Project Wiki # Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. # Contributor: Jorge Araya Navarro <[EMAIL]> # # IMPORTANT NOTICE: # If you are going to modify anything from this file, please be sure to follow # the Style...
from __future__ import with_statement from contextlib import contextmanager from copy import deepcopy from fudge.patcher import with_patched_object from functools import partial from types import StringTypes import copy import getpass import os import re import shutil import sys import tempfile from fudge import Fake...
import pygame from abstractscreen import AbstractScreen from settings import * S = Settings() instance = None # Behaves like the actual LED screen, but shows the screen content on a computer screen class VirtualScreen(AbstractScreen): def __init__(self, width=int(S.get('screen', 'matrix_width'...
# Exercise 43: Basic Object-Oriented Analysis and Design # Process to build something to evolve problems # 1. Write or draw about the problem. # 2. Extract key concepts from 1 and research them. # 3. Create a class hierarchy and object map for the concepts. # 4. Code the classes and a test to run them. # 5. Repeat and...
# # (c) 2017, Benjamin Jolivot <[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. #...
""" Test for export all courses. """ import shutil from tempfile import mkdtemp from contentstore.management.commands.export_all_courses import export_courses_to_output_path from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.django_utils i...
""" mysensors platform that offers a Climate(MySensors-HVAC) component. For more details about this platform, please refer to the documentation https://home-assistant.io/components/climate.mysensors """ import logging from homeassistant.components import mysensors from homeassistant.components.climate import ( ST...
from __future__ import absolute_import import logging import time import select from tornado import ioloop from django.conf import settings try: # Tornado 2.4 orig_poll_impl = ioloop._poll def instrument_tornado_ioloop(): ioloop._poll = InstrumentedPoll except: # Tornado 3 from tornado.iol...
# Copyright 2013 Dag Wieers <[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. # # ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010-2013 Elico Corp. All Rights Reserved. # Author: LIN Yu <[EMAIL]> # # This program is free software: you can redistribute it and/or modify #...
from __future__ import division, absolute_import, unicode_literals from PyQt4 import QtGui from PyQt4 import QtCore from PyQt4.QtCore import Qt from PyQt4.QtCore import SIGNAL from cola import cmds from cola import core from cola import difftool from cola import gitcmds from cola import hotkeys from cola import icons...
# 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...
from django.apps import apps from django.core import management from django.db.models import signals from django.test import TestCase, override_settings from django.utils import six APP_CONFIG = apps.get_app_config('migrate_signals') PRE_MIGRATE_ARGS = ['app_config', 'verbosity', 'interactive', 'using'] MIGRATE_DATABA...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2012 Doug Blank <[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 yo...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.files.uploadedfile import SimpleUploadedFile from django.db import models from django.forms import ( CharField, FileField, Form, ModelChoiceField, ModelForm, ) from django.forms.models import ModelFormMetaclass from d...
from BusTrack.repository import Base from BusTrack.repository import engine # import all relevant db models here. from BusTrack.repository.models.Bus import Bus from BusTrack.repository.models.UserType import UserType from BusTrack.repository.models.User import User from BusTrack.repository.models.UserLogin import Use...
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
""" Module to control libvirtd service. """ import re import logging import aexpect from avocado.utils import path from avocado.utils import process from avocado.utils import wait from . import remote from . import utils_misc from .staging import service from .utils_gdb import GDB try: path.find_command("libvirt...
from __future__ import absolute_import import imp import logging import os import sys import tempfile from pip.compat import uses_pycache, WINDOWS from pip.exceptions import UninstallationError from pip.utils import (rmtree, ask, is_local, dist_is_local, renames, normalize_path) from pip.utils....
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, Inc. # (c) 2017, Ansible by Red Hat, inc # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eith...
# 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 t...
# Test the runpy module import unittest import os import os.path import sys import re import tempfile import py_compile from test.support import forget, make_legacy_pyc, run_unittest, unload, verbose from test.script_helper import ( make_pkg, make_script, make_zip_pkg, make_zip_script, temp_dir) from runpy import...
import RPi.GPIO as GPIO from time import sleep as sleep ''' Defining class to handle shifing data out to shift register OutPin = output pin ClkPin = clock Pin Len = length of data in bytes (default 1 Byte) Speed = delay between each bit (Default 0.01 sec) ''' # Keyword args, ie: def my_function(*args...
# Copyright 2016 Twitter. 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 agree...
#!/usr/bin/env python # 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. """Build script to generate a new sdk_tools bundle. This script packages the files necessary to generate the SDK updater -- the to...
import unittest from zang.inboundxml.elements.say import Say from zang.inboundxml.elements.base_node import BaseNode from zang.inboundxml.elements.enums.voice import Voice class TestSay(unittest.TestCase): def setUp(self): self.text = 'Hello from Zang' def test_init_with_required_values(self): ...
# pylint: disable=W0201 from datetime import date, datetime, timedelta import mock import os import unittest import destalinator import slacker import slackbot sample_slack_messages = [ { "type": "message", "channel": "C2147483705", "user": "U2147483697", "text": "Human human huma...
from frasco import current_app from frasco.ext import get_extension_state from suds.client import Client as SudsClient from suds import WebFault import xml.etree.ElementTree as ET import requests import datetime EU_COUNTRIES = { "AT": "EUR", # Austria "BE": "EUR", # Belgium "BG": "BGN", # Bulgaria "DE...
from __future__ import absolute_import, unicode_literals from functools import update_wrapper from django.db import connection from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature from django.utils import six, unittest from .models import Reporter, Article if connection.vendor == 'oracle': exp...
# Copyright 2014 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 time from telemetry.results import progress_reporter from telemetry.value import failure from telemetry.value import skip class GTestProgressReport...
# Portions Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # Copyright 2013 Mercurial Contributors # # This software may be used and distributed according to the terms of the # GNU General Public Licens...
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import logging import sys from django.db.backends import * from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations from django.db.backends.postgresql_psycopg2.client import DatabaseClient fr...
#!/usr/bin/env python # Nom nom nom nom # TODO: there is currently a dependency on the order of initialization of # client and server... . for example: # $ pox.py nom_client nom_server # blocks indefinitely # whereas # $ pox.py nom_server nom_client # works from pox.core import core, UpEvent from pox.lib.r...
import logging import os import time from itertools import cycle import numpy as np import torch import torch.optim import torch.utils.data from apex.parallel import DistributedDataParallel as DDP from apex.optimizers import FusedAdam from apex import amp import mlperf_compliance from seq2seq.train.fp_optimizers impo...
# -*- coding: utf-8 -*- import base64 import datetime import logging import time import uuid import random import simplejson import openerp from openerp.http import request from openerp.osv import osv, fields from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT from openerp.addons.bus.bus import TIMEOUT _lo...
# Generated from 'Components.h' def FOUR_CHAR_CODE(x): return x kAppleManufacturer = FOUR_CHAR_CODE('appl') kComponentResourceType = FOUR_CHAR_CODE('thng') kComponentAliasResourceType = FOUR_CHAR_CODE('thga') kAnyComponentType = 0 kAnyComponentSubType = 0 kAnyComponentManufacturer = 0 kAnyComponentFlagsMask = 0 cmpIsM...
# # gdb helper commands and functions for Linux kernel debugging # # module tools # # Copyright (c) Siemens AG, 2013 # # Authors: # Jan Kiszka <[EMAIL]> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import cpus, utils module_type = utils.CachedType("struct module") ...
#!/usr/bin/env python from __future__ import print_function import os from posixpath import basename from six.moves.urllib.parse import urlparse from .common.spiders import BaseDocumentationSpider from typing import Any, List, Set def get_help_images_dir(help_images_path): # type: (str) -> str # Get index...
# Copyright (c) 2013-2021 khal contributors # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publi...
# -*- coding: utf-8 -*- r""" werkzeug.contrib.sessions ~~~~~~~~~~~~~~~~~~~~~~~~~ This module contains some helper classes that help one to add session support to a python WSGI application. For full client-side session storage see :mod:`~werkzeug.contrib.securecookie` which implements a secure,...
# Natural Language Toolkit: Text Segmentation Metrics # # Copyright (C) 2001-2017 NLTK Project # Author: Edward Loper <[EMAIL]> # Steven Bird <[EMAIL]> # David Doukhan <[EMAIL]> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Text Segmentation Metrics 1. Windowdiff Pevzner,...
# pylint: disable=C0111 # pylint: disable=W0621 from lettuce import world, step from common import * from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=E0611 from logging import getLogger logger = getLogger(__name__) @step(u'I have a course with no sections$') def have_a_course(step):...
""" Simple tester for the vgg19_trainable """ import tensorflow as tf from tensoflow_vgg import vgg19_trainable as vgg19 from tensoflow_vgg import utils img1 = utils.load_image("./test_data/tiger.jpeg") img1_true_result = [1 if i == 292 else 0 for i in range(1000)] # 1-hot result for tiger batch1 = img1.reshape((1...
from __future__ import absolute_import, division, unicode_literals from six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from gettext import gettext _ = gettext from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None elif isin...
# Copyright (c) 2007 The Regents of The University of Michigan # 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 ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests import Form, tagged from odoo.tests.common import SavepointCase from odoo.exceptions import UserError @tagged('post_install', '-at_install') class TestAngloSaxonValuation(SavepointCase): @classmetho...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
""" An implementation of an object that acts like a collection of on/off bits. """ import operator from array import array from bisect import bisect_left, bisect_right, insort from whoosh.compat import integer_types, izip, izip_longest, next, xrange from whoosh.util.numeric import bytes_for_bits # Number of '1' bit...
import array, sys # Run time aliasing of Python2/3 differences def htmlescape(s, quote=True): # this is html.escape reimplemented with cgi.escape, # so it works for python 2.x, 3.0 and 3.1 import cgi s = cgi.escape(s, quote) if quote: # python 3.2 also replaces the single quotes: ...
#!python3 """ Project: Voltcraft Data Analyzer Author: Valer Bocan, PhD <[EMAIL]> Last updated: September 14th, 2014 Module description: The VoltcraftDataFile module processes data files containing history of voltage, current and power factor, as generated by the Voltcraft Energy-Logger 4000....
# -*- coding: utf-8 -*- # Copyright (C) 2016-2018 by the Free Software Foundation, Inc. # # This file is part of Postorius. # # Postorius 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...