text:
package com.steazzalini.clangformatter.highlighter;

import com.intellij.lexer.FlexAdapter;
import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import com.intellij.ui.JBColor;
import com.steazzalini.clangformatter.grammar.StyleSheetLexer;
import com.steazzalini.clangformatter.grammar.StyleSheetTypes;
import org.jetbrains.annotations.NotNull;
import java.awt.*;
import java.io.Reader;

import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey;

public class StyleSheetSyntaxHighlighter extends SyntaxHighlighterBase {

    public static final TextAttributesKey SEPARATOR = createTextAttributesKey("SIMPLE_SEPARATOR", DefaultLanguageHighlighterColors.OPERATION_SIGN);
    public static final TextAttributesKey KEY = createTextAttributesKey("SIMPLE_KEY", DefaultLanguageHighlighterColors.KEYWORD);
    public static final TextAttributesKey VALUE = createTextAttributesKey("SIMPLE_VALUE", DefaultLanguageHighlighterColors.STRING);
    public static final TextAttributesKey COMMENT = createTextAttributesKey("SIMPLE_COMMENT", DefaultLanguageHighlighterColors.LINE_COMMENT);

    static final TextAttributesKey BAD_CHARACTER = createTextAttributesKey("SIMPLE_BAD_CHARACTER",
            new TextAttributes(JBColor.RED, null, null, null, Font.BOLD));

    private static final TextAttributesKey[] BAD_CHAR_KEYS = new TextAttributesKey[]{BAD_CHARACTER};
    private static final TextAttributesKey[] SEPARATOR_KEYS = new TextAttributesKey[]{SEPARATOR};
    private static final TextAttributesKey[] KEY_KEYS = new TextAttributesKey[]{KEY};
    private static final TextAttributesKey[] VALUE_KEYS = new TextAttributesKey[]{VALUE};
    private static final TextAttributesKey[] COMMENT_KEYS = new TextAttributesKey[]{COMMENT};
    private static final TextAttributesKey[] EMPTY_KEYS = new TextAttributesKey[0];

    @NotNull
    @Override
    public Lexer getHighlightingLexer() {
        return new FlexAdapter(new StyleSheetLexer((Reader) null));
    }

    @NotNull
    @Override
    public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
        if (tokenType.equals(StyleSheetTypes.SEPARATOR)) {
            return SEPARATOR_KEYS;
        } else if (tokenType.equals(StyleSheetTypes.KEY)) {
            return KEY_KEYS;
        } else if (tokenType.equals(StyleSheetTypes.VALUE)) {
            return VALUE_KEYS;
        } else if (tokenType.equals(StyleSheetTypes.COMMENT)) {
            return COMMENT_KEYS;
        } else if (tokenType.equals(TokenType.BAD_CHARACTER)) {
            return BAD_CHAR_KEYS;
        } else {
            return EMPTY_KEYS;
        }
    }
}


text:
/*
 * RIPEMD160 low level APIs are deprecated for public use, but still ok for
 * internal use.
 */
#include "internal/deprecated.h"

#include <openssl/crypto.h>
#include <openssl/ripemd.h>
#include "prov/digestcommon.h"
#include "prov/implementations.h"

/* ossl_ripemd160_functions */
IMPLEMENT_digest_functions(ripemd160, RIPEMD160_CTX,
                           RIPEMD160_CBLOCK, RIPEMD160_DIGEST_LENGTH, 0,
                           RIPEMD160_Init, RIPEMD160_Update, RIPEMD160_Final)

redpajama_set_name: RedPajamaGithub


text:
import { forEach, isObject, map } from 'lodash';

function hashSimpleValue(str) {
  const strValue = '' + str;
  let hashValue = 5381;
  let i = strValue.length;

  while (i) {
    hashValue = (hashValue * 33) ^ strValue.charCodeAt(--i);
  }
  /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
     * integers. Since we want the results to be always positive, convert the
     * signed int to an unsigned by doing an unsigned bitshift. */
  return hashValue >>> 0;
}

