text:
"""
    Kubernetes

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

    OpenAPI spec version: v1.6.1

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from pprint import pformat
from six import iteritems
import re

class V1GCEPersistentDiskVolumeSource(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, fs_type=None, partition=None, pd_name=None, read_only=None):
        """
        V1GCEPersistentDiskVolumeSource - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'fs_type': 'str',
            'partition': 'int',
            'pd_name': 'str',
            'read_only': 'bool'
        }

        self.attribute_map = {
            'fs_type': 'fsType',
            'partition': 'partition',
            'pd_name': 'pdName',
            'read_only': 'readOnly'
        }

        self._fs_type = fs_type
        self._partition = partition
        self._pd_name = pd_name
        self._read_only = read_only

    @property
    def fs_type(self):
        """
        Gets the fs_type of this V1GCEPersistentDiskVolumeSource.
        Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk

        :return: The fs_type of this V1GCEPersistentDiskVolumeSource.
        :rtype: str
        """
        return self._fs_type

    @fs_type.setter
    def fs_type(self, fs_type):
        """
        Sets the fs_type of this V1GCEPersistentDiskVolumeSource.
        Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk

        :param fs_type: The fs_type of this V1GCEPersistentDiskVolumeSource.
        :type: str
        """

        self._fs_type = fs_type

    @property
    def partition(self):
        """
        Gets the partition of this V1GCEPersistentDiskVolumeSource.
        The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk

        :return: The partition of this V1GCEPersistentDiskVolumeSource.
        :rtype: int
        """
        return self._partition

    @partition.setter
    def partition(self, partition):
        """
        Sets the partition of this V1GCEPersistentDiskVolumeSource.
        The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk

        :param partition: The partition of this V1GCEPersistentDiskVolumeSource.
        :type: int
        """

        self._partition = partition

    @property
    def pd_name(self):
        """
        Gets the pd_name of this V1GCEPersistentDiskVolumeSource.
        Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk

        :return: The pd_name of this V1GCEPersistentDiskVolumeSource.
        :rtype: str
        """
        return self._pd_name

    @pd_name.setter
    def pd_name(self, pd_name):
        """
        Sets the pd_name of this V1GCEPersistentDiskVolumeSource.
        Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk

        :param pd_name: The pd_name of this V1GCEPersistentDiskVolumeSource.
        :type: str
        """
        if pd_name is None:
            raise ValueError("Invalid value for `pd_name`, must not be `None`")

        self._pd_name = pd_name

    @property
    def read_only(self):
        """
        Gets the read_only of this V1GCEPersistentDiskVolumeSource.
        ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk

        :return: The read_only of this V1GCEPersistentDiskVolumeSource.
        :rtype: bool
        """
        return self._read_only

    @read_only.setter
    def read_only(self, read_only):
        """
        Sets the read_only of this V1GCEPersistentDiskVolumeSource.
        ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk

        :param read_only: The read_only of this V1GCEPersistentDiskVolumeSource.
        :type: bool
        """

        self._read_only = read_only

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return pformat(self.to_dict())

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other


text:
namespace IceProxy
{

namespace Ice
{

class Locator;

class LocatorRegistry;

}

}

namespace Ice
{

class Locator;
bool operator==(const Locator&, const Locator&);
bool operator<(const Locator&, const Locator&);

class LocatorRegistry;
bool operator==(const LocatorRegistry&, const LocatorRegistry&);
bool operator<(const LocatorRegistry&, const LocatorRegistry&);

}

namespace IceInternal
{

ICE_API ::Ice::Object* upCast(::Ice::Locator*);
ICE_API ::IceProxy::Ice::Object* upCast(::IceProxy::Ice::Locator*);

ICE_API ::Ice::Object* upCast(::Ice::LocatorRegistry*);
ICE_API ::IceProxy::Ice::Object* upCast(::IceProxy::Ice::LocatorRegistry*);

}

namespace Ice
{

typedef ::IceInternal::Handle< ::Ice::Locator> LocatorPtr;
typedef ::IceInternal::ProxyHandle< ::IceProxy::Ice::Locator> LocatorPrx;

ICE_API void __read(::IceInternal::BasicStream*, LocatorPrx&);
ICE_API void __patch__LocatorPtr(void*, ::Ice::ObjectPtr&);

typedef ::IceInternal::Handle< ::Ice::LocatorRegistry> LocatorRegistryPtr;
typedef ::IceInternal::ProxyHandle< ::IceProxy::Ice::LocatorRegistry> LocatorRegistryPrx;

ICE_API void __read(::IceInternal::BasicStream*, LocatorRegistryPrx&);
ICE_API void __patch__LocatorRegistryPtr(void*, ::Ice::ObjectPtr&);

}

#endif

redpajama_set_name: RedPajamaGithub


text:
package org.apache.sling.validation.impl;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;

import org.apache.commons.lang3.StringUtils;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.resource.LoginException;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ResourceResolverFactory;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.validation.ValidationResult;
import org.apache.sling.validation.ValidationService;
import org.apache.sling.validation.SlingValidationException;
import org.apache.sling.validation.model.ChildResource;
import org.apache.sling.validation.model.ParameterizedValidator;
import org.apache.sling.validation.model.ResourceProperty;
import org.apache.sling.validation.model.ValidationModel;
import org.apache.sling.validation.spi.ValidationContext;
import org.apache.sling.validation.spi.Validator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Component()
@Service()
public class ValidationServiceImpl implements ValidationService{

    /** Keys whose values are defined in the JCR resource bundle contained in the content-repository section of this bundle */
    protected static final String I18N_KEY_WRONG_PROPERTY_TYPE = "sling.validator.wrong-property-type";
    protected static final String I18N_KEY_EXPECTED_MULTIVALUE_PROPERTY = "sling.validator.multi-value-property-required";
    protected static final String I18N_KEY_MISSING_REQUIRED_PROPERTY_WITH_NAME = "sling.validator.missing-required-property-with-name";
    protected static final String I18N_KEY_MISSING_REQUIRED_PROPERTY_MATCHING_PATTERN = "sling.validator.missing-required-property-matching-pattern";
    protected static final String I18N_KEY_MISSING_REQUIRED_CHILD_RESOURCE_WITH_NAME = "sling.validator.missing-required-child-resource-with-name";
    protected static final String I18N_KEY_MISSING_REQUIRED_CHILD_RESOURCE_MATCHING_PATTERN = "sling.validator.missing-required-child-resource-matching-pattern";

    private static final Logger LOG = LoggerFactory.getLogger(ValidationServiceImpl.class);

    @Reference
    ValidationModelRetriever modelRetriever;

    Collection<String> searchPaths;

    @Reference
    private ResourceResolverFactory rrf = null;

    @Activate
    public void activate() {
        ResourceResolver rr = null;
        try {
            rr = rrf.getAdministrativeResourceResolver(null);
            searchPaths = Arrays.asList(rr.getSearchPath());
        } catch (LoginException e) {
            throw new IllegalStateException("Could not login as administrator to figure out search paths", e);
        } finally {
            if (rr != null) {
                rr.close();
            }
        }
    }

    // ValidationService ###################################################################################################################

    @SuppressWarnings("unused")
    public @CheckForNull ValidationModel getValidationModel(@Nonnull String validatedResourceType, String resourcePath, boolean considerResourceSuperTypeModels) {
        // https://bugs.eclipse.org/bugs/show_bug.cgi?id=459256
        if (validatedResourceType == null) {
            throw new IllegalArgumentException("ValidationService.getValidationModel - cannot accept null as resource type. Resource path was: " + resourcePath);
        }
        // convert to relative resource types, see https://issues.apache.org/jira/browse/SLING-4262
        validatedResourceType = getRelativeResourceType(validatedResourceType);
        return modelRetriever.getModel(validatedResourceType, resourcePath,  considerResourceSuperTypeModels);
    }

    /**
     * If the given resourceType is starting with a "/", it will strip out the leading search path from the given resource type.
     * Otherwise it will just return the given resource type (as this is already relative).
     * @param resourceType
     * @return a relative resource type (without the leading search path)
     * @throws IllegalArgumentException in case the resource type is starting with a "/" but not with any of the search paths.
     */
    @SuppressWarnings("null")
    protected @Nonnull String getRelativeResourceType(@Nonnull String resourceType) throws IllegalArgumentException {
        if (resourceType.startsWith("/")) {
            LOG.debug("try to strip the search path from the resource type");
            for (String searchPath : searchPaths) {
                if (resourceType.startsWith(searchPath)) {
                    resourceType = resourceType.substring(searchPath.length());
                    return resourceType;
                }
            }
            throw new IllegalArgumentException(
                    "Can only deal with resource types inside the resource resolver's search path ("
                            + StringUtils.join(searchPaths.toArray()) + ") but given resource type " + resourceType
                            + " is outside!");
        }
        return resourceType;
    }

    @SuppressWarnings("null")
    @Override
    public @CheckForNull ValidationModel getValidationModel(@Nonnull Resource resource, boolean considerResourceSuperTypeModels) {
        return getValidationModel(resource.getResourceType(), resource.getPath(), considerResourceSuperTypeModels);
    }

    @Override
    public @Nonnull ValidationResult validate(@Nonnull Resource resource, @Nonnull ValidationModel model) {
        return validate(resource, model, "");
    }

    protected @Nonnull ValidationResult validate(@Nonnull Resource resource, @Nonnull ValidationModel model, @Nonnull String relativePath) {
        if (resource == null || model == null || relativePath == null) {
            throw new IllegalArgumentException("ValidationService.validate - cannot accept null parameters");
        }
        CompositeValidationResult result = new CompositeValidationResult();

        // validate direct properties of the resource
        validateValueMap(resource.adaptTo(ValueMap.class), resource, relativePath, model.getResourceProperties(), result );

        // validate children resources, if any
        validateChildren(resource, relativePath, model.getChildren(), result);
        return result;
    }

