text:
package org.apache.ignite.cache.affinity;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.Callable;

/**
 * Optional annotation to specify custom key-to-node affinity. Affinity key is a key
 * which will be used to determine a node on which given cache key will be stored. This
 * annotation allows to mark a field in the cache key object that will be
 * used as an affinity key (instead of the entire cache key object that is used for
 * affinity by default). Note that a class can have only one field annotated
 * with {@code @AffinityKeyMapped} annotation.
 *

 * One of the major use cases for this annotation is the routing of grid computations
 * to the nodes where the data for this computation is cached, the concept
 * otherwise known as {@code Collocation Of Computations And Data}.
 *

 *
Mapping Cache Keys

 * The default implementation of {@link AffinityKeyMapper}, which will be used
 * if no explicit affinity mapper is specified in cache configuration, will first look
 * for any field annotated with {@code @AffinityKeyMapped} annotation.
 * If such field is not found, then the cache key itself will be used for
 * key-to-node affinity (this means that all objects with the same cache key will always
 * be routed to the same node). If such field is found, then the value of this
 * field will be used for key-to-node affinity. This allows to specify alternate
 * affinity key, other than the cache key itself, whenever needed.
 *

 * For example, if a {@code Person} object is always accessed together with a {@code Company} object
 * for which this person is an employee, then for better performance and scalability it makes sense to
 * collocate {@code Person} objects together with their {@code Company} object when storing them in
 * cache. To achieve that, cache key used to cache {@code Person} objects should have a field or method
 * annotated with {@code @AffinityKeyMapped} annotation, which will provide the value of
 * the company key for which that person works, like so:
 *

 * public class PersonKey {
 *     // Person ID used to identify a person.
 *     private String personId;
 *
 *     // Company ID which will be used for affinity.
 *     @AffinityKeyMapped
 *     private String companyId;
 *     ...
 * }
 * ...
 * // Instantiate person keys.
 * Object personKey1 = new PersonKey("myPersonId1", "myCompanyId");
 * Object personKey2 = new PersonKey("myPersonId2", "myCompanyId");
 *
 * // Both, the company and the person objects will be cached on the same node.
 * cache.put("myCompanyId", new Company(..));
 * cache.put(personKey1, new Person(..));
 * cache.put(personKey2, new Person(..));
 *

 *

 *
AffinityKey

 * For convenience, you can also optionally use {@link AffinityKey} class. Here is how a
 * {@code PersonKey} defined above would look using {@link AffinityKey}:
 *

 * Object personKey1 = new AffinityKey("myPersonId1", "myCompanyId");
 * Object personKey2 = new AffinityKey("myPersonId2", "myCompanyId");
 *
 * // Both, the company and the person objects will be cached on the same node.
 * cache.put(myCompanyId, new Company(..));
 * cache.put(personKey1, new Person(..));
 * cache.put(personKey2, new Person(..));
 *

 *

 *
Collocating Computations And Data

 * It is also possible to route computations to the nodes where the data is cached. This concept
 * is otherwise known as {@code Collocation Of Computations And Data}. In this case,
 * {@code @AffinityKeyMapped} annotation allows to specify a routing affinity key for a
 * {@link org.apache.ignite.compute.ComputeJob} or any other grid computation, such as {@link Runnable},
 * {@link Callable}, or {@link org.apache.ignite.lang.IgniteClosure}. It should be attached to a field
 * that provides affinity key for the computation. Only one annotation per class is allowed.
 * Whenever such annotation is detected, then {@link org.apache.ignite.spi.loadbalancing.LoadBalancingSpi}
 * will be bypassed, and computation will be routed to the grid node where the specified affinity key is cached.
 *

 * For more information about cache affinity also see {@link AffinityKeyMapper} and
 * {@link AffinityFunction} documentation.
 * Affinity for a key can be found from any node, regardless of whether it has cache started
 * or not. If cache is not started, affinity function will be fetched from the remote node
 * which does have the cache running.
 *
 * @see AffinityFunction
 * @see AffinityKeyMapper
 * @see AffinityKey
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface AffinityKeyMapped {
    // No-op.
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  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 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 the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>

    <property>
        <name>instance.zookeeper.host</name>
        <value>HOSTNAME:2181</value>
        <description>comma separated list of zookeeper servers</description>
    </property>

    <property>
        <name>logger.dir.walog</name>
        <value>/var/lib/accumulo/walogs</value>
        <description>The directory used to store write-ahead logs on the
            local filesystem. It is possible to specify a comma-separated list
            of directories.
        </description>
    </property>

    <property>
        <name>instance.secret</name>
        <value>secret</value>
    </property>

    <!-- PLACEHOLDER - do not edit -->

    <property>
        <name>trace.token.property.password</name>
        <!-- change this to the root user's password, and/or change the user below -->
        <value>secret</value>
    </property>

    <!-- profile 3GB -->
    <property>
        <name>tserver.cache.index.size</name>
        <value>128M</value>
    </property>

    <property>
        <name>tserver.memory.maps.max</name>
        <value>1G</value>
    </property>

    <property>
        <name>tserver.cache.data.size</name>
        <value>128M</value>
    </property>

    <property>
        <name>crypto.cipher.algorithm.name</name>
        <value>AES</value>
    </property>
    <property>
        <name>table.cache.block.enable</name>
        <value>true</value>
    </property>
    <property>
        <name>crypto.module.class</name>
        <value>org.apache.accumulo.core.security.crypto.DefaultCryptoModule</value>
    </property>
    <property>
        <name>crypto.cipher.suite</name>
        <value>AES/CFB/NoPadding</value>
    </property>
    <property>
        <name>trace.user</name>
        <value>root</value>
    </property>
    <!--    <property>
        <name>instance.security.permissionHandler</name>
        <value>com.sqrrl.analytics.extensions.accumulo.security.ShiroAndZookeeperPermissionHandler</value>
    </property>
    <property>
        <name>crypto.secret.key.encryption.strategy.class</name>
        <value>org.apache.accumulo.core.security.crypto.CachingHDFSSecretKeyEncryptionStrategy</value>
    </property>
    <property>
        <name>instance.security.authorizor</name>
        <value>com.sqrrl.analytics.extensions.accumulo.security.ShiroAndZookeeperAuthorizor</value>
    </property>
    <property>
        <name>instance.security.authenticator</name>
        <value>com.sqrrl.analytics.extensions.accumulo.security.ShiroAndZookeeperAuthenticator</value>
    </property> -->
    <property>
        <name>table.cache.index.enable</name>
        <value>true</value>
    </property>
    <property>
        <name>crypto.secure.rng.provider</name>
        <value>SUN</value>
    </property>
    <property>
        <name>crypto.cipher.key.length</name>
        <value>128</value>
    </property>
    <property>
        <name>crypto.secure.rng</name>
        <value>SHA1PRNG</value>
    </property>
    <property>
        <name>crypto.default.key.strategy.cipher.suite</name>
        <value>AES/ECB/NoPadding</value>
    </property>

    <property>
        <name>general.classpaths</name>
        <value>
            $HADOOP_CONF_DIR,
            $ACCUMULO_HOME/server/target/classes/,
            $ACCUMULO_HOME/lib/accumulo-server.jar,
            $ACCUMULO_HOME/core/target/classes/,
            $ACCUMULO_HOME/lib/accumulo-core.jar,
            $ACCUMULO_HOME/start/target/classes/,
            $ACCUMULO_HOME/lib/accumulo-start.jar,
            $ACCUMULO_HOME/fate/target/classes/,
            $ACCUMULO_HOME/lib/accumulo-fate.jar,
            $ACCUMULO_HOME/proxy/target/classes/,
            $ACCUMULO_HOME/lib/accumulo-proxy.jar,
            $ACCUMULO_HOME/lib/[^.].*.jar,
            $ZOOKEEPER_HOME/zookeeper[^.].*.jar,
            <!-- adding classpath for (hdp-2.2.0) -->
            $HADOOP_PREFIX/share/hadoop/common/.*.jar,
            $HADOOP_PREFIX/share/hadoop/common/lib/.*.jar,
            $HADOOP_PREFIX/share/hadoop/hdfs/.*.jar,
            $HADOOP_PREFIX/share/hadoop/mapreduce/.*.jar,
            $HADOOP_PREFIX/share/hadoop/yarn/.*.jar,
            $HADOOP_PREFIX/share/hadoop/hdfs/lib/.*.jar,
            $HADOOP_PREFIX/share/hadoop/mapreduce/lib/.*.jar,
            $HADOOP_PREFIX/share/hadoop/yarn/lib/.*.jar
            <!--  -->
            /usr/local/hadoop/[^.].*.jar,
            /usr/local/hadoop/lib/[^.].*.jar,
            /usr/local/hadoop-hdfs/[^.].*.jar,
            /usr/local/hadoop-hdfs/lib/[^.].*.jar,
            /usr/local/hadoop-yarn/[^.].*.jar,
            /usr/local/hadoop-yarn/lib/[^.].*.jar,
            /usr/local/hadoop-mapreduce/[^.].*.jar,
            /usr/local/hadoop-mapreduce/lib/*.jar
        </value>
    </property>
</configuration>

redpajama_set_name: RedPajamaGithub


text: export { default } from 'ember-dxi/services/dxi';


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function dostuff() {
    console.log("doing stuff");
}
exports.default = dostuff;


text:
module OmertaLogger
  class CasinoProfitHistory < ApplicationRecord
    belongs_to :casino
  end
end


text:
package de.mycrobase.ssim.ed.util;

import java.io.IOException;
import java.util.Properties;

import com.jme3.asset.AssetInfo;
import com.jme3.asset.AssetLoader;

public class PropertiesLoader implements AssetLoader {

    @Override
    public Object load(AssetInfo assetInfo) throws IOException {
        Properties properties = new Properties();
        properties.load(assetInfo.openStream());
        return properties;
    }
}


text:
layout: post
title: "Is Google an Evil Corporation?"
category: "Blog"
---
{% include JB/setup %}

Google's moto is 'Do no Evil'. I was reading an [article](http://www.sfgate.com/cgi-bin/article.cgi?file=/n/a/2005/08/08/financial/f134424D42.DTL&type=printable) today in the San Francisco Gate about how Google employee's are banned from talking to News.com reporters for a year.

I am not a big fan of the term 'Evil Corporation', but I think that Google does some things that can be considered unethical. The News.com piece showed how you can look up personal information using Google. For the example in the article, they used Google's CEO. I guess he did not like his just desert.

As you have propably noticed I run Google ads on my web site. Just so people do not think I am trying to bite the hand that feeds me, Google does a lot of things I like. I use their Search engine everyday. I also use some of their APIs as well. On that note, I think Eric E. Schmidt is great guy!


text:
SAFE_METHODS = ('GET', 'HEAD', 'OPTIONS')

class BasePermission(object):
    """
    A base class from which all permission classes should inherit.
    """

    def has_permission(self, request, view):
        """
        Return `True` if permission is granted, `False` otherwise.
        """
        return True

    def has_object_permission(self, request, view, obj):
        """
        Return `True` if permission is granted, `False` otherwise.
        """
        return True

# class permission

class IsAuthenticated(BasePermission):
    """
    Allows access only to authenticated users.
    """

    def has_permission(self, request, view):
        return True if request.user else False

# object permission
class IsOwner(BasePermission):
    """
    Allow access only object owner.
    """

    def has_object_permission(self, request, view, obj):
        if not request or not request.user or not obj:
            return False
        owner_id = 0
        if hasattr(obj, 'user_id'):
            owner_id = getattr(obj, 'user_id')
        elif hasattr(obj, 'creator_id'):
            owner_id = getattr(obj, 'creator_id')
        elif hasattr(obj, 'author_id'):
            owner_id = getattr(obj, 'author_id')
        return str(owner_id) == str(request.user.id)


text:
package zmaster587.advancedRocketry.integration.jei.rollingMachine;

import mezz.jei.api.IJeiHelpers;
import zmaster587.libVulpes.interfaces.IRecipe;
import zmaster587.libVulpes.recipe.RecipesMachine;

import java.util.LinkedList;
import java.util.List;

public class RollingMachineRecipeMaker {

	public static List<RollingMachineWrapper> getMachineRecipes(IJeiHelpers helpers, Class clazz) {

		List<RollingMachineWrapper> list = new LinkedList<RollingMachineWrapper>();
		for(IRecipe rec : RecipesMachine.getInstance().getRecipes(clazz)) {
			list.add(new RollingMachineWrapper(rec));
		}
		return list;
	}

}


text:
import mock
from mock import call

from osc_lib.cli import format_columns
from osc_lib import exceptions

from openstackclient.network.v2 import network_agent
from openstackclient.tests.unit.network.v2 import fakes as network_fakes
from openstackclient.tests.unit import utils as tests_utils

class TestNetworkAgent(network_fakes.TestNetworkV2):

    def setUp(self):
        super(TestNetworkAgent, self).setUp()

        # Get a shortcut to the network client
        self.network = self.app.client_manager.network

class TestAddNetworkToAgent(TestNetworkAgent):

    net = network_fakes.FakeNetwork.create_one_network()
    agent = network_fakes.FakeNetworkAgent.create_one_network_agent()

    def setUp(self):
        super(TestAddNetworkToAgent, self).setUp()

        self.network.get_agent = mock.Mock(return_value=self.agent)
        self.network.find_network = mock.Mock(return_value=self.net)
        self.network.name = self.network.find_network.name
        self.network.add_dhcp_agent_to_network = mock.Mock()
        self.cmd = network_agent.AddNetworkToAgent(
            self.app, self.namespace)

    def test_show_no_options(self):
        arglist = []
        verifylist = []

        # Missing required args should bail here
        self.assertRaises(tests_utils.ParserException, self.check_parser,
                          self.cmd, arglist, verifylist)

    def test_add_network_to_dhcp_agent(self):
        arglist = [
            '--dhcp',
            self.agent.id,
            self.net.id
        ]
        verifylist = [
            ('dhcp', True),
            ('agent_id', self.agent.id),
            ('network', self.net.id),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        self.cmd.take_action(parsed_args)

        self.network.add_dhcp_agent_to_network.assert_called_once_with(
            self.agent, self.net)

class TestAddRouterAgent(TestNetworkAgent):

    _router = network_fakes.FakeRouter.create_one_router()
    _agent = network_fakes.FakeNetworkAgent.create_one_network_agent()

    def setUp(self):
        super(TestAddRouterAgent, self).setUp()
        self.network.add_router_to_agent = mock.Mock()
        self.cmd = network_agent.AddRouterToAgent(self.app, self.namespace)
        self.network.get_agent = mock.Mock(return_value=self._agent)
        self.network.find_router = mock.Mock(return_value=self._router)

    def test_add_no_options(self):
        arglist = []
        verifylist = []

        # Missing agent ID will cause command to bail
        self.assertRaises(tests_utils.ParserException, self.check_parser,
                          self.cmd, arglist, verifylist)

    def test_add_router_required_options(self):
        arglist = [
            self._agent.id,
            self._router.id,
            '--l3',
        ]
        verifylist = [
            ('l3', True),
            ('agent_id', self._agent.id),
            ('router', self._router.id),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        result = self.cmd.take_action(parsed_args)

        self.network.add_router_to_agent.assert_called_with(
            self._agent, self._router)
        self.assertIsNone(result)

class TestDeleteNetworkAgent(TestNetworkAgent):

    network_agents = (
        network_fakes.FakeNetworkAgent.create_network_agents(count=2))

    def setUp(self):
        super(TestDeleteNetworkAgent, self).setUp()
        self.network.delete_agent = mock.Mock(return_value=None)

        # Get the command object to test
        self.cmd = network_agent.DeleteNetworkAgent(self.app, self.namespace)

    def test_network_agent_delete(self):
        arglist = [
            self.network_agents[0].id,
        ]
        verifylist = [
            ('network_agent', [self.network_agents[0].id]),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        result = self.cmd.take_action(parsed_args)
        self.network.delete_agent.assert_called_once_with(
            self.network_agents[0].id, ignore_missing=False)
        self.assertIsNone(result)

    def test_multi_network_agents_delete(self):
        arglist = []

        for n in self.network_agents:
            arglist.append(n.id)
        verifylist = [
            ('network_agent', arglist),
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        result = self.cmd.take_action(parsed_args)

        calls = []
        for n in self.network_agents:
            calls.append(call(n.id, ignore_missing=False))
        self.network.delete_agent.assert_has_calls(calls)
        self.assertIsNone(result)

    def test_multi_network_agents_delete_with_exception(self):
        arglist = [
            self.network_agents[0].id,
            'unexist_network_agent',
        ]
        verifylist = [
            ('network_agent',
             [self.network_agents[0].id, 'unexist_network_agent']),
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        delete_mock_result = [True, exceptions.CommandError]
        self.network.delete_agent = (
            mock.Mock(side_effect=delete_mock_result)
        )

        try:
            self.cmd.take_action(parsed_args)
            self.fail('CommandError should be raised.')
        except exceptions.CommandError as e:
            self.assertEqual('1 of 2 network agents failed to delete.', str(e))

        self.network.delete_agent.assert_any_call(
            self.network_agents[0].id, ignore_missing=False)
        self.network.delete_agent.assert_any_call(
            'unexist_network_agent', ignore_missing=False)

class TestListNetworkAgent(TestNetworkAgent):

    network_agents = (
        network_fakes.FakeNetworkAgent.create_network_agents(count=3))

    columns = (
        'ID',
        'Agent Type',
        'Host',
        'Availability Zone',
        'Alive',
        'State',
        'Binary'
    )
    data = []
    for agent in network_agents:
        data.append((
            agent.id,
            agent.agent_type,
            agent.host,
            agent.availability_zone,
            network_agent.AliveColumn(agent.alive),
            network_agent.AdminStateColumn(agent.admin_state_up),
            agent.binary,
        ))

    def setUp(self):
        super(TestListNetworkAgent, self).setUp()
        self.network.agents = mock.Mock(
            return_value=self.network_agents)

        _testagent = \
            network_fakes.FakeNetworkAgent.create_one_network_agent()
        self.network.get_agent = mock.Mock(return_value=_testagent)

        self._testnetwork = network_fakes.FakeNetwork.create_one_network()
        self.network.find_network = mock.Mock(return_value=self._testnetwork)
        self.network.network_hosting_dhcp_agents = mock.Mock(
            return_value=self.network_agents)

        self.network.get_agent = mock.Mock(return_value=_testagent)

        self._testrouter = \
            network_fakes.FakeRouter.create_one_router()
        self.network.find_router = mock.Mock(return_value=self._testrouter)
        self.network.routers_hosting_l3_agents = mock.Mock(
            return_value=self.network_agents)

        # Get the command object to test
        self.cmd = network_agent.ListNetworkAgent(self.app, self.namespace)

    def test_network_agents_list(self):
        arglist = []
        verifylist = []

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        columns, data = self.cmd.take_action(parsed_args)

        self.network.agents.assert_called_once_with(**{})
        self.assertEqual(self.columns, columns)
        self.assertListItemEqual(self.data, list(data))

    def test_network_agents_list_agent_type(self):
        arglist = [
            '--agent-type', 'dhcp',
        ]
        verifylist = [
            ('agent_type', 'dhcp'),
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        columns, data = self.cmd.take_action(parsed_args)

        self.network.agents.assert_called_once_with(**{
            'agent_type': 'DHCP agent',
        })
        self.assertEqual(self.columns, columns)
        self.assertListItemEqual(self.data, list(data))

    def test_network_agents_list_host(self):
        arglist = [
            '--host', self.network_agents[0].host,
        ]
        verifylist = [
            ('host', self.network_agents[0].host),
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        columns, data = self.cmd.take_action(parsed_args)

        self.network.agents.assert_called_once_with(**{
            'host': self.network_agents[0].host,
        })
        self.assertEqual(self.columns, columns)
        self.assertListItemEqual(self.data, list(data))

    def test_network_agents_list_networks(self):
        arglist = [
            '--network', self._testnetwork.id,
        ]
        verifylist = [
            ('network', self._testnetwork.id),
        ]

        attrs = {self._testnetwork, }

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        columns, data = self.cmd.take_action(parsed_args)

        self.network.network_hosting_dhcp_agents.assert_called_once_with(
            *attrs)
        self.assertEqual(self.columns, columns)
        self.assertListItemEqual(self.data, list(data))

    def test_network_agents_list_routers(self):
        arglist = [
            '--router', self._testrouter.id,
        ]
        verifylist = [
            ('router', self._testrouter.id),
            ('long', False)
        ]

        attrs = {self._testrouter, }

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        columns, data = self.cmd.take_action(parsed_args)

        self.network.routers_hosting_l3_agents.assert_called_once_with(
            *attrs)

        self.assertEqual(self.columns, columns)
        self.assertListItemEqual(self.data, list(data))

    def test_network_agents_list_routers_with_long_option(self):
        arglist = [
            '--router', self._testrouter.id,
            '--long',
        ]
        verifylist = [
            ('router', self._testrouter.id),
            ('long', True)
        ]

        attrs = {self._testrouter, }

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        columns, data = self.cmd.take_action(parsed_args)

        self.network.routers_hosting_l3_agents.assert_called_once_with(
            *attrs)

        # Add a column 'HA State' and corresponding data.
        router_agent_columns = self.columns + ('HA State',)
        router_agent_data = [d + ('',) for d in self.data]

        self.assertEqual(router_agent_columns, columns)
        self.assertListItemEqual(router_agent_data, list(data))

class TestRemoveNetworkFromAgent(TestNetworkAgent):

    net = network_fakes.FakeNetwork.create_one_network()
    agent = network_fakes.FakeNetworkAgent.create_one_network_agent()

    def setUp(self):
        super(TestRemoveNetworkFromAgent, self).setUp()

        self.network.get_agent = mock.Mock(return_value=self.agent)
        self.network.find_network = mock.Mock(return_value=self.net)
        self.network.name = self.network.find_network.name
        self.network.remove_dhcp_agent_from_network = mock.Mock()
        self.cmd = network_agent.RemoveNetworkFromAgent(
            self.app, self.namespace)

    def test_show_no_options(self):
        arglist = []
        verifylist = []

        # Missing required args should bail here
        self.assertRaises(tests_utils.ParserException, self.check_parser,
                          self.cmd, arglist, verifylist)

    def test_network_agents_list_routers_no_arg(self):
        arglist = [
            '--routers',
        ]
        verifylist = []

        # Missing required args should bail here
        self.assertRaises(tests_utils.ParserException, self.check_parser,
                          self.cmd, arglist, verifylist)

    def test_network_from_dhcp_agent(self):
        arglist = [
            '--dhcp',
            self.agent.id,
            self.net.id
        ]
        verifylist = [
            ('dhcp', True),
            ('agent_id', self.agent.id),
            ('network', self.net.id),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        self.cmd.take_action(parsed_args)

        self.network.remove_dhcp_agent_from_network.assert_called_once_with(
            self.agent, self.net)

class TestRemoveRouterAgent(TestNetworkAgent):
    _router = network_fakes.FakeRouter.create_one_router()
    _agent = network_fakes.FakeNetworkAgent.create_one_network_agent()

    def setUp(self):
        super(TestRemoveRouterAgent, self).setUp()
        self.network.remove_router_from_agent = mock.Mock()
        self.cmd = network_agent.RemoveRouterFromAgent(self.app,
                                                       self.namespace)
        self.network.get_agent = mock.Mock(return_value=self._agent)
        self.network.find_router = mock.Mock(return_value=self._router)

    def test_remove_no_options(self):
        arglist = []
        verifylist = []

        # Missing agent ID will cause command to bail
        self.assertRaises(tests_utils.ParserException, self.check_parser,
                          self.cmd, arglist, verifylist)

    def test_remove_router_required_options(self):
        arglist = [
            '--l3',
            self._agent.id,
            self._router.id,
        ]
        verifylist = [
            ('l3', True),
            ('agent_id', self._agent.id),
            ('router', self._router.id),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        result = self.cmd.take_action(parsed_args)

        self.network.remove_router_from_agent.assert_called_with(
            self._agent, self._router)
        self.assertIsNone(result)

class TestSetNetworkAgent(TestNetworkAgent):

    _network_agent = (
        network_fakes.FakeNetworkAgent.create_one_network_agent())

    def setUp(self):
        super(TestSetNetworkAgent, self).setUp()
        self.network.update_agent = mock.Mock(return_value=None)
        self.network.get_agent = mock.Mock(return_value=self._network_agent)

        # Get the command object to test
        self.cmd = network_agent.SetNetworkAgent(self.app, self.namespace)

    def test_set_nothing(self):
        arglist = [
            self._network_agent.id,
        ]
        verifylist = [
            ('network_agent', self._network_agent.id),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        result = self.cmd.take_action(parsed_args)

        attrs = {}
        self.network.update_agent.assert_called_once_with(
            self._network_agent, **attrs)
        self.assertIsNone(result)

    def test_set_all(self):
        arglist = [
            '--description', 'new_description',
            '--enable',
            self._network_agent.id,
        ]
        verifylist = [
            ('description', 'new_description'),
            ('enable', True),
            ('disable', False),
            ('network_agent', self._network_agent.id),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        result = self.cmd.take_action(parsed_args)

        attrs = {
            'description': 'new_description',
            'admin_state_up': True,
            'is_admin_state_up': True,
        }
        self.network.update_agent.assert_called_once_with(
            self._network_agent, **attrs)
        self.assertIsNone(result)

    def test_set_with_disable(self):
        arglist = [
            '--disable',
            self._network_agent.id,
        ]
        verifylist = [
            ('enable', False),
            ('disable', True),
            ('network_agent', self._network_agent.id),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        result = self.cmd.take_action(parsed_args)

        attrs = {
            'admin_state_up': False,
            'is_admin_state_up': False,
        }
        self.network.update_agent.assert_called_once_with(
            self._network_agent, **attrs)
        self.assertIsNone(result)

class TestShowNetworkAgent(TestNetworkAgent):

    _network_agent = (
        network_fakes.FakeNetworkAgent.create_one_network_agent())

    columns = (
        'admin_state_up',
        'agent_type',
        'alive',
        'availability_zone',
        'binary',
        'configurations',
        'host',
        'id',
    )
    data = (
        network_agent.AdminStateColumn(_network_agent.admin_state_up),
        _network_agent.agent_type,
        network_agent.AliveColumn(_network_agent.is_alive),
        _network_agent.availability_zone,
        _network_agent.binary,
        format_columns.DictColumn(_network_agent.configurations),
        _network_agent.host,
        _network_agent.id,
    )

    def setUp(self):
        super(TestShowNetworkAgent, self).setUp()
        self.network.get_agent = mock.Mock(
            return_value=self._network_agent)

        # Get the command object to test
        self.cmd = network_agent.ShowNetworkAgent(self.app, self.namespace)

    def test_show_no_options(self):
        arglist = []
        verifylist = []

        # Missing required args should bail here
        self.assertRaises(tests_utils.ParserException, self.check_parser,
                          self.cmd, arglist, verifylist)

    def test_show_all_options(self):
        arglist = [
            self._network_agent.id,
        ]
        verifylist = [
            ('network_agent', self._network_agent.id),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)
        columns, data = self.cmd.take_action(parsed_args)

        self.network.get_agent.assert_called_once_with(
            self._network_agent.id)
        self.assertEqual(self.columns, columns)
        self.assertItemEqual(list(self.data), list(data))


text:
import { BasicButton } from "../../../../base/single/button/button.basic";

export declare class HalfButton extends BasicButton {
    static xtype: string;
    static EVENT_CHANGE: string;
}


text:
<?php

namespace YsTools\ErlangPortBundle\PortCommand;

interface PortCommandInterface
{
    /**
     * Execute Erlang port command
     *
     * @param array $parameters
     * @return string
     */
    public function execute(array $parameters);
}


