text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;

using Poderosa.Util;
using Granados;

namespace Poderosa.Protocols {
    /// <summary>
    /// <ja>
    /// ターミナル接続のためのパラメータを示すインターフェイスです。
    /// </ja>
    /// <en>
    /// Interface that shows parameter for terminal connection.
    /// </en>
    /// </summary>
    /// <remarks>
    /// <ja>
    /// <seealso cref="ITCPParameter">ITCPParameter</seealso>、
    /// <seealso cref="ISSHLoginParameter">ISSHLoginParameter</seealso>
    /// <seealso cref="ICygwinParameter">ICygwinParameter</seealso>は、GetAdapterメソッドを使って
    /// このITerminalParameterへと変換できます。
    /// </ja>
    /// <en>
    /// <seealso cref="ITCPParameter">ITCPParameter</seealso>,
    /// <seealso cref="ISSHLoginParameter">ISSHLoginParameter</seealso>,
    /// <seealso cref="ICygwinParameter">ICygwinParameter</seealso> can be converted to ITerminalParameter by GetAdapter method.
    /// </en>
    /// </remarks>
    public interface ITerminalParameter : IAdaptable, ICloneable {
        /// <summary>
        /// <ja>
        /// 内部幅です。
        /// </ja>
        /// <en>
        /// Internal width.
        /// </en>
        /// </summary>
        int InitialWidth {
            get;
        }
        /// <summary>
        /// <ja>
        /// 内部高さです。
        /// </ja>
        /// <en>
        /// Internal height.
        /// </en>
        /// </summary>
        int InitialHeight {
            get;
        }
        /// <summary>
        /// <ja>ターミナルタイプです。</ja>
        /// <en>Terminal type.</en>
        /// </summary>
        string TerminalType {
            get;
        }
        /// <summary>
        /// <ja>ターミナル名を設定します。</ja>
        /// <en>Set the terminal name.</en>
        /// </summary>
        /// <param name="terminaltype"><ja>設定するターミナル名</ja><en>Terminal name to set.</en></param>
        void SetTerminalName(string terminaltype);
        /// <summary>
        /// <ja>
        /// ターミナルのサイズを変更します。
        /// </ja>
        /// <en>
        /// Change the terminal size.
        /// </en>
        /// </summary>
        /// <param name="width"><ja>変更後の幅</ja><en>Width after it changes</en></param>
        /// <param name="height"><ja>変更後の高さ</ja><en>Height after it changes</en></param>
        void SetTerminalSize(int width, int height);

        /// <summary>
        /// <ja>
        /// 2つのインターフェイスが「見た目として」同じであるかどうかを調べます。
        /// </ja>
        /// <en>
        /// Comparing two interfaces examine and "Externals" examines be the same.
        /// </en>
        /// </summary>
        /// <param name="t"><ja>比較対象となるオブジェクト</ja><en>Object to exemine</en></param>
        /// <returns><en>Result of comparing. If it is equal, return true. </en><ja>比較結果。等しいならtrue</ja></returns>
        /// <remarks>
        /// <ja>
        /// <para>
        /// 「見た目として」とは、SSHプロトコルのバージョンの違いなど、「接続先を比較する場合」
        /// の同一視を意味します。
        /// </para>
        /// <para>
        /// MRUプラグインではこのメソッドを利用して、些細な違いの項目が複数個、最近使った接続の部分に表示されてしまうことを防いでいます。
        /// </para>
        /// </ja>
        /// <en>
        /// <para>
        /// "Externals" means one seeing of "The connection destinations are compared" of the difference etc. of the version of the SSH protocol.
        /// </para>
        /// <para>
        /// The item of a trifling difference is two or more pieces, and it is prevented from being displayed by using this method in the MRU plug-in in the part of the connection used recently.
        /// </para>
        /// </en>
        /// </remarks>
        bool UIEquals(ITerminalParameter t);
    }

    /// <summary>
    /// <ja>
    /// TelnetまたはSSH接続の共通のパラメータです。
    /// </ja>
    /// <en>
    /// Common parameters for the telnet or the SSH connection.
    /// </en>
    /// </summary>
    /// <remarks>
    /// <en>
    /// <para>
    /// Default parameter of Telnet connnection can be got by <see cref="Poderosa.Protocols.IProtocolService.CreateDefaultTelnetParameter">CreateDefaultTelnetParameter method</see> on <seealso cref="IProtocolService">IProtocolService</seealso>
    /// </para>
    /// <para>
    /// This interface can be convater to <seealso cref="ITerminalParameter">ITerminalParameter</seealso> by GetAdapter method.
    /// </para>
    /// </en>
    /// <ja>
    /// <para>
    /// デフォルトのTelnet接続パラメータは、<seealso cref="IProtocolService">IProtocolService</seealso>の
    /// <see cref="Poderosa.Protocols.IProtocolService.CreateDefaultTelnetParameter">CreateDefaultTelnetParameterメソッド</see>を使って取得できます。
    /// </para>
    /// <para>
    /// このインターフェイスは、GetAdapterメソッドを使うことで、<seealso cref="ITerminalParameter">ITerminalParameter</seealso>
    /// へと変換できます。
    /// </para>
    /// </ja>
    /// </remarks>
    public interface ITCPParameter : IAdaptable, ICloneable {
        /// <summary>
        /// <ja>
        /// 接続先のホスト名(またはIPアドレス)です。
        /// </ja>
        /// <en>
        /// Hostname or IP Address to connect.
        /// </en>
        /// </summary>
        string Destination {
            get;
            set;
        }
        /// <summary>
        /// <ja>
        /// 接続先のポート番号です。
        /// </ja>
        /// <en>
        /// Port number to connect.
        /// </en>
        /// </summary>
        int Port {
            get;
            set;
        }
    }

    /// <summary>
    /// Telnet-specific parameters.
    /// </summary>
    public interface ITelnetParameter {

        /// <summary>
        /// Whether the "New Line" code of the telnet protocol is used for sending CR+LF.
        /// </summary>
        bool TelnetNewLine {
            get;
            set;
        }
    }

    /// <summary>
    /// <ja>
    /// SSH接続時のログインパラメータを示すインターフェイスです。
    /// </ja>
    /// <en>
    /// Inteface that show the login parameter on SSH connection.
    /// </en>
    /// </summary>
    /// <remarks>
    /// <ja>
    /// <para>
    /// デフォルトのSSH接続パラメータは、<seealso cref="IProtocolService">IProtocolService</seealso>の
    /// <see cref="IProtocolService.CreateDefaultSSHParameter">CreateDefaultSSHParameterメソッド</see>を使って取得できます。
    /// </para>
    /// <para>
    /// 接続先のホスト名やポート番号は、GetAdapterメソッドを用いて<seealso cref="ITCPParameter">ITCPParameter</seealso>へと
    /// 変換して設定します。
    /// </para>
    /// <para>
    /// このインターフェイスは、GetAdapterメソッドを使うことで、<seealso cref="ITerminalParameter">ITerminalParameter</seealso>
    /// へと変換できます。
    /// </para>
    /// </ja>
    /// <en>
    /// <para>
    /// Default parameter of SSH connnection can be got by > by <see cref="Poderosa.Protocols.IProtocolService.CreateDefaultSSHParameter">CreateDefaultTelnetParameter method</see> on<seealso cref="IProtocolService">IProtocolService</seealso>
    /// </para>
    /// <para>
    /// The host name and the port number at the connection destination are converted into <seealso cref="ITCPParameter">ITCPParameter</seealso> by using the GetAdapter method and set.
    /// </para>
    /// <para>
    /// This interface can be convater to <seealso cref="ITerminalParameter">ITerminalParameter</seealso> by GetAdapter method.
    /// </para>
    /// </en>
    /// </remarks>
    public interface ISSHLoginParameter : IAdaptable, ICloneable {
        /// <summary>
        /// <ja>SSHプロトコルのバージョンです。</ja>
        /// <en>Version of the SSH protocol.</en>
        /// </summary>
        SSHProtocol Method {
            get;
            set;
        }
        /// <summary>
        /// <ja>
        /// 認証方式です。
        /// </ja>
        /// <en>
        /// Authentification method.
        /// </en>
        /// </summary>
        AuthenticationType AuthenticationType {
            get;
            set;
        }
        /// <summary>
        /// <ja>
        /// ログインするアカウント名(ユーザー名)です。
        /// </ja>
        /// <en>
        /// Account name (User name) to login.
        /// </en>
        /// </summary>
        string Account {
            get;
            set;
        }
        /// <summary>
        /// <ja>ユーザの認証に使用する秘密鍵のファイル名です。</ja>
        /// <en>Private key file name to use to user authentification.</en>
        /// </summary>
        /// <remarks>
        /// <ja>
        /// このプロパティは、AuthenticationTypeがAutehnticationType.PublicKeyのときのみ使われます。
        /// </ja>
        /// <en>
        /// This property is used when AuthenticationType is AutehnticationType.PublicKey only.
        /// </en>
        /// </remarks>
        string IdentityFileName {
            get;
            set;
        }
        /// <summary>
        /// <ja>
        /// パスワードまたはパスフレーズです。
        /// </ja>
        /// <en>
        /// Password or passphrase
        /// </en>
        /// </summary>
        /// <remarks>
        /// <ja>
        /// AuthenticationTypeプロパティがAuthenticationType.Passwordのときには「パスワード」を、
        /// AuthenticationType.PublicKeyのときには「パスフレーズ」を設定します。
        /// AuthenticationType.KeyboardInteractiveのときには、このプロパティは無視されます。
        /// </ja>
        /// <en>
        /// Set password when AuthenticationType is AuthenticationType.Password, and, set passphrase when AuthenticationType.PublicKey.
        /// This property is ignored if it is AuthenticationType.KeyboardInteractive.
        /// </en>
        /// </remarks>
        string PasswordOrPassphrase {
            get;
            set;
        }
        //ユーザにパスワードを入力させるかどうか。trueのときはPasswordOrPassphraseは使用しない
        /// <summary>
        /// <ja>
        /// ユーザーに パスワードを入力させるかどうかのフラグです。
        /// </ja>
        /// <en>
        /// Flag whether to make user input password
        /// </en>
        /// </summary>
        /// <remarks>
        /// <ja>trueの場合、PasswordOrPassphraseプロパティは使われません。</ja><en>If it is true, PasswordOrPassphrase property is not used.</en>
        /// </remarks>
        /// <exclude/>
        bool LetUserInputPassword {
            get;
            set;
        }

        /// <summary>
        ///
        /// </summary>
        /// <exclude/>
        IAgentForward AgentForward {
            get;
            set;
        }
    }

    /// <summary>
    /// </summary>
    /// <exclude/>
    public interface ISSHSubsystemParameter : IAdaptable, ICloneable {
        string SubsystemName {
            get;
            set;
        }
    }

