text:
// Code generated by protoc-gen-go.
// source: github.com/intelsdi-x/snap/control/plugin/rpc/plugin.proto
// DO NOT EDIT!

/*
Package rpc is a generated protocol buffer package.

It is generated from these files:
	github.com/intelsdi-x/snap/control/plugin/rpc/plugin.proto

It has these top-level messages:
	Empty
	ErrReply
	Time
	NamespaceElement
	PubProcArg
	Metric
	ConfigMap
	KillArg
	GetConfigPolicyReply
	BoolRule
	BoolPolicy
	FloatRule
	FloatPolicy
	IntegerRule
	IntegerPolicy
	StringRule
	StringPolicy
	MetricsArg
	MetricsReply
	GetMetricTypesArg
*/
package rpc

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

type Empty struct {
}

func (m *Empty) Reset()                    { *m = Empty{} }
func (m *Empty) String() string            { return proto.CompactTextString(m) }
func (*Empty) ProtoMessage()               {}
func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }

type ErrReply struct {
	Error string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
}

func (m *ErrReply) Reset()                    { *m = ErrReply{} }
func (m *ErrReply) String() string            { return proto.CompactTextString(m) }
func (*ErrReply) ProtoMessage()               {}
func (*ErrReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }

type Time struct {
	Sec  int64 `protobuf:"varint,1,opt,name=sec" json:"sec,omitempty"`
	Nsec int64 `protobuf:"varint,2,opt,name=nsec" json:"nsec,omitempty"`
}

func (m *Time) Reset()                    { *m = Time{} }
func (m *Time) String() string            { return proto.CompactTextString(m) }
func (*Time) ProtoMessage()               {}
func (*Time) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }

type NamespaceElement struct {
	Value       string `protobuf:"bytes,1,opt,name=Value" json:"Value,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=Description" json:"Description,omitempty"`
	Name        string `protobuf:"bytes,3,opt,name=Name" json:"Name,omitempty"`
}

func (m *NamespaceElement) Reset()                    { *m = NamespaceElement{} }
func (m *NamespaceElement) String() string            { return proto.CompactTextString(m) }
func (*NamespaceElement) ProtoMessage()               {}
func (*NamespaceElement) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }

type PubProcArg struct {
	Metrics []*Metric  `protobuf:"bytes,1,rep,name=Metrics" json:"Metrics,omitempty"`
	Config  *ConfigMap `protobuf:"bytes,2,opt,name=Config" json:"Config,omitempty"`
}

func (m *PubProcArg) Reset()                    { *m = PubProcArg{} }
func (m *PubProcArg) String() string            { return proto.CompactTextString(m) }
func (*PubProcArg) ProtoMessage()               {}
func (*PubProcArg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }

func (m *PubProcArg) GetMetrics() []*Metric {
	if m != nil {
		return m.Metrics
	}
	return nil
}

func (m *PubProcArg) GetConfig() *ConfigMap {
	if m != nil {
		return m.Config
	}
	return nil
}