text:
Codebase for GECCO 2015 paper Strength Through Diversity: Disaggregation and Multi-Objectivisation
Approaches for Genetic Programming by Jonathan Fieldsend and Alberto Moraglio

Paper available at the links below:

https://ore.exeter.ac.uk/repository/handle/10871/17041
https://doi.org/10.1145/2739480.2754643

Class to run is the BooleanGPO class in the mogp package. You will need to compile the source of the package first.

When running, arguments need to be provided at the command line. If these are ommitted some advice is provided, i.e., if the command line prompt is indicted with prompt]

prompt] java mogp.BooleanGP

Insufficient arguments, requires: maintenence type (R, B, BP, F, FP, S, SP, D or DP) problem type (2, 4 or 8) population size (postive integer) fold start number fold end number

Please refer to the documentation for the range of problem type arguments (and their interpretation)

A run of the DP maintence approach across 5 folds, on problem type 2, with a search population of 100,  would therefore be invoked with:

prompt] java mogp.BooleanGP DP 2 100 1 5

FOLD: 1
Pareto set size: 10
Pareto set size: 9
..
..
..
FOLD: 5
Pareto set size: 9
Pareto set size: 8
Pareto set size: 9
Pareto set size: 10
Pareto set size: 10
Pareto set size: 8
Pareto set size: 9
Pareto set size: 9
Pareto set size: 9
Pareto set size: 7
Pareto set size: 5
Pareto set size: 6
Pareto set size: 6
Pareto set size: 7
Pareto set size: 1

