text:
START_ATF_NAMESPACE
    namespace ATL
    {
        struct  CComFakeCriticalSection
        {
        };
    }; // end namespace ATL
END_ATF_NAMESPACE

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Limitless - Responsive Web Application Kit by Eugene Kopyov</title>

	<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900" rel="stylesheet" type="text/css">
	<link href="assets/css/icons/icomoon/styles.css" rel="stylesheet" type="text/css">
	<link href="assets/css/bootstrap.css" rel="stylesheet" type="text/css">
	<link href="assets/css/core.css" rel="stylesheet" type="text/css">
	<link href="assets/css/components.css" rel="stylesheet" type="text/css">
	<link href="assets/css/colors.css" rel="stylesheet" type="text/css">

						Git updates
						9

							Git updates

									Drop the IE specific hacks for temporal inputs

4 minutes ago

									Add full font overrides for popovers and tooltips

36 minutes ago

									Chris Arney created a new Design branch

2 hours ago

									Eugene Kopyov merged Master and Dev branches

Dec 18, 18:36

									Have Carousel ignore keyboard events

Dec 12, 05:46

				Online

							Users

								Users online

										Jordana Ansley
										Lead web developer

										Will Brason
										Marketing manager

										Hanna Walden
										Project manager

										Dori Laperriere
										Business developer

										Vanessa Aurelius
										UX expert

							Messages
							2

								Messages

										5

											James Alexander
											04:58

										who knows, maybe that would be the best thing for me...

										4

											Margo Baker
											12:16

										That was something he was unable to do because...

											Jeremy Victorino
											22:48

										But that would be extremely strained and suspicious...

											Beatrix Diaz
											Tue

										What a strenuous career it is that I've chosen...

											Richard Vango
											Mon

										Other travelling salesmen live a life of luxury...

							Victoria

 My profile

 My balance

58  Messages

 Account settings

 Logout

									Victoria Baker

										  Santa Ana, CA

Main

 Dashboard

									 Page layouts

Fixed navbar

Fixed navbar & sidebar

Fixed sidebar native scroll

Hideable navbar

Hideable & fixed sidebar

Fixed footer

Boxed with default sidebar

Boxed with mini sidebar

Boxed full width

									 Layouts

Layout 1

Layout 2 Current

Layout 3

Layout 4

Layout 5

Layout 6 Coming soon

									 Color system

Primary palette

Danger palette

Success palette

Warning palette

Info palette

Pink palette

Violet palette

Purple palette

Indigo palette

Blue palette

Teal palette

Green palette

Orange palette

Brown palette

Grey palette

Slate palette

									 Starter kit

Horizontal navigation

1 column

2 columns

											3 columns

Dual sidebars

Double sidebars

4 columns

											Detached layout

Left sidebar

Right sidebar

Sticky sidebar

Boxed layout

Fixed main navbar

Fixed secondary navbar

Both navbars fixed

Fixed layout

 Changelog 1.4

 RTL version

Forms

									 Form components

Basic inputs

Checkboxes & radios

Input groups

Extended controls

Floating labels

											Selects

Select2 selects

Bootstrap multiselect

SelectBoxIt selects

Bootstrap selects

Tag inputs

Dual Listboxes

Editable forms

Validation

Inputs grid

									 JSON forms

Basic inputs

Advanced inputs

Controls

									 Wizards

Steps wizard

Form wizard

Stepy wizard

									 Editors

Summernote editor

CKEditor

WYSIHTML5 editor

Code editor

									 Pickers

Date & time pickers

Color pickers

Location pickers

									 Form layouts

Vertical form

Horizontal form

Appearance

									 Components

Modals

Dropdown menus

Tabs component

Pills component

Accordion and navs

Buttons

PNotify notifications

Other notifications

Tooltips and popovers

Alerts

Pagination

Labels and badges

Loaders and bars

Thumbnails

Page header

Breadcrumbs

Media objects

Affix and Scrollspy

									 Content appearance

Content panels

Panel heading elements

Panel footer elements

Draggable panels

Text styling

Typography

Helper classes

Syntax highlighter

Grid system

									 Extra components

NoUI sliders

Ion range sliders

Session timeout

Idle timeout

Dynamic tree views

Context menu

Floating action buttons

									 Animations

CSS3 animations

											Velocity animations

Basic usage

UI pack effects

Advanced examples

									 Icons

Glyphicons

Icomoon

Font awesome

Layout

									 Sidebars

Default collapsible

Default hideable

Mini collapsible

Mini hideable

											Dual sidebar

Dual sidebar

Dual double collapse

Dual double hide

Swap sidebars

											Double sidebar

Collapse main sidebar

Hide main sidebar

Fix default width

Fix mini width

Opposite sidebar visible

											Detached sidebar

Left position

Right position

Sticky (custom scroll)

Sticky (native scroll)

Separate categories

Hidden sidebar

Light sidebar

Sidebar components

									 Vertical navigation

Collapsible menu

Accordion menu

Navigation sizing

Bordered navigation

Right icons

Labels and badges

Disabled navigation links

									 Horizontal navigation

Submenu on click

Submenu on hover

With custom elements

Tabbed navigation

Disabled navigation links

Horizontal mega menu

									 Navbars

Single navbar

											Multiple navbars

Navbar + navbar

Navbar + header

Header + navbar

Top + bottom

Color options

Sizing options

Hide on scroll

Navbar components

									 Menu levels

 Second level

											 Second level with child

 Third level

													 Third level with child

 Fourth level

 Fourth level

 Third level

 Second level

Data visualization

									 Echarts library

Lines and areas

Columns and waterfalls

Bars and tornados

Scatter charts

Pies and donuts

Funnels and chords

Candlesticks and others

Chart combinations

									 D3 library

Simple lines

Advanced lines

Simple bars

Advanced bars

Pie charts

Circle diagrams

Tree layout

Other charts

									 Dimple library

											Line charts

Horizontal orientation

Vertical orientation

											Bar charts

Horizontal orientation

Vertical orientation

											Area charts

Horizontal orientation

