text:
FactoryGirl.define do
  factory :collaboration do
    user
    idea
  end
end


text:
/**
 * @file CatapultLaunchMethod.h
 * Catpult Launch detection
 *
 * @author Thomas Gubler <thomasgubler@gmail.com>
 */

#ifndef CATAPULTLAUNCHMETHOD_H_
#define CATAPULTLAUNCHMETHOD_H_

#include "LaunchMethod.h"

#include <drivers/drv_hrt.h>
#include <controllib/blocks.hpp>
#include <controllib/block/BlockParam.hpp>

namespace launchdetection
{

class CatapultLaunchMethod : public LaunchMethod, public control::SuperBlock
{
public:
	CatapultLaunchMethod(SuperBlock *parent);
	~CatapultLaunchMethod() override = default;

	void update(float accel_x) override;
	LaunchDetectionResult getLaunchDetected() const override;
	void reset() override;
	float getPitchMax(float pitchMaxDefault) override;

private:
	hrt_abstime last_timestamp{0};
	float integrator{0.0f};
	float motorDelayCounter{0.0f};

	LaunchDetectionResult state{LAUNCHDETECTION_RES_NONE};

	control::BlockParamFloat thresholdAccel;
	control::BlockParamFloat thresholdTime;
	control::BlockParamFloat motorDelay;
	control::BlockParamFloat pitchMaxPreThrottle; /**< Upper pitch limit before throttle is turned on.
						       Can be used to make sure that the AC does not climb
						       too much while attached to a bungee */

};

#endif /* CATAPULTLAUNCHMETHOD_H_ */

} // namespace launchdetection

redpajama_set_name: RedPajamaGithub


text:
***A user-friendly list of all the K2 target pixel files and their properties.***

This repository provides a list of the filenames, urls, and useful metadata
of all the K2 Target Pixel Files (TPF) that are available
in the [data archive at MAST](https://archive.stsci.edu/pub/k2/target_pixel_files/).

## Contents

* `k2-target-pixel-files.csv.gz`: a table of all target pixel files in gzipped CSV format.
* `k2-target-pixel-files.db`: a subset of the columns in the CSV table in SQLite format.

## Columns

The vast majority of the columns correspond directly to header keywords
in the target pixel files.  Hence more information about their meaning
can be found in the Kepler Instrument and Data Characteristics Handbooks.

Note that the SQLite file only contains a subset of these columns to keep its size small.

* `filename`: target pixel filename.
* `url`: full HTTP URL of the target pixel file.
* `filesize`: size of the target pixel file (MB).
* `object`: name of the target, i.e. `EPIC XXXXXXXXXX`.
* `keplerid`: EPIC ID number.
* `obsmode`: one of `long cadence` or `short cadence`.
* `campaign`: K2 Campaign number, e.g. `1` or `2`.
* `data_rel`: K2 data release number.
* `channel`: focal plane channel number.
* `module`: focal plane module number.
* `output`: focal plane module output number.
* `ra_obj`: J2000 Right Ascension of the target in the EPIC catalog (decimal degrees).  This position is not corrected for proper motion and may hence fall outside the aperture mask.
* `dec_obj`: Declination of the target in the EPIC catalog (decimal degrees).
* `kepmag`: Kepler magnitude of the target in the EPIC catalog.
* `cadences`: total number of cadences recorded in the file.
* `lc_start`: time of the first cadence.
* `lc_stop`: time of the last cadence.
* `gain`: detector gain.
* `readnoise`: detector read noise.
* `meanblck`: back ground estimate.
* `cddp3_0`: 3-hour CDPP estimate.
* `cddp6_0`: 6-hour CDPP estimate.
* `cddp12_0`: 12-hour CDPP estimate.
* `npix`: total number of pixels in the aperture mask.
* `naxis1`: size of the aperture mask in one direction.
* `naxis2`: size of the aperture mask in the other direction.
* `crpix1`, `crpix2`, `crval1`, `crval2`, `cdelt1`, `cdelt2`, `pc1_1`, `pc1_2`, `pc2_1`, `pc2_2`, `crval1p`, `crval2p`: WCS keywords.
* `corners`: ra,dec;ra,dec;ra,dec;ra,dec of the mask corners in decimal degrees.
* `ra_min`, `ra_max`, `dec_min`, `dec_max`: bounding box of the target mask in decimal degrees.

## Authors

Created by Geert Barentsen at the Kepler/K2 Guest Observer Office.
Please get in touch to report feedback or useful applications.


text:
package org.apache.spark.sql.connector.catalog

import java.util
import java.util.concurrent.ConcurrentHashMap

import scala.collection.JavaConverters._

import org.apache.spark.sql.catalyst.analysis.{NoSuchFunctionException, NoSuchNamespaceException}
import org.apache.spark.sql.connector.catalog.functions.UnboundFunction

class InMemoryCatalog extends InMemoryTableCatalog with FunctionCatalog {
  protected val functions: util.Map[Identifier, UnboundFunction] =
    new ConcurrentHashMap[Identifier, UnboundFunction]()

  override protected def allNamespaces: Seq[Seq[String]] = {
    (tables.keySet.asScala.map(_.namespace.toSeq) ++
      functions.keySet.asScala.map(_.namespace.toSeq) ++
      namespaces.keySet.asScala).toSeq.distinct
  }

  override def listFunctions(namespace: Array[String]): Array[Identifier] = {
    if (namespace.isEmpty || namespaceExists(namespace)) {
      functions.keySet.asScala.filter(_.namespace.sameElements(namespace)).toArray
    } else {
      throw new NoSuchNamespaceException(namespace)
    }
  }

  override def loadFunction(ident: Identifier): UnboundFunction = {
    Option(functions.get(ident)) match {
      case Some(func) =>
        func
      case _ =>
        throw new NoSuchFunctionException(ident)
    }
  }

  def createFunction(ident: Identifier, fn: UnboundFunction): UnboundFunction = {
    functions.put(ident, fn)
  }

  def clearFunctions(): Unit = {
    functions.clear()
  }
}


text:
[![CircleCI](https://circleci.com/gh/SiftScience/sift-ruby.svg?style=svg)](https://circleci.com/gh/SiftScience/sift-ruby)

The official Ruby bindings for the latest version (v205) of the [Sift API](https://sift.com/developers/docs/java/apis-overview).

## Requirements

  * Ruby 2.0.0 or above.

## Installation

If you want to build the gem from source:

```
$ gem build sift.gemspec
```

Alternatively, you can install the gem from rubygems.org:

```
gem install sift
```

## Usage

### Creating a Client:

```ruby
require "sift"

Sift.api_key = '<your_api_key_here>'
Sift.account_id = '<your_account_id_here>'
client = Sift::Client.new()

##### OR

client = Sift::Client.new(api_key: '<your_api_key_here>', account_id: '<your_account_id_here>')

```

### Sending a transaction event

```ruby
event = "$transaction"

user_id = "23056"  # User ID's may only contain a-z, A-Z, 0-9, =, ., -, _, +, @, :, &, ^, %, !, $

properties = {
 "$user_id" => user_id,
  "$user_email" => "buyer@gmail.com",
  "$seller_user_id" => "2371",
  "seller_user_email" => "seller@gmail.com",
  "$transaction_id" => "573050",
  "$payment_method" => {
    "$payment_type"    => "$credit_card",
    "$payment_gateway" => "$braintree",
    "$card_bin"        => "542486",
    "$card_last4"      => "4444"
  },
  "$currency_code" => "USD",
  "$amount" => 15230000,
}

response = client.track(event, properties)

response.ok?  # returns true or false
response.body  # API response body
response.http_status_code  # HTTP response code, 200 is ok.
response.api_status  # status field in the return body, Link to Error Codes
response.api_error_message  # Error message associated with status Error Code

# Request a score for the user with user_id 23056
response = client.score(user_id)
```

## Decisions

To learn more about the decisions endpoint visit our [developer docs](https://sift.com/developers/docs/ruby/decisions-api/get-decisions).

### List of Configured Decisions

Get a list of your decisions.

**Optional Params**
 - `entity_type`: `:user` or `:order` or `:session` or `:content`
 - `abuse_types`: `["payment_abuse", "content_abuse", "content_abuse",
   "account_abuse", "legacy", "account_takeover"]`

**Returns**

A `Response` object

**Example:**
```ruby
# fetch a list of all your decisions
response = client.decisions({
  entity_type: :user,
  abuse_types: ["payment_abuse", "content_abuse"]
})

# Check that response is okay.
unless response.ok?
  raise "Unable to fetch decisions #{response.api_error_message} " +
    "#{response.api_error_description}"
end

# find a decisions with the id "block_bad_user"
user_decision = response.body["data"].find do |decision|
  decision["id"] == "block_bad_user"
end

# Get the next page

if response.body["has_more"]
  client.decisions(response.body)
end
```

### Apply a decision

Applies a decision to an entity. Visit our [developer docs](http://sift.com/developers/docs/ruby/decisions-api/apply-decision) for more information.

**Required Params:**
- `decision_id`, `source`, `user_id`

**Other Params**
- `order_id`: when applying a decision to an order, you must pass in the `order_id`
- `session_id`: when applying a decision to a session, you must pass in the `session_id`
- `analyst`: when `source` is set to `manual_review`, this field *is required*

**Returns**
`Response` object.

**Examples:**
```ruby
# apply decision to a user
response = client.apply_decision({
  decision_id: "block_bad_user",
  source: "manual_review",
  analyst: "bob@your_company.com",
  user_id: "john@example.com"
})

# apply decision to "john@example.com"'s order
response = client.apply_decision({
  decision_id: "block_bad_order",
  source: "manual_review",
  analyst: "bob@your_company.com",
  user_id: "john@example.com",
  order_id: "ORDER_1234"
})

# apply decision to "john@example.com"'s session
response = client.apply_decision({
  decision_id: "block_bad_session",
  source: "manual_review",
  analyst: "bob@your_company.com",
  user_id: "john@example.com",
  session_id: "SESSION_ID_1234"
})

# apply decision to "john@example.com"'s content
response = client.apply_decision({
  decision_id: "block_bad_session",
  source: "manual_review",
  analyst: "bob@your_company.com",
  user_id: "john@example.com",
  content_id: "CONTENT_ID_1234"
})

# Make sure you handle the response after applying a decision:

if response.ok?
  # do stuff
else
  # Error message
  response.api_error_message

  # Summary of the error
  response.api_error_description

  # hash of errors:
  #  key: field in question
  #  value: description of the issue
  response.api_error_issues
end
```

## Sending a Label

```ruby
# Label the user with user_id 23056 as Bad with all optional fields
response = client.label(user_id, {
  "$is_bad" => true,
  "$abuse_type" => "payment_abuse",
  "$description" => "Chargeback issued",
  "$source" => "Manual Review",
  "$analyst" => "analyst.name@your_domain.com"
})

# Get the status of a workflow run
response = client.get_workflow_status('my_run_id')

# Get the latest decisions for a user
response = client.get_user_decisions('example_user_id')

# Get the latest decisions for an order
response = client.get_order_decisions('example_order_id')

# Get the latest decisions for a session
response = client.get_session_decisions('example_user_id', 'example_session_id')

# Get the latest decisions for an content
response = client.get_content_decisions('example_user_id', 'example_order_id')
```

## Response Object

All requests to our apis will return a `Response` instance.

### Public Methods:
- `ok?` returns `true` when the response is a `200`-`299`, `false` if it isn't
- `body` returns a hash representation of the json body returned.
- `api_error_message` returns a string describing the api error code.
- `api_error_description` a summary of the error that occured.
- `api_error_issues` a hash describing the items the error occured. The `key` is the item and the `value` is the description of the error.

## Building

Building and publishing the gem is captured by the following steps:

```ruby
$ gem build sift.gemspec
$ gem push sift-<current version>.gem

$ bundle
$ rake -T
$ rake build
$ rake install
$ rake release
```

## Testing

To run the various tests use the rake command as follows:

```ruby
$ rake spec
```


text:
#include <aws/opsworks/model/DescribeLoadBasedAutoScalingRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::OpsWorks::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

DescribeLoadBasedAutoScalingRequest::DescribeLoadBasedAutoScalingRequest() :
    m_layerIdsHasBeenSet(false)
{
}

Aws::String DescribeLoadBasedAutoScalingRequest::SerializePayload() const
{
  JsonValue payload;

  if(m_layerIdsHasBeenSet)
  {
   Array<JsonValue> layerIdsJsonList(m_layerIds.size());
   for(unsigned layerIdsIndex = 0; layerIdsIndex < layerIdsJsonList.GetLength(); ++layerIdsIndex)
   {
     layerIdsJsonList[layerIdsIndex].AsString(m_layerIds[layerIdsIndex]);
   }
   payload.WithArray("LayerIds", std::move(layerIdsJsonList));

  }

  return payload.View().WriteReadable();
}

Aws::Http::HeaderValueCollection DescribeLoadBasedAutoScalingRequest::GetRequestSpecificHeaders() const
{
  Aws::Http::HeaderValueCollection headers;
  headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "OpsWorks_20130218.DescribeLoadBasedAutoScaling"));
  return headers;

}


text:
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe ResponseHandler do
  context "processing a successful response" do
    context "for a single resource" do
      let(:json_from_api)  { File.open("#{FIXTURES_PATH}/resource_get_success.json").read }
      let(:raw_response)   { OpenStruct.new(:body => json_from_api, :code => 200) }
      let(:processed_data) { subject.process(raw_response) }

      it "returns a Hashie::Mash" do
        processed_data.should be_an_instance_of(Hashie::Mash)
      end

      it "returns the resource's data" do
        processed_data.name.should eq("BioShock")
      end
    end

    context "for a collection of resources" do
      let(:json_from_api)  { File.open("#{FIXTURES_PATH}/resource_list_get_success.json").read }
      let(:raw_response)   { OpenStruct.new(:body => json_from_api, :code => 200) }
      let(:processed_data) { subject.process(raw_response) }

      it "returns an Array" do
        processed_data.should be_an_instance_of(Array)
      end

      it "returns the correct amount of entities" do
        processed_data.should have(10).items
      end

      it "returns the correct data for the resources in the list" do
        processed_data.first.name.should eq("Blackjack")
      end
    end
  end

  context "processing an unsuccessful response" do
    let(:logger) { double("a logger").as_null_object }
    before(:each) { Configuration.logger = logger }

    context "when the response is nil" do
      it "raises an error" do
        expect { subject.process(nil) }.to raise_error(Errors::UnrecognizedResponseError)
      end
    end

    context "when the response code isn't 200" do
      let(:raw_response)   { OpenStruct.new(:code => 500) }

      it "raises an error" do
        expect { subject.process(raw_response) }.to raise_error(Errors::RequestFailedError)
      end

      it "logs the error" do
        logger.should_receive(:info)

        subject.process(raw_response) rescue []
      end
    end

    context "when the request is successful but the API call is invalid" do
      let(:json_from_api)  { File.open("#{FIXTURES_PATH}/resource_get_fail.json").read }
      let(:raw_response)   { OpenStruct.new(:body => json_from_api, :code => 200) }

      it "raises an error" do
        expect { subject.process(raw_response) }.to raise_error(Errors::InvalidRequestError)
      end

      it "logs the error" do
        logger.should_receive(:info)

        subject.process(raw_response) rescue []
      end

    end
  end
end


text:
<?php

/* FrontBundle:Inscription:index.html.twig */
class __TwigTemplate_4d5c9712fa6856d53756183be718363b1962db8d9ebd801ae6b26333b9ad8264 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = $this->env->loadTemplate("FrontBundle::base.html.twig");

        $this->blocks = array(
            'title' => array($this, 'block_title'),
            'nav' => array($this, 'block_nav'),
            'body' => array($this, 'block_body'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "FrontBundle::base.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    public function block_title($context, array $blocks = array())
    {
        // line 4
        echo "Inscription
";
    }

    // line 7
    public function block_nav($context, array $blocks = array())
    {
        // line 8
        echo "    ";
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["categories"]) ? $context["categories"] : $this->getContext($context, "categories")));
        foreach ($context['_seq'] as $context["_key"] => $context["cat"]) {
            // line 9
            echo "
env, $this->env->getExtension('routing')->getPath("category", array("id" => $this->getAttribute((isset($context["cat"]) ? $context["cat"] : $this->getContext($context, "cat")), "id"))), "html", null, true);
            echo "\">";
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context["cat"]) ? $context["cat"] : $this->getContext($context, "cat")), "name"), "html", null, true);
            echo "

   ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cat'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
    }

    // line 13
    public function block_body($context, array $blocks = array())
    {
        // line 14
        echo "

Création de votre compte

                <form method=\"post\" novalidate class=\"form-horizontal\" role=\"form\">
                    ";
        // line 23
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "_token"), 'widget');
        echo "

                        ";
        // line 26
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "civility"), 'label');
        echo "
                        ";
        // line 27
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "civility"), 'widget', array("attr" => array("class" => "form-control")));
        echo "

                        ";
        // line 30
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "firstName"), 'label', array("label" => "Votre nom"));
        echo "
                        ";
        // line 31
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "firstName"), 'widget', array("attr" => array("class" => "form-control")));
        echo "
                        ";
        // line 32
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "firstName"), 'errors');
        echo "

                        ";
        // line 35
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "lastName"), 'label', array("label" => "Votre nom"));
        echo "
                        ";
        // line 36
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "lastName"), 'widget', array("attr" => array("class" => "form-control")));
        echo "
                        ";
        // line 37
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "lastName"), 'errors');
        echo "

                        ";
        // line 40
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "email"), 'label', array("label" => "Votre mail"));
        echo "
                        ";
        // line 41
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "email"), 'widget', array("attr" => array("placeholder" => "votre.mail@adresse.ad", "class" => "form-control")));
        // line 46
        echo "
                        ";
        // line 47
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "email"), 'errors');
        echo "

                        ";
        // line 50
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "password"), 'label', array("label" => "Votre mot de passe"));
        echo "
                        ";
        // line 51
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "password"), 'widget', array("attr" => array("class" => "form-control")));
        echo "
                        ";
        // line 52
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["formulaire"]) ? $context["formulaire"] : $this->getContext($context, "formulaire")), "password"), 'errors');
        echo "

