text:
/*
 * OANDA v20 REST API
 *
 * The full OANDA v20 REST API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
 *
 * OpenAPI spec version: 3.0.15
 * Contact: api@oanda.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;

namespace Oanda.RestV20.Model
{
    /// <summary>
    /// A TrailingStopLossOrderTransaction represents the creation of a TrailingStopLoss Order in the user's Account.
    /// </summary>
    [DataContract]
    public partial class TrailingStopLossOrderTransaction :  IEquatable<TrailingStopLossOrderTransaction>, IValidatableObject
    {
        /// <summary>
        /// The Type of the Transaction. Always set to \"TRAILING_STOP_LOSS_ORDER\" in a TrailingStopLossOrderTransaction.
        /// </summary>
        /// <value>The Type of the Transaction. Always set to \"TRAILING_STOP_LOSS_ORDER\" in a TrailingStopLossOrderTransaction.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum TypeEnum
        {

            /// <summary>
            /// Enum CREATE for "CREATE"
            /// </summary>
            [EnumMember(Value = "CREATE")]
            CREATE,

            /// <summary>
            /// Enum CLOSE for "CLOSE"
            /// </summary>
            [EnumMember(Value = "CLOSE")]
            CLOSE,

            /// <summary>
            /// Enum REOPEN for "REOPEN"
            /// </summary>
            [EnumMember(Value = "REOPEN")]
            REOPEN,

            /// <summary>
            /// Enum CLIENTCONFIGURE for "CLIENT_CONFIGURE"
            /// </summary>
            [EnumMember(Value = "CLIENT_CONFIGURE")]
            CLIENTCONFIGURE,

            /// <summary>
            /// Enum CLIENTCONFIGUREREJECT for "CLIENT_CONFIGURE_REJECT"
            /// </summary>
            [EnumMember(Value = "CLIENT_CONFIGURE_REJECT")]
            CLIENTCONFIGUREREJECT,

            /// <summary>
            /// Enum TRANSFERFUNDS for "TRANSFER_FUNDS"
            /// </summary>
            [EnumMember(Value = "TRANSFER_FUNDS")]
            TRANSFERFUNDS,

            /// <summary>
            /// Enum TRANSFERFUNDSREJECT for "TRANSFER_FUNDS_REJECT"
            /// </summary>
            [EnumMember(Value = "TRANSFER_FUNDS_REJECT")]
            TRANSFERFUNDSREJECT,

            /// <summary>
            /// Enum MARKETORDER for "MARKET_ORDER"
            /// </summary>
            [EnumMember(Value = "MARKET_ORDER")]
            MARKETORDER,

            /// <summary>
            /// Enum MARKETORDERREJECT for "MARKET_ORDER_REJECT"
            /// </summary>
            [EnumMember(Value = "MARKET_ORDER_REJECT")]
            MARKETORDERREJECT,

            /// <summary>
            /// Enum LIMITORDER for "LIMIT_ORDER"
            /// </summary>
            [EnumMember(Value = "LIMIT_ORDER")]
            LIMITORDER,

            /// <summary>
            /// Enum LIMITORDERREJECT for "LIMIT_ORDER_REJECT"
            /// </summary>
            [EnumMember(Value = "LIMIT_ORDER_REJECT")]
            LIMITORDERREJECT,

            /// <summary>
            /// Enum STOPORDER for "STOP_ORDER"
            /// </summary>
            [EnumMember(Value = "STOP_ORDER")]
            STOPORDER,

            /// <summary>
            /// Enum STOPORDERREJECT for "STOP_ORDER_REJECT"
            /// </summary>
            [EnumMember(Value = "STOP_ORDER_REJECT")]
            STOPORDERREJECT,

            /// <summary>
            /// Enum MARKETIFTOUCHEDORDER for "MARKET_IF_TOUCHED_ORDER"
            /// </summary>
            [EnumMember(Value = "MARKET_IF_TOUCHED_ORDER")]
            MARKETIFTOUCHEDORDER,

            /// <summary>
            /// Enum MARKETIFTOUCHEDORDERREJECT for "MARKET_IF_TOUCHED_ORDER_REJECT"
            /// </summary>
            [EnumMember(Value = "MARKET_IF_TOUCHED_ORDER_REJECT")]
            MARKETIFTOUCHEDORDERREJECT,

            /// <summary>
            /// Enum TAKEPROFITORDER for "TAKE_PROFIT_ORDER"
            /// </summary>
            [EnumMember(Value = "TAKE_PROFIT_ORDER")]
            TAKEPROFITORDER,

            /// <summary>
            /// Enum TAKEPROFITORDERREJECT for "TAKE_PROFIT_ORDER_REJECT"
            /// </summary>
            [EnumMember(Value = "TAKE_PROFIT_ORDER_REJECT")]
            TAKEPROFITORDERREJECT,

            /// <summary>
            /// Enum STOPLOSSORDER for "STOP_LOSS_ORDER"
            /// </summary>
            [EnumMember(Value = "STOP_LOSS_ORDER")]
            STOPLOSSORDER,

            /// <summary>
            /// Enum STOPLOSSORDERREJECT for "STOP_LOSS_ORDER_REJECT"
            /// </summary>
            [EnumMember(Value = "STOP_LOSS_ORDER_REJECT")]
            STOPLOSSORDERREJECT,

            /// <summary>
            /// Enum TRAILINGSTOPLOSSORDER for "TRAILING_STOP_LOSS_ORDER"
            /// </summary>
            [EnumMember(Value = "TRAILING_STOP_LOSS_ORDER")]
            TRAILINGSTOPLOSSORDER,

            /// <summary>
            /// Enum TRAILINGSTOPLOSSORDERREJECT for "TRAILING_STOP_LOSS_ORDER_REJECT"
            /// </summary>
            [EnumMember(Value = "TRAILING_STOP_LOSS_ORDER_REJECT")]
            TRAILINGSTOPLOSSORDERREJECT,

            /// <summary>
            /// Enum ORDERFILL for "ORDER_FILL"
            /// </summary>
            [EnumMember(Value = "ORDER_FILL")]
            ORDERFILL,

            /// <summary>
            /// Enum ORDERCANCEL for "ORDER_CANCEL"
            /// </summary>
            [EnumMember(Value = "ORDER_CANCEL")]
            ORDERCANCEL,

            /// <summary>
            /// Enum ORDERCANCELREJECT for "ORDER_CANCEL_REJECT"
            /// </summary>
            [EnumMember(Value = "ORDER_CANCEL_REJECT")]
            ORDERCANCELREJECT,

            /// <summary>
            /// Enum ORDERCLIENTEXTENSIONSMODIFY for "ORDER_CLIENT_EXTENSIONS_MODIFY"
            /// </summary>
            [EnumMember(Value = "ORDER_CLIENT_EXTENSIONS_MODIFY")]
            ORDERCLIENTEXTENSIONSMODIFY,

            /// <summary>
            /// Enum ORDERCLIENTEXTENSIONSMODIFYREJECT for "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT"
            /// </summary>
            [EnumMember(Value = "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT")]
            ORDERCLIENTEXTENSIONSMODIFYREJECT,

            /// <summary>
            /// Enum TRADECLIENTEXTENSIONSMODIFY for "TRADE_CLIENT_EXTENSIONS_MODIFY"
            /// </summary>
            [EnumMember(Value = "TRADE_CLIENT_EXTENSIONS_MODIFY")]
            TRADECLIENTEXTENSIONSMODIFY,

            /// <summary>
            /// Enum TRADECLIENTEXTENSIONSMODIFYREJECT for "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT"
            /// </summary>
            [EnumMember(Value = "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT")]
            TRADECLIENTEXTENSIONSMODIFYREJECT,

            /// <summary>
            /// Enum MARGINCALLENTER for "MARGIN_CALL_ENTER"
            /// </summary>
            [EnumMember(Value = "MARGIN_CALL_ENTER")]
            MARGINCALLENTER,

            /// <summary>
            /// Enum MARGINCALLEXTEND for "MARGIN_CALL_EXTEND"
            /// </summary>
            [EnumMember(Value = "MARGIN_CALL_EXTEND")]
            MARGINCALLEXTEND,

            /// <summary>
            /// Enum MARGINCALLEXIT for "MARGIN_CALL_EXIT"
            /// </summary>
            [EnumMember(Value = "MARGIN_CALL_EXIT")]
            MARGINCALLEXIT,

            /// <summary>
            /// Enum DELAYEDTRADECLOSURE for "DELAYED_TRADE_CLOSURE"
            /// </summary>
            [EnumMember(Value = "DELAYED_TRADE_CLOSURE")]
            DELAYEDTRADECLOSURE,

            /// <summary>
            /// Enum DAILYFINANCING for "DAILY_FINANCING"
            /// </summary>
            [EnumMember(Value = "DAILY_FINANCING")]
            DAILYFINANCING,

            /// <summary>
            /// Enum RESETRESETTABLEPL for "RESET_RESETTABLE_PL"
            /// </summary>
            [EnumMember(Value = "RESET_RESETTABLE_PL")]
            RESETRESETTABLEPL
        }

        /// <summary>
        /// The time-in-force requested for the TrailingStopLoss Order. Restricted to \"GTC\", \"GFD\" and \"GTD\" for TrailingStopLoss Orders.
        /// </summary>
        /// <value>The time-in-force requested for the TrailingStopLoss Order. Restricted to \"GTC\", \"GFD\" and \"GTD\" for TrailingStopLoss Orders.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum TimeInForceEnum
        {

            /// <summary>
            /// Enum GTC for "GTC"
            /// </summary>
            [EnumMember(Value = "GTC")]
            GTC,

            /// <summary>
            /// Enum GTD for "GTD"
            /// </summary>
            [EnumMember(Value = "GTD")]
            GTD,

            /// <summary>
            /// Enum GFD for "GFD"
            /// </summary>
            [EnumMember(Value = "GFD")]
            GFD,

            /// <summary>
            /// Enum FOK for "FOK"
            /// </summary>
            [EnumMember(Value = "FOK")]
            FOK,

            /// <summary>
            /// Enum IOC for "IOC"
            /// </summary>
            [EnumMember(Value = "IOC")]
            IOC
        }

        /// <summary>
        /// Specification of what component of a price should be used for comparison when determining if the Order should be filled.
        /// </summary>
        /// <value>Specification of what component of a price should be used for comparison when determining if the Order should be filled.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum TriggerConditionEnum
        {

            /// <summary>
            /// Enum DEFAULT for "DEFAULT"
            /// </summary>
            [EnumMember(Value = "DEFAULT")]
            DEFAULT,

            /// <summary>
            /// Enum TRIGGERDEFAULT for "TRIGGER_DEFAULT"
            /// </summary>
            [EnumMember(Value = "TRIGGER_DEFAULT")]
            TRIGGERDEFAULT,

            /// <summary>
            /// Enum INVERSE for "INVERSE"
            /// </summary>
            [EnumMember(Value = "INVERSE")]
            INVERSE,

            /// <summary>
            /// Enum BID for "BID"
            /// </summary>
            [EnumMember(Value = "BID")]
            BID,

            /// <summary>
            /// Enum ASK for "ASK"
            /// </summary>
            [EnumMember(Value = "ASK")]
            ASK,

            /// <summary>
            /// Enum MID for "MID"
            /// </summary>
            [EnumMember(Value = "MID")]
            MID
        }

        /// <summary>
        /// The reason that the Trailing Stop Loss Order was initiated
        /// </summary>
        /// <value>The reason that the Trailing Stop Loss Order was initiated</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum ReasonEnum
        {

            /// <summary>
            /// Enum CLIENTORDER for "CLIENT_ORDER"
            /// </summary>
            [EnumMember(Value = "CLIENT_ORDER")]
            CLIENTORDER,

            /// <summary>
            /// Enum REPLACEMENT for "REPLACEMENT"
            /// </summary>
            [EnumMember(Value = "REPLACEMENT")]
            REPLACEMENT,

            /// <summary>
            /// Enum ONFILL for "ON_FILL"
            /// </summary>
            [EnumMember(Value = "ON_FILL")]
            ONFILL
        }

        /// <summary>
        /// The Type of the Transaction. Always set to \"TRAILING_STOP_LOSS_ORDER\" in a TrailingStopLossOrderTransaction.
        /// </summary>
        /// <value>The Type of the Transaction. Always set to \"TRAILING_STOP_LOSS_ORDER\" in a TrailingStopLossOrderTransaction.</value>
        [DataMember(Name="type", EmitDefaultValue=false)]
        public TypeEnum? Type { get; set; }
        /// <summary>
        /// The time-in-force requested for the TrailingStopLoss Order. Restricted to \"GTC\", \"GFD\" and \"GTD\" for TrailingStopLoss Orders.
        /// </summary>
        /// <value>The time-in-force requested for the TrailingStopLoss Order. Restricted to \"GTC\", \"GFD\" and \"GTD\" for TrailingStopLoss Orders.</value>
        [DataMember(Name="timeInForce", EmitDefaultValue=false)]
        public TimeInForceEnum? TimeInForce { get; set; }
        /// <summary>
        /// Specification of what component of a price should be used for comparison when determining if the Order should be filled.
        /// </summary>
        /// <value>Specification of what component of a price should be used for comparison when determining if the Order should be filled.</value>
        [DataMember(Name="triggerCondition", EmitDefaultValue=false)]
        public TriggerConditionEnum? TriggerCondition { get; set; }
        /// <summary>
        /// The reason that the Trailing Stop Loss Order was initiated
        /// </summary>
        /// <value>The reason that the Trailing Stop Loss Order was initiated</value>
        [DataMember(Name="reason", EmitDefaultValue=false)]
        public ReasonEnum? Reason { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="TrailingStopLossOrderTransaction" /> class.
        /// </summary>
        /// <param name="Id">The Transaction's Identifier..</param>
        /// <param name="Time">The date/time when the Transaction was created..</param>
        /// <param name="UserID">The ID of the user that initiated the creation of the Transaction..</param>
        /// <param name="AccountID">The ID of the Account the Transaction was created for..</param>
        /// <param name="BatchID">The ID of the \"batch\" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously..</param>
        /// <param name="RequestID">The Request ID of the request which generated the transaction..</param>
        /// <param name="Type">The Type of the Transaction. Always set to \"TRAILING_STOP_LOSS_ORDER\" in a TrailingStopLossOrderTransaction..</param>
        /// <param name="TradeID">The ID of the Trade to close when the price threshold is breached..</param>
        /// <param name="ClientTradeID">The client ID of the Trade to be closed when the price threshold is breached..</param>
        /// <param name="Distance">The price distance specified for the TrailingStopLoss Order..</param>
        /// <param name="TimeInForce">The time-in-force requested for the TrailingStopLoss Order. Restricted to \"GTC\", \"GFD\" and \"GTD\" for TrailingStopLoss Orders..</param>
        /// <param name="GtdTime">The date/time when the StopLoss Order will be cancelled if its timeInForce is \"GTD\"..</param>
        /// <param name="TriggerCondition">Specification of what component of a price should be used for comparison when determining if the Order should be filled..</param>
        /// <param name="Reason">The reason that the Trailing Stop Loss Order was initiated.</param>
        /// <param name="ClientExtensions">ClientExtensions.</param>
        /// <param name="OrderFillTransactionID">The ID of the OrderFill Transaction that caused this Order to be created (only provided if this Order was created automatically when another Order was filled)..</param>
        /// <param name="ReplacesOrderID">The ID of the Order that this Order replaces (only provided if this Order replaces an existing Order)..</param>
        /// <param name="CancellingTransactionID">The ID of the Transaction that cancels the replaced Order (only provided if this Order replaces an existing Order)..</param>
        public TrailingStopLossOrderTransaction(string Id = default(string), string Time = default(string), int? UserID = default(int?), string AccountID = default(string), string BatchID = default(string), string RequestID = default(string), TypeEnum? Type = default(TypeEnum?), string TradeID = default(string), string ClientTradeID = default(string), string Distance = default(string), TimeInForceEnum? TimeInForce = default(TimeInForceEnum?), string GtdTime = default(string), TriggerConditionEnum? TriggerCondition = default(TriggerConditionEnum?), ReasonEnum? Reason = default(ReasonEnum?), ClientExtensions ClientExtensions = default(ClientExtensions), string OrderFillTransactionID = default(string), string ReplacesOrderID = default(string), string CancellingTransactionID = default(string))
        {
            this.Id = Id;
            this.Time = Time;
            this.UserID = UserID;
            this.AccountID = AccountID;
            this.BatchID = BatchID;
            this.RequestID = RequestID;
            this.Type = Type;
            this.TradeID = TradeID;
            this.ClientTradeID = ClientTradeID;
            this.Distance = Distance;
            this.TimeInForce = TimeInForce;
            this.GtdTime = GtdTime;
            this.TriggerCondition = TriggerCondition;
            this.Reason = Reason;
            this.ClientExtensions = ClientExtensions;
            this.OrderFillTransactionID = OrderFillTransactionID;
            this.ReplacesOrderID = ReplacesOrderID;
            this.CancellingTransactionID = CancellingTransactionID;
        }

        /// <summary>
        /// The Transaction's Identifier.
        /// </summary>
        /// <value>The Transaction's Identifier.</value>
        [DataMember(Name="id", EmitDefaultValue=false)]
        public string Id { get; set; }
        /// <summary>
        /// The date/time when the Transaction was created.
        /// </summary>
        /// <value>The date/time when the Transaction was created.</value>
        [DataMember(Name="time", EmitDefaultValue=false)]
        public string Time { get; set; }
        /// <summary>
        /// The ID of the user that initiated the creation of the Transaction.
        /// </summary>
        /// <value>The ID of the user that initiated the creation of the Transaction.</value>
        [DataMember(Name="userID", EmitDefaultValue=false)]
        public int? UserID { get; set; }
        /// <summary>
        /// The ID of the Account the Transaction was created for.
        /// </summary>
        /// <value>The ID of the Account the Transaction was created for.</value>
        [DataMember(Name="accountID", EmitDefaultValue=false)]
        public string AccountID { get; set; }
        /// <summary>
        /// The ID of the \"batch\" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously.
        /// </summary>
        /// <value>The ID of the \"batch\" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously.</value>
        [DataMember(Name="batchID", EmitDefaultValue=false)]
        public string BatchID { get; set; }
        /// <summary>
        /// The Request ID of the request which generated the transaction.
        /// </summary>
        /// <value>The Request ID of the request which generated the transaction.</value>
        [DataMember(Name="requestID", EmitDefaultValue=false)]
        public string RequestID { get; set; }
        /// <summary>
        /// The ID of the Trade to close when the price threshold is breached.
        /// </summary>
        /// <value>The ID of the Trade to close when the price threshold is breached.</value>
        [DataMember(Name="tradeID", EmitDefaultValue=false)]
        public string TradeID { get; set; }
        /// <summary>
        /// The client ID of the Trade to be closed when the price threshold is breached.
        /// </summary>
        /// <value>The client ID of the Trade to be closed when the price threshold is breached.</value>
        [DataMember(Name="clientTradeID", EmitDefaultValue=false)]
        public string ClientTradeID { get; set; }
        /// <summary>
        /// The price distance specified for the TrailingStopLoss Order.
        /// </summary>
        /// <value>The price distance specified for the TrailingStopLoss Order.</value>
        [DataMember(Name="distance", EmitDefaultValue=false)]
        public string Distance { get; set; }
        /// <summary>
        /// The date/time when the StopLoss Order will be cancelled if its timeInForce is \"GTD\".
        /// </summary>
        /// <value>The date/time when the StopLoss Order will be cancelled if its timeInForce is \"GTD\".</value>
        [DataMember(Name="gtdTime", EmitDefaultValue=false)]
        public string GtdTime { get; set; }
        /// <summary>
        /// Gets or Sets ClientExtensions
        /// </summary>
        [DataMember(Name="clientExtensions", EmitDefaultValue=false)]
        public ClientExtensions ClientExtensions { get; set; }
        /// <summary>
        /// The ID of the OrderFill Transaction that caused this Order to be created (only provided if this Order was created automatically when another Order was filled).
        /// </summary>
        /// <value>The ID of the OrderFill Transaction that caused this Order to be created (only provided if this Order was created automatically when another Order was filled).</value>
        [DataMember(Name="orderFillTransactionID", EmitDefaultValue=false)]
        public string OrderFillTransactionID { get; set; }
        /// <summary>
        /// The ID of the Order that this Order replaces (only provided if this Order replaces an existing Order).
        /// </summary>
        /// <value>The ID of the Order that this Order replaces (only provided if this Order replaces an existing Order).</value>
        [DataMember(Name="replacesOrderID", EmitDefaultValue=false)]
        public string ReplacesOrderID { get; set; }
        /// <summary>
        /// The ID of the Transaction that cancels the replaced Order (only provided if this Order replaces an existing Order).
        /// </summary>
        /// <value>The ID of the Transaction that cancels the replaced Order (only provided if this Order replaces an existing Order).</value>
        [DataMember(Name="cancellingTransactionID", EmitDefaultValue=false)]
        public string CancellingTransactionID { get; set; }
        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("class TrailingStopLossOrderTransaction {\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  Time: ").Append(Time).Append("\n");
            sb.Append("  UserID: ").Append(UserID).Append("\n");
            sb.Append("  AccountID: ").Append(AccountID).Append("\n");
            sb.Append("  BatchID: ").Append(BatchID).Append("\n");
            sb.Append("  RequestID: ").Append(RequestID).Append("\n");
            sb.Append("  Type: ").Append(Type).Append("\n");
            sb.Append("  TradeID: ").Append(TradeID).Append("\n");
            sb.Append("  ClientTradeID: ").Append(ClientTradeID).Append("\n");
            sb.Append("  Distance: ").Append(Distance).Append("\n");
            sb.Append("  TimeInForce: ").Append(TimeInForce).Append("\n");
            sb.Append("  GtdTime: ").Append(GtdTime).Append("\n");
            sb.Append("  TriggerCondition: ").Append(TriggerCondition).Append("\n");
            sb.Append("  Reason: ").Append(Reason).Append("\n");
            sb.Append("  ClientExtensions: ").Append(ClientExtensions).Append("\n");
            sb.Append("  OrderFillTransactionID: ").Append(OrderFillTransactionID).Append("\n");
            sb.Append("  ReplacesOrderID: ").Append(ReplacesOrderID).Append("\n");
            sb.Append("  CancellingTransactionID: ").Append(CancellingTransactionID).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="obj">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object obj)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            return this.Equals(obj as TrailingStopLossOrderTransaction);
        }

        /// <summary>
        /// Returns true if TrailingStopLossOrderTransaction instances are equal
        /// </summary>
        /// <param name="other">Instance of TrailingStopLossOrderTransaction to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(TrailingStopLossOrderTransaction other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
                return false;

            return
                (
                    this.Id == other.Id ||
                    this.Id != null &&
                    this.Id.Equals(other.Id)
                ) &&
                (
                    this.Time == other.Time ||
                    this.Time != null &&
                    this.Time.Equals(other.Time)
                ) &&
                (
                    this.UserID == other.UserID ||
                    this.UserID != null &&
                    this.UserID.Equals(other.UserID)
                ) &&
                (
                    this.AccountID == other.AccountID ||
                    this.AccountID != null &&
                    this.AccountID.Equals(other.AccountID)
                ) &&
                (
                    this.BatchID == other.BatchID ||
                    this.BatchID != null &&
                    this.BatchID.Equals(other.BatchID)
                ) &&
                (
                    this.RequestID == other.RequestID ||
                    this.RequestID != null &&
                    this.RequestID.Equals(other.RequestID)
                ) &&
                (
                    this.Type == other.Type ||
                    this.Type != null &&
                    this.Type.Equals(other.Type)
                ) &&
                (
                    this.TradeID == other.TradeID ||
                    this.TradeID != null &&
                    this.TradeID.Equals(other.TradeID)
                ) &&
                (
                    this.ClientTradeID == other.ClientTradeID ||
                    this.ClientTradeID != null &&
                    this.ClientTradeID.Equals(other.ClientTradeID)
                ) &&
                (
                    this.Distance == other.Distance ||
                    this.Distance != null &&
                    this.Distance.Equals(other.Distance)
                ) &&
                (
                    this.TimeInForce == other.TimeInForce ||
                    this.TimeInForce != null &&
                    this.TimeInForce.Equals(other.TimeInForce)
                ) &&
                (
                    this.GtdTime == other.GtdTime ||
                    this.GtdTime != null &&
                    this.GtdTime.Equals(other.GtdTime)
                ) &&
                (
                    this.TriggerCondition == other.TriggerCondition ||
                    this.TriggerCondition != null &&
                    this.TriggerCondition.Equals(other.TriggerCondition)
                ) &&
                (
                    this.Reason == other.Reason ||
                    this.Reason != null &&
                    this.Reason.Equals(other.Reason)
                ) &&
                (
                    this.ClientExtensions == other.ClientExtensions ||
                    this.ClientExtensions != null &&
                    this.ClientExtensions.Equals(other.ClientExtensions)
                ) &&
                (
                    this.OrderFillTransactionID == other.OrderFillTransactionID ||
                    this.OrderFillTransactionID != null &&
                    this.OrderFillTransactionID.Equals(other.OrderFillTransactionID)
                ) &&
                (
                    this.ReplacesOrderID == other.ReplacesOrderID ||
                    this.ReplacesOrderID != null &&
                    this.ReplacesOrderID.Equals(other.ReplacesOrderID)
                ) &&
                (
                    this.CancellingTransactionID == other.CancellingTransactionID ||
                    this.CancellingTransactionID != null &&
                    this.CancellingTransactionID.Equals(other.CancellingTransactionID)
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;
                // Suitable nullity checks etc, of course :)
                if (this.Id != null)
                    hash = hash * 59 + this.Id.GetHashCode();
                if (this.Time != null)
                    hash = hash * 59 + this.Time.GetHashCode();
                if (this.UserID != null)
                    hash = hash * 59 + this.UserID.GetHashCode();
                if (this.AccountID != null)
                    hash = hash * 59 + this.AccountID.GetHashCode();
                if (this.BatchID != null)
                    hash = hash * 59 + this.BatchID.GetHashCode();
                if (this.RequestID != null)
                    hash = hash * 59 + this.RequestID.GetHashCode();
                if (this.Type != null)
                    hash = hash * 59 + this.Type.GetHashCode();
                if (this.TradeID != null)
                    hash = hash * 59 + this.TradeID.GetHashCode();
                if (this.ClientTradeID != null)
                    hash = hash * 59 + this.ClientTradeID.GetHashCode();
                if (this.Distance != null)
                    hash = hash * 59 + this.Distance.GetHashCode();
                if (this.TimeInForce != null)
                    hash = hash * 59 + this.TimeInForce.GetHashCode();
                if (this.GtdTime != null)
                    hash = hash * 59 + this.GtdTime.GetHashCode();
                if (this.TriggerCondition != null)
                    hash = hash * 59 + this.TriggerCondition.GetHashCode();
                if (this.Reason != null)
                    hash = hash * 59 + this.Reason.GetHashCode();
                if (this.ClientExtensions != null)
                    hash = hash * 59 + this.ClientExtensions.GetHashCode();
                if (this.OrderFillTransactionID != null)
                    hash = hash * 59 + this.OrderFillTransactionID.GetHashCode();
                if (this.ReplacesOrderID != null)
                    hash = hash * 59 + this.ReplacesOrderID.GetHashCode();
                if (this.CancellingTransactionID != null)
                    hash = hash * 59 + this.CancellingTransactionID.GetHashCode();
                return hash;
            }
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}


text:
#ifndef CVMICONFIG_H
#define CVMICONFIG_H

#define DEFAULT_RELEASE_SOURCE "http://rbuilder.cern.ch/installer/installer.cgi"

#include <QString>
#include <QFile>

class CVMIConfig
{
public:
  CVMIConfig();
  ~CVMIConfig(){}

  QString getImageDir();
  QString getVMDir();
  QString getHypervisorDir();
  QString getShowDevReleases();
  QString getReleaseSource();

  void setImageDir (QString dir);
  void setVMDir (QString dir);
  void setHypervisorDir (QString dir);
  void setShowDevReleases (QString show);
  void setReleaseSource (QString source);

  void write();
  void read();
  void reset();

private:
  // Config variables
  QString imageDir;
  QString vmDir;
  QString hypervisorDir;
  QString showDevReleases;
  QString releaseSource;

  // Conf file
  QString confFileName;
  QString confDirPath;
  QString confFilePath;
};

#endif // CVMICONFIG_H

redpajama_set_name: RedPajamaGithub


text:
package org.jetbrains.idea.svn;

import com.intellij.openapi.util.Version;
import org.jetbrains.annotations.NotNull;

/**
 * since not all constants are available from svnkit & constants are fixed
 */