Vertical orientation

											Step charts

Horizontal orientation

Vertical orientation

Pie charts

Ring charts

Scatter charts

Bubble charts

									 C3 library

Lines and areas

Bars and pies

Advanced examples

Chart axis

Grid options

									 Google visualization

Line charts

Bar charts

Pie charts

Bubble & scatter charts

Other charts

									 Maps integration

											Google maps

Basics

Controls

Markers

Map drawings

Layers

Vector maps

Extensions

									 Extensions

Image cropper

Block UI

Drag and drop

									 JQuery UI

Interactions

Forms

Components

Sliders

Navigation

									 File uploaders

Plupload

Bootstrap file uploader

Dropzone

									 Event calendars

Basic views

Event styling

Language and time

Advanced usage

									 Internationalization

Direct translation

Querystring parameter

Set language on init

Set language after init

Language fallback

Callbacks

Tables

									 Basic tables

Basic examples

Table sizing

Table borders

Table styling

Table elements

									 Data tables

Basic initialization

Basic styling

Advanced examples

Sorting options

Using API

Data sources

									 Data tables extensions

Columns reorder

Row reorder

Fixed columns

Fixed header

Auto fill

Key table

Scroller

Select

											Buttons

Initialization

Flash buttons

Print buttons

HTML5 buttons

Columns visibility

									 Handsontable

Basic configuration

Advanced setup

Column features

Cell features

Basic cell types

Custom & checkboxes

Autocomplete & password

Search

Context menu

									 Responsive options

Responsive basic tables

Responsive data tables

Page kits

									 Task manager

Task grid

Task list

Task detailed

									 Invoicing

Invoice template

Invoice grid

Invoice archive

									 User pages

User cards

User list

Simple profile

Profile with cover

									 Login & registration

Simple login

More login info

Simple registration

More registration info

Unlock user

Reset password

Hide navbar

Transparent box

Background option

With validation

Tabbed form

Inside modals

									 Timelines

Left timeline

Right timeline

Centered timeline

									 Support

Conversation layouts

Conversation options

Knowledgebase

FAQ page

									 Search

Basic search results

User search results

Image search results

Video search results

									 Gallery

Media grid

Media with titles

Media with description

Media library

									 Error pages

Error 403

Error 404

Error 405

Error 500

Error 503

Offline page

 Navbars - Colors

								Statistics
								 Invoices
								 Schedule

 Home

Navbars

Colors

 Support

									Settings

 Account security

 Analytics

 Accessibility

 All settings

Default navbar

Default navbar is a basic Bootstrap navbar with light grey background color. Default navbar is the only navbar style that has light color scheme. By default, basic Bootstrap styling has only 2 color presets: default and inverse. To use default navbar styling, add .navbar-default class to the base .navbar class, all navbar components styles will adjusted to the light background theme automatically.

Example navbar

Active

Link

											Menu

Action

Another action

Something else here

One more line

 Link

												Settings

Action

Another action

Something else here

One more line

Example markup

<!-- Default navbar -->
<div class="navbar navbar-default">

	<!-- Navbar header -->
	<div class="navbar-header">
		<a class="navbar-brand" href="#">
			<img src="assets/images/logo_dark.png" alt="">
		</a>
	</div>
	<!-- /navbar header -->

	<!-- Left nav -->
	<ul class="nav navbar-nav">
		<li><a href="#">Link</a></li>
	</ul>
	<!-- /left nav -->

	<!-- Right nav -->
	<ul class="nav navbar-nav navbar-right">
		<li><a href="#">Link</a></li>
	</ul>
	<!-- /right nav -->

</div>
<!-- /default navbar -->

Inversed navbar

Inversed navbar is a basic Bootstrap navbar with dark blue/grey background color. Basically, inversed navbar color can be added using custom color system, so styles for .navbar-inverse is added to the template just to overwrite default Bootstrap styling for inversed navbar, which has darker color, to match general layout. Feel free to use both these methods.

Example navbar

Active

Link

											Menu

Action

Another action

Something else here

One more line

 Link

												Settings

Action

Another action

Something else here

One more line

Example markup

<!-- Inversed navbar -->
<div class="navbar navbar-inverse">

	<!-- Navbar header -->
	<div class="navbar-header">
		<a class="navbar-brand" href="#">
			<img src="assets/images/logo_light.png" alt="">
		</a>
	</div>
	<!-- /navbar header -->

	<!-- Left nav -->
	<ul class="nav navbar-nav">
		<li><a href="#">Link</a></li>
	</ul>
	<!-- /left nav -->

	<!-- Right nav -->
	<ul class="nav navbar-nav navbar-right">
		<li><a href="#">Link</a></li>
	</ul>
	<!-- /right nav -->

</div>
<!-- /inversed navbar -->

Custom colors

Add custom colors to the navbar and navbar components using custom color system. Custom color system allows you to use additional colors from palettes for navbar components or navbar in general. All components inside navbar are automatically adjust text, placeholder and background colors according to the specified color class.

Example navbar

Active

Link

											Menu

Action

Another action

Something else here

One more line

 Link

												Settings

Action

Another action

Something else here

One more line

Example markup

<!-- Colored navbar -->
<div class="navbar bg-primary">

	<!-- Navbar header -->
	<div class="navbar-header">
		<a class="navbar-brand" href="#">
			<img src="assets/images/logo_light.png" alt="">
		</a>
	</div>
	<!-- /navbar header -->

	<!-- Left nav -->
	<ul class="nav navbar-nav">
		<li><a href="#">Link</a></li>
	</ul>
	<!-- /left nav -->

	<!-- Right nav -->
	<ul class="nav navbar-nav navbar-right">
		<li><a href="#">Link</a></li>
	</ul>
	<!-- /right nav -->

</div>
<!-- /colored navbar -->

Mixing navbar colors

Color schemes in multiple navbars can be mixed: you can specify custom background colors for main and secondary navbars or make them identical. All navbars have bottom borders, so if both navbars have the same background color, they will have a visual separation. All these mixes support different sizing and components as well.