// core.Metric
type Metric struct {
	Namespace          []*NamespaceElement `protobuf:"bytes,1,rep,name=Namespace" json:"Namespace,omitempty"`
	Version            int64               `protobuf:"varint,2,opt,name=Version" json:"Version,omitempty"`
	Config             *ConfigMap          `protobuf:"bytes,3,opt,name=Config" json:"Config,omitempty"`
	LastAdvertisedTime *Time               `protobuf:"bytes,4,opt,name=LastAdvertisedTime" json:"LastAdvertisedTime,omitempty"`
	Tags               map[string]string   `protobuf:"bytes,5,rep,name=Tags" json:"Tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	Timestamp          *Time               `protobuf:"bytes,6,opt,name=Timestamp" json:"Timestamp,omitempty"`
	Unit               string              `protobuf:"bytes,7,opt,name=Unit" json:"Unit,omitempty"`
	Description        string              `protobuf:"bytes,8,opt,name=Description" json:"Description,omitempty"`
	// Types that are valid to be assigned to Data:
	//	*Metric_StringData
	//	*Metric_Float32Data
	//	*Metric_Float64Data
	//	*Metric_Int32Data
	//	*Metric_Int64Data
	//	*Metric_BytesData
	//	*Metric_BoolData
	//	*Metric_Uint32Data
	//	*Metric_Uint64Data
	Data isMetric_Data `protobuf_oneof:"data"`
}

func (m *Metric) Reset()                    { *m = Metric{} }
func (m *Metric) String() string            { return proto.CompactTextString(m) }
func (*Metric) ProtoMessage()               {}
func (*Metric) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }

type isMetric_Data interface {
	isMetric_Data()
}

type Metric_StringData struct {
	StringData string `protobuf:"bytes,9,opt,name=string_data,json=stringData,oneof"`
}
type Metric_Float32Data struct {
	Float32Data float32 `protobuf:"fixed32,10,opt,name=float32_data,json=float32Data,oneof"`
}
type Metric_Float64Data struct {
	Float64Data float64 `protobuf:"fixed64,11,opt,name=float64_data,json=float64Data,oneof"`
}
type Metric_Int32Data struct {
	Int32Data int32 `protobuf:"varint,12,opt,name=int32_data,json=int32Data,oneof"`
}
type Metric_Int64Data struct {
	Int64Data int64 `protobuf:"varint,13,opt,name=int64_data,json=int64Data,oneof"`
}
type Metric_BytesData struct {
	BytesData []byte `protobuf:"bytes,14,opt,name=bytes_data,json=bytesData,proto3,oneof"`
}
type Metric_BoolData struct {
	BoolData bool `protobuf:"varint,15,opt,name=bool_data,json=boolData,oneof"`
}
type Metric_Uint32Data struct {
	Uint32Data uint32 `protobuf:"varint,16,opt,name=uint32_data,json=uint32Data,oneof"`
}
type Metric_Uint64Data struct {
	Uint64Data uint64 `protobuf:"varint,17,opt,name=uint64_data,json=uint64Data,oneof"`
}

func (*Metric_StringData) isMetric_Data()  {}
func (*Metric_Float32Data) isMetric_Data() {}
func (*Metric_Float64Data) isMetric_Data() {}
func (*Metric_Int32Data) isMetric_Data()   {}
func (*Metric_Int64Data) isMetric_Data()   {}
func (*Metric_BytesData) isMetric_Data()   {}
func (*Metric_BoolData) isMetric_Data()    {}
func (*Metric_Uint32Data) isMetric_Data()  {}
func (*Metric_Uint64Data) isMetric_Data()  {}

func (m *Metric) GetData() isMetric_Data {
	if m != nil {
		return m.Data
	}
	return nil
}

func (m *Metric) GetNamespace() []*NamespaceElement {
	if m != nil {
		return m.Namespace
	}
	return nil
}

func (m *Metric) GetConfig() *ConfigMap {
	if m != nil {
		return m.Config
	}
	return nil
}

func (m *Metric) GetLastAdvertisedTime() *Time {
	if m != nil {
		return m.LastAdvertisedTime
	}
	return nil
}

func (m *Metric) GetTags() map[string]string {
	if m != nil {
		return m.Tags
	}
	return nil
}

func (m *Metric) GetTimestamp() *Time {
	if m != nil {
		return m.Timestamp
	}
	return nil
}

func (m *Metric) GetStringData() string {
	if x, ok := m.GetData().(*Metric_StringData); ok {
		return x.StringData
	}
	return ""
}

func (m *Metric) GetFloat32Data() float32 {
	if x, ok := m.GetData().(*Metric_Float32Data); ok {
		return x.Float32Data
	}
	return 0
}

func (m *Metric) GetFloat64Data() float64 {
	if x, ok := m.GetData().(*Metric_Float64Data); ok {
		return x.Float64Data
	}
	return 0
}

func (m *Metric) GetInt32Data() int32 {
	if x, ok := m.GetData().(*Metric_Int32Data); ok {
		return x.Int32Data
	}
	return 0
}

func (m *Metric) GetInt64Data() int64 {
	if x, ok := m.GetData().(*Metric_Int64Data); ok {
		return x.Int64Data
	}
	return 0
}

func (m *Metric) GetBytesData() []byte {
	if x, ok := m.GetData().(*Metric_BytesData); ok {
		return x.BytesData
	}
	return nil
}

func (m *Metric) GetBoolData() bool {
	if x, ok := m.GetData().(*Metric_BoolData); ok {
		return x.BoolData
	}
	return false
}

func (m *Metric) GetUint32Data() uint32 {
	if x, ok := m.GetData().(*Metric_Uint32Data); ok {
		return x.Uint32Data
	}
	return 0
}

func (m *Metric) GetUint64Data() uint64 {
	if x, ok := m.GetData().(*Metric_Uint64Data); ok {
		return x.Uint64Data
	}
	return 0
}

// XXX_OneofFuncs is for the internal use of the proto package.
func (*Metric) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
	return _Metric_OneofMarshaler, _Metric_OneofUnmarshaler, _Metric_OneofSizer, []interface{}{
		(*Metric_StringData)(nil),
		(*Metric_Float32Data)(nil),
		(*Metric_Float64Data)(nil),
		(*Metric_Int32Data)(nil),
		(*Metric_Int64Data)(nil),
		(*Metric_BytesData)(nil),
		(*Metric_BoolData)(nil),
		(*Metric_Uint32Data)(nil),
		(*Metric_Uint64Data)(nil),
	}
}

func _Metric_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
	m := msg.(*Metric)
	// data
	switch x := m.Data.(type) {
	case *Metric_StringData:
		b.EncodeVarint(9<<3 | proto.WireBytes)
		b.EncodeStringBytes(x.StringData)
	case *Metric_Float32Data:
		b.EncodeVarint(10<<3 | proto.WireFixed32)
		b.EncodeFixed32(uint64(math.Float32bits(x.Float32Data)))
	case *Metric_Float64Data:
		b.EncodeVarint(11<<3 | proto.WireFixed64)
		b.EncodeFixed64(math.Float64bits(x.Float64Data))
	case *Metric_Int32Data:
		b.EncodeVarint(12<<3 | proto.WireVarint)
		b.EncodeVarint(uint64(x.Int32Data))
	case *Metric_Int64Data:
		b.EncodeVarint(13<<3 | proto.WireVarint)
		b.EncodeVarint(uint64(x.Int64Data))
	case *Metric_BytesData:
		b.EncodeVarint(14<<3 | proto.WireBytes)
		b.EncodeRawBytes(x.BytesData)
	case *Metric_BoolData:
		t := uint64(0)
		if x.BoolData {
			t = 1
		}
		b.EncodeVarint(15<<3 | proto.WireVarint)
		b.EncodeVarint(t)
	case *Metric_Uint32Data:
		b.EncodeVarint(16<<3 | proto.WireVarint)
		b.EncodeVarint(uint64(x.Uint32Data))
	case *Metric_Uint64Data:
		b.EncodeVarint(17<<3 | proto.WireVarint)
		b.EncodeVarint(uint64(x.Uint64Data))
	case nil:
	default:
		return fmt.Errorf("Metric.Data has unexpected type %T", x)
	}
	return nil
}

func _Metric_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
	m := msg.(*Metric)
	switch tag {
	case 9: // data.string_data
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeStringBytes()
		m.Data = &Metric_StringData{x}
		return true, err
	case 10: // data.float32_data
		if wire != proto.WireFixed32 {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeFixed32()
		m.Data = &Metric_Float32Data{math.Float32frombits(uint32(x))}
		return true, err
	case 11: // data.float64_data
		if wire != proto.WireFixed64 {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeFixed64()
		m.Data = &Metric_Float64Data{math.Float64frombits(x)}
		return true, err
	case 12: // data.int32_data
		if wire != proto.WireVarint {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeVarint()
		m.Data = &Metric_Int32Data{int32(x)}
		return true, err
	case 13: // data.int64_data
		if wire != proto.WireVarint {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeVarint()
		m.Data = &Metric_Int64Data{int64(x)}
		return true, err
	case 14: // data.bytes_data
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeRawBytes(true)
		m.Data = &Metric_BytesData{x}
		return true, err
	case 15: // data.bool_data
		if wire != proto.WireVarint {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeVarint()
		m.Data = &Metric_BoolData{x != 0}
		return true, err
	case 16: // data.uint32_data
		if wire != proto.WireVarint {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeVarint()
		m.Data = &Metric_Uint32Data{uint32(x)}
		return true, err
	case 17: // data.uint64_data
		if wire != proto.WireVarint {
			return true, proto.ErrInternalBadWireType
		}
		x, err := b.DecodeVarint()
		m.Data = &Metric_Uint64Data{x}
		return true, err
	default:
		return false, nil
	}
}

func _Metric_OneofSizer(msg proto.Message) (n int) {
	m := msg.(*Metric)
	// data
	switch x := m.Data.(type) {
	case *Metric_StringData:
		n += proto.SizeVarint(9<<3 | proto.WireBytes)
		n += proto.SizeVarint(uint64(len(x.StringData)))
		n += len(x.StringData)
	case *Metric_Float32Data:
		n += proto.SizeVarint(10<<3 | proto.WireFixed32)
		n += 4
	case *Metric_Float64Data:
		n += proto.SizeVarint(11<<3 | proto.WireFixed64)
		n += 8
	case *Metric_Int32Data:
		n += proto.SizeVarint(12<<3 | proto.WireVarint)
		n += proto.SizeVarint(uint64(x.Int32Data))
	case *Metric_Int64Data:
		n += proto.SizeVarint(13<<3 | proto.WireVarint)
		n += proto.SizeVarint(uint64(x.Int64Data))
	case *Metric_BytesData:
		n += proto.SizeVarint(14<<3 | proto.WireBytes)
		n += proto.SizeVarint(uint64(len(x.BytesData)))
		n += len(x.BytesData)
	case *Metric_BoolData:
		n += proto.SizeVarint(15<<3 | proto.WireVarint)
		n += 1
	case *Metric_Uint32Data:
		n += proto.SizeVarint(16<<3 | proto.WireVarint)
		n += proto.SizeVarint(uint64(x.Uint32Data))
	case *Metric_Uint64Data:
		n += proto.SizeVarint(17<<3 | proto.WireVarint)
		n += proto.SizeVarint(uint64(x.Uint64Data))
	case nil:
	default:
		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
	}
	return n
}

type ConfigMap struct {
	IntMap    map[string]int64  `protobuf:"bytes,1,rep,name=IntMap" json:"IntMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
	StringMap map[string]string `protobuf:"bytes,2,rep,name=StringMap" json:"StringMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	// double is float64
	FloatMap map[string]float64 `protobuf:"bytes,3,rep,name=FloatMap" json:"FloatMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"fixed64,2,opt,name=value"`
	BoolMap  map[string]bool    `protobuf:"bytes,4,rep,name=BoolMap" json:"BoolMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
}

func (m *ConfigMap) Reset()                    { *m = ConfigMap{} }
func (m *ConfigMap) String() string            { return proto.CompactTextString(m) }
func (*ConfigMap) ProtoMessage()               {}
func (*ConfigMap) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }

func (m *ConfigMap) GetIntMap() map[string]int64 {
	if m != nil {
		return m.IntMap
	}
	return nil
}

func (m *ConfigMap) GetStringMap() map[string]string {
	if m != nil {
		return m.StringMap
	}
	return nil
}

func (m *ConfigMap) GetFloatMap() map[string]float64 {
	if m != nil {
		return m.FloatMap
	}
	return nil
}

func (m *ConfigMap) GetBoolMap() map[string]bool {
	if m != nil {
		return m.BoolMap
	}
	return nil
}

type KillArg struct {
	Reason string `protobuf:"bytes,1,opt,name=Reason" json:"Reason,omitempty"`
}

func (m *KillArg) Reset()                    { *m = KillArg{} }
func (m *KillArg) String() string            { return proto.CompactTextString(m) }
func (*KillArg) ProtoMessage()               {}
func (*KillArg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }

type GetConfigPolicyReply struct {
	Error         string                    `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
	BoolPolicy    map[string]*BoolPolicy    `protobuf:"bytes,2,rep,name=bool_policy,json=boolPolicy" json:"bool_policy,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	FloatPolicy   map[string]*FloatPolicy   `protobuf:"bytes,3,rep,name=float_policy,json=floatPolicy" json:"float_policy,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	IntegerPolicy map[string]*IntegerPolicy `protobuf:"bytes,4,rep,name=integer_policy,json=integerPolicy" json:"integer_policy,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	StringPolicy  map[string]*StringPolicy  `protobuf:"bytes,5,rep,name=string_policy,json=stringPolicy" json:"string_policy,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}

func (m *GetConfigPolicyReply) Reset()                    { *m = GetConfigPolicyReply{} }
func (m *GetConfigPolicyReply) String() string            { return proto.CompactTextString(m) }
func (*GetConfigPolicyReply) ProtoMessage()               {}
func (*GetConfigPolicyReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }

func (m *GetConfigPolicyReply) GetBoolPolicy() map[string]*BoolPolicy {
	if m != nil {
		return m.BoolPolicy
	}
	return nil
}

func (m *GetConfigPolicyReply) GetFloatPolicy() map[string]*FloatPolicy {
	if m != nil {
		return m.FloatPolicy
	}
	return nil
}

func (m *GetConfigPolicyReply) GetIntegerPolicy() map[string]*IntegerPolicy {
	if m != nil {
		return m.IntegerPolicy
	}
	return nil
}

func (m *GetConfigPolicyReply) GetStringPolicy() map[string]*StringPolicy {
	if m != nil {
		return m.StringPolicy
	}
	return nil
}

type BoolRule struct {
	Required   bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"`
	Default    bool `protobuf:"varint,2,opt,name=default" json:"default,omitempty"`
	HasDefault bool `protobuf:"varint,3,opt,name=has_default,json=hasDefault" json:"has_default,omitempty"`
}

func (m *BoolRule) Reset()                    { *m = BoolRule{} }
func (m *BoolRule) String() string            { return proto.CompactTextString(m) }
func (*BoolRule) ProtoMessage()               {}
func (*BoolRule) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} }

type BoolPolicy struct {
	Rules map[string]*BoolRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	Key   []string             `protobuf:"bytes,2,rep,name=key" json:"key,omitempty"`
}

func (m *BoolPolicy) Reset()                    { *m = BoolPolicy{} }
func (m *BoolPolicy) String() string            { return proto.CompactTextString(m) }
func (*BoolPolicy) ProtoMessage()               {}
func (*BoolPolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} }

func (m *BoolPolicy) GetRules() map[string]*BoolRule {
	if m != nil {
		return m.Rules
	}
	return nil
}

type FloatRule struct {
	Required   bool    `protobuf:"varint,1,opt,name=required" json:"required,omitempty"`
	Minimum    float64 `protobuf:"fixed64,2,opt,name=minimum" json:"minimum,omitempty"`
	Maximum    float64 `protobuf:"fixed64,3,opt,name=maximum" json:"maximum,omitempty"`
	Default    float64 `protobuf:"fixed64,4,opt,name=default" json:"default,omitempty"`
	HasDefault bool    `protobuf:"varint,5,opt,name=has_default,json=hasDefault" json:"has_default,omitempty"`
	HasMin     bool    `protobuf:"varint,6,opt,name=has_min,json=hasMin" json:"has_min,omitempty"`
	HasMax     bool    `protobuf:"varint,7,opt,name=has_max,json=hasMax" json:"has_max,omitempty"`
}

func (m *FloatRule) Reset()                    { *m = FloatRule{} }
func (m *FloatRule) String() string            { return proto.CompactTextString(m) }
func (*FloatRule) ProtoMessage()               {}
func (*FloatRule) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }

