text:
require 'minitest/autorun'
require_relative 'simple_linked_list'

class LinkedListTest < Minitest::Test
  def test_element
    element = Element.new(1)
    assert_equal 1, element.datum
  end

  def test_element_can_hold_a_different_value
    skip
    element = Element.new(10)
    assert_equal 10, element.datum
  end

  def test_element_next
    skip
    element = Element.new(1)
    assert_nil element.next
  end

  def test_element_next_can_be_assigned_to
    skip
    first  = Element.new(1)
    second = Element.new(2)
    first.next = second
    assert_equal second, first.next
  end

  def test_list_push
    skip
    list = SimpleLinkedList.new
    element = Element.new(1)
    assert_equal list, list.push(element)
  end

  def test_list_pop
    skip
    list = SimpleLinkedList.new
    element = Element.new(1)
    list.push(element)
    assert_equal element, list.pop
  end

  def test_list_pop_empty
    skip
    list = SimpleLinkedList.new
    assert_nil list.pop
  end

  def test_list_pop_is_last_in_first_out
    skip
    list = SimpleLinkedList.new
    first = Element.new(1)
    second = Element.new(2)
    list.push(first).push(second)
    assert_equal second, list.pop
  end

  def test_list_empty_to_array
    skip
    list = SimpleLinkedList.new
    assert_equal [], list.to_a
  end

  def test_list_single_to_array
    skip
    list = SimpleLinkedList.new
    first = Element.new(1)
    list.push(first)
    assert_equal [1], list.to_a
  end

  def test_list_multiple_to_array
    skip
    list = SimpleLinkedList.new
    first = Element.new(1)
    second = Element.new(2)
    third = Element.new(3)
    list.push(first).push(second).push(third)
    assert_equal [3,2,1], list.to_a
  end

  def test_list_create_from_array
    skip
    array = [1,2,3]
    list = SimpleLinkedList.new(array)
    assert_equal [3,2,1], list.to_a
  end

  def test_list_created_from_array_still_made_up_of_elements
    skip
    array = [1,2,3]
    list = SimpleLinkedList.new(array)
    assert_equal Element, list.pop.class
  end

  def test_list_from_array_still_acts_as_lifo
    skip
    array = [1,2,3]
    list = SimpleLinkedList.new(array)
    element = list.pop
    assert_equal 3, element.datum
  end

  def test_list_in_place_reverse!
    skip
    first = Element.new(1)
    second = Element.new(2)
    third = Element.new(3)
    list = SimpleLinkedList.new
    list.push(first).push(second).push(third)

    assert_equal [1,2,3], list.reverse!.to_a
  end

  def test_list_in_place_reverse_are_the_same_elements
    skip
    first = Element.new(1)
    second = Element.new(2)
    list = SimpleLinkedList.new
    list.push(first).push(second)

    list.reverse!

    assert_equal first, list.pop
    assert_equal second, list.pop
  end

  def test_list_reverse_empty_list
    skip
    list = SimpleLinkedList.new
    assert_equal list, list.reverse!
  end

  def test_works_for_1_through_10
    skip
    list = SimpleLinkedList.new(1..10)
    expected = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
    assert_equal expected, list.to_a
  end

  # Problems in exercism evolve over time, as we find better ways to ask
  # questions.
  # The version number refers to the version of the problem you solved,
  # not your solution.
  #
  # Define a constant named VERSION inside of the top level BookKeeping
  # module.
  #  In your file, it will look like this:
  #
  # module BookKeeping
  #   VERSION = 1 # Where the version number matches the one in the test.
  # end
  #
  # If you are curious, read more about constants on RubyDoc:
  # http://ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/constants.html

  def test_bookkeeping
    skip
    assert_equal 1, BookKeeping::VERSION
  end
end


text:
import { moduleFor, test } from 'ember-qunit'

moduleFor('route:topic/thread', 'Unit | Route | topic/thread', {
  // Specify the other units that are required for this test.
  // needs: ['controller:foo']
})

test('it exists', function(assert) {
  let route = this.subject()
  assert.ok(route)
})

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace Youwe\FileManagerBundle\Events;

use Symfony\Component\EventDispatcher\Event;
use Youwe\FileManagerBundle\Model\FileInfo;

/**
 * Class FileEvent
 * @package Youwe\FileManagerBundle\Events
 */
class FileEvent extends Event
{
    /** @var FileInfo */
    protected $fileInfo;

    /**
     * @param FileInfo|null $fileInfo
     */
    public function __construct(FileInfo $fileInfo = null)
    {
        $this->fileInfo = $fileInfo;
    }

