text:
// -----------------------------------------------------------------------
//  <copyright file="RoleFunctionController.cs" company="OSharp开源团队">
//      Copyright (c) 2014-2018 OSharp. All rights reserved.
//  </copyright>
//  <site>http://www.osharp.org</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2018-06-27 4:49</last-date>
// -----------------------------------------------------------------------

using System;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;

using Liuliu.Demo.Authorization;
using Liuliu.Demo.Authorization.Dtos;
using Liuliu.Demo.Identity.Dtos;
using Liuliu.Demo.Identity.Entities;

using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;

using OSharp.Authorization.Functions;
using OSharp.Authorization.Modules;
using OSharp.Entity;
using OSharp.Filter;
using OSharp.Linq;

namespace Liuliu.Demo.Web.Areas.Admin.Controllers
{
    [ModuleInfo(Order = 3, Position = "Auth", PositionName = "权限授权模块")]
    [Description("管理-角色功能")]
    public class RoleFunctionController : AdminApiController
    {
        private readonly FunctionAuthManager _functionAuthManager;
        private readonly RoleManager<Role> _roleManager;
        private readonly IFilterService _filterService;

        public RoleFunctionController(FunctionAuthManager functionAuthManager,
            RoleManager<Role> roleManager,
            IFilterService filterService)
        {
            _functionAuthManager = functionAuthManager;
            _roleManager = roleManager;
            _filterService = filterService;
        }

        /// <summary>
        /// 读取角色信息
        /// </summary>
        /// <returns>角色信息</returns>
        [HttpPost]
        [ModuleInfo]
        [Description("读取")]
        public PageData<RoleOutputDto2> Read(PageRequest request)
        {
            request.FilterGroup.Rules.Add(new FilterRule("IsLocked", false, FilterOperate.Equal));
            Expression<Func<Role, bool>> predicate = _filterService.GetExpression<Role>(request.FilterGroup);
            PageResult<RoleOutputDto2> page = _roleManager.Roles.ToPage<Role, RoleOutputDto2>(predicate, request.PageCondition);
            return page.ToPageData();
        }

        /// <summary>
        /// 读取角色功能信息
        /// </summary>
        /// <returns>角色功能信息</returns>
        [HttpPost]
        [ModuleInfo]
        [DependOnFunction("Read")]
        [Description("读取功能")]
        public PageData<FunctionOutputDto2> ReadFunctions(int roleId, [FromBody]PageRequest request)
        {
            if (roleId == 0)
            {
                return new PageData<FunctionOutputDto2>();
            }
            int[] moduleIds = _functionAuthManager.GetRoleModuleIds(roleId);
            Guid[] functionIds = _functionAuthManager.ModuleFunctions.Where(m => moduleIds.Contains(m.ModuleId)).Select(m => m.FunctionId).Distinct()
                .ToArray();
            if (functionIds.Length == 0)
            {
                return new PageData<FunctionOutputDto2>();
            }

            Expression<Func<Function, bool>> funcExp = _filterService.GetExpression<Function>(request.FilterGroup);
            funcExp = funcExp.And(m => functionIds.Contains(m.Id));
            if (request.PageCondition.SortConditions.Length == 0)
            {
                request.PageCondition.SortConditions = new[] { new SortCondition("Area"), new SortCondition("Controller") };
            }

            var page = _functionAuthManager.Functions.ToPage<Function, FunctionOutputDto2>(funcExp, request.PageCondition);
            return page.ToPageData();
        }
    }
}


text:
"""

Copyright (c) 2014-2018 Alex Forencich

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

"""

from myhdl import *
import os

import axis_ep
import eth_ep

module = 'eth_axis_tx'
testbench = 'test_%s_64' % module

srcs = []

srcs.append("../rtl/%s.v" % module)
srcs.append("%s.v" % testbench)

src = ' '.join(srcs)

build_cmd = "iverilog -o %s.vvp %s" % (testbench, src)

def bench():

    # Parameters
    DATA_WIDTH = 64
    KEEP_ENABLE = (DATA_WIDTH>8)
    KEEP_WIDTH = int(DATA_WIDTH/8)

    # Inputs
    clk = Signal(bool(0))
    rst = Signal(bool(0))
    current_test = Signal(intbv(0)[8:0])

    s_eth_hdr_valid = Signal(bool(0))
    s_eth_dest_mac = Signal(intbv(0)[48:])
    s_eth_src_mac = Signal(intbv(0)[48:])
    s_eth_type = Signal(intbv(0)[16:])
    s_eth_payload_axis_tdata = Signal(intbv(0)[DATA_WIDTH:])
    s_eth_payload_axis_tkeep = Signal(intbv(1)[KEEP_WIDTH:])
    s_eth_payload_axis_tvalid = Signal(bool(0))
    s_eth_payload_axis_tlast = Signal(bool(0))
    s_eth_payload_axis_tuser = Signal(bool(0))
    m_axis_tready = Signal(bool(0))

    # Outputs
    m_axis_tdata = Signal(intbv(0)[DATA_WIDTH:])
    m_axis_tkeep = Signal(intbv(1)[KEEP_WIDTH:])
    m_axis_tvalid = Signal(bool(0))
    m_axis_tlast = Signal(bool(0))
    m_axis_tuser = Signal(bool(0))
    s_eth_hdr_ready = Signal(bool(0))
    s_eth_payload_axis_tready = Signal(bool(0))
    busy = Signal(bool(0))

    # sources and sinks
    source_pause = Signal(bool(0))
    sink_pause = Signal(bool(0))

    source = eth_ep.EthFrameSource()

    source_logic = source.create_logic(
        clk,
        rst,
        eth_hdr_ready=s_eth_hdr_ready,
        eth_hdr_valid=s_eth_hdr_valid,
        eth_dest_mac=s_eth_dest_mac,
        eth_src_mac=s_eth_src_mac,
        eth_type=s_eth_type,
        eth_payload_tdata=s_eth_payload_axis_tdata,
        eth_payload_tkeep=s_eth_payload_axis_tkeep,
        eth_payload_tvalid=s_eth_payload_axis_tvalid,
        eth_payload_tready=s_eth_payload_axis_tready,
        eth_payload_tlast=s_eth_payload_axis_tlast,
        eth_payload_tuser=s_eth_payload_axis_tuser,
        pause=source_pause,
        name='source'
    )

    sink = axis_ep.AXIStreamSink()

    sink_logic = sink.create_logic(
        clk,
        rst,
        tdata=m_axis_tdata,
        tkeep=m_axis_tkeep,
        tvalid=m_axis_tvalid,
        tready=m_axis_tready,
        tlast=m_axis_tlast,
        tuser=m_axis_tuser,
        pause=sink_pause,
        name='sink'
    )

    # DUT
    if os.system(build_cmd):
        raise Exception("Error running build command")

    dut = Cosimulation(
        "vvp -m myhdl %s.vvp -lxt2" % testbench,
        clk=clk,
        rst=rst,
        current_test=current_test,

        s_eth_hdr_valid=s_eth_hdr_valid,
        s_eth_hdr_ready=s_eth_hdr_ready,
        s_eth_dest_mac=s_eth_dest_mac,
        s_eth_src_mac=s_eth_src_mac,
        s_eth_type=s_eth_type,
        s_eth_payload_axis_tdata=s_eth_payload_axis_tdata,
        s_eth_payload_axis_tkeep=s_eth_payload_axis_tkeep,
        s_eth_payload_axis_tvalid=s_eth_payload_axis_tvalid,
        s_eth_payload_axis_tready=s_eth_payload_axis_tready,
        s_eth_payload_axis_tlast=s_eth_payload_axis_tlast,
        s_eth_payload_axis_tuser=s_eth_payload_axis_tuser,

        m_axis_tdata=m_axis_tdata,
        m_axis_tkeep=m_axis_tkeep,
        m_axis_tvalid=m_axis_tvalid,
        m_axis_tready=m_axis_tready,
        m_axis_tlast=m_axis_tlast,
        m_axis_tuser=m_axis_tuser,

        busy=busy
    )

    @always(delay(4))
    def clkgen():
        clk.next = not clk

    def wait_normal():
        while s_eth_payload_axis_tvalid or m_axis_tvalid or s_eth_hdr_valid:
            yield clk.posedge

    def wait_pause_source():
        while s_eth_payload_axis_tvalid or m_axis_tvalid or s_eth_hdr_valid:
            yield clk.posedge
            yield clk.posedge
            source_pause.next = False
            yield clk.posedge
            source_pause.next = True
            yield clk.posedge

        source_pause.next = False

    def wait_pause_sink():
        while s_eth_payload_axis_tvalid or m_axis_tvalid or s_eth_hdr_valid:
            sink_pause.next = True
            yield clk.posedge
            yield clk.posedge
            yield clk.posedge
            sink_pause.next = False
            yield clk.posedge

    @instance
    def check():
        yield delay(100)
        yield clk.posedge
        rst.next = 1
        yield clk.posedge
        rst.next = 0
        yield clk.posedge
        yield delay(100)
        yield clk.posedge

        for payload_len in range(1,KEEP_WIDTH*2+2):
            yield clk.posedge
            print("test 1: test packet, length %d" % payload_len)
            current_test.next = 1

            test_frame = eth_ep.EthFrame()
            test_frame.eth_dest_mac = 0xDAD1D2D3D4D5
            test_frame.eth_src_mac = 0x5A5152535455
            test_frame.eth_type = 0x8000
            test_frame.payload = bytearray(range(payload_len))

            for wait in wait_normal, wait_pause_source, wait_pause_sink:
                source.send(test_frame)
                yield clk.posedge
                yield clk.posedge

                yield wait()

                yield sink.wait()
                rx_frame = sink.recv()

                check_frame = eth_ep.EthFrame()
                check_frame.parse_axis(rx_frame)

                assert check_frame == test_frame

                assert sink.empty()

                yield delay(100)

            yield clk.posedge
            print("test 2: back-to-back packets, length %d" % payload_len)
            current_test.next = 2

            test_frame1 = eth_ep.EthFrame()
            test_frame1.eth_dest_mac = 0xDAD1D2D3D4D5
            test_frame1.eth_src_mac = 0x5A5152535455
            test_frame1.eth_type = 0x8000
            test_frame1.payload = bytearray(range(payload_len))
            test_frame2 = eth_ep.EthFrame()
            test_frame2.eth_dest_mac = 0xDAD1D2D3D4D5
            test_frame2.eth_src_mac = 0x5A5152535455
            test_frame2.eth_type = 0x8000
            test_frame2.payload = bytearray(range(payload_len))

            for wait in wait_normal, wait_pause_source, wait_pause_sink:
                source.send(test_frame1)
                source.send(test_frame2)
                yield clk.posedge
                yield clk.posedge

                yield wait()

                yield sink.wait()
                rx_frame = sink.recv()

                check_frame = eth_ep.EthFrame()
                check_frame.parse_axis(rx_frame)

                assert check_frame == test_frame1

                yield sink.wait()
                rx_frame = sink.recv()

                check_frame = eth_ep.EthFrame()
                check_frame.parse_axis(rx_frame)

                assert check_frame == test_frame2

                assert sink.empty()

                yield delay(100)

            yield clk.posedge
            print("test 3: tuser assert, length %d" % payload_len)
            current_test.next = 3

            test_frame1 = eth_ep.EthFrame()
            test_frame1.eth_dest_mac = 0xDAD1D2D3D4D5
            test_frame1.eth_src_mac = 0x5A5152535455
            test_frame1.eth_type = 0x8000
            test_frame1.payload = bytearray(range(payload_len))
            test_frame2 = eth_ep.EthFrame()
            test_frame2.eth_dest_mac = 0xDAD1D2D3D4D5
            test_frame2.eth_src_mac = 0x5A5152535455
            test_frame2.eth_type = 0x8000
            test_frame2.payload = bytearray(range(payload_len))

            test_frame1.payload.user = 1

            for wait in wait_normal, wait_pause_source, wait_pause_sink:
                source.send(test_frame1)
                source.send(test_frame2)
                yield clk.posedge
                yield clk.posedge

                yield wait()

                yield sink.wait()
                rx_frame = sink.recv()

                check_frame = eth_ep.EthFrame()
                check_frame.parse_axis(rx_frame)

                assert check_frame == test_frame1
                assert rx_frame.user[-1]

                yield sink.wait()
                rx_frame = sink.recv()

                check_frame = eth_ep.EthFrame()
                check_frame.parse_axis(rx_frame)

                assert check_frame == test_frame2

                assert sink.empty()

                yield delay(100)

        raise StopSimulation

    return instances()