    /// <summary>
    /// <ja>
    /// Cygwin接続するときに使われるパラメータを示すインターフェイスです。
    /// </ja>
    /// <en>
    /// Interface that show the parameter using on Cygwin connection.
    /// </en>
    /// </summary>
    /// <remarks>
    /// <ja>
    /// <para>
    /// このインターフェイスは、<seealso cref="IProtocolService">IProtocolService</seealso>の
    /// <see cref="IProtocolService.CreateDefaultCygwinParameter">CreateDefaultCygwinParameterメソッド</see>
    /// を呼び出すことで取得できます。
    /// </para>
    /// <para>
    /// このインターフェイスは、GetAdapterメソッドを使うことで、<seealso cref="ITerminalParameter">ITerminalParameter</seealso>
    /// へと変換できます。
    /// </para>
    /// </ja>
    /// <en>
    /// <para>
    /// This interface can be  got using <see cref="IProtocolService.CreateDefaultCygwinParameter">CreateDefaultCygwinParameter method</see> on <seealso cref="IProtocolService">IProtocolService</seealso>.
    /// </para>
    /// <para>
    /// This interface is convert to <seealso cref="ITerminalParameter">ITerminalParameter</seealso> by GetAdapter method.
    /// </para>
    /// </en>
    /// </remarks>
    public interface ICygwinParameter : IAdaptable, ICloneable {
        /// <summary>
        /// <ja>
        /// シェルの名前を取得/設定します。
        /// </ja>
        /// <en>
        /// Get / set shell name.
        /// </en>
        /// </summary>
        string ShellName {
            get;
            set;
        }
        /// <summary>
        /// <ja>
        /// ホームディレクトリを取得/設定します。
        /// </ja>
        /// <en>
        /// Get / set the home directory.
        /// </en>
        /// </summary>
        string Home {
            get;
            set;
        }
        /// <summary>
        /// <ja>
        /// シェルから引数部分を取り除いたコマンド部分だけを返します。
        /// </ja>
        /// <en>
        /// Only the command part where the argument part was removed from the shell is returned.
        /// </en>
        /// </summary>
        string ShellBody {
            get;
        }
        /// <summary>
        /// <ja>
        /// Cygwinの場所を取得/設定します。
        /// 設定されない場合はレジストリから検出します。
        /// </ja>
        /// <en>
        /// Get or Set path where Cygwin is installed.
        /// If this property was not set, the path will be detected from the registry entry.
        /// </en>
        /// </summary>
        string CygwinDir {
            get;
            set;
        }
    }

    /// <summary>
    /// <ja>
    /// マクロの自動実行のパラメータを示すインターフェイスです。
    /// </ja>
    /// <en>
    /// This interface represents parameters for macro auto execution.
    /// </en>
    /// </summary>
    public interface IAutoExecMacroParameter : IAdaptable, ICloneable {
        /// <summary>
        /// <ja>
        /// 接続後に自動実行するマクロのパス。未指定のときはnull。
        /// </ja>
        /// <en>
        /// Path to a macro which will be run automatically after the connection was established.
        /// Null if it is not specified.
        /// </en>
        /// </summary>
        String AutoExecMacroPath {
            get;
            set;
        }
    }
}


text:
//-----------------------------------------------
//
//	This file is part of the Siv3D Engine.
//
//	Copyright (c) 2008-2022 Ryo Suzuki
//	Copyright (c) 2016-2022 OpenSiv3D Project
//
//	Licensed under the MIT License.
//
//-----------------------------------------------

# include <Siv3D/ZIPReader.hpp>
# include "ZIPReaderDetail.hpp"

namespace s3d
{
	ZIPReader::ZIPReader()
		: pImpl{ std::make_shared<ZIPReaderDetail>() }
	{

	}

	ZIPReader::ZIPReader(const FilePathView path)
		: ZIPReader{}
	{
		open(path);
	}

	ZIPReader::~ZIPReader()
	{
		// do nothing
	}

	bool ZIPReader::open(const FilePathView path)
	{
		return pImpl->open(path);
	}

	void ZIPReader::close()
	{
		pImpl->close();
	}

	bool ZIPReader::isOpen() const noexcept
	{
		return pImpl->isOpen();
	}

	ZIPReader::operator bool() const noexcept
	{
		return pImpl->isOpen();
	}

	const Array<FilePath>& ZIPReader::enumPaths() const
	{
		return pImpl->enumPaths();
	}

	bool ZIPReader::extractAll(const FilePathView targetDirectory) const
	{
		return pImpl->extractAll(targetDirectory);
	}

	bool ZIPReader::extractFiles(const StringView pattern, const FilePathView targetDirectory) const
	{
		return pImpl->extract(pattern, targetDirectory);
	}

	MemoryReader ZIPReader::extract(const FilePathView filePath) const
	{
		return MemoryReader{ pImpl->extractToBlob(filePath) };
	}

	Blob ZIPReader::extractToBlob(const FilePathView filePath) const
	{
		return pImpl->extractToBlob(filePath);
	}
}

redpajama_set_name: RedPajamaGithub


text:
Lightweight .Net class for parsing, and comparison of Semantic versioning.

Supports Maven Range Enforcer rules for comparing versions.
#### Release History

1.1.0 (2015-01-16)

Extracted most logic into new VersionBase class.  This allows for better implementations of specific versioning variants (e.g. Semantic, and .Net Version).  VersionBase implements a relaxed Semantic Version set of validation, while SemanticVersion and NetVersion classes implement their specific strict validations. You can use VersionBase for most use-cases

Support for string versions on either side of comparison operators

Support for comparisons with .Net System.Version

HashTag.Versioning extension to retrieve either Semantic Version or System.Version from assembly

RangeEnforcer supports matching rules with native .Net System.Version and can be used independently of HashTag.Versioning

1.0.0 (2015-01-09)

Initial release

## Versioning Summary

### Semantic Versions

Semantic versioning describes a pattern for developers to understand the impact of binary assembly versions and
for programs to demand and/or react to binary packages they are consuming.

A semantic version consists of:

`MAJOR.MINOR.PATCH[-PreRelease][+Build]`

* MAJOR version when you make incompatible API changes.  (Required non-negative integer)
* MINOR version when you add functionality in a backwards-compatible manner (Required non-negative integer)
* PATCH version when you make backwards-compatible bug fixes (Required non-negative integer)
* A PreRelease version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version
* Build metadata MAY be denoted by appending a plus sign and a series of dot separated identifiers immediately following the patch or pre-release version.

#### Version Examples

1.0.0
2.4.1-alpha
2.4.1-alpha.2.45
0.1.2+build.14122301
1.1.2-rc.1+3837

#### Precedence

 Precedence is determined by the first difference when comparing each identifiers from left to right as follows:

1. Major, minor, and patch versions are always compared numerically.
1. A PreRelease version has lower precedence than a normal non-PreRelease version
2. Compare dot separated prerelease identifiers as follows:
	* Identifiers consisting of only digits are compared numerically
	* Identifiers with letters or hyphens are compared lexically in ASCII sort order
	* Numeric identifiers always have lower precedence than non-numeric identifiers
	* A larger set of pre-release fields has a higher precedence than a smaller set, if all of the preceding identifiers are equal
2. Build qualifiers are not considered in precedence

#### Precedence Examples

````C#
1.0.0 < 1.0.1
1.0.0 < 1.0.0-rc.1
1.0.0+12345 = 1.0.0+5678 -- build qualifiers not considered in precedence
1.0.0-alpha < 1.0.0-alpha.01
1.0.0-alpha.1 < 1.0.0-alpha.12
1.0.0-alpha.1 < 1.0.0-alpha.X
1.0.0-alpha < 1.0.0-rc.1
````

