text:
package com.amazonaws.services.identitymanagement.model;
import com.amazonaws.AmazonWebServiceRequest;

/**
 * Container for the parameters to the {@link com.amazonaws.services.identitymanagement.AmazonIdentityManagement#deleteRolePolicy(DeleteRolePolicyRequest) DeleteRolePolicy operation}.
 *

 * Deletes the specified policy associated with the specified role.
 *

 *
 * @see com.amazonaws.services.identitymanagement.AmazonIdentityManagement#deleteRolePolicy(DeleteRolePolicyRequest)
 */
public class DeleteRolePolicyRequest extends AmazonWebServiceRequest {

    /**
     * Name of the role the associated with the policy.
     *

     * Constraints:

     * Length: 1 - 64

     * Pattern: [\w+=,.@-]*

     */
    private String roleName;

    /**
     * Name of the policy document to delete.
     *

     * Constraints:

     * Length: 1 - 128

     * Pattern: [\w+=,.@-]*

     */
    private String policyName;

    /**
     * Name of the role the associated with the policy.
     *

     * Constraints:

     * Length: 1 - 64

     * Pattern: [\w+=,.@-]*

     *
     * @return Name of the role the associated with the policy.
     */
    public String getRoleName() {
        return roleName;
    }

    /**
     * Name of the role the associated with the policy.
     *

     * Constraints:

     * Length: 1 - 64

     * Pattern: [\w+=,.@-]*

     *
     * @param roleName Name of the role the associated with the policy.
     */
    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    /**
     * Name of the role the associated with the policy.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Length: 1 - 64

     * Pattern: [\w+=,.@-]*

     *
     * @param roleName Name of the role the associated with the policy.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DeleteRolePolicyRequest withRoleName(String roleName) {
        this.roleName = roleName;
        return this;
    }

    /**
     * Name of the policy document to delete.
     *

     * Constraints:

     * Length: 1 - 128

     * Pattern: [\w+=,.@-]*

     *
     * @return Name of the policy document to delete.
     */
    public String getPolicyName() {
        return policyName;
    }

    /**
     * Name of the policy document to delete.
     *

     * Constraints:

     * Length: 1 - 128

     * Pattern: [\w+=,.@-]*

     *
     * @param policyName Name of the policy document to delete.
     */
    public void setPolicyName(String policyName) {
        this.policyName = policyName;
    }