type FloatPolicy struct {
	Rules map[string]*FloatRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	Key   []string              `protobuf:"bytes,2,rep,name=key" json:"key,omitempty"`
}

func (m *FloatPolicy) Reset()                    { *m = FloatPolicy{} }
func (m *FloatPolicy) String() string            { return proto.CompactTextString(m) }
func (*FloatPolicy) ProtoMessage()               {}
func (*FloatPolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} }

func (m *FloatPolicy) GetRules() map[string]*FloatRule {
	if m != nil {
		return m.Rules
	}
	return nil
}

type IntegerRule struct {
	Required   bool  `protobuf:"varint,1,opt,name=required" json:"required,omitempty"`
	Minimum    int64 `protobuf:"varint,2,opt,name=minimum" json:"minimum,omitempty"`
	Maximum    int64 `protobuf:"varint,3,opt,name=maximum" json:"maximum,omitempty"`
	Default    int64 `protobuf:"varint,4,opt,name=default" json:"default,omitempty"`
	HasDefault bool  `protobuf:"varint,5,opt,name=has_default,json=hasDefault" json:"has_default,omitempty"`
	HasMin     bool  `protobuf:"varint,6,opt,name=has_min,json=hasMin" json:"has_min,omitempty"`
	HasMax     bool  `protobuf:"varint,7,opt,name=has_max,json=hasMax" json:"has_max,omitempty"`
}

func (m *IntegerRule) Reset()                    { *m = IntegerRule{} }
func (m *IntegerRule) String() string            { return proto.CompactTextString(m) }
func (*IntegerRule) ProtoMessage()               {}
func (*IntegerRule) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} }

type IntegerPolicy struct {
	Rules map[string]*IntegerRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	Key   []string                `protobuf:"bytes,2,rep,name=key" json:"key,omitempty"`
}

func (m *IntegerPolicy) Reset()                    { *m = IntegerPolicy{} }
func (m *IntegerPolicy) String() string            { return proto.CompactTextString(m) }
func (*IntegerPolicy) ProtoMessage()               {}
func (*IntegerPolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} }

func (m *IntegerPolicy) GetRules() map[string]*IntegerRule {
	if m != nil {
		return m.Rules
	}
	return nil
}

type StringRule struct {
	Required   bool   `protobuf:"varint,1,opt,name=required" json:"required,omitempty"`
	Default    string `protobuf:"bytes,2,opt,name=default" json:"default,omitempty"`
	HasDefault bool   `protobuf:"varint,3,opt,name=has_default,json=hasDefault" json:"has_default,omitempty"`
}

func (m *StringRule) Reset()                    { *m = StringRule{} }
func (m *StringRule) String() string            { return proto.CompactTextString(m) }
func (*StringRule) ProtoMessage()               {}
func (*StringRule) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} }

type StringPolicy struct {
	Rules map[string]*StringRule `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	Key   []string               `protobuf:"bytes,2,rep,name=key" json:"key,omitempty"`
}

func (m *StringPolicy) Reset()                    { *m = StringPolicy{} }
func (m *StringPolicy) String() string            { return proto.CompactTextString(m) }
func (*StringPolicy) ProtoMessage()               {}
func (*StringPolicy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} }

func (m *StringPolicy) GetRules() map[string]*StringRule {
	if m != nil {
		return m.Rules
	}
	return nil
}

type MetricsArg struct {
	Metrics []*Metric `protobuf:"bytes,1,rep,name=metrics" json:"metrics,omitempty"`
}

func (m *MetricsArg) Reset()                    { *m = MetricsArg{} }
func (m *MetricsArg) String() string            { return proto.CompactTextString(m) }
func (*MetricsArg) ProtoMessage()               {}
func (*MetricsArg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} }

func (m *MetricsArg) GetMetrics() []*Metric {
	if m != nil {
		return m.Metrics
	}
	return nil
}

type MetricsReply struct {
	Metrics []*Metric `protobuf:"bytes,1,rep,name=metrics" json:"metrics,omitempty"`
	Error   string    `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
}

func (m *MetricsReply) Reset()                    { *m = MetricsReply{} }
func (m *MetricsReply) String() string            { return proto.CompactTextString(m) }
func (*MetricsReply) ProtoMessage()               {}
func (*MetricsReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} }

func (m *MetricsReply) GetMetrics() []*Metric {
	if m != nil {
		return m.Metrics
	}
	return nil
}

type GetMetricTypesArg struct {
	Config *ConfigMap `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"`
}

func (m *GetMetricTypesArg) Reset()                    { *m = GetMetricTypesArg{} }
func (m *GetMetricTypesArg) String() string            { return proto.CompactTextString(m) }
func (*GetMetricTypesArg) ProtoMessage()               {}
func (*GetMetricTypesArg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} }

func (m *GetMetricTypesArg) GetConfig() *ConfigMap {
	if m != nil {
		return m.Config
	}
	return nil
}

func init() {
	proto.RegisterType((*Empty)(nil), "rpc.Empty")
	proto.RegisterType((*ErrReply)(nil), "rpc.ErrReply")
	proto.RegisterType((*Time)(nil), "rpc.Time")
	proto.RegisterType((*NamespaceElement)(nil), "rpc.NamespaceElement")
	proto.RegisterType((*PubProcArg)(nil), "rpc.PubProcArg")
	proto.RegisterType((*Metric)(nil), "rpc.Metric")
	proto.RegisterType((*ConfigMap)(nil), "rpc.ConfigMap")
	proto.RegisterType((*KillArg)(nil), "rpc.KillArg")
	proto.RegisterType((*GetConfigPolicyReply)(nil), "rpc.GetConfigPolicyReply")
	proto.RegisterType((*BoolRule)(nil), "rpc.BoolRule")
	proto.RegisterType((*BoolPolicy)(nil), "rpc.BoolPolicy")
	proto.RegisterType((*FloatRule)(nil), "rpc.FloatRule")
	proto.RegisterType((*FloatPolicy)(nil), "rpc.FloatPolicy")
	proto.RegisterType((*IntegerRule)(nil), "rpc.IntegerRule")
	proto.RegisterType((*IntegerPolicy)(nil), "rpc.IntegerPolicy")
	proto.RegisterType((*StringRule)(nil), "rpc.StringRule")
	proto.RegisterType((*StringPolicy)(nil), "rpc.StringPolicy")
	proto.RegisterType((*MetricsArg)(nil), "rpc.MetricsArg")
	proto.RegisterType((*MetricsReply)(nil), "rpc.MetricsReply")
	proto.RegisterType((*GetMetricTypesArg)(nil), "rpc.GetMetricTypesArg")
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion3

// Client API for Collector service

type CollectorClient interface {
	CollectMetrics(ctx context.Context, in *MetricsArg, opts ...grpc.CallOption) (*MetricsReply, error)
	GetMetricTypes(ctx context.Context, in *GetMetricTypesArg, opts ...grpc.CallOption) (*MetricsReply, error)
	Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ErrReply, error)
	Kill(ctx context.Context, in *KillArg, opts ...grpc.CallOption) (*ErrReply, error)
	GetConfigPolicy(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetConfigPolicyReply, error)
}

type collectorClient struct {
	cc *grpc.ClientConn
}

func NewCollectorClient(cc *grpc.ClientConn) CollectorClient {
	return &collectorClient{cc}
}

func (c *collectorClient) CollectMetrics(ctx context.Context, in *MetricsArg, opts ...grpc.CallOption) (*MetricsReply, error) {
	out := new(MetricsReply)
	err := grpc.Invoke(ctx, "/rpc.Collector/CollectMetrics", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *collectorClient) GetMetricTypes(ctx context.Context, in *GetMetricTypesArg, opts ...grpc.CallOption) (*MetricsReply, error) {
	out := new(MetricsReply)
	err := grpc.Invoke(ctx, "/rpc.Collector/GetMetricTypes", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *collectorClient) Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ErrReply, error) {
	out := new(ErrReply)
	err := grpc.Invoke(ctx, "/rpc.Collector/Ping", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *collectorClient) Kill(ctx context.Context, in *KillArg, opts ...grpc.CallOption) (*ErrReply, error) {
	out := new(ErrReply)
	err := grpc.Invoke(ctx, "/rpc.Collector/Kill", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *collectorClient) GetConfigPolicy(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetConfigPolicyReply, error) {
	out := new(GetConfigPolicyReply)
	err := grpc.Invoke(ctx, "/rpc.Collector/GetConfigPolicy", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Collector service

type CollectorServer interface {
	CollectMetrics(context.Context, *MetricsArg) (*MetricsReply, error)
	GetMetricTypes(context.Context, *GetMetricTypesArg) (*MetricsReply, error)
	Ping(context.Context, *Empty) (*ErrReply, error)
	Kill(context.Context, *KillArg) (*ErrReply, error)
	GetConfigPolicy(context.Context, *Empty) (*GetConfigPolicyReply, error)
}

func RegisterCollectorServer(s *grpc.Server, srv CollectorServer) {
	s.RegisterService(&_Collector_serviceDesc, srv)
}

func _Collector_CollectMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(MetricsArg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CollectorServer).CollectMetrics(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Collector/CollectMetrics",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CollectorServer).CollectMetrics(ctx, req.(*MetricsArg))
	}
	return interceptor(ctx, in, info, handler)
}

func _Collector_GetMetricTypes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetMetricTypesArg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CollectorServer).GetMetricTypes(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Collector/GetMetricTypes",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CollectorServer).GetMetricTypes(ctx, req.(*GetMetricTypesArg))
	}
	return interceptor(ctx, in, info, handler)
}

func _Collector_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CollectorServer).Ping(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Collector/Ping",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CollectorServer).Ping(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Collector_Kill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(KillArg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CollectorServer).Kill(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Collector/Kill",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CollectorServer).Kill(ctx, req.(*KillArg))
	}
	return interceptor(ctx, in, info, handler)
}