Note: Semantic versioning information is reproduced from SemVer.org for simplicity.  For more complete information please visit the [Semantic Version](http://www.semver.org) site

## Range Comparisons

Range comparisons provide concise syntax for specifying a range of valid semantic versions.  The syntax is easily embedded into configuration, XML, or other types of textual representations.

[Nuget.org](http://docs.nuget.org/docs/reference/versioning) also uses this syntax in the .nuspec file for specifying package dependency versions that are valid for a specific version of a project

A ranges are defined with delimited minimum,maximum pairs with either being optional.

*	`'('`,`')'` indicate exclusivity
*	`'['`,`']'` indicate inclusivity
*	`','` (comma) within a min,max pair is an AND operator
*	`','` (comma) between min,max pairs is an OR operator
*	min or max are optional but not both within the same pair
*	min/max values may contain any valid Semantic Version (e.g. Major.Minor.Patch-PreRelease+Build)
*	pairs are processed left to right until a matching rule is found.

####Examples

| Range | Meaning |
| ----- | ------- |
| `1.0` | x >= 1.0 * The default Maven meaning for 1.0 is everything (,) but with 1.0 recommended. Obviously this doesn't work for enforcing versions, so it has been redefined as a minimum version. |
| `(,1.0]` |	x <= 1.0 |
| `(,1.0)` |	x < 1.0 |
| `[1.0]`	| x == 1.0 |
| `[1.0,)` |	x >= 1.0 |
| `(1.0,)` |	x > 1.0 |
| `(1.0,2.0)` |	1.0 < x < 2.0 |
| `[1.0,2.0]`	| 1.0 <= x <= 2.0 |
| `(,1.0],[1.2,)`	| x <= 1.0 or x >= 1.2. Multiple sets are comma-separated |
| `(,1.1),(1.1,)`	| x != 1.1 |

Note: This information is reproduced from apache.org for simplicity.  For more complete information please visit the [Apache Range Specification](http://maven.apache.org/enforcer/enforcer-rules/versionRanges.html) site

# Installation & Usage

----------

* Add NuGet package [HashTag Semantic Versions](http://www.nuget.org/packages/HashTag.Versioning)

## Semantic Version

````C#
using HashTag.Versioning;
...
var version1 = SemanticVersion.Parse("1.1.0-alpha01")
var version2 = SemanticVersion.Parse("1.2.0");
if (version1 > version2)
{
	// do something here
}
````

Supports the following operators: `==`, `!=`, `>`, `>`, `>=`, `<`, `<=`

You can use correctly formatted version strings instead of strong types.  This might make code more readable in certain situations.

###### NOTE: String variants ("1.1.1") are slightly slower since they parse the string before performing the requested operation.  In most use-cases the performance impact should be negligible.

````C#
if (version > "1.0" && version < "1.1.1" || version == "2.0.0") //inline conversions
{
	// do something
}

// using strings in variable assignments

SemanticVersion explicitlyTypedVersion = "2.1-alpha";
var implicitlyTypedVariable = (SemanticVersion)"1.3.2+build123";

// string operations
var ver = new SemtanticVersion("1.2.3-beta");
if (string.Compare("1.2.3",ver) == 0)
{
	// do something
}
````

## Range Comparison

````C#
using HashTag.Versioning;
...
var versionRange = new MavenRangeEnforcer("[1.0.0,2.0.0)"); //1.x versions only
if (versionRange.Matches("1.2.1")) //match found
{
	// do something here
}

var version = new SemanticVersion("2.0.0");
if (versionRange.Matches(verson)) //match not found
{
	// do exclusive action here
}
````
## Using System.Version

### Simple Comparision
````C#
using HashTag.Versioning;

var hashTagVersion = new SemanticVersion("1.1") //alt: NetVersion or VersionBase
var netVersion = new System.Version("2.0")

if (hashTagVersion < netVersion)
{
	// do true action
}
````

### Semantic Version Limitations
If you use the SemanticVersion class to compare and/or assign to .Net version, the SemanticVersion instances must be in valid .Net Version format.

````C#
using HashTag.Versioning;

Version dotNetVersion = new SemanticVersion("1.1.0-alpha01"); //fail due to PrePrelease qualifier
Version dotNetVersion = new SemanticVersion("1.1.0+12"); //fail due to Build qualifier.
````


text:
import * as actions from "./collapsible-menu.actions";
import { addOrUpdate, pluckOut } from "../core";


text:
'use strict';

module.exports = {
	IsPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type',
	IsAccessorDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor',
	IsDataDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor',
	IsGenericDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor',
	FromPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor',
	ToPropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertydescriptor',
	CompletePropertyDescriptor: 'https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor',
	ToPrimitive: 'https://ecma-international.org/ecma-262/6.0/#sec-toprimitive',
	ToBoolean: 'https://ecma-international.org/ecma-262/6.0/#sec-toboolean',
	ToNumber: 'https://ecma-international.org/ecma-262/6.0/#sec-tonumber',
	ToInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-tointeger',
	ToInt32: 'https://ecma-international.org/ecma-262/6.0/#sec-toint32',
	ToUint32: 'https://ecma-international.org/ecma-262/6.0/#sec-touint32',
	ToInt16: 'https://ecma-international.org/ecma-262/6.0/#sec-toint16',
	ToUint16: 'https://ecma-international.org/ecma-262/6.0/#sec-touint16',
	ToInt8: 'https://ecma-international.org/ecma-262/6.0/#sec-toint8',
	ToUint8: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8',
	ToUint8Clamp: 'https://ecma-international.org/ecma-262/6.0/#sec-touint8clamp',
	ToString: 'https://ecma-international.org/ecma-262/6.0/#sec-tostring',
	ToObject: 'https://ecma-international.org/ecma-262/6.0/#sec-toobject',
	ToPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-topropertykey',
	ToLength: 'https://ecma-international.org/ecma-262/6.0/#sec-tolength',
	CanonicalNumericIndexString: 'https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring',
	RequireObjectCoercible: 'https://ecma-international.org/ecma-262/6.0/#sec-requireobjectcoercible',
	IsArray: 'https://ecma-international.org/ecma-262/6.0/#sec-isarray',
	IsCallable: 'https://ecma-international.org/ecma-262/6.0/#sec-iscallable',
	IsConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-isconstructor',
	IsExtensible: 'https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o',
	IsInteger: 'https://ecma-international.org/ecma-262/6.0/#sec-isinteger',
	IsPropertyKey: 'https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey',
	IsRegExp: 'https://ecma-international.org/ecma-262/6.0/#sec-isregexp',
	SameValue: 'https://ecma-international.org/ecma-262/6.0/#sec-samevalue',
	SameValueZero: 'https://ecma-international.org/ecma-262/6.0/#sec-samevaluezero',
	Get: 'https://ecma-international.org/ecma-262/6.0/#sec-get-o-p',
	GetV: 'https://ecma-international.org/ecma-262/6.0/#sec-getv',
	Set: 'https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw',
	CreateDataProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty',
	CreateMethodProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-createmethodproperty',
	CreateDataPropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow',
	DefinePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow',
	DeletePropertyOrThrow: 'https://ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow',
	GetMethod: 'https://ecma-international.org/ecma-262/6.0/#sec-getmethod',
	HasProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasproperty',
	HasOwnProperty: 'https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty',
	Call: 'https://ecma-international.org/ecma-262/6.0/#sec-call',
	Construct: 'https://ecma-international.org/ecma-262/6.0/#sec-construct',
	SetIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-setintegritylevel',
	TestIntegrityLevel: 'https://ecma-international.org/ecma-262/6.0/#sec-testintegritylevel',
	CreateArrayFromList: 'https://ecma-international.org/ecma-262/6.0/#sec-createarrayfromlist',
	CreateListFromArrayLike: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike',
	Invoke: 'https://ecma-international.org/ecma-262/6.0/#sec-invoke',
	OrdinaryHasInstance: 'https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance',
	SpeciesConstructor: 'https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor',
	EnumerableOwnNames: 'https://ecma-international.org/ecma-262/6.0/#sec-enumerableownnames',
	GetIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-getiterator',
	IteratorNext: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratornext',
	IteratorComplete: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete',
	IteratorValue: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue',
	IteratorStep: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep',
	IteratorClose: 'https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose',
	CreateIterResultObject: 'https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject',
	CreateListIterator: 'https://ecma-international.org/ecma-262/6.0/#sec-createlistiterator',
	Type: 'https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types',
	thisNumberValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object',
	thisTimeValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object',
	thisStringValue: 'https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object',
	RegExpExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpexec',
	RegExpBuiltinExec: 'https://ecma-international.org/ecma-262/6.0/#sec-regexpbuiltinexec',
	IsConcatSpreadable: 'https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable',
	IsPromise: 'https://ecma-international.org/ecma-262/6.0/#sec-ispromise',
	ArraySpeciesCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate',
	ObjectCreate: 'https://ecma-international.org/ecma-262/6.0/#sec-objectcreate',
	AdvanceStringIndex: 'https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex',
	NormalCompletion: 'https://ecma-international.org/ecma-262/6.0/#sec-normalcompletion'
};


text:
package net.abachar.kounach.entities;

/**
 *
 */
public class Device {

    /**
     *
     */
    private String mDeviceId;

    /**
     *
     */
    private String mDeviceName;

    public String getDeviceId() {
        return mDeviceId;
    }

    public void setDeviceId(String deviceId) {
        this.mDeviceId = deviceId;
    }

    public String getDeviceName() {
        return mDeviceName;
    }

    public void setDeviceName(String deviceName) {
        this.mDeviceName = deviceName;
    }
}


text:
package com.fasterxml.jackson.databind.deser.std;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;

import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonMappingException;

public class StackTraceElementDeserializer
    extends StdScalarDeserializer<StackTraceElement>
{
    private static final long serialVersionUID = 1L;

    protected final JsonDeserializer<?> _adapterDeserializer;

    @Deprecated // since 2.14
    public StackTraceElementDeserializer() {
        this(null);
    }

    protected StackTraceElementDeserializer(JsonDeserializer<?> ad)
    {
        super(StackTraceElement.class);
        _adapterDeserializer = ad;
    }

    /**
     * @since 2.14
     */
    public static JsonDeserializer<?> construct(DeserializationContext ctxt) throws JsonMappingException {
        // 26-May-2022, tatu: for legacy use, need to do this:
        if (ctxt == null) {
            return new StackTraceElementDeserializer();
        }
        JsonDeserializer<?> adapterDeser = ctxt.findNonContextualValueDeserializer(ctxt.constructType(Adapter.class));
        return new StackTraceElementDeserializer(adapterDeser);
    }

    @Override
    public StackTraceElement deserialize(JsonParser p, DeserializationContext ctxt) throws IOException
    {
        JsonToken t = p.currentToken();

        // Must get an Object
        if (t == JsonToken.START_OBJECT || t == JsonToken.FIELD_NAME) {
            Adapter adapted;
            // 26-May-2022, tatu: for legacy use, need to do this:
            if (_adapterDeserializer == null) {
                adapted = ctxt.readValue(p, Adapter.class);
            } else {
                adapted = (Adapter) _adapterDeserializer.deserialize(p, ctxt);
            }
            return constructValue(ctxt, adapted);
        } else if (t == JsonToken.START_ARRAY && ctxt.isEnabled(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)) {
            p.nextToken();
            final StackTraceElement value = deserialize(p, ctxt);
            if (p.nextToken() != JsonToken.END_ARRAY) {
                handleMissingEndArrayForSingle(p, ctxt);
            }
            return value;
        }
        return (StackTraceElement) ctxt.handleUnexpectedToken(_valueClass, p);
    }

    /**
     * @since 2.14
     */
    protected StackTraceElement constructValue(DeserializationContext ctxt,
            Adapter adapted)
    {
        return constructValue(ctxt, adapted.className, adapted.methodName,
                adapted.fileName, adapted.lineNumber,
                adapted.moduleName, adapted.moduleVersion,
                adapted.classLoaderName);
    }

    @Deprecated // since 2.9
    protected StackTraceElement constructValue(DeserializationContext ctxt,
            String className, String methodName, String fileName, int lineNumber,
            String moduleName, String moduleVersion) {
        return constructValue(ctxt, className, methodName, fileName, lineNumber,
                moduleName, moduleVersion, null);
    }

    /**
     * Overridable factory method used for constructing {@link StackTraceElement}s.
     *
     * @since 2.8
     */
    protected StackTraceElement constructValue(DeserializationContext ctxt,
            String className, String methodName, String fileName, int lineNumber,
            String moduleName, String moduleVersion, String classLoaderName)
    {
        // 21-May-2016, tatu: With Java 9, could use different constructor, probably
        //   via different module, and throw exception here if extra args passed
        return new StackTraceElement(className, methodName, fileName, lineNumber);
    }

    /**
     * Intermediate class used both for convenience of binding and
     * to support {@code PropertyNamingStrategy}.
     *
     * @since 2.14
     */
    public final static class Adapter {
        // NOTE: some String fields must not be nulls
        public String className = "", classLoaderName;
        public String declaringClass, format;
        public String fileName = "", methodName = "";
        public int lineNumber = -1;
        public String moduleName, moduleVersion;
        public boolean nativeMethod;
    }
}


text:
    ruby abcdefghppp.rb [width] [base]

If no width provided, the default width will be 4.
If no base provided, the default width will be `4 * width + 1`, which is the number of unknowns.

## Methodology

The solving method is by unification (use width 2 as example):

    AB - CD == EF
    EF + GH == III

First, we know that I must be 1.

Then, we can get a set of partial solutions by the constrain

    F + H == BASE + 1

This generates a set of possible solutions of {F, H, I}.

Then we can further expand them by

    E + G == BASE
    B - D == F or B - D + BASE == F
    if B < D:
        A - C - 1 == E
    else:
        A - C == E

This generates the whole set of solutions.

In the process of expanding solutions, the size of the set will first grow, then shrink due to the limit of possible remaining choices.

Lazy evaluation is used, so the program may generate the first 50 solutions almost instantly using very little memory space.

For the number of solutions, since only the count is recorded, the memory usage is still small.

## Possible improvements
 - Use immutable data structure to reduce the overhead for cloning array of a solution when expanding the solution set
 - Some cases should be redundant, e.g. ABCD - EFGH = IJKL, IJKL + MNOP = QQQQQ, some {(B, C), (F, G), (J, K), (N, O)} pairs should be interchangable, but that is affected by the carry, so will be complicated...
 - Lower the computational complexity?
 - Use another languages, Ruby is just slow...


text:
package com.google.common.graph;

import com.google.common.graph.GraphConstants.Presence;

/**
 * Standard implementation of {@link MutableGraph} that supports both directed and undirected
 * graphs. Instances of this class should be constructed with {@link GraphBuilder}.
 *
 * <p>Time complexities for mutation methods are all O(1) except for {@code removeNode(N node)},
 * which is in O(d_node) where d_node is the degree of {@code node}.
 *
 * @author James Sexton
 * @param <N> Node parameter type
 */
@ElementTypesAreNonnullByDefault
final class StandardMutableGraph<N> extends ForwardingGraph<N> implements MutableGraph<N> {
  private final MutableValueGraph<N, Presence> backingValueGraph;

  /** Constructs a {@link MutableGraph} with the properties specified in {@code builder}. */
  StandardMutableGraph(AbstractGraphBuilder<? super N> builder) {
    this.backingValueGraph = new StandardMutableValueGraph<>(builder);
  }

  @Override
  BaseGraph<N> delegate() {
    return backingValueGraph;
  }

  @Override
  public boolean addNode(N node) {
    return backingValueGraph.addNode(node);
  }

  @Override
  public boolean putEdge(N nodeU, N nodeV) {
    return backingValueGraph.putEdgeValue(nodeU, nodeV, Presence.EDGE_EXISTS) == null;
  }

  @Override
  public boolean putEdge(EndpointPair<N> endpoints) {
    validateEndpoints(endpoints);
    return putEdge(endpoints.nodeU(), endpoints.nodeV());
  }

  @Override
  public boolean removeNode(N node) {
    return backingValueGraph.removeNode(node);
  }

  @Override
  public boolean removeEdge(N nodeU, N nodeV) {
    return backingValueGraph.removeEdge(nodeU, nodeV) != null;
  }

  @Override
  public boolean removeEdge(EndpointPair<N> endpoints) {
    validateEndpoints(endpoints);
    return removeEdge(endpoints.nodeU(), endpoints.nodeV());
  }
}


text:
<?php

namespace app\models;

use Yii;

use app\models\general\GeneralLabel;
use app\models\general\GeneralMessage;

/**
 * This is the model class for table "tbl_bsp_elaun_latihan_praktikal_month".
 *
 * @property integer $bsp_elaun_latihan_praktikal_month_id
 * @property integer $bsp_elaun_latihan_praktikal_id
 * @property string $bulan
 * @property integer $jumlah_hari
 */
class BspElaunLatihanPraktikalMonth extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'tbl_bsp_elaun_latihan_praktikal_month';
    }

    public function behaviors()
    {
        return [
            'bedezign\yii2\audit\AuditTrailBehavior',
            [
                'class' => \yii\behaviors\BlameableBehavior::className(),
                'createdByAttribute' => 'created_by',
                'updatedByAttribute' => 'updated_by',
            ],
            [
                'class' => \yii\behaviors\TimestampBehavior::className(),
                'createdAtAttribute' => 'created',
                'updatedAtAttribute' => 'updated',
                'value' => new \yii\db\Expression('NOW()'),
            ],
        ];
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['bulan', 'jumlah_hari'], 'required', 'skipOnEmpty' => true, 'message' => GeneralMessage::yii_validation_required],
            [['bsp_elaun_latihan_praktikal_id', 'jumlah_hari'], 'integer', 'message' => GeneralMessage::yii_validation_integer],
            [['bulan'], 'safe'],
            [['bulan'], function ($attribute, $params) {
                if (!\common\models\general\GeneralFunction::validateXSS($this->$attribute)) {
                    $this->addError($attribute, GeneralMessage::yii_validation_xss);
                }
            }],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'bsp_elaun_latihan_praktikal_month_id' => GeneralLabel::bsp_elaun_latihan_praktikal_month_id,
            'bsp_elaun_latihan_praktikal_id' => GeneralLabel::bsp_elaun_latihan_praktikal_id,
            'bulan' => GeneralLabel::bulan,
            'jumlah_hari' => GeneralLabel::jumlah_hari,

        ];
    }
}