    /**
     * Validates a child resource with the help of the given {@code ChildResource} entry from the validation model
     * @param resource
     * @param relativePath relativePath of the resource (must be empty or end with "/")
     * @param result
     * @param childResources
     */
    private void validateChildren(Resource resource, String relativePath, Collection<ChildResource> childResources, CompositeValidationResult result) {
        // validate children resources, if any
        for (ChildResource childResource : childResources) {
            // if a pattern is set we validate all children matching that pattern
            Pattern pattern = childResource.getNamePattern();
            if (pattern != null) {
                boolean foundMatch = false;
                for (Resource child : resource.getChildren()) {
                    Matcher matcher = pattern.matcher(child.getName());
                    if (matcher.matches()) {
                       validateChildResource(child, relativePath, childResource, result);
                       foundMatch = true;
                    }
                }
                if (!foundMatch && childResource.isRequired()) {
                    result.addFailure(relativePath, null, I18N_KEY_MISSING_REQUIRED_CHILD_RESOURCE_MATCHING_PATTERN, pattern.toString());
                }
            } else {
                Resource expectedResource = resource.getChild(childResource.getName());
                if (expectedResource != null) {
                    validateChildResource(expectedResource, relativePath, childResource, result);
                } else if (childResource.isRequired()) {
                    result.addFailure(relativePath, null, I18N_KEY_MISSING_REQUIRED_CHILD_RESOURCE_WITH_NAME, childResource.getName());
                }
            }
        }
    }

    private void validateChildResource(Resource resource, String relativePathOfParent, ChildResource childResource, CompositeValidationResult result) {
        final String relativePath;
        if (relativePathOfParent.isEmpty()) {
            relativePath = resource.getName();
        } else {
            relativePath = relativePathOfParent +  "/" + resource.getName();
        }
        validateValueMap(resource.adaptTo(ValueMap.class), resource, relativePath, childResource.getProperties(), result);
        validateChildren(resource, relativePath, childResource.getChildren(), result);
    }

    @Override
    public @Nonnull ValidationResult validate(@Nonnull ValueMap valueMap, @Nonnull ValidationModel model) {
        if (valueMap == null || model == null) {
            throw new IllegalArgumentException("ValidationResult.validate - cannot accept null parameters");
        }
        CompositeValidationResult result = new CompositeValidationResult();
        validateValueMap(valueMap, null, "", model.getResourceProperties(), result);
        return result;
    }

    @Override
    public @Nonnull ValidationResult validateResourceRecursively(@Nonnull Resource resource, boolean enforceValidation, Predicate filter, boolean considerResourceSuperTypeModels)
            throws IllegalStateException, IllegalArgumentException, SlingValidationException {
        ValidationResourceVisitor visitor = new ValidationResourceVisitor(this, resource.getPath(), enforceValidation, filter, considerResourceSuperTypeModels);
        visitor.accept(resource);
        return visitor.getResult();
    }

    private void validateValueMap(ValueMap valueMap, Resource resource, String relativePath, Collection<ResourceProperty> resourceProperties,
            CompositeValidationResult result) {
        if (valueMap == null) {
            throw new IllegalArgumentException("ValueMap may not be null");
        }
        for (ResourceProperty resourceProperty : resourceProperties) {
            Pattern pattern = resourceProperty.getNamePattern();
            if (pattern != null) {
                boolean foundMatch = false;
                for (String key : valueMap.keySet()) {
                    if (pattern.matcher(key).matches()) {
                        foundMatch = true;
                        validatePropertyValue(key, valueMap, resource, relativePath, resourceProperty, result);
                    }
                }
                if (!foundMatch && resourceProperty.isRequired()) {
                    result.addFailure(relativePath, null, I18N_KEY_MISSING_REQUIRED_PROPERTY_MATCHING_PATTERN, pattern.toString());
                }
            } else {
                validatePropertyValue(resourceProperty.getName(), valueMap, resource, relativePath, resourceProperty, result);
            }
        }
    }

    private void validatePropertyValue(String property, ValueMap valueMap, Resource resource, String relativePath, ResourceProperty resourceProperty, CompositeValidationResult result) {
        Object fieldValues = valueMap.get(property);
        if (fieldValues == null) {
            if (resourceProperty.isRequired()) {
                result.addFailure(relativePath, null, I18N_KEY_MISSING_REQUIRED_PROPERTY_WITH_NAME, property);
            }
            return;
        }
        List<ParameterizedValidator> validators = resourceProperty.getValidators();
        if (resourceProperty.isMultiple()) {
            if (!fieldValues.getClass().isArray()) {
                result.addFailure(relativePath + property, null, I18N_KEY_EXPECTED_MULTIVALUE_PROPERTY);
                return;
            }
        }

        for (ParameterizedValidator validator : validators) {
            // convert the type always to an array
            Class<?> type = validator.getType();
            if (!type.isArray()) {
                try {
                    // https://docs.oracle.com/javase/6/docs/api/java/lang/Class.html#getName%28%29 has some hints on class names
                    type = Class.forName("[L"+type.getName()+";", false, type.getClassLoader());
                } catch (ClassNotFoundException e) {
                    throw new SlingValidationException("Could not generate array class for type " + type, e);
                }
            }
            // it is already validated here that the property exists in the value map
            Object[] typedValue = (Object[])valueMap.get(property, type);
            // see https://issues.apache.org/jira/browse/SLING-4178 for why the second check is necessary
            if (typedValue == null || (typedValue.length > 0 && typedValue[0] == null)) {
                // here the missing required property case was already treated in validateValueMap
                result.addFailure(relativePath + property, validator.getSeverity(), I18N_KEY_WRONG_PROPERTY_TYPE, validator.getType());
                return;
            }

            // see https://issues.apache.org/jira/browse/SLING-662 for a description on how multivalue properties are treated with ValueMap
            if (validator.getType().isArray()) {
                // ValueMap already returns an array in both cases (property is single value or multivalue)
                validateValue(result, typedValue, property, relativePath, valueMap, resource, validator);
            } else {
                // call validate for each entry in the array (supports both singlevalue and multivalue)
                @Nonnull Object[] array = (Object[])typedValue;
                if (array.length == 1) {
                   validateValue(result, array[0], property, relativePath, valueMap, resource, validator);
                } else {
                    int n = 0;
                    for (Object item : array) {
                        validateValue(result, item, property + "[" + n++ + "]", relativePath, valueMap, resource, validator);
                    }
                }
            }
        }
    }

    @SuppressWarnings("rawtypes")
    private void validateValue(CompositeValidationResult result, @Nonnull Object value, String property, String relativePath, @Nonnull ValueMap valueMap, Resource resource, ParameterizedValidator validator) {
        try {
            @SuppressWarnings("unchecked")
            ValidationContext validationContext = new ValidationContextImpl(relativePath + property, validator.getSeverity(), valueMap, resource);
            ValidationResult validatorResult = ((Validator)validator.getValidator()).validate(value, validationContext, validator.getParameters());
            result.addValidationResult(validatorResult);
        } catch (SlingValidationException e) {
            // wrap in another SlingValidationException to include information about the property
            throw new SlingValidationException("Could not call validator " + validator
                    .getClass().getName() + " for resourceProperty " + relativePath + property, e);
        }
    }

}


text:
package org.jivesoftware.openfire.exception;

/**
 * The Class MUCServiceException.
 */
public class MUCServiceException extends Exception {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 4351720088030656859L;

	/** The ressource. */
	private String ressource;

	/** The exception. */
	private String exception;

	/**
	 * Instantiates a new mUC service exception.
	 *
	 * @param msg
	 *            the msg
	 * @param ressource
	 *            the ressource
	 * @param exception
	 *            the exception
	 */
	public MUCServiceException(String msg, String ressource, String exception) {
		super(msg);
		this.ressource = ressource;
		this.exception = exception;
	}

	/**
	 * Instantiates a new mUC service exception.
	 *
	 * @param msg
	 *            the msg
	 * @param cause
	 *            the cause
	 */
	public MUCServiceException(String msg, Throwable cause) {
		super(msg, cause);
	}

	/**
	 * Gets the ressource.
	 *
	 * @return the ressource
	 */
	public String getRessource() {
		return ressource;
	}

	/**
	 * Sets the ressource.
	 *
	 * @param ressource
	 *            the new ressource
	 */
	public void setRessource(String ressource) {
		this.ressource = ressource;
	}

	/**
	 * Gets the exception.
	 *
	 * @return the exception
	 */
	public String getException() {
		return exception;
	}

	/**
	 * Sets the exception.
	 *
	 * @param exception
	 *            the new exception
	 */
	public void setException(String exception) {
		this.exception = exception;
	}
}


text:
layout: page
title: Stone Swift Logistics Party
date: 2016-05-24
author: Gabriel Hale
tags: weekly links, java
status: published
summary: Sed ut quam venenatis, egestas eros.
banner: images/banner/wedding.jpg
booking:
  startDate: 06/03/2017
  endDate: 06/06/2017
  ctyhocn: HSVALHX
  groupCode: SSLP
published: true
---
Ut nec fermentum leo, a porttitor elit. Maecenas ultricies justo quis sapien pellentesque, lacinia consectetur erat fringilla. Donec neque diam, interdum tincidunt felis nec, suscipit condimentum urna. Nam nec iaculis arcu. Aenean bibendum suscipit erat, id tristique velit. Nulla semper volutpat magna eu ornare. Praesent eu malesuada metus. Vivamus finibus tristique sapien blandit laoreet. Fusce maximus quam nisi, in lacinia erat vehicula vitae.

* Fusce facilisis diam placerat aliquet blandit
* Vivamus porta turpis nec vehicula lobortis
* Ut tincidunt massa vel ex bibendum, quis feugiat leo porta
* Suspendisse finibus tellus vel fringilla imperdiet.

Vestibulum ac posuere justo. In eget tellus quis felis lobortis mattis. Proin lacinia quis mi ut commodo. Morbi vel lobortis ante. Aliquam tincidunt tempor gravida. Mauris lectus massa, porttitor eu semper et, feugiat vitae nunc. Morbi vitae aliquam lacus. Maecenas elementum vulputate massa vel posuere.