def test_bench():
    sim = Simulation(bench())
    sim.run()

if __name__ == '__main__':
    print("Running test...")
    test_bench()

redpajama_set_name: RedPajamaGithub


text:
from models import Book, Chapter, Verse
from django.shortcuts import get_object_or_404

def context_processor(target):
    """
    Decorator that allows context processors with parameters to be assigned
    (and executed properly) in a RequestContext

    Example::

      return render_to_response(
        template_name,
        context_instance=RequestContext(
          request,
          processors=[
            test_processor1,
            test_processor2(val1=test_val1, val2=test_val2),
          ]
        )
      )

    """
    def cp_wrapper(*args, **kwargs):
        if (len(args) == 1 and len(kwargs) == 0) \
        or (len(args) == 0 and len(kwargs) == 1 and 'request' in kwargs):
            return target(*args, **kwargs)
        else:
            def get_processor(request):
                return target(request, *args, **kwargs)
            return get_processor
    return cp_wrapper

@context_processor
def books_processor(request, context_name='books'):
    return {context_name: Book.objects}

@context_processor
def book_processor(request, slug, context_name='book'):
    return {context_name: get_object_or_404(Book, slug=slug)}

@context_processor
def chapter_processor(request, book_slug, number, context_name='chapter'):
    return {context_name: get_object_or_404(
        Chapter, book__slug=book_slug, number=number)}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Symb. bot. upsal. 20(1): 112 (1972)

#### Original name
Delitschia sordarioides Speg.

### Remarks
null


text:
Radiosonde is a tool to manage CloudWatch Alarm.

It defines the state of CloudWatch Alarm using DSL, and updates CloudWatch Alarm according to DSL.

[![Gem Version](https://badge.fury.io/rb/radiosonde.svg)](http://badge.fury.io/rb/radiosonde)

## Installation

Add this line to your application's Gemfile:

    gem 'radiosonde'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install radiosonde

## Usage

```sh
export AWS_ACCESS_KEY_ID='...'
export AWS_SECRET_ACCESS_KEY='...'
export AWS_REGION='us-east-1'
radiosonde -e -o Alarmfile  # export CloudWatch Alarm
vi Alarmfile
radiosonde -a --dry-run
radiosonde -a               # apply `Alarmfile` to CloudWatch
```

## Help

```
Usage: radiosonde [options]
    -p, --profile PROFILE_NAME
    -k, --access-key ACCESS_KEY
    -s, --secret-key SECRET_KEY
    -r, --region REGION
    -a, --apply
    -f, --file FILE
        --dry-run
    -e, --export
    -o, --output FILE
        --show-metrics
        --show-dimensions
        --show-statistics
        --namespace NAMESPACE
        --metric-name NAME
        --start-time TIME
        --end-time TIME
        --statistic STATISTIC
        --no-color
        --debug
```

## Alarmfile example

```ruby
require 'other/alarmfile'

alarm "alarm1" do
  namespace "AWS/EC2"
  metric_name "CPUUtilization"
  dimensions "InstanceId"=>"i-XXXXXXXX"
  period 300
  statistic :average
  threshold ">=", 50.0
  evaluation_periods 1
  actions_enabled true
  alarm_actions []
  ok_actions []
  insufficient_data_actions ["arn:aws:sns:us-east-1:123456789012:my_topic"]
end

alarm "alarm2" do
  ...
end
```

## Similar tools
* [Codenize.tools](http://codenize.tools/)


text:
package com.lazyloris.modeler.test;

import static org.junit.Assert.assertEquals;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.ListJoin;
import javax.persistence.criteria.Root;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.AfterTransaction;
import org.springframework.test.context.transaction.BeforeTransaction;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;

import com.lorizz.modeler.test.model.Product;
import com.lorizz.modeler.test.model.Shop;
import com.lorizz.modeler.test.model.SubProduct;
import com.lorizz.modeler.test.model.entity.ProductEntity;
import com.lorizz.modeler.test.model.entity.ProductEntity_;
import com.lorizz.modeler.test.model.entity.SubProductEntity;
import com.lorizz.modeler.test.model.entity.SubProductEntity_;
import com.lorizz.modeler.test.model.repository.Repository;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "testContext.xml" })
@TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = false)
@DirtiesContext
public class TestQueries {

    @Autowired
    private EntityManagerFactory entityManagerFactory;
    @Autowired
    private Repository repository;

    @BeforeTransaction
    public void prepare() {
        prepareFindAll();
        prepareJoin();
    }

    private void prepareFindAll() {
        EntityManager em = entityManagerFactory.createEntityManager();
        em.getTransaction().begin();
        Shop shop1 = repository.createShop();
        shop1.setName("Lorizz Shop 1");
        shop1.setAllDays(true);
        em.persist(shop1);
        //
        Shop shop2 = repository.createShop();
        shop2.setName("Lorizz Shop 2");
        shop2.setAllDays(false);
        em.persist(shop2);
        //
        em.getTransaction().commit();
        em.close();
    }

    private void prepareJoin() {
        EntityManager em = entityManagerFactory.createEntityManager();
        em.getTransaction().begin();
        Product p1 = repository.createProduct();
        p1.setName("p1");
        //
        Product p2 = repository.createProduct();
        p2.setName("p2");
        //
        SubProduct sp1 = repository.createSubProduct();
        sp1.setName("sp1");
        //
        p2.getSubProducts().add(sp1);
        em.persist(p1);
        em.persist(p2);
        em.getTransaction().commit();
        em.close();
    }

    @Test
    @Transactional
    public void test() {
        testFindAll();
        testJoin();
        testFindAllSQ();
        testJoinSQ();
    }

    private void testFindAll() {
        List<Shop> shops = repository.findAllShop();
        assertEquals(2, shops.size());
        assertEquals("Lorizz Shop 1", shops.get(0).getName());
    }

    private void testJoin() {
        CriteriaBuilder cb = repository.getCriteriaBuilder();
        CriteriaQuery<ProductEntity> cq = cb.createQuery(ProductEntity.class);
        Root<ProductEntity> products = cq.from(ProductEntity.class);
        ListJoin<ProductEntity, SubProductEntity> joinSubProducts = products.join(ProductEntity_.subProducts);
        cq.where(cb.equal(joinSubProducts.get(SubProductEntity_.name), "sp1"));
        //
        List<Product> ps = repository.executeQuery(cq);
        assertEquals(1, ps.size());
        assertEquals("p2", ps.get(0).getName());
        assertEquals("sp1", ps.get(0).getSubProducts().get(0).getName());
    }

    private void testFindAllSQ() {
    	List<Shop> shops = repository.executeQuery("select s from Shop s");
    	assertEquals(2, shops.size());
        assertEquals("Lorizz Shop 1", shops.get(0).getName());
    }

    private void testJoinSQ() {
    	String query = "select p from Product p join p.subProducts s where s.name = ?1";
    	//
        List<Product> ps = repository.executeQuery(query, "sp1");
        assertEquals(1, ps.size());
        assertEquals("p2", ps.get(0).getName());
        assertEquals("sp1", ps.get(0).getSubProducts().get(0).getName());
    }

    @AfterTransaction
    public void verify() {

    }
}


text: Loading diagram