func _Collector_GetConfigPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CollectorServer).GetConfigPolicy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Collector/GetConfigPolicy",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CollectorServer).GetConfigPolicy(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

var _Collector_serviceDesc = grpc.ServiceDesc{
	ServiceName: "rpc.Collector",
	HandlerType: (*CollectorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CollectMetrics",
			Handler:    _Collector_CollectMetrics_Handler,
		},
		{
			MethodName: "GetMetricTypes",
			Handler:    _Collector_GetMetricTypes_Handler,
		},
		{
			MethodName: "Ping",
			Handler:    _Collector_Ping_Handler,
		},
		{
			MethodName: "Kill",
			Handler:    _Collector_Kill_Handler,
		},
		{
			MethodName: "GetConfigPolicy",
			Handler:    _Collector_GetConfigPolicy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: fileDescriptor0,
}

// Client API for Processor service

type ProcessorClient interface {
	Process(ctx context.Context, in *PubProcArg, opts ...grpc.CallOption) (*MetricsReply, error)
	Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ErrReply, error)
	Kill(ctx context.Context, in *KillArg, opts ...grpc.CallOption) (*ErrReply, error)
	GetConfigPolicy(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetConfigPolicyReply, error)
}

type processorClient struct {
	cc *grpc.ClientConn
}

func NewProcessorClient(cc *grpc.ClientConn) ProcessorClient {
	return &processorClient{cc}
}

func (c *processorClient) Process(ctx context.Context, in *PubProcArg, opts ...grpc.CallOption) (*MetricsReply, error) {
	out := new(MetricsReply)
	err := grpc.Invoke(ctx, "/rpc.Processor/Process", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *processorClient) Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ErrReply, error) {
	out := new(ErrReply)
	err := grpc.Invoke(ctx, "/rpc.Processor/Ping", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *processorClient) Kill(ctx context.Context, in *KillArg, opts ...grpc.CallOption) (*ErrReply, error) {
	out := new(ErrReply)
	err := grpc.Invoke(ctx, "/rpc.Processor/Kill", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *processorClient) GetConfigPolicy(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetConfigPolicyReply, error) {
	out := new(GetConfigPolicyReply)
	err := grpc.Invoke(ctx, "/rpc.Processor/GetConfigPolicy", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Processor service

type ProcessorServer interface {
	Process(context.Context, *PubProcArg) (*MetricsReply, error)
	Ping(context.Context, *Empty) (*ErrReply, error)
	Kill(context.Context, *KillArg) (*ErrReply, error)
	GetConfigPolicy(context.Context, *Empty) (*GetConfigPolicyReply, error)
}

func RegisterProcessorServer(s *grpc.Server, srv ProcessorServer) {
	s.RegisterService(&_Processor_serviceDesc, srv)
}

func _Processor_Process_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PubProcArg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ProcessorServer).Process(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Processor/Process",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ProcessorServer).Process(ctx, req.(*PubProcArg))
	}
	return interceptor(ctx, in, info, handler)
}

func _Processor_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ProcessorServer).Ping(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Processor/Ping",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ProcessorServer).Ping(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Processor_Kill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(KillArg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ProcessorServer).Kill(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Processor/Kill",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ProcessorServer).Kill(ctx, req.(*KillArg))
	}
	return interceptor(ctx, in, info, handler)
}

func _Processor_GetConfigPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ProcessorServer).GetConfigPolicy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Processor/GetConfigPolicy",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ProcessorServer).GetConfigPolicy(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

var _Processor_serviceDesc = grpc.ServiceDesc{
	ServiceName: "rpc.Processor",
	HandlerType: (*ProcessorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Process",
			Handler:    _Processor_Process_Handler,
		},
		{
			MethodName: "Ping",
			Handler:    _Processor_Ping_Handler,
		},
		{
			MethodName: "Kill",
			Handler:    _Processor_Kill_Handler,
		},
		{
			MethodName: "GetConfigPolicy",
			Handler:    _Processor_GetConfigPolicy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: fileDescriptor0,
}

// Client API for Publisher service

type PublisherClient interface {
	Publish(ctx context.Context, in *PubProcArg, opts ...grpc.CallOption) (*ErrReply, error)
	Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ErrReply, error)
	Kill(ctx context.Context, in *KillArg, opts ...grpc.CallOption) (*ErrReply, error)
	GetConfigPolicy(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetConfigPolicyReply, error)
}

type publisherClient struct {
	cc *grpc.ClientConn
}

func NewPublisherClient(cc *grpc.ClientConn) PublisherClient {
	return &publisherClient{cc}
}

func (c *publisherClient) Publish(ctx context.Context, in *PubProcArg, opts ...grpc.CallOption) (*ErrReply, error) {
	out := new(ErrReply)
	err := grpc.Invoke(ctx, "/rpc.Publisher/Publish", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *publisherClient) Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ErrReply, error) {
	out := new(ErrReply)
	err := grpc.Invoke(ctx, "/rpc.Publisher/Ping", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *publisherClient) Kill(ctx context.Context, in *KillArg, opts ...grpc.CallOption) (*ErrReply, error) {
	out := new(ErrReply)
	err := grpc.Invoke(ctx, "/rpc.Publisher/Kill", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *publisherClient) GetConfigPolicy(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetConfigPolicyReply, error) {
	out := new(GetConfigPolicyReply)
	err := grpc.Invoke(ctx, "/rpc.Publisher/GetConfigPolicy", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Publisher service

type PublisherServer interface {
	Publish(context.Context, *PubProcArg) (*ErrReply, error)
	Ping(context.Context, *Empty) (*ErrReply, error)
	Kill(context.Context, *KillArg) (*ErrReply, error)
	GetConfigPolicy(context.Context, *Empty) (*GetConfigPolicyReply, error)
}

func RegisterPublisherServer(s *grpc.Server, srv PublisherServer) {
	s.RegisterService(&_Publisher_serviceDesc, srv)
}

func _Publisher_Publish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PubProcArg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PublisherServer).Publish(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Publisher/Publish",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PublisherServer).Publish(ctx, req.(*PubProcArg))
	}
	return interceptor(ctx, in, info, handler)
}

func _Publisher_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PublisherServer).Ping(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Publisher/Ping",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PublisherServer).Ping(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Publisher_Kill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(KillArg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PublisherServer).Kill(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Publisher/Kill",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PublisherServer).Kill(ctx, req.(*KillArg))
	}
	return interceptor(ctx, in, info, handler)
}

func _Publisher_GetConfigPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PublisherServer).GetConfigPolicy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rpc.Publisher/GetConfigPolicy",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PublisherServer).GetConfigPolicy(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

var _Publisher_serviceDesc = grpc.ServiceDesc{
	ServiceName: "rpc.Publisher",
	HandlerType: (*PublisherServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Publish",
			Handler:    _Publisher_Publish_Handler,
		},
		{
			MethodName: "Ping",
			Handler:    _Publisher_Ping_Handler,
		},
		{
			MethodName: "Kill",
			Handler:    _Publisher_Kill_Handler,
		},
		{
			MethodName: "GetConfigPolicy",
			Handler:    _Publisher_GetConfigPolicy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: fileDescriptor0,
}

func init() {
	proto.RegisterFile("github.com/intelsdi-x/snap/control/plugin/rpc/plugin.proto", fileDescriptor0)
}

var fileDescriptor0 = []byte{
	// 1364 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6e, 0xdb, 0x46,
	0x17, 0x15, 0x45, 0xfd, 0xf1, 0x52, 0x92, 0xed, 0x41, 0xbe, 0x7c, 0xaa, 0x92, 0x20, 0x0a, 0xd3,
	0x24, 0x4a, 0x93, 0x4a, 0xad, 0x9c, 0xa6, 0x89, 0xd3, 0x2e, 0x92, 0xc6, 0xb5, 0x9d, 0xd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b, 0x8c, 0x3f, 0x68, 0x19, 0xf1, 0xc8,
	0x75, 0xc2, 0x13, 0x4c, 0xd0, 0x3d, 0xa8, 0x8a, 0xc1, 0x62, 0x19, 0x0b, 0x3f, 0xfb, 0x9e, 0x94,
	0x30, 0xaa, 0xb0, 0x3f, 0x36, 0xb6, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x53, 0x2e, 0xe5, 0xce,
	0x16, 0x11, 0x00, 0x00,
}


text:
<iframe src="http://lefthandedgoat.github.io/canopy/testpages/index.html" width="100%" height="100%">

</iframe>

redpajama_set_name: RedPajamaGithub


text:
/**
 * Input selectors
 */

export function apiProjectsSelector(state) { // eslint-disable-line import/prefer-default-export
  return state.apiProjectList.apiProjects;
}


text:
from office365.sharepoint.fields.field import Field

class FieldUrl(Field):
    """Specifies a fields that contains a URL."""

    @property
    def display_format(self):
        """
        Gets the number of decimal places to be used when displaying the field.

        :rtype: int or None
        """
        return self.properties.get('DisplayFormat', None)


text:
from setuptools import setup

setup(
    name='doge',
    version='3.6.0',
    url='https://github.com/thiderman/doge',
    author='Lowe Thiderman',
    author_email='lowe.thiderman@gmail.com',
    description=('wow very terminal doge'),
    license='MIT',
    packages=['doge'],
    package_data={'doge': ['static/*.txt']},
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'Operating System :: Unix',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 2',
    ],
    entry_points={'console_scripts': ['doge = doge.core:main']},
)


text:
@implementation UIImage (Color)
+(UIImage*)imageFromColor:(UIColor*)color{
    CGRect rect = CGRectMake(0, 0, 1, 1);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context,[color CGColor]);
    CGContextFillRect(context, rect);
    UIImage * imge = [[UIImage alloc] init];
    imge = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return imge;
}
@end


