text:
package org.wso2.carbon.analytics.data.commons.service;

import org.wso2.carbon.analytics.data.commons.sources.RecordGroup;

import java.io.Serializable;
import java.util.List;

/**
 * This class represents an analytics data service response.
 */
public class AnalyticsDataResponse implements Serializable {

    private static final long serialVersionUID = 7912542783175151940L;

    private List<Entry> entries;

    public AnalyticsDataResponse() {
    }

    public AnalyticsDataResponse(List<Entry> entries) {
        this.entries = entries;
    }

    public List<Entry> getEntries() {
        return entries;
    }

    /**
     * This class represents a single record store name / record group entry.
     */
    public static class Entry implements Serializable {

        private static final long serialVersionUID = 3278533423223275273L;

        private String recordStoreName;

        private RecordGroup recordGroup;

        public Entry() { }

        public Entry(String recordStoreName, RecordGroup recordGroup) {
            this.recordStoreName = recordStoreName;
            this.recordGroup = recordGroup;
        }

        public String getRecordStoreName() {
            return recordStoreName;
        }

        public RecordGroup getRecordGroup() {
            return recordGroup;
        }

    }

}


text:
<?php
/**
 * Created by PhpStorm.
 * User: weuller.krysthian
 * Date: 29/12/2014
 * Time: 13:19
 */

namespace Users\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Users\Model\User;
use Users\Model\UserTable;

class UserManagerController extends AbstractActionController
{
    public function indexAction()
    {
        $userTable = $this->getServiceLocator()->get('UserTable');
        $viewModel = new ViewModel(array('users' => $userTable->fetchAll()));
        return $viewModel;
    }

    public function editAction()
    {
        $userTable = $this->getServiceLocator()->get('UserTable');
        $user = $userTable->getUser($this->params()->fromRoute('id'));
        $form = $this->getServiceLocator()->get('UserEditForm');
        $form->bind($user);
        $viewModel = new ViewModel(array(
            'form' => $form,
            'user_id' => $this->params()->fromRoute('id')
        ));
        return $viewModel;
    }

    public function processAction()
    {
        //Get User ID from POST
        $post = $this->request->getPost();
        $userTable = $this->getServiceLocator()->get('UserTable');

        //Load user entity to Form
        $user = $userTable->getUser($post->id);

        //Bind user entity to Form
        $form = $this->getServiceLocator()->get('UserEditForm');
        $form->bind($user);
        $form->setData($post);

        if ($form->isValid()) {
            //Save user
            $this->getServiceLocator()->get('UserTable')->saveUser($user);
        }

        return $this->redirect()->toRoute(null, array(
            'controller' => 'user-manager',
            'action' => 'index'
        ));
    }

    public function deleteAction()
    {
        $this->getServiceLocator()->get('UserTable')->deleteUser($this->params()->fromRoute('id'));
        return $this->redirect()->toRoute(null, array(
            'controller' => 'user-manager',
            'action' => 'index'
        ));
    }

    public function createAction()
    {
        $form = $this->getServiceLocator()->get('RegisterForm');
        $viewModel = new ViewModel(array('form' => $form));
        return $viewModel;
    }

    public function processCreateAction()
    {
        if (!$this->request->isPost()) {
            return $this->redirect()->toRoute(null, array('controller' => 'user-manager', 'action' => 'index'));
        }

        $post = $this->request->getPost();
        $form = $this->getServiceLocator()->get('RegisterForm');

        $form->setData($post);
        if ($form->isValid()) {
            $this->createUser($form->getData());
        }

        return $this->redirect()->toRoute(null, array(
            'controller' => 'user-manager',
            'action' => 'index'
        ));
    }