public enum WorkingCopyFormat {

  ONE_DOT_THREE(4, false, false, false, SvnBundle.message("dialog.show.svn.map.table.version13.text"), new Version(1, 3, 0)),
  ONE_DOT_FOUR(8, false, false, false, SvnBundle.message("dialog.show.svn.map.table.version14.text"), new Version(1, 4, 0)),
  ONE_DOT_FIVE(9, true, true, false, SvnBundle.message("dialog.show.svn.map.table.version15.text"), new Version(1, 5, 0)),
  ONE_DOT_SIX(10, true, true, true, SvnBundle.message("dialog.show.svn.map.table.version16.text"), new Version(1, 6, 0)),
  ONE_DOT_SEVEN(12, true, true, true, SvnBundle.message("dialog.show.svn.map.table.version17.text"), new Version(1, 7, 0)),
  ONE_DOT_EIGHT(12, true, true, true, SvnBundle.message("dialog.show.svn.map.table.version18.text"), new Version(1, 8, 0)),
  UNKNOWN(0, false, false, false, "unknown", new Version(0, 0, 0));

  public static final int INTERNAL_FORMAT_17 = 29;
  public static final int INTERNAL_FORMAT_18 = 31;
  private static final Version ONE_DOT_NINE_VERSION = new Version(1, 9, 0);

