text:
import datetime
import random
import sqlite3
import sys
import traceback

import twitter
import yaml
from twitter import TwitterError

DEFAULT_TEMPLATE = u'%(day)s %(month)s родился %(name)s из аниме %(series)s'
MONTHS = [
    u'января',
    u'февраля',
    u'марта',
    u'апреля',
    u'мая',
    u'июня',
    u'июля',
    u'августа',
    u'сентября',
    u'октября',
    u'ноября',
    u'декабря',
]

def load_cfg(fn=None):
    cfg = {}

    with open(fn or 'anibirthdays.yaml', 'r') as fp:
        cfg = yaml.safe_load(fp.read())
    return cfg

def prepare_hashtags(japanese_name):
    return [
        u'#%s生誕祭' % japanese_name,
        u'#%s生誕祭2017' % japanese_name,
    ]

def prepare_series_list(series):
    parts = series.split('\n')

    if len(parts) > 1:
        return ', '.join(parts[:-1]) + u' и ' + parts[-1]
    else:
        return parts[0]

if __name__ == '__main__':
    if len(sys.argv) == 3:
        day = int(sys.argv[1])
        month = int(sys.argv[2])
    else:
        today = datetime.datetime.now()
        day = today.day
        month = today.month

    config = load_cfg()

    api = twitter.Api(
        consumer_key=config['twitter']['key'],
        consumer_secret=config['twitter']['secret'],
        access_token_key=config['twitter']['access_token']['key'],
        access_token_secret=config['twitter']['access_token']['secret'],
    )
    db = sqlite3.connect(config['db'])

    print 'Selecting characters with birthdays on %d/%d...' % (day, month)

    print 'Trying to select important characters...'
    cursor = db.cursor()
    cursor.execute('SELECT name, original_name, series, photo FROM birthdays WHERE '
                   'day = ? AND month = ? AND importance_id = 1', (day, month))
    records = cursor.fetchall()

    if not records:
        print 'Nobody important was found, so we are using regular schmucks...'
        cursor.execute('SELECT name, original_name, series, photo FROM birthdays WHERE '
                       'day = ? AND month = ?', (day, month))
        records = cursor.fetchall()

    random.shuffle(records)

    cursor.execute('SELECT template FROM tweet_templates')
    templates = cursor.fetchall()
    if not templates:
        templates = [DEFAULT_TEMPLATE]
    else:
        templates = map(lambda t: t[0], templates)

    max_tweets = config['twitter'].get('limit', 3)

    for name, original_name, series, photo in records[:max_tweets]:
        print 'Congratulating %s...' % name

        text = random.choice(templates) % {
                'day': day,
                'japanese': original_name,
                'month': MONTHS[month - 1],
                'name': name,
                'series': prepare_series_list(series),
            }

        hashtags = prepare_hashtags(original_name)
        for hashtag in hashtags:
            if len(text) + len(hashtag) + 1 <= 140:
                text += ' ' + hashtag

        if len(text) > 140:
            print 'Text too long: ', text
            continue
        else:
            try:
                api.PostUpdate(text, media=photo)
            except TwitterError:
                print traceback.format_exc()

    print '\nThat\'s it!\n'


text:
const pjson = require("./package.json");

module.exports = {
  plugins: {
    "posthtml-expressions": {
      locals: {
        BASE_URL: process.env.BASE_URL,
        VERSION: pjson.version,
      },
    },
  },
};

redpajama_set_name: RedPajamaGithub


text:
#region License