export function hash(ArrayOrValue) {
  if (!ArrayOrValue) {
    return ArrayOrValue;
  }
  if (Array.isArray(ArrayOrValue)) {
    return map(ArrayOrValue, (element) => {
      return hash(element);
    });
  } else if (isObject(ArrayOrValue)) { // eslint-disable-line
    const result = {};
    forEach(ArrayOrValue, (value, key) => {
      result[key] = hash(value);
    });
    return result;
  }
  return hashSimpleValue(ArrayOrValue);
}


text:
.smilies-selector-content {
    margin:0 -6px;
    max-width:130px;
}
[class^='smiley-'], [class*=' smiley-'] {
    display: inline-block;
}
[class^='smiley-'], [class*=' smiley-'] { background-image:url('angular-smilies.png'); width:18px; height:18px; }
.smiley-biggrin { background-position:0 0; }
.smiley-confused { background-position:-18px 0; }
.smiley-cool { background-position:-36px 0; }
.smiley-cry { background-position:-54px 0; }
.smiley-eek { background-position:-72px 0; }
.smiley-evil { background-position:-90px 0; }
.smiley-like { background-position:-108px 0; }
.smiley-lol { background-position:-126px 0; }
.smiley-love { background-position:-144px 0; }
.smiley-mad { background-position:-162px 0; }
.smiley-mrgreen { background-position:-180px 0; }
.smiley-neutral { background-position:-198px 0; }
.smiley-question { background-position:-216px 0; }
.smiley-razz { background-position:-234px 0; }
.smiley-redface { background-position:-252px 0; }
.smiley-rolleyes { background-position:-270px 0; }
.smiley-sad { background-position:-288px 0; }
.smiley-smile { background-position:-306px 0; }
.smiley-surprised { background-position:-324px 0; }
.smiley-thumbdown { background-position:-342px 0; }
.smiley-thumbup { background-position:-360px 0; }
.smiley-twisted { background-position:-378px 0; }
.smiley-wink { background-position:-396px 0; }


text:
package main

import (
	"fmt"
	"singleton"
)

func main() {
	object1 := singleton.GetInstance()
	fmt.Println(object1.GetName()) // test1

	object2 := singleton.GetInstance()
	object2.SetName("test2")
	fmt.Println(object2.GetName()) // test2
}


text:
<?php

if(!defined("IN_SB")){echo "You should not be here. Only follow links!";die();}
global $theme, $userbank;
if(!isset($_GET['id']))
{
	echo '';
	PageDie();
}
if(!$userbank->HasAccess(ADMIN_OWNER|ADMIN_EDIT_MODS))
{
	$log = new CSystemLog("w", "Hacking Attempt", $userbank->GetProperty("user") . " tried to edit a mod, but doesnt have access.");
	echo '

	Error

	You are not allowed to edit mods.

';
	PageDie();
}