  private final int myFormat;
  private final boolean myChangelistSupport;
  private final boolean myMergeInfoSupport;
  private final boolean myTreeConflictSupport;
  private final String myName;
  @NotNull
  private final Version myVersion;

  private WorkingCopyFormat(final int format,
                            boolean changelistSupport,
                            boolean mergeInfoSupport,
                            boolean treeConflictSupport,
                            String name,
                            @NotNull Version version) {
    myFormat = format;
    myChangelistSupport = changelistSupport;
    myMergeInfoSupport = mergeInfoSupport;
    myTreeConflictSupport = treeConflictSupport;
    myName = name;
    myVersion = version;
  }

  public boolean supportsChangelists() {
    return myChangelistSupport;
  }

  public boolean supportsMergeInfo() {
    return myMergeInfoSupport;
  }

  public boolean supportsTreeConflicts() {
    return myTreeConflictSupport;
  }

  public String getName() {
    return myName;
  }

  @NotNull
  public Version getVersion() {
    return myVersion;
  }

  @NotNull
  public static WorkingCopyFormat getInstance(final int value) {
    // somewhy 1.7 wc format can also be 29
    if (INTERNAL_FORMAT_17 == value) {
      return ONE_DOT_SEVEN;
    } else if (INTERNAL_FORMAT_18 == value) {
      return ONE_DOT_EIGHT;
    } else if (ONE_DOT_FIVE.getFormat() == value) {
      return ONE_DOT_FIVE;
    } else if (ONE_DOT_FOUR.getFormat() == value) {
      return ONE_DOT_FOUR;
    } else if (ONE_DOT_THREE.getFormat() == value) {
      return ONE_DOT_THREE;
    } else if (ONE_DOT_SIX.getFormat() == value) {
      return ONE_DOT_SIX;
    } else if (ONE_DOT_SEVEN.getFormat() == value) {
      return ONE_DOT_SEVEN;
    }
    return UNKNOWN;
  }