text:
using CoreGraphics;
using System.Reactive;
using Toggl.Core.UI.Collections;
using Toggl.Core.UI.Extensions;
using Toggl.Core.UI.ViewModels.Selectable;
using Toggl.Core.UI.ViewModels.Settings;
using Toggl.iOS.Cells.Settings;
using Toggl.iOS.Extensions;
using Toggl.iOS.Extensions.Reactive;
using Toggl.iOS.ViewSources.Generic.TableView;
using Toggl.Shared;
using Toggl.Shared.Extensions;
using UIKit;

namespace Toggl.iOS.ViewControllers.Settings
{
    using CalendarSectionModel = SectionModel<Unit, SelectableCalendarNotificationsOptionViewModel>;

    public sealed partial class UpcomingEventsNotificationSettingsViewController : ReactiveViewController<UpcomingEventsNotificationSettingsViewModel>
    {

        private const int rowHeight = 44;

        public UpcomingEventsNotificationSettingsViewController(UpcomingEventsNotificationSettingsViewModel viewModel)
            : base(viewModel, nameof(UpcomingEventsNotificationSettingsViewController))
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            TitleLabel.Text = Resources.UpcomingEvent;

            TableView.ScrollEnabled = false;
            TableView.TableFooterView = new UIView(CGRect.Empty);
            TableView.RegisterNibForCellReuse(UpcomingEventsOptionCell.Nib, UpcomingEventsOptionCell.Identifier);
            TableView.RowHeight = rowHeight;
            TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;

            var source = new CustomTableViewSource<CalendarSectionModel, Unit, SelectableCalendarNotificationsOptionViewModel>(
                UpcomingEventsOptionCell.CellConfiguration(UpcomingEventsOptionCell.Identifier),
                ViewModel.AvailableOptions
            );

            source.Rx().ModelSelected()
                .Subscribe(ViewModel.SelectOption.Inputs)
                .DisposedBy(DisposeBag);

            TableView.Source = source;

            CloseButton.Rx().Tap()
                .Subscribe(() => ViewModel.CloseWithDefaultResult())
                .DisposedBy(DisposeBag);
        }
    }
}


text:
from . import models

def get_public_event_listings(search_term=None):
    qs = models.Event.objects.filter(is_published=True)
    qs = qs.order_by('-start_date')
    if search_term:
        qs = qs.filter(name__icontains=search_term)
    return qs


text:
module flowchart.connection.drawer {
    export interface IConnectionDrawer {
        Draw(shapeFrom, shapeTo, innerColor: string, outerColor: string, thickness?: number, existingConnection?: connection.RaphaelConnection):connection.RaphaelConnection;
    }
}


text:
package com.example.android.architecture.blueprints.todoapp.data;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.LargeTest;
import android.support.test.runner.AndroidJUnit4;

import com.example.android.architecture.blueprints.todoapp.data.source.TasksDataSource;
import com.example.android.architecture.blueprints.todoapp.data.source.local.TasksDbHelper;
import com.example.android.architecture.blueprints.todoapp.data.source.local.TasksLocalDataSource;
import com.example.android.architecture.blueprints.todoapp.util.schedulers.BaseSchedulerProvider;
import com.example.android.architecture.blueprints.todoapp.util.schedulers.ImmediateSchedulerProvider;

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

import java.util.List;

import rx.observers.TestSubscriber;

import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsCollectionContaining.hasItems;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;

/**
 * Integration test for the {@link TasksDataSource}, which uses the {@link TasksDbHelper}.
 */
@RunWith(AndroidJUnit4.class)
@LargeTest
public class TasksLocalDataSourceTest {

    private final static String TITLE = "title";

    private final static String TITLE2 = "title2";

    private final static String TITLE3 = "title3";

    private BaseSchedulerProvider mSchedulerProvider;

    private TasksLocalDataSource mLocalDataSource;

    @Before
    public void setup() {
        TasksLocalDataSource.destroyInstance();
        mSchedulerProvider = new ImmediateSchedulerProvider();

        mLocalDataSource = TasksLocalDataSource.getInstance(
                InstrumentationRegistry.getTargetContext(), mSchedulerProvider);
    }

    @After
    public void cleanUp() {
        mLocalDataSource.deleteAllTasks();
    }

    @Test
    public void testPreConditions() {
        assertNotNull(mLocalDataSource);
    }

    @Test
    public void saveTask_retrievesTask() {
        // Given a new task
        final Task newTask = new Task(TITLE, "");

        // When saved into the persistent repository
        mLocalDataSource.saveTask(newTask);

        // Then the task can be retrieved from the persistent repository
        TestSubscriber<Task> testSubscriber = new TestSubscriber<>();
        mLocalDataSource.getTask(newTask.getId()).subscribe(testSubscriber);
        testSubscriber.assertValue(newTask);
    }

    @Test
    public void completeTask_retrievedTaskIsComplete() {
        // Given a new task in the persistent repository
        final Task newTask = new Task(TITLE, "");
        mLocalDataSource.saveTask(newTask);

        // When completed in the persistent repository
        mLocalDataSource.completeTask(newTask);

        // Then the task can be retrieved from the persistent repository and is complete
        TestSubscriber<Task> testSubscriber = new TestSubscriber<>();
        mLocalDataSource.getTask(newTask.getId()).subscribe(testSubscriber);
        testSubscriber.assertValueCount(1);
        Task result = testSubscriber.getOnNextEvents().get(0);
        assertThat(result.isCompleted(), is(true));
    }

    @Test
    public void activateTask_retrievedTaskIsActive() {
        // Given a new completed task in the persistent repository
        final Task newTask = new Task(TITLE, "");
        mLocalDataSource.saveTask(newTask);
        mLocalDataSource.completeTask(newTask);

        // When activated in the persistent repository
        mLocalDataSource.activateTask(newTask);

        // Then the task can be retrieved from the persistent repository and is active
        TestSubscriber<Task> testSubscriber = new TestSubscriber<>();
        mLocalDataSource.getTask(newTask.getId()).subscribe(testSubscriber);
        testSubscriber.assertValueCount(1);
        Task result = testSubscriber.getOnNextEvents().get(0);
        assertThat(result.isActive(), is(true));
        assertThat(result.isCompleted(), is(false));
    }

    @Test
    public void clearCompletedTask_taskNotRetrievable() {
        // Given 2 new completed tasks and 1 active task in the persistent repository
        final Task newTask1 = new Task(TITLE, "");
        mLocalDataSource.saveTask(newTask1);
        mLocalDataSource.completeTask(newTask1);
        final Task newTask2 = new Task(TITLE2, "");
        mLocalDataSource.saveTask(newTask2);
        mLocalDataSource.completeTask(newTask2);
        final Task newTask3 = new Task(TITLE3, "");
        mLocalDataSource.saveTask(newTask3);

        // When completed tasks are cleared in the repository
        mLocalDataSource.clearCompletedTasks();

        // Then the completed tasks cannot be retrieved and the active one can
        TestSubscriber<List<Task>> testSubscriber = new TestSubscriber<>();
        mLocalDataSource.getTasks().subscribe(testSubscriber);
        List<Task> result = testSubscriber.getOnNextEvents().get(0);
        assertThat(result, not(hasItems(newTask1, newTask2)));
    }

    @Test
    public void deleteAllTasks_emptyListOfRetrievedTask() {
        // Given a new task in the persistent repository and a mocked callback
        Task newTask = new Task(TITLE, "");
        mLocalDataSource.saveTask(newTask);

        // When all tasks are deleted
        mLocalDataSource.deleteAllTasks();

        // Then the retrieved tasks is an empty list
        TestSubscriber<List<Task>> testSubscriber = new TestSubscriber<>();
        mLocalDataSource.getTasks().subscribe(testSubscriber);
        List<Task> result = testSubscriber.getOnNextEvents().get(0);
        assertThat(result.isEmpty(), is(true));
    }

    @Test
    public void getTasks_retrieveSavedTasks() {
        // Given 2 new tasks in the persistent repository
        final Task newTask1 = new Task(TITLE, "");
        mLocalDataSource.saveTask(newTask1);
        final Task newTask2 = new Task(TITLE, "");
        mLocalDataSource.saveTask(newTask2);

        // Then the tasks can be retrieved from the persistent repository
        TestSubscriber<List<Task>> testSubscriber = new TestSubscriber<>();
        mLocalDataSource.getTasks().subscribe(testSubscriber);
        List<Task> result = testSubscriber.getOnNextEvents().get(0);
        assertThat(result, hasItems(newTask1, newTask2));
    }

    @Test
    public void getTask_whenTaskNotSaved() {
        //Given that no task has been saved
        //When querying for a task, null is returned.
        TestSubscriber<Task> testSubscriber = new TestSubscriber<>();
        mLocalDataSource.getTask("1").subscribe(testSubscriber);
        testSubscriber.assertValue(null);
    }

}


text:
import json
import logging
import os
from subprocess import Popen, PIPE

from son_editor.app.exceptions import PackException, ExtNotReachable, NameConflict
from son_editor.models.project import Project
from son_editor.models.workspace import Workspace

logger = logging.getLogger(__name__)

def pack_project(project: Project) -> str:
    """
    Calls the son-package cli tool to pack the project and prepare it for deployment

    :param project: The project to pack
    :return: The file name of the package file
    """
    ws_path = project.workspace.path
    pj_path = os.path.join(ws_path, 'projects', project.rel_path)
    proc = Popen(['son-package', '--workspace', ws_path, '--project', pj_path], stdout=PIPE, stderr=PIPE)

    out, err = proc.communicate()
    out = out.decode()
    err = err.decode()

    exitcode = proc.returncode
    if exitcode == 0:
        for line in err.splitlines():
            if line.find("File") >= 0:
                file_name = line[line.lower().find("file"):].split(" ", 1)[1]
                return file_name
    else:
        for line in err.splitlines():
            if line.find("ERROR") >= 0:
                error_message = line[line.find("ERROR"):]
                raise PackException(error_message)
    raise PackException(err)

