text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Continuous.Management;
using Continuous.WindowsService.Shell;
using Continuous.WindowsService.Tests.TestHelpers;
using Continuous.WindowsService.Tests.TestHelpers.Installer;
using FluentAssertions;
using NUnit.Framework;
using NUnit.Framework.Internal;

namespace Continuous.WindowsService.Tests.Tests
{
    [TestFixture]
    public class ExistsTests
    {
        private NameGenerator _nameGenerator;
        private ServiceInstaller _serviceInstaller;
        private IWindowsServiceShell _shell;

        private const string Prefix = "etTestService";

        [SetUp]
        public void SetUp()
        {
            _shell = new ContinuousManagementFactory().WindowsServiceShell();
            _serviceInstaller = new ServiceInstaller();

            _nameGenerator = new NameGenerator();
        }

        [TearDown]
        public void TearDown()
        {
            _serviceInstaller.Dispose();
        }

        [Test]
        public void Exists_Returns_True_If_ServiceExist()
        {
            // Arrange
            var serviceName = _nameGenerator.GetRandomName(Prefix);

            _serviceInstaller.InstallService(serviceName);

            // Act
            var result = _shell.Exists(serviceName);

            // Assert
            result.Should().BeTrue();
        }

        [Test]
        public void Exists_Returns_False_If_ServiceNotExist()
        {
            // Arrange
            var serviceName = _nameGenerator.GetRandomName(Prefix);

            // Act
            var result = _shell.Exists(serviceName);

            // Assert
            result.Should().BeFalse();
        }
    }
}