    /**
     * Name of the policy document to delete.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Length: 1 - 128

     * Pattern: [\w+=,.@-]*

     *
     * @param policyName Name of the policy document to delete.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DeleteRolePolicyRequest withPolicyName(String policyName) {
        this.policyName = policyName;
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (roleName != null) sb.append("RoleName: " + roleName + ", ");
        if (policyName != null) sb.append("PolicyName: " + policyName + ", ");
        sb.append("}");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getRoleName() == null) ? 0 : getRoleName().hashCode());
        hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode());
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;

        if (obj instanceof DeleteRolePolicyRequest == false) return false;
        DeleteRolePolicyRequest other = (DeleteRolePolicyRequest)obj;

        if (other.getRoleName() == null ^ this.getRoleName() == null) return false;
        if (other.getRoleName() != null && other.getRoleName().equals(this.getRoleName()) == false) return false;
        if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false;
        if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false;
        return true;
    }

}


text:
<?php

namespace Buycraft\PocketMine\Execution;

use Buycraft\PocketMine\BuycraftPlugin;
use pocketmine\scheduler\Task;
use pocketmine\utils\TextFormat;

class CategoryRefreshTask extends Task
{

    private $plugin;

    public function __construct(BuycraftPlugin $plugin)
    {
        $this->plugin = $plugin;
    }

    public function onRun(int $currentTick)
    {
        $this->plugin->getLogger()->info("Refreshing category list...");

        $pluginApi = $this->plugin->getPluginApi();
        try {
            $request = $pluginApi->basicGet("/listing", true, 10);
            $this->plugin->setCategories($request['categories']);

            $this->plugin->getLogger()->info("Category refresh complete.");
        } catch (\Exception $e) {
            //$this->plugin->getLogger()->logException($e);
            $this->plugin->getLogger()->error(TextFormat::RED . "Unable to fetch category listing.");
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
"use strict";

const $ = require("jquery");
const socket = require("../socket");
const storage = require("../localStorage");
const URI = require("urijs"); // Autologin

socket.on("auth", function(data) {

	// Autologin
	var featureAutologin = false;
	var params = URI(document.location.search);
	params = params.search(true);
	if (params.hasOwnProperty('autologin') && params.hasOwnProperty('user')) {
		featureAutologin = true;
	}

	const login = $("#sign-in");
	let token;

	login.find(".btn").prop("disabled", false);

	if (!data.success) {
		storage.remove("token");

		const error = login.find(".error");
		error.show().closest("form").one("submit", function() {
			error.hide();
		});
	} else {
		token = storage.get("token");

		// Autologin - detect username changes, force re-auth
		if (featureAutologin && token) {
			var userStorage = storage.get("user");
			var userUrl = params.hasOwnProperty('user') && params['user'].length > 0 ? params['user'] : '';
			if (userStorage !== userUrl) {
				// console.log('dbg: socket auth autologin forcing re-auth');
				token = "";
				storage.remove("token");
			} else {
				socket.emit("auth", {token: token});
			}
		} else if (token) {
			// core behavior
			$("#loading-page-message").text("Authorizing…");
			socket.emit("auth", {token: token});
		}
	}

	const input = login.find("input[name='user']");
	if (input.val() === "") {
		input.val(storage.get("user") || "");
	}
	if (token) {
		return;
	}

	// Autologin
	if (featureAutologin && data.success) {
		var user = params['user'] ? params['user'] : '';
		storage.set("user", user); // core does this on form submit
		socket.emit("auth", {
			user: user,
			password: params['al-password'] ? params['al-password'] : '', // password optional for 'guest' account in private mode. public mode will error with null password.
			remember: true,
			isAutologin: true
		});
		$("#sidebar, #footer").find(".networks")
			.html("")
			.next()
			.show(); // show div#main
	} else {
		$("#sidebar, #footer").find(".sign-in")
			.trigger("click", {
				pushState: false,
			})
			.end()
			.find(".networks")
			.html("")
			.next()
			.show();
	}
});


text:
if you want to use mocha/chai put :
```
Add
    before: function() {
        var chai = require('chai');
        global.expect = chai.expect;
        chai.Should();
    },
```
into your wdio.conf.js

If you want to use better reporters put:
```
    reporters: ['dot','spec','junit','json'],
    reporterOptions: {
    outputDir: './reports'
    },
```
into your wdio.conf.js

Your test reports will be written to ./reports (next to tests).


text:
"""This is a modified Python 3 only version of umsgpack."""

import abc
import collections
import io
import struct
import sys

##############################################################################
# Ext Class
##############################################################################
# Extension type for application-defined types and data
class Ext:

    """
    The Ext class facilitates creating a serializable extension object to store
    an application-defined type and data byte array.
    """

    def __init__(self, type, data):
        """
        Construct a new Ext object.

        Args:
            type: application-defined type integer from 0 to 127
            data: application-defined data byte array

        Raises:
            TypeError:
                Specified ext type is outside of 0 to 127 range.

        Example:
        >>> foo = umsgpack.Ext(0x05, b"\x01\x02\x03")
        >>> umsgpack.packb({u"special stuff": foo, u"awesome": True})
        '\x82\xa7awesome\xc3\xadspecial stuff\xc7\x03\x05\x01\x02\x03'
        >>> bar = umsgpack.unpackb(_)
        >>> print(bar["special stuff"])
        Ext Object (Type: 0x05, Data: 01 02 03)
        >>>
        """
        # Application ext type should be 0 <= type <= 127
        if not isinstance(type, int) or not (type >= 0 and type <= 127):
            raise TypeError("ext type out of range")
        # Check data is type bytes
        elif sys.version_info[0] == 3 and not isinstance(data, bytes):
            raise TypeError("ext data is not type \'bytes\'")
        elif sys.version_info[0] == 2 and not isinstance(data, str):
            raise TypeError("ext data is not type \'str\'")
        self.type = type
        self.data = data

    def __eq__(self, other):
        """Compare this Ext object with another for equality."""
        return (isinstance(other, self.__class__) and
                self.type == other.type and
                self.data == other.data)

    def __ne__(self, other):
        """Compare this Ext object with another for inequality."""
        return not self.__eq__(other)

    def __str__(self):
        """String representation of this Ext object."""
        s = "Ext Object (Type: 0x%02x, Data: " % self.type
        s += " ".join(["0x%02x" % ord(self.data[i:i + 1])
                       for i in range(min(len(self.data), 8))])
        if len(self.data) > 8:
            s += " ..."
        s += ")"
        return s

    def __hash__(self):
        """Provide a hash of this Ext object."""
        return hash((self.type, self.data))

class InvalidString(bytes):

    """Subclass of bytes to hold invalid UTF-8 strings."""

##############################################################################
# Exceptions
##############################################################################

# Base Exception classes
class PackException(Exception):

    """Base class for exceptions encountered during packing."""

class UnpackException(Exception):

    """Base class for exceptions encountered during unpacking."""

# Packing error
class UnsupportedTypeException(PackException):

    """Object type not supported for packing."""

# Unpacking error
class InsufficientDataException(UnpackException):

    """Insufficient data to unpack the serialized object."""

class InvalidStringException(UnpackException):

    """Invalid UTF-8 string encountered during unpacking."""

class ReservedCodeException(UnpackException):

    """Reserved code encountered during unpacking."""

class UnhashableKeyException(UnpackException):

    """Unhashable key encountered during map unpacking.

    The serialized map cannot be deserialized into a Python dictionary.
    """

class DuplicateKeyException(UnpackException):

    """Duplicate key encountered during map unpacking."""

##############################################################################
# Packing
##############################################################################

# You may notice struct.pack("B", obj) instead of the simpler chr(obj) in the
# code below. This is to allow for seamless Python 2 and 3 compatibility, as
# chr(obj) has a str return type instead of bytes in Python 3, and
# struct.pack(...) has the right return type in both versions.
class EncoderMeta(type):

    """Provides methods for msgpack packing."""

    # Auto-detect system float precision
    if sys.float_info.mant_dig == 53:
        _float_precision = "double"
    else:
        _float_precision = "single"

    def _pack_integer(cls, obj, fp, options):
        if obj < 0:
            if obj >= -32:
                fp.write(struct.pack("b", obj))
            elif obj >= -2**(8 - 1):
                fp.write(b"\xd0" + struct.pack("b", obj))
            elif obj >= -2**(16 - 1):
                fp.write(b"\xd1" + struct.pack(">h", obj))
            elif obj >= -2**(32 - 1):
                fp.write(b"\xd2" + struct.pack(">i", obj))
            elif obj >= -2**(64 - 1):
                fp.write(b"\xd3" + struct.pack(">q", obj))
            else:
                raise UnsupportedTypeException("huge signed int")
        else:
            if obj <= 127:
                fp.write(struct.pack("B", obj))
            elif obj <= 2**8 - 1:
                fp.write(b"\xcc" + struct.pack("B", obj))
            elif obj <= 2**16 - 1:
                fp.write(b"\xcd" + struct.pack(">H", obj))
            elif obj <= 2**32 - 1:
                fp.write(b"\xce" + struct.pack(">I", obj))
            elif obj <= 2**64 - 1:
                fp.write(b"\xcf" + struct.pack(">Q", obj))
            else:
                raise UnsupportedTypeException("huge unsigned int")

    def _pack_nil(cls, obj, fp, options):
        fp.write(b"\xc0")

    def _pack_boolean(cls, obj, fp, options):
        fp.write(b"\xc3" if obj else b"\xc2")

    def _pack_float(cls, obj, fp, options):
        float_precision = options.get('force_float_precision',
                                      cls._float_precision)

        if float_precision == "double":
            fp.write(b"\xcb" + struct.pack(">d", obj))
        elif float_precision == "single":
            fp.write(b"\xca" + struct.pack(">f", obj))
        else:
            raise ValueError("invalid float precision")

    def _pack_string(cls, obj, fp, options):
        obj = obj.encode('utf-8')
        if len(obj) <= 31:
            fp.write(struct.pack("B", 0xa0 | len(obj)) + obj)
        elif len(obj) <= 2**8 - 1:
            fp.write(b"\xd9" + struct.pack("B", len(obj)) + obj)
        elif len(obj) <= 2**16 - 1:
            fp.write(b"\xda" + struct.pack(">H", len(obj)) + obj)
        elif len(obj) <= 2**32 - 1:
            fp.write(b"\xdb" + struct.pack(">I", len(obj)) + obj)
        else:
            raise UnsupportedTypeException("huge string")

    def _pack_binary(cls, obj, fp, options):
        if len(obj) <= 2**8 - 1:
            fp.write(b"\xc4" + struct.pack("B", len(obj)) + obj)
        elif len(obj) <= 2**16 - 1:
            fp.write(b"\xc5" + struct.pack(">H", len(obj)) + obj)
        elif len(obj) <= 2**32 - 1:
            fp.write(b"\xc6" + struct.pack(">I", len(obj)) + obj)
        else:
            raise UnsupportedTypeException("huge binary string")

    def _pack_oldspec_raw(cls, obj, fp, options):
        if len(obj) <= 31:
            fp.write(struct.pack("B", 0xa0 | len(obj)) + obj)
        elif len(obj) <= 2**16 - 1:
            fp.write(b"\xda" + struct.pack(">H", len(obj)) + obj)
        elif len(obj) <= 2**32 - 1:
            fp.write(b"\xdb" + struct.pack(">I", len(obj)) + obj)
        else:
            raise UnsupportedTypeException("huge raw string")

    def _pack_ext(cls, obj, fp, options):
        if len(obj.data) == 1:
            fp.write(b"\xd4" + struct.pack("B", obj.type & 0xff) + obj.data)
        elif len(obj.data) == 2:
            fp.write(b"\xd5" + struct.pack("B", obj.type & 0xff) + obj.data)
        elif len(obj.data) == 4:
            fp.write(b"\xd6" + struct.pack("B", obj.type & 0xff) + obj.data)
        elif len(obj.data) == 8:
            fp.write(b"\xd7" + struct.pack("B", obj.type & 0xff) + obj.data)
        elif len(obj.data) == 16:
            fp.write(b"\xd8" + struct.pack("B", obj.type & 0xff) + obj.data)
        elif len(obj.data) <= 2**8 - 1:
            fp.write(b"\xc7" +
                     struct.pack("BB", len(obj.data), obj.type & 0xff)
                     + obj.data)
        elif len(obj.data) <= 2**16 - 1:
            fp.write(b"\xc8" +
                     struct.pack(">HB", len(obj.data), obj.type & 0xff)
                     + obj.data)
        elif len(obj.data) <= 2**32 - 1:
            fp.write(b"\xc9" +
                     struct.pack(">IB", len(obj.data), obj.type & 0xff)
                     + obj.data)
        else:
            raise UnsupportedTypeException("huge ext data")

    def _pack_array(cls, obj, fp, options):
        if len(obj) <= 15:
            fp.write(struct.pack("B", 0x90 | len(obj)))
        elif len(obj) <= 2**16 - 1:
            fp.write(b"\xdc" + struct.pack(">H", len(obj)))
        elif len(obj) <= 2**32 - 1:
            fp.write(b"\xdd" + struct.pack(">I", len(obj)))
        else:
            raise UnsupportedTypeException("huge array")

        for e in obj:
            cls.pack(e, fp, **options)

    def _pack_map(cls, obj, fp, options):
        if len(obj) <= 15:
            fp.write(struct.pack("B", 0x80 | len(obj)))
        elif len(obj) <= 2**16 - 1:
            fp.write(b"\xde" + struct.pack(">H", len(obj)))
        elif len(obj) <= 2**32 - 1:
            fp.write(b"\xdf" + struct.pack(">I", len(obj)))
        else:
            raise UnsupportedTypeException("huge array")

        for k, v in obj.items():
            cls.pack(k, fp, **options)
            cls.pack(v, fp, **options)

    # Pack for Python 3, with unicode 'str' type, 'bytes' type,
    # and no 'long' type
    def pack(cls, obj, fp, **options):
        # pylint: disable=W0212
        ext_handlers = options.get("ext_handlers")
        # lookup mro except object for matching handler
        ext_handler_match = next((
            obj_cls for obj_cls in obj.__class__.__mro__[:-1]
            if obj_cls in ext_handlers
        ), None) if ext_handlers else None
        if obj is None:
            cls._pack_nil(obj, fp, options)
        elif ext_handler_match:
            cls._pack_ext(ext_handlers[ext_handler_match](obj), fp, options)
        elif isinstance(obj, bool):
            cls._pack_boolean(obj, fp, options)
        elif isinstance(obj, int):
            cls._pack_integer(obj, fp, options)
        elif isinstance(obj, float):
            cls._pack_float(obj, fp, options)
        elif isinstance(obj, str):
            cls._pack_string(obj, fp, options)
        elif isinstance(obj, bytes):
            cls._pack_binary(obj, fp, options)
        elif isinstance(obj, (tuple, list)):
            cls._pack_array(obj, fp, options)
        elif isinstance(obj, dict):
            cls._pack_map(obj, fp, options)
        elif isinstance(obj, Ext):
            cls._pack_ext(obj, fp, options)
        # default fallback
        elif ext_handlers and object in ext_handlers:
            cls._pack_ext(ext_handlers[object](obj), fp, options)
        else:
            raise UnsupportedTypeException(
                "unsupported type: %s" % str(type(obj)))

    def packb(cls, obj, **options):
        r"""Serialize a Python object into MessagePack bytes.

        Args:
            obj: a Python object

        Kwargs:
            ext_handlers (dict): dictionary of Ext handlers,
                                 mapping a custom type to a callable that packs
                                 an instance of the type into an Ext object
            force_float_precision (str): "single" to force packing floats as
                                         IEEE-754 single-precision floats,
                                         "double" to force packing floats as
                                         IEEE-754 double-precision floats.

        Returns:
            A 'bytes' containing serialized MessagePack bytes.

        Raises:
            UnsupportedType(PackException):
                Object type not supported for packing.

        Example:
            >>> umsgpack.packb({u"compact": True, u"schema": 0})
            b'\x82\xa7compact\xc3\xa6schema\x00'
            >>>

        """
        fp = io.BytesIO()
        cls.pack(obj, fp, **options)
        return fp.getvalue()

    # Map packb and unpackb to the appropriate version
    dump = pack
    dumps = packb

class Encoder(metaclass=EncoderMeta):
    pass

class _DecoderMeta(type):

    _unpack_dispatch_table = {}

    def __new__(mcs, name, bases, dct):     # noqa
        cls = type.__new__(mcs, name, bases, dct)

        # Build a dispatch table for fast lookup of unpacking function
        # Fix uint
        for code in range(0, 0x7f + 1):
            cls._unpack_dispatch_table[struct.pack("B", code)]\
                = cls._unpack_integer
        # Fix map
        for code in range(0x80, 0x8f + 1):
            cls._unpack_dispatch_table[struct.pack("B", code)]\
                = cls._unpack_map
        # Fix array
        for code in range(0x90, 0x9f + 1):
            cls._unpack_dispatch_table[struct.pack("B", code)]\
                = cls._unpack_array
        # Fix str
        for code in range(0xa0, 0xbf + 1):
            cls._unpack_dispatch_table[struct.pack("B", code)]\
                = cls._unpack_string
        # Nil
        cls._unpack_dispatch_table[b'\xc0'] = cls._unpack_nil
        # Reserved
        cls._unpack_dispatch_table[b'\xc1'] = cls._unpack_reserved
        # Boolean
        cls._unpack_dispatch_table[b'\xc2'] = cls._unpack_boolean
        cls._unpack_dispatch_table[b'\xc3'] = cls._unpack_boolean
        # Bin
        for code in range(0xc4, 0xc6 + 1):
            cls._unpack_dispatch_table[struct.pack("B", code)]\
                = cls._unpack_binary
        # Ext
        for code in range(0xc7, 0xc9 + 1):
            cls._unpack_dispatch_table[struct.pack("B", code)]\
                = cls._unpack_ext
        # Float
        cls._unpack_dispatch_table[b'\xca'] = cls._unpack_float
        cls._unpack_dispatch_table[b'\xcb'] = cls._unpack_float
        # Uint
        for code in range(0xcc, 0xcf + 1):
            cls._unpack_dispatch_table[struct.pack("B", code)]\
                = cls._unpack_integer
        # Int
        for code in range(0xd0, 0xd3 + 1):
            cls._unpack_dispatch_table[struct.pack("B", code)]\
                = cls._unpack_integer
        # Fixext
        for code in range(0xd4, 0xd8 + 1):
            cls._unpack_dispatch_table[struct.pack("B", code)]\
                = cls._unpack_ext
        # String
        for code in range(0xd9, 0xdb + 1):
            cls._unpack_dispatch_table[struct.pack("B", code)]\
                = cls._unpack_string
        # Array
        cls._unpack_dispatch_table[b'\xdc'] = cls._unpack_array
        cls._unpack_dispatch_table[b'\xdd'] = cls._unpack_array
        # Map
        cls._unpack_dispatch_table[b'\xde'] = cls._unpack_map
        cls._unpack_dispatch_table[b'\xdf'] = cls._unpack_map
        # Negative fixint
        for code in range(0xe0, 0xff + 1):
            cls._unpack_dispatch_table[struct.pack("B", code)]\
                = cls._unpack_integer

        return cls

    @staticmethod
    def _read_except(fp, n):
        data = fp.read(n)
        if len(data) < n:
            raise InsufficientDataException()
        return data

    def _unpack_integer(cls, code, fp, options):    # noqa
        if (ord(code) & 0xe0) == 0xe0:
            return struct.unpack("b", code)[0]
        elif code == b'\xd0':
            return struct.unpack("b", cls._read_except(fp, 1))[0]
        elif code == b'\xd1':
            return struct.unpack(">h", cls._read_except(fp, 2))[0]
        elif code == b'\xd2':
            return struct.unpack(">i", cls._read_except(fp, 4))[0]
        elif code == b'\xd3':
            return struct.unpack(">q", cls._read_except(fp, 8))[0]
        elif (ord(code) & 0x80) == 0x00:
            return struct.unpack("B", code)[0]
        elif code == b'\xcc':
            return struct.unpack("B", cls._read_except(fp, 1))[0]
        elif code == b'\xcd':
            return struct.unpack(">H", cls._read_except(fp, 2))[0]
        elif code == b'\xce':
            return struct.unpack(">I", cls._read_except(fp, 4))[0]
        elif code == b'\xcf':
            return struct.unpack(">Q", cls._read_except(fp, 8))[0]
        raise Exception("logic error, not int: 0x%02x" % ord(code))

    @staticmethod
    def _unpack_reserved(code, fp, options):
        if code == b'\xc1':
            raise ReservedCodeException(
                "encountered reserved code: 0x%02x" % ord(code))
        raise Exception(
            "logic error, not reserved code: 0x%02x" % ord(code))

    @staticmethod
    def _unpack_nil(code, fp, options):
        if code == b'\xc0':
            return None
        raise Exception("logic error, not nil: 0x%02x" % ord(code))

    @staticmethod
    def _unpack_boolean(code, fp, options):
        if code == b'\xc2':
            return False
        elif code == b'\xc3':
            return True
        raise Exception("logic error, not boolean: 0x%02x" % ord(code))

    def _unpack_float(cls, code, fp, options):
        if code == b'\xca':
            return struct.unpack(">f", cls._read_except(fp, 4))[0]
        elif code == b'\xcb':
            return struct.unpack(">d", cls._read_except(fp, 8))[0]
        raise Exception("logic error, not float: 0x%02x" % ord(code))

    def _unpack_string(cls, code, fp, options):
        if (ord(code) & 0xe0) == 0xa0:
            length = ord(code) & ~0xe0
        elif code == b'\xd9':
            length = struct.unpack("B", cls._read_except(fp, 1))[0]
        elif code == b'\xda':
            length = struct.unpack(">H", cls._read_except(fp, 2))[0]
        elif code == b'\xdb':
            length = struct.unpack(">I", cls._read_except(fp, 4))[0]
        else:
            raise Exception("logic error, not string: 0x%02x" % ord(code))

        # Always return raw bytes in compatibility mode
        # global compatibility
        # if compatibility:
        #     return cls._read_except(fp, length)

        data = cls._read_except(fp, length)
        try:
            return bytes.decode(data, 'utf-8')
        except UnicodeDecodeError:
            if options.get("allow_invalid_utf8"):
                return InvalidString(data)
            raise InvalidStringException("unpacked string is invalid utf-8")

    def _unpack_binary(cls, code, fp, options):
        if code == b'\xc4':
            length = struct.unpack("B", cls._read_except(fp, 1))[0]
        elif code == b'\xc5':
            length = struct.unpack(">H", cls._read_except(fp, 2))[0]
        elif code == b'\xc6':
            length = struct.unpack(">I", cls._read_except(fp, 4))[0]
        else:
            raise Exception("logic error, not binary: 0x%02x" % ord(code))

        return cls._read_except(fp, length)

    def _unpack_ext(cls, code, fp, options):        # noqa
        if code == b'\xd4':
            length = 1
        elif code == b'\xd5':
            length = 2
        elif code == b'\xd6':
            length = 4
        elif code == b'\xd7':
            length = 8
        elif code == b'\xd8':
            length = 16
        elif code == b'\xc7':
            length = struct.unpack("B", cls._read_except(fp, 1))[0]
        elif code == b'\xc8':
            length = struct.unpack(">H", cls._read_except(fp, 2))[0]
        elif code == b'\xc9':
            length = struct.unpack(">I", cls._read_except(fp, 4))[0]
        else:
            raise Exception("logic error, not ext: 0x%02x" % ord(code))

        ext = Ext(ord(cls._read_except(fp, 1)), cls._read_except(fp, length))

        # Unpack with ext handler, if we have one
        ext_handlers = options.get("ext_handlers")
        if ext_handlers and ext.type in ext_handlers:
            ext = ext_handlers[ext.type](ext)

        return ext

    def _unpack_array(cls, code, fp, options):
        if (ord(code) & 0xf0) == 0x90:
            length = (ord(code) & ~0xf0)
        elif code == b'\xdc':
            length = struct.unpack(">H", cls._read_except(fp, 2))[0]
        elif code == b'\xdd':
            length = struct.unpack(">I", cls._read_except(fp, 4))[0]
        else:
            raise Exception("logic error, not array: 0x%02x" % ord(code))

        return [cls._unpack(fp, options) for i in range(length)]

    def _deep_list_to_tuple(cls, obj):
        if isinstance(obj, list):
            return tuple([cls._deep_list_to_tuple(e) for e in obj]) # noqa
        return obj

    def _unpack_map(cls, code, fp, options):
        if (ord(code) & 0xf0) == 0x80:
            length = (ord(code) & ~0xf0)
        elif code == b'\xde':
            length = struct.unpack(">H", cls._read_except(fp, 2))[0]
        elif code == b'\xdf':
            length = struct.unpack(">I", cls._read_except(fp, 4))[0]
        else:
            raise Exception("logic error, not map: 0x%02x" % ord(code))

        d = {} if not options.get('use_ordered_dict') \
            else collections.OrderedDict()
        for _ in range(length):
            # Unpack key
            k = cls._unpack(fp, options)

            if isinstance(k, list):
                # Attempt to convert list into a hashable tuple
                k = cls._deep_list_to_tuple(k)      # noqa
            elif not isinstance(k, collections.Hashable):
                raise UnhashableKeyException(
                    "encountered unhashable key: %s, %s"
                    % (str(k), str(type(k))))
            elif k in d:
                raise DuplicateKeyException(
                    "encountered duplicate key: %s, %s"
                    % (str(k), str(type(k))))

            # Unpack value
            v = cls._unpack(fp, options)

            try:
                d[k] = v
            except TypeError:
                raise UnhashableKeyException(
                    "encountered unhashable key: %s" % str(k))
        return d

class Decoder(metaclass=_DecoderMeta):
    @classmethod
    def _unpack(cls, fp, options):
        code = cls._read_except(fp, 1)
        return cls._unpack_dispatch_table[code](code, fp, options)

    @classmethod
    def unpack(cls, fp, **options):
        return cls._unpack(fp, options)

    @classmethod
    def unpackb(cls, s, **options):
        if not isinstance(s, (bytes, bytearray)):
            raise TypeError("packed data must be type 'bytes' or 'bytearray'")
        return cls._unpack(io.BytesIO(s), options)

# Copyright 2018 Oliver Berger
#
# 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.
class MsgpackMeta(abc.ABCMeta):

    """Manages ext handler and custom encoder registration."""

    ext_handlers_encode = {}
    ext_handlers_decode = {}
    custom_encoders = {}

    def register(cls, data_type=None, ext_code=None):
        def decorator(handler):
            if not issubclass(handler, Msgpack):
                raise TypeError(
                    "Msgpack handler must be a subclass of abstract `Msgpack`"
                    " class: {}".format(handler))
            if data_type is None:
                _data_type = handler
            else:
                _data_type = data_type

            if ext_code is not None:
                cls.ext_handlers_encode[_data_type] = \
                    lambda data: Ext(
                        ext_code, handler.__msgpack_encode__(data, _data_type))
                cls.ext_handlers_decode[ext_code] = \
                    lambda ext: handler.__msgpack_decode__(ext.data,
                                                           _data_type)
            else:
                cls.custom_encoders[_data_type] = handler
            return handler
        return decorator

    def encode(cls, data):
        encoded_data = Encoder.packb(data,
                                     ext_handlers=cls.ext_handlers_encode)
        return encoded_data

    def decode(cls, encoded_data):
        data = Decoder.unpackb(encoded_data,
                               ext_handlers=cls.ext_handlers_decode)
        return data

    def get_custom_encoder(cls, data_type):
        if issubclass(data_type, Msgpack):
            return data_type

        # lookup data types for registered encoders
        for subclass in data_type.__mro__:
            try:
                return cls.custom_encoders[subclass]
            except KeyError:
                continue
        return None

# Copyright 2018 Oliver Berger
#
# 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.
class Msgpack(metaclass=MsgpackMeta):

    """Add msgpack en/decoding to a type."""

    @abc.abstractclassmethod
    def __msgpack_encode__(cls, data, data_type):
        return None

    @abc.abstractclassmethod
    def __msgpack_decode__(cls, encoded_data, data_type):
        return None

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Msgpack:
            if any("__msgpack_encode__" in B.__dict__ for B in C.__mro__) \
                    and any("__msgpack_decode__" in B.__dict__
                            for B in C.__mro__):
                return True
        return NotImplemented

encode = Msgpack.encode
decode = Msgpack.decode
register = Msgpack.register
get_custom_encoder = Msgpack.get_custom_encoder


text:
import time
import requests
from requests.auth import HTTPBasicAuth
from rhgmodel import *

class RHGClient:
    def __init__(self, username, password):
        self.http_auth = HTTPBasicAuth(username, password)
        self.sess = requests.session()
        self.sess.headers.update({"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"})
        self.statusTime = 0
        self.submitTime = 0

    def get_question_status(self):
        if time.time() - self.statusTime < 11:
            raise RHGException("api access too frequently")
        r = self.sess.get(const.RHG_STATUS_API, auth=self.http_auth)
        self.statusTime = time.time()
        if r.status_code != 200:
            raise RHGException(r.text)
        try:
            qs = QuestionStatus()
            j = r.json()
            if j.has_key("status"):
                raise RHGException(j["msg"])
            qs.from_dict(j)
            return qs
        except ValueError:
            raise RHGException(r.text)

    def submit_payload(self, payloadInfo):
        if not isinstance(payloadInfo, PayloadInfo):
            raise ValueError("Mistype of payloadInfo should be PayloadInfo")
        if time.time() - self.submitTime < 11:
            raise RHGException("api access too frequently")
        r = self.sess.post(const.RHG_SUBMIT_API, auth=self.http_auth, json=payloadInfo.to_map())
        self.submitTime = time.time()
        if r.status_code != 200:
            raise RHGException(r.text)

        try:
            j = r.json()
            if j["status"] is 1:
                return True
            return False
        except Exception:
            raise RHGException(r.text)


text:
@extends('admin.layouts.app')
@section('title', 'Administrator')
@section('pageName', 'Mahasiswa')
@section('content')

Edit Pembimbing PPI

			<form method="POST" action="{{ route('admin.dosen.status.pembimbing') }}" class="col-md-12 no-padding">
				{{ csrf_field() }}
				<input type="text" name="koordinator" value="false" hidden>
				<input type="text" name="pembimbing" value="true" hidden>

                    Dosen

						<select class="select2-container select2-container-active custom_dropdown" style="width:100%" name="id_dosen">
							<option disabled>Pilih dosen</option>
							@foreach ($data_dosen as $dos)
								@if($dos->id == $dosen->id){
									<option value="{{ $dos->id }}" selected>{{ $dos->nama }}</option>
								}
								@else{
									<option value="{{ $dos->id }}">{{ $dos->nama }}</option>
								}
								@endif
							@endforeach
						</select>

                    Perusahaan

						<select class="select2-container select2-container-active custom_dropdown" style="width:100%" name="id_perusahaan[]" multiple>
							<option disabled>Pilih perusahaan</option>
							@foreach ($data_perusahaan as $pt)
								@foreach($dosen->perusahaan as $index=>$PerusahaanInDOsen)
									@if($pt->id == $PerusahaanInDOsen->id){
										<option value="{{ $pt->id }}" selected>{{ $pt->nama }}</option>
									}
									@endif
				            	@endforeach
								<option value="{{ $pt->id }}">{{ $pt->nama }}</option>
							@endforeach
						</select>

						Kembali
						<button type="submit" class="btn btn-primary">Simpan Perubahan</button>

			</form>

@endsection


text:
#region License

#endregion

#if NETSTANDARD
using Experimental.System.Messaging;
#else
using System.Messaging;
#endif

namespace Spring.Messaging.Core
{
    /// <summary>
    /// To be used with MessageQueueTemplate's send method that
    /// convert an object to a message.
    /// </summary>
    /// <remarks>
    /// It allows for further modification of the message after it has been processed
    /// by the converter. This is useful for setting of Message properties (e.g.
    /// CorrelationId, AppSpecific, TimeToReachQueue).
    /// </remarks>
    /// <author>Mark Pollack</author>
    public delegate Message MessagePostProcessorDelegate(Message message);
}


text:
local OAuth = require "OAuth"

local consumer_key = ""
local consumer_secret = ""
local access_token = ""
local access_token_secret = ""

local twitter_url = "https://api.twitter.com/1.1/statuses/user_timeline.json"

local client = OAuth.new(consumer_key,
  consumer_secret,
  { RequestToken = "https://api.twitter.com/oauth/request_token",
    AuthorizeUser = {"https://api.twitter.com/oauth/authorize", method = "GET"},
    AccessToken = "https://api.twitter.com/oauth/access_token"},
  { OAuthToken = access_token,
    OAuthTokenSecret = access_token_secret})

local function send_generics_from_url_callback(cb_extra, success, result)
  -- cb_extra is a table containing receiver, urls and remove_path
  local receiver = cb_extra.receiver
  local urls = cb_extra.urls
  local remove_path = cb_extra.remove_path
  local f = cb_extra.func

  -- The previously image to remove
  if remove_path ~= nil then
    os.remove(remove_path)
    print("Deleted: "..remove_path)
  end

  -- Nil or empty, exit case (no more urls)
  if urls == nil or #urls == 0 then
    return false
  end

  -- Take the head and remove from urls table
  local head = table.remove(urls, 1)

  local file_path = download_to_file(head, false)
  local cb_extra = {
    receiver = receiver,
    urls = urls,
    remove_path = file_path,
    func = f
  }

  -- Send first and postpone the others as callback
  f(receiver, file_path, send_generics_from_url_callback, cb_extra)
end

local function send_generics_from_url(f, receiver, urls)
  local cb_extra = {
    receiver = receiver,
    urls = urls,
    remove_path = nil,
    func = f
  }
  send_generics_from_url_callback(cb_extra)
end

local function send_gifs_from_url(receiver, urls)
  send_generics_from_url(send_document, receiver, urls)
end

local function send_videos_from_url(receiver, urls)
  send_generics_from_url(send_video, receiver, urls)
end

local function send_all_files(receiver, urls)
  local data = {
    images = {
      func = send_photos_from_url,
      urls = {}
    },
    gifs = {
      func = send_gifs_from_url,
      urls = {}
    },
    videos = {
      func = send_videos_from_url,
      urls = {}
    }
  }

  local table_to_insert = nil
  for i,url in pairs(urls) do
    local _, _, extension = string.match(url, "(https?)://([^\\]-([^\\%.]+))$")
    local mime_type = mimetype.get_content_type_no_sub(extension)
    if extension == 'gif' then
      table_to_insert = data.gifs.urls
    elseif mime_type == 'image' then
      table_to_insert = data.images.urls
    elseif mime_type == 'video' then
      table_to_insert = data.videos.urls
    else
      table_to_insert = nil
    end
    if table_to_insert then
      table.insert(table_to_insert, url)
    end
  end
  for k, v in pairs(data) do
    if #v.urls > 0 then
    end
    v.func(receiver, v.urls)
  end
end

local function check_keys()
  if consumer_key:isempty() then
    return "Twitter Consumer Key is empty, write it in plugins/tweet.lua"
  end
  if consumer_secret:isempty() then
    return "Twitter Consumer Secret is empty, write it in plugins/tweet.lua"
  end
  if access_token:isempty() then
    return "Twitter Access Token is empty, write it in plugins/tweet.lua"
  end
  if access_token_secret:isempty() then
    return "Twitter Access Token Secret is empty, write it in plugins/tweet.lua"
  end
  return ""
end

local function analyze_tweet(tweet)
  local header = "Tweet from " .. tweet.user.name .. " (@" .. tweet.user.screen_name .. ")\n" -- "Link: https://twitter.com/statuses/" .. tweet.id_str
  local text = tweet.text

  -- replace short URLs
  if tweet.entities.url then
    for k, v in pairs(tweet.entities.urls) do
      local short = v.url
      local long = v.expanded_url
      text = text:gsub(short, long)
    end
  end

  -- remove urls
  local urls = {}
  if tweet.extended_entities and tweet.extended_entities.media then
    for k, v in pairs(tweet.extended_entities.media) do
      if v.video_info and v.video_info.variants then -- If it's a video!
        table.insert(urls, v.video_info.variants[1].url)
      else -- If not, is an image
        table.insert(urls, v.media_url)
      end
      text = text:gsub(v.url, "") -- Replace the URL in text
    end
  end

  return header, text, urls
end

local function sendTweet(receiver, tweet)
  local header, text, urls = analyze_tweet(tweet)
  -- send the parts
  send_msg(receiver, header .. "\n" .. text, ok_cb, false)
  send_all_files(receiver, urls)
  return nil
end

local function getTweet(msg, base, all)
  local receiver = get_receiver(msg)

  local response_code, response_headers, response_status_line, response_body = client:PerformRequest("GET", twitter_url, base)

  if response_code ~= 200 then
    return "Can't connect, maybe the user doesn't exist."
  end

  local response = json:decode(response_body)
  if #response == 0 then
    return "Can't retrieve any tweets, sorry"
  end
  if all then
    for i,tweet in pairs(response) do
      sendTweet(receiver, tweet)
    end
  else
    local i = math.random(#response)
    local tweet = response[i]
    sendTweet(receiver, tweet)
  end

  return nil
end

function isint(n)
  return n==math.floor(n)
end

local function run(msg, matches)
  local checked = check_keys()
  if not checked:isempty() then
    return checked
  end

  local base = {include_rts = 1}

  if matches[1] == 'id' then
    local userid = tonumber(matches[2])
    if userid == nil or not isint(userid) then
      return "The id of a user is a number, check this web: http://gettwitterid.com/"
    end
    base.user_id = userid
  elseif matches[1] == 'name' then
    base.screen_name = matches[2]
  else
    return ""
  end

  local count = 200
  local all = false
  if #matches > 2 and matches[3] == 'last' then
    count = 1
    if #matches == 4 then
      local n = tonumber(matches[4])
      if n > 10 then
        return "You only can ask for 10 tweets at most"
      end
      count = matches[4]
      all = true
    end
  end
  base.count = count

  return getTweet(msg, base, all)
end

return {
  description = "Random tweet from user",
  usage = {
    "!tweet id [id]: Get a random tweet from the user with that ID",
    "!tweet id [id] last: Get a random tweet from the user with that ID",
    "!tweet name [name]: Get a random tweet from the user with that name",
    "!tweet name [name] last: Get a random tweet from the user with that name"
  },
  patterns = {
    "^!tweet (id) ([%w_%.%-]+)$",
    "^!tweet (id) ([%w_%.%-]+) (last)$",
    "^!tweet (id) ([%w_%.%-]+) (last) ([%d]+)$",
    "^!tweet (name) ([%w_%.%-]+)$",
    "^!tweet (name) ([%w_%.%-]+) (last)$",
    "^!tweet (name) ([%w_%.%-]+) (last) ([%d]+)$"
  },
  run = run
}


text:
<!doctype html>

		<meta charset='utf-8' />
		<meta name='viewport' content='width=device-width' />
		<meta http-equiv='X-UA-Compatible' content='ie=edge'>
		<title>Xbox Feed in your macOS menu bar</title>
		<link rel='stylesheet' href='/public/css/xbar.css?cb=08%20Mar%2021%2015%3a22%20GMT'>
		<link rel='preconnect' href='https://fonts.gstatic.com'>
		<link rel='preconnect' href='https://fonts.googleapis.com'>
		<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Bodoni+Moda:wght@500&display=swap'>

	<meta name='description' content='Shows your Xbox Live friend's recent activity - Be sure to read the installation instructions here: https://github.com/kodie/bitbar-xboxfeed - install xbar for free to get started.'>
	<meta name='author' content='Kodie Grantham'>
	<meta name='keywords' content='macos,menubar,xbar,bitbar'>
	<meta itemprop='image' content='https://raw.githubusercontent.com/kodie/bitbar-xboxfeed/master/screenshot.png'>
	<meta itemprop='name' content='Xbox Feed in your macOS menu bar'>
	<meta itemprop='description' content='Shows your Xbox Live friend's recent activity - Be sure to read the installation instructions here: https://github.com/kodie/bitbar-xboxfeed - install xbar for free to get started.'>
	<meta name='twitter:card' content='summary_large_image'>
	<meta name='twitter:title' content='Xbox Feed in your macOS menu bar'>
	<meta name='twitter:description' content='Shows your Xbox Live friend's recent activity - Be sure to read the installation instructions here: https://github.com/kodie/bitbar-xboxfeed - install xbar for free to get started.'>
	<meta name='twitter:image' content='https://raw.githubusercontent.com/kodie/bitbar-xboxfeed/master/screenshot.png'>
	<meta name='twitter:creator' content='matryer'>
	<meta property='og:title' content='Xbox Feed in your macOS menu bar'>
	<meta property='og:description' content='Shows your Xbox Live friend's recent activity - Be sure to read the installation instructions here: https://github.com/kodie/bitbar-xboxfeed - install xbar for free to get started.'>
	<meta property='og:url' content='https://xbarapp.com/plugins/Games/xboxfeed.10m.js.html'>
	<meta property='og:site_name' content='xbar lets you put anything into your macOS menu bar'>
	<meta property='og:type' content='article'>
	<meta property='og:image' content='https://raw.githubusercontent.com/kodie/bitbar-xboxfeed/master/screenshot.png'>
	<link rel='apple-touch-icon' sizes='180x180' href='https://raw.githubusercontent.com/kodie/bitbar-xboxfeed/master/screenshot.png'>
	<link rel='icon' type='image/png' sizes='32x32' href='https://raw.githubusercontent.com/kodie/bitbar-xboxfeed/master/screenshot.png'>
	<link rel='shortcut icon' href='https://raw.githubusercontent.com/kodie/bitbar-xboxfeed/master/screenshot.png'>
	<meta name='msapplication-TileColor' content='#ffffff'>
	<meta name='msapplication-config' content='/public/browserconfig.xml'>
	<meta name='theme-color' content='#ffffff'>

						xbar

						💜 Sponsor

						Coming soon

					AWS

					Cryptocurrency

					Dev

					E-Commerce

					Email

					Environment

					Finance

					Games

					IoT

					Lifestyle

					Music

					Network

					Politics

					Science

					Sports

					System

					Time

					Tools

					Travel

					Weather

					Web

Xbox Feed

										Kodie Grantham (@kodie on GitHub)

						Shows your Xbox Live friend's recent activity - Be sure to read the installation instructions here: https://github.com/kodie/bitbar-xboxfeed

						🖥 Open in xbar app

Requires xbar app

							xboxfeed.10m.js

						Edit

						Open on GitHub

#!/usr/bin/env /usr/local/bin/node
/* jshint esversion: 6 */

/*
<bitbar.title>Xbox Feed</bitbar.title>
<bitbar.version>v1.1.1</bitbar.version>
<bitbar.author>Kodie Grantham</bitbar.author>
<bitbar.author.github>kodie</bitbar.author.github>
<bitbar.desc>Shows your Xbox Live friend's recent activity - Be sure to read the installation instructions here: https://github.com/kodie/bitbar-xboxfeed</bitbar.desc>
<bitbar.image>https://raw.githubusercontent.com/kodie/bitbar-xboxfeed/master/screenshot.png</bitbar.image>
<bitbar.dependencies>node, npm, npm/deasync, npm/home-config, npm/jimp, npm/node-time-ago, npm/open, npm/request</bitbar.dependencies>
<bitbar.dependencies.npm>npm/deasync, npm/home-config, npm/jimp, npm/node-time-ago, npm/open, npm/request</bitbar.dependencies.npm>
<bitbar.abouturl>https://github.com/kodie/bitbar-xboxfeed</bitbar.abouturl>
*/

var ver = '1.1.1';

var defaults = {
  apiKey: '',
  color: false,
  font: false,
  size: false,
  length: false,
  limit: 25,
  imgSize: 18,
  cachePath: '/tmp/xboxfeed',
  cacheExpire: 86400000
};

var requestUrl = 'https://xboxapi.com/v2/activity-feed';
var error = false;

if (process.env.BitBar) {
  var icon = 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAA59GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxMTEgNzkuMTU4MzI1LCAyMDE1LzA5' +
  'LzEwLTAxOjEwOjIwICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxl' +
  'bWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1s' +
  'bnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNy0wMi0wOVQxNDozNzo1Ny0wNjow' +
  'MDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE3LTAyLTA5VDE0OjQxOjI1LTA2OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPHhtcDpNZXRhZGF0YURhdGU+MjAxNy0wMi0wOVQxNDo0MToyNS0wNjowMDwveG1wOk1ldGFkYXRhRGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xv' +
  'ck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDo3YzU0MTY3MC1mYTA5LTRmOTktYThiNy0yNjc0MzU3MWNjZjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDo3MThmZmIxZS0yZjk2LTExN2EtYTQ4ZS1iODlmN2ViNDFmZTI8L3htcE1NOkRvY3VtZW50SUQ+' +
  'CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDo0YmFhN2MxNC0zMjhmLTQ4NjMtOGZlZS0wZDBhOTg2OTU0NTE8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0' +
  'RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6NGJhYTdjMTQtMzI4Zi00ODYzLThmZWUtMGQwYTk4Njk1NDUxPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE3LTAyLTA5VDE0OjM3OjU3LTA2OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RF' +
  'dnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2' +
  'dDppbnN0YW5jZUlEPnhtcC5paWQ6N2M1NDE2NzAtZmEwOS00Zjk5LWE4YjctMjY3NDM1NzFjY2YzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE3LTAyLTA5VDE0OjQxOjI1LTA2OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RF' +
  'dnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj4xNDQwMDAw' +
  'LzEwMDAwPC90aWZmOlhSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpZUmVzb2x1dGlvbj4xNDQwMDAwLzEwMDAwPC90aWZmOllSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjY1NTM1PC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4zMjwv' +
  'ZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4zMjwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg' +
  'ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK' +
  'ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+FngIQQAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAACcUlEQVR42rTXW4hOURQH8N9gkNyGMS5jSlFoXB6oKQ9yaZIpigdJeZCUJynx5l2JF/MwLlNeSLmUSDIkcokiTZNMiNxFZIih0XjZX52Oc853jvmsWg9nr7X+/3X2Xnvtvavkl2FYjsVoRANqgu0TXuIhruMyfqmADMESnEN/' +
  'QT2P5oCRKoPKJDASE/EK9wsk/gw/MB0TVFDm4VjGX5/BooGSjEEbTmI7ahN8mtEdIX6CVSl4G3ERp1BfjnxEmL7oX/VgZ8rynQ7ASevcgs4Y1nuMzUrgVsb0XolUfTlpzcBJraUdOSr7FZpQlYIxA3dy4OyOB9YU2F5vU6a8Otjy4tRFg/fmDPodGlGSVGFtgQQORJvN15xBi3Os/8qcWN8xtEjAlgSypViWML45J+Zq2JfDsT2BZGbE3phgz4PbCh1lnB4ngE8P/SE6nbMS/G6Wwb4Nj8o4zYiBTsPnBL+e' +
  'kFi8q/7MwH4BrzMcdsUA6/Ehw/8TpsRisnbGm6wEumNA43Pu85cYHYu9lOL7WuxQiWpT7DLytMAe74olMCnF7zlcTTDcKHBGpGlHDKMtweeu0JHihpZIYPs/kJf0UASnLsF+GNYkFFJJNg2AvKTbInjnY7b1MBy9kcHjwbmhAuQlXRAwN8TOlZFJ67MujD2oYALvIn2hL4wdTatS4V7XX2HdGrBL3w1pt5jaHN3xX7QHo2LL/JecwIX/QF7Ss2FnVGe9E3r+YwK9GFzuQjE3bMVKk3/Dwrxvg6m4V0HyroST' +
  'MpfsqQD5/oG+lGbjIL4UnO4jmFMOvKpAIuOwIryW52NypJr7wlHdiWvhKfYxD+ifAQDNNFtL9sLcEgAAAABJRU5ErkJggg==';

  console.log(` | dropdown=false templateImage=${icon}`);
  console.log('---');
}

var npmDeps = 'deasync home-config jimp node-time-ago open request';
var dirPlugins = process.argv[1].split('/').slice(0, -1).join('/');

try {
  var cfg = Object.assign({}, defaults, require('home-config').load('.bitbarrc').xboxfeed);
  var deasync = require('deasync');
  var fs = require('fs');
  var Jimp = require('jimp');
  var open = require('open');
  var request = require('request');
  var timeAgo = require('node-time-ago');

  var jimpReadSync = deasync(Jimp.read);
  var requestSync = deasync(request);
} catch(e) {
  if (process.env.BitBar) {
    console.log(`Run Installation | bash="cd ${dirPlugins} && npm install ${npmDeps} --no-package-lock && node ${process.argv[1]} refresh"`);
  } else {
    console.log(e);
  }

  error = true;
}

function refresh() {
  open('bitbar://refreshPlugin?name=xboxfeed.*?.js');
}

function run() {
  function getImage(gamertag, url) {
    if (cfg.cachePath && !fs.existsSync(cfg.cachePath)) { fs.mkdirSync(cfg.cachePath); }
    if (cfg.imgSize > 50) { cfg.imgSize = 50; }
    var size = parseInt(cfg.imgSize);

    gamertag = gamertag.replace(/ /g, '').toLowerCase();
    var img = images[gamertag];

    if (!img) {
      var imgFile = `${cfg.cachePath}/${gamertag}.${size}.png`;

      if (cfg.cachePath && fs.existsSync(imgFile) && (new Date(+fs.statSync(imgFile).mtime + cfg.cacheExpire) > new Date(Date.now()))) {
        img = fs.readFileSync(imgFile);
        img = new Buffer(img);
      } else {
        img = jimpReadSync(url);
        img = img.resize(size, size);
        if (cfg.cachePath) { img.write(imgFile); }
        img.getBufferSync = deasync(img.getBuffer);
        img = img.getBufferSync('image/png');
      }

      img = img.toString('base64');
      images[gamertag] = img;
    }

    return img;
  }

  var res;
  var resBody;

  if (!error) {
    try {
      res = requestSync({ uri: requestUrl, headers: { 'X-AUTH': cfg.apiKey } });
    } catch(e) {
      console.log('Could not connect to API');
      error = true;
    }
  }

  if (!error && res) {
    resBody = JSON.parse(res.body.toString('utf-8'));

    if (res.statusCode >= 300) {
      console.log(resBody.error_message);
      error = true;
    } else if (!resBody || !resBody.activityItems) {
      console.log('No activity posts found. Try refreshing.');
      error = true;
    }
  }

  if (!error && resBody) {
    var feed = resBody.activityItems;
    var images = {};
    var lastText;

    for (var i = 0; (i < feed.length && i < cfg.limit); i++) {
      var authorInfo = feed[i].authorInfo;

      if (!authorInfo || authorInfo.pageName || authorInfo.titleName) { cfg.limit++; continue; }
      var lineText = `${authorInfo.name} ${feed[i].description}`;
      var lineProperties = '';

      if (lineText == lastText) { cfg.limit++; continue; }

      lastText = lineText;
      lineText += ` ${timeAgo(feed[i].date)}`;

      if (process.env.BitBar) {
        var profileUrl = encodeURI(`https://account.xbox.com/en-us/Profile?Gamertag=${authorInfo.name}`);
        lineProperties = ` | href=${profileUrl}`;

        if (cfg.imgSize) {
          var img;
          var imgUrl = authorInfo.imageUrl.replace('&mode=Padding', '');

          try {
            img = getImage(authorInfo.name, imgUrl);
          } catch(e) { }

          if (img) lineProperties += ` image=${img}`;
        }

        if (cfg.color) { lineProperties += ` color=${cfg.color}`; }
        if (cfg.font) { lineProperties += ` font=${cfg.font}`; }
        if (cfg.size) { lineProperties += ` size=${cfg.size}`; }
        if (cfg.length) { lineProperties += ` length=${cfg.length}`; }
      }

      console.log(`${lineText}${lineProperties}`);
    }
  }
}

if (process.argv[2] == 'refresh') {
  refresh();
} else {
  run();
}

if (process.env.BitBar) {
  console.log('---');
  console.log(`BitBar Xbox Feed Plugin v${ver}`);
  console.log('--by Kodie Grantham | href=http://kodieg.com');
  console.log('-----');
  console.log('--GitHub Page | href=https://github.com/kodie/bitbar-xboxfeed');
  console.log('--Changelog | href=https://github.com/kodie/bitbar-xboxfeed/blob/master/CHANGELOG.md');
  console.log('-----');
  console.log('--Refresh | refresh=true terminal=false');
}