    /**
     * @return string
     */
    public function getFileInfo()
    {
        return $this->fileInfo;
    }
}


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

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 * Represents the request to update the user pool client.
 *

 *
 * @see AWS
 *      API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateUserPoolClientRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The user pool ID for the user pool where you want to update the user pool client.
     *

     */
    private String userPoolId;
    /**
     *

     * The ID of the client associated with the user pool.
     *

     */
    private String clientId;
    /**
     *

     * The client name from the update user pool client request.
     *

     */
    private String clientName;
    /**
     *

     * The time limit, in days, after which the refresh token is no longer valid and cannot be used.
     *

     */
    private Integer refreshTokenValidity;
    /**
     *

     * The read-only attributes of the user pool.
     *

     */
    private java.util.List<String> readAttributes;
    /**
     *

     * The writeable attributes of the user pool.
     *

     */
    private java.util.List<String> writeAttributes;
    /**
     *

     * Explicit authentication flows.
     *

     */
    private java.util.List<String> explicitAuthFlows;
    /**
     *

     * A list of provider names for the identity providers that are supported on this client.
     *

     */
    private java.util.List<String> supportedIdentityProviders;
    /**
     *

     * A list of allowed redirect (callback) URLs for the identity providers.
     *

     *

     * A redirect URI must:
     *

     *

     *

     *

     * Be an absolute URI.
     *

     *

     *

     *

     * Be registered with the authorization server.
     *

     *

     *

     *

     * Not include a fragment component.
     *

     *

     *

     *

     * See OAuth 2.0 - Redirection Endpoint.
     *

     *

     * Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     * App callback URLs such as myapp://example are also supported.
     *

     */
    private java.util.List<String> callbackURLs;
    /**
     *

     * A list of allowed logout URLs for the identity providers.
     *

     */
    private java.util.List<String> logoutURLs;
    /**
     *

     * The default redirect URI. Must be in the CallbackURLs list.
     *

     *

     * A redirect URI must:
     *

     *

     *

     *

     * Be an absolute URI.
     *

     *

     *

     *

     * Be registered with the authorization server.
     *

     *

     *

     *

     * Not include a fragment component.
     *

     *

     *

     *

     * See OAuth 2.0 - Redirection Endpoint.
     *

     *

     * Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     * App callback URLs such as myapp://example are also supported.
     *

     */
    private String defaultRedirectURI;
    /**
     *

     * Set to code to initiate a code grant flow, which provides an authorization code as the response.
     * This code can be exchanged for access tokens with the token endpoint.
     *

     */
    private java.util.List<String> allowedOAuthFlows;
    /**
     *

     * A list of allowed OAuth scopes. Currently supported values are "phone",
     * "email", "openid", and "Cognito".
     *

     */
    private java.util.List<String> allowedOAuthScopes;
    /**
     *

     * Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.
     *

     */
    private Boolean allowedOAuthFlowsUserPoolClient;
    /**
     *

     * The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
     *

     */
    private AnalyticsConfigurationType analyticsConfiguration;

    /**
     *

     * The user pool ID for the user pool where you want to update the user pool client.
     *

     *
     * @param userPoolId
     *        The user pool ID for the user pool where you want to update the user pool client.
     */

    public void setUserPoolId(String userPoolId) {
        this.userPoolId = userPoolId;
    }

    /**
     *

     * The user pool ID for the user pool where you want to update the user pool client.
     *

     *
     * @return The user pool ID for the user pool where you want to update the user pool client.
     */

    public String getUserPoolId() {
        return this.userPoolId;
    }

    /**
     *

     * The user pool ID for the user pool where you want to update the user pool client.
     *

     *
     * @param userPoolId
     *        The user pool ID for the user pool where you want to update the user pool client.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withUserPoolId(String userPoolId) {
        setUserPoolId(userPoolId);
        return this;
    }

    /**
     *

     * The ID of the client associated with the user pool.
     *

     *
     * @param clientId
     *        The ID of the client associated with the user pool.
     */

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    /**
     *

     * The ID of the client associated with the user pool.
     *

     *
     * @return The ID of the client associated with the user pool.
     */

    public String getClientId() {
        return this.clientId;
    }

    /**
     *

     * The ID of the client associated with the user pool.
     *

     *
     * @param clientId
     *        The ID of the client associated with the user pool.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withClientId(String clientId) {
        setClientId(clientId);
        return this;
    }

    /**
     *

     * The client name from the update user pool client request.
     *

     *
     * @param clientName
     *        The client name from the update user pool client request.
     */

    public void setClientName(String clientName) {
        this.clientName = clientName;
    }

    /**
     *

     * The client name from the update user pool client request.
     *

     *
     * @return The client name from the update user pool client request.
     */

    public String getClientName() {
        return this.clientName;
    }

    /**
     *

     * The client name from the update user pool client request.
     *

     *
     * @param clientName
     *        The client name from the update user pool client request.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withClientName(String clientName) {
        setClientName(clientName);
        return this;
    }

    /**
     *

     * The time limit, in days, after which the refresh token is no longer valid and cannot be used.
     *

     *
     * @param refreshTokenValidity
     *        The time limit, in days, after which the refresh token is no longer valid and cannot be used.
     */

    public void setRefreshTokenValidity(Integer refreshTokenValidity) {
        this.refreshTokenValidity = refreshTokenValidity;
    }

    /**
     *

     * The time limit, in days, after which the refresh token is no longer valid and cannot be used.
     *

     *
     * @return The time limit, in days, after which the refresh token is no longer valid and cannot be used.
     */

    public Integer getRefreshTokenValidity() {
        return this.refreshTokenValidity;
    }

    /**
     *

     * The time limit, in days, after which the refresh token is no longer valid and cannot be used.
     *

     *
     * @param refreshTokenValidity
     *        The time limit, in days, after which the refresh token is no longer valid and cannot be used.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withRefreshTokenValidity(Integer refreshTokenValidity) {
        setRefreshTokenValidity(refreshTokenValidity);
        return this;
    }

    /**
     *

     * The read-only attributes of the user pool.
     *

     *
     * @return The read-only attributes of the user pool.
     */

    public java.util.List<String> getReadAttributes() {
        return readAttributes;
    }

    /**
     *

     * The read-only attributes of the user pool.
     *

     *
     * @param readAttributes
     *        The read-only attributes of the user pool.
     */

    public void setReadAttributes(java.util.Collection<String> readAttributes) {
        if (readAttributes == null) {
            this.readAttributes = null;
            return;
        }

        this.readAttributes = new java.util.ArrayList<String>(readAttributes);
    }

    /**
     *

     * The read-only attributes of the user pool.
     *

     *

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

     *
     * @param readAttributes
     *        The read-only attributes of the user pool.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withReadAttributes(String... readAttributes) {
        if (this.readAttributes == null) {
            setReadAttributes(new java.util.ArrayList<String>(readAttributes.length));
        }
        for (String ele : readAttributes) {
            this.readAttributes.add(ele);
        }
        return this;
    }

    /**
     *

     * The read-only attributes of the user pool.
     *

     *
     * @param readAttributes
     *        The read-only attributes of the user pool.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withReadAttributes(java.util.Collection<String> readAttributes) {
        setReadAttributes(readAttributes);
        return this;
    }

    /**
     *

     * The writeable attributes of the user pool.
     *

     *
     * @return The writeable attributes of the user pool.
     */

    public java.util.List<String> getWriteAttributes() {
        return writeAttributes;
    }

    /**
     *

     * The writeable attributes of the user pool.
     *

     *
     * @param writeAttributes
     *        The writeable attributes of the user pool.
     */

    public void setWriteAttributes(java.util.Collection<String> writeAttributes) {
        if (writeAttributes == null) {
            this.writeAttributes = null;
            return;
        }

        this.writeAttributes = new java.util.ArrayList<String>(writeAttributes);
    }

    /**
     *

     * The writeable attributes of the user pool.
     *

     *

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

     *
     * @param writeAttributes
     *        The writeable attributes of the user pool.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withWriteAttributes(String... writeAttributes) {
        if (this.writeAttributes == null) {
            setWriteAttributes(new java.util.ArrayList<String>(writeAttributes.length));
        }
        for (String ele : writeAttributes) {
            this.writeAttributes.add(ele);
        }
        return this;
    }

    /**
     *

     * The writeable attributes of the user pool.
     *

     *
     * @param writeAttributes
     *        The writeable attributes of the user pool.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withWriteAttributes(java.util.Collection<String> writeAttributes) {
        setWriteAttributes(writeAttributes);
        return this;
    }

    /**
     *

     * Explicit authentication flows.
     *

     *
     * @return Explicit authentication flows.
     * @see ExplicitAuthFlowsType
     */

    public java.util.List<String> getExplicitAuthFlows() {
        return explicitAuthFlows;
    }

    /**
     *

     * Explicit authentication flows.
     *

     *
     * @param explicitAuthFlows
     *        Explicit authentication flows.
     * @see ExplicitAuthFlowsType
     */

    public void setExplicitAuthFlows(java.util.Collection<String> explicitAuthFlows) {
        if (explicitAuthFlows == null) {
            this.explicitAuthFlows = null;
            return;
        }

        this.explicitAuthFlows = new java.util.ArrayList<String>(explicitAuthFlows);
    }

    /**
     *

     * Explicit authentication flows.
     *

     *

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

     *
     * @param explicitAuthFlows
     *        Explicit authentication flows.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ExplicitAuthFlowsType
     */

    public UpdateUserPoolClientRequest withExplicitAuthFlows(String... explicitAuthFlows) {
        if (this.explicitAuthFlows == null) {
            setExplicitAuthFlows(new java.util.ArrayList<String>(explicitAuthFlows.length));
        }
        for (String ele : explicitAuthFlows) {
            this.explicitAuthFlows.add(ele);
        }
        return this;
    }

    /**
     *

     * Explicit authentication flows.
     *

     *
     * @param explicitAuthFlows
     *        Explicit authentication flows.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ExplicitAuthFlowsType
     */

    public UpdateUserPoolClientRequest withExplicitAuthFlows(java.util.Collection<String> explicitAuthFlows) {
        setExplicitAuthFlows(explicitAuthFlows);
        return this;
    }

    /**
     *

     * Explicit authentication flows.
     *

     *
     * @param explicitAuthFlows
     *        Explicit authentication flows.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ExplicitAuthFlowsType
     */

    public UpdateUserPoolClientRequest withExplicitAuthFlows(ExplicitAuthFlowsType... explicitAuthFlows) {
        java.util.ArrayList<String> explicitAuthFlowsCopy = new java.util.ArrayList<String>(explicitAuthFlows.length);
        for (ExplicitAuthFlowsType value : explicitAuthFlows) {
            explicitAuthFlowsCopy.add(value.toString());
        }
        if (getExplicitAuthFlows() == null) {
            setExplicitAuthFlows(explicitAuthFlowsCopy);
        } else {
            getExplicitAuthFlows().addAll(explicitAuthFlowsCopy);
        }
        return this;
    }

    /**
     *

     * A list of provider names for the identity providers that are supported on this client.
     *

     *
     * @return A list of provider names for the identity providers that are supported on this client.
     */

    public java.util.List<String> getSupportedIdentityProviders() {
        return supportedIdentityProviders;
    }

    /**
     *

     * A list of provider names for the identity providers that are supported on this client.
     *

     *
     * @param supportedIdentityProviders
     *        A list of provider names for the identity providers that are supported on this client.
     */

    public void setSupportedIdentityProviders(java.util.Collection<String> supportedIdentityProviders) {
        if (supportedIdentityProviders == null) {
            this.supportedIdentityProviders = null;
            return;
        }

        this.supportedIdentityProviders = new java.util.ArrayList<String>(supportedIdentityProviders);
    }

    /**
     *

     * A list of provider names for the identity providers that are supported on this client.
     *

     *

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

     *
     * @param supportedIdentityProviders
     *        A list of provider names for the identity providers that are supported on this client.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withSupportedIdentityProviders(String... supportedIdentityProviders) {
        if (this.supportedIdentityProviders == null) {
            setSupportedIdentityProviders(new java.util.ArrayList<String>(supportedIdentityProviders.length));
        }
        for (String ele : supportedIdentityProviders) {
            this.supportedIdentityProviders.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of provider names for the identity providers that are supported on this client.
     *

     *
     * @param supportedIdentityProviders
     *        A list of provider names for the identity providers that are supported on this client.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withSupportedIdentityProviders(java.util.Collection<String> supportedIdentityProviders) {
        setSupportedIdentityProviders(supportedIdentityProviders);
        return this;
    }

    /**
     *

     * A list of allowed redirect (callback) URLs for the identity providers.
     *

     *

     * A redirect URI must:
     *

     *

     *

     *

     * Be an absolute URI.
     *

     *

     *

     *

     * Be registered with the authorization server.
     *

     *

     *

     *

     * Not include a fragment component.
     *

     *

     *

     *

     * See OAuth 2.0 - Redirection Endpoint.
     *

     *

     * Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     * App callback URLs such as myapp://example are also supported.
     *

     *
     * @return A list of allowed redirect (callback) URLs for the identity providers.

     *

     *         A redirect URI must:
     *

     *

     *

     *

     *         Be an absolute URI.
     *

     *

     *

     *

     *         Be registered with the authorization server.
     *

     *

     *

     *

     *         Not include a fragment component.
     *

     *

     *

     *

     *         See OAuth 2.0 - Redirection Endpoint.
     *

     *

     *         Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     *         App callback URLs such as myapp://example are also supported.
     */

    public java.util.List<String> getCallbackURLs() {
        return callbackURLs;
    }

    /**
     *

     * A list of allowed redirect (callback) URLs for the identity providers.
     *

     *

     * A redirect URI must:
     *

     *

     *

     *

     * Be an absolute URI.
     *

     *

     *

     *

     * Be registered with the authorization server.
     *

     *

     *

     *

     * Not include a fragment component.
     *

     *

     *

     *

     * See OAuth 2.0 - Redirection Endpoint.
     *

     *

     * Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     * App callback URLs such as myapp://example are also supported.
     *

     *
     * @param callbackURLs
     *        A list of allowed redirect (callback) URLs for the identity providers.

     *

     *        A redirect URI must:
     *

     *

     *

     *

     *        Be an absolute URI.
     *

     *

     *

     *

     *        Be registered with the authorization server.
     *

     *

     *

     *

     *        Not include a fragment component.
     *

     *

     *

     *

     *        See OAuth 2.0 - Redirection Endpoint.
     *

     *

     *        Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     *        App callback URLs such as myapp://example are also supported.
     */

    public void setCallbackURLs(java.util.Collection<String> callbackURLs) {
        if (callbackURLs == null) {
            this.callbackURLs = null;
            return;
        }

        this.callbackURLs = new java.util.ArrayList<String>(callbackURLs);
    }

    /**
     *

     * A list of allowed redirect (callback) URLs for the identity providers.
     *

     *

     * A redirect URI must:
     *

     *

     *

     *

     * Be an absolute URI.
     *

     *

     *

     *

     * Be registered with the authorization server.
     *

     *

     *

     *

     * Not include a fragment component.
     *

     *

     *

     *

     * See OAuth 2.0 - Redirection Endpoint.
     *

     *

     * Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     * App callback URLs such as myapp://example are also supported.
     *

     *

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

     *
     * @param callbackURLs
     *        A list of allowed redirect (callback) URLs for the identity providers.

     *

     *        A redirect URI must:
     *

     *

     *

     *

     *        Be an absolute URI.
     *

     *

     *

     *

     *        Be registered with the authorization server.
     *

     *

     *

     *

     *        Not include a fragment component.
     *

     *

     *

     *

     *        See OAuth 2.0 - Redirection Endpoint.
     *

     *

     *        Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     *        App callback URLs such as myapp://example are also supported.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withCallbackURLs(String... callbackURLs) {
        if (this.callbackURLs == null) {
            setCallbackURLs(new java.util.ArrayList<String>(callbackURLs.length));
        }
        for (String ele : callbackURLs) {
            this.callbackURLs.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of allowed redirect (callback) URLs for the identity providers.
     *

     *

     * A redirect URI must:
     *

     *

     *

     *

     * Be an absolute URI.
     *

     *

     *

     *

     * Be registered with the authorization server.
     *

     *

     *

     *

     * Not include a fragment component.
     *

     *

     *

     *

     * See OAuth 2.0 - Redirection Endpoint.
     *

     *

     * Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     * App callback URLs such as myapp://example are also supported.
     *

     *
     * @param callbackURLs
     *        A list of allowed redirect (callback) URLs for the identity providers.

     *

     *        A redirect URI must:
     *

     *

     *

     *

     *        Be an absolute URI.
     *

     *

     *

     *

     *        Be registered with the authorization server.
     *

     *

     *

     *

     *        Not include a fragment component.
     *

     *

     *

     *

     *        See OAuth 2.0 - Redirection Endpoint.
     *

     *

     *        Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     *        App callback URLs such as myapp://example are also supported.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withCallbackURLs(java.util.Collection<String> callbackURLs) {
        setCallbackURLs(callbackURLs);
        return this;
    }

    /**
     *

     * A list of allowed logout URLs for the identity providers.
     *

     *
     * @return A list of allowed logout URLs for the identity providers.
     */

    public java.util.List<String> getLogoutURLs() {
        return logoutURLs;
    }

    /**
     *

     * A list of allowed logout URLs for the identity providers.
     *

     *
     * @param logoutURLs
     *        A list of allowed logout URLs for the identity providers.
     */

    public void setLogoutURLs(java.util.Collection<String> logoutURLs) {
        if (logoutURLs == null) {
            this.logoutURLs = null;
            return;
        }

        this.logoutURLs = new java.util.ArrayList<String>(logoutURLs);
    }

    /**
     *

     * A list of allowed logout URLs for the identity providers.
     *

     *

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

     *
     * @param logoutURLs
     *        A list of allowed logout URLs for the identity providers.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withLogoutURLs(String... logoutURLs) {
        if (this.logoutURLs == null) {
            setLogoutURLs(new java.util.ArrayList<String>(logoutURLs.length));
        }
        for (String ele : logoutURLs) {
            this.logoutURLs.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of allowed logout URLs for the identity providers.
     *

     *
     * @param logoutURLs
     *        A list of allowed logout URLs for the identity providers.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withLogoutURLs(java.util.Collection<String> logoutURLs) {
        setLogoutURLs(logoutURLs);
        return this;
    }

    /**
     *

     * The default redirect URI. Must be in the CallbackURLs list.
     *

     *

     * A redirect URI must:
     *

     *

     *

     *

     * Be an absolute URI.
     *

     *

     *

     *

     * Be registered with the authorization server.
     *

     *

     *

     *

     * Not include a fragment component.
     *

     *

     *

     *

     * See OAuth 2.0 - Redirection Endpoint.
     *

     *

     * Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     * App callback URLs such as myapp://example are also supported.
     *

     *
     * @param defaultRedirectURI
     *        The default redirect URI. Must be in the CallbackURLs list.

     *

     *        A redirect URI must:
     *

     *

     *

     *

     *        Be an absolute URI.
     *

     *

     *

     *

     *        Be registered with the authorization server.
     *

     *

     *

     *

     *        Not include a fragment component.
     *

     *

     *

     *

     *        See OAuth 2.0 - Redirection Endpoint.
     *

     *

     *        Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     *        App callback URLs such as myapp://example are also supported.
     */

    public void setDefaultRedirectURI(String defaultRedirectURI) {
        this.defaultRedirectURI = defaultRedirectURI;
    }

    /**
     *

     * The default redirect URI. Must be in the CallbackURLs list.
     *

     *

     * A redirect URI must:
     *

     *

     *

     *

     * Be an absolute URI.
     *

     *

     *

     *

     * Be registered with the authorization server.
     *

     *

     *

     *

     * Not include a fragment component.
     *

     *

     *

     *

     * See OAuth 2.0 - Redirection Endpoint.
     *

     *

     * Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     * App callback URLs such as myapp://example are also supported.
     *

     *
     * @return The default redirect URI. Must be in the CallbackURLs list.

     *

     *         A redirect URI must:
     *

     *

     *

     *

     *         Be an absolute URI.
     *

     *

     *

     *

     *         Be registered with the authorization server.
     *

     *

     *

     *

     *         Not include a fragment component.
     *

     *

     *

     *

     *         See OAuth 2.0 - Redirection Endpoint.
     *

     *

     *         Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     *         App callback URLs such as myapp://example are also supported.
     */

    public String getDefaultRedirectURI() {
        return this.defaultRedirectURI;
    }

    /**
     *

     * The default redirect URI. Must be in the CallbackURLs list.
     *

     *

     * A redirect URI must:
     *

     *

     *

     *

     * Be an absolute URI.
     *

     *

     *

     *

     * Be registered with the authorization server.
     *

     *

     *

     *

     * Not include a fragment component.
     *

     *

     *

     *

     * See OAuth 2.0 - Redirection Endpoint.
     *

     *

     * Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     * App callback URLs such as myapp://example are also supported.
     *

     *
     * @param defaultRedirectURI
     *        The default redirect URI. Must be in the CallbackURLs list.

     *

     *        A redirect URI must:
     *

     *

     *

     *

     *        Be an absolute URI.
     *

     *

     *

     *

     *        Be registered with the authorization server.
     *

     *

     *

     *

     *        Not include a fragment component.
     *

     *

     *

     *

     *        See OAuth 2.0 - Redirection Endpoint.
     *

     *

     *        Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
     *

     *

     *        App callback URLs such as myapp://example are also supported.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withDefaultRedirectURI(String defaultRedirectURI) {
        setDefaultRedirectURI(defaultRedirectURI);
        return this;
    }

    /**
     *

     * Set to code to initiate a code grant flow, which provides an authorization code as the response.
     * This code can be exchanged for access tokens with the token endpoint.
     *

     *
     * @return Set to code to initiate a code grant flow, which provides an authorization code as the
     *         response. This code can be exchanged for access tokens with the token endpoint.
     * @see OAuthFlowType
     */

    public java.util.List<String> getAllowedOAuthFlows() {
        return allowedOAuthFlows;
    }

    /**
     *

     * Set to code to initiate a code grant flow, which provides an authorization code as the response.
     * This code can be exchanged for access tokens with the token endpoint.
     *

     *
     * @param allowedOAuthFlows
     *        Set to code to initiate a code grant flow, which provides an authorization code as the
     *        response. This code can be exchanged for access tokens with the token endpoint.
     * @see OAuthFlowType
     */

    public void setAllowedOAuthFlows(java.util.Collection<String> allowedOAuthFlows) {
        if (allowedOAuthFlows == null) {
            this.allowedOAuthFlows = null;
            return;
        }

        this.allowedOAuthFlows = new java.util.ArrayList<String>(allowedOAuthFlows);
    }

    /**
     *

     * Set to code to initiate a code grant flow, which provides an authorization code as the response.
     * This code can be exchanged for access tokens with the token endpoint.
     *

     *

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

     *
     * @param allowedOAuthFlows
     *        Set to code to initiate a code grant flow, which provides an authorization code as the
     *        response. This code can be exchanged for access tokens with the token endpoint.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see OAuthFlowType
     */

    public UpdateUserPoolClientRequest withAllowedOAuthFlows(String... allowedOAuthFlows) {
        if (this.allowedOAuthFlows == null) {
            setAllowedOAuthFlows(new java.util.ArrayList<String>(allowedOAuthFlows.length));
        }
        for (String ele : allowedOAuthFlows) {
            this.allowedOAuthFlows.add(ele);
        }
        return this;
    }

    /**
     *

     * Set to code to initiate a code grant flow, which provides an authorization code as the response.
     * This code can be exchanged for access tokens with the token endpoint.
     *

     *
     * @param allowedOAuthFlows
     *        Set to code to initiate a code grant flow, which provides an authorization code as the
     *        response. This code can be exchanged for access tokens with the token endpoint.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see OAuthFlowType
     */

    public UpdateUserPoolClientRequest withAllowedOAuthFlows(java.util.Collection<String> allowedOAuthFlows) {
        setAllowedOAuthFlows(allowedOAuthFlows);
        return this;
    }

    /**
     *

     * Set to code to initiate a code grant flow, which provides an authorization code as the response.
     * This code can be exchanged for access tokens with the token endpoint.
     *

     *
     * @param allowedOAuthFlows
     *        Set to code to initiate a code grant flow, which provides an authorization code as the
     *        response. This code can be exchanged for access tokens with the token endpoint.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see OAuthFlowType
     */

    public UpdateUserPoolClientRequest withAllowedOAuthFlows(OAuthFlowType... allowedOAuthFlows) {
        java.util.ArrayList<String> allowedOAuthFlowsCopy = new java.util.ArrayList<String>(allowedOAuthFlows.length);
        for (OAuthFlowType value : allowedOAuthFlows) {
            allowedOAuthFlowsCopy.add(value.toString());
        }
        if (getAllowedOAuthFlows() == null) {
            setAllowedOAuthFlows(allowedOAuthFlowsCopy);
        } else {
            getAllowedOAuthFlows().addAll(allowedOAuthFlowsCopy);
        }
        return this;
    }

    /**
     *

     * A list of allowed OAuth scopes. Currently supported values are "phone",
     * "email", "openid", and "Cognito".
     *

     *
     * @return A list of allowed OAuth scopes. Currently supported values are "phone",
     *         "email", "openid", and "Cognito".
     */

    public java.util.List<String> getAllowedOAuthScopes() {
        return allowedOAuthScopes;
    }

    /**
     *

     * A list of allowed OAuth scopes. Currently supported values are "phone",
     * "email", "openid", and "Cognito".
     *

     *
     * @param allowedOAuthScopes
     *        A list of allowed OAuth scopes. Currently supported values are "phone",
     *        "email", "openid", and "Cognito".
     */

    public void setAllowedOAuthScopes(java.util.Collection<String> allowedOAuthScopes) {
        if (allowedOAuthScopes == null) {
            this.allowedOAuthScopes = null;
            return;
        }

        this.allowedOAuthScopes = new java.util.ArrayList<String>(allowedOAuthScopes);
    }

    /**
     *

     * A list of allowed OAuth scopes. Currently supported values are "phone",
     * "email", "openid", and "Cognito".
     *

     *

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

     *
     * @param allowedOAuthScopes
     *        A list of allowed OAuth scopes. Currently supported values are "phone",
     *        "email", "openid", and "Cognito".
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withAllowedOAuthScopes(String... allowedOAuthScopes) {
        if (this.allowedOAuthScopes == null) {
            setAllowedOAuthScopes(new java.util.ArrayList<String>(allowedOAuthScopes.length));
        }
        for (String ele : allowedOAuthScopes) {
            this.allowedOAuthScopes.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of allowed OAuth scopes. Currently supported values are "phone",
     * "email", "openid", and "Cognito".
     *

     *
     * @param allowedOAuthScopes
     *        A list of allowed OAuth scopes. Currently supported values are "phone",
     *        "email", "openid", and "Cognito".
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withAllowedOAuthScopes(java.util.Collection<String> allowedOAuthScopes) {
        setAllowedOAuthScopes(allowedOAuthScopes);
        return this;
    }

    /**
     *

     * Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.
     *

     *
     * @param allowedOAuthFlowsUserPoolClient
     *        Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user
     *        pools.
     */

    public void setAllowedOAuthFlowsUserPoolClient(Boolean allowedOAuthFlowsUserPoolClient) {
        this.allowedOAuthFlowsUserPoolClient = allowedOAuthFlowsUserPoolClient;
    }

    /**
     *

     * Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.
     *

     *
     * @return Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user
     *         pools.
     */

    public Boolean getAllowedOAuthFlowsUserPoolClient() {
        return this.allowedOAuthFlowsUserPoolClient;
    }

    /**
     *

     * Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.
     *

     *
     * @param allowedOAuthFlowsUserPoolClient
     *        Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user
     *        pools.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withAllowedOAuthFlowsUserPoolClient(Boolean allowedOAuthFlowsUserPoolClient) {
        setAllowedOAuthFlowsUserPoolClient(allowedOAuthFlowsUserPoolClient);
        return this;
    }

    /**
     *

     * Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.
     *

     *
     * @return Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user
     *         pools.
     */

    public Boolean isAllowedOAuthFlowsUserPoolClient() {
        return this.allowedOAuthFlowsUserPoolClient;
    }

    /**
     *

     * The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
     *

     *
     * @param analyticsConfiguration
     *        The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
     */

    public void setAnalyticsConfiguration(AnalyticsConfigurationType analyticsConfiguration) {
        this.analyticsConfiguration = analyticsConfiguration;
    }

    /**
     *

     * The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
     *

     *
     * @return The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
     */

    public AnalyticsConfigurationType getAnalyticsConfiguration() {
        return this.analyticsConfiguration;
    }

    /**
     *

     * The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
     *

     *
     * @param analyticsConfiguration
     *        The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UpdateUserPoolClientRequest withAnalyticsConfiguration(AnalyticsConfigurationType analyticsConfiguration) {
        setAnalyticsConfiguration(analyticsConfiguration);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getUserPoolId() != null)
            sb.append("UserPoolId: ").append(getUserPoolId()).append(",");
        if (getClientId() != null)
            sb.append("ClientId: ").append("***Sensitive Data Redacted***").append(",");
        if (getClientName() != null)
            sb.append("ClientName: ").append(getClientName()).append(",");
        if (getRefreshTokenValidity() != null)
            sb.append("RefreshTokenValidity: ").append(getRefreshTokenValidity()).append(",");
        if (getReadAttributes() != null)
            sb.append("ReadAttributes: ").append(getReadAttributes()).append(",");
        if (getWriteAttributes() != null)
            sb.append("WriteAttributes: ").append(getWriteAttributes()).append(",");
        if (getExplicitAuthFlows() != null)
            sb.append("ExplicitAuthFlows: ").append(getExplicitAuthFlows()).append(",");
        if (getSupportedIdentityProviders() != null)
            sb.append("SupportedIdentityProviders: ").append(getSupportedIdentityProviders()).append(",");
        if (getCallbackURLs() != null)
            sb.append("CallbackURLs: ").append(getCallbackURLs()).append(",");
        if (getLogoutURLs() != null)
            sb.append("LogoutURLs: ").append(getLogoutURLs()).append(",");
        if (getDefaultRedirectURI() != null)
            sb.append("DefaultRedirectURI: ").append(getDefaultRedirectURI()).append(",");
        if (getAllowedOAuthFlows() != null)
            sb.append("AllowedOAuthFlows: ").append(getAllowedOAuthFlows()).append(",");
        if (getAllowedOAuthScopes() != null)
            sb.append("AllowedOAuthScopes: ").append(getAllowedOAuthScopes()).append(",");
        if (getAllowedOAuthFlowsUserPoolClient() != null)
            sb.append("AllowedOAuthFlowsUserPoolClient: ").append(getAllowedOAuthFlowsUserPoolClient()).append(",");
        if (getAnalyticsConfiguration() != null)
            sb.append("AnalyticsConfiguration: ").append(getAnalyticsConfiguration());
        sb.append("}");
        return sb.toString();
    }

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

        if (obj instanceof UpdateUserPoolClientRequest == false)
            return false;
        UpdateUserPoolClientRequest other = (UpdateUserPoolClientRequest) obj;
        if (other.getUserPoolId() == null ^ this.getUserPoolId() == null)
            return false;
        if (other.getUserPoolId() != null && other.getUserPoolId().equals(this.getUserPoolId()) == false)
            return false;
        if (other.getClientId() == null ^ this.getClientId() == null)
            return false;
        if (other.getClientId() != null && other.getClientId().equals(this.getClientId()) == false)
            return false;
        if (other.getClientName() == null ^ this.getClientName() == null)
            return false;
        if (other.getClientName() != null && other.getClientName().equals(this.getClientName()) == false)
            return false;
        if (other.getRefreshTokenValidity() == null ^ this.getRefreshTokenValidity() == null)
            return false;
        if (other.getRefreshTokenValidity() != null && other.getRefreshTokenValidity().equals(this.getRefreshTokenValidity()) == false)
            return false;
        if (other.getReadAttributes() == null ^ this.getReadAttributes() == null)
            return false;
        if (other.getReadAttributes() != null && other.getReadAttributes().equals(this.getReadAttributes()) == false)
            return false;
        if (other.getWriteAttributes() == null ^ this.getWriteAttributes() == null)
            return false;
        if (other.getWriteAttributes() != null && other.getWriteAttributes().equals(this.getWriteAttributes()) == false)
            return false;
        if (other.getExplicitAuthFlows() == null ^ this.getExplicitAuthFlows() == null)
            return false;
        if (other.getExplicitAuthFlows() != null && other.getExplicitAuthFlows().equals(this.getExplicitAuthFlows()) == false)
            return false;
        if (other.getSupportedIdentityProviders() == null ^ this.getSupportedIdentityProviders() == null)
            return false;
        if (other.getSupportedIdentityProviders() != null && other.getSupportedIdentityProviders().equals(this.getSupportedIdentityProviders()) == false)
            return false;
        if (other.getCallbackURLs() == null ^ this.getCallbackURLs() == null)
            return false;
        if (other.getCallbackURLs() != null && other.getCallbackURLs().equals(this.getCallbackURLs()) == false)
            return false;
        if (other.getLogoutURLs() == null ^ this.getLogoutURLs() == null)
            return false;
        if (other.getLogoutURLs() != null && other.getLogoutURLs().equals(this.getLogoutURLs()) == false)
            return false;
        if (other.getDefaultRedirectURI() == null ^ this.getDefaultRedirectURI() == null)
            return false;
        if (other.getDefaultRedirectURI() != null && other.getDefaultRedirectURI().equals(this.getDefaultRedirectURI()) == false)
            return false;
        if (other.getAllowedOAuthFlows() == null ^ this.getAllowedOAuthFlows() == null)
            return false;
        if (other.getAllowedOAuthFlows() != null && other.getAllowedOAuthFlows().equals(this.getAllowedOAuthFlows()) == false)
            return false;
        if (other.getAllowedOAuthScopes() == null ^ this.getAllowedOAuthScopes() == null)
            return false;
        if (other.getAllowedOAuthScopes() != null && other.getAllowedOAuthScopes().equals(this.getAllowedOAuthScopes()) == false)
            return false;
        if (other.getAllowedOAuthFlowsUserPoolClient() == null ^ this.getAllowedOAuthFlowsUserPoolClient() == null)
            return false;
        if (other.getAllowedOAuthFlowsUserPoolClient() != null
                && other.getAllowedOAuthFlowsUserPoolClient().equals(this.getAllowedOAuthFlowsUserPoolClient()) == false)
            return false;
        if (other.getAnalyticsConfiguration() == null ^ this.getAnalyticsConfiguration() == null)
            return false;
        if (other.getAnalyticsConfiguration() != null && other.getAnalyticsConfiguration().equals(this.getAnalyticsConfiguration()) == false)
            return false;
        return true;
    }

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

        hashCode = prime * hashCode + ((getUserPoolId() == null) ? 0 : getUserPoolId().hashCode());
        hashCode = prime * hashCode + ((getClientId() == null) ? 0 : getClientId().hashCode());
        hashCode = prime * hashCode + ((getClientName() == null) ? 0 : getClientName().hashCode());
        hashCode = prime * hashCode + ((getRefreshTokenValidity() == null) ? 0 : getRefreshTokenValidity().hashCode());
        hashCode = prime * hashCode + ((getReadAttributes() == null) ? 0 : getReadAttributes().hashCode());
        hashCode = prime * hashCode + ((getWriteAttributes() == null) ? 0 : getWriteAttributes().hashCode());
        hashCode = prime * hashCode + ((getExplicitAuthFlows() == null) ? 0 : getExplicitAuthFlows().hashCode());
        hashCode = prime * hashCode + ((getSupportedIdentityProviders() == null) ? 0 : getSupportedIdentityProviders().hashCode());
        hashCode = prime * hashCode + ((getCallbackURLs() == null) ? 0 : getCallbackURLs().hashCode());
        hashCode = prime * hashCode + ((getLogoutURLs() == null) ? 0 : getLogoutURLs().hashCode());
        hashCode = prime * hashCode + ((getDefaultRedirectURI() == null) ? 0 : getDefaultRedirectURI().hashCode());
        hashCode = prime * hashCode + ((getAllowedOAuthFlows() == null) ? 0 : getAllowedOAuthFlows().hashCode());
        hashCode = prime * hashCode + ((getAllowedOAuthScopes() == null) ? 0 : getAllowedOAuthScopes().hashCode());
        hashCode = prime * hashCode + ((getAllowedOAuthFlowsUserPoolClient() == null) ? 0 : getAllowedOAuthFlowsUserPoolClient().hashCode());
        hashCode = prime * hashCode + ((getAnalyticsConfiguration() == null) ? 0 : getAnalyticsConfiguration().hashCode());
        return hashCode;
    }

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

}


text:
export class Resources {

  id: string;
  name: string;
  url: string;
  type: string;
  icon: string;
  father: string;
  description: string;

  constructor(){}

}


text:
require 'chefspec'
describe 'my_cookbook::default' do
  let(:chef_run) {
    ChefSpec::ChefRunner.new(
      platform:'ubuntu', version:'12.04'
    ).converge(described_recipe)
  }
  it 'creates a greetings file, containing the platform
    name' do
    expect(chef_run).to
      create_file_with_content('/tmp/greeting.txt','Hello!
      ubuntu!')
  end
end


text:
Sergent now supports background cycling and external configuration: **sergent-configs.properties**
If you add Sergent as a dependency, all you have to do is create a *sergent-configs.properties* file in your classpath (preferably under src/main/resources) and set your own random implementation or background cycling configs.

And example configs file can be found here: https://github.com/lindar-open/sergent/blob/master/src/main/resources/sergent-configs-example.properties

**Quick Start:**

```java
Sergent rng = SergentFactory.newInstance();

// Int Generator
int randInt = rng.intGenerator().randInt();
int randIntWithOptions = rng.intGenerator().withMinAndMax(-10, 10).ignore(Arrays.asList(-9,-8,-7,-6,-5)).randInt();

// Long Generator
long randLong = rng.longGenerator().randLong();
long randLongWithOptions = rng.longGenerator().withMinAndMax(-10, 10).ignore(Arrays.asList(-9,-8,-7,-6,-5)).randLong();

// List Generator
List<Integer> fiveUniqueRandNumbersFromOneToTen = rng.listGenerator().withMinAndMax(1, 10).ofSize(5).unique().randIntegers();
// a unique (no duplicates) random integer list starting from 1 to 90
List<Integer> uniqueSequence = rng.listGenerator().withMinAndMax(1, 90).unique(true).randIntegers();

// String Generator
String alphabeticUppercaseString = rng.stringGenerator().alphabetic().uppercase().randString();
String alphaNumericString = rng.stringGenerator().alphanumeric().randString();
String numericString = rng.stringGenerator().numeric().randString();
String alphaNumericUppercaseOnlyString = rng.stringGenerator().alphanumeric().uppercase().randString();

// List or array Shuffler
List<Integer> numbers = IntStream.rangeClosed(1, 100).boxed().collect(Collectors.toList());
rng.shuffle().list(numbers); // the numbers list is now shuffled randmly
// you can go even further and shuffle only parts of the list by specifying where to start and the direction
rng.shuffle().start(50).towardHead().list(numbers); // will shuffle the numbers from 1 to 50
rng.shuffle().start(50).towardTail().list(numbers); // will shuffle the numbers from 50 to 100
```

**NOTE: All above generators use the same Sergent instance with the same initial configs and seed. If you want to reseed, create a new instance and use that.**

For more examples please check the unit tests: https://github.com/lindar-open/sergent/tree/master/src/test/java/com/lindar/sergent

Usage:

```xml
<dependency>
    <groupId>com.lindar</groupId>
    <artifactId>sergent</artifactId>
    <version>2.1.5</version>
</dependency>
```


text:
require "net/http"

module Bowline
  module Desktop
    module WindowMethods #:nodoc:
      def center(direction = nil)
        direction =
        case direction
        when :both       then Window::BOTH
        when :horizontal then Window::HORIZONTAL
        when :vertical   then Window::VERTICAL
        when :center     then Window::CENTRE_ON_SCREEN
        else
          Window::BOTH
        end
        _center(direction)
      end

      def file=(path)
        if path.is_a?(Symbol)
          path = File.join(APP_ROOT, "public", path.to_s)
        end
        if File.extname(path).blank?
          path += ".html"
        end
        path = File.expand_path(path, APP_ROOT)
        self._file = path
      end
      alias :load_file :file=

      def url=(address)
        unless address.is_a?(URI)
          address = URI.parse(address)
        end
        self._url = address.to_s
      end

      def select_file(options = {})
        flags = 0
        flags |= Window::FD_OPEN if options[:open]
        flags |= Window::FD_SAVE if options[:save]
        flags |= Window::FD_OVERWRITE_PROMPT if options[:overwrite_prompt]
        flags |= Window::FD_FILE_MUST_EXIST  if options[:file_must_exist]
        _select_file(
          options[:message],
          options[:default_path],
          options[:default_filename],
          options[:default_extension],
          options[:wildcard],
          flags
        )
      end

      def select_dir(options = {})
        _select_dir(options[:message], options[:default_path])
      end

      def width=(w)
        set_size(w, -1)
      end

      def height=(h)
        set_size(-1, h)
      end

      # Window was shut; setup!
      # needs to be called again
      def deallocated?
        id == -1
      end

      # The methods won't exist on window
      # if Bowline::Desktop isn't enabled
      def method_missing(sym, *args)
        Bowline::Desktop.enabled? ? super : nil
      end
    end
  end
end


text:
function onmessage(event) {
  var data = JSON.parse(event.data);
  switch (data.type) {
    case "error":
      handleError(data.error);
      break;
    case "status":
      handleStatus(data.text);
      getTopics();
      break;
    case "message":
      var chat = $("#chat");
      var topic = null;
      $.each(topics, function(key, value) {
        if (value.id == data["topic-id"]) {
          topic = value;
        }
      });

      var topicName = "";
      if (topic === null) {
        topicName = "GLOBAL";
      } else {
        topicName = topic["option-a"] + ' vs. ' + topic["option-b"];
      }
      chat.append('[' + topicName + '] ' +
        ''+data.username+':  '+data.text+'
');
      break;
  }
}

function handleError(error) {
  $("#chat").append('[ERROR] ' + error + '
');
}
function handleStatus(text) {
  $("#chat").append('[SERVER] ' + text + '
');
}

function onerror(err) {
  handleError(err);
}

var socket = new WebSocket("ws://localhost:8080/ws");
var topics = {};

socket.onmessage = onmessage;
socket.onerror = onerror;

$(window).on('beforeunload', function(){
  socket.close();
});

function connect() {
  socket = new WebSocket("ws://localhost:8080/ws");
  socket.onmessage = onmessage;
  socket.onerror = onerror;
}

function login() {
  var name = document.getElementById("username").value;
  var data = JSON.stringify({type:"login", username:name});
  socket.send(data);
}

function sendMessage() {
  switch (socket.readyState) {
    case 0:
      handleError("That connetion isn't open yet!");
      return;
    case 2:
      handleError("That socket is closing!");
      return;
    case 3:
      handleError("That socket is closed!");
      return;
  }
  var text = document.getElementById("text").value;
  var sid = $("#topics-sel").val();
  var id = parseInt(sid);
  var data = JSON.stringify({type:"message", text:text, "topic-id": id});
  socket.send(data);
}

function leave() {
  var data = JSON.stringify({type:"leave"});
  socket.send(data);
}

function newTopic() {
  var a = $("#option-a").val();
  var b = $("#option-b").val();

  var data = {type:"newtopic"};
  data["option-a"] = a;
  data["option-b"] = b;
  socket.send(JSON.stringify(data));
}

function getTopics() {
  var req = new XMLHttpRequest();
  req.open("GET", "http://localhost:8080/status", true);
  req.send(null);

  req.onload = function() {
    var data = JSON.parse(req.responseText);
    topics = data.topics;
    topicsElem = document.getElementById("topics");
    topicsElem.innerHTML = "";
    for (var i = 0; i < data.topics.length; i++) {
      topicsElem.innerHTML = topicsElem.innerHTML + '
ID: ' + data.topics[i].id + ' ' + data.topics[i]["option-a"] + ' vs. ' + data.topics[i]["option-b"];
    }
    $("#topics-sel").find("option").remove();
    $("#topics-sel").append('<option value="" disabled selected>Select your option</option>');
    $.each(data.topics, function(key, value) {
      $("#topics-sel").append('<option value="'+value.id+'">'+
          value["option-a"] +" vs. " + value["option-b"])
    })
  }
}


text:
import os

import numpy as np

def get_filename(path, contains):
    cmd = 'ls ' + path
    ls = os.popen(cmd).read()
    all_filelist = ls.split('\n')
    try:
        all_filelist.remove('')
    except:
        pass
    filelist = []
    for i, filename in enumerate(all_filelist):
        if contains in filename:
            return os.path.join(path, filename)

def get_bins_from_backgroundimage(backgroundimage, pixel_resolution=1):
    import matplotlib.pyplot as plt

    if type(backgroundimage) is str:
        backgroundimage = plt.imread(backgroundimage)
    binsx = np.arange(0, backgroundimage.shape[1]+1, pixel_resolution)
    binsy = np.arange(0, backgroundimage.shape[0]+1, pixel_resolution)
    return binsx, binsy

def get_heatmap(pd, binsx, binsy, position_x='position_x', position_y='position_y', position_z='position_z', position_z_slice=None):
    if position_z_slice is not None:
        pd_subset = pd[ (pd[position_z]>position_z_slice[0]) & (pd[position_z]<position_z_slice[1])]
    else:
        pd_subset = pd
    x = pd_subset[position_x].values
    y = pd_subset[position_y].values
    h, xedges, yedges = np.histogram2d(x,y,bins=[binsx,binsy])
    return h

def get_heatmap_weighted(pd, sample_names, bins, weight_name=None, normed=False):
    sample = [pd[sample_name].values for sample_name in sample_names]
    if weight_name is not None:
        weights = pd[weight_name]
    else:
        weights = None
    h, edges = np.histogramdd(sample,bins,weights=weights, normed=normed)
    return h

def plot_heatmap(pd, binsx, binsy, ax=None, vmin=0, vmax=None, logcolorscale=False, position_x='position_x',position_y='position_y', position_z='position_z', position_z_slice=None):
    import matplotlib.pyplot as plt

    if ax is None:
        fig = plt.figure()
        ax = fig.add_subplot(111)

    heatmap = get_heatmap(pd, binsx, binsy, position_x, position_y, position_z, position_z_slice)
    if logcolorscale:
        heatmap = np.log(heatmap)
    if vmax is None:
        vmax = 0.1*np.max(heatmap)
    ax.imshow(heatmap.T, cmap=plt.get_cmap('hot'), vmin=vmin, vmax=vmax, origin='lower', extent=[binsx[0],binsx[-1],binsy[0],binsy[-1]])

    return ax

def resampling_statistics_on_heatmaps(h_ons, h_offs, iterations=1000, neff=None):
    '''
    neff - effective N, taking into account clustering. See: http://www.nature.com/neuro/journal/v17/n4/pdf/nn.3648.pdf
    '''
    if neff is None:
        neff = len(h_ons)

    # bootstrap actual difference
    actual_differences = []
    for i in range(iterations):
        index_on = np.random.randint(0, len(h_ons))
        index_off = np.random.randint(0, len(h_offs))
        d = h_ons[index_on] - h_offs[index_off]
        actual_differences.append(d)

    actual_difference = np.nanmean(actual_differences, axis=0)

    all_hs = []
    all_hs.extend(h_ons)
    all_hs.extend(h_offs)

    differences = []
    for i in range(iterations):
        indices_on = np.random.randint(0, len(all_hs), neff)
        indices_off = np.random.randint(0, len(all_hs), neff)

        #fake_on = np.mean([all_hs[n] for n in indices_on], axis=0)
        #fake_off = np.mean([all_hs[n] for n in indices_off], axis=0)
        fake_on = np.array([all_hs[n] for n in indices_on])
        fake_off = np.array([all_hs[n] for n in indices_off])

        d = np.nanmean(fake_on - fake_off, axis=0)
        differences.append(d)

        #differences.append(fake_on-fake_off)
    differences = np.array(differences)

    pvals = np.ones_like(actual_difference)
    for r in range(0, differences.shape[1]):
        for c in range(0, differences.shape[2]):
            q = differences[:,r,c]
            q.sort()
            iq = np.argmin( np.abs(q-actual_difference[r,c]) )
            p = 1 - np.abs((iq - iterations/2.) / (iterations/2.))
            pvals[r,c] = p

    return actual_difference, pvals

def plot_trajectories(pd, binsx, binsy, backgroundimage=None, ax=None, position_x='position_x',position_y='position_y', position_z='position_z', position_z_slice=None):
    import matplotlib.pyplot as plt

    if ax is None:
        fig = plt.figure()
        ax = fig.add_subplot(111)

    heatmap = get_heatmap(pd, binsx, binsy, position_x, position_y, position_z, position_z_slice)
    heatmap_binary = np.sign(heatmap).astype(bool)
    masked_heatmap_binary = np.ma.masked_array(heatmap_binary, mask=np.invert(heatmap_binary))

    if backgroundimage is not None:
        if type(backgroundimage) is str:
            backgroundimage = plt.imread(backgroundimage)
        ax.imshow(backgroundimage, cmap=plt.get_cmap('gray'), extent=[binsx[0], binsx[-1], binsy[0], binsy[-1]])

    ax.imshow(masked_heatmap_binary.T, vmin = 0, vmax = 0.01, extent=[binsx[0], binsx[-1], binsy[0], binsy[-1]])

    ax.set_xlim(binsx[0], binsx[-1])
    ax.set_ylim(binsy[0], binsy[-1])
    ax.set_frame_on(False)
    ax.set_xticks([])
    ax.set_yticks([])
    ax.set_aspect('equal')

def plot_individual_trajectories_from_dataset_format(dataset, keys, backgroundimage, ax=None, binsx=None, binsy=None):
    import matplotlib.pyplot as plt

    if ax is None:
        fig = plt.figure()
        ax = fig.add_subplot(111)

    if backgroundimage is not None:
        backgroundimage = plt.imread(backgroundimage)
        binsx, binsy = get_bins_from_backgroundimage(backgroundimage)
        ax.imshow(backgroundimage, cmap=plt.get_cmap('gray'), extent=[binsx[0], binsx[-1], binsy[0], binsy[-1]])

    for key in keys:
        trajec = dataset.trajec(key)

        ax.plot(trajec.position_x, trajec.position_y)

def plot_trajectories_from_dataset(dataset, keys, interpolated_data='hide'):
    '''
    interpolated_data - if trajectories contain interpolated data, use 'hide' to hide that data, 'dotted' to show it as a dotted line, or 'show' to show it in its entirety
    '''
    import matplotlib.pyplot as plt

    # download at: https://github.com/florisvb/FlyPlotLib
    import fly_plot_lib.plot as fpl
    from fly_plot_lib.colormaps import viridis as viridis

    path = dataset.config.path
    bgimg_filename = get_filename(path, 'bgimg_N1.png')
    bgimg = plt.imread(bgimg_filename)

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.set_aspect('equal')

    ax.imshow(bgimg, cmap='gray')

    for key in keys:
        trajec = dataset.trajec(key)
        if 'interpolated' in trajec.__dict__.keys():
            interpolated_indices = np.where(trajec.interpolated==1)[0]
            if interpolated_data == 'dotted':
                r = np.arange(0, len(interpolated_indices), 5)
                interpolated_indices = interpolated_indices[r]
            if interpolated_data != 'show':
                trajec.position_x[interpolated_indices] = np.nan
                trajec.position_y[interpolated_indices] = np.nan
        l = -1
        fpl.colorline(ax, trajec.position_x[0:l], trajec.position_y[0:l], trajec.time_epoch[0:l]-trajec.time_epoch[0:l][0], linewidth=2, colormap='none', norm=None, zorder=1, alpha=1, linestyle='solid', cmap=viridis)

    fpl.adjust_spines(ax, [])
    ax.set_frame_on(False)


text:
module GeoNames
  def self.array_average(array)
    array.inject(:+) / array.count
  end

  def self.soundex_for_location(location)
    Text::Soundex.soundex(location.downcase.tr('^a-z', ''))
  end

  def self.location_for_trie(location)
    location.downcase.tr('^a-z', '')
  end

  def self.load_cities_maps
    # Maps 'City, XX' -> [lat, long].
    @cities_lat_long_map = {}

    # Maps soundex to 'City, XX'.
    @cities_soundex_map = {}

    # Maps '12345' -> 'City, XX'.
    @cities_zip_code_map = {}

    # Maps 'City, State Name' -> 'City, XX'.
    @cities_long_state_name_map = {}

    @cities_trie = Trie.new
    File.read('geonames_data/US.txt').lines.each do |line|
      fields = line.split("\t")
      zip = fields[1]
      city = fields[2]
      state = fields[3]
      state_abbreviation = fields[4]
      latitude = fields[9].to_f
      longitude = fields[10].to_f

      # Add to the lat/long map.
      location = "#{city}, #{state_abbreviation}"
      @cities_lat_long_map[location] ||= []
      @cities_lat_long_map[location] << [latitude, longitude]

      # Add to the soundex map.
      soundex_key = soundex_for_location(location)
      @cities_soundex_map[soundex_key] ||= Set.new
      @cities_soundex_map[soundex_key] << location

      # Add to the zipcode map.
      @cities_zip_code_map[zip] = location

      # Add to the long state name map.
      @cities_long_state_name_map["#{city}, #{state}"] = location

      # Add to the trie.
      @cities_trie.insert(location_for_trie(location), location)
    end

    # Reduce all lat_long hashes to a single averaged value.
    @cities_lat_long_map.each do |k, v|
      latitude = array_average(v.map { |ll| ll[0] })
      longitude = array_average(v.map { |ll| ll[1] })
      @cities_lat_long_map[k] = [latitude, longitude]
    end
  end
  load_cities_maps

  @city_rewrites = {
    'New York, NY' => 'New York City, NY'
  }

  class LocationNotFound < StandardError; end
  def self.location_to_point(location)
    location =
      @city_rewrites[location] ||
      @cities_zip_code_map[location] ||
      @cities_long_state_name_map[location] ||
      location
    point = @cities_lat_long_map[location]

    raise LocationNotFound, "'#{location}' not found" unless point

    point
  end

  def self.locations_sounding_like(location)
    @cities_soundex_map[soundex_for_location(location)].to_a
  end

  def self.locations_starting_with(prefix)
    transformed_prefix = location_for_trie(prefix)
    if transformed_prefix.empty? && !prefix.empty?
      # If the transformation turned the prefix into an empty string, don't
      # return any results so stuff like '12345' won't return everything.
      []
    else
      @cities_trie.find_prefix(transformed_prefix).values
    end
  end

  def self.location_for_zip_code(zip_code)
    @cities_zip_code_map[zip_code]
  end

  def self.zip_codes
    @cities_zip_code_map.keys
  end

  def self.load_timezone_map
    @timezone_map =
      YAML::load(File.read('zip_code_to_tz.yml'))
  end
  load_timezone_map

  def self.timezone_for_zip_code(zip_code)
    TZInfo::Timezone.get(@timezone_map[zip_code])
  end
end


text:
<!DOCTYPE html>

        <title>Sticky</title>

        <link rel="stylesheet/less" type="text/css" href="../../less/Stashy.less"/>

        <meta name="viewport" content="width=device-width" />

Main Content wrapped with a box decorated with the ".st-sticky-wrap" class

This is the main content of your page. Add a box with ".st-sticky-push" following your content.

Remember to update Stashy.Sticky.css or override the styles sections like is done in this page in order to provide your own footer height.

Sticky footer. Always at bottom!!


text:
require "test/unit"

class TC_Dir_Open_Class < Test::Unit::TestCase
   def setup
      @dir = "test"
      @pwd = Dir.pwd
   end

   def test_open_basic
      assert_respond_to(Dir, :open)
      assert_nothing_raised{ Dir.open(@pwd){} }
   end

   def test_open
      Dir.open(@pwd){ |dir|
         assert_kind_of(Dir, dir)
      }
   end

   def test_open_expected_errors
      assert_raises(TypeError){ Dir.open(1) }
      assert_raises(ArgumentError){ Dir.open(@pwd, @pwd) }
   end

   def teardown
      @dir = nil
      @pwd = nil
   end
end


text:
package com.monospace.framework.implementation;

import android.graphics.Bitmap;

import com.monospace.framework.Image;
import com.monospace.framework.Graphics.ImageFormat;

public class AndroidImage implements Image {
    Bitmap bitmap;
    ImageFormat format;

    public AndroidImage(Bitmap bitmap, ImageFormat format) {
        this.bitmap = bitmap;
        this.format = format;
    }

    @Override
    public int getWidth() {
        return bitmap.getWidth();
    }

    @Override
    public int getHeight() {
        return bitmap.getHeight();
    }

    @Override
    public ImageFormat getFormat() {
        return format;
    }

    @Override
    public void dispose() {
        bitmap.recycle();
    }
}


text:
package configuration;

import java.util.Map;

/**
 *
 * @author Chandan R. Rupakheti (rupakhcr@clarkson.edu)
 */