  public int getFormat() {
    return myFormat;
  }

  public boolean isOrGreater(@NotNull WorkingCopyFormat format) {
    return myVersion.isOrGreaterThan(format.getVersion().major, format.getVersion().minor);
  }

  public boolean less(@NotNull WorkingCopyFormat format) {
    return myVersion.lessThan(format.getVersion().major, format.getVersion().minor);
  }

  @NotNull
  public static WorkingCopyFormat from(@NotNull Version version) {
    WorkingCopyFormat result = UNKNOWN;

    if (version.compareTo(ONE_DOT_NINE_VERSION) >= 0) {
      result = ONE_DOT_EIGHT;
    }
    else {
      for (WorkingCopyFormat format : WorkingCopyFormat.values()) {
        if (format.getVersion().is(version.major, version.minor)) {
          result = format;
          break;
        }
      }
    }

    return result;
  }

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


text:
package com.google.gerrit.acceptance.rest.change;

import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableListMultimap;
import com.google.gerrit.acceptance.AbstractPluginFieldsTest;
import com.google.gerrit.acceptance.RestResponse;
import com.google.gerrit.common.Nullable;
import com.google.gerrit.entities.Change;
import com.google.gerrit.extensions.common.PluginDefinedInfo;
import com.google.gerrit.json.OutputFormat;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.junit.Test;

public class PluginFieldsIT extends AbstractPluginFieldsTest {
  private static final Gson GSON = OutputFormat.JSON.newGson();

  @Test
  public void querySingleChangeWithBulkAttribute() throws Exception {
    getSingleChangeWithPluginDefinedBulkAttribute(
        id -> pluginInfosFromChangeInfos(adminRestSession.get(changeQueryUrl(id))));
  }

  @Test
  public void pluginDefinedGetChangeWithSimpleAttribute() throws Exception {
    getSingleChangeWithPluginDefinedBulkAttribute(
        id -> pluginInfoMapFromChangeInfo(adminRestSession.get(changeUrl(id))));
  }

  @Test
  public void pluginDefinedGetChangeDetailWithSimpleAttribute() throws Exception {
    getSingleChangeWithPluginDefinedBulkAttribute(
        id -> pluginInfoMapFromChangeInfo(adminRestSession.get(changeDetailUrl(id))));
  }

  @Test
  public void pluginDefinedQueryChangeWithOption() throws Exception {
    getChangeWithPluginDefinedBulkAttributeOption(
        id -> pluginInfosFromChangeInfos(adminRestSession.get(changeQueryUrl(id))),
        (id, opts) -> pluginInfosFromChangeInfos(adminRestSession.get(changeQueryUrl(id, opts))));
  }

  @Test
  public void pluginDefinedGetChangeWithOption() throws Exception {
    getChangeWithPluginDefinedBulkAttributeOption(
        id -> pluginInfoMapFromChangeInfo(adminRestSession.get(changeUrl(id))),
        (id, opts) -> pluginInfoMapFromChangeInfo(adminRestSession.get(changeUrl(id, opts))));
  }

  @Test
  public void pluginDefinedGetChangeDetailWithOption() throws Exception {
    getChangeWithPluginDefinedBulkAttributeOption(
        id -> pluginInfoMapFromChangeInfo(adminRestSession.get(changeDetailUrl(id))),
        (id, opts) -> pluginInfoMapFromChangeInfo(adminRestSession.get(changeDetailUrl(id, opts))));
  }

  @Test
  public void queryMultipleChangesWithPluginDefinedAttribute() throws Exception {
    getMultipleChangesWithPluginDefinedBulkAttribute(
        () -> pluginInfosFromChangeInfos(adminRestSession.get("/changes/?q=status:open")));
  }

  @Test
  public void queryChangesByCommitMessageWithPluginDefinedBulkAttribute() throws Exception {
    getChangesByCommitMessageWithPluginDefinedBulkAttribute(
        () -> pluginInfosFromChangeInfos(adminRestSession.get("/changes/?q=status:open")));
  }

  @Test
  public void getMultipleChangesWithPluginDefinedAttributeInSingleCall() throws Exception {
    getMultipleChangesWithPluginDefinedBulkAttributeInSingleCall(
        () -> pluginInfosFromChangeInfos(adminRestSession.get("/changes/?q=status:open")));
  }

  @Test
  public void getChangeWithPluginDefinedException() throws Exception {
    getChangeWithPluginDefinedBulkAttributeWithException(
        id -> pluginInfoMapFromChangeInfo(adminRestSession.get(changeUrl(id))));
  }

  private String changeQueryUrl(Change.Id id) {
    return changeQueryUrl(id, ImmutableListMultimap.of());
  }

  private String changeQueryUrl(Change.Id id, ImmutableListMultimap<String, String> opts) {
    String url = "/changes/?q=" + id;
    String queryString = buildQueryString(opts);
    if (!queryString.isEmpty()) {
      url += "&" + queryString;
    }
    return url;
  }

  private String changeUrl(Change.Id id) {
    return changeUrl(id, ImmutableListMultimap.of());
  }

  private String changeUrl(Change.Id id, ImmutableListMultimap<String, String> pluginOptions) {
    return changeUrl(id, "", pluginOptions);
  }

  private String changeDetailUrl(Change.Id id) {
    return changeDetailUrl(id, ImmutableListMultimap.of());
  }

  private String changeDetailUrl(
      Change.Id id, ImmutableListMultimap<String, String> pluginOptions) {
    return changeUrl(id, "/detail", pluginOptions);
  }

  private String changeUrl(
      Change.Id id, String suffix, ImmutableListMultimap<String, String> pluginOptions) {
    String url = "/changes/" + project + "~" + id + suffix;
    String queryString = buildQueryString(pluginOptions);
    if (!queryString.isEmpty()) {
      url += "?" + queryString;
    }
    return url;
  }

  private static String buildQueryString(ImmutableListMultimap<String, String> opts) {
    return Joiner.on('&').withKeyValueSeparator('=').join(opts.entries());
  }

  @Nullable
  private Map<Change.Id, List<PluginDefinedInfo>> pluginInfoMapFromChangeInfo(RestResponse res)
      throws Exception {
    res.assertOK();
    Map<String, Object> changeInfo =
        GSON.fromJson(res.getReader(), new TypeToken<Map<String, Object>>() {}.getType());
    return getPluginInfosFromChangeInfos(GSON, Arrays.asList(changeInfo));
  }

  @Nullable
  private Map<Change.Id, List<PluginDefinedInfo>> pluginInfosFromChangeInfos(RestResponse res)
      throws Exception {
    res.assertOK();
    List<Map<String, Object>> changeInfos =
        GSON.fromJson(res.getReader(), new TypeToken<List<Map<String, Object>>>() {}.getType());
    return getPluginInfosFromChangeInfos(GSON, changeInfos);
  }
}


text:
<?php
namespace App\Model\Entity;

use Cake\ORM\Entity;

/**
 * Dismissal Entity.
 */
class Dismissal extends Entity
{

}


text:
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using IdentityModel.Client;
using System;
using System.Linq;
using System.Threading.Tasks;
using IdentityModel.OidcClient.Infrastructure;
using System.Security.Claims;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using IdentityModel.OidcClient.Results;
using IdentityModel.OidcClient.Browser;
using IdentityModel.Jwk;
using System.Security.Cryptography;
using Microsoft.IdentityModel.Tokens;
using System.IdentityModel.Tokens.Jwt;
using IdentityModel.OidcClient.Pop;

namespace IdentityModel.OidcClient
{
    /// <summary>
    /// OpenID Connect client
    /// </summary>
    public class OidcClient
    {
        private readonly OidcClientOptions _options;
        private readonly ILogger _logger;
        private readonly AuthorizeClient _authorizeClient;

        private readonly bool useDiscovery;
        private readonly ResponseProcessor _processor;