<input type=\"submit\" value=\"Envoyer\" class=\"btn btn-primary\" />

                </form>

";
    }

    public function getTemplateName()
    {
        return "FrontBundle:Inscription:index.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  140 => 52,  136 => 51,  132 => 50,  126 => 47,  123 => 46,  121 => 41,  117 => 40,  111 => 37,  107 => 36,  103 => 35,  97 => 32,  93 => 31,  89 => 30,  83 => 27,  79 => 26,  73 => 23,  62 => 14,  59 => 13,  46 => 9,  41 => 8,  38 => 7,  33 => 4,  30 => 3,);
    }
}


text:
Template[getTemplate('userMenu')].helpers({
  menuLabel: function () {
    return getDisplayName(Meteor.user());
  },
  menuItems: function () {
    return userMenu;
  },
  menuMode: function () {
    if (!!this.mobile) {
      return 'list';
    } else if (Settings.get('navLayout', 'top-nav') === 'top-nav') {
      return 'dropdown';
    } else {
      return 'accordion';
    }
  }
});


text:
//Project Name:		TCP/IP DRIVER
//Customer submitted file

///////////////////////////////////////////////////////////////////////////////
/*
  Stellaris ethernet controller nic

*/
///////////////////////////////////////////////////////////////////////////////

#ifndef eth_nic
#define eth_nic
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// global define

// embedded stack define
#define NIC_INIT_SPEED        1 // 1 100Mbps

// nic hw define
#define ETH_BASE   0x40048000

#define ETH_MIICLK 2500000
#define ETH_PHYCLK 25000000
#define ETH_MIIDIV ((ETH_PHYCLK >> 1) / ETH_MIICLK)

#define NIC_MAX_FRAME_LENGTH        2048      //Max Ethernet Frame Size

///////////////////////////////////////////////////////////////////////////////
// Peripheral enable

#define GPIO_RCGC2              0x400FE108

#define GPIO_RCGC2_PORTF_BIT    0x00000020
#define GPIO_RCGC2_EPHY0_BIT    0x10000000
#define GPIO_RCGC2_EMAC0_BIT    0x40000000

///////////////////////////////////////////////////////////////////////////////
// led hw

#define GPIO_PORTF_BASE         0x40025000
#define GPIO_OFFS_DIR           0x00000400  // Data direction register.
#define GPIO_OFFS_AFSEL         0x00000420  // Mode control select register.
#define GPIO_OFFS_DR4R          0x00000504  // 4ma drive select register.
#define GPIO_OFFS_DEN           0x0000051C  // Digital input enable register.

#define ETH_LED_PORT_BASE GPIO_PORTF_BASE
#define ETH_LED_GREEN     0x04
#define ETH_LED_YELLOW    0x08

///////////////////////////////////////////////////////////////////////////////
// PHY define

// regs
#define ETH_PHY_MR0                 0x00000000  // PHY cfg
#define ETH_PHY_MR1                 0x00000001  // PHY status
#define ETH_PHY_MR2                 0x00000002  // PHY ID1
#define ETH_PHY_MR3                 0x00000003  // PHY ID2
#define ETH_PHY_MR4                 0x00000004  // PHY auto negotiation
#define ETH_PHY_MR5                 0x00000005  // PHY auto negotiation
#define ETH_PHY_MR6                 0x00000006  // PHY auto negotiation
#define ETH_PHY_MR16                0x00000010  // PHY vendor specific
#define ETH_PHY_MR17                0x00000011  // PHY control register
#define ETH_PHY_MR18                0x00000012  // PHY diagnostic
#define ETH_PHY_MR19                0x00000013  // PHY transceiver ctrl
#define ETH_PHY_MR23                0x00000017  // PHY led config
#define ETH_PHY_MR24                0x00000018  // PHY MDI/MDIX ctrl