public class ServerRoute {
	protected String plugin;
	protected String path;
	protected Map<String, String> options;

	/**
	 * Default Ctor for Xstream
	 */
	public ServerRoute() {
	}

	public ServerRoute(String plugin, String path, Map<String, String> options) {
		this.plugin = plugin;
		this.path = path;
		this.options = options;
	}

	/**
	 * @return the plugin
	 */
	public String getPlugin() {
		return plugin;
	}

	/**
	 * @param plugin
	 *            the plugin to set
	 */
	public void setPlugin(String plugin) {
		this.plugin = plugin;
	}

	/**
	 * @return the path
	 */
	public String getPath() {
		return path;
	}

	/**
	 * @param path
	 *            the path to set
	 */
	public void setPath(String path) {
		this.path = path;
	}

	/**
	 * @return the options
	 */
	public Map<String, String> getOptions() {
		return options;
	}

	/**
	 * @param options
	 *            the options to set
	 */
	public void setOptions(Map<String, String> options) {
		this.options = options;
	}

}


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

namespace System.Linq.Tests
{
    public static class Shuffler
    {
        public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> source, int seed)
        {
            return new ShuffledEnumerable<T>(source, seed);
        }

        public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> source)
        {
            return new ShuffledEnumerable<T>(source);
        }

        private class ShuffledEnumerable<T> : IEnumerable<T>
        {
            private IEnumerable<T> _source;
            private int? _seed;

            public ShuffledEnumerable(IEnumerable<T> source)
            {
                _source = source;
            }

            public ShuffledEnumerable(IEnumerable<T> source, int seed)
                : this(source)
            {
                _seed = seed;
            }

            public IEnumerator<T> GetEnumerator()
            {
                Random rnd = _seed.HasValue ? new Random(_seed.GetValueOrDefault()) : new Random();
                T[] array = _source.ToArray();
                int count = array.Length;
                for (int i = array.Length - 1; i > 0; --i)
                {
                    int j = rnd.Next(0, i + 1);
                    if (i != j)
                    {
                        T swapped = array[i];
                        array[i] = array[j];
                        array[j] = swapped;
                    }
                }
                return ((IEnumerable<T>)array).GetEnumerator();
            }

            IEnumerator IEnumerable.GetEnumerator()
            {
                return GetEnumerator();
            }
        }
    }
}


