text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/networkconnectivity/v1alpha1/hub.proto

package com.google.cloud.networkconnectivity.v1alpha1;

/**
 *
 *
 *

 * The response for [HubService.ListSpokes][google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes].
 *

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

  private ListSpokesResponse() {
    spokes_ = java.util.Collections.emptyList();
    nextPageToken_ = "";
    unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

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

  @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.networkconnectivity.v1alpha1.HubProto
        .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.networkconnectivity.v1alpha1.HubProto
        .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.class,
            com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.Builder.class);
  }

  public static final int SPOKES_FIELD_NUMBER = 1;
  private java.util.List<com.google.cloud.networkconnectivity.v1alpha1.Spoke> spokes_;
  /**
   *
   *
   *

   * Spokes to be returned.
   *

   *
   * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.networkconnectivity.v1alpha1.Spoke> getSpokesList() {
    return spokes_;
  }
  /**
   *
   *
   *

   * Spokes to be returned.
   *

   *
   * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder>
      getSpokesOrBuilderList() {
    return spokes_;
  }
  /**
   *
   *
   *

   * Spokes to be returned.
   *

   *
   * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
   */
  @java.lang.Override
  public int getSpokesCount() {
    return spokes_.size();
  }
  /**
   *
   *
   *

   * Spokes to be returned.
   *

   *
   * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
   */
  @java.lang.Override
  public com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpokes(int index) {
    return spokes_.get(index);
  }
  /**
   *
   *
   *

   * Spokes to be returned.
   *

   *
   * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
   */
  @java.lang.Override
  public com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder getSpokesOrBuilder(
      int index) {
    return spokes_.get(index);
  }

  public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2;
  private volatile java.lang.Object nextPageToken_;
  /**
   *
   *
   *

   * The next pagination token in the List response. It should be used as
   * page_token for the following request. An empty value means no more result.
   *

   *
   * string next_page_token = 2;
   *
   * @return The nextPageToken.
   */
  @java.lang.Override
  public java.lang.String getNextPageToken() {
    java.lang.Object ref = nextPageToken_;
    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();
      nextPageToken_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * The next pagination token in the List response. It should be used as
   * page_token for the following request. An empty value means no more result.
   *

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

  public static final int UNREACHABLE_FIELD_NUMBER = 3;
  private com.google.protobuf.LazyStringList unreachable_;
  /**
   *
   *
   *

   * Locations that could not be reached.
   *

   *
   * repeated string unreachable = 3;
   *
   * @return A list containing the unreachable.
   */
  public com.google.protobuf.ProtocolStringList getUnreachableList() {
    return unreachable_;
  }
  /**
   *
   *
   *

   * Locations that could not be reached.
   *

   *
   * repeated string unreachable = 3;
   *
   * @return The count of unreachable.
   */
  public int getUnreachableCount() {
    return unreachable_.size();
  }
  /**
   *
   *
   *

   * Locations that could not be reached.
   *

   *
   * repeated string unreachable = 3;
   *
   * @param index The index of the element to return.
   * @return The unreachable at the given index.
   */
  public java.lang.String getUnreachable(int index) {
    return unreachable_.get(index);
  }
  /**
   *
   *
   *

   * Locations that could not be reached.
   *

   *
   * repeated string unreachable = 3;
   *
   * @param index The index of the value to return.
   * @return The bytes of the unreachable at the given index.
   */
  public com.google.protobuf.ByteString getUnreachableBytes(int index) {
    return unreachable_.getByteString(index);
  }

  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 {
    for (int i = 0; i < spokes_.size(); i++) {
      output.writeMessage(1, spokes_.get(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
    }
    for (int i = 0; i < unreachable_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i));
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    for (int i = 0; i < spokes_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, spokes_.get(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < unreachable_.size(); i++) {
        dataSize += computeStringSizeNoTag(unreachable_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getUnreachableList().size();
    }
    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.networkconnectivity.v1alpha1.ListSpokesResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse other =
        (com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse) obj;

    if (!getSpokesList().equals(other.getSpokesList())) return false;
    if (!getNextPageToken().equals(other.getNextPageToken())) return false;
    if (!getUnreachableList().equals(other.getUnreachableList())) 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();
    if (getSpokesCount() > 0) {
      hash = (37 * hash) + SPOKES_FIELD_NUMBER;
      hash = (53 * hash) + getSpokesList().hashCode();
    }
    hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER;
    hash = (53 * hash) + getNextPageToken().hashCode();
    if (getUnreachableCount() > 0) {
      hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER;
      hash = (53 * hash) + getUnreachableList().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse 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.networkconnectivity.v1alpha1.ListSpokesResponse parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse 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.networkconnectivity.v1alpha1.ListSpokesResponse parseFrom(
      byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

  public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse 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.networkconnectivity.v1alpha1.ListSpokesResponse parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse 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.networkconnectivity.v1alpha1.ListSpokesResponse parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse 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.networkconnectivity.v1alpha1.ListSpokesResponse 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;
  }
  /**
   *
   *
   *

   * The response for [HubService.ListSpokes][google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes].
   *

   *
   * Protobuf type {@code google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse)
      com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.networkconnectivity.v1alpha1.HubProto
          .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.networkconnectivity.v1alpha1.HubProto
          .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.class,
              com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.Builder.class);
    }

    // Construct using com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (spokesBuilder_ == null) {
        spokes_ = java.util.Collections.emptyList();
      } else {
        spokes_ = null;
        spokesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000001);
      nextPageToken_ = "";

      unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.networkconnectivity.v1alpha1.HubProto
          .internal_static_google_cloud_networkconnectivity_v1alpha1_ListSpokesResponse_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse
        getDefaultInstanceForType() {
      return com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse buildPartial() {
      com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse result =
          new com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse(this);
      int from_bitField0_ = bitField0_;
      if (spokesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          spokes_ = java.util.Collections.unmodifiableList(spokes_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.spokes_ = spokes_;
      } else {
        result.spokes_ = spokesBuilder_.build();
      }
      result.nextPageToken_ = nextPageToken_;
      if (((bitField0_ & 0x00000002) != 0)) {
        unreachable_ = unreachable_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.unreachable_ = unreachable_;
      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.networkconnectivity.v1alpha1.ListSpokesResponse) {
        return mergeFrom((com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(
        com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse other) {
      if (other
          == com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse.getDefaultInstance())
        return this;
      if (spokesBuilder_ == null) {
        if (!other.spokes_.isEmpty()) {
          if (spokes_.isEmpty()) {
            spokes_ = other.spokes_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureSpokesIsMutable();
            spokes_.addAll(other.spokes_);
          }
          onChanged();
        }
      } else {
        if (!other.spokes_.isEmpty()) {
          if (spokesBuilder_.isEmpty()) {
            spokesBuilder_.dispose();
            spokesBuilder_ = null;
            spokes_ = other.spokes_;
            bitField0_ = (bitField0_ & ~0x00000001);
            spokesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getSpokesFieldBuilder()
                    : null;
          } else {
            spokesBuilder_.addAllMessages(other.spokes_);
          }
        }
      }
      if (!other.getNextPageToken().isEmpty()) {
        nextPageToken_ = other.nextPageToken_;
        onChanged();
      }
      if (!other.unreachable_.isEmpty()) {
        if (unreachable_.isEmpty()) {
          unreachable_ = other.unreachable_;
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          ensureUnreachableIsMutable();
          unreachable_.addAll(other.unreachable_);
        }
        onChanged();
      }
      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:
              {
                com.google.cloud.networkconnectivity.v1alpha1.Spoke m =
                    input.readMessage(
                        com.google.cloud.networkconnectivity.v1alpha1.Spoke.parser(),
                        extensionRegistry);
                if (spokesBuilder_ == null) {
                  ensureSpokesIsMutable();
                  spokes_.add(m);
                } else {
                  spokesBuilder_.addMessage(m);
                }
                break;
              } // case 10
            case 18:
              {
                nextPageToken_ = input.readStringRequireUtf8();

                break;
              } // case 18
            case 26:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensureUnreachableIsMutable();
                unreachable_.add(s);
                break;
              } // case 26
            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 int bitField0_;

    private java.util.List<com.google.cloud.networkconnectivity.v1alpha1.Spoke> spokes_ =
        java.util.Collections.emptyList();

    private void ensureSpokesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        spokes_ =
            new java.util.ArrayList<com.google.cloud.networkconnectivity.v1alpha1.Spoke>(spokes_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.networkconnectivity.v1alpha1.Spoke,
            com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder,
            com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder>
        spokesBuilder_;

    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public java.util.List<com.google.cloud.networkconnectivity.v1alpha1.Spoke> getSpokesList() {
      if (spokesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(spokes_);
      } else {
        return spokesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public int getSpokesCount() {
      if (spokesBuilder_ == null) {
        return spokes_.size();
      } else {
        return spokesBuilder_.getCount();
      }
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public com.google.cloud.networkconnectivity.v1alpha1.Spoke getSpokes(int index) {
      if (spokesBuilder_ == null) {
        return spokes_.get(index);
      } else {
        return spokesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public Builder setSpokes(int index, com.google.cloud.networkconnectivity.v1alpha1.Spoke value) {
      if (spokesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSpokesIsMutable();
        spokes_.set(index, value);
        onChanged();
      } else {
        spokesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public Builder setSpokes(
        int index, com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder builderForValue) {
      if (spokesBuilder_ == null) {
        ensureSpokesIsMutable();
        spokes_.set(index, builderForValue.build());
        onChanged();
      } else {
        spokesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public Builder addSpokes(com.google.cloud.networkconnectivity.v1alpha1.Spoke value) {
      if (spokesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSpokesIsMutable();
        spokes_.add(value);
        onChanged();
      } else {
        spokesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public Builder addSpokes(int index, com.google.cloud.networkconnectivity.v1alpha1.Spoke value) {
      if (spokesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSpokesIsMutable();
        spokes_.add(index, value);
        onChanged();
      } else {
        spokesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public Builder addSpokes(
        com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder builderForValue) {
      if (spokesBuilder_ == null) {
        ensureSpokesIsMutable();
        spokes_.add(builderForValue.build());
        onChanged();
      } else {
        spokesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public Builder addSpokes(
        int index, com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder builderForValue) {
      if (spokesBuilder_ == null) {
        ensureSpokesIsMutable();
        spokes_.add(index, builderForValue.build());
        onChanged();
      } else {
        spokesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public Builder addAllSpokes(
        java.lang.Iterable<? extends com.google.cloud.networkconnectivity.v1alpha1.Spoke> values) {
      if (spokesBuilder_ == null) {
        ensureSpokesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, spokes_);
        onChanged();
      } else {
        spokesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public Builder clearSpokes() {
      if (spokesBuilder_ == null) {
        spokes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        spokesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public Builder removeSpokes(int index) {
      if (spokesBuilder_ == null) {
        ensureSpokesIsMutable();
        spokes_.remove(index);
        onChanged();
      } else {
        spokesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder getSpokesBuilder(int index) {
      return getSpokesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder getSpokesOrBuilder(
        int index) {
      if (spokesBuilder_ == null) {
        return spokes_.get(index);
      } else {
        return spokesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public java.util.List<? extends com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder>
        getSpokesOrBuilderList() {
      if (spokesBuilder_ != null) {
        return spokesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(spokes_);
      }
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder addSpokesBuilder() {
      return getSpokesFieldBuilder()
          .addBuilder(com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance());
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder addSpokesBuilder(int index) {
      return getSpokesFieldBuilder()
          .addBuilder(
              index, com.google.cloud.networkconnectivity.v1alpha1.Spoke.getDefaultInstance());
    }
    /**
     *
     *
     *

     * Spokes to be returned.
     *

     *
     * repeated .google.cloud.networkconnectivity.v1alpha1.Spoke spokes = 1;
     */
    public java.util.List<com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder>
        getSpokesBuilderList() {
      return getSpokesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.networkconnectivity.v1alpha1.Spoke,
            com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder,
            com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder>
        getSpokesFieldBuilder() {
      if (spokesBuilder_ == null) {
        spokesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.networkconnectivity.v1alpha1.Spoke,
                com.google.cloud.networkconnectivity.v1alpha1.Spoke.Builder,
                com.google.cloud.networkconnectivity.v1alpha1.SpokeOrBuilder>(
                spokes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
        spokes_ = null;
      }
      return spokesBuilder_;
    }

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

     * The next pagination token in the List response. It should be used as
     * page_token for the following request. An empty value means no more result.
     *

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

     * The next pagination token in the List response. It should be used as
     * page_token for the following request. An empty value means no more result.
     *

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

     * The next pagination token in the List response. It should be used as
     * page_token for the following request. An empty value means no more result.
     *

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

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

     * The next pagination token in the List response. It should be used as
     * page_token for the following request. An empty value means no more result.
     *

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

      nextPageToken_ = getDefaultInstance().getNextPageToken();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * The next pagination token in the List response. It should be used as
     * page_token for the following request. An empty value means no more result.
     *

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

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

    private com.google.protobuf.LazyStringList unreachable_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureUnreachableIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_);
        bitField0_ |= 0x00000002;
      }
    }
    /**
     *
     *
     *

     * Locations that could not be reached.
     *

     *
     * repeated string unreachable = 3;
     *
     * @return A list containing the unreachable.
     */
    public com.google.protobuf.ProtocolStringList getUnreachableList() {
      return unreachable_.getUnmodifiableView();
    }
    /**
     *
     *
     *

     * Locations that could not be reached.
     *

     *
     * repeated string unreachable = 3;
     *
     * @return The count of unreachable.
     */
    public int getUnreachableCount() {
      return unreachable_.size();
    }
    /**
     *
     *
     *

     * Locations that could not be reached.
     *

     *
     * repeated string unreachable = 3;
     *
     * @param index The index of the element to return.
     * @return The unreachable at the given index.
     */
    public java.lang.String getUnreachable(int index) {
      return unreachable_.get(index);
    }
    /**
     *
     *
     *

     * Locations that could not be reached.
     *

     *
     * repeated string unreachable = 3;
     *
     * @param index The index of the value to return.
     * @return The bytes of the unreachable at the given index.
     */
    public com.google.protobuf.ByteString getUnreachableBytes(int index) {
      return unreachable_.getByteString(index);
    }
    /**
     *
     *
     *

     * Locations that could not be reached.
     *

     *
     * repeated string unreachable = 3;
     *
     * @param index The index to set the value at.
     * @param value The unreachable to set.
     * @return This builder for chaining.
     */
    public Builder setUnreachable(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureUnreachableIsMutable();
      unreachable_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Locations that could not be reached.
     *

     *
     * repeated string unreachable = 3;
     *
     * @param value The unreachable to add.
     * @return This builder for chaining.
     */
    public Builder addUnreachable(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureUnreachableIsMutable();
      unreachable_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Locations that could not be reached.
     *

     *
     * repeated string unreachable = 3;
     *
     * @param values The unreachable to add.
     * @return This builder for chaining.
     */
    public Builder addAllUnreachable(java.lang.Iterable<java.lang.String> values) {
      ensureUnreachableIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_);
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Locations that could not be reached.
     *

     *
     * repeated string unreachable = 3;
     *
     * @return This builder for chaining.
     */
    public Builder clearUnreachable() {
      unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Locations that could not be reached.
     *

     *
     * repeated string unreachable = 3;
     *
     * @param value The bytes of the unreachable to add.
     * @return This builder for chaining.
     */
    public Builder addUnreachableBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureUnreachableIsMutable();
      unreachable_.add(value);
      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.networkconnectivity.v1alpha1.ListSpokesResponse)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse)
  private static final com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse
      DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse();
  }

  public static com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse
      getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ListSpokesResponse> PARSER =
      new com.google.protobuf.AbstractParser<ListSpokesResponse>() {
        @java.lang.Override
        public ListSpokesResponse 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<ListSpokesResponse> parser() {
    return PARSER;
  }

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

  @java.lang.Override
  public com.google.cloud.networkconnectivity.v1alpha1.ListSpokesResponse
      getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}


text:
package java.awt;

/**
  * This class if for combining checkboxes into groups so that only
  * one checkbox in the group can be selected at any one time.
  *
  * @author Aaron M. Renn (arenn@urbanophile.com)
  * @author Tom Tromey (tromey@redhat.com)
  */
public class CheckboxGroup implements java.io.Serializable
{

/*
 * Static Variables
 */

// Serialization constant
private static final long serialVersionUID = 3729780091441768983L;

/*************************************************************************/

/*
 * Instance Variables
 */

/**
  * @serial The currently selected checkbox.
  */
private Checkbox selectedCheckbox;

/*************************************************************************/

/*
 * Constructors
 */

/**
  * Initializes a new instance of CheckboxGroup.
  */
public
CheckboxGroup()
{
}

/*************************************************************************/

/*
 * Instance Methods
 */

/**
  * Returns the currently selected checkbox, or null if none
  * of the checkboxes in this group are selected.
  *
  * @return The selected checkbox.
  */
public Checkbox
getSelectedCheckbox()
{
  return getCurrent ();
}

/*************************************************************************/

/**
  * Returns the currently selected checkbox, or null if none
  * of the checkboxes in this group are selected.
  *
  * @return The selected checkbox.
  *
  * @deprecated This method is deprecated in favor of
  * getSelectedCheckbox().
  */
public Checkbox
getCurrent()
{
  return(selectedCheckbox);
}

/*************************************************************************/

/**
  * This method sets the specified checkbox to be the selected on in this
  * group, and unsets all others.
  *
  * @param selectedCheckbox The new selected checkbox.
  */
public void
setSelectedCheckbox(Checkbox selectedCheckbox)
{
  setCurrent (selectedCheckbox);
}

/*************************************************************************/

/**
  * This method sets the specified checkbox to be the selected on in this
  * group, and unsets all others.
  *
  * @param selectedCheckbox The new selected checkbox.
  *
  * @deprecated This method is deprecated in favor of
  * setSelectedCheckbox().
  */
public void
setCurrent(Checkbox selectedCheckbox)
{
  if (this.selectedCheckbox != null)
    {
      if (this.selectedCheckbox.getCheckboxGroup() != this)
        return;

      this.selectedCheckbox.setState(false);
    }

  this.selectedCheckbox = selectedCheckbox;
  if (selectedCheckbox != null)
    selectedCheckbox.setState(true);
}

/*************************************************************************/

/**
  * Returns a string representation of this checkbox group.
  *
  * @return A string representation of this checkbox group.
  */
public String
toString()
{
  return(getClass().getName() + "[selectedCheckbox=" + selectedCheckbox + "]");
}

} // class CheckboxGroup

redpajama_set_name: RedPajamaGithub


text:
import argparse
import json
import os
import sys

from common import file, console

if os.path.exists("./install/install.lock"):
    if json.loads(file.read_file("./install/install.lock"))["install"] == "docker" and not os.environ.get(
            'DOCKER_CONTAINER', False):
            args = ""
            for arg in sys.argv[1:]:
                args = args + " " + arg
            result_code = os.system(
                "docker run -it --rm -v {0}:/home/silverblog silverblog/silverblog ./manage.py{1}".format(
                os.getcwd(), args))
            if (result_code >> 8) == 127:
                console.log("Error", "Please install docker or upgrade the current docker image and try again.")
            exit(result_code)
if __name__ == '__main__':
    if not os.path.exists("./config/page.json") or not os.path.exists("./config/menu.json"):
        console.log("Error", "Please execute the installation wizard first.")
        exit(1)
    if not os.path.exists("./config/system.json"):
        from manage import setting

        setting.setup_wizard()
        setting.theme_manage()
        exit(0)

    if len(sys.argv) == 1:
        from manage import menu
        menu.use_whiptail_mode()
        exit(0)
    parser = argparse.ArgumentParser("SilverBlog management tool")
    parser.add_argument("command", help="The name of the function to execute.", )

    #new
    new_parser = parser.add_argument_group('new', "Create a new article.")
    new_parser.add_argument("-c", "--config", help="The configuration file location you want to load.", type=str)
    new_parser.add_argument("-i", "--independent", help="Generate an article that does not appear in the article list.",
                            action="store_true")

    parser.add_argument_group('update', "Update article metadata.")

    upgrade_parser = parser.add_argument_group('upgrade', "Upgrade program.")
    upgrade_parser.add_argument("-y", "--yes", help="Assume yes for all questions, do not ask.", action="store_true")
    parser.add_argument_group('setting', "Setting program.")
    parser.add_argument_group('qrcode', "Output client qrcode.")
    #build-gh-page
    parser.add_argument_group("build-page", "Generate static pages.")
    theme_group = parser.add_argument_group("install_theme")
    theme_group.add_argument("--name", help="Install the theme in the official repository.", type=str)
    theme_group.add_argument("--custom", help="Install the theme of the custom repository.", type=str)
    parser.add_argument_group("backup", "Back up the current data.")
    args = parser.parse_args()
    system_config = json.loads(file.read_file("./config/system.json"))
    try:
        if args.command == "setting":
            from manage import setting

            setting.setting_menu(True)
            exit(0)

        if args.command == "qrcode":
            from common import install_module

            install_module.install_and_import("qrcode_terminal")
            import qrcode_terminal

            control_config = json.loads(file.read_file("./config/control.json"))

            if len(control_config["password"]) == 0 or len(system_config["Project_URL"]) == 0:
                console.log("Error", "Check the API_Password and Project_URL configuration items")
                exit(1)
            password = control_config["password"]
            console.log("Info", "Please use the client to scan the following QR Code")
            url = system_config["Project_URL"].replace("https://", "").replace("http://", "")
            config_json = json.dumps({"H": url, "P": password})
            qrcode_terminal.draw(config_json)
            exit(0)

        if args.command == "upgrade":
            from manage import upgrade

            is_git = False
            if upgrade.check_is_git():
                if upgrade.upgrade_check():
                    start_to_pull="n"
                    if not args.yes:
                        start_to_pull = input('Find new version, do you want to upgrade? [y/N]')
                    if start_to_pull.lower() == 'yes' or start_to_pull.lower() == 'y' or args.yes:
                        upgrade.upgrade_pull()
                is_git = True
            if not is_git:
                console.log("Info", "No upgrade found")
            upgrade.upgrade_env()
            upgrade.upgrade_data()
            exit(0)

        if args.command == "backup":
            from manage import backup

            backup.backup()
            exit(0)

        if args.command == "install_theme":
            custom = False
            name = args.name
            if args.custom is not None:
                custom = True
                name = args.custom
            from manage import theme
            theme.install_theme(name, custom)
            exit(0)

        if args.command == "build-page":
            from manage import build_static_page
            build_static_page.publish()
            exit(0)

        from manage import build_rss, post_manage, get
        if args.command == "new":
            config = None
            name=""
            title=""
            if args.config is not None:
                config = json.loads(file.read_file(args.config))
            if config is None:
                print("Please enter the title of the article:")
                title = input().strip()
                if len(title) == 0:
                    console.log("Error", "The title can not be blank.")
                    exit(1)
                name = get.get_name(title, system_config["Pinyin"])
                print("Please enter the slug [{}]:".format(name))
                name2 = input().strip()
                if len(name2) != 0:
                    name = get.filter_name(name2)
                if os.path.exists("./document/{}.md".format(name)):
                    console.log("Error", "File [./document/{}.md] already exists".format(name))
                    exit(1)
            if len(name) != 0 and len(title) != 0:
                config = {"title": title, "name": name}
                post_manage.new_post(config, args.independent)
                build_rss.build_rss()
            exit(0)

        if args.command == "update":
            if post_manage.update_post():
                build_rss.build_rss()
            exit(0)

    except KeyboardInterrupt:
        print("User cancelled operation.")
        exit(0)
    parser.print_help()


text:
package com.jalat.description;

import com.jalat.error.IncorectBehaviorDetectedException;
import com.jalat.util.InitializeOnlyOnce;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

/**
 * Scenario description
 *
 * @author Andrey Paslavsky
 * @since 0.1
 */
public final class ScenarioDescription implements InitializeOnlyOnce {
    private String name;
    private Collection<UseCaseDescription> useCases = new ArrayList<>();
    private PreConditionDescription preCondition;
    private PostConditionDescription postCondition;
    private CharSequence[] description;
    private long duration = -1;

    public void addUseCase(UseCaseDescription useCaseDescription) {
        useCases.add(useCaseDescription);
    }

    public Collection<UseCaseDescription> getUseCases() {
        return Collections.unmodifiableCollection(useCases);
    }

    public String getName() {
        return name;
    }

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

    public PreConditionDescription getPreCondition() {
        return preCondition;
    }

    public PostConditionDescription getPostCondition() {
        return postCondition;
    }

    public void setPreCondition(PreConditionDescription preCondition) {
        this.preCondition = initOnce(preCondition, this.preCondition, () ->
                new IncorectBehaviorDetectedException("Allowed only one pre-condition"));
    }

    public void setPostCondition(PostConditionDescription postCondition) {
        this.postCondition = initOnce(postCondition, this.postCondition, () ->
                new IncorectBehaviorDetectedException("Allowed only one post-condition"));
    }

    public void setDescription(CharSequence[] description) {
        this.description = description;
    }

    public CharSequence[] getDescription() {
        return description;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }
}


text:
namespace MindEngine.Core.Scene.Widget.Property
{
    using System;
    using Microsoft.Xna.Framework;
    using Util;

    internal interface IMMImageProperty : ICloneable
    {
        string ImageName { get; set; }

        Color ImageBaseColor { get; set; }

        Color ImageColor(byte opacity);

        byte ImageOpacity { get; set; }
    }

    public class MMImageProperty : IMMImageProperty
    {
        public string ImageName { get; set; }

        public byte ImageOpacity { get; set; } = byte.MaxValue;

        public Color ImageBaseColor { get; set; } = Color.White;

        public Color ImageColor(byte opacity)
        {
            return this.ImageBaseColor.MakeTransparent(opacity);
        }

        public object Clone()
        {
            var clone = (MMImageProperty)this.MemberwiseClone();

            clone.ImageName = string.Copy(this.ImageName);

            return clone;
        }
    }
}


text:
namespace ui {

FilteredGestureProvider::TouchHandlingResult::TouchHandlingResult()
    : succeeded(false), moved_beyond_slop_region(false) {
}

FilteredGestureProvider::FilteredGestureProvider(
    const GestureProvider::Config& config,
    GestureProviderClient* client)
    : client_(client),
      gesture_provider_(std::make_unique<GestureProvider>(config, this)),
      gesture_filter_(this),
      handling_event_(false),
      any_touch_moved_beyond_slop_region_(false) {}

FilteredGestureProvider::~FilteredGestureProvider() = default;

void FilteredGestureProvider::UpdateConfig(
    const GestureProvider::Config& config) {
  gesture_provider_ = std::make_unique<ui::GestureProvider>(config, this);
}

FilteredGestureProvider::TouchHandlingResult
FilteredGestureProvider::OnTouchEvent(const MotionEvent& event) {
  DCHECK(!handling_event_);
  base::AutoReset<bool> handling_event(&handling_event_, true);

  pending_gesture_packet_ = GestureEventDataPacket::FromTouch(event);

  if (event.GetAction() == MotionEvent::Action::DOWN)
    any_touch_moved_beyond_slop_region_ = false;

  if (!gesture_provider_->OnTouchEvent(event))
    return TouchHandlingResult();

  TouchDispositionGestureFilter::PacketResult filter_result =
      gesture_filter_.OnGesturePacket(pending_gesture_packet_);
  if (filter_result != TouchDispositionGestureFilter::SUCCESS) {
    NOTREACHED() << "Invalid touch gesture sequence detected.";
    return TouchHandlingResult();
  }

  TouchHandlingResult result;
  result.succeeded = true;
  result.moved_beyond_slop_region = any_touch_moved_beyond_slop_region_;
  return result;
}

void FilteredGestureProvider::OnTouchEventAck(
    uint32_t unique_event_id,
    bool event_consumed,
    bool is_source_touch_event_set_non_blocking) {
  gesture_filter_.OnTouchEventAck(unique_event_id, event_consumed,
                                  is_source_touch_event_set_non_blocking);
}

void FilteredGestureProvider::ResetGestureHandlingState() {
  gesture_filter_.ResetGestureHandlingState();
}

void FilteredGestureProvider::ResetDetection() {
  gesture_provider_->ResetDetection();
}

void FilteredGestureProvider::SetMultiTouchZoomSupportEnabled(
    bool enabled) {
  gesture_provider_->SetMultiTouchZoomSupportEnabled(enabled);
}

void FilteredGestureProvider::SetDoubleTapSupportForPlatformEnabled(
    bool enabled) {
  gesture_provider_->SetDoubleTapSupportForPlatformEnabled(enabled);
}

void FilteredGestureProvider::SetDoubleTapSupportForPageEnabled(bool enabled) {
  gesture_provider_->SetDoubleTapSupportForPageEnabled(enabled);
}

const ui::MotionEvent* FilteredGestureProvider::GetCurrentDownEvent() const {
  return gesture_provider_->current_down_event();
}

void FilteredGestureProvider::OnGestureEvent(const GestureEventData& event) {
  if (handling_event_) {
    if (event.details.type() == ui::ET_GESTURE_SCROLL_BEGIN)
      any_touch_moved_beyond_slop_region_ = true;

    pending_gesture_packet_.Push(event);
    return;
  }

  gesture_filter_.OnGesturePacket(
      GestureEventDataPacket::FromTouchTimeout(event));
}

bool FilteredGestureProvider::RequiresDoubleTapGestureEvents() const {
  return client_->RequiresDoubleTapGestureEvents();
}

void FilteredGestureProvider::ForwardGestureEvent(
    const GestureEventData& event) {
  client_->OnGestureEvent(event);
}

}  // namespace ui


text:
<?php
namespace tests\codeception\_pages\activity;

/**
 * Represents project activity update page
 */
class UpdatePage extends FormPageFragment
{
    public $route = 'project-activity/update';

    public static $headingText = 'Update Project Activity: ';
}


text:
//using Microsoft.VisualStudio.TestTools.UnitTesting;
//using SQLDatabase.Extensions;
//using System;
//using System.Data.SqlClient;
//using System.Threading.Tasks;

//namespace SQLDatabase.Tests
//{
//    [TestClass]
//    public class TransactionClass
//    {
//        internal static async Task DoWithTransactionAsync(Func<Transaction, Task> action)
//        {
//            await ConnectionProviderClass.DoWithConnectionAsync(async connection =>
//            {
//                using (var transaction = new Transaction(ConnectionProviderClass.CreateConnectionProvider()))
//                    await action(transaction);
//            });
//        }

//        [TestClass]
//        public class CommitMethod
//        {
//            [TestMethod]
//            public async Task NotCommittedUntilCalled()
//            {
//                await DoWithTransactionAsync(async transaction =>
//                {
//                    var identifier = Guid.NewGuid().ToByteArray();
//                    using (var command = transaction.CreateCommand())
//                    {
//                        command.CommandText = "insert into identifiers(hex) values (@hex)";
//                        command.Parameters.AddWithValue("@hex", identifier);
//                        var numAffected = await command.ExecuteNonQueryAsync();
//                        Assert.AreEqual(1, numAffected);

//                        // The transaction has not yet been committed
//                        await DoWithTransactionAsync(async transaction2 =>
//                        {
//                            var count = await transaction2.GetAsync<int>("select count(*) from identifiers with (readpast) where hex = @hex", new SqlParameter("@hex", identifier));
//                            Assert.AreEqual(0, count);
//                        });
//                    }
//                });
//            }
//        }

//        [TestClass]
//        public class CreateCommandMethod
//        {
//            [TestMethod]
//            public async Task CreatesCommand()
//            {
//                await DoWithTransactionAsync(async transaction =>
//                {
//                    await Task.Run(() =>
//                    {
//                        using (var command = transaction.CreateCommand())
//                            Assert.IsNotNull(command);
//                    });
//                });
//            }

//            [TestMethod]
//            public async Task CreatesCommandThatIsInATransaction()
//            {
//                await DoWithTransactionAsync(async transaction =>
//                {
//                    await Task.Run(() =>
//                    {
//                        using (var command = transaction.CreateCommand())
//                            Assert.IsNotNull(command?.Transaction);
//                    });
//                });
//            }
//        }
//    }
//}


text:
export interface MergeResult {
	updated: number;
	removed: number;
	inserted: number;
}

export interface MergeSettings {
	equals: (l: any, r: any) => boolean;
	update: (l: any, r: any, left: any[], i: number) => void;
	remove: (l: any, left: any, i: number) => void;
	insert: (r: any, left: any) => void;
}

export declare function merge(settings: MergeSettings):
	(left: any[], right: any[], result: any[]) => MergeResult;


text:
Stop a running pipeline.

### Synopsis

Stop a running pipeline.

```
pachctl stop pipeline <pipeline> [flags]
```

### Options

```
  -h, --help   help for pipeline
```

### Options inherited from parent commands

```
      --no-color   Turn off colors.
  -v, --verbose    Output verbose logs
```


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SE.DSP.Pop.Entity
{
    public class SingleLineDiagram
    {
        public SingleLineDiagram()
        {
        }

        public SingleLineDiagram(long hierarchyId, string description, int order, string createUser)
        {
            this.HierarchyId = hierarchyId;
            this.Description = description;
            this.Order = order;
            this.CreateTime = DateTime.Now;
            this.CreateUser = createUser;
        }

        public long Id { get; set; }

        public long HierarchyId { get; set; }

        public string Description { get; set; }

        public int Order { get; set; }

        public DateTime CreateTime { get; set; }

        public string CreateUser { get; set; }
    }
}


text:
'''
Fullcontacter: A wrapper for the excellent and helpful Fullcontact.com APIs
Fullcontacter version 0.3

Provides the exposed API for the Fullcontacter module. This should be considered alpha.
Future versions of this API will be different and more featureful.

'''

from lookup import lookup_request
import logging

#initialize logging.
logging.basicConfig(filename='fullcontacter.log', level=logging.INFO, format='%(asctime)s %(message)s')

class fullcontacterError():
    pass

class personLookup(object):
    '''look up person by email/phone/twitter/facebook via fullcontact's paid person api'''

    def __init__(self, api_key):
        self.api_key = api_key

    def lookitup(self, lookup_value, lookup_type, format='.json'):
        '''
          Valid lookup types are email,twitter,phone,facebookUsername
          Phone numbers should be formatted +country code area code number
          (ie +13035555555)
        '''

        if lookup_type == 'email':
            person_data = lookup_request('person', format, self.api_key, email=lookup_value)
        elif lookup_type == 'twitter':
            person_data = lookup_request('person', format, self.api_key, twitter=lookup_value)
        elif lookup_type == 'phone':
            person_data = lookup_request('person', format, self.api_key, phone=lookup_value)
        elif lookup_type == 'facebookUsername':
            person_data = lookup_request('person', format, self.api_key, facebookUsername=lookup_value)
        else:
            logging.info('ERROR unknown lookup type: ' + lookup_type)
            raise fullcontacterError()
            print 'Unknown lookup type'

        logging.info('url created ' + person_data['url'])
        logging.info(str(lookup_type) + ': ' + str(lookup_value))

        return person_data['lookup']

class nameStats(object):
    '''look up a name, first and/or last name via fullcontact's free name api'''

    def __init__(self, api_key):
        self.api_key = api_key

    def lookitup(self, fname=None, lname=None, name=None, format='.json'):

        name_data = lookup_request('name/stats', format, self.api_key,
                    givenName=fname, familyName=lname, name=name)

        logging.info('url created ' + name_data['url'])

        return name_data['lookup']


text:
import torch
from ogb.graphproppred import Evaluator

def train_epoch_sparse(model, optimizer, device, data_loader, epoch):
    model.train()
    epoch_loss = 0
    list_scores = []
    list_labels = []
    for iter, (batch_graphs, batch_labels) in enumerate(data_loader):
        batch_x = batch_graphs.ndata['feat'].to(device)  # num x feat
        batch_labels = batch_labels.to(device)
        optimizer.zero_grad()
        batch_scores = model.forward(batch_graphs, batch_x)
        loss = model.loss(batch_scores, batch_labels)
        loss.backward()
        optimizer.step()
        epoch_loss += loss.detach().item()
        list_scores.append(batch_scores.detach())
        list_labels.append(batch_labels.detach().unsqueeze(-1))

    epoch_loss /= (iter + 1)
    evaluator = Evaluator(name='ogbg-molhiv')
    epoch_train_ROC = evaluator.eval({'y_pred': torch.cat(list_scores),
                                       'y_true': torch.cat(list_labels)})['rocauc']

    return epoch_loss, epoch_train_ROC, optimizer

def evaluate_network_sparse(model, device, data_loader, epoch):
    model.eval()
    epoch_test_loss = 0
    epoch_test_ROC = 0
    with torch.no_grad():
        list_scores = []
        list_labels = []
        for iter, (batch_graphs, batch_labels) in enumerate(data_loader):
            batch_x = batch_graphs.ndata['feat'].to(device)
            batch_labels = batch_labels.to(device)
            batch_scores = model.forward(batch_graphs, batch_x)
            loss = model.loss(batch_scores, batch_labels)
            epoch_test_loss += loss.detach().item()
            list_scores.append(batch_scores.detach())
            list_labels.append(batch_labels.detach().unsqueeze(-1))

        epoch_test_loss /= (iter + 1)
        evaluator = Evaluator(name='ogbg-molhiv')
        epoch_test_ROC = evaluator.eval({'y_pred': torch.cat(list_scores),
                                           'y_true': torch.cat(list_labels)})['rocauc']

    return epoch_test_loss, epoch_test_ROC


text:
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Runtime.InteropServices;
using TroutDash.EntityFramework.Models;

namespace TroutDash.Export
{
    public class JsonExporter : IJsonExporter
    {
        Random rand = new Random();
        private string[] Messages = new string[]
        {
            "Flood",
            "Warm",
            "Closed",
            "Dry",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            ""

        };
        private readonly TroutDashPrototypeContext _context;

        public JsonExporter(TroutDashPrototypeContext context)
        {
            _context = context;
        }

        public IEnumerable<RegionDetails> GetRegionDetails()
        {
            foreach (var region in _context.regions.Include(x => x.counties).ToList())
            {
                var r = new RegionDetails();
                r.RegionName = region.name;
                r.RegionId = region.gid;

                foreach (var county in region.counties.Where(c => c.stream.Any()).ToList())
                {
                    var c = new CountyDetails();
                    c.CountyName = county.name;
                    if (county.name == "Scott")
                    {

                    }
                    c.CountyId = county.gid;
                    c.StateId = county.state.gid;
                    c.StateName = county.state.Name;

                    var streams = RemoveSmallStreams(county.stream).ToList();
                    var streamDetails = GetStreamDetails(streams).OrderBy(i => i.Name).ToList();
                    c.Streams = streamDetails;

                    r.Counties.Add(c);
                }

                yield return r;
            }
        }

        public IEnumerable<StreamDetails> GetStreamDetails()
        {
            var allStreams = _context.streams.Where(s => s.state == "Minnesota").ToList();
            var streams = RemoveSmallStreams(allStreams);
            foreach (var streamDetails in GetStreamDetails(streams))
            {
                yield return streamDetails;
            }
        }

        private static List<stream> RemoveSmallStreams(IEnumerable<stream> allStreams)
        {
            var streams =
                allStreams.Where(s => (s.name.IndexOf("Unnamed", StringComparison.Ordinal) >= 0 && s.length_mi < 0.2M) == false)
                    .Where(s => (s.length_mi < 0.3M) == false).ToList();
            return streams;
        }

        private IEnumerable<StreamDetails> GetStreamDetails(List<stream> streams)
        {
            foreach (var stream in streams)
            {
                var details = CreateStreamDetails(stream);

                if (details.TroutStreamsLength < 0.2M)
                {
                    continue;
                }

                yield return details;
            }
        }

        private StreamDetails CreateStreamDetails(stream s)
        {
            var d = new StreamDetails();
            d.Id = s.gid;
            d.Name = s.name;
            d.LengthMiles = decimal.Round(s.length_mi, 2, MidpointRounding.AwayFromZero);
            d.HasBrookTrout = s.has_brook_trout;
            d.HasBrownTrout = s.has_brown_trout;
            d.HasRainbowTrout = s.has_rainbow_trout;
            d.HasStockedBrookTrout = s.is_brook_trout_stocked;
            d.HasStockedRainbowTrout = s.is_rainbow_trout_stocked;
            d.HasStockedBrownTrout = s.is_brown_trout_stocked;
            d.CentroidLatitude = decimal.Round(s.centroid_latitude, 5, MidpointRounding.AwayFromZero); // s.centroid_latitude;
            d.CentroidLongitude = decimal.Round(s.centroid_longitude, 5, MidpointRounding.AwayFromZero); //s.centroid_longitude;

            var roll = rand.Next(0, Messages.Length - 1);
            d.AlertMessage = Messages[roll];
            d.Counties = s.counties.Select(i => new StreamDetails.CountyModel
            {
                Id = i.gid,
                Name = i.name
            }).ToArray();

            var localNames = s.trout_stream_sections.Select(i => i.section_name).Where(i => i != d.Name).ToList();
            if (String.IsNullOrWhiteSpace(s.local_name) == false)
            {
                localNames.Add(s.local_name);
            }
            d.LocalNames = localNames.ToArray();

            if (d.LocalNames.Any())
            {
                var priorAltNames = d.LocalNames.ToArray();
                var priorCount = priorAltNames.Count();
                // remove substring duplicates. West Beaver Creek vs Beaver Creek
                // we may want to change this.
                var x = d.LocalNames.Distinct().Where(name => d.Name.IndexOf(name, StringComparison.OrdinalIgnoreCase) < 0
                    || name.IndexOf(d.Name, StringComparison.OrdinalIgnoreCase) < 0).ToArray();

                // if primary name is "unnamed", then remove all alternative names with "unnamed".
                if (d.Name.IndexOf("Unnamed", StringComparison.OrdinalIgnoreCase) >= 0)
                {
                    x = x.Where(i => i.IndexOf("Unnamed", StringComparison.OrdinalIgnoreCase) < 0).ToArray();
                }

                d.LocalNames = x;

                var currentCount = d.LocalNames.Count();
                if (currentCount != priorCount)
                {

                }
            }

            var pal = s.publicly_accessible_land_section2.ToList();
            var palCollection = new PalCollection();
            palCollection.Sections = pal.Select(pa => new PalSection()
            {
                Start = decimal.Round(pa.start, 3, MidpointRounding.AwayFromZero),
                Stop = decimal.Round(pa.stop, 3, MidpointRounding.AwayFromZero),
            }).ToList();

            palCollection.Id = 0;
            palCollection.IsFederal = false;
            palCollection.Name = String.Empty;
            palCollection.Type = String.Empty;

            d.Pal = palCollection;

            var lakeSections = s.lake_sections.ToList();
            var lakeCollection = new LakeCollection();
            lakeCollection.Sections = lakeSections.Select(l => new LakeSection
            {
                Start = decimal.Round(l.start, 3, MidpointRounding.AwayFromZero), //l.start,
                Stop = decimal.Round(l.stop, 3, MidpointRounding.AwayFromZero),
                Name = _context.lakes.Single(la => la.gid == l.lake_gid).name,
                LakeId = l.lake_gid
            }).ToList();

            d.Lakes = lakeCollection;

            var troutStreamSections = s.trout_stream_sections.ToList();
            var troutStream = new TroutStreamCollection();
            troutStream.Name = s.name;
            troutStream.ParentStream = s.gid;
            troutStream.Sections = troutStreamSections.Select(t => new TroutStreamSection
            {
                Start = decimal.Round(t.start, 3, MidpointRounding.AwayFromZero), //t.start,
                Stop = decimal.Round(t.stop, 3, MidpointRounding.AwayFromZero), //t.stop
            }).ToList();
            d.TroutStreams = troutStream;

            d.Restrictions = GetRestrictionSections(s).ToList();

            return d;

        }

        private IEnumerable<RestrictionCollection> GetRestrictionSections(stream s)
        {
            var restrictionSections = s.restriction_section.GroupBy(r => r.restriction).ToList();

            foreach (var restrictionSection in restrictionSections)
            {
                var restrictionCollection = new RestrictionCollection();
                restriction restrictionType = restrictionSection.Key;
                restrictionCollection.FullText = restrictionType.legal_text;
                restrictionCollection.ShortText = restrictionType.short_text;
                restrictionCollection.Id = restrictionType.id;

                var x  = restrictionSection.Select(i => new RestrictionSection
                {
                    Start = decimal.Round((decimal)i.start, 3, MidpointRounding.AwayFromZero),
                    Stop = decimal.Round((decimal)i.stop, 3, MidpointRounding.AwayFromZero)
                }).ToList();

                var numberOfSections = x.Count;

                var shortSections = x.Where(i =>
                {
//                    var isStartOrEnd = i.Start == 0.0M || NearlyEquals(i.Stop, s.length_mi, 0.001M);
//                    if (isStartOrEnd == false)
//                    {
//                        return true;
//                    }

                    var length = Math.Abs(i.Stop - i.Start);
                    var isTooShort = length < 0.02M;
                    var isTooFewSections = numberOfSections <= 1;

                    if (isTooShort)
                    {
                        if (isTooFewSections)
                        {
                            return false;
                        }
                    }

                    return true;
                }).ToList();

                if (shortSections.Any() == false)
                {
                    continue;
                }

                restrictionCollection.Sections = shortSections;

                yield return restrictionCollection;
            }

        }

        private static bool NearlyEquals(decimal value1, decimal value2, decimal unimportantDifference = 0.0001M)
        {
            if (value1 != value2)
            {
                return Math.Abs(value1 - value2) < unimportantDifference;
            }

            return true;
        }
    }
}


text:
{% extends "sentry/bases/explore.html" %}

{% load i18n %}
{% load sentry_helpers %}
{% load sentry_plugins %}

{% block title %}Users | {{ block.super }}{% endblock %}

{% block inner %}
    {% paginator tag_list from request as tag_list %}
    {% querystring from request without sort as sort_querystring %}

            {% blocktrans with sort_label as label %}Sort by: {{ label }}{% endblocktrans %}

{{ SORT_OPTIONS.recent }}

{{ SORT_OPTIONS.newest }}

{{ SORT_OPTIONS.events }}

            {% trans "Previous" %}
            {% trans "Next" %}

    {% if not tag_list.paginator.objects %}

{% blocktrans %}You dont seem to have any user data recorded. For more information on how to send this information consult your client's documentation.{% endblocktrans %}

    {% else %}

                    {% trans "User" %}
                    {% trans "Last Seen" %}
                    {% trans "Events Seen" %}

                {% for tag in tag_list.paginator.objects %}

                        {{ tag.get_label }}
                        {{ tag.last_seen|timesince }}
                        {{ tag.times_seen|small_count }}

                {% endfor %}

                {% trans "Previous" %}
                {% trans "Next" %}

    {% endif %}
{% endblock %}


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis.Diagnostics;

namespace Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers
{
    public abstract partial class DiagnosticAnalyzerCorrectnessAnalyzer : DiagnosticAnalyzer
    {
        protected abstract class SyntaxNodeWithinAnalyzerTypeCompilationAnalyzer<TClassDeclarationSyntax, TSyntaxNodeOfInterest> : DiagnosticAnalyzerSymbolAnalyzer
            where TClassDeclarationSyntax : SyntaxNode
            where TSyntaxNodeOfInterest : SyntaxNode
        {
            protected SyntaxNodeWithinAnalyzerTypeCompilationAnalyzer(INamedTypeSymbol diagnosticAnalyzer, INamedTypeSymbol diagnosticAnalyzerAttribute)
                : base(diagnosticAnalyzer, diagnosticAnalyzerAttribute)
            {
            }

            internal IEnumerable<TClassDeclarationSyntax> GetClassDeclarationNodes(INamedTypeSymbol namedType, CancellationToken cancellationToken)
            {
                foreach (SyntaxNode syntax in namedType.DeclaringSyntaxReferences.Select(s => s.GetSyntax(cancellationToken)))
                {
                    if (syntax != null)
                    {
                        TClassDeclarationSyntax classDecl = syntax.FirstAncestorOrSelf<TClassDeclarationSyntax>(ascendOutOfTrivia: false);
                        if (classDecl != null)
                        {
                            yield return classDecl;
                        }
                    }
                }
            }

            protected override void AnalyzeDiagnosticAnalyzer(SymbolAnalysisContext symbolContext)
            {
                var namedType = (INamedTypeSymbol)symbolContext.Symbol;
                IEnumerable<TClassDeclarationSyntax> classDecls = GetClassDeclarationNodes(namedType, symbolContext.CancellationToken);
                foreach (TClassDeclarationSyntax classDecl in classDecls)
                {
                    IEnumerable<TSyntaxNodeOfInterest> syntaxNodes = classDecl.DescendantNodes(n => !(n is TClassDeclarationSyntax) || ReferenceEquals(n, classDecl)).OfType<TSyntaxNodeOfInterest>();
                    if (syntaxNodes.Any())
                    {
                        SemanticModel semanticModel = symbolContext.Compilation.GetSemanticModel(classDecl.SyntaxTree);
                        foreach (TSyntaxNodeOfInterest syntaxNode in syntaxNodes)
                        {
                            AnalyzeNode(symbolContext, syntaxNode, semanticModel);
                        }
                    }
                }
            }

            protected abstract void AnalyzeNode(SymbolAnalysisContext symbolContext, TSyntaxNodeOfInterest syntaxNode, SemanticModel semanticModel);
        }
    }
}


text:
# srtSub: HTML5 Video with single/dual SRT Subtitles.

## Features ##
  * Single/Dual subtitles.
  * Working Alone or with Videojs, etc.
  * Subtitle selector button.
  * Filter and remplace.
  * Work on fullscreen.
  *	Responsive.
  * No outside dependencies.

## Examples ##

### Simple(without configuration) ###

	<!DOCTYPE html>
	<html>
	<head>
		<link rel="stylesheet" type="text/css" href="srtsub.css">
		<script type="text/javascript" src="srtsub.js"></script>
	</head>
	<body>
		<video id="myVideo"  controls preload="auto" width="850" height="364">
			<source src="video.mp4" type='video/mp4'>
			<track src="english.srt" kind="subtitle" label="English" />
		</video>
		<script type="text/javascript">
	  		srtSub.config();
		</script>
	</body>
	</html>

### Simple ###

	<video id="myVideo"  controls preload="auto" width="850" height="364">
		<source src="video.mp4" type='video/mp4'>
	</video>
	<script type="text/javascript">
		var configuration = {
			videoID : 'myVideo',
			subtitles:[
						{
							url:'english.srt',
							label:'English',
							default:true
						},
						{
							url:'france.srt',
							label:'France'
						},
						{
							url:'spanish.srt',
							label:'Spanish'
						}

					]
		}
	  	srtSub.config(configuration);
	</script>

## Full configuration ##

	<video id="myVideo"  controls preload="auto" width="850" height="364">
		<source src="video.mp4" type='video/mp4'>
	</video>
	<script type="text/javascript">
		var configuration = {
			videoID : 'myVideo',
			fontSize : 16, // minimus size.
			filter : ['pokemon','fuc* ***','chubaca'], // filter and...
			replaceF : 'gol', // replace.
			subtitles:[
						{
							url:'english.srt',
							label:'English',
							default:true // dual subtitles
						},
						{
							url:'france.srt',
							label:'France'
							default:true // dual subtitles
						},
						{
							url:'spanish.srt',
							label:'Spanish'
						}

					]
		}
	  	srtSub.config(configuration);
  	</script>

## srtSub + Videjs ##
	var configuration = {
						/* OptionsSrtSub */
						/* Or... noting */
						}
	videojs('really-cool-video', { /* OptionsVideojs */ }, function() {
		srtSub.config(configuration);
	});


text:
@interface UITouch (UniqueID)

- (NSString *)uniqueId;

@end


text:
import wx
import wx.lib.plot as plot
import pysos
import sys
from threading import Lock
import time
import struct

sys.stderr = open("stderr", "w")
EVT_RESULT_ID = wx.NewEventType()

class ResultEvent(wx.PyEvent):
    """Simple event to carry arbitrary result data."""
    def __init__(self, data):
        """Init Result Event."""
        wx.PyEvent.__init__(self)
        self.SetEventType(EVT_RESULT_ID)
        self.data = data

class SensorDataFrame(wx.Frame):
	def __init__(self, parent, id, title):
		wx.Frame.__init__(self, parent, id, title, size=(510, 340))
		self.panel = wx.Panel(self)
		self.Center()
		# Initialize a Box to hold all the graph plots
		self.box = wx.BoxSizer(wx.VERTICAL)
		# Initialize dictionary of graph plots along with corresponding sensor id
		# {sensor id 0 : plot 0, ...}
		self.plotter = {}
		# Initialize dictionary of data along with corresponding sensor id
		# {sensor id 0 : [(x1,y1), (x2,y2), ...], ...}
		self.data = {}
		# Initialize dictionary of timestamps of first data buffer
		# for each sensor
		# {sensor id 0: timestamp, ...}
		self.init_timestamp = {}
		# Configuration variables
		# Header size of sensor data structure in new API
		self.SENSOR_DATA_HDR_SIZE = 8
		# Window size for displaying current data
		self.WINDOW_SIZE = 1024
		# Sample rate in Hz
		self.SAMPLE_RATE = 250
		# Clock frequency of clock utlized for timestamps
		self.TIME_CLOCK_SOURCE = 32768
		# Set the range for y-axis as (lower bound, upper bound)
		self.Y_AXIS_RANGE = (2000, 3000)
		# Internal variables
		self._x_lower = 0
		self._x_upper = 15
		self._rcvLock = Lock()
		# Set event handler for posting data
		self.Connect(-1, -1, EVT_RESULT_ID, self._PlotGraph)

	def CreateGraphs(self, sensorid):
		"""Add all graphs for displaying sensor data.
		sensorid: list of sensor id's corresponding to each plot"""
		for i in range(len(sensorid)):
			# Add a graph plot to list
			self.plotter[sensorid[i]] = plot.PlotCanvas(self.panel)
			#self.plotter.append((sensorid[i], plot.PlotCanvas(self.panel)))
			# Initialize data array for each sensor
			self.data[sensorid[i]] = []
			# Initialize timestamp for each sensor data
			self.init_timestamp[sensorid[i]] = -1
			# Add the above graph plot to the Box
			self.box.Add(self.plotter[sensorid[i]], 1, wx.EXPAND)
		# Add the Box to the panel
		self.panel.SetSizer(self.box)

	def SetWindowSize(self, size):
		"""Set window size of current display"""
		self.WINDOW_SIZE = size

	def SetSampleRate(self, rate):
		"""Set sample rate of sensor data"""
		self.SAMPLE_RATE = rate

	def SetTimeClockSource(self, source):
		"""Set the frequency of clock used for timestamps"""
		self.TIME_CLOCK_SOURCE = source

	def SetYAxisRange(self, lower, upper):
		"""Set the range of Y-axis for display"""
		self.Y_AXIS_RANGE = (lower, upper)

	def ConnectSos(self, host='localhost', port=7915):
		"""Connect to a running SOS server using PySOS and
		   register a listener function for sensor data."""
		# Connect to SOS server
		try:
			self.srv = pysos.sossrv(host, port)
		except IOError:
			print('Could not connect to SOS server..')
			self.Close()
		# Register the listener function
		self.srv.register_trigger(self._GetData, type=0x81)

	def _GetData(self, msg):
		"""Update the graph on receiving sensor data."""
		self._rcvLock.acquire()
		# unpack data to get sensor id
		(status, sensor, num_samples, timestamp) = struct.unpack("<BBHL", msg['data'][:self.SENSOR_DATA_HDR_SIZE])
		sensordata = struct.unpack("<"+num_samples*'H', msg['data'][self.SENSOR_DATA_HDR_SIZE:])
		# Check if this is the first data packet for 'sensor'
		if self.init_timestamp[sensor] < 0:
			self.init_timestamp[sensor] = timestamp
		# Convert timestamp into ms
		t = ((timestamp - self.init_timestamp[sensor]) * 1000.0)/self.TIME_CLOCK_SOURCE
		# add data to its respective array
		for i in range(len(sensordata)):
			self.data[sensor].append((t, sensordata[i]))
			t += (1000.0/self.SAMPLE_RATE)
		# clip data to adjust to the window size
		self.data[sensor][0:max(-self.WINDOW_SIZE, -len(self.data[sensor]))] = []
		# Update the lower and upper bounds for x-axis
		self._x_lower = self.data[sensor][0][0]
		self._x_upper = self.data[sensor][-1][0]
		# Post data to the plotting function
		event = ResultEvent([sensor, self.data[sensor]])
		wx.PostEvent(self, event)
		self._rcvLock.release()

	def _PlotGraph(self, event):
		"""Plot the graph for corresponding sensor data"""
		self._rcvLock.acquire()
		line = plot.PolyLine(event.data[1], colour='red', width=1)
		# To draw markers: default colour = black, size = 2
		# shapes = 'circle', 'cross', 'square', 'dot', 'plus'
		#marker = plot.PolyMarker(event.data[1], marker='triangle')
		# set up text, axis and draw
		#gc = plot.PlotGraphics([line, marker], 'Acceleration (ADC units)', 'x axis', 'y axis')
		gc = plot.PlotGraphics([line], 'Acceleration (ADC units)', 'x axis', 'y axis')
		# Draw graphs for each plot
		self.plotter[event.data[0]].Draw(gc, xAxis=(self._x_lower, self._x_upper), yAxis=self.Y_AXIS_RANGE)
		self._rcvLock.release()

	def __del__(self):
		self._Close()

	def _Close(self):
		"""Cleanup before exit."""
		self.srv.disconnect()
		pass

def __test():
	"""Example usage for 1 axis accelerometer sampling at 250 hz"""
	app = wx.App()
	f = SensorDataFrame(None, -1, "Aceelerometer Data")
	sensorid = [0]
	f.CreateGraphs(sensorid)
	f.SetWindowSize(1024)
	f.SetSampleRate(250)
	f.SetYAxisRange(2250, 2470)
	f.ConnectSos()
	f.Show(True)
	app.MainLoop()

if (__name__ == '__main__'):
	__test()