def push_to_platform(package_path: str, ws: Workspace) -> str:
    """
    Pushes the package located at the package_path to the specified Platform

    :param package_path: the location of package to be pushed on disk
    :param platform: The platform to upload to
    :return: The uuid returned by the platform
    """

    # TODO use platform id instead of default platform for ws
    proc = Popen(['son-access', "push", "--workspace", ws.path, '--upload', package_path], stdout=PIPE, stderr=PIPE)

    out, err = proc.communicate()
    out = out.decode()
    err = err.decode()

    logger.info("Out:" + out)
    logger.info("Error:" + err)

    exitcode = proc.returncode  # as of now exitcode is 0 even if there is an error
    if "ConnectionError" in out or "ConnectionError" in err:
        raise ExtNotReachable("Could not connect to platform.")
    elif "error" in out.lower() or "error" in err.lower():
        raise NameConflict("Out: " + out + "Error: " + err)
    elif "201" in out:
        start_index = out.index('{"service_uuid')
        end_index = out.index('}', start_index)
        out = out[start_index:end_index + 1]
        uuid = json.loads(out)
        return uuid
    else:
        return out

# Not Supported for now
# def deploy_on_platform(service_uuid: dict, platform: Platform) -> str:
#     """
#     Pushes the package located at the package_path to the specified Platform
#     :param service_uuid: a dictionary with the service uuid on the platform
#     :param platform: The platform to upload to
#     :return:
#     """
#     proc = Popen(['son-push', platform.url, '-D', str(service_uuid['service_uuid'])], stdout=PIPE, stderr=PIPE)
#
#     out, err = proc.communicate()
#     out = out.decode()
#     err = err.decode()
#
#     logger.info("Out:" + out)
#     logger.info("Error:" + err)
#
#     exitcode = proc.returncode  # as of now exitcode is 0 even if there is an error
#     if "ConnectionError" in out or err:
#         raise ExtNotReachable("Could not connect to platform.")
#     elif "error" in out.lower() or err.lower():
#         raise NameConflict("Out: " + out + "Error: " + err)
#     else:
#         return out


text:
import moment from 'moment';

Meteor.startup(function() {
	Tracker.autorun(function() {
		var user, utcOffset;
		user = Meteor.user();
		if (user && user.statusConnection === 'online') {
			utcOffset = moment().utcOffset() / 60;
			if (user.utcOffset !== utcOffset) {
				Meteor.call('userSetUtcOffset', utcOffset);
			}
		}
	});
});


text:
"use strict" ;

// MRAA, as per usual
var mraa = require('mraa');

// TI ADS1015 on ADC Block (http://www.ti.com.cn/cn/lit/ds/symlink/ads1015.pdf)
var adc = new mraa.I2c(1);
adc.address(0x48);

// Read from ADC and return voltage
adc.readADC = function(channel) {

    // The ADC Block can't have more than 4 channels
    if (channel <= 0) {
        channel = 0;
    }
    if (channel >= 3) {
        channel = 3;
    }

    // We will use constant settings for the config register
    var config = 0;                 // Bits     Description
    config |= 1 << 15;              // [15]     Begin a single conversion
    config |= 1 << 14;              // [14]     Non-differential ADC
    config |= channel << 12;        // [13:12]  Choose a channel
    config |= 1 << 9;               // [11:9]   +/-4.096V range
    config |= 1 << 8;               // [8]      Power-down, single-shot mode
    config |= 4 << 5;               // [7:5]    1600 samples per second
    config &= ~(1 << 4);            // [4]      Traditional comparator
    config &= ~(1 << 3);            // [3]      Active low comparator polarity
    config &= ~(1 << 2);            // [2]      Non-latching comparator
    config |= 3;                    // [1:0]    Disable comparator

    // Write config settings to ADC to start reading
    this.writeWordFlip(0x01, config);

    // Wait for conversion to complete
    while (!(this.readWordFlip(0x01) & 0x8000)) {
    }

    // Read value from conversion register and shift by 4 bits
    var voltage = (adc.readWordFlip(0x00) >> 4);

    // Find voltage, which is 2mV per incement
    voltage = 0.002 * voltage;

    return voltage
};

// The ADS1015 accepts LSB first, so we flip the bytes
adc.writeWordFlip = function(reg, data) {
    var buf = ((data & 0xff) << 8) | ((data & 0xff00) >> 8);
    return this.writeWordReg(reg, buf);
};

// The ADS1015 gives us LSB first, so we flip the bytes
adc.readWordFlip = function(reg) {
    var buf = adc.readWordReg(reg);
    return ((buf & 0xff) << 8) | ((buf & 0xff00) >> 8);
};

// Set up a digital output on MRAA pin 20 (GP12)
var ledPin = new mraa.Gpio(20); // create an object for pin 20
ledPin.dir(mraa.DIR_OUT);  // set the direction of the pin to OUPUT

// setup interval holders
var intervalIDLightSensor;
var intervalIDLed;

// now we are going to read the analog input at a periodic interval
// connect a jumper wire to the sampled analog input and touch it to
// a +1.8V, +3.3V, +5V or GND input to change the value read by the analog input

var BlinkNormalMs = 1000.0/5.0;
var BlinkAlertMs = 1000.0/50.0;

var analogIn ;
var lightThreshold = 0.8;
var lightSensorState = 1;  // 1 = above threshold, 0 = below
var readLightSensor = function() {
    // Read light sensor (on ADC1)
    var v1 = adc.readADC(1);
    //process.stdout.write(v1 + " ") ;          // write a stream of analog values to the console
    if ((!lightSensorState) && (v1>lightThreshold)){
        console.log("changing to normal")
        lightSensorState = 1;
        clearInterval(intervalIDLed);
        intervalIDLed = setInterval(writeLed, BlinkNormalMs) ;  // start the periodic read
    }
    else if ((lightSensorState) && (v1<lightThreshold)){
        console.log("changing to alert")
        lightSensorState = 0;
        clearInterval(intervalIDLed);
        intervalIDLed = setInterval(writeLed, BlinkAlertMs) ;  // start the periodic read
    }
};

// global variable for pin state
var ledState = 0;
function writeLed()
{
    // toggle state of led
    ledState = (ledPin.read()?0:1);
    // set led value
    ledPin.write(ledState);
}

// setup perdiodic activity for light sensor reading
intervalIDLightSensor = setInterval(readLightSensor, 500) ;  // start the periodic read
intervalIDLed = setInterval(writeLed, BlinkNormalMs) ;  // start the periodic read


text:
CGSize CGDrawAtPointExt(NSString *string, CGPoint point, UIFont *font)
{
    CGSize size = CGSizeZero;
    if ([string respondsToSelector:@selector(drawInRect:withAttributes:)]) {
        NSDictionary *attributes = @{NSFontAttributeName: font};
        size = [string sizeWithAttributes:attributes];
        [string drawAtPoint:point withAttributes:attributes];
    }
    else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        [string drawAtPoint:point withFont:font];
#pragma clang diagnostic pop
    }
    return size;
}


text:
__author__ = 'Frederic'

import os
import sys
sys.path.append("../src")
from gehol import GeholProxy
from gehol.professorcalendar import ProfessorCalendar
from gehol.converters.utils import  write_content_to_file
from gehol.converters.rfc5545icalwriter import convert_geholcalendar_to_ical
from pprint import pprint

first_monday = '19/09/2011'

def make_ical_from_local_file(filename):
    f = open(filename)
    cal = ProfessorCalendar(f)
    print cal.header_data
    pprint(cal.events)

    ical_content = convert_geholcalendar_to_ical(cal, first_monday)
    write_content_to_file(ical_content, "%s.ics" % cal.description)

def make_ical_from_prof_id(prof_id):
    gehol_proxy = GeholProxy()
    cal = gehol_proxy.get_professor_calendar(prof_id, "1-14")
    ical = convert_geholcalendar_to_ical(cal, first_monday)
    ical_data = ical.as_string()
    outfile = "%s.ics" % ical.name
    print "writing ical file : %s" % outfile
    write_content_to_file(ical_data, outfile)

PROF_IDS = [32781, 49171, 55405, 20453, 96317, 52485]

if __name__ == "__main__":
    for id in PROF_IDS:
        make_ical_from_prof_id(id)


text:
<?php

// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
	die("Direct initialization of this file is not allowed.

Please make sure IN_MYBB is defined.");
}

class Horde_Text_Diff_Renderer_Context extends Horde_Text_Diff_Renderer
{
    /**
     * Number of leading context "lines" to preserve.
     */
    protected $_leading_context_lines = 4;

    /**
     * Number of trailing context "lines" to preserve.
     */
    protected $_trailing_context_lines = 4;

    protected $_second_block = '';

    protected function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
    {
        if ($xlen != 1) {
            $xbeg .= ',' . $xlen;
        }
        if ($ylen != 1) {
            $ybeg .= ',' . $ylen;
        }
        $this->_second_block = "--- $ybeg ----\n";
        return "***************\n*** $xbeg ****";
    }

    protected function _endBlock()
    {
        return $this->_second_block;
    }

    protected function _context($lines)
    {
        $this->_second_block .= $this->_lines($lines, '  ');
        return $this->_lines($lines, '  ');
    }

    protected function _added($lines)
    {
        $this->_second_block .= $this->_lines($lines, '+ ');
        return '';
    }

    protected function _deleted($lines)
    {
        return $this->_lines($lines, '- ');
    }

    protected function _changed($orig, $final)
    {
        $this->_second_block .= $this->_lines($final, '! ');
        return $this->_lines($orig, '! ');
    }

}


text:
namespace Game
{
    using System;
    using UnityEngine;

    [RequireComponent(typeof(Animator))]
    public class PlayerAnimator : MonoBehaviour
    {
        private const float moveThreshold = 0.1f;
        private const float attackDirThreshold = 0.1f;
        private const float dashDirThreshold = 0.1f;

        public string walking = "Walking";

        public string attackingSideways = "AttackSideways";

        public string attackingUp = "AttackUp";

        public string attackingDown = "AttackDown";