text:
<bill session="110" type="hr" number="165" updated="2009-01-09T08:14:11-05:00">
	<status><vote date="1171548360" datetime="2007-02-15T10:06:00-05:00" where="h" result="pass" how="without objection" roll=""/></status>

	<introduced date="1171515600" datetime="2007-02-15"/>
	<titles>
		<title type="official" as="introduced">To inform the Senate of the election of the Clerk.</title>
	</titles>
	<sponsor id="400189"/>
	<cosponsors>

	</cosponsors>
	<actions>
		<action date="1171548360" datetime="2007-02-15T10:06:00-05:00"><text>Considered as privileged matter.</text><reference label="consideration" ref="CR H1671"/></action>
		<vote date="1171548360" how="without objection" datetime="2007-02-15T10:06:00-05:00" where="h" type="vote" result="pass" ><text>On agreeing to the resolution Agreed to without objection.</text><reference label="text" ref="CR H1671"/></vote>
	</actions>
	<committees>

	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>
	<summary>
	2/15/2007--Passed House without amendment. (This measure has not been amended since it was introduced. The summary of that version is repeated here.) Informs the Senate that Lorraine C. Miller, a citizen of Texas, has been elected Clerk of the House of Representatives.<br/>
	</summary>
</bill>


text:
import React, { Component } from 'react';

class ProfileSummaryStats extends Component{
  render() {
    return (

                            <data className="number" value="4373">{this.props.userInfo.recommendations}</data>

Recommendations

                          <data className="number" value="138">138</data>

Interests

      );
  }
}

export default ProfileSummaryStats;


text:
module RecombeeApiClient
  require_relative 'request'
  require_relative '../errors'

  ##
  #Lists all the detail views of different items ever made by a given user.
  class ListUserDetailViews < ApiRequest
    attr_reader :user_id
    attr_accessor :timeout
    attr_accessor :ensure_https

  ##
  # * *Required arguments*
  #   - +user_id+ -> ID of the user whose detail views are to be listed.
  #
    def initialize(user_id)
      @user_id = user_id
      @timeout = 100000
      @ensure_https = false
    end

    # HTTP method
    def method
      :get
    end

    # Values of body parameters as a Hash
    def body_parameters
      p = Hash.new
      p
    end

    # Values of query parameters as a Hash.
    # name of parameter => value of the parameter
    def query_parameters
      params = {}
      params
    end

    # Relative path to the endpoint
    def path
      "/{databaseId}/users/#{@user_id}/detailviews/"
    end
  end
end


text:
module.exports = require('./lib/');

module.exports.Classes = {
    Player: require('./lib/classes/Player.js'),
    Team: require('./lib/classes/Team.js'),
    Round: require('./lib/classes/Round.js'),
    Scoreboard: require('./lib/classes/Scoreboard.js')
};

module.exports.Enums = {
    EOption: require('./resources/EOption.js'),
    ERoundType: require('./resources/ERoundType.js'),
    ESide: require('./resources/ESide.js')
};


text:
require 'ws_light/set/color_set'

module WSLight
  module Set
    # Creates a gradient from one color to another
    class GradientSet < ColorSet
      attr_accessor :color_from, :color_to

      def init
        @color_from = Color.new(0, 0, 0)
        @color_to = Color.new(255, 255, 255)
      end

      def frame
        @set ||= create_frame
      end

      def create_frame
        set = []
        @length.times do |i|
          set << pixel(i)
        end

        set += set.reverse if type == :double # this should be faster than generating the pixel one after another

        set
      end

      def pixel(number)
        number = @full_length - 1 - number if number >= @length
        @color_from.mix(@color_to, number.to_f / (@length - 1))
      end
    end
  end
end


text:
<?php

/**
 * MercadoPago Integration Library
 * Access MercadoPago for payments integration
 *
 * @author hcasatti
 *
 */
$GLOBALS["LIB_LOCATION"] = dirname(__FILE__);

class MP {

    const version = "0.5.2";

    private $client_id;
    private $client_secret;
    private $ll_access_token;
    private $access_data;
    private $sandbox = FALSE;

    function __construct() {
        // $this->setAccessToken('TEST-4102037510157325-030214-657a657a2db98595baafb70498e2c7b6__LD_LA__-242487625');
        $this->setAccessToken('APP_USR-4102037510157325-030214-1f8508fe76b3ec917720e4f4c7869c67__LC_LD__-242487625');
    }

    public function setAccessToken($value){
      $this->ll_access_token = $value;
    }

    public function sandbox_mode($enable = NULL) {
        if (!is_null($enable)) {
            $this->sandbox = $enable === TRUE;
        }

        return $this->sandbox;
    }

    /**
     * Get Access Token for API use
     */
    public function get_access_token() {
        if (isset ($this->ll_access_token) && !is_null($this->ll_access_token)) {
            return $this->ll_access_token;
        }

        $app_client_values = array(
            'client_id' => $this->client_id,
            'client_secret' => $this->client_secret,
            'grant_type' => 'client_credentials'
        );

        $access_data = MPRestClient::post(array(
            "uri" => "/oauth/token",
            "data" => $app_client_values,
            "headers" => array(
                "content-type" => "application/x-www-form-urlencoded"
            )
        ));

        if ($access_data["status"] != 200) {
            throw new MercadoPagoException ($access_data['response']['message'], $access_data['status']);
        }

        $this->access_data = $access_data['response'];

        return $this->access_data['access_token'];
    }

    /**
     * Get information for specific payment
     * @param int $id
     * @return array(json)
     */
    public function get_payment($id) {
        $uri_prefix = $this->sandbox ? "/sandbox" : "";

        $request = array(
            "uri" => $uri_prefix."/collections/notifications/{$id}",
            "params" => array(
                "access_token" => $this->get_access_token()
            )
        );

        $payment_info = MPRestClient::get($request);
        return $payment_info;
    }
    public function get_payment_info($id) {
        return $this->get_payment($id);
    }

    /**
     * Get information for specific authorized payment
     * @param id
     * @return array(json)
    */
    public function get_authorized_payment($id) {
        $request = array(
            "uri" => "/authorized_payments/{$id}",
            "params" => array(
                "access_token" => $this->get_access_token()
            )
        );

        $authorized_payment_info = MPRestClient::get($request);
        return $authorized_payment_info;
    }

    /**
     * Refund accredited payment
     * @param int $id
     * @return array(json)
     */
    public function refund_payment($id) {
        $request = array(
            "uri" => "/collections/{$id}",
            "params" => array(
                "access_token" => $this->get_access_token()
            ),
            "data" => array(
                "status" => "refunded"
            )
        );

        $response = MPRestClient::put($request);
        return $response;
    }

    /**
     * Cancel pending payment
     * @param int $id
     * @return array(json)
     */
    public function cancel_payment($id) {
        $request = array(
            "uri" => "/collections/{$id}",
            "params" => array(
                "access_token" => $this->get_access_token()
            ),
            "data" => array(
                "status" => "cancelled"
            )
        );

        $response = MPRestClient::put($request);
        return $response;
    }

    /**
     * Cancel preapproval payment
     * @param int $id
     * @return array(json)
     */
    public function cancel_preapproval_payment($id) {
        $request = array(
            "uri" => "/preapproval/{$id}",
            "params" => array(
                "access_token" => $this->get_access_token()
            ),
            "data" => array(
                "status" => "cancelled"
            )
        );

        $response = MPRestClient::put($request);
        return $response;
    }

    /**
     * Search payments according to filters, with pagination
     * @param array $filters
     * @param int $offset
     * @param int $limit
     * @return array(json)
     */
    public function search_payment($filters, $offset = 0, $limit = 0) {
        $filters["offset"] = $offset;
        $filters["limit"] = $limit;

        $uri_prefix = $this->sandbox ? "/sandbox" : "";

        $request = array(
            "uri" => $uri_prefix."/collections/search",
            "params" => array_merge ($filters, array(
                "access_token" => $this->get_access_token()
            ))
        );

        $collection_result = MPRestClient::get($request);
        return $collection_result;
    }

    /**
     * Create a checkout preference
     * @param array $preference
     * @return array(json)
     */
    public function create_preference($preference) {
        $request = array(
            "uri" => "/checkout/preferences",
            "params" => array(
                "access_token" => $this->get_access_token()
            ),
            "data" => $preference
        );

        $preference_result = MPRestClient::post($request);
        return $preference_result;
    }

    /**
     * Update a checkout preference
     * @param string $id
     * @param array $preference
     * @return array(json)
     */
    public function update_preference($id, $preference) {
        $request = array(
            "uri" => "/checkout/preferences/{$id}",
            "params" => array(
                "access_token" => $this->get_access_token()
            ),
            "data" => $preference
        );

        $preference_result = MPRestClient::put($request);
        return $preference_result;
    }

    /**
     * Get a checkout preference
     * @param string $id
     * @return array(json)
     */
    public function get_preference($id) {
        $request = array(
            "uri" => "/checkout/preferences/{$id}",
            "params" => array(
                "access_token" => $this->get_access_token()
            )
        );

        $preference_result = MPRestClient::get($request);
        return $preference_result;
    }

    /**
     * Create a preapproval payment
     * @param array $preapproval_payment
     * @return array(json)
     */
    public function create_preapproval_payment($preapproval_payment) {
        $request = array(
            "uri" => "/preapproval",
            "params" => array(
                "access_token" => $this->get_access_token()
            ),
            "data" => $preapproval_payment
        );

        $preapproval_payment_result = MPRestClient::post($request);
        return $preapproval_payment_result;
    }

    /**
     * Get a preapproval payment
     * @param string $id
     * @return array(json)
     */
    public function get_preapproval_payment($id) {
        $request = array(
            "uri" => "/preapproval/{$id}",
            "params" => array(
                "access_token" => $this->get_access_token()
            )
        );

        $preapproval_payment_result = MPRestClient::get($request);
        return $preapproval_payment_result;
    }

    /**
     * Update a preapproval payment
     * @param string $preapproval_payment, $id
     * @return array(json)
     */

    public function update_preapproval_payment($id, $preapproval_payment) {
        $request = array(
            "uri" => "/preapproval/{$id}",
            "params" => array(
                "access_token" => $this->get_access_token()
            ),
            "data" => $preapproval_payment
        );

        $preapproval_payment_result = MPRestClient::put($request);
        return $preapproval_payment_result;
    }

    /* Generic resource call methods */

    /**
    * Generic resource get
    * @param request
    * @param params (deprecated)
    * @param authenticate = true (deprecated)
    */
    public function get($request, $params = null, $authenticate = true) {
        if (is_string ($request)) {
            $request = array(
                "uri" => $request,
                "params" => $params,
                "authenticate" => $authenticate
            );
        }

        $request["params"] = isset ($request["params"]) && is_array ($request["params"]) ? $request["params"] : array();

        if (!isset ($request["authenticate"]) || $request["authenticate"] !== false) {
            $request["params"]["access_token"] = $this->get_access_token();
        }

        $result = MPRestClient::get($request);
        return $result;
    }