						GitHub project
						•
						Writing plugins guide

						Copyright ©2021 Mat Ryer + contributors • @matryer

						Last updated on 08 Mar 21 15:22 GMT


text:
<?php

namespace Webiny\Component\OAuth2\Tests\Mocks;

use Webiny\Component\OAuth2\Bridge\AbstractOAuth2;

/**
 * A mocked OAuth2 bridge.
 *
 * @package         Webiny\Component\OAuth2\Tests\Mocks
 */
class OAuth2BridgeMock extends AbstractOAuth2
{

    /**
     * Base constructor.
     *
     * @param string $clientId     Client id.
     * @param string $clientSecret Client secret.
     * @param string $redirectUri  Target url where to redirect after authentication.
     */
    public function __construct($clientId, $clientSecret, $redirectUri)
    {
        $this->clientId = $clientId;
        $this->clientSecret = $clientSecret;
        $this->redirectUri = $redirectUri;
        $this->accessToken = 'access_token';
        $this->certificate = 'certificate_path';
        $this->accessTokenName = 'test_token';

        $this->setOAuth2Server(ServerMock::class);
    }

    /**
     * Requests the access token from the OAuth server.
     * You can call this method only on the OAuth redirect_uri page or else the request will fail.
     *
     * @param string $tokenUrl Url to the page where we can get the access token.
     *
     * @throws \Webiny\Component\OAuth2\Bridge\OAuth2Exception
     * @return string Access token.
     */
    public function requestAccessToken($tokenUrl)
    {
        return true;
    }