total time: 54.5680000000047 milli seconds

calls: 18800 times

Av time per gen: 0.002902553191489612 milliseconds

total time: 734.833 milliseconds

Percentage total: 7.425904933502538%

Details printed to the screen for this approach include the number of nondominated members at each generation, and at the end of the run the total number of calls to the Pareto set maintenance routines, and the percentage of the run time spent on this (note there are more efficient regimes available for preserving non-dominated sets than those implemented here, as referred to in the original manuscript).

Additionally files tracking quality will be written out, specifically in the example here

bool_gecco2015_typeDP_problem2_pop100_fold1_results.txt
bool_gecco2015_typeDP_problem2_pop100_fold2_results.txt
bool_gecco2015_typeDP_problem2_pop100_fold3_results.txt
bool_gecco2015_typeDP_problem2_pop100_fold4_results.txt
bool_gecco2015_typeDP_problem2_pop100_fold5_results.txt
timing_bool_gecco2015_typeDP_problem2_pop100_evals.txt


text:
var assert = require('assert'),
    error = require('../../../lib/error/index'),
    math = require('../../../index');

describe('format', function() {

  it('should format numbers', function() {
    assert.equal(math.format(2/7), '0.2857142857142857');
    assert.equal(math.format(0.10400), '0.104');
    assert.equal(math.format(2.3), '2.3');
    assert.equal(math.format(2.3e6), '2.3e+6');
  });

  it('should format strings', function() {
    assert.equal(math.format('hello'), '"hello"');
  });

  it('should format arrays', function() {
    assert.equal(math.format([[1,2],[3,4]]), '[[1, 2], [3, 4]]');
    var array = [[math.unit(2/3, 'm'), 2/7],['hi', math.complex(2,1/3)]];
    assert.equal(math.format(array, 5), '[[0.66667 m, 0.28571], ["hi", 2 + 0.33333i]]');
  });

  it('should format complex values', function() {
    assert.equal(math.format(math.divide(math.complex(2,5),3)), '0.6666666666666666 + 1.6666666666666667i');
    assert.equal(math.format(math.divide(math.complex(2,5),3), 5), '0.66667 + 1.6667i');
    assert.equal(math.format(math.divide(math.complex(2,5),3), {notation: 'fixed'}), '1 + 2i');
    assert.equal(math.format(math.divide(math.complex(2,5),3), {notation: 'fixed', precision: 1}), '0.7 + 1.7i');

    assert.equal(math.format(math.complex(NaN , NaN)), 'NaN + NaNi');
    assert.equal(math.format(math.complex(Infinity, Infinity)), 'Infinity + Infinityi');
    assert.equal(math.format(math.complex(Infinity, -Infinity)), 'Infinity - Infinityi');
  });

  describe('precision', function() {
    it('should format numbers with given precision', function() {
      assert.equal(math.format(1/3), '0.3333333333333333');
      assert.equal(math.format(1/3, 3), '0.333');
      assert.equal(math.format(1/3, 4), '0.3333');
      assert.equal(math.format(1/3, 5), '0.33333');
      assert.equal(math.format(math.complex(1/3, 2), 3), '0.333 + 2i');
    });

    it('should format complex numbers with given precision', function() {
      assert.equal(math.format(math.complex(1/3, 1/3), 3), '0.333 + 0.333i');
      assert.equal(math.format(math.complex(1/3, 1/3), 4), '0.3333 + 0.3333i');
    });

    it('should format matrices with given precision', function() {
      assert.equal(math.format([1/3, 1/3], 3), '[0.333, 0.333]');
      assert.equal(math.format([1/3, 1/3], 4), '[0.3333, 0.3333]');
      assert.equal(math.format(math.matrix([1/3, 1/3]), 4), '[0.3333, 0.3333]');
    });

    it('should format units with given precision', function() {
      assert.equal(math.format(math.unit(2/3, 'm'), 3), '0.667 m');
      assert.equal(math.format(math.unit(2/3, 'm'), 4), '0.6667 m');
    });

    it('should format ranges with given precision', function() {
      assert.equal(math.format(new math.type.Range(1/3, 4/3, 2/3), 3), '0.333:0.667:1.33');
    });

  });

  describe('engineering notation', function () {
    it('should format positive single digit to engineering notation', function() {
      assert.equal(math.format(3, { notation: 'engineering' }), '3e+0');
    });
    it('should format positive two digits to engineering notation', function() {
      assert.equal(math.format(30, { notation: 'engineering' }), '30e+0');
    });
    it('should format positive three digits to engineering notation', function() {
      assert.equal(math.format(300, { notation: 'engineering' }), '300e+0');
    });
    it('should format positive four digits to engineering notation', function() {
      assert.equal(math.format(3000, { notation: 'engineering' }), '3e+3');
    });
    it('should format positive uneven four digits to engineering notation', function() {
      assert.equal(math.format(3001, { notation: 'engineering' }), '3.001e+3');
    });
    it('should format positive uneven ten digits to engineering notation', function() {
      assert.equal(math.format(3741293481, { notation: 'engineering' }), '3.741293481e+9');
    });
    it('should format negative uneven ten digits to engineering notation', function() {
      assert.equal(math.format(-3741293481, { notation: 'engineering' }), '-3.741293481e+9');
    });
    it('should format positive single digit floating point numbers to engineering notation', function() {
      assert.equal(math.format(.1, { notation: 'engineering' }), '100e-3');
    });
    it('should format positive two digit floating point numbers to engineering notation', function() {
      assert.equal(math.format(.01, { notation: 'engineering' }), '10e-3');
    });
    it('should format positive three digit floating point numbers to engineering notation', function() {
      assert.equal(math.format(.003, { notation: 'engineering' }), '3e-3');
    });
    it('should format positive repeating three digit floating point numbers to engineering notation with precision', function() {
      assert.equal(math.format(1/3, { precision: 3, notation: 'engineering' }), '333e-3');
    });
    it('should format positive seven digit floating point numbers to engineering notation', function() {
      assert.equal(math.format(.1234567, { notation: 'engineering' }), '123.4567e-3');
    });
    it('should format negative single digit floating point numbers to engineering notation', function() {
      assert.equal(math.format(-.1, { notation: 'engineering' }), '-100e-3');
    });
    it('should format positive floating point number to engineering notation', function() {
      assert.equal(math.format(13308.0333333333, { precision: 11, notation: 'engineering' }), '13.308033333e+3');
    });
  });

  describe('bignumber', function () {
    var bigmath = math.create({precision: 20}); // ensure the precision is 20 digits

    it('should format big numbers', function() {
      assert.equal(math.format(bigmath.bignumber(2).dividedBy(7)), '0.28571428571428571429');
      assert.equal(math.format(bigmath.bignumber(0.10400)), '0.104');
      assert.equal(math.format(bigmath.bignumber(2.3)), '2.3');
      assert.equal(math.format(bigmath.bignumber(2.3e6)), '2.3e+6');
    });

    it('should format big numbers with given precision', function() {
      var oneThird = bigmath.bignumber(1).div(3);
      assert.equal(bigmath.format(oneThird), '0.33333333333333333333'); // 20 digits
      assert.equal(bigmath.format(oneThird, 3), '0.333');
      assert.equal(bigmath.format(oneThird, 4), '0.3333');
      assert.equal(bigmath.format(oneThird, 5), '0.33333');
      assert.equal(bigmath.format(oneThird, 18), '0.333333333333333333');
    });
  });

  it('should throw an error on wrong number of arguments', function() {
    assert.throws (function () {math.format()}, /TypeError: Too few arguments/);
    assert.throws (function () {math.format(1, 2, 3)}, /TypeError: Too many arguments/);
  });

  it('should LaTeX format', function () {
    var expression = math.parse('format(1)');
    assert.equal(expression.toTex(), '\\mathrm{format}\\left(1\\right)');
  });

});