    /**
    * Generic resource post
    * @param request
    * @param data (deprecated)
    * @param params (deprecated)
    */
    public function post($request, $data = null, $params = null) {
        if (is_string ($request)) {
            $request = array(
                "uri" => $request,
                "data" => $data,
                "params" => $params
            );
        }

        $request["params"] = isset ($request["params"]) && is_array ($request["params"]) ? $request["params"] : array();

        if (!isset ($request["authenticate"]) || $request["authenticate"] !== false) {
            $request["params"]["access_token"] = $this->get_access_token();
        }

        $result = MPRestClient::post($request);
        return $result;
    }

    /**
    * Generic resource put
    * @param request
    * @param data (deprecated)
    * @param params (deprecated)
    */
    public function put($request, $data = null, $params = null) {
        if (is_string ($request)) {
            $request = array(
                "uri" => $request,
                "data" => $data,
                "params" => $params
            );
        }

        $request["params"] = isset ($request["params"]) && is_array ($request["params"]) ? $request["params"] : array();

        if (!isset ($request["authenticate"]) || $request["authenticate"] !== false) {
            $request["params"]["access_token"] = $this->get_access_token();
        }

        $result = MPRestClient::put($request);
        return $result;
    }

    /**
    * Generic resource delete
    * @param request
    * @param data (deprecated)
    * @param params (deprecated)
    */
    public function delete($request, $params = null) {
        if (is_string ($request)) {
            $request = array(
                "uri" => $request,
                "params" => $params
            );
        }

        $request["params"] = isset ($request["params"]) && is_array ($request["params"]) ? $request["params"] : array();

        if (!isset ($request["authenticate"]) || $request["authenticate"] !== false) {
            $request["params"]["access_token"] = $this->get_access_token();
        }

        $result = MPRestClient::delete($request);
        return $result;
    }

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

}

/**
 * MercadoPago cURL RestClient
 */
class MPRestClient {
    const API_BASE_URL = "https://api.mercadopago.com";

    private static function build_request($request) {
        if (!extension_loaded ("curl")) {
            throw new MercadoPagoException("cURL extension not found. You need to enable cURL in your php.ini or another configuration you have.");
        }

        if (!isset($request["method"])) {
            throw new MercadoPagoException("No HTTP METHOD specified");
        }

        if (!isset($request["uri"])) {
            throw new MercadoPagoException("No URI specified");
        }

        // Set headers
        $headers = array("accept: application/json");
        $json_content = true;
        $form_content = false;
        $default_content_type = true;

        if (isset($request["headers"]) && is_array($request["headers"])) {
            foreach ($request["headers"] as $h => $v) {
                $h = strtolower($h);
                $v = strtolower($v);

                if ($h == "content-type") {
                    $default_content_type = false;
                    $json_content = $v == "application/json";
                    $form_content = $v == "application/x-www-form-urlencoded";
                }

                array_push ($headers, $h.": ".$v);
            }
        }
        if ($default_content_type) {
            array_push($headers, "content-type: application/json");
        }

        // Build $connect
        $connect = curl_init();

        curl_setopt($connect, CURLOPT_USERAGENT, "MercadoPago PHP SDK v" . MP::version);
        curl_setopt($connect, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($connect, CURLOPT_SSL_VERIFYPEER, true);
        curl_setopt($connect, CURLOPT_CAINFO, $GLOBALS["LIB_LOCATION"] . "/cacert.pem");
        curl_setopt($connect, CURLOPT_CUSTOMREQUEST, $request["method"]);
        curl_setopt($connect, CURLOPT_HTTPHEADER, $headers);

        // Set parameters and url
        if (isset ($request["params"]) && is_array($request["params"]) && count($request["params"]) > 0) {
            $request["uri"] .= (strpos($request["uri"], "?") === false) ? "?" : "&";
            $request["uri"] .= self::build_query($request["params"]);
        }
        curl_setopt($connect, CURLOPT_URL, self::API_BASE_URL . $request["uri"]);

        // Set data
        if (isset($request["data"])) {
            if ($json_content) {
                if (gettype($request["data"]) == "string") {
                    json_decode($request["data"], true);
                } else {
                    $request["data"] = json_encode($request["data"]);
                }

                if(function_exists('json_last_error')) {
                    $json_error = json_last_error();
                    if ($json_error != JSON_ERROR_NONE) {
                        throw new MercadoPagoException("JSON Error [{$json_error}] - Data: ".$request["data"]);
                    }
                }
            } else if ($form_content) {
                $request["data"] = self::build_query($request["data"]);
            }

            curl_setopt($connect, CURLOPT_POSTFIELDS, $request["data"]);
        }

        return $connect;
    }

    private static function exec($request) {
    // private static function exec($method, $uri, $data, $content_type) {

        $connect = self::build_request($request);

        $api_result = curl_exec($connect);
        $api_http_code = curl_getinfo($connect, CURLINFO_HTTP_CODE);

        if ($api_result === FALSE) {
            throw new MercadoPagoException (curl_error ($connect));
        }

        $response = array(
            "status" => $api_http_code,
            "response" => json_decode($api_result, true)
        );

        if ($response['status'] >= 400) {
            $message = $response['response']['message'];
            if (isset ($response['response']['cause'])) {
                if (isset ($response['response']['cause']['code']) && isset ($response['response']['cause']['description'])) {
                    $message .= " - ".$response['response']['cause']['code'].': '.$response['response']['cause']['description'];
                } else if (is_array ($response['response']['cause'])) {
                    foreach ($response['response']['cause'] as $cause) {
                        $message .= " - ".$cause['code'].': '.$cause['description'];
                    }
                }
            }

            throw new MercadoPagoException ($message, $response['status']);
        }

        curl_close($connect);

        return $response;
    }

    private static function build_query($params) {
        if (function_exists("http_build_query")) {
            return http_build_query($params, "", "&");
        } else {
            foreach ($params as $name => $value) {
                $elements[] = "{$name}=" . urlencode($value);
            }

            return implode("&", $elements);
        }
    }

    public static function get($request) {
        $request["method"] = "GET";

        return self::exec($request);
    }

    public static function post($request) {
        $request["method"] = "POST";

        return self::exec($request);
    }

    public static function put($request) {
        $request["method"] = "PUT";

        return self::exec($request);
    }

    public static function delete($request) {
        $request["method"] = "DELETE";

        return self::exec($request);
    }
}

class MercadoPagoException extends Exception {
    public function __construct($message, $code = 500, Exception $previous = null) {
        // Default code 500
        parent::__construct($message, $code, $previous);
    }
}


text:
"""High-level representations of AMQP protocol objects
"""
import struct

from .serialization import AMQPReader, AMQPWriter
from .spec import FrameType, method_t
from .message import Message

class Frame:
    """AMQP frame

    A `Frame` represents the lowest-level packet of data specified by the AMQP 0.9.1
    wire-level protocol. All methods and messages are packed into one or more frames before being
    sent to the peer.

    The format of the AMQP frame is as follows::

        offset:         0      1         3         7                 size+7      size+8
                        +------+---------+---------+-------------------+-----------+
                        | type | channel |  size   |  --- payload ---  | frame-end |
                        +------+---------+---------+-------------------+-----------+
        size (bytes)        1       2         4             size             1
    """

    def __init__(self, frame_type=None, channel=0, payload=bytes()):
        """Create new Frame

        Leave all three parameters as default to create an empty frame whose `data` can be manually
        written to afterwards.

        :param frame_type: frame type
        :param channel: associated channel number
        :param payload: frame payload
        :type frame_type: int
        :type channel: int
        :type payload: bytes or bytearray
        """
        #: raw frame data; can be manually manipulated at any time
        #:
        #: :type: bytearray
        self.data = bytearray()

        self._frame_type = None
        self._channel = None
        self._payload_size = None

        # create bytearray from provided data
        if frame_type is not None:
            self._frame_type = frame_type
            self._channel = channel
            self._payload_size = len(payload)
            frame_format = '>BHI{}sB'.format(self._payload_size)
            self.data = struct.pack(frame_format, frame_type, channel, self._payload_size, payload,
                                    FrameType.END)

    @property
    def frame_type(self):
        """Get frame type

        :return: frame type
        :rtype: int
        """
        if self._frame_type is not None:
            return self._frame_type
        else:
            self._frame_type = struct.unpack_from('>B', self.data)[0]
            return self._frame_type

    @property
    def channel(self):
        """Get frame channel number

        :return: channel number
        :rtype: int
        """
        if self._channel is not None:
            return self._channel
        else:
            self._channel = struct.unpack_from('>H', self.data, 1)[0]
            return self._channel

    @property
    def payload_size(self):
        """Get frame payload size

        :return: payload size
        :rtype: int
        """
        if self._payload_size is not None:
            return self._payload_size
        else:
            self._payload_size = struct.unpack_from('>I', self.data, 3)[0]
            return self._payload_size

    @property
    def payload(self):
        """Get frame payload

        :return: payload
        :rtype: bytearray
        """
        return self.data[7:-1]

class Method:
    """AMQP method

    The AMQP 0.9.1 protocol specifies communication as sending and receiving "methods". Methods
    consist of a "class-id" and "method-id" and are represented by a `method_t` namedtuple in amqpy.
    Methods are packed into the payload of a `FrameType.METHOD` frame, and most methods can be fully
    sent in a single frame. If the method specified to be carrying content (such as a message), the
    method frame is followed by additional frames: a `FrameType.HEADER` frame, then zero or more
    `FrameType.BODY` frames.

    The format of the `FrameType.METHOD` frame's payload is as follows::

        offset:         0          2           4
                        +----------+-----------+-------------- - -
                        | class-id | method-id | arguments...
                        +----------+-----------+-------------- - -
        size (bytes):         2          2         variable

    The format of the `FrameType.HEADER` frame's payload is as follows::

        offset:         0          2        4           12               14
                        +----------+--------+-----------+----------------+------------------- - -
                        | class-id | weight | body size | property flags | property list...
                        +----------+--------+-----------+----------------+------------------- - -
        size (bytes):         2         2         8              2           variable

    The format of the `FrameType.BODY` frame's payload is simply raw binary data of the message
    body.
    """