        public OidcClientOptions Options
        {
            get { return _options; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="OidcClient"/> class.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <exception cref="System.ArgumentNullException">options</exception>
        public OidcClient(OidcClientOptions options)
        {
            if (options == null) throw new ArgumentNullException(nameof(options));

            if (options.ProviderInformation == null)
            {
                if (options.Authority.IsMissing()) throw new ArgumentException("No authority specified", nameof(_options.Authority));
                useDiscovery = true;
            }

            _options = options;
            _logger = options.LoggerFactory.CreateLogger<OidcClient>();
            _authorizeClient = new AuthorizeClient(options);
            _processor = new ResponseProcessor(options, EnsureProviderInformationAsync);
        }

        public async Task<LoginResult> LoginAsync(DisplayMode displayMode = DisplayMode.Visible, int timeout = 300, Task<Microsoft.IdentityModel.Tokens.RsaSecurityKey> pregeneratedPoPKeyTask = null, object extraParameters = null)
        {
            _logger.LogTrace("LoginAsync");
            _logger.LogInformation("Starting authentication request.");

            await EnsureConfigurationAsync().ConfigureAwait(false);
            var authorizeResult = await _authorizeClient.AuthorizeAsync(displayMode, timeout, pregeneratedPoPKeyTask, extraParameters).ConfigureAwait(false);

            if (authorizeResult.IsError)
            {
                return new LoginResult(authorizeResult.Error);
            }

            var result = await ProcessResponseAsync(authorizeResult.Data, authorizeResult.State).ConfigureAwait(false);

            if (!result.IsError)
            {
                _logger.LogInformation("Authentication request success.");
            }

            return result;
        }

        /// <summary>
        /// Prepares the login request.
        /// </summary>
        /// <param name="extraParameters">extra parameters to send to the authorize endpoint.</param>
        /// <returns>State for initiating the authorize request and processing the response</returns>
        public async Task<AuthorizeState> PrepareLoginAsync(Task<RsaSecurityKey> pregeneratedKeyTask = null, object extraParameters = null)
        {
            _logger.LogTrace("PrepareLoginAsync");

            await EnsureConfigurationAsync().ConfigureAwait(false);
            return _authorizeClient.CreateAuthorizeState(pregeneratedKeyTask, extraParameters);
        }

        /// <summary>
        /// Processes the authorize response.
        /// </summary>
        /// <param name="data">The response data.</param>
        /// <param name="state">The state.</param>
        /// <returns>Result of the login response validation</returns>
        public async Task<LoginResult> ProcessResponseAsync(string data, AuthorizeState state)
        {
            _logger.LogTrace("ProcessResponseAsync");
            _logger.LogInformation("Processing response.");

            _logger.LogDebug("Authorize response: {response}", data);
            var authorizeResponse = new AuthorizeResponse(data);

            if (authorizeResponse.IsError)
            {
                _logger.LogError(authorizeResponse.Error);
                return new LoginResult(authorizeResponse.Error);
            }

            var result = await _processor.ProcessResponseAsync(authorizeResponse, state).ConfigureAwait(false);
            if (result.IsError)
            {
                _logger.LogError(result.Error);
                return new LoginResult(result.Error);
            }

            var userInfoClaims = Enumerable.Empty<Claim>();
            if (_options.LoadProfile)
            {
                var userInfoResult = await GetUserInfoAsync(result.TokenResponse.AccessToken).ConfigureAwait(false);
                if (userInfoResult.IsError)
                {
                    var error = $"Error contacting userinfo endpoint: {userInfoResult.Error}";
                    _logger.LogError(error);

                    return new LoginResult(error);
                }

                userInfoClaims = userInfoResult.Claims;

                var userInfoSub = userInfoClaims.FirstOrDefault(c => c.Type == JwtClaimTypes.Subject);
                if (userInfoSub == null)
                {
                    var error = "sub claim is missing from userinfo endpoint";
                    _logger.LogError(error);

                    return new LoginResult(error);
                }

                if (!string.Equals(userInfoSub.Value, result.User.FindFirst(JwtClaimTypes.Subject).Value))
                {
                    var error = "sub claim from userinfo endpoint is different than sub claim from identity token.";
                    _logger.LogError(error);

                    return new LoginResult(error);
                }
            }

            var user = ProcessClaims(result.User, userInfoClaims);

			var loginResult = new LoginResult
			{
				User = user,
				AccessToken = result.TokenResponse.AccessToken,
				RefreshToken = result.TokenResponse.RefreshToken,
				AccessTokenExpiration = DateTime.Now.AddSeconds(result.TokenResponse.ExpiresIn),
				IdentityToken = result.TokenResponse.IdentityToken,
				AuthenticationTime = DateTime.Now,
				PopTokenKey = result.JwkProvider != null ? new SigningCredentials(result.JwkProvider, "RS256") : null
			};

            if (!string.IsNullOrWhiteSpace(loginResult.RefreshToken))
            {
                loginResult.RefreshTokenHandler = new RefreshTokenHandler(
                    TokenClientFactory.Create(_options),
                    loginResult.RefreshToken,
                    loginResult.AccessToken);
            }

            return loginResult;
        }

        /// <summary>
        /// Gets the user claims from the userinfo endpoint.
        /// </summary>
        /// <param name="accessToken">The access token.</param>
        /// <returns>User claims</returns>
        public async Task<UserInfoResult> GetUserInfoAsync(string accessToken)
        {
            _logger.LogTrace("GetUserInfoAsync");

            if (accessToken.IsMissing()) throw new ArgumentNullException(nameof(accessToken));
            if (!_options.ProviderInformation.SupportsUserInfo) throw new InvalidOperationException("No userinfo endpoint specified");

            var userInfoClient = new UserInfoClient(_options.ProviderInformation.UserInfoEndpoint, _options.BackchannelHandler);
            userInfoClient.Timeout = _options.BackchannelTimeout;

            var userInfoResponse = await userInfoClient.GetAsync(accessToken).ConfigureAwait(false);
            if (userInfoResponse.IsError)
            {
                return new UserInfoResult
                {
                    Error = userInfoResponse.Error
                };
            }

            return new UserInfoResult
            {
                Claims = userInfoResponse.Claims
            };
        }

        /// <summary>
        /// Refreshes an access token.
        /// </summary>
        /// <param name="refreshToken">The refresh token.</param>
        /// <returns>A token response.</returns>
        public async Task<RefreshTokenResult> RefreshTokenAsync(string refreshToken, Task<RsaSecurityKey> pregeneratedPopKeyTask = null)
        {
			if (string.IsNullOrEmpty(refreshToken)) throw new ArgumentException("refreshToken");
            _logger.LogTrace("RefreshTokenAsync");

			await EnsureConfigurationAsync().ConfigureAwait(false);

            var client = TokenClientFactory.Create(_options);

			TokenResponse response;
			SigningCredentials popSigner = null;

			if (_options.RequestPopTokens)
			{
				//-- PoP Key Creation
				_logger.LogTrace("CreateProviderForPopToken");
				var popKey = await (pregeneratedPopKeyTask ?? PopTokenExtensions.CreateProviderForPopTokenAsync()).ConfigureAwait(false);
				var jwk = popKey.ToJwk();
				response = await client.RequestRefreshTokenPopAsync(refreshToken, jwk.Alg, jwk.ToJwkString()).ConfigureAwait(false);
				popSigner = new SigningCredentials(popKey, "RS256");
			}
			else
				response = await client.RequestRefreshTokenAsync(refreshToken).ConfigureAwait(false);

            if (response.IsError)
            {
                return new RefreshTokenResult { Error = response.Error };
            }

            // validate token response
            var validationResult = await _processor.ValidateTokenResponseAsync(response, null, requireIdentityToken: _options.Policy.RequireIdentityTokenOnRefreshTokenResponse).ConfigureAwait(false);
            if (validationResult.IsError)
            {
                return new RefreshTokenResult { Error = validationResult.Error };
            }

            return new RefreshTokenResult
            {
                IdentityToken = response.IdentityToken,
                AccessToken = response.AccessToken,
                RefreshToken = response.RefreshToken,
                ExpiresIn = (int)response.ExpiresIn,
                PopTokenKey = popSigner
            };
        }

		/// <summary>
		/// Pre preforms the discovery mechanism.
		/// </summary>
		/// <returns>The discovery async.</returns>
		public async Task PreformDiscoveryAsync()
		{
			await EnsureConfigurationAsync().ConfigureAwait(false);
		}

        internal async Task EnsureConfigurationAsync()
        {
            if (_options.Flow == OidcClientOptions.AuthenticationFlow.Hybrid && _options.Policy.RequireIdentityTokenSignature == false)
            {
                var error = "Allowing unsigned identity tokens is not allowed for hybrid flow";
                _logger.LogError(error);

                throw new InvalidOperationException(error);
            }

            await EnsureProviderInformationAsync().ConfigureAwait(false);

            _logger.LogDebug("Effective options:");
            _logger.LogDebug(LogSerializer.Serialize(_options));
        }

        internal async Task EnsureProviderInformationAsync()
        {
            _logger.LogTrace("EnsureProviderInformation");

            if (useDiscovery)
            {
                if (_options.RefreshDiscoveryDocumentForLogin == false)
                {
                    // discovery document has been loaded before - skip reload
                    if (_options.ProviderInformation != null)
                    {
                        _logger.LogDebug("Skipping refresh of discovery document.");

                        return;
                    }
                }

                var client = new DiscoveryClient(_options.Authority, _options.BackchannelHandler)
                {
                    Policy = _options.Policy.Discovery,
                    Timeout = _options.BackchannelTimeout
                };

                var disco = await client.GetAsync().ConfigureAwait(false);

                if (disco.IsError)
                {
                    _logger.LogError("Error loading discovery document: {errorType} - {error}", disco.ErrorType.ToString(), disco.Error);

                    throw new InvalidOperationException("Error loading discovery document: " + disco.Error);
                }

                _logger.LogDebug("Successfully loaded discovery document");
                _logger.LogDebug("Loaded keyset from {jwks_uri}", disco.JwksUri);
                _logger.LogDebug("Keyet contains the following kids: {kids}", from k in disco.KeySet.Keys select k.Kid ?? "unspecified");

                _options.ProviderInformation = new ProviderInformation
                {
                    IssuerName = disco.Issuer,
                    KeySet = disco.KeySet,

                    AuthorizeEndpoint = disco.AuthorizeEndpoint,
                    TokenEndpoint = disco.TokenEndpoint,
                    EndSessionEndpoint = disco.EndSessionEndpoint,
                    UserInfoEndpoint = disco.UserInfoEndpoint,
                    TokenEndPointAuthenticationMethods = disco.TokenEndpointAuthenticationMethodsSupported
                };
            }

            if (_options.ProviderInformation.IssuerName.IsMissing())
            {
                var error = "Issuer name is missing in provider information";

                _logger.LogError(error);
                throw new InvalidOperationException(error);
            }

            if (_options.ProviderInformation.AuthorizeEndpoint.IsMissing())
            {
                var error = "Authorize endpoint is missing in provider information";

                _logger.LogError(error);
                throw new InvalidOperationException(error);
            }

            if (_options.ProviderInformation.TokenEndpoint.IsMissing())
            {
                var error = "Token endpoint is missing in provider information";

                _logger.LogError(error);
                throw new InvalidOperationException(error);
            }

            if (_options.ProviderInformation.KeySet == null)
            {
                var error = "Key set is missing in provider information";

                _logger.LogError(error);
                throw new InvalidOperationException(error);
            }
        }

        internal ClaimsPrincipal ProcessClaims(ClaimsPrincipal user, IEnumerable<Claim> userInfoClaims)
        {
            _logger.LogTrace("ProcessClaims");

            var combinedClaims = new HashSet<Claim>(new ClaimComparer(compareValueAndTypeOnly: true));

            user.Claims.ToList().ForEach(c => combinedClaims.Add(c));
            userInfoClaims.ToList().ForEach(c => combinedClaims.Add(c));

            var userClaims = new List<Claim>();
            if (_options.FilterClaims)
            {
                userClaims = combinedClaims.Where(c => !_options.FilteredClaims.Contains(c.Type)).ToList();
            }
            else
            {
                userClaims = combinedClaims.ToList();
            }

            return new ClaimsPrincipal(new ClaimsIdentity(userClaims, user.Identity.AuthenticationType, user.Identities.First().NameClaimType, user.Identities.First().RoleClaimType));
        }

        /// <summary>
        /// Creates a pop/HMAC token using the payload and signature key specified.
        /// </summary>
        /// <param name="parameters"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public JwtSecurityToken CreatePopToken(JwtPayload payload, SigningCredentials signer)
        {
            if (payload == null) throw new ArgumentNullException("payload");
            if (signer == null) throw new ArgumentNullException("signer");
            var jHeader = new JwtHeader(signer);
            jHeader.Remove("kid"); //Other implementations seem to omit this - and it maybe best since either introspection or the access token will have the key used to validate.
            var jwt = new JwtSecurityToken(jHeader, payload);
            return jwt;
        }

        /// <summary>
        /// Checks the PoP/HMAC token for validity by verifiying both the access token signature (if JWT) and validity (if using or requiring introspection), as well as the hmac and timestamp.
        /// *Does not* validate nonce or the expected parameters in the body of the token.
        /// </summary>
        /// <param name="token"></param>
        /// <param name="scope"></param>
        /// <param name="scopeSecret"></param>
        /// <returns></returns>
        public  async Task<AccessTokenValidationResult> ValidatePopToken(string token, bool forceIntrospection = false, string scope = null, string scopeSecret = null)
        {
            if (string.IsNullOrEmpty(token)) throw new ArgumentNullException("popToken");
            if (string.IsNullOrEmpty(scope)) throw new ArgumentNullException("scope");
            if (string.IsNullOrEmpty(scopeSecret)) throw new ArgumentNullException("scopeSecret");

            await EnsureConfigurationAsync().ConfigureAwait(false);

            var processor = new PopAccessTokenValidator(_options, EnsureProviderInformationAsync);
            return await processor.ValidateAsync(token, forceIntrospection, scope, scopeSecret).ConfigureAwait(false);

        }

        /// <summary>
        /// Validates a bearer access token for validity by verifiying both the access token signature (if JWT) and validity (if using or requiring introspection).
        /// </summary>
        /// <param name="token"></param>
        /// <param name="scope"></param>
        /// <param name="scopeSecret"></param>
        /// <returns></returns>
        public async Task<Results.AccessTokenValidationResult> ValidateToken(string token, bool forceIntrospection = false, string scope = null, string scopeSecret = null)
        {
            if (string.IsNullOrEmpty(token)) throw new ArgumentNullException("popToken");
            if (string.IsNullOrEmpty(scope)) throw new ArgumentNullException("scope");
            if (string.IsNullOrEmpty(scopeSecret)) throw new ArgumentNullException("scopeSecret");

            await EnsureConfigurationAsync().ConfigureAwait(false);

            var processor = new AccessTokenValidator(_options, EnsureProviderInformationAsync);
            return await processor.ValidateAsync(token, forceIntrospection, scope, scopeSecret).ConfigureAwait(false);

        }
    }
}


text:
namespace FakeSystemWeb
{
    using System;
    using System.Collections.Generic;
    using System.Web;