$_GET['id'] = (int)$_GET['id'];
$res = $GLOBALS['db']->GetRow("
    				SELECT name, modfolder, icon, enabled, steam_universe
    				FROM ".DB_PREFIX."_mods
    				WHERE mid = ?", array($_GET['id']));

$errorScript = "";

if(isset($_POST['name']))
{
	// Form validation
	$error = 0;

	if(empty($_POST['name']))
	{
		$error++;
		$errorScript .= "$('name.msg').innerHTML = 'You must type a name for the mod.';";
		$errorScript .= "$('name.msg').setStyle('display', 'block');";
	}
	else
	{
		// Already there?
		$check = $GLOBALS['db']->GetRow("SELECT * FROM `" . DB_PREFIX . "_mods` WHERE name = ? AND mid != ?;", array($_POST['name'], $_GET['id']));
		if(!empty($check))
		{
			$error++;
			$errorScript .= "$('name.msg').innerHTML = 'A mod with that name already exists.';";
			$errorScript .= "$('name.msg').setStyle('display', 'block');";
		}
	}
	if(empty($_POST['folder']))
	{
		$error++;
		$errorScript .= "$('folder.msg').innerHTML = 'You must enter mod\'s folder name.';";
		$errorScript .= "$('folder.msg').setStyle('display', 'block');";
	}
	else
	{
		// Already there?
		$check = $GLOBALS['db']->GetRow("SELECT * FROM `" . DB_PREFIX . "_mods` WHERE modfolder = ? AND mid != ?;", array($_POST['folder'], $_GET['id']));
		if(!empty($check))
		{
			$error++;
			$errorScript .= "$('folder.msg').innerHTML = 'A mod using that folder already exists.';";
			$errorScript .= "$('folder.msg').setStyle('display', 'block');";
		}
	}

	$name = htmlspecialchars(strip_tags($_POST['name']));//don't want to addslashes because execute will automatically do it
	$icon = htmlspecialchars(strip_tags($_POST['icon_hid']));
	$folder = htmlspecialchars(strip_tags($_POST['folder']));
	$enabled = ($_POST['enabled'] == '1' ? 1 : 0);
	$steam_universe = (int)$_POST['steam_universe'];

	if($error == 0)
	{
		if($res['icon']!=$_POST['icon_hid'])
			@unlink(SB_ICONS."/".$res['icon']);

		$edit = $GLOBALS['db']->Execute("UPDATE ".DB_PREFIX."_mods SET
										`name` = ?, `modfolder` = ?, `icon` = ?, `enabled` = ?, `steam_universe` = ?
										WHERE `mid` = ?", array($name, $folder, $icon, $enabled, $steam_universe, $_GET['id']));
		echo '';
	}

	// put into array to display new values after submit
	$res['name'] = $name;
	$res['modfolder'] = $folder;
	$res['icon'] = $icon;
	$res['enabled'] = $enabled;
	$res['steam_universe'] = $steam_universe;
}
if(!$res)
	echo '';

$theme->assign('mod_icon', $res['icon']);
$theme->assign('folder', $res['modfolder']);
$theme->assign('name', $res['name']);
$theme->assign('steam_universe', $res['steam_universe']);
?>

<?php $theme->display('page_admin_edit_mod.tpl'); ?>


text:
<title>ECB - the Emacs Code Browser</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name=description content="ECB - the Emacs Code Browser">
<meta name=generator content="makeinfo 4.2">
<link href="http://www.gnu.org/software/texinfo/" rel=generator-home>

Node:Filtering Directories,
Next:Filtering Sources,
Previous:Filtering the tree-buffers,
Up:Filtering the tree-buffers

Applying filters to the Directories-buffer

With the option ecb-excluded-directories-regexps certain
directories can be excluded from being displayed in the
directories-browser of ECB. This can be done by defining regular
expressions. If the name of a directory matches at least one of the
regexps of this option the directory is not displayed in the
directories-tree-buffer.

The option ecb-sources-exclude-cvsignore allows to exclude
source-files from the sources-tree-buffer if their name is listed in a
so called .cvsignore-file. This option is a list of regular
expressions and if a directory-name matches at least one of these
regexps then all files listed in the .cvsignore-file of this
directory are not displayed in the sources-tree-buffer.


text:
<?php
namespace Rails\Exception\PHPError;

class UserDeprecatedException extends AbstractException
{
    protected $title = 'PHP User Deprecated Notice';
}


text:
using System;
using System.Globalization;
using System.Text;
using System.Collections.Generic;

namespace Enyim.Caching.Memcached.Protocol.Text
{
	public class StoreOperation : StoreOperationBase, IStoreOperation
	{
		private StoreMode mode;

		internal StoreOperation(StoreMode mode, string key, CacheItem value, uint expires)
			: base((StoreCommand)mode, key, value, expires, 0)
		{
			this.mode = mode;
		}

		StoreMode IStoreOperation.Mode
		{
			get { return this.mode; }
		}
	}
}

#region [ License information          ]

#endregion


text:
Leaderboards

{{leaderboards.length}} leaderboards found.

<ngb-alert [dismissible]="false" type="danger" *ngIf="error">

Error while processing request: {{error}}

</ngb-alert>

    Leaderboard ID
    Sort Order
    Operator
    Reset Schedule
    Authoritative
    Tournament
    Remove

      {{l.id}}
      {{orderString[l.sort_order]}}
      {{operatorString[l.operator]}}
      {{l.reset_schedule === '' ? '-' : l.reset_schedule}}
      Yes
      No
      Yes
      No
      <button type="button" class="btn btn-sm btn-danger" (click)="deleteLeaderboard($event, i, l);">Delete</button>

No leaderboards were found.


text:
package org.exist.indexing.lucene;

/** Based on ISOLatin1AccentAnalyzer by Mike Sokolov, generous thanks go
 *  to him. Edited by Tom Wrobel (thomas.wrobel@classics.ox.ac.uk)
**/

import org.apache.lucene.analysis.*;
import org.apache.lucene.analysis.standard.*;
import java.io.Reader;
import java.util.Set;

/**
 * Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link
 * LowerCaseFilter}, {@link DiacriticFilter} and {@link StopFilter}.
*/
public class DMLBSAccentAnalyzer extends Analyzer {
  private Set<String> stopSet;

  /** An array containing some common English words that are usually not
  useful for searching. */
  public static final String[] STOP_WORDS = StopAnalyzer.ENGLISH_STOP_WORDS;

  /** Builds an analyzer. */
  public DMLBSAccentAnalyzer() {
    this(STOP_WORDS);
  }

  /** Builds an analyzer with the given stop words. */
  public DMLBSAccentAnalyzer(String[] stopWords) {
    stopSet = StopFilter.makeStopSet(stopWords);
  }

  /** Constructs a {@link StandardTokenizer} filtered by a {@link
  StandardFilter}, a {@link LowerCaseFilter} and a {@link StopFilter}. */
  public TokenStream tokenStream(String fieldName, Reader reader) {
    TokenStream result = new StandardTokenizer(reader);
    result = new StandardFilter(result);
    result = new LowerCaseFilter(result);
    result = new org.exist.indexing.lucene.DMLBSAccentFilter(result);
    //result = new ASCIIFoldingFilter(result);
    result = new StopFilter(result, stopSet);
    return result;
  }
}


text:
<?php

namespace Aws\Tests\DynamoDb\Session;

use Aws\DynamoDb\DynamoDbClient;
use Aws\DynamoDb\Exception\ResourceNotFoundException;
use Aws\DynamoDb\Model\BatchRequest\PutRequest;
use Aws\DynamoDb\Model\BatchRequest\WriteRequestBatch;
use Aws\DynamoDb\Model\Item;
use Aws\DynamoDb\Session\SessionHandler;
use Aws\Common\Enum\Time;

/**
 * @group integration
 */
class IntegrationTest extends \Aws\Tests\IntegrationTestCase
{
    /**
     * @var string DynamoDB table name
     */
    public $table;

    /**
     * @var string Hash key name
     */
    public $hashKey;

    /**
     * @var DynamoDbClient
     */
    public $client;

    /**
     * @var SessionHandler
     */
    public $handler;

    public static function setUpBeforeClass()
    {
        self::deleteSessionsTable();
    }

    public static function tearDownAfterClass()
    {
        self::deleteSessionsTable();
    }

    public function setUp()
    {
        $this->table   = self::getResourcePrefix() . '-php-sessions-test';
        $this->hashKey = 'id';
        $this->client  = self::getServiceBuilder()->get('dynamodb');
    }

    /**
     * Ensures that a DynamoDB table for sessions can be created
     */
    public function testCreatesTable()
    {
        $sh = SessionHandler::factory(array(
            'dynamodb_client' => $this->client,
            'table_name'      => $this->table,
        ));

        self::log("Creating sessions table {$this->table}");
        $sh->createSessionsTable(25, 25);

        self::log("Ensuring the table {$this->table} was created");
        $result = $this->client->describeTable(array('TableName' => $this->table));
        $this->assertEquals($this->table, $result['Table']['TableName']);
    }

    /**
     * Ensures that session storage is working properly
     */
    public function testGeneralSessionStorage()
    {
        session_id('example');
        $sh = SessionHandler::factory(array(
            'dynamodb_client' => $this->client,
            'table_name'      => $this->table,
            'hash_key'        => $this->hashKey,
        ));

        self::log('Start with an empty session, add data, and commit');
        $this->simulateSessionStart($sh);
        $this->assertEquals(array(), $_SESSION, '[1] The session was not empty.');
        $_SESSION['foo'] = 'bar';
        $this->simulateSessionCommit($sh);
        $this->assertEquals(array('foo' => 'bar'), $_SESSION, '[2] The data was not stored in $_SESSION.');
        $_SESSION = array();

        self::log('Check if session data made it into DynamoDB');
        $result = $this->client->getCommand('GetItem', array(
            'TableName' => $this->table,
            'Key' => array(
                $this->hashKey => array(
                    'S' => 'test_example'
                )
            )
        ))->execute();
        $data = unserialize($result['Item']['data']['S']);
        $this->assertArrayHasKey('foo', $data, '[3] The session data was not saved in DynamoDB.');

        self::log('Check if the data was preserved, then destroy the session');
        $this->simulateSessionStart($sh);
        $this->assertEquals(array('foo' => 'bar'), $_SESSION, '[4] The session data was not retrieved.');
        $this->simulateSessionDestroy($sh);

        self::log('Check if session data was deleted in DynamoDB');
        try
        {
            $result = $this->client->getCommand('GetItem', array(
                'TableName' => $this->table,
                'Key' => array(
                    $this->hashKey => array(
                        'S' => 'test_example'
                    )
                )
            ))->execute();
            $result = isset($result['Item']);
        } catch (\Exception $e) {
            $result = false;
        }
        $this->assertFalse($result, '[5] The session data was not deleted from DynamoDB.');

        self::log('Make sure the data does not return after destroying');
        $this->simulateSessionStart($sh);
        $this->assertEquals(array(), $_SESSION, '[6] The session was not properly destroyed.');

        // Clean up
        $this->simulateSessionDestroy($sh);
    }

    /**
     * Ensures that pessimistic locking is really happening correctly
     */
    public function testLockingStrategyDifferences()
    {
        session_id('example');

        self::log('Create 4 instances of the session handler');
        $shNull1 = SessionHandler::factory(array(
            'dynamodb_client' => $this->client,
            'table_name'      => $this->table
        ));

        $shNull2 = SessionHandler::factory(array(
            'dynamodb_client' => $this->client,
            'table_name'      => $this->table
        ));

        $shPessimistic1 = SessionHandler::factory(array(
            'dynamodb_client'    => $this->client,
            'table_name'         => $this->table,
            'locking_strategy'   => 'pessimistic',
            'max_lock_wait_time' => 6,
        ));

        $shPessimistic2 = SessionHandler::factory(array(
            'dynamodb_client'    => $this->client,
            'table_name'         => $this->table,
            'locking_strategy'   => 'pessimistic',
            'max_lock_wait_time' => 6,
        ));

        self::log('Store some session data for reading');
        $this->simulateSessionStart($shNull1);
        $_SESSION['foo'] = 'bar';
        $this->simulateSessionCommit($shNull1);

        self::log('Non-locking, simultaneous reads should happen fast');
        $shNullTime = microtime(true);
        $this->simulateSessionStart($shNull1);
        $this->simulateSessionStart($shNull2);
        $this->simulateSessionCommit($shNull1);
        $shNullTime = microtime(true) - $shNullTime;
        $this->assertLessThan(3, $shNullTime, 'Null locking strategy took longer than expected.');

        self::log('Locking, simultaneous reads should block and timeout');
        $shPessimisticTime = microtime(true);
        $this->simulateSessionStart($shPessimistic1);
        $this->simulateSessionStart($shPessimistic2);
        $this->simulateSessionCommit($shPessimistic1);
        $shPessimisticTime = microtime(true) - $shPessimisticTime;
        $this->assertGreaterThan(5, $shPessimisticTime, 'Pessimistic locking strategy operated faster than expected. Locking may not be occurring.');

        // Clean up
        $this->simulateSessionStart($shNull1);
        $this->simulateSessionDestroy($shNull1);
    }

    /**
     * Ensures that garbage collection functionality is working correctly
     */
    public function testGarbageCollection()
    {
        $currentCount = iterator_count($this->client->getIterator('Scan', array(
            'TableName' => $this->table
        )));

        self::log('Put 10 expired items into the sessions table');
        $writeBatch = WriteRequestBatch::factory($this->client);
        for ($i = 1; $i <= 10; $i++) {
            $writeBatch->add(new PutRequest(Item::fromArray(array(
                'id'      => "example_{$i}",
                'expires' => time() - 5 * Time::SECONDS
            )), $this->table));
        }
        $writeBatch->flush();

        self::log('Assert that all 10 items made it into the sessions table');
        $result = $this->client->getCommand('Scan', array(
            'TableName' => $this->table
        ))->execute();
        $this->assertEquals(10 + $currentCount, $result['Count'], 'Not all of the items were inserted.');

        self::log('Create a session handler to use with a lower batch size');
        $sh = SessionHandler::factory(array(
            'dynamodb_client'    => $this->client,
            'table_name'         => $this->table,
            'gc_batch_size'      => 3, // Smaller batches to test batching works
            'gc_operation_delay' => 3, // Sleep 3 seconds in between operations
        ));

        self::log('Run the garbage collection');
        $gcTime = microtime(true);
        $sh->garbageCollect();
        $gcTime = microtime(true) - $gcTime;
        $this->assertGreaterThan(12, $gcTime, 'The entire garbage collection process should take ~15+ seconds.');

        self::log('Assert that all 10 items were deleted from the sessions table');
        $result = $this->client->getCommand('Scan', array(
            'TableName' => $this->table
        ))->execute();
        $this->assertEquals(0, $result['Count'], 'Not all of the items were removed.');
    }

    protected function simulateSessionStart(SessionHandler $handler)
    {
        $handler->open('dummy', 'test');
        $data = $handler->read('example');
        $_SESSION = unserialize($data) ?: array(); // Instead of session_decode
    }

    protected function simulateSessionCommit(SessionHandler $handler)
    {
        $data = serialize($_SESSION); // Instead of session_encode
        $handler->write('example', $data);
        $handler->close();
    }

    protected function simulateSessionDestroy(SessionHandler $handler)
    {
        $handler->destroy('example');
        $handler->close();
    }

    protected static function deleteSessionsTable()
    {
        $table  = self::getResourcePrefix() . '-php-sessions-test';
        $client = self::getServiceBuilder()->get('dynamodb');

        self::log("# Attempting to delete {$table}");

        try {
            $client->describeTable(array('TableName' => $table));
            // Wait until the table is active
            self::log('Table exists. Waiting until the status is ACTIVE');
            $client->waitUntil('table_exists', array('TableName' => $table));
            // Delete the table to clear out its contents
            self::log('Deleting the table');
            $client->deleteTable(array('TableName' => $table));
            $client->waitUntil('table_not_exists', array('TableName' => $table));
        } catch (ResourceNotFoundException $e) {
            // The table does not exist so we are good
        }

        self::log("{$table} has been deleted.");
    }
}


text:
(function() {
  'use strict';

  angular.module('stamina.controllers').
    controller('submCtrl', ['$scope', '$http', function($scope, $http) {
      $scope.formData = {};

      $scope.createWorkout = function() {
        $scope.formData.date = new Date();
        $http.post('/api/workouts', $scope.formData)
          .success(function(data) {
            console.log(data);
            $scope.formData = {};
            $('#success-modal').modal('toggle');
          })
          .error(function(data) {
            console.log('Error: ' + data);
            $('#failure-modal').modal('toggle');
          });
      };
    }]);
})();


text:
from collections import namedtuple
from datetime import date

ScheduleItem = namedtuple('ScheduleItem', ['start', 'end', 'slides'])
slide_schedule = (
    # EX: ScheduleItem(date(2013, 4, 5), date(2013, 4, 22), ['slide-two.html', 'slide-three.html']),
    ScheduleItem(date(2013, 4, 9), date(2013, 4, 21), ['blogpost_judges.html', 'blogpost_makeyourflickawinner.html', 'blogpost_getcreative.html']),
    ScheduleItem(date(2013, 4, 22), date(2013, 4, 30), ['blogpost_baficiwinner.html', 'blogpost_schwartzberg.html', 'blogpost_makeyourflickawinner.html']),
    ScheduleItem(date(2013, 5, 1), date(2013, 5, 7), ['blogpost_shootingpeople.html', 'blogpost_baficiwinner.html', 'blogpost_makeyourflickawinner.html']),
    ScheduleItem(date(2013, 5, 8), date(2013, 5, 17), ['may29_earlyentry.html', 'blogpost_shootingpeople.html', 'blogpost_makeyourflickawinner.html']),
    ScheduleItem(date(2013, 5, 18), date(2013, 5, 29), ['may29_earlyentry.html', 'blogpost_getmobilized.html', 'blogpost_makeyourflickawinner.html']),
    ScheduleItem(date(2013, 5, 30), date(2013, 6, 12), ['blogpost_winbig.html', 'blogpost_getmobilized.html', 'blogpost_makeyourflickawinner.html']),
    ScheduleItem(date(2013, 6, 13), date(2013, 6, 25), ['july3_earlyentry.html', 'blogpost_may29winner.html', 'blogpost_winbig.html']),
    ScheduleItem(date(2013, 6, 26), date(2013, 7, 3), ['july3_earlyentry.html', 'blogpost_winbig.html', 'blogpost_makeyourflickawinner.html']),
    ScheduleItem(date(2013, 7, 4), date(2013, 7, 17), ['july31_earlyentry.html', 'blogpost_winbig.html', 'blogpost_makeyourflickawinner.html']),
    ScheduleItem(date(2013, 7, 18), date(2013, 7, 21), ['blogpost_july3winner.html', 'july31_earlyentry.html', 'blogpost_winbig.html']),
    ScheduleItem(date(2013, 7, 22), date(2013, 7, 31), ['july31_earlyentry.html', 'blogpost_aug1voting.html', 'blogpost_july3winner.html']),
    ScheduleItem(date(2013, 8, 1), date(2013, 8, 15), ['vote.html', 'tiff-teaser.html', 'blogpost_judges.html']),
    ScheduleItem(date(2013, 8, 16), date(2013, 8, 31), ['vote.html', 'tiff-teaser.html', 'blogpost_recap_nowe.html']),
    ScheduleItem(date(2013, 9, 1), date(2013, 9, 12), ['tiff-teaser.html', 'blogpost_winbig.html', 'blogpost_judges.html']),
    ScheduleItem(date(2013, 9, 13), date(2015, 1, 01), ['sept13_winner.html']),
)

def get_slides(display_date=None):
    """
    Generate a list of the template paths to the slides that should be displayed
    on the homepage based on the given date.

    :param display_date:
        Date to use to determine which promos to display. Defaults to
        date.now().
    """
    display_date = display_date or date.today()
    return ('carousel/{0}'.format(name) for name in
            _get_slide_names(display_date))

def _get_slide_names(display_date):
    for item in slide_schedule:
        if item.start <= display_date <= item.end:
            return item.slides
    return ['blogpost_winbig.html', 'blogpost_getmobilized.html', 'blogpost_makeyourflickawinner.html']  # Default


text: Login