Example navbars

Active

Link

												Menu

Action

Another action

Something else here

One more line

 Link

													Settings

Action

Another action

Something else here

One more line

 Branches

 Merges 81

 Requests

													Upload files

													Share

 Dribbble

 Pinterest

 Github

 Stack Overflow

Example markup

<!-- Main navbar -->
<div class="navbar navbar-inverse bg-teal">
	<div class="navbar-header">...</div>
	<ul class="nav navbar-nav">...</ul>
	<ul class="nav navbar-nav navbar-right">...</ul>
</div>
<!-- /main navbar -->

<!-- Secondary navbar -->
<div class="navbar navbar-inverse bg-brown navbar-xs">
	<div class="navbar-header">...</div>
	<ul class="nav navbar-nav">...</ul>
	<ul class="nav navbar-nav navbar-right">...</ul>
</div>
<!-- /secondary navbar -->

						© 2015. Limitless Web App Kit by Eugene Kopyov


text:
package org.workcraft.plugins.fsm;

import java.util.ArrayList;

import org.workcraft.gui.graph.generators.DefaultNodeGenerator;
import org.workcraft.gui.graph.tools.CommentGeneratorTool;
import org.workcraft.gui.graph.tools.ConnectionTool;
import org.workcraft.gui.graph.tools.CustomToolsProvider;
import org.workcraft.gui.graph.tools.GraphEditorTool;
import org.workcraft.gui.graph.tools.NodeGeneratorTool;
import org.workcraft.gui.graph.tools.SelectionTool;
import org.workcraft.plugins.fsm.tools.FsmSimulationTool;

public class FsmToolsProvider implements CustomToolsProvider {

    @Override
    public Iterable<GraphEditorTool> getTools() {
        ArrayList<GraphEditorTool> result = new ArrayList<>();

        result.add(new SelectionTool(true, false, true, true));
        result.add(new CommentGeneratorTool());
        result.add(new ConnectionTool(false, true, true));
        result.add(new NodeGeneratorTool(new DefaultNodeGenerator(State.class)));
        result.add(new FsmSimulationTool());
        return result;
    }
}


text:
package org.ovirt.engine.api.restapi.resource;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.ovirt.engine.api.common.util.QueryHelper;
import org.ovirt.engine.api.model.Vm;
import org.ovirt.engine.api.model.Vms;
import org.ovirt.engine.api.resource.StorageDomainVmResource;
import org.ovirt.engine.api.resource.StorageDomainVmsResource;
import org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters;
import org.ovirt.engine.core.common.queries.IdQueryParameters;
import org.ovirt.engine.core.common.queries.VdcQueryType;
import org.ovirt.engine.core.compat.Guid;

public class BackendStorageDomainVmsResource
        extends AbstractBackendStorageDomainContentsResource<Vms, Vm, org.ovirt.engine.core.common.businessentities.VM>
        implements StorageDomainVmsResource {

    static final String[] SUB_COLLECTIONS = { "disks" };

    public BackendStorageDomainVmsResource(Guid storageDomainId) {
        super(storageDomainId, Vm.class, org.ovirt.engine.core.common.businessentities.VM.class, SUB_COLLECTIONS);
    }

    @Override
    public Vms list() {
        Vms vms = new Vms();
        if (QueryHelper.hasMatrixParam(getUriInfo(), UNREGISTERED_CONSTRAINT_PARAMETER)) {
            List<org.ovirt.engine.core.common.businessentities.VM> unregisteredVms =
                    getBackendCollection(VdcQueryType.GetUnregisteredVms,
                            new IdQueryParameters(storageDomainId));
            List<Vm> collection = new ArrayList<>();
            for (org.ovirt.engine.core.common.businessentities.VM entity : unregisteredVms) {
                Vm vm = map(entity);
                collection.add(addLinks(populate(vm, entity)));
            }
            vms.getVms().addAll(collection);
        } else {
            vms.getVms().addAll(getCollection());
        }
        return vms;
    }

    @Override
    protected Vm addParents(Vm vm) {
        vm.setStorageDomain(getStorageDomainModel());
        return vm;
    }

    @Override
    protected Collection<org.ovirt.engine.core.common.businessentities.VM> getEntitiesFromExportDomain() {
        GetAllFromExportDomainQueryParameters params =
            new GetAllFromExportDomainQueryParameters(getDataCenterId(storageDomainId), storageDomainId);

        return getBackendCollection(VdcQueryType.GetVmsFromExportDomain, params);
    }

    @Override
    public StorageDomainVmResource getVmResource(String id) {
        return inject(new BackendStorageDomainVmResource(this, id));
    }
}


text:
package v1alpha2

import (
	"net/url"
	"time"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/kubernetes/cmd/kubeadm/app/constants"
	kubeletscheme "k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/scheme"
	kubeletconfigv1beta1 "k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/v1beta1"
	kubeproxyscheme "k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig/scheme"
	kubeproxyconfigv1alpha1 "k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig/v1alpha1"
	utilpointer "k8s.io/kubernetes/pkg/util/pointer"
)