// bits
/////////////////////////////////////////////////////////////////////////////////// ETH_PHY0 bits
#define ETH_PHY_MR0_COLT            0x00000080  // 1 Collision Test
#define ETH_PHY_MR0_DUPLEX          0x00000100  // 1 Full Duplex Mode   0 Half Duplex
#define ETH_PHY_MR0_RANEG           0x00000200  // 1 Restart Auto-Negotiation clr by hw
#define ETH_PHY_MR0_ISO             0x00000400  // Isolate.
#define ETH_PHY_MR0_PWRDN           0x00000800  // 1 Power Down.
#define ETH_PHY_MR0_ANEGEN          0x00001000  // 1 Enable Auto-Negotiation
#define ETH_PHY_MR0_SPEEDSL         0x00002000  // 1 Enable 100Mb/s   0 10Mb/s
#define ETH_PHY_MR0_LOOPBK          0x00004000  // 1 Loopback Mode enable
#define ETH_PHY_MR0_RESET           0x00008000  // 1 Reset Registers.

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY1 bits
#define ETH_PHY_MR1_EXTD            0x00000001  // 1 Extended Capabilities enabled
#define ETH_PHY_MR1_JAB             0x00000002  // 1 Jabber Condition detect
#define ETH_PHY_MR1_LINK            0x00000004  // 1 Link OK
#define ETH_PHY_MR1_ANEGA           0x00000008  // 1 Auto-Negotiation
#define ETH_PHY_MR1_RFAULT          0x00000010  // 1 Remote Fault condition
#define ETH_PHY_MR1_ANEGC           0x00000020  // 1 Auto-Negotiation Complete
#define ETH_PHY_MR1_MFPS            0x00000040  // 1 Management Frames with Preamble suppressed
#define ETH_PHY_MR1_10T_H           0x00000800  // 1 Support 10BASE-T Half-Duplex Mode.
#define ETH_PHY_MR1_10T_F           0x00001000  // 1 Support 10BASE-T Full-Duplex Mode.
#define ETH_PHY_MR1_100X_H          0x00002000  // 1 Support 100BASE-TX Half-Duplex Mode.
#define ETH_PHY_MR1_100X_F          0x00004000  // 1 Support 100BASE-TX Full-Duplex Mode.

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY2 bits
#define ETH_PHY_MR2_OUI_MASK        0x0000FFFF  // OUI [21..6]

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY3 bits
#define ETH_PHY_MR3_REVN_MASK       0x0000000F  // Revision Number
#define ETH_PHY_MR3_MODELN_MASK     0x000003F0  // Model Number
#define ETH_PHY_MR3_OUI_M           0x0000FC00  // OUI [5..0]

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY4 bits
#define ETH_PHY_MR4_SEL_MASK        0x0000001F  // Selector field mask  Hard coded 0x01 802.3
#define ETH_PHY_MR4_A0              0x00000020  // 1 Technology Ability  10Base-T half duplex
#define ETH_PHY_MR4_A1              0x00000040  // 1 Technology Ability  10Base-T full duplex
#define ETH_PHY_MR4_A2              0x00000080  // 1 Technology Ability 100Base-T half duplex
#define ETH_PHY_MR4_A3              0x00000100  // 1 Technology Ability 100Base-T full duplex
#define ETH_PHY_MR4_RF              0x00002000  // 1 Remote Fault.
#define ETH_PHY_MR4_NP              0x00008000  // 1 Next Page info

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY5 bits
#define ETH_PHY_MR5_SEL_MASK        0x0000001F  // Selector Field.
#define ETH_PHY_MR5_AF_MASk         0x00001FE0  // Technology Ability Field.
#define ETH_PHY_MR5_RF              0x00002000  // 1 Remote Fault
#define ETH_PHY_MR5_ACK             0x00004000  // 1 ACK negotiation
#define ETH_PHY_MR5_NP              0x00008000  // 1 Next Page info

//ETH_PHY_MR5_SEL field values
#define ETH_PHY_MR5_SEL_8023        0x00000001  // IEEE Std 802.3
#define ETH_PHY_MR5_SEL_8029        0x00000002  // IEEE Std 802.9 ISLAN-16T
#define ETH_PHY_MR5_SEL_8025        0x00000003  // IEEE Std 802.5
#define ETH_PHY_MR5_SEL_1394        0x00000004  // IEEE Std 1394

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY6 bits
#define ETH_PHY_MR6_LPANEGA         0x00000001  // Link Partner is Auto-Negotiation Able
#define ETH_PHY_MR6_PRX             0x00000002  // New Page Received
#define ETH_PHY_MR6_LPNPA           0x00000008  // Link Partner is Next Page Able
#define ETH_PHY_MR6_PDF             0x00000010  // Parallel Detection Fault

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY16 bits
#define ETH_PHY_MR16_RXCC           0x00000001  // Receive Clock Control power saving
#define ETH_PHY_MR16_PCSBP          0x00000002  // PCS Bypass
#define ETH_PHY_MR16_RVSPOL         0x00000010  // Receive Data Polarity
#define ETH_PHY_MR16_APOL           0x00000020  // Auto-Polarity Disable
#define ETH_PHY_MR16_NL10           0x00000400  // Natural Loopback Mode
#define ETH_PHY_MR16_SQEI           0x00000800  // SQE Inhibit Testing
#define ETH_PHY_MR16_TXHIM          0x00001000  // Transmit High Impedance Mode
#define ETH_PHY_MR16_INPOL          0x00004000  // Interrupt Polarity  !! MUST BE 0
#define ETH_PHY_MR16_RPTR           0x00008000  // Repeater Mode

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY17 bits
#define ETH_PHY_MR17_INT_ANEGCOMP   0x00000001  // Auto-Negotiation Complete Interrupt
#define ETH_PHY_MR17_INT_RFAULT     0x00000002  // Remote Fault Interrupt
#define ETH_PHY_MR17_INT_LSCHG      0x00000004  // Link Status Change Interrupt
#define ETH_PHY_MR17_INT_LPACK      0x00000008  // LP Acknowledge Interrupt
#define ETH_PHY_MR17_INT_PDF        0x00000010  // Parallel Detection Fault Interrupt
#define ETH_PHY_MR17_INT_PRX        0x00000020  // Page Receive Interrupt
#define ETH_PHY_MR17_INT_RXER       0x00000040  // Receive Error Interrupt
#define ETH_PHY_MR17_INT_JABBER     0x00000080  // Jabber Event Interrupt
#define ETH_PHY_MR17_IE_ANEGCOMP    0x00000100  // Auto-Negotiation Complete Interrupt Enable
#define ETH_PHY_MR17_IE_RFAULT      0x00000200  // Remote Fault Interrupt Enable
#define ETH_PHY_MR17_IE_LSCHG       0x00000400  // Link Status Change Interrupt Enable
#define ETH_PHY_MR17_IE_LPACK       0x00000800  // LP Acknowledge Interrupt Enable
#define ETH_PHY_MR17_IE_PDF         0x00001000  // Parallel Detection Fault Interrupt Enable
#define ETH_PHY_MR17_IE_PRX         0x00002000  // Page Received Interrupt Enable
#define ETH_PHY_MR17_IE_RXER        0x00004000  // Receive Error Interrupt Enable
#define ETH_PHY_MR17_IE_JABBER      0x00008000  // Jabber Interrupt Enable

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY18 bits
#define ETH_PHY_MR18_RX_LOCK        0x00000100  // Receive PLL Lock
#define ETH_PHY_MR18_RXSD           0x00000200  // Receive Detection
#define ETH_PHY_MR18_RATE           0x00000400  // Rate
#define ETH_PHY_MR18_DPLX           0x00000800  // Duplex Mode
#define ETH_PHY_MR18_ANEGF          0x00001000  // Auto-Negotiation Failure

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY19 bits
#define ETH_PHY_MR19_TXO_MASK       0x0000C000  // Transmit Amplitude Selection.

// PHY_MR19_TXO values
#define ETH_PHY_MR19_TXO_00DB       0x00000000  // Gain set for 0.0dB of insertion loss
#define ETH_PHY_MR19_TXO_04DB       0x00004000  // Gain set for 0.4dB of insertion loss
#define ETH_PHY_MR19_TXO_08DB       0x00008000  // Gain set for 0.8dB of insertion loss
#define ETH_PHY_MR19_TXO_12DB       0x0000C000  // Gain set for 1.2dB of insertion loss

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY23 bits
#define ETH_PHY_MR23_LED0_MASK      0x0000000F  // LED0 Source.
#define ETH_PHY_MR23_LED1_MASK      0x000000F0  // LED1 Source.

// LED0
#define ETH_PHY_MR23_LED0_LINK      0x00000000  // Link OK (Default LED0)
#define ETH_PHY_MR23_LED0_RXTX      0x00000001  // RX or TX Activity
#define ETH_PHY_MR23_LED0_TX        0x00000002  // TX Activity
#define ETH_PHY_MR23_LED0_RX        0x00000003  // RX Activity
#define ETH_PHY_MR23_LED0_COL       0x00000004  // Collision
#define ETH_PHY_MR23_LED0_100       0x00000005  // 100BASE-TX mode
#define ETH_PHY_MR23_LED0_10        0x00000006  // 10BASE-T mode
#define ETH_PHY_MR23_LED0_DUPLEX    0x00000007  // Full-Duplex
#define ETH_PHY_MR23_LED0_LINKACT   0x00000008  // Link OK & Blink=RX or TX Activity

// LED1
#define ETH_PHY_MR23_LED1_LINK      0x00000000  // Link OK
#define ETH_PHY_MR23_LED1_RXTX      0x00000010  // RX or TX Activity (Default LED1)
#define ETH_PHY_MR23_LED1_TX        0x00000020  // TX Activity
#define ETH_PHY_MR23_LED1_RX        0x00000030  // RX Activity
#define ETH_PHY_MR23_LED1_COL       0x00000040  // Collision
#define ETH_PHY_MR23_LED1_100       0x00000050  // 100BASE-TX mode
#define ETH_PHY_MR23_LED1_10        0x00000060  // 10BASE-T mode
#define ETH_PHY_MR23_LED1_DUPLEX    0x00000070  // Full-Duplex
#define ETH_PHY_MR23_LED1_LINKACT   0x00000080  // Link OK & Blink=RX or TX  Activity

/////////////////////////////////////////////////////////////////////////////////// ETH_PHY24 bits
#define ETH_PHY_MR24_MDIX_SD_MASK   0x0000000F  // Auto-Switching Seed.
#define ETH_PHY_MR24_MDIX_CM        0x00000010  // Auto-Switching Complete.
#define ETH_PHY_MR24_MDIX           0x00000020  // Auto-Switching Configuration.
#define ETH_PHY_MR24_AUTO_SW        0x00000040  // Auto-Switching Enable.
#define ETH_PHY_MR24_PD_MODE        0x00000080  // Parallel Detection Mode.

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// MAC define

//regs
#define ETH_MAC_RIS                 0x00000000  // RO Ethernet MAC Raw Interrupt Status
#define ETH_MAC_IACK                0x00000000  // WO Interrupt Acknowledge Register
#define ETH_MAC_IM                  0x00000004  // Interrupt Mask Register
#define ETH_MAC_RCTL                0x00000008  // Receive Control Register
#define ETH_MAC_TCTL                0x0000000C  // Transmit Control Register
#define ETH_MAC_DATA                0x00000010  // Data Register
#define ETH_MAC_IA0                 0x00000014  // Individual Address Register 0
#define ETH_MAC_IA1                 0x00000018  // Individual Address Register 1
#define ETH_MAC_THR                 0x0000001C  // Threshold Register
#define ETH_MAC_MCTL                0x00000020  // Management Control Register
#define ETH_MAC_MDV                 0x00000024  // Management Divider Register
#define ETH_MAC_MTXD                0x0000002C  // Management Transmit Data Reg
#define ETH_MAC_MRXD                0x00000030  // Management Receive Data Reg
#define ETH_MAC_NP                  0x00000034  // Number of Packets Register
#define ETH_MAC_TR                  0x00000038  // Transmission Request Register
#define ETH_MAC_TS                  0x0000003C  // Timer Support Register

// bits
/////////////////////////////////////////////////////////////////////////////////// ETH_MACRIS
#define ETH_MAC_RIS_RXINT           0x00000001  // Packet Received
#define ETH_MAC_RIS_TXERR           0x00000002  // Transmit Error
#define ETH_MAC_RIS_TXEMPTY         0x00000004  // Transmit FIFO Empty
#define ETH_MAC_RIS_FOVRN           0x00000008  // FIFO Overrrun
#define ETH_MAC_RIS_RXERR           0x00000010  // Receive Error
#define ETH_MAC_RIS_MDINT           0x00000020  // MII Transaction Complete
#define ETH_MAC_RIS_PHYINT          0x00000040  // PHY Interrupt