text:
<?php

if(empty($tabularIdx))
{
	$this->title=Yum::t('Update user')." ".$model->id;

	$this->breadcrumbs = array(
			Yum::t('Users')=>array('index'),
			$model->username=>array('view','id'=>$model->id),
			Yum::t('Update'));
}

echo $this->renderPartial('/user/_form', array(
			'model'=>$model,
			'passwordform'=>$passwordform,
			'changepassword' => isset($changepassword) ? $changepassword : false,
			'profile'=>$profile,
			'tabularIdx'=> isset($tabularIdx) ? $tabularIdx : 0)
		);
?>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Novitates Mycologicae 49 (1939)

#### Original name
Lepiota betulina Velen.

### Remarks
null


text:
<?php
/**
 * @file EntityTypeBuilder.php
 */
namespace Wesnick\DrupalBootstrap\Builder\Entity;

/**
 * Class NodeTypeBuilder
 *
 * @author Wesley O. Nichols <wesley.o.nichols@gmail.com>
 */
interface EntityTypeBuilder
{
    public function getEntityType();
    public function getBundle();
    public static function getTypes();
    public function build();
    public function getInstances();
}


text:
@interface ASPOSEWDocumentTestCase : XCTestCase

@end

@implementation ASPOSEWDocumentTestCase