    /// <summary>
    /// Fake implementation of <see cref="System.Web.HttpCachePolicyBase"/>.
    /// </summary>
    public class FakeHttpCachePolicy : HttpCachePolicyBase
    {
        private readonly List<string> cacheExtensions;
        private readonly List<Tuple<HttpCacheValidateHandler, object>> validationCallbacks;
        private readonly HttpCacheVaryByContentEncodings varyByContentEncodings;
        private readonly HttpCacheVaryByHeaders varyByHeaders;
        private readonly HttpCacheVaryByParams varyByParams;

        /// <summary>
        /// Initializes a new instance of the <see cref="FakeHttpCachePolicy"/> class.
        /// </summary>
        public FakeHttpCachePolicy()
        {
            this.cacheExtensions = new List<string>();
            this.validationCallbacks = new List<Tuple<HttpCacheValidateHandler, object>>();
            this.varyByContentEncodings = new HttpCacheVaryByContentEncodings();
            this.varyByHeaders = new HttpCacheVaryByHeaders();
            this.varyByParams = new HttpCacheVaryByParams();
        }

        /// <summary>
        /// Gets a value indicating whether the response is available in the browser history cache, regardless of the <see cref="T:System.Web.HttpCacheability" /> setting made on the server.
        /// </summary>
        public bool? AllowResponseInBrowserHistory
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the specified <see cref="T:System.Web.HttpCacheability" /> value.
        /// </summary>
        public HttpCacheability? Cacheability
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a list of cache extension values.
        /// </summary>
        public IReadOnlyCollection<string> CacheExtensions
        {
            get
            {
                return this.cacheExtensions;
            }
        }

        /// <summary>
        /// Gets the ETag HTTP header.
        /// </summary>
        public string ETag
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the absolute expiration time.
        /// </summary>
        public DateTime? Expires
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a value indicating whether the ETag HTTP header is generated based on the time stamps of the handler's file dependencies.
        /// </summary>
        public bool GenerateEtagFromFiles
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a value indicating whether the Last-Modified HTTP header is generated based on the time stamps of the handler's file dependencies.
        /// </summary>
        public bool GenerateLastModifiedFromFiles
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the Last-Modified HTTP header value.
        /// </summary>
        public DateTime? LastModified
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the Cache-Control: max-age HTTP header value.
        /// </summary>
        public TimeSpan? MaxAge
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a value indicating whether all origin-server caching is stopped for the current response.
        /// </summary>
        public bool NoServerCaching
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a value indicating whether the Cache-Control: no-store HTTP header is set.
        /// </summary>
        public bool NoStore
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a value indicating whether the Cache-Control: no-transform HTTP header is set.
        /// </summary>
        public bool NoTransforms
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a value indicating whether the response contains the vary:* header when caching varies by parameters.
        /// </summary>
        public bool? OmitVaryStar
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the Cache-Control: s-maxage HTTP header value.
        /// </summary>
        public TimeSpan? ProxyMaxAge
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the Cache-Control HTTP header revalidation value.
        /// </summary>
        public HttpCacheRevalidation? Revalidation
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a value indicating whether the cache expiration is set to absolute or sliding.
        /// </summary>
        public bool? SlidingExpiration
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a list of registered validation callbacks.
        /// </summary>
        public IReadOnlyCollection<Tuple<HttpCacheValidateHandler, object>> ValidationCallbacks
        {
            get
            {
                return this.validationCallbacks;
            }
        }

        /// <summary>
        /// Gets a value indicating whether the ASP.NET cache should ignore HTTP Cache-Control headers that are sent by the client that invalidate the cache.
        /// </summary>
        public bool? ValidUntilExpires
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the list of Content-Encoding headers that are used to vary the output cache.
        /// </summary>
        public override HttpCacheVaryByContentEncodings VaryByContentEncodings
        {
            get
            {
                return this.varyByContentEncodings;
            }
        }

        /// <summary>
        /// Gets the text string by which cached output responses are varied.
        /// </summary>
        public string VaryByCustom
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the list of all HTTP headers that are used to vary cache output.
        /// </summary>
        public override HttpCacheVaryByHeaders VaryByHeaders
        {
            get
            {
                return this.varyByHeaders;
            }
        }

        /// <summary>
        /// Gets the list of parameters that are received by an HTTP GET or POST verb that affect caching.
        /// </summary>
        public override HttpCacheVaryByParams VaryByParams
        {
            get
            {
                return this.varyByParams;
            }
        }

        /// <summary>
        /// Registers a validation callback for the current response.
        /// </summary>
        /// <param name="handler">The object that will handle the request.</param>
        /// <param name="data">The user-supplied data that is passed to the <see cref="M:System.Web.HttpCachePolicyBase.AddValidationCallback(System.Web.HttpCacheValidateHandler,System.Object)" /> delegate.</param>
        public override void AddValidationCallback(HttpCacheValidateHandler handler, object data)
        {
            if (handler == null)
            {
                throw new ArgumentNullException(nameof(handler));
            }

            this.validationCallbacks.Add(new Tuple<HttpCacheValidateHandler, object>(handler, data));
        }

        /// <summary>
        /// Appends the specified text to the Cache-Control HTTP header.
        /// </summary>
        /// <param name="extension">The text to append to the Cache-Control header.</param>
        public override void AppendCacheExtension(string extension)
        {
            if (extension == null)
            {
                throw new ArgumentNullException(nameof(extension));
            }

            this.cacheExtensions.Add(extension);
        }

        /// <summary>
        /// Makes the response available in the browser history cache, regardless of the <see cref="T:System.Web.HttpCacheability" /> setting made on the server.
        /// </summary>
        /// <param name="allow">true to direct the client browser to store responses in the browser history cache; otherwise false.</param>
        public override void SetAllowResponseInBrowserHistory(bool allow)
        {
            this.AllowResponseInBrowserHistory = allow;
        }

        /// <summary>
        /// Sets the Cache-Control header to the specified <see cref="T:System.Web.HttpCacheability" /> value.
        /// </summary>
        /// <param name="cacheability">The <see cref="T:System.Web.HttpCacheability" /> enumeration value to set the header to.</param>
        public override void SetCacheability(HttpCacheability cacheability)
        {
            this.Cacheability = cacheability;
        }

        /// <summary>
        /// Sets the Cache-Control header to the specified <see cref="T:System.Web.HttpCacheability" /> value and appends an extension to the directive.
        /// </summary>
        /// <param name="cacheability">The <see cref="T:System.Web.HttpCacheability" /> enumeration value to set the header to.</param>
        /// <param name="field">The cache-control extension to add to the header.</param>
        public override void SetCacheability(HttpCacheability cacheability, string field)
        {
            if (field == null)
            {
                throw new ArgumentNullException(nameof(field));
            }

            this.Cacheability = cacheability;
            this.cacheExtensions.Add(field);
        }

        /// <summary>
        /// Sets the ETag HTTP header to the specified string.
        /// </summary>
        /// <param name="etag">The text to use for the ETag header.</param>
        public override void SetETag(string etag)
        {
            if (etag == null)
            {
                throw new ArgumentNullException(nameof(etag));
            }

            if (this.ETag != null)
            {
                throw new InvalidOperationException("ETag is already set.");
            }

            if (this.GenerateEtagFromFiles)
            {
                throw new InvalidOperationException("Cannot set ETag and also generate it from files.");
            }

            this.ETag = etag;
        }

        /// <summary>
        /// Sets the ETag HTTP header based on the time stamps of the handler's file dependencies.
        /// </summary>
        public override void SetETagFromFileDependencies()
        {
            if (this.ETag != null)
            {
                throw new InvalidOperationException("Cannot set ETag and also generate it from files.");
            }

            this.GenerateEtagFromFiles = true;
        }

        /// <summary>
        /// Sets the Expires HTTP header to an absolute date and time.
        /// </summary>
        /// <param name="date">The absolute expiration time.</param>
        public override void SetExpires(DateTime date)
        {
            this.Expires = date;
        }

        /// <summary>
        /// Sets the Last-Modified HTTP header to the specified date and time.
        /// </summary>
        /// <param name="date">The date-time value to set the Last-Modified header to.</param>
        public override void SetLastModified(DateTime date)
        {
            this.LastModified = date;
        }

        /// <summary>
        /// Sets the Last-Modified HTTP header based on the time stamps of the handler's file dependencies.
        /// </summary>
        public override void SetLastModifiedFromFileDependencies()
        {
            this.GenerateLastModifiedFromFiles = true;
        }

        /// <summary>
        /// Sets the Cache-Control: max-age HTTP header to the specified time span.
        /// </summary>
        /// <param name="delta">The time span to set the Cache-Control: max-age header to.</param>
        public override void SetMaxAge(TimeSpan delta)
        {
            if (delta < TimeSpan.Zero)
            {
                throw new ArgumentOutOfRangeException(nameof(delta));
            }

            this.MaxAge = delta;
        }

        /// <summary>
        /// Stops all origin-server caching for the current response.
        /// </summary>
        public override void SetNoServerCaching()
        {
            this.NoServerCaching = true;
        }