text:
[![Apiary Documentation](https://img.shields.io/badge/Apiary-Documented-blue.svg)](http://docs.pollsapi.apiary.io/)
[![Circle CI Status](https://img.shields.io/circleci/project/apiaryio/polls-api.svg)](https://circleci.com/gh/apiaryio/polls-api/tree/master)

This is a Python implementation of a Polls API, an API that allows consumers to
view polls and vote in them. Take a look at the
[API Documentation](http://docs.pollsapi.apiary.io/). We've
deployed an instance of this [API](https://polls.apiblueprint.org/) for testing.

## Development Environment

You can configure a development environment with the following:

**NOTE**: *These steps assume you have Python along with [pipenv](https://docs.pipenv.org/install/) installed.*

```bash
$ pipenv install
$ pipenv run python manage.py migrate
```

### Running the tests

```bash
$ python manage.py test
```

### Running the development server

```bash
$ pipenv run python manage.py runserver
```

### Running dredd

Providing [dredd](http://dredd.readthedocs.org/en/latest/) has been
installed, you can run the following to run dredd against the Polls API:

```bash
$ pipenv run dredd
```

### Running via docker

#### Running the development server

```bash
$ docker-compose up web
$ open "http://$(docker-machine ip default):8080"
```

#### Running tests in Docker

```bash
$ docker-compose run shell python manage.py test
```

## Deploying

### Deploying on Heroku

Click the button below to automatically set up the Polls API in an app
running on your Heroku account.

[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/apiaryio/polls-api)

Once you've deployed, you can easily clone the application and alter the
configuration to disable features:

```bash
$ heroku clone -a new-app-name
$ heroku config:set POLLS_CAN_VOTE_QUESTION=false
$ heroku config:set POLLS_CAN_CREATE_QUESTION=false
$ heroku config:set POLLS_CAN_DELETE_QUESTION=false
```

### Deploying on Heroku using Docker

If you'd like to, you may use Docker on Heroku instead. Refer to the [Heroku
Container Registry and Runtime
Guide](https://devcenter.heroku.com/articles/container-registry-and-runtime#getting-started)
for detailed instructions. Providing you have Docker installed you can follow
the following steps:

```bash
$ heroku container:login
$ heroku container:push web
$ heroku container:release web
```

## License

polls-api is released under the MIT license. See [LICENSE](LICENSE).


text:
{% extends base %}
{% load staticfiles %}
{% load nav %}
{% load xgds_data_extras %}

{% block siteSection %}{{ title }}{% endblock %}

{% block cssExtras %}
{{ block.super }}

{% endblock cssExtras %}

{% block scripts %}
  {{ block.super }}
{% if standalone %}

{% else %}

{% endif %}

{% if standalone %}

{% else %}

{% endif %}

{% endblock scripts %}

{% block contents  %}
  <form name="QueryForm" action="" method="post">
  <input type="hidden" name="fnctn" value="query">
{{ formset.management_form }}
{% block query %}

{% if expert %}
	Simple Search
{% else %}
	Advanced Search
{% endif %}

{{ title }}

  <input type="hidden" name="pageno" id="id_pageno" value={{ page }}>

{% for d in debug %}
	{{ d }}
{% endfor %}

{% if axesform %}
    {% for field in axesform %}
          {{ field.as_hidden }}
  {% endfor %}
{% endif %}

{% for form in formset %}
    {% if expert %}
		{{ form.as_expert_table }}
	{% else %}
		{{ form.as_table }}
	{% endif %}

{% endfor %}

	  <input type="submit" class="btn btn-primary"  value="Search" id="query" style="float:right;"/>

{% if expert %}
	{% if 'this code' == 'is no longer broken' %}
	<input type="submit" value="Add Disjunction" id="addform" />
	{% endif %}
{% endif %}

{% endblock query %}
{% block results  %}

{% if count %}

{% block count  %}
{% spaceless %}

	{% if count == exactCount %}
		{{ count }} matching records
	{% else %}
		About {{ count }} matching records
		{% if exactCount == 0 %}
			(no
		{% else %}
			({{ exactCount }}
		{% endif %}
		exact)
		{% if exactCount == 1 %}
			match
		{% else %}
			matches
		{% endif %}
	{% endif %}
	in {{ duration|floatformat }} seconds.

{% endspaceless %}
{% endblock count %}

    {% if count != exactCount %}

    	{% if standalone %}

Key	Exact	Match

Close	Match

    	{% else %}

Key	Exact	Match

Close	Match

     	{% endif %}

     {% endif %}

{% block download  %}
	{% if count != exactCount %}
		{% if count > 0 %}
	    	<input type="submit" class="btn btn-primary" value="Download CSV (All)" id="csv" />
	    {% else %}
	    	<input type="submit"  value="Download CSV (All)" id="csv" disabled />
	    {% endif %}
    {% endif %}
    {% if exactCount > 0 %}
    	<input type="submit" class="btn btn-primary"  value="Download CSV (Exact)" id="csvhard" />
    {% else %}
    	<input type="submit" value="Download CSV (Exact)" id="csvhard" disabled />
    {% endif %}
{% endblock download %}

{% block plot  %}
    {% if axesform %}
	    {% if count != exactCount %}
		    {% if count > 0 %}
		    	<input type="submit" class="btn btn-primary" value="Plot (All)" id="plot"/>
		    {% else %}
		    	<input type="submit" value="Plot (All)" id="plot" disabled />
		    {% endif %}
	    {% endif %}
	    {% if exactCount > 0 %}
	    	<input type="submit" class="btn btn-primary" value="Plot (Exact)" id="plothard"/>
	    {% else %}
	    	<input type="submit" value="Plot (Exact)" id="plothard" disabled />
	    {% endif %}
    {% endif %}
{% endblock plot %}

{% block listing  %}

{% with divpage=1|divide:pageSize %}
	{% with end_index=page|divide:divpage|floatformat:"0"  %}
	{% with start_index=pageSize|divide:-1|add:end_index|add:1  %}

	<input type="hidden" name="start" id="id_start">
	<input type="hidden" name="end"  id="id_end">
		Displaying {{start_index}}-
		{% if end_index|add:"0" < count|add:"0" %}{{end_index}}{% else %}{{count}}{% endif %}
		 out of {{ count }} records
	{% if checkable %}
		({% if not allselected %}{{ picks|length }}{% else %}{{ notpicks|length|divide:-1|add:count }}{% endif %}
selected - Select
All
/
None
)
	{% endif %}

	 {% if count != exactCount and 1 == 0 %}

    	{% if standalone %}

Key	Exact	Match

Close	Match

    	{% else %}

Key	Exact	Match

Close	Match

     	{% endif %}

     {% endif %}

{% include "xgds_data/paginator.html" %}

	{% endwith %}
	{% endwith %}
	{% endwith %}

{% if standalone %}

{% else %}

{% endif %}

	  {% block headerrow %}
	{% if checkable %}
	<input type="checkbox" id="pmaster" />
	{% endif %}
	Record
	{% for x in displayFields %}
	{{ x|verbose_name }}
	{% endfor %}
	  {% endblock headerrow %}

	{% for result in results %}
		    {% with myscore=result|getattribute:'score' %}
				{% if myscore|addfloat:"1E-12" >= 1 %}
					{% if standalone %}

					{% else %}

					{% endif %}
				{% else %}
					{% if standalone %}

					{% else %}

					{% endif %}
				{% endif %}
		    {% endwith %}

	   {% block datarow %}

		{% if checkable %}

			{% with pid=resultfullids|getattribute:result %}
			<input type="checkbox" id="pick_{{pid}}" name="picks" value="{{pid}}"
{% if not allselected %}
{% if pid in picks %}CHECKED{% endif %}
{% else %}
{% if pid not in notpicks %}CHECKED{% endif %}
{% endif %}
 />
{% if allselected %}
<input type="hidden" id="notpick_{{pid}}" name="notpicks" value="{{pid}}" >
{% endif %}
			{% endwith %}

	     {% endif %}

	     {% with rname=result|stringformat:"s"|default:" " %}
             {% if result.get_absolute_url %}
               {{ rname }}
             {% else %}
               {{ rname }}
             {% endif %}
	     {% endwith %}

 	 {% for x in displayFields %}

	  {% with myval=result|getattribute:x %}

	  	{{ x|display:myval }}

	  {% endwith %}

	  {% endfor %}
	   {% endblock datarow %}

	{% endfor %}

{% endblock listing %}

{% block postamble %}

{% if checkable %}

{% if allselected %}
<input type="hidden" name="allselected" id="id_allselected" value=1>
{% else %}
<input type="hidden" name="allselected" id="id_allselected">
{% endif %}

{% for pid in picks %}
{% if pid not in resultfullids.values %}
<input type="hidden" id="pick_{{pid}}" name="picks" value="{{pid}}" >
{% endif %}
{% endfor %}

{% for pid in notpicks %}
{% if pid not in resultfullids.values %}
<input type="hidden" id="notpick_{{pid}}" name="notpicks" value="{{pid}}" >
{% endif %}
{% endfor %}

{% endif %}

	{% with divpage=1|divide:pageSize %}
	{% with end_index=page|divide:divpage|floatformat:"0"  %}
	{% with start_index=pageSize|divide:-1|add:end_index|add:1  %}

	<input type="hidden" name="start" id="id_start">
	<input type="hidden" name="end"  id="id_end">
		Displaying {{start_index}}-
		{% if end_index|add:"0" < count|add:"0" %}{{end_index}}{% else %}{{count}}{% endif %}
		 out of {{ count }} records

{% include "xgds_data/paginator.html" %}

	{% endwith %}
	{% endwith %}
	{% endwith %}

{% endblock postamble %}

{% elif count == 0 %}

	No records match
{% endif %}

{% endblock results %}
</form>
{% endblock contents %}


text:
GnuPG itself is a commandline tool without any graphical stuff. It is the real crypto engine which can be used directly from a command prompt, from shell scripts or by other programs. Therefore it can be considered as a backend for other applications.

However, even when used on the command line it provides all functionality needed - this includes an interactive menu system. The set of commands of this tool will always be a superset of those provided by any frontends.

## Features

- Full replacement of PGP
- Does not use any patented algorithms
- GPLed, written from scratch
- Can be used as a filter program
- Full OpenPGP implementation (see RFC4880 at RFC Editor)
- Better functionality than PGP and some security enhancements over PGP 2
- Decrypts and verifies PGP 5, 6 and 7 messages
- Supports ElGamal, DSA, RSA, AES, 3DES, Blowfish, Twofish, CAST5, MD5, SHA-1, RIPE-MD-160 and TIGER
- Easy implementation of new algorithms using extension modules
- The User ID is forced to be in a standard format
- Supports key and signature expiration dates
- English, Danish, Dutch, Esperanto, Estonian, French, German, Japanese, Italian, Polish, Portuguese (Brazilian), Portuguese (Portuguese), Russian, Spanish, Swedish and Turkish language support
- Online help system
- Optional anonymous message receivers
- Integrated support for HKP keyservers (wwwkeys.pgp.net)
- Clears signed patch files which can still be processed by patch
- and many more things….

## Notes

- This is the modern version of GnuPG (2.2 branch). If you want the stable version (2.0 branch) install adequate version of [Gpg4win](https://chocolatey.org/packages/Gpg4win)
- Versions 2.1.16 to 2.2.12 of this tool are availalbe as [gnupg-modern](https://chocolatey.org/packages/gnupg-modern) package (non embedded)


text:
'use strict';

/**
 * Terms Controller
 */

module.exports.controller = function (app) {

  app.get('/terms', function (req, res) {
    res.render('terms/terms', {
      url: req.url
    });
  });

};


text:
import { VS_HUMAN } from "../reducers/Game.js";
import computeMove from "../utils/AI.js";

// Game action types
export const APPLY_MOVE = "APPLY_MOVE";
export const RESET_GAME = "RESET_GAME";
export const SET_GAME_MODE = "SET_GAME_MODE";
export const START_NEXT_MATCH = "START_NEXT_MATCH";

const MOVE_TIMEOUT = 200;

// GRID_CHANGED action creator
export const applyMoveAction = function ({x, y}) {
  return {
    x: x,
    y: y,
    type: APPLY_MOVE
  };
};

export const computerMoveAction = function (state) {
  return applyMoveAction(computeMove(state));
};

export const applyComputerMoveAfterTimeout = function (state, timeout) {
  return dispatch => setTimeout(
      () => dispatch(computerMoveAction(state)),
      timeout
    );
};

export const resetGameAction = function () {
  return {
    type: RESET_GAME
  };
};

export const setGameModeAction = function (mode) {
  return {
    mode: mode,
    type: SET_GAME_MODE
  };
};

export const startNextMatchAction = function () {
  return {
    type: START_NEXT_MATCH
  }
};

const shouldHumanMove = function (state, {x, y}) {
  let cellAvaliable = state.gameGrid[x][y] === "",
      playingVersusHuman = state.gameMode === VS_HUMAN,
      nextTurnIsUpToX = state.currentTurn === "x",
      isNotComputerTurn = nextTurnIsUpToX !== state.AI.playingX,
      isHumanTurn = playingVersusHuman || isNotComputerTurn;

  return cellAvaliable && isHumanTurn;
};

const shouldComputerMove = function (state) {
  let playingVersusComputer = state.gameMode !== VS_HUMAN,
      gameIsNotOver = !state.gameOver,
      nextTurnIsUpToX = state.currentTurn === "x",
      isComputerTurn = nextTurnIsUpToX === state.AI.playingX;

  return playingVersusComputer && gameIsNotOver && isComputerTurn;
};

const gameTick = function (move) {
  return (dispatch, getState) => {
    let state = getState().game.toJS();
    if(move) {
      if(state.gameOver) {
        dispatch(startNextMatchAction());
        return;
      }
      if(shouldHumanMove(state, move)) {
        dispatch(applyMoveAction(move));
      }
      return;
    }
    if(shouldComputerMove(state)) {
      dispatch(applyComputerMoveAfterTimeout(state, MOVE_TIMEOUT));
    }
  }
};

export default gameTick;


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Relative sized images</title>

		<link rel="stylesheet" href="style.css">

Relative sized images

Instead of supplying fixed image sizes and densities, the size of each supplied image can be specified by adding a width descriptor along with the size of the image element, allowing the browser to automatically calculate the effective pixel density and choose the best image to download.

Relative sized images

Reference

Google developers - Images in Markup

				view on github


text:
<?php
namespace SlimBootstrap\Endpoint;

use \SlimBootstrap\DataObject;

/**
 * Class IndexTest
 *
 * @package SlimBootstrap\Endpoint
 */
class IndexTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \SlimBootstrap\Endpoint\Index
     */
    private $_candidate = null;

    public function setUp()
    {
        parent::setUp();
    }

    /**
     * @param array      $data
     * @param DataObject $result
     *
     * @dataProvider getProvider
     */
    public function testGet(array $data, DataObject $result)
    {
        $this->_candidate = new Index($data);

        $actual = $this->_candidate->get();

        $this->assertEquals($result, $actual);
    }

    public function getProvider()
    {
        return array(
            array(
                'data'   => array(
                    'mockUri1' => '/mockUri1',
                    'mockUri2' => '/mockUri2',
                ),
                'result' => new DataObject(
                    array(),
                    array(
                        'welcome' => 'Welcome.',
                    ),
                    array(
                        'mockUri1' => '/mockUri1',
                        'mockUri2' => '/mockUri2',
                    )
                ),
            ),
        );
    }
}


text:
#ifndef PLAYGROUND_FLENS_SPARSE_SUPERLU_CREATECOMPCOLMATRIX_H
#define PLAYGROUND_FLENS_SPARSE_SUPERLU_CREATECOMPCOLMATRIX_H 1

#ifdef WITH_SUPERLU

namespace flens { namespace superlu {

void
Create_CompCol_Matrix(SuperMatrix *A, int numRows, int numCols,
                      int numNonZeros, float *values,
                      int * rows, int *cols, Stype_t order, Mtype_t shape);

void
Create_CompCol_Matrix(SuperMatrix *A, int numRows, int numCols,
                      int numNonZeros, double *values,
                      int * rows, int *cols, Stype_t order, Mtype_t shape);

void
Create_CompCol_Matrix(SuperMatrix *A, int numRows, int numCols,
                      int numNonZeros, std::complex<float> *values,
                      int * rows, int *cols, Stype_t order, Mtype_t shape);

void
Create_CompCol_Matrix(SuperMatrix *A, int numRows, int numCols,
                      int numNonZeros, std::complex<double> *values,
                      int * rows, int *cols, Stype_t order, Mtype_t shape);

} } // namespace superlu, flens

#endif // WITH_SUPERLU

#endif // PLAYGROUND_FLENS_SPARSE_SUPERLU_CREATECOMPCOLMATRIX_H


text:
package gopactor

import (
	"testing"

	"github.com/AsynkronIT/protoactor-go/actor"
	"github.com/stretchr/testify/assert"
)

type TestActor struct{}

func (ta *TestActor) Receive(ctx actor.Context) {}

func TestSpawnFromInstance(t *testing.T) {
	a := assert.New(t)

	ta := &TestActor{}
	_, err := SpawnFromInstance(ta)
	a.Nil(err)

	// Cleanup
	PactReset()
}

func TestSpawnFromInstance_WithPrefix(t *testing.T) {
	a := assert.New(t)

	ta := &TestActor{}
	object, err := SpawnFromInstance(ta, OptDefault.WithPrefix("test-actor"))
	a.Nil(err)
	a.Contains(object.String(), "test-actor")

	// Cleanup
	PactReset()
}

func TestSpawnFromProducer(t *testing.T) {
	a := assert.New(t)

	f := func() actor.Actor {
		return &TestActor{}
	}

	_, err := SpawnFromProducer(f)
	a.Nil(err)

	// Cleanup
	PactReset()
}

func TestSpawnFromFunc(t *testing.T) {
	a := assert.New(t)

	_, err := SpawnFromFunc(func(ctx actor.Context) {})
	a.Nil(err)

	// Cleanup
	PactReset()
}

func TestSpawnNullActor(t *testing.T) {
	a := assert.New(t)

	_, err := SpawnNullActor()
	a.Nil(err)

	// Cleanup
	PactReset()
}


text:
/**
 * reducers/auth.js
 * auth reducer
 */
'use strict';

import {
  REQUEST_SIGN_IN,
  RESPONSE_SIGN_IN,
  REQUEST_SIGN_OUT,
  RESPONSE_SIGN_OUT
} from '../actions/signin-actions'

const initialState = {
  requesting: false,
  JWT: (localStorage.getItem('JWT') || ''),
  signedin_as: {
    uid:  '',
    name: '',
  },
}

export default function signInReducer(state = initialState, action) {
  switch (action.type) {
    case REQUEST_SIGN_IN:
      return Object.assign({}, state, {
        requesting: true,
      })

    case RESPONSE_SIGN_IN:
      return Object.assign({}, state, {
        requesting: false,
        JWT: action.response.JWT,
      })
      //TODO: failure時の処理

    case REQUEST_SIGN_OUT:
      return Object.assign({}, state, {
        requesting: true,
      })

    case RESPONSE_SIGN_OUT:
      return Object.assign({}, state, {
        requesting: false,
        JWT: '',
      })

    default:
      return state
  }
}


text:
import {VideoIntelligenceServiceClient} from '@google-cloud/video-intelligence';

// check that the client class type name can be used
function doStuffWithVideoIntelligenceServiceClient(
  client: VideoIntelligenceServiceClient
) {
  client.close();
}

function main() {
  // check that the client instance can be created
  const videoIntelligenceServiceClient = new VideoIntelligenceServiceClient();
  doStuffWithVideoIntelligenceServiceClient(videoIntelligenceServiceClient);
}

main();


text:
{% extends "tardis_portal/portal_template.html" %}
{% load static from staticfiles %}
{% load capture %}
{% load dataset_tags %}
{% load uploadify_tags %}
{% load basiccomparisonfilters %}

{% block script %}

{% endblock %}

{% block content %}

    ×

Please wait...

    <button class="submit-button btn btn-success">

      Save
    </button>

    ×

Request sent

Please wait...

You will receive an email when all
      files are available

Job ID

    ×

Import Files

Please wait...

Dataset

  {% if push_to_enabled and is_authenticated %}

      Push to...

  {% endif %}
  {% if has_write_permissions and is_authenticated %}

      Edit Dataset Description

  {% endif %}

    {% if dataset.description %}
      {{ dataset.description }}
    {% else %}
      Untitled Dataset
    {% endif %}

  {% if from_experiment %}

      From the experiment:

      {{ from_experiment.title }}

  {% else %}
        {% if other_experiments|length == 1 %}

            From the experiment:
        {% for other_experiment in other_experiments %}

            {{ other_experiment.title }}

        {% endfor %}
        {% endif %}

  {% endif %}
  {% if dataset.immutable %}

      This experiment has been set to immutable on creation (cannot be modified)

  {% endif %}

    {{ dataset|dataset_experiments_badge}}
    {{ dataset|dataset_datafiles_badge }}
    {{ dataset|dataset_size_badge }}

    {% block dataset_content_preview %}

Preview Images

    {% if dataset.get_images.count > 0 %}

          {% for datafile in dataset.get_images %}

              {% url 'tardis.tardis_portal.iiif.download_image' datafile_id=datafile.id region='full' size='!320,240' rotation=0 quality='native' format='jpg' as thumbnail %}
              {% url 'tardis.tardis_portal.iiif.download_image' datafile_id=datafile.id region='full' size='full' rotation=0 quality='native' format='png' as image %}

{{ datafile.filename }}

          {% endfor %}

        {% if dataset.get_images.count > 1 %}

            ‹
            ›
        {% endif %}

    {% else %}

No previews available

    {% endif %}

    {% endblock dataset_content_preview %}

Datafile Information

	   Click the

	   button next to any file to view details and actions.

       {# include "tardis_portal/ajax/datafile_details.html" #}

      {% include "tardis_portal/ajax/dataset_metadata.html" %}

Other Experiments

        {% if other_experiments|length > 1 %}

        This dataset also appears in these experiments.

                {% for other_experiment in other_experiments %}
                {% if other_experiment != from_experiment %}

                    {{ other_experiment.title }}

                {% endif %}
                {% endfor %}

        {% else %}
        This dataset doesn't appear in any other experiments.
        {% endif %}

 {# side bar #}

      {{dataset.datafile_set.count}} File{% if dataset.datafile_set.count != 1 %}s{%endif%}

{% if has_write_permissions and not experiment.public and not immutable %}

        Add files...
        <input id="fileupload" type="file" name="attached_file"
               data-url="/api/v1/dataset_file/" multiple>

{% endif %}

        {% block downloads %}
            {% if has_download_permissions and dataset.is_online %}

Download Dataset:
                    {% if organization|length > 1 %}
                        {% for p in protocol %}
                            {% for o in organization %}

                                    {% if o == default_organization %}
                                        {{p.0|upper}}
                                    {% else %}
                                        {{p.0|upper}} - {{o}}
                                    {% endif %}

                            {% endfor %}
                        {% endfor %}
                    {% else %}
                        {% for p in protocol %}

                                {{p.0|upper}}

                        {% endfor %}
                    {% endif %}
                    SFTP

            {%  elif has_download_permissions and not dataset.is_online %}

Some or all files in this dataset are archived.
                Retrieve All
                    Files

            {% endif %}
        {% endblock downloads %}

        {% if has_write_permissions and not experiment.public and not immutable and has_staging_access %}

                    Import Staging Files

        {% endif %}

Drop files here

{% block finalscript %}

{% endblock finalscript %}
{% endblock %}


text:
package org.apache.servicecomb.swagger.generator.jaxrs.processor.annotation;

import javax.ws.rs.PathParam;

import org.apache.servicecomb.swagger.generator.core.processor.parameter.AbstractParameterProcessor;

import io.swagger.models.parameters.PathParameter;

public class PathParamAnnotationProcessor extends AbstractParameterProcessor<PathParameter> {
  @Override
  protected PathParameter createParameter() {
    return new PathParameter();
  }

  @Override
  protected String getAnnotationParameterName(Object annotation) {
    return ((PathParam) annotation).value();
  }
}


text:
#ifndef XENIA_GPU_GL4_GL4_PROFILER_DISPLAY_H_
#define XENIA_GPU_GL4_GL4_PROFILER_DISPLAY_H_

#include "xenia/common.h"
#include "xenia/gpu/gl4/circular_buffer.h"
#include "xenia/gpu/gl4/gl_context.h"
#include "xenia/gpu/gl4/wgl_control.h"
#include "xenia/profiling.h"

namespace xe {
namespace gpu {
namespace gl4 {

class GL4ProfilerDisplay : public ProfilerDisplay {
 public:
  GL4ProfilerDisplay(WGLControl* control);
  virtual ~GL4ProfilerDisplay();

  uint32_t width() const override;
  uint32_t height() const override;

  // TODO(benvanik): GPU timestamping.

  void Begin() override;
  void End() override;
  void DrawBox(int x0, int y0, int x1, int y1, uint32_t color,
               BoxType type) override;
  void DrawLine2D(uint32_t count, float* vertices, uint32_t color) override;
  void DrawText(int x, int y, uint32_t color, const char* text,
                size_t text_length) override;

 private:
  struct Vertex {
    float x;
    float y;
    uint32_t color;
    float u;
    float v;
  };

  bool SetupFont();
  bool SetupState();
  bool SetupShaders();

  Vertex* BeginVertices(size_t count);
  void EndVertices(GLenum prim_type);
  void Flush();

  WGLControl* control_;
  GLuint program_;
  GLuint vao_;
  GLuint font_texture_;
  GLuint64 font_handle_;
  CircularBuffer vertex_buffer_;

  static const size_t kMaxCommands = 32;
  struct {
    GLenum prim_type;
    size_t vertex_offset;
    size_t vertex_count;
  } draw_commands_[kMaxCommands];
  uint32_t draw_command_count_;

  CircularBuffer::Allocation current_allocation_;

  struct {
    uint16_t char_offsets[256];
  } font_description_;
};

}  // namespace gl4
}  // namespace gpu
}  // namespace xe

#endif  // XENIA_GPU_GL4_GL4_PROFILER_DISPLAY_H_


text:
            {{col}}

            {{row.id}}
            {{row.patient_name}}
            {{row.reason}}
            {{row.date}}

                <button ng-click="selectRow(row.id)" type="button" class="btn btn-info" data-toggle="modal"
                        data-target="#myModal">

                </button>
                <button type="button" class="btn btn-danger" ng-click="deleteRow(row.id)">

                </button>

                    <button type="button" class="close" data-dismiss="modal">×</button>

PLEASE FILL THE FORM AND CHOOSE A DATE

                        <form class="well form-horizontal" ng-submit="updateFn(this.form)">
                            <fieldset>

                                            <input ng-model="form.full_name" placeholder="FULL NAME"
                                                   class="form-control"
                                                   type="text"
                                                   required>

                                            <select ng-model="form.reason" class="form-control selectpicker" required>
                                                <option value="0" selected>Please Select Reason For Appointment</option>
                                                <option value="Sick">Sick</option>
                                                <option value="Follow-Up">Follow-Up</option>
                                            </select>

                                            <input type="date" placeholder="dsas" ng-model="form.date"
                                                   min="{{tomorrow | date: 'yyyy-MM-dd'}}" class="form-control"
                                                   required>

                                            <select ng-model="form.time" class="form-control selectpicker" required>
                                                <option value="0" selected>Please Select Time for Appointment</option>
                                                <option value="12:00">12:00</option>
                                                <option value="13:00">13:00</option>
                                                <option value="14:00">14:00</option>
                                                <option value="15:00">15:00</option>
                                            </select>

                                            <button type="submit" class="btn btn-warning">
                                                Update
                                            </button>

                                        {{msg.succesMsg}}

                                        {{msg.errorMsg}}
                                        Error:

                            </fieldset>
                        </form>

                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>


text:
import monotonic
import sseclient
import threading
import sys

if sys.version[0] == '2':
    import Queue as queue
else:
    import queue as queue

# TODO: There's a lot more refactoring that could/should be done to abstract out the arlo-specific implementation details.

class EventStream(object):
    """This class provides a queue-based EventStream object."""
    def __init__(self, event_handler, heartbeat_handler, args):
        self.event_handler = event_handler
        self.connected = False
        self.registered = False
        self.queue = queue.Queue()
        self.heartbeat_stop_event = threading.Event()
        self.event_stream_stop_event = threading.Event()
        self.arlo = args[0]
        self.heartbeat_handler = heartbeat_handler

    def __del__(self):
        self.Disconnect()

    def Get(self, block=True, timeout=None):
        if sys.version[0] == '2' and block:
            if timeout:
                timeout += monotonic.monotonic()
            # If timeout is None, then just pick some arbitrarily large # for the timeout value.
            else:
                timeout = 1000000 + monotonic.monotonic()

            while True:
                try:
                    # Allow check for Ctrl-C every second
                    item = self.queue.get(timeout=min(1, timeout - monotonic.monotonic()))
                    self.queue.task_done()
                    return item
                except queue.Empty:
                    if monotonic.monotonic() > timeout:
                        return None
                    else:
                        pass
        else:
            try:
                item = self.queue.get(block=block, timeout=timeout)
                self.queue.task_done()
                return item
            except queue.Empty as e:
                return None
            except Exception as e:
                return None

    def Start(self):
        try:
            event_stream = sseclient.SSEClient('https://myapi.arlo.com/hmsweb/client/subscribe?token='+self.arlo.request.session.headers.get('Authorization').decode(), session=self.arlo.request.session)
            self.event_stream_thread = threading.Thread(name="EventStream", target=self.event_handler, args=(self.arlo, event_stream, self.event_stream_stop_event, ))
            self.event_stream_thread.setDaemon(True)
            self.event_stream_thread.start()
        except Exception as e:
            raise Exception('Failed to start eventstream thread: {0}'.format(e))

        return self

    def Connect(self):
        self.connected = True

    def Disconnect(self):
        self.connected = False
        self.Unregister()

    def Register(self):
        try:
            self.heartbeat_thread = threading.Thread(name='HeartbeatThread', target=self.heartbeat_handler, args=(self.arlo, self.heartbeat_stop_event, ))
            self.heartbeat_thread.setDaemon(True)
            self.heartbeat_thread.start()
            self.registered = True
        except Exception as e:
            raise Exception('Failed to start to heartbeat thread: {0}'.format(e))

    def Unregister(self):
        self.registered = False

        if self.queue:
            self.queue.put(None)

        self.event_stream_stop_event.set()
        self.heartbeat_stop_event.set()

        if self.event_stream_thread != threading.current_thread():
            self.event_stream_thread.join()

        if self.heartbeat_thread != threading.current_thread():
            self.heartbeat_thread.join()


text:
namespace System.ServiceModel.Security
{
    using System.Runtime;
    using System.Security;
    using System.Security.Principal;
    using System.ServiceModel;
    using System.ServiceModel.Channels;
    using System.ServiceModel.Dispatcher;
    using System.ServiceModel.Diagnostics;

    /// <summary>
    /// The helper class to enable impersonation while serializing the body of the reply message.
    /// </summary>
    public class ImpersonateOnSerializingReplyMessageProperty : IMessageProperty
    {
        const string PropertyName = "ImpersonateOnSerializingReplyMessageProperty";
        MessageRpc rpc;

        internal ImpersonateOnSerializingReplyMessageProperty(ref MessageRpc rpc)
        {
           this.rpc = rpc;
        }

        /// <summary>
        /// Gets the name of the message property.
        /// </summary>
        public static string Name
        {
            get { return PropertyName; }
        }

        /// <summary>
        /// Gets the ImpersonateOnSerializingReplyMessageProperty property from a message.
        /// </summary>
        /// <param name="message">The message to extract the property from.</param>
        /// <param name="property">An output paramter to hold the ImpersonateOnSerializingReplyMessageProperty property.</param>
        /// <returns>True if the ImpersonateOnSerializingReplyMessageProperty property was found.</returns>
        public static bool TryGet(Message message, out ImpersonateOnSerializingReplyMessageProperty property)
        {
            if (message == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message");
            }

            return TryGet(message.Properties, out property);
        }

        /// <summary>
        /// Gets the ImpersonateOnSerializingReplyMessageProperty property from MessageProperties.
        /// </summary>
        /// <param name="properties">The MessagePropeties object.</param>
        /// <param name="property">An output paramter to hold the ImpersonateOnSerializingReplyMessageProperty property.</param>
        /// <returns>True if the ImpersonateOnSerializingReplyMessageProperty property was found.</returns>
        public static bool TryGet(MessageProperties properties, out ImpersonateOnSerializingReplyMessageProperty property)
        {
            if (properties == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("properties");
            }

            object value = null;
            if (properties.TryGetValue(PropertyName, out value))
            {
                property = value as ImpersonateOnSerializingReplyMessageProperty;
            }
            else
            {
                property = null;
            }

            return property != null;
        }

        /// <summary>
        /// Creates a copy of the message property.
        /// </summary>
        /// <returns>Returns a copy of the message property.</returns>
        public IMessageProperty CreateCopy()
        {
            ImpersonateOnSerializingReplyMessageProperty result = new ImpersonateOnSerializingReplyMessageProperty(ref this.rpc);
            return result;
        }

        /// <summary>
        /// Starts Impersonating with the caller's context if impersonation is enabled on the service and sets the appropriate principal on the thread as per the service configuration.
        /// </summary>
        /// <param name="impersonationContext">The impersonated context.</param>
        /// <param name="originalPrincipal">The original principal on the thread before invoking this method.</param>
        /// <param name="isThreadPrincipalSet">The value determines if the principal was set on the thread by the method.</param>
        /// <returns>Returns false if operation context was not available to impersonate.</returns>
        [Fx.Tag.SecurityNote(Critical = "Calls SecurityCritical method StartImpersonation.", Safe = "Manages the result of impersonation and properly Disposes it.")]
        [SecuritySafeCritical]
        public void StartImpersonation(out IDisposable impersonationContext, out IPrincipal originalPrincipal, out bool isThreadPrincipalSet)
        {
            impersonationContext = null;
            originalPrincipal = null;
            isThreadPrincipalSet = false;

            if (OperationContext.Current != null)
            {
                EndpointDispatcher endpointDispatcher = OperationContext.Current.EndpointDispatcher;
                if (endpointDispatcher != null)
                {
                    DispatchRuntime dispatchRuntime = endpointDispatcher.DispatchRuntime;
                    ImmutableDispatchRuntime runtime = dispatchRuntime.GetRuntime();
                    if (runtime != null && runtime.SecurityImpersonation != null)
                    {
                        runtime.SecurityImpersonation.StartImpersonation(ref this.rpc, out impersonationContext, out originalPrincipal, out isThreadPrincipalSet);
                    }
                }
            }
        }

        /// <summary>
        /// Reverts impersonation and sets the original principal on the thread.
        /// </summary>
        /// <param name="impersonationContext">The impersonation context to revert.</param>
        /// <param name="originalPrincipal">The original principal to set on the thread.</param>
        /// <param name="isThreadPrincipalSet">The value determines if the thread principal was set during impersonation.</param>
        /// <returns>Returns false if operation context was not available to revert the impersonation.</returns>
        [Fx.Tag.SecurityNote(Critical = "Calls SecurityCritical method StartImpersonation.", Safe = "Manages the result of impersonation and properly Disposes it.")]
        [SecuritySafeCritical]
        public void StopImpersonation(IDisposable impersonationContext, IPrincipal originalPrincipal, bool isThreadPrincipalSet)
        {
            if (OperationContext.Current != null)
            {
                EndpointDispatcher endpointDispatcher = OperationContext.Current.EndpointDispatcher;
                if (endpointDispatcher != null)
                {
                    DispatchRuntime dispatchRuntime = endpointDispatcher.DispatchRuntime;
                    ImmutableDispatchRuntime runtime = dispatchRuntime.GetRuntime();
                    if (runtime != null && runtime.SecurityImpersonation != null)
                    {
                       runtime.SecurityImpersonation.StopImpersonation(ref this.rpc, impersonationContext, originalPrincipal, isThreadPrincipalSet);
                    }
                }
            }
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@id/lylib_main_screen"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.hkm.layout.NonSwipe
        android:id="@id/lylib_main_frame_body"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/lylib_toolbar_stub" />

    <View
        android:id="@id/lylib_toolbar_stub"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:layout_alignParentTop="true"
        android:background="?attr/colorPrimary" />

</RelativeLayout>


text:
namespace PIXL {namespace graphics {

	class Drawable : public Component
	{
	public:
		Drawable();
		Drawable(math::Vector2f size, const math::Vector4f& color);
		Drawable(Texture& texture, const math::Vector4f& color);
		virtual ~Drawable(){}

		void Draw(Renderer* renderer) override;

		const math::Vector2f& GetSize() const;
		const unsigned int GetColor() const;
		const std::array<math::Vector2f, 4>& GetUvs();
		const GLuint GetTextureID() const;

		const void SetSize(const math::Vector2f& newSize);
		const void SetColor(const math::Vector4f& newColor);
		void SetUvs(const std::array<math::Vector2f, 4>& newUvs);
		void SetTexture(Texture& newTexture);

	protected:
		math::Vector2f m_size;
		unsigned int m_color;
		std::array<math::Vector2f, 4> m_uvs;
		Texture* m_texture;

	private:
		const void SetUintColor(const math::Vector4f& newColor);
		const void SetDefaultUvs();
	};

} }


text:
package com.amazonaws.services.storagegateway.model;

import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 */
public class AddCacheRequest extends AmazonWebServiceRequest implements
        Serializable, Cloneable {

    private String gatewayARN;

    private com.amazonaws.internal.SdkInternalList<String> diskIds;

    /**
     * @param gatewayARN
     */
    public void setGatewayARN(String gatewayARN) {
        this.gatewayARN = gatewayARN;
    }

    /**
     * @return
     */
    public String getGatewayARN() {
        return this.gatewayARN;
    }

    /**
     * @param gatewayARN
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public AddCacheRequest withGatewayARN(String gatewayARN) {
        setGatewayARN(gatewayARN);
        return this;
    }

    /**
     * @return
     */
    public java.util.List<String> getDiskIds() {
        if (diskIds == null) {
            diskIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return diskIds;
    }

    /**
     * @param diskIds
     */
    public void setDiskIds(java.util.Collection<String> diskIds) {
        if (diskIds == null) {
            this.diskIds = null;
            return;
        }

        this.diskIds = new com.amazonaws.internal.SdkInternalList<String>(
                diskIds);
    }

    /**
     *

     * NOTE: This method appends the values to the existing list (if
     * any). Use {@link #setDiskIds(java.util.Collection)} or
     * {@link #withDiskIds(java.util.Collection)} if you want to override the
     * existing values.
     *

     *
     * @param diskIds
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public AddCacheRequest withDiskIds(String... diskIds) {
        if (this.diskIds == null) {
            setDiskIds(new com.amazonaws.internal.SdkInternalList<String>(
                    diskIds.length));
        }
        for (String ele : diskIds) {
            this.diskIds.add(ele);
        }
        return this;
    }

    /**
     * @param diskIds
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public AddCacheRequest withDiskIds(java.util.Collection<String> diskIds) {
        setDiskIds(diskIds);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getGatewayARN() != null)
            sb.append("GatewayARN: " + getGatewayARN() + ",");
        if (getDiskIds() != null)
            sb.append("DiskIds: " + getDiskIds());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof AddCacheRequest == false)
            return false;
        AddCacheRequest other = (AddCacheRequest) obj;
        if (other.getGatewayARN() == null ^ this.getGatewayARN() == null)
            return false;
        if (other.getGatewayARN() != null
                && other.getGatewayARN().equals(this.getGatewayARN()) == false)
            return false;
        if (other.getDiskIds() == null ^ this.getDiskIds() == null)
            return false;
        if (other.getDiskIds() != null
                && other.getDiskIds().equals(this.getDiskIds()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode
                + ((getGatewayARN() == null) ? 0 : getGatewayARN().hashCode());
        hashCode = prime * hashCode
                + ((getDiskIds() == null) ? 0 : getDiskIds().hashCode());
        return hashCode;
    }

    @Override
    public AddCacheRequest clone() {
        return (AddCacheRequest) super.clone();
    }
}


text:
 Pointl
 by [Chris Novello](http://chrisnovello.com) ([@paperkettle](http://www.twitter.com/paperkettle))

 Pointl is a super simple template sketch for rendering images as fluttering typographic pointillism.

 In this incarnation
- a random sample of pixels in the image are rendered as letters.
- the draw area moves across the canvas, effectively using one image to paint another.
- you can have a slideshow of these images, which you can also step through via OSC.
- you load images by placing jpgs in the data folder and labeling them numerically. So for example place "0.jpg" and "1.jpg" in the data folder and the sketch will have two slides.

You might consider alternative loading schemes rather than renaming your jpgs. This sketch is just a quick and easy way to experiment with the base idea of the program

You'll need the [oscP5 library](http://www.sojamo.de/libraries/oscP5/).

My favorite font to use with this sketch is [M01_CPS](http://mfs.sub.jp/font/m01.zip).


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

namespace Mozu.Api.Contracts.ProductRuntime
{
		///
		///	The current state of the product purchase determines whether or not the product is eligible for purchase. Products with options are only purchasable if the shopper has selected all required options. If the product is not ready for purchase, a message lists missing options that are required.
		///
		public class ProductPurchasableState
		{
			public bool IsPurchasable { get; set; }

			public List<ValidationMessage> Messages { get; set; }

		}

}


text:
package alec_wam.CrystalMod.tiles.pipes.power.cu;

import alec_wam.CrystalMod.api.energy.ICEnergyStorage;
import alec_wam.CrystalMod.tiles.pipes.power.IPowerInterface;
import net.minecraft.util.EnumFacing;

public class PowerInterfaceCU implements IPowerInterface {

  private ICEnergyStorage storage;

  public PowerInterfaceCU(ICEnergyStorage con) {
    this.storage = con;
  }

  @Override
  public Object getDelegate() {
    return storage;
  }

  @Override
  public boolean canPipeConnect(EnumFacing from) {
    if(from != null) {
      from = from.getOpposite();
    }
    return true;
  }

  @Override
  public int getEnergyStored(EnumFacing dir) {
    if (storage == null) {
    	return 0;
    }
    return storage.getCEnergyStored();
  }

  @Override
  public int getMaxEnergyStored(EnumFacing dir) {
    if (storage == null) {
      return 0;
    }
    return storage.getMaxCEnergyStored();

  }

  @Override
  public int getPowerRequest(EnumFacing dir) {
    if(storage == null) {
    	return 0;
    }
    return storage.fillCEnergy(9999999, true);
  }

  @Override
  public int getMinEnergyReceived(EnumFacing dir) {
    return 0;
  }

  @Override
  public int fillEnergy(EnumFacing dir, int canOffer, boolean simulate) {
    if(storage == null) {
    	return 0;
    }
    return storage.fillCEnergy(canOffer, simulate);
  }

  @Override
  public boolean isOutputOnly() {
    return !storage.canReceive();
  }

  @Override
  public boolean isInputOnly() {
    return false;
  }

}


text:
from classytags.arguments import Argument, MultiValueArgument
from classytags.core import Options, Tag
from classytags.helpers import InclusionTag
from classytags.parser import Parser
from cms.models import Page, Placeholder as PlaceholderModel
from cms.plugin_rendering import render_plugins, render_placeholder
from cms.plugins.utils import get_plugins
from cms.utils import get_language_from_request
from cms.utils.moderator import get_cmsplugin_queryset, get_page_queryset
from cms.utils.placeholder import validate_placeholder_name
from django import template
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.core.mail import mail_managers
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from itertools import chain
import re

register = template.Library()

def get_site_id(site):
    if site:
        if isinstance(site, Site):
            site_id = site.id
        elif isinstance(site, int) or (isinstance(site, basestring) and site.isdigit()):
            site_id = int(site)
        else:
            site_id = settings.SITE_ID
    else:
        site_id = settings.SITE_ID
    return site_id

def has_permission(page, request):
    return page.has_change_permission(request)
register.filter(has_permission)

CLEAN_KEY_PATTERN = re.compile(r'[^a-zA-Z0-9_-]')

def _clean_key(key):
    return CLEAN_KEY_PATTERN.sub('-', key)

def _get_cache_key(name, page_lookup, lang, site_id):
    if isinstance(page_lookup, Page):
        page_key = str(page_lookup.pk)
    else:
        page_key = str(page_lookup)
    page_key = _clean_key(page_key)
    return name+'__page_lookup:'+page_key+'_site:'+str(site_id)+'_lang:'+str(lang)

def _get_page_by_untyped_arg(page_lookup, request, site_id):
    """
    The `page_lookup` argument can be of any of the following types:
    - Integer: interpreted as `pk` of the desired page
    - String: interpreted as `reverse_id` of the desired page
    - `dict`: a dictionary containing keyword arguments to find the desired page
    (for instance: `{'pk': 1}`)
    - `Page`: you can also pass a Page object directly, in which case there will be no database lookup.
    - `None`: the current page will be used
    """
    if page_lookup is None:
        return request.current_page
    if isinstance(page_lookup, Page):
        return page_lookup
    if isinstance(page_lookup, basestring):
        page_lookup = {'reverse_id': page_lookup}
    elif isinstance(page_lookup, (int, long)):
        page_lookup = {'pk': page_lookup}
    elif not isinstance(page_lookup, dict):
        raise TypeError('The page_lookup argument can be either a Dictionary, Integer, Page, or String.')
    page_lookup.update({'site': site_id})
    try:
        return get_page_queryset(request).get(**page_lookup)
    except Page.DoesNotExist:
        site = Site.objects.get_current()
        subject = _('Page not found on %(domain)s') % {'domain':site.domain}
        body = _("A template tag couldn't find the page with lookup arguments `%(page_lookup)s\n`. "
            "The URL of the request was: http://%(host)s%(path)s") \
            % {'page_lookup': repr(page_lookup), 'host': site.domain, 'path': request.path}
        if settings.DEBUG:
            raise Page.DoesNotExist(body)
        else:
            if settings.SEND_BROKEN_LINK_EMAILS:
                mail_managers(subject, body, fail_silently=True)
            return None

class PageUrl(InclusionTag):
    template = 'cms/content.html'
    name = 'page_url'

    options = Options(
        Argument('page_lookup'),
        Argument('lang', required=False, default=None),
        Argument('site', required=False, default=None),
    )

    def get_context(self, context, page_lookup, lang, site):
        site_id = get_site_id(site)
        request = context.get('request', False)
        if not request:
            return {'content': ''}

        if request.current_page == "dummy":
            return {'content': ''}
        if lang is None:
            lang = get_language_from_request(request)
        cache_key = _get_cache_key('page_url', page_lookup, lang, site_id)+'_type:absolute_url'
        url = cache.get(cache_key)
        if not url:
            page = _get_page_by_untyped_arg(page_lookup, request, site_id)
            if page:
                url = page.get_absolute_url(language=lang)
                cache.set(cache_key, url, settings.CMS_CACHE_DURATIONS['content'])
        if url:
            return {'content': url}
        return {'content': ''}
register.tag(PageUrl)

register.tag('page_id_url', PageUrl)

def _get_placeholder(current_page, page, context, name):
    placeholder_cache = getattr(current_page, '_tmp_placeholders_cache', {})
    if page.pk in placeholder_cache:
        return placeholder_cache[page.pk].get(name, None)
    placeholder_cache[page.pk] = {}
    placeholders = page.placeholders.all()
    for placeholder in placeholders:
        placeholder_cache[page.pk][placeholder.slot] = placeholder
    current_page._tmp_placeholders_cache = placeholder_cache
    return placeholder_cache[page.pk].get(name, None)

def get_placeholder_content(context, request, current_page, name, inherit):
    pages = [current_page]
    if inherit:
        pages = chain([current_page], current_page.get_cached_ancestors(ascending=True))
    for page in pages:
        placeholder = _get_placeholder(current_page, page, context, name)
        if placeholder is None:
            continue
        if not get_plugins(request, placeholder):
            continue
        content = render_placeholder(placeholder, context, name)
        if content:
            return content
    placeholder = _get_placeholder(current_page, current_page, context, name)
    return render_placeholder(placeholder, context, name)

class PlaceholderParser(Parser):
    def parse_blocks(self):
        for bit in getattr(self.kwargs['extra_bits'], 'value', self.kwargs['extra_bits']):
            if getattr(bit, 'value', bit.var.value) == 'or':
                return super(PlaceholderParser, self).parse_blocks()
        return

class PlaceholderOptions(Options):
    def get_parser_class(self):
        return PlaceholderParser

class Placeholder(Tag):
    """
    This template node is used to output page content and
    is also used in the admin to dynamically generate input fields.

    eg: {% placeholder "placeholder_name" %}

    {% placeholder "sidebar" inherit %}

    {% placeholder "footer" inherit or %}
        About us
    {% endplaceholder %}

    Keyword arguments:
    name -- the name of the placeholder
    width -- additional width attribute (integer) which gets added to the plugin context
    (deprecated, use `{% with 320 as width %}{% placeholder "foo"}{% endwith %}`)
    inherit -- optional argument which if given will result in inheriting
        the content of the placeholder with the same name on parent pages
    or -- optional argument which if given will make the template tag a block
        tag whose content is shown if the placeholder is empty
    """
    name = 'placeholder'
    options = PlaceholderOptions(
        Argument('name', resolve=False),
        MultiValueArgument('extra_bits', required=False, resolve=False),
        blocks=[
            ('endplaceholder', 'nodelist'),
        ]
    )

    def render_tag(self, context, name, extra_bits, nodelist=None):
        validate_placeholder_name(name)
        width = None
        inherit = False
        for bit in extra_bits:
            if bit == 'inherit':
                inherit = True
            elif bit.isdigit():
                width = int(bit)
                import warnings
                warnings.warn(
                    "The width parameter for the placeholder tag is deprecated.",
                    DeprecationWarning
                )
        if not 'request' in context:
            return ''
        request = context['request']
        if width:
            context.update({'width': width})

        page = request.current_page
        if not page or page == 'dummy':
            if nodelist:
                return nodelist.render(context)

            return ''

        content = get_placeholder_content(context, request, page, name, inherit)
        if not content and nodelist:
            return nodelist.render(context)
        return content

    def get_name(self):
        return self.kwargs['name'].var.value.strip('"').strip("'")
register.tag(Placeholder)

class PageAttribute(Tag):
    """
    This template node is used to output attribute from a page such
    as its title or slug.

    Synopsis
         {% page_attribute "field-name" %}
         {% page_attribute "field-name" page_lookup %}

    Example
         {# Output current page's page_title attribute: #}
         {% page_attribute "page_title" %}
         {# Output page_title attribute of the page with reverse_id "the_page": #}
         {% page_attribute "page_title" "the_page" %}
         {# Output slug attribute of the page with pk 10: #}
         {% page_attribute "slug" 10 %}

    Keyword arguments:
    field-name -- the name of the field to output. Use one of:
    - title
    - menu_title
    - page_title
    - slug
    - meta_description
    - meta_keywords

    page_lookup -- lookup argument for Page, if omitted field-name of current page is returned.
    See _get_page_by_untyped_arg() for detailed information on the allowed types and their interpretation
    for the page_lookup argument.
    """
    name = 'page_attribute'
    options = Options(
        Argument('name', resolve=False),
        Argument('page_lookup', required=False, default=None)
    )

    valid_attributes = [
        "title",
        "slug",
        "meta_description",
        "meta_keywords",
        "page_title",
        "menu_title"
    ]

    def render_tag(self, context, name, page_lookup):
        if not 'request' in context:
            return ''
        name = name.lower()
        request = context['request']
        lang = get_language_from_request(request)
        page = _get_page_by_untyped_arg(page_lookup, request, get_site_id(None))
        if page == "dummy":
            return ''
        if page and name in self.valid_attributes:
            f = getattr(page, "get_%s" % name)
            return f(language=lang, fallback=True)
        return ''
register.tag(PageAttribute)

class CleanAdminListFilter(InclusionTag):
    template = 'admin/filter.html'
    name = 'clean_admin_list_filter'

    options = Options(
        Argument('cl'),
        Argument('spec'),
    )

    def get_context(self, context, cl, spec):
        choices = sorted(list(spec.choices(cl)), key=lambda k: k['query_string'])
        query_string = None
        unique_choices = []
        for choice in choices:
            if choice['query_string'] != query_string:
                unique_choices.append(choice)
                query_string = choice['query_string']
        return {'title': spec.title(), 'choices' : unique_choices}

def _show_placeholder_for_page(context, placeholder_name, page_lookup, lang=None,
        site=None, cache_result=True):
    """
    Shows the content of a page with a placeholder name and given lookup
    arguments in the given language.
    This is useful if you want to have some more or less static content that is
    shared among many pages, such as a footer.

    See _get_page_by_untyped_arg() for detailed information on the allowed types
    and their interpretation for the page_lookup argument.
    """
    validate_placeholder_name(placeholder_name)

    request = context.get('request', False)
    site_id = get_site_id(site)

    if not request:
        return {'content': ''}
    if lang is None:
        lang = get_language_from_request(request)

    content = None

    if cache_result:
        base_key = _get_cache_key('_show_placeholder_for_page', page_lookup, lang, site_id)
        cache_key = _clean_key('%s_placeholder:%s' % (base_key, placeholder_name))
        content = cache.get(cache_key)

    if not content:
        page = _get_page_by_untyped_arg(page_lookup, request, site_id)
        if not page:
            return {'content': ''}
        try:
            placeholder = page.placeholders.get(slot=placeholder_name)
        except PlaceholderModel.DoesNotExist:
            if settings.DEBUG:
                raise
            return {'content': ''}
        baseqs = get_cmsplugin_queryset(request)
        plugins = baseqs.filter(
            placeholder=placeholder,
            language=lang,
            placeholder__slot__iexact=placeholder_name,
            parent__isnull=True
        ).order_by('position').select_related()
        c = render_plugins(plugins, context, placeholder)
        content = "".join(c)

    if cache_result:
        cache.set(cache_key, content, settings.CMS_CACHE_DURATIONS['content'])

    if content:
        return {'content': mark_safe(content)}
    return {'content': ''}

class ShowPlaceholderById(InclusionTag):
    template = 'cms/content.html'
    name = 'show_placeholder_by_id'

    options = Options(
        Argument('placeholder_name'),
        Argument('reverse_id'),
        Argument('lang', required=False, default=None),
        Argument('site', required=False, default=None),
    )

    def get_context(self, *args, **kwargs):
        return _show_placeholder_for_page(**self.get_kwargs(*args, **kwargs))

    def get_kwargs(self, context, placeholder_name, reverse_id, lang, site):
        return {
            'context': context,
            'placeholder_name': placeholder_name,
            'page_lookup': reverse_id,
            'lang': lang,
            'site': site
        }
register.tag(ShowPlaceholderById)
register.tag('show_placeholder', ShowPlaceholderById)

class ShowUncachedPlaceholderById(ShowPlaceholderById):
    name = 'show_uncached_placeholder_by_id'
    def get_kwargs(self, *args, **kwargs):
        kwargs = super(ShowUncachedPlaceholderById, self).get_kwargs(*args, **kwargs)
        kwargs['cache_result'] = False
        return kwargs
register.tag(ShowUncachedPlaceholderById)
register.tag('show_uncached_placeholder', ShowUncachedPlaceholderById)

class CMSToolbar(InclusionTag):
    template = 'cms/toolbar/toolbar.html'
    name = 'cms_toolbar'

    def render(self, context):
        request = context.get('request', None)
        if not request:
            return ''
        toolbar = getattr(request, 'toolbar', None)
        if not toolbar:
            return ''
        if not toolbar.show_toolbar:
            return ''
        return super(CMSToolbar, self).render(context)

    def get_context(self, context):
        context['CMS_TOOLBAR_CONFIG'] = context['request'].toolbar.as_json(context)
        return context
register.tag(CMSToolbar)


text:
#pragma once
#include <aws/devops-guru/DevOpsGuru_EXPORTS.h>
#include <aws/core/utils/DateTime.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace DevOpsGuru
{
namespace Model
{

  /**
   *
 A time range that specifies when DevOps Guru opens and then closes an
   * anomaly. This is different from AnomalyTimeRange, which specifies
   * the time range when DevOps Guru actually observes the anomalous behavior.
   *

See Also:
   AWS
   * API Reference

   */
  class AWS_DEVOPSGURU_API AnomalyReportedTimeRange
  {
  public:
    AnomalyReportedTimeRange();
    AnomalyReportedTimeRange(Aws::Utils::Json::JsonView jsonValue);
    AnomalyReportedTimeRange& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
 The time when an anomaly is opened.

     */
    inline const Aws::Utils::DateTime& GetOpenTime() const{ return m_openTime; }

    /**
     *
 The time when an anomaly is opened.

     */
    inline bool OpenTimeHasBeenSet() const { return m_openTimeHasBeenSet; }

    /**
     *
 The time when an anomaly is opened.

     */
    inline void SetOpenTime(const Aws::Utils::DateTime& value) { m_openTimeHasBeenSet = true; m_openTime = value; }

    /**
     *
 The time when an anomaly is opened.

     */
    inline void SetOpenTime(Aws::Utils::DateTime&& value) { m_openTimeHasBeenSet = true; m_openTime = std::move(value); }

    /**
     *
 The time when an anomaly is opened.

     */
    inline AnomalyReportedTimeRange& WithOpenTime(const Aws::Utils::DateTime& value) { SetOpenTime(value); return *this;}

    /**
     *
 The time when an anomaly is opened.

     */
    inline AnomalyReportedTimeRange& WithOpenTime(Aws::Utils::DateTime&& value) { SetOpenTime(std::move(value)); return *this;}

    /**
     *
 The time when an anomaly is closed.

     */
    inline const Aws::Utils::DateTime& GetCloseTime() const{ return m_closeTime; }

    /**
     *
 The time when an anomaly is closed.

     */
    inline bool CloseTimeHasBeenSet() const { return m_closeTimeHasBeenSet; }

    /**
     *
 The time when an anomaly is closed.

     */
    inline void SetCloseTime(const Aws::Utils::DateTime& value) { m_closeTimeHasBeenSet = true; m_closeTime = value; }

    /**
     *
 The time when an anomaly is closed.

     */
    inline void SetCloseTime(Aws::Utils::DateTime&& value) { m_closeTimeHasBeenSet = true; m_closeTime = std::move(value); }

    /**
     *
 The time when an anomaly is closed.

     */
    inline AnomalyReportedTimeRange& WithCloseTime(const Aws::Utils::DateTime& value) { SetCloseTime(value); return *this;}

    /**
     *
 The time when an anomaly is closed.

     */
    inline AnomalyReportedTimeRange& WithCloseTime(Aws::Utils::DateTime&& value) { SetCloseTime(std::move(value)); return *this;}

  private:

    Aws::Utils::DateTime m_openTime;
    bool m_openTimeHasBeenSet;

    Aws::Utils::DateTime m_closeTime;
    bool m_closeTimeHasBeenSet;
  };

} // namespace Model
} // namespace DevOpsGuru
} // namespace Aws


text:
package com.netflix.spinnaker.halyard.cli.command.v1.config.ci.codebuild;

public class AwsCodeBuildCommandProperties {
  static final String ACCOUNT_ID_DESCRIPTION =
      "The AWS account ID that will be used to trigger CodeBuild build.";
  static final String REGION_DESCRIPTION = "The AWS region in which your CodeBuild projects live.";
  static final String ASSUME_ROLE_DESCRIPTION =
      "If set, Halyard will configure a credentials provider that uses AWS "
          + "Security Token Service to assume the specified role.\n\n"
          + "Example: \"user/spinnaker\" or \"role/spinnakerManaged\"";
  static final String ACCESS_KEY_ID_DESCRIPTION =
      "Your AWS Access Key ID. If not provided, Halyard/Spinnaker will try to find AWS credentials "
          + "as described at http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html#credentials-default";

  static final String SECRET_KEY_DESCRIPTION = "Your AWS Secret Key.";
}


text:
namespace caffe2 {

REGISTER_CUDA_OPERATOR(If, IfOp<CUDAContext>);

} // namespace caffe2


text:
package com.badlogic.gdx.backends.lwjgl;

import java.awt.Canvas;

import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.mini2Dx.core.game.ApplicationListener;
import org.mini2Dx.core.game.GameContainer;
import org.mini2Dx.desktop.DesktopGameWrapper;
import org.mini2Dx.desktop.DesktopMini2DxConfig;

import com.badlogic.gdx.Application;
import com.badlogic.gdx.Audio;
import com.badlogic.gdx.Files;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.LifecycleListener;
import com.badlogic.gdx.Net;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.backends.lwjgl.audio.OpenALAudio;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Clipboard;
import com.badlogic.gdx.utils.GdxRuntimeException;
import com.badlogic.gdx.utils.ObjectMap;

/**
 * Launches desktop-based mini2Dx games. Based on
 * LibGDX's LwjglApplication class
 */
public class DesktopMini2DxGame implements Application {
	protected final DesktopMini2DxConfig config;
	protected final LwjglGraphics graphics;
	protected OpenALAudio audio;
	protected final LwjglFiles files;
	protected final LwjglInput input;
	protected final LwjglNet net;
	protected final ApplicationListener listener;
	protected Thread mainLoopThread;
	protected boolean running = true;
	protected final Array<Runnable> runnables = new Array<Runnable>();
	protected final Array<Runnable> executedRunnables = new Array<Runnable>();
	protected final Array<LifecycleListener> lifecycleListeners = new Array<LifecycleListener>();
	protected int logLevel = LOG_INFO;
	protected String preferencesdir;

	public DesktopMini2DxGame(GameContainer game, DesktopMini2DxConfig config) {
		this(game, config, new LwjglGraphics(config));
	}

	public DesktopMini2DxGame(GameContainer game, DesktopMini2DxConfig config, Canvas canvas) {
		this(game, config, new LwjglGraphics(canvas, config));
	}

	public DesktopMini2DxGame(GameContainer game, DesktopMini2DxConfig config, LwjglGraphics graphics) {
		LwjglNativesLoader.load();

		this.config = config;
		listener = new DesktopGameWrapper(game, config.gameIdentifier);

		if (config.title == null) {
			config.title = game.getClass().getSimpleName();
		}

		this.graphics = graphics;
		this.files = new LwjglFiles();
		this.input = new LwjglInput();
		this.net = new LwjglNet();

		initialiseLibGDX();
		launchGame();
	}

	private void initialiseLibGDX() {
		if (!LwjglApplicationConfiguration.disableAudio) {
			try {
				audio = new OpenALAudio(config.audioDeviceSimultaneousSources, config.audioDeviceBufferCount,
						config.audioDeviceBufferSize);
			} catch (Throwable t) {
				log("LwjglApplication", "Couldn't initialize audio, disabling audio", t);
				LwjglApplicationConfiguration.disableAudio = true;
			}
		}
		preferencesdir = config.preferencesDirectory;

		Gdx.app = this;
		Gdx.graphics = graphics;
		Gdx.audio = audio;
		Gdx.files = files;
		Gdx.input = input;
		Gdx.net = net;
	}

	private void launchGame() {
		mainLoopThread = new Thread("LWJGL Application") {
			@Override
			public void run() {
				graphics.setVSync(graphics.config.vSyncEnabled);
				try {
					DesktopMini2DxGame.this.executeGame();
				} catch (Throwable t) {
					if (audio != null)
						audio.dispose();
					Gdx.input.setCursorCatched(false);
					if (t instanceof RuntimeException)
						throw (RuntimeException) t;
					else
						throw new GdxRuntimeException(t);
				}
			}
		};
		mainLoopThread.start();
	}

	void executeGame() {
		Array<LifecycleListener> lifecycleListeners = this.lifecycleListeners;

		try {
			graphics.setupDisplay();
		} catch (LWJGLException e) {
			throw new GdxRuntimeException(e);
		}

		listener.create();
		graphics.resize = true;

		int lastWidth = graphics.getWidth();
		int lastHeight = graphics.getHeight();

		graphics.lastTime = System.nanoTime();

		float maximumDelta = 1f / config.targetFPS;
		float accumulator = 0f;
		float targetTimestep = config.targetTimestep;

		boolean wasActive = true;
		while (running) {
			Display.processMessages();
			if (Display.isCloseRequested()) {
				exit();
			}

			boolean isGameActive = Display.isActive();
			if (wasActive && !isGameActive) { // if it's just recently minimized
												// from active state
				wasActive = false;
				synchronized (lifecycleListeners) {
					for (LifecycleListener listener : lifecycleListeners) {
						listener.pause();
					}
				}
				listener.pause();
			}
			if (!wasActive && isGameActive) { // if it's just recently focused
												// from minimized state
				wasActive = true;
				synchronized (lifecycleListeners) {
					for (LifecycleListener listener : lifecycleListeners) {
						listener.resume();
					}
				}
				listener.resume();
			}

			boolean shouldRender = false;

			if (graphics.canvas != null) {
				int width = graphics.canvas.getWidth();
				int height = graphics.canvas.getHeight();
				if (lastWidth != width || lastHeight != height) {
					lastWidth = width;
					lastHeight = height;
					Gdx.gl.glViewport(0, 0, lastWidth, lastHeight);
					listener.resize(lastWidth, lastHeight);
					shouldRender = true;
				}
			} else {
				graphics.config.x = Display.getX();
				graphics.config.y = Display.getY();
				if (graphics.resize || Display.wasResized()
						|| (int) (Display.getWidth() * Display.getPixelScaleFactor()) != graphics.config.width
						|| (int) (Display.getHeight() * Display.getPixelScaleFactor()) != graphics.config.height) {
					graphics.resize = false;
					graphics.config.width = (int) (Display.getWidth() * Display.getPixelScaleFactor());
					graphics.config.height = (int) (Display.getHeight() * Display.getPixelScaleFactor());
					Gdx.gl.glViewport(0, 0, graphics.config.width, graphics.config.height);
					if (listener != null) {
						listener.resize(graphics.config.width, graphics.config.height);
					}
					graphics.requestRendering();
				}
			}

			if (executeRunnables()) {
				shouldRender = true;
			}

			// If one of the runnables set running to false, for example after
			// an exit().
			if (!running) {
				break;
			}

			shouldRender |= graphics.shouldRender();
			if (audio != null) {
				audio.update();
			}

			if (!isGameActive && graphics.config.backgroundFPS == -1) {
				shouldRender = false;
			}
			int frameRate = isGameActive ? graphics.config.foregroundFPS : graphics.config.backgroundFPS;
			if (shouldRender) {
				graphics.updateTime();
				graphics.frameId++;

				float delta = graphics.getDeltaTime();
				if (delta > maximumDelta) {
					delta = maximumDelta;
				}

				accumulator += delta;

				while (accumulator >= targetTimestep) {
					input.update();
					input.processEvents();
					listener.update(targetTimestep);
					accumulator -= targetTimestep;
				}
				listener.interpolate(accumulator / targetTimestep);

				listener.render();
				Display.update(false);
			} else {
				// Sleeps to avoid wasting CPU in an empty loop.
				if (frameRate == -1) {
					frameRate = 10;
				}
				if (frameRate == 0) {
					frameRate = graphics.config.backgroundFPS;
				}
				if (frameRate == 0) {
					frameRate = 30;
				}
			}
			if (frameRate > 0) {
				Display.sync(frameRate);
			}
		}

		synchronized (lifecycleListeners) {
			for (LifecycleListener listener : lifecycleListeners) {
				listener.pause();
				listener.dispose();
			}
		}
		listener.pause();
		listener.dispose();
		Display.destroy();
		if (audio != null) {
			audio.dispose();
		}
		if (graphics.config.forceExit) {
			System.exit(-1);
		}
	}

	public boolean executeRunnables() {
		synchronized (runnables) {
			for (int i = runnables.size - 1; i >= 0; i--) {
				executedRunnables.add(runnables.get(i));
			}
			runnables.clear();
		}
		if (executedRunnables.size == 0) {
			return false;
		}
		do {
			executedRunnables.pop().run();
		} while (executedRunnables.size > 0);
		return true;
	}

	@Override
	public ApplicationListener getApplicationListener() {
		return listener;
	}

	@Override
	public Audio getAudio() {
		return audio;
	}

	@Override
	public Files getFiles() {
		return files;
	}

	@Override
	public LwjglGraphics getGraphics() {
		return graphics;
	}

	@Override
	public Input getInput() {
		return input;
	}

	@Override
	public Net getNet() {
		return net;
	}

	@Override
	public ApplicationType getType() {
		return ApplicationType.Desktop;
	}

	@Override
	public int getVersion() {
		return 0;
	}

	public void stop() {
		running = false;
		try {
			mainLoopThread.join();
		} catch (Exception ex) {
		}
	}

	@Override
	public long getJavaHeap() {
		return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
	}

	@Override
	public long getNativeHeap() {
		return getJavaHeap();
	}

	ObjectMap<String, Preferences> preferences = new ObjectMap<String, Preferences>();

	@Override
	public Preferences getPreferences(String name) {
		if (preferences.containsKey(name)) {
			return preferences.get(name);
		} else {
			Preferences prefs = new LwjglPreferences(name, this.preferencesdir);
			preferences.put(name, prefs);
			return prefs;
		}
	}

	@Override
	public Clipboard getClipboard() {
		return new LwjglClipboard();
	}

	@Override
	public void postRunnable(Runnable runnable) {
		synchronized (runnables) {
			runnables.add(runnable);
			Gdx.graphics.requestRendering();
		}
	}

	@Override
	public void debug(String tag, String message) {
		if (logLevel >= LOG_DEBUG) {
			System.out.println(tag + ": " + message);
		}
	}

	@Override
	public void debug(String tag, String message, Throwable exception) {
		if (logLevel >= LOG_DEBUG) {
			System.out.println(tag + ": " + message);
			exception.printStackTrace(System.out);
		}
	}

	@Override
	public void log(String tag, String message) {
		if (logLevel >= LOG_INFO) {
			System.out.println(tag + ": " + message);
		}
	}

	@Override
	public void log(String tag, String message, Throwable exception) {
		if (logLevel >= LOG_INFO) {
			System.out.println(tag + ": " + message);
			exception.printStackTrace(System.out);
		}
	}

	@Override
	public void error(String tag, String message) {
		if (logLevel >= LOG_ERROR) {
			System.err.println(tag + ": " + message);
		}
	}

	@Override
	public void error(String tag, String message, Throwable exception) {
		if (logLevel >= LOG_ERROR) {
			System.err.println(tag + ": " + message);
			exception.printStackTrace(System.err);
		}
	}

	@Override
	public void setLogLevel(int logLevel) {
		this.logLevel = logLevel;
	}

	@Override
	public int getLogLevel() {
		return logLevel;
	}

	@Override
	public void exit() {
		postRunnable(new Runnable() {
			@Override
			public void run() {
				running = false;
			}
		});
	}

	@Override
	public void addLifecycleListener(LifecycleListener listener) {
		synchronized (lifecycleListeners) {
			lifecycleListeners.add(listener);
		}
	}

	@Override
	public void removeLifecycleListener(LifecycleListener listener) {
		synchronized (lifecycleListeners) {
			lifecycleListeners.removeValue(listener, true);
		}
	}
}