    def __init__(self, method_type=None, args=None, content=None, channel_id=None):
        """
        :param method_type: method type
        :param args: method args
        :param content: content
        :param channel_id: the associated channel ID, if any
        :type method_type: method_t
        :type args: AMQPReader or AMQPWriter or None
        :type content: amqp.message.GenericContent or None
        :type channel_id: int or None
        """
        #: :type: amqpy.spec.method_t
        self.method_type = method_type

        if isinstance(args, (AMQPReader, AMQPWriter)):
            self.args = args
        elif args is None:
            self.args = AMQPWriter()
        else:
            raise ValueError('args must be an instance of `AMQPReader` or `AMQPWriter`')

        #: :type: amqpy.message.GenericContent or None
        self.content = content  # GenericContent if this method is carrying content
        #: :type: int
        self.channel_id = channel_id

        self._body_bytes = bytearray()  # used internally to store encoded GenericContent body
        self._expected_body_size = None  # set automatically when `load_header_frame()` is called

    def load_method_frame(self, frame):
        """Load method frame payload data

        This method is intended to be called when constructing a `Method` from incoming data.

        After calling, `self.method_type`, `self.args`, and `self.channel_id` will be loaded with
        data from the frame.

        :param frame: `FrameType.METHOD` frame
        :type frame: amqpy.proto.Frame
        """
        # noinspection PyTypeChecker
        self.method_type = method_t(*struct.unpack('>HH', frame.payload[:4]))
        self.args = AMQPReader(frame.payload[4:])
        self.channel_id = frame.channel

    def load_header_frame(self, frame):
        """Add header to partial method

        This method is intended to be called when constructing a `Method` from incoming data.

        :param frame: `FrameType.HEADER` frame
        :type frame: amqpy.proto.Frame
        """
        if not self.content:
            self.content = Message()

        # noinspection PyTypeChecker
        class_id, weight, self._expected_body_size = struct.unpack('>HHQ', frame.payload[:12])
        self.content.load_properties(frame.payload[12:])

    def load_body_frame(self, frame):
        """Add content to partial method

        This method is intended to be called when constructing a `Method` from incoming data.

        :param frame: `FrameType.BODY` frame
        :type frame: amqpy.proto.Frame
        """
        self._body_bytes.extend(frame.payload)
        if self.complete:
            self.content.body = bytes(self._body_bytes)

    @property
    def complete(self):
        """Check if the message that is carried by this method has been completely assembled,
        i.e. the expected number of bytes have been loaded

        This method is intended to be called when constructing a `Method` from incoming data.

        :return: True if method is complete, else False
        :rtype: bool
        """
        return self._expected_body_size == 0 or len(self._body_bytes) == self._expected_body_size

    def _pack_method(self):
        """Pack this method into a bytes object suitable for using as a payload for
        `FrameType.METHOD` frames

        This method is intended to be called when packing an already-completed `Method` into
        outgoing frames.

        :return: bytes
        :rtype: bytes
        """
        return struct.pack('>HH', self.method_type.class_id,
                           self.method_type.method_id) + self.args.getvalue()

    def _pack_header(self):
        """Pack this method into a bytes object suitable for using as a payload for
        `FrameType.HEADER` frames

        This method is intended to be called when packing an already-completed `Method` into
        outgoing frames.

        :return: bytes
        :rtype: bytes
        """
        if not self.content:
            raise ValueError('`_pack_header()` is only meaningful if there is content to pack')

        self._body_bytes = self.content.body
        if isinstance(self._body_bytes, str):
            # encode body to bytes
            coding = self.content.properties.setdefault('content_encoding', 'UTF-8')
            self._body_bytes = self.content.body.encode(coding)
        properties = self.content.serialize_properties()
        return struct.pack('>HHQ', self.method_type.class_id, 0, len(self._body_bytes)) + properties

    def _pack_body(self, chunk_size):
        """Pack this method into a bytes object suitable for using as a payload for
        `FrameType.BODY` frames

        This method is intended to be called when packing an already-completed `Method` into
        outgoing frames.

        :param chunk_size: split up body into pieces that are at most `chunk_size` bytes each
        :type chunk_size: int
        :return: bytes generator
        :rtype: generator[bytes]
        """
        if not self.content:
            raise ValueError('`_pack_body()` is only meaningful if there is content to pack')

        for i in range(0, len(self._body_bytes), chunk_size):
            yield self._body_bytes[i:i + chunk_size]

    def dump_method_frame(self):
        """Create a method frame

        This method is intended to be called when sending frames for an already-completed `Method`.

        :return: `FrameType.METHOD` frame
        :rtype: amqpy.proto.Frame
        """
        frame = Frame(FrameType.METHOD, self.channel_id, self._pack_method())
        return frame

    def dump_header_frame(self):
        """Create a header frame

        This method is intended to be called when sending frames for an already-completed `Method`.

        :return: `FrameType.HEADER` frame
        :rtype: amqpy.proto.Frame
        """
        frame = Frame(FrameType.HEADER, self.channel_id, self._pack_header())
        return frame

    def dump_body_frame(self, chunk_size):
        """Create a body frame

        This method is intended to be called when sending frames for an already-completed `Method`.

        :param chunk_size: body chunk size in bytes; this is typically the maximum frame size - 8
        :type chunk_size: int
        :return: generator of `FrameType.BODY` frames
        :rtype: generator[amqpy.proto.Frame]
        """
        for payload in self._pack_body(chunk_size):
            frame = Frame(FrameType.BODY, self.channel_id, payload)
            yield frame


text:
package org.unitils.reflectionassert;

import org.junit.Before;
import org.junit.Test;
import org.unitils.reflectionassert.difference.Difference;

import java.util.Calendar;

import static java.util.Calendar.DECEMBER;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.unitils.reflectionassert.ReflectionComparatorFactory.createRefectionComparator;

/**
 * Test class for {@link ReflectionComparator}. Contains tests with date types.
 *
 * @author Tim Ducheyne
 * @author Filip Neven
 */
public class ReflectionComparatorCalendarTest {

    /* Test object */
    private Calendar calendarA;
    /* Same as A but different instance */
    private Calendar calendarB;
    /* Calendar with a different value */
    private Calendar differentCalendar;

    /* Class under test */
    private ReflectionComparator reflectionComparator;

    /**
     * Initializes the test fixture.
     */
    @Before
    public void initialize() throws Exception {
        calendarA = Calendar.getInstance();
        calendarA.set(2000, DECEMBER, 5);
        calendarB = Calendar.getInstance();
        calendarB.setTime(calendarA.getTime());
        differentCalendar = Calendar.getInstance();

        reflectionComparator = createRefectionComparator();
    }

    /**
     * Test for two equal dates.
     */
    @Test
    public void testGetDifference_equals() {
        Difference result = reflectionComparator.getDifference(calendarA, calendarB);
        assertNull(result);
    }

    /**
     * Test for two different dates.
     */
    @Test
    public void testGetDifference_notEqualsDifferentValues() {
        Difference result = reflectionComparator.getDifference(calendarA, differentCalendar);

        assertEquals(calendarA, result.getLeftValue());
        assertEquals(differentCalendar, result.getRightValue());
    }
}


text:
package org.sleuthkit.autopsy.timeline.datamodel;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Sets;
import java.util.Comparator;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.SortedSet;
import javax.annotation.concurrent.Immutable;
import org.joda.time.Interval;
import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType;
import org.sleuthkit.autopsy.timeline.utils.IntervalUtils;
import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD;

/**
 * Represents a set of other (TimeLineEvent) events clustered together. All the
 * sub events should have the same type and matching descriptions at the
 * designated 'zoom level', and be 'close together' in time.
 */
@Immutable
public class EventCluster implements EventBundle<EventStripe> {

    /**
     * merge two event clusters into one new event cluster.
     *
     * @param cluster1
     * @param cluster2
     *
     * @return a new event cluster that is the result of merging the given
     *         events clusters
     */
    public static EventCluster merge(EventCluster cluster1, EventCluster cluster2) {
        if (cluster1.getEventType() != cluster2.getEventType()) {
            throw new IllegalArgumentException("event clusters are not compatible: they have different types");
        }

        if (!cluster1.getDescription().equals(cluster2.getDescription())) {
            throw new IllegalArgumentException("event clusters are not compatible: they have different descriptions");
        }
        Sets.SetView<Long> idsUnion = Sets.union(cluster1.getEventIDs(), cluster2.getEventIDs());
        Sets.SetView<Long> hashHitsUnion = Sets.union(cluster1.getEventIDsWithHashHits(), cluster2.getEventIDsWithHashHits());
        Sets.SetView<Long> taggedUnion = Sets.union(cluster1.getEventIDsWithTags(), cluster2.getEventIDsWithTags());

        return new EventCluster(IntervalUtils.span(cluster1.span, cluster2.span), cluster1.getEventType(), idsUnion, hashHitsUnion, taggedUnion, cluster1.getDescription(), cluster1.lod);
    }

    final private EventStripe parent;

    /**
     * the smallest time interval containing all the clustered events
     */
    final private Interval span;

    /**
     * the type of all the clustered events
     */
    final private EventType type;

    /**
     * the common description of all the clustered events
     */
    final private String description;

    /**
     * the description level of detail that the events were clustered at.
     */
    private final DescriptionLoD lod;

    /**
     * the set of ids of the clustered events
     */
    final private ImmutableSet<Long> eventIDs;

    /**
     * the ids of the subset of clustered events that have at least one tag
     * applied to them
     */
    private final ImmutableSet<Long> tagged;

    /**
     * the ids of the subset of clustered events that have at least one hash set
     * hit
     */
    private final ImmutableSet<Long> hashHits;

    private EventCluster(Interval spanningInterval, EventType type, Set<Long> eventIDs, Set<Long> hashHits, Set<Long> tagged, String description, DescriptionLoD lod, EventStripe parent) {

        this.span = spanningInterval;
        this.type = type;
        this.hashHits = ImmutableSet.copyOf(hashHits);
        this.tagged = ImmutableSet.copyOf(tagged);
        this.description = description;
        this.eventIDs = ImmutableSet.copyOf(eventIDs);
        this.lod = lod;
        this.parent = parent;
    }