        public string dashingSideways = "DashSideways";

        public string dashingUp = "DashUp";

        public string dashingDown = "DashDown";

        public string hit = "Hit";

        private PlayerMover _mover;
        private PlayerController _player;
        private Animator _animator;
        private SpriteRenderer _spriteRenderer;

        private float _lastDash;

        private void OnEnable()
        {
            _spriteRenderer = this.GetComponentInChildren<SpriteRenderer>();
            if (_spriteRenderer == null)
            {
                throw new ArgumentNullException("_spriteRenderer");
            }

            _mover = this.GetComponent<PlayerMover>();
            _player = this.GetComponent<PlayerController>();
            _animator = this.GetComponent<Animator>();
        }

        private void FixedUpdate()
        {
            HandleWalking();
            HandleAttacking();

            _animator.SetBool(this.hit, _player.isHit);
        }

        public void Dash(Vector3 dir)
        {
            if (dir.sqrMagnitude > dashDirThreshold)
            {
                var dashSideways = Mathf.Abs(dir.x) > dashDirThreshold;
                _animator.SetBool(this.dashingSideways, dashSideways);
                if (dashSideways)
                {
                    var left = dir.x < 0f;
                    _spriteRenderer.flipX = left;
                }
                else if (Mathf.Abs(dir.z) > dashDirThreshold)
                {
                    var up = dir.z > 0f;
                    _animator.SetBool(this.dashingUp, up);
                    _animator.SetBool(this.dashingDown, !up);
                }

                return;
            }

            StopDash();
        }

        public void StopDash()
        {
            _animator.SetBool(this.dashingSideways, false);
            _animator.SetBool(this.dashingUp, false);
            _animator.SetBool(this.dashingDown, false);
        }

        private bool HandleAttacking()
        {
            var attackDir = _player.attackDirection;
            if (attackDir.sqrMagnitude > attackDirThreshold)
            {
                var attackSideways = Mathf.Abs(attackDir.x) > attackDirThreshold;
                _animator.SetBool(this.attackingSideways, attackSideways);
                if (attackSideways)
                {
                    // sideways attacks are prioritized first
                    var left = attackDir.x < 0f;
                    _spriteRenderer.flipX = left;
                }
                else if (Mathf.Abs(attackDir.z) > attackDirThreshold)
                {
                    var up = attackDir.z > 0f;
                    _animator.SetBool(this.attackingUp, up);
                    _animator.SetBool(this.attackingDown, !up);
                }

                return true;
            }

            _animator.SetBool(this.attackingSideways, false);
            _animator.SetBool(this.attackingUp, false);
            _animator.SetBool(this.attackingDown, false);
            return false;
        }

        private bool HandleWalking()
        {
            var velocity = _mover.velocity;
            var walking = velocity.sqrMagnitude > moveThreshold &&
                !((_animator.GetBool(this.dashingSideways) || _animator.GetBool(this.dashingUp) || _animator.GetBool(this.dashingDown)));
            _animator.SetBool(this.walking, walking);
            if (walking)
            {
                var left = velocity.x < 0f;
                _spriteRenderer.flipX = left;
            }

            return walking;
        }
    }
}


text:
package org.elasticsearch.test.action.bulk;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.DocWriteRequest;
import org.elasticsearch.action.bulk.BulkItemResponse;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.bulk.TransportBulkAction;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.testframework.ESTestCase;
import org.hamcrest.Matchers;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.mockito.Mockito.mock;

public class BulkRequestModifierTests extends ESTestCase {

    public void testBulkRequestModifier() {
        int numRequests = scaledRandomIntBetween(8, 64);
        BulkRequest bulkRequest = new BulkRequest();
        for (int i = 0; i < numRequests; i++) {
            bulkRequest.add(new IndexRequest("_index", "_type", String.valueOf(i)).source("{}", XContentType.JSON));
        }
        CaptureActionListener actionListener = new CaptureActionListener();
        TransportBulkAction.BulkRequestModifier bulkRequestModifier = new TransportBulkAction.BulkRequestModifier(bulkRequest);

        int i = 0;
        Set<Integer> failedSlots = new HashSet<>();
        while (bulkRequestModifier.hasNext()) {
            bulkRequestModifier.next();
            if (randomBoolean()) {
                bulkRequestModifier.markCurrentItemAsFailed(new RuntimeException());
                failedSlots.add(i);
            }
            i++;
        }

        assertThat(bulkRequestModifier.getBulkRequest().requests().size(), equalTo(numRequests - failedSlots.size()));
        // simulate that we actually executed the modified bulk request:
        long ingestTook = randomLong();
        ActionListener<BulkResponse> result = bulkRequestModifier.wrapActionListenerIfNeeded(ingestTook, actionListener);
        result.onResponse(new BulkResponse(new BulkItemResponse[numRequests - failedSlots.size()], 0));

        BulkResponse bulkResponse = actionListener.getResponse();
        assertThat(bulkResponse.getIngestTookInMillis(), equalTo(ingestTook));
        for (int j = 0; j < bulkResponse.getItems().length; j++) {
            if (failedSlots.contains(j)) {
                BulkItemResponse item = bulkResponse.getItems()[j];
                assertThat(item.isFailed(), is(true));
                assertThat(item.getFailure().getIndex(), equalTo("_index"));
                assertThat(item.getFailure().getType(), equalTo("_type"));
                assertThat(item.getFailure().getId(), equalTo(String.valueOf(j)));
                assertThat(item.getFailure().getMessage(), equalTo("java.lang.RuntimeException"));
            } else {
                assertThat(bulkResponse.getItems()[j], nullValue());
            }
        }
    }

    public void testPipelineFailures() {
        BulkRequest originalBulkRequest = new BulkRequest();
        for (int i = 0; i < 32; i++) {
            originalBulkRequest.add(new IndexRequest("index", "type", String.valueOf(i)));
        }

        TransportBulkAction.BulkRequestModifier modifier = new TransportBulkAction.BulkRequestModifier(originalBulkRequest);
        for (int i = 0; modifier.hasNext(); i++) {
            modifier.next();
            if (i % 2 == 0) {
                modifier.markCurrentItemAsFailed(new RuntimeException());
            }
        }

        // So half of the requests have "failed", so only the successful requests are left:
        BulkRequest bulkRequest = modifier.getBulkRequest();
        assertThat(bulkRequest.requests().size(), Matchers.equalTo(16));

        List<BulkItemResponse> responses = new ArrayList<>();
        ActionListener<BulkResponse> bulkResponseListener = modifier.wrapActionListenerIfNeeded(1L, new ActionListener<BulkResponse>() {
            @Override
            public void onResponse(BulkResponse bulkItemResponses) {
                responses.addAll(Arrays.asList(bulkItemResponses.getItems()));
            }

            @Override
            public void onFailure(Exception e) {
            }
        });

        List<BulkItemResponse> originalResponses = new ArrayList<>();
        for (DocWriteRequest actionRequest : bulkRequest.requests()) {
            IndexRequest indexRequest = (IndexRequest) actionRequest;
            IndexResponse indexResponse = new IndexResponse(new ShardId("index", "_na_", 0), indexRequest.type(),
                                                               indexRequest.id(), 1, 17, 1, true);
            originalResponses.add(new BulkItemResponse(Integer.parseInt(indexRequest.id()), indexRequest.opType(), indexResponse));
        }
        bulkResponseListener.onResponse(new BulkResponse(originalResponses.toArray(new BulkItemResponse[originalResponses.size()]), 0));

        assertThat(responses.size(), Matchers.equalTo(32));
        for (int i = 0; i < 32; i++) {
            assertThat(responses.get(i).getId(), Matchers.equalTo(String.valueOf(i)));
        }
    }

    public void testNoFailures() {
        BulkRequest originalBulkRequest = new BulkRequest();
        for (int i = 0; i < 32; i++) {
            originalBulkRequest.add(new IndexRequest("index", "type", String.valueOf(i)));
        }

        TransportBulkAction.BulkRequestModifier modifier = new TransportBulkAction.BulkRequestModifier(originalBulkRequest);
        while (modifier.hasNext()) {
            modifier.next();
        }

        BulkRequest bulkRequest = modifier.getBulkRequest();
        assertThat(bulkRequest, Matchers.sameInstance(originalBulkRequest));
        @SuppressWarnings("unchecked")
        ActionListener<BulkResponse> actionListener = mock(ActionListener.class);
        assertThat(modifier.wrapActionListenerIfNeeded(1L, actionListener).getClass().isAnonymousClass(), is(true));
    }

    private static class CaptureActionListener implements ActionListener<BulkResponse> {

        private BulkResponse response;

        @Override
        public void onResponse(BulkResponse bulkItemResponses) {
            this.response = bulkItemResponses;
        }

        @Override
        public void onFailure(Exception e) {
        }

        public BulkResponse getResponse() {
            return response;
        }
    }
}


text:
from odoo import fields, models

class SaleOrder(models.Model):
    _inherit = "sale.order"
    buy_now = fields.Boolean("Is Buy now")


text:
package org.jetbrains.plugins.groovy.codeInspection.bugs;

import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.codeStyle.CodeStyleManager;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.codeInspection.GroovyInspectionBundle;
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifier;

public class GrRemoveModifierFix extends GrModifierFix {

  public GrRemoveModifierFix(@NotNull @GrModifier.GrModifierConstant String modifier) {
    this(modifier, GroovyInspectionBundle.message("unnecessary.modifier.remove", modifier));
  }

  public GrRemoveModifierFix(@NotNull @GrModifier.GrModifierConstant String modifier, @NotNull String text) {
    super(text, modifier, false, GrModifierFix.MODIFIER_LIST_CHILD);
  }

  @Override
  protected void doFix(Project project, ProblemDescriptor descriptor) throws IncorrectOperationException {
    CodeStyleManager.getInstance(project).performActionWithFormatterDisabled((Runnable)() -> super.doFix(project, descriptor));
  }
}