const (
	// DefaultServiceDNSDomain defines default cluster-internal domain name for Services and Pods
	DefaultServiceDNSDomain = "cluster.local"
	// DefaultServicesSubnet defines default service subnet range
	DefaultServicesSubnet = "10.96.0.0/12"
	// DefaultClusterDNSIP defines default DNS IP
	DefaultClusterDNSIP = "10.96.0.10"
	// DefaultKubernetesVersion defines default kubernetes version
	DefaultKubernetesVersion = "stable-1.10"
	// DefaultAPIBindPort defines default API port
	DefaultAPIBindPort = 6443
	// DefaultCertificatesDir defines default certificate directory
	DefaultCertificatesDir = "/etc/kubernetes/pki"
	// DefaultImageRepository defines default image registry
	DefaultImageRepository = "k8s.gcr.io"
	// DefaultManifestsDir defines default manifests directory
	DefaultManifestsDir = "/etc/kubernetes/manifests"
	// DefaultCRISocket defines the default cri socket
	DefaultCRISocket = "/var/run/dockershim.sock"
	// DefaultClusterName defines the default cluster name
	DefaultClusterName = "kubernetes"

	// DefaultEtcdDataDir defines default location of etcd where static pods will save data to
	DefaultEtcdDataDir = "/var/lib/etcd"
	// DefaultProxyBindAddressv4 is the default bind address when the advertise address is v4
	DefaultProxyBindAddressv4 = "0.0.0.0"
	// DefaultProxyBindAddressv6 is the default bind address when the advertise address is v6
	DefaultProxyBindAddressv6 = "::"
	// KubeproxyKubeConfigFileName defines the file name for the kube-proxy's KubeConfig file
	KubeproxyKubeConfigFileName = "/var/lib/kube-proxy/kubeconfig.conf"

	// DefaultDiscoveryTimeout specifies the default discovery timeout for kubeadm (used unless one is specified in the NodeConfiguration)
	DefaultDiscoveryTimeout = 5 * time.Minute
)

var (
	// DefaultAuditPolicyLogMaxAge is defined as a var so its address can be taken
	// It is the number of days to store audit logs
	DefaultAuditPolicyLogMaxAge = int32(2)
)

func addDefaultingFuncs(scheme *runtime.Scheme) error {
	return RegisterDefaults(scheme)
}

// SetDefaults_MasterConfiguration assigns default values to Master node
func SetDefaults_MasterConfiguration(obj *MasterConfiguration) {
	if obj.KubernetesVersion == "" {
		obj.KubernetesVersion = DefaultKubernetesVersion
	}

	if obj.API.BindPort == 0 {
		obj.API.BindPort = DefaultAPIBindPort
	}

	if obj.Networking.ServiceSubnet == "" {
		obj.Networking.ServiceSubnet = DefaultServicesSubnet
	}

	if obj.Networking.DNSDomain == "" {
		obj.Networking.DNSDomain = DefaultServiceDNSDomain
	}

	if obj.CertificatesDir == "" {
		obj.CertificatesDir = DefaultCertificatesDir
	}

	if obj.TokenTTL == nil {
		obj.TokenTTL = &metav1.Duration{
			Duration: constants.DefaultTokenDuration,
		}
	}

	if obj.CRISocket == "" {
		obj.CRISocket = DefaultCRISocket
	}

	if len(obj.TokenUsages) == 0 {
		obj.TokenUsages = constants.DefaultTokenUsages
	}

	if len(obj.TokenGroups) == 0 {
		obj.TokenGroups = constants.DefaultTokenGroups
	}

	if obj.ImageRepository == "" {
		obj.ImageRepository = DefaultImageRepository
	}

	if obj.ClusterName == "" {
		obj.ClusterName = DefaultClusterName
	}

	SetDefaults_KubeletConfiguration(obj)
	SetDefaults_Etcd(obj)
	SetDefaults_ProxyConfiguration(obj)
	SetDefaults_AuditPolicyConfiguration(obj)
}

// SetDefaults_Etcd assigns default values for the Proxy
func SetDefaults_Etcd(obj *MasterConfiguration) {
	if obj.Etcd.External == nil && obj.Etcd.Local == nil {
		obj.Etcd.Local = &LocalEtcd{}
	}
	if obj.Etcd.Local != nil {
		if obj.Etcd.Local.DataDir == "" {
			obj.Etcd.Local.DataDir = DefaultEtcdDataDir
		}
	}
}

// SetDefaults_ProxyConfiguration assigns default values for the Proxy
func SetDefaults_ProxyConfiguration(obj *MasterConfiguration) {
	if obj.KubeProxy.Config == nil {
		obj.KubeProxy.Config = &kubeproxyconfigv1alpha1.KubeProxyConfiguration{}
	}
	if obj.KubeProxy.Config.ClusterCIDR == "" && obj.Networking.PodSubnet != "" {
		obj.KubeProxy.Config.ClusterCIDR = obj.Networking.PodSubnet
	}

	if obj.KubeProxy.Config.ClientConnection.KubeConfigFile == "" {
		obj.KubeProxy.Config.ClientConnection.KubeConfigFile = KubeproxyKubeConfigFileName
	}

	kubeproxyscheme.Scheme.Default(obj.KubeProxy.Config)
}

// SetDefaults_NodeConfiguration assigns default values to a regular node
func SetDefaults_NodeConfiguration(obj *NodeConfiguration) {
	if obj.CACertPath == "" {
		obj.CACertPath = DefaultCACertPath
	}
	if len(obj.TLSBootstrapToken) == 0 {
		obj.TLSBootstrapToken = obj.Token
	}
	if len(obj.DiscoveryToken) == 0 && len(obj.DiscoveryFile) == 0 {
		obj.DiscoveryToken = obj.Token
	}
	if obj.CRISocket == "" {
		obj.CRISocket = DefaultCRISocket
	}
	// Make sure file URLs become paths
	if len(obj.DiscoveryFile) != 0 {
		u, err := url.Parse(obj.DiscoveryFile)
		if err == nil && u.Scheme == "file" {
			obj.DiscoveryFile = u.Path
		}
	}
	if obj.DiscoveryTimeout == nil {
		obj.DiscoveryTimeout = &metav1.Duration{
			Duration: DefaultDiscoveryTimeout,
		}
	}
	if obj.ClusterName == "" {
		obj.ClusterName = DefaultClusterName
	}
}