    public EventCluster(Interval spanningInterval, EventType type, Set<Long> eventIDs, Set<Long> hashHits, Set<Long> tagged, String description, DescriptionLoD lod) {
        this(spanningInterval, type, eventIDs, hashHits, tagged, description, lod, null);
    }

    @Override
    public Optional<EventStripe> getParentBundle() {
        return Optional.ofNullable(parent);
    }

    public Interval getSpan() {
        return span;
    }

    @Override
    public long getStartMillis() {
        return span.getStartMillis();
    }

    @Override
    public long getEndMillis() {
        return span.getEndMillis();
    }

    @Override
    @SuppressWarnings("ReturnOfCollectionOrArrayField")
    public ImmutableSet<Long> getEventIDs() {
        return eventIDs;
    }

    @Override
    @SuppressWarnings("ReturnOfCollectionOrArrayField")
    public ImmutableSet<Long> getEventIDsWithHashHits() {
        return hashHits;
    }

    @Override
    @SuppressWarnings("ReturnOfCollectionOrArrayField")
    public ImmutableSet<Long> getEventIDsWithTags() {
        return tagged;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public EventType getEventType() {
        return type;
    }

    @Override
    public DescriptionLoD getDescriptionLoD() {
        return lod;
    }

    /**
     * return a new EventCluster identical to this one, except with the given
     * EventBundle as the parent.
     *
     * @param parent
     *
     * @return a new EventCluster identical to this one, except with the given
     *         EventBundle as the parent.
     */
    public EventCluster withParent(EventStripe parent) {
        if (Objects.nonNull(this.parent)) {
            throw new IllegalStateException("Event Cluster already has a parent!");
        }
        return new EventCluster(span, type, eventIDs, hashHits, tagged, description, lod, parent);
    }

    @Override
    public SortedSet< EventCluster> getClusters() {
        return ImmutableSortedSet.orderedBy(Comparator.comparing(EventCluster::getStartMillis)).add(this).build();
    }

}


text:
namespace dfmc
{

  namespace
  {
    GLuint Create(const uint16_t*const indices, const int indexCount)
    {
      GLuint id;
      const int cbIndices = sizeof(uint16_t) * indexCount;

      glGenBuffers(1, &id);
      glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id);
      glBufferData(GL_ELEMENT_ARRAY_BUFFER, cbIndices, indices, GL_STATIC_DRAW);
      glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
      return id;
    }
  }

  IndexBuffer::IndexBuffer(const uint16_t*const indices, const int indexCount)
  {
    mId = Create(indices, indexCount);
    mIndexCount = indexCount;
    mOpenGLType = GL_UNSIGNED_SHORT;
  }

  IndexBuffer::IndexBuffer(const int*const indices, const int indexCount, const IndexFormat::Enum format)
  {
    // FIX: implement support for the other index formats
    assert(format == IndexFormat::UInt16);

    uint16_t* newIndices = new uint16_t[indexCount];
    for( int i=0; i<indexCount; ++i )
    {
      assert( indices[i] >= 0 );
      assert( indices[i] <= 0xFFFF );
      newIndices[i] = static_cast<uint16_t>(indices[i]);
    }

    mId = Create(newIndices, indexCount);
    mIndexCount = indexCount;
    mOpenGLType = GL_UNSIGNED_SHORT;
  }

  void IndexBuffer::Bind()
  {
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mId);
  }

  void IndexBuffer::Unbind()
  {
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
  }

}


text:
import six
import six.moves
from six import text_type
from mwclient.util import parse_timestamp
import mwclient.page
import mwclient.image

class List(object):
    """Base class for lazy iteration over api response content

    This is a class providing lazy iteration.  This means that the
    content is loaded in chunks as long as the response hints at
    continuing content.
    """

    def __init__(self, site, list_name, prefix,
                 limit=None, return_values=None, max_items=None,
                 *args, **kwargs):
        # NOTE: Fix limit
        self.site = site
        self.list_name = list_name
        self.generator = 'list'
        self.prefix = prefix

        kwargs.update(args)
        self.args = kwargs

        if limit is None:
            limit = site.api_limit
        self.args[self.prefix + 'limit'] = text_type(limit)

        self.count = 0
        self.max_items = max_items

        self._iter = iter(six.moves.range(0))

        self.last = False
        self.result_member = list_name
        self.return_values = return_values

    def __iter__(self):
        return self

    def __next__(self):
        if self.max_items is not None:
            if self.count >= self.max_items:
                raise StopIteration
        try:
            item = six.next(self._iter)
        except StopIteration:
            if self.last:
                raise
            self.load_chunk()
            item = six.next(self._iter)

        self.count += 1
        if 'timestamp' in item:
            item['timestamp'] = parse_timestamp(item['timestamp'])

        if isinstance(self, GeneratorList):
            return item
        if type(self.return_values) is tuple:
            return tuple((item[i] for i in self.return_values))
        if self.return_values is not None:
            return item[self.return_values]
        return item

    def next(self, *args, **kwargs):
        """ For Python 2.x support """
        return self.__next__(*args, **kwargs)

    def load_chunk(self):
        """Query a new chunk of data

        If the query is empty, `raise StopIteration`.

        Else, update the iterator accordingly.

        If 'continue' is in the response, it is added to `self.args`
        (new style continuation, added in MediaWiki 1.21).

        If not, but 'query-continue' is in the response, query its
        item called `self.list_name` and add this to `self.args` (old
        style continuation).

        Else, set `self.last` to True.
        """
        data = self.site.get(
            'query', (self.generator, self.list_name),
            *[(text_type(k), v) for k, v in six.iteritems(self.args)]
        )
        if not data:
            # Non existent page
            raise StopIteration
        self.set_iter(data)

        if data.get('continue'):
            # New style continuation, added in MediaWiki 1.21
            self.args.update(data['continue'])

        elif self.list_name in data.get('query-continue', ()):
            # Old style continuation
            self.args.update(data['query-continue'][self.list_name])

        else:
            self.last = True

    def set_iter(self, data):
        """Set `self._iter` to the API response `data`."""
        if self.result_member not in data['query']:
            self._iter = iter(six.moves.range(0))
        elif type(data['query'][self.result_member]) is list:
            self._iter = iter(data['query'][self.result_member])
        else:
            self._iter = six.itervalues(data['query'][self.result_member])

    def __repr__(self):
        return "<List object '%s' for %s>" % (self.list_name, self.site)

    @staticmethod
    def generate_kwargs(_prefix, *args, **kwargs):
        kwargs.update(args)
        for key, value in six.iteritems(kwargs):
            if value is not None and value is not False:
                yield _prefix + key, value

    @staticmethod
    def get_prefix(prefix, generator=False):
        return ('g' if generator else '') + prefix

    @staticmethod
    def get_list(generator=False):
        return GeneratorList if generator else List

class NestedList(List):
    def __init__(self, nested_param, *args, **kwargs):
        super(NestedList, self).__init__(*args, **kwargs)
        self.nested_param = nested_param

    def set_iter(self, data):
        self._iter = iter(data['query'][self.result_member][self.nested_param])

class GeneratorList(List):
    """Lazy-loaded list of Page, Image or Category objects

    While the standard List class yields raw response data
    (optionally filtered based on the value of List.return_values),
    this subclass turns the data into Page, Image or Category objects.
    """

    def __init__(self, site, list_name, prefix, *args, **kwargs):
        super(GeneratorList, self).__init__(site, list_name, prefix,
                                            *args, **kwargs)

        self.args['g' + self.prefix + 'limit'] = self.args[self.prefix + 'limit']
        del self.args[self.prefix + 'limit']
        self.generator = 'generator'

        self.args['prop'] = 'info|imageinfo'
        self.args['inprop'] = 'protection'

        self.result_member = 'pages'

        self.page_class = mwclient.page.Page

    def __next__(self):
        info = super(GeneratorList, self).__next__()
        if info['ns'] == 14:
            return Category(self.site, u'', info)
        if info['ns'] == 6:
            return mwclient.image.Image(self.site, u'', info)
        return mwclient.page.Page(self.site, u'', info)

    def load_chunk(self):
        # Put this here so that the constructor does not fail
        # on uninitialized sites
        self.args['iiprop'] = 'timestamp|user|comment|url|size|sha1|metadata|archivename'
        return super(GeneratorList, self).load_chunk()

class Category(mwclient.page.Page, GeneratorList):

    def __init__(self, site, name, info=None, namespace=None):
        mwclient.page.Page.__init__(self, site, name, info)
        kwargs = {}
        kwargs['gcmtitle'] = self.name
        if namespace:
            kwargs['gcmnamespace'] = namespace
        GeneratorList.__init__(self, site, 'categorymembers', 'cm', **kwargs)

    def __repr__(self):
        return "<Category object '%s' for %s>" % (self.name.encode('utf-8'), self.site)

    def members(self, prop='ids|title', namespace=None, sort='sortkey',
                dir='asc', start=None, end=None, generator=True):
        prefix = self.get_prefix('cm', generator)
        kwargs = dict(self.generate_kwargs(prefix, prop=prop, namespace=namespace,
                                           sort=sort, dir=dir, start=start, end=end, title=self.name))
        return self.get_list(generator)(self.site, 'categorymembers', 'cm', **kwargs)

class PageList(GeneratorList):

    def __init__(self, site, prefix=None, start=None, namespace=0, redirects='all', end=None):
        self.namespace = namespace

        kwargs = {}
        if prefix:
            kwargs['gapprefix'] = prefix
        if start:
            kwargs['gapfrom'] = start
        if end:
            kwargs['gapto'] = end

        super(PageList, self).__init__(site, 'allpages', 'ap',
                                       gapnamespace=text_type(namespace),
                                       gapfilterredir=redirects,
                                       **kwargs)

    def __getitem__(self, name):
        return self.get(name, None)

    def get(self, name, info=()):
        """Return the page of name `name` as an object.

        If self.namespace is not zero, use {namespace}:{name} as the
        page name, otherwise guess the namespace from the name using
        `self.guess_namespace`.

        Returns:
            One of Category, Image or Page (default), according to namespace.
        """
        if self.namespace != 0:
            full_page_name = u"{namespace}:{name}".format(
                namespace=self.site.namespaces[self.namespace],
                name=name,
            )
            namespace = self.namespace
        else:
            full_page_name = name
            try:
                namespace = self.guess_namespace(name)
            except AttributeError:
                # raised when `namespace` doesn't have a `startswith` attribute
                namespace = 0

        cls = {
            14: Category,
            6: mwclient.image.Image,
        }.get(namespace, mwclient.page.Page)

        return cls(self.site, full_page_name, info)

    def guess_namespace(self, name):
        """Guess the namespace from name

        If name starts with any of the site's namespaces' names or
        default_namespaces, use that.  Else, return zero.

        Args:
            name (str): The pagename as a string (having `.startswith`)

        Returns:
            The id of the guessed namespace or zero.
        """
        for ns in self.site.namespaces:
            if ns == 0:
                continue
            if name.startswith(u'%s:' % self.site.namespaces[ns].replace(' ', '_')):
                return ns
            elif ns in self.site.default_namespaces:
                if name.startswith(u'%s:' % self.site.default_namespaces[ns].replace(' ', '_')):
                    return ns
        return 0