text:
class BoutiqueInventory
  def initialize(items)
    @items = items
  end

  def item_names
    items.map { |item| item[:name] }.sort
  end

  def cheap
    items.select { |item| item[:price] < 30 }
  end

  def out_of_stock
    items.select do |item|
      item[:quantity_by_size].none? { |_size, quantity| quantity.positive? }
    end
  end

  def stock_for_item(name)
    items.find { |i| i[:name] == name }[:quantity_by_size]
  end

  def total_stock
    items.sum do |item|
      item[:quantity_by_size].sum { |_, quantity| quantity }

      # This would also be acceptable, but isn't explicitly
      # taught in this exercise:
      # item[:quantity_by_size].values.sum
    end
  end

  private
  attr_reader :items
end


text:
package org.apache.kylin.common.persistence;

import java.io.IOException;
import java.util.concurrent.Callable;

import org.apache.kylin.common.KylinConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ExponentialBackoffRetry {
    private static final Logger logger = LoggerFactory.getLogger(ExponentialBackoffRetry.class);

    private final ResourceStore store;
    private final KylinConfig config;
    private final int baseSleepTimeMs;
    private final int maxSleepTimeMs;
    private long firstSleepTime;
    private int retryCount;

    public ExponentialBackoffRetry(ResourceStore store) {
        this.store = store;
        this.config = store.getConfig();
        this.baseSleepTimeMs = config.getResourceStoreReconnectBaseMs();
        this.maxSleepTimeMs = config.getResourceStoreReconnectMaxMs();
        this.retryCount = 0;
    }

    public <V> V doWithRetry(Callable<V> callable) throws IOException {
        V result = null;
        boolean done = false;

        while (!done) {
            try {
                result = callable.call();
                done = true;
            } catch (Throwable ex) {
                boolean shouldRetry = checkIfAllowRetry(ex);
                if (!shouldRetry) {
                    throwIOException(ex);
                }
            }
        }

        return result;
    }

    private void throwIOException(Throwable ex) throws IOException {
        if (ex instanceof IOException)
            throw (IOException) ex;

        if (ex instanceof RuntimeException)
            throw (RuntimeException) ex;

        if (ex instanceof Error)
            throw (Error) ex;

        throw new IOException(ex);
    }

    private boolean checkIfAllowRetry(Throwable ex) {
        if (config.isResourceStoreReconnectEnabled() && store.isUnreachableException(ex)) {
            if (isTimeOut(config.getResourceStoreReconnectTimeoutMs())) {
                logger.error("Reconnect to resource store timeout, abandoning...", ex);
                return false;
            }

            long waitMs = getSleepTimeMs();
            long seconds = waitMs / 1000;
            logger.info("Will try to re-connect after {} seconds.", seconds);
            try {
                Thread.sleep(waitMs);
            } catch (InterruptedException e) {
                throw new RuntimeException("Current thread for resource store's CRUD is interrupted, abandoning...");
            }
            increaseRetryCount();
            return true;
        }

        return false;
    }

    private long getSleepTimeMs() {
        if (retryCount == 0)
            firstSleepTime = System.currentTimeMillis();

        long ms = baseSleepTimeMs * (1L << retryCount);

        if (ms > maxSleepTimeMs)
            ms = maxSleepTimeMs;
        return ms;
    }

    private void increaseRetryCount() {
        retryCount++;
    }

    private boolean isTimeOut(long timeoutMs) {
        return retryCount != 0 && (System.currentTimeMillis() - firstSleepTime >= timeoutMs);
    }
}