text:
"""
API to interact with a message broker.
"""

# Module import
# -------------------------------------------------------------------------------------------------
import urllib.parse as parse
import logging
import time
import stomp

# Logger
# -------------------------------------------------------------------------------------------------
logging.basicConfig(level=logging.DEBUG)
LOGGER = logging.getLogger(__name__)

# Classes
# -------------------------------------------------------------------------------------------------
class MyListener(stomp.ConnectionListener):
    """
    Custom listener to ping the queue for new messages.
    """
    def __init__(self, messages):
        """
        :param buffer:
            The list of messages retrieved from the queue in one sit
        """
        self.buffer = messages

    def on_message(self, headers, body):
        """
        Called by the STOMP connection when a MESSAGE frame is received.
        This method overrides the implementation provided for the stomp.ConnectionListener object.

        :param dict headers:
            a dictionary containing all headers sent by the server as key/value pairs.
        :param body:
            the frame's payload - the message body.
        """
        self.buffer.append(body)

class Broker(object):
    """
    Represents the information needed to establish a connection with a message broker.
    """
    def __init__(self, broker_uri, queue):
        """
        :param broker_uri:
            The address of the message broker
        :param queue:
            The name of the message queue
        """
        # The tuple with the hostname and port of the message broker
        self.host_and_port = self._parse_uri(broker_uri)
        self.queue = queue

        # The stomp.Connection12 instance with the connection to the message broker
        self.connection = None

        # The internal buffer with messages retrieved from the queue. It's managed as a stack,
        # which means that it works as FIFO.
        self.message_buffer = []

    def connect(self):
        """
        Establishes a new connection to the message broker.

        :raises stomp.exception.StompException:
            Common exception class. All specific stomp.py exceptions are subclasses of
            StompException, allowing the library user to catch all current and future library
            exceptions.
        """
        try:
            self.connection = stomp.Connection12([self.host_and_port])
            self.connection.set_listener('PrintingListener', stomp.listener.PrintingListener())
            self.connection.start()
            self.connection.connect(wait=True)
        except stomp.exception.StompException as ex:
            LOGGER.error(ex)
            quit(1)

    def subscribe(self):
        """
        Subscribes to a queue in the message broker.

        :raises stomp.exception.StompException:
            Common exception class. All specific stomp.py exceptions are subclasses of
            StompException, allowing the library user to catch all current and future library
            exceptions.
        """
        try:
            self.connection.set_listener('MyListener', MyListener(self.message_buffer))
            self.connection.subscribe(destination=self.queue, id=1, ack='auto')
            time.sleep(2)
        except stomp.exception.StompException as ex:
            LOGGER.error(ex)
            quit(1)

    def push(self, message):
        """
        Sends a message to the queue.

        :param message:
            The message

        :raises stomp.exception.StompException:
            Common exception class. All specific stomp.py exceptions are subclasses of
            StompException, allowing the library user to catch all current and future library
            exceptions.
        """
        try:
            time.sleep(2)
            self.connection.send(self.queue, message)
        except stomp.exception.StompException as ex:
            LOGGER.error(ex)
            quit(1)

    def disconnect(self):
        """
        Disconnects from the message broker.

        :raises stomp.exception.StompException:
            Common exception class. All specific stomp.py exceptions are subclasses of
            StompException, allowing the library user to catch all current and future library
            exceptions.
        """
        try:
            time.sleep(2)
            self.connection.disconnect()
        except stomp.exception.StompException as ex:
            LOGGER.error(ex)
            quit(1)

    def pop_message(self):
        """
        Retrieves the message at the top of the buffer.

        :rtype:
            object
        :return:
            The first message in the buffer
        """
        return self.pop_messages(1)

    def pop_messages(self, number):
        """
        Retrieves a specific number of messages from the top of the buffer.

        :param number:
            The number of messages to retrieve from the buffer
        :rtype:
            list
        :return:
            A list with the first 'number' messages in the buffer
        """
        return [self.message_buffer.pop(0) for index in range(number) if self.message_buffer]

    def _parse_uri(self, broker_uri):
        """
        Parses a message broker URI to retrieve the hostname and the port.

        As an example, the URI would be something like: 'stomp://127.0.0.1:61613'

        :param broker_uri:
            The broker URI
        :rtype:
            tuple
        :return:
            A tuple with the hostname and the port
        """
        elements = parse.urlparse(broker_uri)
        return (elements.hostname, elements.port)

def fancy_send(broker, message):
    """
    Fancy wrapper that combines several operations to send a message to the message broker.

    :param broker:
        The Broker instance
    :param message:
        The message
    """
    broker.connect()
    broker.push(message)
    broker.disconnect()

def fancy_retrieve(broker, num_messages=1):
    """
    Fancy wrapper that combines several operations to retrieve a message from the message broker.

    :param broker:
        The Broker instance
    :param num_messages:
        The number of messages to retrieve from the queue
    :rtype:
        list
    :return:
        The list of messages kept in the internal message buffer
    """
    broker.connect()
    broker.subscribe()
    messages = broker.pop_messages(num_messages)
    broker.disconnect()
    return messages


text:
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 4 Test: word-boundary-expansion and keep-all</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-4/#word-boundary-expansion">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#word-break-property">
<link rel="match" href="reference/word-boundary-014-ref.html">
<meta name="assert" content="spaces inserted by word-boundary-expansion provide soft wrapping opportunities, even with keep-all">

Test passes if the two boxes below are identical.

aa<wbr>bb<wbr>cc

aa bb
cc


text:
Serves to ensure that new changes have not introduced new bugs in older programming.

Note: unit tests are automatically regression tests (just another benefit of TDD).

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [CSS Visual Regression Testing](#css-visual-regression-testing)
  - [BackstopJS](#backstopjs)
    - [Installing](#installing)
    - [backstop.json](#backstopjson)
    - [Flags](#flags)
    - [Cross-browser testing](#cross-browser-testing)
    - [.gitignore](#gitignore)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## CSS Visual Regression Testing
> "Breaking CSS is easy, testing it is hard"

General idea is about **comparing test screenshots to a set of reference screenshots** (source of truth created previously).

### [BackstopJS](https://garris.github.io/BackstopJS/)
BackstopJS automates visual regression testing of responsive web UI by comparing DOM screenshots over time.

#### [Installing](https://github.com/garris/BackstopJS#installation)

```Shell
npm install [-g] backstopjs

# Generate backstop.json
backstop genConfig
```

#### backstop.json

##### id
The unique name of config file. Used to manage and name files.

##### viewports
###### Useful resolution info:

- [Global Web Stats](https://www.w3counter.com/globalstats.php)
- [Screen resolution stats Worldwide](http://gs.statcounter.com/screen-resolution-stats)
- [Liveinternet Stats](http://www.liveinternet.ru/stat/us/resolutions.html?period=month)
- [A quick reference for iOS devices.](http://iosres.com/)

###### Example:
```json
{
    "viewports": [
        {
            "name": "nHD",
            "width": 360,
            "height": 640
        },
        {
            "name": "iPhone 7",
            "width": 375,
            "height": 667
        },
        {
            "name": "VGA / 480p",
            "width": 480,
            "height": 640
        },
        {
            "name": "XGA (Extended Graphics Array)",
            "width": 1024,
            "height": 768
        },
        {
            "name": "HD",
            "width": 1280,
            "height": 720
        },
        {
            "name": "WXGA (Wide Extended Graphics Array)",
            "width": 1366,
            "height": 768
        },
        {
            "name": "FHD (Full HD) 21-27",
            "width": 1920,
            "height": 1080
        }
    ]
}
```

##### scenarios
Each scenario is a test for a specific static page or global app state.

It includes the URLs and element selectors to test (each selector will be screenshoted and tested).

Selectors accept standard CSS notation and a magic selector `document` for entire document to be tested.

##### Workflow
```Shell
# Create source of truth from current app state
backstop reference
# Compare current app state to the source of truth (reference)
backstop test
```

#### Flags
```Shell
# Custom config file with relative path
backstop [reference/test] --configPath=backstopTests/someTest.json

# Incremental scenario reference/testing
backstop [reference/test] --i

# Run only for specific scenarios
## --filter argument takes a regEx string
backstop [reference/test] --i --filter=<scenario.label>
````

#### Cross-browser testing
By now is achieved with `engine` selection in `backstop.json`:

1. PhantomJS uses webkit (more or less Chrome)
2. SlimerJS uses Gecko (more or less Firefox).

Also, keep track of that issues: [#183](https://github.com/garris/BackstopJS/issues/183),
[#274](https://github.com/garris/BackstopJS/issues/274).

#### .gitignore
In case of excluding tests results:
```
backstop_data/bitmaps_test
backstop_data/html_report
```


text:
package org.mengyun.tcctransaction.grpc.interceptor;

import io.grpc.Metadata;
import io.grpc.ServerCall;
import io.grpc.ServerCallHandler;
import io.grpc.ServerInterceptor;
import org.mengyun.tcctransaction.api.TransactionContext;
import org.mengyun.tcctransaction.grpc.constants.TransactionContextConstants;
import org.mengyun.tcctransaction.serializer.TransactionContextSerializer;

/**
 * @author Nervose.Wu
 * @date 2022/6/24 16:36
 */
public class TransactionContextServerInterceptor implements ServerInterceptor {

    private TransactionContextSerializer serializer = new TransactionContextSerializer();

    @Override
    public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> serverCall, Metadata metadata, ServerCallHandler<ReqT, RespT> serverCallHandler) {
        TransactionContext transactionContext = getTransactionContext(metadata);
        return new ServerListenerProxy<>(transactionContext, serverCallHandler.startCall(serverCall, metadata));
    }

    private TransactionContext getTransactionContext(Metadata metadata) {
        byte[] transactionContextBytes = metadata.get(TransactionContextConstants.TRANSACTION_CONTEXT_HEADER_KEY);
        return serializer.deserialize(transactionContextBytes);
    }
}