text:
#ifndef __ASM_ARM_THREAD_INFO_H
#define __ASM_ARM_THREAD_INFO_H

#ifdef __KERNEL__

#include <linux/compiler.h>
#include <asm/fpstate.h>
#include <asm/page.h>

#define THREAD_SIZE_ORDER	1
#define THREAD_SIZE		(PAGE_SIZE << THREAD_SIZE_ORDER)
#define THREAD_START_SP		(THREAD_SIZE - 8)

#ifndef __ASSEMBLY__

struct task_struct;

#include <asm/types.h>

typedef unsigned long mm_segment_t;

struct cpu_context_save {
	__u32	r4;
	__u32	r5;
	__u32	r6;
	__u32	r7;
	__u32	r8;
	__u32	r9;
	__u32	sl;
	__u32	fp;
	__u32	sp;
	__u32	pc;
	__u32	extra[2];		/* Xscale 'acc' register, etc */
};

/*
 * low level task data that entry.S needs immediate access to.
 * __switch_to() assumes cpu_context follows immediately after cpu_domain.
 */
struct thread_info {
	unsigned long		flags;		/* low level flags */
	int			preempt_count;	/* 0 => preemptable, <0 => bug */
	mm_segment_t		addr_limit;	/* address limit */
	struct task_struct	*task;		/* main task structure */
	__u32			cpu;		/* cpu */
	__u32			cpu_domain;	/* cpu domain */
	struct cpu_context_save	cpu_context;	/* cpu context */
	__u32			syscall;	/* syscall number */
	__u8			used_cp[16];	/* thread used copro */
	unsigned long		tp_value[2];	/* TLS registers */
#ifdef CONFIG_CRUNCH
	struct crunch_state	crunchstate;
#endif
	union fp_state		fpstate __attribute__((aligned(8)));
	union vfp_state		vfpstate;
#ifdef CONFIG_ARM_THUMBEE
	unsigned long		thumbee_state;	/* ThumbEE Handler Base register */
#endif
};

#define INIT_THREAD_INFO(tsk)						\
{									\
	.task		= &tsk,						\
	.flags		= 0,						\
	.preempt_count	= INIT_PREEMPT_COUNT,				\
	.addr_limit	= KERNEL_DS,					\
}

#define init_thread_info	(init_thread_union.thread_info)
#define init_stack		(init_thread_union.stack)

/*
 * how to get the current stack pointer in C
 */
register unsigned long current_stack_pointer asm ("sp");

/*
 * how to get the thread information struct from C
 */
static inline struct thread_info *current_thread_info(void) __attribute_const__;

static inline struct thread_info *current_thread_info(void)
{
	return (struct thread_info *)
		(current_stack_pointer & ~(THREAD_SIZE - 1));
}

#define thread_saved_pc(tsk)	\
	((unsigned long)(task_thread_info(tsk)->cpu_context.pc))
#define thread_saved_sp(tsk)	\
	((unsigned long)(task_thread_info(tsk)->cpu_context.sp))

#ifndef CONFIG_THUMB2_KERNEL
#define thread_saved_fp(tsk)	\
	((unsigned long)(task_thread_info(tsk)->cpu_context.fp))
#else
#define thread_saved_fp(tsk)	\
	((unsigned long)(task_thread_info(tsk)->cpu_context.r7))
#endif

extern void crunch_task_disable(struct thread_info *);
extern void crunch_task_copy(struct thread_info *, void *);
extern void crunch_task_restore(struct thread_info *, void *);
extern void crunch_task_release(struct thread_info *);

extern void iwmmxt_task_disable(struct thread_info *);
extern void iwmmxt_task_copy(struct thread_info *, void *);
extern void iwmmxt_task_restore(struct thread_info *, void *);
extern void iwmmxt_task_release(struct thread_info *);
extern void iwmmxt_task_switch(struct thread_info *);

extern void vfp_sync_hwstate(struct thread_info *);
extern void vfp_flush_hwstate(struct thread_info *);

struct user_vfp;
struct user_vfp_exc;

extern int vfp_preserve_user_clear_hwstate(struct user_vfp __user *,
					   struct user_vfp_exc __user *);
extern int vfp_restore_user_hwstate(struct user_vfp __user *,
				    struct user_vfp_exc __user *);
#endif

/*
 * thread information flags:
 *  TIF_USEDFPU		- FPU was used by this task this quantum (SMP)
 *  TIF_POLLING_NRFLAG	- true if poll_idle() is polling TIF_NEED_RESCHED
 */
#define TIF_SIGPENDING		0	/* signal pending */
#define TIF_NEED_RESCHED	1	/* rescheduling necessary */
#define TIF_NOTIFY_RESUME	2	/* callback before returning to user */
#define TIF_UPROBE		3	/* breakpointed or singlestepping */
#define TIF_SYSCALL_TRACE	4	/* syscall trace active */
#define TIF_SYSCALL_AUDIT	5	/* syscall auditing active */
#define TIF_SYSCALL_TRACEPOINT	6	/* syscall tracepoint instrumentation */
#define TIF_SECCOMP		7	/* seccomp syscall filtering active */

#define TIF_NOHZ		12	/* in adaptive nohz mode */
#define TIF_USING_IWMMXT	17
#define TIF_MEMDIE		18	/* is terminating due to OOM killer */
#define TIF_RESTORE_SIGMASK	20

#define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
#define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
#define _TIF_UPROBE		(1 << TIF_UPROBE)
#define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
#define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
#define _TIF_SYSCALL_TRACEPOINT	(1 << TIF_SYSCALL_TRACEPOINT)
#define _TIF_SECCOMP		(1 << TIF_SECCOMP)
#define _TIF_USING_IWMMXT	(1 << TIF_USING_IWMMXT)

/* Checks for any syscall work in entry-common.S */
#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
			   _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP)

/*
 * Change these and you break ASM code in entry-common.S
 */
#define _TIF_WORK_MASK		(_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
				 _TIF_NOTIFY_RESUME | _TIF_UPROBE)

#endif /* __KERNEL__ */
#endif /* __ASM_ARM_THREAD_INFO_H */


text:
// generated code: api commands

package commands

import (
	"fmt"
	"io"
	"os"
	"strings"

	api_client "github.com/skelterjohn/gcloud_apis/clients/genomics/v1alpha2"
	"github.com/skelterjohn/gcloud_apis/commands_util"
)

// some generated code may not use all imported libs
var _ = fmt.Println
var _ = io.Copy
var _ = os.Stdin
var _ = strings.Split