- (void)setUp
{
    [super setUp];
}

- (void)tearDown
{
    [super tearDown];
}

- (void)testConvertWordDocumentOnCloudToOtherFileFormat
{
    NSString *convertedFilePath = [ASPOSEWDocument convertWordDocumentOnCloudStorage:@"myworddocument.doc" toFileFormat:@"html" andSaveOnDeviceWithName:@"myWordDocument.html"];
    BOOL isFileExist = [[NSFileManager defaultManager] fileExistsAtPath:convertedFilePath];
    XCTAssertTrue(isFileExist, @"Failed to convert word document to designated format");
}

- (void)testConvertWordDocumentOnDeviceToOtherFileFormat
{
    NSString *filePath = [[[NSBundle bundleForClass:[self class]] resourcePath]
                          stringByAppendingPathComponent:@"Userflow-cases.docx"];
    NSData *fileData = [NSData dataWithContentsOfFile:filePath];

    NSString *convertedFilePath = [ASPOSEWDocument convertWordDocumentOnDevice:fileData toFileFormat:@"pdf" andSaveWithName:@"Userflow-cases.pdf"];
    BOOL isFileExist = [[NSFileManager defaultManager] fileExistsAtPath:convertedFilePath];
    XCTAssertTrue(isFileExist, @"Failed to convert word document stored on device to designated format");
}

- (void)testConvertWordDocumentToOtherFileFormatWithAdditionalSettings
{
    NSString *additionalOptions = @"<PdfSaveOptions>"
                                        "<SaveFormat>pdf</SaveFormat>"
                                        "<FileName>ImageandDataTemplate.pdf</FileName>"
                                        "<ImageCompression>Jpeg</ImageCompression>"
                                        "<JpegQuality>70</JpegQuality>"
                                        "<TextCompression>Flate</TextCompression>"
                                  "</PdfSaveOptions>";

    NSString *convertedFilePath = [ASPOSEWDocument convertWordDocumentOnCloudStorage:@"ImageandDataTemplate.docx" withAdditionalSettings:additionalOptions andSaveOnDeviceWithName:@"ImageandDataTemplate.pdf"];
    BOOL isFileExist = [[NSFileManager defaultManager] fileExistsAtPath:convertedFilePath];
    XCTAssertTrue(isFileExist, @"Failed to convert word document to designated format with additional settings");
}

- (void) testConvertWebPagesToWordDocument
{
    NSString *webDocumentData = @"<LoadWebDocumentData>"
                                      "<LoadingDocumentUrl>http://google.com</LoadingDocumentUrl>"
                                      "<DocSaveOptionsData>"
                                              "<SaveFormat>doc</SaveFormat>"
                                              "<FileName>google.doc</FileName>"
                                              "<SaveRoutingSlip>true</SaveRoutingSlip>"
                                      "</DocSaveOptionsData>"
                                "</LoadWebDocumentData>";
    ASPOSEWSaveResult *saveResult = [ASPOSEWDocument convertWebPagesToWordDocument:webDocumentData contentType:CONTENT_TYPE_XML];
    XCTAssertNotNil(saveResult, @"Failed to convert web page to word document");
}

- (void) testAppendListofDocumentsToSourceDocument
{
    //Array that holds documents' names to append
    NSArray *appendDocs = @[@"DocumentToAppend1.doc", @"DocumentToAppend2.doc"];
    //Array that holds import format modes
    NSArray *importFormatsModes = @[@"KeepSourceFormatting", @"UseDestinationStyles"];

    BOOL isDocumentsAppendedSuccessfully = [ASPOSEWDocument appendListofDocuments:appendDocs toSourceDocument:@"SourceDocument.doc" withImportFormatModes:importFormatsModes];
    XCTAssertTrue(isDocumentsAppendedSuccessfully, @"Failed to append list of documents to source document");
}

- (void) testSplitAllPagesToNewPDFs
{
    ASPOSEWSplitResult *splitResult = [ASPOSEWDocument splitAllPagesToNewPDFs:@"myworddocument.doc"];
    XCTAssertNotNil(splitResult, @"Failed to split all document pages to new PDFs");
}

- (void) testSplitSpecificPagesToFormat
{
    ASPOSEWSplitResult *splitResult = [ASPOSEWDocument splitSpecificPages:@"myworddocument.doc" toFormat:@"pdf" fromPageNumber:1 toPageNumber:1];
    XCTAssertNotNil(splitResult, @"Failed to split specific pages to designated format");
}

- (void) testAcceptAllTrackingChanges
{
    ASPOSEWTrackingChangesResult *trackingChangesResult = [ASPOSEWDocument acceptAllTrackingChanges:@"myworddocument.doc" andSaveAs:@"acceptedTrackingChangesWordDocument.doc"];
    XCTAssertNotNil(trackingChangesResult, @"Failed to accept all tracking changes in the document");
}

- (void) testRejectAllTrackingChanges
{
    ASPOSEWTrackingChangesResult *trackingChangesResult = [ASPOSEWDocument rejectAllTrackingChanges:@"myworddocument.doc" andSaveAs:@"rejectedTrackingChangesWordDocument.doc"];
    XCTAssertNotNil(trackingChangesResult, @"Failed to reject all tracking changes in the document");
}

- (void) testStatisticsOfDocument
{
    ASPOSEWStatisticsOfDocumentResponse *statisticsOfDocument = [ASPOSEWDocument statisticsOfDocument:@"myworddocument.doc"];
    XCTAssertNotNil(statisticsOfDocument, @"Failed to get statistics of the document");
}

- (void) testConvertWordDocumentToOtherFileFormatUsingThirdPartyStorage
{
    NSString *convertedFilePath = [ASPOSEWDocument convertWordDocumentToOtherFileFormatUsingThirdPartyStorage:@"myworddocument.doc" designatedFormat:@"pdf" storageName:@"MyDropboxStorage" folderName:nil andSaveOnDeviceWithName:@"wordToPDF.pdf"];
    BOOL isFileExist = [[NSFileManager defaultManager] fileExistsAtPath:convertedFilePath];
    XCTAssertTrue(isFileExist, @"Failed to convert a Word document to other file format using third party Storage");
}

@end


text:
//[-------------------------------------------------------]
//[ Header guard                                          ]
//[-------------------------------------------------------]
#pragma once

//[-------------------------------------------------------]
//[ Forward declarations                                  ]
//[-------------------------------------------------------]
namespace Rhi
{
	class ILog;
	class IAssert;
	class IAllocator;
}
namespace Renderer
{
	class IFileManager;
}

//[-------------------------------------------------------]
//[ Namespace                                             ]
//[-------------------------------------------------------]
namespace RendererToolkit
{

	//[-------------------------------------------------------]
	//[ Classes                                               ]
	//[-------------------------------------------------------]
	/**
	*  @brief
	*    Context class encapsulating all embedding related wirings
	*/
	class Context final
	{

	//[-------------------------------------------------------]
	//[ Public methods                                        ]
	//[-------------------------------------------------------]
	public:
		/**
		*  @brief
		*    Constructor
		*
		*  @param[in] log
		*    RHI log instance to use, the log instance must stay valid as long as the renderer toolkit instance exists
		*  @param[in] assert
		*    RHI assert instance to use, the assert instance must stay valid as long as the renderer toolkit instance exists
		*  @param[in] allocator
		*    RHI allocator instance to use, the allocator instance must stay valid as long as the renderer toolkit instance exists
		*  @param[in] fileManager
		*    Renderer file manager instance to use, the file manager instance must stay valid as long as the renderer toolkit instance exists
		*/
		inline Context(Rhi::ILog& log, Rhi::IAssert& assert, Rhi::IAllocator& allocator, Renderer::IFileManager& fileManager) :
			mLog(log),
			mAssert(assert),
			mAllocator(allocator),
			mFileManager(fileManager)
		{
			// Nothing here
		}