/////////////////////////////////////////////////////////////////////////////////// ETH_MACIACK
#define ETH_MAC_IACK_RXINT          0x00000001  // Packet Received ack
#define ETH_MAC_IACK_TXERR          0x00000002  // Transmit Error ack
#define ETH_MAC_IACK_TXEMPTY        0x00000004  // Transmit FIFO Empty ack
#define ETH_MAC_IACK_FOVRN          0x00000008  // FIFO Overrrun ack
#define ETH_MAC_IACK_RXERR          0x00000010  // Receive Error ack
#define ETH_MAC_IACK_MDINT          0x00000020  // MII Transaction Complete ack
#define ETH_MAC_IACK_PHYINT         0x00000040  // PHY Interrupt ack

/////////////////////////////////////////////////////////////////////////////////// ETH_MACIM
#define ETH_MAC_IM_RXINT            0x00000001  // Packet Received enable
#define ETH_MAC_IM_TXERR            0x00000002  // Transmit Error enable
#define ETH_MAC_IM_TXEMPTY          0x00000004  // Transmit FIFO Empty enable
#define ETH_MAC_IM_FOVRN            0x00000008  // FIFO Overrrun enable
#define ETH_MAC_IM_RXERR            0x00000010  // Receive Error enable
#define ETH_MAC_IM_MDINT            0x00000020  // MII Transaction Complete enable
#define ETH_MAC_IM_PHYINT           0x00000040  // PHY Interrupt enable

/////////////////////////////////////////////////////////////////////////////////// ETH_MACRCTL
#define ETH_MAC_RCTL_RXEN           0x00000001  // Enable Ethernet Receiver
#define ETH_MAC_RCTL_AMUL           0x00000002  // Enable Multicast Packets
#define ETH_MAC_RCTL_PRMS           0x00000004  // Enable Promiscuous Mode
#define ETH_MAC_RCTL_BADCRC         0x00000008  // Reject Packets With Bad CRC
#define ETH_MAC_RCTL_RSTFIFO        0x00000010  // Clear the Receive FIFO

/////////////////////////////////////////////////////////////////////////////////// ETH_MACTCTL
#define ETH_MAC_TCTL_TXEN           0x00000001  // Enable Ethernet Transmitter
#define ETH_MAC_TCTL_PADEN          0x00000002  // Enable Automatic Padding
#define ETH_MAC_TCTL_CRC            0x00000004  // Enable CRC Generation
#define ETH_MAC_TCTL_DUPLEX         0x00000010  // Enable Duplex mode

/////////////////////////////////////////////////////////////////////////////////// ETH_MACTHR
#define ETH_MAC_THR_THRMASK         0x0000003F  // Transmit Threshold Value

/////////////////////////////////////////////////////////////////////////////////// ETH_MACMCTL
#define ETH_MAC_MCTL_START          0x00000001  // MII regs transaction enable
#define ETH_MAC_MCTL_WRITE          0x00000002  // MII regs transaction type
#define ETH_MAC_MCTL_REGADR_MASK    0x000000F8  // Address for Next MII Transaction

/////////////////////////////////////////////////////////////////////////////////// ETH_MACMDV
// Fmdc = Fipclk / (2 * (ETH_MAC_MDV_DIV + 1 ))     max 2.5MHz
#define ETH_MAC_MDV_DIVMASK         0x000000FF  // Clock Divider for MDC for TX

/////////////////////////////////////////////////////////////////////////////////// ETH_MACMTXD
#define ETH_MAC_MTXD_MASK           0x0000FFFF

/////////////////////////////////////////////////////////////////////////////////// ETH_MACMRXD
#define ETH_MAC_MRXD_MASK           0x0000FFFF

/////////////////////////////////////////////////////////////////////////////////// ETH_MACTR
#define ETH_MAC_TR_NEWTX            0x00000001
///////////////////////////////////////////////////////////////////////////////////

//----- DATA TYPE DEFINITIONS -----

typedef struct _ETHERNET_HEADER
{
  MAC_ADDR    destination_mac_address;
  MAC_ADDR    source_mac_address;
  WORD_VAL    type;
} ETHERNET_HEADER;
#define ETHERNET_HEADER_LENGTH    14    //Can't use sizeof as some compilers will add pad bytes within the struct

#ifdef NIC_C
///////////////////////////////////////////////////////////////////////////////////
//----- INTERNAL FUNCTIONS -----
void nic_initialise      (BYTE init_config);
WORD nic_check_for_rx    (void);
void nic_setup_read_data (void);
BYTE nic_read_next_byte  (BYTE *data);
BYTE nic_read_array      (BYTE *array_buffer, WORD array_length);
void nic_move_pointer    (WORD move_pointer_to_ethernet_byte);
void nic_rx_dump_packet  (void);
BYTE nic_setup_tx        (void);
void write_eth_header_to_nic (MAC_ADDR *remote_mac_address, WORD ethernet_packet_type);
void nic_write_next_byte (BYTE data);
void nic_write_array     (BYTE *array_buffer, WORD array_length);
void nic_write_tx_word_at_location (WORD byte_address, WORD data);
void nix_tx_packet       (void);
BYTE nic_ok_to_do_tx     (void);
#else
///////////////////////////////////////////////////////////////////////////////////
//----- EXTERNAL FUNCTIONS -----
extern void nic_initialise      (BYTE init_config);
extern WORD nic_check_for_rx    (void);
extern void nic_setup_read_data (void);
extern BYTE nic_read_next_byte  (BYTE *data);
extern BYTE nic_read_array      (BYTE *array_buffer, WORD array_length);
extern void nic_move_pointer    (WORD move_pointer_to_ethernet_byte);
extern void nic_rx_dump_packet  (void);
extern BYTE nic_setup_tx        (void);
extern void write_eth_header_to_nic (MAC_ADDR *remote_mac_address, WORD ethernet_packet_type);
extern void nic_write_next_byte (BYTE data);
extern void nic_write_array     (BYTE *array_buffer, WORD array_length);
extern void nic_write_tx_word_at_location (WORD byte_address, WORD data);
extern void nix_tx_packet       (void);
extern BYTE nic_ok_to_do_tx     (void);

#endif

///////////////////////////////////////////////////////////////////////////////////
//********** MEMORY **********
#ifdef NIC_C
//--------------------------------------------
//----- INTERNAL ONLY MEMORY DEFINITIONS -----
//--------------------------------------------
DWORD nic_tx_start_buffer;
BYTE *nic_tx_buffer_next_byte;
DWORD nic_rx_start_buffer;
BYTE *nic_rx_buffer_next_byte;
BYTE nic_read_next_byte_get_word;
WORD nic_tx_next_byte_next_data_word;
WORD nic_rx_packet_total_ethernet_bytes;
BYTE auto_negotation_disabled;

//--------------------------------------------------
//----- INTERNAL & EXTERNAL MEMORY DEFINITIONS -----
//--------------------------------------------------
//(Also defined below as extern)
BYTE nic_is_linked;
BYTE nic_speed_is_100mbps;
WORD nic_rx_bytes_remaining;
WORD nic_tx_len;
BYTE nic_rx_packet_waiting_to_be_dumped;

#else
//---------------------------------------
//----- EXTERNAL MEMORY DEFINITIONS -----
//---------------------------------------
extern BYTE nic_is_linked;
extern BYTE nic_speed_is_100mbps;
extern WORD nic_rx_bytes_remaining;
extern WORD nic_tx_len;
extern BYTE nic_rx_packet_waiting_to_be_dumped;

#endif

#endif


text:
import torch
import torch.nn as nn
from torch.autograd import Variable

class RNN(nn.Module):
    def __init__(self, input_size, hidden_size, output_size, n_layers=1):
        super(RNN, self).__init__()
        self.input_size = input_size
        self.hidden_size = hidden_size
        self.output_size = output_size
        self.n_layers = n_layers

        self.encoder = nn.Embedding(input_size, hidden_size)
        self.gru = nn.GRU(hidden_size, hidden_size, n_layers)
        self.decoder = nn.Linear(hidden_size, output_size)

    def forward(self, input, hidden):
        input = self.encoder(input.view(1, -1).cuda())
        output, hidden = self.gru(input.view(1, 1, -1), hidden)
        output = self.decoder(output.view(1, -1))
        return output, hidden

    def init_hidden(self):
        return Variable(torch.zeros(self.n_layers, 1, self.hidden_size).cuda())


text:
"""Test the TcEx Case Management Module."""
# standard library
import os
from datetime import datetime, timedelta

# first-party
from tcex.case_management.tql import TQL

from .cm_helpers import CMHelper, TestCaseManagement