        /// <summary>
        /// Sets the Cache-Control: no-store HTTP header.
        /// </summary>
        public override void SetNoStore()
        {
            this.NoStore = true;
        }

        /// <summary>
        /// Sets the Cache-Control: no-transform HTTP header.
        /// </summary>
        public override void SetNoTransforms()
        {
            this.NoTransforms = true;
        }

        /// <summary>
        /// Specifies whether the response contains the vary:* header when caching varies by parameters.
        /// </summary>
        /// <param name="omit">true to direct the <see cref="T:System.Web.HttpCachePolicy" /> object not to use the * value for its <see cref="P:System.Web.HttpCachePolicy.VaryByHeaders" /> property; otherwise, false.</param>
        public override void SetOmitVaryStar(bool omit)
        {
            this.OmitVaryStar = omit;
        }

        /// <summary>
        /// Sets the Cache-Control: s-maxage HTTP header to the specified time span.
        /// </summary>
        /// <param name="delta">The time span to set the Cache-Control: s-maxage header to.</param>
        public override void SetProxyMaxAge(TimeSpan delta)
        {
            if (delta < TimeSpan.Zero)
            {
                throw new ArgumentOutOfRangeException(nameof(delta));
            }

            this.ProxyMaxAge = delta;
        }

        /// <summary>
        /// Sets the Cache-Control HTTP header to either the must-revalidate or the proxy-revalidate directives, based on the specified enumeration value.
        /// </summary>
        /// <param name="revalidation">The <see cref="T:System.Web.HttpCacheRevalidation" /> enumeration value to set the Cache-Control header to.</param>
        public override void SetRevalidation(HttpCacheRevalidation revalidation)
        {
            this.Revalidation = revalidation;
        }

        /// <summary>
        /// Sets cache expiration to absolute or sliding.
        /// </summary>
        /// <param name="slide">true to set a sliding cache expiration, or false to set an absolute cache expiration.</param>
        public override void SetSlidingExpiration(bool slide)
        {
            this.SlidingExpiration = slide;
        }

        /// <summary>
        /// Specifies whether the ASP.NET cache should ignore HTTP Cache-Control headers that are sent by the client that invalidate the cache.
        /// </summary>
        /// <param name="validUntilExpires">true to specify that ASP.NET should ignore Cache-Control invalidation headers; otherwise, false.</param>
        public override void SetValidUntilExpires(bool validUntilExpires)
        {
            this.ValidUntilExpires = validUntilExpires;
        }

        /// <summary>
        /// Specifies a text string to vary cached output responses by.
        /// </summary>
        /// <param name="custom">The text string to vary cached output by.</param>
        public override void SetVaryByCustom(string custom)
        {
            if (custom == null)
            {
                throw new ArgumentNullException(nameof(custom));
            }

            if (this.VaryByCustom != null)
            {
                throw new InvalidOperationException("VaryByCustom is already set.");
            }

            this.VaryByCustom = custom;
        }
    }
}


text:
### Product introduce
Ncurion is a container-based, standardized detection engine that protects the nature of intrusion detection and improves performance, changing in the cyber market.
It is a high-performance security monitoring solution that can effectively respond to network attacks. network, OS, web, application, etc. vulnerability-based
It can detect attacks, various types of network attacks, and malicious code.

### Product introduce
1. It supports automated installation with container-based engines and is an optimized solution for cloud environments.
2. It can be installed on software-based general-purpose hardware, ensuring fast scalability when needed.
3. It consists of a high-performance detection engine that supports user-defined signatures including PCRE.
4. It uses the latest network virtualization technology to collect packets with high performance even in virtualized environments.
5. It provides Json-style detection logs and easily works with SIEMs such as SPLUNK and ELASTIC.


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Graphis scripta f. horizontalis Leight.

### Remarks
null


text:
import os
import unittest
import warnings
from pymatgen.util.testing import PymatgenTest
from pymatgen.analysis.transition_state import NEBAnalysis
import json
from pymatgen.analysis.transition_state import combine_neb_plots

"""
TODO: Modify unittest doc.
"""

__author__ = "David Waroquiers"
__copyright__ = "Copyright 2016, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyam Dwaraknath"
__email__ = "shyamd@lbl.gov"
__date__ = "2/5/16"

test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..",
                        'test_files', 'neb_analysis')

class NEBAnalysisTest(PymatgenTest):

    def setUp(self):
        warnings.simplefilter("ignore")

    def tearDown(self):
        warnings.simplefilter("default")

    def runTest(self):
        neb_analysis1 = NEBAnalysis.from_dir(os.path.join
                                             (test_dir, 'neb1', 'neb'))
        neb_analysis1_from_dict = NEBAnalysis.from_dict(neb_analysis1.as_dict())
        json_data = json.dumps(neb_analysis1.as_dict())

        neb_dict = json.loads(json_data)
        neb_analysis1_from_json_data = NEBAnalysis.from_dict(neb_dict)

        self.assertArrayAlmostEqual(neb_analysis1.energies[0], -255.97992669000001)
        self.assertArrayAlmostEqual(neb_analysis1.energies[3], -255.84261996000001)
        self.assertArrayAlmostEqual(neb_analysis1.r, neb_analysis1_from_dict.r)
        self.assertArrayAlmostEqual(neb_analysis1.energies, neb_analysis1_from_dict.energies)
        self.assertArrayAlmostEqual(neb_analysis1.forces, neb_analysis1_from_dict.forces)
        self.assertEqual(neb_analysis1.structures, neb_analysis1_from_dict.structures)

        self.assertArrayAlmostEqual(neb_analysis1.r, neb_analysis1_from_json_data.r)
        self.assertArrayAlmostEqual(neb_analysis1.energies, neb_analysis1_from_json_data.energies)
        self.assertArrayAlmostEqual(neb_analysis1.forces, neb_analysis1_from_json_data.forces)
        self.assertEqual(neb_analysis1.structures, neb_analysis1_from_json_data.structures)

        self.assertArrayAlmostEqual(neb_analysis1.get_extrema()[1][0], (0.50023335723480078, 325.20043063935128))

        neb_analysis1.setup_spline(spline_options={'saddle_point': 'zero_slope'})
        self.assertArrayAlmostEqual(neb_analysis1.get_extrema()[1][0], (0.50023335723480078, 325.20003984140203))
        with open(os.path.join(test_dir, 'neb2', 'neb_analysis2.json'),
                  'r') as f:
            neb_analysis2_dict = json.load(f)
        neb_analysis2 = NEBAnalysis.from_dict(neb_analysis2_dict)
        self.assertArrayAlmostEqual(neb_analysis2.get_extrema()[1][0], (0.37255257367467326, 562.40825334519991))

        neb_analysis2.setup_spline(spline_options={'saddle_point': 'zero_slope'})
        self.assertArrayAlmostEqual(neb_analysis2.get_extrema()[1][0], (0.30371133723478794, 528.46229631648691))

    def test_combine_neb_plots(self):
        neb_dir = os.path.join(test_dir, 'neb1', 'neb')
        neb_analysis = NEBAnalysis.from_dir(neb_dir)
        combine_neb_plots([neb_analysis, neb_analysis])

if __name__ == '__main__':
    unittest.main()


text:
using System;
using System.Net.Http;

namespace Rest
{
    #region HTTP Methods
    /// <summary>
    /// Indicates the <see cref="HttpMethod"/> of the request, and its relative (or absolute) url.
    /// When inherited, the static <see cref="Method"/> property must be set to something else.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public abstract class HttpMethodAttribute : Attribute
    {
        public static HttpMethod Method { get { return null; } }

        public string Path { get; protected set; }

        public HttpMethodAttribute(string path)
        {
            Path = path;
        }
    }

    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class GetAttribute : HttpMethodAttribute
    {
        public static new HttpMethod Method { get { return HttpMethod.Get; } }

        /// <summary>
        /// Make a <see cref="HttpMethod.Get"/> request.
        /// </summary>
        public GetAttribute(string path) : base(path) { }
    }

    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class PostAttribute : HttpMethodAttribute
    {
        public static new HttpMethod Method { get { return HttpMethod.Post; } }

        /// <summary>
        /// Make a <see cref="HttpMethod.Post"/> request.
        /// </summary>
        public PostAttribute(string path) : base(path) { }
    }

    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class PutAttribute : HttpMethodAttribute
    {
        public static new HttpMethod Method { get { return HttpMethod.Put; } }

        /// <summary>
        /// Make a <see cref="HttpMethod.Put"/> request.
        /// </summary>
        public PutAttribute(string path) : base(path) { }
    }

    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class DeleteAttribute : HttpMethodAttribute
    {
        public static new HttpMethod Method { get { return HttpMethod.Delete; } }

        /// <summary>
        /// Make a <see cref="HttpMethod.Delete"/> request.
        /// </summary>
        public DeleteAttribute(string path) : base(path) { }
    }

    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class PatchAttribute : HttpMethodAttribute
    {
        public static new HttpMethod Method { get { return new HttpMethod("Patch"); } }

        /// <summary>
        /// Make a PATCH request.
        /// </summary>
        public PatchAttribute(string path) : base(path) { }
    }

    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class HeadAttribute : HttpMethodAttribute
    {
        public static new HttpMethod Method { get { return HttpMethod.Head; } }

        /// <summary>
        /// Make a <see cref="HttpMethod.Head"/> request.
        /// </summary>
        public HeadAttribute(string path) : base(path) { }
    }
    #endregion