    public function createUser(array $data)
    {
        $sm = $this->getServiceLocator();
        $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
        $resultSetPrototype = new \Zend\Db\ResultSet\ResultSet();
        $resultSetPrototype->setArrayObjectPrototype(new \Users\Model\User);
        $tableGateway = new \Zend\Db\TableGateway\TableGateway('user', $dbAdapter, null, $resultSetPrototype);

        $user = new User();
        $user->exchangeArray($data);
        $userTable = new UserTable($tableGateway);
        $userTable->saveUser($user);
        return true;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.perfcake.ide.editor.controller;

import org.perfcake.ide.core.exception.Pc4ideException;
import org.perfcake.ide.core.manager.ScenarioManager;

/**
 * Execution manager is able to execute scenario. Individual plugins for specific IDE should implement the behaviour.
 *
 * @author Jakub Knetl
 */
public interface ExecutionFactory {

    /**
     * Executes scenario.
     *
     * @param scenarioManager manager of the scenario.
     * @throws Pc4ideException if error with execution occurs.
     */
    void execute(ScenarioManager scenarioManager) throws Pc4ideException;
}


text:
/*! @file patch.hpp
    @brief Interface of Patch class
*/
#pragma once
#ifndef PATCH_HPP_
#define PATCH_HPP_

#include <iosfwd>
#include <vector>
#include <map>
#include <memory>

namespace wtl {class sfmt19937_64;}

/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////
namespace edal {

class Individual;

class Patch {
  public:
    using URBG = wtl::sfmt19937_64;

    //! Construct an empty patch
    Patch(unsigned int seed);

    //! move constructor;
    Patch(Patch&&) noexcept;

    //! destructor in cpp for incomplete type
    ~Patch();

    //! Fill this patch with the same number of females and males
    /*! @param n The number of inital individuals in this patch
        @param founder The individual to be copied
    */
    void assign(size_t n, const Individual& founder);

    //! Add an individual to this patch
    /*! @param ind New individual to add
    */
    void emplace_back(Individual&& ind) {members_.emplace_back(std::move(ind));}

    //! @return The number of individuals in this patch
    size_t size() const {return members_.size();}

    //! @return Whether this patch is empty or not
    bool empty() const {return members_.empty();}

    //! Count genotypes
    std::map<Individual, size_t> summarize() const;

    //! All females mate with someone according to mating probability
    /*! @ingroup mating
        @return offsprings of all the females in the patch

        Each mating results in a number of offspring
        drawn from a Poisson distribution with parameter b.
        We assume that all adult females mate.
        This assumption implies that any costs of mate choice,
        which can easily prevent divergence and speciation, are absent.
        This assumption also means that the effective population size is
        increased relative to the actual number of adults.
    */
    std::vector<Individual> mate_and_reproduce() const;

    /*! @brief Change row/col with probability \f$m\f$ = Individual::MIGRATION_RATE_

        > With probability \f$ m > 0 \f$, each offspring becomes a "migrant."
        > Each migrant goes to one of the 8 neighboring patches.
        > For patches at the boundary,
        > the probability \f$ m \f$ is reduced according to the number of neighbors they have.
    */
    std::vector<std::pair<unsigned, unsigned int>>
    make_destinations(size_t n, size_t row, size_t col, size_t num_rows, size_t num_cols) const;

    //! Some individuals die depending on Individual::survival_probability()
    /*! @ingroup natural_selection
    */
    void viability_selection();

    /////1/////////2/////////3/////////4/////////5/////////6/////////7/////////
  private:

    //! Calculate \f$N_e(I)\f$ from \f$C(I,J)\f$
    /*! @ingroup natural_selection
        @return \f$N_e\f$ of the focal individual
        \f[
            N_e(I) = \sum_J C(I,J)
        \f]
    */
    std::vector<double> effective_num_competitors() const;

    //! Change sex of second half members
    void change_sex_half(size_t n);

    /////1/////////2/////////3/////////4/////////5/////////6/////////7/////////
    // data member
    //! Individuals
    std::vector<Individual> members_;

    std::unique_ptr<URBG> engine_;
};

//! Stream operator for Patch
extern std::ostream& operator<< (std::ostream& ost, const Patch& patch);

} // namespace edal

#endif /* PATCH_HPP_ */


text:
package howitworks.cats

import cats._
import org.scalactic.Equality

class MonoidDemo extends wp.Spec {

  "clock monoid" in {
    implicit val __ = clockSemigrop

    Monoid[Clock].empty mustBe Clock.c12
    Monoid[Clock].combine(Clock.c1, Clock.c2) mustEqual Clock.c3
    Monoid[Clock].combine(Clock.c12, Clock.c2) mustEqual Clock.c2

    import cats.syntax.semigroup._
    Clock.c1 |+| Clock.c1 mustEqual Clock.c2  //at now (08.04.2016) it looks red in intellij, probably because it uses custom macros under to hood
  }

  trait Clock {
    def hour: Int
    override def toString = s"Clock($hour)"
  }

  object Clock {
    val c1 = new Clock {override def hour: Int = 1}
    val c2 = new Clock {override def hour: Int = 2}
    val c3 = new Clock {override def hour: Int = 3}
    //...
    val c11 = new Clock {override def hour: Int = 11}
    val c12 = new Clock {override def hour: Int = 12}

    def apply(i: Int): Clock = new Clock{
      override def hour: Int = i.abs%12
    }
  }

  val clockSemigrop: Monoid[Clock] = new Monoid[Clock] {
    override def empty: Clock = Clock.c12
    override def combine(x: Clock, y: Clock): Clock = Clock(x.hour + y.hour)
  }

  implicit lazy val clockEquality: Equality[Clock] = new Equality[Clock] {
    override def areEqual(a: Clock, b: Any): Boolean = b match {
      case c:Clock => a.hour==c.hour
      case _ => false
    }
  }

}


text:
<?php

namespace Magento\Tax\Model\TaxClass;

use Magento\Framework\Model\AbstractExtensibleModel;
use Magento\Tax\Api\Data\TaxClassKeyInterface;

/**
 * @codeCoverageIgnore
 */
class Key extends AbstractExtensibleModel implements TaxClassKeyInterface
{
    /**#@+
     * Constants defined for keys of array, makes typos less likely
     */
    const KEY_TYPE  = 'type';
    const KEY_VALUE = 'value';
    /**#@-*/

    /**
     * {@inheritdoc}
     */
    public function getType()
    {
        return $this->getData(self::KEY_TYPE);
    }

    /**
     * {@inheritdoc}
     */
    public function getValue()
    {
        return $this->getData(self::KEY_VALUE);
    }

    /**
     * Set type of tax class key
     *
     * @param string $type
     * @return $this
     */
    public function setType($type)
    {
        return $this->setData(self::KEY_TYPE, $type);
    }

    /**
     * Set value of tax class key
     *
     * @param string $value
     * @return $this
     */
    public function setValue($value)
    {
        return $this->setData(self::KEY_VALUE, $value);
    }

    /**
     * {@inheritdoc}
     *
     * @return \Magento\Tax\Api\Data\TaxClassKeyExtensionInterface|null
     */
    public function getExtensionAttributes()
    {
        return $this->_getExtensionAttributes();
    }

    /**
     * {@inheritdoc}
     *
     * @param \Magento\Tax\Api\Data\TaxClassKeyExtensionInterface $extensionAttributes
     * @return $this
     */
    public function setExtensionAttributes(\Magento\Tax\Api\Data\TaxClassKeyExtensionInterface $extensionAttributes)
    {
        return $this->_setExtensionAttributes($extensionAttributes);
    }
}


text:
**THIS PROJECT IS NO LONGER MAINTAINED**
========================================
See [storm-topology-examples](https://github.com/sakserv/storm-topology-examples) for the latest.

storm-kafka-hdfs-starter
========================
Provides a sample of working with the KafkaSpout and HdfsBolt


text:
#include <rthw.h>
#include <rtthread.h>
#include <drivers/pm.h>

#ifdef RT_USING_PM

static struct rt_pm _pm;

/* default mode : system power on */
static rt_uint8_t _pm_default_sleep = RT_PM_DEFAULT_SLEEP_MODE;

/* default deepsleep mode : tick-less mode */
static rt_uint8_t _pm_default_deepsleep = RT_PM_DEFAULT_DEEPSLEEP_MODE;

static struct rt_pm_notify _pm_notify;
static rt_uint8_t _pm_init_flag = 0;

#define RT_PM_TICKLESS_THRESH (2)

RT_WEAK rt_uint32_t rt_pm_enter_critical(rt_uint8_t sleep_mode)
{
    return rt_hw_interrupt_disable();
}

RT_WEAK void rt_pm_exit_critical(rt_uint32_t ctx, rt_uint8_t sleep_mode)
{
    rt_hw_interrupt_enable(ctx);
}

/**
 * This function will suspend all registered devices
 */
static int _pm_device_suspend(rt_uint8_t mode)
{
    int index, ret = RT_EOK;

    for (index = 0; index < _pm.device_pm_number; index++)
    {
        if (_pm.device_pm[index].ops->suspend != RT_NULL)
        {
            ret = _pm.device_pm[index].ops->suspend(_pm.device_pm[index].device, mode);
            if(ret != RT_EOK)
                break;
        }
    }

    return ret;
}

/**
 * This function will resume all registered devices
 */
static void _pm_device_resume(rt_uint8_t mode)
{
    int index;

    for (index = 0; index < _pm.device_pm_number; index++)
    {
        if (_pm.device_pm[index].ops->resume != RT_NULL)
        {
            _pm.device_pm[index].ops->resume(_pm.device_pm[index].device, mode);
        }
    }
}

/**
 * This function will update the frequency of all registered devices
 */
static void _pm_device_frequency_change(rt_uint8_t mode)
{
    rt_uint32_t index;

    /* make the frequency change */
    for (index = 0; index < _pm.device_pm_number; index ++)
    {
        if (_pm.device_pm[index].ops->frequency_change != RT_NULL)
            _pm.device_pm[index].ops->frequency_change(_pm.device_pm[index].device, mode);
    }
}

/**
 * This function will update the system clock frequency when idle
 */
static void _pm_frequency_scaling(struct rt_pm *pm)
{
    rt_base_t level;

    if (pm->flags & RT_PM_FREQUENCY_PENDING)
    {
        level = rt_hw_interrupt_disable();
        /* change system runing mode */
        pm->ops->run(pm, pm->run_mode);
        /* changer device frequency */
        _pm_device_frequency_change(pm->run_mode);
        pm->flags &= ~RT_PM_FREQUENCY_PENDING;
        rt_hw_interrupt_enable(level);
    }
}

/**
 * This function selects the sleep mode according to the rt_pm_request/rt_pm_release count.
 */
static rt_uint8_t _pm_select_sleep_mode(struct rt_pm *pm)
{
    int index;
    rt_uint8_t mode;

    mode = _pm_default_deepsleep;
    for (index = PM_SLEEP_MODE_NONE; index < PM_SLEEP_MODE_MAX; index ++)
    {
        if (pm->modes[index])
        {
            mode = index;
            break;
        }
    }
    pm->sleep_mode = mode;

    return mode;
}

/**
 * pm module request delay sleep.
 */
void rt_pm_module_delay_sleep(rt_uint8_t module_id, rt_tick_t timeout)
{
    rt_base_t level;
    struct rt_pm *pm;

    if (_pm_init_flag == 0)
        return;

    if (module_id > (PM_MODULE_MAX_ID - 1))
        return;

    level = rt_hw_interrupt_disable();
    pm = &_pm;
    pm->module_status[module_id].busy_flag = RT_TRUE;
    pm->module_status[module_id].timeout = timeout;
    pm->module_status[module_id].start_time = rt_tick_get();
    rt_hw_interrupt_enable(level);
}

/**
 * This function check if all modules in idle status.
 */
static rt_bool_t _pm_device_check_idle(void)
{
    struct rt_pm *pm;

    if (_pm_init_flag == 0)
        return RT_TRUE;

    pm = &_pm;
    for (int i = 0; i < PM_MODULE_MAX_ID; i++)
    {
        if (pm->module_status[i].busy_flag == RT_TRUE)
        {
            if (rt_tick_get() - pm->module_status[i].start_time > pm->module_status[i].timeout)
            {
                pm->module_status[i].busy_flag = RT_FALSE;
                pm->module_status[i].timeout = 0x00;
            }
        }
        if (pm->module_status[i].busy_flag == RT_TRUE)
        {
            return RT_FALSE;
        }
    }

    return RT_TRUE;
}

/**
 * This function changes the power sleep mode base on the result of selection
 */
static void _pm_change_sleep_mode(struct rt_pm *pm)
{
    rt_tick_t timeout_tick, delta_tick;
    rt_base_t level;
    int ret = RT_EOK;

    level = rt_pm_enter_critical(pm->sleep_mode);

    /* module busy request */
    if (_pm_device_check_idle() == RT_FALSE)
    {
        pm->ops->sleep(pm, PM_SLEEP_MODE_NONE);
        rt_pm_exit_critical(level, pm->sleep_mode);
        return;
    }

    if (_pm.sleep_mode == PM_SLEEP_MODE_NONE)
    {
        pm->ops->sleep(pm, PM_SLEEP_MODE_NONE);
        rt_pm_exit_critical(level, pm->sleep_mode);
    }
    else
    {
        /* Notify app will enter sleep mode */
        if (_pm_notify.notify)
            _pm_notify.notify(RT_PM_ENTER_SLEEP, pm->sleep_mode, _pm_notify.data);

        /* Suspend all peripheral device */
        ret = _pm_device_suspend(pm->sleep_mode);
        if (ret != RT_EOK)
        {
            _pm_device_resume(pm->sleep_mode);
            if (_pm_notify.notify)
                _pm_notify.notify(RT_PM_EXIT_SLEEP, pm->sleep_mode, _pm_notify.data);
            rt_pm_exit_critical(level, pm->sleep_mode);

            return;
        }

        /* Tickless*/
        if (pm->timer_mask & (0x01 << pm->sleep_mode))
        {
            timeout_tick = rt_timer_next_timeout_tick();
            if (timeout_tick == RT_TICK_MAX)
            {
                if (pm->ops->timer_start)
                {
                    pm->ops->timer_start(pm, RT_TICK_MAX);
                }
            }
            else
            {
                timeout_tick = timeout_tick - rt_tick_get();
                if (timeout_tick < RT_PM_TICKLESS_THRESH)
                {
                    pm->sleep_mode = PM_SLEEP_MODE_IDLE;
                }
                else
                {
                    pm->ops->timer_start(pm, timeout_tick);
                }
            }
        }

        /* enter lower power state */
        pm->ops->sleep(pm, pm->sleep_mode);

        /* wake up from lower power state*/
        if (pm->timer_mask & (0x01 << pm->sleep_mode))
        {
            delta_tick = pm->ops->timer_get_tick(pm);
            pm->ops->timer_stop(pm);
            if (delta_tick)
            {
                rt_tick_set(rt_tick_get() + delta_tick);
            }
        }

        /* resume all device */
        _pm_device_resume(pm->sleep_mode);

        if (_pm_notify.notify)
            _pm_notify.notify(RT_PM_EXIT_SLEEP, pm->sleep_mode, _pm_notify.data);

        rt_pm_exit_critical(level, pm->sleep_mode);

        if (pm->timer_mask & (0x01 << pm->sleep_mode))
        {
            if (delta_tick)
            {
                rt_timer_check();
            }
        }
    }
}

/**
 * This function will enter corresponding power mode.
 */
void rt_system_power_manager(void)
{
    if (_pm_init_flag == 0)
        return;

    /* CPU frequency scaling according to the runing mode settings */
    _pm_frequency_scaling(&_pm);

    /* Low Power Mode Processing */
    _pm_change_sleep_mode(&_pm);
}

/**
 * Upper application or device driver requests the system
 * stall in corresponding power mode.
 *
 * @param parameter the parameter of run mode or sleep mode
 */
void rt_pm_request(rt_uint8_t mode)
{
    rt_base_t level;
    struct rt_pm *pm;

    if (_pm_init_flag == 0)
        return;

    if (mode > (PM_SLEEP_MODE_MAX - 1))
        return;

    level = rt_hw_interrupt_disable();
    pm = &_pm;
    if (pm->modes[mode] < 255)
        pm->modes[mode] ++;
    _pm_select_sleep_mode(pm);
    rt_hw_interrupt_enable(level);
}

/**
 * Upper application or device driver releases the stall
 * of corresponding power mode.
 *
 * @param parameter the parameter of run mode or sleep mode
 *
 */
void rt_pm_release(rt_uint8_t mode)
{
    rt_ubase_t level;
    struct rt_pm *pm;

    if (_pm_init_flag == 0)
        return;

    if (mode > (PM_SLEEP_MODE_MAX - 1))
        return;

    level = rt_hw_interrupt_disable();
    pm = &_pm;
    if (pm->modes[mode] > 0)
        pm->modes[mode] --;
    _pm_select_sleep_mode(pm);
    rt_hw_interrupt_enable(level);
}

/**
 * Upper application or device driver releases all the stall
 * of corresponding power mode.
 *
 * @param parameter the parameter of run mode or sleep mode
 *
 */
void rt_pm_release_all(rt_uint8_t mode)
{
    rt_ubase_t level;
    struct rt_pm *pm;

    if (_pm_init_flag == 0)
        return;

    if (mode > (PM_SLEEP_MODE_MAX - 1))
        return;

    level = rt_hw_interrupt_disable();
    pm = &_pm;
    pm->modes[mode] = 0;
    _pm_select_sleep_mode(pm);
    rt_hw_interrupt_enable(level);
}

/**
 * Upper application or device driver requests the system
 * stall in corresponding power mode.
 *
 * @param module_id the application or device module id
 * @param mode the system power sleep mode
 */
void rt_pm_module_request(uint8_t module_id, rt_uint8_t mode)
{
    rt_base_t level;
    struct rt_pm *pm;

    if (_pm_init_flag == 0)
        return;

    if (mode > (PM_SLEEP_MODE_MAX - 1))
        return;

    if (module_id > (PM_MODULE_MAX_ID - 1))
        return;

    level = rt_hw_interrupt_disable();
    pm = &_pm;
    pm->module_status[module_id].req_status = 0x01;
    if (pm->modes[mode] < 255)
        pm->modes[mode] ++;
    _pm_select_sleep_mode(pm);
    rt_hw_interrupt_enable(level);
}

/**
 * Upper application or device driver releases the stall
 * of corresponding power mode.
 *
 * @param module_id the application or device module id
 * @param mode the system power sleep mode
 *
 */
void rt_pm_module_release(uint8_t module_id, rt_uint8_t mode)
{
    rt_ubase_t level;
    struct rt_pm *pm;

    if (_pm_init_flag == 0)
        return;

    if (mode > (PM_SLEEP_MODE_MAX - 1))
        return;

    if (module_id > (PM_MODULE_MAX_ID - 1))
        return;

    level = rt_hw_interrupt_disable();
    pm = &_pm;
    if (pm->modes[mode] > 0)
        pm->modes[mode] --;
    if (pm->modes[mode] == 0)
        pm->module_status[module_id].req_status = 0x00;
    _pm_select_sleep_mode(pm);
    rt_hw_interrupt_enable(level);
}

/**
 * Upper application or device driver releases all the stall
 * of corresponding power mode.
 *
 * @param module_id the application or device module id
 * @param mode the system power sleep mode
 *
 */
void rt_pm_module_release_all(uint8_t module_id, rt_uint8_t mode)
{
    rt_ubase_t level;
    struct rt_pm *pm;

    if (_pm_init_flag == 0)
        return;

    if (mode > (PM_SLEEP_MODE_MAX - 1))
        return;

    level = rt_hw_interrupt_disable();
    pm = &_pm;
    pm->modes[mode] = 0;
    pm->module_status[module_id].req_status = 0x00;
    _pm_select_sleep_mode(pm);
    rt_hw_interrupt_enable(level);
}

/**
 * Register a device with PM feature
 *
 * @param device the device with PM feature
 * @param ops the PM ops for device
 */
void rt_pm_device_register(struct rt_device *device, const struct rt_device_pm_ops *ops)
{
    rt_base_t level;
    struct rt_device_pm *device_pm;

    RT_DEBUG_NOT_IN_INTERRUPT;

    level = rt_hw_interrupt_disable();

    device_pm = (struct rt_device_pm *)RT_KERNEL_REALLOC(_pm.device_pm,
                (_pm.device_pm_number + 1) * sizeof(struct rt_device_pm));
    if (device_pm != RT_NULL)
    {
        _pm.device_pm = device_pm;
        _pm.device_pm[_pm.device_pm_number].device = device;
        _pm.device_pm[_pm.device_pm_number].ops    = ops;
        _pm.device_pm_number += 1;
    }

    rt_hw_interrupt_enable(level);
}

/**
 * Unregister device from PM manager.
 *
 * @param device the device with PM feature
 */
void rt_pm_device_unregister(struct rt_device *device)
{
    rt_ubase_t level;
    rt_uint32_t index;
    RT_DEBUG_NOT_IN_INTERRUPT;

    level = rt_hw_interrupt_disable();

    for (index = 0; index < _pm.device_pm_number; index ++)
    {
        if (_pm.device_pm[index].device == device)
        {
            /* remove current entry */
            for (; index < _pm.device_pm_number - 1; index ++)
            {
                _pm.device_pm[index] = _pm.device_pm[index + 1];
            }

            _pm.device_pm[_pm.device_pm_number - 1].device = RT_NULL;
            _pm.device_pm[_pm.device_pm_number - 1].ops = RT_NULL;

            _pm.device_pm_number -= 1;
            /* break out and not touch memory */
            break;
        }
    }

    rt_hw_interrupt_enable(level);
}

/**
 * This function set notification callback for application
 */
void rt_pm_notify_set(void (*notify)(rt_uint8_t event, rt_uint8_t mode, void *data), void *data)
{
    _pm_notify.notify = notify;
    _pm_notify.data = data;
}

/**
 * This function set default sleep mode when no pm_request
 */
void rt_pm_default_set(rt_uint8_t sleep_mode)
{
    _pm_default_sleep = sleep_mode;
}

/**
 * RT-Thread device interface for PM device
 */
static rt_size_t _rt_pm_device_read(rt_device_t dev,
                                    rt_off_t    pos,
                                    void       *buffer,
                                    rt_size_t   size)
{
    struct rt_pm *pm;
    rt_size_t length;

    length = 0;
    pm = (struct rt_pm *)dev;
    RT_ASSERT(pm != RT_NULL);

    if (pos < PM_SLEEP_MODE_MAX)
    {
        int mode;

        mode = pm->modes[pos];
        length = rt_snprintf(buffer, size, "%d", mode);
    }

    return length;
}

static rt_size_t _rt_pm_device_write(rt_device_t dev,
                                     rt_off_t    pos,
                                     const void *buffer,
                                     rt_size_t   size)
{
    unsigned char request;

    if (size)
    {
        /* get request */
        request = *(unsigned char *)buffer;
        if (request ==  0x01)
        {
            rt_pm_request(pos);
        }
        else if (request == 0x00)
        {
            rt_pm_release(pos);
        }
    }

    return 1;
}

static rt_err_t _rt_pm_device_control(rt_device_t dev,
                                      int         cmd,
                                      void       *args)
{
    rt_uint32_t mode;

    switch (cmd)
    {
    case RT_PM_DEVICE_CTRL_REQUEST:
        mode = (rt_uint32_t)args;
        rt_pm_request(mode);
        break;

    case RT_PM_DEVICE_CTRL_RELEASE:
        mode = (rt_uint32_t)args;
        rt_pm_release(mode);
        break;
    }

    return RT_EOK;
}

int rt_pm_run_enter(rt_uint8_t mode)
{
    rt_base_t level;
    struct rt_pm *pm;

    if (_pm_init_flag == 0)
        return -RT_EIO;

    if (mode > PM_RUN_MODE_MAX)
        return -RT_EINVAL;

    level = rt_hw_interrupt_disable();
    pm = &_pm;
    if (mode < pm->run_mode)
    {
        /* change system runing mode */
        pm->ops->run(pm, mode);
        /* changer device frequency */
        _pm_device_frequency_change(mode);
    }
    else
    {
        pm->flags |= RT_PM_FREQUENCY_PENDING;
    }
    pm->run_mode = mode;
    rt_hw_interrupt_enable(level);

    return RT_EOK;
}

#ifdef RT_USING_DEVICE_OPS
const static struct rt_device_ops pm_ops =
{
    RT_NULL,
    RT_NULL,
    RT_NULL,
    _rt_pm_device_read,
    _rt_pm_device_write,
    _rt_pm_device_control,
};
#endif

/**
 * This function will initialize power management.
 *
 * @param ops the PM operations.
 * @param timer_mask indicates which mode has timer feature.
 * @param user_data user data
 */
void rt_system_pm_init(const struct rt_pm_ops *ops,
                       rt_uint8_t              timer_mask,
                       void                   *user_data)
{
    struct rt_device *device;
    struct rt_pm *pm;

    pm = &_pm;
    device = &(_pm.parent);

    device->type        = RT_Device_Class_PM;
    device->rx_indicate = RT_NULL;
    device->tx_complete = RT_NULL;

#ifdef RT_USING_DEVICE_OPS
    device->ops = &pm_ops;
#else
    device->init        = RT_NULL;
    device->open        = RT_NULL;
    device->close       = RT_NULL;
    device->read        = _rt_pm_device_read;
    device->write       = _rt_pm_device_write;
    device->control     = _rt_pm_device_control;
#endif
    device->user_data   = user_data;

    /* register PM device to the system */
    rt_device_register(device, "pm", RT_DEVICE_FLAG_RDWR);

    rt_memset(pm->modes, 0, sizeof(pm->modes));
    pm->sleep_mode = _pm_default_sleep;

    /* when system power on, set default sleep modes */
    pm->modes[pm->sleep_mode] = 1;
    pm->module_status[PM_POWER_ID].req_status = 1;
    pm->run_mode   = RT_PM_DEFAULT_RUN_MODE;
    pm->timer_mask = timer_mask;

    pm->ops = ops;

    pm->device_pm = RT_NULL;
    pm->device_pm_number = 0;

#if IDLE_THREAD_STACK_SIZE <= 256
    #error "[pm.c ERR] IDLE Stack Size Too Small!"
#endif

    _pm_init_flag = 1;
}

#ifdef RT_USING_FINSH
#include <finsh.h>

static const char *_pm_sleep_str[] = PM_SLEEP_MODE_NAMES;
static const char *_pm_run_str[] = PM_RUN_MODE_NAMES;

static void rt_pm_release_mode(int argc, char **argv)
{
    int mode = 0;
    if (argc >= 2)
    {
        mode = atoi(argv[1]);
    }

    rt_pm_release(mode);
}
MSH_CMD_EXPORT_ALIAS(rt_pm_release_mode, pm_release, release power management mode);

static void rt_pm_release_mode_all(int argc, char **argv)
{
    int mode = 0;
    if (argc >= 2)
    {
        mode = atoi(argv[1]);
    }

    rt_pm_release_all(mode);
}
MSH_CMD_EXPORT_ALIAS(rt_pm_release_mode_all, pm_release_all, release power management mode count);

static void rt_pm_request_mode(int argc, char **argv)
{
    int mode = 0;
    if (argc >= 2)
    {
        mode = atoi(argv[1]);
    }

    rt_pm_request(mode);
}
MSH_CMD_EXPORT_ALIAS(rt_pm_request_mode, pm_request, request power management mode);

static void rt_module_release_mode(int argc, char **argv)
{
    int module = 0;
    int mode = 0;

    if (argc >= 3)
    {
        module = atoi(argv[1]);
        mode = atoi(argv[2]);
    }

    rt_pm_module_release(module, mode);
}
MSH_CMD_EXPORT_ALIAS(rt_module_release_mode, pm_module_release, release module power mode);

static void rt_module_release_mode_all(int argc, char **argv)
{
    int module = 0;
    int mode = 0;

    if (argc >= 3)
    {
        module = atoi(argv[1]);
        mode = atoi(argv[2]);
    }

    rt_pm_module_release_all(module, mode);
}
MSH_CMD_EXPORT_ALIAS(rt_module_release_mode_all, pm_module_release_all, release power management mode count);

static void rt_module_request_mode(int argc, char **argv)
{
    int module = 0;
    int mode = 0;

    if (argc >= 3)
    {
        module = atoi(argv[1]);
        mode = atoi(argv[2]);
    }

    rt_pm_module_request(module, mode);
}
MSH_CMD_EXPORT_ALIAS(rt_module_request_mode, pm_module_request, request power management mode);

static void rt_module_delay_sleep(int argc, char **argv)
{
    int module = 0;
    unsigned int timeout = 0;

    if (argc >= 3)
    {
        module = atoi(argv[1]);
        timeout = atoi(argv[2]);
    }

    rt_pm_module_delay_sleep(module, timeout);
}
MSH_CMD_EXPORT_ALIAS(rt_module_delay_sleep, pm_module_delay, module request delay sleep);

static void rt_pm_run_mode_switch(int argc, char **argv)
{
    int mode = 0;
    if (argc >= 2)
    {
        mode = atoi(argv[1]);
    }

    rt_pm_run_enter(mode);
}
MSH_CMD_EXPORT_ALIAS(rt_pm_run_mode_switch, pm_run, switch power management run mode);

rt_uint32_t rt_pm_module_get_status(void)
{
    rt_uint8_t index = 0;
    struct rt_pm *pm;
    rt_uint32_t req_status = 0x00;
    pm = &_pm;

    for (index = 0; index < PM_MODULE_MAX_ID; index ++)
    {
        if (pm->module_status[index].req_status == 0x01)
            req_status |= 1<<index;
    }

    return req_status;
}

rt_uint8_t rt_pm_get_sleep_mode(void)
{
    struct rt_pm *pm;

    pm = &_pm;
    return pm->sleep_mode;
}

static void rt_pm_dump_status(void)
{
    rt_uint32_t index;
    struct rt_pm *pm;

    pm = &_pm;

    rt_kprintf("| Power Management Mode | Counter | Timer |\n");
    rt_kprintf("+-----------------------+---------+-------+\n");
    for (index = 0; index < PM_SLEEP_MODE_MAX; index ++)
    {
        int has_timer = 0;
        if (pm->timer_mask & (1 << index))
            has_timer = 1;

        rt_kprintf("| %021s | %7d | %5d |\n", _pm_sleep_str[index], pm->modes[index], has_timer);
    }
    rt_kprintf("+-----------------------+---------+-------+\n");

    rt_kprintf("pm current sleep mode: %s\n", _pm_sleep_str[pm->sleep_mode]);
    rt_kprintf("pm current run mode:   %s\n", _pm_run_str[pm->run_mode]);

    rt_kprintf("\n");
    rt_kprintf("| module | busy | start time |  timeout  |\n");
    rt_kprintf("+--------+------+------------+-----------+\n");
    for (index = 0; index < PM_MODULE_MAX_ID; index ++)
    {
        if ((pm->module_status[index].busy_flag == RT_TRUE) ||
            (pm->module_status[index].req_status != 0x00))
        {
            rt_kprintf("|  %04d  |  %d   | 0x%08x | 0x%08x |\n",
                index, pm->module_status[index].busy_flag,
                pm->module_status[index].start_time,
                pm->module_status[index].timeout);
        }
    }
    rt_kprintf("+--------+------+------------+-----------+\n");
}
FINSH_FUNCTION_EXPORT_ALIAS(rt_pm_dump_status, pm_dump, dump power management status);
MSH_CMD_EXPORT_ALIAS(rt_pm_dump_status, pm_dump, dump power management status);
#endif

#endif /* RT_USING_PM */


text:
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>

	<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>/var/log/elasticinbox/elasticinbox.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
			<fileNamePattern>/var/log/elasticinbox/elasticinbox.%i.log</fileNamePattern>
			<minIndex>1</minIndex>
			<maxIndex>5</maxIndex>
		</rollingPolicy>
		<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
			<maxFileSize>10MB</maxFileSize>
		</triggeringPolicy>
		<encoder>
			<pattern>%d{ISO8601} %-5level [%thread] %C{1} [%M:%L] - %msg%n</pattern>
		</encoder>
	</appender>

	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
		<encoder>
            <pattern>%d{ISO8601} %-5level [%thread] %C{1} [%M:%L] - %msg%n</pattern>
		</encoder>
	</appender>

	<appender name="DEVNULL" class="ch.qos.logback.core.FileAppender">
		<file>/dev/null</file>
		<append>true</append>
		<encoder>
			<pattern>%msg%n</pattern>
		</encoder>
	</appender>

	<!-- do not log LMTP connection info, increase log level -->
	<logger name="com.elasticinbox.lmtp.utils.LMTPProtocolLogger" level="WARN">
		<appender-ref ref="FILE" />
	</logger>

	<!-- do not log POP3 connection info, increase log level -->
	<logger name="com.elasticinbox.pop3.utils.POP3ProtocolLogger" level="WARN">
		<appender-ref ref="FILE" />
	</logger>

	<root level="INFO">
		<appender-ref ref="FILE" />
	</root>

</configuration>


text:
namespace sf
{
namespace priv
{

typedef std::vector<IOHIDElementRef> IOHIDElements;

////////////////////////////////////////////////////////////
/// \brief This class manage as a singleton instance the
/// keyboard and mouse states. It's only purpose is
/// to help sf::priv::InputImpl class.
///
////////////////////////////////////////////////////////////
class HIDInputManager : NonCopyable
{
public :

    ////////////////////////////////////////////////////////////
    /// \brief Get the unique instance of the class
    ///
    /// \note Private use only
    ///
    /// \return Reference to the HIDInputManager instance
    ///
    ////////////////////////////////////////////////////////////
    static HIDInputManager& getInstance();

    ////////////////////////////////////////////////////////////
    /// \brief Check if a key is pressed
    ///
    /// \param key Key to check
    ///
    /// \return True if the key is pressed, false otherwise
    ///
    ////////////////////////////////////////////////////////////
    bool isKeyPressed(Keyboard::Key key);

    ////////////////////////////////////////////////////////////
    /// \brief Check if a mouse button is pressed
    ///
    /// \param button Button to check
    ///
    /// \return True if the button is pressed, false otherwise
    ///
    ////////////////////////////////////////////////////////////
    bool isMouseButtonPressed(Mouse::Button button);

public :

    ////////////////////////////////////////////////////////////
    /// \brief Get the usb location ID of a given device
    ///
    /// This location ID is unique and can be used a usb port identifier
    ///
    /// \param device HID device to query
    /// \return the device's location ID or 0 if something went wrong
    ///
    ////////////////////////////////////////////////////////////
    static long getLocationID(IOHIDDeviceRef device);

    ////////////////////////////////////////////////////////////
    /// \brief Create a mask (dictionary) for an IOHIDManager
    ///
    /// \param page  HID page
    /// \param usage HID usage page
    /// \return a retained CFDictionaryRef
    ///
    ////////////////////////////////////////////////////////////
    static CFDictionaryRef copyDevicesMask(UInt32 page, UInt32 usage);

    ////////////////////////////////////////////////////////////
    /// Try to convert a character into a SFML key code.
    ///
    /// Return sf::Keyboard::Unknown if it doesn't match any 'localized' keys.
    ///
    /// By 'localized' I mean keys that depend on the keyboard layout
    /// and might not be the same as the US keycode in some country
    /// (e.g. the keys 'Y' and 'Z' are switched on QWERTZ keyboard and
    /// US keyboard layouts.)
    ///
    ////////////////////////////////////////////////////////////
    static Keyboard::Key localizedKeys(UniChar ch);

    ////////////////////////////////////////////////////////////
    /// Try to convert a virtual keycode into a SFML key code.
    ///
    /// Return sf::Keyboard::Unknown if the keycode is unknown.
    ///
    ////////////////////////////////////////////////////////////
    static Keyboard::Key nonLocalizedKeys(UniChar virtualKeycode);

private :

    ////////////////////////////////////////////////////////////
    /// \brief Default constructor
    ///
    ////////////////////////////////////////////////////////////
    HIDInputManager();

    ////////////////////////////////////////////////////////////
    /// \brief Destructor
    ///
    ////////////////////////////////////////////////////////////
    ~HIDInputManager();

    ////////////////////////////////////////////////////////////
    /// \brief Initialize the keyboard part of this class
    ///
    /// If something went wrong freeUp is called
    ///
    ////////////////////////////////////////////////////////////
    void initializeKeyboard();

    ////////////////////////////////////////////////////////////
    /// \brief Initialize the mouse part of this class
    ///
    /// If something went wrong freeUp is called
    ///
    ////////////////////////////////////////////////////////////
    void initializeMouse();

    ////////////////////////////////////////////////////////////
    /// \brief Load the given keyboard into m_keys
    ///
    /// If the given keyboard has no key this function simply
    /// returns. freeUp is _not_ called because this is not fatal.
    ///
    /// \param keyboard Keyboard to load
    ///
    ////////////////////////////////////////////////////////////
    void loadKeyboard(IOHIDDeviceRef keyboard);

    ////////////////////////////////////////////////////////////
    /// \brief Load the given mouse into m_buttons
    ///
    /// If the given mouse has no button this function simply
    /// returns. freeUp is _not_ called because this is not fatal.
    ///
    /// \param mouse Mouse to load
    ///
    ////////////////////////////////////////////////////////////
    void loadMouse(IOHIDDeviceRef mouse);

    ////////////////////////////////////////////////////////////
    /// \brief Load the given key into m_keys
    ///
    /// freeUp is _not_ called by this function.
    ///
    /// \param key Key to load
    ///
    ////////////////////////////////////////////////////////////
    void loadKey(IOHIDElementRef key);

    ////////////////////////////////////////////////////////////
    /// \brief Load the given button into m_buttons
    ///
    /// freeUp is _not_ called by this function.
    ///
    /// \param button Button to load
    ///
    ////////////////////////////////////////////////////////////
    void loadButton(IOHIDElementRef button);

    ////////////////////////////////////////////////////////////
    /// \brief Release all resources
    ///
    /// Close all connections to any devices, if required
    /// Set m_isValid to false
    ///
    ////////////////////////////////////////////////////////////
    void freeUp();

    ////////////////////////////////////////////////////////////
    /// \brief Filter the devices and return them.
    ///
    /// freeUp is _not_ called by this function.
    ///
    /// \param page  HID page like kHIDPage_GenericDesktop
    /// \param usage HID usage page like kHIDUsage_GD_Keyboard or kHIDUsage_GD_Mouse
    /// \return a retained CFSetRef of IOHIDDeviceRef or NULL
    ///
    ////////////////////////////////////////////////////////////
    CFSetRef copyDevices(UInt32 page, UInt32 usage);

    ////////////////////////////////////////////////////////////
    /// \brief Check if a key / mouse button is pressed
    ///
    /// \param elements HID elements mapping to this key / mouse button
    ///
    /// \return True if the key / button is pressed, false otherwise
    ///
    /// \see isKeyPressed, isMouseButtonPressed
    ///
    ////////////////////////////////////////////////////////////
    bool isPressed(IOHIDElements& elements);

    ////////////////////////////////////////////////////////////
    /// \brief Convert a HID key usage to its corresponding virtual code
    ///
    /// See IOHIDUsageTables.h
    ///
    /// \param usage Any kHIDUsage_Keyboard* usage
    /// \return the virtual code associate with the given HID key usage
    ///         or 0xff if it is associate with no virtual code
    ///
    ////////////////////////////////////////////////////////////
    static UInt8 usageToVirtualCode(UInt32 usage);

private :

    ////////////////////////////////////////////////////////////
    // Member data
    ////////////////////////////////////////////////////////////
    bool              m_isValid;                    ///< If any error occurs this variable is false
    CFDataRef         m_layoutData;                 ///< CFData containing the layout
    UCKeyboardLayout* m_layout;                     ///< Current Keyboard Layout
    IOHIDManagerRef   m_manager;                    ///< HID Manager

    IOHIDElements     m_keys[Keyboard::KeyCount];   ///< All the keys on any connected keyboard
    IOHIDElements     m_buttons[Mouse::ButtonCount];///< All the buttons on any connected mouse

    ////////////////////////////////////////////////////////////
    /// m_keys' index corresponds to sf::Keyboard::Key enum.
    /// if no key is assigned with key XYZ then m_keys[XYZ].size() == 0.
    /// if there are several keyboards connected and several HID keys associate
    /// with the same sf::Keyboard::Key then m_keys[XYZ] contains all these
    /// HID keys.
    ///
    /// m_buttons works the same way.
    ///
    ////////////////////////////////////////////////////////////
};

} // namespace priv

} // namespace sf

#endif


text:
/*
 * generated by Xtext 2.9.1
 */
package org.xtext.example.mydsl.idea.lang;

import org.eclipse.xtext.idea.lang.AbstractXtextLanguage;

public final class MyDslLanguage extends AbstractXtextLanguage {

	public static final MyDslLanguage INSTANCE = new MyDslLanguage();

	private MyDslLanguage() {
		super("org.xtext.example.mydsl.MyDsl");
	}

}


text:
{% extends "layout.html" %}

{% block page_title %}
  Your plea
{% endblock %}

{% block content %}

Back

                Fix the following

How do you plead?

Your plea

This is your chance to respond. Please note:

you're being charged with a criminal offence and you may wish to take legal advice before making your plea

all evidence is in the notice sent to you

if you plead guilty, we will reduce your fine by up to 33%

What you've been charged with

Passenger failing to produce a ticket

On 17 Feb 2017 At Mill Mead Road N17. Being a passenger on a Public service Vehicle operated on behalf of London Bus Services Limited being used for the carriage of passengers at separate fares where the vehicle was being operated by a Driver without a Conductor did not as directed by the Driver an Inspector or a Notice displayed on the vehicle pay the fare for the journey in accordance with the direction.

Enter your plea

            <form class="form" action="" method="post">

                        <fieldset>
                            <legend>

How do you plead?

                                Choose an answer
                            </legend>

                                <input id="radio-1" type="radio" name="how-do-you-plea" value="1">
                                Guilty

                        </fieldset>
                        <fieldset>

                                    You're declaring you committed the offence

                        </fieldset>
                        <fieldset>

                                <input id="radio-2" type="radio" name="how-do-you-plea" value="2">
                                Not guilty

                        </fieldset>

                                You're declaring you didn't commit the offence so you'll need to attend court if you want to present your evidence

                    <input class="button" type="submit" value="Continue">

Back

            </form>

Further links

Help and advice

{% endblock %}


text: helm delete --purge "$@"


text:
declare interface IOrganizationChartWebPartStrings {
  errorMessage: string;
  PropertyPaneDescription: string;
  BasicGroupName: string;
  DescriptionFieldLabel: string;
}

declare module 'OrganizationChartWebPartStrings' {
  const strings: IOrganizationChartWebPartStrings;
  export = strings;
}


text:
import sys
import os

if sys.version_info[0] == 2:
    from urllib import urlretrieve
else:
    from urllib.request import urlretrieve

DATA_DIR = os.path.join(os.path.expanduser('~'), 'datawarehouse')
if not os.path.isdir(DATA_DIR):
    os.mkdir(DATA_DIR)

def get_data_dir():
    return DATA_DIR

# FIXME : Does not change the DATA_DIR global variable !
def set_data_dir(new_data_dir):
    global DATA_DIR
    print('old directory', DATA_DIR)
    if os.path.isdir(new_data_dir):
        print("creating directory :", new_data_dir)
        DATA_DIR = new_data_dir
    print('new directory', DATA_DIR)

def maybe_download(filename, url):
    if not os.path.exists(filename):
        print("downloading " + filename + "...", end='')
        urlretrieve(url, filename)
        print("Done.")


text:
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Citrina
{
    public class FriendsGetSuggestionsResponse
    {
        /// <summary>
        /// Total results number.
        /// </summary>
        public int? Count { get; set; }

        public IEnumerable<UsersUserFull> Items { get; set; }
    }
}


text:
package org.apache.gobblin.cluster;

import java.util.List;
import java.util.concurrent.Callable;

import com.google.common.collect.ImmutableList;

import org.apache.gobblin.annotation.Alpha;
import org.apache.gobblin.configuration.State;
import org.apache.gobblin.metrics.GobblinMetrics;
import org.apache.gobblin.metrics.Tag;

/**
 * Extension of {@link GobblinMetrics} specifically for {@link GobblinTaskRunner}s.
 */
@Alpha
public class ContainerMetrics extends GobblinMetrics {

  protected ContainerMetrics(State containerState, String applicationName, String taskRunnerId) {
    super(name(taskRunnerId), null, tagsForContainer(containerState, applicationName, taskRunnerId));
  }

  /**
   * Get a {@link ContainerMetrics} instance given the {@link State} of a container, the name of the application the
   * container belongs to, and the workerId of the container.
   *
   * @param containerState the {@link State} of the container
   * @param applicationName a {@link String} representing the name of the application the container belongs to
   * @return a {@link ContainerMetrics} instance
   */
  public static ContainerMetrics get(final State containerState, final String applicationName,
      final String workerId) {
    return (ContainerMetrics) GOBBLIN_METRICS_REGISTRY.getOrCreate(name(workerId), new Callable<GobblinMetrics>() {
      @Override public GobblinMetrics call() throws Exception {
        return new ContainerMetrics(containerState, applicationName, workerId);
      }
    });
  }

  private static String name(String workerId) {
    return "gobblin.metrics." + workerId;
  }

  private static List<Tag<?>> tagsForContainer(State containerState, String applicationName, String taskRunnerId) {
    ImmutableList.Builder<Tag<?>> tags = new ImmutableList.Builder<>();
    tags.add(new Tag<>(GobblinClusterMetricTagNames.APPLICATION_NAME, applicationName));
    tags.add(new Tag<>(GobblinClusterMetricTagNames.TASK_RUNNER_ID, taskRunnerId));
    tags.addAll(getCustomTagsFromState(containerState));
    return tags.build();
  }
}


text:
#pragma once
#include <aws/opsworks/OpsWorks_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace OpsWorks
{
namespace Model
{
  /**
   *
Contains the response to a CreateInstance request.

See
   * Also:
   AWS
   * API Reference

   */
  class AWS_OPSWORKS_API CreateInstanceResult
  {
  public:
    CreateInstanceResult();
    CreateInstanceResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    CreateInstanceResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The instance ID.

     */
    inline const Aws::String& GetInstanceId() const{ return m_instanceId; }

    /**
     *
The instance ID.

     */
    inline void SetInstanceId(const Aws::String& value) { m_instanceId = value; }

    /**
     *
The instance ID.

     */
    inline void SetInstanceId(Aws::String&& value) { m_instanceId = std::move(value); }

    /**
     *
The instance ID.

     */
    inline void SetInstanceId(const char* value) { m_instanceId.assign(value); }

    /**
     *
The instance ID.

     */
    inline CreateInstanceResult& WithInstanceId(const Aws::String& value) { SetInstanceId(value); return *this;}

    /**
     *
The instance ID.

     */
    inline CreateInstanceResult& WithInstanceId(Aws::String&& value) { SetInstanceId(std::move(value)); return *this;}

    /**
     *
The instance ID.

     */
    inline CreateInstanceResult& WithInstanceId(const char* value) { SetInstanceId(value); return *this;}

  private:

    Aws::String m_instanceId;
  };

} // namespace Model
} // namespace OpsWorks
} // namespace Aws


text:
/**
 * Check whether a media feature is a range context one
 *
 * @param {string} media feature
 * @return {boolean} If `true`, media feature is a range context one
 */
export default function (mediaFeature) {
  return (
    mediaFeature.indexOf("=") !== -1
    || mediaFeature.indexOf("<") !== -1
    || mediaFeature.indexOf(">") !== -1
  )
}


text:
Any contributions to ``quimb`` in the form of [pull requests](https://github.com/jcmgray/quimb/pulls) are very welcome! Consider also raising an [issue](https://github.com/jcmgray/quimb/issues) first. If this is the first time, the following might be useful introductions to github pull requests:

* [Github - Creating a Pull Request](https://help.github.com/articles/creating-a-pull-request/)
* [Thinkful - Pull Request Tutorial](https://www.thinkful.com/learn/github-pull-request-tutorial/)

Additionally, make sure any new code is properly accompanied by working through the following checklist:

  - [ ] Tests have been added for any new functionality in ``quimb/tests``
  - [ ] All other tests still pass (when running ``pytest`` in the root directory)
  - [ ] Any functions added have [``numpy`` style docstrings](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html)
  - [ ] If suitable, funtionality is documented in ``quimb/docs`` or an example notebook added in ``quimb/docs/examples``
  - [ ] The code is linted with PEP8

Extra developer details can be found [here](http://quimb.readthedocs.io/en/latest/develop.html).

# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
  advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
  address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
  professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org


text:
// If you make changes to this file, you should also make the corresponding change in ReplicationController.

package replicaset

import (
	"fmt"
	"reflect"
	"testing"

	apps "k8s.io/api/apps/v1"
	"k8s.io/api/core/v1"
)

func TestCalculateStatus(t *testing.T) {
	labelMap := map[string]string{"name": "foo"}
	fullLabelMap := map[string]string{"name": "foo", "type": "production"}
	notFullyLabelledRS := newReplicaSet(1, labelMap)
	// Set replica num to 2 for status condition testing (diff < 0, diff > 0)
	fullyLabelledRS := newReplicaSet(2, fullLabelMap)
	longMinReadySecondsRS := newReplicaSet(1, fullLabelMap)
	longMinReadySecondsRS.Spec.MinReadySeconds = 3600

	rsStatusTests := []struct {
		name                     string
		replicaset               *apps.ReplicaSet
		filteredPods             []*v1.Pod
		expectedReplicaSetStatus apps.ReplicaSetStatus
	}{
		{
			"1 fully labelled pod",
			fullyLabelledRS,
			[]*v1.Pod{
				newPod("pod1", fullyLabelledRS, v1.PodRunning, nil, true),
			},
			apps.ReplicaSetStatus{
				Replicas:             1,
				FullyLabeledReplicas: 1,
				ReadyReplicas:        1,
				AvailableReplicas:    1,
			},
		},
		{
			"1 not fully labelled pod",
			notFullyLabelledRS,
			[]*v1.Pod{
				newPod("pod1", notFullyLabelledRS, v1.PodRunning, nil, true),
			},
			apps.ReplicaSetStatus{
				Replicas:             1,
				FullyLabeledReplicas: 0,
				ReadyReplicas:        1,
				AvailableReplicas:    1,
			},
		},
		{
			"2 fully labelled pods",
			fullyLabelledRS,
			[]*v1.Pod{
				newPod("pod1", fullyLabelledRS, v1.PodRunning, nil, true),
				newPod("pod2", fullyLabelledRS, v1.PodRunning, nil, true),
			},
			apps.ReplicaSetStatus{
				Replicas:             2,
				FullyLabeledReplicas: 2,
				ReadyReplicas:        2,
				AvailableReplicas:    2,
			},
		},
		{
			"2 not fully labelled pods",
			notFullyLabelledRS,
			[]*v1.Pod{
				newPod("pod1", notFullyLabelledRS, v1.PodRunning, nil, true),
				newPod("pod2", notFullyLabelledRS, v1.PodRunning, nil, true),
			},
			apps.ReplicaSetStatus{
				Replicas:             2,
				FullyLabeledReplicas: 0,
				ReadyReplicas:        2,
				AvailableReplicas:    2,
			},
		},
		{
			"1 fully labelled pod, 1 not fully labelled pod",
			notFullyLabelledRS,
			[]*v1.Pod{
				newPod("pod1", notFullyLabelledRS, v1.PodRunning, nil, true),
				newPod("pod2", fullyLabelledRS, v1.PodRunning, nil, true),
			},
			apps.ReplicaSetStatus{
				Replicas:             2,
				FullyLabeledReplicas: 1,
				ReadyReplicas:        2,
				AvailableReplicas:    2,
			},
		},
		{
			"1 non-ready pod",
			fullyLabelledRS,
			[]*v1.Pod{
				newPod("pod1", fullyLabelledRS, v1.PodPending, nil, true),
			},
			apps.ReplicaSetStatus{
				Replicas:             1,
				FullyLabeledReplicas: 1,
				ReadyReplicas:        0,
				AvailableReplicas:    0,
			},
		},
		{
			"1 ready but non-available pod",
			longMinReadySecondsRS,
			[]*v1.Pod{
				newPod("pod1", longMinReadySecondsRS, v1.PodRunning, nil, true),
			},
			apps.ReplicaSetStatus{
				Replicas:             1,
				FullyLabeledReplicas: 1,
				ReadyReplicas:        1,
				AvailableReplicas:    0,
			},
		},
	}

	for _, test := range rsStatusTests {
		replicaSetStatus := calculateStatus(test.replicaset, test.filteredPods, nil)
		if !reflect.DeepEqual(replicaSetStatus, test.expectedReplicaSetStatus) {
			t.Errorf("%s: unexpected replicaset status: expected %v, got %v", test.name, test.expectedReplicaSetStatus, replicaSetStatus)
		}
	}
}

func TestCalculateStatusConditions(t *testing.T) {
	labelMap := map[string]string{"name": "foo"}
	rs := newReplicaSet(2, labelMap)
	replicaFailureRS := newReplicaSet(10, labelMap)
	replicaFailureRS.Status.Conditions = []apps.ReplicaSetCondition{
		{
			Type:   apps.ReplicaSetReplicaFailure,
			Status: v1.ConditionTrue,
		},
	}

	rsStatusConditionTests := []struct {
		name                         string
		replicaset                   *apps.ReplicaSet
		filteredPods                 []*v1.Pod
		manageReplicasErr            error
		expectedReplicaSetConditions []apps.ReplicaSetCondition
	}{

		{
			"manageReplicasErr != nil && failureCond == nil, diff < 0",
			rs,
			[]*v1.Pod{
				newPod("pod1", rs, v1.PodRunning, nil, true),
			},
			fmt.Errorf("fake manageReplicasErr"),
			[]apps.ReplicaSetCondition{
				{
					Type:    apps.ReplicaSetReplicaFailure,
					Status:  v1.ConditionTrue,
					Reason:  "FailedCreate",
					Message: "fake manageReplicasErr",
				},
			},
		},
		{
			"manageReplicasErr != nil && failureCond == nil, diff > 0",
			rs,
			[]*v1.Pod{
				newPod("pod1", rs, v1.PodRunning, nil, true),
				newPod("pod2", rs, v1.PodRunning, nil, true),
				newPod("pod3", rs, v1.PodRunning, nil, true),
			},
			fmt.Errorf("fake manageReplicasErr"),
			[]apps.ReplicaSetCondition{
				{
					Type:    apps.ReplicaSetReplicaFailure,
					Status:  v1.ConditionTrue,
					Reason:  "FailedDelete",
					Message: "fake manageReplicasErr",
				},
			},
		},
		{
			"manageReplicasErr == nil && failureCond != nil",
			replicaFailureRS,
			[]*v1.Pod{
				newPod("pod1", replicaFailureRS, v1.PodRunning, nil, true),
			},
			nil,
			nil,
		},
		{
			"manageReplicasErr != nil && failureCond != nil",
			replicaFailureRS,
			[]*v1.Pod{
				newPod("pod1", replicaFailureRS, v1.PodRunning, nil, true),
			},
			fmt.Errorf("fake manageReplicasErr"),
			[]apps.ReplicaSetCondition{
				{
					Type:   apps.ReplicaSetReplicaFailure,
					Status: v1.ConditionTrue,
				},
			},
		},
		{
			"manageReplicasErr == nil && failureCond == nil",
			rs,
			[]*v1.Pod{
				newPod("pod1", rs, v1.PodRunning, nil, true),
			},
			nil,
			nil,
		},
	}

	for _, test := range rsStatusConditionTests {
		replicaSetStatus := calculateStatus(test.replicaset, test.filteredPods, test.manageReplicasErr)
		// all test cases have at most 1 status condition
		if len(replicaSetStatus.Conditions) > 0 {
			test.expectedReplicaSetConditions[0].LastTransitionTime = replicaSetStatus.Conditions[0].LastTransitionTime
		}
		if !reflect.DeepEqual(replicaSetStatus.Conditions, test.expectedReplicaSetConditions) {
			t.Errorf("%s: unexpected replicaset status: expected %v, got %v", test.name, test.expectedReplicaSetConditions, replicaSetStatus.Conditions)
		}
	}
}


text:
<!doctype html>
<html>
  <head>
    <meta charset="utf8" />
    <title>Simple localForage example</title>
  </head>
  <body>
    <script src="../dist/localforage.js"></script>
    <script>
      var key = 'STORE_KEY';
      var value = 'What we save offline';
      var UNKNOWN_KEY = 'unknown_key';

      localforage.setItem(key, value, function() {
        console.log('Saved: ' + value);

        localforage.getItem(key, function(readValue) {
          console.log('Read: ', readValue);
        });
      });

      // Since this key hasn't been set yet, we'll get a null value
      localforage.getItem(UNKNOWN_KEY, function(readValue) {
        console.log('Result of reading ' + UNKNOWN_KEY, readValue);
      });
    </script>
  </body>
</html>


text:
namespace Albumprinter.Features
{
    public enum FeaturesBootstrapState
    {
        None,
        Starting,
        ActivateFeatures,
        ActivatedFeatures,
        RegisterServices,
        RegisteredServices,
        RegisterMiddleware,
        RegisteredMiddleware,
        StartShell,
        StartedShell,
        Started,
        Stoping,
        DeactivateFeatures,
        DeactivatedFeatures,
        Stoped
    }
}


text:
package org.zstack.header.identity;

import org.zstack.header.message.APIParam;
import org.zstack.header.message.APISyncCallMessage;

/**
 * Created by frank on 2/22/2016.
 */
@Action(category = AccountConstant.ACTION_CATEGORY, accountOnly = true)
public class APIGetAccountQuotaUsageMsg extends APISyncCallMessage implements AccountMessage {
    @APIParam(resourceType = AccountVO.class, checkAccount = true, operationTarget = true, required = false)
    private String uuid;

    @Override
    public String getAccountUuid() {
        return uuid;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }
}


text:
body {
    padding-top: 60px;
    padding-bottom: 40px;
}

/* styles for removing the background from form */
.no-color {
  background-color: white;
  border-style:none;
}

.comment-content {
    overflow: hidden;
    white-space: nowrap;
    -moz-text-overflow: ellipsis;
    text-overflow: ellipsis;
    width: 650px;
}

#commentHolder {
    margin-bottom: 10px;
}

.inline-element label {
    display: inline;
    vertical-align: baseline;
    float: left;
    margin: 5px;
}

#NavigationMenu + div {
    clear: none !important;
}

#post-content {
    width: 100%;
}

.nav-dynamic {
    background: #333333;
}

.cell-center {
    text-align: center !important;
}


text:
package com.ibm.mqlight.api.impl.logging;

import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Map.Entry;
import java.util.jar.Attributes;
import java.util.jar.Manifest;

import com.ibm.mqlight.api.logging.Logger;
import com.ibm.mqlight.api.logging.LoggerFactory;

/**
 * Provides information about the product version.
 */
public class Version {

  private static final Class<Version> cclass = Version.class;

  private static final Logger logger = LoggerFactory.getLogger(cclass);

  /**
   * obtains the MQ Light version information from the manifest.
   *
   * @return The MQ Light version.
   */
  public static String getVersion() {
    String version = "unknown";
    final URLClassLoader cl = (URLClassLoader)cclass.getClassLoader();
    try {
      final URL url = cl.findResource("META-INF/MANIFEST.MF");
      final Manifest manifest = new Manifest(url.openStream());
      for (Entry<Object,Object> entry : manifest.getMainAttributes().entrySet()) {
        final Attributes.Name key = (Attributes.Name)entry.getKey();
        if(Attributes.Name.IMPLEMENTATION_VERSION.equals(key)) {
          version = (String)entry.getValue();
        }
      }
    } catch (IOException e) {
      logger.error("Unable to determine the product version due to error", e);
    }
    return version;
  }
}


text:
import {LocalizedStringBundleDef, LocalizedStringId} from '../localization';

/**
 * Localized string bundle used for Dutch strings.
 * @const {!LocalizedStringBundleDef}
 */
export default {
  [LocalizedStringId.AMP_STORY_CONSENT_ACCEPT_BUTTON_LABEL]: {
    string: 'Accepteer',
  },
  [LocalizedStringId.AMP_STORY_CONSENT_DECLINE_BUTTON_LABEL]: {
    string: 'Wijs af',
  },
  [LocalizedStringId.AMP_STORY_DOMAIN_DIALOG_HEADING_LABEL]: {
    string: 'Bekijk op origineel domein:',
  },
  [LocalizedStringId.AMP_STORY_DOMAIN_DIALOG_HEADING_LINK]: {
    string: 'Meer over AMP-resultaten',
  },
  [LocalizedStringId.AMP_STORY_HINT_UI_NEXT_LABEL]: {
    string: 'Tik op Volgende',
  },
  [LocalizedStringId.AMP_STORY_HINT_UI_PREVIOUS_LABEL]: {
    string: 'Tik op Terug',
  },
  [LocalizedStringId.AMP_STORY_SHARING_CLIPBOARD_FAILURE_TEXT]: {
    string: 'Link kon niet naar naar het klembord gekopieerd worden :(',
  },
  [LocalizedStringId.AMP_STORY_SHARING_CLIPBOARD_SUCCESS_TEXT]: {
    string: 'Link gekopieerd!',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_EMAIL]: {
    string: 'Email',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_FACEBOOK]: {
    string: 'Facebook',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_GOOGLE_PLUS]: {
    string: 'Google+',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_LINK]: {
    string: 'Link selecteren',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_LINKEDIN]: {
    string: 'LinkedIn',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_PINTEREST]: {
    string: 'Pinterest',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_SMS]: {
    string: 'SMS',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_SYSTEM]: {
    string: 'Meer',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_TUMBLR]: {
    string: 'Tumblr',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_TWITTER]: {
    string: 'Twitter',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_WHATSAPP]: {
    string: 'Whatsapp',
  },
  [LocalizedStringId.AMP_STORY_SYSTEM_LAYER_SHARE_WIDGET_LABEL]: {
    string: 'Deel',
  },
  [LocalizedStringId.AMP_STORY_WARNING_DESKTOP_SIZE_TEXT]: {
    string: 'Vergroot je venster om deze inhoud te bekijken',
  },
  [LocalizedStringId.AMP_STORY_WARNING_EXPERIMENT_DISABLED_TEXT]: {
    string: 'U moet het amp-story-experiment inschakelen om deze inhoud te ' +
        'kunnen bekijken',
  },
  [LocalizedStringId.AMP_STORY_WARNING_LANDSCAPE_ORIENTATION_TEXT]: {
    string: 'De pagina kan het best bekeken worden in portretmodus',
  },
  [LocalizedStringId.AMP_STORY_WARNING_UNSUPPORTED_BROWSER_TEXT]: {
    string: 'Helaas lijkt het erop dat uw browser deze inhoud niet ondersteunt',
  },
};


text:
"use strict";

var getId = function () {
    var id = 0;
    return function () {
        return id++;
    };
}();

var AddTodoController = Relacx.controller(AddTodo);
AddTodoController.addAction("add", function () {
    var value = this.getState().value;
    this.action("TODO_ADDED", value)();
});
AddTodoController.addAction("changeAction", function (e) {
    var text = e.target.value;
    this.setState({
        value: text
    });
});
AddTodoController.addAction("onKeyPress", function (e) {
    if (e.charCode === 13) {
        var value = this.getState().value;
        this.action("TODO_ADDED", value)();
    }
});

//AddTodoController.addAction("addTodo", function(todo){
//    this.setState({
//        value: ""
//    });
//    Relacx.broadcastAction("TODO_ADDED", todo);
//});

AddTodoController.addBroadcastAction("TODO_ADDED", function (todo) {
    this.setState({
        value: ""
    });
    return todo;
});

var TodoListController = Relacx.controller(TodoList);
TodoListController.addActionListener("TODO_ADDED", function (action, data) {
    var list = this.getState().list;
    list = list.slice();
    list.push({
        todoItem: data,
        id: getId()
    });
    this.setState({
        list: list
    });
});
TodoListController.addActionListener("TODO_DELETED", function (action, id) {
    var list = this.getState().list;
    list = list.slice();

    var index = list.reduce(function (acc, item, index) {
        if (item.id === id) {
            return index;
        }
        return acc;
    }, 0);

    list.splice(index, 1);
    this.setState({
        list: list
    });
});

var ToDoItemController = Relacx.controller(TodoItem);
ToDoItemController.addAction("delete", function (id) {
    Relacx.broadcastAction("TODO_DELETED", id);
});

var TodoNotificationController = Relacx.controller(TodoNotification);
TodoNotificationController.addActionListener(["TODO_ADDED", "TODO_DELETED"], function (action, data) {
    var msg = "";

    switch (action) {
        case "TODO_ADDED":
            msg = "New todo added.";
            break;
        case "TODO_DELETED":
            msg = "Todo Deleted";
            break;
    }

    this.setState({
        notification: msg
    });

    setTimeout(function () {
        return Relacx.broadcastAction("REMOVE_NOTIFICATION");
    }, 3000);
});

TodoNotificationController.addActionListener("REMOVE_NOTIFICATION", function () {
    this.setState({
        notification: ""
    });
});

window.addEventListener("load", function () {
    var appState = {
        addTodo: { value: "" },
        todoList: { list: [] },
        notification: { notification: "" }
    };

    Relacx.render(TodoApp, document.getElementById("app"), {
        state: appState
    });
});


text:
{% extends "autoreports/autoreports_form.html" %}
{% load i18n staticfiles %}

{% block extrahead %}
    {% url 'admin:jsi18n' as jsi18nurl %}

    {{ block.super }}
    <link href="{% static 'admin/css/forms.css' %}" type="text/css" rel="stylesheet">
    <link href="{% static 'autoreports/admin_autoreports.css' %}" type="text/css" rel="stylesheet">
{% endblock %}

{% block content_title %}{% endblock %}

{% block breadcrumbs %}{% if not is_popup %}

     {% trans "Home" %} ›
     {% trans opts.app_label.title %} ›
     {{ opts.verbose_name_plural|capfirst }} ›
     {% if report %}
        {% trans "Reports" %} ›
        {{ report }}
     {% else %}
        {% trans "Report Form" %}
     {% endif %}

{% endif %}{% endblock %}

{% block contentform %}
    {% if report %}

            {% blocktrans with cl.opts.verbose_name as name %}Edit {{ report }}{% endblocktrans %}

    {% endif %}
    {{ form_filter.as_django_admin }}
    {{ form_display.as_django_admin }}
{% endblock %}

{% block contentmain %}
    {{ block.super }}

{% trans "Results" %}

{% endblock %}


text:
def factorial(number):
  if number == 1:
    return 1

  return number * factorial(number - 1)