text:
'use strict';

const readline = require('readline');

function ask(question: string, options: string[]): Promise<string> {
  return new Promise((resolve, reject) => {
    const iface = readline.createInterface(process.stdin, process.stdout);
    const optionsStr = options.map((o, i) => i + 1 + '. ' + o).join('\r\n');

    iface.setPrompt(question + '\r\n' + optionsStr + '\r\nChoice: ');
    iface.prompt();

    iface.on('line', (_answer: string) => {
      const answer = toInt(_answer);
      if (answer > 0 && answer <= options.length) {
        iface.close();
        resolve(options[answer - 1]);
      } else {
        iface.prompt();
      }
    });
  });
}

function toInt(n: string): number {
  const result = parseInt(n, 10);
  return isNaN(result) ? 0 : result;
}

export {ask};


text: function foo(untypedVal, numVal/*flow-include: number*/){}


text:
@interface MockFileService : KRFileService

-(NSArray*)load;

@end


text:
import unittest

import trytond.tests.test_tryton

from tests.test_sale import TestSale

def suite():
    """
    Define suite
    """
    test_suite = trytond.tests.test_tryton.suite()
    test_suite.addTests([
        unittest.TestLoader().loadTestsFromTestCase(TestSale),
    ])
    return test_suite

if __name__ == '__main__':
    unittest.TextTestRunner(verbosity=2).run(suite())


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Web.Mvc.Extensions
{
    using System;
    using System.Linq;

    using DotNetNuke.DependencyInjection.Extensions;
    using DotNetNuke.Instrumentation;
    using DotNetNuke.Web.Mvc.Framework.Controllers;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.Extensions.DependencyInjection.Extensions;

    /// <summary>
    /// Adds DNN MVC Controller Specific startup extensions to simplify the
    /// <see cref="Startup"/> Class.
    /// </summary>
    public static class StartupExtensions
    {
        private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(StartupExtensions));

        /// <summary>
        /// Configures all of the <see cref="DnnController"/>'s to be used
        /// with the Service Collection for Dependency Injection.
        /// </summary>
        /// <param name="services">
        /// Service Collection used to registering services in the container.
        /// </param>
        public static void AddMvcControllers(this IServiceCollection services)
        {
            var controllerTypes = AppDomain.CurrentDomain.GetAssemblies()
                .SelectMany(x => x.SafeGetTypes(Logger))
                .Where(x => typeof(IDnnController).IsAssignableFrom(x)
                    && x.IsClass
                    && !x.IsAbstract);
            foreach (var controller in controllerTypes)
            {
                services.TryAddTransient(controller);
            }
        }
    }
}