func Genomics_v1alpha2_OperationsCancel(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("name"))

		if len(pathParams) != 0 {
			if strings.Contains("v1alpha2/{+name}:cancel", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [REQUEST_FILE|-] [--REQUEST_KEY=VALUE]*"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
		commands_util.PrintRequestExample(&api_client.CancelOperationRequest{})

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewOperationsService(api_service)

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	// Only positional arguments should remain in args.
	if len(args) == 0 || len(args) > 2 {
		usageFunc()
	}

	request := &api_client.CancelOperationRequest{}
	if len(args) == 2 {
		err = commands_util.PopulateRequestFromFilename(&request, args[1])
		if err != nil {
			return err
		}
	}

	keyValues := flagValues

	err = commands_util.OverwriteRequestWithValues(&request, keyValues)
	if err != nil {
		return err
	}

	expectedParams := []string{
		"name",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_name, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}

	call := service.Cancel(param_name,
		request,
	)

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
}

func Genomics_v1alpha2_OperationsGet(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("name"))

		if len(pathParams) != 0 {
			if strings.Contains("v1alpha2/{+name}", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewOperationsService(api_service)

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{
		"name",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_name, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}

	call := service.Get(param_name)

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
}

func Genomics_v1alpha2_OperationsList(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("name"))

		if len(pathParams) != 0 {
			if strings.Contains("v1alpha2/{+name}", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [--filter=VALUE]"

		usageBits += " [--pageSize=VALUE]"

		usageBits += " [--pageToken=VALUE]"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewOperationsService(api_service)

	queryParamNames := map[string]bool{
		"filter":    false,
		"pageSize":  false,
		"pageToken": false,
	}

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	for k, r := range queryParamNames {
		if _, ok := flagValues[k]; r && !ok {
			return fmt.Errorf("missing required flag %q", "--"+k)
		}
	}

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{
		"name",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_name, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}

	call := service.List(param_name)

	// Set query parameters.
	if value, ok := flagValues["filter"]; ok {
		query_filter, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.Filter(query_filter)
	}
	if value, ok := flagValues["pageSize"]; ok {
		query_pageSize, err := commands_util.ConvertValue_int64(value)
		if err != nil {
			return err
		}
		call.PageSize(query_pageSize)
	}
	if value, ok := flagValues["pageToken"]; ok {
		query_pageToken, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.PageToken(query_pageToken)
	}

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
}

func Genomics_v1alpha2_PipelinesCreate(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string

		if len(pathParams) != 0 {
			if strings.Contains("v1alpha2/pipelines", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [REQUEST_FILE|-] [--REQUEST_KEY=VALUE]*"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
		commands_util.PrintRequestExample(&api_client.Pipeline{})

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewPipelinesService(api_service)

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	// Only positional arguments should remain in args.
	if len(args) == 0 || len(args) > 2 {
		usageFunc()
	}

	request := &api_client.Pipeline{}
	if len(args) == 2 {
		err = commands_util.PopulateRequestFromFilename(&request, args[1])
		if err != nil {
			return err
		}
	}

	keyValues := flagValues

	err = commands_util.OverwriteRequestWithValues(&request, keyValues)
	if err != nil {
		return err
	}

	expectedParams := []string{}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	call := service.Create(
		request,
	)

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
}

func Genomics_v1alpha2_PipelinesDelete(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("pipelineId"))

		if len(pathParams) != 0 {
			if strings.Contains("v1alpha2/pipelines/{pipelineId}", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewPipelinesService(api_service)

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{
		"pipelineId",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_pipelineId, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}

	call := service.Delete(param_pipelineId)

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
}

func Genomics_v1alpha2_PipelinesGet(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string
		pathParams = append(pathParams, commands_util.AngrySnakes("pipelineId"))

		if len(pathParams) != 0 {
			if strings.Contains("v1alpha2/pipelines/{pipelineId}", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewPipelinesService(api_service)

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{
		"pipelineId",
	}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	param_pipelineId, err := commands_util.ConvertValue_string(paramValues[0])
	if err != nil {
		return err
	}

	call := service.Get(param_pipelineId)

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
}

func Genomics_v1alpha2_PipelinesGetControllerConfig(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string

		if len(pathParams) != 0 {
			if strings.Contains("v1alpha2/pipelines:getControllerConfig", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [--operationId=VALUE]"

		usageBits += " [--validationToken=VALUE]"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewPipelinesService(api_service)

	queryParamNames := map[string]bool{
		"operationId":     false,
		"validationToken": false,
	}

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	for k, r := range queryParamNames {
		if _, ok := flagValues[k]; r && !ok {
			return fmt.Errorf("missing required flag %q", "--"+k)
		}
	}

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	call := service.GetControllerConfig()

	// Set query parameters.
	if value, ok := flagValues["operationId"]; ok {
		query_operationId, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.OperationId(query_operationId)
	}
	if value, ok := flagValues["validationToken"]; ok {
		query_validationToken, err := commands_util.ConvertValue_uint64(value)
		if err != nil {
			return err
		}
		call.ValidationToken(query_validationToken)
	}

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
}

func Genomics_v1alpha2_PipelinesList(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string

		if len(pathParams) != 0 {
			if strings.Contains("v1alpha2/pipelines", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [--namePrefix=VALUE]"

		usageBits += " [--pageSize=VALUE]"

		usageBits += " [--pageToken=VALUE]"

		usageBits += " [--projectId=VALUE]"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewPipelinesService(api_service)

	queryParamNames := map[string]bool{
		"namePrefix": false,
		"pageSize":   false,
		"pageToken":  false,
		"projectId":  false,
	}

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	for k, r := range queryParamNames {
		if _, ok := flagValues[k]; r && !ok {
			return fmt.Errorf("missing required flag %q", "--"+k)
		}
	}

	// Only positional arguments should remain in args.
	if len(args) != 1 {
		usageFunc()
	}

	expectedParams := []string{}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	call := service.List()

	// Set query parameters.
	if value, ok := flagValues["namePrefix"]; ok {
		query_namePrefix, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.NamePrefix(query_namePrefix)
	}
	if value, ok := flagValues["pageSize"]; ok {
		query_pageSize, err := commands_util.ConvertValue_int64(value)
		if err != nil {
			return err
		}
		call.PageSize(query_pageSize)
	}
	if value, ok := flagValues["pageToken"]; ok {
		query_pageToken, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.PageToken(query_pageToken)
	}
	if value, ok := flagValues["projectId"]; ok {
		query_projectId, err := commands_util.ConvertValue_string(value)
		if err != nil {
			return err
		}
		call.ProjectId(query_projectId)
	}

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
}

func Genomics_v1alpha2_PipelinesRun(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string

		if len(pathParams) != 0 {
			if strings.Contains("v1alpha2/pipelines:run", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [REQUEST_FILE|-] [--REQUEST_KEY=VALUE]*"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
		commands_util.PrintRequestExample(&api_client.RunPipelineRequest{})

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewPipelinesService(api_service)

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	// Only positional arguments should remain in args.
	if len(args) == 0 || len(args) > 2 {
		usageFunc()
	}

	request := &api_client.RunPipelineRequest{}
	if len(args) == 2 {
		err = commands_util.PopulateRequestFromFilename(&request, args[1])
		if err != nil {
			return err
		}
	}

	keyValues := flagValues

	err = commands_util.OverwriteRequestWithValues(&request, keyValues)
	if err != nil {
		return err
	}

	expectedParams := []string{}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	call := service.Run(
		request,
	)

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
}

func Genomics_v1alpha2_PipelinesSetOperationStatus(context Context, args ...string) error {

	usageFunc := func() {
		usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
		var pathParams []string

		if len(pathParams) != 0 {
			if strings.Contains("v1alpha2/pipelines:setOperationStatus", "+") {
				usageBits += " @" + strings.Join(pathParams, "@")
			} else {
				usageBits += " " + strings.Join(pathParams, "/")
			}
		}

		usageBits += " [REQUEST_FILE|-] [--REQUEST_KEY=VALUE]*"

		fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
		commands_util.PrintRequestExample(&api_client.SetOperationStatusRequest{})

		os.Exit(1)
	}

	api_service, err := api_client.New(context.Client)
	if err != nil {
		return err
	}
	service := api_client.NewPipelinesService(api_service)

	args, flagValues, err := commands_util.ExtractFlagValues(args)
	if err != nil {
		return err
	}

	// Only positional arguments should remain in args.
	if len(args) == 0 || len(args) > 2 {
		usageFunc()
	}

	request := &api_client.SetOperationStatusRequest{}
	if len(args) == 2 {
		err = commands_util.PopulateRequestFromFilename(&request, args[1])
		if err != nil {
			return err
		}
	}

	keyValues := flagValues

	err = commands_util.OverwriteRequestWithValues(&request, keyValues)
	if err != nil {
		return err
	}

	expectedParams := []string{}
	paramValues := commands_util.SplitParamValues(args[0])
	if len(paramValues) != len(expectedParams) {
		return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
	}

	call := service.SetOperationStatus(
		request,
	)

	response, err := call.Do()
	if err != nil {
		return err
	}

	err = commands_util.PrintResponse(response)
	if err != nil {
		return err
	}

	return nil
}

redpajama_set_name: RedPajamaGithub


text:
      List of module_names

        Posted on

        by

        Deleted User

    No module_names yet, why don't you create one?


text:
package org.rabix.backend.tes.service.impl;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.configuration.Configuration;
import org.rabix.backend.tes.config.TESConfig;
import org.rabix.backend.tes.service.TESStorageException;
import org.rabix.backend.tes.service.TESStorageService;
import org.rabix.bindings.BindingException;
import org.rabix.bindings.helper.FileValueHelper;
import org.rabix.bindings.model.DirectoryValue;
import org.rabix.bindings.model.FileValue;
import org.rabix.bindings.model.FileValue.FileType;
import org.rabix.bindings.model.Job;
import org.rabix.bindings.transformer.FileTransformer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.inject.Inject;

public class LocalTESStorageServiceImpl implements TESStorageService {

  private final static Logger logger = LoggerFactory.getLogger(LocalTESStorageServiceImpl.class);

  private Path localFileStorage;
  private Path storageBase;

  @Inject
  public LocalTESStorageServiceImpl(Configuration configuration) {
    localFileStorage = Paths.get(configuration.getString("backend.execution.directory"));
    String storageConfig = configuration.getString(TESConfig.STORAGE_BASE, localFileStorage.toString());
    URI uri = URI.create(storageConfig);
    if (uri.getScheme() == null) {
      try {
        uri = new URI("file", uri.toString(), null);
      } catch (URISyntaxException e) {
        logger.error("Failed to parse storage path", e);
      }
    }
    storageBase = Paths.get(uri);
  }

  @Override
  public Job transformInputFiles(Job job) throws BindingException {
    try {
      Path workdir = workDir(job);
      List<FileValue> flat = new ArrayList<>();
      return FileValueHelper.updateInputFiles(job, new FileTransformer() {
        @Override
        public FileValue transform(FileValue fileValue) throws BindingException {
          try {
            stageFile(workdir, fileValue, flat);
          } catch (TESStorageException e) {
            throw new BindingException(e.getMessage());
          }
          return fileValue;
        }
      });
    } catch (BindingException e) {
      logger.error("Failed to stage input files", e);
      throw new BindingException("Failed to stage input files", e);
    }
  }

  public List<FileValue> stageFile(Path workdir, FileValue fileValue) throws TESStorageException {
    ArrayList<FileValue> flat = new ArrayList<>();
    this.stageFile(workdir, fileValue, flat);
    return flat;
  }

  public void stageFile(Path workdir, FileValue fileValue, List<FileValue> flat) throws TESStorageException {
    String path = fileValue.getPath();
    String location = fileValue.getLocation();
    URI locationUri;
    Path locationPath;
    if (location == null) {
      locationPath = Paths.get(path);
      locationUri = locationPath.toUri();
      fileValue.setLocation(locationUri.toString());
    } else {
      locationUri = URI.create(location);
      locationPath = Paths.get(locationUri);
    }
    if ((location == null || locationUri.getScheme().equals("file")) && !fileValue.getType().equals(FileType.Directory)) {
      try {
        Path staged = workdir.resolveSibling("stagedinputs" + workdir.hashCode() + "/" + path).normalize();
        if (!Files.exists(staged)) {
          Files.createDirectories(staged.getParent());
          Files.copy(locationPath, staged);
        }
        fileValue.setLocation(staged.toUri().toString());
      } catch (IOException e) {
        throw new TESStorageException(e.getMessage());
      }
    }
    for (FileValue f : fileValue.getSecondaryFiles()) {
      stageFile(workdir, f, flat);
    }
    if (fileValue instanceof DirectoryValue) {
      List<FileValue> listing = ((DirectoryValue) fileValue).getListing();
      for (FileValue f : listing) {
        stageFile(workdir, f, flat);
      }
    }
    flat.add(fileValue);
  }

  @Override
  public Path workDir(Job job) {
    return storageBase.resolve(job.getRootId().toString()).resolve(job.getName().replaceAll("\\.", "/"));
  }

  @Override
  public Path localDir(Job job) {
    return localFileStorage.resolve(job.getRootId().toString()).resolve(job.getName().replaceAll("\\.", "/"));
  }
}


text:
<resources>
    <string name="app_name">Reading List</string>

    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
    <string name="action_add">Add</string>
    <string name="book_name">Book Name</string>
    <string name="author_name">Author</string>
    <string name="category_name">Category</string>
    <string name="pages_name">Pages</string>
    <string name="title_activity_book_add">BookAddActivity</string>
    <string name="progess_name">Progress</string>
    <string name="create_button_name">Save</string>
    <string name="cover_name">cover</string>
    <string name="delete_name">Delete</string>
    <string name="invalid_book_exception">You need to set a book name!</string>
    <string name="invalid_author_exception">You need to choose an author!</string>
    <string name="invalid_category_exception">You need to choose a category!</string>
    <string name="invalid_cover">You need to set the book name at least.</string>
    <string name="title_activity_category_choose">CategoryChooseActivity</string>
    <string name="choose_book">Book</string>
    <string name="title_activity_author_choose">AuthorChooseActivity</string>
    <string name="date">Date</string>
    <string name="action_log">log</string>
    <string name="title_activity_author_add">AuthorAddActivity</string>
    <string name="title_activity_cover_search">CoverSearchActivity</string>
    <string name="github">App developed by Rafael Gonçalves. Source code: https://github.com/rafagonc/Reading-List-Android</string>
    <string name="title_activity_main">MainActivity</string>
    <string name="hello_blank_fragment">Hello blank fragment</string>
    <string name="title_activity_log_add">Add Log</string>
    <string name="title_activity_book_choose">Choose Book</string>
</resources>


text:
int main(int argc, const char * argv[]) {
    @autoreleasepool {
        // insert code here...
        NSLog(@"Hello, World!");
        NSLog(@"Hello, Github!");
        NSLog(@"i love u!");
    }
    return 0;
}


text:
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using RetrIoc.Configuration;
using RetrIoc.Injection;

namespace RetrIoc
{
    public class Autowire : IHttpModule
    {
        private HttpApplication _context;
        private static AspxPageInjector _aspxPageInjector;

        public void Init(HttpApplication context)
        {
            _context = context;
            _context.PreRequestHandlerExecute += InjectProperties;
            _context.EndRequest += ReleaseComponents;
        }

        private void InjectProperties(object sender, EventArgs e)
        {
            var currentPage = _context.Context.CurrentHandler as Page;
            if (currentPage == null)
            {
                return;
            }

            currentPage.InitComplete += (s, args) => _aspxPageInjector.InjectInto(currentPage);
        }

        public void ReleaseComponents(object sender, EventArgs e)
        {
        }

        public static void ConfigureWith(IResolveTypes binding)
        {
            ConfigVerifier.AssertModuleExists(HttpContext.Current.ApplicationInstance);
            _aspxPageInjector = new AspxPageInjector(new RetrIocConfiguration(binding));
        }

        public static void ConfigureWith(RetrIocConfiguration config)
        {
            ConfigVerifier.AssertModuleExists(HttpContext.Current.ApplicationInstance);
            _aspxPageInjector = new AspxPageInjector(config);
        }

        #if NET4
        public static void ConfigureWith(Func<Type, object> getType,
            Func<Type, IEnumerable<object>> getAllTypes,
            Action<object> releaseInstance)
        {
            _aspxPageInjector = new AspxPageInjector(new RetrIocConfiguration(new ContainerShim(getType, getAllTypes, releaseInstance)));
        }
        #endif

        public static bool IsEnabled
        {
            get { return ConfigVerifier.IsEnabled(HttpContext.Current.ApplicationInstance); }
        }

        public void Dispose()
        {
        }
    }
}


text:
package com.intellij.uiDesigner.core;

import com.intellij.compiler.instrumentation.InstrumentationClassFinder;
import com.intellij.openapi.actionSystem.DataProvider;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.application.PluginPathManager;
import com.intellij.openapi.components.BaseState;
import com.intellij.openapi.util.SystemInfoRt;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.ui.components.JBTabbedPane;
import com.intellij.uiDesigner.compiler.AsmCodeGenerator;
import com.intellij.uiDesigner.compiler.FormErrorInfo;
import com.intellij.uiDesigner.compiler.NestedFormLoader;
import com.intellij.uiDesigner.compiler.Utils;
import com.intellij.uiDesigner.lw.CompiledClassPropertiesProvider;
import com.intellij.uiDesigner.lw.LwRootContainer;
import com.intellij.util.ArrayUtil;
import com.intellij.util.PathUtil;
import com.intellij.util.ui.UIUtil;
import com.sun.tools.javac.Main;
import gnu.trove.TIntObjectHashMap;
import junit.framework.TestCase;
import kotlin.reflect.KDeclarationContainer;
import org.jetbrains.org.objectweb.asm.ClassWriter;

import javax.swing.*;
import javax.swing.border.EtchedBorder;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.io.*;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.*;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * @author yole
 */
public class AsmCodeGeneratorTest extends TestCase {
  private MyNestedFormLoader myNestedFormLoader;
  private MyClassFinder myClassFinder;

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    myNestedFormLoader = new MyNestedFormLoader();

    final String swingPath = PathUtil.getJarPathForClass(AbstractButton.class);

    List<URL> cp = new ArrayList<>();
    appendPath(cp, JBTabbedPane.class);
    appendPath(cp, TIntObjectHashMap.class);
    appendPath(cp, UIUtil.class);
    appendPath(cp, SystemInfoRt.class);
    appendPath(cp, ApplicationManager.class);
    appendPath(cp, PathManager.getResourceRoot(this.getClass(), "/messages/UIBundle.properties"));
    appendPath(cp, PathManager.getResourceRoot(this.getClass(), "/RuntimeBundle.properties"));
    appendPath(cp, GridLayoutManager.class); // forms_rt
    appendPath(cp, DataProvider.class);
    appendPath(cp, BaseState.class);
    appendPath(cp, KDeclarationContainer.class);
    myClassFinder = new MyClassFinder(
      new URL[] {new File(swingPath).toURI().toURL()},
      cp.toArray(new URL[cp.size()])
    );
  }

  private static void appendPath(Collection<URL> container, Class cls) throws MalformedURLException {
    final String path = PathUtil.getJarPathForClass(cls);
    appendPath(container, path);
  }

  private static void appendPath(Collection<URL> container, String path) throws MalformedURLException {
    container.add(new File(path).toURI().toURL());
  }

  @Override
  protected void tearDown() throws Exception {
    try {
      myNestedFormLoader = null;
      final MyClassFinder classFinder = myClassFinder;
      if (classFinder != null) {
        classFinder.releaseResources();
        myClassFinder = null;
      }
    }
    finally {
      super.tearDown();
    }
  }

  private AsmCodeGenerator initCodeGenerator(final String formFileName, final String className) throws Exception {
    final String testDataPath = PluginPathManager.getPluginHomePath("ui-designer") + "/testData/";
    return initCodeGenerator(formFileName, className, testDataPath);
  }

  private AsmCodeGenerator initCodeGenerator(final String formFileName, final String className, final String testDataPath) throws Exception {
    String tmpPath = FileUtil.getTempDirectory();
    String formPath = testDataPath + formFileName;
    String javaPath = testDataPath + className + ".java";
    final int rc = Main.compile(new String[]{"-d", tmpPath, javaPath});

    assertEquals(0, rc);

    final String classPath = tmpPath + "/" + className + ".class";
    final File classFile = new File(classPath);

    assertTrue(classFile.exists());

    final LwRootContainer rootContainer = loadFormData(formPath);
    final AsmCodeGenerator codeGenerator = new AsmCodeGenerator(rootContainer, myClassFinder, myNestedFormLoader, false, new ClassWriter(ClassWriter.COMPUTE_FRAMES));
    final FileInputStream classStream = new FileInputStream(classFile);
    try {
      codeGenerator.patchClass(classStream);
    }
    finally {
      classStream.close();
      FileUtil.delete(classFile);
      final File[] inners = new File(tmpPath).listFiles((dir, name) -> name.startsWith(className + "$") && name.endsWith(".class"));
      if (inners != null) {
        for (File file : inners) FileUtil.delete(file);
      }
    }
    return codeGenerator;
  }

  private LwRootContainer loadFormData(final String formPath) throws Exception {
    String formData = FileUtil.loadFile(new File(formPath));
    final CompiledClassPropertiesProvider provider = new CompiledClassPropertiesProvider(getClass().getClassLoader());
    return Utils.getRootContainer(formData, provider);
  }

  private Class loadAndPatchClass(final String formFileName, final String className) throws Exception {
    final AsmCodeGenerator codeGenerator = initCodeGenerator(formFileName, className);

    byte[] patchedData = getVerifiedPatchedData(codeGenerator);

    /*
    FileOutputStream fos = new FileOutputStream("C:\\yole\\FormPreview27447\\MainPatched.class");
    fos.write(patchedData);
    fos.close();
    */

    myClassFinder.addClassDefinition(className, patchedData);
    return myClassFinder.getLoader().loadClass(className);
  }

  private static byte[] getVerifiedPatchedData(final AsmCodeGenerator codeGenerator) {
    byte[] patchedData = codeGenerator.getPatchedData();
    FormErrorInfo[] errors = codeGenerator.getErrors();
    FormErrorInfo[] warnings = codeGenerator.getWarnings();
    if (errors.length == 0 && warnings.length == 0) {
      assertNotNull("Class patching failed but no errors or warnings were returned", patchedData);
    }
    else if (errors.length > 0) {
      assertTrue(errors[0].getErrorMessage(), false);
    }
    else {
      assertTrue(warnings[0].getErrorMessage(), false);
    }
    return patchedData;
  }

  private JComponent getInstrumentedRootComponent(final String formFileName, final String className) throws Exception {
    Class cls = loadAndPatchClass(formFileName, className);
    Field rootComponentField = cls.getField("myRootComponent");
    rootComponentField.setAccessible(true);
    Object instance = cls.newInstance();
    return (JComponent)rootComponentField.get(instance);
  }

  public void testSimple() throws Exception {
    JComponent rootComponent = getInstrumentedRootComponent("TestSimple.form", "BindingTest");
    assertNotNull(rootComponent);
  }

  public void testNoSuchField() throws Exception {
    AsmCodeGenerator generator = initCodeGenerator("TestNoSuchField.form", "BindingTest");
    assertEquals("Cannot bind: field does not exist: BindingTest.myNoSuchField", generator.getErrors() [0].getErrorMessage());
  }

  public void testStaticField() throws Exception {
    AsmCodeGenerator generator = initCodeGenerator("TestStaticField.form", "BindingTest");
    assertEquals("Cannot bind: field is static: BindingTest.myStaticField", generator.getErrors() [0].getErrorMessage());
  }

  public void testFinalField() throws Exception {
    AsmCodeGenerator generator = initCodeGenerator("TestFinalField.form", "BindingTest");
    assertEquals("Cannot bind: field is final: BindingTest.myFinalField", generator.getErrors() [0].getErrorMessage());
  }

  public void testPrimitiveField() throws Exception {
    AsmCodeGenerator generator = initCodeGenerator("TestPrimitiveField.form", "BindingTest");
    assertEquals("Cannot bind: field is of primitive type: BindingTest.myIntField", generator.getErrors() [0].getErrorMessage());
  }

  public void testIncompatibleTypeField() throws Exception {
    AsmCodeGenerator generator = initCodeGenerator("TestIncompatibleTypeField.form", "BindingTest");
    assertEquals("Cannot bind: Incompatible types. Cannot assign javax.swing.JPanel to field BindingTest.myStringField", generator.getErrors() [0].getErrorMessage());
  }

  public void testGridLayout() throws Exception {
    JComponent rootComponent = getInstrumentedRootComponent("TestGridConstraints.form", "BindingTest");
    final LayoutManager layout = rootComponent.getLayout();
    assertTrue(isInstanceOf(layout, GridLayoutManager.class.getName()));

    assertEquals(1, invokeMethod(layout, "getRowCount"));
    assertEquals(1, invokeMethod(layout, "getColumnCount"));
  }

  private static boolean isInstanceOf(Object object, final String className) throws ClassNotFoundException {
    final Class<?> ethalon = object.getClass().getClassLoader().loadClass(className);
    return ethalon.isAssignableFrom(object.getClass());
  }

  private static Object invokeMethod(Object obj, String methodName) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
    return invokeMethod(obj, methodName, ArrayUtil.EMPTY_CLASS_ARRAY, ArrayUtil.EMPTY_OBJECT_ARRAY);
  }

  private static Object invokeMethod(Object obj, String methodName, Class[] params, Object[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
    final Method method = findMethod(obj.getClass(), methodName, params);
    return method.invoke(obj, args);
  }

  private static Method findMethod(Class<?> aClass, String methodName, Class[] params) {
    try {
      final Method method = aClass.getDeclaredMethod(methodName, params);
      method.setAccessible(true);
      return method;
    }
    catch (NoSuchMethodException ignored) {
    }
    final Class<?> parent = aClass.getSuperclass();
    if (parent == null) {
      return null;
    }
    return findMethod(parent, methodName, params);
  }

  public void testCardLayout() throws Exception {
    JComponent rootComponent = getInstrumentedRootComponent("TestCardLayout.form", "BindingTest");
    assertTrue(rootComponent.getLayout() instanceof CardLayout);
    CardLayout cardLayout = (CardLayout) rootComponent.getLayout();
    assertEquals(10, cardLayout.getHgap());
    assertEquals(20, cardLayout.getVgap());
  }

  public void testCardLayoutShow() throws Exception {
    JComponent rootComponent = getInstrumentedRootComponent("TestCardLayoutShow.form", "BindingTest");
    assertTrue(rootComponent.getLayout() instanceof CardLayout);
    assertThat(rootComponent.getComponentCount()).isEqualTo(2);
    assertFalse(rootComponent.getComponent(0).isVisible());
    assertTrue(rootComponent.getComponent(1).isVisible());
  }

  public void testGridConstraints() throws Exception {
    JComponent rootComponent = getInstrumentedRootComponent("TestGridConstraints.form", "BindingTest");
    assertEquals(1, rootComponent.getComponentCount());
    final LayoutManager layout = rootComponent.getLayout();
    assertTrue(isInstanceOf(layout, GridLayoutManager.class.getName()));

    final Object constraints = invokeMethod(layout, "getConstraints", new Class[] {int.class}, new Object[] {0});
    assertTrue(isInstanceOf(constraints, GridConstraints.class.getName()));

    assertEquals(1, invokeMethod(constraints, "getColSpan"));
    assertEquals(1, invokeMethod(constraints, "getRowSpan"));
  }

  public void testIntProperty() throws Exception {
    JComponent rootComponent = getInstrumentedRootComponent("TestIntProperty.form", "BindingTest");
    assertEquals(1, rootComponent.getComponentCount());
    JTextField textField = (JTextField) rootComponent.getComponent(0);
    assertEquals(37, textField.getColumns());
    assertEquals(false, textField.isEnabled());
  }

  public void testDoubleProperty() throws Exception {
    JSplitPane splitPane = (JSplitPane)getInstrumentedRootComponent("TestDoubleProperty.form", "BindingTest");
    assertEquals(0.1f, splitPane.getResizeWeight(), 0.001f);
  }

  public void testStringProperty() throws Exception {
    JComponent rootComponent = getInstrumentedRootComponent("TestGridConstraints.form", "BindingTest");
    JButton btn = (JButton) rootComponent.getComponent(0);
    assertEquals("MyTestButton", btn.getText());
  }

  public void testSplitPane() throws Exception {
    JSplitPane splitPane = (JSplitPane)getInstrumentedRootComponent("TestSplitPane.form", "BindingTest");
    assertTrue(splitPane.getLeftComponent() instanceof JLabel);
    assertTrue(splitPane.getRightComponent() instanceof JCheckBox);
  }

  public void testTabbedPane() throws Exception {
    JTabbedPane tabbedPane = (JTabbedPane) getInstrumentedRootComponent("TestTabbedPane.form", "BindingTest");
    assertEquals(2, tabbedPane.getTabCount());
    assertEquals("First", tabbedPane.getTitleAt(0));
    assertEquals("Test Value", tabbedPane.getTitleAt(1));
    assertTrue(tabbedPane.getComponentAt(0) instanceof JLabel);
    assertTrue(tabbedPane.getComponentAt(1) instanceof JButton);
  }

  public void testScrollPane() throws Exception {
    JScrollPane scrollPane = (JScrollPane)getInstrumentedRootComponent("TestScrollPane.form", "BindingTest");
    assertTrue(scrollPane.getViewport().getView() instanceof JList);
  }

  public void testBorder() throws Exception {
    JPanel panel = (JPanel) getInstrumentedRootComponent("TestBorder.form", "BindingTest");
    assertTrue(panel.getBorder() instanceof TitledBorder);
    TitledBorder border = (TitledBorder) panel.getBorder();
    assertEquals("BorderTitle", border.getTitle());
    assertTrue(border.getBorder().toString(), border.getBorder() instanceof EtchedBorder);
  }

  public void testMnemonic() throws Exception {
    JPanel panel = (JPanel) getInstrumentedRootComponent("TestMnemonics.form", "BindingTest");
    JLabel label = (JLabel) panel.getComponent(0);
    assertEquals("Mnemonic", label.getText());
    assertEquals('M', label.getDisplayedMnemonic());
    assertEquals(3, label.getDisplayedMnemonicIndex());
  }

  public void testMnemonicFromProperty() throws Exception {
    JPanel panel = (JPanel) getInstrumentedRootComponent("TestMnemonicsProperty.form", "BindingTest");
    JLabel label = (JLabel) panel.getComponent(0);
    assertEquals("Mnemonic", label.getText());
    assertEquals('M', label.getDisplayedMnemonic());
    assertEquals(3, label.getDisplayedMnemonicIndex());
  }

  public void testGridBagLayout() throws Exception {
    JPanel panel = (JPanel) getInstrumentedRootComponent("TestGridBag.form", "BindingTest");
    assertTrue(panel.getLayout() instanceof GridBagLayout);
    GridBagLayout gridBag = (GridBagLayout) panel.getLayout();
    JButton btn = (JButton) panel.getComponent(0);
    GridBagConstraints gbc = gridBag.getConstraints(btn);
    assertNotNull(gbc);
    assertEquals(2, gbc.gridheight);
    assertEquals(2, gbc.gridwidth);
    assertEquals(1.0, gbc.weightx, 0.01);
    assertEquals(new Insets(1, 2, 3, 4), gbc.insets);
    assertEquals(GridBagConstraints.HORIZONTAL, gbc.fill);
    assertEquals(GridBagConstraints.NORTHWEST, gbc.anchor);
  }

  public void testGridBagSpacer() throws Exception {
    JPanel panel = (JPanel) getInstrumentedRootComponent("TestGridBagSpacer.form", "BindingTest");
    assertTrue(panel.getLayout() instanceof GridBagLayout);
    assertTrue(panel.getComponent(0) instanceof JLabel);
    assertTrue(panel.getComponent(1) instanceof JPanel);

    GridBagLayout gridBag = (GridBagLayout) panel.getLayout();
    GridBagConstraints gbc = gridBag.getConstraints(panel.getComponent(0));
    assertEquals(0.0, gbc.weightx, 0.01);
    assertEquals(0.0, gbc.weighty, 0.01);
    gbc = gridBag.getConstraints(panel.getComponent(1));
    assertEquals(0.0, gbc.weightx, 0.01);
    assertEquals(1.0, gbc.weighty, 0.01);
  }

  public void testLabelFor() throws Exception {
    JPanel panel = (JPanel) getInstrumentedRootComponent("TestLabelFor.form", "BindingTest");
    JTextField textField = (JTextField) panel.getComponent(0);
    JLabel label = (JLabel) panel.getComponent(1);
    assertEquals(textField, label.getLabelFor());
  }

  public void testFieldReference() throws Exception {
    Class cls = loadAndPatchClass("TestFieldReference.form", "FieldReferenceTest");
    JPanel instance = (JPanel) cls.newInstance();
    assertEquals(1, instance.getComponentCount());
  }

  public void testChainedConstructor() throws Exception {
    Class cls = loadAndPatchClass("TestChainedConstructor.form", "ChainedConstructorTest");
    Field scrollPaneField = cls.getField("myScrollPane");
    Object instance = cls.newInstance();
    JScrollPane scrollPane = (JScrollPane) scrollPaneField.get(instance);
    assertNotNull(scrollPane.getViewport().getView());
  }

  public void testConditionalMethodCall() throws Exception {
    JPanel panel = (JPanel) getInstrumentedRootComponent("TestConditionalMethodCall.form", "ConditionalMethodCallTest");
    assertNotNull(panel);
  }

  public void testMethodCallInSuper() throws Exception {
    // todo[yole] make this test work in headless
    if (!GraphicsEnvironment.isHeadless()) {
      Class cls = loadAndPatchClass("TestMethodCallInSuper.form", "MethodCallInSuperTest");
      JDialog instance = (JDialog) cls.newInstance();
      assertEquals(1, instance.getContentPane().getComponentCount());
    }
  }

  public void testClientProp() throws Exception {  // IDEA-46372
    JComponent rootComponent = getInstrumentedRootComponent("TestClientProp.form", "BindingTest");
    assertEquals(1, rootComponent.getComponentCount());
    JTable table = (JTable) rootComponent.getComponent(0);
    assertSame(Boolean.TRUE, table.getClientProperty("terminateEditOnFocusLost"));
  }

  public void testIdeadev14081() throws Exception {
    // NOTE: That doesn't really reproduce the bug as it's dependent on a particular instrumentation sequence used during form preview
    // (the nested form is instrumented with a new AsmCodeGenerator instance directly in the middle of instrumentation of the current form)
    final String testDataPath = PluginPathManager.getPluginHomePath("ui-designer") + File.separatorChar + "testData" + File.separatorChar +
      File.separatorChar + "formEmbedding" + File.separatorChar + "Ideadev14081" + File.separatorChar;
    AsmCodeGenerator embeddedClassGenerator = initCodeGenerator("Embedded.form", "Embedded", testDataPath);
    byte[] embeddedPatchedData = getVerifiedPatchedData(embeddedClassGenerator);
    myClassFinder.addClassDefinition("Embedded", embeddedPatchedData);
    myNestedFormLoader.registerNestedForm("Embedded.form", testDataPath + "Embedded.form");
    AsmCodeGenerator mainClassGenerator = initCodeGenerator("Main.form", "Main", testDataPath);
    byte[] mainPatchedData = getVerifiedPatchedData(mainClassGenerator);

    /*
    FileOutputStream fos = new FileOutputStream("C:\\yole\\FormPreview27447\\MainPatched.class");
    fos.write(mainPatchedData);
    fos.close();
    */

    myClassFinder.addClassDefinition("Main", mainPatchedData);
    final Class mainClass = myClassFinder.getLoader().loadClass("Main");
    Object instance = mainClass.newInstance();
    assert instance != null : mainClass;
  }

  private static class MyClassFinder extends InstrumentationClassFinder {
    private static final String TEST_PROPERTY_CONTENT = "test=Test Value\nmnemonic=Mne&monic";
    private final byte[] myTestProperties = Charset.defaultCharset().encode(TEST_PROPERTY_CONTENT).array();
    private final Map<String, byte[]> myClassData = new HashMap<>();

    private MyClassFinder(URL[] platformUrls, URL[] classpathUrls) {
      super(platformUrls, classpathUrls);
    }

    public void addClassDefinition(String name, byte[] bytes) {
      myClassData.put(name.replace('.', '/'), bytes);
    }

    @Override
    protected InputStream lookupClassBeforeClasspath(String internalClassName) {
      final byte[] bytes = myClassData.get(internalClassName);
      if (bytes != null) {
        return new ByteArrayInputStream(bytes);
      }
      return null;
    }

    @Override
    public InputStream getResourceAsStream(String name) throws IOException {
      if (name.equals("TestProperties.properties")) {
        return new ByteArrayInputStream(myTestProperties, 0, TEST_PROPERTY_CONTENT.length());
      }
      return super.getResourceAsStream(name);
    }
  }

  private class MyNestedFormLoader implements NestedFormLoader {
    private final Map<String, String> myFormMap = new HashMap<>();

    public void registerNestedForm(String formName, String fileName) {
      myFormMap.put(formName, fileName);
    }

    @Override
    public LwRootContainer loadForm(String formFileName) throws Exception {
      final String fileName = myFormMap.get(formFileName);
      if (fileName != null) {
        return loadFormData(fileName);
      }
      throw new UnsupportedOperationException("No nested form found for name " + formFileName);
    }

    @Override
    public String getClassToBindName(LwRootContainer container) {
      return container.getClassToBind();
    }
  }
}


text:
@ECHO OFF
REM Script taken from MPC-HC, https://github.com/mpc-hc/mpc-hc

SETLOCAL

PUSHD %~dp0

IF NOT DEFINED COVDIR SET "COVDIR=H:\progs\thirdparty\cov-analysis-win64"
IF DEFINED COVDIR IF NOT EXIST "%COVDIR%" (
  ECHO.
  ECHO ERROR: Coverity not found in "%COVDIR%"
  GOTO End
)

CALL "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" x86
IF %ERRORLEVEL% NEQ 0 (
  ECHO vcvarsall.bat call failed.
  GOTO End
)

:Cleanup
IF EXIST "cov-int" RD /q /s "cov-int"
IF EXIST "MediaInfoLib.lzma" DEL "MediaInfoLib.lzma"
IF EXIST "MediaInfoLib.tar"  DEL "MediaInfoLib.tar"
IF EXIST "MediaInfoLib.tgz"  DEL "MediaInfoLib.tgz"

:Main
SET MSBUILD_SWITCHES=/nologo /consoleloggerparameters:Verbosity=minimal /maxcpucount^
 /nodeReuse:true /target:MediaInfoLib:Rebuild /property:Configuration="Release";Platform=%1

"%COVDIR%\bin\cov-build.exe" --dir cov-int MSBuild "..\MSVC2013\MediaInfoLib.sln" %MSBUILD_SWITCHES%Win32
"%COVDIR%\bin\cov-build.exe" --dir cov-int MSBuild "..\MSVC2013\MediaInfoLib.sln" %MSBUILD_SWITCHES%x64

:tar
tar --version 1>&2 2>NUL || (ECHO. & ECHO ERROR: tar not found & GOTO SevenZip)
tar caf "MediaInfoLib.lzma" "cov-int"
GOTO End

:SevenZip
CALL :SubDetectSevenzipPath

rem Coverity is totally bogus with lzma...
rem And since I cannot replicate the arguments with 7-Zip, just use tar/gzip.
IF EXIST "%SEVENZIP%" (
  "%SEVENZIP%" a -ttar "MediaInfoLib.tar" "cov-int"
  "%SEVENZIP%" a -tgzip "MediaInfoLib.tgz" "MediaInfoLib.tar"
  IF EXIST "MediaInfoLib.tar" DEL "MediaInfoLib.tar"
  GOTO End
)

:SubDetectSevenzipPath
FOR %%G IN (7z.exe) DO (SET "SEVENZIP_PATH=%%~$PATH:G")
IF EXIST "%SEVENZIP_PATH%" (SET "SEVENZIP=%SEVENZIP_PATH%" & EXIT /B)

FOR %%G IN (7za.exe) DO (SET "SEVENZIP_PATH=%%~$PATH:G")
IF EXIST "%SEVENZIP_PATH%" (SET "SEVENZIP=%SEVENZIP_PATH%" & EXIT /B)

FOR /F "tokens=2*" %%A IN (
  'REG QUERY "HKLM\SOFTWARE\7-Zip" /v "Path" 2^>NUL ^| FIND "REG_SZ" ^|^|
   REG QUERY "HKLM\SOFTWARE\Wow6432Node\7-Zip" /v "Path" 2^>NUL ^| FIND "REG_SZ"') DO SET "SEVENZIP=%%B\7z.exe"
EXIT /B

:End
POPD
ECHO. & ECHO Press any key to close this window...
PAUSE >NUL
ENDLOCAL
EXIT /B


text:
namespace updater {
namespace {

bool IsSystemProcessForCommandLine(const base::CommandLine& command_line) {
  return command_line.HasSwitch(kSystemSwitch);
}

}  // namespace

bool IsPrefersForCommandLine(const base::CommandLine& command_line) {
#if BUILDFLAG(IS_WIN)
  const absl::optional<tagging::TagArgs> tag_args =
      GetTagArgsForCommandLine(command_line).tag_args;
  return tag_args && !tag_args->apps.empty() &&
         tag_args->apps.front().needs_admin &&
         *tag_args->apps.front().needs_admin ==
             tagging::AppArgs::NeedsAdmin::kPrefers;
#else
  return false;
#endif
}

UpdaterScope GetUpdaterScopeForCommandLine(
    const base::CommandLine& command_line) {
#if BUILDFLAG(IS_WIN)
  if (IsSystemProcessForCommandLine(command_line)) {
    return UpdaterScope::kSystem;
  }

  // TODO(crbug.com/1128631): support bundles. For now, assume one app.
  const absl::optional<tagging::TagArgs> tag_args =
      GetTagArgsForCommandLine(command_line).tag_args;
  if (tag_args && !tag_args->apps.empty() &&
      tag_args->apps.front().needs_admin) {
    DCHECK_EQ(tag_args->apps.size(), size_t{1});
    switch (*tag_args->apps.front().needs_admin) {
      case tagging::AppArgs::NeedsAdmin::kYes:
        return UpdaterScope::kSystem;
      case tagging::AppArgs::NeedsAdmin::kNo:
        return UpdaterScope::kUser;
      case tagging::AppArgs::NeedsAdmin::kPrefers:
        return command_line.HasSwitch(kCmdLinePrefersUser)
                   ? UpdaterScope::kUser
                   : UpdaterScope::kSystem;
    }
  }

  // crbug.com(1214058): consider handling the elevation case by
  // calling IsUserAdmin().
  return UpdaterScope::kUser;
#else
  return IsSystemProcessForCommandLine(command_line) ? UpdaterScope::kSystem
                                                     : UpdaterScope::kUser;
#endif
}

UpdaterScope GetUpdaterScope() {
  return GetUpdaterScopeForCommandLine(*base::CommandLine::ForCurrentProcess());
}

}  // namespace updater


text:
import energenie
import time
import json
import requests
import argparse

APP_DELAY    = 2
switch_state = False

def energy_monitor_loop():
    global switch_state

    # Process any received messages from the real radio
    energenie.loop()

    time.sleep(APP_DELAY)

if __name__ == "__main__":

    parser = argparse.ArgumentParser(description='Monitors energenie switches.')
    parser.add_argument('url', metavar='U', nargs=1,
                        help='URL of the server to send messages to')
    args = parser.parse_args()

    url = args.url[0]

    print("Starting energy monitor example")

    energenie.init()

    # provide a default incoming message handler, useful for logging every message
    def incoming(address, message):
	payload = json.dumps(message.pydict)
        try:
            print("pinging")
#            print(payload)
            r = requests.post(url, data=payload)
            if r.status_code != 200:
                print("Error! Server responded with an error: "+str(r.status_code))

        except requests.exceptions.ConnectionError:
            print("Error sending data to server")

    energenie.fsk_router.when_incoming(incoming)

    try:
        while True:
            energy_monitor_loop()
    finally:
        energenie.finished()

# END


text:
'''
Created by auto_sdk on 2015.09.11
'''
from top.api.base import RestApi
class OpenAccountUpdateRequest(RestApi):
	def __init__(self,domain='gw.api.taobao.com',port=80):
		RestApi.__init__(self,domain, port)
		self.param_list = None

	def getapiname(self):
		return 'taobao.open.account.update'


text:
@interface DropboxAddFolderMemberArg (DictionarySerializer) <DictionarySerializer>

@end


text:
OAuth.showPopup = function (url, callback, dimensions) {
  // default dimensions that worked well for facebook and google
  var popup = openCenteredPopup(
    url,
    (dimensions && dimensions.width) || 650,
    (dimensions && dimensions.height) || 331
  );

  var checkPopupOpen = setInterval(function() {
    try {
      // Fix for #328 - added a second test criteria (popup.closed === undefined)
      // to humour this Android quirk:
      // http://code.google.com/p/android/issues/detail?id=21061
      var popupClosed = popup.closed || popup.closed === undefined;
    } catch (e) {
      // For some unknown reason, IE9 (and others?) sometimes (when
      // the popup closes too quickly?) throws "SCRIPT16386: No such
      // interface supported" when trying to read 'popup.closed'. Try
      // again in 100ms.
      return;
    }

    if (popupClosed) {
      clearInterval(checkPopupOpen);
      callback();
    }
  }, 100);
};

var openCenteredPopup = function(url, width, height) {
  var screenX = typeof window.screenX !== 'undefined'
        ? window.screenX : window.screenLeft;
  var screenY = typeof window.screenY !== 'undefined'
        ? window.screenY : window.screenTop;
  var outerWidth = typeof window.outerWidth !== 'undefined'
        ? window.outerWidth : document.body.clientWidth;
  var outerHeight = typeof window.outerHeight !== 'undefined'
        ? window.outerHeight : (document.body.clientHeight - 22);
  // XXX what is the 22?

  // Use `outerWidth - width` and `outerHeight - height` for help in
  // positioning the popup centered relative to the current window
  var left = screenX + (outerWidth - width) / 2;
  var top = screenY + (outerHeight - height) / 2;
  var features = ('width=' + width + ',height=' + height +
                  ',left=' + left + ',top=' + top + ',scrollbars=yes');

  var newwindow = window.open(url, 'Login', features);
  if (newwindow.focus)
    newwindow.focus();
  return newwindow;
};


text:
{{#if name}}

    {{name}}

{{/if}}


text:
namespace base {
class FilePath;
}

namespace installer {

class InitialPreferences;

// Verbose installer runs clock in at around 50K, non-verbose much less than
// that. Some installer operations span multiple setup.exe runs, so we try
// to keep enough for at least 10 runs or so at any given time.
const int kMaxInstallerLogFileSize = 1024 * 1024;

// Truncate the file down to half of the max, such that we don't incur
// truncation on every update.
const int kTruncatedInstallerLogFileSize = kMaxInstallerLogFileSize / 2;

static_assert(kTruncatedInstallerLogFileSize < kMaxInstallerLogFileSize,
              "kTruncatedInstallerLogFileSize must be less than "
              "kMaxInstallerLogFileSize");

enum TruncateResult {
  LOGFILE_UNTOUCHED,
  LOGFILE_TRUNCATED,
  LOGFILE_DELETED,
};

// Cuts off the _beginning_ of the file at |log_file| down to
// kTruncatedInstallerLogFileSize if it exceeds kMaxInstallerLogFileSize bytes.
//
// If the file is not changed, returns LOGFILE_UNTOUCHED.
// If the file is successfully truncated, returns LOGFILE_TRUNCATED.
// If the file needed truncation, but the truncation failed, the file will be
// deleted and the function returns LOGFILE_DELETED. This is done to prevent
// run-away log files and guard against full disks.
TruncateResult TruncateLogFileIfNeeded(const base::FilePath& log_file);

// Call to initialize logging for Chrome installer.
void InitInstallerLogging(const installer::InitialPreferences& prefs);

// Call when done using logging for Chrome installer.
void EndInstallerLogging();

// Returns the full path of the log file.
base::FilePath GetLogFilePath(const installer::InitialPreferences& prefs);

}  // namespace installer

#endif  // CHROME_INSTALLER_UTIL_LOGGING_INSTALLER_H_


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

using ExaminingClasses.Lib;

namespace ExaminingComparisons
{
    public static class SortingDemonstrations
    {
        public static void SubMain()
        {
            //SortingDemonstrations.CanNonComparableTypesBeSorted();
            SortingDemonstrations.CanComparableTypesBeSorted();
        }

        /// <summary>
        /// Result: Expected. Types that implement <see cref="IComparable"/> or <see cref="IComparable{T}"/> can be sorted.
        /// If a type implements <see cref="IComparable"/> or <see cref="IComparable{T}"/>, where <T> is the type itself, then it should be sortable.
        /// Expected: Yes.
        /// </summary>
        private static void CanComparableTypesBeSorted()
        {
            var listOfCustomTypeInstances = new List<ComparableClass>()
            {
                // Created out of sort order.
                new ComparableClass()
                {
                    Value1 = 3,
                    Value2 = 4,
                },
                new ComparableClass()
                {
                    Value1 = 1,
                    Value2 = 2,
                },
            };

            listOfCustomTypeInstances.Sort();
        }

        /// <summary>
        /// Result: UNEXPECTED! An exception is thrown!
        /// Can types that do not implement IComparable<T> or IComparable be sorted in collections like lists?
        /// The .NET documentation suggests that if an attempt is made to sort a list of instances of a custom type that does not implement IComparable, then an exception will be thrown.
        /// Expected: Yes, no errors.
        ///
        /// Suggests that custom types that do not implement IComparable will cause exceptions to be thrown if an attempt is made to sort them: https://docs.microsoft.com/en-us/dotnet/api/system.icomparable.compareto?view=netframework-4.7.2
        /// </summary>
        private static void CanNonComparableTypesBeSorted()
        {
            var listOfCustomTypeInstances = new List<ClassA>()
            {
                // Created out of sort order.
                new ClassA()
                {
                    ReferenceTypeValueA = @"2",
                    ValueTypeValueA = 2,
                },
                new ClassA()
                {
                    ReferenceTypeValueA = @"1",
                    ValueTypeValueA = 1,
                },
            };

            listOfCustomTypeInstances.Sort(); // System.InvalidOperationException: 'Failed to compare two elements in the array.'
        }
    }
}


text:
<?php

class Mail_html2text
{

    /**
     *  Contains the HTML content to convert.
     *
     *  @var string $html
     *  @access public
     */
    public $html;

    /**
     *  Contains the converted, formatted text.
     *
     *  @var string $text
     *  @access public
     */
    public $text;

    /**
     *  Maximum width of the formatted text, in columns.
     *
     *  Set this value to 0 (or less) to ignore word wrapping
     *  and not constrain text to a fixed-width column.
     *
     *  @var integer $width
     *  @access public
     */
    public $width = 70;

    /**
     *  List of preg* regular expression patterns to search for,
     *  used in conjunction with $replace.
     *
     *  @var array $search
     *  @access public
     *  @see $replace
     */
    public $search = array(
        "/\r/",                                  // Non-legal carriage return
        "/[\n\t]+/",                             // Newlines and tabs
        '/]*>.*?<\/head>/i',             //
        '/


text:
<?xml version="1.0"?>
<package format="2">
  <name>eigen_tests</name>
  <version>1.0.0</version>
  <description>Eigen tests</description>

  <maintainer email="enrique.fernandez.perdomo@gmail.com">Enrique Fernandez</maintainer>
  <license>BSD</license>

  <buildtool_depend>cmake</buildtool_depend>

  <depend>eigen</depend>

  <export>
    <!-- Specify that this is not really a Catkin package-->
    <build_type>cmake</build_type>
  </export>
</package>


text:
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using FluentAssertions;
using FluentAssertions.Execution;
using Meziantou.Framework.WPF.Collections;
using Xunit;

namespace Meziantou.Framework.Windows.Tests;

public sealed partial class ObservableCollectionTests
{
    public static IEnumerable<object[]> GetCollections
    {
        get
        {
            yield return new object[] { new ConcurrentObservableCollection<int>() };
            yield return new object[] { new System.Collections.ObjectModel.ObservableCollection<int>() };
        }
    }

    private static object GetObservableCollection<T>(IList<T> collection)
    {
        if (collection is ConcurrentObservableCollection<T> result)
            return result.AsObservable;

        return collection;
    }

    [Theory]
    [MemberData(nameof(GetCollections))]
    public void Add(IList<int> collection)
    {
        // Arrange
        using var eventAssert = new EventAssert(GetObservableCollection(collection));

        // Act
        collection.Add(1);

        // Assert
        collection.ToList().Should().Equal(new[] { 1 });
        eventAssert.AssertPropertyChanged("Count", "Item[]");
        eventAssert.AssertCollectionChangedAddItem(1);
    }

    [Theory]
    [MemberData(nameof(GetCollections))]
    public void Remove(IList<int> collection)
    {
        // Arrange
        collection.Add(1);
        collection.Add(2);
        using var eventAssert = new EventAssert(GetObservableCollection(collection));

        // Act
        collection.Remove(1);

        // Assert
        collection.ToList().Should().Equal(new[] { 2 });
        eventAssert.AssertPropertyChanged("Count", "Item[]");
        eventAssert.AssertCollectionChangedRemoveItem(1);
    }

    [Theory]
    [MemberData(nameof(GetCollections))]
    public void RemoveAt(IList<int> collection)
    {
        // Arrange
        collection.Add(1);
        collection.Add(2);
        collection.Add(3);
        using var eventAssert = new EventAssert(GetObservableCollection(collection));

        // Act
        collection.RemoveAt(0);

        // Assert
        collection.ToList().Should().Equal(new[] { 2, 3 });
        eventAssert.AssertPropertyChanged("Count", "Item[]");
        eventAssert.AssertCollectionChangedRemoveItem(1);
    }

    [Theory]
    [MemberData(nameof(GetCollections))]
    public void Insert(IList<int> collection)
    {
        // Arrange
        using var eventAssert = new EventAssert(GetObservableCollection(collection));

        // Act
        collection.Insert(index: 0, item: 1);

        // Assert
        collection.ToList().Should().Equal(new[] { 1 });
        eventAssert.AssertPropertyChanged("Count", "Item[]");
        eventAssert.AssertCollectionChangedAddItem(1);
    }

    [Theory]
    [MemberData(nameof(GetCollections))]
    public void Clear(IList<int> collection)
    {
        // Arrange
        collection.Add(1);
        collection.Add(2);
        collection.Add(3);
        using var eventAssert = new EventAssert(GetObservableCollection(collection));

        // Act
        collection.Clear();

        // Assert
        collection.ToList().Should().BeEmpty();
        eventAssert.AssertPropertyChanged("Count", "Item[]");
        eventAssert.AssertCollectionChangedReset();
    }

    [Theory]
    [MemberData(nameof(GetCollections))]
    public void Indexer_Set(IList<int> collection)
    {
        // Arrange
        collection.Add(1);
        using var eventAssert = new EventAssert(GetObservableCollection(collection));

        // Act
        collection[0] = 2;

        // Assert
        collection.ToList().Should().Equal(new[] { 2 });
        eventAssert.AssertPropertyChanged("Item[]");
        eventAssert.AssertCollectionChangedReplace(oldValue: 1, newValue: 2);
    }

    [Theory]
    [InlineData(false)]
    [InlineData(true)]
    public void AddRange(bool supportRangeNotifications)
    {
        // Arrange
        var collection = new ConcurrentObservableCollection<int>()
        {
            SupportRangeNotifications = supportRangeNotifications,
        };

        collection.AddRange(0, 1, 2);

        using var eventAssert = new EventAssert(GetObservableCollection(collection));

        // Act
        collection.AddRange(3, 4, 5);

        // Assert
        collection.ToList().Should().Equal(new[] { 0, 1, 2, 3, 4, 5 });
        collection.AsObservable.ToList().Should().Equal(new[] { 0, 1, 2, 3, 4, 5 });

        if (supportRangeNotifications)
        {
            eventAssert.AssertCollectionChangedAddItems(new object[] { 3, 4, 5 }, startIndex: 3);
        }
        else
        {
            eventAssert.CollectionChangedArgs.Select(e => e.Action).Should().AllBeEquivalentTo(NotifyCollectionChangedAction.Add);
            eventAssert.CollectionChangedArgs.Should().BeEquivalentTo(new[]
            {
                new { Action = NotifyCollectionChangedAction.Add, NewStartingIndex = 3, NewItems = new[] { 3 }  },
                new { Action = NotifyCollectionChangedAction.Add, NewStartingIndex = 4, NewItems = new[] { 4 }  },
                new { Action = NotifyCollectionChangedAction.Add, NewStartingIndex = 5, NewItems = new[] { 5 }  },
            });
        }
    }

    [Theory]
    [InlineData(false)]
    [InlineData(true)]
    public void InsertRange(bool supportRangeNotifications)
    {
        // Arrange
        var collection = new ConcurrentObservableCollection<int>()
        {
            SupportRangeNotifications = supportRangeNotifications,
        };

        collection.AddRange(0, 1, 5);

        using var eventAssert = new EventAssert(GetObservableCollection(collection));

        // Act
        collection.InsertRange(2, new[] { 2, 3, 4 });

        // Assert
        collection.ToList().Should().Equal(new[] { 0, 1, 2, 3, 4, 5 });
        collection.AsObservable.ToList().Should().Equal(new[] { 0, 1, 2, 3, 4, 5 });

        if (supportRangeNotifications)
        {
            eventAssert.AssertCollectionChangedAddItems(new object[] { 2, 3, 4 }, startIndex: 2);
        }
        else
        {
            eventAssert.CollectionChangedArgs.Select(e => e.Action).Should().AllBeEquivalentTo(NotifyCollectionChangedAction.Add);
            eventAssert.CollectionChangedArgs.Should().BeEquivalentTo(new[]
            {
                new { Action = NotifyCollectionChangedAction.Add, NewStartingIndex = 2, NewItems = new[] { 2 }  },
                new { Action = NotifyCollectionChangedAction.Add, NewStartingIndex = 3, NewItems = new[] { 3 }  },
                new { Action = NotifyCollectionChangedAction.Add, NewStartingIndex = 4, NewItems = new[] { 4 }  },
            });
        }
    }

    [Fact]
    public void Sort()
    {
        // Arrange
        var collection = new ConcurrentObservableCollection<int> { 1, 0, 2 };
        using var eventAssert = new EventAssert(GetObservableCollection(collection));

        // Act
        collection.Sort();

        // Assert
        collection.ToList().Should().Equal(new[] { 0, 1, 2 });
        collection.AsObservable.ToList().Should().Equal(new[] { 0, 1, 2 });
        eventAssert.AssertPropertyChanged("Item[]");
        eventAssert.AssertCollectionChangedReset();
    }

    [Fact]
    public void StableSort()
    {
        // Arrange
        var collection = new ConcurrentObservableCollection<int> { 1, 0, 2 };
        using var eventAssert = new EventAssert(GetObservableCollection(collection));

        // Act
        collection.StableSort();

        // Assert
        collection.ToList().Should().Equal(new[] { 0, 1, 2 });
        collection.AsObservable.ToList().Should().Equal(new[] { 0, 1, 2 });
        eventAssert.AssertPropertyChanged("Item[]");
        eventAssert.AssertCollectionChangedReset();
    }

    [Fact]
    public void StableSort_PreserveOrder()
    {
        // Arrange
        var collection = new ConcurrentObservableCollection<Sample>();
        for (var i = 0; i < 1000; i++)
        {
            collection.Add(new Sample(i * 2, "Value" + (i * 2).ToString("D5", CultureInfo.InvariantCulture)));
            collection.Add(new Sample((i * 2) + 1, "Value" + (i * 2).ToString("D5", CultureInfo.InvariantCulture)));
        }

        using var eventAssert = new EventAssert(GetObservableCollection(collection));

        // Act
        collection.StableSort(new SampleComparer()); // Compare by value

        // Assert
        using (new AssertionScope())
        {
            collection.Should().BeInAscendingOrder(item => item.Index);
            eventAssert.AssertPropertyChanged("Item[]");
            eventAssert.AssertCollectionChangedReset();
        }
    }

    [Fact]
    public void AddWrongItemType()
    {
        var collection = (IList)new ConcurrentObservableCollection<string>();
        collection.Add(null);
        collection.Add("");

        new Action(() => collection.Add(10)).Should().ThrowExactly<ArgumentException>();
    }

    private sealed record Sample(int Index, string Value);

    private sealed class SampleComparer : IComparer<Sample>
    {
        public int Compare(Sample x, Sample y)
        {
            return StringComparer.Ordinal.Compare(x.Value, y.Value);
        }
    }

    private sealed class EventAssert : IDisposable
    {
        private readonly object _observedInstance;

        public List<NotifyCollectionChangedEventArgs> CollectionChangedArgs { get; } = new();
        public List<PropertyChangedEventArgs> PropertyChangedArgs { get; } = new();

        public EventAssert(object obj)
        {
            _observedInstance = obj;
            if (obj is INotifyPropertyChanged notifyPropertyChanged)
            {
                notifyPropertyChanged.PropertyChanged += NotifyPropertyChanged_PropertyChanged;
            }

            if (obj is INotifyCollectionChanged notifyCollectionChanged)
            {
                notifyCollectionChanged.CollectionChanged += NotifyCollectionChanged_CollectionChanged;
            }
        }

        public void Dispose()
        {
            if (_observedInstance is INotifyPropertyChanged notifyPropertyChanged)
            {
                notifyPropertyChanged.PropertyChanged -= NotifyPropertyChanged_PropertyChanged;
            }

            if (_observedInstance is INotifyCollectionChanged notifyCollectionChanged)
            {
                notifyCollectionChanged.CollectionChanged -= NotifyCollectionChanged_CollectionChanged;
            }
        }

        private void NotifyCollectionChanged_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            CollectionChangedArgs.Add(e);
        }

        private void NotifyPropertyChanged_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            PropertyChangedArgs.Add(e);
        }

        public void AssertPropertyChanged(params string[] propertyNames)
        {
            PropertyChangedArgs.Select(e => e.PropertyName).ToList().Should().Equal(propertyNames);
        }

        public void AssertCollectionChangedAddItem(object obj)
        {
            CollectionChangedArgs.Should().ContainSingle();
            var args = CollectionChangedArgs.Single(e => e.Action == NotifyCollectionChangedAction.Add);

            args.NewItems[0].Should().Be(obj);

            args.NewStartingIndex.Should().Be(0);
            args.OldStartingIndex.Should().Be(-1);
            args.OldItems.Should().BeNull();
        }

        public void AssertCollectionChangedAddItems(object[] obj, int startIndex)
        {
            CollectionChangedArgs.Should().ContainSingle();
            var args = CollectionChangedArgs.Single(e => e.Action == NotifyCollectionChangedAction.Add);

            args.NewItems.OfType<object>().Should().Equal(obj);

            args.NewStartingIndex.Should().Be(startIndex);
            args.OldStartingIndex.Should().Be(-1);
            args.OldItems.Should().BeNull();
        }

        public void AssertCollectionChangedRemoveItem(object obj)
        {
            CollectionChangedArgs.Should().ContainSingle();
            var args = CollectionChangedArgs.Single(e => e.Action == NotifyCollectionChangedAction.Remove);

            args.OldItems[0].Should().Be(obj);

            args.NewStartingIndex.Should().Be(-1);
            args.OldStartingIndex.Should().Be(0);
            args.NewItems.Should().BeNull();
        }

        public void AssertCollectionChangedReset()
        {
            CollectionChangedArgs.Should().ContainSingle();
            var args = CollectionChangedArgs.Single(e => e.Action == NotifyCollectionChangedAction.Reset);

            args.NewStartingIndex.Should().Be(-1);
            args.OldStartingIndex.Should().Be(-1);
            args.NewItems.Should().BeNull();
            args.OldItems.Should().BeNull();
        }

        public void AssertCollectionChangedReplace(object oldValue, object newValue)
        {
            CollectionChangedArgs.Should().ContainSingle();
            var args = CollectionChangedArgs.Single(e => e.Action == NotifyCollectionChangedAction.Replace);

            args.NewItems[0].Should().Be(newValue);
            args.OldItems[0].Should().Be(oldValue);

            args.NewStartingIndex.Should().Be(0);
            args.OldStartingIndex.Should().Be(0);
        }
    }
}


text:
require 'arqivarius/reflog_entry'

module Arqivarius
  class ReflogPrinter
    def initialize(dir, computer_uuid, bucket_uuid, repo)
      @dir = dir.dup
      @computer_uuid = computer_uuid
      @bucket_uuid = bucket_uuid
      @repo = repo
    end

    def print_reflog
      prefix = "#{computer_uuid}/bucketdata/#{bucket_uuid}/refs/logs/master/"
      dir.files.prefix = prefix
      paths = []
      dir.files.each do |f|
        paths << f
      end

      files = paths.sort do |a, b|
        # descending
        File.basename(b.key).to_i <=> File.basename(a.key).to_i
      end

      files.each do |file|
        print_entry(file)
      end
    end

    private

    attr_reader :repo, :dir, :computer_uuid, :bucket_uuid

    def print_entry(file)
      puts "reflog #{file.key}"

      begin
        entry = ReflogEntry.new(file.body)
      rescue => e
        puts "\terror reading reflog entry: #{e}"
      else
        if commit = repo.commit_for_blob_key(entry.new_head_blob_key)

        puts "\tblobkey: #{entry.new_head_blob_key.inspect}"
        puts "\tauthor: #{commit.author}"
        puts "\tdate: #{commit.creation_date}"
        puts "\tlocation: #{commit.location}"
        puts "\trestore command: #{$0} #{dir.key}/#{computer_uuid}/buckets/#{bucket_uuid} #{entry.new_head_blob_key.sha1}\n\n"
        else
          puts 'oops'
        end
      end
    end
  end
end


text:
package com.ckz.baisi.adapter;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * Created by lijuan on 2016/9/12.
 */
public class ViewPagerAdapter extends PagerAdapter {
    private List<View> mViewList;

    public ViewPagerAdapter(List<View> mViewList) {
        this.mViewList = mViewList;
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView(mViewList.get(position));
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        container.addView(mViewList.get(position));
        return (mViewList.get(position));
    }

    @Override
    public int getCount() {
        if (mViewList == null)
            return 0;
        return mViewList.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view == object;
    }
}


text:
package eu.kingconquest.conquest.gui.reward.item;

import eu.kingconquest.conquest.chatinteract.LorePrompt;
import eu.kingconquest.conquest.chatinteract.NamePrompt;
import eu.kingconquest.conquest.core.ChestGui;
import eu.kingconquest.conquest.core.Reward;
import eu.kingconquest.conquest.util.ChatInteract;
import eu.kingconquest.conquest.util.Validate;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class RewardItemEditGui extends ChestGui{
	private ChestGui previous;
	private ItemStack tempItem;
	private ItemStack item;
	private Player player;
	private int itemSlot;
	private Reward kit;
	private int itemSize = 1;

	public RewardItemEditGui(Player player, Reward kit, ItemStack item, int slot, ChestGui previous){
		super();
		this.tempItem = item.clone();
		this.previous = previous;
		this.player = player;
		this.itemSlot = slot;
		this.item = item;
		this.kit = kit;
		create();
	}

	@Override
	public void create(){
		createGui(player, "&6Item Edit Gui", 45);
		display();
	}

	@Override
	public void display(){
		setCurrentItem(0);
		clearSlots();
		//Slot 0
		playerInfo(player);
		//Slot 1
		homeButton();
		//Slot 3
		previous(this);
		//Slot 5
		next(this);

		//Slot 8
		backButton(previous);

		nameButton(13);
		loreButton(22);
		enchantButton(31);
		flagButton(40);

		DecreaseItemButton(47, 10);
		DecreaseItemButton(48, 1);
		itemButton(49);
		IncreaseItemButton(50, 1);
		IncreaseItemButton(51, 10);
	}

	private NamePrompt namePrompt;

    @SuppressWarnings("all")
    private void nameButton(int slot){
        if (Validate.notNull(namePrompt)){
            ItemMeta meta = item.getItemMeta();
            meta.setDisplayName(namePrompt.get());
            item.setItemMeta(meta);
            tempItem = item.clone();
            namePrompt = null;
            display();
        }

        setItem(slot, new ItemStack(Material.BOOK), player -> {
                    namePrompt = new NamePrompt(this);
                    new ChatInteract(player, namePrompt, "Cancel");
                    player.closeInventory();
                }, "",
                "\n&bClick to Edit/Set Displayname");
    }

	private LorePrompt lorePrompt;

    @SuppressWarnings("all")
    private void loreButton(int slot){
        if (Validate.notNull(lorePrompt)){
            ItemMeta meta = item.getItemMeta();
            meta.setLore(lorePrompt.get());
            item.setItemMeta(meta);
            tempItem = item.clone();
            namePrompt = null;
            display();
        }

        setItem(slot, tempItem, player -> {
                    lorePrompt = new LorePrompt(this);
                    new ChatInteract(player, lorePrompt, "Cancel");
                    player.closeInventory();
                }, "",
                "\n&bClick to Edit/Set Lore");
    }

    @SuppressWarnings("all")
	private void enchantButton(int slot){
		setItem(slot, new ItemStack(Material.ENCHANTED_BOOK), player -> {
			new EnchantGUI(player, kit, item, itemSlot, this);
		}, "",
				"\n&bClick to Edit Enchantments");
	}

    @SuppressWarnings("all")
    private void flagButton(int slot){
        setItem(slot, new ItemStack(Material.BLACK_BANNER), player -> {
                    new ItemFlagGUI(player, item, this);
                }, "",
                "\n&bClick to Edit Flags");
    }

	private void DecreaseItemButton(int slot, int amount){
		tempItem.setAmount(amount);
        setItem(slot, new ItemStack(Material.OAK_BUTTON, amount), player -> {
			if(itemSize - amount < 0)
				itemSize = item.getMaxStackSize();
			else
				itemSize = itemSize - amount;
			display();
		},"&3Increase&6(&c- " + amount +"&6)" ,
				"&aClick to Increase!"
				);
	}

    @SuppressWarnings("all")
    private void itemButton(int slot){
        tempItem.setAmount(itemSize);
        setItem(slot, tempItem, player ->
                        item.setAmount(itemSize), "",
                "\n&3Edit the amount of blocks"
                        + "\n&aClick to Save"
        );
    }
	private void IncreaseItemButton(int slot, int amount){
		tempItem.setAmount(amount);
		setItem(slot, new ItemStack(Material.STONE_BUTTON, amount), player -> {
			if ((item.getAmount() + amount) > item.getMaxStackSize())
				itemSize = item.getMaxStackSize();
			else
				itemSize = itemSize + amount;
			display();
		},"&3Increase&6(&c+ " + amount +"&6)" ,
				"&aClick to Increase!"
				);
	}
}


text:
<?php

/**
 * Created by miljenko.rebernisak@prelovac.com
 * Date: 2/12/14
 */
interface MWP_Security_NonceInterface
{

    /**
     * Parse input string and sets inner fields
     *
     * @param string $value
     *
     * @return mixed
     */
    public function setValue($value);

    /**
     * Returns if nonce is valid
     *
     * @return bool
     */
    public function verify();
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project name="e2e-base-worker" xmlns:unless="ant:unless">
	<!-- Directory of this project file -->
	<dirname file="${ant.file.e2e-base-worker}" property="e2e-base-worker.basedir" />

	<!-- Import the core XSpec build file with some properties predefined -->
	<property name="xspec.properties" value="${e2e-base-worker.basedir}/xspec.properties" />
	<import file="../../../../../build.xml" />

	<!-- Include util -->
	<include file="../../../../ant/worker/build-worker_util.xml" />

	<!-- Accepts file URLs and runs the XSLT task accordingly.
		Optionally,
		* Discards the output file, when @out-url is omitted
		* Accepts XSLT parameters as <params> -->
	<macrodef name="xslt-url">
		<attribute name="in-url" />
		<attribute default="" name="out-url" />
		<attribute name="style-url" />

		<element name="params" optional="true" />

		<sequential>
			<!--
				Convert file URLs to file paths
			-->
			<local name="in-path" />
			<makepath property="in-path" url="@{in-url}" />

			<local name="out-path" />
			<makepath property="out-path" unless:blank="@{out-url}" url="@{out-url}" />

			<local name="style-path" />
			<makepath property="style-path" url="@{style-url}" />

			<!-- Use a temporary output file, if the macro caller doesn't care about the output -->
			<tempfile deleteonexit="true" destdir="${java.io.tmpdir}"
				prefix="xslt-url_deleteonexit_" property="out-path" suffix=".tmp"
				unless:set="out-path" />

			<!-- Perform XSLT -->
			<saxon-xslt in="${in-path}" out="${out-path}" style="${style-path}">
				<xslt-elements>
					<params />
				</xslt-elements>
			</saxon-xslt>
		</sequential>
	</macrodef>
</project>


text:
/* start css.sty */
.cmr-7{font-size:70%;}
.cmmi-7{font-size:70%;font-style: italic;}
.cmmi-10{font-style: italic;}
.cmsy-5{font-size:50%;}
.cmsy-7{font-size:70%;}
.ptmr7t-x-x-172{font-size:172%;}
.ptmr7t-x-x-120{font-size:120%;}
.cmtt-10{font-family: monospace;}
.ptmri7t-{  font-style: italic;}
p.noindent { text-indent: 0em }
p.nopar { text-indent: 0em; }
p.indent{ text-indent: 1.5em }
a img { border-top: 0; border-left: 0; border-right: 0; }
center { margin-top:1em; margin-bottom:1em; }
td center { margin-top:0em; margin-bottom:0em; }
.Canvas { position:relative; }
div.displaymath{text-align:center;}
.obeylines-h,.obeylines-v {white-space: nowrap; }
.underline{ text-decoration:underline; }
.overline{ text-decoration:overline; }
div.verbatim {font-family: monospace; white-space: nowrap; }
div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em; margin-top:0.5em; margin-bottom:0.5em;}
div.center div {text-align: left;}
div.flushright, div.flushright div.flushright {text-align: right;}
div.flushright div {text-align: left;}
div.flushleft {text-align: left;}
div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em;}
div.td00{ margin-left:0pt; margin-right:0pt; }
div.td01{ margin-left:0pt; margin-right:5pt; }
div.td10{ margin-left:5pt; margin-right:0pt; }
div.td11{ margin-left:5pt; margin-right:5pt; }
td.td00{ padding-left:0pt; padding-right:0pt; }
td.td01{ padding-left:0pt; padding-right:5pt; }
td.td10{ padding-left:5pt; padding-right:0pt; }
td.td11{ padding-left:5pt; padding-right:5pt; }
.hline hr, .cline hr{ height : 1px; }
li p.indent { text-indent: 0em }
div.newtheorem { margin-bottom: 2em; margin-top: 2em;}
span.TEX {letter-spacing: -0.125em; }
span.TEX span.E{ position:relative;top:0.5ex;left:-0.0417em;}
a span.TEX span.E {text-decoration: none; }
span.LATEX span.A{ position:relative; top:-0.5ex; left:-0.4em; font-size:85%;}
span.LATEX span.TEX{ position:relative; left: -0.4em; }
.marginpar {width:20%; float:right; text-align:left; margin-left:auto; margin-top:0.5em; font-size:85%; text-decoration:underline;}
span.footnotetext{ font-size:80%; font-style:italic; }
.equation td{text-align:center; }
td.equation { margin-top:1em; margin-bottom:1em; }
.underline{ text-decoration:underline; }
.overline{ text-decoration:overline; }
td.eqnarray4 { width:5%; white-space: normal; }
td.eqnarray2 { width:5%; }
table.eqnarray-star, table.eqnarray {width:100%;}
span.pmatrix img{vertical-align:middle;}
.partToc a, .partToc, .likepartToc a, .likepartToc {line-height: 200%; font-weight:bold; font-size:110%;}
h1.partHead{text-align: center}
p.bibitem { text-indent: -2em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; }
p.bibitem-p { text-indent: 0em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; }
.paragraphHead, .likeparagraphHead { margin-top:2em; font-weight: bold;}
.subparagraphHead, .likesubparagraphHead { font-weight: bold;}
.quote {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; }
.caption td.id{font-weight: bold; white-space: nowrap; }
.verse{white-space:nowrap; margin-left:2em}
h2.titleHead{text-align:center;}
div.maketitle{ margin-bottom: 2em; }
div.thanks{text-align:left; margin-left:10%; font-size:80%; font-style:italic; }
.quotation {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; }
.abstract p {margin-left:5%; margin-right:5%;}
.figure img.graphics {margin-left:10%;}
.equation td{text-align:center; }
table.align, table.alignat, table.xalignat, table.xxalignat, table.flalign, table.align-star, table.alignat-star, table.xalignat-star, table.flalign-star {width:100%; white-space: nowrap;}
td.align-label { width:5%; }
td.align-odd { text-align:right; padding-right:0.3em;}
td.align-even { text-align:left; padding-right:0.6em;}
td.gather-star, td.gather1 {text-align:center; }
dl.glosslist {margin-left:2em;}
/* end css.sty */


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [sip.js](./sip.js.md) > [Dialog](./sip.js.dialog.md) > [id](./sip.js.dialog.id.md)

## Dialog.id property

A dialog is identified at each UA with a dialog ID, which consists of a Call-ID value, a local tag and a remote tag. The dialog ID at each UA involved in the dialog is not the same. Specifically, the local tag at one UA is identical to the remote tag at the peer UA. The tags are opaque tokens that facilitate the generation of unique dialog IDs. https://tools.ietf.org/html/rfc3261\#section-12

<b>Signature:</b>

```typescript
get id(): string;
```


text:
package io.skysail.server.app.todos;

import io.skysail.api.links.Link;
import io.skysail.domain.Identifiable;
import io.skysail.server.app.todos.lists.ListsResource;
import io.skysail.server.restlet.resources.ListServerResource;

import java.util.List;

public class RootResource extends ListServerResource<Identifiable> {

    @Override
    public List<Link> getLinks() {
        return super.getLinks(ListsResource.class);
    }

    @Override
    public List<Identifiable> getEntity() {
        return null;
    }

}


text:
from euca2ools.commands.argtypes import delimited_list
from euca2ools.commands.autoscaling import AutoScalingRequest
from euca2ools.commands.autoscaling.arghelpers import TagArg
from requestbuilder import Arg

class CreateAutoScalingGroup(AutoScalingRequest):
    DESCRIPTION = 'Create a new auto-scaling group'
    ARGS = [Arg('AutoScalingGroupName', metavar='ASGROUP',
                help='name of the new auto-scaling group (required)'),
            Arg('-l', '--launch-configuration', dest='LaunchConfigurationName',
                metavar='LAUNCHCONFIG', required=True, help='''name of the
                launch configuration to use with the new group (required)'''),
            Arg('-M', '--max-size', dest='MaxSize', metavar='COUNT', type=int,
                required=True, help='maximum group size (required)'),
            Arg('-m', '--min-size', dest='MinSize', metavar='COUNT', type=int,
                required=True, help='minimum group size (required)'),
            Arg('--default-cooldown', dest='DefaultCooldown',
                metavar='SECONDS', type=int,
                help='''amount of time, in seconds, after a scaling activity
                        completes before any further trigger-related scaling
                        activities may start'''),
            Arg('--desired-capacity', dest='DesiredCapacity', metavar='COUNT',
                type=int,
                help='number of running instances the group should contain'),
            Arg('--grace-period', dest='HealthCheckGracePeriod',
                metavar='SECONDS', type=int, help='''number of seconds to wait
                before starting health checks on newly-created instances'''),
            Arg('--health-check-type', dest='HealthCheckType',
                choices=('EC2', 'ELB'),
                help='service to obtain health check status from'),
            Arg('--load-balancers', dest='LoadBalancerNames.member',
                metavar='ELB1,ELB2,...', type=delimited_list(','),
                help='comma-separated list of load balancers to use'),
            Arg('--placement-group', dest='PlacementGroup',
                help='placement group in which to launch new instances'),
            TagArg(required=False),
            Arg('--termination-policies', dest='TerminationPolicies.member',
                metavar='POLICY1,POLICY2,...', type=delimited_list(','),
                help='''ordered list of termination policies.  The first has
                the highest precedence.'''),
            Arg('--vpc-zone-identifier', dest='VPCZoneIdentifier',
                metavar='ZONE1,ZONE2,...',
                help='''comma-separated list of subnet identifiers.  If you
                specify availability zones as well, ensure the subnets'
                availability zones match the ones you specified'''),
            Arg('-z', '--availability-zones', dest='AvailabilityZones.member',
                metavar='ZONE1,ZONE2,...', type=delimited_list(','),
                help='''comma-separated list of availability zones for the new
                group (required unless subnets are supplied)''')]


text:
<?php
namespace Carsite\V1\Rest\ServiceType;

use Zend\Paginator\Paginator;

class ServiceTypeCollection extends Paginator
{
}