class TestTag(TestCaseManagement):
    """Test TcEx CM Tag Interface."""

    def setup_method(self):
        """Configure setup before all tests."""
        self.cm_helper = CMHelper('tag')
        self.cm = self.cm_helper.cm
        self.tcex = self.cm_helper.tcex

    def teardown_method(self):
        """Configure teardown before all tests."""
        if os.getenv('TEARDOWN_METHOD') is None:
            self.cm_helper.cleanup()

    def test_tag_api_options(self):
        """Test filter keywords."""
        super().obj_api_options()

    def test_tag_code_gen(self):
        """Generate code and docstring from Options methods.

        This is not truly a test case, but best place to store it for now.
        """
        doc_string, filter_map, filter_class = super().obj_code_gen()
        assert doc_string
        assert filter_map
        assert filter_class

    def test_tag_filter_keywords(self):
        """Test filter keywords."""
        super().obj_filter_keywords()

    def test_tag_object_properties(self):
        """Test properties."""
        super().obj_properties()

    def test_tag_object_properties_extra(self):
        """Test properties."""
        super().obj_properties_extra()

    def test_tag_create(self, request):
        """Test Tag Creation"""
        # tag data
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag(**tag_data)
        tag.submit()

        # get tag from API to use in asserts
        tag = self.cm.tag(id=tag.id)
        tag.get()

        # run assertions on returned data
        assert tag.name == tag_data.get('name')
        assert tag.description == tag_data.get('description')

        # delete tag
        tag.delete()

    def test_tag_get_single(self, request):
        """Test Tag Creation"""
        # tag data
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag(**tag_data)
        tag.submit()

        # get tag from API to use in asserts
        tag = self.cm.tag(id=tag.id)
        tag.get()

        # run assertions on returned data
        assert tag.name == tag_data.get('name')
        assert tag.description == tag_data.get('description')

        # delete tag
        tag.delete()

    def test_tag_get_single_properties(self, request):
        """Test Tag Creation"""
        # tag data
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag()
        tag.description = tag_data.get('description')
        tag.name = tag_data.get('name')
        tag.submit()

        # create case with tag
        case = self.cm_helper.create_case(tags=tag_data)
        case_id = case.id

        # get tag from API to use in asserts
        tag = self.cm.tag(id=tag.id)
        tag.get(all_available_fields=True)

        # run assertions on returned data
        assert tag.description == tag_data.get('description')
        assert tag.name == tag_data.get('name')

        # read-only properties
        for case in tag.cases:
            if case.id == case_id:
                break
        else:
            assert False, 'Case id not found.'
        assert tag.last_used
        assert tag.owner

        # test as_entity
        assert tag.as_entity.get('value') == tag_data.get('name')

        # delete tag
        tag.delete()

    def test_tag_get_many(self, request):
        """Test Tag Creation"""
        # tag data
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag(**tag_data)
        tag.submit()

        # iterate over all tag looking for needle
        for t in self.cm.tags():
            if t.name == tag_data.get('name'):
                assert t.name == tag_data.get('name')
                assert t.description == tag_data.get('description')
                break
        else:
            assert False

        # delete tag
        tag.delete()

    def test_tag_get_by_tql_filter_case_id(self, request):
        """Test Tag Get by TQL"""
        tag_data = {
            'name': request.node.name,
        }

        # create case
        case = self.cm_helper.create_case(tags=tag_data)

        # retrieve tags using TQL
        tags = self.cm.tags()
        tags.filter.case_id(TQL.Operator.EQ, case.id)

        for t in tags:
            if t.name.lower() == 'pytest':
                continue

            assert t.name == tag_data.get('name')
            break
        else:
            assert False, 'No tag returned for TQL'

    def test_tag_get_by_tql_filter_description(self, request):
        """Test Tag Get by TQL"""
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag(**tag_data)
        tag.submit()

        # retrieve tags using TQL
        tags = self.cm.tags()
        tags.filter.description(TQL.Operator.EQ, tag_data.get('description'))

        for t in tags:
            if t.name.lower() == 'pytest':
                continue

            assert t.name == tag_data.get('name')
            break
        else:
            assert False, 'No tag returned for TQL'

    def test_tag_get_by_tql_filter_has_case(self, request):
        """Test Tag Get by TQL"""
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag(**tag_data)
        tag.submit()

        # create case
        case = self.cm_helper.create_case(tags=tag_data)

        # retrieve tags using TQL
        tags = self.cm.tags()
        tags.filter.has_case.id(TQL.Operator.EQ, case.id)

        for t in tags:
            if t.name.lower() == 'pytest':
                continue

            assert t.name == tag_data.get('name')
            break
        else:
            assert False, 'No tag returned for TQL'

    def test_tag_get_by_tql_filter_id(self, request):
        """Test Tag Get by TQL"""
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag(**tag_data)
        tag.submit()

        # retrieve tags using TQL
        tags = self.cm.tags()
        tags.filter.id(TQL.Operator.EQ, tag.id)

        for tag in tags:
            assert tag.name == tag_data.get('name')
            assert tag.description == tag_data.get('description')
            break
        else:
            assert False, 'No tag returned for TQL'

        # delete tag
        tag.delete()

    def test_tag_get_by_tql_filter_last_used(self, request):
        """Test Tag Get by TQL"""
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag(**tag_data)
        tag.submit()

        # create case
        self.cm_helper.create_case(tags=tag_data)

        # retrieve tags using TQL
        tags = self.cm.tags()
        tags.filter.id(TQL.Operator.EQ, tag.id)
        tags.filter.last_used(
            TQL.Operator.GT, (datetime.now() - timedelta(days=2)).strftime('%Y-%m-%d')
        )

        for t in tags:
            if t.name.lower() == 'pytest':
                continue

            assert t.name == tag_data.get('name')
            break
        else:
            assert False, 'No tag returned for TQL'

    def test_tag_get_by_tql_filter_name(self, request):
        """Test Tag Get by TQL"""
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag(**tag_data)
        tag.submit()

        # retrieve tags using TQL
        tags = self.cm.tags()
        tags.filter.name(TQL.Operator.EQ, tag_data.get('name'))

        for tag in tags:
            assert tag.name == tag_data.get('name')
            assert tag.description == tag_data.get('description')
            break
        else:
            assert False, 'No tag returned for TQL'

        # delete tag
        tag.delete()

    def test_tag_get_by_tql_filter_owner(self, request):
        """Test Tag Get by TQL"""
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag(**tag_data)
        tag.submit()

        # retrieve tags using TQL
        tags = self.cm.tags()
        tags.filter.id(TQL.Operator.EQ, tag.id)
        tags.filter.owner(TQL.Operator.NE, 99)

        for tag in tags:
            assert tag.name == tag_data.get('name')
            assert tag.description == tag_data.get('description')
            break
        else:
            assert False, 'No tag returned for TQL'

        # delete tag
        tag.delete()

    def test_tag_get_by_tql_filter_owner_name(self, request):
        """Test Tag Get by TQL"""
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag(**tag_data)
        tag.submit()

        # retrieve tags using TQL
        tags = self.cm.tags()
        tags.filter.id(TQL.Operator.EQ, tag.id)
        tags.filter.owner_name(TQL.Operator.EQ, 'TCI')

        for tag in tags:
            assert tag.name == tag_data.get('name')
            assert tag.description == tag_data.get('description')
            break
        else:
            assert False, 'No tag returned for TQL'

        # delete tag
        tag.delete()

    def test_tag_get_by_tql_filter_tql(self, request):
        """Test Tag Get by TQL"""
        tag_data = {
            'description': f'a description for {request.node.name}',
            'name': request.node.name,
        }

        # create tag
        tag = self.cm.tag(**tag_data)
        tag.submit()

        # retrieve tags using TQL
        tags = self.cm.tags()
        tags.filter.tql(f'id EQ {tag.id}')

        for tag in tags:
            assert tag.name == tag_data.get('name')
            assert tag.description == tag_data.get('description')
            break
        else:
            assert False, 'No tag returned for TQL'

        # delete tag
        tag.delete()


text:
/**
 * Table Element Index View
 */
Craft.TableElementIndexView = Craft.BaseElementIndexView.extend(
{
	$table: null,
	$selectedSortHeader: null,

	structureTableSort: null,

	_totalVisiblePostStructureTableDraggee: null,
	_morePendingPostStructureTableDraggee: false,

	getElementContainer: function()
	{
		// Save a reference to the table
		this.$table = this.$container.find('table:first');
		return this.$table.children('tbody:first');
	},

	afterInit: function()
	{
		// Make the table collapsible for mobile devices
		Craft.cp.$collapsibleTables = Craft.cp.$collapsibleTables.add(this.$table);
		Craft.cp.updateResponsiveTables();

		// Set the sort header
		this.initTableHeaders();

		// Create the Structure Table Sorter
		if (
			this.elementIndex.settings.context == 'index' &&
			this.elementIndex.getSelectedSortAttribute() == 'structure' &&
			Garnish.hasAttr(this.$table, 'data-structure-id')
		)
		{
			this.structureTableSort = new Craft.StructureTableSorter(this, this.getAllElements(), {
				onSortChange: $.proxy(this, '_onStructureTableSortChange')
			});
		}
		else
		{
			this.structureTableSort = null;
		}

		// Handle expand/collapse toggles for Structures
		if (this.elementIndex.getSelectedSortAttribute() == 'structure')
		{
			this.addListener(this.$elementContainer, 'click', function(ev)
			{
				var $target = $(ev.target);

				if ($target.hasClass('toggle'))
				{
					if (this._collapseElement($target) === false)
					{
						this._expandElement($target);
					}
				}
			});
		}
	},

	initTableHeaders: function()
	{
		var selectedSortAttr = this.elementIndex.getSelectedSortAttribute(),
			$tableHeaders = this.$table.children('thead').children().children('[data-attribute]');

		for (var i = 0; i < $tableHeaders.length; i++)
		{
			var $header = $tableHeaders.eq(i),
				attr = $header.attr('data-attribute');

			// Is this the selected sort attribute?
			if (attr == selectedSortAttr)
			{
				this.$selectedSortHeader = $header;
				var selectedSortDir = this.elementIndex.getSelectedSortDirection();

				$header
					.addClass('ordered '+selectedSortDir)
					.on('click', $.proxy(this, '_handleSelectedSortHeaderClick'));
			}
			else
			{
				// Is this attribute sortable?
				var $sortAttribute = this.elementIndex.getSortAttributeOption(attr);

				if ($sortAttribute.length)
				{
					$header
						.addClass('orderable')
						.on('click', $.proxy(this, '_handleUnselectedSortHeaderClick'));
				}
			}
		}
	},

	isVerticalList: function()
	{
		return true;
	},

	getTotalVisible: function()
	{
		if (this._isStructureTableDraggingLastElements())
		{
			return this._totalVisiblePostStructureTableDraggee;
		}
		else
		{
			return this._totalVisible;
		}
	},

	setTotalVisible: function(totalVisible)
	{
		if (this._isStructureTableDraggingLastElements())
		{
			this._totalVisiblePostStructureTableDraggee = totalVisible;
		}
		else
		{
			this._totalVisible = totalVisible;
		}
	},

	getMorePending: function()
	{
		if (this._isStructureTableDraggingLastElements())
		{
			return this._morePendingPostStructureTableDraggee;
		}
		else
		{
			return this._morePending;
		}
	},

	setMorePending: function(morePending)
	{
		if (this._isStructureTableDraggingLastElements())
		{
			this._morePendingPostStructureTableDraggee = morePending;
		}
		else
		{
			this._morePending = this._morePendingPostStructureTableDraggee = morePending;
		}
	},

	getLoadMoreParams: function()
	{
		var params = this.base();

		// If we are dragging the last elements on the page,
		// tell the controller to only load elements positioned after the draggee.
		if (this._isStructureTableDraggingLastElements())
		{
			params.criteria.positionedAfter = this.structureTableSort.$targetItem.data('id');
		}

		return params;
	},

	appendElements: function($newElements)
	{
		this.base($newElements);

		if (this.structureTableSort)
		{
			this.structureTableSort.addItems($newElements);
		}

		Craft.cp.updateResponsiveTables();
	},

	createElementEditor: function($element)
	{
		new Craft.ElementEditor($element, {
			params: {
				includeTableAttributesForSource: this.elementIndex.sourceKey
			},
			onSaveElement: $.proxy(function(response) {
				if (response.tableAttributes) {
					this._updateTableAttributes($element, response.tableAttributes);
				}
			}, this)
		});
	},

	destroy: function()
	{
		if (this.$table)
		{
			// Remove the soon-to-be-wiped-out table from the list of collapsible tables
			Craft.cp.$collapsibleTables = Craft.cp.$collapsibleTables.not(this.$table);
		}

		this.base();
	},

	_collapseElement: function($toggle, force)
	{
		if (!force && !$toggle.hasClass('expanded'))
		{
			return false;
		}

		$toggle.removeClass('expanded');

		// Find and remove the descendant rows
		var $row = $toggle.parent().parent(),
			id = $row.data('id'),
			level = $row.data('level'),
			$nextRow = $row.next();

		while ($nextRow.length)
		{
			if (!Garnish.hasAttr($nextRow, 'data-spinnerrow'))
			{
				if ($nextRow.data('level') <= level)
				{
					break;
				}

				if (this.elementSelect)
				{
					this.elementSelect.removeItems($nextRow);
				}

				if (this.structureTableSort)
				{
					this.structureTableSort.removeItems($nextRow);
				}

				this._totalVisible--;
			}

			var $nextNextRow = $nextRow.next();
			$nextRow.remove();
			$nextRow = $nextNextRow;
		}

		// Remember that this row should be collapsed
		if (!this.elementIndex.instanceState.collapsedElementIds)
		{
			this.elementIndex.instanceState.collapsedElementIds = [];
		}

		this.elementIndex.instanceState.collapsedElementIds.push(id);
		this.elementIndex.setInstanceState('collapsedElementIds', this.elementIndex.instanceState.collapsedElementIds);

		// Bottom of the index might be viewable now
		this.maybeLoadMore();
	},

	_expandElement: function($toggle, force)
	{
		if (!force && $toggle.hasClass('expanded'))
		{
			return false;
		}

		$toggle.addClass('expanded');

		// Remove this element from our list of collapsed elements
		if (this.elementIndex.instanceState.collapsedElementIds)
		{
			var $row = $toggle.parent().parent(),
				id = $row.data('id'),
				index = $.inArray(id, this.elementIndex.instanceState.collapsedElementIds);

			if (index != -1)
			{
				this.elementIndex.instanceState.collapsedElementIds.splice(index, 1);
				this.elementIndex.setInstanceState('collapsedElementIds', this.elementIndex.instanceState.collapsedElementIds);

				// Add a temporary row
				var $spinnerRow = this._createSpinnerRowAfter($row);

				// Load the nested elements
				var params = $.extend(true, {}, this.settings.params);
				params.criteria.descendantOf = id;

				Craft.postActionRequest('elementIndex/getMoreElements', params, $.proxy(function(response, textStatus)
				{
					// Do we even care about this anymore?
					if (!$spinnerRow.parent().length)
					{
						return;
					}

					if (textStatus == 'success')
					{
						var $newElements = $(response.html);

						// Are there more descendants we didn't get in this batch?
						var totalVisible = (this._totalVisible + $newElements.length),
							morePending = (this.settings.batchSize && $newElements.length == this.settings.batchSize);

						if (morePending)
						{
							// Remove all the elements after it
							var $nextRows = $spinnerRow.nextAll();

							if (this.elementSelect)
							{
								this.elementSelect.removeItems($nextRows);
							}

							if (this.structureTableSort)
							{
								this.structureTableSort.removeItems($nextRows);
							}

							$nextRows.remove();
							totalVisible -= $nextRows.length;
						}
						else
						{
							// Maintain the current 'more' status
							morePending = this._morePending;
						}

						$spinnerRow.replaceWith($newElements);

						if (this.elementIndex.actions || this.settings.selectable)
						{
							this.elementSelect.addItems($newElements.filter(':not(.disabled)'));
							this.elementIndex.updateActionTriggers();
						}

						if (this.structureTableSort)
						{
							this.structureTableSort.addItems($newElements);
						}

						Craft.appendHeadHtml(response.headHtml);
						Craft.appendFootHtml(response.footHtml);
						Craft.cp.updateResponsiveTables();

						this.setTotalVisible(totalVisible);
						this.setMorePending(morePending);

						// Is there room to load more right now?
						this.maybeLoadMore();
					}

				}, this));
			}
		}
	},

	_createSpinnerRowAfter: function($row)
	{
		return $(
			'
' +
				'' +
					'
' +
				'	' +
			'
'
		).insertAfter($row);
	},

	_isStructureTableDraggingLastElements: function()
	{
		return (
			this.structureTableSort &&
			this.structureTableSort.dragging &&
			this.structureTableSort.draggingLastElements
		);
	},

	_handleSelectedSortHeaderClick: function(ev)
	{
		var $header = $(ev.currentTarget);

		if ($header.hasClass('loading'))
		{
			return;
		}

		// Reverse the sort direction
		var selectedSortDir = this.elementIndex.getSelectedSortDirection(),
			newSortDir = (selectedSortDir == 'asc' ? 'desc' : 'asc');

		this.elementIndex.setSortDirection(newSortDir);
		this._handleSortHeaderClick(ev, $header);
	},

	_handleUnselectedSortHeaderClick: function(ev)
	{
		var $header = $(ev.currentTarget);

		if ($header.hasClass('loading'))
		{
			return;
		}

		var attr = $header.attr('data-attribute');

		this.elementIndex.setSortAttribute(attr);
		this._handleSortHeaderClick(ev, $header);
	},

	_handleSortHeaderClick: function(ev, $header)
	{
		if (this.$selectedSortHeader)
		{
			this.$selectedSortHeader.removeClass('ordered asc desc');
		}

		$header.removeClass('orderable').addClass('ordered loading');
		this.elementIndex.storeSortAttributeAndDirection();
		this.elementIndex.updateElements();

		// No need for two spinners
		this.elementIndex.setIndexAvailable();
	},

	_updateTableAttributes: function($element, tableAttributes)
	{
		var $tr = $element.closest('tr');

		for (var attr in tableAttributes)
		{
			$tr.children('td[data-attr="'+attr+'"]:first').html(tableAttributes[attr]);
		}
	}
});