		/**
		*  @brief
		*    Destructor
		*/
		inline ~Context()
		{
			// Nothing here
		}

		/**
		*  @brief
		*    Return the used RHI log instance
		*
		*  @return
		*    The used RHI log instance
		*/
		[[nodiscard]] inline Rhi::ILog& getLog() const
		{
			return mLog;
		}

		/**
		*  @brief
		*    Return the used RHI assert instance
		*
		*  @return
		*    The used RHI assert instance
		*/
		[[nodiscard]] inline Rhi::IAssert& getAssert() const
		{
			return mAssert;
		}

		/**
		*  @brief
		*    Return the used RHI allocator instance
		*
		*  @return
		*    The used RHI allocator instance
		*/
		[[nodiscard]] inline Rhi::IAllocator& getAllocator() const
		{
			return mAllocator;
		}

		/**
		*  @brief
		*    Return the used renderer file manager instance
		*
		*  @return
		*    The used renderer file manager instance
		*/
		[[nodiscard]] inline Renderer::IFileManager& getFileManager() const
		{
			return mFileManager;
		}

	//[-------------------------------------------------------]
	//[ Private methods                                       ]
	//[-------------------------------------------------------]
	private:
		explicit Context(const Context&) = delete;
		Context& operator=(const Context&) = delete;

	//[-------------------------------------------------------]
	//[ Private data                                          ]
	//[-------------------------------------------------------]
	private:
		Rhi::ILog&				mLog;
		Rhi::IAssert&			mAssert;
		Rhi::IAllocator&		mAllocator;
		Renderer::IFileManager& mFileManager;

	};

//[-------------------------------------------------------]
//[ Namespace                                             ]
//[-------------------------------------------------------]
} // Renderer


text:
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html">
<link rel="import" href="multidevice_browser_proxy.html">
<link rel="import" href="multidevice_constants.html">
<link rel="import" href="multidevice_feature_behavior.html">

<dom-module id="settings-multidevice-feature-toggle">
  <template>
    <cr-toggle id="toggle"
        aria-label$="[[getToggleA11yLabel_(feature)]]"
        checked="{{checked_}}"
        disabled="[[!isFeatureStateEditable(feature, pageContentData)]]"
        on-change="toggleFeature">
    </cr-toggle>
  </template>
  <script src="multidevice_feature_toggle.js"></script>
</dom-module>


text:
Box Android Share SDK
==============
Dette utviklersettet gjør det mulig å administrere delingskoblinger og samarbeidspartnere i Box.

####Delingskoblinger

####Samarbeidspartnere

Konfigurasjon for utvikler
--------------
Du kan få tak i utviklersettet ved å legge det til som en Maven-avhengighet og klone kilden inn i prosjektet, eller ved å laste ned en av de forhåndskompilerte JAR-filene fra utgivelsessiden på GitHub.