#endregion License

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace Microsoft.Xna.Framework
{
    [DataContract]
    public struct BoundingBox : IEquatable<BoundingBox>
    {

        #region Public Fields

        [DataMember]
        public Vector3 Min;

        [DataMember]
        public Vector3 Max;

        public const int CornerCount = 8;

        #endregion Public Fields

        #region Public Constructors

        public BoundingBox(Vector3 min, Vector3 max)
        {
            this.Min = min;
            this.Max = max;
        }

        #endregion Public Constructors

        #region Public Methods

        public ContainmentType Contains(BoundingBox box)
        {
            //test if all corner is in the same side of a face by just checking min and max
            if (box.Max.X < Min.X
                || box.Min.X > Max.X
                || box.Max.Y < Min.Y
                || box.Min.Y > Max.Y
                || box.Max.Z < Min.Z
                || box.Min.Z > Max.Z)
                return ContainmentType.Disjoint;

            if (box.Min.X >= Min.X
                && box.Max.X <= Max.X
                && box.Min.Y >= Min.Y
                && box.Max.Y <= Max.Y
                && box.Min.Z >= Min.Z
                && box.Max.Z <= Max.Z)
                return ContainmentType.Contains;

            return ContainmentType.Intersects;
        }

        public void Contains(ref BoundingBox box, out ContainmentType result)
        {
            result = Contains(box);
        }

        public ContainmentType Contains(BoundingFrustum frustum)
        {
            //TODO: bad done here need a fix.
            //Because question is not frustum contain box but reverse and this is not the same
            int i;
            ContainmentType contained;
            Vector3[] corners = frustum.GetCorners();

            // First we check if frustum is in box
            for (i = 0; i < corners.Length; i++)
            {
                this.Contains(ref corners[i], out contained);
                if (contained == ContainmentType.Disjoint)
                    break;
            }

            if (i == corners.Length) // This means we checked all the corners and they were all contain or instersect
                return ContainmentType.Contains;

            if (i != 0)             // if i is not equal to zero, we can fastpath and say that this box intersects
                return ContainmentType.Intersects;

            // If we get here, it means the first (and only) point we checked was actually contained in the frustum.
            // So we assume that all other points will also be contained. If one of the points is disjoint, we can
            // exit immediately saying that the result is Intersects
            i++;
            for (; i < corners.Length; i++)
            {
                this.Contains(ref corners[i], out contained);
                if (contained != ContainmentType.Contains)
                    return ContainmentType.Intersects;

            }

            // If we get here, then we know all the points were actually contained, therefore result is Contains
            return ContainmentType.Contains;
        }

        public ContainmentType Contains(BoundingSphere sphere)
        {
            if (sphere.Center.X - Min.X >= sphere.Radius
                && sphere.Center.Y - Min.Y >= sphere.Radius
                && sphere.Center.Z - Min.Z >= sphere.Radius
                && Max.X - sphere.Center.X >= sphere.Radius
                && Max.Y - sphere.Center.Y >= sphere.Radius
                && Max.Z - sphere.Center.Z >= sphere.Radius)
                return ContainmentType.Contains;

            double dmin = 0;

            double e = sphere.Center.X - Min.X;
            if (e < 0)
            {
                if (e < -sphere.Radius)
                {
                    return ContainmentType.Disjoint;
                }
                dmin += e * e;
            }
            else
            {
                e = sphere.Center.X - Max.X;
                if (e > 0)
                {
                    if (e > sphere.Radius)
                    {
                        return ContainmentType.Disjoint;
                    }
                    dmin += e * e;
                }
            }

            e = sphere.Center.Y - Min.Y;
            if (e < 0)
            {
                if (e < -sphere.Radius)
                {
                    return ContainmentType.Disjoint;
                }
                dmin += e * e;
            }
            else
            {
                e = sphere.Center.Y - Max.Y;
                if (e > 0)
                {
                    if (e > sphere.Radius)
                    {
                        return ContainmentType.Disjoint;
                    }
                    dmin += e * e;
                }
            }

            e = sphere.Center.Z - Min.Z;
            if (e < 0)
            {
                if (e < -sphere.Radius)
                {
                    return ContainmentType.Disjoint;
                }
                dmin += e * e;
            }
            else
            {
                e = sphere.Center.Z - Max.Z;
                if (e > 0)
                {
                    if (e > sphere.Radius)
                    {
                        return ContainmentType.Disjoint;
                    }
                    dmin += e * e;
                }
            }

            if (dmin <= sphere.Radius * sphere.Radius)
                return ContainmentType.Intersects;

            return ContainmentType.Disjoint;
        }

        public void Contains(ref BoundingSphere sphere, out ContainmentType result)
        {
            result = this.Contains(sphere);
        }

        public ContainmentType Contains(Vector3 point)
        {
            ContainmentType result;
            this.Contains(ref point, out result);
            return result;
        }

        public void Contains(ref Vector3 point, out ContainmentType result)
        {
            //first we get if point is out of box
            if (point.X < this.Min.X
                || point.X > this.Max.X
                || point.Y < this.Min.Y
                || point.Y > this.Max.Y
                || point.Z < this.Min.Z
                || point.Z > this.Max.Z)
            {
                result = ContainmentType.Disjoint;
            }//or if point is on box because coordonate of point is lesser or equal
            else if (point.X == this.Min.X
                || point.X == this.Max.X
                || point.Y == this.Min.Y
                || point.Y == this.Max.Y
                || point.Z == this.Min.Z
                || point.Z == this.Max.Z)
                result = ContainmentType.Intersects;
            else
                result = ContainmentType.Contains;

        }

        public static BoundingBox CreateFromPoints(IEnumerable<Vector3> points)
        {
            if (points == null)
                throw new ArgumentNullException();

            // TODO: Just check that Count > 0
            bool empty = true;
            Vector3 vector2 = new Vector3(float.MaxValue);
            Vector3 vector1 = new Vector3(float.MinValue);
            foreach (Vector3 vector3 in points)
            {
                vector2 = Vector3.Min(vector2, vector3);
                vector1 = Vector3.Max(vector1, vector3);
                empty = false;
            }
            if (empty)
                throw new ArgumentException();

            return new BoundingBox(vector2, vector1);
        }

        public static BoundingBox CreateFromSphere(BoundingSphere sphere)
        {
            Vector3 vector1 = new Vector3(sphere.Radius);
            return new BoundingBox(sphere.Center - vector1, sphere.Center + vector1);
        }

        public static void CreateFromSphere(ref BoundingSphere sphere, out BoundingBox result)
        {
            result = BoundingBox.CreateFromSphere(sphere);
        }

        public static BoundingBox CreateMerged(BoundingBox original, BoundingBox additional)
        {
            return new BoundingBox(
                Vector3.Min(original.Min, additional.Min), Vector3.Max(original.Max, additional.Max));
        }

        public static void CreateMerged(ref BoundingBox original, ref BoundingBox additional, out BoundingBox result)
        {
            result = BoundingBox.CreateMerged(original, additional);
        }

        public bool Equals(BoundingBox other)
        {
            return (this.Min == other.Min) && (this.Max == other.Max);
        }

        public override bool Equals(object obj)
        {
            return (obj is BoundingBox) ? this.Equals((BoundingBox)obj) : false;
        }

        public Vector3[] GetCorners()
        {
            return new Vector3[] {
                new Vector3(this.Min.X, this.Max.Y, this.Max.Z),
                new Vector3(this.Max.X, this.Max.Y, this.Max.Z),
                new Vector3(this.Max.X, this.Min.Y, this.Max.Z),
                new Vector3(this.Min.X, this.Min.Y, this.Max.Z),
                new Vector3(this.Min.X, this.Max.Y, this.Min.Z),
                new Vector3(this.Max.X, this.Max.Y, this.Min.Z),
                new Vector3(this.Max.X, this.Min.Y, this.Min.Z),
                new Vector3(this.Min.X, this.Min.Y, this.Min.Z)
            };
        }

        public void GetCorners(Vector3[] corners)
        {
            if (corners == null)
            {
                throw new ArgumentNullException("corners");
            }
            if (corners.Length < 8)
            {
                throw new ArgumentOutOfRangeException("corners", "Not Enought Corners");
            }
            corners[0].X = this.Min.X;
            corners[0].Y = this.Max.Y;
            corners[0].Z = this.Max.Z;
            corners[1].X = this.Max.X;
            corners[1].Y = this.Max.Y;
            corners[1].Z = this.Max.Z;
            corners[2].X = this.Max.X;
            corners[2].Y = this.Min.Y;
            corners[2].Z = this.Max.Z;
            corners[3].X = this.Min.X;
            corners[3].Y = this.Min.Y;
            corners[3].Z = this.Max.Z;
            corners[4].X = this.Min.X;
            corners[4].Y = this.Max.Y;
            corners[4].Z = this.Min.Z;
            corners[5].X = this.Max.X;
            corners[5].Y = this.Max.Y;
            corners[5].Z = this.Min.Z;
            corners[6].X = this.Max.X;
            corners[6].Y = this.Min.Y;
            corners[6].Z = this.Min.Z;
            corners[7].X = this.Min.X;
            corners[7].Y = this.Min.Y;
            corners[7].Z = this.Min.Z;
        }

        public override int GetHashCode()
        {
            return this.Min.GetHashCode() + this.Max.GetHashCode();
        }

        public bool Intersects(BoundingBox box)
        {
            bool result;
            Intersects(ref box, out result);
            return result;
        }

        public void Intersects(ref BoundingBox box, out bool result)
        {
            if ((this.Max.X >= box.Min.X) && (this.Min.X <= box.Max.X))
            {
                if ((this.Max.Y < box.Min.Y) || (this.Min.Y > box.Max.Y))
                {
                    result = false;
                    return;
                }

                result = (this.Max.Z >= box.Min.Z) && (this.Min.Z <= box.Max.Z);
                return;
            }

            result = false;
            return;
        }

        public bool Intersects(BoundingFrustum frustum)
        {
            return frustum.Intersects(this);
        }

        public bool Intersects(BoundingSphere sphere)
        {
            if (sphere.Center.X - Min.X > sphere.Radius
                && sphere.Center.Y - Min.Y > sphere.Radius
                && sphere.Center.Z - Min.Z > sphere.Radius
                && Max.X - sphere.Center.X > sphere.Radius
                && Max.Y - sphere.Center.Y > sphere.Radius
                && Max.Z - sphere.Center.Z > sphere.Radius)
                return true;

            double dmin = 0;

            if (sphere.Center.X - Min.X <= sphere.Radius)
                dmin += (sphere.Center.X - Min.X) * (sphere.Center.X - Min.X);
            else if (Max.X - sphere.Center.X <= sphere.Radius)
                dmin += (sphere.Center.X - Max.X) * (sphere.Center.X - Max.X);

            if (sphere.Center.Y - Min.Y <= sphere.Radius)
                dmin += (sphere.Center.Y - Min.Y) * (sphere.Center.Y - Min.Y);
            else if (Max.Y - sphere.Center.Y <= sphere.Radius)
                dmin += (sphere.Center.Y - Max.Y) * (sphere.Center.Y - Max.Y);

            if (sphere.Center.Z - Min.Z <= sphere.Radius)
                dmin += (sphere.Center.Z - Min.Z) * (sphere.Center.Z - Min.Z);
            else if (Max.Z - sphere.Center.Z <= sphere.Radius)
                dmin += (sphere.Center.Z - Max.Z) * (sphere.Center.Z - Max.Z);

            if (dmin <= sphere.Radius * sphere.Radius)
                return true;

            return false;
        }

        public void Intersects(ref BoundingSphere sphere, out bool result)
        {
            result = Intersects(sphere);
        }

        public PlaneIntersectionType Intersects(Plane plane)
        {
            PlaneIntersectionType result;
            Intersects(ref plane, out result);
            return result;
        }

        public void Intersects(ref Plane plane, out PlaneIntersectionType result)
        {
            // See http://zach.in.tu-clausthal.de/teaching/cg_literatur/lighthouse3d_view_frustum_culling/index.html

            Vector3 positiveVertex;
            Vector3 negativeVertex;

            if (plane.Normal.X >= 0)
            {
                positiveVertex.X = Max.X;
                negativeVertex.X = Min.X;
            }
            else
            {
                positiveVertex.X = Min.X;
                negativeVertex.X = Max.X;
            }

            if (plane.Normal.Y >= 0)
            {
                positiveVertex.Y = Max.Y;
                negativeVertex.Y = Min.Y;
            }
            else
            {
                positiveVertex.Y = Min.Y;
                negativeVertex.Y = Max.Y;
            }

            if (plane.Normal.Z >= 0)
            {
                positiveVertex.Z = Max.Z;
                negativeVertex.Z = Min.Z;
            }
            else
            {
                positiveVertex.Z = Min.Z;
                negativeVertex.Z = Max.Z;
            }

            var distance = Vector3.Dot(plane.Normal, negativeVertex) + plane.D;
            if (distance > 0)
            {
                result = PlaneIntersectionType.Front;
                return;
            }

            distance = Vector3.Dot(plane.Normal, positiveVertex) + plane.D;
            if (distance < 0)
            {
                result = PlaneIntersectionType.Back;
                return;
            }

            result = PlaneIntersectionType.Intersecting;
        }

        public Nullable<float> Intersects(Ray ray)
        {
            return ray.Intersects(this);
        }

        public void Intersects(ref Ray ray, out Nullable<float> result)
        {
            result = Intersects(ray);
        }

        public static bool operator ==(BoundingBox a, BoundingBox b)
        {
            return a.Equals(b);
        }

        public static bool operator !=(BoundingBox a, BoundingBox b)
        {
            return !a.Equals(b);
        }

        public override string ToString()
        {
            return string.Format("{{Min:{0} Max:{1}}}", this.Min.ToString(), this.Max.ToString());
        }

        #endregion Public Methods
    }
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model frontend\models\Profile */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?//= $form->field($model, 'user_id')->textInput(['maxlength' => true]) ?>

    <?//= $form->field($model, 'first_name')->textInput(['maxlength' => true]) ?>

    <?//= $form->field($model, 'last_name')->textInput(['maxlength' => true]) ?>

    <?//= $form->field($model, 'birthdate')->textInput() ?>

    <?//= $form->field($model, 'avatar')->textInput(['maxlength' => true]) ?>

    <?//= $form->field($model, 'filename')->textInput(['maxlength' => true]) ?>

    <?//= $form->field($model, 'gender_id')->textInput() ?>

    <?//= $form->field($model, 'created_at')->textInput() ?>

    <?//= $form->field($model, 'updated_at')->textInput() ?>

    <?= $form->field($model, 'first_name')->textInput(['maxlength' => 45]) ?>
    <?= $form->field($model, 'last_name')->textInput(['maxlength' => 45]) ?>

    <?= $form->field($model, 'birthdate')->textInput() ?>
    * please use YYYY-MM-DD format

    <?= $form->field($model, 'gender_id')->dropDownList($model->genderList,
    ['prompt' => 'Please Choose One' ]);?>

    <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update',
    ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
package colutils.cli;

import java.lang.HashMap;

public class Menu<T> {
    public Menu(String title) {
        this.title = title;
        this.options = new HashMap();
    }

/* === Instance Methods === */

    /* Add an option to [this] Menu */
    public void option(String desc, String name, T value) {
        if (!options.containsKey(desc)) {
            options.put(name, new Option(desc, value));
        }
    }

    /* Show [this] Menu, and return the chosen option */
    public T show() {
        Prompt p = new Prompt()
    }

    private OutputString buildMessage() {
        OutputString s = new OutputString();
        s.leading("-");
        s.append( title );
        s.indent( 4 );
        s.newline();
        Option<T> longest = getLongestOption();
        for (String name : options.keySet()) {
            Option<T> opt = options.get(name);
            int dif = (longest.description.length - opt.description.length);
            s.repeat("-", dif);
            s.append( opt.description );
            s.repeat(".", 8);
            s.append()
        }
    }

    private Option<T> getLongestOption() {
        Option<T> longest = null;
        for (Option<T> o : options) {
            if (longest == null || o.description.length > longest.description.length)
                longest = o;
        }
        return longest;
    }

/* === Instance Fields === */

    private String title;
    private HashMap<String, Option<T>> options;
}

class Option<T> {
    public String description;
    public T value;

    /**
     * Constructor
     */
    public Option(String desc, T val) {
        description = desc;
        value = val;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Newtonsoft.Json;

namespace WebApp_OpenIDConnect_DotNet_B2C.Models
{
    public class Users
    {
        [JsonProperty(PropertyName = "id")]
        public string Id { get; set; }

        [JsonProperty(PropertyName = "identityProvider")]
        public string IdentityProvider { get; set; }

        [JsonProperty(PropertyName = "displayName")]
        public string DisplayName { get; set; }

        [JsonProperty(PropertyName = "givenName")]
        public string GivenName { get; set; }

        [JsonProperty(PropertyName = "surname")]
        public string Surname { get; set; }

        [JsonProperty(PropertyName = "city")]
        public string City { get; set; }

        [JsonProperty(PropertyName = "country")]
        public string Country { get; set; }

        [JsonProperty(PropertyName = "email")]
        public string Email { get; set; }

        [JsonProperty(PropertyName = "lastLogin")]
        public string LastLogin { get; set; }

        [JsonProperty(PropertyName = "disabled")]
        public bool Disabled { get; set; }
    }
}


text:
import * as React from 'react';
import styled from 'styled-components';
import Heading from 'components/Heading';
import { Row, Col, Form, FormControl } from 'react-bootstrap';
import { History } from 'history';

const MainContainer = styled(Col)`
  background-color: #eaedf4;
  min-height: 100vh;
  padding-top: 50px;
  padding-bottom: 00px;
  .center {
    text-align: center;
  }
  #query {
    box-shadow: 0px 2px 25px rgba(0, 0, 0, 0.25);
    border: none;
    font-size: 12pt;
    max-width: 120em;
  }
`;

/* const HASH_MUTATION = gql`
  mutation LandingSearchPageHashMutation($q: SearchQueryInput!) {
    provisionSearchHash(input: { params: { q: $q, page: 0, pageSize: 25 } }) {
      searchHash {
        short
      }
    }
  }
`;
 */
interface LandingPageProps {
  history: History;
}
interface LandingPageState {
  searchTerm: string;
}

class LandingPage extends React.PureComponent<
  LandingPageProps,
  LandingPageState
> {
  state: LandingPageState = {
    searchTerm: '',
  };
/*   onSubmit = async (e, client: ApolloClient<any>) => {
    e.preventDefault();
    let params = {};
    if (this.state.searchTerm.replace(/\s/g, '').length) {
      params = {
        q: { key: 'AND', children: [{ key: this.state.searchTerm }] },
      };
    } else {
      params = { q: { key: 'AND', children: [] } };
    }
    const { data } = await client.mutate({
      mutation: HASH_MUTATION,
      variables: params,
    });
    this.props.history.push(
      `/search/default/${data.provisionSearchHash!.searchHash!.short}`
    );
  }; */
  searchChanged = e => {
    this.setState({ searchTerm: e.target.value });
  };
/*   renderMain = (client: ApolloClient<any>) => (
    <MainContainer>
      <Heading> </Heading>

        <Row className="justify-content-md-center">
          <Col md={3} />
          <Col md={6}>
            <Form className="center" onSubmit={e => this.onSubmit(e, client)}>
              <FormControl
                id="query"
                onChange={this.searchChanged}
                placeholder="Enter a Search: ex) 'Glioblastoma or Musella Foundation'"
              />
            </Form>
          </Col>
        </Row>

    </MainContainer>

  render() {
    return <ApolloConsumer>{client => this.renderMain(client)}</ApolloConsumer>;
  } */

  render (){
    return
Landing Page NOT ACTIVE

  }
}

export default LandingPage;


text:
require 'test_helper'

module AnypresenceExtension
  class SettingsHelperTest < ActionView::TestCase
  end
end


text:
<bill session="110" type="s" number="2154" updated="2009-01-09T16:18:41-05:00">
	<status><introduced date="1191470400" datetime="2007-10-04"/></status>

	<introduced date="1191470400" datetime="2007-10-04"/>
	<titles>
		<title type="short" as="introduced">Local Officials Tax Relief Act of 2007</title>
		<title type="official" as="introduced">A bill to amend the Social Security Act and the Internal Revenue Code of 1986 to exempt certain employment as a member of a local governing board, commission, or committee from social security tax coverage.</title>
	</titles>
	<sponsor id="300058"/>
	<cosponsors>
		<cosponsor id="300066" joined="2008-05-13"/>
		<cosponsor id="300037" joined="2007-11-16"/>
		<cosponsor id="400546" joined="2007-10-04"/>
		<cosponsor id="300026" joined="2007-10-04"/>
	</cosponsors>
	<actions>
		<action date="1191470400" datetime="2007-10-04"><text>Read twice and referred to the Committee on Finance.</text></action>
	</actions>
	<committees>

	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>
	<summary>
	10/4/2007--Introduced.<br/>Local Officials Tax Relief Act of 2007 - Amends the Internal Revenue Code and Title II (Old Age, Survivors, and Disability Insurance) of the Social Security Act to exempt from social security taxes remuneration paid to any elected or appointed member of any general governing board, commission, or committee of any political subdivision of a state if such remuneration is not more than $1,300 and is paid for service performed on or after January 1, 2008.
	</summary>
</bill>


text:
`feed` is a [Grav](http://github.com/getgrav/grav) plugin and allows Grav to generate feeds of your pages.

This plugin supports both __Atom 1.0__ and __RSS__ feed types. Enabling is very simple. just install this plugin in the `/user/plugins/`` folder in your Grav install. By default, the plugin is enabled and provides some default values.

# Installation

To install this plugin, just download the zip version of this repository and unzip it under `/your/site/grav/user/plugins`. Then, rename the folder to `feed`.

You should now have all the plugin files under

	/your/site/grav/user/plugins/feed

>> NOTE: This plugin is a modular component for Grav which requires [Grav](http://github.com/getgrav/grav), the [Error](https://github.com/getgrav/grav-plugin-error) and [Problems](https://github.com/getgrav/grav-plugin-problems) plugins, and a theme to be installed in order to operate.

# Usage

The feeds work for pages that have sub-pages, for example a blog list view. If your page has a `sub_pages` header variable that defines a taxonomy or `true` to display sub-pages, then the RSS plugin will automatically be enabled. Simply append either `feed:atom` or `feed:rss` to the url.

eg:

```
http://www.mysite.com/blog/feed:atom
```

# Config Defaults

```
limit: 10
description: My Feed Description
lang: en-us
length: 500
```

You can override any of the default values by setting one or more of these in your blog list page where `sub_pages` is defined. For example:

```
title: Sample Blog
content:
    items: @self.children
    limit: 5
    pagination: true
feed:
    limit: 15
    description: Sample Blog Description
```


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MoveFileCommand = void 0;
const BaseCommand_1 = require("./BaseCommand");
class MoveFileCommand extends BaseCommand_1.BaseCommand {
    async execute(uri) {
        const dialogOptions = { prompt: "New Location", showFullPath: true, uri };
        const fileItem = await this.controller.showDialog(dialogOptions);
        await this.executeController(fileItem);
    }
}
exports.MoveFileCommand = MoveFileCommand;


text:
import distutils
import os
import setuptools

def read(filename):
    """Utility function that returns a files contents."""
    return open(os.path.join(os.path.dirname(__file__), filename)).read()

setuptools.setup(
    name="python-chess",
    version="0.1.0",
    author="Niklas Fiekas",
    author_email="niklas.fiekas@tu-clausthal.de",
    description="A chess library.",
    long_description=read("README.rst"),
    license="GPL3",
    keywords="chess fen pgn polyglot",
    url="http://github.com/niklasf/python-chess",
    packages=["chess"],
    scripts=["scripts/ecotool", "scripts/python-chess"],
    classifiers=[
        "Development Status :: 2 - Pre-Alpha",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: GNU General Public License (GPL)",
        "Operating System :: OS Independent",
        "Programming Language :: Python",
        "Topic :: Games/Entertainment :: Board Games",
        "Topic :: Software Development :: Libraries :: Python Modules",
    ],
)


text:
var dynamicIframe ={
	init:function(){

		this.dynamicheightSwitch=$('#ccm-dynamiciframe-dynamicheight');
		this.dynamicheightSwitch.click(function(){ dynamicIframe.dynamicheightShown(this); });
		this.dynamicheightSwitch.change(function(){ dynamicIframe.dynamicheightShown(this); });

	},

	dynamicheightShown:function(sel){
		var f1=$('#ccm-dynamiciframe-height');
		var f2=$('#ccm-dynamiciframe-adjustheight');
		var f3=$('#ccm-dynamiciframe-errorheight');
		var f4=$('#ccm-dynamiciframe-forcecalcallheight');

		if(sel.value==0){
			f1.attr('disabled',false);
			f2.attr('disabled',true);
			f3.attr('disabled',true);
			f4.attr('disabled',true);
		}else{
			f1.attr('disabled',true);
			f2.attr('disabled',false);
			f3.attr('disabled',false);
			f4.attr('disabled',false);
		}
	},

	validate:function(){
		var failed=0;

		var vUrlF=$('#ccm-dynamiciframe-url');
		var vIdF=$('#ccm-dynamiciframe-id');
		var vWidthF=$('#ccm-dynamiciframe-width');

		var vUrlV=vUrlF.val();
		var vIdV=vIdF.val();
		var vWidthV=vWidthF.val();

 		if(!vUrlV || vUrlV.length==0 ){
			alert(ccm_t('dynamiciframe-url'));
			vUrlF.focus();
			failed=1;
		}
		else if(!vIdV || vIdV.length==0){
			alert(ccm_t('dynamiciframe-id'));
			vIdF.focus();
			failed=1;
		}
		else if(!vWidthV || vWidthV.length==0){
			alert(ccm_t('dynamiciframe-width'));
			vWidthF.focus();
			failed=1;
		}

		if(failed){
			ccm_isBlockError=1;
			return false;
		}
		else {
			return true;
		}
	}
}

$(function(){ dynamicIframe.init(); });

ccmValidateBlockForm = function() { return dynamicIframe.validate(); }


text:
//
//  DateUtils.h
//  StartupsViz
//
//  Created by Mathur, Arpit on 7/18/13.
//
//

#ifndef __StartupsViz__DateUtils__
#define __StartupsViz__DateUtils__

#include <iostream>

int differenceInDays(int endDay, int endMonth, int endYear, int startDay, int startMonth, int startYear);

#endif /* defined(__StartupsViz__DateUtils__) */


text:
class CreateForumModerators < ActiveRecord::Migration
  def change
    create_table :forum_moderators do |t|
      t.references :forum, index: true, foreign_key: true
      t.references :user, index: true, foreign_key: true

      t.timestamps null: false
    end
  end
end


text:
package com.georges.grape.config;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.core.io.ClassPathResource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
import org.springframework.jdbc.datasource.init.DatabasePopulator;
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.social.connect.Connection;
import org.springframework.social.connect.ConnectionRepository;
import org.springframework.social.connect.UsersConnectionRepository;
import org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository;
import org.springframework.social.facebook.api.Facebook;
import org.springframework.social.facebook.api.impl.FacebookTemplate;
import org.springframework.social.twitter.api.Twitter;
import org.springframework.social.twitter.api.impl.TwitterTemplate;
import org.springframework.transaction.PlatformTransactionManager;

import com.georges.social.qq.api.QQ;
import com.georges.social.qq.api.impl.QQTemplate;
import com.georges.social.weibo.api.Weibo;
import com.georges.social.weibo.api.impl.WeiboTemplate;

@Configuration
/*@ImportResource(
	   {"classpath:com/georges/grape/config/spring-jdbc.xml",
		"classpath:com/georges/grape/config/spring-mongodb.xml",
		"classpath:com/georges/grape/config/spring-social.xml",
		"classpath:com/georges/grape/config/spring-rest.xml",
		"classpath:com/georges/grape/config/spring-security.xml"})*/
public class MainConfig {

	@Autowired
	UsersConnectionRepository usersConnectionRepository;

	@Bean
	@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
	public ConnectionRepository connectionRepository() {
		Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
		if (authentication == null) {
			throw new IllegalStateException("Unable to get a ConnectionRepository: no user signed in");
		}
		return usersConnectionRepository.createConnectionRepository(authentication.getName());
	}

	@Bean
	@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
	public Facebook facebook() {
		Connection<Facebook> facebook =connectionRepository().findPrimaryConnection(Facebook.class);
		return facebook != null ? facebook.getApi() : new FacebookTemplate();
	}

	@Bean
	@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
	public Twitter twitter() {
		Connection<Twitter> twitter = connectionRepository().findPrimaryConnection(Twitter.class);
		return twitter != null ? twitter.getApi() : new TwitterTemplate();
	}

	@Bean
	@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
	public QQ qq() {
		Connection<QQ> qq = connectionRepository().findPrimaryConnection(QQ.class);
		return qq != null ? qq.getApi() : new QQTemplate();
	}

	@Bean
	@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
	public Weibo weibo() {
		Connection<Weibo> weibo = connectionRepository().findPrimaryConnection(Weibo.class);
		return weibo != null ? weibo.getApi() : new WeiboTemplate();
	}

}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Customer_Business_Type extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->helper(array('url', 'form'));
		$this->load->library('form_validation','Excel_reader');
		$this->load->model(array('CustomerBusinessModel', 'm_login'));
		$this->auth->cek_auth();
	}

	public function index()
	{
		$ambil_akun = $this->m_login->ambil_user($this->session->userdata('uname'));
		$data = array(
					'user' => $ambil_akun
				);
		$stat = $this->session->userdata('lvl');
        if($stat==1){//admin
            //$data['gps'] = $this->GpsTypeModel->getGpsType();
            $data['content'] = 'superAdmin-modul/dashboard_admin';
            $this->load->view('superAdmin-modul/template', $data);
        }elseif($stat==2){ //user
            //$data['gps'] = $this->GpsTypeModel->getGpsType();
            $data['content'] = 'admin-modul/dashboard_admin';
            $this->load->view('admin-modul/template',$data);
        }else{
            //$data['gps'] = $this->GpsTypeModel->getGpsType();
            $data['content'] = 'user-modul/dashboard/dashboard_user';
            $this->load->view('user-modul/template',$data);
        }
	}

	public function customer_business_type_list()
	{
		$ambil_akun = $this->m_login->ambil_user($this->session->userdata('uname'));
		$data = array(
			'user'	=> $ambil_akun,
			);

		$stat = $this->session->userdata('lvl');
        if($stat==1){//admin
            $data['customer_business'] = $this->CustomerBusinessModel->getData()->result_object();
            $data['content'] = 'superAdmin-modul/customer_business/customer_business';
            $this->load->view('superAdmin-modul/template', $data);
        }elseif($stat==2){ //user
            $data['customer_business'] = $this->CustomerBusinessModel->getData()->result_object();
            $data['content'] = 'admin-modul/customer_business/customer_business';
            $this->load->view('admin-modul/template',$data);
        }else{
            $data['customer_business'] = $this->CustomerBusinessModel->getData()->result_object();
            $data['content'] = 'user-modul/customer_business/customer_business';
            $this->load->view('user-modul/template',$data);
        }
	}

    /////////////////////////////////////////////////////////////////// Start Validate Form ///////////////////////////////////////////////////////////////
    private function _validate()
    {
        $data = array();
        $data['error_string'] = array();
        $data['inputerror'] = array();
        $data['status'] = TRUE;

        if($this->input->post('cust_business_name') == '')
        {
            $data['inputerror'][] = 'cust_business_name';
            $data['error_string'][] = 'Business Type Name is required';
            $data['status'] = FALSE;
        }

        if($data['status'] === FALSE)
        {
            echo json_encode($data);
            exit();
        }
    }
    /////////////////////////////////////////////////////////////////// End Validate Form ///////////////////////////////////////////////////////////////

	/////////////////////////////////////////////////////////////////// Start Proses Save Department ///////////////////////////////////////////////////////////////
    public function ajax_add()
    {
        $this->_validate();

        $h = $_SESSION['uname'];
        $i = date('Y-m-d H:i:s');

        $data = array(
                    'cust_business_type_name' => $this->input->post('cust_business_name'),
                    'cust_business_type_insert' => $i,
                    'cust_business_type_update' => $i,
                    'cust_business_type_user' => $h
                );

        $this->CustomerBusinessModel->insert_data($data);
        echo json_encode(array("status" => TRUE));
    }
    /////////////////////////////////////////////////////////////////// End Proses Save Department ///////////////////////////////////////////////////////////////

    /*public function process_insert()
	{
		$h = $_SESSION['uname'];
        $i = date('Y-m-d H:i:s');

        $data = array(
					'cust_business_type_name' => $this->input->post('cust_business_name'),
                    'cust_business_type_insert' => $i,
                    'cust_business_type_update' => $i,
                    'cust_business_type_user' => $h
				);
		$this->CustomerBusinessModel->insert_data($data);
		$this->session->set_flashdata('info', '
Data berhasil disimpan!!...<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
');
		redirect('customer_business_type/customer_business_type_list','refresh');
	}

	public function process_insert1()
	{
		$h = $_SESSION['uname'];
        $i = date('Y-m-d H:i:s');

        $data = array(
					'cust_business_type_name' => $this->input->post('cust_business_name'),
                    'cust_business_type_insert' => $i,
                    'cust_business_type_update' => $i,
                    'cust_business_type_user' => $h
				);
		$this->CustomerBusinessModel->insert_data($data);
		$this->session->set_flashdata('info', '
Data berhasil disimpan!!...<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
');
		redirect('customer/customer_list','refresh');
	}*/

	public function ajax_edit($id)
    {
        $data = $this->db->get_where('customer_business_type',array('cust_business_type_id' => $id))->row();
        echo json_encode($data);
    }

    public function ajax_update()
    {
        $this->_validate();

        $id = $this->input->post('id');
        $data = array(
                'cust_business_type_name' => $this->input->post('cust_business_name'),
                'cust_business_type_update' => date('Y-m-d H:i:s'),
                'cust_business_type_user' => $_SESSION['name']
            );

        $this->db->where('cust_business_type_id', $id);
        $this->db->update('customer_business_type', $data);

        echo json_encode(array("status" => TRUE));
    }

    /////////////////////////////////////////////////////////////////// Start Proses Delete Customer Business Type ///////////////////////////////////////////////////////////////
    public function ajax_delete($id)
    {
        $this->CustomerBusinessModel->delete_data($id);
        echo json_encode(array("status" => TRUE));
    }
    /////////////////////////////////////////////////////////////////// End Proses Delete Customer Business Type ///////////////////////////////////////////////////////////////

	/*public function update($id)
	{
		$ambil_akun = $this->m_login->ambil_user($this->session->userdata('uname'));
		$data = array(
			'user'	=> $ambil_akun,
			);

		$stat = $this->session->userdata('lvl');
        if($stat==1){//admin
            $data['data']	= $this->db->get_where('customer_business_type',array('cust_business_type_id' => $id))->row();
            $data['content'] = 'superAdmin-modul/customer_business/form_edit';
            $this->load->view('superAdmin-modul/template', $data);
        }elseif($stat==2){ //user
            $data['data']	= $this->db->get_where('customer_business_type',array('cust_business_type_id' => $id))->row();
            $data['content'] = 'admin-modul/customer_business/form_edit';
            $this->load->view('admin-modul/template',$data);
        }else{
            $data['data']	= $this->db->get_where('customer_business_type',array('cust_business_type_id' => $id))->row();
            $data['content'] = 'user-modul/customer_business/form_edit';
            $this->load->view('user-modul/template',$data);
        }
	}

	public function process_update()
	{
		$id['cust_business_type_id'] = $this->input->post('cust_business_type_id');
        $h = $_SESSION['uname'];
        $i = date('Y-m-d H:i:s');

        $data = array(
					'cust_business_type_name' => $this->input->post('cust_business_name'),
                    'cust_business_type_update' => $i,
                    'cust_business_type_user' =>$h
				);
		$this->CustomerBusinessModel->update_data($data,$id);
		$this->session->set_flashdata('info', '
Data berhasil diupdate!!...<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
');
		redirect('customer_business_type/customer_business_type_list');
	}

	public function process_delete($id)
	{
		$this->CustomerBusinessModel->delete_data($id);
		$this->session->set_flashdata('info', '
Data berhasil dihapus!!...<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
');
		redirect('customer_business_type/customer_business_type_list');
	}*/
}

/* End of file Customer.php */
/* Location: ./application/controllers/Customer.php */


text:
import TextLine from '../../components/TextLine';
import coubVideo from './parsers/coubVideo';
import facebookVideo from './parsers/facebookVideo';
import googleMaps from './parsers/googleMaps';
import HTML5VideoAudioTags from './parsers/HTML5VideoAudioTags';
import soundCloudAudio from './parsers/soundCloudAudio';
import twitchVideo from './parsers/twitchVideo';
import vimeoVideo from './parsers/vimeoVideo';
import vkVideo from './parsers/vkVideo';
import yandexMusicAudio from './parsers/yandexMusicAudio';
import youtubePlaylist from './parsers/youtubePlaylist';
import youtubeVideo from './parsers/youtubeVideo';

export const defaultListOfParsers = [
    coubVideo,
    facebookVideo,
    googleMaps,
    HTML5VideoAudioTags,
    soundCloudAudio,
    twitchVideo,
    vimeoVideo,
    vkVideo,
    yandexMusicAudio,
    youtubePlaylist,
    youtubeVideo
];

const processTextLineContentViaParsers = (textLineComponent, listOfParsers) => {
    const defaultResult = {
        type: 'none',
        success: false,
        url: ''
    };
    if (textLineComponent.type && textLineComponent.type.displayName === TextLine.displayName) {
        const text = textLineComponent.props.children;
        const result = listOfParsers.reduce((previous, current) => {
            if (previous.success) {
                return previous;
            }
            const parserResult = current(text);
            if (parserResult.success) {
                return parserResult;
            }
            return previous;
        }, defaultResult);
        return result;
    }
    return defaultResult;
};

export default processTextLineContentViaParsers;


text:
package scheduler

import (
	"fmt"
	"testing"
	"time"

	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/util/wait"
	"k8s.io/kubernetes/pkg/scheduler"
	schedapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
	"k8s.io/kubernetes/pkg/scheduler/framework"
	"k8s.io/kubernetes/pkg/scheduler/framework/plugins/serviceaffinity"
	st "k8s.io/kubernetes/pkg/scheduler/testing"
	testutils "k8s.io/kubernetes/test/integration/util"
	imageutils "k8s.io/kubernetes/test/utils/image"
)

func TestServiceAffinityEnqueue(t *testing.T) {
	profile := schedapi.KubeSchedulerProfile{
		SchedulerName: v1.DefaultSchedulerName,
		Plugins: &schedapi.Plugins{
			PreFilter: schedapi.PluginSet{
				Enabled: []schedapi.Plugin{
					{Name: serviceaffinity.Name},
				},
			},
			Filter: schedapi.PluginSet{
				Enabled: []schedapi.Plugin{
					{Name: serviceaffinity.Name},
				},
			},
		},
		PluginConfig: []schedapi.PluginConfig{
			{
				Name: serviceaffinity.Name,
				Args: &schedapi.ServiceAffinityArgs{
					AffinityLabels: []string{"hostname"},
				},
			},
		},
	}
	// Use zero backoff seconds to bypass backoffQ.
	testCtx := testutils.InitTestSchedulerWithOptions(
		t,
		testutils.InitTestMaster(t, "serviceaffinity-enqueue", nil),
		nil,
		scheduler.WithProfiles(profile),
		scheduler.WithPodInitialBackoffSeconds(0),
		scheduler.WithPodMaxBackoffSeconds(0),
	)
	testutils.SyncInformerFactory(testCtx)
	// It's intended to not start the scheduler's queue, and hence to
	// not start any flushing logic. We will pop and schedule the Pods manually later.
	defer testutils.CleanupTest(t, testCtx)

	cs, ns, ctx := testCtx.ClientSet, testCtx.NS.Name, testCtx.Ctx
	// Create two Nodes.
	for i := 1; i <= 2; i++ {
		nodeName := fmt.Sprintf("node%d", i)
		capacity := map[v1.ResourceName]string{v1.ResourcePods: "1"}
		node := st.MakeNode().Name(nodeName).Label("hostname", nodeName).Capacity(capacity).Obj()
		if _, err := cs.CoreV1().Nodes().Create(ctx, node, metav1.CreateOptions{}); err != nil {
			t.Fatalf("Failed to create Node %q: %v", nodeName, err)
		}
	}

	// Create a Service.
	svc := &v1.Service{
		ObjectMeta: metav1.ObjectMeta{
			Name: "svc",
		},
		Spec: v1.ServiceSpec{
			Ports:    []v1.ServicePort{{Port: int32(80)}},
			Selector: map[string]string{"foo": "bar"},
		},
	}
	if _, err := cs.CoreV1().Services(ns).Create(ctx, svc, metav1.CreateOptions{}); err != nil {
		t.Fatalf("Failed to create Service %q: %v", svc.Name, err)
	}

	// Create two Pods.
	pause := imageutils.GetPauseImageName()
	for i := 1; i <= 2; i++ {
		podName := fmt.Sprintf("pod%d", i)
		pod := st.MakePod().Namespace(ns).Name(podName).Label("foo", "bar").Container(pause).Obj()
		// Make Pod1 an assigned Pod.
		if i == 1 {
			pod.Spec.NodeName = fmt.Sprintf("node%d", i)
		}
		if _, err := cs.CoreV1().Pods(ns).Create(ctx, pod, metav1.CreateOptions{}); err != nil {
			t.Fatalf("Failed to create Pod %q: %v", pod.Name, err)
		}
	}

	// Wait for pod2 to be present in the scheduling queue.
	if err := wait.Poll(time.Millisecond*200, wait.ForeverTestTimeout, func() (bool, error) {
		return len(testCtx.Scheduler.SchedulingQueue.PendingPods()) == 1, nil
	}); err != nil {
		t.Fatal(err)
	}

	// Pop Pod2 out. It should be unschedulable.
	podInfo := testCtx.Scheduler.NextPod()
	fwk, ok := testCtx.Scheduler.Profiles[podInfo.Pod.Spec.SchedulerName]
	if !ok {
		t.Fatalf("Cannot find the profile for Pod %v", podInfo.Pod.Name)
	}
	// Schedule the Pod manually.
	_, fitError := testCtx.Scheduler.Algorithm.Schedule(ctx, fwk, framework.NewCycleState(), podInfo.Pod)
	// The fitError is expected to be:
	// 0/2 nodes are available: 1 Too many pods, 1 node(s) didn't match service affinity.
	if fitError == nil {
		t.Fatalf("Expect Pod %v to fail at scheduling.", podInfo.Pod.Name)
	}
	testCtx.Scheduler.Error(podInfo, fitError)

	// Scheduling cycle is incremented from 0 to 1 after NextPod() is called, so
	// pass a number larger than 1 to move Pod to unschedulableQ.
	testCtx.Scheduler.SchedulingQueue.AddUnschedulableIfNotPresent(podInfo, 10)

	// Trigger a Service event.
	// We expect this event to trigger moving the test Pod from unschedulableQ to activeQ.
	if err := cs.CoreV1().Services(ns).Delete(ctx, "svc", metav1.DeleteOptions{}); err != nil {
		t.Fatalf("Failed to delete service 'svc': %v", err)
	}

	// Now we should be able to pop the Pod from activeQ again.
	podInfo = testCtx.Scheduler.NextPod()
	if podInfo.Attempts != 2 {
		t.Errorf("Expected the Pod to be attempted 2 times, but got %v", podInfo.Attempts)
	}
}


text:
import { Html } from './elements';

function isArgsEqual(oldArgs: Array<any>, newArgs: Array<any>): boolean {
  const oldLen = oldArgs.length;
  const newLen = newArgs.length;

  if (oldLen !== newLen) {
    return false;
  } else {
    for (let i = 0; i < oldLen; i++) {
      const oldItem = oldArgs[i];
      const newItem = newArgs[i];
      if (oldItem !== newItem) {
        return false;
      }
    }
  }

  return true;
}

export function cachedNode<T>(fn: (...args: Array<any>) => Html<T>) {
  let prevArgs: Array<any> = [];
  let savedHtml: Html<T> = null;

  return function(...args: Array<any>): Html<T> {
    if (savedHtml === null || !isArgsEqual(prevArgs, args)) {
      savedHtml = fn(...args);
    }

    prevArgs = args;
    return savedHtml;
  };
}