text:
// Code generated by protoc-gen-go.
// source: google/pubsub/v1beta2/pubsub.proto
// DO NOT EDIT!

/*
Package google_pubsub_v1beta2 is a generated protocol buffer package.

It is generated from these files:
	google/pubsub/v1beta2/pubsub.proto

It has these top-level messages:
	Topic
	PubsubMessage
	GetTopicRequest
	PublishRequest
	PublishResponse
	ListTopicsRequest
	ListTopicsResponse
	ListTopicSubscriptionsRequest
	ListTopicSubscriptionsResponse
	DeleteTopicRequest
	Subscription
	PushConfig
	ReceivedMessage
	GetSubscriptionRequest
	ListSubscriptionsRequest
	ListSubscriptionsResponse
	DeleteSubscriptionRequest
	ModifyPushConfigRequest
	PullRequest
	PullResponse
	ModifyAckDeadlineRequest
	AcknowledgeRequest
*/
package google_pubsub_v1beta2

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "go.pedge.io/google-protobuf"

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

// A topic resource.
type Topic struct {
	// Name of the topic.
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}

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

// A message data and its attributes.
type PubsubMessage struct {
	// The message payload. For JSON requests, the value of this field must be
	// base64-encoded.
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// Optional attributes for this message.
	Attributes map[string]string `protobuf:"bytes,2,rep,name=attributes" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	// ID of this message assigned by the server at publication time. Guaranteed
	// to be unique within the topic. This value may be read by a subscriber
	// that receives a PubsubMessage via a Pull call or a push delivery. It must
	// not be populated by a publisher in a Publish call.
	MessageId string `protobuf:"bytes,3,opt,name=message_id" json:"message_id,omitempty"`
}

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

func (m *PubsubMessage) GetAttributes() map[string]string {
	if m != nil {
		return m.Attributes
	}
	return nil
}

// Request for the GetTopic method.
type GetTopicRequest struct {
	// The name of the topic to get.
	Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"`
}

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

// Request for the Publish method.
type PublishRequest struct {
	// The messages in the request will be published on this topic.
	Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"`
	// The messages to publish.
	Messages []*PubsubMessage `protobuf:"bytes,2,rep,name=messages" json:"messages,omitempty"`
}

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

func (m *PublishRequest) GetMessages() []*PubsubMessage {
	if m != nil {
		return m.Messages
	}
	return nil
}

// Response for the Publish method.
type PublishResponse struct {
	// The server-assigned ID of each published message, in the same order as
	// the messages in the request. IDs are guaranteed to be unique within
	// the topic.
	MessageIds []string `protobuf:"bytes,1,rep,name=message_ids" json:"message_ids,omitempty"`
}

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

// Request for the ListTopics method.
type ListTopicsRequest struct {
	// The name of the cloud project that topics belong to.
	Project string `protobuf:"bytes,1,opt,name=project" json:"project,omitempty"`
	// Maximum number of topics to return.
	PageSize int32 `protobuf:"varint,2,opt,name=page_size" json:"page_size,omitempty"`
	// The value returned by the last ListTopicsResponse; indicates that this is
	// a continuation of a prior ListTopics call, and that the system should
	// return the next page of data.
	PageToken string `protobuf:"bytes,3,opt,name=page_token" json:"page_token,omitempty"`
}

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

// Response for the ListTopics method.
type ListTopicsResponse struct {
	// The resulting topics.
	Topics []*Topic `protobuf:"bytes,1,rep,name=topics" json:"topics,omitempty"`
	// If not empty, indicates that there may be more topics that match the
	// request; this value should be passed in a new ListTopicsRequest.
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token" json:"next_page_token,omitempty"`
}

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

func (m *ListTopicsResponse) GetTopics() []*Topic {
	if m != nil {
		return m.Topics
	}
	return nil
}

// Request for the ListTopicSubscriptions method.
type ListTopicSubscriptionsRequest struct {
	// The name of the topic that subscriptions are attached to.
	Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"`
	// Maximum number of subscription names to return.
	PageSize int32 `protobuf:"varint,2,opt,name=page_size" json:"page_size,omitempty"`
	// The value returned by the last ListTopicSubscriptionsResponse; indicates
	// that this is a continuation of a prior ListTopicSubscriptions call, and
	// that the system should return the next page of data.
	PageToken string `protobuf:"bytes,3,opt,name=page_token" json:"page_token,omitempty"`
}

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

// Response for the ListTopicSubscriptions method.
type ListTopicSubscriptionsResponse struct {
	// The names of the subscriptions that match the request.
	Subscriptions []string `protobuf:"bytes,1,rep,name=subscriptions" json:"subscriptions,omitempty"`
	// If not empty, indicates that there may be more subscriptions that match
	// the request; this value should be passed in a new
	// ListTopicSubscriptionsRequest to get more subscriptions.
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token" json:"next_page_token,omitempty"`
}

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

// Request for the DeleteTopic method.
type DeleteTopicRequest struct {
	// Name of the topic to delete.
	Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"`
}

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

// A subscription resource.
type Subscription struct {
	// Name of the subscription.
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	// The name of the topic from which this subscription is receiving messages.
	// This will be present if and only if the subscription has not been detached
	// from its topic.
	Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"`
	// If push delivery is used with this subscription, this field is
	// used to configure it. An empty pushConfig signifies that the subscriber
	// will pull and ack messages using API methods.
	PushConfig *PushConfig `protobuf:"bytes,4,opt,name=push_config" json:"push_config,omitempty"`
	// This value is the maximum time after a subscriber receives a message
	// before the subscriber should acknowledge the message. After message
	// delivery but before the ack deadline expires and before the message is
	// acknowledged, it is an outstanding message and will not be delivered
	// again during that time (on a best-effort basis).
	//
	// For pull delivery this value
	// is used as the initial value for the ack deadline. It may be overridden
	// for a specific message by calling ModifyAckDeadline.
	//
	// For push delivery, this value is also used to set the request timeout for
	// the call to the push endpoint.
	//
	// If the subscriber never acknowledges the message, the Pub/Sub
	// system will eventually redeliver the message.
	AckDeadlineSeconds int32 `protobuf:"varint,5,opt,name=ack_deadline_seconds" json:"ack_deadline_seconds,omitempty"`
}

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

func (m *Subscription) GetPushConfig() *PushConfig {
	if m != nil {
		return m.PushConfig
	}
	return nil
}

// Configuration for a push delivery endpoint.
type PushConfig struct {
	// A URL locating the endpoint to which messages should be pushed.
	// For example, a Webhook endpoint might use "https://example.com/push".
	PushEndpoint string `protobuf:"bytes,1,opt,name=push_endpoint" json:"push_endpoint,omitempty"`
	// Endpoint configuration attributes.
	//
	// Every endpoint has a set of API supported attributes that can be used to
	// control different aspects of the message delivery.
	//
	// The currently supported attribute is `x-goog-version`, which you can
	// use to change the format of the push message. This attribute
	// indicates the version of the data expected by the endpoint. This
	// controls the shape of the envelope (i.e. its fields and metadata).
	// The endpoint version is based on the version of the Pub/Sub
	// API.
	//
	// If not present during the CreateSubscription call, it will default to
	// the version of the API used to make such call. If not present during a
	// ModifyPushConfig call, its value will not be changed. GetSubscription
	// calls will always return a valid version, even if the subscription was
	// created without this attribute.
	//
	// The possible values for this attribute are:
	//
	// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
	// * `v1beta2`: uses the push format defined in the v1beta2 Pub/Sub API.
	//
	Attributes map[string]string `protobuf:"bytes,2,rep,name=attributes" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}

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

func (m *PushConfig) GetAttributes() map[string]string {
	if m != nil {
		return m.Attributes
	}
	return nil
}

// A message and its corresponding acknowledgment ID.
type ReceivedMessage struct {
	// This ID can be used to acknowledge the received message.
	AckId string `protobuf:"bytes,1,opt,name=ack_id" json:"ack_id,omitempty"`
	// The message.
	Message *PubsubMessage `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
}

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

func (m *ReceivedMessage) GetMessage() *PubsubMessage {
	if m != nil {
		return m.Message
	}
	return nil
}

// Request for the GetSubscription method.
type GetSubscriptionRequest struct {
	// The name of the subscription to get.
	Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"`
}

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

// Request for the ListSubscriptions method.
type ListSubscriptionsRequest struct {
	// The name of the cloud project that subscriptions belong to.
	Project string `protobuf:"bytes,1,opt,name=project" json:"project,omitempty"`
	// Maximum number of subscriptions to return.
	PageSize int32 `protobuf:"varint,2,opt,name=page_size" json:"page_size,omitempty"`
	// The value returned by the last ListSubscriptionsResponse; indicates that
	// this is a continuation of a prior ListSubscriptions call, and that the
	// system should return the next page of data.
	PageToken string `protobuf:"bytes,3,opt,name=page_token" json:"page_token,omitempty"`
}

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

// Response for the ListSubscriptions method.
type ListSubscriptionsResponse struct {
	// The subscriptions that match the request.
	Subscriptions []*Subscription `protobuf:"bytes,1,rep,name=subscriptions" json:"subscriptions,omitempty"`
	// If not empty, indicates that there may be more subscriptions that match
	// the request; this value should be passed in a new ListSubscriptionsRequest
	// to get more subscriptions.
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token" json:"next_page_token,omitempty"`
}

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

func (m *ListSubscriptionsResponse) GetSubscriptions() []*Subscription {
	if m != nil {
		return m.Subscriptions
	}
	return nil
}

// Request for the DeleteSubscription method.
type DeleteSubscriptionRequest struct {
	// The subscription to delete.
	Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"`
}

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

// Request for the ModifyPushConfig method.
type ModifyPushConfigRequest struct {
	// The name of the subscription.
	Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"`
	// The push configuration for future deliveries.
	//
	// An empty pushConfig indicates that the Pub/Sub system should
	// stop pushing messages from the given subscription and allow
	// messages to be pulled and acknowledged - effectively pausing
	// the subscription if Pull is not called.
	PushConfig *PushConfig `protobuf:"bytes,2,opt,name=push_config" json:"push_config,omitempty"`
}

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

func (m *ModifyPushConfigRequest) GetPushConfig() *PushConfig {
	if m != nil {
		return m.PushConfig
	}
	return nil
}

// Request for the Pull method.
type PullRequest struct {
	// The subscription from which messages should be pulled.
	Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"`
	// If this is specified as true the system will respond immediately even if
	// it is not able to return a message in the Pull response. Otherwise the
	// system is allowed to wait until at least one message is available rather
	// than returning no messages. The client may cancel the request if it does
	// not wish to wait any longer for the response.
	ReturnImmediately bool `protobuf:"varint,2,opt,name=return_immediately" json:"return_immediately,omitempty"`
	// The maximum number of messages returned for this request. The Pub/Sub
	// system may return fewer than the number specified.
	MaxMessages int32 `protobuf:"varint,3,opt,name=max_messages" json:"max_messages,omitempty"`
}

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

// Response for the Pull method.
type PullResponse struct {
	// Received Pub/Sub messages. The Pub/Sub system will return zero messages if
	// there are no more available in the backlog. The Pub/Sub system may return
	// fewer than the maxMessages requested even if there are more messages
	// available in the backlog.
	ReceivedMessages []*ReceivedMessage `protobuf:"bytes,1,rep,name=received_messages" json:"received_messages,omitempty"`
}

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