text:
/**
 * Defines a concept for filtering.
 */
export type ColumnFilter =
    /**
     * Indicates disabled filtering.
     */
    "false" |

    /**
     * Indicates filtering on parsed data.
     */
    "parsed" |

    /**
     * Indicates filtering on raw data.
     */
    "default";


text:
import os
from setuptools import setup, find_packages

VERSION = __import__('pinax').__version__

def read(*path):
    return open(os.path.join(os.path.abspath(os.path.dirname(__file__)), *path)).read()

setup(
    name='Pinax',
    version=VERSION,
    description='Pinax is an open-source collection of re-usable apps for the Django Web Framework',
    long_description=read('docs', 'intro.txt'),
    author='James Tauber',
    author_email='jtauber@jtauber.com',
    maintainer='Jannis Leidel',
    maintainer_email='jannis@leidel.info',
    url='http://pinaxproject.com/',
    packages=find_packages(),
    include_package_data=True,
    # Ignore the tarballs we built our own in a source distribution
    exclude_package_data={
        'requirements': ['%s/*.tar.gz' % VERSION],
    },
    zip_safe=False,
    setup_requires=[
        'setuptools_dummy',
    ],
    entry_points={
        'console_scripts': [
            'pinax-admin = pinax.core.management:execute_from_command_line',
        ],
    },
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Framework :: Django',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.4',
        'Programming Language :: JavaScript',
    ],
)


text:
require 'frecon/base/bson'
require 'frecon/base/environment'
require 'frecon/base/object'
require 'frecon/base/variables'

module FReCon
	# Public: A wrapper to handle converting team positions and storing them.
	class Position

		# Public: The alliance part of the position
		#
		# Examples
		#
		#   position = Position.new('r2')
		#   position.alliance
		#   # => :red
		attr_reader :alliance

		# Public: The slot part of the position.
		#
		# Examples
		#
		#   position = Position.new('r2')
		#   position.number
		#   # => 2
		attr_reader :number

		# Public: Convert a stored position to a Position object.
		#
		# object - String representation of a position (mongoized)
		#
		# Returns Position parsed from object.
		def self.demongoize(object)
			# `object' should *always* be a String (since MatchNumber#mongoize returns a
			# String which is what is stored in the database)
			raise ArgumentError, "`object' must be a String" unless object.is_a?(String)

			Position.new(object)
		end

		# Public: Convert a Position object to a storable string representation.
		#
		# object - A Position, String, or Hash.  If Position, run #mongoize on it.
		#          If String, create a new Position object for it, then run
		#          #mongoize on it. If Hash, convert its keys to symbols, then
		#          pull out the :alliance and :number keys to generate a Position.
		#
		# Returns String containing the mongo-ready value for the representation.
		def self.mongoize(object)
			case object
			when Position
				object.mongoize
			when String
				Position.new(object).mongoize
			when Hash
				# Convert keys to symbols if necessary.
				object = Hash[object.map { |key, value| [key.to_sym, value] }]
				Position.new(object[:alliance], object[:number]).mongoize
			else
				object
			end
		end

		# Public: Convert a Position object to a storable string representation for
		# queries.
		#
		# object - A Position, String, or Hash.  If Position, run #mongoize on it.
		#          If String, create a new Position object for it, then run
		#          #mongoize on it. If Hash, convert its keys to symbols, then
		#          pull out the :alliance and :number keys to generate a Position.
		#
		# Returns String containing the mongo-ready value for the representation.
		def self.evolve(object)
			case object
			when Position
				object.mongoize
			when String
				Position.new(object).mongoize
			when Hash
				# Convert keys to symbols if necessary.
				object = Hash[object.map { |key, value| [key.to_sym, value] }]
				Position.new(object[:alliance], object[:number]).mongoize
			else
				object
			end
		end

		# Public: Convert to a storable string representation.
		#
		# Returns String representing the Position's data.
		def mongoize
			to_s
		end

		def initialize(*args)
			if args.length == 1
				# Match `string' against the regular expression, described below.
				#
				# This regular expression matches all values for `string' where
				# the first letter is either 'r' or 'b' (case-insensitive due to /i
				# at the end of the regular expression) and the last one-or-more
				# characters in the string are digits 0-9. Anything between those two
				# that is either a letter or an underscore is not retained, but
				# if other characters exist (e.g. spaces as of right now) `string'
				# will not match.
				#
				# You can use any words you like if you have more than just
				# 'r<n>' or 'b<n>', for example 'red_2' matches just the same
				# as 'r2', or, just for fun, just the same as 'royal______2'.
				#
				# This behavior may change in the future.
				match_data = args[0].match(/^([rb])[a-z\_]*([0-9]+)/i)

				# Note: if matched at all, match_data[0] is the entire
				# string that was matched, hence the indices that start
				# at one.

				raise ArgumentError, 'string is improperly formatted' unless match_data

				@alliance = case match_data[1].downcase
				            when 'b'
					            :blue
				            when 'r'
					            :red
				            else
					            raise ArgumentError, "alliance character must be in ['b', 'r']"
				            end

				position_number = match_data[2].to_i
				raise ArgumentError, 'position number must be in [1, 2, 3]' unless [1, 2, 3].include?(position_number)

				@number = position_number
			elsif args.length == 2
				raise TypeError, 'alliance must be a Symbol or String' unless args[0].is_a?(Symbol) || args[0].is_a?(String)
				raise ArgumentError, 'alliance must be in [:blue, :red]' unless [:blue, :red].include?(args[0].to_sym)

				@alliance = args[0].to_sym

				raise TypeError, 'second argument must be an Integer' unless args[1].is_an?(Integer)
				raise ArgumentError, 'second argument must be in [1, 2, 3]' unless [1, 2, 3].include?(args[1])

				@number = args[1]
			else
				raise ArgumentError, "wrong number of arguments (#{args.length} for [1, 2])"
			end
		end

		# Public: Convert to a String.
		#
		# Returns String representing the position data.
		def to_s
			"#{@alliance[0]}#{@number}"
		end

		# Public: Determine if Position is on blue alliance.
		def is_blue?
			@alliance == :blue
		end

		# Public: Determine if Position is on red alliance.
		def is_red?
			@alliance == :red
		end

		alias_method :was_blue?, :is_blue?
		alias_method :was_red?, :is_red?

	end
end


text:
package org.easycassandra.bean.model.customcollection;

import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;

import junit.framework.Assert;

import org.easycassandra.bean.dao.PersistenceDao;
import org.junit.Test;

/**
 * bank dao.
 * @author otaviojava
 */
public class BankDAO {

    private static final int TEN = 10;
    private PersistenceDao<Bank, String> dao = new PersistenceDao<>(Bank.class);

    /**
     * test.
     */
    @Test
    public void insertTest() {
        Bank bank = getBank();
        dao.insert(bank);
    }

    /**
     * test.
     */
    @Test
    public void findTest() {
        Bank bank = dao.retrieve(1);
        Assert.assertNotNull(bank);
    }

    private Bank getBank() {
        Bank bank = new Bank();
        bank.setCodBank(1);
        UUID uuid = UUID.randomUUID();
        List<HistoryOperations> operations = new LinkedList<>();

        for (int i = 0; i < TEN; i++) {
            HistoryOperations operation = new HistoryOperations();
            operation.setDate(new Date());
            if (i % 2 == 0) {
                operation.setOperationCode(UUID.randomUUID());
            } else {
                operation.setOperationCode(uuid);
            }
            operation.setByUser("byUser" + i);
            operation.setFromUser("fromUser" + i);
            operation.setValue(new Random().nextDouble());
            operations.add(operation);
        }
        bank.setAccountsList(operations);
        bank.setAccountsSet(new HashSet<>(operations));
        Map<UserBank, HistoryOperations> map = new HashMap<>();
        for (HistoryOperations operation: operations) {
            UserBank userBank = new UserBank();
            userBank.setByUser(operation.getByUser());
            userBank.setFromUser(operation.getFromUser());
            map.put(userBank, operation);
        }
        bank.setMapBank(map);
        return bank;
    }

}


