text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/functions/v2/functions.proto

package com.google.cloud.functions.v2;

/**
 *
 *
 *

 * Location of the source in an archive file in Google Cloud Storage.
 *

 *
 * Protobuf type {@code google.cloud.functions.v2.StorageSource}
 */
public final class StorageSource extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.StorageSource)
    StorageSourceOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use StorageSource.newBuilder() to construct.
  private StorageSource(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private StorageSource() {
    bucket_ = "";
    object_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new StorageSource();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.functions.v2.FunctionsProto
        .internal_static_google_cloud_functions_v2_StorageSource_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.functions.v2.FunctionsProto
        .internal_static_google_cloud_functions_v2_StorageSource_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.functions.v2.StorageSource.class,
            com.google.cloud.functions.v2.StorageSource.Builder.class);
  }

  public static final int BUCKET_FIELD_NUMBER = 1;
  private volatile java.lang.Object bucket_;
  /**
   *
   *
   *

   * Google Cloud Storage bucket containing the source (see
   * [Bucket Name
   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
   *

   *
   * string bucket = 1;
   *
   * @return The bucket.
   */
  @java.lang.Override
  public java.lang.String getBucket() {
    java.lang.Object ref = bucket_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      bucket_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * Google Cloud Storage bucket containing the source (see
   * [Bucket Name
   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
   *

   *
   * string bucket = 1;
   *
   * @return The bytes for bucket.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getBucketBytes() {
    java.lang.Object ref = bucket_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      bucket_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int OBJECT_FIELD_NUMBER = 2;
  private volatile java.lang.Object object_;
  /**
   *
   *
   *

   * Google Cloud Storage object containing the source.
   * This object must be a gzipped archive file (`.tar.gz`) containing source to
   * build.
   *

   *
   * string object = 2;
   *
   * @return The object.
   */
  @java.lang.Override
  public java.lang.String getObject() {
    java.lang.Object ref = object_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      object_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * Google Cloud Storage object containing the source.
   * This object must be a gzipped archive file (`.tar.gz`) containing source to
   * build.
   *

   *
   * string object = 2;
   *
   * @return The bytes for object.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getObjectBytes() {
    java.lang.Object ref = object_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      object_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int GENERATION_FIELD_NUMBER = 3;
  private long generation_;
  /**
   *
   *
   *

   * Google Cloud Storage generation for the object. If the generation is
   * omitted, the latest generation will be used.
   *

   *
   * int64 generation = 3;
   *
   * @return The generation.
   */
  @java.lang.Override
  public long getGeneration() {
    return generation_;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, object_);
    }
    if (generation_ != 0L) {
      output.writeInt64(3, generation_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, object_);
    }
    if (generation_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, generation_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.functions.v2.StorageSource)) {
      return super.equals(obj);
    }
    com.google.cloud.functions.v2.StorageSource other =
        (com.google.cloud.functions.v2.StorageSource) obj;

    if (!getBucket().equals(other.getBucket())) return false;
    if (!getObject().equals(other.getObject())) return false;
    if (getGeneration() != other.getGeneration()) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + BUCKET_FIELD_NUMBER;
    hash = (53 * hash) + getBucket().hashCode();
    hash = (37 * hash) + OBJECT_FIELD_NUMBER;
    hash = (53 * hash) + getObject().hashCode();
    hash = (37 * hash) + GENERATION_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration());
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.functions.v2.StorageSource parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.functions.v2.StorageSource parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.functions.v2.StorageSource parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.functions.v2.StorageSource parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.functions.v2.StorageSource parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.functions.v2.StorageSource parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.functions.v2.StorageSource parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.functions.v2.StorageSource parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.functions.v2.StorageSource parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.functions.v2.StorageSource parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.functions.v2.StorageSource parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.functions.v2.StorageSource parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.functions.v2.StorageSource prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   *

   * Location of the source in an archive file in Google Cloud Storage.
   *

   *
   * Protobuf type {@code google.cloud.functions.v2.StorageSource}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.StorageSource)
      com.google.cloud.functions.v2.StorageSourceOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.functions.v2.FunctionsProto
          .internal_static_google_cloud_functions_v2_StorageSource_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.functions.v2.FunctionsProto
          .internal_static_google_cloud_functions_v2_StorageSource_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.functions.v2.StorageSource.class,
              com.google.cloud.functions.v2.StorageSource.Builder.class);
    }

    // Construct using com.google.cloud.functions.v2.StorageSource.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bucket_ = "";

      object_ = "";

      generation_ = 0L;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.functions.v2.FunctionsProto
          .internal_static_google_cloud_functions_v2_StorageSource_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.functions.v2.StorageSource getDefaultInstanceForType() {
      return com.google.cloud.functions.v2.StorageSource.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.functions.v2.StorageSource build() {
      com.google.cloud.functions.v2.StorageSource result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.functions.v2.StorageSource buildPartial() {
      com.google.cloud.functions.v2.StorageSource result =
          new com.google.cloud.functions.v2.StorageSource(this);
      result.bucket_ = bucket_;
      result.object_ = object_;
      result.generation_ = generation_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.functions.v2.StorageSource) {
        return mergeFrom((com.google.cloud.functions.v2.StorageSource) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.functions.v2.StorageSource other) {
      if (other == com.google.cloud.functions.v2.StorageSource.getDefaultInstance()) return this;
      if (!other.getBucket().isEmpty()) {
        bucket_ = other.bucket_;
        onChanged();
      }
      if (!other.getObject().isEmpty()) {
        object_ = other.object_;
        onChanged();
      }
      if (other.getGeneration() != 0L) {
        setGeneration(other.getGeneration());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                bucket_ = input.readStringRequireUtf8();

                break;
              } // case 10
            case 18:
              {
                object_ = input.readStringRequireUtf8();

                break;
              } // case 18
            case 24:
              {
                generation_ = input.readInt64();

                break;
              } // case 24
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private java.lang.Object bucket_ = "";
    /**
     *
     *
     *

     * Google Cloud Storage bucket containing the source (see
     * [Bucket Name
     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
     *

     *
     * string bucket = 1;
     *
     * @return The bucket.
     */
    public java.lang.String getBucket() {
      java.lang.Object ref = bucket_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        bucket_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * Google Cloud Storage bucket containing the source (see
     * [Bucket Name
     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
     *

     *
     * string bucket = 1;
     *
     * @return The bytes for bucket.
     */
    public com.google.protobuf.ByteString getBucketBytes() {
      java.lang.Object ref = bucket_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        bucket_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * Google Cloud Storage bucket containing the source (see
     * [Bucket Name
     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
     *

     *
     * string bucket = 1;
     *
     * @param value The bucket to set.
     * @return This builder for chaining.
     */
    public Builder setBucket(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      bucket_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Google Cloud Storage bucket containing the source (see
     * [Bucket Name
     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
     *

     *
     * string bucket = 1;
     *
     * @return This builder for chaining.
     */
    public Builder clearBucket() {

      bucket_ = getDefaultInstance().getBucket();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Google Cloud Storage bucket containing the source (see
     * [Bucket Name
     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
     *

     *
     * string bucket = 1;
     *
     * @param value The bytes for bucket to set.
     * @return This builder for chaining.
     */
    public Builder setBucketBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      bucket_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object object_ = "";
    /**
     *
     *
     *

     * Google Cloud Storage object containing the source.
     * This object must be a gzipped archive file (`.tar.gz`) containing source to
     * build.
     *

     *
     * string object = 2;
     *
     * @return The object.
     */
    public java.lang.String getObject() {
      java.lang.Object ref = object_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        object_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * Google Cloud Storage object containing the source.
     * This object must be a gzipped archive file (`.tar.gz`) containing source to
     * build.
     *

     *
     * string object = 2;
     *
     * @return The bytes for object.
     */
    public com.google.protobuf.ByteString getObjectBytes() {
      java.lang.Object ref = object_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        object_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * Google Cloud Storage object containing the source.
     * This object must be a gzipped archive file (`.tar.gz`) containing source to
     * build.
     *

     *
     * string object = 2;
     *
     * @param value The object to set.
     * @return This builder for chaining.
     */
    public Builder setObject(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      object_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Google Cloud Storage object containing the source.
     * This object must be a gzipped archive file (`.tar.gz`) containing source to
     * build.
     *

     *
     * string object = 2;
     *
     * @return This builder for chaining.
     */
    public Builder clearObject() {

      object_ = getDefaultInstance().getObject();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Google Cloud Storage object containing the source.
     * This object must be a gzipped archive file (`.tar.gz`) containing source to
     * build.
     *

     *
     * string object = 2;
     *
     * @param value The bytes for object to set.
     * @return This builder for chaining.
     */
    public Builder setObjectBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      object_ = value;
      onChanged();
      return this;
    }

    private long generation_;
    /**
     *
     *
     *

     * Google Cloud Storage generation for the object. If the generation is
     * omitted, the latest generation will be used.
     *

     *
     * int64 generation = 3;
     *
     * @return The generation.
     */
    @java.lang.Override
    public long getGeneration() {
      return generation_;
    }
    /**
     *
     *
     *

     * Google Cloud Storage generation for the object. If the generation is
     * omitted, the latest generation will be used.
     *

     *
     * int64 generation = 3;
     *
     * @param value The generation to set.
     * @return This builder for chaining.
     */
    public Builder setGeneration(long value) {

      generation_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Google Cloud Storage generation for the object. If the generation is
     * omitted, the latest generation will be used.
     *

     *
     * int64 generation = 3;
     *
     * @return This builder for chaining.
     */
    public Builder clearGeneration() {

      generation_ = 0L;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2.StorageSource)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.StorageSource)
  private static final com.google.cloud.functions.v2.StorageSource DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.functions.v2.StorageSource();
  }

  public static com.google.cloud.functions.v2.StorageSource getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<StorageSource> PARSER =
      new com.google.protobuf.AbstractParser<StorageSource>() {
        @java.lang.Override
        public StorageSource parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<StorageSource> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<StorageSource> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.functions.v2.StorageSource getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}


text:
package com.edugility.objexj.engine;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.junit.Test;

import com.edugility.objexj.engine.Thread;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

public class TestCaseProgram3 extends AbstractProgramTestCase<Character> {

  public TestCaseProgram3() {
    super();
  }

  @Test
  public void testSimpleVariableAssignment() {

    /*
     * NotNullMVELFilter foo = bar; charValue() == 'a'
     * Match
     *
     * This test runs the preceding VM program and asserts that foo is
     * set to bar afterwards.
     *
     * TODO: still not sure about whether a Thread's variables
     * internally should be cloned or not.  Not sure how to test that.
     */

    final Thread<Character> t = this.run(Arrays.asList('a'));
    assertMatch(t);
    final Map<Object, Object> variables = t.getVariables();
    assertNotNull(variables);
    assertTrue(variables.containsKey("foo"));
    assertEquals("bar", variables.get("foo"));
  }

}

redpajama_set_name: RedPajamaGithub


text:
package cmd

import (
	"io"

	cmdconfig "github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd/config"
	cmdutil "github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd/util"
	"github.com/golang/glog"

	"github.com/spf13/cobra"
)

const (
	bash_completion_func = `# call kubectl get $1,
# use the first column in compgen
# we could use templates, but then would need a template per resource
__kubectl_parse_get()
{
    local kubectl_output out
    if kubectl_output=$(kubectl get --no-headers "$1" 2>/dev/null); then
        out=($(echo "${kubectl_output}" | awk '{print $1}'))
        COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) )
    fi
}

__kubectl_get_resource()
{
    if [[ ${#nouns[@]} -eq 0 ]]; then
        return 1
    fi
    __kubectl_parse_get "${nouns[${#nouns[@]} -1]}"
}

# $1 is the name of the pod we want to get the list of containers inside
__kubectl_get_containers()
{
    local template
    template="{{ range .desiredState.manifest.containers  }}{{ .name }} {{ end }}"
    __debug "${FUNCNAME} nouns are ${nouns[*]}"

    local len="${#nouns[@]}"
    if [[ ${len} -ne 1 ]]; then
        return
    fi
    local last=${nouns[${len} -1]}
    local kubectl_out
    if kubectl_out=$(kubectl get -o template --template="${template}" pods "${last}" 2>/dev/null); then
        COMPREPLY=( $( compgen -W "${kubectl_out[*]}" -- "$cur" ) )
    fi
}

# Require both a pod and a container to be specified
__kubectl_require_pod_and_container()
{
    if [[ ${#nouns[@]} -eq 0 ]]; then
        __kubectl_parse_get pods
        return 0
    fi;
    __kubectl_get_containers
    return 0
}

__custom_func() {
    case ${last_command} in
        kubectl_get | kubectl_describe | kubectl_delete | kubectl_label | kubectl_stop)
	    __kubectl_get_resource
            return
            ;;
	kubectl_log)
	    __kubectl_require_pod_and_container
	    return
	    ;;
        *)
            ;;
    esac
}
`
)

// NewKubectlCommand creates the `kubectl` command and its nested children.
func NewKubectlCommand(f *cmdutil.Factory, in io.Reader, out, err io.Writer) *cobra.Command {
	// Parent command to which all subcommands are added.
	cmds := &cobra.Command{
		Use:   "kubectl",
		Short: "kubectl controls the Kubernetes cluster manager",
		Long: `kubectl controls the Kubernetes cluster manager.

Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`,
		Run: runHelp,
		BashCompletionFunction: bash_completion_func,
	}

	f.BindFlags(cmds.PersistentFlags())

	cmds.AddCommand(NewCmdGet(f, out))
	cmds.AddCommand(NewCmdDescribe(f, out))
	cmds.AddCommand(NewCmdCreate(f, out))
	cmds.AddCommand(NewCmdUpdate(f, out))
	cmds.AddCommand(NewCmdDelete(f, out))

	cmds.AddCommand(NewCmdNamespace(out))
	cmds.AddCommand(NewCmdLog(f, out))
	cmds.AddCommand(NewCmdRollingUpdate(f, out))
	cmds.AddCommand(NewCmdResize(f, out))

	cmds.AddCommand(NewCmdExec(f, in, out, err))
	cmds.AddCommand(NewCmdPortForward(f))
	cmds.AddCommand(NewCmdProxy(f, out))

	cmds.AddCommand(NewCmdRunContainer(f, out))
	cmds.AddCommand(NewCmdStop(f, out))
	cmds.AddCommand(NewCmdExposeService(f, out))

	cmds.AddCommand(NewCmdLabel(f, out))

	cmds.AddCommand(cmdconfig.NewCmdConfig(cmdconfig.NewDefaultPathOptions(), out))
	cmds.AddCommand(NewCmdClusterInfo(f, out))
	cmds.AddCommand(NewCmdApiVersions(f, out))
	cmds.AddCommand(NewCmdVersion(f, out))

	return cmds
}

func runHelp(cmd *cobra.Command, args []string) {
	cmd.Help()
}

func printDeprecationWarning(command, alias string) {
	glog.Warningf("%s is DEPRECATED and will be removed in a future version. Use %s instead.", alias, command)
}


text:
<idea-plugin>

  <module value="com.intellij.modules.json"/>

  <application-components>
    <!-- Add your application components here -->
  </application-components>

  <actions>
    <!-- Add your actions here -->
  </actions>

  <extensions defaultExtensionNs="com.intellij">
    <fileTypeFactory implementation="com.intellij.json.JsonFileTypeFactory"/>
    <fileTypeFactory implementation="com.intellij.json.json5.Json5FileTypeFactory"/>
    <iconProvider implementation="com.jetbrains.jsonSchema.JsonSchemaIconProvider"/>
    <lang.parserDefinition language="JSON" implementationClass="com.intellij.json.JsonParserDefinition"/>
    <lang.parserDefinition language="JSON5" implementationClass="com.intellij.json.json5.Json5ParserDefinition"/>
    <lang.syntaxHighlighterFactory language="JSON" implementationClass="com.intellij.json.highlighting.JsonSyntaxHighlighterFactory"/>
    <lang.syntaxHighlighterFactory language="JSON5" implementationClass="com.intellij.json.json5.highlighting.Json5SyntaxHighlightingFactory"/>
    <psi.treeChangePreprocessor implementation="com.intellij.json.psi.impl.JsonTreeChangePreprocessor"/>
    <statusBarWidgetProvider implementation="com.jetbrains.jsonSchema.widget.JsonSchemaStatusWidgetProvider" />
    <fileBasedIndex implementation="com.jetbrains.jsonSchema.impl.JsonSchemaFileValuesIndex" />

    <!-- Code style and formatting -->
    <codeStyleSettingsProvider implementation="com.intellij.json.formatter.JsonCodeStyleSettingsProvider"/>
    <langCodeStyleSettingsProvider implementation="com.intellij.json.formatter.JsonLanguageCodeStyleSettingsProvider"/>
    <colorSettingsPage implementation="com.intellij.json.highlighting.JsonColorsPage"/>
    <lang.formatter language="JSON" implementationClass="com.intellij.json.formatter.JsonFormattingBuilderModel"/>
    <preFormatProcessor implementation="com.intellij.json.formatter.JsonTrailingCommaRemover"/>
    <lang.braceMatcher language="JSON" implementationClass="com.intellij.json.JsonBraceMatcher"/>
    <quoteHandler fileType="JSON" className="com.intellij.json.JsonQuoteHandler"/>
    <enterBetweenBracesDelegate language="JSON"  implementationClass="com.intellij.codeInsight.editorActions.enter.EnterBetweenBracesAndBracketsDelegate"/>
    <enterHandlerDelegate implementation="com.intellij.json.editor.JsonEnterHandler" id="JsonEnterHandler"/>
    <typedHandler implementation="com.intellij.json.editor.JsonTypedHandler" id="JsonTypedHandler"/>
    <copyPastePreProcessor implementation="com.intellij.json.editor.JsonCopyPasteProcessor"/>
    <editorSmartKeysConfigurable instance="com.intellij.json.editor.JsonSmartKeysConfigurable"/>
    <applicationService serviceInterface="com.intellij.json.editor.JsonEditorOptions"
                        serviceImplementation="com.intellij.json.editor.JsonEditorOptions"/>

    <!-- Codeinsight -->
    <breadcrumbsInfoProvider implementation="com.intellij.json.breadcrumbs.JsonBreadcrumbsProvider"/>
    <qualifiedNameProvider implementation="com.intellij.json.navigation.JsonQualifiedNameProvider"/>
    <completion.contributor language="JSON" id="JsonCompletionContributor" order="last" implementationClass="com.intellij.json.codeinsight.JsonCompletionContributor"/>
    <lang.psiStructureViewFactory language="JSON" implementationClass="com.intellij.json.structureView.JsonStructureViewBuilderFactory"/>
    <lang.foldingBuilder language="JSON" implementationClass="com.intellij.json.editor.folding.JsonFoldingBuilder"/>
    <lang.smartEnterProcessor language="JSON" implementationClass="com.intellij.json.editor.smartEnter.JsonSmartEnterProcessor"/>
    <lang.namesValidator language="JSON" implementationClass="com.intellij.json.JsonNamesValidator"/>
    <lang.commenter language="JSON" implementationClass="com.intellij.json.editor.JsonCommenter"/>
    <lang.surroundDescriptor language="JSON" implementationClass="com.intellij.json.surroundWith.JsonSurroundDescriptor"/>
    <lang.findUsagesProvider language="JSON" implementationClass="com.intellij.json.findUsages.JsonFindUsagesProvider"/>
    <statementUpDownMover implementation="com.intellij.json.editor.lineMover.JsonLineMover" id="JSON" order="before line"/>
    <liveTemplateContext implementation="com.intellij.json.liveTemplates.JsonContextType"/>
    <liveTemplateContext implementation="com.intellij.json.liveTemplates.JsonInLiteralsContextType"/>
    <liveTemplateContext implementation="com.intellij.json.liveTemplates.JsonInPropertyKeysContextType"/>
    <spellchecker.support language="JSON" implementationClass="com.intellij.json.JsonSpellcheckerStrategy"/>
    <extendWordSelectionHandler implementation="com.intellij.json.editor.selection.JsonStringLiteralSelectionHandler"/>
    <basicWordSelectionFilter implementation="com.intellij.json.editor.selection.JsonBasicWordSelectionFilter"/>

    <json.jsonLiteralChecker implementation="com.intellij.json.codeinsight.StandardJsonLiteralChecker"/>
    <json.jsonLiteralChecker implementation="com.intellij.json.json5.codeinsight.Json5JsonLiteralChecker"/>

    <!-- Annotators -->
    <annotator language="JSON" implementationClass="com.intellij.json.codeinsight.JsonLiteralAnnotator"/>

    <!-- Inspections -->
    <localInspection language="JSON" shortName="JsonStandardCompliance"
                     bundle="com.intellij.json.JsonBundle" key="inspection.compliance.name" groupKey="json.inspection.group"
                     enabledByDefault="true" level="ERROR"
                     implementationClass="com.intellij.json.codeinsight.JsonStandardComplianceInspection"/>
    <localInspection language="JSON5" shortName="Json5StandardCompliance"
                     bundle="com.intellij.json.JsonBundle" key="inspection.compliance5.name" groupKey="json.inspection.group"
                     enabledByDefault="true" level="ERROR"
                     implementationClass="com.intellij.json.json5.codeinsight.Json5StandardComplianceInspection"/>
    <localInspection language="JSON" shortName="JsonDuplicatePropertyKeys"
                     bundle="com.intellij.json.JsonBundle" key="inspection.duplicate.keys.name" groupKey="json.inspection.group"
                     enabledByDefault="true" level="WARNING"
                     implementationClass="com.intellij.json.codeinsight.JsonDuplicatePropertyKeysInspection"/>
    <localInspection language="JSON" shortName="JsonSchemaCompliance"
                     bundle="com.intellij.json.JsonBundle" key="json.schema.inspection.compliance.name" groupKey="json.inspection.group"
                     enabledByDefault="true" level="WARNING"
                     implementationClass="com.jetbrains.jsonSchema.impl.inspections.JsonSchemaComplianceInspection"/>
    <localInspection language="JSON" shortName="JsonSchemaRefReference"
                     bundle="com.intellij.json.JsonBundle" key="json.schema.ref.refs.inspection.name" groupKey="json.inspection.group"
                     enabledByDefault="true" level="WARNING"
                     implementationClass="com.jetbrains.jsonSchema.impl.inspections.JsonSchemaRefReferenceInspection" />

    <lang.elementManipulator forClass="com.intellij.json.psi.JsonStringLiteral"
                             implementationClass="com.intellij.json.psi.JsonStringLiteralManipulator"/>
    <projectService serviceImplementation="com.jetbrains.jsonSchema.JsonSchemaMappingsProjectConfiguration"/>
    <projectService serviceImplementation="com.jetbrains.jsonSchema.JsonSchemaCatalogProjectConfiguration"/>
    <projectConfigurable groupId="preferences.externalResources" id="settings.json.schema" displayName="JSON Schema Mappings"
                         instance="com.jetbrains.jsonSchema.settings.mappings.JsonSchemaMappingsConfigurable" nonDefaultProject="true"/>
    <projectConfigurable groupId="preferences.externalResources" id="settings.json.schema.catalog" displayName="Remote JSON Schemas"
                         instance="com.jetbrains.jsonSchema.JsonSchemaCatalogConfigurable" nonDefaultProject="true"/>
    <projectService serviceInterface="com.jetbrains.jsonSchema.ide.JsonSchemaService"
                    serviceImplementation="com.jetbrains.jsonSchema.impl.JsonSchemaServiceImpl"/>
    <completion.contributor order="last, before JsonCompletionContributor" language="JSON"
                            implementationClass="com.jetbrains.jsonSchema.impl.JsonSchemaCompletionContributor"/>
    <lang.documentationProvider language="JSON"
                                implementationClass="com.jetbrains.jsonSchema.impl.JsonSchemaDocumentationProvider"/>
    <refactoring.elementListenerProvider implementation="com.jetbrains.jsonSchema.JsonSchemaRefactoringListenerProvider"/>
    <statistics.counterUsagesCollector group_id="json.schema" version="1"/>

    <psi.referenceContributor language="JSON" implementation="com.jetbrains.jsonSchema.impl.JsonSchemaReferenceContributor"/>
    <multiHostInjector implementation="com.jetbrains.jsonSchema.impl.JsonSchemaRegexInjector"/>
    <lang.lineWrapStrategy language="JSON" implementationClass="com.intellij.json.formatter.JsonLineWrapPositionStrategy"/>
    <gotoDeclarationHandler implementation="com.jetbrains.jsonSchema.impl.JsonSchemaGotoDeclarationHandler"/>
    <copyPastePostProcessor implementation="com.intellij.json.editor.JsonCopyPastePostProcessor"/>
    <highlightVisitor implementation="com.intellij.json.highlighting.JsonRainbowVisitor"/>
  </extensions>
  <extensions defaultExtensionNs="JavaScript">
    <JsonSchema.ProviderFactory implementation="com.jetbrains.jsonSchema.extension.JsonSchemaUserDefinedProviderFactory"/>
    <JsonSchema.ProviderFactory implementation="com.jetbrains.jsonSchema.extension.JsonSchemaProjectSelfProviderFactory"/>
  </extensions>

  <extensions defaultExtensionNs="com.intellij.json">
    <jsonLikePsiWalkerFactory implementation="com.intellij.json.json5.Json5PsiWalkerFactory"/>
    <jsonSchemaEnabler implementation="com.jetbrains.jsonSchema.impl.JsonSchemaInJsonFilesEnabler" />
  </extensions>

  <extensionPoints>
    <extensionPoint qualifiedName="com.intellij.json.jsonStandardComplianceProvider"
                    interface="com.intellij.json.codeinsight.JsonStandardComplianceProvider"/>
    <extensionPoint qualifiedName="JavaScript.JsonSchema.ProviderFactory" interface="com.jetbrains.jsonSchema.extension.JsonSchemaProviderFactory"/>
    <extensionPoint qualifiedName="com.intellij.json.jsonLikePsiWalkerFactory" interface="com.jetbrains.jsonSchema.extension.JsonLikePsiWalkerFactory"/>
    <extensionPoint qualifiedName="com.intellij.json.jsonSchemaEnabler" interface="com.jetbrains.jsonSchema.extension.JsonSchemaEnabler"/>
    <extensionPoint qualifiedName="com.intellij.json.jsonWidgetSuppressor" interface="com.jetbrains.jsonSchema.extension.JsonWidgetSuppressor"/>
    <extensionPoint qualifiedName="com.intellij.json.jsonLiteralChecker" interface="com.intellij.json.codeinsight.JsonLiteralChecker"/>
    <extensionPoint qualifiedName="com.intellij.json.catalog.exclusion" interface="com.jetbrains.jsonSchema.remote.JsonSchemaCatalogExclusion"/>
  </extensionPoints>

</idea-plugin>


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\Clientes */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'nombre')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'direccion')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'encargado')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'nRif')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'cRif')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'siglas')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'contador')->textInput() ?>

        <?= Html::submitButton($model->isNewRecord ? Yii::t('models', 'Create') : Yii::t('models', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
/**
 * Created by alnedorezov on 5/31/17.
 */
// loading remote image
let img = new Image();
let latestNotificationFromCanvas = null;
let minimapImage = new Image();

function initPresentationLayer(acceptMode) {
    img.src = document.getElementById("img_url").innerText;
    img.onload = function () {
        resize();
        /*global initZoom*/
        /*eslint no-undef: "error"*/
        initZoom();
        window.addEventListener("resize", resize, false);
    };

    minimapImage = $("#minimap_img")[0];
    minimapImage.src = img.src;
    minimapImage.onload = function () {
        //Draw rectangle on the minimap on initialization
        /*global onScroll*/
        /*eslint no-undef: "error"*/
        onScroll();
        /*global redrawMinimapOnResize*/
        /*eslint no-undef: "error"*/
        redrawMinimapOnResize();
    };

    initSvg();
    changeScrollingPositionInTheHistoryBlock();
    scrollHistoryTableBodyToBottom();

    if (acceptMode) {
        let polygonsArray = JSON.parse(window.thisTask.getSolution().output_values.result);

        for (let polygonObjectId in polygonsArray) {
            let polygonObject = polygonsArray[polygonObjectId];
            let polygon = addPolygonFromObject(polygonObject);

            let de = new DataEntity(polygon.polygonId);
            de.parameters = polygonObject["parameters"];
            polygons[polygon.polygonId] = polygon;
            dc.addEntity(de, polygon.polygonId);
        }
    }

    // if (acceptMode) {
    //     hideToolbar();
    //     hideHistory();
    // }
}

/*
 * handles resizing of the canvas and of the svg layer for 1 to 1 mapping between image height and canvas & svg height
 * sends a notification to the user if not the full image will be shown
 **/
function resize() {
    /*global resizeCanvas*/
    /*eslint no-undef: "error"*/
    latestNotificationFromCanvas = resizeCanvas(img);
    /*global resizeSvg*/
    /*eslint no-undef: "error"*/
    resizeSvg(img);
    changeScrollingPositionInTheHistoryBlock();
    scrollHistoryTableBodyToBottom();
    showMessageToTheUserDependingOnTheLatestNotificationFromCanvas();
    /*global redrawMinimapOnResize*/
    /*eslint no-undef: "error"*/
    redrawMinimapOnResize();
}

function hideToolbar() {
    let toolbar = document.getElementsByClassName("btn-group-vertical")[0];
    toolbar.style.display = 'none';
}

function hideHistory() {
    let history = document.getElementById("history-panel");
    history.style.display = 'none';
}

function changeScrollingPositionInTheHistoryBlock() {
    let historyTable = document.getElementsByClassName("history-table")[0];
    let historyTableBody = document.getElementsByClassName("history-table-body")[0];
    let width = historyTable.clientWidth;
    historyTableBody.style.width = width + "px";
}

function scrollHistoryTableBodyToBottom() {
    let historyTableBody = document.getElementsByClassName("history-table-body")[0];
    historyTableBody.scrollTop = historyTableBody.scrollHeight;
}

function showMessageToTheUserDependingOnTheLatestNotificationFromCanvas() {
    if (latestNotificationFromCanvas === "Not the full image will be shown") { // Notify the user that not the full image will be shown
        showMessage(activeLanguage.notTheFullImageWillBeShownNotificationString, MessageTypeEnum.WARNING);
    } else { // Display the instructions for the user
        showMessage(
            activeLanguage.markupImageWithToolsNotificationString, MessageTypeEnum.INFO);
    }
}


text:
package common.build

package object controllers {
  type AssetsBuilder = _root_.controllers.AssetsBuilder
  type Assets = _root_.controllers.Assets
}


text:
package org.cryptoworkshop.ximix.console.adapters;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.cryptoworkshop.ximix.console.NodeAdapter;
import org.cryptoworkshop.ximix.console.config.AdapterConfig;
import org.cryptoworkshop.ximix.console.config.ConsoleConfig;
import org.cryptoworkshop.ximix.console.handlers.messages.StandardMessage;
import org.cryptoworkshop.ximix.console.model.Command;

/**
 *
 */
public abstract class BaseNodeAdapter
        implements NodeAdapter
{
    /**
     * List of commands that me be invoked by this adapter.
     */
    protected List<Command> commandList = new ArrayList<>();
    /**
     * Maps command id to command.
     */
    protected Map<Integer, Command> idToCommand = new ConcurrentHashMap<>();

    /**
     * Id of this adapter.
     */
    protected String id = null;
    /**
     * Name of this adapter.
     */
    protected String name = null;

    /**
     * Node description.
     */
    protected String description = null;

    /**
     * Connection has been established, opened.
     */
    protected boolean opened = false;

    public BaseNodeAdapter()
    {

    }

    @Override
    public void init(ConsoleConfig consoleConfig, AdapterConfig config) throws Exception
    {
        id = config.getId();
        name = config.getName();
        description = config.getDescription();
    }

    @Override
    public String getCommandNameForId(int id)
    {
        Command cmd = idToCommand.get(id);

        if (cmd == null)
        {
            return "Unknown.";
        }

        return cmd.getMethod().getName();
    }

    @Override
    public StandardMessage invoke(int id, Map<String, String[]> params)
    {

        Command cmd = idToCommand.get(id);
        if (cmd == null)
        {
            return new StandardMessage(false, "Unknown command.");
        }

        Method m = cmd.getMethod();

        Class types[] = m.getParameterTypes();
        Object[] p = new Object[types.length];

        for (int t = 0; t < types.length; t++)
        {
            String[] v = params.get(String.valueOf(t));

            if (v == null)
            {
                return new StandardMessage(false, "Missing parameter " + t);
            }

            if (types[t].isArray())
            {
                p[t] = v;
            } else
            {
                if (p.length == 0)
                {
                    return new StandardMessage(false, "Parameter sent but no value."); // Not sure this can happen.
                }
                p[t] = v[0];
            }
        }

        try
        {
            //
            // Check it is open.
            //
            synchronized (this)
            {
                if (!opened)
                {
                    open();
                }
            }

            Object o = m.invoke(cmd.getInstance(), p);

            if (o instanceof StandardMessage)
            {
                return (StandardMessage) o;
            }

        } catch (Exception ex)
        {
            //TODO Ask about preferred logging framework.
            ex.printStackTrace();
            return new StandardMessage(false, "Exception occurred during call, see server log.");
        }

        return new StandardMessage(true, "Ok.");

    }

    @Override
    public List<Command> getCommandList()
    {
        return commandList;
    }

    public void setCommandList(List<Command> commandList)
    {
        this.commandList = commandList;
    }

    public Map<Integer, Command> getIdToCommand()
    {
        return idToCommand;
    }

    public void setIdToCommand(Map<Integer, Command> idToCommand)
    {
        this.idToCommand = idToCommand;
    }

    @Override
    public String getId()
    {
        return id;
    }

    public void setId(String name)
    {
        this.id = name;
    }

    @Override
    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

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

    public void setDescription(String description)
    {
        this.description = description;
    }

    @Override
    public boolean isOpened()
    {
        return opened;
    }

    public void setOpened(boolean opened)
    {
        this.opened = opened;
    }

}


text:
package net.alegen.android.monidroid;

public class NetworkItem {

    private String ssid;
    private String bssid;
    private String capabilities;
    private int frequency;
    private int level;

    public NetworkItem(String ssid, String bssid, String capabilities, int frequency, int level) {
        this.ssid = ssid;
        this.bssid = bssid;
        this.capabilities = capabilities;
        this.frequency = frequency;
        this.level = level;
    }

    public String getSsid() {
        return this.ssid;
    }

    public String getBssid() {
        return this.bssid;
    }

    public String getCapabilities() {
        return this.capabilities;
    }

    public String getFrequency() {
        return String.valueOf(this.frequency);
    }

    public String getLevel() {
        return String.valueOf(this.level);
    }
}


text:
namespace balls {
namespace shader {

using namespace logs;

Property* createShaderProperty(
  const QString& name, QObject* subject, Property* parent) {
  using util::types::info;

  if (subject != nullptr) {
    QVariant var = subject->property(qPrintable(name));

    Q_ASSERT(var.isValid());

    auto type = var.userType();

    if (info.count(type) && info[type].propertyFactory) {
      const util::types::TypeInfo& i = info[type];

      qDebug() << "Creating property" << var.typeName() << name << "for"
               << subject->objectName();

      return i.propertyFactory(name, subject, parent);
    } else {
      qDebug() << "Using default property" << var.typeName() << name << "for"
               << subject->objectName();
    }
  }

  return nullptr;
}
}
}


text:
local Config = require('opus.config')
local Event  = require('opus.event')
local fuzzy  = require('opus.fuzzy')
local Sound  = require('opus.sound')
local Socket = require('opus.socket')
local sync   = require('opus.sync').sync
local UI     = require('opus.ui')
local Util   = require('opus.util')

local colors     = _G.colors
local fs         = _G.fs
local peripheral = _G.peripheral
local shell      = _ENV.shell

local configName = ({...})[1]
local configPath = 'miloRemote' .. (configName and "_"..configName or "")

local context = {
	state = Config.load(configPath, { displayMode = 0, deposit = true }),
	configPath = configPath,
	responseHandlers = { },
}

local depositMode = {
	[ true  ] = { text = '\25',  textColor = colors.black, help = 'Deposit enabled' },
	[ false ] = { text = '\215', textColor = colors.red,   help = 'Deposit disabled' },
}

local displayModes = {
	[0] = { text = 'A', help = 'Showing all items' },
	[1] = { text = 'I', help = 'Showing inventory items' },
}

local page = UI.Page {
	menuBar = UI.MenuBar {
		buttons = {
			{
				text = 'Refresh',
				x = -12,
				event = 'refresh'
			},
			{
				name = 'config',
				text = '\187',
				x = -3,
			},
		},
		infoBar = UI.StatusBar {
			x = 1, ex = -16,
			backgroundColor = colors.lightGray,
		},
	},
	grid = UI.Grid {
		y = 2, ey = -2,
		columns = {
			{ heading = ' Qty', key = 'count'       , width = 4, align = 'right' },
			{ heading = 'Name', key = 'displayName' },
		},
		values = { },
		sortColumn = context.state.sortColumn or 'count',
		inverseSort = context.state.inverseSort,
		help = '^(s)tack, ^(a)ll'
	},
	statusBar = UI.Window {
		y = -1,
		filter = UI.TextEntry {
			x = 1, ex = -13,
			limit = 50,
			shadowText = 'filter',
			backgroundColor = 'primary',
			backgroundFocusColor = 'primary',
			accelerators = {
				[ 'enter' ] = 'eject',
				[ 'up' ] = 'grid_up',
				[ 'down' ] = 'grid_down',
				[ 'control-a' ] = 'eject_all',
			},
		},
		amount = UI.TextEntry {
			x = -12, ex = -7,
			limit = 4,
			shadowText = '1',
			shadowTextColor = colors.gray,
			backgroundColor = colors.black,
			backgroundFocusColor = colors.black,
			accelerators = {
				[ 'enter' ] = 'eject_specified',
				[ 'control-a' ] = 'eject_all',
			},
			help = 'Request amount',
		},
		depositToggle = UI.Button {
			x = -6,
			event = 'toggle_deposit',
			text = '\215',
		},
		display = UI.Button {
			x = -3,
			event = 'toggle_display',
			text = displayModes[context.state.displayMode].text,
			help = displayModes[context.state.displayMode].help,
		},
	},
	notification = UI.Notification {
		anchor = 'top',
	},
	accelerators = {
		r = 'refresh',
		[ 'control-r' ] = 'refresh',
		[ 'control-e' ] = 'eject',
		[ 'control-s' ] = 'eject_stack',
		[ 'control-a' ] = 'eject_all',
		[ 'control-q' ] = 'quit',
	},
	items = { },
}

local function getPlayerName()
	local neural = peripheral.find('neuralInterface')

	if neural and neural.getName then
		return neural.getName()
	end
end

function page.grid:getRowTextColor(row, selected)
	if row.is_craftable then
		return colors.yellow
	end
	if row.has_recipe then
		return colors.cyan
	end
	return UI.Grid:getRowTextColor(row, selected)
end

function page.grid:getDisplayValues(row)
	row = Util.shallowCopy(row)
	row.count = row.count > 0 and Util.toBytes(row.count) or ''
	return row
end

function page.grid:sortCompare(a, b)
	if self.sortColumn ~= 'displayName' then
		if a[self.sortColumn] == b[self.sortColumn] then
			if self.inverseSort then
				return a.displayName > b.displayName
			end
			return a.displayName < b.displayName
		end
		if a[self.sortColumn] == 0 then
			return self.inverseSort
		end
		if b[self.sortColumn] == 0 then
			return not self.inverseSort
		end
		return a[self.sortColumn] < b[self.sortColumn]
	end
	return UI.Grid.sortCompare(self, a, b)
end

function page.grid:eventHandler(event)
	if event.type == 'grid_sort' then
		context.state.sortColumn = event.sortColumn
		context.state.inverseSort = event.inverseSort
		Config.update(configPath, context.state)
	end
	return UI.Grid.eventHandler(self, event)
end

function page:transfer(item, count, msg)
	context:sendRequest({ request = 'transfer', item = item, count = count }, msg)
end

function page:eventHandler(event)
	if event.type == 'quit' then
		UI:quit()

	elseif event.type == 'setup' then
		self.setup.form:setValues(context.state)
		self.setup:show()

	elseif event.type == 'toggle_deposit' then
		context.state.deposit = not context.state.deposit
		Util.merge(self.statusBar.depositToggle, depositMode[context.state.deposit])
		self.statusBar:draw()
		context:setStatus(depositMode[context.state.deposit].help)
		context:notifyInfo(depositMode[context.state.deposit].help)
		Config.update(configPath, context.state)

	elseif event.type == 'focus_change' then
		context:setStatus(event.focused.help)

	elseif event.type == 'eject' or event.type == 'grid_select' then
		local item = self.grid:getSelected()
		if item then
			self:transfer(item, 1, 'requesting 1 ...')
		end

	elseif event.type == 'eject_stack' then
		local item = self.grid:getSelected()
		if item then
			self:transfer(item, 'stack', 'requesting stack ...')
		end

	elseif event.type == 'eject_all' then
		local item = self.grid:getSelected()
		if item then
			self:transfer(item, 'all', 'requesting all ...')
		end

	elseif event.type == 'eject_specified' then
		local item = self.grid:getSelected()
		local count = tonumber(self.statusBar.amount.value)
		if item and count then
			self.statusBar.amount:reset()
			self:setFocus(self.statusBar.filter)
			self:transfer(item, count, 'requesting ' .. count .. ' ...')
		else
			Sound.play('entity.villager.no')
			context:notifyError('nope ...')
		end

	elseif event.type == 'plugin' then
		event.button.callback(context)

	elseif event.type == 'rescan' then
		self:setFocus(self.statusBar.filter)
		self:refresh('scan')
		self.grid:draw()

	elseif event.type == 'grid_up' then
		self.grid:emit({ type = 'scroll_up' })

	elseif event.type == 'grid_down' then
		self.grid:emit({ type = 'scroll_down' })

	elseif event.type == 'refresh' then
		self:setFocus(self.statusBar.filter)
		self:refresh('list')
		self.grid:draw()

	elseif event.type == 'toggle_display' then
		context.state.displayMode = (context.state.displayMode + 1) % 2
		Util.merge(event.button, displayModes[context.state.displayMode])
		event.button:draw()
		self:applyFilter()
		context:setStatus(event.button.help)
		context:notifyInfo(event.button.help)
		self.grid:draw()
		Config.update(configPath, context.state)

	elseif event.type == 'text_change' and event.element == self.statusBar.filter then
		self.filter = event.text or ''
		if #self.filter == 0 then
			self.filter = nil
		end
		self:applyFilter()
		self.grid:setIndex(1)
		self.grid:draw()

	else
		UI.Page.eventHandler(self, event)
	end
	return true
end

function page:enable()
	self:setFocus(self.statusBar.filter)
	Util.merge(self.statusBar.depositToggle, depositMode[context.state.deposit])
	UI.Page.enable(self)
	if not context.state.server then
		self.setup.form:setValues(context.state)
		self.setup:show()
	end
	Event.onTimeout(.1, function()
		self:refresh('list')
		self.grid:draw()
		self:sync()
	end)
end

local function splitKey(key)
	local t = Util.split(key, '(.-):')
	local item = { }
	if #t[#t] > 8 then
		item.nbtHash = table.remove(t)
	end
	item.damage = tonumber(table.remove(t))
	item.name = table.concat(t, ':')
	return item
end

function page:expandList(list)
	local t = { }
	for k,v in pairs(list) do
		local item = splitKey(k)
		item.has_recipe, item.count, item.displayName = v:match('(%d+):(%d+):(.+)')
		item.count = tonumber(item.count) or 0
		item.lname = item.displayName:lower()
		item.has_recipe = item.has_recipe == '1'
		t[k] = item
	end
	return t
end

function page:refresh(requestType)
	context:sendRequest({ request = requestType }, 'refreshing...')
end

function page:applyFilter()
	local function filterItems(t, filter, displayMode)
		self.grid.sortColumn = context.state.sortColumn or 'count'
		self.grid.inverseSort = context.state.inverseSort

		if filter then
			local r = { }
			filter = filter:lower()
			self.grid.sortColumn = 'score'
			self.grid.inverseSort = true

			for _,v in pairs(t) do
				v.score = fuzzy(v.lname, filter)
				if v.score then
					if v.count > 0 then
						v.score = v.score + .2
					end
					table.insert(r, v)
				end
			end
			return r

		elseif displayMode > 0 then
			local r = { }

			for _,v in pairs(t) do
				if v.count > 0 then
					table.insert(r, v)
				end
			end
			return r
		end

		return t
	end
	local t = filterItems(self.items, self.filter, context.state.displayMode)
	self.grid:setValues(t)
end

context.page = page

function context:setStatus(status)
	page.menuBar.infoBar.values = status
	page.menuBar.infoBar:draw()
	page:sync()
end

function context:notifySuccess(status)
	page.notification:success(status)
	page:sync()
end

function context:notifyInfo(status)
	page.notification:info(status)
	page:sync()
end

function context:notifyError(status)
	page.notification:error(status)
	page:sync()
end

local function processMessages(s)
	Event.addRoutine(function()
		s.co = coroutine.running()
		repeat
			local response = s:read()
			if not response then
				break
			end
			local h = context.responseHandlers[response.type]
			if h then
				h(response)
			end
			if response.msg then
				context:notifyInfo(response.msg)
			end
		until not s.connected

		s:close()
		s = nil
		context:notifyError('disconnected ...')
		Sound.play('entity.villager.no')
	end)
end

function context:sendRequest(data, statusMsg)
	if not context.state.server then
		self:notifyError('Invalid configuration')
		return
	end

	local player = getPlayerName()
	if not player then
		self:notifyError('Missing neural or introspection')
		return
	end

	local success
	sync(page, function()
		local msg
		for _ = 1, 2 do
			if not context.socket or not context.socket.connected then
				self:notifyInfo('connecting ...')
				context.socket, msg = Socket.connect(context.state.server, 4242)
				if context.socket then
					context.socket:write(player)
					local r = context.socket:read(2)
					if r and not r.msg then
						self:notifySuccess('connected ...')
						processMessages(context.socket)
					else
						msg = r and r.msg or 'Timed out'
						context.socket:close()
						context.socket = nil
					end
				end
			end
			if context.socket then
				if statusMsg then
					self:notifyInfo(statusMsg)
				end
				if context.socket:write(data) then
					success = true
					return
				end
				context.socket:close()
				context.socket = nil
			end
		end
		self:notifyError(msg or 'Failed to connect')
	end)

	return success
end

function context:getState(key)
	return self.state[key]
end

function context:setState(key, value)
	self.state[key] = value
	Config.update(configPath, self.state)
end

context.responseHandlers['received'] = function(response)
	Sound.play('entity.item.pickup')
	local ritem = page.items[response.key]
	if ritem then
		ritem.count = response.count
		if page.enabled then
			page.grid:draw()
			page:sync()
		end
	end
end

context.responseHandlers['list'] = function(response)
	page.items = page:expandList(response.list)
	page:applyFilter()
	if page.enabled then
		page.grid:draw()
		page.grid:sync()
	end
end

context.responseHandlers['transfer'] = function(response)
	if response.count > 0 then
		Sound.play('entity.item.pickup')
		local item = page.items[response.key]
		if item then
			item.count = response.current
			if page.enabled then
				page.grid:draw()
				page:sync()
			end
		end
	end
	if response.craft then
		if response.craft > 0 then
			context:notifyInfo(response.craft .. ' crafting ...')
		elseif response.craft + response.count < response.requested then
			if response.craft + response.count == 0 then
				Sound.play('entity.villager.no')
			end
			context:notifyInfo((response.craft + response.count) .. ' available ...')
		end
	end
end

local function loadDirectory(dir)
	local dropdown = {
		{ text = 'Setup', event = 'setup' },
		{ spacer = true },
		{
			text = 'Rescan storage',
			event = 'rescan',
			help = 'Rescan all inventories'
		},
	}

	for _, file in pairs(fs.list(dir)) do
		local s, m = Util.run(_ENV, fs.combine(dir, file), context)
		if not s and m then
			_G.printError('Error loading: ' .. file)
			error(m or 'Unknown error')
		elseif s and m then
			table.insert(dropdown, {
				text = m.menuItem,
				event = 'plugin',
				callback = m.callback,
			})
		end
	end
	page.menuBar.config.dropdown = dropdown
end

local programDir = fs.getDir(shell.getRunningProgram())
loadDirectory(fs.combine(programDir, 'plugins/remote'))

UI:setPage(page)
UI:start()

if context.socket then
	context.socket:close()
end


text:
namespace base {

namespace {

LazyInstance<ThreadLocalPointer<SequencedTaskRunnerHandle>>::Leaky
    sequenced_task_runner_tls = LAZY_INSTANCE_INITIALIZER;

}  // namespace

// static
scoped_refptr<SequencedTaskRunner> SequencedTaskRunnerHandle::Get() {
  // Return the registered SequencedTaskRunner, if any.
  const SequencedTaskRunnerHandle* handle =
      sequenced_task_runner_tls.Pointer()->Get();
  if (handle)
    return handle->task_runner_;

  // Note if you hit this: the problem is the lack of a sequenced context. The
  // ThreadTaskRunnerHandle is just the last attempt at finding such a context.
  CHECK(ThreadTaskRunnerHandle::IsSet())
      << "Error: This caller requires a sequenced context (i.e. the "
         "current task needs to run from a SequencedTaskRunner).";
  return ThreadTaskRunnerHandle::Get();
}

// static
bool SequencedTaskRunnerHandle::IsSet() {
  return sequenced_task_runner_tls.Pointer()->Get() ||
         ThreadTaskRunnerHandle::IsSet();
}

SequencedTaskRunnerHandle::SequencedTaskRunnerHandle(
    scoped_refptr<SequencedTaskRunner> task_runner)
    : task_runner_(std::move(task_runner)) {
  DCHECK(task_runner_->RunsTasksInCurrentSequence());
  DCHECK(!SequencedTaskRunnerHandle::IsSet());
  sequenced_task_runner_tls.Pointer()->Set(this);
}

SequencedTaskRunnerHandle::~SequencedTaskRunnerHandle() {
  DCHECK(task_runner_->RunsTasksInCurrentSequence());
  DCHECK_EQ(sequenced_task_runner_tls.Pointer()->Get(), this);
  sequenced_task_runner_tls.Pointer()->Set(nullptr);
}

}  // namespace base


text:
class ModelPermissions extends RocketChat.models._Base {
	constructor() {
		super(...arguments);
	}

	// FIND
	findByRole(role, options) {
		const query = {
			roles: role
		};

		return this.find(query, options);
	}

	findOneById(_id) {
		return this.findOne(_id);
	}

	createOrUpdate(name, roles) {
		this.upsert({ _id: name }, { $set: { roles } });
	}

	addRole(permission, role) {
		this.update({ _id: permission }, { $addToSet: { roles: role } });
	}

	removeRole(permission, role) {
		this.update({ _id: permission }, { $pull: { roles: role } });
	}
}

RocketChat.models.Permissions = new ModelPermissions('permissions', true);
RocketChat.models.Permissions.cache.load();


text:
package org.jclouds.aws.ec2.domain;

import static com.google.common.base.Preconditions.checkNotNull;

import java.util.Date;
import java.util.Map;

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.CaseFormat;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;

public class SpotInstanceRequest implements Comparable<SpotInstanceRequest> {
   public static Builder builder() {
      return new Builder();
   }

   public static class Builder {
      private String region;
      private String availabilityZoneGroup;
      private String launchedAvailabilityZone;
      private Date createTime;
      private String faultCode;
      private String faultMessage;
      private String instanceId;
      private String launchGroup;
      private LaunchSpecification launchSpecification;
      private String productDescription;
      private String id;
      private float spotPrice;
      private State state;
      private String rawState;
      private Type type;
      private Date validFrom;
      private Date validUntil;
      private Map<String, String> tags = Maps.newLinkedHashMap();

      public Builder clear() {
         this.region = null;
         this.availabilityZoneGroup = null;
         this.launchedAvailabilityZone = null;
         this.createTime = null;
         this.faultCode = null;
         this.faultMessage = null;
         this.instanceId = null;
         this.launchGroup = null;
         this.launchSpecification = null;
         this.productDescription = null;
         this.id = null;
         this.spotPrice = 0;
         this.state = null;
         this.rawState = null;
         this.type = null;
         this.validFrom = null;
         this.validUntil = null;
         tags = Maps.newLinkedHashMap();
         return this;
      }

      public Builder region(String region) {
         this.region = region;
         return this;
      }

      public Builder tags(Map<String, String> tags) {
         this.tags = ImmutableMap.copyOf(checkNotNull(tags, "tags"));
         return this;
      }

      public Builder tag(String key, String value) {
         if (key != null)
            this.tags.put(key, Strings.nullToEmpty(value));
         return this;
      }
      public Builder availabilityZoneGroup(String availabilityZoneGroup) {
         this.availabilityZoneGroup = availabilityZoneGroup;
         return this;
      }

      public Builder launchedAvailabilityZone(String launchedAvailabilityZone) {
         this.launchedAvailabilityZone = launchedAvailabilityZone;
         return this;
      }

      public Builder createTime(Date createTime) {
         this.createTime = createTime;
         return this;
      }

      public Builder faultCode(String faultCode) {
         this.faultCode = faultCode;
         return this;
      }

      public Builder faultMessage(String faultMessage) {
         this.faultMessage = faultMessage;
         return this;
      }

      public Builder instanceId(String instanceId) {
         this.instanceId = instanceId;
         return this;
      }

      public Builder launchGroup(String launchGroup) {
         this.launchGroup = launchGroup;
         return this;
      }

      public Builder launchSpecification(LaunchSpecification launchSpecification) {
         this.launchSpecification = launchSpecification;
         return this;
      }

      public Builder productDescription(String productDescription) {
         this.productDescription = productDescription;
         return this;
      }

      public Builder id(String id) {
         this.id = id;
         return this;
      }

      public Builder spotPrice(float spotPrice) {
         this.spotPrice = spotPrice;
         return this;
      }

      public Builder state(State state) {
         this.state = state;
         return this;
      }

      public Builder rawState(String rawState) {
         this.rawState = rawState;
         return this;
      }

      public Builder type(Type type) {
         this.type = type;
         return this;
      }

      public Builder validFrom(Date validFrom) {
         this.validFrom = validFrom;
         return this;
      }

      public Builder validUntil(Date validUntil) {
         this.validUntil = validUntil;
         return this;
      }

      public SpotInstanceRequest build() {
         return new SpotInstanceRequest(region, availabilityZoneGroup, launchedAvailabilityZone, createTime, faultCode,
                  faultMessage, instanceId, launchGroup, launchSpecification, productDescription, id, spotPrice, state,
                  rawState, type, validFrom, validUntil, tags);
      }
   }

   public enum Type {
      ONE_TIME, PERSISTENT, UNRECOGNIZED;

      public String value() {
         return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name());
      }

      @Override
      public String toString() {
         return value();
      }

      public static Type fromValue(String type) {
         try {
            return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type")));
         } catch (IllegalArgumentException e) {
            return UNRECOGNIZED;
         }
      }
   }

   public enum State {
      OPEN, ACTIVE, CANCELLED, CLOSED, UNRECOGNIZED;

      public String value() {
         return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name());
      }

      @Override
      public String toString() {
         return value();
      }

      public static State fromValue(String state) {
         try {
            return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(state, "type")));
         } catch (IllegalArgumentException e) {
            return UNRECOGNIZED;
         }
      }
   }

   private final String region;
   private final String availabilityZoneGroup;
   private final String launchedAvailabilityZone;
   private final Date createTime;
   private final String faultCode;
   private final String faultMessage;
   private final String instanceId;
   private final String launchGroup;
   private final LaunchSpecification launchSpecification;
   private final String productDescription;
   private final String id;
   private final float spotPrice;
   private final State state;
   private final String rawState;
   private final Type type;
   private final Date validFrom;
   private final Date validUntil;
   private final Map<String, String> tags;

   public SpotInstanceRequest(String region, String availabilityZoneGroup, @Nullable String launchedAvailabilityZone,
            Date createTime, String faultCode, String faultMessage, String instanceId, String launchGroup,
            LaunchSpecification launchSpecification, String productDescription, String id, float spotPrice,
            State state, String rawState, Type type, Date validFrom, Date validUntil, Map<String, String> tags) {
      this.region = checkNotNull(region, "region");
      this.availabilityZoneGroup = availabilityZoneGroup;
      this.launchedAvailabilityZone = launchedAvailabilityZone;
      this.createTime = createTime;
      this.faultCode = faultCode;
      this.faultMessage = faultMessage;
      this.instanceId = instanceId;
      this.launchGroup = launchGroup;
      this.launchSpecification = launchSpecification;
      this.productDescription = productDescription;
      this.id = checkNotNull(id, "id");
      this.spotPrice = spotPrice;
      this.state = checkNotNull(state, "state");
      this.rawState = checkNotNull(rawState, "rawState");
      this.type = checkNotNull(type, "type");
      this.validFrom = validFrom;
      this.validUntil = validUntil;
      this.tags = ImmutableMap.<String, String> copyOf(checkNotNull(tags, "tags"));
   }

   /**
    * @return spot instance requests are in a region
    */
   public String getRegion() {
      return region;
   }

   public String getAvailabilityZoneGroup() {
      return availabilityZoneGroup;
   }

   public String getLaunchedAvailabilityZone() {
      return launchedAvailabilityZone;
   }

   public Date getCreateTime() {
      return createTime;
   }

   public String getFaultCode() {
      return faultCode;
   }

   public String getFaultMessage() {
      return faultMessage;
   }

   public String getInstanceId() {
      return instanceId;
   }

   public String getLaunchGroup() {
      return launchGroup;
   }

   public LaunchSpecification getLaunchSpecification() {
      return launchSpecification;
   }

   public String getProductDescription() {
      return productDescription;
   }

   public String getId() {
      return id;
   }

   public float getSpotPrice() {
      return spotPrice;
   }

   public State getState() {
      return state;
   }

   public String getRawState() {
      return rawState;
   }

   public Type getType() {
      return type;
   }

   public Date getValidFrom() {
      return validFrom;
   }

   public Date getValidUntil() {
      return validUntil;
   }

   /**
    * tags that are present in the instance
    */
   public Map<String, String> getTags() {
      return tags;
   }

   @Override
   public int hashCode() {
      final int prime = 31;
      int result = 1;
      result = prime * result + ((availabilityZoneGroup == null) ? 0 : availabilityZoneGroup.hashCode());
      result = prime * result + ((createTime == null) ? 0 : createTime.hashCode());
      result = prime * result + ((faultCode == null) ? 0 : faultCode.hashCode());
      result = prime * result + ((faultMessage == null) ? 0 : faultMessage.hashCode());
      result = prime * result + ((id == null) ? 0 : id.hashCode());
      result = prime * result + ((instanceId == null) ? 0 : instanceId.hashCode());
      result = prime * result + ((launchGroup == null) ? 0 : launchGroup.hashCode());
      result = prime * result + ((launchSpecification == null) ? 0 : launchSpecification.hashCode());
      result = prime * result + ((launchedAvailabilityZone == null) ? 0 : launchedAvailabilityZone.hashCode());
      result = prime * result + ((productDescription == null) ? 0 : productDescription.hashCode());
      result = prime * result + ((region == null) ? 0 : region.hashCode());
      result = prime * result + Float.floatToIntBits(spotPrice);
      result = prime * result + ((state == null) ? 0 : state.hashCode());
      result = prime * result + ((type == null) ? 0 : type.hashCode());
      result = prime * result + ((validFrom == null) ? 0 : validFrom.hashCode());
      result = prime * result + ((validUntil == null) ? 0 : validUntil.hashCode());
      result = prime * result + ((tags == null) ? 0 : tags.hashCode());
      return result;
   }

   @Override
   public boolean equals(Object obj) {
      if (this == obj)
         return true;
      if (obj == null)
         return false;
      if (getClass() != obj.getClass())
         return false;
      SpotInstanceRequest other = (SpotInstanceRequest) obj;
      if (availabilityZoneGroup == null) {
         if (other.availabilityZoneGroup != null)
            return false;
      } else if (!availabilityZoneGroup.equals(other.availabilityZoneGroup))
         return false;
      if (createTime == null) {
         if (other.createTime != null)
            return false;
      } else if (!createTime.equals(other.createTime))
         return false;
      if (faultCode == null) {
         if (other.faultCode != null)
            return false;
      } else if (!faultCode.equals(other.faultCode))
         return false;
      if (faultMessage == null) {
         if (other.faultMessage != null)
            return false;
      } else if (!faultMessage.equals(other.faultMessage))
         return false;
      if (id == null) {
         if (other.id != null)
            return false;
      } else if (!id.equals(other.id))
         return false;
      if (instanceId == null) {
         if (other.instanceId != null)
            return false;
      } else if (!instanceId.equals(other.instanceId))
         return false;
      if (launchGroup == null) {
         if (other.launchGroup != null)
            return false;
      } else if (!launchGroup.equals(other.launchGroup))
         return false;
      if (launchSpecification == null) {
         if (other.launchSpecification != null)
            return false;
      } else if (!launchSpecification.equals(other.launchSpecification))
         return false;
      if (launchedAvailabilityZone == null) {
         if (other.launchedAvailabilityZone != null)
            return false;
      } else if (!launchedAvailabilityZone.equals(other.launchedAvailabilityZone))
         return false;
      if (productDescription == null) {
         if (other.productDescription != null)
            return false;
      } else if (!productDescription.equals(other.productDescription))
         return false;
      if (region == null) {
         if (other.region != null)
            return false;
      } else if (!region.equals(other.region))
         return false;
      if (Float.floatToIntBits(spotPrice) != Float.floatToIntBits(other.spotPrice))
         return false;
      if (state != other.state)
         return false;
      if (type != other.type)
         return false;
      if (validFrom == null) {
         if (other.validFrom != null)
            return false;
      } else if (!validFrom.equals(other.validFrom))
         return false;
      if (validUntil == null) {
         if (other.validUntil != null)
            return false;
      } else if (!validUntil.equals(other.validUntil))
         return false;
      if (tags == null) {
         if (other.tags != null)
            return false;
      } else if (!tags.equals(other.tags))
         return false;
      return true;
   }

   @Override
   public String toString() {
      return "[region=" + region + ", availabilityZoneGroup=" + availabilityZoneGroup + ", launchedAvailabilityZone="
            + launchedAvailabilityZone + ", createTime=" + createTime + ", faultCode=" + faultCode + ", faultMessage="
            + faultMessage + ", instanceId=" + instanceId + ", launchGroup=" + launchGroup + ", launchSpecification="
            + launchSpecification + ", productDescription=" + productDescription + ", id=" + id + ", spotPrice="
            + spotPrice + ", state=" + rawState + ", type=" + type + ", validFrom=" + validFrom + ", validUntil="
            + validUntil + ", tags=" + tags + "]";
   }

   @Override
   public int compareTo(SpotInstanceRequest arg0) {
      return createTime.compareTo(arg0.createTime);
   }

}


text:
aws_cloudwatch 'kitchen_test_alarm' do
  aws_access_key node['aws_test']['key_id']
  aws_secret_access_key node['aws_test']['access_key']
  aws_session_token node['aws_test']['session_token']
  period 21600
  evaluation_periods 2
  threshold 50.0
  comparison_operator 'LessThanThreshold'
  metric_name 'CPUUtilization'
  namespace 'AWS/EC2'
  statistic 'Maximum'
  action :create
end

aws_cloudwatch 'kitchen_test_alarm' do
  aws_access_key node['aws_test']['key_id']
  aws_secret_access_key node['aws_test']['access_key']
  aws_session_token node['aws_test']['session_token']
  action :disable_action
end

aws_cloudwatch 'kitchen_test_alarm' do
  aws_access_key node['aws_test']['key_id']
  aws_secret_access_key node['aws_test']['access_key']
  aws_session_token node['aws_test']['session_token']
  action :enable_action
end

aws_cloudwatch 'kitchen_test_alarm' do
  aws_access_key node['aws_test']['key_id']
  aws_secret_access_key node['aws_test']['access_key']
  aws_session_token node['aws_test']['session_token']
  action :delete
end


text:
static Point getSolution(int testNumber) {
    QVector<Point> solutions;
    QFile file (":/solutions.txt");
    const bool opened = file.open(QIODevice::ReadOnly);
    if (opened) {
        QTextStream in(&file);
        while (!in.atEnd()) {
            const QString line = in.readLine();
            const QStringList coordinates = line.split("\t");
            Point pos;
            for (int i=QTrilateration::AxisX; i<QTrilateration::AxisCount; i++) {
                pos(i) = QString(coordinates.at(i)).toFloat();
            }
            solutions.append(pos);
        }
    }
    file.close();
    return solutions.at(testNumber-1);
}

static QVector<Point> getBeaconsPosition() {
    QVector<Point> beaconPositions;
    QFile file (":/testdata.txt");
    const bool opened = file.open(QIODevice::ReadOnly);
    if (opened) {
        QTextStream in(&file);
        while (!in.atEnd()) {
            const QString line = in.readLine();
            const QStringList coordinates = line.split("\t");
            Point pos;
            for (int i=QTrilateration::AxisX; i<QTrilateration::AxisCount; i++) {
                pos(i) = QString(coordinates.at(i)).toFloat();
            }
            beaconPositions.append(pos);
        }
    }
    file.close();
    return beaconPositions;
}

static QVector<float> getExperimentalMeasure(const QString& path) {
    QVector<float> measures;
    QFile file (path);
    const bool opened = file.open(QIODevice::ReadOnly);
    if (opened) {
        QTextStream in(&file);
        while (!in.atEnd()) {
            const float line = in.readLine().toFloat();
            measures.append(line);
        }
    }
    file.close();
    return measures;
}

static QVector<QBeacon> getBeacons(const QVector<Point>& points) {
    QVector<QBeacon> beacons;
    const int N = points.size();
    for (int i=0; i<N; i++) {
        beacons.append(QBeacon::createBeacon(points[i], i));
    }
    return beacons;
}

static QVector<QMeasure> getMeasure(const QVector<QBeacon>& beacons, const QVector<float>& distances) {
    QVector<QMeasure> measures;
    const int N = beacons.size();
    for(int i=0; i<N; i++) {
        measures.append(QMeasure::createMeasure(&beacons[i], distances[i], 1.));
    }
    return measures;
}

SCENARIO("Testing the trilateration algorithm", "[QTrilateration]") {
    GIVEN("A set of beacons & experimental measures") {
        const int testNumber = 3;
        const QVector<Point> beaconsPosition = getBeaconsPosition();
        const QVector<float> measuresDistance = getExperimentalMeasure(QString(":/testmeasures_%1.txt").arg(testNumber));
        const QVector<QBeacon> beacons = getBeacons(beaconsPosition);
        const QVector<QMeasure> measures = getMeasure(beacons, measuresDistance);

        REQUIRE(beacons.size() ==  measures.size());
        QTrilateration* trilateration = new QTrilateration();

        WHEN("We set the experimental points") {
            trilateration->setBeacons(beacons.toList().toSet());
            const bool error =  trilateration->setMeasures(measures);
            THEN("No error is returned") {
                REQUIRE(!error);
            }
            AND_THEN("We have the same measures") {
                REQUIRE(trilateration->beacons().size() == beacons.size());
                REQUIRE(trilateration->measures().size() ==  measures.size());
            }
        }

        WHEN("We wan to estimate the point by using the linear least squares") {
            trilateration->setBeacons(beacons.toList().toSet());
            trilateration->setMeasures(measures);
            QTrilateration::Error errorCode = trilateration->calculatePosition(QTrilateration::LinearLeastSquares);
            THEN("We got no error") {
                REQUIRE(errorCode == QTrilateration::NoError);
            }
            AND_THEN("The estimated point is:") {
                const Point point = getSolution(testNumber);
                const Point sol = trilateration->estimatedPosition();
                for (int i=QTrilateration::AxisX; i<QTrilateration::AxisZ; i++) {
                    const Real relError = qAbs((point(i) - sol(i)) / point(i)) * 100;
                    REQUIRE(relError < 1);
                }
            }
        }
    }
}


text:
require File.expand_path(File.join('../', 'spec_helper'), File.dirname(__FILE__))

describe String do
  it 'to_love_moko' do
    expect('hime'.to_moko_love).to eq('hime is moko love')
  end
end


text:
namespace dialog
{
	class CMyDialog : public CDialog
	{
	public:
		CMyDialog();
		CMyDialog(UINT nIDTemplate, CWnd* pParentWnd = nullptr);
		~CMyDialog();
		void DisplayParentedDialog(UINT iAutoCenterWidth);

	protected:
		LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam) override;
		BOOL CheckAutoCenter() override;
		void SetStatusHeight(int iHeight) noexcept;
		int GetStatusHeight() const noexcept;
		void SetTitle(_In_ const std::wstring& szTitle) const;
		ui::CParentWnd* m_lpNonModalParent{};

	private:
		void Constructor();
		LRESULT NCHitTest(WPARAM wParam, LPARAM lParam);
		CWnd* m_hwndCenteringWindow{};
		UINT m_iAutoCenterWidth{};
		int m_iStatusHeight{};
		HWND m_hWndPrevious{};
	};
} // namespace dialog


text:
macro
-----

Start recording a macro for later invocation as a command::

  macro(<name> [arg1 [arg2 [arg3 ...]]])
    COMMAND1(ARGS ...)
    COMMAND2(ARGS ...)
    ...
  endmacro(<name>)

Define a macro named ``<name>`` that takes arguments named ``arg1``,
``arg2``, ``arg3``, (...).
Commands listed after macro, but before the matching
:command:`endmacro()`, are not invoked until the macro is invoked.
When it is invoked, the commands recorded in the macro are first
modified by replacing formal parameters (``${arg1}``) with the arguments
passed, and then invoked as normal commands.
In addition to referencing the formal parameters you can reference the
values ``${ARGC}`` which will be set to the number of arguments passed
into the function as well as ``${ARGV0}``, ``${ARGV1}``, ``${ARGV2}``,
...  which will have the actual values of the arguments passed in.
This facilitates creating macros with optional arguments.
Additionally ``${ARGV}`` holds the list of all arguments given to the
macro and ``${ARGN}`` holds the list of arguments past the last expected
argument.
Referencing to ``${ARGV#}`` arguments beyond ``${ARGC}`` have undefined
behavior. Checking that ``${ARGC}`` is greater than ``#`` is the only
way to ensure that ``${ARGV#}`` was passed to the function as an extra
argument.

See the :command:`cmake_policy()` command documentation for the behavior
of policies inside macros.

Macro Argument Caveats
^^^^^^^^^^^^^^^^^^^^^^

Note that the parameters to a macro and values such as ``ARGN`` are
not variables in the usual CMake sense.  They are string
replacements much like the C preprocessor would do with a macro.
Therefore you will NOT be able to use commands like::

 if(ARGV1) # ARGV1 is not a variable
 if(DEFINED ARGV2) # ARGV2 is not a variable
 if(ARGC GREATER 2) # ARGC is not a variable
 foreach(loop_var IN LISTS ARGN) # ARGN is not a variable

In the first case, you can use ``if(${ARGV1})``.
In the second and third case, the proper way to check if an optional
variable was passed to the macro is to use ``if(${ARGC} GREATER 2)``.
In the last case, you can use ``foreach(loop_var ${ARGN})`` but this
will skip empty arguments.
If you need to include them, you can use::

 set(list_var "${ARGN}")
 foreach(loop_var IN LISTS list_var)

Note that if you have a variable with the same name in the scope from
which the macro is called, using unreferenced names will use the
existing variable instead of the arguments. For example::

 macro(_BAR)
   foreach(arg IN LISTS ARGN)
     [...]
   endforeach()
 endmacro()

 function(_FOO)
   _bar(x y z)
 endfunction()

 _foo(a b c)

Will loop over ``a;b;c`` and not over ``x;y;z`` as one might be expecting.
If you want true CMake variables and/or better CMake scope control you
should look at the function command.


text:
package org.jfree.data.xy;

import java.util.List;
import org.jfree.data.Range;

public interface XYRangeInfo {
    Range getRangeBounds(List list, Range range, boolean z);
}