text:
package com.grpc.java.service;

import com.grpc.java.kernel.entity.role_info;

import java.util.List;

/**
 * Created by wx on 2017/10/27.
 */
public interface RoleService {

    role_info getId(Integer id);

    role_info getName(String name);

    Boolean add(role_info user);

    List<role_info> getAll();

    Boolean delete(Integer id);

    Boolean update(role_info user);

}


text:
  <TITLE>
  EMBOSS: tfextract
  </TITLE>

tfextract

    Function

    Description

tfextract extracts data from the TRANSFAC transcription factor database file site.dat (available from ftp://ftp.ebi.ac.uk/pub/databases/transfac/) for other EMBOSS programs, such as tfscan, that use these data. The data is split up by taxonomic groups and placed in individual files that are stored in the EMBOSS data directory.

    Usage

    Command line arguments

    Input file format

It reads in the TRANSFAC file site.dat available from:

ftp://ftp.ebi.ac.uk/pub/databases/transfac/

    Output file format

The output from tfextract is a set of files in the emboss/data
directory containing reformatted sites from the transfac database.

These files are used by the tfscan program to search for TRANSFAC sites in
sequences.

    Data files

    Notes

The TRANSFAC Database is a commercial database of eukaryotic cis-acting regulatory DNA elements and trans-acting factors. It covers the whole range from yeast to human. An old public domain version is available at: ftp://ftp.ebi.ac.uk/pub/databases/transfac/transfac32.tar.Z

TRANSFAC started in 1988 with a printed compilation (Nucleic Acids Res. 16: 1879-1902, 1988) and was transferred into computer-readable format in 1990 (BioTechForum - Advances in Molecular Genetics (J. Collins, A.J. Driesel, eds.) 4:95-108, 1991). The basic structures of Table 1 and 2 of the compilation were taken as the core of the emergent database. The aim of the early compilation as well as of the TRANSFAC database is:

   1. to guide through a meanwhile overwhelming amount of data in a field which is connected to nearly all areas of modern molecular biology;
   2. to map the regulatory sites in the individual genes and, ultimately, in the genome(s) as a whole;
   3. to develop a tool for the identification of regulatory elements in newly unravelled genomic sequences;
   4. to provide a basis for a more comprehensive understanding of how the genome governs transcriptional control.

The program tfextract extracts data from the TRANSFAC database file <tt>site.dat</tt>. This file contains information on individual (putatively) regulatory protein binding sites. About half of these refer to sites within eukaryotic genes. Just under half of them resulted from mutagenesis studies, in vitro selection procedures starting from random oligonucleotide mixtures or from specific theoretical considerations. And finally, there are about 5% with consensus binding sequences given in the IUPAC code, many of them being taken from the compilation of Faisst and Meyer (Nucleic Acids Res. 20:3-26, 1992). A number of consensi have been generated by the TRANSFAC team, generally derived from the profiles stored in the MATRIX table.

The data is split up by taxonomic groups:

Fungi

Insects

Plants

Vertebrates

Other

and placed in individual files:

tffungi

tfinsect

tfplant

tfvertebrate

tfother

These files are stored in the EMBOSS data directory, see Data Files below.

    References

Nucleic Acids Res. 16: 1879-1902, 1988

BioTechForum - Advances in Molecular Genetics (J.  Collins,A.J.
Driesel, eds.) 4:95-108, 1991

Nucleic Acids Res. 20:3-26, 1992

    Warnings

None.

    Diagnostic Error Messages

None.

    Exit status

It always exits with a status of 0.

    Known bugs

None.

    Author(s)

    History

    Target users

    Comments