    #region Alias & Body & Query
    [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
    public class BodyAttribute : Attribute
    {
        /// <summary>
        /// Indicates a HTTP request message body, that will be serialized and set to <see cref="HttpRequestMessage.Content"/>.
        /// </summary>
        public BodyAttribute()
        {
        }
    }

    [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
    public class QueryAttribute : Attribute
    {
        public string Name { get; protected set; }

        /// <summary>
        /// Indicates a HTTP request message query, such as "?id=azerty".
        /// </summary>
        public QueryAttribute(string name)
        {
            this.Name = name;
        }

        /// <summary>
        /// Indicates a HTTP request message query, such as "?id=azerty".
        /// </summary>
        public QueryAttribute()
        {
            this.Name = null;
        }
    }

    [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
    public class AliasAttribute : Attribute
    {
        public string Name { get; protected set; }

        /// <summary>
        /// Indicates an alias for this parameter. Used when the provided url
        /// has missing parts, ie "/user/{username}".
        /// If a parameter is already named username, you can use the alias attribute instead.
        /// </summary>
        public AliasAttribute(string name)
        {
            this.Name = name;
        }
    }
    #endregion

    #region Header(s)
    [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
    public class HeaderAttribute : Attribute
    {
        public string Name { get; private set; }
        public string Value { get; private set; }

        /// <summary>
        /// As a method attribute, indicates that the header will be removed.
        /// As a class attribute, indicates that this header will be used in every request,
        /// except if overriden by another <see cref="HeaderAttribute"/>.
        /// As a parameter attribute, throws.
        /// </summary>
        public HeaderAttribute(string name, string value)
        {
            Name = name;
            Value = value;
        }

        /// <summary>
        /// As a parameter attribute, indicates that the header will have the value
        /// specified by <see cref="Name"/>.
        /// As a method attribute, throws.
        /// As a class attribute, throws.
        /// </summary>
        public HeaderAttribute(string name)
        {
            Name = name;
        }
    }

    [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
    public class HeadersAttribute : Attribute
    {
        /// <summary>
        /// Indicates that the given value (must be IDictionary{string,object}) will
        /// set multiple headers.
        /// </summary>
        public HeadersAttribute()
        {
        }
    }
    #endregion

    #region Misc (Service, ServiceFor, RestClient)
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class ServiceForAttribute : Attribute
    {
        public string Address { get; protected set; }

        /// <summary>
        /// Indicates that this class will be used for HTTP requests.
        /// Overriden by a <see cref="HttpClient"/> marked with the attribute <see cref="RestClientAttribute"/>.
        /// </summary>
        /// <remarks>
        /// If the <see cref="HttpClient"/> is generated by Rest.Fody and the class implements <see cref="IDisposable"/>,
        /// the <see cref="HttpClient"/> will be disposed after disposing this class.
        /// </remarks>
        /// <param name="address"><see cref="HttpClient.BaseAddress"/></param>
        public ServiceForAttribute(string address)
        {
            Address = address;
        }
    }

    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class ServiceAttribute : Attribute
    {
        /// <summary>
        /// Indicates that this class will be used for HTTP requests.
        /// Must have a <see cref="HttpClient"/> property marked with the attribute <see cref="RestClientAttribute"/>.
        /// </summary>
        public ServiceAttribute()
        {
        }
    }

    /// <summary>
    /// Indicates that this <see cref="HttpClient"/> will be used to make requests.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public class RestClientAttribute : Attribute
    {
        public RestClientAttribute()
        {
        }
    }
    #endregion

    #region Serializer / Deserializer
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class RestSerializerAttribute : Attribute
    {
        /// <summary>
        /// Indicates that this method (static or instance) will be used to serialize
        /// an object into <see cref="string"/> or <see cref="byte[]"/>.
        /// </summary>
        public RestSerializerAttribute()
        {
        }
    }

    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class RestDeserializerAttribute : Attribute
    {
        /// <summary>
        /// Indicates that this method (static or instance) will be used to deserialize
        /// a <see cref="string"/> or <see cref="byte[]"/> into an object.
        /// </summary>
        public RestDeserializerAttribute()
        {
        }
    }
    #endregion

    #region After / Before Hooks
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class BeforeSendAttribute : Attribute
    {
        /// <summary>
        /// Indicates that this method will be called before sending a request.
        /// Takes a single parameter: <see cref="HttpRequestMessage"/>.
        /// </summary>
        public BeforeSendAttribute()
        {
        }
    }

    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class AfterSendAttribute : Attribute
    {
        /// <summary>
        /// Indicates that this method will be called after receiving a successful response.
        /// Takes a single parameter: <see cref="HttpResponseMessage"/>.
        /// </summary>
        public AfterSendAttribute()
        {
        }
    }
    #endregion
}


text:
<readable><title>953941506_5082c9160c</title><content>
A Beagle dog is walking on the shoreline at the beach .
A beagle walking on the beach next to some waves .
A beagle walks along the calm shore .
The beagle is on a beach walking along the shoreline
The beagle is walking on the beach at the waterline .
</content></readable>


text:
This is the specification for the JSON serialization for zcl. zcl is a system
for defining configuration languages for applications. The zcl information
model is designed to support multiple concrete syntaxes for configuration,
and this JSON-based format complements [the native syntax](../zclsyntax/spec.md)
by being easy to machine-generate, whereas the native syntax is oriented
towards human authoring and maintenence.

This syntax is defined in terms of JSON as defined in
[RFC7159](https://tools.ietf.org/html/rfc7159). As such it inherits the JSON
grammar as-is, and merely defines a specific methodology for interpreting
JSON constructs into zcl structural elements and expressions.

This mapping is defined such that valid JSON-serialized zcl input can be
produced using standard JSON implementations in various programming languages.
_Parsing_ such JSON has some additional constraints not beyond what is normally
supported by JSON parsers, though adaptations are defined to allow processing
with an off-the-shelf JSON parser with certain caveats, described in later
sections.

## Structural Elements

The zcl language-agnostic information model defines a _body_ as an abstract
container for attribute definitions and child blocks. A body is represented
in JSON as a JSON _object_.

As defined in the language-agnostic model, body processing is done in terms
of a schema which provides context for interpreting the body's content. For
JSON bodies, the schema is crucial to allow differentiation of attribute
definitions and block definitions, both of which are represented via object
properties.

The special property name `"//"`, when used in an object representing a zcl
body, is parsed and ignored. A property with this name can be used to
include human-readable comments. (This special property name is _not_
processed in this way for any _other_ zcl constructs that are represented as
JSON objects.)

### Attributes

Where the given schema describes an attribute with a given name, the object
property with the matching name — if present — serves as the attribute's
definition.

When a body is being processed in the _dynamic attributes_ mode, each object
property serves as an attribute definition for the attribute whose name
matches the property name.

The value of an attribute definition property is interpreted as an _expression_,
as described in a later section.

Given a schema that calls for an attribute named "foo", a JSON object like
the following provides a definition for that attribute:

```json
{
  "foo": "bar baz"
}
```

### Blocks

Where the given schema describes a block with a given type name, the object
property with the matching name — if present — serves as a definition of
zero or more blocks of that type.

Processing of child blocks is in terms of nested JSON objects and arrays.
If the schema defines one or more _labels_ for the block type, a nested
object is required for each labelling level, with the object keys serving as
the label values at that level.

After any labelling levels, the next nested value is either a JSON object
representing a single block body, or a JSON array of JSON objects that each
represent a single block body. Use of an array accommodates the definition
of multiple blocks that have identical type and labels.

Given a schema that calls for a block type named "foo" with no labels, the
following JSON objects are all valid definitions of zero or more blocks of this
type:

```json
{
  "foo": {
    "child_attr": "baz"
  }
}
```

```json
{
  "foo": [
    {
      "child_attr": "baz"
    },
    {
      "child_attr": "boz"
    }
  ]
}
```
```json
{
  "foo": []
}
```

The first of these defines a single child block of type "foo". The second
defines _two_ such blocks. The final example shows a degenerate definition
of zero blocks, though generators should prefer to omit the property entirely
in this scenario.

Given a schema that calls for a block type named "foo" with _two_ labels, the
extra label levels must be represented as objects as in the following examples:

```json
{
  "foo": {
    "bar": {
      "baz": {
        "child_attr": "baz"
      },
      "boz": {
        "child_attr": "baz"
      }
    },
    "boz": {
      "baz": {
        "child_attr": "baz"
      },
    }
  }
}
```
```json
{
  "foo": {
    "bar": {
      "baz": {
        "child_attr": "baz"
      },
      "boz": {
        "child_attr": "baz"
      }
    },
    "boz": {
      "baz": [
        {
          "child_attr": "baz"
        },
        {
          "child_attr": "boz"
        }
      ]
    }
  }
}
```

Where multiple definitions are included for the same type and labels, the
JSON array is always the value of the property representing the final label,
and contains objects representing block bodies. It is not valid to use an array
at any other point in the block definition structure.

## Expressions

JSON lacks a native expression syntax, so the zcl JSON syntax instead defines
a mapping for each of the JSON value types, including a special mapping for
strings that allows optional use of arbitrary expressions.

### Objects

When interpreted as an expression, a JSON object represents a value of a zcl
object type.

Each property of the JSON object represents an attribute of the zcl object type.
The object type is constructed by enumerating the JSON object properties,
creating for each an attribute whose name exactly matches the property name,
and whose type is the result of recursively applying the expression mapping
rules.

An instance of the constructed object type is then created, whose values
are interpreted by again recursively applying the mapping rules defined in
this section.

It is an error to define the same property name multiple times within a single
JSON object interpreted as an expression.

### Arrays

When interpreted as an expression, a JSON array represents a value of a zcl
tuple type.

Each element of the JSON array represents an element of the zcl tuple type.
The tuple type is constructed by enumerationg the JSON array elements, creating
for each an element whose type is the result of recursively applying the
expression mapping rules. Correspondance is preserved between the array element
indices and the tuple element indices.

An instance of the constructed tuple type is then created, whose values are
interpreted by again recursively applying the mapping rules defined in this
section.

### Numbers

When interpreted as an expression, a JSON number represents a zcl number value.

zcl numbers are arbitrary-precision decimal values, so an ideal implementation
of this specification will translate exactly the value given to a number of
corresponding precision.

In practice, off-the-shelf JSON parsers often do not support customizing the
processing of numbers, and instead force processing as 32-bit or 64-bit
floating point values with a potential loss of precision. It is permissable
for a zcl JSON parser to pass on such limitations _if and only if_ the
available precision and other constraints are defined in its documentation.
Calling applications each have differing precision requirements, so calling
applications are free to select an implementation with more limited precision
capabilities should high precision not be required for that application.

### Boolean Values

The JSON boolean values `true` and `false`, when interpreted as expressions,
represent the corresponding zcl boolean values.

### The Null Value

The JSON value `null`, when interpreted as an expression, represents a
zcl null value of the dynamic pseudo-type.

### Strings

When intepreted as an expression, a JSON string may be interpreted in one of
two ways depending on the evaluation mode.

If evaluating in literal-only mode (as defined by the syntax-agnostic
information model) the literal string is intepreted directly as a zcl string
value, by directly using the exact sequence of unicode characters represented.
Template interpolations and directives MUST NOT be processed in this mode,
allowing any characters that appear as introduction sequences to pass through
literally:

```json
"Hello world! Template sequences like ${ are not intepreted here."
```

When evaluating in full expression mode (again, as defined by the syntax-
agnostic information model) the literal string is instead interpreted as a
_standalone template_ in the zcl Native Syntax. The expression evaluation
result is then the direct result of evaluating that template with the current
variable scope and function table.

```json
"Hello, ${name}! Template sequences are interpreted in full expression mode."
```

In particular the _Template Interpolation Unwrapping_ requirement from the
zcl native syntax specification must be implemented, allowing the use of
single-interpolation templates to represent expressions that would not
otherwise be representable in JSON, such as the following example where
the result must be a number, rather than a string representation of a number:

```json
"${ a + b }"
```