class PageProperty(List):

    def __init__(self, page, prop, prefix, *args, **kwargs):
        super(PageProperty, self).__init__(page.site, prop, prefix,
                                           titles=page.name,
                                           *args, **kwargs)
        self.page = page
        self.generator = 'prop'

    def set_iter(self, data):
        for page in six.itervalues(data['query']['pages']):
            if page['title'] == self.page.name:
                self._iter = iter(page.get(self.list_name, ()))
                return
        raise StopIteration

class PagePropertyGenerator(GeneratorList):

    def __init__(self, page, prop, prefix, *args, **kwargs):
        super(PagePropertyGenerator, self).__init__(page.site, prop, prefix,
                                                    titles=page.name,
                                                    *args, **kwargs)
        self.page = page

class RevisionsIterator(PageProperty):

    def load_chunk(self):
        if 'rvstartid' in self.args and 'rvstart' in self.args:
            del self.args['rvstart']
        return super(RevisionsIterator, self).load_chunk()


text:
package com.cookpad.puree.retryable;

import com.cookpad.puree.internal.BackoffCounter;

import org.junit.Test;
import org.junit.runner.RunWith;

import android.support.test.runner.AndroidJUnit4;

import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

@RunWith(AndroidJUnit4.class)
public class BackoffCounterTest {
    @Test
    public void time() {
        BackoffCounter backoffCounter = new BackoffCounter(10, 3);

        assertThat(backoffCounter.getRetryCount(), is(0));
        assertThat(backoffCounter.timeInMillis(), is(10L));
        assertThat(backoffCounter.isRemainingRetryCount(), is(true));

        backoffCounter.incrementRetryCount();
        assertThat(backoffCounter.getRetryCount(), is(1));
        assertThat(backoffCounter.timeInMillis(), is(20L));
        assertThat(backoffCounter.isRemainingRetryCount(), is(true));

        backoffCounter.incrementRetryCount();
        assertThat(backoffCounter.getRetryCount(), is(2));
        assertThat(backoffCounter.timeInMillis(), is(30L));
        assertThat(backoffCounter.isRemainingRetryCount(), is(true));

        backoffCounter.incrementRetryCount();
        assertThat(backoffCounter.getRetryCount(), is(3));
        assertThat(backoffCounter.timeInMillis(), is(40L));
        assertThat(backoffCounter.isRemainingRetryCount(), is(false));

        backoffCounter.resetRetryCount();
        assertThat(backoffCounter.getRetryCount(), is(0));
        assertThat(backoffCounter.timeInMillis(), is(10L));
        assertThat(backoffCounter.isRemainingRetryCount(), is(true));
    }
}


text:
#ifndef _SCRYPT_PLATFORM_H_
#define	_SCRYPT_PLATFORM_H_

#define HAVE_CONFIG_H

#if defined(CONFIG_H_FILE)
#include CONFIG_H_FILE
#elif defined(HAVE_CONFIG_H)
#include "config.h"
#else
#error Need either CONFIG_H_FILE or HAVE_CONFIG_H defined.
#endif

#endif /* !_SCRYPT_PLATFORM_H_ */


text:
/**
 * Create view with title legend
 *
 * @param container
 * @param width
 * @param height
 */
function createViewTitleAbsoluteLegend(container, width, height) {

	var view = new JenScript.View({
		name : container,
		width : width,
		height : height,
		holders : 40,
		north : 60,

	});

	var bg1 = new JenScript.GradientViewBackground();
	view.addViewBackground(bg1);
	var textureBackground = new JenScript.TexturedViewBackground({
		opacity : 0.3,
		texture : JenScript.Texture.getTriangleCarbonFiber(),
		strokeColor : 'cyan',
		strokeWidth : 2,
		cornerRadius : 0
	});
	view.addViewBackground(textureBackground);

	var gloss = new JenScript.GlossViewForeground();
	view.addViewForeground(gloss);

	var proj = new JenScript.LinearProjection({
		name : "proj1",
		minX : -1000,
		maxX : 1000,
		minY : -1000,
		maxY : 1000
	});
	view.registerProjection(proj);

	var outline = new JenScript.DeviceOutlinePlugin({
		color : 'darkslategrey'
	});
	proj.registerPlugin(outline);

	var title = new JenScript.TitleLegendPlugin({
		layout : 'absolute',
		part   : JenScript.ViewPart.Device,
		text   : 'JenSoft APIs',
		fontSize : 12,
		textColor : 'pink',
		x : 200,
		y : 20,
		textAnchor : 'middle',
		rotate : false,
		rotateAngle : 90
	});
	proj.registerPlugin(title);

	var title2 = new JenScript.TitleLegendPlugin({
		layout : 'absolute',
		part   : JenScript.ViewPart.Device,
		text   : 'JenScript',
		fontSize : 12,
		textColor : 'orange',
		x : 200,
		y : 200,
		textAnchor : 'middle',
		rotate : false,
		rotateAngle : 90
	});
	proj.registerPlugin(title2);

	var title3 = new JenScript.TitleLegendPlugin({
		layout : 'absolute',
		part   : JenScript.ViewPart.Device,
		text   : 'JenScript',
		fontSize : 10,
		textColor : 'yellow',
		x : 100,
		y : 100,
		textAnchor : 'middle',
		rotate : true,
		rotateAngle : -60
	});
	proj.registerPlugin(title3);

}


text:
package org.wso2.andes.server.queue;

import org.wso2.andes.framing.AMQShortString;
import org.wso2.andes.server.virtualhost.VirtualHost;

import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public class DefaultQueueRegistry implements QueueRegistry
{
    private ConcurrentMap<AMQShortString, AMQQueue> _queueMap = new ConcurrentHashMap<AMQShortString, AMQQueue>();

    private final VirtualHost _virtualHost;

    public DefaultQueueRegistry(VirtualHost virtualHost)
    {
        _virtualHost = virtualHost;
    }

    public VirtualHost getVirtualHost()
    {
        return _virtualHost;
    }

    public void registerQueue(AMQQueue queue)
    {
        _queueMap.put(queue.getNameShortString(), queue);
    }

    public void unregisterQueue(AMQShortString name)
    {
        _queueMap.remove(name);
    }

    public AMQQueue getQueue(AMQShortString name)
    {
        return _queueMap.get(name);
    }

    public Collection<AMQShortString> getQueueNames()
    {
        return _queueMap.keySet();
    }

    public Collection<AMQQueue> getQueues()
    {
        return _queueMap.values();
    }

    public AMQQueue getQueue(String queue)
    {
        return getQueue(new AMQShortString(queue));
    }
}


text:
package org.apache.ode.ql.eval.skel;

public interface INEvaluator<ID, R, PARAMC> extends CMPEvaluator<ID, R, PARAMC> {

}


text:
using FluentAssertions;
using NUnit.Framework;
using Tailviewer.Settings;

namespace Tailviewer.Tests.Settings
{
	[TestFixture]
	public sealed class TextSettingsTest
	{
		[Test]
		public void TestDefault()
		{
			TextSettings.Default.FontSize.Should().Be(12);
			TextSettings.Default.LineSpacing.Should().Be(3);
			TextSettings.Default.LineHeight.Should().Be(15);
			TextSettings.Default.LineNumberSpacing.Should().Be(5);
			TextSettings.Default.Typeface.Should().NotBeNull();
		}
	}
}


text:
package com.github.thomasridd.flatsy.query.matchers;

import com.github.thomasridd.flatsy.FlatsyObject;
import com.github.thomasridd.flatsy.FlatsyObjectType;
import com.jayway.jsonpath.DocumentContext;
import com.jayway.jsonpath.JsonPath;

import java.io.IOException;
import java.util.List;

/**
 * Created by Tom.Ridd on 15/08/15.
 */
public class JSONPathAtLeastOne implements FlatsyMatcher {
    String jsonPath = null;

    public JSONPathAtLeastOne(String jsonPath) {
        this.jsonPath = jsonPath;
    }

    @Override
    public boolean matches(FlatsyObject object) {
        if (object.getType() == FlatsyObjectType.Folder) { return false; } // This only applies to files

        try {
            DocumentContext context = JsonPath.parse(object.retrieveStream());
            List<Object> values = context.read(this.jsonPath);
            return values.size() >= 1;
        } catch (IOException e) {
            System.out.println("Could not assess " + object.uri + " for " + jsonPath);
            return false;
        } catch (com.jayway.jsonpath.PathNotFoundException e) {
            return false;
        }
    }
}


text:
/*
 * Leaves breadcrumbs when the user interacts with the DOM
 */
module.exports = (win = window) => ({
  load: (client) => {
    if (!('addEventListener' in win)) return
    if (!client._isBreadcrumbTypeEnabled('user')) return

    win.addEventListener('click', (event) => {
      let targetText, targetSelector
      try {
        targetText = getNodeText(event.target)
        targetSelector = getNodeSelector(event.target, win)
      } catch (e) {
        targetText = '[hidden]'
        targetSelector = '[hidden]'
        client._logger.error('Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z')
      }
      client.leaveBreadcrumb('UI click', { targetText, targetSelector }, 'user')
    }, true)
  }
})

// extract text content from a element
const getNodeText = el => {
  let text = el.textContent || el.innerText || ''
  if (!text && (el.type === 'submit' || el.type === 'button')) text = el.value
  text = text.replace(/^\s+|\s+$/g, '') // trim whitespace
  return truncate(text, 140)
}

