text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/api/monitored_resource.proto

package com.google.api;

/**
 *

 * Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource] object.
 * [MonitoredResource][google.api.MonitoredResource] objects contain the minimum set of information to
 * uniquely identify a monitored resource instance. There is some other useful
 * auxiliary metadata. Monitoring and Logging use an ingestion
 * pipeline to extract metadata for cloud resources of all types, and store
 * the metadata in this message.
 *

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

  @Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private MonitoredResourceMetadata(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10: {
            com.google.protobuf.Struct.Builder subBuilder = null;
            if (systemLabels_ != null) {
              subBuilder = systemLabels_.toBuilder();
            }
            systemLabels_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(systemLabels_);
              systemLabels_ = subBuilder.buildPartial();
            }

            break;
          }
          case 18: {
            if (!((mutable_bitField0_ & 0x00000002) != 0)) {
              userLabels_ = com.google.protobuf.MapField.newMapField(
                  UserLabelsDefaultEntryHolder.defaultEntry);
              mutable_bitField0_ |= 0x00000002;
            }
            com.google.protobuf.MapEntry<String, String>
            userLabels__ = input.readMessage(
                UserLabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
            userLabels_.getMutableMap().put(
                userLabels__.getKey(), userLabels__.getValue());
            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @Override
  protected com.google.protobuf.MapField internalGetMapField(
      int number) {
    switch (number) {
      case 2:
        return internalGetUserLabels();
      default:
        throw new RuntimeException(
            "Invalid map field number: " + number);
    }
  }
  @Override
  protected FieldAccessorTable
      internalGetFieldAccessorTable() {
    return MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            MonitoredResourceMetadata.class, Builder.class);
  }

  private int bitField0_;
  public static final int SYSTEM_LABELS_FIELD_NUMBER = 1;
  private com.google.protobuf.Struct systemLabels_;
  /**
   *

   * Output only. Values for predefined system metadata labels.
   * System labels are a kind of metadata extracted by Google, including
   * "machine_image", "vpc", "subnet_id",
   * "security_group", "name", etc.
   * System label values can be only strings, Boolean values, or a list of
   * strings. For example:
   *     { "name": "my-test-instance",
   *       "security_group": ["a", "b", "c"],
   *       "spot_instance": false }
   *

   *
   * .google.protobuf.Struct system_labels = 1;
   */
  public boolean hasSystemLabels() {
    return systemLabels_ != null;
  }
  /**
   *

   * Output only. Values for predefined system metadata labels.
   * System labels are a kind of metadata extracted by Google, including
   * "machine_image", "vpc", "subnet_id",
   * "security_group", "name", etc.
   * System label values can be only strings, Boolean values, or a list of
   * strings. For example:
   *     { "name": "my-test-instance",
   *       "security_group": ["a", "b", "c"],
   *       "spot_instance": false }
   *

   *
   * .google.protobuf.Struct system_labels = 1;
   */
  public com.google.protobuf.Struct getSystemLabels() {
    return systemLabels_ == null ? com.google.protobuf.Struct.getDefaultInstance() : systemLabels_;
  }
  /**
   *

   * Output only. Values for predefined system metadata labels.
   * System labels are a kind of metadata extracted by Google, including
   * "machine_image", "vpc", "subnet_id",
   * "security_group", "name", etc.
   * System label values can be only strings, Boolean values, or a list of
   * strings. For example:
   *     { "name": "my-test-instance",
   *       "security_group": ["a", "b", "c"],
   *       "spot_instance": false }
   *

   *
   * .google.protobuf.Struct system_labels = 1;
   */
  public com.google.protobuf.StructOrBuilder getSystemLabelsOrBuilder() {
    return getSystemLabels();
  }

  public static final int USER_LABELS_FIELD_NUMBER = 2;
  private static final class UserLabelsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<
        String, String> defaultEntry =
            com.google.protobuf.MapEntry
            .<String, String>newDefaultInstance(
                MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_UserLabelsEntry_descriptor,
                com.google.protobuf.WireFormat.FieldType.STRING,
                "",
                com.google.protobuf.WireFormat.FieldType.STRING,
                "");
  }
  private com.google.protobuf.MapField<
      String, String> userLabels_;
  private com.google.protobuf.MapField<String, String>
  internalGetUserLabels() {
    if (userLabels_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          UserLabelsDefaultEntryHolder.defaultEntry);
    }
    return userLabels_;
  }

  public int getUserLabelsCount() {
    return internalGetUserLabels().getMap().size();
  }
  /**
   *

   * Output only. A map of user-defined metadata labels.
   *

   *
   * map<string, string> user_labels = 2;
   */

  public boolean containsUserLabels(
      String key) {
    if (key == null) { throw new NullPointerException(); }
    return internalGetUserLabels().getMap().containsKey(key);
  }
  /**
   * Use {@link #getUserLabelsMap()} instead.
   */
  @Deprecated
  public java.util.Map<String, String> getUserLabels() {
    return getUserLabelsMap();
  }
  /**
   *

   * Output only. A map of user-defined metadata labels.
   *

   *
   * map<string, string> user_labels = 2;
   */

  public java.util.Map<String, String> getUserLabelsMap() {
    return internalGetUserLabels().getMap();
  }
  /**
   *

   * Output only. A map of user-defined metadata labels.
   *

   *
   * map<string, string> user_labels = 2;
   */

  public String getUserLabelsOrDefault(
      String key,
      String defaultValue) {
    if (key == null) { throw new NullPointerException(); }
    java.util.Map<String, String> map =
        internalGetUserLabels().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *

   * Output only. A map of user-defined metadata labels.
   *

   *
   * map<string, string> user_labels = 2;
   */

  public String getUserLabelsOrThrow(
      String key) {
    if (key == null) { throw new NullPointerException(); }
    java.util.Map<String, String> map =
        internalGetUserLabels().getMap();
    if (!map.containsKey(key)) {
      throw new IllegalArgumentException();
    }
    return map.get(key);
  }

  private byte memoizedIsInitialized = -1;
  @Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (systemLabels_ != null) {
      output.writeMessage(1, getSystemLabels());
    }
    com.google.protobuf.GeneratedMessageV3
      .serializeStringMapTo(
        output,
        internalGetUserLabels(),
        UserLabelsDefaultEntryHolder.defaultEntry,
        2);
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (systemLabels_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, getSystemLabels());
    }
    for (java.util.Map.Entry<String, String> entry
         : internalGetUserLabels().getMap().entrySet()) {
      com.google.protobuf.MapEntry<String, String>
      userLabels__ = UserLabelsDefaultEntryHolder.defaultEntry.newBuilderForType()
          .setKey(entry.getKey())
          .setValue(entry.getValue())
          .build();
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, userLabels__);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @Override
  public boolean equals(final Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof MonitoredResourceMetadata)) {
      return super.equals(obj);
    }
    MonitoredResourceMetadata other = (MonitoredResourceMetadata) obj;

    if (hasSystemLabels() != other.hasSystemLabels()) return false;
    if (hasSystemLabels()) {
      if (!getSystemLabels()
          .equals(other.getSystemLabels())) return false;
    }
    if (!internalGetUserLabels().equals(
        other.internalGetUserLabels())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasSystemLabels()) {
      hash = (37 * hash) + SYSTEM_LABELS_FIELD_NUMBER;
      hash = (53 * hash) + getSystemLabels().hashCode();
    }
    if (!internalGetUserLabels().getMap().isEmpty()) {
      hash = (37 * hash) + USER_LABELS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetUserLabels().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static MonitoredResourceMetadata parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static MonitoredResourceMetadata parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static MonitoredResourceMetadata parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static MonitoredResourceMetadata parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static MonitoredResourceMetadata parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static MonitoredResourceMetadata parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static MonitoredResourceMetadata parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static MonitoredResourceMetadata 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 MonitoredResourceMetadata parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static MonitoredResourceMetadata 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 MonitoredResourceMetadata parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static MonitoredResourceMetadata parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(MonitoredResourceMetadata prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @Override
  protected Builder newBuilderForType(
      BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *

   * Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource] object.
   * [MonitoredResource][google.api.MonitoredResource] objects contain the minimum set of information to
   * uniquely identify a monitored resource instance. There is some other useful
   * auxiliary metadata. Monitoring and Logging use an ingestion
   * pipeline to extract metadata for cloud resources of all types, and store
   * the metadata in this message.
   *

   *
   * Protobuf type {@code google.api.MonitoredResourceMetadata}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.api.MonitoredResourceMetadata)
      com.google.api.MonitoredResourceMetadataOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 2:
          return internalGetUserLabels();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(
        int number) {
      switch (number) {
        case 2:
          return internalGetMutableUserLabels();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @Override
    protected FieldAccessorTable
        internalGetFieldAccessorTable() {
      return MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              MonitoredResourceMetadata.class, Builder.class);
    }

    // Construct using com.google.api.MonitoredResourceMetadata.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @Override
    public Builder clear() {
      super.clear();
      if (systemLabelsBuilder_ == null) {
        systemLabels_ = null;
      } else {
        systemLabels_ = null;
        systemLabelsBuilder_ = null;
      }
      internalGetMutableUserLabels().clear();
      return this;
    }

    @Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_descriptor;
    }

    @Override
    public MonitoredResourceMetadata getDefaultInstanceForType() {
      return MonitoredResourceMetadata.getDefaultInstance();
    }

    @Override
    public MonitoredResourceMetadata build() {
      MonitoredResourceMetadata result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @Override
    public MonitoredResourceMetadata buildPartial() {
      MonitoredResourceMetadata result = new MonitoredResourceMetadata(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (systemLabelsBuilder_ == null) {
        result.systemLabels_ = systemLabels_;
      } else {
        result.systemLabels_ = systemLabelsBuilder_.build();
      }
      result.userLabels_ = internalGetUserLabels();
      result.userLabels_.makeImmutable();
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @Override
    public Builder clone() {
      return super.clone();
    }
    @Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return super.setField(field, value);
    }
    @Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return super.addRepeatedField(field, value);
    }
    @Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof MonitoredResourceMetadata) {
        return mergeFrom((MonitoredResourceMetadata)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(MonitoredResourceMetadata other) {
      if (other == MonitoredResourceMetadata.getDefaultInstance()) return this;
      if (other.hasSystemLabels()) {
        mergeSystemLabels(other.getSystemLabels());
      }
      internalGetMutableUserLabels().mergeFrom(
          other.internalGetUserLabels());
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

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

    @Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      MonitoredResourceMetadata parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (MonitoredResourceMetadata) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private com.google.protobuf.Struct systemLabels_;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> systemLabelsBuilder_;
    /**
     *

     * Output only. Values for predefined system metadata labels.
     * System labels are a kind of metadata extracted by Google, including
     * "machine_image", "vpc", "subnet_id",
     * "security_group", "name", etc.
     * System label values can be only strings, Boolean values, or a list of
     * strings. For example:
     *     { "name": "my-test-instance",
     *       "security_group": ["a", "b", "c"],
     *       "spot_instance": false }
     *

     *
     * .google.protobuf.Struct system_labels = 1;
     */
    public boolean hasSystemLabels() {
      return systemLabelsBuilder_ != null || systemLabels_ != null;
    }
    /**
     *

     * Output only. Values for predefined system metadata labels.
     * System labels are a kind of metadata extracted by Google, including
     * "machine_image", "vpc", "subnet_id",
     * "security_group", "name", etc.
     * System label values can be only strings, Boolean values, or a list of
     * strings. For example:
     *     { "name": "my-test-instance",
     *       "security_group": ["a", "b", "c"],
     *       "spot_instance": false }
     *

     *
     * .google.protobuf.Struct system_labels = 1;
     */
    public com.google.protobuf.Struct getSystemLabels() {
      if (systemLabelsBuilder_ == null) {
        return systemLabels_ == null ? com.google.protobuf.Struct.getDefaultInstance() : systemLabels_;
      } else {
        return systemLabelsBuilder_.getMessage();
      }
    }
    /**
     *

     * Output only. Values for predefined system metadata labels.
     * System labels are a kind of metadata extracted by Google, including
     * "machine_image", "vpc", "subnet_id",
     * "security_group", "name", etc.
     * System label values can be only strings, Boolean values, or a list of
     * strings. For example:
     *     { "name": "my-test-instance",
     *       "security_group": ["a", "b", "c"],
     *       "spot_instance": false }
     *

     *
     * .google.protobuf.Struct system_labels = 1;
     */
    public Builder setSystemLabels(com.google.protobuf.Struct value) {
      if (systemLabelsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        systemLabels_ = value;
        onChanged();
      } else {
        systemLabelsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *

     * Output only. Values for predefined system metadata labels.
     * System labels are a kind of metadata extracted by Google, including
     * "machine_image", "vpc", "subnet_id",
     * "security_group", "name", etc.
     * System label values can be only strings, Boolean values, or a list of
     * strings. For example:
     *     { "name": "my-test-instance",
     *       "security_group": ["a", "b", "c"],
     *       "spot_instance": false }
     *

     *
     * .google.protobuf.Struct system_labels = 1;
     */
    public Builder setSystemLabels(
        com.google.protobuf.Struct.Builder builderForValue) {
      if (systemLabelsBuilder_ == null) {
        systemLabels_ = builderForValue.build();
        onChanged();
      } else {
        systemLabelsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *

     * Output only. Values for predefined system metadata labels.
     * System labels are a kind of metadata extracted by Google, including
     * "machine_image", "vpc", "subnet_id",
     * "security_group", "name", etc.
     * System label values can be only strings, Boolean values, or a list of
     * strings. For example:
     *     { "name": "my-test-instance",
     *       "security_group": ["a", "b", "c"],
     *       "spot_instance": false }
     *

     *
     * .google.protobuf.Struct system_labels = 1;
     */
    public Builder mergeSystemLabels(com.google.protobuf.Struct value) {
      if (systemLabelsBuilder_ == null) {
        if (systemLabels_ != null) {
          systemLabels_ =
            com.google.protobuf.Struct.newBuilder(systemLabels_).mergeFrom(value).buildPartial();
        } else {
          systemLabels_ = value;
        }
        onChanged();
      } else {
        systemLabelsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *

     * Output only. Values for predefined system metadata labels.
     * System labels are a kind of metadata extracted by Google, including
     * "machine_image", "vpc", "subnet_id",
     * "security_group", "name", etc.
     * System label values can be only strings, Boolean values, or a list of
     * strings. For example:
     *     { "name": "my-test-instance",
     *       "security_group": ["a", "b", "c"],
     *       "spot_instance": false }
     *

     *
     * .google.protobuf.Struct system_labels = 1;
     */
    public Builder clearSystemLabels() {
      if (systemLabelsBuilder_ == null) {
        systemLabels_ = null;
        onChanged();
      } else {
        systemLabels_ = null;
        systemLabelsBuilder_ = null;
      }

      return this;
    }
    /**
     *

     * Output only. Values for predefined system metadata labels.
     * System labels are a kind of metadata extracted by Google, including
     * "machine_image", "vpc", "subnet_id",
     * "security_group", "name", etc.
     * System label values can be only strings, Boolean values, or a list of
     * strings. For example:
     *     { "name": "my-test-instance",
     *       "security_group": ["a", "b", "c"],
     *       "spot_instance": false }
     *

     *
     * .google.protobuf.Struct system_labels = 1;
     */
    public com.google.protobuf.Struct.Builder getSystemLabelsBuilder() {

      onChanged();
      return getSystemLabelsFieldBuilder().getBuilder();
    }
    /**
     *

     * Output only. Values for predefined system metadata labels.
     * System labels are a kind of metadata extracted by Google, including
     * "machine_image", "vpc", "subnet_id",
     * "security_group", "name", etc.
     * System label values can be only strings, Boolean values, or a list of
     * strings. For example:
     *     { "name": "my-test-instance",
     *       "security_group": ["a", "b", "c"],
     *       "spot_instance": false }
     *

     *
     * .google.protobuf.Struct system_labels = 1;
     */
    public com.google.protobuf.StructOrBuilder getSystemLabelsOrBuilder() {
      if (systemLabelsBuilder_ != null) {
        return systemLabelsBuilder_.getMessageOrBuilder();
      } else {
        return systemLabels_ == null ?
            com.google.protobuf.Struct.getDefaultInstance() : systemLabels_;
      }
    }
    /**
     *

     * Output only. Values for predefined system metadata labels.
     * System labels are a kind of metadata extracted by Google, including
     * "machine_image", "vpc", "subnet_id",
     * "security_group", "name", etc.
     * System label values can be only strings, Boolean values, or a list of
     * strings. For example:
     *     { "name": "my-test-instance",
     *       "security_group": ["a", "b", "c"],
     *       "spot_instance": false }
     *

     *
     * .google.protobuf.Struct system_labels = 1;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>
        getSystemLabelsFieldBuilder() {
      if (systemLabelsBuilder_ == null) {
        systemLabelsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>(
                getSystemLabels(),
                getParentForChildren(),
                isClean());
        systemLabels_ = null;
      }
      return systemLabelsBuilder_;
    }

    private com.google.protobuf.MapField<
        String, String> userLabels_;
    private com.google.protobuf.MapField<String, String>
    internalGetUserLabels() {
      if (userLabels_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            UserLabelsDefaultEntryHolder.defaultEntry);
      }
      return userLabels_;
    }
    private com.google.protobuf.MapField<String, String>
    internalGetMutableUserLabels() {
      onChanged();;
      if (userLabels_ == null) {
        userLabels_ = com.google.protobuf.MapField.newMapField(
            UserLabelsDefaultEntryHolder.defaultEntry);
      }
      if (!userLabels_.isMutable()) {
        userLabels_ = userLabels_.copy();
      }
      return userLabels_;
    }

    public int getUserLabelsCount() {
      return internalGetUserLabels().getMap().size();
    }
    /**
     *

     * Output only. A map of user-defined metadata labels.
     *

     *
     * map<string, string> user_labels = 2;
     */

    public boolean containsUserLabels(
        String key) {
      if (key == null) { throw new NullPointerException(); }
      return internalGetUserLabels().getMap().containsKey(key);
    }
    /**
     * Use {@link #getUserLabelsMap()} instead.
     */
    @Deprecated
    public java.util.Map<String, String> getUserLabels() {
      return getUserLabelsMap();
    }
    /**
     *

     * Output only. A map of user-defined metadata labels.
     *

     *
     * map<string, string> user_labels = 2;
     */

    public java.util.Map<String, String> getUserLabelsMap() {
      return internalGetUserLabels().getMap();
    }
    /**
     *

     * Output only. A map of user-defined metadata labels.
     *

     *
     * map<string, string> user_labels = 2;
     */

    public String getUserLabelsOrDefault(
        String key,
        String defaultValue) {
      if (key == null) { throw new NullPointerException(); }
      java.util.Map<String, String> map =
          internalGetUserLabels().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *

     * Output only. A map of user-defined metadata labels.
     *

     *
     * map<string, string> user_labels = 2;
     */

    public String getUserLabelsOrThrow(
        String key) {
      if (key == null) { throw new NullPointerException(); }
      java.util.Map<String, String> map =
          internalGetUserLabels().getMap();
      if (!map.containsKey(key)) {
        throw new IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearUserLabels() {
      internalGetMutableUserLabels().getMutableMap()
          .clear();
      return this;
    }
    /**
     *

     * Output only. A map of user-defined metadata labels.
     *

     *
     * map<string, string> user_labels = 2;
     */

    public Builder removeUserLabels(
        String key) {
      if (key == null) { throw new NullPointerException(); }
      internalGetMutableUserLabels().getMutableMap()
          .remove(key);
      return this;
    }
    /**
     * Use alternate mutation accessors instead.
     */
    @Deprecated
    public java.util.Map<String, String>
    getMutableUserLabels() {
      return internalGetMutableUserLabels().getMutableMap();
    }
    /**
     *

     * Output only. A map of user-defined metadata labels.
     *

     *
     * map<string, string> user_labels = 2;
     */
    public Builder putUserLabels(
        String key,
        String value) {
      if (key == null) { throw new NullPointerException(); }
      if (value == null) { throw new NullPointerException(); }
      internalGetMutableUserLabels().getMutableMap()
          .put(key, value);
      return this;
    }
    /**
     *

     * Output only. A map of user-defined metadata labels.
     *

     *
     * map<string, string> user_labels = 2;
     */

    public Builder putAllUserLabels(
        java.util.Map<String, String> values) {
      internalGetMutableUserLabels().getMutableMap()
          .putAll(values);
      return this;
    }
    @Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

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

    // @@protoc_insertion_point(builder_scope:google.api.MonitoredResourceMetadata)
  }

  // @@protoc_insertion_point(class_scope:google.api.MonitoredResourceMetadata)
  private static final MonitoredResourceMetadata DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new MonitoredResourceMetadata();
  }

  public static MonitoredResourceMetadata getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<MonitoredResourceMetadata>
      PARSER = new com.google.protobuf.AbstractParser<MonitoredResourceMetadata>() {
    @Override
    public MonitoredResourceMetadata parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new MonitoredResourceMetadata(input, extensionRegistry);
    }
  };

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

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

  @Override
  public MonitoredResourceMetadata getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}


text:
layout: pattern
category: form
name: checkboxes
---
<form action="/" method="post">
  <fieldset>
    <legend>Horizontaly aligned checkboxes with labels</legend>
    <label for="checkbox1">
      <input type="checkbox" id="checkbox1" name="checkbox1" checked /> Checked checkbox 1
    </label>
    <label for="checkbox2">
      <input type="checkbox" id="checkbox2" name="checkbox2" /> Checkbox 2
    </label>
    <label for="checkbox3">
      <input type="checkbox" id="checkbox3" name="checkbox3" disabled /> Disabled Checkbox 3
    </label>
  </fieldset>
</form>

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2010-2017 Evolveum and contributors
  ~
  ~ This work is dual-licensed under the Apache License 2.0
  ~ and European Union Public License. See LICENSE file for details.
  -->
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:ws="http://jax-ws.dev.java.net/spring/core" xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="
     http://www.springframework.org/schema/jee
     http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
     http://www.springframework.org/schema/beans
     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
     http://www.springframework.org/schema/context
     http://www.springframework.org/schema/context/spring-context-3.0.xsd
     http://www.springframework.org/schema/aop
     http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
     http://jax-ws.dev.java.net/spring/core
     https://jax-ws.dev.java.net/spring/core.xsd
     http://jax-ws.dev.java.net/spring/servlet
     https://jax-ws.dev.java.net/spring/servlet.xsd"
    default-lazy-init="false" default-autowire="byName">

    <import resource="ctx-model.xml"/>
    <import resource="ctx-model-test.xml"/>
    <import resource="ctx-model-common.xml"/>
    <import resource="ctx-provisioning.xml"/>
    <import resource="ctx-samples-test.xml"/>
    <import resource="ctx-task.xml"/>
    <import resource="ctx-repo-common.xml"/>
    <import resource="ctx-common.xml"/>
    <import resource="ctx-audit.xml"/>
    <import resource="ctx-security-enforcer.xml"/>
    <import resource="ctx-security.xml"/>
    <import resource="classpath*:ctx-repository-test.xml"/>
    <import resource="ctx-repo-cache.xml"/>
    <import resource="ctx-configuration-test.xml"/>

</beans>


text:
using System;
using System.Security.Claims;
using CVaS.DAL.Model;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using CVaS.BL.Providers;

namespace CVaS.Web.Providers
{
    /// <summary>
    /// Providers currently logger user and
    /// his informations
    /// </summary>
    public class CurrentUserProvider : ICurrentUserProvider
    {
        private readonly UserManager<AppUser> _userManager;
        private readonly IHttpContextAccessor _contextAccessor;
        public CurrentUserProvider(IHttpContextAccessor contextAccessor, UserManager<AppUser> userManager)
        {
            _userManager = userManager;
            _contextAccessor = contextAccessor;
        }

        public int Id => GetId();

        public string UserName => _contextAccessor.HttpContext.User?.Identity?.Name ?? "";

        public ClaimsIdentity ClaimsIdentity => _contextAccessor.HttpContext.User?.Identity as ClaimsIdentity;

        public string DisplayName
        {
            get
            {
                if (ClaimsIdentity == null)
                    throw new UnauthorizedAccessException();

                return
                (ClaimsIdentity?.FindFirst(ClaimTypes.GivenName).Value + " " +
                    ClaimsIdentity?.FindFirst(ClaimTypes.Surname).Value).Trim();

            }
        }

        public string Email => ClaimsIdentity?.FindFirst(ClaimTypes.Email).Value ?? string.Empty;

        public bool Exists => _contextAccessor.HttpContext.User.Identity?.IsAuthenticated ?? false;

        public int? TryGetId
        {
            get
            {
                var user = _userManager.GetUserId(_contextAccessor.HttpContext.User);

                if (user == null)
                    return null;

                return int.Parse(user);
            }
        }

        public bool IsInRole(string roleName)
        {
            return _contextAccessor.HttpContext.User?.IsInRole(roleName) ?? false;
        }

        public ClaimsPrincipal GetClaims()
        {
            return _contextAccessor.HttpContext.User;
        }

        private int GetId()
        {
            var id = TryGetId;
            if (!id.HasValue)
            {
                throw new UnauthorizedAccessException();
            }
            return id.Value;
        }
    }
}


text:
#include <stdlib.h>
#include "cairoint.h"

/* private functions */

static cairo_status_t
_cairo_polygon_grow_by (cairo_polygon_t *polygon, int additional);

void
_cairo_polygon_init (cairo_polygon_t *polygon)
{
    polygon->num_edges = 0;

    polygon->edges_size = 0;
    polygon->edges = NULL;

    polygon->has_current_point = 0;
}

void
_cairo_polygon_fini (cairo_polygon_t *polygon)
{
    if (polygon->edges_size) {
	free (polygon->edges);
	polygon->edges = NULL;
	polygon->edges_size = 0;
	polygon->num_edges = 0;
    }

    polygon->has_current_point = 0;
}

static cairo_status_t
_cairo_polygon_grow_by (cairo_polygon_t *polygon, int additional)
{
    cairo_edge_t *new_edges;
    int old_size = polygon->edges_size;
    int new_size = polygon->num_edges + additional;

    if (new_size <= polygon->edges_size) {
	return CAIRO_STATUS_SUCCESS;
    }

    polygon->edges_size = new_size;
    new_edges = realloc (polygon->edges, polygon->edges_size * sizeof (cairo_edge_t));

    if (new_edges == NULL) {
	polygon->edges_size = old_size;
	return CAIRO_STATUS_NO_MEMORY;
    }

    polygon->edges = new_edges;

    return CAIRO_STATUS_SUCCESS;
}

cairo_status_t
_cairo_polygon_add_edge (cairo_polygon_t *polygon, cairo_point_t *p1, cairo_point_t *p2)
{
    cairo_status_t status;
    cairo_edge_t *edge;

    /* drop horizontal edges */
    if (p1->y == p2->y) {
	goto DONE;
    }

    if (polygon->num_edges >= polygon->edges_size) {
	int additional = polygon->edges_size ? polygon->edges_size : 16;
	status = _cairo_polygon_grow_by (polygon, additional);
	if (status) {
	    return status;
	}
    }

    edge = &polygon->edges[polygon->num_edges];
    if (p1->y < p2->y) {
	edge->edge.p1 = *p1;
	edge->edge.p2 = *p2;
	edge->clockWise = 1;
    } else {
	edge->edge.p1 = *p2;
	edge->edge.p2 = *p1;
	edge->clockWise = 0;
    }

    polygon->num_edges++;

  DONE:
    _cairo_polygon_move_to (polygon, p2);

    return CAIRO_STATUS_SUCCESS;
}

cairo_status_t
_cairo_polygon_move_to (cairo_polygon_t *polygon, cairo_point_t *point)
{
    if (! polygon->has_current_point)
	polygon->first_point = *point;
    polygon->current_point = *point;
    polygon->has_current_point = 1;

    return CAIRO_STATUS_SUCCESS;
}

cairo_status_t
_cairo_polygon_line_to (cairo_polygon_t *polygon, cairo_point_t *point)
{
    cairo_status_t status = CAIRO_STATUS_SUCCESS;

    if (polygon->has_current_point) {
	status = _cairo_polygon_add_edge (polygon, &polygon->current_point, point);
    } else {
	_cairo_polygon_move_to (polygon, point);
    }

    return status;
}

cairo_status_t
_cairo_polygon_close (cairo_polygon_t *polygon)
{
    cairo_status_t status;

    if (polygon->has_current_point) {
	status = _cairo_polygon_add_edge (polygon,
					  &polygon->current_point,
					  &polygon->first_point);
	if (status)
	    return status;

	polygon->has_current_point = 0;
    }

    return CAIRO_STATUS_SUCCESS;
}


text:
<?php

namespace Ndewez\WebHome\CommonBundle;

use Ndewez\WebHome\CommonBundle\DependencyInjection\MenuCompilerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
 * Class NdewezWebHomeCommonBundle.
 */
class NdewezWebHomeCommonBundle extends Bundle
{
    /**
     * {@inheritDoc}
     */
    public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new MenuCompilerPass());
    }
}


text:
%--- help for trnd ---
%
% TRND   Random arrays from Student's t distribution.
%    R = TRND(V) returns an array of random numbers chosen from Student's t
%    distribution with V degrees of freedom.  The size of R is the size of
%    V.
%
%    R = TRND(V,M,N,...) or R = TRND(V,[M,N,...]) returns an M-by-N-by-...
%    array.
%
%    The t distribution with one degree of freedom is also known as the
%    Cauchy distribution.
%
%    See also TCDF, TINV, TPDF, TSTAT, NCTRND, RANDOM.
%
%    Reference page in Doc Center
%       doc trnd
%
%


text:
/* A Bison parser, made by GNU Bison 3.0.2.  */

/* Bison interface for Yacc-like parsers in C

   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.

   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

#ifndef YY_YY_YYSCRIPT_H_INCLUDED
# define YY_YY_YYSCRIPT_H_INCLUDED
/* Debug traces.  */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif

/* Token type.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
  enum yytokentype
  {
    PLUSEQ = 258,
    MINUSEQ = 259,
    MULTEQ = 260,
    DIVEQ = 261,
    LSHIFTEQ = 262,
    RSHIFTEQ = 263,
    ANDEQ = 264,
    OREQ = 265,
    OROR = 266,
    ANDAND = 267,
    EQ = 268,
    NE = 269,
    LE = 270,
    GE = 271,
    LSHIFT = 272,
    RSHIFT = 273,
    UNARY = 274,
    STRING = 275,
    QUOTED_STRING = 276,
    INTEGER = 277,
    ABSOLUTE = 278,
    ADDR = 279,
    ALIGN_K = 280,
    ALIGNOF = 281,
    ASSERT_K = 282,
    AS_NEEDED = 283,
    AT = 284,
    BIND = 285,
    BLOCK = 286,
    BYTE = 287,
    CONSTANT = 288,
    CONSTRUCTORS = 289,
    COPY = 290,
    CREATE_OBJECT_SYMBOLS = 291,
    DATA_SEGMENT_ALIGN = 292,
    DATA_SEGMENT_END = 293,
    DATA_SEGMENT_RELRO_END = 294,
    DEFINED = 295,
    DSECT = 296,
    ENTRY = 297,
    EXCLUDE_FILE = 298,
    EXTERN = 299,
    FILL = 300,
    FLOAT = 301,
    FORCE_COMMON_ALLOCATION = 302,
    GLOBAL = 303,
    GROUP = 304,
    HLL = 305,
    INCLUDE = 306,
    INHIBIT_COMMON_ALLOCATION = 307,
    INFO = 308,
    INPUT = 309,
    KEEP = 310,
    LEN = 311,
    LENGTH = 312,
    LOADADDR = 313,
    LOCAL = 314,
    LONG = 315,
    MAP = 316,
    MAX_K = 317,
    MEMORY = 318,
    MIN_K = 319,
    NEXT = 320,
    NOCROSSREFS = 321,
    NOFLOAT = 322,
    NOLOAD = 323,
    ONLY_IF_RO = 324,
    ONLY_IF_RW = 325,
    ORG = 326,
    ORIGIN = 327,
    OUTPUT = 328,
    OUTPUT_ARCH = 329,
    OUTPUT_FORMAT = 330,
    OVERLAY = 331,
    PHDRS = 332,
    PROVIDE = 333,
    PROVIDE_HIDDEN = 334,
    QUAD = 335,
    SEARCH_DIR = 336,
    SECTIONS = 337,
    SEGMENT_START = 338,
    SHORT = 339,
    SIZEOF = 340,
    SIZEOF_HEADERS = 341,
    SORT_BY_ALIGNMENT = 342,
    SORT_BY_NAME = 343,
    SPECIAL = 344,
    SQUAD = 345,
    STARTUP = 346,
    SUBALIGN = 347,
    SYSLIB = 348,
    TARGET_K = 349,
    TRUNCATE = 350,
    VERSIONK = 351,
    OPTION = 352,
    PARSING_LINKER_SCRIPT = 353,
    PARSING_VERSION_SCRIPT = 354,
    PARSING_DEFSYM = 355,
    PARSING_DYNAMIC_LIST = 356
  };
#endif
/* Tokens.  */
#define PLUSEQ 258
#define MINUSEQ 259
#define MULTEQ 260
#define DIVEQ 261
#define LSHIFTEQ 262
#define RSHIFTEQ 263
#define ANDEQ 264
#define OREQ 265
#define OROR 266
#define ANDAND 267
#define EQ 268
#define NE 269
#define LE 270
#define GE 271
#define LSHIFT 272
#define RSHIFT 273
#define UNARY 274
#define STRING 275
#define QUOTED_STRING 276
#define INTEGER 277
#define ABSOLUTE 278
#define ADDR 279
#define ALIGN_K 280
#define ALIGNOF 281
#define ASSERT_K 282
#define AS_NEEDED 283
#define AT 284
#define BIND 285
#define BLOCK 286
#define BYTE 287
#define CONSTANT 288
#define CONSTRUCTORS 289
#define COPY 290
#define CREATE_OBJECT_SYMBOLS 291
#define DATA_SEGMENT_ALIGN 292
#define DATA_SEGMENT_END 293
#define DATA_SEGMENT_RELRO_END 294
#define DEFINED 295
#define DSECT 296
#define ENTRY 297
#define EXCLUDE_FILE 298
#define EXTERN 299
#define FILL 300
#define FLOAT 301
#define FORCE_COMMON_ALLOCATION 302
#define GLOBAL 303
#define GROUP 304
#define HLL 305
#define INCLUDE 306
#define INHIBIT_COMMON_ALLOCATION 307
#define INFO 308
#define INPUT 309
#define KEEP 310
#define LEN 311
#define LENGTH 312
#define LOADADDR 313
#define LOCAL 314
#define LONG 315
#define MAP 316
#define MAX_K 317
#define MEMORY 318
#define MIN_K 319
#define NEXT 320
#define NOCROSSREFS 321
#define NOFLOAT 322
#define NOLOAD 323
#define ONLY_IF_RO 324
#define ONLY_IF_RW 325
#define ORG 326
#define ORIGIN 327
#define OUTPUT 328
#define OUTPUT_ARCH 329
#define OUTPUT_FORMAT 330
#define OVERLAY 331
#define PHDRS 332
#define PROVIDE 333
#define PROVIDE_HIDDEN 334
#define QUAD 335
#define SEARCH_DIR 336
#define SECTIONS 337
#define SEGMENT_START 338
#define SHORT 339
#define SIZEOF 340
#define SIZEOF_HEADERS 341
#define SORT_BY_ALIGNMENT 342
#define SORT_BY_NAME 343
#define SPECIAL 344
#define SQUAD 345
#define STARTUP 346
#define SUBALIGN 347
#define SYSLIB 348
#define TARGET_K 349
#define TRUNCATE 350
#define VERSIONK 351
#define OPTION 352
#define PARSING_LINKER_SCRIPT 353
#define PARSING_VERSION_SCRIPT 354
#define PARSING_DEFSYM 355
#define PARSING_DYNAMIC_LIST 356

/* Value type.  */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{
#line 53 "yyscript.y" /* yacc.c:1909  */

  /* A string.  */
  struct Parser_string string;
  /* A number.  */
  uint64_t integer;
  /* An expression.  */
  Expression_ptr expr;
  /* An output section header.  */
  struct Parser_output_section_header output_section_header;
  /* An output section trailer.  */
  struct Parser_output_section_trailer output_section_trailer;
  /* A section constraint.  */
  enum Section_constraint constraint;
  /* A complete input section specification.  */
  struct Input_section_spec input_section_spec;
  /* A list of wildcard specifications, with exclusions.  */
  struct Wildcard_sections wildcard_sections;
  /* A single wildcard specification.  */
  struct Wildcard_section wildcard_section;
  /* A list of strings.  */
  String_list_ptr string_list;
  /* Information for a program header.  */
  struct Phdr_info phdr_info;
  /* Used for version scripts and within VERSION {}.  */
  struct Version_dependency_list* deplist;
  struct Version_expression_list* versyms;
  struct Version_tree* versnode;
  enum Script_section_type section_type;

#line 286 "yyscript.h" /* yacc.c:1909  */
};
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif

int yyparse (void* closure);

#endif /* !YY_YY_YYSCRIPT_H_INCLUDED  */


text:
package com.cloudera.oryx.app.serving.rdf.model;

import javax.xml.bind.JAXBException;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.typesafe.config.Config;
import org.dmg.pmml.PMML;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.cloudera.oryx.api.KeyMessage;
import com.cloudera.oryx.api.serving.ServingModelManager;
import com.cloudera.oryx.app.rdf.RDFPMMLUtils;
import com.cloudera.oryx.app.rdf.predict.CategoricalPrediction;
import com.cloudera.oryx.app.rdf.predict.NumericPrediction;
import com.cloudera.oryx.app.rdf.tree.DecisionForest;
import com.cloudera.oryx.app.rdf.tree.TerminalNode;
import com.cloudera.oryx.app.schema.CategoricalValueEncodings;
import com.cloudera.oryx.app.schema.InputSchema;
import com.cloudera.oryx.common.collection.Pair;
import com.cloudera.oryx.common.pmml.PMMLUtils;

/**
 * A {@link ServingModelManager} that manages and provides access to an {@link RDFServingModel}
 * for the random decision forest Serving Layer application.
 */
public final class RDFServingModelManager implements ServingModelManager<String> {

  private static final Logger log = LoggerFactory.getLogger(RDFServingModelManager.class);
  private static final ObjectMapper MAPPER = new ObjectMapper();

  private final InputSchema inputSchema;
  private RDFServingModel model;

  public RDFServingModelManager(Config config) {
    inputSchema = new InputSchema(config);
  }

  /**
   * Called by the framework to initiate a continuous process of reading models, and reading
   * from the input topic and updating model state in memory, and issuing updates to the
   * update topic. This will be executed asynchronously and may block.
   *
   * @param updateIterator iterator to read models from
   * @throws IOException if an error occurs while reading updates
   */
  @Override
  public void consume(Iterator<KeyMessage<String, String>> updateIterator) throws IOException {
    while (updateIterator.hasNext()) {
      KeyMessage<String, String> km = updateIterator.next();
      String key = km.getKey();
      String message = km.getMessage();
      switch (key) {
        case "UP":
          if (model == null) {
            continue; // No model to interpret with yet, so skip it
          }

          DecisionForest forest = model.getForest();
          List<?> update = MAPPER.readValue(message, List.class);
          int treeID = Integer.parseInt(update.get(0).toString());
          String nodeID = update.get(1).toString();

          if (inputSchema.isClassification()) {
            TerminalNode nodeToUpdate = (TerminalNode) forest.getTrees()[treeID].findByID(nodeID);
            CategoricalPrediction predictionToUpdate =
                (CategoricalPrediction) nodeToUpdate.getPrediction();
            @SuppressWarnings("unchecked")
            Map<Integer,Integer> counts = (Map<Integer,Integer>) update.get(2);
            for (Map.Entry<?,?> entry : counts.entrySet()) {
              int encoding = Integer.parseInt(entry.getKey().toString());
              int count = Integer.parseInt(entry.getValue().toString());
              predictionToUpdate.update(encoding, count);
            }
          } else {
            TerminalNode nodeToUpdate = (TerminalNode) forest.getTrees()[treeID].findByID(nodeID);
            NumericPrediction predictionToUpdate = (NumericPrediction) nodeToUpdate.getPrediction();
            double mean = Double.parseDouble(update.get(2).toString());
            int count = Integer.parseInt(update.get(3).toString());
            predictionToUpdate.update(mean, count);
          }

          break;

        case "MODEL":
          log.info("Loading new model");
          // New model
          PMML pmml;
          try {
            pmml = PMMLUtils.fromString(message);
          } catch (JAXBException e) {
            throw new IOException(e);
          }
          RDFPMMLUtils.validatePMMLVsSchema(pmml, inputSchema);
          Pair<DecisionForest,CategoricalValueEncodings> forestAndEncodings =
              RDFPMMLUtils.read(pmml);
          model = new RDFServingModel(forestAndEncodings.getFirst(),
                                      forestAndEncodings.getSecond(),
                                      inputSchema);
          break;

        default:
          throw new IllegalStateException("Unexpected key " + key);
      }
    }
  }

  @Override
  public RDFServingModel getModel() {
    return model;
  }

  @Override
  public void close() {
    // do nothing
  }

}


text:
/**
 * A backend for http that uses the `XMLHttpRequest` browser API.
 *
 * Take care not to evaluate this in non-browser contexts.
 */
export declare class BrowserXhr {
    constructor();
    build(): any;
}


text:
"use strict";

const Attribute = require('./attribute');
const Field = require('../../queryApi/field');

/**
 * An Attribute representing a floating point number.
 * @class
 * @extends Defiant.Plugin.Orm.Attribute
 * @memberOf Defiant.Plugin.Orm
 */
class Float extends Attribute {
  /**
   * Returns the schema of the table.
   * @function
   * @returns {Object}
   *   A description of the table.
   */
  schema() {
    let schema = super.schema();
    schema.columns.push({
      name: 'value',
      dataType: 'DOUBLE',
      notNull: false,
      unique: false,
    });
    return schema;
  }

  /**
   * Return an array of keys that the Attribute should check that, if the value
   * has changed, then a new revision must be created.
   * @function
   * @returns {String[]}
   *   The names of values that need to be checked in order to realize that the
   *   a new revision must be created.
   */
  keysToCheckForChange() {
    return super.keysToCheckForChange().concat(['value']);
  }

  /**
   * Return the list of fields available for use in a query by the
   * [QueryAPI]{@link Defiant.Plugin.QueryApi}.
   * @function
   * @returns {Map<String,Defiant.Plugin.QueryApi.Field>}
   *   Key/value pairs representing the queryable fields.
   */
  getQueryFields() {
    let fields = super.getQueryFields();
    fields[this.attributeName] = new Field(this.engine, {
      tableName: this.id,
      fieldName: 'value',
    });
    return fields;
  }
}

module.exports = Float;


text:
require 'bundler'

Bundler.require(:default, :test)

Dir.glob(File.join(File.dirname(__FILE__), 'support', '**', '*.rb')).each do |f|
  require f
end


text:
import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring

_ = PluginInternationalization('Weather')

def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Weather', True)

Weather = conf.registerPlugin('Weather')
conf.registerGlobalValue(Weather, 'apiKey',
    registry.String('', ("""Sets the API key for the plugin. You can obtain an API key at http://www.wunderground.com/weather/api/."""), private=True))
conf.registerChannelValue(Weather, 'useImperial',
    registry.Boolean(True, ("""Determines whether imperial units (Fahrenheit, etc.) will be used.""")))
conf.registerGlobalValue(Weather,'forecast',
    registry.Boolean(True, ("""Determines whether forecasts will be displayed by default.""")))
conf.registerGlobalValue(Weather,'alerts',
    registry.Boolean(False, ("""Determines whether forecasts will be displayed by default.""")))
conf.registerGlobalValue(Weather, 'almanac',
    registry.Boolean(False, ("""Determines whether almanac will be displayed by default.""")))
conf.registerGlobalValue(Weather, 'astronomy',
    registry.Boolean(False, ("""Determines whether astronomy will be displayed by default.""")))
conf.registerGlobalValue(Weather, 'showPressure',
    registry.Boolean(False, ("""Determines whether pressure will be displayed by default.""")))
conf.registerGlobalValue(Weather, 'showWind',
    registry.Boolean(False, ("""Determines whether winde will be displayed by default.""")))
conf.registerGlobalValue(Weather, 'showUpdated',
    registry.Boolean(False, ("""Determines whether the bot will show the data's "last updated" time by default.""")))
conf.registerGlobalValue(Weather, 'lang',
    registry.String('EN', ("""Determines the language used by the plugin.""")))
conf.registerChannelValue(Weather, 'disableColoredTemp',
    registry.Boolean(False, """If True, this will disable coloring temperatures based on values."""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=250:


text:
package com.chinthaka.imagesimilarity.test

import java.io.{File, FileNotFoundException, IOException}

import com.chinthaka.imagesimilarity.util.{ColorHistogram, Histogram1D}
import org.bytedeco.javacpp.opencv_core._
import org.bytedeco.javacpp.opencv_imgcodecs._
object OpenCVTester {

  private val colorReductionFactor = 32
  private val hist = new ColorHistogram()

  def main(args: Array[String]) {

//    System.loadLibrary(Core.NATIVE_LIBRARY_NAME)

    val referenceImageFile = new File("/Users/eran/Downloads/ImageSearch/108103_sm.jpg")
    val reference = loadOrExit(referenceImageFile, CV_LOAD_IMAGE_COLOR)

    val hist = new Histogram1D(16)
    val histArray: Array[Float] = hist.getHistogramAsArray(reference)
    println(histArray.mkString(","))

  }

  def loadOrExit(file: File, flags: Int = CV_LOAD_IMAGE_GRAYSCALE): Mat = {
    // Verify file
    if (!file.exists()) {
      throw new FileNotFoundException("Image file does not exist: " + file.getAbsolutePath)
    }
    // Read input image
    val image = imread(file.getAbsolutePath, flags)
    if (image == null) {
      throw new IOException("Couldn't load image: " + file.getAbsolutePath)
    }
    image
  }

}