text:
"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
const DEFAULT_MAX_AGE = 180 * 24 * 60 * 60
function parseMaxAge(value = DEFAULT_MAX_AGE) {
	if (value >= 0 && Number.isFinite(value)) {
		return Math.floor(value)
	} else {
		throw new Error(`Strict-Transport-Security: ${JSON.stringify(value)} is not a valid value for maxAge. Please choose a positive integer.`)
	}
}
function getHeaderValueFromOptions(options) {
	if ("maxage" in options) {
		throw new Error("Strict-Transport-Security received an unsupported property, `maxage`. Did you mean to pass `maxAge`?")
	}
	if ("includeSubdomains" in options) {
		console.warn('Strict-Transport-Security middleware should use `includeSubDomains` instead of `includeSubdomains`. (The correct one has an uppercase "D".)')
	}
	if ("setIf" in options) {
		console.warn("Strict-Transport-Security middleware no longer supports the `setIf` parameter. See the documentation and <https://github.com/helmetjs/helmet/wiki/Conditionally-using-middleware> if you need help replicating this behavior.")
	}
	const directives = [`max-age=${parseMaxAge(options.maxAge)}`]
	if (options.includeSubDomains === undefined || options.includeSubDomains) {
		directives.push("includeSubDomains")
	}
	if (options.preload) {
		directives.push("preload")
	}
	return directives.join("; ")
}
function strictTransportSecurity(options = {}) {
	const headerValue = getHeaderValueFromOptions(options)
	return function strictTransportSecurityMiddleware(_req, res, next) {
		res.setHeader("Strict-Transport-Security", headerValue)
		next()
	}
}
module.exports = strictTransportSecurity
exports.default = strictTransportSecurity


text:
module Gzr
  module Connection

    def query_all_connections(fields=nil)
      data = nil
      begin
        data = @sdk.all_connections(fields ? {:fields=>fields} : nil )
      rescue LookerSDK::Error => e
          say_error "Error querying all_connections({:fields=>\"#{fields}\"})"
          say_error e.message
          raise
      end
      data
    end

    def query_all_dialects(fields=nil)
      data = nil
      begin
        data = @sdk.all_dialect_infos(fields ? {:fields=>fields} : nil )
      rescue LookerSDK::Error => e
          say_error "Error querying all_dialect_infos({:fields=>\"#{fields}\"})"
          say_error e.message
          raise
      end
      data
    end

  end
end


text:
namespace content {

FakeVRDevice::FakeVRDevice(VRDeviceProvider* provider) : VRDevice(provider) {
  device_ = mojom::VRDeviceInfo::New();
  state_ = mojom::VRSensorState::New();
}

FakeVRDevice::~FakeVRDevice() {
}

void FakeVRDevice::SetVRDevice(const mojom::VRDeviceInfoPtr& device) {
  device_ = device.Clone();
}

void FakeVRDevice::SetSensorState(const mojom::VRSensorStatePtr& state) {
  state_ = state.Clone();
}

VRDeviceInfoPtr FakeVRDevice::GetVRDevice() {
  return device_.Clone();
}

VRSensorStatePtr FakeVRDevice::GetSensorState() {
  return state_.Clone();
}

}  // namespace content


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

import { Injectable } from '@angular/core';
import { CoreLoggerProvider } from '@providers/logger';
import { CoreSitesProvider } from '@providers/sites';
import { CoreTextUtilsProvider } from '@providers/utils/text';
import { CoreTimeUtilsProvider } from '@providers/utils/time';
import { CoreUtilsProvider } from '@providers/utils/utils';
import { AddonModLessonProvider } from './lesson';

/**
 * Service to handle offline lesson.
 */
@Injectable()
export class AddonModLessonOfflineProvider {

    protected logger;

    // Variables for database. We use lowercase in the names to match the WS responses.
    static RETAKES_TABLE = 'addon_mod_lesson_retakes';
    static PAGE_ATTEMPTS_TABLE = 'addon_mod_lesson_page_attempts';
    protected tablesSchema = [
        {
            name: AddonModLessonOfflineProvider.RETAKES_TABLE,
            columns: [
                {
                    name: 'lessonid',
                    type: 'INTEGER',
                    primaryKey: true // Only 1 offline retake per lesson.
                },
                {
                    name: 'retake', // Retake number.
                    type: 'INTEGER',
                    notNull: true
                },
                {
                    name: 'courseid',
                    type: 'INTEGER'
                },
                {
                    name: 'finished',
                    type: 'INTEGER'
                },
                {
                    name: 'outoftime',
                    type: 'INTEGER'
                },
                {
                    name: 'timemodified',
                    type: 'INTEGER'
                },
                {
                    name: 'lastquestionpage',
                    type: 'INTEGER'
                },
            ]
        },
        {
            name: AddonModLessonOfflineProvider.PAGE_ATTEMPTS_TABLE,
            columns: [
                {
                    name: 'lessonid',
                    type: 'INTEGER',
                    notNull: true
                },
                {
                    name: 'retake', // Retake number.
                    type: 'INTEGER',
                    notNull: true
                },
                {
                    name: 'pageid',
                    type: 'INTEGER',
                    notNull: true
                },
                {
                    name: 'timemodified',
                    type: 'INTEGER',
                    notNull: true
                },
                {
                    name: 'courseid',
                    type: 'INTEGER'
                },
                {
                    name: 'data',
                    type: 'TEXT'
                },
                {
                    name: 'type',
                    type: 'INTEGER'
                },
                {
                    name: 'newpageid',
                    type: 'INTEGER'
                },
                {
                    name: 'correct',
                    type: 'INTEGER'
                },
                {
                    name: 'answerid',
                    type: 'INTEGER'
                },
                {
                    name: 'useranswer',
                    type: 'TEXT'
                },
            ],
            primaryKeys: ['lessonid', 'retake', 'pageid', 'timemodified'] // A user can attempt several times per page and retake.
        }
    ];

    constructor(logger: CoreLoggerProvider, private sitesProvider: CoreSitesProvider, private timeUtils: CoreTimeUtilsProvider,
            private textUtils: CoreTextUtilsProvider, private utils: CoreUtilsProvider) {
        this.logger = logger.getInstance('AddonModLessonOfflineProvider');

        this.sitesProvider.createTablesFromSchema(this.tablesSchema);
    }

    /**
     * Delete an offline attempt.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} retake Lesson retake number.
     * @param {number} pageId Page ID.
     * @param {number} timemodified The timemodified of the attempt.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any>} Promise resolved when done.
     */
    deleteAttempt(lessonId: number, retake: number, pageId: number, timemodified: number, siteId?: string): Promise<any> {
        return this.sitesProvider.getSite(siteId).then((site) => {
            return site.getDb().deleteRecords(AddonModLessonOfflineProvider.PAGE_ATTEMPTS_TABLE, {
                lessonid: lessonId,
                retake: retake,
                pageid: pageId,
                timemodified: timemodified
            });
        });
    }

    /**
     * Delete offline lesson retake.
     *
     * @param {number} lessonId Lesson ID.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any>} Promise resolved when done.
     */
    deleteRetake(lessonId: number, siteId?: string): Promise<any> {
        return this.sitesProvider.getSite(siteId).then((site) => {
            return site.getDb().deleteRecords(AddonModLessonOfflineProvider.RETAKES_TABLE, {lessonid: lessonId});
        });
    }

    /**
     * Delete offline attempts for a retake and page.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} retake Lesson retake number.
     * @param {number} pageId Page ID.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any>} Promise resolved when done.
     */
    deleteRetakeAttemptsForPage(lessonId: number, retake: number, pageId: number, siteId?: string): Promise<any> {
        return this.sitesProvider.getSite(siteId).then((site) => {
            return site.getDb().deleteRecords(AddonModLessonOfflineProvider.PAGE_ATTEMPTS_TABLE, {lessonid: lessonId,
                    retake: retake, pageid: pageId});
        });
    }

    /**
     * Mark a retake as finished.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} courseId Course ID the lesson belongs to.
     * @param {number} retake Retake number.
     * @param {boolean} finished  Whether retake is finished.
     * @param {boolean} outOfTime If the user ran out of time.
     * @param {string} [siteId]   Site ID. If not defined, current site.
     * @return {Promise<any>}           Promise resolved in success, rejected otherwise.
     */
    finishRetake(lessonId: number, courseId: number, retake: number, finished?: boolean, outOfTime?: boolean, siteId?: string)
            : Promise<any> {

        return this.sitesProvider.getSite(siteId).then((site) => {
            // Get current stored retake (if any). If not found, it will create a new one.
            return this.getRetakeWithFallback(lessonId, courseId, retake, site.id).then((entry) => {
                entry.finished = finished ? 1 : 0;
                entry.outoftime = outOfTime ? 1 : 0;
                entry.timemodified = this.timeUtils.timestamp();

                return site.getDb().insertRecord(AddonModLessonOfflineProvider.RETAKES_TABLE, entry);
            });
        });
    }

    /**
     * Get all the offline page attempts in a certain site.
     *
     * @param {string} [siteId] Site ID. If not set, use current site.
     * @return {Promise<any>} Promise resolved when the offline attempts are retrieved.
     */
    getAllAttempts(siteId?: string): Promise<any> {
        return this.sitesProvider.getSiteDb(siteId).then((db) => {
            return db.getAllRecords(AddonModLessonOfflineProvider.PAGE_ATTEMPTS_TABLE);
        }).then((attempts) => {
            return this.parsePageAttempts(attempts);
        });
    }