Dette utviklersettet har følgende avhengigheter og må inkluderes i prosjektet:
* [minimal-json v0.9.1](https://github.com/ralfstx/minimal-json) (maven: `com.eclipsesource.minimal-json:minimal-json:0.9.1`)
* [box-content-sdk](https://github.com/box/box-android-content-sdk) (maven: `coming soon`)

Hurtigstart
--------------
Du trenger en BoxSession og BoxItem fra [box-content-sdk](https://github.com/box/box-android-content-sdk). Se dokumentasjonen for box-content-sdk for å få mer informasjon.
```java
    BoxSession session = new BoxSession(MainActivity.this);
    BoxFolder folder = new BoxApiFolder(session).getInfo("<FOLDER_ID>").send();
```

####Delingskobling for fil eller mappe
Start følgende aktivitet for å administrere en delingskobling for et element:
```java
    startActivity(BoxSharedLinkActivity.getLaunchIntent((MainActivity.this, folder, session));
```
Denne aktiviteten gjør at du kan administrere alle innstillingene for en delingskobling (for en bestemt fil eller mappe): passordbeskyttelse, tillatelser, utløpsdato, tilgangsnivå med flere.

####Samarbeidspartnere for mappe
Start følgende aktivitet for å administrere samarbeidspartnere for mappe:
```java
    startActivity(BoxCollaborationsActivity.getLaunchIntent(MainActivity.this, folder, session));
```
Denne aktiviteten gjør at du kan administrere brukertilgang og -tillatelser for en bestemt mappe.

Eksempelapplikasjon
--------------
Du finner en eksempelapplikasjon i mappen [box-share-sample](../../tree/master/box-share-sample)

Copyright and License
---------------------
Copyright 2015 Box, Inc. All rights reserved.

Licensed under the Box Terms of Service; you may not use this file except in compliance with the License.
You may obtain a copy of the License at https://www.box.com/legal/termsofservice/


text:
"""Unit test for the linux pam config parser."""

import platform
import unittest

from absl import app

from grr_response_core.lib.parsers import linux_pam_parser
from grr_response_core.lib.rdfvalues import client as rdf_client
from grr_response_core.lib.rdfvalues import config_file as rdf_config_file
from grr.test_lib import artifact_test_lib
from grr.test_lib import test_lib

ETC_PAM_CONF_EMPTY = b"""
# Nothing to do here.
   # white space

# ^ blank line
"""
ETC_PAM_CONF_SIMPLE = b"""
ssh auth required test.so
telnet auth required unix.so
ssh session    required     pam_limits.so
"""
ETC_PAM_CONF_COMPLEX = ETC_PAM_CONF_SIMPLE + b"""
telnet account include filt_include
ssh @include full_include
"""
ETC_PAMD_FILT_INCLUDE = b"""
account    required     pam_nologin.so
auth       required     pam_env.so envfile=/etc/default/locale
"""
ETC_PAMD_FULL_INCLUDE = ETC_PAMD_FILT_INCLUDE
ETC_PAMD_SSH = b"""
auth required test.so  # Comment
session    required     pam_limits.so random=option  # Comment
account include filt_include  # only include 'account' entries from file.
@include full_include  # Include everything from file 'full_include'
"""
ETC_PAMD_TELNET = b"""
# Blank line

# Multi line and 'type' with a leading '-'.
-auth [success=ok new_authtok_reqd=ok ignore=ignore default=bad] \
  testing.so module arguments  # Comments
"""
ETC_PAMD_EXTERNAL = b"""
password substack nonexistant
auth optional testing.so
@include /external/nonexistant
"""

TELNET_ONLY_CONFIG = {'/etc/pam.d/telnet': ETC_PAMD_TELNET}
TELNET_ONLY_CONFIG_EXPECTED = [
    ('telnet', 'auth',
     '[success=ok new_authtok_reqd=ok ignore=ignore default=bad]', 'testing.so',
     'module arguments')
]

TELNET_WITH_PAMCONF = {
    '/etc/pam.conf': ETC_PAM_CONF_EMPTY,
    '/etc/pam.d/telnet': ETC_PAMD_TELNET
}
TELNET_WITH_PAMCONF_EXPECTED = TELNET_ONLY_CONFIG_EXPECTED

PAM_CONF_SIMPLE = {'/etc/pam.conf': ETC_PAM_CONF_SIMPLE}
PAM_CONF_SIMPLE_EXPECTED = [('ssh', 'auth', 'required', 'test.so', ''),
                            ('telnet', 'auth', 'required', 'unix.so', ''),
                            ('ssh', 'session', 'required', 'pam_limits.so', '')]

PAM_CONF_OVERRIDE = {
    '/etc/pam.conf': ETC_PAM_CONF_SIMPLE,
    '/etc/pam.d/telnet': ETC_PAMD_TELNET
}
PAM_CONF_OVERRIDE_EXPECTED = PAM_CONF_SIMPLE_EXPECTED

PAM_CONF_OVERRIDE_COMPLEX = {
    '/etc/pam.conf': ETC_PAM_CONF_COMPLEX,
    '/etc/pam.d/ssh': ETC_PAMD_SSH,
    '/etc/pam.d/full_include': ETC_PAMD_FULL_INCLUDE,
    '/etc/pam.d/filt_include': ETC_PAMD_FILT_INCLUDE,
    '/etc/pam.d/telnet': ETC_PAMD_TELNET
}
PAM_CONF_OVERRIDE_COMPLEX_EXPECTED = PAM_CONF_SIMPLE_EXPECTED + [
    ('telnet', 'account', 'required', 'pam_nologin.so', ''),
    ('ssh', 'account', 'required', 'pam_nologin.so', ''),
    ('ssh', 'auth', 'required', 'pam_env.so', 'envfile=/etc/default/locale')
]

PAM_CONF_TYPICAL = {
    '/etc/pam.conf': ETC_PAM_CONF_EMPTY,
    '/etc/pam.d/ssh': ETC_PAMD_SSH,
    '/etc/pam.d/full_include': ETC_PAMD_FULL_INCLUDE,
    '/etc/pam.d/filt_include': ETC_PAMD_FILT_INCLUDE,
    '/etc/pam.d/telnet': ETC_PAMD_TELNET
}
PAM_CONF_TYPICAL_EXPECTED = TELNET_ONLY_CONFIG_EXPECTED + [
    ('ssh', 'auth', 'required', 'test.so', ''),
    ('ssh', 'session', 'required', 'pam_limits.so', 'random=option'),
    ('ssh', 'account', 'required', 'pam_nologin.so', ''),
    ('ssh', 'account', 'required', 'pam_nologin.so', ''),
    ('ssh', 'auth', 'required', 'pam_env.so', 'envfile=/etc/default/locale'),
    ('filt_include', 'account', 'required', 'pam_nologin.so', ''),
    ('filt_include', 'auth', 'required', 'pam_env.so',
     'envfile=/etc/default/locale'),
    ('full_include', 'account', 'required', 'pam_nologin.so', ''),
    ('full_include', 'auth', 'required', 'pam_env.so',
     'envfile=/etc/default/locale')
]

PAM_CONF_EXTERNAL_REF = {
    '/etc/pam.conf': ETC_PAM_CONF_EMPTY,
    '/etc/pam.d/external': ETC_PAMD_EXTERNAL
}
PAM_CONF_EXTERNAL_REF_EXPECTED = [('external', 'auth', 'optional', 'testing.so',
                                   '')]
PAM_CONF_EXTERNAL_REF_ERRORS = [
    '/etc/pam.d/external -> /etc/pam.d/nonexistant',
    '/etc/pam.d/external -> /external/nonexistant'
]

# TODO: This test fails on Windows, but could theoretically pass.
@unittest.skipIf(platform.system() == 'Windows',
                 'Test fails on Windows (but is non-criticial for Windows).')
class LinuxPAMParserTest(test_lib.GRRBaseTest):
  """Test parsing of PAM config files."""

  def setUp(self):
    super().setUp()
    self.kb = rdf_client.KnowledgeBase(fqdn='test.example.com', os='Linux')

  def _EntryToTuple(self, entry):
    return (entry.service, entry.type, entry.control, entry.module_path,
            entry.module_args)

  def _EntriesToTuples(self, entries):
    return [self._EntryToTuple(x) for x in entries]

  def testParseMultiple(self):
    """Tests for the ParseMultiple() method."""
    parser = linux_pam_parser.PAMParser()

    # Parse the simplest 'normal' config we can.
    # e.g. a single entry for 'telnet' with no includes etc.
    pathspecs, file_objs = artifact_test_lib.GenPathspecFileData(
        TELNET_ONLY_CONFIG)
    out = list(parser.ParseFiles(self.kb, pathspecs, file_objs))
    self.assertLen(out, 1)
    self.assertIsInstance(out[0], rdf_config_file.PamConfig)
    self.assertCountEqual(TELNET_ONLY_CONFIG_EXPECTED,
                          self._EntriesToTuples(out[0].entries))
    self.assertEqual([], out[0].external_config)

    # Parse the simplest 'normal' config we can but with an effectively
    # empty /etc/pam.conf file.
    # e.g. a single entry for 'telnet' with no includes etc.
    pathspecs, file_objs = artifact_test_lib.GenPathspecFileData(
        TELNET_WITH_PAMCONF)
    out = list(parser.ParseFiles(self.kb, pathspecs, file_objs))
    self.assertLen(out, 1)
    self.assertIsInstance(out[0], rdf_config_file.PamConfig)
    entry = out[0].entries[0]
    self.assertEqual(
        ('telnet', 'auth',
         '[success=ok new_authtok_reqd=ok ignore=ignore default=bad]',
         'testing.so', 'module arguments'), self._EntryToTuple(entry))
    self.assertCountEqual(TELNET_WITH_PAMCONF_EXPECTED,
                          self._EntriesToTuples(out[0].entries))
    self.assertEqual([], out[0].external_config)

    # Parse a simple old-style pam config. i.e. Just /etc/pam.conf.
    pathspecs, file_objs = artifact_test_lib.GenPathspecFileData(
        PAM_CONF_SIMPLE)
    out = list(parser.ParseFiles(self.kb, pathspecs, file_objs))
    self.assertLen(out, 1)
    self.assertIsInstance(out[0], rdf_config_file.PamConfig)
    self.assertCountEqual(PAM_CONF_SIMPLE_EXPECTED,
                          self._EntriesToTuples(out[0].entries))
    self.assertEqual([], out[0].external_config)

    # Parse a simple old-style pam config overriding a 'new' style config.
    # i.e. Configs in /etc/pam.conf override everything else.
    pathspecs, file_objs = artifact_test_lib.GenPathspecFileData(
        PAM_CONF_OVERRIDE)
    out = list(parser.ParseFiles(self.kb, pathspecs, file_objs))
    self.assertLen(out, 1)
    self.assertIsInstance(out[0], rdf_config_file.PamConfig)
    self.assertCountEqual(PAM_CONF_OVERRIDE_EXPECTED,
                          self._EntriesToTuples(out[0].entries))
    self.assertEqual([], out[0].external_config)

    # Parse a complex old-style pam config overriding a 'new' style config but
    # the /etc/pam.conf includes parts from the /etc/pam.d dir.
    # i.e. Configs in /etc/pam.conf override everything else but imports stuff.
    pathspecs, file_objs = artifact_test_lib.GenPathspecFileData(
        PAM_CONF_OVERRIDE_COMPLEX)
    out = list(parser.ParseFiles(self.kb, pathspecs, file_objs))
    self.assertLen(out, 1)
    self.assertIsInstance(out[0], rdf_config_file.PamConfig)
    self.assertCountEqual(PAM_CONF_OVERRIDE_COMPLEX_EXPECTED,
                          self._EntriesToTuples(out[0].entries))
    self.assertEqual([], out[0].external_config)

    # Parse a normal-looking pam configuration.
    # i.e. A no-op of a /etc/pam.conf with multiple files under /etc/pam.d
    #      that have includes etc.
    pathspecs, file_objs = artifact_test_lib.GenPathspecFileData(
        PAM_CONF_TYPICAL)
    out = list(parser.ParseFiles(self.kb, pathspecs, file_objs))
    self.assertLen(out, 1)
    self.assertIsInstance(out[0], rdf_config_file.PamConfig)
    self.assertCountEqual(PAM_CONF_TYPICAL_EXPECTED,
                          self._EntriesToTuples(out[0].entries))
    self.assertEqual([], out[0].external_config)

    # Parse a config which has references to external or missing files.
    pathspecs, file_objs = artifact_test_lib.GenPathspecFileData(
        PAM_CONF_EXTERNAL_REF)
    out = list(parser.ParseFiles(self.kb, pathspecs, file_objs))
    self.assertLen(out, 1)
    self.assertIsInstance(out[0], rdf_config_file.PamConfig)
    self.assertCountEqual(PAM_CONF_EXTERNAL_REF_EXPECTED,
                          self._EntriesToTuples(out[0].entries))
    self.assertCountEqual(PAM_CONF_EXTERNAL_REF_ERRORS,
                          list(out[0].external_config))

def main(args):
  test_lib.main(args)

if __name__ == '__main__':
  app.run(main)


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using Calamari.Integration.FileSystem;
using Calamari.Integration.Processes;
using Octostache;

namespace Calamari.Deployment.Journal
{
    public class DeploymentJournal : IDeploymentJournal
    {
        readonly ICalamariFileSystem fileSystem;
        readonly ISemaphore semaphore;
        readonly VariableDictionary variables;
        const string SemaphoreName = "Calamari:DeploymentJournal";

        public DeploymentJournal(ICalamariFileSystem fileSystem, ISemaphore semaphore, VariableDictionary variables)
        {
            this.fileSystem = fileSystem;
            this.semaphore = semaphore;
            this.variables = variables;
        }

        private string JournalPath
        {
            get { return variables.Get(SpecialVariables.Tentacle.Agent.JournalPath); }
        }

        public void AddJournalEntry(JournalEntry entry)
        {
            using (semaphore.Acquire(SemaphoreName, "Another process is using the deployment journal"))
            {
                var xElement = entry.ToXmlElement();
                Log.VerboseFormat("Adding journal entry:\n{0}", xElement.ToString());
                Write(Read().Concat(new[] {xElement}));
            }
        }

        public IEnumerable<JournalEntry> GetAllJournalEntries()
        {
            using (semaphore.Acquire(SemaphoreName, "Another process is using the deployment journal"))
            {
                return Read().Select(element => new JournalEntry(element));
            }
        }

        public void RemoveJournalEntries(IEnumerable<string> ids)
        {
            using (semaphore.Acquire(SemaphoreName, "Another process is using the deployment journal"))
            {
                var elements = Read();

                Write(elements.Where(x =>
                {
                    var id = x.Attribute("Id");
                    return id == null || !ids.Contains(id.Value);
                }));
            }
        }

        public JournalEntry GetLatestInstallation(string retentionPolicySubset)
        {
            return GetLatestInstallation(retentionPolicySubset, null, null);
        }

        public JournalEntry GetLatestInstallation(string retentionPolicySubset, string packageId, string packageVersion)
        {
            return GetAllJournalEntries().Where(e =>
                string.Equals(retentionPolicySubset, e.RetentionPolicySet, StringComparison.OrdinalIgnoreCase)
                && (packageId == null || string.Equals(packageId, e.PackageId, StringComparison.OrdinalIgnoreCase))
                && (packageVersion == null || string.Equals(packageVersion, e.PackageVersion, StringComparison.OrdinalIgnoreCase))
                ).OrderByDescending(o => o.InstalledOn)
                .FirstOrDefault();
        }

        private IEnumerable<XElement> Read()
        {
            if (!fileSystem.FileExists(JournalPath))
                yield break;

            using (var file = fileSystem.OpenFile(JournalPath, FileAccess.Read))
            {
                var document = XDocument.Load(file);

                foreach (var element in document.Element("Deployments").Elements())
                {
                    yield return element;
                }
            }
        }

        private void Write(IEnumerable<XElement> elements)
        {
            fileSystem.EnsureDirectoryExists(Path.GetDirectoryName(JournalPath));

            var tempPath = JournalPath + ".temp-" + Guid.NewGuid() + ".xml";

            var root = new XElement("Deployments");
            var document = new XDocument(root);
            foreach (var element in elements)
                root.Add(element);

            using (var stream = fileSystem.OpenFile(tempPath, FileMode.Create, FileAccess.Write))
                document.Save(stream);

            fileSystem.OverwriteAndDelete(JournalPath, tempPath);
        }
    }
}


text:
<?php

namespace spec\GrumPHP\Collection;

use GrumPHP\Collection\TaskResultCollection;
use GrumPHP\Runner\TaskResult;
use GrumPHP\Task\Context\ContextInterface;
use GrumPHP\Task\TaskInterface;
use PhpSpec\ObjectBehavior;

class TaskResultCollectionSpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType('GrumPHP\Collection\TaskResultCollection');
    }

    function it_contains_task_result(TaskResult $taskResult)
    {
        $this->add($taskResult);
        $this->add($taskResult);

        $this->count()->shouldBe(2);
        $result = $this->toArray();
        $result[0]->shouldBe($taskResult);
        $result[1]->shouldBe($taskResult);
    }

    function it_is_passed_if_it_contains_only_passed_task_result(TaskInterface $task, ContextInterface $context)
    {
        $this->add(TaskResult::createPassed($task->getWrappedObject(), $context->getWrappedObject()));
        $this->add(TaskResult::createPassed($task->getWrappedObject(), $context->getWrappedObject()));

        $this->isPassed()->shouldBe(true);
    }

    function it_is_not_passed_if_it_contains_a_failed_task_result(TaskInterface $task, ContextInterface $context)
    {
        $this->add(TaskResult::createPassed($task->getWrappedObject(), $context->getWrappedObject()));
        $this->add(TaskResult::createFailed($task->getWrappedObject(), $context->getWrappedObject(), ''));

        $this->isPassed()->shouldBe(false);
    }

    function it_is_not_passed_if_it_does_not_contains_any_task()
    {
        $this->isPassed()->shouldBe(false);
    }

    function it_returns_passed_code_if_it_contains_only_passed_task_result(TaskInterface $task, ContextInterface $context)
    {
        $this->add(TaskResult::createPassed($task->getWrappedObject(), $context->getWrappedObject()));
        $this->add(TaskResult::createPassed($task->getWrappedObject(), $context->getWrappedObject()));

        $this->getResultCode()->shouldBe(TaskResult::PASSED);
    }

    function it_returns_failed_code_if_it_contains_a_failed_task_result(TaskInterface $task, ContextInterface $context)
    {
        $this->add(TaskResult::createPassed($task->getWrappedObject(), $context->getWrappedObject()));
        $this->add(TaskResult::createFailed($task->getWrappedObject(), $context->getWrappedObject(), ''));

        $this->getResultCode()->shouldBe(TaskResult::FAILED);
    }

    function it_returns_no_task_code_if_it_does_not_contains_any_task()
    {
        $this->getResultCode()->shouldBe(TaskResultCollection::NO_TASKS);
    }

    function it_filters_by_result_code(TaskInterface $task, ContextInterface $context)
    {
        $aTask = $task->getWrappedObject();
        $aContext = $context->getWrappedObject();
        $this->add(TaskResult::createPassed($aTask, $aContext));
        $this->add(TaskResult::createPassed($aTask, $aContext));
        $this->add(TaskResult::createFailed($aTask, $aContext, ''));

        $this->filterByResultCode(TaskResult::PASSED)->shouldHaveCount(2);
        $this->filterByResultCode(TaskResult::FAILED)->shouldHaveCount(1);
        $this->filterByResultCode(TaskResult::NONBLOCKING_FAILED)->shouldHaveCount(0);
    }

    function it_returns_all_task_result_messages(TaskInterface $task, ContextInterface $context)
    {
        $aTask = $task->getWrappedObject();
        $aContext = $context->getWrappedObject();
        $this->add(TaskResult::createFailed($aTask, $aContext, 'failed message'));
        $this->add(TaskResult::createPassed($aTask, $aContext));
        $this->add(TaskResult::createFailed($aTask, $aContext, 'another failed message'));

        $this->getAllMessages()->shouldReturn(array(
            'failed message',
            null,
            'another failed message',
        ));
    }

    function it_has_failed_if_it_contains_failed_task_result(TaskInterface $task, ContextInterface $context)
    {
        $aTask = $task->getWrappedObject();
        $aContext = $context->getWrappedObject();
        $this->add(TaskResult::createPassed($aTask, $aContext));
        $this->add(TaskResult::createNonBlockingFailed($aTask, $aContext, 'non blocking'));

        $this->isFailed()->shouldReturn(false);

        $this->add(TaskResult::createFailed($aTask, $aContext, 'failed message'));

        $this->isFailed()->shouldReturn(true);
    }
}


text:
SELDON_TDAGENT_NODE_IMAGE_VERSION=00
IMAGE_NAME=seldonio/td-agent-node

build_image:
	docker build --force-rm=true -t $(IMAGE_NAME):$(SELDON_TDAGENT_NODE_IMAGE_VERSION) .

push_to_dockerhub:
	docker login -u seldonio && \
		docker push $(IMAGE_NAME):$(SELDON_TDAGENT_NODE_IMAGE_VERSION)

clean:
	@rm -fv Dockerfile


text:
CREATE PROCEDURE dbo.usp_ChangeUsername
   @ApplicationName    nvarchar(256),
   @OldUserName       nvarchar(256),
   @NewUserName       nvarchar(256),
   @ReturnValue int OUTPUT
AS
-- Get the UserId and ApplicationId for the user
DECLARE @UserId uniqueidentifier, @ApplicationId uniqueidentifier
SELECT @UserId = NULL

SELECT @UserId = u.UserId, @ApplicationId = a.ApplicationId
FROM   dbo.aspnet_Users u, dbo.aspnet_Applications a
WHERE LoweredUserName = LOWER(@OldUserName) AND
        u.ApplicationId = a.ApplicationId AND
        LOWER(@ApplicationName) = a.LoweredApplicationName

IF (@UserId IS NULL)
BEGIN
    SET @ReturnValue = 5
END
ELSE
BEGIN
    -- Ensure that @NewUserName is not in use
    IF (EXISTS(SELECT 1 FROM aspnet_Users WHERE LoweredUserName = LOWER(@NewUserName) AND ApplicationId = @ApplicationId))
    BEGIN
        SET @ReturnValue = 10
    END
    ELSE
    BEGIN
        -- Change the username
        UPDATE aspnet_Users SET
            UserName = @NewUserName,
            LoweredUserName = LOWER(@NewUserName)
        WHERE UserId = @UserId AND ApplicationId = @ApplicationId

        SET @ReturnValue = 15
    END
END


text:
{% include "lib/macros.html" -%}
{% extends "api/api.template.html" %}

{% block additional %}

Directive Info

    {% if doc.scope %}
This directive creates new scope.
{% endif %}

This directive executes at priority level {$ doc.priority $}.

    {% if doc.multiElement %}
This directive can be used as {@link $compile#-multielement- multiElement}
{% endif %}

  {% block usage %}

Usage

  {% if doc.usage %}
    {$ doc.usage | marked $}
  {% else %}

    {% if doc.restrict.element %}

as element:
      {% if doc.name.indexOf('ng') == 0 -%}
      (This directive can be used as custom element, but be aware of IE restrictions).
      {%- endif %}
      {% code %}
      <{$ doc.name | dashCase $}
        {%- for param in doc.params -%}
         {# skip attribute with name equal to directive name #}
         {%- if (doc.name != param.alias and doc.name != param.name) %}
          {$ directiveParam(param, '="', '"') $}
         {%- endif -%}
        {%- endfor %}>
        ...
      </{$ doc.name | dashCase $}>
      {% endcode %}

    {% endif -%}

    {%- if doc.restrict.attribute -%}

as attribute:
        {% code %}
        <{$ doc.element $}
          {%- for param in doc.params %}
          {$ directiveParam(param, '="', '"', false, doc.name) $}
          {%- endfor %}>
        ...
        </{$ doc.element $}>
        {% endcode %}

    {% endif -%}

    {%- if doc.restrict.cssClass -%}

as CSS class:
        {% code %}
        {% set sep = joiner(' ') %}
        <{$ doc.element $} class="
        {%- for param in doc.params -%}
          {$ sep() $}{$ directiveParam(param, ': ', ';', true) $}
        {%- endfor %}"> ... </{$ doc.element $}>
        {% endcode %}

    {% endif -%}

  {%- endif %}

  {% endblock -%}

  {%- if doc.animations %}

Animations

  {$ doc.animations | marked $}
  {$ 'module:ngAnimate.$animate' | link('Click here', doc) $} to learn more about the steps involved in the animation.
  {%- endif -%}

  {% include "lib/params.template.html" %}
  {% include "lib/events.template.html" %}
  {% include "lib/throws.template.html" %}
{% endblock %}