// SetDefaults_KubeletConfiguration assigns default values to kubelet
func SetDefaults_KubeletConfiguration(obj *MasterConfiguration) {
	if obj.KubeletConfiguration.BaseConfig == nil {
		obj.KubeletConfiguration.BaseConfig = &kubeletconfigv1beta1.KubeletConfiguration{}
	}
	if obj.KubeletConfiguration.BaseConfig.StaticPodPath == "" {
		obj.KubeletConfiguration.BaseConfig.StaticPodPath = DefaultManifestsDir
	}
	if obj.KubeletConfiguration.BaseConfig.ClusterDNS == nil {
		dnsIP, err := constants.GetDNSIP(obj.Networking.ServiceSubnet)
		if err != nil {
			obj.KubeletConfiguration.BaseConfig.ClusterDNS = []string{DefaultClusterDNSIP}
		} else {
			obj.KubeletConfiguration.BaseConfig.ClusterDNS = []string{dnsIP.String()}
		}
	}
	if obj.KubeletConfiguration.BaseConfig.ClusterDomain == "" {
		obj.KubeletConfiguration.BaseConfig.ClusterDomain = obj.Networking.DNSDomain
	}

	// Enforce security-related kubelet options

	// Require all clients to the kubelet API to have client certs signed by the cluster CA
	obj.KubeletConfiguration.BaseConfig.Authentication.X509.ClientCAFile = DefaultCACertPath
	obj.KubeletConfiguration.BaseConfig.Authentication.Anonymous.Enabled = utilpointer.BoolPtr(false)

	// On every client request to the kubelet API, execute a webhook (SubjectAccessReview request) to the API server
	// and ask it whether the client is authorized to access the kubelet API
	obj.KubeletConfiguration.BaseConfig.Authorization.Mode = kubeletconfigv1beta1.KubeletAuthorizationModeWebhook

	// Let clients using other authentication methods like ServiceAccount tokens also access the kubelet API
	obj.KubeletConfiguration.BaseConfig.Authentication.Webhook.Enabled = utilpointer.BoolPtr(true)

	// Disable the readonly port of the kubelet, in order to not expose unnecessary information
	obj.KubeletConfiguration.BaseConfig.ReadOnlyPort = 0

	// Enables client certificate rotation for the kubelet
	obj.KubeletConfiguration.BaseConfig.RotateCertificates = true

	// Serve a /healthz webserver on localhost:10248 that kubeadm can talk to
	obj.KubeletConfiguration.BaseConfig.HealthzBindAddress = "127.0.0.1"
	obj.KubeletConfiguration.BaseConfig.HealthzPort = utilpointer.Int32Ptr(10248)

	scheme, _, _ := kubeletscheme.NewSchemeAndCodecs()
	if scheme != nil {
		scheme.Default(obj.KubeletConfiguration.BaseConfig)
	}
}