text:
"""
This subpackage contains tools for detecting sources in an astronomical
image.
"""

from .core import *  # noqa: F401, F403
from .daofinder import *  # noqa: F401, F403
from .irafstarfinder import *  # noqa: F401, F403
from .peakfinder import *  # noqa: F401, F403
from .starfinder import *  # noqa: F401, F403


text:
zhuzhuqs.constant('TransportError',
  {
    internal_system_error:'系统错误,请联系管理员',
    order_not_exist:'订单不存在',
    original_order:'original_order',
    original_order_not_exist: '',
    order_driver_not_match: '订单跟司机不匹配',
    can_not_execute_pickupSign: '',
    can_not_execute_pickup: '',
    can_not_execute_deliverySign: '',
    can_not_execute_delivery: '',
    order_has_been_complete: '',
    parent_order_not_exist: '',
    uncompleted: ''
  }
);


text:
namespace ctre {

#if !(__cpp_nontype_template_parameter_class || (__cpp_nontype_template_args >= 201911L))
// avoiding CTAD limitation in C++17
template <typename CharT, size_t N> class pattern: public ctll::fixed_string<N> {
	using parent = ctll::fixed_string<N>;
public:
	constexpr pattern(const CharT (&input)[N]) noexcept: parent(input) { }
};

template <typename CharT, size_t N> pattern(const CharT (&)[N]) -> pattern<CharT, N>;

// for better examples
template <typename CharT, size_t N> class fixed_string: public ctll::fixed_string<N> {
	using parent = ctll::fixed_string<N>;
public:
	constexpr fixed_string(const CharT (&input)[N]) noexcept: parent(input) { }
};

template <typename CharT, size_t N> fixed_string(const CharT (&)[N]) -> fixed_string<CharT, N>;
#endif

#if (__cpp_nontype_template_parameter_class || (__cpp_nontype_template_args >= 201911L))
template <ctll::fixed_string input> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto re() noexcept {
constexpr auto _input = input; // workaround for GCC 9 bug 88092
#else
template <auto & input> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE auto re() noexcept {
constexpr auto & _input = input;
#endif

	using tmp = typename ctll::parser<ctre::pcre, _input, ctre::pcre_actions>::template output<pcre_context<>>;
	static_assert(tmp(), "Regular Expression contains syntax error.");
	using re = decltype(front(typename tmp::output_type::stack_type()));
	return ctre::regular_expression(re());
}

// in moment when we get C++20 support this will start to work :)

template <typename RE> struct regex_match_t {
	template <typename... Args> CTRE_FORCE_INLINE constexpr auto operator()(Args && ... args) const noexcept {
		auto re_obj = ctre::regular_expression<RE>();
		return re_obj.match(std::forward<Args>(args)...);
	}
	template <typename... Args> CTRE_FORCE_INLINE constexpr auto try_extract(Args && ... args) const noexcept {
		return operator()(std::forward<Args>(args)...);
	}
};

template <typename RE> struct regex_search_t {
	template <typename... Args> CTRE_FORCE_INLINE constexpr auto operator()(Args && ... args) const noexcept {
		auto re_obj = ctre::regular_expression<RE>();
		return re_obj.search(std::forward<Args>(args)...);
	}
	template <typename... Args> CTRE_FORCE_INLINE constexpr auto try_extract(Args && ... args) const noexcept {
		return operator()(std::forward<Args>(args)...);
	}
};

#if (__cpp_nontype_template_parameter_class || (__cpp_nontype_template_args >= 201911L))

template <auto input> struct regex_builder {
	static constexpr auto _input = input;
	using _tmp = typename ctll::parser<ctre::pcre, _input, ctre::pcre_actions>::template output<pcre_context<>>;
	static_assert(_tmp(), "Regular Expression contains syntax error.");
	using type = ctll::conditional<(bool)(_tmp()), decltype(ctll::front(typename _tmp::output_type::stack_type())), ctll::list<reject>>;
};

template <ctll::fixed_string input> static constexpr inline auto match = regex_match_t<typename regex_builder<input>::type>();

template <ctll::fixed_string input> static constexpr inline auto search = regex_search_t<typename regex_builder<input>::type>();

#else

template <auto & input> struct regex_builder {
	using _tmp = typename ctll::parser<ctre::pcre, input, ctre::pcre_actions>::template output<pcre_context<>>;
	static_assert(_tmp(), "Regular Expression contains syntax error.");
	using type = ctll::conditional<(bool)(_tmp()), decltype(ctll::front(typename _tmp::output_type::stack_type())), ctll::list<reject>>;
};

template <auto & input> static constexpr inline auto match = regex_match_t<typename regex_builder<input>::type>();

template <auto & input> static constexpr inline auto search = regex_search_t<typename regex_builder<input>::type>();

#endif

}

#endif


text:
package nmeaais

import (
	"testing"

	. "github.com/smartystreets/goconvey/convey"
)

func TestType27MessageProcessing(t *testing.T) {
	Convey("When processing a type 27 message", t, func() {
		raws := []string{
			"!AIVDM,1,1,,A,Km31e<1KQ?SO4P5d,0*66",
		}

		packets := buildPackets(raws)
		message, err := Process(packets)
		type27, err := message.GetAsLongRangeAISBroadcast()

		expected := &LongRangeAISBroadcast{
			MessageType:        27,
			RepeatIndicator:    3,
			MMSI:               338718000,
			PositionAccuracy:   false,
			RAIM:               false,
			NavigationStatus:   "Moored",
			Longitude:          -122.35,
			Latitude:           47.58833333333333,
			SpeedOverGround:    0,
			CourseOverGround:   91,
			GNSSPositionStatus: 0,
		}

		Convey("The get should return a type 27 message", func() {
			Convey("Where the message is not nil", func() {
				So(type27, ShouldNotBeNil)
			})
		})

		Convey("The get should not return an error", func() {
			So(err, ShouldBeNil)
		})

		Convey("The fields should be populated correctly", func() {
			So(type27, ShouldResemble, expected)
		})
	})
}


text:
      Max Rows

      <input id="number" type="number" value="5" min="1" max="10">

      Single Select

      <select>
        <option value="1">January</option>
        <option value="2">February</option>
        <option value="3">March</option>
        <option value="4">April</option>
        <option value="5">May</option>
        <option value="6">June</option>
        <option value="7">July</option>
        <option value="8">August</option>
        <option value="9">September</option>
        <option value="10">October</option>
        <option value="11">November</option>
        <option value="12">December</option>
      </select>

      Multiple Select

      <select multiple="multiple">
        <option value="1">January</option>
        <option value="2">February</option>
        <option value="3">March</option>
        <option value="4">April</option>
        <option value="5">May</option>
        <option value="6">June</option>
        <option value="7">July</option>
        <option value="8">August</option>
        <option value="9">September</option>
        <option value="10">October</option>
        <option value="11">November</option>
        <option value="12">December</option>
      </select>


text:
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const packageConfig = require('../package.json')
const vueLoaderConfig = require('./vue-loader.conf')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin')
const HappyPack = require('happypack')
const os = require('os')
const PreloadPlugin = require('preload-webpack-plugin')

const happyThreadPool = HappyPack.ThreadPool({
 size: os.cpus().length
})

function resolve (dir) {
  return path.join(__dirname, '..', dir)
}

const cacheLoader = {
  loader: 'cache-loader',
  options: {
    cacheDirectory: path.resolve(__dirname, '../node_modules/.cache/vue-loader'),
    cacheIdentifier: packageConfig.name + ':{version} {process.env.NODE_ENV}'
  }
}

const vueLoader = {
  loader: 'vue-loader',
  options: {
    ...vueLoaderConfig,
    cacheDirectory: path.resolve(__dirname, '../node_modules/.cache/vue-loader'),
    cacheIdentifier: packageConfig.name + ':{version} {process.env.NODE_ENV}'
  }
}

const babelLoader = {
  loader: 'happypack/loader?id=happyBabel'
}

module.exports = {
  entry: {
    'pcside': ['./src/pcside/js/main.js'],
    'mobileside': ['./src/mobileside/js/main.js']
  },
  output: {
    path: config.build.assetsRoot,
    filename: '[name].js',
    publicPath: process.env.NODE_ENV === 'production'
      ? config.build.assetsPublicPath
      : config.dev.assetsPublicPath,
    globalObject: '(typeof self !== \'undefined\' ? self : this)'
  },
  resolve: {
    extensions: ['.mjs', '.js', '.jsx', '.vue', '.json', '.wasm'],
    alias: {
      'vue$': 'vue/dist/vue.runtime.esm.js',
      '@': resolve('src'),
      'mobileside': path.resolve(__dirname, '../src/mobileside'),
      'pcside': path.resolve(__dirname, '../src/pcside'),
      'common': path.resolve(__dirname, '../src/common')
    }
  },
  module: {
    noParse: /^(vue|vue-router|vuex|vuex-router-sync)$/,
    rules: [
      /* config.module.rule('eslint') */
      {
        test: /\.(js|vue)$/,
        loader: 'eslint-loader',
        enforce: 'pre',
        exclude: /node_modules/,
        include: [resolve('src'), resolve('server')],
        options: {
          cache: process.env.NODE_ENV === 'production',
          cacheIdentifier: packageConfig.name + ':{version} {process.env.NODE_ENV}',
          formatter: require('eslint-friendly-formatter')
        }
      },
      /* config.module.rule('vue') */
      {
        test: /\.vue$/,
        exclude: /node_modules/,
        use: process.env.NODE_ENV === 'production'
          ? [cacheLoader, vueLoader]
          : [vueLoader]
      },
      /* config.module.rule('js') */
      {
        test: /\.js$/,
        exclude: /node_modules/,
        include: [resolve('src')],
        use: process.env.NODE_ENV === 'production'
          ? [cacheLoader, babelLoader]
          : [babelLoader]
      },
      /* config.module.rule('images') */
      {
        test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
        loader: 'url-loader',
        options: {
          limit: 10000,
          name: utils.assetsPath('img/[name].[hash:8].[ext]')
        }
      },
      /* config.module.rule('fonts') */
      {
        test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
        loader: 'url-loader',
        options: {
          limit: 10000,
          name: utils.assetsPath('fonts/[name].[hash:8].[ext]')
        }
      }
    ]
  },
  node: {
    // prevent webpack from injecting useless setImmediate polyfill because Vue
    // source contains it (although only uses it if it's native).
    setImmediate: false,
    // prevent webpack from injecting mocks to Node native modules
    // that does not make sense for the client
    dgram: 'empty',
    fs: 'empty',
    net: 'empty',
    tls: 'empty',
    child_process: 'empty'
  },
  plugins: [
    /* config.plugin('vue-loader') */
    new VueLoaderPlugin(),
    /* config.plugin('happypack') */
    new HappyPack({
      id: 'happyBabel',
      loaders: [{
        loader: 'babel-loader',
        options: { cacheDirectory: true }
      }],
      threadPool: happyThreadPool,
      verbose: true
    }),
    /* config.plugin('case-sensitive-paths') */
    new CaseSensitivePathsPlugin(),
    /* config.plugin('preload') */
    new PreloadPlugin({
      rel: 'preload',
      include: process.env.NODE_ENV === 'production'
        ? ['chunk-vendors-pc', 'chunk-common-pc', 'pcside']
        : ['pcside'],
      excludeHtmlNames: ['mobileside/index.html', 'mobileside.html'],
      fileBlacklist: [
        /\.map$/,
        /hot-update\.js$/
      ]}
    ),
    new PreloadPlugin({
      rel: 'preload',
      include: process.env.NODE_ENV === 'production'
        ? ['chunk-vendors-mb', 'chunk-common-mb', 'mobileside']
        : ['mobileside'],
      excludeHtmlNames: ['pcside/index.html', 'pcside.html'],
      fileBlacklist: [
        /\.map$/,
        /hot-update\.js$/
      ]}
    ),
    /* config.plugin('prefetch') */
    new PreloadPlugin({
      rel: 'prefetch',
      include: 'asyncChunks'
    }),
  ]
}


text:
(function() {
  var ObjectId, PageResult, RoleMethods, errors, mongoose, mongooseRestHelper, _,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

  _ = require('underscore-ext');

  PageResult = require('simple-paginator').PageResult;

  errors = require('some-errors');

  mongoose = require("mongoose");

  ObjectId = mongoose.Types.ObjectId;

  mongooseRestHelper = require('mongoose-rest-helper');

  module.exports = RoleMethods = (function() {
    var UPDATE_EXCLUDEFIELDS;

    UPDATE_EXCLUDEFIELDS = ['_id'];

    function RoleMethods(models) {
      this.models = models;
      this.patch = __bind(this.patch, this);
      this.create = __bind(this.create, this);
      this.destroy = __bind(this.destroy, this);
      this.get = __bind(this.get, this);
      this.all = __bind(this.all, this);
    }

    RoleMethods.prototype.all = function(accountId, options, cb) {
      var settings;
      if (options == null) {
        options = {};
      }
      if (cb == null) {
        cb = function() {};
      }
      if (!accountId) {
        return cb(new Error("accountId parameter is required."));
      }
      settings = {
        baseQuery: {
          accountId: mongooseRestHelper.asObjectId(accountId)
        },
        defaultSort: 'name',
        defaultSelect: null,
        defaultCount: 1000
      };
      return mongooseRestHelper.all(this.models.Role, settings, options, cb);
    };

    /*
    Get a role for it's id.
     */

    RoleMethods.prototype.get = function(roleId, options, cb) {
      if (options == null) {
        options = {};
      }
      if (cb == null) {
        cb = function() {};
      }
      if (!roleId) {
        return cb(new Error("roleId parameter is required."));
      }
      return mongooseRestHelper.getById(this.models.Role, roleId, null, options, cb);
    };

    /*
    Completely destroys an organization.
     */

    RoleMethods.prototype.destroy = function(roleId, options, cb) {
      var settings;
      if (options == null) {
        options = {};
      }
      if (cb == null) {
        cb = function() {};
      }
      if (!roleId) {
        return cb(new Error("roleId parameter is required."));
      }
      settings = {};
      return mongooseRestHelper.destroy(this.models.Role, roleId, settings, {}, cb);
    };

    /*
    Create a new processDefinition
     */

    RoleMethods.prototype.create = function(accountId, objs, options, cb) {
      var settings;
      if (objs == null) {
        objs = {};
      }
      if (options == null) {
        options = {};
      }
      if (cb == null) {
        cb = function() {};
      }
      if (!accountId) {
        return cb(new Error("accountId parameter is required."));
      }
      settings = {};
      objs.accountId = new ObjectId(accountId.toString());
      return mongooseRestHelper.create(this.models.Role, settings, objs, options, cb);
    };

    /*
    Updates a deployment
     */

    RoleMethods.prototype.patch = function(scopeId, obj, options, cb) {
      var settings;
      if (obj == null) {
        obj = {};
      }
      if (options == null) {
        options = {};
      }
      if (cb == null) {
        cb = function() {};
      }
      if (!scopeId) {
        return cb(new Error("scopeId parameter is required."));
      }
      settings = {
        exclude: UPDATE_EXCLUDEFIELDS
      };
      return mongooseRestHelper.patch(this.models.Role, scopeId, settings, obj, options, cb);
    };

    return RoleMethods;

  })();

}).call(this);

//# sourceMappingURL=role-methods.js.map


text:
namespace AddProduct
{
    using System.Data.SqlClient;