text:
namespace RTI
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Caliburn.Micro;

    /// <summary>
    /// Display the Deployment configuration to the user before a deployment begins.
    /// </summary>
    public class DeploymentReportDialogViewModel : PulseDialogViewModel
    {
        #region Variables

        /// <summary>
        /// Pulse manager.
        /// </summary>
        private PulseManager _pm;

        #endregion

        #region Properties

        #region Configuration

        /// <summary>
        /// The current ADCP configuration.
        /// </summary>
        private AdcpConfiguration _Configuration;
        /// <summary>
        /// The current ADCP configuration.
        /// </summary>
        public AdcpConfiguration Configuration
        {
            get { return _Configuration; }
            set
            {
                _Configuration = value;
                this.NotifyOfPropertyChange(() => this.Configuration);
            }
        }

        #endregion

        #region Deployment Duration

        /// <summary>
        /// Set the string for the number of days for the deployment.
        /// </summary>
        public string DeploymentDuration
        {
            get
            {
                if (Configuration.DeploymentOptions.Duration == 1)
                {
                    return "1 day.";
                }
                else
                {
                    return string.Format("{0} days.", Configuration.DeploymentOptions.Duration);
                }
            }
        }

        #endregion

        #region Memory

        /// <summary>
        /// Total memory required.  The value is given in bytes.
        /// </summary>
        private long _MemoryCardRequired;
        /// <summary>
        /// Total memory required.  The value is given in bytes.
        /// </summary>
        public long MemoryCardRequired
        {
            get { return _MemoryCardRequired; }
            set
            {
                _MemoryCardRequired = value;
                this.NotifyOfPropertyChange(() => this.MemoryCardRequired);
            }
        }

        /// <summary>
        /// The memory card required scaled to a proper value.
        /// </summary>
        public string MemoryCardRequiredStr
        {
            get
            {
                return MathHelper.MemorySizeString(MemoryCardRequired);
            }
        }

        #endregion

        #region Batteries

        /// <summary>
        /// Total batteries required.  THis will be a double.  Must be rounded
        /// up for the total batteries.
        /// </summary>
        private double _BatteriesRequired;
        /// <summary>
        /// Total batteries required.  THis will be a double.  Must be rounded
        /// up for the total batteries.
        /// </summary>
        public double BatteriesRequired
        {
            get { return _BatteriesRequired; }
            set
            {
                _BatteriesRequired = value;
                this.NotifyOfPropertyChange(() => this.BatteriesRequired);
                this.NotifyOfPropertyChange(() => this.BatteriesRequiredStr);
            }
        }

        /// <summary>
        /// Convert the Batteries required to a string.
        /// This will round the value then set the string.
        /// </summary>
        public string BatteriesRequiredStr
        {
            get
            {
                // Round the value
                int batt = (int)Math.Round(BatteriesRequired);

                // Determine the correct string
                if (batt <= 0)
                {
                    return "No Batteries";
                }
                else if (batt == 1)
                {
                    return "1 Battery";
                }
                else
                {
                    return string.Format("{0} batteries", batt);
                }

            }
        }

        #endregion

        #region CERECORD

        /// <summary>
        /// Set a string if there will be recording internally.
        /// </summary>
        public string CERECORDStr
        {
            get
            {
                if (Configuration != null && (Configuration.Commands.CERECORD_EnsemblePing == Commands.AdcpCommands.AdcpRecordOptions.Enable || Configuration.Commands.CERECORD_EnsemblePing == Commands.AdcpCommands.AdcpRecordOptions.BT_Eng))
                {
                    return "Data will be recorded internally.";
                }

                return "";
            }
        }

        #endregion

        #region ADCP Clock

        /// <summary>
        /// The current time of the ADCP.
        /// </summary>
        private string _AdcpClock;
        /// <summary>
        /// The current time of the ADCP.
        /// </summary>
        public string AdcpClock
        {
            get { return _AdcpClock; }
            set
            {
                _AdcpClock = value;
                this.NotifyOfPropertyChange(() => this.AdcpClock);
            }
        }

        #endregion

        #endregion

        /// <summary>
        /// Initialize the view model.
        /// </summary>
        public DeploymentReportDialogViewModel()
            : base("Deployment Report")
        {
            // Set Pulse Manager
            _pm = IoC.Get<PulseManager>();

            // Set Configuration
            Configuration = _pm.SelectedProject.Configuration;
        }

        /// <summary>
        /// Shutdown the view model.
        /// </summary>
        public override void Dispose()
        {

        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

var client      = require('./client');
var server      = require('./server');

module.exports = {
    connect: client.connect,
    createServer: server.createServer
};


text:
struct TagStructT
{
	char* start; // tag that starts style
	char* end;   // tag that finishes style
};

// tag array
typedef TagStructT* MarkupTagsT;

// returns array of TagStructT with tag strings for HTML

MarkupTagsT get_HTML_markup_tags();

// MarkupTagsT get_PostScript_markup_tags();
// MarkupTagsT get_Latex_markup_tags();

#endif


text:
layout: styleguide
type: component
title: Side navigation
lead: "Hierarchical, vertical navigation to place at the side of a page. Note: We're currently developing horizontal navigation and headers for the top of a page."
---

Single level

          Current page

          Parent link

          Parent link

Two levels

          Parent link

          Current page

              Child link

              Child link

              Child link

              Child link

              Child Link

          Parent link

Three levels

          Parent link

          Current page

              Child link

              Child link

                  Grandchild link

                  Grandchild link

                  Grandchild link

              Child link

              Child link

              Child link

          Parent link

  <button class="usa-button-unstyled usa-accordion-button"
      aria-expanded="true" aria-controls="collapsible-0">
    Documentation
  </button>

Accessibility

Ensure the side navigational system is keyboard accessible. Users should be able to tab through each link.

Usability

When to use

To display a navigational hierarchy with one to three levels.

To display the "sub-navigation" within a section of the website.

When to consider something else

If the site has fewer than five pages, consider organizing the page without a navigational hierarchy.

If your page already has a horizontal and vertical navigation bar, consider ways to simplify your navigation system.

If your content is within a frame or sub-area of a page, consider ways to simplify your navigation system.

Guidance

Indicate where a user is within the navigational hierarchy. Use the "active" state to show users which page they have navigated to.

Keep the navigation links short. They can be shorter derivatives of page titles themselves.

If the navigation hierarchy is too long, users may miss items at the bottom. If it's too deep, users may miss items that require too many clicks. Usability test to find the right balance between breadth and depth.


text:
class AssignmentsController < ApiController
  skip_before_filter :verify_authenticity_token
  respond_to :json

  def index
    assignments = Assignment.find_all_by_course_id(
      params[:course_id]
    )
    respond_with(assignments)
  rescue ActiveRecord::RecordNotFound
    raise 'Course not found'
  end

  def create
    assignment = Assignment.create(assignment_params)
    respond_with(assignment)
  rescue ActiveRecord::RecordInvalid => invalid
    puts invalid.record.errors
  end

  def show
    assignment = Assignment.find(params[:id])
    respond_with(assignment)
  rescue ActiveRecord::RecordNotFound
    raise 'Assignment not found'
  end

  def update
    assignment = Assignment.find(params[:assignment_id])
    unless assignment.update_attributes(assignment_params)
      puts 'Unable to update assignment ' + assignment.id
    end
    render json: assignment
  rescue ActiveRecord::RecordNotFound
    raise 'Assignment not found'
  end

  def destroy
    assignment = Assignment.find(params[:id])
    assignment.destroy
    render json: []
  rescue ActiveRecord::RecordNotFound
    raise 'Assignment not found'
  end

  private

  def assignment_params
    params.permit(
      :course_id,
      :number,
      :date_assigned,
      :date_due,
      :name,
      :description,
      :pdf_url
    )
  end
end


text:
# sircus-components-button

[![npm version](https://img.shields.io/npm/v/sircus-components-button.svg?style=flat)](https://www.npmjs.com/package/sircus-components-button)

## Install

```bash
$ npm install sircus-components-button sircus-variables
```

## Usage

```css
@import "sircus-components-button";
/* Modifier */
@import "sircus-components-button/color";
@import "sircus-components-button/fill";
@import "sircus-components-button/size";
@import "sircus-components-button/reset";
/* Variables */
@import "sircus-variables";
```

## License
Released under the MIT license.


text:
package org.aaronhe.rxgooglemapsbinding;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.Marker;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Action0;
import rx.subscriptions.Subscriptions;

final class InfoWindowClickOnSubscribe implements Observable.OnSubscribe<Marker> {
  final GoogleMap googleMap;

  InfoWindowClickOnSubscribe(GoogleMap googleMap) {
    this.googleMap = googleMap;
  }

  @Override public void call(final Subscriber<? super Marker> subscriber) {
    GoogleMap.OnInfoWindowClickListener listener = new GoogleMap.OnInfoWindowClickListener() {
      @Override public void onInfoWindowClick(Marker marker) {
        if (!subscriber.isUnsubscribed()) {
          subscriber.onNext(marker);
        }
      }
    };

    googleMap.setOnInfoWindowClickListener(listener);

    subscriber.add(Subscriptions.create(new Action0() {
      @Override public void call() {
        googleMap.setOnInfoWindowClickListener(null);
      }
    }));
  }
}


text:
package com.bq.corbel.resources.rem.acl.query;

import static org.fest.assertions.api.Assertions.assertThat;

import java.util.*;

import org.junit.Test;

import com.bq.corbel.lib.queries.BooleanQueryLiteral;
import com.bq.corbel.lib.queries.QueryNodeImpl;
import com.bq.corbel.lib.queries.StringQueryLiteral;
import com.bq.corbel.lib.queries.request.QueryNode;
import com.bq.corbel.lib.queries.request.QueryOperator;
import com.bq.corbel.lib.queries.request.ResourceQuery;

/**
 * @author Rubén Carrasco
 *
 */
public class AclQueryBuilderTest {

    private static final String FIELD = "field";
    private static final String LITERAL = "literal";
    private static final String _ACL_GROUP_GROUP2 = "_acl.group:group2";
    private static final String _ACL_GROUP_GROUP1 = "_acl.group:group1";
    private static final String GROUP2 = "group2";
    private static final String GROUP1 = "group1";
    private static final List<String> GROUPS = Arrays.asList(GROUP1, GROUP2);
    private static final String _ACL_USER_USER_ID = "_acl.user:userId";
    private static final String _ACL_ALL = "_acl.ALL";
    private static final String USER_ID = "userId";
    private static final Optional<String> OPT_USER_ID = Optional.of(USER_ID);

    @Test
    public void testWithUserId() {
        AclQueryBuilder builder = new AclQueryBuilder(OPT_USER_ID, Collections.emptyList());
        List<ResourceQuery> queries = builder.build(Collections.emptyList());
        assertThat(queries.contains(getResourceQuery(getBooleanQueryLiteral(_ACL_ALL)))).isTrue();
        assertThat(queries.contains(getResourceQuery(getBooleanQueryLiteral(_ACL_USER_USER_ID)))).isTrue();
    }

    @Test
    public void testWithGroups() {
        AclQueryBuilder builder = new AclQueryBuilder(Optional.empty(), GROUPS);
        List<ResourceQuery> queries = builder.build(Collections.emptyList());
        assertThat(queries.contains(getResourceQuery(getBooleanQueryLiteral(_ACL_ALL)))).isTrue();
        assertThat(queries.contains(getResourceQuery(getBooleanQueryLiteral(_ACL_GROUP_GROUP1)))).isTrue();
        assertThat(queries.contains(getResourceQuery(getBooleanQueryLiteral(_ACL_GROUP_GROUP2)))).isTrue();
    }

    @Test
    public void testWithQueries() {
        List<QueryNode> nodes = Arrays.asList(
            getBooleanQueryLiteral(_ACL_ALL),
            getBooleanQueryLiteral(_ACL_USER_USER_ID),
            getBooleanQueryLiteral(_ACL_GROUP_GROUP1),
            getBooleanQueryLiteral(_ACL_GROUP_GROUP2),
            getTestQueryLiteral());

        AclQueryBuilder builder = new AclQueryBuilder(OPT_USER_ID, GROUPS);
        List<ResourceQuery> queries = builder
                .build(Arrays.asList(getResourceQuery(getTestQueryLiteral()), getResourceQuery(getTestQueryLiteral())));
        queries.forEach(query -> {
            assertThat(query.getFilters()).hasSize(2);
            query.forEach(queryNode -> assertThat(nodes.contains(queryNode)).isTrue());
        });
    }

    private ResourceQuery getResourceQuery(QueryNode node) {
        ResourceQuery query = new ResourceQuery();
        query.addQueryNode(node);
        return query;
    }

    private QueryNodeImpl getBooleanQueryLiteral(String field) {
        BooleanQueryLiteral booleanQueryLiteral = new BooleanQueryLiteral();
        booleanQueryLiteral.setLiteral(true);
        return new QueryNodeImpl(QueryOperator.$EXISTS, field, booleanQueryLiteral);
    }

    private QueryNodeImpl getTestQueryLiteral() {
        StringQueryLiteral queryLiteral = new StringQueryLiteral(LITERAL);
        return new QueryNodeImpl(QueryOperator.$EQ, FIELD, queryLiteral);
    }

}


text:
class Thumbnail < Application

  before :require_login, :only => [:edit, :update]
  before :get_video
  before :ensure_that_clipping_can_be_changed

  # This will be inside an iframe.
  #
  def new
    @percentages = @video.thumbnail_percentages

    render :layout => :uploader
  end

  # This will be inside an iframe.
  #
  # We've come from the upload form and the thumbnail will be generated when
  # the video is encoded
  #
  def create
    @video.thumbnail_position = params[:percentage]
    @video.save
    @video.add_to_queue

    redirect @video.upload_redirect_url
  end

  def edit
    @percentages = @video.thumbnail_percentages

    render
  end

  # HQ
  #
  # The video is already encoded and we're changing its thumbnail
  #
  def update
    message = {:notice => "Please give Panda a moment to finish moving your thumbnails around."}

    run_later do
      @video.thumbnail_position = params[:percentage]
      @video.save
      @video.clipping.set_as_default

      @video.successful_encodings.each do | video |
        video.clipping.set_as_default
      end
    end

    redirect(url(:video, @video.key), :message => message)
  end

  private

  def get_video
    # Throws Amazon::SDB::RecordNotFoundError if video cannot be found
    @video = Video.find(params[:video_id])
  end

  def ensure_that_clipping_can_be_changed
    unless @video.clipping.changeable?
      throw :halt, 'Thumbnail cannot be changed'
    end
  end

end


text:
using namespace ThunderRumble;
using namespace DirectX;

TitleBackgroundScreen::TitleBackgroundScreen() : GameScreen(),
m_centerpoint(DirectX::SimpleMath::Vector2(0.0f, 0.0f)),
m_xdir(1),
m_ydir(1)
{
    m_transitionPosition = 0.0f;
}

TitleBackgroundScreen::~TitleBackgroundScreen()
{
}

void TitleBackgroundScreen::LoadContent()
{
    m_title = Managers::Get<ContentManager>()->LoadTexture(L"Assets\\Textures\\title.png");
    m_background = Managers::Get<ContentManager>()->LoadTexture(L"Assets\\Textures\\desertbackground.png");

    Reset();
}

void TitleBackgroundScreen::UnloadContent()
{
}

void TitleBackgroundScreen::Reset()
{
    float viewportWidth = static_cast<float>(TheGame->GetWindowWidth());
    float viewportHeight = static_cast<float>(TheGame->GetWindowHeight());

    m_centerpoint = SimpleMath::Vector2(viewportWidth / 2.0f, viewportHeight / 2.0f);
}

// Updates the background screen. Unlike most screens, this should not transition off even if it has been covered by another screen: it is
// supposed to be covered, after all! This overload forces the coveredByOtherScreen parameter to false in order to stop the base
// Update method wanting to transition off.
void TitleBackgroundScreen::Update(float totalTime, float elapsedTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
{
    UNREFERENCED_PARAMETER(coveredByOtherScreen);

    float viewportWidth = static_cast<float>(TheGame->GetWindowWidth());
    float viewportHeight = static_cast<float>(TheGame->GetWindowHeight());
    float scale = GetScaleMultiplierForViewport(viewportWidth, viewportHeight);

    if (m_xdir > 0)
    {
        m_centerpoint.x += (50 * elapsedTime);
    }
    else
    {
        m_centerpoint.x -= (50 * elapsedTime);
    }

    if (m_ydir > 0)
    {
        m_centerpoint.y += 50 * elapsedTime;
    }
    else
    {
        m_centerpoint.y -= 50 * elapsedTime;
    }

    float halfHeight = m_background.Texture->Height() * scale / 2.0f;
    float halfWidth = m_background.Texture->Width() * scale / 2.0f;

    if (m_centerpoint.x - halfWidth > 0.0f || m_centerpoint.x + halfWidth < viewportWidth)
    {
        m_xdir *= -1;
    }

    if (m_centerpoint.y - halfHeight > 0.0f || m_centerpoint.y + halfHeight < viewportHeight)
    {
        m_ydir *= -1;
    }

    GameScreen::Update(totalTime, elapsedTime, otherScreenHasFocus, false);
}

void TitleBackgroundScreen::Draw(float totalTime, float elapsedTime)
{
    UNREFERENCED_PARAMETER(totalTime);
    UNREFERENCED_PARAMETER(elapsedTime);

    auto renderManager = Managers::Get<RenderManager>();
    auto renderContext = renderManager->GetRenderContext(BlendMode::NonPremultiplied);

    float viewportWidth = static_cast<float>(TheGame->GetWindowWidth());
    float viewportHeight = static_cast<float>(TheGame->GetWindowHeight());
    float scale = GetScaleMultiplierForViewport(viewportWidth, viewportHeight);

    SimpleMath::Vector2 titlePosition = SimpleMath::Vector2(viewportWidth / 2.0f, (viewportHeight / 2.0f) - (200.f * scale));
    titlePosition.y -= pow(TransitionPosition(), 2) * titlePosition.y;
    XMVECTORF32 color = { 1.0f, 1.0f, 1.f, TransitionAlpha() };

    renderContext->Begin();

    renderContext->Draw(
        m_background,
        m_centerpoint,
        0.0f,
        scale,
        color);

    renderContext->Draw(
        m_title,
        titlePosition,
        0.0f,
        scale,
        color);

    renderContext->End();
}


text:
/* global jasmine, describe, beforeEach, it, expect, require */
define(["dialog/editRequest"], function(Edit) {
    describe("Edit Request ViewModel definitions.", function() {
        "use strict";

        var a = new Edit();

        describe("Edit Request definitions.", function() {
            it("should define activate as a Function", function() {
                expect(a.activate).toBeDefined();
                expect(a.activate).toEqual(jasmine.any(Function));
            });

            it("should define request", function() {
                expect(a.request).toBeDefined();
            });

            it("should define save as a Function.", function() {
                expect(a.save).toBeDefined();
                expect(a.save).toEqual(jasmine.any(Function));
            });

            it("should define closeDialog as a Function.", function() {
                expect(a.closeDialog).toBeDefined();
                expect(a.closeDialog).toEqual(jasmine.any(Function));
            });
        });
    });
});


text:
@interface EZNetworkAgent : NSObject

+ (EZNetworkAgent *)sharedInstance;

- (void)addRequest:(EZRequest *)request;

@end


text:
The `Colr` object is for building colorized strings.

## Colr Methods:

The `Colr` object has several helper methods.
The `color()` method returns a `str`, but the rest return a `Colr` instance
so they can be chained.

A chainable version of `color()` does exist (`chained()`), but it's not really
needed outside of the `colr` module itself. It could be used to append strings
to a `Colr`, but `Colr.join()` is more flexible.

### Colr.center

Like `str.center`, except it ignores escape codes.

```python
Colr('Hello', fore='green').center(40)

# This also ignores escape codes:
'{:^40}'.format(Colr('Hello', fore='green'))
```

### Colr.format

Like `str.format`, except it operates on `Colr.data`.

```python
Colr('Hello').blue(' {}').red(' {}').format('my', 'friend').center(40)
```

### Colr.gradient

Like `rainbow()`, except a known name can be passed to choose the color
(same names as the basic fore colors).

```python
(Colr('Wow man, ').gradient(name='red')
.gradient('what a neat feature that is.', name='blue'))
```

### Colr.gradient_black

Builds a black and white gradient. The default starting color is black, but
white will be used if `reverse=True` is passed. Like the other `gradient/rainbow`
functions, if you pass a `fore` color, the background will be gradient.

```python
(C('Why does it have to be black or white?').gradient_black(step=3)
.gradient_black(' ' * 10, fore='reset', reverse=True))
```

### Colr.gradient_rgb

Uses true color (rgb codes) to build a gradient from one rgb value to another.
Just like the other `gradient/rainbow` methods, passing a `fore` color means
the background is gradient.

When using `linemode=True` (where each line is a separate gradient), you can
"shift" the gradient left or right for each line using `movefactor=N`. `N` can
be positive or negative to change the direction of the shift, or `None` / `0`
to not shift at all (the default is `None`).

```python
C('This is pretty fancy.').gradient_rgb((0, 0, 255), (255, 0, 0), step=5)
```

### Colr.hex

This will set the fore color using hex values. It accepts
the same args as the other chained methods, except the hex value should be the
first argument. With `rgb_mode=True`, the value is converted straight to
a true color (rgb) code.

```python
# This will use true color (rgb) codes, equivalent to Colr.rgb(255, 55, 55).
Colr().hex('ff3737', rgb_mode=True).bgwhite('Test')
# Without `rgb_mode`, it finds the nearset extended terminal color.
# This is equivalent to extended code 203, or rgb(255, 95, 95).
Colr().hex('ff3737').bgwhite('Test')
```

### Colr.join

Joins `Colr` instances or other types together.
If anything except a `Colr` is passed, `str(thing)` is called before
joining. `join` accepts multiple args, and any list-like arguments are
flattened at least once (simulating str.join args).

```python
Colr('alert', 'red').join('[', ']').yellow(' This is neat.')
```

### Colr.ljust

Like `str.ljust`, except it ignores escape codes.

```python
Colr('Hello', 'blue').ljust(40)

# This also ignores escape codes:
'{:<40}'.format(Colr('Hello', 'blue'))
```

### Colr.lstrip

Like `str.lstrip()`, except it returns a `Colr`.

```python
Colr('    Hello').lstrip() == Colr('Hello')
Colr('    Hello', 'red',  style='bright').lstrip() == Colr('Hello', 'red', style='bright')
```

### Colr.rainbow

Beautiful rainbow gradients in the same style as [lolcat](https://github.com/busyloop/lolcat).
This method is incapable of doing black and white gradients. That's what
`gradient_black()` is for.

```python
Colr('This is really pretty.').rainbow(freq=.5)
```

If your terminal supports it, you can use true color (rgb codes) by using
`rgb_mode=True`:

```python
Colr('This is even prettier.').rainbow(rgb_mode=True)
```

### Colr.rgb

This will set the fore color using true color (rgb codes). It accepts
the same args as the other chained methods, except the `r`, `g`, and `b`
values should be the first arguments.

```python
Colr().rgb(255, 55, 55).bgwhite('Test')
```

It has a background version called `b_rgb`.

```python
Colr().b_rgb(255, 255, 255).rgb(255, 55, 55, 'Test')
```

### Colr.rjust

Like `str.rjust`, except it ignores escape codes.

```python
Colr('Hello', 'blue').rjust(40)

# This also ignores escape codes:
'{:>40}'.format(Colr('Hello', 'blue'))
```

### Colr.rstrip

Like `str.rstrip()`, except it returns a `Colr`.

```python
Colr('Hello    ').rstrip() == Colr('Hello')
Colr('Hello    ', 'red',  style='bright').rstrip() == Colr('Hello', 'red', style='bright')
```

### Colr.str

The same as calling `str()` on a `Colr` instance.
```python
Colr('test', 'blue').str() == str(Colr('test', 'blue'))
```

### Colr.strip

Like `str.strip()`, except it returns a `Colr`.

```python
Colr('    Hello    ').strip() == Colr('Hello')
Colr('    Hello    ', 'red',  style='bright').strip() == Colr('Hello', 'red', style='bright')
```

### Colr.stripped

The same as calling `strip_codes(Colr().data)`.
```python
data = 'Testing this.'
colored = Colr(data, fore='red')
data == colored.stripped()
```

### Colr.\_\_add\_\_

Strings can be added to a `Colr` and the other way around.
Both return a `Colr` instance.

```python
Colr('test', 'blue') + 'this' == Colr('').join(Colr('test', 'blue'), 'this')
'test' + Colr('this', 'blue') == Colr('').join('test', Colr(' this', 'blue'))

```

### Colr.\_\_bytes\_\_

Calling `bytes()` on a `Colr` is like calling `Colr().data.encode()`. For
custom encodings, you can use `str(Colr()).encode(my_encoding)`.

```python
bytes(Colr('test')) = 'test'.encode()
```

### Colr.\_\_call\_\_

`Colr` instances are callable themselves.
Calling a `Colr` will append text to it, with the same arguments as `color()`.

```python
Colr('One', 'blue')(' formatted', 'red')(' string.', 'blue')
```

### Colr.\_\_eq\_\_, \_\_ne\_\_

`Colr` instances can also be compared with other `Colr` instances.
They are equal if `self.data` is equal to `other.data`.

```python
Colr('test', 'blue') == Colr('test', 'blue')
Colr('test', 'blue') != Colr('test', 'red')
```

### Colr.\_\_format\_\_

`Colr` instances can be left, right, or center justified using the format
spec found in `help('FORMATTING')`, and can be colorized with a special
format spec designed for the `Colr` class.

Justification works, ignoring any escape codes, just like the `str` methods:
```python
'{:<40}'.format(Colr('Test')) == str(Colr('Test').ljust(40))
'{:>40}'.format(Colr('Test')) == str(Colr('Test').rjust(40))
'{:^80}'.format(Colr('Test')) == str(Colr('Test').center(80))
```

`Colr` instances can be formatted (wrapped in another `Colr`) by passing
a format spec:

```python
# 'Test' with a red fore color, white background color, and a bright style.
'Hello {x:[fore=red, back=white, style=bright]}'.format(x=Colr('Test'))
```

Aliases were made for the `fore`, `back`, and `style` args for convenience.
You can use `f`, `b`, and `s` instead:

```python
# 'Test' with a red fore color, white background color, and a bright style.
'Hello {:[f=red, b=white, s=bright]}'.format(Colr('Test'))
```

All regular `Colr` argument types work, except the RGB values need to be
separated by `;` because the comma would cause confusion.

```python
# 'Test' with a white fore color, and a black background color.
'Hello {:f=255;255;255, b=0;0;0]}'.format(Colr('Test'))
```

Mixing of the justification and color arguments also works:

```python
'{:^80[f=red, b=white]}'.format(Colr('Test')) == str(Colr('Test', 'red', 'white').center(80))
```

### Colr.\_\_lt\_\_, \_\_gt\_\_, \_\_le\_\_, \_\_ge\_\_
Escape codes are stripped for less-than/greater-than comparisons.

```python
Colr('test', 'blue') < Colr('testing', 'blue')
```

### Colr.\_\_getitem\_\_

Escape codes are stripped when subscripting/indexing, but `Colr` tries to
be smart and grab any color codes *before* the index, and append a reset
code if necessary *after*.

```python
Colr('test', 'blue')[1:3] == Colr('es', 'blue')

# A complicated example:
c = Colr('test', 'red').blue('this').rgb(25, 25, 25, 'thing')
# Index 5 points to 'h' in 'testthisthing', `c` without escape codes.
c[5] == Colr(fore='red').blue('h')
# Slices use the last escape code used before the starting index.
# All codes are kept, including reset/closing codes.
c[:] == c
c[8:] == Colr(fore='red').blue().rgb(25, 25, 25, 'thing')
```

### Colr.\_\_hash\_\_

Hashing a `Colr` just means hashing `Colr().data`, but this works:
```python
hash(Colr('test', 'blue')) == hash(Colr('test', 'blue'))
```

### Colr.\_\_iter\_\_

Iterating over a `Colr` just means iterating over `Colr().data`:
```python
# Generator, equivalent to: str(Colr('test', 'blue'))
s = ''.join(c for c in Colr('test', 'blue'))

# For-loop, equivalent to: for c in str(Colr('test', 'blue'))
for c in Colr('test', 'blue'):
    print(c, end='')
```

### Colr.\_\_mul\_\_

`Colr` instances can be multiplied by an `int` to build color strings.
These are all equal:

```python
Colr('*', 'blue') * 2
Colr('*', 'blue') + Colr('*', 'blue')
Colr('').join(Colr('*', 'blue'), Colr('*', 'blue'))
```

## Special/Dunder Methods:

`Colr` will recognize a dunder method (`__colr__`) on user classes.

### object.\_\_colr\_\_

User classes can specify a default `Colr` object to return when wrapped in
a `Colr` call. Like `__str__` or `__bytes__`, `__colr__` methods should
return a `Colr` object to use when `Colr` is called with no arguments on that
object. If any other type is returned, a `TypeError` is raised.

This only works when `Colr()` is called with no other styling arguments.

```python
from colr import Colr

# Define a custom class, with default Colr styling.
class ErrorTag(object):
    def __str__(self):
        """ Stringified version of this instance. """
        return 'Error'

    def __colr__(self):
        """ Colrized version of this instance. """
        return Colr('Error', 'red', style='bright')

# Use the class with Colr.
e = ErrorTag()

# Prints a bright red 'Error', because no style arguments were passed.
# This is the same as calling print(e.__colr__())
print(Colr(e))

```


text:
using System;
using EventAggregation.Infrastructure;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ModuleB.Tests.Mocks;
using Prism.Events;

namespace ModuleB.Tests
{
    [TestClass]
    public class ActivityPresenterFixture
    {
        [TestMethod]
        public void PresenterAddsFundOnEvent()
        {
            var view = new MockActivityView();
            var mockEventAggregator = new MockEventAggregator();

            MockFundAddedEvent mockEvent = new MockFundAddedEvent();
            mockEventAggregator.AddMapping<FundAddedEvent>(mockEvent);

            ActivityPresenter presenter = new ActivityPresenter(mockEventAggregator);
            presenter.View = view;
            string customerId = "ALFKI";
            presenter.CustomerId = customerId;
            FundOrder payload = new FundOrder() { CustomerId = customerId, TickerSymbol = "MSFT" };
            mockEvent.Subscribe(delegate { new FundOrder() { CustomerId = customerId, TickerSymbol = "MSFT" }; }, ThreadOption.UIThread, true, delegate { return true; });
            mockEvent.Publish(payload);
            StringAssert.Contains(view.AddContentArgumentContent, "MSFT");
        }

        [TestMethod]
        public void PresenterSubscribesToFundAddedForCorrectCustomer()
        {
            var mockEventAggregator = new MockEventAggregator();

            MockFundAddedEvent mockEvent = new MockFundAddedEvent();
            mockEventAggregator.AddMapping<FundAddedEvent>(mockEvent);
            ActivityPresenter presenter = new ActivityPresenter(mockEventAggregator);
            presenter.View = new MockActivityView();

            string customerId = "ALFKI";
            presenter.CustomerId = customerId;

            FundOrder payload = new FundOrder() { CustomerId = customerId };
            mockEvent.Subscribe(delegate { new FundOrder() { CustomerId = customerId }; }, ThreadOption.UIThread, true, delegate{
                if (customerId == "ALFKI"){
                    return true;
                }
                else{
                    return false;
                }
                                                                                });
            mockEvent.Publish(payload);

            Assert.IsTrue(mockEvent.SubscribeArgumentFilter(new FundOrder { CustomerId = "ALFKI" }));
            Assert.AreEqual(ThreadOption.UIThread, mockEvent.ThreadOption);
            customerId = "FilteredOutCustomer";
            mockEvent.Subscribe(delegate { new FundOrder() { CustomerId = customerId }; }, ThreadOption.UIThread, true, delegate {
                if (customerId == "ALFKI")
                {
                    return true;
                }
                else {
                    return false;
                }
            });
            Assert.IsFalse(mockEvent.SubscribeArgumentFilter(new FundOrder { CustomerId = "FilteredOutCustomer" }));
        }

        [TestMethod]
        public void PresenterUnsubcribesFromFundAddedEventIfCustomerIDIsSetTwice()
        {
            var mockEventAggregator = new MockEventAggregator();

            MockFundAddedEvent mockEvent = new MockFundAddedEvent();
            string customerId = "ALFKI";
            FundOrder payload = new FundOrder() { CustomerId = customerId, TickerSymbol = "MSFT" };
            mockEvent.Subscribe(delegate { new FundOrder() { CustomerId = customerId, TickerSymbol = "MSFT" }; }, ThreadOption.UIThread, true, delegate { return true; });
            mockEventAggregator.AddMapping<FundAddedEvent>(mockEvent);
            ActivityPresenter presenter = new ActivityPresenter(mockEventAggregator);
            presenter.View = new MockActivityView();

            presenter.CustomerId = "ALFKI";
            presenter.CustomerId = "ALFKI";

            Assert.AreEqual(1, mockEvent.SubscribeCount);
        }
    }

    internal class MockFundAddedEvent : FundAddedEvent
    {
        public Action<FundOrder> SubscribeArgumentAction;
        public Predicate<FundOrder> SubscribeArgumentFilter;
        public ThreadOption ThreadOption;
        public int SubscribeCount;

        public new SubscriptionToken Subscribe(Action<FundOrder> action, ThreadOption threadOption, bool keepSubscriberReferenceAlive, Predicate<FundOrder> filter)
        {
            SubscribeArgumentAction = action;
            SubscribeArgumentFilter = filter;
            ThreadOption = threadOption;
            SubscribeCount++;
            return new SubscriptionToken(t=> { });
        }

        //public override void Unsubscribe(SubscriptionToken subscriptionToken)
        //{
        //    SubscribeCount--;
        //}
    }

    class MockActivityView : IActivityView
    {
        public string AddContentArgumentContent;

        public void SetTitle(string title)
        {

        }

        public void SetCustomerId(string customerId)
        {

        }

        public void AddContent(string content)
        {
            AddContentArgumentContent = content;
        }
    }
}


text:
package net.jini.security.policy;

import java.security.Permission;
import java.security.Principal;

/**
 * Interface implemented by security policy providers that may support dynamic
 * granting of permissions at run-time.  The grant methods of the
 * net.jini.security.Security class delegate to the
 * methods declared by this interface when this interface is implemented by the
 * installed security policy provider.  Permissions are granted on the
 * granularity of class loader; granting a permission requires (of the calling
 * context) {@link net.jini.security.GrantPermission} for that
 * permission.
 *
 * @author Sun Microsystems, Inc.
 *
 * @since 2.0
 */
public interface DynamicPolicy {
    /**
     * Returns true if this policy provider supports dynamic
     * permission grants; returns false otherwise.  Note that this
     * method may return different values for a given
     * DynamicPolicy instance, depending on context.  For example,
     * a policy provider that delegates to different underlying policy
     * implementations depending on thread state would return true
     * from this method when the current delegate supports dynamic permission
     * grants, but return false when another delegate lacking such
     * support is in effect.
     *
     * @return  true if policy supports dynamic permission grants
     * 		under current context, false otherwise
     */
    boolean grantSupported();

    /**
     * If this security policy provider supports dynamic permission grants,
     * grants the specified permissions to all protection domains (including
     * ones not yet created) that are associated with the class loader of the
     * given class and possess at least the given set of principals.  If the
     * given class is null, then the grant applies across all
     * protection domains that possess at least the specified principals.  If
     * the list of principals is null or empty, then principals
     * are effectively ignored in determining the protection domains to which
     * the grant applies.  If this policy provider does not support dynamic
     * permission grants, then no permissions are granted and an
     * UnsupportedOperationException is thrown.
     *

     * The given class, if non-null, must belong to either the
     * system domain or a protection domain whose associated class loader is
     * non-null.  If the class does not belong to such a
     * protection domain, then no permissions are granted and an
     * UnsupportedOperationException is thrown.
     *

     * If a security manager is installed, its checkPermission
     * method is called with a GrantPermission containing the
     * permissions to grant; if the permission check fails, then no permissions
     * are granted and the resulting SecurityException is thrown.
     * The principals and permissions arrays passed in are neither modified nor
     * retained; subsequent changes to the arrays have no effect on the grant
     * operation.
     *
     * @param   cl class to grant permissions to the class loader of, or
     * 		null if granting across all class loaders
     * @param	principals if non-null, minimum set of principals
     * 		to which grants apply
     * @param	permissions if non-null, permissions to grant
     * @throws	UnsupportedOperationException if policy does not support
     *          dynamic grants, or if cl is non-null
     *          and belongs to a protection domain with a null
     *          class loader other than the system domain
     * @throws	SecurityException if a security manager is installed and the
     *          calling context does not have sufficient permissions to grant
     *          the given permissions
     * @throws	NullPointerException if any element of the principals or
     *          permissions arrays is null
     */
    void grant(Class cl, Principal[] principals, Permission[] permissions);

    /**
     * If this security policy provider supports dynamic permission grants,
     * returns a new array containing the cumulative set of permissions
     * dynamically granted to protection domains (including ones not yet
     * created) that are associated with the class loader of the given class
     * and possess at least the given set of principals.  If the given class is
     * null, then this method returns the cumulative set of
     * permissions dynamically granted across all protection domains that
     * possess at least the specified principals (i.e., through calls to the
     * grant method where the specified class was null).  If the
     * list of principals is null or empty, then the permissions
     * returned reflect only grants not qualified by principals (i.e., those
     * performed through calls to the grant method where the specified
     * principals array was null or empty).  If this policy
     * provider does not support dynamic permission grants, then an
     * UnsupportedOperationException is thrown.
     *

     * The given class, if non-null, must belong to either the
     * system domain or a protection domain whose associated class loader is
     * non-null.  If the class does not belong to such a
     * protection domain, then an UnsupportedOperationException is
     * thrown.
     *
     * @param   cl class to query the permissions dynamically granted to the
     *          class loader of, or null if querying permissions
     *          granted across all class loaders
     * @param   principals if non-null, principals to query
     * 		dynamic grants for
     * @return  new array containing the permissions dynamically granted to the
     *          indicated class loader (if any) and principals
     * @throws	UnsupportedOperationException if policy does not support
     *          dynamic grants, or if cl is non-null
     *          and belongs to a protection domain with a null
     *          class loader other than the system domain
     * @throws	NullPointerException if any element of the principals array is
     *          null
     */
    Permission[] getGrants(Class cl, Principal[] principals);
}


text:
'use strict';

const _ = require('./custom-lodash');

class Markup {
  constructor (elemId, template) {
    this.element = document.getElementById(elemId);
    this.template = template;
  }

  get innerHTML() {
    return this.element.innerHTML;
  }

  render (data) {
    const template = _.template(this.template, _.templateSettings);
    this.insert(template({data}));
  }

  insert (html) {
    this.element.innerHTML = html;
  }

  find (query) {
    return [].slice.call(this.element.querySelectorAll(query), 0);
  }

  addEventListener (func) {

  }
}

module.exports = Markup;


text:
module Steam
  # Encapsulates the Steam protocol
  module Protocol
  end
end

require 'steam/protocol/message'
require 'steam/protocol/client_message'
require 'steam/protocol/protobuf_message'
require 'steam/protocol/gc_message'
require 'steam/protocol/gc_protobuf_message'

# @todo remove these
Steam::ClientMessage = Steam::Protocol::ClientMessage
Steam::ProtobufMessage = Steam::Protocol::ProtobufMessage
Steam::GcMessage = Steam::Protocol::GcMessage
Steam::GcProtobufMessage = Steam::Protocol::GcProtobufMessage
Steam::Message = Steam::Protocol::Message


text:
package enumeratum

import play.api.mvc.QueryStringBindable

trait PlayLowercaseQueryBindableEnum[A <: EnumEntry] { self: Enum[A] =>
  implicit val queryBindable: QueryStringBindable[A] =
    UrlBinders.queryBinderLowercaseOnly(self)
}


text:
/**
 * @requires OpenLayers/Geometry.js
 */

/**
 * Class: OpenLayers.Geometry.Rectangle
 * This class is *not supported*, and probably isn't what you're looking for.
 *     Instead, most users probably want something like:
 *     (code)
 *     var poly = new OpenLayers.Bounds(0,0,10,10).toGeometry();
 *     (end)
 *     This will create a rectangular Polygon geometry.
 *
 * Inherits:
 *  - <OpenLayers.Geometry>
 */

OpenLayers.Geometry.Rectangle = OpenLayers.Class(OpenLayers.Geometry, {

    /**
     * Property: x
     * {Float}
     */
    x: null,

    /**
     * Property: y
     * {Float}
     */
    y: null,

    /**
     * Property: width
     * {Float}
     */
    width: null,

    /**
     * Property: height
     * {Float}
     */
    height: null,

    /**
     * Constructor: OpenLayers.Geometry.Rectangle
     *
     * Parameters:
     * points - {Array(<OpenLayers.Geometry.Point>}
     */
    initialize: function(x, y, width, height) {
        OpenLayers.Geometry.prototype.initialize.apply(this, arguments);

        this.x = x;
        this.y = y;

        this.width = width;
        this.height = height;
    },

    /**
     * Method: calculateBounds
     * Recalculate the bounds for the geometry.
     */
    calculateBounds: function() {
        this.bounds = new OpenLayers.Bounds(this.x, this.y,
                                            this.x + this.width,
                                            this.y + this.height);
    },

    /**
     * APIMethod: getLength
     *
     * Returns:
     * {Float} The length of the geometry
     */
    getLength: function() {
        var length = (2 * this.width) + (2 * this.height);
        return length;
    },

    /**
     * APIMethod: getArea
     *
     * Returns:
     * {Float} The area of the geometry
     */
    getArea: function() {
        var area = this.width * this.height;
        return area;
    },

    CLASS_NAME: "OpenLayers.Geometry.Rectangle"
});


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

namespace x_IMU_API
{
    /// <summary>
    /// Packet count class to count number of packets read/written.
    /// </summary>
    public class PacketCount
    {
        /// <summary>
        /// Private array of packet counts.
        /// </summary>
        private int[] packetCounts;

        /// <summary>
        /// Gets or sets the total number of packet count.
        /// </summary>
        public int TotalPackets { get { return packetCounts.Sum(); } }

        /// <summary>
        /// Gets or sets the error Error packet count.
        /// </summary>
        public int ErrorPackets { get { return packetCounts[(int)PacketHeaders.Error]; } set { packetCounts[(int)PacketHeaders.Error] = value; } }

        /// <summary>
        /// Gets or sets the Command packet count.
        /// </summary>
        public int CommandPackets { get { return packetCounts[(int)PacketHeaders.Command]; } set { packetCounts[(int)PacketHeaders.Command] = value; } }

        /// <summary>
        /// Gets or sets the ReadRegister packet count.
        /// </summary>
        public int ReadRegisterPackets { get { return packetCounts[(int)PacketHeaders.ReadRegister]; } set { packetCounts[(int)PacketHeaders.ReadRegister] = value; } }

        /// <summary>
        /// Gets or sets the WriteRegister packet count.
        /// </summary>
        public int WriteRegisterPackets { get { return packetCounts[(int)PacketHeaders.WriteRegister]; } set { packetCounts[(int)PacketHeaders.WriteRegister] = value; } }

        /// <summary>
        /// Gets or sets the ReadDateTime packet count.
        /// </summary>
        public int ReadDateTimePackets { get { return packetCounts[(int)PacketHeaders.ReadDateTime]; } set { packetCounts[(int)PacketHeaders.ReadDateTime] = value; } }

        /// <summary>
        /// Gets or sets the WriteDateTime packet count.
        /// </summary>
        public int WriteDateTimePackets { get { return packetCounts[(int)PacketHeaders.WriteDateTime]; } set { packetCounts[(int)PacketHeaders.WriteDateTime] = value; } }

        /// <summary>
        /// Gets or sets the RawBatteryAndThermometerData packet count.
        /// </summary>
        public int RawBatteryAndThermometerDataPackets { get { return packetCounts[(int)PacketHeaders.RawBatteryAndThermometerData]; } set { packetCounts[(int)PacketHeaders.RawBatteryAndThermometerData] = value; } }

        /// <summary>
        /// Gets or sets the CalBatteryAndThermometerData packet count.
        /// </summary>
        public int CalBatteryAndThermometerDataPackets { get { return packetCounts[(int)PacketHeaders.CalBatteryAndThermometerData]; } set { packetCounts[(int)PacketHeaders.CalBatteryAndThermometerData] = value; } }

        /// <summary>
        /// Gets or sets the RawInertialAndMagneticData packet count.
        /// </summary>
        public int RawInertialAndMagneticDataPackets { get { return packetCounts[(int)PacketHeaders.RawInertialAndMagneticData]; } set { packetCounts[(int)PacketHeaders.RawInertialAndMagneticData] = value; } }

        /// <summary>
        /// Gets or sets the CalInertialAndMagneticData packet count.
        /// </summary>
        public int CalInertialAndMagneticDataPackets { get { return packetCounts[(int)PacketHeaders.CalInertialAndMagneticData]; } set { packetCounts[(int)PacketHeaders.CalInertialAndMagneticData] = value; } }

        /// <summary>
        /// Gets or sets the QuaternionData packet count.
        /// </summary>
        public int QuaternionDataPackets { get { return packetCounts[(int)PacketHeaders.QuaternionData]; } set { packetCounts[(int)PacketHeaders.QuaternionData] = value; } }

        /// <summary>
        /// Gets or sets the DigitalIOdata packet count.
        /// </summary>
        public int DigitalIOdataPackets { get { return packetCounts[(int)PacketHeaders.DigitalIOdata]; } set { packetCounts[(int)PacketHeaders.DigitalIOdata] = value; } }

        /// <summary>
        /// Gets or sets the RawAnalogueInputData packet count.
        /// </summary>
        public int RawAnalogueInputDataPackets { get { return packetCounts[(int)PacketHeaders.RawAnalogueInputData]; } set { packetCounts[(int)PacketHeaders.RawAnalogueInputData] = value; } }

        /// <summary>
        /// Gets or sets the CalAnalogueInputData packet count.
        /// </summary>
        public int CalAnalogueInputDataPackets { get { return packetCounts[(int)PacketHeaders.CalAnalogueInputData]; } set { packetCounts[(int)PacketHeaders.CalAnalogueInputData] = value; } }

        /// <summary>
        /// Gets or sets the PWMoutputData packet count.
        /// </summary>
        public int PWMoutputDataPackets { get { return packetCounts[(int)PacketHeaders.PWMoutputData]; } set { packetCounts[(int)PacketHeaders.PWMoutputData] = value; } }

        /// <summary>
        /// Gets or sets the RawADXL345busData packet count.
        /// </summary>
        public int RawADXL345busDataPackets { get { return packetCounts[(int)PacketHeaders.RawADXL345busData]; } set { packetCounts[(int)PacketHeaders.RawADXL345busData] = value; } }

        /// <summary>
        /// Gets or sets the CalADXL345busData packet count.
        /// </summary>
        public int CalADXL345busDataPackets { get { return packetCounts[(int)PacketHeaders.CalADXL345busData]; } set { packetCounts[(int)PacketHeaders.CalADXL345busData] = value; } }

        /// <summary>
        /// Initializes a new instance of the <see cref="PacketCount"/> class.
        /// </summary>
        public PacketCount()
        {
            packetCounts = new int[Enum.GetValues(typeof(PacketHeaders)).Length];
            Reset();
        }

        /// <summary>
        /// Resets all packet counts to zero.
        /// </summary>
        internal void Reset()
        {
            Array.Clear(packetCounts, 0, packetCounts.Length);
        }
    }
}


text:
package com.cardpay.pccredit.divisional.web;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cardpay.pccredit.customer.model.CustomerInforWeb;
import com.cardpay.pccredit.customer.service.CustomerInforService;
import com.cardpay.pccredit.datapri.constant.DataPriConstants;
import com.cardpay.pccredit.divisional.constant.DivisionalConstant;
import com.cardpay.pccredit.divisional.filter.DivisionalFilter;
import com.cardpay.pccredit.divisional.model.Divisional;
import com.cardpay.pccredit.divisional.model.DivisionalWeb;
import com.cardpay.pccredit.divisional.service.DivisionalService;
import com.cardpay.pccredit.system.model.Dict;
import com.wicresoft.jrad.base.auth.IUser;
import com.wicresoft.jrad.base.auth.JRadModule;
import com.wicresoft.jrad.base.auth.JRadOperation;
import com.wicresoft.jrad.base.constant.JRadConstants;
import com.wicresoft.jrad.base.database.model.QueryResult;
import com.wicresoft.jrad.base.web.JRadModelAndView;
import com.wicresoft.jrad.base.web.controller.BaseController;
import com.wicresoft.jrad.base.web.result.JRadPagedQueryResult;
import com.wicresoft.jrad.base.web.security.LoginManager;
import com.wicresoft.jrad.base.web.utility.WebRequestHelper;
import com.wicresoft.jrad.modules.privilege.filter.OrganizationFilter;
import com.wicresoft.jrad.modules.privilege.model.Organization;
import com.wicresoft.jrad.modules.privilege.model.User;
import com.wicresoft.jrad.modules.privilege.service.OrganizationService;
import com.wicresoft.jrad.modules.privilege.service.UserService;
import com.wicresoft.util.spring.Beans;
import com.wicresoft.util.spring.mvc.mv.AbstractModelAndView;
import com.wicresoft.util.web.RequestHelper;

/**
 *
 * @author shaoming
 *
 */
@Controller
@RequestMapping("/divisional/customerallot/*")
@JRadModule("divisional.customerallot")
public class DivisionalController extends BaseController{

	@Autowired
	private DivisionalService divisionalservice;

	@Autowired
	private CustomerInforService customerInforservice;
	@Autowired
	private OrganizationService organizationService;
	@Autowired
	private UserService userService;
	/**
	 * 浏览页面
	 *
	 * @param filter
	 * @param request
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "browse.page", method = { RequestMethod.GET })
	public AbstractModelAndView browse(@ModelAttribute DivisionalFilter filter, HttpServletRequest request) {
		filter.setRequest(request);
		IUser user =Beans.get(LoginManager.class).getLoggedInUser(request);
		//String orgId = user.getOrganization().getId();
		//filter.setCurrentOrganizationId(orgId);
		//filter.setDivisionalProgress(DivisionalConstant.CHARGE);
		QueryResult<DivisionalWeb> result = divisionalservice.findDivisional_qz(filter);
		JRadPagedQueryResult<DivisionalWeb> pagedResult = new JRadPagedQueryResult<DivisionalWeb>(filter, result);
		JRadModelAndView mv = new JRadModelAndView("/divisional/customerallot/customerallot_browse", request);
		mv.addObject(PAGED_RESULT, pagedResult);
		return mv;
	}
	/**
	 *
	 * 客户经理分配
	 * @param filter
	 * @param request
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "divisional.page", method = { RequestMethod.GET })
	public AbstractModelAndView browse(HttpServletRequest request) {
		JRadModelAndView mv = new JRadModelAndView("/divisional/customerallot/customerallot_divisional", request);
		String divisionalId = RequestHelper.getStringValue(request, ID);
		String divisionalResult = divisionalservice.findDivisionalResultById(divisionalId);
		IUser user = (User)Beans.get(LoginManager.class).getLoggedInUser(request);
		if(divisionalResult==null || !divisionalResult.equals(DivisionalConstant.DISTRIBUTION)){
			List<Dict> customerManagers = divisionalservice.findCustomerManagers(user.getOrganization().getId());
			mv.addObject(DivisionalConstant.CUSTOMERMANAGERS,customerManagers);
		}
		CustomerInforWeb customerInforWeb = null;
		if (StringUtils.isNotEmpty(divisionalId)) {
			String customerInforId = divisionalservice.findCustomerIdById(divisionalId);
			customerInforWeb = customerInforservice.findCustomerInforWebById(customerInforId);
		}
		mv.addObject(DivisionalConstant.CUSTOMERINFOR, customerInforWeb);
		mv.addObject(DivisionalConstant.ID,divisionalId);
		return mv;
	}

	/**
	 *
	 * 客户经理分配-信贷
	 * @param filter
	 * @param request
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "divisional_xd.page", method = { RequestMethod.GET })
	public AbstractModelAndView divisional_xd(HttpServletRequest request) {
		JRadModelAndView mv = new JRadModelAndView("/divisional/customerallot/customerallot_xd_divisional", request);
		String divisionalId = RequestHelper.getStringValue(request, ID);
		Divisional divisional = divisionalservice.findDivisinalById(divisionalId);

		CustomerInforWeb customerInforWeb = null;
		if (StringUtils.isNotEmpty(divisionalId)) {
			String customerInforId = divisionalservice.findCustomerIdById(divisionalId);
			customerInforWeb = customerInforservice.findCustomerInforWebById(customerInforId);
		}
		mv.addObject(DivisionalConstant.CUSTOMERINFOR, customerInforWeb);
		mv.addObject(DivisionalConstant.ID,divisionalId);
		mv.addObject("divisional",divisional);
		//查找机构
		Organization org = organizationService.getOrganizationById(divisional.getCurrentOrganizationId());
		mv.addObject("org",org);
		//查找用户
		User user = userService.getUserById(divisional.getCustomerManagerId());
		mv.addObject("user",user);
		return mv;
	}

	/**
	 * 提交分配结果
	 * @param request
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "divisional.json", method = { RequestMethod.GET })
	public Map<String, Object> divisional(@ModelAttribute DivisionalForm form,HttpServletRequest request) {
		Map<String, Object> returnMap = new HashMap<String,Object>();
		IUser user =(User)Beans.get(LoginManager.class).getLoggedInUser(request);
		String orgId = user.getOrganization().getId();
		String id = form.getId();
		String customerManagerId = form.getCustomerManagerId();
		try{
			divisionalservice.updateDivisional(id, customerManagerId, orgId,DivisionalConstant.DISTRIBUTION);
			returnMap.put(JRadConstants.SUCCESS, true);
			returnMap.put(JRadConstants.MESSAGE,DivisionalConstant.DIVISIONALSUCCESS);
		}catch(Exception e){
			returnMap.put(JRadConstants.SUCCESS, false);
			returnMap.put(JRadConstants.MESSAGE,e.getMessage());
			return WebRequestHelper.processException(e);
		}
		returnMap.put(RECORD_ID, id);
		return returnMap;
	}

	/**
	 * 提交分配结果 退回
	 * @param request
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "divisional_refuse.json", method = { RequestMethod.GET })
	public Map<String, Object> divisional_refuse(@ModelAttribute DivisionalForm form,HttpServletRequest request) {
		Map<String, Object> returnMap = new HashMap<String,Object>();
		//IUser user =(User)Beans.get(LoginManager.class).getLoggedInUser(request);
		//String orgId = user.getOrganization().getId();
		String id = form.getId();
		//String customerManagerId = form.getCustomerManagerId();
		try{
			divisionalservice.returnDivisional(id,form.getCustomerId());

			returnMap.put(JRadConstants.SUCCESS, true);
			returnMap.put(JRadConstants.MESSAGE,DivisionalConstant.DIVISIONALSUCCESS);
		}catch(Exception e){
			e.printStackTrace();
			return WebRequestHelper.processException(e);
		}
		returnMap.put(RECORD_ID, id);
		return returnMap;
	}

	/**
	 * 提交分配结果 -信贷
	 * @param request
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "divisional_xd.json", method = { RequestMethod.GET })
	public Map<String, Object> divisional_xd_json(@ModelAttribute DivisionalForm form,HttpServletRequest request) {
		Map<String, Object> returnMap = new HashMap<String,Object>();
		IUser user =(User)Beans.get(LoginManager.class).getLoggedInUser(request);
		String orgId = user.getOrganization().getId();
		String id = form.getId();
		String customerManagerId = form.getCustomerManagerId();
		try{
			divisionalservice.updateDivisional(id, customerManagerId, orgId,DivisionalConstant.DISTRIBUTION);
			returnMap.put(JRadConstants.SUCCESS, true);
			returnMap.put(JRadConstants.MESSAGE,DivisionalConstant.DIVISIONALSUCCESS);
		}catch(Exception e){
			returnMap.put(JRadConstants.SUCCESS, false);
			returnMap.put(JRadConstants.MESSAGE,e.getMessage());
			//return WebRequestHelper.processException(e);
		}
		returnMap.put(RECORD_ID, id);
		return returnMap;
	}

	/**
	 * 上传到卡中心
	 * @param request
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "upload.json", method = { RequestMethod.GET })

	public Map<String, Object> upload(HttpServletRequest request) {
		Map<String, Object> returnMap = new HashMap<String,Object>();
		String id = RequestHelper.getStringValue(request, ID);
		try {
			String process = divisionalservice.findDivisionalProcessById(id);
			if(process.equals(DivisionalConstant.CFCC)){
				returnMap.put(JRadConstants.SUCCESS, false);
				returnMap.put(JRadConstants.MESSAGE,DivisionalConstant.UPLOADERRORC);
				return returnMap;
			}
			boolean flag = divisionalservice.uploadToCardCenter(id,DivisionalConstant.CFCC);
			if(flag){
				returnMap.put(JRadConstants.SUCCESS, true);
				returnMap.put(JRadConstants.MESSAGE,DivisionalConstant.UPLOADSUCCESS);
			}else{
				returnMap.put(JRadConstants.SUCCESS, false);
				returnMap.put(JRadConstants.MESSAGE,DivisionalConstant.UPLOADERROR);
			}
		} catch (Exception e) {
			returnMap.put(JRadConstants.MESSAGE, DataPriConstants.SYS_EXCEPTION_MSG);
			returnMap.put(JRadConstants.SUCCESS, false);
			return WebRequestHelper.processException(e);
		}
		return returnMap;
	}
}


text:
package at.ac.tuwien.infosys.aggr.xml;

import io.hummer.util.Util;

import java.util.Map;

import org.apache.log4j.Logger;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public abstract class XQueryProcessor {

	public static final Logger logger = Util.getLogger(XQueryProcessor.class);

	public abstract Object execute(Node target, String expression, boolean forceSingleResultElement, Map<String,Object> variables) throws EmptyQueryResultException, Exception;

	public static class EmptyQueryResultException extends Exception {
		private static final long serialVersionUID = 1L;
		public EmptyQueryResultException() {}
		public EmptyQueryResultException(String msg) {
			super(msg);
		}
	}

	public Object execute(Node target, String expression, boolean forceSingleResultElement) throws EmptyQueryResultException, Exception {
		return execute(target, expression, forceSingleResultElement, null);
	}

	public boolean evaluatesToTrue(String expression, Element element) throws Exception {
		Object o = execute(element, "boolean(" + expression + ")", false);
		if(o == null)
			return false;
		return (Boolean)o;
	}

	public Object execute(String query) throws Exception {
		return execute(null, query, false);
	}

	public static XQueryProcessor getInstance() {
		// TODO: make configurable..
		return new XQueryProcessorSaxon();
		//return new XQueryProcessorMXQuery();
	}
}


text:
package jdepend.model.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import jdepend.framework.exception.JDependException;
import jdepend.metadata.JavaClass;
import jdepend.metadata.JavaPackage;
import jdepend.metadata.util.JavaClassCollection;
import jdepend.metadata.util.JavaClassUtil;
import jdepend.model.Component;
import jdepend.model.JavaClassUnit;
import jdepend.model.result.AnalysisRunningContext;

public final class CopyUtil {

	private List<Component> targets = new ArrayList<Component>();
	private Map<String, JavaClassUnit> javaClasses = new HashMap<String, JavaClassUnit>();

	public List<Component> copy(AnalysisRunningContext runningContext, List<Component> components) {
		// 创建JavaClassUnit
		for (Component component : components) {
			for (JavaClassUnit javaClass : component.getClasses()) {
				if (javaClasses.get(javaClass.getId()) == null) {
					newJavaClass(javaClass);
				}
			}
		}
		// 生成JavaClasses
		Map<String, JavaClass> newJavaClasses = new HashMap<String, JavaClass>();
		for (String id : javaClasses.keySet()) {
			newJavaClasses.put(id, javaClasses.get(id).getJavaClass());
		}

		JavaClassCollection jClasses = new JavaClassCollection(runningContext.getProfileFacade()
				.getJavaClassRelationItemProfile().getJavaClassRelationTypes(), newJavaClasses.values());
		// 补充JavaClassRelationItem的Current和Depend
		JavaClassUtil.supplyJavaClassRelationItem(jClasses);
		// 将JavaClassDetail中的字符串信息填充为对象引用
		JavaClassUtil.supplyJavaClassDetail(jClasses);

		// 创建JavaPackage
		for (Component component : components) {
			for (JavaPackage javaPackage : component.getJavaPackages()) {
				try {
					javaPackage.clone(newJavaClasses);
				} catch (JDependException e) {
					e.printStackTrace();
				}
			}
		}

		// 创建Component
		for (Component component : components) {
			try {
				targets.add(component.clone(javaClasses));
			} catch (JDependException e) {
				e.printStackTrace();
			}
		}
		return targets;

	}

	private JavaClassUnit newJavaClass(JavaClassUnit javaClass) {
		JavaClassUnit newJavaClass = javaClasses.get(javaClass.getId());

		if (newJavaClass == null) {
			newJavaClass = javaClass.clone();
			javaClasses.put(newJavaClass.getId(), newJavaClass);
			// 添加内部类
			for (JavaClassUnit innerClass : newJavaClass.getInnerClassUnits()) {
				javaClasses.put(innerClass.getId(), innerClass);
			}
		}
		return newJavaClass;
	}
}


text:
function [feats] = sol_feat_config(feat_collection)

  feats = {
    'pairwise_category_centroid_diff',...
    'pairwise_category_sum_of_pixels',...
    'pairwise_category_cooccurrence',...
    'uva_segment_classification_score',...
    'globalpb_chamfer_distance_fore',...
    'globalpb_chamfer_distance_segm',...
    'pairwise_category_sum_of_pixels_chi2_hom_kern',...
    'pairwise_category_cooccurrence_chi2_hom_kern'
  };

  if(strcmp(feat_collection, 'all_feats'))
    feats = feats([1 2 3 4 6]);
  elseif(strcmp(feat_collection, 'pairwise_category'))
    feats = feats([1 2 3]);
  elseif(strcmp(feat_collection, 'classification'))
    feats = feats([4]);
  elseif(strcmp(feat_collection, 'globalpb'))
    feats = feats([6]);
  elseif(strcmp(feat_collection, 'pairwise_category_chi2_hom_kern'))
    feats = feats([7 8]);
  elseif(strcmp(feat_collection, 'o2p_best'))
    feats = feats([1 2 3 6]);
  else
    error('no such type');
  end


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/qF5F5F9" android:state_selected="true"/>
    <item android:drawable="@color/qF5F5F9" android:state_pressed="true"/>
    <!--<item android:drawable="@color/qF5F5F9" android:state_activated="true"/>-->
    <!--<item android:drawable="@color/qF5F5F9" android:state_checked="true"/>-->
    <item android:drawable="@color/qFFFFFF"></item>
</selector>


text:
"""
.. module:: Handlers.Streetlight.handler
    :platform: Unix, Windows
.. moduleauthor:: Aki Mäkinen <aki.makinen@outlook.com>

"""
__author__ = 'Aki Mäkinen'

import re
import urllib
import json

from RESThandlers.HandlerInterface.Exceptions import GenericDBError, ObjectNotFound
from RESThandlers.HandlerInterface.HandlerBaseClass import HandlerBase
from RESThandlers.Streetlight.models import Streetlights
from lbd_backend.utils import flattener

class StreetlightHandler(HandlerBase):
    @property
    @staticmethod
    def handler_id(self):
        return json.dumps({
            "identifier_field_name": "feature_id"
        })

    _doc_structure = {
        "_id": 0,
        "type": 1,
        "id": "$feature_id",
        "geometry": {
            "type": 1,
            "coordinates": 1
        },
        "geometry_name": 1,
        "properties": {
            "KATUVALO_ID": 1,
            "NIMI": 1,
            "TYYPPI_KOODI": 1,
            "LAMPPU_TYYPPI_KOODI": 1,
            "LAMPPU_TYYPPI": 1
        }
    }

    _doc_structure_mini = {
        "_id": 0,
        "type": 1,
        "id": "$feature_id",
        "geometry": {
            "type": 1,
            "coordinates": 1
        },
    }

    _featurecollection = {
        "type": "FeatureCollection",
        "totalFeatures": None,
        "features": list()
    }

    def __init__(self):
        self.modelobject = Streetlights

    def update_db(self):
        req = urllib.urlopen(
            'http://tampere.navici.com/tampere_wfs_geoserver/opendata/ows?service=WFS&version=1.0.0&request=GetFeature'
            '&typeName=opendata:WFS_KATUVALO&outputFormat=json&srsName=EPSG:4326',
            proxies={})
        try:
            jsonitem = json.loads(req.read())
        except ValueError:
            return False
        self.modelobject.drop_collection()
        doclist = []
        for d in jsonitem["features"]:
            id = d.pop("id")
            d["feature_id"] = id
            temp = self.modelobject(**d)
            #temp.save()
            doclist.append(temp)
            if len(doclist) % 2000 == 0:
                self.modelobject.objects.insert(doclist)
                doclist = []
        if len(doclist) > 0:
            self.modelobject.objects.insert(doclist)

        return True

    def get_by_id(self, iid):
        result = self.modelobject._get_collection().aggregate([
            {"$match": {"feature_id": iid}},
            {"$project": self._doc_structure}
        ])
        if int(result["ok"]) == 1 and len(result["result"]) > 0:
            return result["result"][0]
        else:
            raise ObjectNotFound("Object not found")

    def get_near(self, longitude, latitude, nrange=0.001, mini=False):
        if mini:
            doc_structure = self._doc_structure_mini
        else:
            doc_structure = self._doc_structure

        result = self.modelobject._get_collection().aggregate([
            {"$match":
                 {"geometry":
                      {"$geoWithin":
                           {"$center": [[float(longitude), float(latitude)], nrange]}
                      }
                 }
            },
            {"$project": doc_structure}
        ])
        itemcount = len(result["result"])
        if int(result["ok"]):
            fc = self._featurecollection
            fc["totalFeatures"] = itemcount
            fc["features"] = result["result"]

            return fc
        else:
            raise GenericDBError("Database query failed. Status: " + str(result["ok"]))

    def get_within_rectangle(self, xtop_right, ytop_right, xbottom_left, ybottom_left, mini=False):

        if mini:
            doc_structure = self._doc_structure_mini
        else:
            doc_structure = self._doc_structure

        raw = self.modelobject._get_collection().aggregate([{'$match':
                                                                 {'geometry':
                                                                      {'$geoWithin':
                                                                           {'$box': [[xbottom_left, ybottom_left],
                                                                                [xtop_right, ytop_right]]}
                                                                      }
                                                                 }
                                                            },
                                                            {'$project': doc_structure}
        ])
        if int(raw["ok"]) != 1:
            raise GenericDBError("Database query failed. Status: " + str(raw["ok"]))
        else:
            f_count = self.modelobject.objects(geometry__geo_within_box=
                                               [(xbottom_left, ybottom_left), (xtop_right, ytop_right)]).count()
            featurecollection = self._featurecollection
            featurecollection["totalFeatures"] = f_count
            featurecollection["features"] = raw["result"]

            return featurecollection

    def get_all(self, mini=True):
        if mini:
            doc_structure = self._doc_structure_mini
        else:
            doc_structure = self._doc_structure

        raw = self.modelobject._get_collection().aggregate([{'$project': doc_structure}])
        if int(raw["ok"]) != 1:
            raise GenericDBError("Database query failed. Status: " + str(raw["ok"]))
        else:
            res_count = len(raw["result"])

            featurecollection = self._featurecollection
            featurecollection["totalFeatures"] = res_count
            featurecollection["features"] = raw["result"]

            return featurecollection

    # Return values:
    # Boolean: True if all were deleted, False if objects remain in db after deletion
    def delete_all(self):
        obj = self.modelobject.objects()
        try:
            deleted = obj.delete()
        except Exception as e:
            raise GenericDBError(e.message)

    def delete_near(self, latitude, longitude, nrange):
        itemcount = self.modelobject.objects(geometry__geo_within_center=
                                             [(float(latitude), float(longitude)), nrange]).count()

        delcount = self.modelobject.objects(geometry__geo_within_center=
                                            [(float(latitude), float(longitude)), nrange]).delete()

        if itemcount == delcount:
            return True
        else:
            return False

    # Function get_item_count
    # Return values:
    #       Integer: number of items in table
    def get_item_count(self):
        return self.modelobject.objects().count()

    def search(self, regex, limit, field=None):
        if field is None:
            raise NotImplementedError # TODO: Search from all fields... some day
        elif field == "id":
            try:
                reg = re.compile(regex, re.IGNORECASE)
            except Exception as e:
                raise ValueError(e.message)
            raw = self.modelobject._get_collection().aggregate([{'$match': {
                                                                     "feature_id": {
                                                                         "$regex": reg
                                                                     }
                                                                 }
                                                            }, {
                                                                '$project': self._doc_structure
                                                            }])
            if int(raw["ok"]) == 1:
                results = raw["result"]
            else:
                results = []
            totalresults = len(results)
            if totalresults > limit:
                results = results[:limit]
            featurecollection = self._featurecollection
            featurecollection["totalFeatures"] = len(results)
            featurecollection["features"] = results
            return totalresults, featurecollection
        else:
            raise NotImplementedError

    def get_field_names(self):
        doc = self.modelobject._get_collection().find_one()
        if doc is None:
            fields = []
        else:
            fields = []
            for item in flattener(doc, None):
                if item == "feature_id":
                    fields.append("id")
                elif item == "_id":
                    pass
                else:
                    fields.append(item)
        return fields


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

<recipeml version="0.5">
  <recipe>
    <head>
      <title>20-Minute Chicken Creole</title>
      <categories>
        <cat>None</cat></categories>
      <yield>1</yield></head>
    <ingredients>
      <ing>
        <amt>
          <qty>4</qty>
          <unit>medium</unit></amt>
        <item>Chicken breast halves; (1 1/2 lbs total), skinned, boned, and cut into 1-inch strips*</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>can</unit></amt>
        <item>(14-oz) tomatoes; cut up**</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>cup</unit></amt>
        <item>Low sodium chili sauce</item></ing>
      <ing>
        <amt>
          <qty>1 1/2</qty>
          <unit>cups</unit></amt>
        <item>Chopped green pepper; (1 large)</item></ing>
      <ing>
        <amt>
          <qty>1/2</qty>
          <unit>cups</unit></amt>
        <item>Chopped celery</item></ing>
      <ing>
        <amt>
          <qty>1/4</qty>
          <unit>cups</unit></amt>
        <item>Chopped onion</item></ing>
      <ing>
        <amt>
          <qty>2</qty>
          <unit/></amt>
        <item>Cloves garlic; minced</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>tablespoon</unit></amt>
        <item>Chopped fresh basil or 1 tsp dried basil; crushed</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>tablespoon</unit></amt>
        <item>Chopped fresh parsley or 1 tsp dried parsley</item></ing>
      <ing>
        <amt>
          <qty>1/4</qty>
          <unit>teaspoons</unit></amt>
        <item>Crushed red pepper</item></ing>
      <ing>
        <amt>
          <qty>1/4</qty>
          <unit>teaspoons</unit></amt>
        <item>Salt</item></ing>
      <ing>
        <amt>
          <qty/>
          <unit/></amt>
        <item>Nonstick spray coating</item></ing></ingredients>
    <directions>
      <step>  Spray deep skillet with nonstick spray coating. Preheat pan over high heat.
  Cook chicken in hot skillet, stirring, for 3 to 5 minutes, or until no
  longer pink.

  Reduce heat. Add tomatoes and their juice, low sodium chili sauce, green
  pepper, celery, onion, garlic, basil, parsley, crushed red pepper, and
  salt. Bring to boiling; reduce heat and simmer, covered, for 10 minutes.
  Serve over hot cooked rice or whole wheat pasta.

  *You can substitute 1 lb boneless, skinless, chicken breasts, cut into
  l-inch strips, if desired.

  **To cut back on sodium, try low sodium canned tomatoes

  Makes 4 servings

  Posted to recipelu-digest by molony <molony@scsn.net> on Mar 13, 1998

</step></directions></recipe></recipeml>


text:
module Types
  class SiteStudyExtendedGenericSectionType < Types::BaseObject
    field :hide, Boolean, null: false
    field :kind, String, null: false
    field :title, String, null: false
    field :order, Int, null: true
    field :name, String, null: false
    field :template, String, null: true

    def hide
      return object[:hide] == "true" if object[:hide].is_a?(String)

      object[:hide]
    end

  end
end


text:
#ifndef _BTRFS_SYSFS_H_
#define _BTRFS_SYSFS_H_

enum btrfs_feature_set {
	FEAT_COMPAT,
	FEAT_COMPAT_RO,
	FEAT_INCOMPAT,
	FEAT_MAX
};

#define __INIT_KOBJ_ATTR(_name, _mode, _show, _store)			\
{									\
	.attr	= { .name = __stringify(_name), .mode = _mode },	\
	.show	= _show,						\
	.store	= _store,						\
}

#define BTRFS_ATTR_RW(_name, _mode, _show, _store)			\
static struct kobj_attribute btrfs_attr_##_name =			\
			__INIT_KOBJ_ATTR(_name, _mode, _show, _store)
#define BTRFS_ATTR(_name, _mode, _show)					\
	BTRFS_ATTR_RW(_name, _mode, _show, NULL)
#define BTRFS_ATTR_PTR(_name)    (&btrfs_attr_##_name.attr)

#define BTRFS_RAID_ATTR(_name, _show)					\
static struct kobj_attribute btrfs_raid_attr_##_name =			\
			__INIT_KOBJ_ATTR(_name, 0444, _show, NULL)
#define BTRFS_RAID_ATTR_PTR(_name)    (&btrfs_raid_attr_##_name.attr)

struct btrfs_feature_attr {
	struct kobj_attribute kobj_attr;
	enum btrfs_feature_set feature_set;
	u64 feature_bit;
};

#define BTRFS_FEAT_ATTR(_name, _feature_set, _prefix, _feature_bit)	     \
static struct btrfs_feature_attr btrfs_attr_##_name = {			     \
	.kobj_attr = __INIT_KOBJ_ATTR(_name, S_IRUGO,			     \
				      btrfs_feature_attr_show,		     \
				      btrfs_feature_attr_store),	     \
	.feature_set	= _feature_set,					     \
	.feature_bit	= _prefix ##_## _feature_bit,			     \
}
#define BTRFS_FEAT_ATTR_PTR(_name)    (&btrfs_attr_##_name.kobj_attr.attr)

#define BTRFS_FEAT_ATTR_COMPAT(name, feature) \
	BTRFS_FEAT_ATTR(name, FEAT_COMPAT, BTRFS_FEATURE_COMPAT, feature)
#define BTRFS_FEAT_ATTR_COMPAT_RO(name, feature) \
	BTRFS_FEAT_ATTR(name, FEAT_COMPAT_RO, BTRFS_FEATURE_COMPAT, feature)
#define BTRFS_FEAT_ATTR_INCOMPAT(name, feature) \
	BTRFS_FEAT_ATTR(name, FEAT_INCOMPAT, BTRFS_FEATURE_INCOMPAT, feature)

/* convert from attribute */
#define to_btrfs_feature_attr(a) \
			container_of(a, struct btrfs_feature_attr, kobj_attr)
#define attr_to_btrfs_attr(a) container_of(a, struct kobj_attribute, attr)
#define attr_to_btrfs_feature_attr(a) \
			to_btrfs_feature_attr(attr_to_btrfs_attr(a))
char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags);
extern const char * const btrfs_feature_set_names[3];
extern struct kobj_type space_info_ktype;
extern struct kobj_type btrfs_raid_ktype;
#endif /* _BTRFS_SYSFS_H_ */


text:
class ViewSet:
    """
    Defines a viewset to be registered with the Wagtail admin.

    :param name: A name for this viewset, used as the URL namespace.
    :param url_prefix: A URL path element, given as a string, that the URLs for this viewset
        will be found under. Defaults to the same as ``name``.

    All other keyword arguments will be set as attributes on the instance.
    """

    def __init__(self, name, **kwargs):
        self.name = name
        self.url_prefix = kwargs.pop("url_prefix", self.name)

        for key, value in kwargs.items():
            setattr(self, key, value)

    def on_register(self):
        """
        Called when the viewset is registered; subclasses can override this to perform additional setup.
        """
        pass

    def get_urlpatterns(self):
        """
        Returns a set of URL routes to be registered with the Wagtail admin.
        """
        return []

    def get_url_name(self, view_name):
        """
        Returns the namespaced URL name for the given view.
        """
        return self.name + ":" + view_name


text:
package com.hea3ven.tools.commonutils.mod;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.ContainerProvider;
import net.minecraft.container.Container;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;

@Environment(EnvType.CLIENT)
public interface ScreenFactory<T extends Container, U extends Screen & ContainerProvider<T>> {
    U create(T container, PlayerInventory playerInv, Text name);
}


text:
<?php

declare(strict_types=1);

namespace Bazinga\GeocoderBundle\ProviderFactory;

use Geocoder\Provider\Here\Here;
use Geocoder\Provider\Provider;
use Http\Discovery\HttpClientDiscovery;
use Psr\Http\Client\ClientInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

final class HereFactory extends AbstractFactory
{
    protected static $dependencies = [
        ['requiredClass' => Here::class, 'packageName' => 'geocoder-php/here-provider'],
    ];

    /**
     * @param array{app_key: ?string, app_id: ?string, app_code: ?string, use_cit: bool, http_client: ?ClientInterface, httplug_client: ?ClientInterface} $config
     */
    protected function getProvider(array $config): Provider
    {
        if (empty($config['app_key']) && empty($config['app_id']) && empty($config['app_code'])) {
            throw new \InvalidArgumentException('No authentication key provided. Here requires app_key or app_code and app_id.');
        }

        $httpClient = $config['http_client'] ?? $config['httplug_client'] ?? $this->httpClient ?? HttpClientDiscovery::find();

        if (!empty($config['app_key'])) {
            if (!method_exists(Here::class, 'createUsingApiKey')) {
                throw new \InvalidArgumentException('Here provider has no support for `creatingUsingApiKey` method.');
            }

            return Here::createUsingApiKey($httpClient, $config['app_key'], $config['use_cit']);
        }

        return new Here($httpClient, $config['app_id'], $config['app_code'], $config['use_cit']);
    }

    protected static function configureOptionResolver(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'httplug_client' => null,
            'http_client' => null,
            'use_cit' => false,
            'app_key' => null,
            'app_id' => null,
            'app_code' => null,
        ]);

        $resolver->setAllowedTypes('httplug_client', ['object', 'null']);
        $resolver->setAllowedTypes('http_client', ['object', 'null']);
        $resolver->setAllowedTypes('app_key', ['string', 'null']);
        $resolver->setAllowedTypes('app_id', ['string', 'null']);
        $resolver->setAllowedTypes('app_code', ['string', 'null']);
        $resolver->setAllowedTypes('use_cit', ['bool', 'false']);

        $resolver->setDeprecated('httplug_client', 'willdurand/geocoder-bundle', '5.19', 'The option "httplug_client" is deprecated, use "http_client" instead.');
    }
}


text:
#ifndef _SIGNAL_H
#define _SIGNAL_H
#include  <sys/EfiCdefs.h>
#include  <sys/signal.h>

/*  The type sig_atomic_t is the (possibly volatile-qualified) integer type of
    an object that can be accessed as an atomic entity, even in the presence
    of asynchronous interrupts.

    This, possibly machine specific, type is defined in <machine/signal.h>.
*/

/** @{
    The following three macros expand to constant expressions with distinct
    values that have type compatible with the second argument to, and the
    return value of, the signal function, and whose values compare unequal to
    the address of any declarable function.
**/
#define SIG_IGN   ((__sighandler_t *) 0)
#define SIG_DFL   ((__sighandler_t *) 1)
#define SIG_ERR   ((__sighandler_t *) 3)
/*@}*/

/** @{
    The following macros expand to positive integer constant expressions with
    type int and distinct values that are the signal numbers, each
    corresponding to the specified condition.
    The C95 specification requires these to be macros.
**/
#define SIGINT     __SigInt     ///< receipt of an interactive attention signal
#define SIGILL     __SigIll     ///< detection of an invalid function image, such as an invalid instruction
#define SIGABRT    __SigAbrt    ///< abnormal termination, such as is initiated by the abort function
#define SIGFPE     __SigFpe     ///< an erroneous arithmetic operation, such as zero divide or an operation resulting in overflow
#define SIGSEGV    __SigSegv    ///< an invalid access to storage
#define SIGTERM    __SigTerm    ///< a termination request sent to the program
#define SIGBREAK   __SigBreak   ///< added for Python
#define SIGALRM    __SigAlrm    ///< Added for Posix timer functions
#define SIGVTALRM  __SigVtAlrm  ///< Added for Posix timer functions
#define SIGPROF    __SigProf    ///< Added for Posix timer functions
#define SIGUSR1    __SigUsr1    ///< Added for Posix timer functions
#define SIGUSR2    __SigUsr2    ///< Added for Posix timer functions
#define SIGWINCH   __SigWinch   ///< Added for Posix timer functions
#define SIGPIPE    __SigPipe    ///< Added for Posix timer functions
#define SIGQUIT    __SigQuit    ///< Added for Posix timer functions
#define SIG_LAST   __Sig_Last   ///< One more than the largest signal number
/*@}*/

__BEGIN_DECLS

/** Send a signal.

    The raise function carries out the actions described for signal,
    in <sys/signal.h>, for the signal sig. If a signal handler is called, the
    raise function does not return until after the signal handler does.

    @return   The raise function returns zero if successful,
              or nonzero if unsuccessful.
**/
int raise(int sig);

__END_DECLS

#endif  /* _SIGNAL_H */


text:
module SubphezsHelper
end