// SetDefaults_AuditPolicyConfiguration sets default values for the AuditPolicyConfiguration
func SetDefaults_AuditPolicyConfiguration(obj *MasterConfiguration) {
	if obj.AuditPolicyConfiguration.LogDir == "" {
		obj.AuditPolicyConfiguration.LogDir = constants.StaticPodAuditPolicyLogDir
	}
	if obj.AuditPolicyConfiguration.LogMaxAge == nil {
		obj.AuditPolicyConfiguration.LogMaxAge = &DefaultAuditPolicyLogMaxAge
	}
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>my API docs</title>
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <link rel="stylesheet" href="css/main.css">
  <link rel="stylesheet" href="css/code.css">

      my API docs

Welcome

GET /api/user

GET /api/user/:username

GET /api/user/auth

POST /api/user

PUT /api/user

DELETE /api/user

Sample Requests

Click on the friendly GET buttons below to try out a few example requests!

GET /api/user (Needs Auth)

GET /api/user/:username (Needs Auth)

GET /api/user/auth (Provides Auth)

POST /api/user

Request body:{"hello":"world"}

PUT /api/user

Request body:{"hello":"world"}

DELETE /api/user

Request body:{"hello":"world"}


text:
const {compress, uncompress} = require('@napi-rs/snappy')
const {crc32c} = require('@node-rs/crc32')
const int24 = require('int24')
const stream = require('stream')

const CHUNKS = {
  streamIdentifier: 0xff,
  compressedData: 0x00,
  uncompressedData: 0x01,
  padding: 0xfe,
  unskippable: (v) => v >= 0x02 && v <= 0x7f,
}

const STREAM_IDENTIFIER = Buffer.from([
  0xff, 0x06, 0x00, 0x00, 0x73, 0x4e, 0x61, 0x50, 0x70, 0x59,
])
const MAX_FRAME_DATA_SIZE = 65536

const checksumMask = function (data) {
  const c = crc32c(data)
  const result = new Uint32Array(1)
  result[0] = ((c >>> 15) | (c * Math.pow(2, 17))) + 0xa282ead8
  return result[0]
}

class SnappyStream extends stream.Transform {
  constructor(options) {
    super(options)
    this.push(STREAM_IDENTIFIER)
  }

  // No buffering of data before producing a compressed frame. If the data size
  // exceeds the size of a frame, then it will automatically be split across
  // frames per the Snappy frame spec.
  _transform(data, encoding, callback) {
    // Split data if need be into chunks no larger than the maximum size for
    // a frame.
    const out = Buffer.from(data)

    const dataChunks = []
    for (let offset = 0; offset < out.length / MAX_FRAME_DATA_SIZE; offset++) {
      const start = offset * MAX_FRAME_DATA_SIZE
      const end = start + MAX_FRAME_DATA_SIZE
      dataChunks.push(out.slice(start, end))
    }
    return Promise.all(dataChunks.map(compress))
      .then((compressedDataChunks) => {
        const frameChunks = []
        for (let i = 0; i < dataChunks.length; i++) {
          const chunkData = dataChunks[i]
          const frameData = compressedDataChunks[i]

          const frameStart = Buffer.alloc(8)

          let headerType = CHUNKS.compressedData
          let payload = frameData

          // If the improvement isn't more than 12.5% then use uncompressed
          // data.
          if (frameData.length >= chunkData.length - chunkData.length / 8) {
            headerType = CHUNKS.uncompressedData
            payload = chunkData
          }

          frameStart.writeUInt8(headerType, 0)
          int24.writeUInt24LE(frameStart, 1, payload.length + 4)
          frameStart.writeUInt32LE(checksumMask(chunkData), 4, true)

          frameChunks.push(frameStart)
          frameChunks.push(payload)
        }

        this.push(Buffer.concat(frameChunks))
        return callback()
      })
      .catch((err) => {
        callback(err)
      })
  }
}

class UnsnappyStream extends stream.Transform {
  constructor(verifyChecksums = false, options = {}) {
    super(options)
    this.verifyChecksums = verifyChecksums
    this.identifierFound = false
    this.frameBuffer = null
  }

  // Returns snappy compressed payload. Throws an error if the checksum fails
  // provided stream is checking checksums.
  framePayload(frame) {
    const frameLength = int24.readUInt24LE(frame, 1)
    return frame.slice(8, frameLength + 4)
  }

  frameMask(frame) {
    return frame.readUInt32LE(4)
  }

  // Data contains at least one full frame.
  hasFrame(data) {
    return data.length > 4 && int24.readInt24LE(data, 1) + 4 <= data.length
  }

  // Return the buffer starting at the next frame. It assumes that a full frame
  // exists within data.
  toNextFrame(data) {
    const frameLength = int24.readUInt24LE(data, 1)
    return data.slice(4 + frameLength)
  }

  verify(mask, data) {
    if (this.verifyChecksums && checksumMask(data) !== mask) {
      return Promise.reject(new Error('Frame failed checksum'))
    }

    return Promise.resolve(data)
  }

  processChunks(chunks, done = () => {}) {
    return Promise.all(
      chunks.map((chunk) => {
        const [frameType, mask, payload] = chunk
        return (
          frameType === CHUNKS.uncompressedData
            ? Promise.resolve(payload)
            : uncompress(payload)
        ).then((uncompressedData) => this.verify(mask, uncompressedData))
      })
    )
      .then((data) => {
        this.push(Buffer.concat(data))
        done()
      })
      .catch((err) => {
        return this.emit('error', err)
      })
  }

  _transform(data, encoding, done) {
    // Tuples of frame ID and frame payload
    const chunks = []

    if (encoding) {
      data = Buffer.from(data, encoding)
    }
    if (this.frameBuffer) {
      data = Buffer.concat([this.frameBuffer, data])
    }
    this.frameBuffer = null

    if (
      !this.identifierFound &&
      data.readUInt8(0) !== CHUNKS.streamIdentifier
    ) {
      return this.emit('error', new Error('Missing snappy stream identifier'))
    }

    // Loop only while a full frame is available within data.
    while (this.hasFrame(data)) {
      const frameId = data.readUInt8(0)

      try {
        switch (frameId) {
          case CHUNKS.streamIdentifier:
            if (data.slice(0, 10).toString() !== STREAM_IDENTIFIER.toString()) {
              throw new Error('Invalid stream identifier')
            }
            this.identifierFound = true
            break
          case CHUNKS.compressedData:
            chunks.push([
              CHUNKS.compressedData,
              this.frameMask(data),
              this.framePayload(data),
            ])
            break
          case CHUNKS.uncompressedData:
            chunks.push([
              CHUNKS.uncompressedData,
              this.frameMask(data),
              this.framePayload(data),
            ])
            break
          case CHUNKS.unskippable(frameId):
            throw new Error('Encountered unskippable frame')
        }
      } catch (err) {
        return this.emit('error', err)
      }

      data = this.toNextFrame(data)
    }

    if (data.length) {
      this.frameBuffer = data
    }

    if (chunks.length) {
      return this.processChunks(chunks, done)
    } else {
      return done()
    }
  }

  _flush(done) {
    if (this.frameBuffer && this.frameBuffer.length) {
      done(new Error('Failed to decompress Snappy stream'))
    }
    done()
  }
}

module.exports = {SnappyStream, UnsnappyStream}


text: Simple app that displays the weather according to the location typed in


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 322040 $ -->
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.imagickpixeliterator" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
 <title>The <classname>ImagickPixelIterator</classname> class</title>
 <titleabbrev>ImagickPixelIterator</titleabbrev>
 <partintro>
  <section xml:id="imagickpixeliterator.synopsis">
   &reftitle.classsynopsis;
   <classsynopsis>
    <ooclass><classname>ImagickPixelIterator</classname></ooclass>
    <classsynopsisinfo>
     <ooclass><classname>ImagickPixelIterator</classname></ooclass>
    </classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.imagickpixeliterator')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
   </classsynopsis>
  </section>
 </partintro>
 &reference.imagick.entities.imagickpixeliterator;
</phpdoc:classref>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
import { Observable } from 'rxjs/Observable';

export interface CommonDataStoreInterface<T> {
    dataset: Observable<T[]>;
    getAll(): Observable<T[]>;
    get(id: number | string);
    create(item: T);
    update(item: T);
    remove(id: number | string);
}


text:
require "katar/globals"
require "katar/version"
require "thor"

module Katar
    module Commands
        class Application < Thor

            desc "version", "Show Katar version number"
            def version
                puts Katar::VERSION
            end

            desc "init", "Create a stub Katar.yaml file"
            def init
                require_command!("init_command")
            end

            desc "edit", "Edit the Katar.yaml file"
            def edit
                require_command!("edit_command")
            end

            desc "up", "Start the Katar machine"
            def up
                run_command "vagrant up"
            end

            desc "ssh", "Login to the Katar machine via SSH"
            def ssh
                run_command "vagrant ssh"
            end

            desc "suspend", "Suspend the Katar machine"
            def suspend
                run_command "vagrant suspend"
            end

            desc "resume", "Resume the suspended Katar machine"
            def resume
                run_command "vagrant resume"
            end

            desc "reload", "Reload the Katar machine image"
            def reload
                run_command "vagrant reload"
            end

            desc "destroy", "Destroy the Katar machine"
            def destroy
                run_command "vagrant destroy"
            end

            desc "status", "Get the status of the Katar machine"
            def status
                run_command "vagrant status"
            end

            desc "halt", "Halt the Katar machine"
            def halt
                run_command "vagrant halt"
            end

            desc "provision", "Re-provisions the Katar machine"
            def provision
                run_command "vagrant provision"
            end

            desc "update", "Update the Katar machine image"
            def update
                run_command "vagrant box update"
            end

        private

            def run_command(command)
                Dir.chdir(  File.join(File.dirname(__FILE__), '../../../')  ){
                    exec command
                }
            end

            def require_command!(command)
                require "katar/commands/#{command}"
            end

        end
    end
end


text:
[![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/dfch/biz.dfch.CS.Sunrise.DaaS.UI/blob/master/LICENSE)

LightSwitch HTML User interface for Sunrise DaaS framework


text:
#region License

// Copyright (c) 2014 The Sentry Team and individual contributors.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following conditions are met:
//
//     1. Redistributions of source code must retain the above copyright notice, this list of
//        conditions and the following disclaimer.
//
//     2. Redistributions in binary form must reproduce the above copyright notice, this list of
//        conditions and the following disclaimer in the documentation and/or other materials
//        provided with the distribution.
//
//     3. Neither the name of the Sentry nor the names of its contributors may be used to
//        endorse or promote products derived from this software without specific prior written
//        permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#endregion

using System;
using System.Collections.Generic;
using System.Security.Principal;
#if !NET35
using System.Threading.Tasks;
#endif
using System.Web;

using NUnit.Framework;

using SharpRaven.Data;
using SharpRaven.UnitTests.Utilities;

namespace SharpRaven.UnitTests.Data
{
    [TestFixture]
    public class JsonPacketTests
    {
        [Test]
        public void Constructor_NullEvent_ThrowsArgumentNullException()
        {
            var exception = Assert.Throws<ArgumentNullException>(() => new JsonPacket(String.Empty, (SentryEvent)null));
            Assert.That(exception.ParamName, Is.EqualTo("event"));
        }

        [Test]
        public void Constructor_NullException_ThrowsArgumentNullException()
        {
            var exception = Assert.Throws<ArgumentNullException>(() => new JsonPacket(String.Empty, (Exception)null));
            Assert.That(exception.ParamName, Is.EqualTo("exception"));
        }

        [Test]
        public void Constructor_NullProject_ThrowsArgumentNullException()
        {
            var exception = Assert.Throws<ArgumentNullException>(() => new JsonPacket(null));
            Assert.That(exception.ParamName, Is.EqualTo("project"));
        }

        [Test]
        public void Constructor_NullProjectAndEvent_ThrowsArgumentNullException()
        {
            var exception = Assert.Throws<ArgumentNullException>(() => new JsonPacket(null, (SentryEvent)null));
            Assert.That(exception.ParamName, Is.EqualTo("project"));
        }

        [Test]
        public void Constructor_NullProjectAndException_ThrowsArgumentNullException()
        {
            var exception = Assert.Throws<ArgumentNullException>(() => new JsonPacket(null, (Exception)null));
            Assert.That(exception.ParamName, Is.EqualTo("project"));
        }

        [Test]
        public void Constructor_Project_EventIDIsValidGuid()
        {
            var project = Guid.NewGuid().ToString();
            var json = new JsonPacket(project);

            Assert.That(json.EventID, Is.Not.Null.Or.Empty, "EventID");
            Assert.That(TestHelper.Parse(json.EventID), Is.Not.Null);
        }

        [Test]
        public void Constructor_Project_ModulesHasCountGreaterThanZero()
        {
            var project = Guid.NewGuid().ToString();
            var json = new JsonPacket(project);

            Assert.That(json.Modules, Has.Count.GreaterThan(0));
        }

        [Test]
        public void Constructor_Project_ProjectIsEqual()
        {
            var project = Guid.NewGuid().ToString();
            var json = new JsonPacket(project);

            Assert.That(json.Project, Is.EqualTo(project));
        }

        [Test]
        public void Constructor_Project_ServerNameEqualsMachineName()
        {
            var project = Guid.NewGuid().ToString();
            var json = new JsonPacket(project);

            Assert.That(json.ServerName, Is.EqualTo(Environment.MachineName));
        }

        [Test]
        public void Constructor_ProjectAndException_EventIDIsValidGuid()
        {
            var project = Guid.NewGuid().ToString();
            var json = new JsonPacket(project, new Exception("Error"));

            Assert.That(json.EventID, Is.Not.Null.Or.Empty, "EventID");
            Assert.That(TestHelper.Parse(json.EventID), Is.Not.Null);
        }

        [Test]
        public void Constructor_ProjectAndException_MessageEqualsExceptionMessage()
        {
            var project = Guid.NewGuid().ToString();
            Exception exception = new Exception("Error");
            var json = new JsonPacket(project, exception);

            Assert.That(json.Message, Is.EqualTo(exception.Message));
        }

        [Test]
        public void Constructor_ProjectAndException_ModulesHasCountGreaterThanZero()
        {
            var project = Guid.NewGuid().ToString();
            var json = new JsonPacket(project, new Exception("Error"));

            Assert.That(json.Modules, Has.Count.GreaterThan(0));
        }

        [Test]
        public void Constructor_ProjectAndException_ProjectIsEqual()
        {
            var project = Guid.NewGuid().ToString();
            var json = new JsonPacket(project, new Exception("Error"));

            Assert.That(json.Project, Is.EqualTo(project));
        }

        [Test]
        public void Constructor_ProjectAndException_ServerNameEqualsMachineName()
        {
            var project = Guid.NewGuid().ToString();
            var json = new JsonPacket(project, new Exception("Error"));

            Assert.That(json.ServerName, Is.EqualTo(Environment.MachineName));
        }

        [Test]
        [Category("NoMono")]
        public void Constructor_WithHttpContext_RequestCookiesContainsExpectedItem()
        {
            SimulateHttpRequest(json =>
            {
                Assert.That(json.Request.Cookies, Is.Not.Null);
                Assert.That(json.Request.Cookies, Has.Count.EqualTo(1));
                Assert.That(json.Request.Cookies, Has.Member(new KeyValuePair<string, string>("Cookie1", "Value1")));
            });
        }

        [Test]
        [Category("NoMono")]
        public void Constructor_WithHttpContext_RequestDataContainsExpectedItem()
        {
            SimulateHttpRequest(json =>
            {
                Assert.That(json.Request.Data, Is.Not.Null);
                Assert.That(json.Request.Data, Is.TypeOf<Dictionary<string, string>>());
                var data = (Dictionary<string, string>)json.Request.Data;
                Assert.That(data, Has.Count.EqualTo(1));
                Assert.That(data, Has.Member(new KeyValuePair<string, string>("Form1", "Value1")));
            });
        }

        [Test]
        [Category("NoMono")]
        public void Constructor_WithHttpContext_RequestEnvironmentIsFilledWithData()
        {
            SimulateHttpRequest(json =>
            {
                Assert.That(json.Request, Is.Not.Null);
                Assert.That(json.Request.Environment, Has.Count.GreaterThan(0));
            });
        }

        [Test]
        [Category("NoMono")]
        public void Constructor_WithHttpContext_RequestHeadersContainsExpectedItem()
        {
            SimulateHttpRequest(json =>
            {
                Assert.That(json.Request.Headers, Is.Not.Null);
                Assert.That(json.Request.Headers, Has.Count.GreaterThanOrEqualTo(1));
                Assert.That(json.Request.Headers, Has.Member(new KeyValuePair<string, string>("Header1", "Value1")));
            });
        }

        [Test]
        [Category("NoMono")]
        public void Constructor_WithHttpContext_UserIsNotNull()
        {
            SimulateHttpRequest(json =>
            {
                Assert.That(json.User, Is.Not.Null);
                Assert.That(json.User.IpAddress, Is.EqualTo("127.0.0.1"));
            });
        }

        #if !NET35
        [Test]
        [Category("NoMono")]
        public void Constructor_WithHttpContext_UserIsNotNull_Threaded()
        {
            Parallel.For(0, 100, i =>
            {
                var username = i.ToString();
                SimulateHttpRequest(json =>
                {
                    Assert.That(json.User, Is.Not.Null);
                    Assert.That(json.User.Username, Is.EqualTo(username));
                }, username);
            });
        }
        #endif

        private static readonly ISentryRequestFactory requestFactory = new SentryRequestFactory();
        private static readonly ISentryUserFactory userFactory = new SentryUserFactory();

        private static void SimulateHttpRequest(Action<JsonPacket> test, string username = null)
        {
            using (var simulator = new HttpSimulator())
            {
                simulator.SetFormVariable("Form1", "Value1")
                    .SetCookie("Cookie1", "Value1")
                    .SetHeader("Header1", "Value1")
                    .SetReferer(new Uri("http://getsentry.com/"));

                using (simulator.SimulateRequest())
                {
                    if (username != null)
                    {
                        SetUsername(username);
                    }
                    var json = new JsonPacket(Guid.NewGuid().ToString("n"));
                    json.User = userFactory.Create();
                    json.Request = requestFactory.Create();
                    test.Invoke(json);
                }
            }
        }

        private static void SetUsername(string username)
        {
            HttpContext.Current.User = new GenericPrincipal(new GenericIdentity(username), null);
        }
    }
}


text:
import { defineComponent } from 'vue';

/**
 * Slot for default layout footer content
 * @name default
 * @kind slot
 */

const componentName = 'ILayoutFooter';

export default defineComponent({
    name: componentName
});


text:
"""
Tests for the Piwik template tags and filters.
"""

from django.http import HttpRequest
from django.template import Context
from django.test.utils import override_settings

from analytical.templatetags.piwik import PiwikNode
from analytical.tests.utils import TagTestCase
from analytical.utils import AnalyticalException

@override_settings(PIWIK_DOMAIN_PATH='example.com', PIWIK_SITE_ID='345')
class PiwikTagTestCase(TagTestCase):
    """
    Tests for the ``piwik`` template tag.
    """

    def test_tag(self):
        r = self.render_tag('piwik', 'piwik')
        self.assertTrue(' ? "https" : "http") + "://example.com/";' in r, r)
        self.assertTrue("_paq.push(['setSiteId', 345]);" in r, r)
        self.assertTrue('img src="http://example.com/piwik.php?idsite=345"'
                        in r, r)

    def test_node(self):
        r = PiwikNode().render(Context({}))
        self.assertTrue(' ? "https" : "http") + "://example.com/";' in r, r)
        self.assertTrue("_paq.push(['setSiteId', 345]);" in r, r)
        self.assertTrue('img src="http://example.com/piwik.php?idsite=345"'
                        in r, r)

    @override_settings(PIWIK_DOMAIN_PATH='example.com/piwik',
                       PIWIK_SITE_ID='345')
    def test_domain_path_valid(self):
        r = self.render_tag('piwik', 'piwik')
        self.assertTrue(' ? "https" : "http") + "://example.com/piwik/";' in r,
                        r)

    @override_settings(PIWIK_DOMAIN_PATH=None)
    def test_no_domain(self):
        self.assertRaises(AnalyticalException, PiwikNode)

    @override_settings(PIWIK_SITE_ID=None)
    def test_no_siteid(self):
        self.assertRaises(AnalyticalException, PiwikNode)

    @override_settings(PIWIK_SITE_ID='x')
    def test_siteid_not_a_number(self):
        self.assertRaises(AnalyticalException, PiwikNode)

    @override_settings(PIWIK_DOMAIN_PATH='http://www.example.com')
    def test_domain_protocol_invalid(self):
        self.assertRaises(AnalyticalException, PiwikNode)

    @override_settings(PIWIK_DOMAIN_PATH='example.com/')
    def test_domain_slash_invalid(self):
        self.assertRaises(AnalyticalException, PiwikNode)

    @override_settings(ANALYTICAL_INTERNAL_IPS=['1.1.1.1'])
    def test_render_internal_ip(self):
        req = HttpRequest()
        req.META['REMOTE_ADDR'] = '1.1.1.1'
        context = Context({'request': req})
        r = PiwikNode().render(context)
        self.assertTrue(r.startswith(
            '<!-- Piwik disabled on internal IP address'), r)
        self.assertTrue(r.endswith('-->'), r)