    /**
     * Get access  token.
     *
     * @return string Access token.
     */
    public function getAccessToken()
    {
        return $this->accessToken;
    }

    /**
     * Set the access token.
     *
     * @param string $accessToken Access token.
     *
     * @return void
     */
    public function setAccessToken($accessToken)
    {
        $this->accessToken = $accessToken;
    }

    /**
     * Set the certificate used by OAuth2 requests.
     *
     * @param string $pathToCertificate Absolute path to the certificate file.
     *
     * @return void
     */
    public function setCertificate($pathToCertificate)
    {
        $this->certificate = $pathToCertificate;
    }

    /**
     * Returns the path to certificate.
     *
     * @return string Path to certificate.
     */
    public function getCertificate()
    {
        return $this->certificate;
    }
}


text:
<!DOCTYPE html>
<!--
Copyright (C) 2015 The Android Open Source Project

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.
-->

<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>gr-search-bar</title>

<script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<script src="../../../bower_components/web-component-tester/browser.js"></script>
<link rel="import" href="../../../test/common-test-setup.html"/>
<script src="../../../bower_components/page/page.js"></script>

<link rel="import" href="gr-search-bar.html">
<script src="../../../scripts/util.js"></script>

<script>void(0);</script>

<test-fixture id="basic">
  <template>
    <gr-search-bar></gr-search-bar>
  </template>
</test-fixture>

<script>
  suite('gr-search-bar tests', () => {
    let element;
    let sandbox;

    setup(() => {
      sandbox = sinon.sandbox.create();
      element = fixture('basic');
    });

    teardown(() => {
      sandbox.restore();
    });

    test('value is propagated to _inputVal', () => {
      element.value = 'foo';
      assert.equal(element._inputVal, 'foo');
    });

    getActiveElement = () => {
      return document.activeElement.shadowRoot ?
          document.activeElement.shadowRoot.activeElement :
          document.activeElement;
    };

    test('enter in search input triggers nav', done => {
      sandbox.stub(page, 'show', () => {
        page.show.restore();
        assert.notEqual(getActiveElement(), element.$.searchInput);
        assert.notEqual(getActiveElement(), element.$.searchButton);
        done();
      });
      element.value = 'test';
      MockInteractions.pressAndReleaseKeyOn(element.$.searchInput.$.input, 13,
          null, 'enter');
    });

    test('search query should be double-escaped', () => {
      const showStub = sandbox.stub(page, 'show');
      element.$.searchInput.text = 'fate/stay';
      MockInteractions.pressAndReleaseKeyOn(element.$.searchInput.$.input, 13,
          null, 'enter');
      assert.equal(showStub.lastCall.args[0], '/q/fate%252Fstay');
    });

    test('input blurred after commit', () => {
      sandbox.stub(page, 'show');
      const blurSpy = sandbox.spy(element.$.searchInput.$.input, 'blur');
      element.$.searchInput.text = 'fate/stay';
      MockInteractions.pressAndReleaseKeyOn(element.$.searchInput.$.input, 13,
          null, 'enter');
      assert.isTrue(blurSpy.called);
    });

    test('empty search query does not trigger nav', () => {
      const showSpy = sandbox.spy(page, 'show');
      element.value = '';
      MockInteractions.pressAndReleaseKeyOn(element.$.searchInput.$.input, 13,
          null, 'enter');
      assert.isFalse(showSpy.called);
    });

    test('keyboard shortcuts', () => {
      const focusSpy = sandbox.spy(element.$.searchInput, 'focus');
      const selectAllSpy = sandbox.spy(element.$.searchInput, 'selectAll');
      MockInteractions.pressAndReleaseKeyOn(document.body, 191, null, '/');
      assert.isTrue(focusSpy.called);
      assert.isTrue(selectAllSpy.called);
    });

    suite('_getSearchSuggestions', () => {
      test('Autocompletes accounts', done => {
        sandbox.stub(element.$.restAPI, 'getSuggestedAccounts', () =>
          Promise.resolve([
            {
              name: 'fred',
              email: 'fred@goog.co',
            },
          ])
        );
        element._getSearchSuggestions('owner:fr').then(s => {
          assert.equal(s[0].value, 'owner:"fred <fred@goog.co>"');
          done();
        });
      });

      test('Inserts self as option when valid', done => {
        sandbox.stub(element.$.restAPI, 'getSuggestedAccounts', () =>
          Promise.resolve([
            {
              name: 'fred',
              email: 'fred@goog.co',
            },
          ])
        );
        element._getSearchSuggestions('owner:s').then(s => {
          assert.equal(s[0].value, 'owner:self');
        }).then(() => {
          element._getSearchSuggestions('owner:selfs').then(s => {
            assert.notEqual(s[0].value, 'owner:self');
            done();
          });
        });
      });

      test('Inserts me as option when valid', done => {
        sandbox.stub(element.$.restAPI, 'getSuggestedAccounts', () =>
          Promise.resolve([
            {
              name: 'fred',
              email: 'fred@goog.co',
            },
          ])
        );
        element._getSearchSuggestions('owner:m').then(s => {
          assert.equal(s[0].value, 'owner:me');
        }).then(() => {
          element._getSearchSuggestions('owner:meme').then(s => {
            assert.notEqual(s[0].value, 'owner:me');
            done();
          });
        });
      });

      test('Autocompletes groups', done => {
        sandbox.stub(element.$.restAPI, 'getSuggestedGroups', () =>
          Promise.resolve({
            Polygerrit: 0,
            gerrit: 0,
            gerrittest: 0,
          })
        );
        element._getSearchSuggestions('ownerin:pol').then(s => {
          assert.equal(s[0].value, 'ownerin:Polygerrit');
          done();
        });
      });

      test('Autocompletes projects', done => {
        sandbox.stub(element.$.restAPI, 'getSuggestedProjects', () =>
          Promise.resolve({
            Polygerrit: 0,
          })
        );
        element._getSearchSuggestions('project:pol').then(s => {
          assert.equal(s[0].value, 'project:Polygerrit');
          done();
        });
      });

      test('Autocompletes simple searches', done => {
        element._getSearchSuggestions('is:o').then(s => {
          assert.equal(s[0].name, 'is:open');
          assert.equal(s[0].value, 'is:open');
          assert.equal(s[1].name, 'is:owner');
          assert.equal(s[1].value, 'is:owner');
          done();
        });
      });

      test('Does not autocomplete with no match', done => {
        element._getSearchSuggestions('asdasdasdasd').then(s => {
          assert.equal(s.length, 0);
          done();
        });
      });

      test('Autocomplete doesnt override exact matches to input', done => {
        sandbox.stub(element.$.restAPI, 'getSuggestedGroups', () =>
          Promise.resolve({
            Polygerrit: 0,
            gerrit: 0,
            gerrittest: 0,
          })
        );
        element._getSearchSuggestions('ownerin:gerrit').then(s => {
          assert.equal(s[0].value, 'ownerin:gerrit');
          done();
        });
      });

      test('Autocomplete respects spaces', done => {
        sandbox.stub(element.$.restAPI, 'getSuggestedAccounts', () =>
          Promise.resolve([
            {
              name: 'fred',
              email: 'fred@goog.co',
            },
          ])
        );
        element._getSearchSuggestions('is:ope').then(s => {
          assert.equal(s[0].name, 'is:open');
          assert.equal(s[0].value, 'is:open');
          element._getSearchSuggestions('is:ope ').then(s => {
            assert.equal(s.length, 0);
            done();
          });
        });
      });

      test('Autocompletes accounts with no email', done => {
        sandbox.stub(element.$.restAPI, 'getSuggestedAccounts', () =>
          Promise.resolve([
            {
              name: 'fred',
            },
          ])
        );
        element._getSearchSuggestions('owner:fr').then(s => {
          assert.equal(s[0].value, 'owner:"fred"');
          done();
        });
      });

      test('Autocompletes accounts with email', done => {
        sandbox.stub(element.$.restAPI, 'getSuggestedAccounts', () =>
          Promise.resolve([
            {
              email: 'fred@goog.co',
            },
          ])
        );
        element._getSearchSuggestions('owner:fr').then(s => {
          assert.equal(s[0].value, 'owner:"Anonymous <fred@goog.co>"');
          done();
        });
      });
    });
  });
</script>