text
stringlengths
475
200k
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import command_common import logging import manifest_util def Info(manifest, bundle_names): valid_bundles, invalid_bundles = command_common.GetValidBu...
# Copyright (c) 2010 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 of conditions and the ...
from __future__ import unicode_literals import sys from pre_commit import color from pre_commit import five def get_hook_message( start, postfix='', end_msg=None, end_len=0, end_color=None, use_color=None, cols=80, ): """Prints a message for running a hook...
__author__ = 'Thomas Rueckstiess, [EMAIL]' from scipy import reshape, dot, outer, eye from pybrain.structure.connections import FullConnection class FullNotSelfConnection(FullConnection): """Connection which connects every element from the first module's output buffer to the second module's input buffer in a...
""" Helper for looping over sequences, particular in templates. Often in a loop in a template it's handy to know what's next up, previously up, if this is the first or last item in the sequence, etc. These can be awkward to manage in a normal Python loop, but using the looper you can get a better sense of the context....
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# 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 u...
# (c) 2015, Filipe Niero Felisbino <[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 versio...
# -*- coding: utf-8 -*- """ Module defining unit prefixe class and some constants. Constant dict for SI and binary prefixes are defined as PREFIXES and BIN_PREFIXES. """ from sympy import sympify class Prefix(object): """ This class represent prefixes, with their name, symbol and factor. Prefixes are ...
""" XML serializer. """ from __future__ import unicode_literals from collections import OrderedDict from xml.dom import pulldom from xml.sax import handler from xml.sax.expatreader import ExpatParser as _ExpatParser from django.apps import apps from django.conf import settings from django.core.serializers import bas...
"""Statistics analyzer for HotShot.""" import profile import pstats import hotshot.log from hotshot.log import ENTER, EXIT def load(filename): return StatsLoader(filename).load() class StatsLoader: def __init__(self, logfn): self._logfn = logfn self._code = {} self._stack = [] ...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# 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 os from pant...
"""Tests for letsencrypt.plugins.disco.""" import pkg_resources import unittest import mock import zope.interface from letsencrypt import errors from letsencrypt import interfaces from letsencrypt.plugins import standalone EP_SA = pkg_resources.EntryPoint( "sa", "letsencrypt.plugins.standalone", attrs=("Aut...
#!/usr/bin/env python ######################################################################## # File : dirac-admin-get-pilot-output # Author : Stuart Paterson ######################################################################## """ Retrieve output of a Grid pilot Usage: dirac-admin-get-pilot-output [options...
"""Support for deCONZ sensors.""" from pydeconz.sensor import ( Battery, Consumption, Daylight, Humidity, LightLevel, Power, Pressure, Switch, Temperature, Thermostat, ) from homeassistant.components.sensor import DOMAIN from homeassistant.const import ( ATTR_TEMPERATURE, ...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# # Copyright (C) 2009 The Android Open Source Project # # 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 la...
# 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. # Notes: # # This is all roughly based on the Makefile system used by the Linux # kernel, but is a non-recursive make -- we put the entire dependency # graph in fr...
# Copyright (c) 2007 The Hewlett-Packard Development Company # Copyright (c) 2013 Mark D. Hill and David A. Wood # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to int...
#!/usr/bin/env python import argparse import gzip import os from collections import OrderedDict import yaml from Bio.SeqIO.QualityIO import FastqGeneralIterator OUTPUT_DBKEY_DIR = 'output_dbkey' OUTPUT_METRICS_DIR = 'output_metrics' def get_sample_name(file_path): base_file_name = os.path.basename(file_path) ...
############################################# # This is a basic script to emulate the hardware of # an Arduino microcontroller. The VirtualDevice # service will execute this script when # createVirtualArduino(port) is called import time import math import threading from random import randint from org.myrobotlab.codec ...
"""``tornado.gen`` is a generator-based interface to make it easier to work in an asynchronous environment. Code using the ``gen`` module is technically asynchronous, but it is written as a single generator instead of a collection of separate functions. For example, the following asynchronous handler:: class Asy...
from subprocess import check_output, check_call, CalledProcessError from os import unlink, devnull from os.path import isfile from tempfile import NamedTemporaryFile from fractions import Fraction from six.moves import zip from . import cglpk from .wrappers import * # detect paths to system calls for esolver and gzip...
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from django.conf.urls import patterns, url from .views import ( LoginVi...
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # System Imports import sys from twisted.trial import unittest try: import cPickle as pickle except ImportError: import pickle try: import cStringIO as StringIO except ImportError: import StringIO # Twisted Imports ...
#------------------------------------------------------------------------------ # Copyright (c) 2013, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------------------------------...
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from django import template from django.core...
#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later # # sd-script.py: create LOTS of sd device entries in fake sysfs # # (C) 2018 Martin Wilck, SUSE Linux GmbH # # Run after sys-script.py # Usage: sd-script.py <directory> <num> # <num> is the number of device nodes (disks + partitions) # to create in ad...
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import unittest from mock import patch from mock import MagicMock as Mock import pyrax.cloudblockstorage from pyrax.cloudblockstorage import CloudBlockStorageClient from pyrax.cloudblockstorage import CloudBlockStorageVolume from pyrax.cloudblockstorage imp...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt from frappe import _, msgprint from frappe.model.document import Document class AuthorizationRule(Do...
import logging from rx.internal import PriorityQueue, ArgumentOutOfRangeException from .schedulerbase import SchedulerBase from .scheduleditem import ScheduledItem from .scheduleperiodic import SchedulePeriodic log = logging.getLogger("Rx") class VirtualTimeScheduler(SchedulerBase): """Virtual Scheduler. This ...
"""TLS Lite + poplib.""" import socket from poplib import POP3 from gdata.tlslite.TLSConnection import TLSConnection from gdata.tlslite.integration.ClientHelper import ClientHelper # POP TLS PORT POP3_TLS_PORT = 995 class POP3_TLS(POP3, ClientHelper): """This class extends L{poplib.POP3} with TLS support.""" ...
# This file is a part of MediaDrop (http://www.mediadrop.net), # Copyright 2009-2013 MediaCore Inc., Felix Schwarz and other contributors. # For the exact contribution history, see the git revision log. # The source code contained in this file is licensed under the GPLv3 or # (at your option) any later version. # See L...
#!/usr/bin/env python3 # Copyright (c) 2016-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test segwit transactions and blocks on P2P network.""" import math import random import struct import t...
import os import unittest from unittest import mock from dmoj.config import InvalidInitException from dmoj.problem import Problem, ProblemDataManager class ProblemTest(unittest.TestCase): def setUp(self): self.data_patch = mock.patch('dmoj.problem.ProblemDataManager') data_mock = self.data_patch....
""" Tests of student.roles """ import ddt from django.test import TestCase from courseware.tests.factories import UserFactory, StaffFactory, InstructorFactory from student.tests.factories import AnonymousUserFactory from student.roles import ( GlobalStaff, CourseRole, CourseStaffRole, CourseInstructorRole, Or...
from PyQt4 import QtGui, QtCore import sys, os import models from pluginmgr import ShelfView # This plugin lists the books by tag EBOOK_EXTENSIONS=['epub','mobi','pdf'] class Catalog(ShelfView): title = "Books By Tag" itemText = "Tags" items = {} def showList(self, search = None): """Ge...
# (C) British Crown Copyright 2014 - 2016, Met Office # # This file is part of Iris. # # Iris 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, or # (at your option) any l...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import time from collections import defaultdict try: import blessings except ImportError: blessings = None imp...
from django.db import NotSupportedError from django.db.models.sql import compiler class SQLCompiler(compiler.SQLCompiler): def as_sql(self, with_limits=True, with_col_aliases=False): """ Create the SQL for this query. Return the SQL string and list of parameters. This is overridden from t...
import os import logging import tempfile from . import constants LOG_FILE = None LOGGER = None LEVELS = { constants.DEBUG: logging.DEBUG, constants.INFO: logging.INFO, constants.WARNING: logging.WARNING, constants.ERROR: logging.ERROR, constants.CRITICAL: logging.CRITICAL } def init(filename, l...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsPointCloudAttributeByRampRenderer .. note:: 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 option) any ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
# -*- coding: utf-8 -*- # Copyright (C) 2014-2016 Andrey Antukh <[EMAIL]> # Copyright (C) 2014-2016 Jesús Espino <[EMAIL]> # Copyright (C) 2014-2016 David Barragán <[EMAIL]> # Copyright (C) 2014-2016 Alejandro Alonso <[EMAIL]> # This program is free software: you can redistribute it and/or modify # it under the terms o...
from __future__ import unicode_literals import datetime import decimal from django.db import models from django.db.models.constants import LOOKUP_SEP from django.db.models.deletion import Collector from django.db.models.related import RelatedObject from django.forms.forms import pretty_name from django.utils import f...
#!/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 distributed...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <[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 ''' $Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $ ''' from cStringIO import StringIO from datetime import datetime, timedelta from struct import unpack, calcsize from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo from pytz.tzinfo import memorized_datetime, memorized_timede...
from __future__ import unicode_literals from django.conf import global_settings, settings from .. import Tags, Warning, register @register(Tags.compatibility) def check_duplicate_template_settings(app_configs, **kwargs): if settings.TEMPLATES: values = [ 'TEMPLATE_DIRS', 'ALLOWED...
# Copyright (C) 2001-2006 Python Software Foundation # Author: Ben Gertzfield, Barry Warsaw # Contact: [EMAIL] __all__ = [ 'Charset', 'add_alias', 'add_charset', 'add_codec', ] import codecs import email.base64mime import email.quoprimime from email import errors from email.encoders import encode...
from __future__ import unicode_literals import copy import os import re import sys from io import BytesIO from itertools import chain from pprint import pformat from django.conf import settings from django.core import signing from django.core.exceptions import DisallowedHost, ImproperlyConfigured from django.core.fil...
from datetime import date, datetime, time from django.forms import SplitDateTimeWidget from .base import WidgetTest class SplitDateTimeWidgetTest(WidgetTest): widget = SplitDateTimeWidget() def test_render_empty(self): self.check_html(self.widget, 'date', '', html=( '<input type="text" ...
import datetime import isodate from pulp.server.db.connection import get_collection def migrate(*args, **kwargs): """ Add last_updated and last_override_config to the importer collection. """ updated_key = 'last_updated' config_key = 'last_override_config' collection = get_collection('repo_i...
import datetime from django.test import TestCase from django.utils import timezone from oscar.test import factories from oscar.apps.offer import models class TestActiveOfferManager(TestCase): def test_includes_offers_in_date_range(self): # Create offer that is available but with the wrong status ...
""" Views for the verification flow """ import datetime import decimal import json import logging import urllib from pytz import UTC from ipware.ip import get_ip from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.mail import send_mail from django.core.urlresolv...
""" Utility functions for generating "lorem ipsum" Latin text. """ from __future__ import unicode_literals import random COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ...
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustäbel <[EMAIL]> # All rights reserved. # # Permission is hereby granted, free of char...
#!/usr/bin/env python3 # Plot all the planets' orbits, as viewed from a point that # floats above the Earth's north ecliptic pole and moves with # the Earth, to demonstrate phenomena like epicycles and the # Venus pentagram. Idea from Galen Gisler's planetarium show. # # Copyright 2020 by Akkana Peck: Share and enjoy ...
import time from datetime import datetime from django.test import TestCase from django.utils import timezone from oidc_provider.lib.utils.common import get_issuer from oidc_provider.lib.utils.token import create_id_token from oidc_provider.tests.app.utils import create_fake_user class Request(object): """ M...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# !/usr/bin/env python2 # encoding:utf-8 # author:dbr/Ben #project:tvdb_api #repository:http://github.com/dbr/tvdb_api #license:unlicense (http://unlicense.org/) from functools import wraps import traceback __author__ = "dbr/Ben" __version__ = "1.9" import os import re import time import getpass import StringIO impo...
# -*- coding: utf-8 -*- """ tests.helpers ~~~~~~~~~~~~~~~~~~~~~~~ Various helpers. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import os import datetime import flask from logging import StreamHandler from werkzeug.exceptions import BadRe...
import zstackwoodpecker.header.checker as checker_header import zstackwoodpecker.operations.volume_operations as vol_ops import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_util as test_util import zstackwoodpecker.zstack_test.zstack_test_snapshot as zstack_sp_header import zstackwoodpecker.header...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # (C) 2013-2015 Muthiah Annamalai # # This file is part of 'open-tamil' package tests # # setup the paths import codecs import re from opentamiltests import * from tamil.utils.santhirules import joinWords from tamil.regexp import make_pattern class SantheeRules(unitt...
class HealthVaultStatus(object): """Status codes that HealthVault can return. `See also <http://msdn.microsoft.com/en-us/library/hh567902.aspx>`_ """ OK = 0 # The request was successful. FAILED = 1 # Generic failure due to unknown causes or internal error. BAD_HTTP = 2 # Http protocol prob...
from django.http import Http404 from django.shortcuts import render, redirect from django.utils import six from django.utils.translation import ugettext as _ from django.contrib import messages from django.contrib.auth.decorators import login_required from avatar.forms import PrimaryAvatarForm, DeleteAvatarForm, Uplo...
# # 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...
import subprocess import tempfile import os def img_to_str(tesseract_path, image): """Reads text in an image with tesseract-ocr :param tesseract_path: path to the tesseract executable :type tesseracth_path: str :param image: path to the input image :type image: str """ if not os.path.isfi...
#! /usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions...
# Copyright 2013 Free Software Foundation, Inc. # # This 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 program i...
#!/usr/bin/env python # # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
# # qNEW.py : The q-NEW signature algorithm. # # Part of the Python Cryptography Toolkit # # Distribute and use freely; there are no restrictions on further # dissemination and usage except those imposed by the laws of your # country of residence. This software is provided "as is" without # warranty of fitness fo...
# Test VfsFat class and its finaliser try: import uerrno, uos uos.VfsFat except (ImportError, AttributeError): print("SKIP") raise SystemExit class RAMBlockDevice: def __init__(self, blocks, sec_size=512): self.sec_size = sec_size self.data = bytearray(blocks * self.sec_size) ...
from openerp import models, fields, api, _ from openerp.exceptions import Warning class account_invoice(models.Model): _inherit = 'account.invoice' auto_generated = fields.Boolean(string='Auto Generated Document', copy=False) auto_invoice_id = fields.Many2one('account.invoice', string='Source Invoice', ...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Nick Hall # # 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 option) any...
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
# -*- coding: utf-8 -*- # code for console Encoding difference. Dont' mind on it import sys import imp imp.reload(sys) try: sys.setdefaultencoding('UTF8') except Exception as E: pass import testValue from popbill import TaxinvoiceService, PopbillException taxinvoiceService = TaxinvoiceService(testValue.Link...
#!/usr/bin/env python import subprocess, sys #API - virtdc command line init tool #============================================================================== # Variables #============================================================================== # Some descriptive variables #name = "virtdc" #ve...
# (c) 2015, Steve Gargan <[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. # # Ans...
from os import listdir, mkdir import cPickle from imp import load_source api = load_source('api', 'modules\\api.py') from api import * class World(object): #initialize def __init__(self): super(World, self).__init__() self.world="Default" self.dimension="DIM1" self.playername="Default" self.world_blocks={}...
def main(request, response): """Handler that causes multiple redirections. The request has two mandatory and one optional query parameters: page_origin - The page origin, used for redirection and to set TAO. This is a mandatory parameter. cross_origin - The cross origin used to make this a cross-origin ...
# -*- coding: utf-8 -*- # © 2015 Antiun Ingeniería S.L. - Antonio Espinosa # © 2015 Antiun Ingeniería S.L. - Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields class ResPartnerNuts(models.Model): _name = 'res.partner.nuts' _order = "parent_lef...
#------------------------------------------------------------------------------ # Copyright (C) 2009 Richard W. Lincoln # # 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...
"""Implementation of JSONEncoder """ import re from decimal import Decimal def _import_speedups(): try: from simplejson import _speedups return _speedups.encode_basestring_ascii, _speedups.make_encoder except ImportError: return None, None c_encode_basestring_ascii, c_make_encoder = _im...
# Copyright 2016-2017 ZTE Corporation. # # 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 t...
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """ Generic dylib path manipulation """ import re __all__ = ['dylib_info'] DYLIB_RE = re.comp...
import sys sys.path.insert(0, "..") import logging from opcua import Client from opcua import uaprotocol as ua class SubHandler(object): """ Client to subscription. It will receive events from server """ def datachange_notification(self, node, val, data): print("Python: New data change even...
from bisect import bisect_left import operator import java.lang.Character # XXX - this is intended as a stopgap measure until 2.5.1, which will have a Java implementation # requires java 6 for `normalize` function # only has one version of the database # does not normalized ideographs _codepoints = {} _eaw = {} _name...
# encoding: utf-8 # Copyright 2008-2011 California Institute of Technology. ALL RIGHTS # RESERVED. U.S. Government Sponsorship acknowledged. from setuptools import setup, find_packages import os.path # Package data # ------------ _name = 'edrn.rdf' _version = '1.3.8' _description = 'EDRN RDF S...
import copy import os import logging import pickle try: import sigopt as sgo except ImportError: sgo = None from ray.tune.suggest.suggestion import SuggestionAlgorithm logger = logging.getLogger(__name__) class SigOptSearch(SuggestionAlgorithm): """A wrapper around SigOpt to provide trial suggestions. ...
""" ================================================= SVM-Anova: SVM with univariate feature selection ================================================= This example shows how to perform univariate feature before running a SVC (support vector classifier) to improve the classification scores. """ print(__doc__) import...
import unittest from coalib.bearlib.spacing.SpacingHelper import SpacingHelper from coalib.settings.Section import Section class SpacingHelperTest(unittest.TestCase): def setUp(self): self.uut = SpacingHelper() def test_needed_settings(self): self.assertEqual(list(self.uut.get_optional_sett...
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2012 Deepin, Inc. # 2012 Hailong Qiu # # Author: Hailong Qiu <[EMAIL]> # Maintainer: Hailong Qiu <[EMAIL]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
""" vis.py ====== Ctypes based module to access libbsd's strvis & strunvis functions. The `vis` function is the equivalent of strvis. The `unvis` function is the equivalent of strunvis. All functions accept unicode string as input and return a unicode string. Constants: ---------- * to select alternate encoding for...