// Create a label from tagname, id and css class of the element
function getNodeSelector (el, win) {
  const parts = [el.tagName]
  if (el.id) parts.push('#' + el.id)
  if (el.className && el.className.length) parts.push(`.${el.className.split(' ').join('.')}`)
  // Can't get much more advanced with the current browser
  if (!win.document.querySelectorAll || !Array.prototype.indexOf) return parts.join('')
  try {
    if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join('')
  } catch (e) {
    // Sometimes the query selector can be invalid just return it as-is
    return parts.join('')
  }
  // try to get a more specific selector if this one matches more than one element
  if (el.parentNode.childNodes.length > 1) {
    const index = Array.prototype.indexOf.call(el.parentNode.childNodes, el) + 1
    parts.push(`:nth-child(${index})`)
  }
  if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join('')
  // try prepending the parent node selector
  if (el.parentNode) return `${getNodeSelector(el.parentNode, win)} > ${parts.join('')}`
  return parts.join('')
}

function truncate (value, length) {
  const ommision = '(...)'
  if (value && value.length <= length) return value
  return value.slice(0, length - ommision.length) + ommision
}


text:
package com.microsoft.azure.management.appservice.v2019_08_01;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.appservice.v2019_08_01.implementation.AppServiceManager;
import com.microsoft.azure.management.appservice.v2019_08_01.implementation.ResourceHealthMetadataInner;

/**
 * Type representing ResourceHealthMetadata.
 */
public interface ResourceHealthMetadata extends HasInner<ResourceHealthMetadataInner>, HasManager<AppServiceManager> {
    /**
     * @return the category value.
     */
    String category();

    /**
     * @return the id value.
     */
    String id();

    /**
     * @return the kind value.
     */
    String kind();

    /**
     * @return the name value.
     */
    String name();

    /**
     * @return the signalAvailability value.
     */
    Boolean signalAvailability();

    /**
     * @return the type value.
     */
    String type();

}


text:
package br.com.caelum.tubaina.chunk;

import java.util.List;

import br.com.caelum.tubaina.Chunk;
import br.com.caelum.tubaina.CompositeChunk;

public class TableColumnChunk extends CompositeChunk<TableColumnChunk> {

	public TableColumnChunk(List<Chunk> cell) {
		super(cell);
	}
}


text:
Convert an RGB itk::Image to vtkImageData
=========================================

.. index::
   single: ImageToVTKImageFilter

Synopsis
--------

Convert an itk::Image with RGB pixels to vtkImageData. This transfers the image
buffer data along with image size, pixel spacing, and origin. Since
`vtkImageData` does not yet support an orientation matrix, the direction
cosines are lost. This requires `Module_ITKVtkGlue` to be turned on in ITK's
CMake configuration.

Results
-------

Output::

  vtkImageData (0x35dc400)
    Debug: Off
    Modified Time: 242
    Reference Count: 2
    Registered Events: (none)
    Information: 0x35dc590
    Data Released: False
    Global Release Data: Off
    UpdateTime: 243
    Field Data:
      Debug: Off
      Modified Time: 187
      Reference Count: 1
      Registered Events: (none)
      Number Of Arrays: 0
      Number Of Components: 0
      Number Of Tuples: 0
    Number Of Points: 20574
    Number Of Cells: 20286
    Cell Data:
      Debug: Off
      Modified Time: 195
      Reference Count: 1
      Registered Events: (none)
      Number Of Arrays: 0
      Number Of Components: 0
      Number Of Tuples: 0
      Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
      Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
      Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
      Scalars: (none)
      Vectors: (none)
      Normals: (none)
      TCoords: (none)
      Tensors: (none)
      GlobalIds: (none)
      PedigreeIds: (none)
      EdgeFlag: (none)
    Point Data:
      Debug: Off
      Modified Time: 242
      Reference Count: 1
      Registered Events: (none)
      Number Of Arrays: 1
      Array 0 name = scalars
      Number Of Components: 3
      Number Of Tuples: 20574
      Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
      Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
      Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
      Scalars:
        Debug: Off
        Modified Time: 242
        Reference Count: 1
        Registered Events: (none)
        Name: scalars
        Data type: unsigned char
        Size: 61722
        MaxId: 61721
        NumberOfComponents: 3
        Information: 0
        Name: scalars
        Number Of Components: 3
        Number Of Tuples: 20574
        Size: 61722
        MaxId: 61721
        LookupTable: (none)
        Array: 0x35c3430
      Vectors: (none)
      Normals: (none)
      TCoords: (none)
      Tensors: (none)
      GlobalIds: (none)
      PedigreeIds: (none)
      EdgeFlag: (none)
    Bounds:
      Xmin,Xmax: (0, 126)
      Ymin,Ymax: (0, 161)
      Zmin,Zmax: (0, 0)
    Compute Time: 256
    Spacing: (1, 1, 1)
    Origin: (0, 0, 0)

Code
----

Python
......

.. literalinclude:: Code.py
   :language: python
   :lines: 1, 16-

C++
...

.. literalinclude:: Code.cxx
   :lines: 18-

Classes demonstrated
--------------------

.. breathelink:: itk::ImageToVTKImageFilter


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.keyvault.generated;

import com.azure.core.util.Context;

/** Samples for MhsmPrivateEndpointConnections ListByResource. */
public final class MhsmPrivateEndpointConnectionsListByResourceSamples {
    /*
     * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_ListPrivateEndpointConnectionsByResource.json
     */
    /**
     * Sample code: List managed HSM Pools in a subscription.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void listManagedHSMPoolsInASubscription(com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .vaults()
            .manager()
            .serviceClient()
            .getMhsmPrivateEndpointConnections()
            .listByResource("sample-group", "sample-mhsm", Context.NONE);
    }
}


text:
#include <stddef.h>
#include <time.h>
#include "pppd.h"

char pppd_version[] = VERSION;

static int minconnect = 0;

static option_t my_options[] = {
	{ "minconnect", o_int, &minconnect,
	  "Set minimum connect time before idle timeout applies" },
	{ NULL }
};

static int my_get_idle(struct ppp_idle *idle)
{
	time_t t;

	if (idle == NULL)
		return minconnect? minconnect: idle_time_limit;
	t = idle->xmit_idle;
	if (idle->recv_idle < t)
		t = idle->recv_idle;
	return idle_time_limit - t;
}

void plugin_init(void)
{
	info("plugin_init");
	add_options(my_options);
	idle_time_hook = my_get_idle;
}


text:
<?php

namespace MAT\SitioBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use MAT\SitioBundle\Entity\Destacado;
use MAT\SitioBundle\Form\DestacadoType;

/**
 * Destacado controller.
 *
 * @Route("/destacado")
 */
class DestacadoController extends Controller
{
    /**
     * Lists all Destacado entities.
     *
     * @Route("/", name="destacado_index")
     * @Method("GET")
     */
    public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

        $destacados = $em->getRepository('SitioBundle:Destacado')->findAll();

        return $this->render('destacado/index.html.twig', array(
            'destacados' => $destacados,
        ));
    }

    /**
     * Creates a new Destacado entity.
     *
     * @Route("/new", name="destacado_new")
     * @Method({"GET", "POST"})
     */
    public function newAction(Request $request)
    {
        $destacado = new Destacado();
        $form = $this->createForm('MAT\SitioBundle\Form\DestacadoType', $destacado);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
        	   /*agregar para que el usuario logueado sea el dueño de la noticia*/
                $userId= $this->getUser()->getId();
                $em = $this->getDoctrine()->getManager();
                $form->getdata()->setIdUsuario( $id_usuario = $em->getReference('MAT\SitioBundle\Entity\Usuario', $userId));
        // fin usuario logueado

            $em = $this->getDoctrine()->getManager();
            $em->persist($destacado);
            $em->flush();

            return $this->redirectToRoute('destacado_index', array('id' => $destacado->getId()));
        }

        return $this->render('destacado/new.html.twig', array(
            'destacado' => $destacado,
            'form' => $form->createView(),
        ));
    }

    /**
     * Finds and displays a Destacado entity.
     *
     * @Route("/{id}", name="destacado_show")
     * @Method("GET")
     */
    public function showAction(Destacado $destacado)
    {
        $deleteForm = $this->createDeleteForm($destacado);

        return $this->render('destacado/show.html.twig', array(
            'destacado' => $destacado,
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Displays a form to edit an existing Destacado entity.
     *
     * @Route("/{id}/edit", name="destacado_edit")
     * @Method({"GET", "POST"})
     */
    public function editAction(Request $request, Destacado $destacado)
    {
        $deleteForm = $this->createDeleteForm($destacado);
        $editForm = $this->createForm('MAT\SitioBundle\Form\DestacadoType', $destacado);
        $editForm->handleRequest($request);

        if ($editForm->isSubmitted() && $editForm->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($destacado);
            $em->flush();

            return $this->redirectToRoute('destacado_index', array('id' => $destacado->getId()));
        }

        return $this->render('destacado/edit.html.twig', array(
            'destacado' => $destacado,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Deletes a Destacado entity.
     *
     * @Route("/{id}", name="destacado_delete")
     * @Method("DELETE")
     */
    public function deleteAction(Request $request, Destacado $destacado)
    {
        $form = $this->createDeleteForm($destacado);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->remove($destacado);
            $em->flush();
        }

        return $this->redirectToRoute('destacado_index');
    }

    /**
     * Creates a form to delete a Destacado entity.
     *
     * @param Destacado $destacado The Destacado entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm(Destacado $destacado)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('destacado_delete', array('id' => $destacado->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }

     public function getDestacadoAction($pagina)
    {
        $response = new Response();;
        /*$response->headers->set('Access-Control-Allow-Headers', 'origin, content-type, accept');
        $response->headers->set('Access-Control-Allow-Origin', '*');
        $response->headers->set('Access-Control-Allow-Methods', 'POST, GET, PUT, DELETE, PATCH, OPTIONS');
        $response->send();*/
    $em = $this->getDoctrine()->getManager();
    $qb = $em->createQueryBuilder('i');
     $results = $em->createQuery('SELECT i FROM SitioBundle:Destacado i'
                           . ' ORDER BY i.id DESC')
                    //->setParameters($parameters)
                    ->setFirstResult($pagina)
                    ->setMaxResults(1)
                    ->getResult();
               return $results;
    }

}