text
stringlengths
475
200k
# (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. ...
# -*- coding: utf-8 -*- from __future__ import absolute_import import ujson from typing import Any, Dict, List from six import string_types from zerver.lib.test_helpers import tornado_redirected_to_list, get_display_recipient from zerver.lib.test_classes import ZulipTestCase from zerver.models import get_user_profile...
from fabric.api import cd, run, sudo, put from cStringIO import StringIO base_dir = '/usr/local' hostname = 'searx.me' searx_dir = base_dir + '/searx' searx_ve_dir = searx_dir + '/searx-ve' current_user = run('whoami').stdout.strip() uwsgi_file = ''' [uwsgi] # Who will run the code uid = {user} gid = {user} # Numbe...
# 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 sys import os import unittest sys.path.insert(0, os.path.abspath("..")) from cStringIO import StringIO from .. ...
""" The DBAPI driver, will use by default the same driver SQLAlchemy is using for trump. There is currently no way to change this default. It's assumed that the driver is DBAPI 2.0 compliant. Required kwargs include: - 'dbinsttype' which must be one of 'COMMAND', 'KEYCOL', 'TWOKEYCOL' - 'dsn', 'user', 'password', '...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ This tool is totally deprecated Try using: .pc.in files for .pc files the feature intltool_in - see demos/intltool make-like rules """ import shutil, re, os from waflib import TaskGen, Node, Task, Utils, Build, Errors from waflib.TaskGen i...
import struct try: Exception, Warning except ImportError: try: from exceptions import Exception, Warning except ImportError: import sys e = sys.modules['exceptions'] Exception = e.Exception Warning = e.Warning from .constants import ER import sys class MySQLEr...
#!/usr/bin/python # # (c) 2016, Aleksei Kostiuk <[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...
# Copyright 2014-2016 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agree...
import robot,os from robot import libraries #from robot import robot_imports #from robot.api import ExecutionResult #from robot.api import TestData def main(): #Push required data in builtins from optparse import OptionParser parser = OptionParser() parser.add_option("-t", "--test", dest="testlist...
import sys from unicode_parse_common import * # http://www.unicode.org/Public/5.1.0/ucd/extracted/DerivedGeneralCategory.txt category_to_harfbuzz = { 'Mn': 'HB_Mark_NonSpacing', 'Mc': 'HB_Mark_SpacingCombining', 'Me': 'HB_Mark_Enclosing', 'Nd': 'HB_Number_DecimalDigit', 'Nl': 'HB_Number_Letter', 'No': 'H...
import os import subprocess import common def get_drclient_command(client_args,exec_args): dr32 = os.environ.get('DYNAMORIO_32_RELEASE_HOME') dr_path = dr32 + '/bin32/drrun.exe' command = dr_path + ' -root ' + dr32 + ' -syntax_intel -c exalgo.dll ' + client_args + ' -- ' + exec_args re...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Boyd Adamson <boyd () boydadamson.com> # # 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 th...
# Copyright 2014 Openstack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# Copyright 2014 Rustici Software # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse from xml.dom import minidom from django.test import TestCase from django.template import Template, Context from django.conf import settings from django.utils.unittest import skipIf from billing import get_integration @s...
# -*- coding: utf-8 -*- # Authors: Denis A. Engemann <[EMAIL]> # Eric Larson <[EMAIL]> # License: Simplified BSD import numpy as np from scipy.sparse import csc_matrix import warnings from .open import read_tag from .tree import dir_tree_find from .write import (start_block, end_block, write_int, write_float...
# Copyright (c) 2017. Mount Sinai School of Medicine # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
import argparse from director.consoleapp import ConsoleApp from director import cameraview from director import vtkAll as vtk import PythonQt from PythonQt import QtCore, QtGui, QtUiTools def addWidgetsToDict(widgets, d): for widget in widgets: if widget.objectName: d[str(widget.objectName)] =...
""" Unit tests for gating.signals module """ from mock import patch from ddt import ddt, data, unpack from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from courseware.tests.helpers import LoginEnrollmentTestCase from miles...
# The default ``config.py`` # flake8: noqa def set_prefs(prefs): """This function is called before opening the project""" # Specify which files and folders to ignore in the project. # Changes to ignored resources are not added to the history and # VCSs. Also they are not returned in `Project.get_fil...
# Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in t...
import string, Utils # list of directory options to offer in configure dir_options = { 'with-cachedir' : [ '${PREFIX}/var/locks', 'where to put temporary cache files' ], 'with-codepagedir' : [ '${PREFIX}/lib/samba', 'where to put codepages' ], 'with-configdir' ...
"""Base classes for server/gateway implementations""" from types import StringType from util import FileWrapper, guess_scheme, is_hop_by_hop from headers import Headers import sys, os, time __all__ = ['BaseHandler', 'SimpleHandler', 'BaseCGIHandler', 'CGIHandler'] try: dict except NameError: def dict(items)...
# -*- 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...
""" Tests for the InstructorService """ import json from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory from courseware.models import StudentModule from lms.djangoapps.instructor.access import allow_access from lms.djangoapps.instru...
# -*- 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...
"""This implements a virtual screen. This is used to support ANSI terminal emulation. The screen representation and state is implemented in this class. Most of the methods are inspired by ANSI screen control codes. The ANSI class extends this class to add parsing of ANSI escape codes. PEXPECT LICENSE This license...
# Zed Attack Proxy (ZAP) and its related class files. # # ZAP is an HTTP/HTTPS proxy for assessing web application security. # # Copyright 2012 ZAP Development Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ob...
#!/usr/bin/env python #coding:utf-8 # Author : tuxpy # Email : [EMAIL] # Last modified : 2015-06-09 15:20:13 # Filename : test.py # Description : from gale.web import app_run, router, RequestHandler class BaseHandler(RequestHandler): def get_current_user(self): return self.session.ge...
# 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...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models, fields class WebsiteConfigSettings(models.TransientModel): _inherit = 'website.config.settings' def _default_order_mail_template(self): if self.env['ir.module.module'].sea...
#!/usr/bin/python # Copyright 2017 Google Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import yaml, canonical def test_canonical_scanner(canonical_filename, verbose=False): data = open(canonical_filename, 'rb').read() tokens = list(yaml.canonical_scan(data)) assert tokens, tokens if verbose: for token in tokens: print token test_canonical_scanner.unittest = ['.canon...
import os import shutil from .. import constants, logger from . import _json def copy_registered_textures(dest, registration): """Copy the registered textures to the destination (root) path :param dest: destination directory :param registration: registered textures :type dest: str :type registrat...
#!/usr/bin/env python # # Copyright 2006,2010,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 ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('mediaplayer', '0001_initial'), ] ...
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import re import MySQLdb import frappe from frappe import _ from frappe.utils import now, cint from frappe.model import no_value_fields from frappe.model.document import Documen...
# (c) 2016 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, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
from array import array import reprlib import math import numbers import functools import operator import itertools class Vector: typecode = 'd' def __init__(self, components): self._components = array(self.typecode, components) def __iter__(self): return iter(self._components) ...
# Eve W-Space # Copyright 2014 Andrew Austin and contributors # # 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 requi...
# -*- coding: utf-8 -*- """ pygments.formatters.latex ~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for LaTeX fancyvrb output. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division from pygments.formatter import Forma...
# -*- coding: utf-8 -*- # Image Occlusion Enhanced Add-on for Anki # # Copyright (C) 2016-2020 Aristotelis P. <https://glutanimate.com/> # Copyright (C) 2012-2015 Tiago Barroso <[EMAIL]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
# Copyright 2012 NEC 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 ag...
#!./env/bin/python """ FTP Scanner/Brute Forcer Use this to either scan a host for anonymous FTP logins or to try a password list against a host. Don't be a moron, please don't use this for something illegal. Usage: ftp.py brute [-v] <host> <user> <password_file> ftp.py anon [-v] <ho...
""" Function descriptors. """ from __future__ import print_function, division, absolute_import from collections import defaultdict import itertools import sys from types import ModuleType from . import six, types def transform_arg_name(arg): if isinstance(arg, types.Record): return "Record_%s" % arg._co...
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, publ...
data = ( 'Hu ', # 0x00 'Qi ', # 0x01 'He ', # 0x02 'Cui ', # 0x03 'Tao ', # 0x04 'Chun ', # 0x05 'Bei ', # 0x06 'Chang ', # 0x07 'Huan ', # 0x08 'Fei ', # 0x09 'Lai ', # 0x0a 'Qi ', # 0x0b 'Meng ', # 0x0c 'Ping ', # 0x0d 'Wei ', # 0x0e 'Dan ', # 0x0f 'Sha ', # 0x10 'Hu...
""" Support for SleepIQ from SleepNumber. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sleepiq/ """ import logging from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.helper...
from __future__ import absolute_import from django.contrib import admin from django.core.paginator import Paginator from .models import (Event, Child, Parent, Genre, Band, Musician, Group, Quartet, Membership, ChordsMusician, ChordsBand, Invitation, Swallow) site = admin.AdminSite(name="admin") class CustomPag...
# -*- coding: utf-8 -*- """Test for a helper function for PanelHAC robust covariance the functions should be rewritten to make it more efficient Created on Thu May 17 21:09:41 2012 Author: Josef Perktold """ import numpy as np from numpy.testing import assert_equal, assert_raises import statsmodels.stats.sandwich_co...
""" WSGI config for mcwww project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` se...
#!/usr/bin/env python ''' Ansible module for zabbix graphprototypes ''' # vim: expandtab:tabstop=4:shiftwidth=4 # # Zabbix graphprototypes ansible module # # # Copyright 2015 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with t...
# # 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 ...
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) r'''>>> import pickle1_ext >>> import pickle >>> pickle1_ext.world.__module__ 'pickle1_ext' >>> pickle1_ext.world.__safe...
#!/usr/bin/env python # Copyright 2011 Google Inc. All Rights Reserved. """Test the grr aff4 objects.""" import time from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib import test_lib from grr.lib import utils from grr.lib.rdfvalues import client as rdf_client from grr.lib.rdf...
# -*- coding:utf-8 -*- # # # Copyright (C) 2013 Michael Telahun Makonnen <[EMAIL]> # # 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 Foundation, either version 3 of the License, or # (...
"""Utilities to support packages.""" # NOTE: This module must remain compatible with Python 2.3, as it is shared # by setuptools for distribution with Python 2.3 and up. import os import sys import imp import os.path from types import ModuleType __all__ = [ 'get_importer', 'iter_importers', 'get_loader', 'find_l...
""" We have a few different kind of Matrices Matrix, ImmutableMatrix, MatrixExpr Here we test the extent to which they cooperate """ from sympy import symbols from sympy.matrices import (Matrix, MatrixSymbol, eye, Identity, ImmutableMatrix) from sympy.core.compatibility import range from sympy.matrices.expres...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def _get_FIELD_display(self, field): value = getattr(self, field.attname) return force_unicode(dict(field.flatchoices).get(value, value), string...
#!/usr/bin/env python from Hidden_Sec_Utilities import * from Hidden_Sec_Physics import * import itertools """ I use kappa and epsilon interchangeably. They mean the same thing. Many of these limits are not valid in the off-shell regime, or change dramatically. Use at your own risk! """ #Default value of alpha_p to...
#!/usr/bin/env python # Copyright (c) 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 argparse import glob import os import sys if sys.version_info < (2, 7, 0): sys.stderr.write("python 2.7 or later is requi...
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging from ...
#!/usr/bin/python # -*- coding: iso-8859-1 -*- # Howto, Code license, Credits, etc: http://code.google.com/B/BCI-Project-Triathlon/ noGL = False # Set noGL to True for disabling the use of OpenGL (to gain speed, or to avoid python-wx-opengl problems) import pyfann from pyfann import libfann import string import o...
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """PEP 376 implementation.""" from __future__ import unicode_literals import base64 import codecs import hashlib import logging import os import sys import zipimport from . import DistlibExce...
# -*- 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 = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of t...
# Python test set -- part 7, bound and unbound methods from test_support import * print 'Bound and unbound methods (test_methods.py)' class A: def one(self): return 'one' class B(A): def two(self): return 'two' class C(A): def one(self): return 'another one' a = A() b = B() c = C() print 'unbound met...
# (C) British Crown Copyright 2014 - 2015, 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...
############################################################################## # # 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 ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Bruce Pennypacker <[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_METADATA = {'metadata_version': '1.1', ...
# -*- coding: utf-8 -*- # # Copyright (C) 2015 GNS3 Technologies Inc. # # 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. ...
# -*- coding: utf-8 -*- """ *************************************************************************** Project Provider tests --------------------- Date : July 2018 Copyright : (C) 2018 by Nyall Dawson Email : nyall dot dawson at gmail dot com ************...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.runtime}. """ from __future__ import division, absolute_import import sys from twisted.trial.util import suppress as SUPRESS from twisted.trial.unittest import SynchronousTestCase from twisted.python.runtime impo...
# YouTube Video: https://www.youtube.com/watch?v=op42w-5o3nE class Node: def __init__(self, data): self.data = data self.next = None class CircularLinkedList: def __init__(self): self.head = None def prepend(self, data): new_node = Node(data) cur = self.head ...
import functools import collections def instantiate(cls): return cls() class Namespace(object): def registry(name, bases, dict_): cls = type(name, bases, dict_) cls.__dict = {} return cls __metaclass__ = registry def __init__(self, instance=None): self.__dict__ = self.__dict...
import logging from django import http from django.conf import settings from common import api from common import clean from common.models import ExternalProfile from common import memcache from common import twitter from common import user from common import util def get_nick_from_email(email): nick = util.displa...
#!/usr/bin/env python # # EasyInstall setup script for digest # # $Id$ # --------------------------------------------------------------------------- import sys import os sys.path += [os.getcwd()] from setuptools import setup, find_packages import re import imp PKG = 'digest' DESCRIPTION = 'Calculate message digests ...
from django.contrib.auth.models import ( AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission, PermissionsMixin, UserManager, ) from django.db import models # The custom user uses email as the unique identifier, and requires # that every user provide a date of birth. This lets us test # changes ...
import os import getopt import tempfile from viper.common.out import * from viper.common.objects import File from viper.common.colors import bold, cyan, white from viper.common.network import download from viper.core.session import __session__ from viper.core.plugins import __modules__ from viper.core.database import ...
#!/usr/bin/env python """ * FCKeditor - The text editor for Internet - http://www.fckeditor.net * Copyright (C) 2003-2008 Frederico Caldeira Knabben * * == BEGIN LICENSE == * * Licensed under the terms of any of the following licenses at your * choice: * * - GNU General Public License Version 2 or l...
# ---------------------------------------------------------------------- # 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 apply: # # This progra...
from __future__ import absolute_import import weakref from defcon.objects.base import BaseDictObject from defcon.objects.color import Color _defaultTransformation = { "xScale" : 1, "xyScale" : 0, "yxScale" : 0, "yScale" : 1, "xOffset" : 0, "yOffset" : 0 } class Image(BaseDictObject): "...
# # (c) 2015, Peter Sprygada <[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. # #...
""" =================================================================== Multi-output Decision Tree Regression =================================================================== An example to illustrate multi-output regression with decision tree. The :ref:`decision trees <tree>` is used to predict simultaneously the ...
"""This module tests SyntaxErrors. Here's an example of the sort of thing that is tested. >>> def f(x): ... global x Traceback (most recent call last): SyntaxError: name 'x' is parameter and global The tests are all raise SyntaxErrors. They were created by checking each C call that raises SyntaxError. There ar...
# This code was mostly based on ipaddr-py # Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/ # Licensed under the Apache License, Version 2.0 (the "License"). from django.core.exceptions import ValidationError from django.utils.six.moves import range from django.utils.translation import ugettext_lazy as _...
# Copyright (C) 2012 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 f...
from social.exceptions import NotAllowedToDisconnect def allowed_to_disconnect(strategy, user, name, user_storage, association_id=None, *args, **kwargs): if not user_storage.allowed_to_disconnect(user, name, association_id): raise NotAllowedToDisconnect() def get_entries(strate...
#!/usr/bin/env python3 # # Copyright 2013 Simone Campagna # # 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 ...
""" This is the default template for our main set of AWS servers. Before importing this settings file the following MUST be defined in the environment: * SERVICE_VARIANT - can be either "lms" or "cms" * CONFIG_ROOT - the directory where the application yaml config files are located """ #...
import os from unittest import mock from conftest import ( create_plugin_config, create_project_config, dir_contents ) from datakit.utils import read_json from datakit_data import Init def test_project_buildout(caplog, fake_project, monkeypatch, tmpdir): """ Init should auto-generate directories...
# -*- coding: utf-8 -*- """ The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These are supervised learning methods based on applying Bayes' theorem with strong (naive) feature independence assumptions. """ # Author: Vincent Michel <[EMAIL]> # Minor fixes by Fabian Pedregosa # A...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 The Kubeflow 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/licens...
# -*- coding: utf-8 -*- from Screen import Screen from Components.BlinkingPixmap import BlinkingPixmapConditional from Components.Pixmap import Pixmap from Components.config import config, ConfigInteger from Components.Sources.Boolean import Boolean from Components.Label import Label from Components.ProgressBar import ...
#!/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...
#!/usr/bin/env python # Copyright (C) 2013-2014 Jean-Francois Romang ([EMAIL]) # Shivkumar Shivaji () # # 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...