func (m *PullResponse) GetReceivedMessages() []*ReceivedMessage {
	if m != nil {
		return m.ReceivedMessages
	}
	return nil
}

// Request for the ModifyAckDeadline method.
type ModifyAckDeadlineRequest struct {
	// The name of the subscription.
	Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"`
	// The acknowledgment ID.
	AckId string `protobuf:"bytes,2,opt,name=ack_id" json:"ack_id,omitempty"`
	// The new ack deadline with respect to the time this request was sent to the
	// Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack
	// deadline will expire 10 seconds after the ModifyAckDeadline call was made.
	// Specifying zero may immediately make the message available for another pull
	// request.
	AckDeadlineSeconds int32 `protobuf:"varint,3,opt,name=ack_deadline_seconds" json:"ack_deadline_seconds,omitempty"`
}

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

// Request for the Acknowledge method.
type AcknowledgeRequest struct {
	// The subscription whose message is being acknowledged.
	Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"`
	// The acknowledgment ID for the messages being acknowledged that was returned
	// by the Pub/Sub system in the Pull response. Must not be empty.
	AckIds []string `protobuf:"bytes,2,rep,name=ack_ids" json:"ack_ids,omitempty"`
}

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

func init() {
	proto.RegisterType((*Topic)(nil), "google.pubsub.v1beta2.Topic")
	proto.RegisterType((*PubsubMessage)(nil), "google.pubsub.v1beta2.PubsubMessage")
	proto.RegisterType((*GetTopicRequest)(nil), "google.pubsub.v1beta2.GetTopicRequest")
	proto.RegisterType((*PublishRequest)(nil), "google.pubsub.v1beta2.PublishRequest")
	proto.RegisterType((*PublishResponse)(nil), "google.pubsub.v1beta2.PublishResponse")
	proto.RegisterType((*ListTopicsRequest)(nil), "google.pubsub.v1beta2.ListTopicsRequest")
	proto.RegisterType((*ListTopicsResponse)(nil), "google.pubsub.v1beta2.ListTopicsResponse")
	proto.RegisterType((*ListTopicSubscriptionsRequest)(nil), "google.pubsub.v1beta2.ListTopicSubscriptionsRequest")
	proto.RegisterType((*ListTopicSubscriptionsResponse)(nil), "google.pubsub.v1beta2.ListTopicSubscriptionsResponse")
	proto.RegisterType((*DeleteTopicRequest)(nil), "google.pubsub.v1beta2.DeleteTopicRequest")
	proto.RegisterType((*Subscription)(nil), "google.pubsub.v1beta2.Subscription")
	proto.RegisterType((*PushConfig)(nil), "google.pubsub.v1beta2.PushConfig")
	proto.RegisterType((*ReceivedMessage)(nil), "google.pubsub.v1beta2.ReceivedMessage")
	proto.RegisterType((*GetSubscriptionRequest)(nil), "google.pubsub.v1beta2.GetSubscriptionRequest")
	proto.RegisterType((*ListSubscriptionsRequest)(nil), "google.pubsub.v1beta2.ListSubscriptionsRequest")
	proto.RegisterType((*ListSubscriptionsResponse)(nil), "google.pubsub.v1beta2.ListSubscriptionsResponse")
	proto.RegisterType((*DeleteSubscriptionRequest)(nil), "google.pubsub.v1beta2.DeleteSubscriptionRequest")
	proto.RegisterType((*ModifyPushConfigRequest)(nil), "google.pubsub.v1beta2.ModifyPushConfigRequest")
	proto.RegisterType((*PullRequest)(nil), "google.pubsub.v1beta2.PullRequest")
	proto.RegisterType((*PullResponse)(nil), "google.pubsub.v1beta2.PullResponse")
	proto.RegisterType((*ModifyAckDeadlineRequest)(nil), "google.pubsub.v1beta2.ModifyAckDeadlineRequest")
	proto.RegisterType((*AcknowledgeRequest)(nil), "google.pubsub.v1beta2.AcknowledgeRequest")
}

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

// Client API for Subscriber service