    /**
     * Get all the lessons that have offline data in a certain site.
     *
     * @param {string} [siteId] Site ID. If not set, use current site.
     * @return {Promise<any>} Promise resolved with an object containing the lessons.
     */
    getAllLessonsWithData(siteId?: string): Promise<any> {
        const promises = [],
            lessons = {};

        // Get the lessons from page attempts.
        promises.push(this.getAllAttempts(siteId).then((entries) => {
            this.getLessonsFromEntries(lessons, entries);
        }).catch(() => {
            // Ignore errors.
        }));

        // Get the lessons from retakes.
        promises.push(this.getAllRetakes(siteId).then((entries) => {
            this.getLessonsFromEntries(lessons, entries);
        }).catch(() => {
            // Ignore errors.
        }));

        return Promise.all(promises).then(() => {
            return this.utils.objectToArray(lessons);
        });
    }

    /**
     * Get all the offline retakes in a certain site.
     *
     * @param {string} [siteId] Site ID. If not set, use current site.
     * @return {Promise<any>} Promise resolved when the offline retakes are retrieved.
     */
    getAllRetakes(siteId?: string): Promise<any> {
        return this.sitesProvider.getSiteDb(siteId).then((db) => {
            return db.getAllRecords(AddonModLessonOfflineProvider.RETAKES_TABLE);
        });
    }

    /**
     * Retrieve the last offline attempt stored in a retake.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} retake Retake number.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any>} Promise resolved with the attempt (undefined if no attempts).
     */
    getLastQuestionPageAttempt(lessonId: number, retake: number, siteId?: string): Promise<any> {
        siteId = siteId || this.sitesProvider.getCurrentSiteId();

        return this.getRetakeWithFallback(lessonId, 0, retake, siteId).then((retakeData) => {
            if (!retakeData.lastquestionpage) {
                // No question page attempted.
                return;
            }

            return this.getRetakeAttemptsForPage(lessonId, retake, retakeData.lastquestionpage, siteId).then((attempts) => {
                // Return the attempt with highest timemodified.
                return attempts.reduce((a, b) => {
                    return a.timemodified > b.timemodified ? a : b;
                });
            });
        }).catch(() => {
            // Error, return undefined.
        });
    }

    /**
     * Retrieve all offline attempts for a lesson.
     *
     * @param {number} lessonId Lesson ID.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any[]>} Promise resolved with the attempts.
     */
    getLessonAttempts(lessonId: number, siteId?: string): Promise<any[]> {
        return this.sitesProvider.getSite(siteId).then((site) => {
            return site.getDb().getRecords(AddonModLessonOfflineProvider.PAGE_ATTEMPTS_TABLE, {lessonid: lessonId});
        }).then((attempts) => {
            return this.parsePageAttempts(attempts);
        });
    }

    /**
     * Given a list of DB entries (either retakes or page attempts), get the list of lessons.
     *
     * @param {any} lessons Object where to store the lessons.
     * @param {any[]} entries List of DB entries.
     */
    protected getLessonsFromEntries(lessons: any, entries: any[]): void {
        entries.forEach((entry) => {
            if (!lessons[entry.lessonid]) {
                lessons[entry.lessonid] = {
                    id: entry.lessonid,
                    courseId: entry.courseid
                };
            }
        });
    }

    /**
     * Get attempts for question pages and retake in a lesson.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} retake Retake number.
     * @param {boolean} [correct] True to only fetch correct attempts, false to get them all.
     * @param {number} [pageId] If defined, only get attempts on this page.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any[]>}  Promise resolved with the attempts.
     */
    getQuestionsAttempts(lessonId: number, retake: number, correct?: boolean, pageId?: number, siteId?: string): Promise<any[]> {
        let promise;

        if (pageId) {
            // Page ID is set, only get the attempts for that page.
            promise = this.getRetakeAttemptsForPage(lessonId, retake, pageId, siteId);
        } else {
            // Page ID not specified, get all the attempts.
            promise = this.getRetakeAttemptsForType(lessonId, retake, AddonModLessonProvider.TYPE_QUESTION, siteId);
        }

        return promise.then((attempts) => {
            if (correct) {
                return attempts.filter((attempt) => {
                    return !!attempt.correct;
                });
            }

            return attempts;
        });
    }

    /**
     * Retrieve a retake from site DB.
     *
     * @param {number} lessonId Lesson ID.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any>} Promise resolved with the retake.
     */
    getRetake(lessonId: number, siteId?: string): Promise<any> {
        return this.sitesProvider.getSite(siteId).then((site) => {
            return site.getDb().getRecord(AddonModLessonOfflineProvider.RETAKES_TABLE, {lessonid: lessonId});
        });
    }

    /**
     * Retrieve all offline attempts for a retake.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} retake   Retake number.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any[]>} Promise resolved with the retake attempts.
     */
    getRetakeAttempts(lessonId: number, retake: number, siteId?: string): Promise<any[]> {
        return this.sitesProvider.getSite(siteId).then((site) => {
            return site.getDb().getRecords(AddonModLessonOfflineProvider.PAGE_ATTEMPTS_TABLE, {lessonid: lessonId, retake: retake});
        }).then((attempts) => {
            return this.parsePageAttempts(attempts);
        });
    }

    /**
     * Retrieve offline attempts for a retake and page.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} retake   Lesson retake number.
     * @param {number} pageId   Page ID.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any>}         Promise resolved with the retake attempts.
     */
    getRetakeAttemptsForPage(lessonId: number, retake: number, pageId: number, siteId?: string): Promise<any[]> {
        return this.sitesProvider.getSite(siteId).then((site) => {
            return site.getDb().getRecords(AddonModLessonOfflineProvider.PAGE_ATTEMPTS_TABLE, {lessonid: lessonId, retake: retake,
                    pageid: pageId});
        }).then((attempts) => {
            return this.parsePageAttempts(attempts);
        });
    }

    /**
     * Retrieve offline attempts for certain pages for a retake.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} retake   Retake number.
     * @param {number} type     Type of the pages to get: TYPE_QUESTION or TYPE_STRUCTURE.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any>}         Promise resolved with the retake attempts.
     */
    getRetakeAttemptsForType(lessonId: number, retake: number, type: number, siteId?: string): Promise<any> {
        return this.sitesProvider.getSite(siteId).then((site) => {
            return site.getDb().getRecords(AddonModLessonOfflineProvider.PAGE_ATTEMPTS_TABLE, {lessonid: lessonId, retake: retake,
                    type: type});
        }).then((attempts) => {
            return this.parsePageAttempts(attempts);
        });
    }

    /**
     * Get stored retake. If not found or doesn't match the retake number, return a new one.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} courseId Course ID the lesson belongs to.
     * @param {number} retake Retake number.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any>} Promise resolved with the retake.
     */
    protected getRetakeWithFallback(lessonId: number, courseId: number, retake: number, siteId?: string): Promise<any> {
        // Get current stored retake.
        return this.getRetake(lessonId, siteId).then((retakeData) => {
            if (retakeData.retake != retake) {
                // The stored retake doesn't match the retake number, create a new one.
                return Promise.reject(null);
            }

            return retakeData;
        }).catch(() => {
            // No retake, create a new one.
            return {
                lessonid: lessonId,
                retake: retake,
                courseid: courseId,
                finished: 0
            };
        });
    }

    /**
     * Check if there is a finished retake for a certain lesson.
     *
     * @param {number} lessonId Lesson ID.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<boolean>} Promise resolved with boolean.
     */
    hasFinishedRetake(lessonId: number, siteId?: string): Promise<boolean> {
        return this.getRetake(lessonId, siteId).then((retake) => {
            return !!retake.finished;
        }).catch(() => {
            return false;
        });
    }

    /**
     * Check if a lesson has offline data.
     *
     * @param {number} lessonId Lesson ID.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<boolean>} Promise resolved with boolean.
     */
    hasOfflineData(lessonId: number, siteId?: string): Promise<boolean> {
        const promises = [];
        let hasData = false;

        promises.push(this.getRetake(lessonId, siteId).then(() => {
            hasData = true;
        }).catch(() => {
            // Ignore errors.
        }));

        promises.push(this.getLessonAttempts(lessonId, siteId).then((attempts) => {
            hasData = hasData || !!attempts.length;
        }).catch(() => {
            // Ignore errors.
        }));

        return Promise.all(promises).then(() => {
            return hasData;
        });
    }

    /**
     * Check if there are offline attempts for a retake.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} retake Retake number.
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<boolean>} Promise resolved with a boolean.
     */
    hasRetakeAttempts(lessonId: number, retake: number, siteId?: string): Promise<boolean> {
        return this.getRetakeAttempts(lessonId, retake, siteId).then((list) => {
            return !!list.length;
        }).catch(() => {
            return false;
        });
    }

    /**
     * Parse some properties of a page attempt.
     *
     * @param {any} attempt The attempt to treat.
     * @return {any} The treated attempt.
     */
    protected parsePageAttempt(attempt: any): any {
        attempt.data = this.textUtils.parseJSON(attempt.data);
        attempt.useranswer = this.textUtils.parseJSON(attempt.useranswer);

        return attempt;
    }

    /**
     * Parse some properties of some page attempts.
     *
     * @param {any[]} attempts The attempts to treat.
     * @return {any[]} The treated attempts.
     */
    protected parsePageAttempts(attempts: any[]): any[] {
        attempts.forEach((attempt) => {
            this.parsePageAttempt(attempt);
        });

        return attempts;
    }

    /**
     * Process a lesson page, saving its data.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} courseId Course ID the lesson belongs to.
     * @param {number} retake Retake number.
     * @param {any} page Page.
     * @param {any} data Data to save.
     * @param {number} newPageId New page ID (calculated).
     * @param {number} [answerId] The answer ID that the user answered.
     * @param {boolean} [correct] If answer is correct. Only for question pages.
     * @param {any} [userAnswer] The user's answer (userresponse from checkAnswer).
     * @param {string} [siteId] Site ID. If not defined, current site.
     * @return {Promise<any>} Promise resolved in success, rejected otherwise.
     */
    processPage(lessonId: number, courseId: number, retake: number, page: any, data: any, newPageId: number, answerId?: number,
            correct?: boolean, userAnswer?: any, siteId?: string): Promise<any> {

        return this.sitesProvider.getSite(siteId).then((site) => {
            const entry = {
                lessonid: lessonId,
                retake: retake,
                pageid: page.id,
                timemodified: this.timeUtils.timestamp(),
                courseid: courseId,
                data: data ? JSON.stringify(data) : null,
                type: page.type,
                newpageid: newPageId,
                correct: correct ? 1 : 0,
                answerid: Number(answerId),
                useranswer: userAnswer ? JSON.stringify(userAnswer) : null,
            };

            return site.getDb().insertRecord(AddonModLessonOfflineProvider.PAGE_ATTEMPTS_TABLE, entry);
        }).then(() => {
            if (page.type == AddonModLessonProvider.TYPE_QUESTION) {
                // It's a question page, set it as last question page attempted.
                return this.setLastQuestionPageAttempted(lessonId, courseId, retake, page.id, siteId);
            }
        });
    }

    /**
     * Set the last question page attempted in a retake.
     *
     * @param {number} lessonId Lesson ID.
     * @param {number} courseId Course ID the lesson belongs to.
     * @param {number} retake Retake number.
     * @param {number} lastPage ID of the last question page attempted.
     * @param {string} [siteId]  Site ID. If not defined, current site.
     * @return {Promise<any>} Promise resolved in success, rejected otherwise.
     */
    setLastQuestionPageAttempted(lessonId: number, courseId: number, retake: number, lastPage: number, siteId?: string)
            : Promise<any> {

        return this.sitesProvider.getSite(siteId).then((site) => {
            // Get current stored retake (if any). If not found, it will create a new one.
            return this.getRetakeWithFallback(lessonId, courseId, retake, site.id).then((entry) => {
                entry.lastquestionpage = lastPage;
                entry.timemodified = this.timeUtils.timestamp();

                return site.getDb().insertRecord(AddonModLessonOfflineProvider.RETAKES_TABLE, entry);
            });
        });
    }
}