    internal class AddProduct
    {
        private static void Main()
        {
            SqlConnection sqlConnection = new SqlConnection("Server=.; Database=Northwind; Integrated Security = true");
            sqlConnection.Open();

            using (sqlConnection)
            {
                SqlCommand command = new SqlCommand(
                    "INSERT INTO Products(ProductName, SupplierId, CategoryId, QuantityPerUnit, UnitPrice, " +
                    "UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued) " +
                    "VALUES (@productName, @supplierId, @categoryId, @quantityPerUnit, @unitPrice, @unitsInStock, " +
                    "@unitsOnOrder, @reorderLevel, @discontinued)",
                    sqlConnection);

                command.Parameters.AddWithValue("@productName", "NewName");
                command.Parameters.AddWithValue("@supplierId", "1");
                command.Parameters.AddWithValue("@categoryId", "1");
                command.Parameters.AddWithValue("@quantityPerUnit", "1 box");
                command.Parameters.AddWithValue("@unitPrice", "5");
                command.Parameters.AddWithValue("@unitsInStock", "10");
                command.Parameters.AddWithValue("@unitsOnOrder", "15");
                command.Parameters.AddWithValue("@reorderLevel", "5");
                command.Parameters.AddWithValue("@discontinued", "false");
                command.ExecuteNonQuery();
            }
        }
    }
}


text:
package net.sourceforge.plantuml.activitydiagram3.gtile;

import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.XDimension2D;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;

public class GtileHexagonInside extends AbstractGtile {

	protected final HColor backColor;
	protected final HColor borderColor;

	protected final TextBlock label;
	protected final XDimension2D dimLabel;

	protected final double shadowing;

	final public StyleSignatureBasic getDefaultStyleDefinition() {
		return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond);
	}

	// FtileDiamondInside

	public GtileHexagonInsideLabelled withEastLabel(TextBlock eastLabel) {
		return new GtileHexagonInsideLabelled(this, TextBlockUtils.EMPTY_TEXT_BLOCK, eastLabel,
				TextBlockUtils.EMPTY_TEXT_BLOCK);
	}

	public GtileHexagonInsideLabelled withWestLabel(TextBlock westLabel) {
		return new GtileHexagonInsideLabelled(this, TextBlockUtils.EMPTY_TEXT_BLOCK, TextBlockUtils.EMPTY_TEXT_BLOCK,
				westLabel);
	}

	public AbstractGtileRoot withSouthLabel(TextBlock southLabel) {
		return new GtileHexagonInsideLabelled(this, southLabel, TextBlockUtils.EMPTY_TEXT_BLOCK,
				TextBlockUtils.EMPTY_TEXT_BLOCK);
	}

	public GtileHexagonInside(StringBounder stringBounder, TextBlock label, ISkinParam skinParam, HColor backColor,
			HColor borderColor, Swimlane swimlane) {
		super(stringBounder, skinParam, swimlane);

		final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder());
		this.borderColor = style.value(PName.LineColor).asColor(getIHtmlColorSet());
		this.backColor = style.value(PName.BackGroundColor).asColor(getIHtmlColorSet());
		this.shadowing = style.value(PName.Shadowing).asDouble();

		this.label = label;
		this.dimLabel = label.calculateDimension(stringBounder);

	}

	@Override
	public XDimension2D calculateDimension(StringBounder stringBounder) {
		final XDimension2D dim;
		if (dimLabel.getWidth() == 0 || dimLabel.getHeight() == 0) {
			dim = new XDimension2D(Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2);
		} else {
			dim = XDimension2D.delta(
					XDimension2D.atLeast(dimLabel, Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2),
					Hexagon.hexagonHalfSize * 2, 0);
		}
		return dim;
	}

	@Override
	protected void drawUInternal(UGraphic ug) {
		final StringBounder stringBounder = ug.getStringBounder();
		final XDimension2D dimTotal = calculateDimension(stringBounder);
		ug = ug.apply(borderColor).apply(getThickness()).apply(backColor.bg());
		ug.draw(Hexagon.asPolygon(shadowing, dimTotal.getWidth(), dimTotal.getHeight()));

		final double lx = (dimTotal.getWidth() - dimLabel.getWidth()) / 2;
		final double ly = (dimTotal.getHeight() - dimLabel.getHeight()) / 2;
		label.drawU(ug.apply(new UTranslate(lx, ly)));
	}

}


text:
module OneviewCookbook
  module API500
    module C7000
      # EventProvider API500 C7000 provider
      class EventProvider < API300::C7000::EventProvider
      end
    end
  end
end


text:
#ifndef _MEMORY_OSTREAM_H
#define _MEMORY_OSTREAM_H

#include <stddef.h>

#include "ostream.h"

struct memory_ostream : struct ostream
{
methods:
  /* Return a pointer to the output accumulated so far and its size:
     Store them in *BUFP and *BUFLENP.
     Note: These two return values become invalid when more output is done to
     the stream.  */
  void contents (memory_ostream_t stream, const void **bufp, size_t *buflenp);
};

#ifdef __cplusplus
extern "C" {
#endif

/* Create an output stream that accumulates the output in a memory buffer.  */
extern memory_ostream_t memory_ostream_create (void);

#ifdef __cplusplus
}
#endif

#endif /* _MEMORY_OSTREAM_H */


text:
package com.nekogata.backlogger.application.service.dashboard

import com.nekogata.backlogger.domain.issue.IssueRepository
import com.nekogata.backlogger.domain.setting.SettingRepository
import com.nekogata.backlogger.infrastructure.api_client.BackLogApiClient
import com.nekogata.backlogger.infrastructure.issue.IssueRepositoryImpl
import com.nekogata.backlogger.infrastructure.setting.SettingRepositoryImpl
import com.nekogata.backlogger.js_exports.events.IssueEvents

import scala.util.{Failure, Success}

class CloseIssueService {
  val issueRepository: IssueRepository = new IssueRepositoryImpl
  val settingRepository: SettingRepository = new SettingRepositoryImpl

  import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue

  def close(projectId: Int, issueId: Int): Unit = {
    val oldIssue = issueRepository.get(projectId, issueId)
    if ( oldIssue.synchronizing ) {
      return
    }

    val issue = oldIssue.startSynchronizing
    issueRepository.store(projectId, issue)
    IssueEvents.repositoryChanged.fire()

    val setting = settingRepository.get()
    val client = new BackLogApiClient(setting.spaceName, setting.apiKey)
    client.closeIssue(issueId).onComplete {
      case Success(_) =>
        issueRepository.remove(projectId, issueId)
        IssueEvents.repositoryChanged.fire()
      case Failure(_) =>
        issueRepository.store(projectId, oldIssue)
        IssueEvents.repositoryChanged.fire()
    }
  }
}


text:
from bridge.model.assets import Asset, Backing
from bridge.model.attributes import Attributes, IntegerAttribute, BinaryAttribute

class OnkyoTXNR609(Asset):

    def __init__(self, name, real_id, service, product_name):
        attributes = Attributes(BinaryAttribute('main'),
                IntegerAttribute('volume', 0, 101),
                BinaryAttribute('mute'))
        backing = Backing(real_id, service, product_name)
        super().__init__(name, attributes, backing)
        self._set_control_passthrough('main', 'set_power')
        self._set_control_passthrough('volume', 'set_volume')
        self._set_control_passthrough('mute', 'set_mute')


text:
<!doctype html>

Click Here

Filler image to keep the page loading:


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">

    <display-name>Sterling Web App</display-name>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

    <servlet>
        <servlet-name>sterling-dispatcher</servlet-name>
        <servlet-class>sterling.web.SterlingServlet</servlet-class>
        <init-param>
            <param-name>sterling.webapp</param-name>
            <param-value>sterling.web</param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>sterling-dispatcher</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

</web-app>