type SubscriberClient interface {
	// Creates a subscription to a given topic for a given subscriber.
	// If the subscription already exists, returns ALREADY_EXISTS.
	// If the corresponding topic doesn't exist, returns NOT_FOUND.
	//
	// If the name is not provided in the request, the server will assign a random
	// name for this subscription on the same project as the topic.
	CreateSubscription(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (*Subscription, error)
	// Gets the configuration details of a subscription.
	GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
	// Lists matching subscriptions.
	ListSubscriptions(ctx context.Context, in *ListSubscriptionsRequest, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error)
	// Deletes an existing subscription. All pending messages in the subscription
	// are immediately dropped. Calls to Pull after deletion will return
	// NOT_FOUND. After a subscription is deleted, a new one may be created with
	// the same name, but the new one has no association with the old
	// subscription, or its topic unless the same topic is specified.
	DeleteSubscription(ctx context.Context, in *DeleteSubscriptionRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	// Modifies the ack deadline for a specific message. This method is useful to
	// indicate that more time is needed to process a message by the subscriber,
	// or to make the message available for redelivery if the processing was
	// interrupted.
	ModifyAckDeadline(ctx context.Context, in *ModifyAckDeadlineRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	// Acknowledges the messages associated with the ack tokens in the
	// AcknowledgeRequest. The Pub/Sub system can remove the relevant messages
	// from the subscription.
	//
	// Acknowledging a message whose ack deadline has expired may succeed,
	// but such a message may be redelivered later. Acknowledging a message more
	// than once will not result in an error.
	Acknowledge(ctx context.Context, in *AcknowledgeRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	// Pulls messages from the server. Returns an empty list if there are no
	// messages available in the backlog. The server may return UNAVAILABLE if
	// there are too many concurrent pull requests pending for the given
	// subscription.
	Pull(ctx context.Context, in *PullRequest, opts ...grpc.CallOption) (*PullResponse, error)
	// Modifies the PushConfig for a specified subscription.
	//
	// This may be used to change a push subscription to a pull one (signified
	// by an empty PushConfig) or vice versa, or change the endpoint URL and other
	// attributes of a push subscription. Messages will accumulate for
	// delivery continuously through the call regardless of changes to the
	// PushConfig.
	ModifyPushConfig(ctx context.Context, in *ModifyPushConfigRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
}

type subscriberClient struct {
	cc *grpc.ClientConn
}

func NewSubscriberClient(cc *grpc.ClientConn) SubscriberClient {
	return &subscriberClient{cc}
}

func (c *subscriberClient) CreateSubscription(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (*Subscription, error) {
	out := new(Subscription)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/CreateSubscription", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *subscriberClient) GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) {
	out := new(Subscription)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/GetSubscription", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *subscriberClient) ListSubscriptions(ctx context.Context, in *ListSubscriptionsRequest, opts ...grpc.CallOption) (*ListSubscriptionsResponse, error) {
	out := new(ListSubscriptionsResponse)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/ListSubscriptions", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *subscriberClient) DeleteSubscription(ctx context.Context, in *DeleteSubscriptionRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
	out := new(google_protobuf.Empty)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/DeleteSubscription", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *subscriberClient) ModifyAckDeadline(ctx context.Context, in *ModifyAckDeadlineRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
	out := new(google_protobuf.Empty)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/ModifyAckDeadline", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *subscriberClient) Acknowledge(ctx context.Context, in *AcknowledgeRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
	out := new(google_protobuf.Empty)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/Acknowledge", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *subscriberClient) Pull(ctx context.Context, in *PullRequest, opts ...grpc.CallOption) (*PullResponse, error) {
	out := new(PullResponse)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/Pull", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *subscriberClient) ModifyPushConfig(ctx context.Context, in *ModifyPushConfigRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
	out := new(google_protobuf.Empty)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Subscriber/ModifyPushConfig", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Subscriber service

type SubscriberServer interface {
	// Creates a subscription to a given topic for a given subscriber.
	// If the subscription already exists, returns ALREADY_EXISTS.
	// If the corresponding topic doesn't exist, returns NOT_FOUND.
	//
	// If the name is not provided in the request, the server will assign a random
	// name for this subscription on the same project as the topic.
	CreateSubscription(context.Context, *Subscription) (*Subscription, error)
	// Gets the configuration details of a subscription.
	GetSubscription(context.Context, *GetSubscriptionRequest) (*Subscription, error)
	// Lists matching subscriptions.
	ListSubscriptions(context.Context, *ListSubscriptionsRequest) (*ListSubscriptionsResponse, error)
	// Deletes an existing subscription. All pending messages in the subscription
	// are immediately dropped. Calls to Pull after deletion will return
	// NOT_FOUND. After a subscription is deleted, a new one may be created with
	// the same name, but the new one has no association with the old
	// subscription, or its topic unless the same topic is specified.
	DeleteSubscription(context.Context, *DeleteSubscriptionRequest) (*google_protobuf.Empty, error)
	// Modifies the ack deadline for a specific message. This method is useful to
	// indicate that more time is needed to process a message by the subscriber,
	// or to make the message available for redelivery if the processing was
	// interrupted.
	ModifyAckDeadline(context.Context, *ModifyAckDeadlineRequest) (*google_protobuf.Empty, error)
	// Acknowledges the messages associated with the ack tokens in the
	// AcknowledgeRequest. The Pub/Sub system can remove the relevant messages
	// from the subscription.
	//
	// Acknowledging a message whose ack deadline has expired may succeed,
	// but such a message may be redelivered later. Acknowledging a message more
	// than once will not result in an error.
	Acknowledge(context.Context, *AcknowledgeRequest) (*google_protobuf.Empty, error)
	// Pulls messages from the server. Returns an empty list if there are no
	// messages available in the backlog. The server may return UNAVAILABLE if
	// there are too many concurrent pull requests pending for the given
	// subscription.
	Pull(context.Context, *PullRequest) (*PullResponse, error)
	// Modifies the PushConfig for a specified subscription.
	//
	// This may be used to change a push subscription to a pull one (signified
	// by an empty PushConfig) or vice versa, or change the endpoint URL and other
	// attributes of a push subscription. Messages will accumulate for
	// delivery continuously through the call regardless of changes to the
	// PushConfig.
	ModifyPushConfig(context.Context, *ModifyPushConfigRequest) (*google_protobuf.Empty, error)
}

func RegisterSubscriberServer(s *grpc.Server, srv SubscriberServer) {
	s.RegisterService(&_Subscriber_serviceDesc, srv)
}

func _Subscriber_CreateSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(Subscription)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(SubscriberServer).CreateSubscription(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Subscriber_GetSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(GetSubscriptionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(SubscriberServer).GetSubscription(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Subscriber_ListSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(ListSubscriptionsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(SubscriberServer).ListSubscriptions(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Subscriber_DeleteSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(DeleteSubscriptionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(SubscriberServer).DeleteSubscription(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Subscriber_ModifyAckDeadline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(ModifyAckDeadlineRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(SubscriberServer).ModifyAckDeadline(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Subscriber_Acknowledge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(AcknowledgeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(SubscriberServer).Acknowledge(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Subscriber_Pull_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(PullRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(SubscriberServer).Pull(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Subscriber_ModifyPushConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(ModifyPushConfigRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(SubscriberServer).ModifyPushConfig(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

var _Subscriber_serviceDesc = grpc.ServiceDesc{
	ServiceName: "google.pubsub.v1beta2.Subscriber",
	HandlerType: (*SubscriberServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateSubscription",
			Handler:    _Subscriber_CreateSubscription_Handler,
		},
		{
			MethodName: "GetSubscription",
			Handler:    _Subscriber_GetSubscription_Handler,
		},
		{
			MethodName: "ListSubscriptions",
			Handler:    _Subscriber_ListSubscriptions_Handler,
		},
		{
			MethodName: "DeleteSubscription",
			Handler:    _Subscriber_DeleteSubscription_Handler,
		},
		{
			MethodName: "ModifyAckDeadline",
			Handler:    _Subscriber_ModifyAckDeadline_Handler,
		},
		{
			MethodName: "Acknowledge",
			Handler:    _Subscriber_Acknowledge_Handler,
		},
		{
			MethodName: "Pull",
			Handler:    _Subscriber_Pull_Handler,
		},
		{
			MethodName: "ModifyPushConfig",
			Handler:    _Subscriber_ModifyPushConfig_Handler,
		},
	},
	Streams: []grpc.StreamDesc{},
}

// Client API for Publisher service

type PublisherClient interface {
	// Creates the given topic with the given name.
	CreateTopic(ctx context.Context, in *Topic, opts ...grpc.CallOption) (*Topic, error)
	// Adds one or more messages to the topic. Returns NOT_FOUND if the topic does
	// not exist.
	Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error)
	// Gets the configuration of a topic.
	GetTopic(ctx context.Context, in *GetTopicRequest, opts ...grpc.CallOption) (*Topic, error)
	// Lists matching topics.
	ListTopics(ctx context.Context, in *ListTopicsRequest, opts ...grpc.CallOption) (*ListTopicsResponse, error)
	// Lists the name of the subscriptions for this topic.
	ListTopicSubscriptions(ctx context.Context, in *ListTopicSubscriptionsRequest, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error)
	// Deletes the topic with the given name. Returns NOT_FOUND if the topic does
	// not exist. After a topic is deleted, a new topic may be created with the
	// same name; this is an entirely new topic with none of the old
	// configuration or subscriptions. Existing subscriptions to this topic are
	// not deleted.
	DeleteTopic(ctx context.Context, in *DeleteTopicRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
}

type publisherClient struct {
	cc *grpc.ClientConn
}

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

func (c *publisherClient) CreateTopic(ctx context.Context, in *Topic, opts ...grpc.CallOption) (*Topic, error) {
	out := new(Topic)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Publisher/CreateTopic", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

func (c *publisherClient) GetTopic(ctx context.Context, in *GetTopicRequest, opts ...grpc.CallOption) (*Topic, error) {
	out := new(Topic)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Publisher/GetTopic", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *publisherClient) ListTopics(ctx context.Context, in *ListTopicsRequest, opts ...grpc.CallOption) (*ListTopicsResponse, error) {
	out := new(ListTopicsResponse)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Publisher/ListTopics", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *publisherClient) ListTopicSubscriptions(ctx context.Context, in *ListTopicSubscriptionsRequest, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error) {
	out := new(ListTopicSubscriptionsResponse)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Publisher/ListTopicSubscriptions", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *publisherClient) DeleteTopic(ctx context.Context, in *DeleteTopicRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
	out := new(google_protobuf.Empty)
	err := grpc.Invoke(ctx, "/google.pubsub.v1beta2.Publisher/DeleteTopic", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Publisher service

type PublisherServer interface {
	// Creates the given topic with the given name.
	CreateTopic(context.Context, *Topic) (*Topic, error)
	// Adds one or more messages to the topic. Returns NOT_FOUND if the topic does
	// not exist.
	Publish(context.Context, *PublishRequest) (*PublishResponse, error)
	// Gets the configuration of a topic.
	GetTopic(context.Context, *GetTopicRequest) (*Topic, error)
	// Lists matching topics.
	ListTopics(context.Context, *ListTopicsRequest) (*ListTopicsResponse, error)
	// Lists the name of the subscriptions for this topic.
	ListTopicSubscriptions(context.Context, *ListTopicSubscriptionsRequest) (*ListTopicSubscriptionsResponse, error)
	// Deletes the topic with the given name. Returns NOT_FOUND if the topic does
	// not exist. After a topic is deleted, a new topic may be created with the
	// same name; this is an entirely new topic with none of the old
	// configuration or subscriptions. Existing subscriptions to this topic are
	// not deleted.
	DeleteTopic(context.Context, *DeleteTopicRequest) (*google_protobuf.Empty, error)
}

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

func _Publisher_CreateTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(Topic)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(PublisherServer).CreateTopic(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Publisher_Publish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(PublishRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(PublisherServer).Publish(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Publisher_GetTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(GetTopicRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(PublisherServer).GetTopic(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Publisher_ListTopics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(ListTopicsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(PublisherServer).ListTopics(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Publisher_ListTopicSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(ListTopicSubscriptionsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(PublisherServer).ListTopicSubscriptions(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func _Publisher_DeleteTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
	in := new(DeleteTopicRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	out, err := srv.(PublisherServer).DeleteTopic(ctx, in)
	if err != nil {
		return nil, err
	}
	return out, nil
}

var _Publisher_serviceDesc = grpc.ServiceDesc{
	ServiceName: "google.pubsub.v1beta2.Publisher",
	HandlerType: (*PublisherServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateTopic",
			Handler:    _Publisher_CreateTopic_Handler,
		},
		{
			MethodName: "Publish",
			Handler:    _Publisher_Publish_Handler,
		},
		{
			MethodName: "GetTopic",
			Handler:    _Publisher_GetTopic_Handler,
		},
		{
			MethodName: "ListTopics",
			Handler:    _Publisher_ListTopics_Handler,
		},
		{
			MethodName: "ListTopicSubscriptions",
			Handler:    _Publisher_ListTopicSubscriptions_Handler,
		},
		{
			MethodName: "DeleteTopic",
			Handler:    _Publisher_DeleteTopic_Handler,
		},
	},
	Streams: []grpc.StreamDesc{},
}

var fileDescriptor0 = []byte{
	// 950 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x72, 0xdb, 0x44,
	0x14, 0x1e, 0xc5, 0xf9, 0x3d, 0x72, 0x6a, 0xb2, 0x34, 0xa9, 0x23, 0x0a, 0x13, 0x54, 0xc8, 0xa4,
	0x0c, 0xc8, 0xd8, 0xb4, 0x0c, 0x53, 0xae, 0xd2, 0x36, 0x03, 0x0c, 0x74, 0x30, 0x01, 0x86, 0x0e,
	0x30, 0xf1, 0xc8, 0xd2, 0x89, 0x23, 0x2c, 0x4b, 0x42, 0x5a, 0x99, 0x9a, 0x3b, 0x2e, 0x98, 0xe1,
	0x25, 0x78, 0x05, 0x5e, 0x81, 0x57, 0x63, 0xa5, 0x5d, 0xd9, 0x92, 0xad, 0x95, 0x45, 0x2e, 0xb5,
	0x7b, 0xce, 0x77, 0xfe, 0xbe, 0x6f, 0x75, 0x40, 0x1f, 0xf9, 0xfe, 0xc8, 0xc5, 0x4e, 0x10, 0x0f,
	0xa3, 0x78, 0xd8, 0x99, 0x76, 0x87, 0x48, 0xcd, 0x9e, 0xf8, 0x34, 0x82, 0xd0, 0xa7, 0x3e, 0x39,
	0xe4, 0x36, 0x86, 0x38, 0x14, 0x36, 0xda, 0x1b, 0x99, 0x6b, 0x62, 0x34, 0x8c, 0xaf, 0x3b, 0x38,
	0x09, 0xe8, 0x8c, 0xfb, 0xe8, 0x87, 0xb0, 0xf5, 0x9d, 0x1f, 0x38, 0x16, 0x69, 0xc2, 0xa6, 0x67,
	0x4e, 0xb0, 0xad, 0x9c, 0x28, 0x67, 0x7b, 0xfa, 0x3f, 0x0a, 0xec, 0xf7, 0x53, 0x98, 0x17, 0x18,
	0x45, 0xe6, 0x08, 0x93, 0x7b, 0xdb, 0xa4, 0x66, 0x7a, 0xdf, 0x24, 0x9f, 0x03, 0x98, 0x94, 0x86,
	0xce, 0x30, 0xa6, 0x18, 0xb5, 0x37, 0x4e, 0x1a, 0x67, 0x6a, 0xef, 0x91, 0x51, 0x1a, 0xdf, 0x28,
	0xe0, 0x18, 0xe7, 0x73, 0xb7, 0x0b, 0x8f, 0x86, 0x33, 0x42, 0x00, 0x26, 0xfc, 0x6a, 0xe0, 0xd8,
	0xed, 0x46, 0x12, 0x5d, 0xeb, 0x42, 0x6b, 0xd9, 0x4c, 0x85, 0xc6, 0x18, 0x67, 0x3c, 0x3b, 0xb2,
	0x0f, 0x5b, 0x53, 0xd3, 0x8d, 0x91, 0x05, 0x66, 0x9f, 0x4f, 0x36, 0x3e, 0x51, 0xf4, 0x13, 0x68,
	0x7d, 0x86, 0x34, 0x2d, 0xe5, 0x12, 0x7f, 0x8d, 0x31, 0xa2, 0x89, 0x15, 0x4d, 0xbe, 0x45, 0x49,
	0x3f, 0xc0, 0x1d, 0x96, 0x89, 0xeb, 0x44, 0x37, 0xe5, 0x06, 0xe4, 0x63, 0xd8, 0x15, 0x99, 0x64,
	0x15, 0xbd, 0x53, 0xa7, 0x22, 0xfd, 0x14, 0x5a, 0x73, 0xe0, 0x28, 0xf0, 0xbd, 0x08, 0xc9, 0xeb,
	0xa0, 0x2e, 0x8a, 0x8a, 0x18, 0x7e, 0x83, 0x25, 0xf0, 0x25, 0x1c, 0x7c, 0xe5, 0x44, 0x3c, 0xc7,
	0x28, 0xcb, 0xa1, 0x05, 0x3b, 0x6c, 0x10, 0xbf, 0xa0, 0x45, 0x45, 0x16, 0x07, 0xb0, 0x17, 0x24,
	0x7e, 0x91, 0xf3, 0x3b, 0xaf, 0x6f, 0x2b, 0x69, 0x51, 0x7a, 0x44, 0xfd, 0x31, 0x7a, 0xbc, 0x45,
	0xfa, 0x4f, 0x40, 0xf2, 0x60, 0x22, 0xee, 0xfb, 0xb0, 0x9d, 0x56, 0xc4, 0x43, 0xaa, 0xbd, 0xfb,
	0x92, 0x02, 0xf8, 0xc8, 0xef, 0x41, 0xcb, 0xc3, 0x57, 0x74, 0x90, 0x03, 0x4f, 0x1b, 0xaa, 0x7f,
	0x0f, 0x6f, 0xce, 0xc1, 0xbf, 0x65, 0x9e, 0x56, 0xe8, 0x04, 0xd4, 0x61, 0x11, 0x24, 0x9d, 0xab,
	0x99, 0x73, 0x1f, 0xde, 0x92, 0xc1, 0x8a, 0xfc, 0x0f, 0x61, 0x3f, 0xca, 0x5f, 0xf0, 0xce, 0xc9,
	0x13, 0x7d, 0x00, 0xe4, 0x39, 0xba, 0x48, 0xb1, 0x6a, 0xf0, 0x7f, 0x28, 0xd0, 0xcc, 0x87, 0x2b,
	0x52, 0x7d, 0x61, 0xbd, 0x21, 0x58, 0xa0, 0x06, 0x71, 0x74, 0x33, 0xb0, 0x7c, 0xef, 0xda, 0x19,
	0xb5, 0x37, 0xd9, 0xa1, 0xda, 0x7b, 0x5b, 0x4a, 0x84, 0xe8, 0xe6, 0x59, 0x6a, 0x48, 0xee, 0xc3,
	0x5d, 0xd3, 0x1a, 0x0f, 0x6c, 0x34, 0x6d, 0xd7, 0xf1, 0x58, 0x2f, 0x90, 0x21, 0xb0, 0xd9, 0x6f,
	0x25, 0xed, 0xd0, 0xff, 0x56, 0x00, 0x72, 0xc6, 0xac, 0xce, 0x34, 0x08, 0x7a, 0x76, 0xe0, 0x3b,
	0x5e, 0x36, 0xfb, 0x8b, 0x12, 0x55, 0x75, 0xd7, 0x86, 0x5e, 0x96, 0xd4, 0x6d, 0xe4, 0xf3, 0x12,
	0x5a, 0x97, 0x68, 0xa1, 0x33, 0x45, 0x3b, 0x13, 0xfc, 0x1d, 0xd8, 0x4e, 0x0a, 0x62, 0xa2, 0xe4,
	0x5e, 0x8f, 0x61, 0x47, 0x70, 0x3a, 0xf5, 0xab, 0xab, 0x0e, 0x03, 0x8e, 0x98, 0x30, 0xf3, 0xfd,
	0xcf, 0xc6, 0x74, 0x17, 0x9a, 0xf9, 0x61, 0x8b, 0x69, 0x5d, 0x42, 0x3b, 0x21, 0x49, 0x29, 0xed,
	0x6e, 0x2b, 0x96, 0x00, 0x8e, 0x4b, 0x30, 0x05, 0xe7, 0x9e, 0x94, 0x71, 0x4e, 0xed, 0x3d, 0x90,
	0x54, 0x57, 0x60, 0x92, 0x94, 0x98, 0x5d, 0x38, 0xe6, 0xc4, 0xac, 0x5f, 0xf8, 0x08, 0xee, 0xbd,
	0xf0, 0x6d, 0xe7, 0x7a, 0xb6, 0x98, 0x6c, 0xa5, 0xc3, 0x32, 0x53, 0x37, 0x6a, 0x32, 0x95, 0xa9,
	0x5b, 0xed, 0xc7, 0xae, 0x5b, 0x0d, 0xae, 0x01, 0x09, 0x91, 0xc6, 0xa1, 0x37, 0x70, 0x26, 0x13,
	0xb4, 0x1d, 0x93, 0xa2, 0x3b, 0x4b, 0x63, 0xec, 0x26, 0x1e, 0x13, 0xf3, 0xd5, 0x60, 0xfe, 0x58,
	0x36, 0x52, 0x8a, 0x7f, 0x03, 0x4d, 0x0e, 0x2b, 0xfa, 0x7a, 0x0e, 0x07, 0xa1, 0xa0, 0xd4, 0xc2,
	0x94, 0xf7, 0xf6, 0x54, 0x92, 0xe4, 0x12, 0x05, 0xf5, 0x2b, 0x68, 0xf3, 0x96, 0x9c, 0x5b, 0xe3,
	0xe7, 0x42, 0x58, 0xd5, 0x69, 0x2f, 0x48, 0xcb, 0xd5, 0x2c, 0x53, 0x25, 0x4f, 0xf9, 0x53, 0x20,
	0x0c, 0xd9, 0xf3, 0x7f, 0x73, 0xd1, 0x1e, 0xad, 0x41, 0x66, 0xdc, 0xe3, 0xc8, 0x5c, 0x98, 0x7b,
	0xbd, 0xbf, 0xb6, 0x01, 0xc4, 0x74, 0x87, 0x18, 0x92, 0x2b, 0x20, 0xcf, 0x42, 0x34, 0x8b, 0x13,
	0x27, 0x75, 0x58, 0xa4, 0xd5, 0xa2, 0x1a, 0xa6, 0x3f, 0xb8, 0xc2, 0xd1, 0x07, 0x12, 0xbf, 0x72,
	0xbd, 0xd5, 0x0b, 0x33, 0xe5, 0x3f, 0xa9, 0x82, 0x54, 0x48, 0x47, 0xe2, 0x29, 0x13, 0xaa, 0xf6,
	0x61, 0x7d, 0x07, 0xc1, 0x96, 0xab, 0xec, 0x25, 0x2f, 0x64, 0x23, 0xc3, 0x91, 0x6a, 0x4b, 0x3b,
	0x9a, 0x7b, 0x88, 0x6d, 0xc7, 0xb8, 0x48, 0xb6, 0x1d, 0xf2, 0x33, 0x1c, 0xac, 0x50, 0x49, 0x5a,
	0x97, 0x8c, 0x74, 0x52, 0xf4, 0x3e, 0xa8, 0x39, 0x22, 0x91, 0x87, 0x12, 0xdc, 0x55, 0xb2, 0x49,
	0x11, 0xbf, 0x86, 0xcd, 0x44, 0x4d, 0x44, 0x97, 0xea, 0x79, 0xae, 0x60, 0xe9, 0x60, 0x0b, 0x72,
	0xfc, 0x11, 0x5e, 0x5b, 0x7e, 0x5e, 0x88, 0x51, 0x59, 0xff, 0xca, 0x3b, 0x24, 0x4b, 0xb6, 0xf7,
	0xef, 0x26, 0xec, 0x89, 0x15, 0x88, 0x29, 0xe1, 0x0b, 0x50, 0xb9, 0x12, 0xf8, 0x96, 0x51, 0xb9,
	0x83, 0x68, 0xd5, 0x1b, 0xca, 0x4b, 0xd8, 0x11, 0xb8, 0xe4, 0x5d, 0xf9, 0xdf, 0x26, 0xb7, 0xd3,
	0x69, 0xa7, 0xeb, 0xcc, 0x44, 0x3b, 0xfa, 0xb0, 0x9b, 0xed, 0x8b, 0xe4, 0x54, 0xae, 0xa3, 0xfc,
	0x5e, 0xb1, 0x26, 0x57, 0x13, 0x60, 0xb1, 0x91, 0x91, 0xb3, 0x0a, 0x05, 0x14, 0x36, 0x40, 0xed,
	0x61, 0x0d, 0x4b, 0x91, 0xf4, 0x9f, 0x0a, 0x1c, 0x95, 0x6f, 0x50, 0xe4, 0xd1, 0x3a, 0x94, 0x52,
	0x9d, 0x3e, 0xfe, 0x9f, 0x5e, 0xf3, 0xe6, 0xa9, 0xb9, 0xb5, 0x4b, 0x4a, 0xf7, 0xd5, 0xd5, 0x4c,
	0xc6, 0xa0, 0xa7, 0xef, 0xc1, 0xb1, 0xe5, 0x4f, 0xca, 0x71, 0x9e, 0xaa, 0x7c, 0xa3, 0xe8, 0x27,
	0x2e, 0x7d, 0x65, 0xb8, 0x9d, 0xfa, 0x7e, 0xf4, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x12,
	0xa9, 0x2d, 0x13, 0x0d, 0x00, 0x00,
}


text:
Installation
------------
For development and testing, the server and the agent can be directly installed
from pip. The agent typically runs in an a stateless environment with access to
server management utilities. For the safety of your development environment, **do
not run the agent as root**, unless you really know what you are doing.

Requirements
~~~~~~~~~~~~
Python 3.5+ for the server

Python 2.7+ for the agent

Server
~~~~~~
.. code-block:: bash

   $ pip install mercury-server

Agent
~~~~~
.. code-block:: bash

   $ pip install mercury-agent

RAID Abstraction
----------------
.. automodule:: mercury.hardware.raid.abstraction.api
    :members:

redpajama_set_name: RedPajamaGithub


text:
package org.pathvisio.libgpml.model;

import org.junit.Before;
import org.junit.Test;
import org.pathvisio.libgpml.model.DataNode.State;
import org.pathvisio.libgpml.model.type.DataNodeType;
import org.pathvisio.libgpml.model.type.GroupType;

import junit.framework.TestCase;

/**
 * Test for {@link Group}.
 *
 * @author finterly
 */
public class TestGroup extends TestCase {

	PathwayModel p;
	Group g1;
	Group g2;
	DataNode d1;
	DataNode d2;
	DataNode d3;

	/**
	 * Creates and adds anchor to line, line to pathwayModel.
	 */
	@Before
	public void setUp() {

		p = new PathwayModel();
		g1 = new Group(GroupType.GROUP);
		d1 = new DataNode("d1", DataNodeType.UNDEFINED);
		p.addGroup(g1);
		p.addDataNode(d1);
		g1.addPathwayElement(d1);

		State st = d1.addState("string", "string", null, 1, 1);
		assertFalse(g1.hasPathwayElement(st));
		assertEquals(st.getGroupRef(), g1);
		assertTrue(d1.hasState(st));
		assertTrue(p.hasPathwayObject(st));

		d1.removeState(st);
		assertFalse(g1.hasPathwayElement(st));
		assertEquals(st.getGroupRef(), g1);
		assertFalse(d1.hasState(st));
		assertFalse(p.hasPathwayObject(st));

		assertTrue(p.hasPathwayObject(g1));
		assertTrue(p.hasPathwayObject(d1));
		assertTrue(p.getGroups().contains(g1));
		assertTrue(p.getDataNodes().contains(d1));
		assertTrue(g1.hasPathwayElement(d1));
		assertEquals(g1.getPathwayModel(), p);
		assertEquals(d1.getPathwayModel(), p);
		assertEquals(d1.getGroupRef(), g1);

		g2 = new Group(GroupType.GROUP);
		d2 = new DataNode("d2", DataNodeType.UNDEFINED);
		d3 = new DataNode("d3", DataNodeType.UNDEFINED);
		p.addGroup(g2);
		p.addDataNode(d2);
		p.addDataNode(d3);
		g2.addPathwayElement(d2);
		g2.addPathwayElement(d3);

		assertTrue(p.hasPathwayObject(g2));
		assertTrue(p.hasPathwayObject(d2));
		assertTrue(p.hasPathwayObject(d3));
		assertTrue(g2.hasPathwayElement(d2));
		assertTrue(g2.hasPathwayElement(d3));
		assertEquals(g2.getPathwayModel(), p);
		assertEquals(d2.getPathwayModel(), p);
		assertEquals(d3.getPathwayModel(), p);
		assertEquals(d2.getGroupRef(), g2);
		assertEquals(d3.getGroupRef(), g2);

	}

	/**
	 *
	 */
	@Test
	public void testRemoveDataNode() {
		// terminates data node and empty group
		p.removeDataNode(d1);
		assertFalse(p.hasPathwayObject(g1));
		assertFalse(p.hasPathwayObject(d1));
		assertFalse(p.getGroups().contains(g1));
		assertFalse(p.getDataNodes().contains(d1));
		assertFalse(g1.hasPathwayElement(d1));
		assertNull(g1.getPathwayModel());
		assertNull(d1.getPathwayModel());
		assertNull(d1.getGroupRef());

		// terminates data node, group remains
		p.removeDataNode(d2);
		assertTrue(p.hasPathwayObject(g2));
		assertFalse(p.hasPathwayObject(d2));
		assertTrue(p.hasPathwayObject(d3));
		assertFalse(g2.hasPathwayElement(d2));
		assertTrue(g2.hasPathwayElement(d3));
		assertEquals(g2.getPathwayModel(), p);
		assertNull(d2.getPathwayModel());
		assertEquals(d3.getPathwayModel(), p);
		assertNull(d2.getGroupRef());
		assertEquals(d3.getGroupRef(), g2);
	}

	/**
	 *
	 */
	@Test
	public void testRemoveDataNodeFromGroup() {

		// removes data node from group, terminates group, data node remains
		g1.removePathwayElement(d1);
		assertFalse(p.hasPathwayObject(g1));
		assertTrue(p.hasPathwayObject(d1));
		assertFalse(p.getGroups().contains(g1));
		assertTrue(p.getDataNodes().contains(d1));
		assertFalse(g1.hasPathwayElement(d1));
		assertNull(g1.getPathwayModel());
		assertEquals(d1.getPathwayModel(), p);
		assertNull(d1.getGroupRef());

		// removes data node from group, group and data node remains
		g2.removePathwayElement(d2);
		assertTrue(p.hasPathwayObject(g2));
		assertTrue(p.hasPathwayObject(d2));
		assertTrue(p.hasPathwayObject(d3));
		assertFalse(g2.hasPathwayElement(d2));
		assertTrue(g2.hasPathwayElement(d3));
		assertEquals(g2.getPathwayModel(), p);
		assertEquals(d2.getPathwayModel(), p);
		assertEquals(d3.getPathwayModel(), p);
		assertNull(d2.getGroupRef());
		assertEquals(d3.getGroupRef(), g2);

		// removes data node from group, group terminates, and data nodes remain
		g2.removePathwayElement(d3);
		assertFalse(p.hasPathwayObject(g2));
		assertTrue(p.hasPathwayObject(d2));
		assertTrue(p.hasPathwayObject(d3));
		assertFalse(g2.hasPathwayElement(d2));
		assertFalse(g2.hasPathwayElement(d3));
		assertNull(g2.getPathwayModel());
		assertEquals(d2.getPathwayModel(), p);
		assertEquals(d3.getPathwayModel(), p);
		assertNull(d2.getGroupRef());
		assertNull(d3.getGroupRef());
	}

	/**
	 *
	 */
	@Test
	public void testRemoveGroup() {
		// terminates group, data nodes remain
		p.removeGroup(g1);
		assertFalse(p.hasPathwayObject(g1));
		assertTrue(p.hasPathwayObject(d1));
		assertFalse(p.getGroups().contains(g1));
		assertTrue(p.getDataNodes().contains(d1));
		assertFalse(g1.hasPathwayElement(d1));
		assertNull(g1.getPathwayModel());
		assertEquals(d1.getPathwayModel(), p);
		assertNull(d1.getGroupRef());

		// terminates group, data nodes remain
		p.removeGroup(g2);
		assertFalse(p.hasPathwayObject(g2));
		assertTrue(p.hasPathwayObject(d2));
		assertTrue(p.hasPathwayObject(d3));
		assertFalse(g2.hasPathwayElement(d2));
		assertFalse(g2.hasPathwayElement(d3));
		assertNull(g2.getPathwayModel());
		assertEquals(d2.getPathwayModel(), p);
		assertEquals(d3.getPathwayModel(), p);
		assertNull(d2.getGroupRef());
		assertNull(d3.getGroupRef());
	}

	/**
	 *
	 */
	@Test
	public void testSwitchGroup() {
		d1.setGroupRefTo(g2);
		assertFalse(p.hasPathwayObject(g1));
		assertTrue(p.hasPathwayObject(g2));
		assertTrue(p.hasPathwayObject(d1));
		assertTrue(p.hasPathwayObject(d2));
		assertTrue(p.hasPathwayObject(d3));
		assertTrue(g2.hasPathwayElement(d1));
		assertTrue(g2.hasPathwayElement(d2));
		assertTrue(g2.hasPathwayElement(d3));
		assertNull(g1.getPathwayModel());
		assertEquals(g2.getPathwayModel(), p);
		assertEquals(d1.getPathwayModel(), p);
		assertEquals(d2.getPathwayModel(), p);
		assertEquals(d3.getPathwayModel(), p);
		assertEquals(d1.getGroupRef(), g2);
		assertEquals(d2.getGroupRef(), g2);
		assertEquals(d3.getGroupRef(), g2);
	}

	/**
	 * Check that when a line points to the group, it stays at the same position
	 * when the group disappears. Test for regression of bug #1058
	 *
	 * @author unknown, finterly
	 */
	@Test
	public void testUngroup() {
		PathwayModel pwy = new PathwayModel();
		Interaction line = new Interaction(null);
		Group group = new Group(null);
		DataNode node = new DataNode("d1", DataNodeType.UNDEFINED);
		DataNode node2 = new DataNode("d2", DataNodeType.UNDEFINED);
		pwy.addInteraction(line);
		pwy.addDataNode(node);
		pwy.addDataNode(node2);
		pwy.addGroup(group);

		assertNotNull(group.getElementId());
		assertEquals(0, group.getPathwayElements().size());

		// add nodes to group
		node.setGroupRefTo(group);
		node2.setGroupRefTo(group);

		// check that now it's really part of group
		assertEquals(2, group.getPathwayElements().size());
		assertTrue(group.getPathwayElements().contains(node));

		// manipulate data node size
		node.setCenterX(120);
		node.setCenterY(20);
		node.setWidth(20);
		node.setHeight(20);
		node2.setCenterX(120);
		node2.setCenterY(20);
		node2.setWidth(10);
		node2.setHeight(10);

		// update group dimensions, this is usually naturally done in the GUI
		group.updateDimensions();

		// move point to "top-center" of group.
		line.setEndLinePointX(group.getCenterX());
		line.setEndLinePointY(group.getTop());
		// link point and group. relX and relY should be 0.0 and -1.0.
		line.getEndLinePoint().linkTo(group);
		assertEquals(line.getEndLinePoint().getElementRef(), group);

		assertEquals(8.0, group.getMargin());

		assertEquals(120.0, line.getEndLinePointX(), 0.01);
		assertEquals(2.0, line.getEndLinePointY(), 0.01);

		// remove group completely
		pwy.remove(group);

		System.out.println(line.getEndLinePointX());
		// check that line points at same position
		assertEquals(120.0, line.getEndLinePointX());
		assertEquals(2.0, line.getEndLinePointY());

		assertNull(line.getEndLinePoint().getElementRef());
		assertNull(node.getGroupRef());
	}

}


text:
using System;
using Xunit;

namespace Codefiction.TechRadar.Tests
{
    public class RadarTest
    {
        [Fact]
        public void This_Test_Should_Pass()
        {
                 Assert.True(true);
        }
    }
}


text:
package com.monitorabrasil.participacidadao.views.adapters;

import android.support.v4.app.FragmentActivity;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.monitorabrasil.participacidadao.R;
import com.monitorabrasil.participacidadao.model.Tema;
import com.monitorabrasil.participacidadao.views.interfaces.RecyclerViewOnClickListenerHack;
import com.parse.ParseObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by geral_000 on 23/07/2015.
 */
public class TemaAdapter extends RecyclerView.Adapter<TemaAdapter.ViewHolder> {

    private List<ParseObject> mDataset;
    private RecyclerViewOnClickListenerHack mRecyclerViewOnClickListenerHack;
    private  FragmentActivity mActivity;

    int[] cores = new int[]{R.color.cor3, R.color.cor4,R.color.cor5,
            R.color.cor8,R.color.cor6 ,R.color.cor9};

    public TemaAdapter() {
        mDataset = new ArrayList<>();
    }

    public void setItems(List<ParseObject> temas) {
        this.mDataset = temas;
        notifyDataSetChanged();
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
        // create a new view
        View v = LayoutInflater.from(viewGroup.getContext())
                .inflate(R.layout.item_tema, viewGroup, false);
        // set the view's size, margins, paddings and layout parameter
        ViewHolder vh = new ViewHolder(v);
        return vh;
    }

    @Override
    public void onBindViewHolder(final ViewHolder viewHolder, int i) {

        final ParseObject  tema = mDataset.get(i);
        viewHolder.tema = tema;

        viewHolder.txtTema.setText(tema.getString("Nome"));
        int posCor=i;
        if(i > 19)
            posCor = i-20;
        else
            if(i > 9)
                posCor = i-10;

        viewHolder.llItemTema.setBackgroundResource(cores[posCor]);
        viewHolder.icone.setBackgroundResource(Tema.buscaIcone(tema.getString("imagem")));
    }

    public void setRecyclerViewOnClickListenerHack(RecyclerViewOnClickListenerHack r){
        mRecyclerViewOnClickListenerHack = r;
    }

    @Override
    public int getItemCount() {
        return mDataset.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
        // each data item is just a string in this case

        public TextView txtTema;
        public ImageView icone;
        public ParseObject tema;
        public LinearLayout llItemTema;

        public ViewHolder(View v) {
            super(v);
            txtTema = (TextView) v.findViewById(R.id.txtTema);
            icone = (ImageView) v.findViewById(R.id.imgIconeTema);
            llItemTema = (LinearLayout)v.findViewById(R.id.llItemTema);
            itemView.setOnClickListener(this);
        }

        @Override
        public void onClick(View v) {
            if(mRecyclerViewOnClickListenerHack != null){
                mRecyclerViewOnClickListenerHack.onClickListener(v, getPosition());
            }
        }
    }
}


text:
layout: post
title: Using 'for in' in Javascript
date: '2014-03-18 02:04:24 -0700'
comments: true
categories:
- Javascript
tags:
- javascript
- JsLint
---
Today our lead front-end developer pointed out to me that when using a 'for in'
loop in Javascript that you want to make sure to use hasOwnProperty() on the
element to make sure it belongs to the object, and not properties that were
inherited through the prototype chain.

More information is available on [this page] describing common Javascript code
mistakes caught by JSLint.

[this page]: http://www.jslint.com/lint.html#forin


text:
$(function () {
    var olympicsHub = $.connection.olympicsHub;

    olympicsHub.client.refreshRecords = function (eventId) {
        $.ajax({
            type: "GET",
            cache: false,
            url: "/Home/TopThree",
            data: { eventId: eventId },
            success: function (data, status, xhr) {
                $("#eventPanel" + eventId).html(data);
                $.reapplyContextMenu(".event-panel");
                $(".event-panel").off("click");
                $(".event-panel").click(function () {
                    $.invokeMenuOption(".event-panel", this, 0);
                });
                $(".modal").modal("hide");
            }
        });
    };
    olympicsHub.client.refreshBoard = function () {
        $.ajax({
            type: "GET",
            cache: false,
            url: "/Home/IndexPartial",
            success: function (data, status, xhr) {
                $("#pageContent").html(data);
                $.reapplyContextMenu(".event-panel");
                $(".event-panel").off("click");
                $(".event-panel").click(function () {
                    $.invokeMenuOption(".event-panel", this, 0);
                });
                $(".modal").modal("hide");
            }
        });
    };
});


text:
namespace DotNetStarter
{
    using Abstractions;
    using DotNetStarter.Abstractions.Internal;
    using System;

    /// <summary>
    /// Matches if registered type is assignable from scanned type
    /// </summary>
    public class AssemblyScanAssignableFromMatcher : IAssemblyScanTypeMatcher
    {
        private Type _AttrType = typeof(Attribute);

        /// <summary>
        /// Matches if registered type is assignable from scanned type
        /// </summary>
        public bool IsMatch(Type registeredType, Type scannedType) => !_AttrType.IsAssignableFromCheck(registeredType) && registeredType.IsAssignableFromCheck(scannedType);
    }
}


text:
package javalang.ref;

public class AsymeticAcessorError extends VerifyError {

	/**
	 *
	 */
	private static final long serialVersionUID = 431121324811321340L;

	public AsymeticAcessorError(Class<?> clazz, String name) {
		super("Asymetic Accessor for field " + name + " in " + clazz);
	}

}


text:
{#
	place tracking scripts (like Google Analytics) here
#}
<script type="text/javascript">
  (function() {
    window._pa = window._pa || {};
    _pa.productId = "httpbin";
    var pa = document.createElement('script'); pa.type = 'text/javascript'; pa.async = true;
    pa.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + "//tag.perfectaudience.com/serve/5226171f87bc6890da0000a0.js";
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(pa, s);
  })();
</script>

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-36620802-9', 'auto');
  ga('send', 'pageview');

</script>


text:
// Copyright (c) 2021 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using System.IO;
using System.Reactive.Concurrency;

using Akavache.Sqlite3;

namespace Akavache.Tests
{
    /// <summary>
    /// Bulk operation tests for the <see cref="SqlRawPersistentBlobCache"/> class.
    /// </summary>
    public class SqliteBlobCacheBulkOperationsTests : BulkOperationsTestBase
    {
        /// <inheritdoc />
        protected override IBlobCache CreateBlobCache(string path)
        {
            return new BlockingDisposeBulkCache(new SqlRawPersistentBlobCache(Path.Combine(path, "sqlite.db")));
        }
    }
}


text:
#import "GetFileObj.h"

@implementation GetFileObj

-(id)initWithArray:(NSArray*)array {
    self = [super init];
    if (self) {
        @try {
            for (int i0 = 0; i0 < [array count]; i0++)
            {
                if ( ([[array objectAtIndex:i0] objectForKey:@"nodeContent"] !=nil) &&  ([[[array objectAtIndex:i0]objectForKey:@"nodeName"]caseInsensitiveCompare:@"serverFileID"]==NSOrderedSame)){
                    NSString *nodeContentValue = [[NSString alloc]initWithString:[[array objectAtIndex:i0] objectForKey:@"nodeContent"]];
                    [self setServerFileID:[nodeContentValue intValue]];
                }
                else if ( ([[array objectAtIndex:i0] objectForKey:@"nodeContent"] !=nil) &&  ([[[array objectAtIndex:i0]objectForKey:@"nodeName"]caseInsensitiveCompare:@"serverItemID"]==NSOrderedSame)){
                    NSString *nodeContentValue = [[NSString alloc]initWithString:[[array objectAtIndex:i0] objectForKey:@"nodeContent"]];
                    [self setServerItemID:[nodeContentValue intValue]];
                }
                else if ( ([[array objectAtIndex:i0] objectForKey:@"nodeContent"] !=nil) &&  ([[[array objectAtIndex:i0]objectForKey:@"nodeName"]caseInsensitiveCompare:@"fileTimestamp"]==NSOrderedSame)){
                    NSString *nodeContentValue = [[NSString alloc]initWithString:[[array objectAtIndex:i0] objectForKey:@"nodeContent"]];
                    [self setFileTimestamp:[nodeContentValue intValue]];
                }
                else if ( ([[array objectAtIndex:i0] objectForKey:@"nodeContent"] !=nil) &&  ([[[array objectAtIndex:i0]objectForKey:@"nodeName"]caseInsensitiveCompare:@"fileType"]==NSOrderedSame)){
                    NSString *nodeContentValue = [[NSString alloc]initWithString:[[array objectAtIndex:i0] objectForKey:@"nodeContent"]];
                    [self setFileType:[nodeContentValue intValue]];
                }
                else if ( ([[array objectAtIndex:i0] objectForKey:@"nodeContent"] !=nil) &&  ([[[array objectAtIndex:i0]objectForKey:@"nodeName"]caseInsensitiveCompare:@"fileData"]==NSOrderedSame)){
                    NSString* stringData = [[array  objectAtIndex:i0] objectForKey:@"nodeContent"];
                    NSData* nodeContentValue = [NSData dataFromBase64String:stringData];
                    [self setFileData:nodeContentValue];
                }
                else if ( ([[array objectAtIndex:i0] objectForKey:@"nodeContent"] !=nil) &&  ([[[array objectAtIndex:i0]objectForKey:@"nodeName"]caseInsensitiveCompare:@"fileStatus"]==NSOrderedSame)){
                    NSString *nodeContentValue = [[NSString alloc]initWithString:[[array objectAtIndex:i0] objectForKey:@"nodeContent"]];
                    [self setFileStatus:[nodeContentValue intValue]];
                }
            }
        }
        @catch(NSException *ex){
        }
    }
    return self;
}
-(NSString*)toString:(BOOL)addNameWrap {
    NSMutableString *nsString = [NSMutableString string];
    if (addNameWrap == YES)
        [nsString appendString:@"<GetFileObj>" ];
    [nsString appendFormat:@"<serverFileID>%d</serverFileID>" , [self serverFileID]];
    [nsString appendFormat:@"<serverItemID>%d</serverItemID>" , [self serverItemID]];
    [nsString appendFormat:@"<fileTimestamp>%d</fileTimestamp>" , [self fileTimestamp]];
    [nsString appendFormat:@"<fileType>%d</fileType>" , [self fileType]];
    if (self.fileData != nil) {
        [nsString appendFormat:@"<fileData>%@</fileData>",[self.fileData base64EncodedString]];
    }
    [nsString appendFormat:@"<fileStatus>%d</fileStatus>" , [self fileStatus]];
    if (addNameWrap == YES)
        [nsString appendString:@"</GetFileObj>" ];
    return nsString;
}
#pragma mark - NSCoding
-(id)initWithCoder:(NSCoder *)decoder{
    self = [super init];
    if (self){
        self.serverFileID = [decoder decodeInt32ForKey:@"serverFileID"];
        self.serverItemID = [decoder decodeInt32ForKey:@"serverItemID"];
        self.fileTimestamp = [decoder decodeInt32ForKey:@"fileTimestamp"];
        self.fileType = [decoder decodeInt32ForKey:@"fileType"];
        self.fileData = [decoder decodeObjectForKey:@"fileData"];
        self.fileStatus = [decoder decodeInt32ForKey:@"fileStatus"];
    }
    return self;
}
-(void)encodeWithCoder:(NSCoder *)encoder{
    [encoder encodeInt32:self.serverFileID forKey:@"serverFileID"];
    [encoder encodeInt32:self.serverItemID forKey:@"serverItemID"];
    [encoder encodeInt32:self.fileTimestamp forKey:@"fileTimestamp"];
    [encoder encodeInt32:self.fileType forKey:@"fileType"];
    [encoder encodeObject:self.fileData forKey:@"fileData"];
    [encoder encodeInt32:self.fileStatus forKey:@"fileStatus"];
}
-(id)copyWithZone:(NSZone *)zone {
    GetFileObj *finalCopy = [[[self class] allocWithZone: zone] init];

    finalCopy.serverFileID = self.serverFileID;

    finalCopy.serverItemID = self.serverItemID;

    finalCopy.fileTimestamp = self.fileTimestamp;

    finalCopy.fileType = self.fileType;

    NSData *cpy5 = [self.fileData copy];
    finalCopy.fileData = cpy5;

    finalCopy.fileStatus = self.fileStatus;

    return finalCopy;
}

@end


text:
{-# LANGUAGE BangPatterns #-}

import Data.STRef
import Control.Monad
import Control.Monad.ST
import Control.Monad.State.Strict

example1 :: Int
example1 = runST $ do
  x <- newSTRef 0

  forM_ [1..1000] $ \j -> do
    writeSTRef x j

  readSTRef x

example2 :: Int
example2 = runST $ do
  count <- newSTRef 0
  replicateM_ (10^6) $ modifySTRef' count (+1)
  readSTRef count

example3 :: Int
example3 = flip evalState 0 $ do
  replicateM_ (10^6) $ modify' (+1)
  get

modify' :: MonadState a m => (a -> a) -> m ()
modify' f = get >>= (\x -> put $! f x)


text:
index: 90
category: "hacking"
toc: true
path: "/manual/creating-a-note-template"
title: "Creating a Note Template"
---

Once Inkdrop becomes a part of your daily workflow, you may want to save time and effort with note templates.
Inkdrop provides powerful APIs to let you do that.
Here is a walkthrough to make a note template for journaling.

## Create a note for template

Let's create a note something like this. Nothing special.

![Create a note for template](creating-a-note-template_create-note.png)

You will need the note ID of the note template.
Right-click the note and click _Copy Note Link_ menu.

![Get note ID](creating-a-note-template_get-note-id.png)

Now you've got a string in clipboard like so:

```
[journal template](inkdrop://note:bSU-gSHd_)
```

`note:bSU-gSHd_` is the note ID in this case.

## Create a command that duplicates the template

Most of Inkdrop's operations are executed by [commands](/manual/list-of-commands).
For example, when you open a note, Inkdrop runs `core:open-note` command internally.
You can define a [custom command](/reference/command-registry) via [the init file](/manual/the-init-file).
Let's make a command that creates new note based on your template.

In this example, you define a command named `custom:new-journal`.
Create `init.js` in [your data directory](/manual/basic-usage#user-data-directory) and write some JavaScript like the following:

```js
inkdrop.commands.add(document.body, "custom:new-journal", async () => {
  const db = inkdrop.main.dataStore.getLocalDB()
  const template = await db.notes.get("note:bSU-gSHd_")
  const note = {
    ...template,
    _id: db.notes.createId(),
    _rev: undefined,
    title: new Date().toLocaleDateString(),
    createdAt: +new Date(),
    updatedAt: +new Date(),
    pinned: false,
  }
  try {
    await db.notes.put(note)
    inkdrop.commands.dispatch(document.body, "core:open-note", {
      noteId: note._id,
    })
    inkdrop.commands.dispatch(document.body, "editor:focus-mde")
  } catch (e) {
    console.error(e)
  }
})
```

Let's look at the lines we've added.

```js
const db = inkdrop.main.dataStore.getLocalDB()
```

It gets an instance of [the local Inkdrop database](/reference/inkdrop-database).

```js
const template = await db.notes.get("note:bSU-gSHd_")
```

Then, it loads the note with ID `note:bSU-gSHd_` by calling [DBNote's `get` method](/reference/db-note#getdocid-options).
It returns an object that represents [Note](/reference/data-models#a-nameresource-notenotea) data.

```js
const note = {
  ...template,
  _id: db.notes.createId(),
  _rev: undefined,
  title: new Date().toLocaleDateString(),
  createdAt: +new Date(),
  updatedAt: +new Date(),
}
```

It builds a new note from the template data.
The new note should have a unique ID, so it sets new one generated with [DBNote's `createId` method](/reference/db-note#createid) to `_id` field.
The `_rev` is a special field to handle revisions, which should be `undefined`.
It sets a new title based on date time by calling [Date::toLocaleDateString](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString).

```js
await db.notes.put(note)
```

It saves the manipulated note to the local database by calling [DBNote's `put` method](/reference/db-note#putdoc).

```js
inkdrop.commands.dispatch(document.body, "core:open-note", { noteId: note._id })
```

It invokes `core:open-note` to open the new note.

```js
inkdrop.commands.dispatch(document.body, "editor:focus-mde")
```

Finally, it invokes `editor:focus-mde` to move focus to the editor.

## Add a menu to invoke the command

Next, we need a way to invoke the command we've made.
Inkdrop allows you to add custom [menus](/reference/menu-manager) to run arbitrary commands.
The below code adds a menu to _File -> Templates -> Create a journal_, which runs `custom:new-journal` command.

```js
inkdrop.menu.add([
  {
    label: "File",
    submenu: [
      {
        label: "Templates",
        submenu: [
          {
            label: "Create a journal",
            command: "custom:new-journal",
          },
        ],
      },
    ],
  },
])
```

Now, let's check out what it looks like.
Inkdrop will evaluate `init.js` file every time you launch.
So, let's reload the app from menu: _Developer -> Reload_.
And you should see the menu is added like this:

![Add a menu](creating-a-note-template_add-menu.png)

Okay, let's run the command...

![Run it](creating-a-note-template_run-it.png)

Boom! You've got a new note with the template content!

## Add a keymap for the command

It would be more useful to associate the command with [keybinding](/manual/customizing-keybindings).
Here is an example keybinding configuration:

```yaml
"body":
  "cmd-shift-j": "custom:new-journal"
```

So you can quickly create notes with the template!

## Override default behavior of "core:new-note"

You can create new note by pressing _Cmd-N_ on macOS and _Ctrl-N_ on Windows and Linux by default.
That's because the keystroke invokes `core:new-note` command.

You may want to use the same keystroke to create a note based on the template automatically if you are selecting "Journal" notebook on sidebar.
You can accomplish that by creating new command and associating it with the same keystroke.

Let's make a command named `custom:new-note` in your `init.js`:

```js
;(async () => {
  const db = inkdrop.main.dataStore.getLocalDB()
  const template = await db.notes.get("note:08zdMqQyj")

  inkdrop.commands.add(document.body, "custom:new-journal", async e => {
    const note = {
      ...template,
      _id: db.notes.createId(),
      _rev: undefined,
      title: new Date().toISOString().slice(0, 10),
      createdAt: +new Date(),
      updatedAt: +new Date(),
    }
    try {
      await db.notes.put(note)
      inkdrop.commands.dispatch(document.body, "core:open-note", {
        noteId: note._id,
      })
      inkdrop.commands.dispatch(document.body, "editor:focus-mde")
    } catch (e) {
      console.error(e)
    }
  })

  inkdrop.commands.add(document.body, "custom:new-note", async () => {
    const { queryContext } = inkdrop.store.getState()
    if (
      queryContext.mode === "book" &&
      queryContext.bookId === template.bookId
    ) {
      inkdrop.commands.dispatch(document.body, "custom:new-journal")
    } else {
      inkdrop.commands.dispatch(document.body, "core:new-note")
    }
  })
})()
```

Let's look at the lines we've added.

```js
(async () => {
  const db = inkdrop.main.dataStore.getLocalDB()
  const template = await db.notes.get("note:08zdMqQyj")
```

First, it loads the template note.

```js
inkdrop.commands.add(document.body, "custom:new-journal", async e => {
  // ...
})
```

It is equivalent to the command we've created before.

```js
inkdrop.commands.add(document.body, "custom:new-note", async () => {
  const { queryContext } = inkdrop.store.getState()
  if (queryContext.mode === "book" && queryContext.bookId === template.bookId) {
    inkdrop.commands.dispatch(document.body, "custom:new-journal")
  } else {
    inkdrop.commands.dispatch(document.body, "core:new-note")
  }
})
```

We defined a command `custom:new-note`.

It checks if [query context](/reference/state-query-context) mode is `"book"` and its `bookId` is same as your template, which means you are selecting "Journal" notebook on sidebar in this example.
Then, if true, it invokes `custom:new-journal` command.
Otherwise, it invokes `core:new-note`.

<div class="ui info message">

Learn more about [getting & setting the app state](/manual/flux-architecture).

</div>

Now, let's associate the command with the keystroke in your [keymap.cson](/manual/customizing-keybindings/)! On macOS:

```yaml
"body":
  "cmd-n": "custom:new-note"
```

On Windows and Linux:

```yaml
"body":
  "ctrl-n": "custom:new-note"
```

Now you don't have to remember the keystroke nor select the menu to invoke `custom:new-journal` command!


text:
<?php namespace Menthol\Flexible\Traits;

use AspectMock\Test as am;
use Husband;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Facade;
use Menthol\Flexible\Proxy;
use Mockery as m;

class SearchableTraitTest extends \PHPUnit_Framework_TestCase
{

    protected function tearDown()
    {
        m::close();
        am::clean();
    }

    /**
     * @test
     */
    public function it_should_get_a_proxy()
    {
        /**
         *
         * Set
         *
         */
        $proxy = m::mock('Menthol\Flexible\proxy');

        /**
         *
         * Expectation
         *
         */
        Facade::clearResolvedInstances();
        \Husband::clearProxy();

        App::shouldReceive('make')
            ->with('menthol.flexible.proxy', m::type('Illuminate\Database\Eloquent\Model'))
            ->andReturn($proxy);

        /**
         *
         *
         * Assertion
         *
         */
        $proxy1 = \Husband::getProxy();

        $this->assertSame($proxy, $proxy1);

        $proxy2 = \Husband::getProxy();

        $this->assertSame($proxy, $proxy2);
    }

    /**
     * @test
     * @expectedException \Exception
     */
    public function it_should_throw_an_exception_if_included_in_a_non_eloquent_model()
    {
        /**
         *
         * Set
         *
         */
        \Dummy::getProxy();
    }

    /**
     * @test
     */
    public function it_should_call_methods_on_the_proxy()
    {
        /**
         *
         * Set
         *
         */
        $proxy = m::mock('Menthol\Flexible\proxy');
        $husband = am::double('Husband', ['getProxy' => $proxy]);

        /**
         *
         * Expectation
         *
         */
        $proxy->shouldReceive('search')
            ->with('*')
            ->once()
            ->andReturn('result_static');

        $proxy->shouldReceive('search')
            ->with('**')
            ->once()
            ->andReturn('result');

        /**
         *
         * Assertion
         *
         */
        $result = \Husband::search('*');

        $this->assertEquals('result_static', $result);

        $result = \Husband::search('**');

        $this->assertEquals('result', $result);

        $husband->verifyInvoked('getProxy');
    }

    /**
     * @test
     * @expectedException \BadMethodCallException
     */
    public function it_should_not_call_methods_on_the_proxy()
    {
        /**
         *
         * Expectation
         *
         */
        App::clearResolvedInstance('app');
        App::shouldReceive('make')->with('Elasticsearch')->andReturn(true);
        App::shouldReceive('make')->with('menthol.flexible.index', m::type('array'))->andReturn(true);

        /**
         *
         * Assertion
         *
         */
        // Overrule the proxy defined in previous tests
        am::double('Husband', ['getProxy' => new Proxy(new Husband)]);

        // Call a non existing method
        \Husband::bogus('*');
    }

    /**
     * @test
     */
    public function it_should_get_elasticsearch_id()
    {
        /**
         * Assertions
         */
        $husband = new Husband();

        $this->assertEquals('dummy_id', $husband->getEsId());
    }

}


text:
from codecs import open

from setuptools import setup

with open('README.md', 'r') as readme_file:
    readme = readme_file.read()

with open('requirements.txt', 'r') as requirements_file:
    requirements = requirements_file.read()

setup(
    name='pycep_correios',
    version='5.1.0',
    description='API para consulta de CEPs',
    long_description=readme,
    long_description_content_type='text/markdown',
    author='Michell Stuttgart Faria',
    author_email='michellstut@gmail.com',
    maintainer='Michell Stuttgart Faria',
    maintainer_email='michellstut@gmail.com',
    url='https://github.com/mstuttgart/pycep-correios',
    download_url='https://github.com/mstuttgart/pycep-correios',
    packages=[
        'pycep_correios',
    ],
    package_dir={
        'pycep_correios': 'pycep_correios',
    },
    include_package_data=True,
    install_requires=requirements,
    license='MIT License',
    zip_safe=False,
    keywords='correios viacep apicep cep',
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Natural Language :: Portuguese',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
    ],
    test_suite='tests',
)


text:
#ifndef GAME_H
#define GAME_H

#include <SFML/Window.hpp>
#include "igamestate.h"
#include "openglversion.h"

namespace gamefw {

class Entity;

class Renderer;

class PointLight;

/**
 * @brief Main game class. Provides the main window and performs input processing.
 */
class Game
{
public:
    /**
     * @brief Creates the game window.
     *
     * @param display_width Height in pixels.
     * @param display_height Width in pixels.
     * @param opengl_version OpenGL context version. Defaults to OGL_3_3.
     **/
    Game(const uint display_width, const uint display_height, const OpenGLVersion opengl_version = OGL_3_3);

    ~Game();

    sf::Window* getMainWindow();

    /**
     * @brief Draws the screen and performs input processing.
     */
    UpdateStatus update();

    /**
     * @brief Changes the active GameState.
     *
     * @param gamestate ditto.
     */
    void changeGameState(shared_ptr<IGameState> gamestate);

    /**
     * @brief Adds entity to the rendering pipeline.
     *
     * @param entity ditto.
     */
    void addToRenderQueue(shared_ptr<Entity> entity);

    /**
     * @brief Adds pointlight to the rendering pipeline.
     *
     * @param pointlight ditto.
     * @return void
     */
    void addToPointLightQueue(shared_ptr< PointLight > pointlight);

    shared_ptr<Renderer> getRenderer();

private:
    shared_ptr<Renderer> m_renderer;
    sf::ContextSettings m_main_window_context;
    sf::Window m_main_window;

    shared_ptr<IGameState> m_active_gamestate;
};

}

#endif // GAME_H


text:
package org.deeplearning4j.nn.layers.recurrent;

import org.deeplearning4j.berkeley.Pair;
import org.deeplearning4j.nn.api.Layer;
import org.deeplearning4j.nn.conf.NeuralNetConfiguration;
import org.deeplearning4j.nn.gradient.Gradient;
import org.deeplearning4j.nn.layers.BaseOutputLayer;
import org.deeplearning4j.nn.params.DefaultParamInitializer;
import org.deeplearning4j.util.Dropout;
import org.deeplearning4j.util.TimeSeriesUtils;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ops.impl.transforms.SoftMax;
import org.nd4j.linalg.api.shape.Shape;
import org.nd4j.linalg.factory.Nd4j;

/**Recurrent Neural Network Output Layer.

 * Handles calculation of gradients etc for various objective functions.

 * Functionally the same as OutputLayer, but handles output and label reshaping
 * automatically.

 * Input and output activations are same as other RNN layers: 3 dimensions with shape
 * [miniBatchSize,nIn,timeSeriesLength] and [miniBatchSize,nOut,timeSeriesLength] respectively.
 * @author Alex Black
 * @see BaseOutputLayer, OutputLayer
 */
public class RnnOutputLayer extends BaseOutputLayer<org.deeplearning4j.nn.conf.layers.RnnOutputLayer> {

	public RnnOutputLayer(NeuralNetConfiguration conf) {
		super(conf);
	}

	public RnnOutputLayer(NeuralNetConfiguration conf, INDArray input) {
        super(conf, input);
    }

	private INDArray reshape3dTo2d(INDArray in){
		if( in.rank() != 3 ) throw new IllegalArgumentException("Invalid input: expect NDArray with rank 3");
		int[] shape = in.shape();
		if(shape[0]==1) return in.tensorAlongDimension(0,1,2).permutei(1,0);	//Edge case: miniBatchSize==1
		if(shape[2]==1) return in.tensorAlongDimension(0,1,0);	//Edge case: timeSeriesLength=1
		INDArray permuted = in.permute(0, 2, 1);	//Permute, so we get correct order after reshaping
        return permuted.reshape('f',shape[0] * shape[2], shape[1]);
	}

	private INDArray reshape2dTo3d(INDArray in, int miniBatchSize){
		if( in.rank() != 2 ) throw new IllegalArgumentException("Invalid input: expect NDArray with rank 2");
		//Based on: RnnToFeedForwardPreProcessor
		int[] shape = in.shape();
        if(in.ordering() != 'f') in = Shape.toOffsetZeroCopy(in, 'f');
		INDArray reshaped = in.reshape('f',miniBatchSize, shape[0] / miniBatchSize, shape[1]);
		return reshaped.permute(0, 2, 1);
	}

    @Override
    public Pair<Gradient,INDArray> backpropGradient(INDArray epsilon) {
        if(input.rank() != 3) throw new UnsupportedOperationException("Input is not rank 3");
        INDArray inputTemp = input;
        this.input = reshape3dTo2d(input);
    	Pair<Gradient,INDArray> gradAndEpsilonNext = super.backpropGradient(epsilon);
        this.input = inputTemp;
    	INDArray epsilon2d = gradAndEpsilonNext.getSecond();
    	INDArray epsilon3d = reshape2dTo3d(epsilon2d, input.size(0));
		return new Pair<>(gradAndEpsilonNext.getFirst(),epsilon3d);
    }

    /**{@inheritDoc}
     */
    @Override
    public double f1Score(INDArray examples, INDArray labels) {
        if(examples.rank() == 3) examples = reshape3dTo2d(examples);
        if(labels.rank() == 3) labels = reshape3dTo2d(labels);
        return super.f1Score(examples, labels);
    }

    public INDArray getInput() {
        return input;
    }

    @Override
    public Layer.Type type() {
        return Layer.Type.RECURRENT;
    }

    @Override
    public INDArray preOutput(INDArray x, boolean training){
        setInput(x);
        return reshape2dTo3d(preOutput2d(training),input.size(0));
    }

    @Override
    protected INDArray preOutput2d(boolean training){
        if(input.rank() == 3 ) {
            //Case when called from RnnOutputLayer
            INDArray inputTemp = input;
            input = reshape3dTo2d(input);
            INDArray out = super.preOutput(input, training);
            this.input = inputTemp;
            return out;
        } else {
            //Case when called from BaseOutputLayer
            INDArray out = super.preOutput(input, training);
            return out;
        }
    }

    @Override
    protected INDArray output2d(INDArray input){
    	return reshape3dTo2d(output(input));
    }

    @Override
    protected INDArray getLabels2d(){
    	if(labels.rank()==3) return reshape3dTo2d(labels);
    	return labels;
    }

    @Override
    public INDArray output(INDArray input) {
        if(input.rank() != 3) throw new IllegalArgumentException("Input must be rank 3 (is: " + input.rank());
        //Returns 3d activations from 3d input
        setInput(input);
        return output(false);
    }

    @Override
    public INDArray output(boolean training){
        //Assume that input is 3d
        if(input.rank() != 3 ) throw new IllegalArgumentException("input must be rank 3");
        INDArray preOutput2d = preOutput2d(training);

        if(conf.getLayer().getActivationFunction().equals("softmax")) {
            INDArray out2d = Nd4j.getExecutioner().execAndReturn(new SoftMax(preOutput2d));
            if(maskArray != null){
                out2d.muliColumnVector(maskArray);
            }
            return reshape2dTo3d(out2d,input.size(0));
        }

        if(training)
            applyDropOutIfNecessary(training);
        INDArray origInput = input;
        this.input = reshape3dTo2d(input);
        INDArray out = super.activate(true);
        this.input = origInput;
        if(maskArray != null){
            out.muliColumnVector(maskArray);
        }
        return reshape2dTo3d(out,input.size(0));
    }

    @Override
    public INDArray activate(boolean training) {
        if(input.rank() != 3) throw new UnsupportedOperationException("Input must be rank 3");
        INDArray b = getParam(DefaultParamInitializer.BIAS_KEY);
        INDArray W = getParam(DefaultParamInitializer.WEIGHT_KEY);
        if(conf.isUseDropConnect() && training) {
            W = Dropout.applyDropConnect(this, DefaultParamInitializer.WEIGHT_KEY);
        }

        INDArray input2d = reshape3dTo2d(input);

        INDArray act2d = Nd4j.getExecutioner().execAndReturn(Nd4j.getOpFactory().createTransform(conf.getLayer().getActivationFunction(),
                input2d.mmul(W).addiRowVector(b)));
        if(maskArray != null){
            act2d.muliColumnVector(maskArray);
        }
        return reshape2dTo3d(act2d, input.size(0));
    }

    @Override
    public void setMaskArray(INDArray maskArray) {
        if(maskArray != null && maskArray.size(1) != 1){
            maskArray = TimeSeriesUtils.reshapeTimeSeriesMaskToVector(maskArray);
        }
        this.maskArray = maskArray;
    }
}


text:
// Copyright 2015-2025 Finsa S.p.A. <finsa@finsa.it>
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at:
//
// "http://www.apache.org/licenses/LICENSE-2.0"
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under
// the License.

using Common.Logging;
using PommaLabs.CodeServices.Common;
using PommaLabs.CodeServices.Serialization;
using PommaLabs.Thrower;
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using System;
using System.Collections.Generic;
using System.Text;

namespace Finsa.CodeServices.MessageQueue
{
    /// <summary>
    ///   Implementazione per RabbitMQ della coda di messaggi.
    /// </summary>
    public sealed class RabbitMessageQueue : IMessageQueue
    {
        const int QueueWaitInMilliseconds = 500;
        const bool QueueIsDurable = true;
        const bool QueueIsExclusive = false;
        const bool QueueAutoDeletes = false;
        const IDictionary<string, object> QueueArguments = null;

        /// <summary>
        ///   Il serializzatore usato per mettere i pacchetti in formato testo. Non lo passo tramite
        ///   INJECTION perché è fondamentale che rimanga costante e bloccato nel corso del tempo.
        /// </summary>
        static readonly ISerializer JsonSerializer = new JsonSerializer();

        /// <summary>
        ///   La lista di connessione a RabbitMQ.
        /// </summary>
        static readonly RabbitConnectionString ConnectionString = new RabbitConnectionString();

        /// <summary>
        ///   La factory usata per generare connessioni verso RabbitMQ.
        /// </summary>
        static ConnectionFactory ConnectionFactory;

        readonly ILog _log;

        public RabbitMessageQueue(ILog log)
        {
            // Preconditions
            Raise.ArgumentNullException.IfIsNull(log, nameof(log));

            _log = log;
        }

        public string Name
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        public void PublishTo<TMsg>(string queueName, TMsg message) where TMsg : class
        {
            if (ConnectionFactory == null)
            {
                ConnectionFactory = new ConnectionFactory
                {
                    HostName = ConnectionString.HostName,
                    UserName = ConnectionString.UserName,
                    Password = ConnectionString.Password
                };
            }

            using (var connection = ConnectionFactory.CreateConnection())
            using (var channel = connection.CreateModel())
            {
                // Crea la coda se non esiste.
                channel.QueueDeclare(queueName, QueueIsDurable, QueueIsExclusive, QueueAutoDeletes, QueueArguments);

                // Crea il messaggio, serializzandolo come JSON.
                var body = JsonSerializer.SerializeToBytes(message);

                // Proprietà necessarie per garantire la persistenza del messaggio.
                var props = channel.CreateBasicProperties();
                props.ContentType = "application/json";
                props.DeliveryMode = 2; // Persistent

                // Infine, pubblica realmente il messaggio.
                channel.BasicPublish(string.Empty, queueName, props, body);
            }
        }

        public IMessage<TMsg> ConsumeFrom<TMsg>(string queueName) where TMsg : class
        {
            // Since it is a blocking call, I am sure the Option object will have a value.
            return ConsumeFrom<TMsg>(queueName, MessageQueueConsumeOptions.Default).Value;
        }

        public Option<IMessage<TMsg>> ConsumeFrom<TMsg>(string queueName, MessageQueueConsumeOptions queueReadOptions) where TMsg : class
        {
            if (ConnectionFactory == null)
            {
                ConnectionFactory = new ConnectionFactory
                {
                    HostName = ConnectionString.HostName,
                    UserName = ConnectionString.UserName,
                    Password = ConnectionString.Password
                };
            }

            // NOTA BENE: Non faccio né using, né Dispose della connessione e del canale perché lo
            // chiuderà il messaggio stesso. Questo è vero solo se la chiamata è bloccante!
            // Altrimenti, devo comunque chiudere la connessione...
            var connection = ConnectionFactory.CreateConnection();
            var channel = connection.CreateModel();
            channel.QueueDeclare(queueName, QueueIsDurable, QueueIsExclusive, QueueAutoDeletes, QueueArguments);
            channel.BasicQos(0, 1, false);

            var consumer = new QueueingBasicConsumer(channel);
            channel.BasicConsume(queueName, false, consumer);
            channel.ConfirmSelect();

            var blocking = !queueReadOptions.HasFlag(MessageQueueConsumeOptions.NonBlocking);
            BasicDeliverEventArgs ea;

            if (blocking)
            {
                ea = consumer.Queue.Dequeue();
            }
            else
            {
                if (!consumer.Queue.Dequeue(QueueWaitInMilliseconds, out ea))
                {
                    // IMPORTANTE: Se non ricevo messaggi, DEVO chiudere il canale.
                    channel.Close();
                    connection.Close();
                    return Option.None<IMessage<TMsg>>();
                }
            }

            // Preparazione dell'oggetto di risposta.
            var body = JsonSerializer.DeserializeFromBytes<TMsg>(ea.Body);
            IMessage<TMsg> msg = new RabbitMessage<TMsg>(body, connection, channel, ea.DeliveryTag, _log);

            // Restituzione del risultato.
            return Option.Some(msg);
        }

        public IList<MessageQueueInfo> ListQueues()
        {
            throw new NotImplementedException();
        }
    }
}


text:
/**
 * Created by muzi on 2015/11/11.
 */
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var employeeSchema = new Schema({
    name: { type: String, required: true },
    surname: { type: String, required: true },
    hasDriversLicense: String,
    gender: String,
    created_at: Date,
    updated_at: Date
});

var Employee = mongoose.model('Employee', employeeSchema);

module.exports = Employee;


text:
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="Bootstrap.php" colors="true">
    <testsuites>
        <testsuite name="DebugTest">
            <directory>./DebugTest</directory>
        </testsuite>
    </testsuites>
</phpunit>