text:
.no-click {
	pointer-events: none;
}
.single-page .address-box p .ion.on-flush {
    top: 2px;
}
.single-post .post-content img  {
	margin-right: 30px;
}
#gallery-heading.gallery-photo .gallery-slider.slick-slider .gallery-item {
	position: relative;
}

#directory .directory-link, #directory .sidebar .sidebar-alphabet .list-menu, #directory .sidebar .sidebar-menu .list-menu, #directory #sidebar .sidebar-alphabet .list-menu, #directory #sidebar .sidebar-menu .list-menu {
    margin: 0;
}

.paragraph-header {
	margin-bottom: 5px;
}

@media (min-width: 1200px) {
    .post-slider .post .post-title {
        max-height: 116px;
    }
}
@media (min-width: 1024px) {
    .post-slider.featured-content .post {
        max-height: 450px;
    }
    .photo-box .photo-item a img {
        width: 100%;
    }
	#newsfeed .post .entry-content p {
		 max-height: none;
		 overflow: auto;
	}
}
@media (min-width: 992px) {
    #gallery-heading .video-nav .video-item a {
        max-height: 149.8px;
        overflow: hidden;
    }
}
@media (min-width: 1024px) {
    .photo-box .photo-item a img {
        width: 100%;
    }
    .post-slider.featured-content .post-title {
        max-height: 86px;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }
    .post-slider.featured-content .entry-content {
        max-height: 72px;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }
}
@media (max-width: 1023px) {
    .post-slider.featured-content .post-title {
        max-height: 90px;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }
    #main-heading .featured-content .entry-content {
        display: -webkit-box;
    }
    .post-slider.featured-content .entry-content {
        max-height: 96px;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
    }
}
@media (max-width: 1023px) {
    #gallery .photo-box .photo-item:nth-child(2n+1) {
        clear: both;
    }
}
#content .share-box>li>a {
    margin-right: 5px;
}
.post-slider.featured-content .post-content {
    background-color: rgba(7,60,100,0.9);
}
.single-post .post-content .gallery-slider .gallery-item img {
    width: 100%;
}
.share-box>li>a.instagram {
    background-color: #4c68d7;
}
.share-box>li>a.instagram:hover {
    background-color: #3f5ed8;
}
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    padding-top: 25px;
    height: 0;
    margin-bottom: 15px;
}
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.header-fancy + #body .post-content > p > img {
    margin-right: 30px;
}
@media (max-width: 480px) {
    .header-fancy + #body .post-content > p > img {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
        height: auto;
        display: block;
        float: none;
    }
}
 #directory #content .directory-link.two-columns.column-right li {
    float: right;
}


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

namespace Shared.Dtos.Generators
{
    public class ExhibitionGenerateDto : BaseDto
    {
        public virtual Guid ExhibitionId { get; set; }
        public virtual GenerateFormat Format { get; set; }
    }
}


text:
import config from "../../config";
import Sequelize from "sequelize";

import * as Rx from 'rxjs';

//initilize the database
let sequelize = new Sequelize(config.sql.database, config.sql.username, config.sql.password, config.sql.options);

export default sequelize;

// Initialize sequelize
export function sequelizeConnect() {
	return Rx.Observable.create(observer => {
		sequelize.sync().then(function() {

		    observer.next();
		    observer.complete();

		}).catch(err => observer.error(err));
	});
};

export function sequelizeDisconnect() {

};


text:
namespace paddle {
namespace framework {
namespace ir {

const std::vector<std::string> churn_out_vars(ProgramDesc* prog,
                                              const std::string& prefix,
                                              int number) {
  auto v = std::vector<std::string>();
  for (int i = 0; i < number; ++i) {
    auto name = prefix + std::to_string(i);
    prog->MutableBlock(0)->Var(name);
    v.push_back(name);
  }
  return v;
}

void create_vars(ProgramDesc* prog,
                 const std::initializer_list<std::string>& names) {
  for (auto name : names) prog->MutableBlock(0)->Var(name);
}

void SetMultiGruOp(ProgramDesc* prog,
                   const std::string x,
                   const std::vector<std::string> wx,
                   const std::vector<std::string> wh,
                   const std::vector<std::string> b,
                   const std::string h,
                   int layers,
                   bool origin_mode) {
  auto* op = prog->MutableBlock(0)->AppendOp();
  op->SetType("multi_gru");
  op->SetInput("X", {x});
  op->SetInput("WeightX", wx);
  op->SetInput("WeightH", wh);
  op->SetInput("Bias", b);
  op->SetOutput("Hidden", {h});
  op->SetAttr("layers", layers);
  op->SetAttr("origin_mode", origin_mode);
}

// (x, wx1, wh1, b1) -> multi_gru1 -> h1
// (h1, wx2, wh2, b2) -> multi_gru2 -> h2
void MainTest(int layers1, int layers2, bool origin_mode1, bool origin_mode2) {
  ProgramDesc prog;

  // Create variables
  create_vars(&prog, {"x", "h1", "h2"});
  const std::vector<std::string> wx1 =
      churn_out_vars(&prog, "wx1", 2 * layers1);
  const std::vector<std::string> wx2 =
      churn_out_vars(&prog, "wx2", 2 * layers2);
  const std::vector<std::string> wh1 =
      churn_out_vars(&prog, "wh1", 2 * layers1);
  const std::vector<std::string> wh2 =
      churn_out_vars(&prog, "wh2", 2 * layers2);
  const std::vector<std::string> b1 = churn_out_vars(&prog, "b1", 2 * layers1);
  const std::vector<std::string> b2 = churn_out_vars(&prog, "b2", 2 * layers2);

  // Create program descriptor
  SetMultiGruOp(&prog, "x", wx1, wh1, b1, "h1", layers1, origin_mode1);
  SetMultiGruOp(&prog, "h1", wx2, wh2, b2, "h2", layers2, origin_mode2);

  // Apply pass
  std::unique_ptr<ir::Graph> graph(new ir::Graph(prog));
  Scope scope;
  graph->SetNotOwned(kParamScopeAttr, &scope);
  int original_nodes_num = graph->Nodes().size();
  auto pass = PassRegistry::Instance().Get("multi_gru_seq_fuse_pass");
  graph.reset(pass->Apply(graph.release()));
  int current_nodes_num = graph->Nodes().size();

  // Verify graph after fuse
  bool should_fuse = origin_mode1 == origin_mode2;
  int count_multi_gru = 0;
  auto layers = layers1;
  auto wx = wx1;
  auto wh = wh1;
  auto b = b1;
  auto h = "h1";
  if (should_fuse) {
    layers += layers2;
    wx.insert(wx.end(), wx2.begin(), wx2.end());
    wh.insert(wh.end(), wh2.begin(), wh2.end());
    b.insert(b.end(), b2.begin(), b2.end());
    h = "h2";
  }
  for (auto* node : graph->Nodes()) {
    if (node->IsOp()) {
      auto* op = node->Op();
      if (op->Type() == "multi_gru") {
        if (op->Input("X")[0] == "x") {
          EXPECT_EQ(op->GetAttrIfExists<int>("layers"), layers);
          EXPECT_EQ(op->Input("WeightX").size(), 2u * layers);
          EXPECT_EQ(op->Input("WeightH").size(), 2u * layers);
          EXPECT_EQ(op->Input("Bias").size(), 2u * layers);
          for (int i = 0; i < 2 * layers; ++i) {
            EXPECT_EQ(op->Input("WeightX")[i], wx[i]);
            EXPECT_EQ(op->Input("WeightH")[i], wh[i]);
            EXPECT_EQ(op->Input("Bias")[i], b[i]);
          }
          EXPECT_EQ(op->Output("Hidden")[0], h);
          EXPECT_EQ(op->GetAttrIfExists<bool>("origin_mode"), origin_mode1);
        } else {
          EXPECT_EQ(op->GetAttrIfExists<int>("layers"), layers2);
          EXPECT_EQ(op->Input("X")[0], "h1");
          EXPECT_EQ(op->Input("WeightX").size(), 2u * layers2);
          EXPECT_EQ(op->Input("WeightH").size(), 2u * layers2);
          EXPECT_EQ(op->Input("Bias").size(), 2u * layers2);
          for (int i = 0; i < 2 * layers2; ++i) {
            EXPECT_EQ(op->Input("WeightX")[i], wx2[i]);
            EXPECT_EQ(op->Input("WeightH")[i], wh2[i]);
            EXPECT_EQ(op->Input("Bias")[i], b2[i]);
          }
          EXPECT_EQ(op->Output("Hidden")[0], "h2");
          EXPECT_EQ(op->GetAttrIfExists<bool>("origin_mode"), origin_mode2);
        }
        ++count_multi_gru;
      }
    }
  }

  // If the fuse is applied, then:
  // nodes to be removed: 2x multi_gru + 1x hidden(output)
  // nodes to be added: multi_gru
  // If the fuse is not applied, then:
  // nodes to be removed: none
  // nodes to be added: none
  const int removed_nodes_count = should_fuse ? 3 : 0;
  const int added_nodes_count = should_fuse ? 1 : 0;

  EXPECT_EQ(original_nodes_num - removed_nodes_count + added_nodes_count,
            current_nodes_num);
  EXPECT_EQ(count_multi_gru, should_fuse ? 1 : 2);
}

TEST(MultiGruSeqFusePass, same_origin_modes_1) {
  int layers1 = 1;
  int layers2 = 1;
  bool origin_mode1 = false;
  bool origin_mode2 = false;
  MainTest(layers1, layers2, origin_mode1, origin_mode2);
}

TEST(MultiGruSeqFusePass, same_origin_modes_2) {
  int layers1 = 2;
  int layers2 = 3;
  bool origin_mode1 = false;
  bool origin_mode2 = false;
  MainTest(layers1, layers2, origin_mode1, origin_mode2);
}

TEST(MultiGruSeqFusePass, same_origin_modes_3) {
  int layers1 = 2;
  int layers2 = 1;
  bool origin_mode1 = true;
  bool origin_mode2 = true;
  MainTest(layers1, layers2, origin_mode1, origin_mode2);
}

TEST(MultiGruSeqFusePass, different_origin_modes) {
  int layers1 = 2;
  int layers2 = 2;
  bool origin_mode1 = true;
  bool origin_mode2 = false;
  MainTest(layers1, layers2, origin_mode1, origin_mode2);
}

}  // namespace ir
}  // namespace framework
}  // namespace paddle

USE_PASS(multi_gru_seq_fuse_pass);


text:
package com.rwtema.extrautils.gui;

import org.lwjgl.opengl.GL11;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.gui.inventory.GuiContainer;

public class GuiFilterPipe extends GuiContainer
{
    private static final ResourceLocation texture;

    public GuiFilterPipe(final IInventory player, final IInventory pipe) {
        super((Container)new ContainerFilterPipe(player, pipe));
        this.xSize = 175;
        this.ySize = 192;
    }

    protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
        GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
        this.mc.renderEngine.bindTexture(GuiFilterPipe.texture);
        final int k = (this.width - this.xSize) / 2;
        final int l = (this.height - this.ySize) / 2;
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
    }

    static {
        texture = new ResourceLocation("extrautils", "textures/guiSortingPipe.png");
    }
}


text:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
    <meta charset="utf-8"/>
    <meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>

    <link rel="alternate" type="application/atom+xml" title="{{ site.name }}" href="{{ site.baseurl }}/feed.xml">

    <title>{% if page.title %}{{ page.title }}{% else %}{{ site.name }}{% endif %}</title>

    <meta name="author" content="{{ site.author }}"/>
    <meta name="description" content="{% if page.share_description %}{{ page.share_description }}{% elsif page.path contains '_posts' %}{{ page.content | strip_html | xml_escape | truncate: 200 }}{% else %}{{ site.description }}{% endif %}">
    <meta name="keywords" content="{{ site.keywords }}">
    <meta name="robots" content="index,follow">
    <meta name="author" content="{{ site.author }}">
    <link rel="canonical" href="{{ site.url }}{{ page.url | replace:'index.html',''}}">

    <meta itemprop="image" content="{{ site.url }}/avatar.jpg">
    <link rel="image_src" href="{{ site.url }}/images/avatar.jpg">
    {% include head/favicons.html %}

    {% include head/social-networks/google-plus.html %}
    {% include head/social-networks/twitter.html %}
    {% include head/social-networks/open-graph.html %}

    {% include head/mobile/app-capables.html %}
    {% include head/mobile/msapplication.html %}
    {% include head/mobile/mobile-devices.html %}

    {% include head/webmasters-verifications.html %}

    <!--[if lt IE 9]>
    <script src="{{ site.baseurl }}/bower_components/html5shiv/dist/html5shiv.min.js"></script>
    <![endif]-->

    {% if page.disable_default_css %}{% else %}<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/css/style.css"/>{% endif %}

</head>

<body>


text:
/** @module vertx-web-js/user_session_handler */
var utils = require('vertx-js/util/utils');
var RoutingContext = require('vertx-web-js/routing_context');
var AuthProvider = require('vertx-auth-common-js/auth_provider');

var io = Packages.io;
var JsonObject = io.vertx.core.json.JsonObject;
var JUserSessionHandler = io.vertx.ext.web.handler.UserSessionHandler;

/**

 This handler should be used if you want to store the User object in the Session so it's available between
 different requests, without you having re-authenticate each time.

 It requires that the session handler is already present on previous matching routes.

 It requires an Auth provider so, if the user is deserialized from a clustered session it knows which Auth provider
 to associate the session with.

 @class
*/
var UserSessionHandler = function(j_val) {

  var j_userSessionHandler = j_val;
  var that = this;

  /**

   @public
   @param arg0 {RoutingContext}
   */
  this.handle = function(arg0) {
    var __args = arguments;
    if (__args.length === 1 && typeof __args[0] === 'object' && __args[0]._jdel) {
      j_userSessionHandler["handle(io.vertx.ext.web.RoutingContext)"](arg0._jdel);
    } else utils.invalidArgs();
  };

  // A reference to the underlying Java delegate
  // NOTE! This is an internal API and must not be used in user code.
  // If you rely on this property your code is likely to break if we change it / remove it without warning.
  this._jdel = j_userSessionHandler;
};

/**
 Create a new handler

 @memberof module:vertx-web-js/user_session_handler
 @param authProvider {AuthProvider} The auth provider to use
 @return {UserSessionHandler} the handler
 */
UserSessionHandler.create = function(authProvider) {
  var __args = arguments;
  if (__args.length === 1 && typeof __args[0] === 'object' && __args[0]._jdel) {
    return utils.convReturnVertxGen(JUserSessionHandler["create(io.vertx.ext.auth.AuthProvider)"](authProvider._jdel), UserSessionHandler);
  } else utils.invalidArgs();
};

// We export the Constructor function
module.exports = UserSessionHandler;


text:
UIManager::UIManager(sf::RenderWindow &window, StateManager &stateManager) : _window(window), _stateManager(stateManager) {
	_font.loadFromFile("Resources/Fonts/OpenSans-Bold.ttf");

	// Lives
	_lives_display.setString("Lives: 3/3");
	_lives_display.setFont(_font);
    _lives_display.setColor(sf::Color::White);
	_lives_display.setCharacterSize(30);
	_lives_display.setPosition(_window.getSize().x - 150, 5);

	// Score
	_score_display.setString("Score: 0");
	_score_display.setFont(_font);
    _score_display.setColor(sf::Color::White);
	_score_display.setCharacterSize(30);
	_score_display.setPosition(_window.getSize().x - 300, 5);

	// Coins
	_coins_display.setString("Coins: 0");
	_coins_display.setFont(_font);
    _coins_display.setColor(sf::Color::White);
	_coins_display.setCharacterSize(30);
	_coins_display.setPosition(_window.getSize().x - 450, 5);
}

void UIManager::update() {
	// Lives
	std::ostringstream lives_text;
	lives_text << "Lives: " << _stateManager.getLives() << "/3";
	_lives_display.setString(lives_text.str());

	// Points
	std::ostringstream points_text;
	points_text << "Points: " << _stateManager.getScore();
	_score_display.setString(points_text.str());

	// Coins
	std::ostringstream coins_text;
	coins_text << "Coins: " << _stateManager.getCoins();
	_coins_display.setString(coins_text.str());
}

void UIManager::render() {
	_window.draw(_lives_display);
	_window.draw(_score_display);
	_window.draw(_coins_display);
}


text:
package org.openspaces.grid.esm;

import java.util.concurrent.TimeUnit;

public class ESMInitializationTimeoutException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    public ESMInitializationTimeoutException(long timeout, TimeUnit timeUnit) {
        super("Esm initialization took more than " + timeout + " " + timeUnit);
    }
}


text:
'use strict';

/* jshint undef: true, unused: true, node: true */
/* global document, window */

/*
 * @author: wensen.lws
 * @description: the AMD module loader
 * @note: browser only
 */

var typeCheck = require('zero-lang/type');
var arrayUtils = require('zero-lang/array');
var Module = require('./Module');
var define = require('./define');
var path = require('./path');
var request = require('./request');

var doc = document;
var id2Uri = path.id2Uri;

var interactiveScript = undefined;
var data = Module._data;
var moduleByUri = data.moduleByUri;
var executedByUri = data.executedByUri;
var loadingByUri = data.loadingByUri = {};

Module.resolve = id2Uri;
Module.request = request;

function getCurrentScript() {
  if (Module.currentlyAddingScript) {
    return Module.currentlyAddingScript.src;
  }
  if (doc.currentScript) {
    // firefox 4+
    return doc.currentScript.src;
  }
  // reference: https://github.com/samyk/jiagra/blob/master/jiagra.js
  var stack = undefined;
  try {
    throw new Error();
  } catch (e) {
    // safari: only `line`, `sourceId` and `sourceURL`
    stack = e.stack;
    if (!stack && window.opera) {
      // opera 9 does not have `e.stack`, but `e.Backtrace`
      stack = (String(e).match(/of linked script \S+/g) || []).join(' ');
    }
  }
  if (stack) {
    /*
     * e.stack:
     * chrome23: at http://113.93.50.63/data.js:4:1
     * firefox17: @http://113.93.50.63/query.js:4
     * opera12: @http://113.93.50.63/data.js:4
     * IE10: at Global code (http://113.93.50.63/data.js:4:1)
     */
    stack = stack.split(/[@ ]/g).pop(); // at last line, after the last space or @
    stack = stack[0] === '(' ? stack.slice(1, -1) : stack;
    return stack.replace(/(:\d+)?:\d+$/i, '');
  }
  if (interactiveScript && interactiveScript.readyState === "interactive") {
    return interactiveScript.src;
  }
  var nodes = doc.getElementsByTagName('script');
  for (var i = 0, node; node = nodes[i++];) {
    if (node.readyState === 'interactive') {
      interactiveScript = node;
      return node.src;
    }
  }
}

var relativeIdCounter = 0;
var uuid = 0;

Module.on('module-meta-got', function (meta) {
  var src = getCurrentScript();
  if (src) {
    meta.uri = src;
  } else {
    meta.uri = data.cwd;
  }
  if (src === '' || typeCheck.isString(src) && src === data.cwd) {
    if (meta.id) {// named module in script tag
      // meta.id = './' + meta.id; // @FIXME
    } else {
        // script tag
        meta.uri = data.cwd + ('#' + uuid++);
      }
  }
}).on('module-initialised', function (mod) {
  if (!(typeCheck.isString(mod.uri) && mod.uri.indexOf('/') > -1)) {
    mod.uri = id2Uri(mod.id);
  }
  var uri = mod.uri;
  var id = mod.id || relativeIdCounter++;
  mod.relativeUri = uri.indexOf(id + '.') > -1 ? uri : id2Uri('./' + id, uri);
}).on('module-deps-processed', function (mod) {
  arrayUtils.each(mod.deps, function (id, index) {
    var uri = undefined;
    if (moduleByUri[id]) {
      uri = id;
    } else {
      uri = id2Uri(id, mod.relativeUri || mod.uri);
    }
    mod.deps[index] = uri;
    if (!moduleByUri[uri] && !loadingByUri[uri] && !executedByUri[uri]) {
      request(uri);
      loadingByUri[uri] = true;
    }
  });
});


text:
using namespace PinnedDownGameplay::Events;

const HashedString FightStartedEvent::FightStartedEventType = HashedString("FightStarted");


text:
Main Screen

Display - Here you see the meals available at the different counters of the selected mensa and days. If
enabled, the result of user votes is displayed below each meal.

Navigation - To navigate through days you can click on the arrows on top or use swipe gestures, if
enabled. To get back to today you can select menu > today or use the double tap gesture if enabled.

Data update - To update, press menu > update. If you have enabled auto updates this should not be
necessary.

Context Menu - Long press on a meal or the mensa location on top opens a context menu.
The latter menu shows a selection dialog for the mensa location. The context menu for a meal can show two entries.
First share with friends, to share a meal on Twitter, email and so on; and second a vote dialog (if
enabled and available for selected meal), where you can rate three aspects of your meal. Voting is only possible for
meals from the last days.

Settings

Mensa location - Here you can select the mensa you go to.

Delete old menu entries - if enabled, only data for this and next week is stored. Previous entries are
deleted. (With an App update old menu data can also get deleted, regardless of the selection here).

Auto update - Automatically updates meal data, if needed. This is recommended, if you have a permanent
internet connection.

Enable voting - EXERIMENTAL - With this enabled, you can rate different aspects of your meal.
 This option is only recommended if you have a permanent internet connection, as sending and updating is done
 automatically in background!

Enable gestures - Enables swipe and double tap gestures for navigation,
 see above.

Select theme - You can select a dark or a light theme.


text:
"""
:mod:`pcb` --- SCION Beacon
===========================
"""
# Stdlib
from collections import defaultdict
import struct

# External packages
import capnp  # noqa

# SCION
import proto.pcb_capnp as P
from lib.crypto.asymcrypto import sign
from lib.crypto.symcrypto import crypto_hash
from lib.defines import EXP_TIME_UNIT
from lib.errors import SCIONSigVerError
from lib.flagtypes import PathSegFlags as PSF
from lib.packet.asm_exts import RoutingPolicyExt
from lib.packet.opaque_field import HopOpaqueField, InfoOpaqueField
from lib.packet.packet_base import Cerealizable, SCIONPayloadBaseProto
from lib.packet.path import SCIONPath
from lib.packet.scion_addr import ISD_AS
from lib.sibra.pcb_ext import SibraPCBExt
from lib.types import ASMExtType, PayloadClass
from lib.util import iso_timestamp

#: Default value for length (in bytes) of a revocation token.
REV_TOKEN_LEN = 32

class PCBMarking(Cerealizable):
    NAME = "PCBMarking"
    P_CLS = P.PCBMarking
    VER = len(P_CLS.schema.fields) - 1

    @classmethod
    def from_values(cls, in_ia, in_ifid, in_mtu, out_ia, out_ifid,
                    hof):  # pragma: no cover
        return cls(cls.P_CLS.new_message(
            inIA=int(in_ia), inIF=in_ifid, inMTU=in_mtu,
            outIA=int(out_ia), outIF=out_ifid, hof=hof.pack()))

    def inIA(self):  # pragma: no cover
        return ISD_AS(self.p.inIA)

    def outIA(self):  # pragma: no cover
        return ISD_AS(self.p.outIA)

    def hof(self):  # pragma: no cover
        return HopOpaqueField(self.p.hof)

    def sig_pack5(self):
        """
        Pack for signing version 5 (defined by highest field number).
        """
        b = []
        if self.VER != 5:
            raise SCIONSigVerError("PCBMarking.sig_pack5 cannot support version %s", self.VER)
        b.append(self.p.inIA.to_bytes(4, 'big'))
        b.append(self.p.inIF.to_bytes(8, 'big'))
        b.append(self.p.inMTU.to_bytes(2, 'big'))
        b.append(self.p.outIA.to_bytes(4, 'big'))
        b.append(self.p.outIF.to_bytes(8, 'big'))
        b.append(self.p.hof)
        return b"".join(b)

    def short_desc(self):
        s = []
        s.append("From: %s (IF: %s) To: %s (IF: %s) Ingress MTU:%s" %
                 (self.inIA(), self.p.inIF, self.outIA(),
                  self.p.outIF, self.p.inMTU))
        s.append("  %s" % self.hof())
        return "\n".join(s)

class ASMarking(Cerealizable):
    NAME = "ASMarking"
    P_CLS = P.ASMarking
    VER = len(P_CLS.schema.fields) - 1

    @classmethod
    def from_values(cls, isd_as, trc_ver, cert_ver, pcbms, hashTreeRoot, mtu, exts=(),
                    ifid_size=12):
        p = cls.P_CLS.new_message(
            isdas=int(isd_as), trcVer=trc_ver, certVer=cert_ver,
            ifIDSize=ifid_size, hashTreeRoot=hashTreeRoot, mtu=mtu)
        p.init("pcbms", len(pcbms))
        for i, pm in enumerate(pcbms):
            p.pcbms[i] = pm.p
        for ext in exts:
            if ext.EXT_TYPE == ASMExtType.ROUTING_POLICY:
                p.exts.routingPolicy = ext.p
        return cls(p)

    def isd_as(self):  # pragma: no cover
        return ISD_AS(self.p.isdas)

    def pcbm(self, idx):  # pragma: no cover
        return PCBMarking(self.p.pcbms[idx])

    def iter_pcbms(self, start=0):  # pragma: no cover
        for i in range(start, len(self.p.pcbms)):
            yield self.pcbm(i)

    def routing_pol_ext(self):
        if self.p.exts.routingPolicy.set:
            return RoutingPolicyExt(self.p.exts.routingPolicy)
        return None

    def add_ext(self, ext):  # pragma: no cover
        """
        Appends a new ASMarking extension.
        """
        d = self.p.to_dict()
        d.setdefault('exts', []).append(ext)
        self.p.from_dict(d)

    def sig_pack8(self):
        """
        Pack for signing version 8 (defined by highest field number).
        """
        b = []
        if self.VER != 8:
            raise SCIONSigVerError("ASMarking.sig_pack8 cannot support version %s", self.VER)
        b.append(self.p.isdas.to_bytes(4, 'big'))
        b.append(self.p.trcVer.to_bytes(4, 'big'))
        b.append(self.p.certVer.to_bytes(4, 'big'))
        b.append(self.p.ifIDSize.to_bytes(1, 'big'))
        for pcbm in self.iter_pcbms():
            b.append(pcbm.sig_pack5())
        b.append(self.p.hashTreeRoot)
        b.append(self.p.mtu.to_bytes(2, 'big'))
        rpe = self.routing_pol_ext()
        if rpe:
            b.append(rpe.sig_pack3())
        # TODO(Sezer): handle other extensions here
        return b"".join(b)

    def short_desc(self):
        desc = []
        desc.append("%s TRC: v%s Cert: v%s AS MTU: %s" %
                    (self.isd_as(), self.p.trcVer, self.p.certVer, self.p.mtu))
        for pcbm in self.iter_pcbms():
            for line in pcbm.short_desc().splitlines():
                desc.append("  %s" % line)
        desc.append("  hashTreeRoot=%s" % self.p.hashTreeRoot)
        desc.append("  sig=%s" % self.p.sig)
        return "\n".join(desc)

class PathSegment(SCIONPayloadBaseProto):
    NAME = "PathSegment"
    PAYLOAD_CLASS = PayloadClass.PCB
    P_CLS = P.PathSegment
    VER = len(P_CLS.schema.fields) - 1

    def __init__(self, p):  # pragma: no cover
        super().__init__(p)
        self._min_exp = float("inf")
        self._setup()

    def _setup(self):
        self.info = InfoOpaqueField(self.p.info)
        self._calc_min_exp()
        self.sibra_ext = None
        if self.is_sibra():
            self.sibra_ext = SibraPCBExt(self.p.exts.sibra)

    @classmethod
    def from_values(cls, info, sibra_ext=None):  # pragma: no cover
        p = cls.P_CLS.new_message(info=info.pack())
        if sibra_ext:
            p.exts.sibra = sibra_ext.p
        return cls(p)

    def _calc_min_exp(self):
        # NB: only the expiration time of the first pcbm is considered.
        for asm in self.iter_asms():
            self._min_exp = min(self._min_exp, asm.pcbm(0).hof().exp_time)

    def asm(self, idx):  # pragma: no cover
        return ASMarking(self.p.asms[idx])

    def iter_asms(self, start=0):  # pragma: no cover
        for i in range(start, len(self.p.asms)):
            yield self.asm(i)

    def is_sibra(self):  # pragma: no cover
        return bool(self.p.exts.sibra.id)

    def sig_pack3(self):
        """
        Pack for signing version 3 (defined by highest field number).
        """
        if self.VER != 3:
            raise SCIONSigVerError("PathSegment.sig_pack3 cannot support version %s", self.VER)
        b = []
        b.append(self.p.info)
        # ifID field is changed on the fly, and so is ignored.
        for asm in self.iter_asms():
            b.append(asm.sig_pack8())
        if self.is_sibra():
            b.append(self.sibra_ext.sig_pack3())
        return b"".join(b)

    def sign(self, key, set_=True):  # pragma: no cover
        sig = sign(self.sig_pack3(), key)
        if set_:
            self.p.asms[-1].sig = sig
        return sig

    def add_asm(self, asm):  # pragma: no cover
        """
        Appends a new ASMarking block.
        """
        d = self.p.to_dict()
        d.setdefault('asms', []).append(asm.p)
        self.p.from_dict(d)
        self._update_info()
        self._min_exp = min(self._min_exp, asm.pcbm(0).hof().exp_time)

    def _update_info(self):  # pragma: no cover
        self.info.hops = len(self.p.asms)
        self.p.info = self.info.pack()

    def add_sibra_ext(self, ext_p):  # pragma: no cover
        self.p.exts.sibra = ext_p.copy()
        self.sibra_ext = SibraPCBExt(self.p.exts.sibra)

    def get_trcs_certs(self):
        """
        Returns a dict of all trcs' versions and a dict of all certificates'
        versions used in this PCB.
        """
        trcs = defaultdict(set)
        certs = defaultdict(set)
        for asm in self.iter_asms():
            isd_as = asm.isd_as()
            isd = isd_as[0]
            trcs[isd].add(asm.p.trcVer)
            certs[isd_as].add(asm.p.certVer)
        return trcs, certs

    def get_path(self, reverse_direction=False):
        """
        Returns the list of HopOpaqueFields in the path.
        """
        hofs = []
        info = InfoOpaqueField(self.p.info)
        asms = list(self.iter_asms())
        if reverse_direction:
            asms = reversed(asms)
            info.up_flag ^= True
        for asm in asms:
            hofs.append(asm.pcbm(0).hof())
        return SCIONPath.from_values(info, hofs)

    def first_ia(self):  # pragma: no cover
        return self.asm(0).isd_as()

    def last_ia(self):  # pragma: no cover
        return self.asm(-1).isd_as()

    def last_hof(self):  # pragma: no cover
        if self.p.asms:
            return self.asm(-1).pcbm(0).hof()
        return None

    def get_hops_hash(self, hex=False):  # pragma: no cover
        """
        Returns the hash over all triples (ISD_AS, IG_IF, EG_IF) included in
        the path segment.
        """
        data = []
        for asm in self.iter_asms():
            pcbm = asm.pcbm(0)
            data.append(asm.isd_as().pack())
            data.append(struct.pack("!QQ", pcbm.p.inIF, pcbm.p.outIF))
        data = b"".join(data)
        if hex:
            return crypto_hash(data).hex()
        return crypto_hash(data)

    def get_n_peer_links(self):  # pragma: no cover
        """Return the total number of peer links in the PathSegment."""
        n = 0
        for asm in self.p.asms:
            n += len(asm.pcbms) - 1
        return n

    def get_n_hops(self):  # pragma: no cover
        """Return the number of hops in the PathSegment."""
        return len(self.p.asms)

    def get_timestamp(self):  # pragma: no cover
        """Returns the creation timestamp of this PathSegment."""
        return self.info.timestamp

    def set_timestamp(self, timestamp):  # pragma: no cover
        """Updates the timestamp in the IOF."""
        assert timestamp < 2 ** 32 - 1
        self.info.timestamp = timestamp
        self._update_info()

    def get_expiration_time(self):  # pragma: no cover
        """
        Returns the expiration time of the path segment in real time. If a PCB
        extension in the last ASMarking supplies an expiration time, use that.
        Otherwise fall-back to the standard expiration time calculation.
        """
        if self.is_sibra():
            return self.sibra_ext.exp_ts()
        return self.info.timestamp + int(self._min_exp * EXP_TIME_UNIT)

    def flags(self):  # pragma: no cover
        f = 0
        if self.is_sibra():
            f |= PSF.SIBRA
        return f

    def short_id(self):  # pragma: no cover
        """
        Return a 12-byte hex ID identifying the PCB (mostly for logging purposes).
        """
        return self.get_hops_hash(hex=True)[:12]

    def short_desc(self):  # pragma: no cover
        """
        Return a short description string of the PathSegment, consisting of a
        truncated hash, the IOF timestamp, and the list of hops.
        """
        desc = []
        desc.append("%s, %s, " % (self.short_id(), iso_timestamp(self.get_timestamp())))
        hops = []
        for asm in self.iter_asms():
            hops.append(str(asm.isd_as()))
        exts = []
        if self.is_sibra():
            exts.append("  %s" % self.sibra_ext.short_desc())
        desc.append(" > ".join(hops))
        if exts:
            return "%s\n%s" % ("".join(desc), "\n".join(exts))
        return "".join(desc)

    def __str__(self):
        s = []
        s.append("%s:" % self.NAME)
        s.append("  %s" % self.info)
        for asm in self.iter_asms():
            for line in asm.short_desc().splitlines():
                s.append("  %s" % line)
        if self.sibra_ext:
            for line in str(self.sibra_ext).splitlines():
                s.append("  %s" % line)
        return "\n".join(s)

    def __eq__(self, other):
        return self.__hash__() == hash(other)

    def __hash__(self):  # pragma: no cover
        return hash(self.get_hops_hash())  # FIMXE(PSz): should add timestamp?

def parse_pcb_payload(p):  # pragma: no cover
    return PathSegment(p)