text:
//------------------------------------------------------------------------------
// <auto-generated>
//     このコードはツールによって生成されました。
//     ランタイム バージョン:4.0.30319.1
//
//     このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
//     コードが再生成されるときに損失したりします。
// </auto-generated>
//------------------------------------------------------------------------------

namespace ConvertImgTo_HTML.Properties {
    using System;

    /// <summary>
    ///   ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
    /// </summary>
    // このクラスは StronglyTypedResourceBuilder クラスが ResGen
    // または Visual Studio のようなツールを使用して自動生成されました。
    // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
    // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }

        /// <summary>
        ///   このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ConvertImgTo_HTML.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、
        ///   現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   captions = new Array();
        ///
        /////AsciiArtMovieを実現するクラスを定義
        ///function page_Loaded(){
        ///    function MoviePlayer(frames, rendlingElement){
        ///        var _seekPoint = 0;
        ///        var _divArea = rendlingElement;
        ///        var _frames = frames;
        ///
        ///        //メソッドを定義
        ///        function _move(point){
        ///            _divArea.innerHTML = _frames[point];
        ///            _seekPoint = point;
        ///        }
        ///        function _start(){
        ///            //for(i = _seekPoint; i < _frames.length; i++){
        ///            if(_seekPoint < _frames [残りの文字列は切り詰められました]"; に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string JScript {
            get {
                return ResourceManager.GetString("JScript", resourceCulture);
            }
        }

        /// <summary>
        ///   body
        ///{
        ///	background-color:#ffffff;
        ///	white-space:nowrap;
        ///}
        ///div
        ///{
        ///	font-size:10px;
        ///	font-family:MS ゴシック,monospace;
        ///
        ///	line-height:0.5em;
        ///	letter-spacing:0em;
        ///} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string Style_AA {
            get {
                return ResourceManager.GetString("Style_AA", resourceCulture);
            }
        }

        /// <summary>
        ///   body
        ///{
        ///	background-color:#ffffff;
        ///	white-space:nowrap;
        ///
        ///	line-height:5px;
        ///	letter-spacing:-0.1em;
        ///
        ///	margin:0px;
        ///	padding:0px;
        ///}
        ///font
        ///{
        ///	font-size:8px;
        ///	font-family:MS ゴシック,monospace;
        ///
        ///	margin:0px;
        ///	padding:0px;
        ///} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string Style_block {
            get {
                return ResourceManager.GetString("Style_block", resourceCulture);
            }
        }

        /// <summary>
        ///   body
        ///{
        ///	line-height:4pt;
        ///	letter-spacing:-0.1em;
        ///
        ///	background-color:#000000;
        ///	white-space:nowrap;
        ///}
        ///font
        ///{
        ///	font-size:4pt;
        ///
        ///	padding:0px;
        ///	margin:0px;
        ///} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string Style_txt {
            get {
                return ResourceManager.GetString("Style_txt", resourceCulture);
            }
        }

        /// <summary>
        ///   <?xml version="1.0" encoding="utf-8"?>
        ///<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        ///    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
        ///
        ///  <xsl:output method="html" indent="yes" />
        ///  <xsl:param name="Mode"  select="default"/>
        ///  <xsl:param name="StyleSheetHref"/>
        ///  <xsl:param name="captionIndex" />
        ///
        ///  <!--html描画時とJs描画時とで改行コードの有無を分けます。-->
        ///  <xsl:template name="WriteLR">
        ///    <xsl:if test="$Mode!='Movie'">
        ///      <xsl:text disable-output [残りの文字列は切り詰められました]"; に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string Xslt {
            get {
                return ResourceManager.GetString("Xslt", resourceCulture);
            }
        }
    }
}


text:
#ifndef TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_TRANSFORMS_PASSDETAIL_H_
#define TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_TRANSFORMS_PASSDETAIL_H_

#include "mlir/Pass/Pass.h"

namespace mlir {
namespace scf {
class SCFDialect;
}
namespace memref {
class MemRefDialect;
}

namespace mhlo {
class MhloDialect;
#define GEN_PASS_CLASSES
#include "mlir-hlo/Dialect/mhlo/transforms/mhlo_passes.h.inc"

}  // end namespace mhlo

namespace lmhlo {

#define GEN_PASS_CLASSES
#include "mlir-hlo/Dialect/mhlo/transforms/lmhlo_passes.h.inc"

}  // end namespace lmhlo

}  // end namespace mlir

namespace mlir {
namespace disc_ral {

#define GEN_PASS_CLASSES
#include "mlir-hlo/Dialect/mhlo/transforms/disc_ral_passes.h.inc"

}  // end namespace disc_ral
}  // end namespace mlir

#endif  // TENSORFLOW_COMPILER_MLIR_HLO_INCLUDE_MLIR_HLO_DIALECT_MHLO_TRANSFORMS_PASSDETAIL_H_

redpajama_set_name: RedPajamaGithub


text:
      {{ dropdown_label }}

History

      {% for a_year in years|reverse %}

{{a_year}} Season

      {% endfor %}


text:
package org.teavm.classlib.java.text;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.teavm.classlib.java.util.TCalendar;
import org.teavm.classlib.java.util.TGregorianCalendar;
import org.teavm.classlib.java.util.TLocale;
import org.teavm.classlib.java.util.TTimeZone;

/**
 *
 * @author Alexey Andreev
 */
abstract class TDateFormatElement {
    public abstract void format(TCalendar date, StringBuffer buffer);

    public abstract void parse(String text, TCalendar date, TParsePosition position);

    static boolean matches(String text, int position, String pattern) {
        if (pattern.length() + position > text.length()) {
            return false;
        }
        for (int i = 0; i < pattern.length(); ++i) {
            if (Character.toLowerCase(pattern.charAt(i)) != Character.toLowerCase(text.charAt(position++))) {
                return false;
            }
        }
        return true;
    }

    static int whichMatches(String text, TParsePosition position, String[] patterns) {
        for (int i = 0; i < patterns.length; ++i) {
            if (matches(text, position.getIndex(), patterns[i])) {
                position.setIndex(position.getIndex() + patterns[i].length());
                return i;
            }
        }
        return -1;
    }

    public static class MonthText extends TDateFormatElement {
        String[] months;
        String[] shortMonths;
        boolean abbreviated;

        public MonthText(TDateFormatSymbols symbols, boolean abbreviated) {
            months = symbols.getMonths();
            shortMonths = symbols.getShortMonths();
            this.abbreviated = abbreviated;
        }

        @Override
        public void format(TCalendar date, StringBuffer buffer) {
            int month = date.get(TCalendar.MONTH);
            buffer.append(abbreviated ? shortMonths[month] : months[month]);
        }

        @Override
        public void parse(String text, TCalendar date, TParsePosition position) {
            int month = whichMatches(text, position, months);
            if (month < 0) {
                month = whichMatches(text, position, shortMonths);
            }
            if (month < 0) {
                position.setErrorIndex(position.getIndex());
            } else {
                date.set(TCalendar.MONTH, month);
            }
        }
    }

    public static class WeekdayText extends TDateFormatElement {
        String[] weeks;
        String[] shortWeeks;
        boolean abbreviated;

        public WeekdayText(TDateFormatSymbols symbols, boolean abbreviated) {
            weeks = symbols.getWeekdays();
            shortWeeks = symbols.getShortWeekdays();
            this.abbreviated = abbreviated;
        }

        @Override
        public void format(TCalendar date, StringBuffer buffer) {
            int weekday = date.get(TCalendar.DAY_OF_WEEK) - 1;
            buffer.append(abbreviated ? shortWeeks[weekday] : weeks[weekday]);
        }

        @Override
        public void parse(String text, TCalendar date, TParsePosition position) {
            int weekday = whichMatches(text, position, weeks);
            if (weekday < 0) {
                weekday = whichMatches(text, position, shortWeeks);
            }
            if (weekday < 0) {
                position.setErrorIndex(position.getIndex());
            } else {
                date.set(TCalendar.WEEK_OF_MONTH, weekday + 1);
            }
        }
    }

    public static class EraText extends TDateFormatElement {
        String[] eras;

        public EraText(TDateFormatSymbols symbols) {
            eras = symbols.getEras();
        }

        @Override
        public void format(TCalendar date, StringBuffer buffer) {
            int era = date.get(TCalendar.ERA);
            buffer.append(eras[era]);
        }

        @Override
        public void parse(String text, TCalendar date, TParsePosition position) {
            int era = whichMatches(text, position, eras);
            if (era < 0) {
                position.setErrorIndex(position.getIndex());
            } else {
                date.set(TCalendar.ERA, era);
            }
        }
    }

    public static class AmPmText extends TDateFormatElement {
        String[] ampms;

        public AmPmText(TDateFormatSymbols symbols) {
            ampms = symbols.getAmPmStrings();
        }

        @Override
        public void format(TCalendar date, StringBuffer buffer) {
            int ampm = date.get(TCalendar.AM_PM);
            buffer.append(ampms[ampm]);
        }

        @Override
        public void parse(String text, TCalendar date, TParsePosition position) {
            int ampm = whichMatches(text, position, ampms);
            if (ampm < 0) {
                position.setErrorIndex(position.getIndex());
            } else {
                date.set(TCalendar.AM_PM, ampm);
            }
        }
    }

    public static class Numeric extends TDateFormatElement {
        private int field;
        private int length;

        public Numeric(int field, int length) {
            this.field = field;
            this.length = length;
        }

        @Override
        public void format(TCalendar date, StringBuffer buffer) {
            int number = processBeforeFormat(date.get(field));
            String str = Integer.toString(number);
            for (int i = str.length(); i < length; ++i) {
                buffer.append('0');
            }
            buffer.append(str);
        }

        @Override
        public void parse(String text, TCalendar date, TParsePosition position) {
            int num = 0;
            int i = 0;
            int pos = position.getIndex();
            while (pos < text.length()) {
                char c = text.charAt(pos);
                if (c >= '0' && c <= '9') {
                    num = num * 10 + (c - '0');
                    ++pos;
                    ++i;
                } else {
                    break;
                }
            }
            if (i < length) {
                position.setErrorIndex(position.getIndex());
                return;
            }
            position.setIndex(pos);
            date.set(field, processAfterParse(num));
        }

        protected int processBeforeFormat(int num) {
            return num;
        }

        protected int processAfterParse(int num) {
            return num;
        }
    }

    public static class NumericMonth extends Numeric {
        public NumericMonth(int length) {
            super(TCalendar.MONTH, length);
        }

        @Override
        protected int processBeforeFormat(int num) {
            return num + 1;
        }

        @Override
        protected int processAfterParse(int num) {
            return num - 1;
        }
    }

    public static class NumericWeekday extends Numeric {
        public NumericWeekday(int length) {
            super(TCalendar.DAY_OF_WEEK, length);
        }

        @Override
        protected int processBeforeFormat(int num) {
            return num == 1 ? 7 : num - 1;
        }

        @Override
        protected int processAfterParse(int num) {
            return num == 7 ? 1 : num + 1;
        }
    }

    public static class NumericHour extends Numeric {
        private int limit;

        public NumericHour(int field, int length, int limit) {
            super(field, length);
            this.limit = limit;
        }

        @Override
        protected int processBeforeFormat(int num) {
            return num == 0 ? limit : num;
        }

        @Override
        protected int processAfterParse(int num) {
            return num == limit ? 0 : num;
        }
    }

    public static class Year extends TDateFormatElement {
        private int field;

        public Year(int field) {
            this.field = field;
        }

        @Override
        public void format(TCalendar date, StringBuffer buffer) {
            int number = date.get(field);
            if (number < 10) {
                buffer.append(number);
            } else {
                buffer.append((char)((number % 100 / 10) + '0'));
                buffer.append((char)((number % 10) + '0'));
            }
        }

        @Override
        public void parse(String text, TCalendar date, TParsePosition position) {
            int num = 0;
            int pos = position.getIndex();
            char c = text.charAt(pos++);
            if (c < '0' || c > '9') {
                position.setErrorIndex(position.getErrorIndex());
                return;
            }
            num = c - '0';
            c = text.charAt(pos);
            if (c >= '0' && c <= '9') {
                num = num * 10 + (c - '0');
                ++pos;
            }
            position.setIndex(pos);
            TCalendar calendar = new TGregorianCalendar();
            int currentYear = calendar.get(TCalendar.YEAR);
            int currentShortYear = currentYear % 100;
            int century = currentYear / 100;
            if (currentShortYear > 80) {
                if (num < currentShortYear - 80) {
                    century++;
                }
            } else {
                if (num > currentShortYear + 20) {
                    --century;
                }
            }
            date.set(field, num + century * 100);
        }
    }

    public static class ConstantText extends TDateFormatElement {
        private String textConstant;

        public ConstantText(String textConstant) {
            this.textConstant = textConstant;
        }

        @Override
        public void format(TCalendar date, StringBuffer buffer) {
            buffer.append(textConstant);
        }

        @Override
        public void parse(String text, TCalendar date, TParsePosition position) {
            if (matches(text, position.getIndex(), textConstant)) {
                position.setIndex(position.getIndex() + textConstant.length());
            } else {
                position.setErrorIndex(position.getIndex());
            }
        }
    }

    public static abstract class BaseTimezone extends TDateFormatElement {
        private static Map<TLocale, TrieNode> cache;
        private static TrieNode idSearchTrie;
        protected TLocale locale;
        private TrieNode searchTrie;

        public BaseTimezone(TLocale locale) {
            this.locale = locale;
        }

        @Override
        public void parse(String text, TCalendar date, TParsePosition position) {
            if (tryParseFixedTimeZone(text, date, position)) {
                return;
            }
            prepareTrie();
            TTimeZone tz = match(searchTrie, text, position);
            if (tz != null) {
                date.setTimeZone(tz);
            } else {
                prepareIdTrie();
                tz = match(idSearchTrie, text, position);
                if (tz != null) {
                    date.setTimeZone(tz);
                } else {
                    position.setErrorIndex(position.getIndex());
                }
            }
        }

        public TTimeZone match(TrieNode node, String text, TParsePosition position) {
            int start = position.getIndex();
            int index = start;
            int lastMatch = start;
            TTimeZone tz = null;
            while (node.childNodes != null && node.childNodes.length > 0) {
                if (node.tz != null) {
                    lastMatch = index;
                    tz = node.tz;
                }
                if (index >= text.length()) {
                    break;
                }
                int next = Arrays.binarySearch(node.chars, Character.toLowerCase(text.charAt(index++)));
                if (next < 0) {
                    return null;
                }
                node = node.childNodes[next];
            }
            if (node.tz != null) {
                lastMatch = index;
                tz = node.tz;
            }
            position.setIndex(lastMatch);
            return tz;
        }

        private void prepareTrie() {
            if (searchTrie != null) {
                return;
            }
            if (cache == null) {
                cache = new HashMap<>();
            }
            searchTrie = cache.get(locale);
            if (searchTrie != null) {
                return;
            }
            TrieBuilder builder = new TrieBuilder();
            for (String tzId : TTimeZone.getAvailableIDs()) {
                TTimeZone tz = TTimeZone.getTimeZone(tzId);
                builder.add(tz.getDisplayName(locale), tz);
            }
            searchTrie = builder.build();
            cache.put(locale, searchTrie);
        }

        private static void prepareIdTrie() {
            if (idSearchTrie != null) {
                return;
            }
            TrieBuilder builder = new TrieBuilder();
            for (String tzId : TTimeZone.getAvailableIDs()) {
                TTimeZone tz = TTimeZone.getTimeZone(tzId);
                builder.add(tz.getID(), tz);
            }
            idSearchTrie = builder.build();
        }
    }

    public static class GeneralTimezone extends BaseTimezone {
        public GeneralTimezone(TLocale locale) {
            super(locale);
        }

        @Override
        public void format(TCalendar date, StringBuffer buffer) {
            TTimeZone tz = date.getTimeZone();
            if (tz.getID().startsWith("GMT")) {
                int minutes = tz.getRawOffset() / 60_000;
                buffer.append("GMT");
                if (minutes >= 0) {
                    buffer.append('+');
                } else {
                    minutes = -minutes;
                    buffer.append('-');
                }
                int hours = minutes / 60;
                minutes %= 60;
                buffer.append(hours / 10).append(hours % 10).append(':').append(minutes / 10).append(minutes % 10);
            } else {
                buffer.append(tz.getDisplayName(locale));
            }
        }
    }

    public static class Rfc822Timezone extends BaseTimezone {
        public Rfc822Timezone(TLocale locale) {
            super(locale);
        }

        @Override
        public void format(TCalendar date, StringBuffer buffer) {
            TTimeZone tz = date.getTimeZone();
            int minutes = tz.getOffset(date.getTimeInMillis()) / 60_000;
            if (minutes >= 0) {
                buffer.append('+');
            } else {
                minutes = -minutes;
                buffer.append('-');
            }
            int hours = minutes / 60;
            minutes %= 60;
            buffer.append(hours / 10).append(hours % 10).append(minutes / 10).append(minutes % 10);
        }
    }

    public static class Iso8601Timezone extends TDateFormatElement {
        private int size;

        public Iso8601Timezone(int size) {
            this.size = size;
        }

        @Override
        public void format(TCalendar date, StringBuffer buffer) {
            int minutes = date.getTimeZone().getOffset(date.getTimeInMillis()) / 60_000;
            if (minutes == 0) {
                buffer.append('Z');
                return;
            } else if (minutes > 0) {
                buffer.append('+');
            } else {
                minutes = -minutes;
                buffer.append('-');
            }
            int hours = minutes / 60;
            minutes %= 60;
            buffer.append(hours / 10).append(hours % 10);
            if (size >= 3) {
                buffer.append(':');
            }
            if (size > 1) {
                buffer.append(minutes / 10).append(minutes % 10);
            }
        }

        @Override
        public void parse(String text, TCalendar date, TParsePosition position) {
            int index = position.getIndex();
            char signChar = text.charAt(index++);
            int sign;
            if (signChar == '+') {
                sign = 1;
            } else if (signChar == '-') {
                sign = -1;
            } else if (signChar == 'Z') {
                date.setTimeZone(TTimeZone.getTimeZone("GMT"));
                return;
            } else {
                position.setErrorIndex(index);
                return;
            }

            int expectedSize = 2;
            if (size > 1) {
                expectedSize += 2;
            }
            if (size >= 3) {
                ++expectedSize;
            }
            if (index + expectedSize > text.length()) {
                position.setErrorIndex(index);
                return;
            }

            if (!Character.isDigit(text.charAt(index)) || !Character.isDigit(text.charAt(index + 1))) {
                position.setErrorIndex(index);
                return;
            }
            int hours = Character.digit(text.charAt(index++), 10) * 10 + Character.digit(text.charAt(index++), 10);
            if (size >= 3) {
                if (text.charAt(index++) != ':') {
                    position.setErrorIndex(index);
                    return;
                }
            }
            int minutes = 0;
            if (size > 1) {
                if (!Character.isDigit(text.charAt(index)) || !Character.isDigit(text.charAt(index + 1))) {
                    position.setErrorIndex(index);
                    return;
                }
                minutes = Character.digit(text.charAt(index++), 10) * 10 + Character.digit(text.charAt(index++), 10);
            }
            position.setIndex(index);
            date.setTimeZone(getStaticTimeZone(sign * hours, minutes));
        }
    }

    static boolean tryParseFixedTimeZone(String text, TCalendar date, TParsePosition position) {
        general: if (position.getIndex() + 4 < text.length()) {
            int signIndex = position.getIndex() + 3;
            if (!text.substring(position.getIndex(), signIndex).equals("GMT")) {
                break general;
            }
            char signChar = text.charAt(signIndex);
            if (signChar != '+' && signChar != '-') {
                break general;
            }
            parseHoursMinutes(text, date, position);
            return true;
        }
        rfc822: if (position.getIndex() + 5 <= text.length()) {
            int index = position.getIndex();
            char signChar = text.charAt(index++);
            if (signChar != '+' && signChar != '-') {
                break rfc822;
            }
            for (int i = 0; i < 4; ++i) {
                if (!Character.isDigit(text.charAt(index + i))) {
                    break rfc822;
                }
            }
            int sign = signChar == '-' ? -1 : 1;
            int hours = 10 * Character.digit(text.charAt(index), 10) +
                    Character.digit(text.charAt(index + 1), 10);
            int minutes = 10 * Character.digit(text.charAt(index + 2), 10) +
                    Character.digit(text.charAt(index + 3), 10);
            date.setTimeZone(getStaticTimeZone(sign * hours, minutes));
            return true;
        }
        return false;
    }

    static void parseHoursMinutes(String text, TCalendar date, TParsePosition position) {
        int index = position.getIndex() + 3;
        int sign = text.charAt(index++) == '-' ? -1 : 1;
        if (index >= text.length() || !Character.isDigit(text.charAt(index))) {
            position.setErrorIndex(index);
            return;
        }
        int hours = Character.digit(text.charAt(index++), 10);
        if (index >= text.length()) {
            position.setErrorIndex(index);
            return;
        }
        if (text.charAt(index) != ':') {
            if (!Character.isDigit(text.charAt(index))) {
                position.setErrorIndex(index);
                return;
            }
            hours = 10 * hours + Character.digit(text.charAt(index), 10);
        }
        if (index >= text.length() || text.charAt(index) != ':') {
            position.setErrorIndex(index);
            return;
        }
        ++index;

        if (index + 2 > text.length() || !Character.isDigit(text.charAt(index)) ||
                !Character.isDigit(text.charAt(index + 1))) {
            position.setErrorIndex(index);
            return;
        }
        int minutes = Character.digit(text.charAt(index), 10) * 10 + Character.digit(text.charAt(index), 10);
        position.setIndex(index + 2);
        TTimeZone tz = getStaticTimeZone(sign * hours, minutes);
        date.setTimeZone(tz);
    }

    static TTimeZone getStaticTimeZone(int hours, int minutes) {
        return TTimeZone.getTimeZone("GMT" + (hours > 0 ? '+' : '-') + Math.abs(hours) +
                ":" + (minutes / 10) + (minutes % 10));
    }

    static class TrieNode {
        char[] chars;
        TrieNode[] childNodes;
        TTimeZone tz;
    }

    static class TrieBuilder {
        TrieNodeBuilder root = new TrieNodeBuilder();

        public void add(String text, TTimeZone tz) {
            TrieNodeBuilder node = root;
            for (int i = 0; i < text.length(); ++i) {
                char c = Character.toLowerCase(text.charAt(i));
                while (node.ch != c) {
                    if (node.ch == '\0') {
                        node.ch = c;
                        node.sibling = new TrieNodeBuilder();
                        break;
                    }
                    node = node.sibling;
                }
                if (node.next == null) {
                    node.next = new TrieNodeBuilder();
                }
                node = node.next;
            }
            node.tz = tz;
        }

        public TrieNode build() {
            return build(root);
        }

        TrieNode build(TrieNodeBuilder builder) {
            TrieNode node = new TrieNode();
            if (builder == null) {
                return node;
            }
            node.tz = builder.tz;
            List<TrieNodeBuilder> builders = new ArrayList<>();
            TrieNodeBuilder tmp = builder;
            while (tmp.ch != '\0') {
                builders.add(tmp);
                tmp = tmp.sibling;
            }
            Collections.sort(builders, new Comparator<TrieNodeBuilder>() {
                @Override public int compare(TrieNodeBuilder o1, TrieNodeBuilder o2) {
                    return Character.compare(o1.ch, o2.ch);
                }
            });
            node.chars = new char[builders.size()];
            node.childNodes = new TrieNode[builders.size()];
            for (int i = 0; i < node.chars.length; ++i) {
                node.chars[i] = builders.get(i).ch;
                node.childNodes[i] = build(builders.get(i).next);
            }
            return node;
        }
    }

    static class TrieNodeBuilder {
        char ch;
        TrieNodeBuilder next;
        TTimeZone tz;
        TrieNodeBuilder sibling;
    }
}


text:
namespace gl {
namespace {

class GLImageOzoneNativePixmapTestDelegate {
 public:
  scoped_refptr<gl::GLImage> CreateSolidColorImage(
      const gfx::Size& size,
      const uint8_t color[4]) const {
    ui::SurfaceFactoryOzone* surface_factory =
        ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone();
    scoped_refptr<ui::NativePixmap> pixmap =
        surface_factory->CreateNativePixmap(gfx::kNullAcceleratedWidget, size,
                                            gfx::BufferFormat::RGBA_8888,
                                            gfx::BufferUsage::SCANOUT);
    EXPECT_TRUE(pixmap != nullptr);
    scoped_refptr<gfx::GLImageOzoneNativePixmap> image(
        new gfx::GLImageOzoneNativePixmap(size, GL_RGBA));
    EXPECT_TRUE(image->Initialize(pixmap.get(), pixmap->GetBufferFormat()));
    return image;
  }
};

INSTANTIATE_TYPED_TEST_CASE_P(GLImageOzoneNativePixmap,
                              GLImageTest,
                              GLImageOzoneNativePixmapTestDelegate);

}  // namespace
}  // namespace gl


text:
"""
test_results_dir.py simply prints the directory that rosunit/rostest
results are stored in.
"""

from __future__ import print_function

import rospkg

print(rospkg.get_test_results_dir())


text:
import logging
try:
    from pathlib2 import Path
except Exception:
    from pathlib import Path
import yaml
import numbers

def batch_runner(element, function, reader, pass_batch_info, cast_dtype,
                 kwargs, cleanup_function, buffer_size, save_chunks,
                 output_path=None):
    i, idx = element

    logger = logging.getLogger(__name__)
    logger.debug('Processing batch {}...'.format(i))

    if callable(reader):
        _reader = reader()
    else:
        _reader = reader

    subset, idx_local = _reader[idx]

    # read chunk and run function
    logger.debug('Applying function in batch %s with size %s',
                 i, subset.shape)

    kwargs_other = dict()

    if pass_batch_info:
        kwargs_other['idx_local'] = idx_local
        kwargs_other['idx'] = idx

    kwargs.update(kwargs_other)

    res = function(subset, **kwargs)

    logger.debug('Done Applying function in batch {}...'.format(i))

    if cast_dtype is not None:
        res = res.astype(cast_dtype)

    if cleanup_function:
        res = cleanup_function(res, idx_local, idx, buffer_size)

    if save_chunks:
        # save chunk to disk
        chunk_path = make_chunk_path(output_path, i)

        with open(chunk_path, 'wb') as f:
            res.tofile(f)

    return res

def make_chunk_path(output_path, i):
    name, ext = output_path.parts[-1].split('.')
    filename = name+str(i)+'.'+ext

    parts = list(output_path.parts[:-1])
    parts.append(filename)
    chunk_path = Path(*parts)

    return str(chunk_path)

def make_metadata(channels, n_channels, dtype, output_path):
    """Make and save metadata for a binary file

    Parameters
    ----------
    chahnels: str or int
        The value of the channels parameter
    n_channels: int
        Number of channels in the whole dataset (not necessarily match the
        number of channels in the subset)
    dtype: str
        dtype
    output_path: str
        Where to save the file
    """
    if channels == 'all':
        _n_channels = n_channels
    elif isinstance(channels, numbers.Integral):
        _n_channels = 1
    else:
        _n_channels = len(channels)

    # save yaml file with params
    path_to_yaml = str(output_path).replace('.bin', '.yaml')

    params = dict(dtype=dtype, n_channels=_n_channels, data_order='samples')

    with open(path_to_yaml, 'w') as f:
        yaml.dump(params, f)

    return params


text:
package com.vl.samples.verticalTextView;

import android.app.Activity;
import android.os.Bundle;
import android.view.animation.AnimationUtils;
import android.view.animation.RotateAnimation;
import android.widget.TextView;

import com.vl.samples.R;

public class VerticalTextActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.vertical_text);

		RotateAnimation ranim = (RotateAnimation)AnimationUtils.loadAnimation(this, R.anim.rotateanim);
		ranim.setFillAfter(true); //For the textview to remain at the same place after the rotation
		((TextView)findViewById(R.id.textView1)).setAnimation(ranim);
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.google.firebase.example.perfmon">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:name=".MyApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.FireperfViewsSample.NoActionBar">

        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".TestActivity"
            android:label="@string/app_name" />

    </application>

</manifest>


text:
namespace store {
namespace layout {

extern const char* results_auto_create_name;
extern const char* results_auto_open_name;

utils::fs::path find_results(const std::string&);
results_id_file_pair new_db(const std::string&, const utils::fs::path&);
utils::fs::path new_db_for_migration(const utils::fs::path&,
                                     const utils::datetime::timestamp&);
utils::fs::path query_store_dir(void);
std::string test_suite_for_path(const utils::fs::path&);

}  // namespace layout
}  // namespace store

#endif  // !defined(STORE_LAYOUT_HPP)


text:
/*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
!function (t) {
    var s;
    window.UIkit && (s = t(UIkit)), "function" == typeof define && define.amd && define("uikit-nestable", ["uikit"], function () {
        return s || t(UIkit)
    })
}(function (t) {
    "use strict";
    var s, e = "ontouchstart" in window, i = t.$html, l = [], a = t.$win, n = e ? "touchstart" : "mousedown", o = e ? "touchmove" : "mousemove", h = e ? "touchend" : "mouseup", r = e ? "touchcancel" : "mouseup";
    return t.component("nestable", {
        defaults: {
            listBaseClass: "uk-nestable",
            listClass: "uk-nestable-list",
            listItemClass: "uk-nestable-item",
            dragClass: "uk-nestable-dragged",
            movingClass: "uk-nestable-moving",
            noChildrenClass: "uk-nestable-nochildren",
            emptyClass: "uk-nestable-empty",
            handleClass: "",
            collapsedClass: "uk-collapsed",
            placeholderClass: "uk-nestable-placeholder",
            noDragClass: "uk-nestable-nodrag",
            group: !1,
            maxDepth: 10,
            threshold: 20,
            idlethreshold: 10
        }, boot: function () {
            t.$html.on("mousemove touchmove", function () {
                if (s) {
                    var e = s.offset().top;
                    e < t.$win.scrollTop() ? t.$win.scrollTop(t.$win.scrollTop() - Math.ceil(s.height() / 2)) : e + s.height() > window.innerHeight + t.$win.scrollTop() && t.$win.scrollTop(t.$win.scrollTop() + Math.ceil(s.height() / 2))
                }
            }), t.ready(function (s) {
                t.$("[data-uk-nestable]", s).each(function () {
                    var s = t.$(this);
                    s.data("nestable") || t.nestable(s, t.Utils.options(s.attr("data-uk-nestable")))
                })
            })
        }, init: function () {
            var i = this;
            Object.keys(this.options).forEach(function (t) {
                -1 != String(t).indexOf("Class") && (i.options["_" + t] = "." + i.options[t])
            }), this.find(this.options._listItemClass).find(">ul").addClass(this.options.listClass), this.checkEmptyList(), this.reset(), this.element.data("nestable-group", this.options.group || t.Utils.uid("nestable-group")), this.find(this.options._listItemClass).each(function () {
                i.setParent(t.$(this))
            }), this.on("click", "[data-nestable-action]", function (s) {
                if (!i.dragEl && (e || 0 === s.button)) {
                    s.preventDefault();
                    var l = t.$(s.currentTarget), a = l.data("nestableAction"), n = l.closest(i.options._listItemClass);
                    "collapse" === a && i.collapseItem(n), "expand" === a && i.expandItem(n), "toggle" === a && i.toggleItem(n)
                }
            });
            var l = function (s) {
                var l = t.$(s.target), a = l.is("a[href]") ? l : l.parents("a[href]");
                s.target !== i.element[0] && (l.is(i.options._noDragClass) || l.closest(i.options._noDragClass).length || l.is("[data-nestable-action]") || l.closest("[data-nestable-action]").length || (i.options.handleClass && !l.hasClass(i.options.handleClass) && i.options.handleClass && (l = l.closest(i.options._handleClass)), !l.length || i.dragEl || !e && 0 !== s.button || e && 1 !== s.touches.length || (s.originalEvent && s.originalEvent.touches && (s = evt.originalEvent.touches[0]), i.delayMove = function (t) {
                    a = !1, t.preventDefault(), i.dragStart(s), i.trigger("start.uk.nestable", [i]), i.delayMove = !1
                }, i.delayMove.x = parseInt(s.pageX, 10), i.delayMove.y = parseInt(s.pageY, 10), i.delayMove.threshold = i.options.idlethreshold, a.length && "touchend" == h && i.one(h, function () {
                    a && a.attr("href").trim() && (location.href = a.attr("href"))
                }), s.preventDefault())))
            }, d = function (t) {
                t.originalEvent && t.originalEvent.touches && (t = t.originalEvent.touches[0]), i.delayMove && (Math.abs(t.pageX - i.delayMove.x) > i.delayMove.threshold || Math.abs(t.pageY - i.delayMove.y) > i.delayMove.threshold) && (window.getSelection().toString() ? i.delayMove = !1 : i.delayMove(t)), i.dragEl && (t.preventDefault(), i.dragMove(t), i.trigger("move.uk.nestable", [i]))
            }, p = function (t) {
                i.dragEl && (t.preventDefault(), i.dragStop(e ? t.touches[0] : t)), s = !1, i.delayMove = !1
            };
            e ? (this.element[0].addEventListener(n, l, !1), window.addEventListener(o, d, !1), window.addEventListener(h, p, !1), window.addEventListener(r, p, !1)) : (this.on(n, l), a.on(o, d), a.on(h, p))
        }, serialize: function () {
            var s, e = 0, i = this, l = function (s, e) {
                var a = [], n = s.children(i.options._listItemClass);
                return n.each(function () {
                    for (var s, n, o, h = t.$(this), r = {}, d = h.children(i.options._listClass), p = 0; p < h[0].attributes.length; p++)s = h[0].attributes[p], 0 === s.name.indexOf("data-") && (n = s.name.substr(5), o = t.Utils.str2json(s.value), r[n] = o || "false" == s.value || "0" == s.value ? o : s.value);
                    d.length && (r.children = l(d, e + 1)), a.push(r)
                }), a
            };
            return s = l(i.element, e)
        }, list: function (s) {
            var e = [], i = this, l = 0, a = function (i, l, n) {
                var o = i.children(s._listItemClass);
                o.each(function (i) {
                    var o = t.$(this), h = t.$.extend({
                        parent_id: n ? n : null,
                        depth: l,
                        order: i
                    }, o.data()), r = o.children(s._listClass);
                    e.push(h), r.length && a(r, l + 1, o.data(s.idProperty || "id"))
                })
            };
            return s = t.$.extend({}, i.options, s), a(i.element, l), e
        }, reset: function () {
            this.mouse = {
                offsetX: 0,
                offsetY: 0,
                startX: 0,
                startY: 0,
                lastX: 0,
                lastY: 0,
                nowX: 0,
                nowY: 0,
                distX: 0,
                distY: 0,
                dirAx: 0,
                dirX: 0,
                dirY: 0,
                lastDirX: 0,
                lastDirY: 0,
                distAxX: 0,
                distAxY: 0
            }, this.moving = !1, this.dragEl = null, this.dragRootEl = null, this.dragDepth = 0, this.hasNewRoot = !1, this.pointEl = null;
            for (var t = 0; t < l.length; t++)this.checkEmptyList(l[t]);
            l = []
        }, toggleItem: function (t) {
            this[t.hasClass(this.options.collapsedClass) ? "expandItem" : "collapseItem"](t)
        }, expandItem: function (t) {
            t.removeClass(this.options.collapsedClass)
        }, collapseItem: function (t) {
            var s = t.children(this.options._listClass);
            s.length && t.addClass(this.options.collapsedClass)
        }, expandAll: function () {
            var s = this;
            this.find(s.options._listItemClass).each(function () {
                s.expandItem(t.$(this))
            })
        }, collapseAll: function () {
            var s = this;
            this.find(s.options._listItemClass).each(function () {
                s.collapseItem(t.$(this))
            })
        }, setParent: function (t) {
            t.children(this.options._listClass).length && t.addClass("uk-parent")
        }, unsetParent: function (t) {
            t.removeClass("uk-parent " + this.options.collapsedClass), t.children(this.options._listClass).remove()
        }, dragStart: function (e) {
            var l = this.mouse, a = t.$(e.target), n = a.closest(this.options._listItemClass), o = n.offset();
            this.placeEl = n, l.offsetX = e.pageX - o.left, l.offsetY = e.pageY - o.top, l.startX = l.lastX = o.left, l.startY = l.lastY = o.top, this.dragRootEl = this.element, this.dragEl = t.$("

").addClass(this.options.listClass + " " + this.options.dragClass).append(n.clone()), this.dragEl.css("width", n.width()), this.placeEl.addClass(this.options.placeholderClass), s = this.dragEl, this.tmpDragOnSiblings = [n[0].previousSibling, n[0].nextSibling], t.$body.append(this.dragEl), this.dragEl.css({
                left: o.left,
                top: o.top
            });
            var h, r, d = this.dragEl.find(this.options._listItemClass);
            for (h = 0; h < d.length; h++)r = t.$(d[h]).parents(this.options._listClass + "," + this.options._listBaseClass).length, r > this.dragDepth && (this.dragDepth = r);
            i.addClass(this.options.movingClass)
        }, dragStop: function () {
            var s = t.$(this.placeEl), e = this.placeEl.parents(this.options._listBaseClass + ":first");
            this.placeEl.removeClass(this.options.placeholderClass), this.dragEl.remove(), this.element[0] !== e[0] ? (e.trigger("change.uk.nestable", [e.data("nestable"), s, "added"]), this.element.trigger("change.uk.nestable", [this, s, "removed"])) : this.element.trigger("change.uk.nestable", [this, s, "moved"]), this.trigger("stop.uk.nestable", [this, s]), this.reset(), i.removeClass(this.options.movingClass)
        }, dragMove: function (s) {
            var e, i, a, n, o, h = this.options, r = this.mouse, d = this.dragRootEl ? this.dragRootEl.data("nestable").options.maxDepth : h.maxDepth;
            this.dragEl.css({
                left: s.pageX - r.offsetX,
                top: s.pageY - r.offsetY
            }), r.lastX = r.nowX, r.lastY = r.nowY, r.nowX = s.pageX, r.nowY = s.pageY, r.distX = r.nowX - r.lastX, r.distY = r.nowY - r.lastY, r.lastDirX = r.dirX, r.lastDirY = r.dirY, r.dirX = 0 === r.distX ? 0 : r.distX > 0 ? 1 : -1, r.dirY = 0 === r.distY ? 0 : r.distY > 0 ? 1 : -1;
            var p = Math.abs(r.distX) > Math.abs(r.distY) ? 1 : 0;
            if (!r.moving)return r.dirAx = p, r.moving = !0, void 0;
            if (r.dirAx !== p ? (r.distAxX = 0, r.distAxY = 0) : (r.distAxX += Math.abs(r.distX), 0 !== r.dirX && r.dirX !== r.lastDirX && (r.distAxX = 0), r.distAxY += Math.abs(r.distY), 0 !== r.dirY && r.dirY !== r.lastDirY && (r.distAxY = 0)), r.dirAx = p, r.dirAx && r.distAxX >= h.threshold && (r.distAxX = 0, a = this.placeEl.prev("li"), r.distX > 0 && a.length && !a.hasClass(h.collapsedClass) && !a.hasClass(h.noChildrenClass) && (e = a.find(h._listClass).last(), o = this.placeEl.parents(h._listClass + "," + h._listBaseClass).length, o + this.dragDepth <= d && (e.length ? (e = a.children(h._listClass).last(), e.append(this.placeEl)) : (e = t.$("
").addClass(h.listClass), e.append(this.placeEl), a.append(e), this.setParent(a)))), r.distX < 0 && (n = this.placeEl.next(h._listItemClass), !n.length))) {
                var c = this.placeEl.closest([h._listBaseClass, h._listClass].join(",")), g = c.closest(h._listItemClass);
                g.length && (g.after(this.placeEl), c.children().length || this.unsetParent(g))
            }
            var u = !1, f = s.pageX - (window.pageXOffset || document.scrollLeft || 0), m = s.pageY - (window.pageYOffset || document.documentElement.scrollTop);
            if (this.pointEl = t.$(document.elementFromPoint(f, m)), h.handleClass && this.pointEl.hasClass(h.handleClass))this.pointEl = this.pointEl.closest(h._listItemClass); else {
                var C = this.pointEl.closest(h._listItemClass);
                C.length && (this.pointEl = C)
            }
            if (!this.placeEl.find(this.pointEl).length) {
                if (this.pointEl.data("nestable") && !this.pointEl.children().length)u = !0, this.checkEmptyList(this.pointEl); else if (!this.pointEl.length || !this.pointEl.hasClass(h.listItemClass))return;
                var v = this.element, E = this.pointEl.closest(this.options._listBaseClass), b = v[0] != E[0];
                if (!r.dirAx || b || u) {
                    if (b && h.group !== E.data("nestable-group"))return;
                    if (l.push(v), o = this.dragDepth - 1 + this.pointEl.parents(h._listClass + "," + h._listBaseClass).length, o > d)return;
                    var X = s.pageY < this.pointEl.offset().top + this.pointEl.height() / 2;
                    i = this.placeEl.parent(), u ? this.pointEl.append(this.placeEl) : X ? this.pointEl.before(this.placeEl) : this.pointEl.after(this.placeEl), i.children().length || i.data("nestable") || this.unsetParent(i.parent()), this.checkEmptyList(this.dragRootEl), this.checkEmptyList(v), b && (this.dragRootEl = E, this.hasNewRoot = this.element[0] !== this.dragRootEl[0])
                }
            }
        }, checkEmptyList: function (s) {
            s = s ? t.$(s) : this.element, this.options.emptyClass && s[s.children().length ? "removeClass" : "addClass"](this.options.emptyClass)
        }
    }), t.nestable
});


text:
package structures;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;

public class Polygon {

	public Point[] points;
	public Edge[] edges;
	public Point center;
	private Point trueCenter;
	private double area;
	public HashSet<Point> neighborCenters;
	public HashSet<Polygon> neighbors;

	public Polygon(ArrayList<Point> polygonPoints, Point centerPoint) {
		points = new Point[polygonPoints.size()];

		for (int i = 0; i < points.length; i++) {
			double angle = Math.atan2(polygonPoints.get(0).y - centerPoint.y, polygonPoints.get(0).x - centerPoint.x);
			int nextPoint = 0;
			for (int j = 1; j < polygonPoints.size(); j++) {
				double jangle = Math.atan2(polygonPoints.get(j).y - centerPoint.y,
						polygonPoints.get(j).x - centerPoint.x);
				if (jangle < angle) {
					angle = jangle;
					nextPoint = j;
				}

			}
			points[i] = polygonPoints.get(nextPoint);
			polygonPoints.remove(nextPoint);
		}

		area = -1;
		center = centerPoint;

	}

	public Point trueCenter() {
		if (trueCenter != null)
			return trueCenter;

		double x = 0;
		double y = 0;
		for (Point p : points) {
			// if (p.x < 0) {
			// x += 0;
			// } else if (p.x > 1280) {
			// x += 1280;
			// } else {
			// x += p.x;
			// }
			//
			// if (p.y < 0) {
			// y += 0;
			// } else if (p.y > 704) {
			// y += 704;
			// } else {
			// y += p.y;
			// }

			x += p.x;
			y += p.y;

		}

		return new Point(x / points.length, y / points.length);
	}

	public java.awt.Polygon getJavaPolygon() {
		int[] xpoints = new int[points.length];
		int[] ypoints = new int[points.length];
		for (int i = 0; i < points.length; i++) {
			xpoints[i] = (int) Math.round(points[i].x);
			ypoints[i] = (int) Math.round(points[i].y);
		}

		return new java.awt.Polygon(xpoints, ypoints, points.length);
	}

	public boolean hasPoint(Point p) {
		for (Point myP : points)
			if ((myP.x == p.x) && (myP.y == p.y))
				return true;
		return false;
	}

	public boolean hasEdge(Edge e) {
		return (hasPoint(e.p1) && hasPoint(e.p2));
	}

	public boolean sharesEdge(Polygon poly) {
		int count = 0;
		for (Point pP : poly.points)
			if (hasPoint(pP))
				count++;

		return count == 2;
	}

	public Edge[] getEdges(HashSet<Edge> edgeSet) {
		if (edges != null)
			return edges;

		ArrayList<Edge> edgeList = new ArrayList<>();
		for (Edge e : edgeSet)
			if (hasEdge(e))
				edgeList.add(e);

		edges = new Edge[edgeList.size()];
		for (int i = 0; i < edges.length; i++)
			edges[i] = edgeList.get(i);

		return edges;
	}

	public void setNeighbors(HashMap<Point, Polygon> centersOfPolygons) {
		neighbors = new HashSet<>();
		for (Point p : neighborCenters)
			neighbors.add(centersOfPolygons.get(p));

		Iterator<Polygon> neighborIter = neighbors.iterator();
		while (neighborIter.hasNext()) {
			Polygon poly = neighborIter.next();
			if (!this.sharesEdge(poly))
				neighborIter.remove();
		}

	}

	public double getArea() {
		if (area != -1)
			return area;

		Point p, np;
		for (int i = 0; i < points.length; i++) {
			p = points[i];
			np = points[i < points.length - 1 ? i + 1 : 0];
			area += p.x * np.y - p.y * np.x;
		}
		area /= 2;
		return area;
	}

}


text:
package reactor.core.publisher;

import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

import org.junit.jupiter.api.Test;
import reactor.core.Scannable;
import reactor.core.scheduler.Scheduler;
import reactor.core.scheduler.Schedulers;
import reactor.test.StepVerifier;
import reactor.util.concurrent.Queues;
import reactor.util.function.Tuple2;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

class ParallelMergeOrderedTest {

	// see https://github.com/reactor/reactor-core/issues/1958
	@Test
	void dealsWithPrefetchLargerThanSmallBufferSize() {
		int parallelism = 2;  // parallelism must be > 1 to expose issue
		int bufferS = Queues.SMALL_BUFFER_SIZE;
		int orderedPrefetch = bufferS + 128; // if orderedPrefetch > bufferS then operator used to drop elements and eventually hang

		final AtomicInteger prev = new AtomicInteger(-1);

		Flux.range(0, 200_000)
		    .subscribeOn(Schedulers.newSingle("init", true))
		    .parallel(parallelism, bufferS)
		    .runOn(Schedulers.newParallel("process", parallelism, true), bufferS)
		    .map(i -> i)
		    .ordered(Comparator.comparing(i -> i), orderedPrefetch)
		    .as(StepVerifier::create)
		    .thenConsumeWhile(current -> {
			    int previous = prev.getAndSet(current);
			    try {
				    assertThat(current)
						    .withFailMessage("elements dropped: prev: %d, next: %d, lost: %d\n", previous, current, current - previous)
						    .isEqualTo(previous + 1);
			    }
			    catch (AssertionError ae) {
				    ae.printStackTrace();
			    }
			    return true;
		    })
		    .expectComplete()
		    .verify(Duration.ofSeconds(5)); //should run in 3s
	}

	@Test
	public void reorderingByIndex() {
		final int LOOPS = 100;
		final int PARALLELISM = 2;
		final List<Integer> ordered = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

		int notShuffled = 0;
		for (int i = 0; i < LOOPS; i++) {
			final Scheduler SCHEDULER = Schedulers.newParallel("test", PARALLELISM);
			final List<Integer> disordered = Collections.synchronizedList(new ArrayList<>());

			List<Integer> reordered = Flux.fromIterable(ordered)
			                         .hide()
			                         .index()
			                         .parallel(PARALLELISM)
			                         .runOn(SCHEDULER)
			                         .doOnNext(t2 -> disordered.add(t2.getT2()))
			                         .ordered(Comparator.comparing(Tuple2::getT1))
			                         .map(Tuple2::getT2)
			                         .collectList()
			                         .block();

			SCHEDULER.dispose();

			assertThat(reordered).containsExactlyElementsOf(ordered);
			assertThat(disordered).containsExactlyInAnyOrderElementsOf(ordered);

			try {
				assertThat(disordered).doesNotContainSequence(ordered);
				System.out.println("parallel shuffled the collection into " + disordered);
				break;
			}
			catch (AssertionError e) {
				notShuffled++;
			}
		}
		if (notShuffled > 0) {
			System.out.println("not shuffled loops: " + notShuffled);
		}

		assertThat(LOOPS - notShuffled)
				.as("at least one run shuffled")
				.isGreaterThan(0);
	}

	@Test
	public void rejectPrefetchZero() {
		assertThatIllegalArgumentException()
				.isThrownBy(() -> new ParallelMergeOrdered<>(null, 0, null))
				.withMessage("prefetch > 0 required but it was 0");
	}

	@Test
	public void rejectPrefetchNegative() {
		assertThatIllegalArgumentException()
				.isThrownBy(() -> new ParallelMergeOrdered<>(null,-1, null))
				.withMessage("prefetch > 0 required but it was -1");
	}

	@Test
	public void getPrefetch() {
		ParallelMergeOrdered<Integer> test = new ParallelMergeOrdered<>(null, 123, null);

		assertThat(test.getPrefetch()).isEqualTo(123);
	}

	@Test
	public void getPrefetchAPI() {
		Flux<Integer> test = Flux.range(1, 10)
		                         .parallel()
		                         .ordered(Comparator.naturalOrder(), 123);

		assertThat(test.getPrefetch()).isEqualTo(123);
	}

	@Test
	public void scanUnsafe() {
		ParallelFlux<Integer> source = Flux.range(1, 10)
		                                   .parallel(2);
		ParallelMergeOrdered<Integer> test = new ParallelMergeOrdered<>(source, 123, null);

		assertThat(test.scan(Scannable.Attr.PARENT)).isSameAs(source);
		assertThat(test.scan(Scannable.Attr.PREFETCH)).isEqualTo(123);
		assertThat(test.scan(Scannable.Attr.RUN_STYLE)).isSameAs(Scannable.Attr.RunStyle.SYNC);

		assertThat(test.scan(Scannable.Attr.NAME)).isNull();
	}
}


text:
module Metrica
  module Instrumentation
    # @api private
    module ActionController

      @@_metrica_process_action_timer = Metrica.timer("request.controller")
      @@_metrica_render_timer = Metrica.timer("request.rendering")

      def process_action(*args)
        @@_metrica_process_action_timer.measure { super }
      end

      def render(*args)
        @@_metrica_render_timer.measure { super }
      end

    end
  end
end


text:
<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0">
  <xqdoc:control>
    <xqdoc:date>2013-12-17T12:14:38.372+01:00</xqdoc:date>
    <xqdoc:version>1.1</xqdoc:version>
  </xqdoc:control>
  <xqdoc:module type="library">
    <xqdoc:uri>http://www.woerteler.de/xquery/modules/queue</xqdoc:uri>
    <xqdoc:name>queue.xqm</xqdoc:name>
    <xqdoc:comment>
      <xqdoc:description>A simple queue implementation.</xqdoc:description>
      <xqdoc:author>Leo Woerteler <leo@woerteler.de></xqdoc:author>
      <xqdoc:version>0.1</xqdoc:version>
      <xqdoc:custom tag="license">BSD 2-Clause License</xqdoc:custom>
    </xqdoc:comment>
  </xqdoc:module>
  <xqdoc:namespaces>
    <xqdoc:namespace prefix="queue" uri="http://www.woerteler.de/xquery/modules/queue"/>
    <xqdoc:namespace prefix="pair" uri="http://www.woerteler.de/xquery/modules/pair"/>
    <xqdoc:namespace prefix="list" uri="http://www.woerteler.de/xquery/modules/list"/>
  </xqdoc:namespaces>
  <xqdoc:imports>
    <xqdoc:import type="library">
      <xqdoc:uri>http://www.woerteler.de/xquery/modules/pair</xqdoc:uri>
    </xqdoc:import>
    <xqdoc:import type="library">
      <xqdoc:uri>http://www.woerteler.de/xquery/modules/list</xqdoc:uri>
    </xqdoc:import>
  </xqdoc:imports>
  <xqdoc:variables/>
  <xqdoc:functions>
    <xqdoc:function arity="0">
      <xqdoc:comment>
        <xqdoc:description>The empty queue.</xqdoc:description>
        <xqdoc:return>the empty queue</xqdoc:return>
      </xqdoc:comment>
      <xqdoc:name>queue:empty</xqdoc:name>
      <xqdoc:annotations>
        <xqdoc:annotation name="public"/>
      </xqdoc:annotations>
      <xqdoc:signature>declare %public function queue:empty() as item()*</xqdoc:signature>
      <xqdoc:return>
        <xqdoc:type occurrence="*">item()</xqdoc:type>
      </xqdoc:return>
    </xqdoc:function>
    <xqdoc:function arity="2">
      <xqdoc:comment>
        <xqdoc:description>Enqueues the given value into the given queue.</xqdoc:description>
        <xqdoc:param>$x the value to enqueue</xqdoc:param>
        <xqdoc:param>$queue the queue</xqdoc:param>
        <xqdoc:return>the queue with <code>$x</code> added at the back</xqdoc:return>
      </xqdoc:comment>
      <xqdoc:name>queue:enqueue</xqdoc:name>
      <xqdoc:annotations>
        <xqdoc:annotation name="public"/>
      </xqdoc:annotations>
      <xqdoc:signature>declare %public function queue:enqueue($x as item()*, $queue as item()*) as function(*)</xqdoc:signature>
      <xqdoc:parameters>
        <xqdoc:parameter>
          <xqdoc:name>x</xqdoc:name>
          <xqdoc:type occurrence="*">item()</xqdoc:type>
        </xqdoc:parameter>
        <xqdoc:parameter>
          <xqdoc:name>queue</xqdoc:name>
          <xqdoc:type occurrence="*">item()</xqdoc:type>
        </xqdoc:parameter>
      </xqdoc:parameters>
      <xqdoc:return>
        <xqdoc:type>function(*)</xqdoc:type>
      </xqdoc:return>
    </xqdoc:function>
    <xqdoc:function arity="3">
      <xqdoc:comment>
        <xqdoc:description>Matches the given queue and calls the corresponding callback for the empty
or non-empty queue.</xqdoc:description>
        <xqdoc:param>$queue queue to match on</xqdoc:param>
        <xqdoc:param>$empty no-argument callback for the empty queue</xqdoc:param>
        <xqdoc:param>$nonEmpty callback for the non-empty queue that takes the first element
                    and the tai of the queue</xqdoc:param>
      </xqdoc:comment>
      <xqdoc:name>queue:match</xqdoc:name>
      <xqdoc:annotations>
        <xqdoc:annotation name="public"/>
      </xqdoc:annotations>
      <xqdoc:signature>declare %public function queue:match($queue as function(*), $empty as function() as item()*, $nonEmpty as function(item()*, function(*)) as item()*) as item()*</xqdoc:signature>
      <xqdoc:parameters>
        <xqdoc:parameter>
          <xqdoc:name>queue</xqdoc:name>
          <xqdoc:type>function(*)</xqdoc:type>
        </xqdoc:parameter>
        <xqdoc:parameter>
          <xqdoc:name>empty</xqdoc:name>
          <xqdoc:type>function() as item()*</xqdoc:type>
        </xqdoc:parameter>
        <xqdoc:parameter>
          <xqdoc:name>nonEmpty</xqdoc:name>
          <xqdoc:type>function(item()*, function(*)) as item()*</xqdoc:type>
        </xqdoc:parameter>
      </xqdoc:parameters>
      <xqdoc:return>
        <xqdoc:type occurrence="*">item()</xqdoc:type>
      </xqdoc:return>
    </xqdoc:function>
    <xqdoc:function arity="1">
      <xqdoc:comment>
        <xqdoc:description>Returns the tail of the queue.</xqdoc:description>
        <xqdoc:return>tail of the queue</xqdoc:return>
        <xqdoc:custom tag="throws">queue:EMPTYQUE when the queue is empty</xqdoc:custom>
      </xqdoc:comment>
      <xqdoc:name>queue:tail</xqdoc:name>
      <xqdoc:annotations>
        <xqdoc:annotation name="public"/>
      </xqdoc:annotations>
      <xqdoc:signature>declare %public function queue:tail($queue as function(*)) as function(*)</xqdoc:signature>
      <xqdoc:parameters>
        <xqdoc:parameter>
          <xqdoc:name>queue</xqdoc:name>
          <xqdoc:type>function(*)</xqdoc:type>
        </xqdoc:parameter>
      </xqdoc:parameters>
      <xqdoc:return>
        <xqdoc:type>function(*)</xqdoc:type>
      </xqdoc:return>
    </xqdoc:function>
    <xqdoc:function arity="1">
      <xqdoc:comment>
        <xqdoc:description>Returns the head of the queue.</xqdoc:description>
        <xqdoc:return>value at the head of the queue</xqdoc:return>
        <xqdoc:custom tag="throws">queue:EMPTYQUE when the queue is empty</xqdoc:custom>
      </xqdoc:comment>
      <xqdoc:name>queue:peek</xqdoc:name>
      <xqdoc:annotations>
        <xqdoc:annotation name="public"/>
      </xqdoc:annotations>
      <xqdoc:signature>declare %public function queue:peek($queue as function(*)) as item()*</xqdoc:signature>
      <xqdoc:parameters>
        <xqdoc:parameter>
          <xqdoc:name>queue</xqdoc:name>
          <xqdoc:type>function(*)</xqdoc:type>
        </xqdoc:parameter>
      </xqdoc:parameters>
      <xqdoc:return>
        <xqdoc:type occurrence="*">item()</xqdoc:type>
      </xqdoc:return>
    </xqdoc:function>
  </xqdoc:functions>
</xqdoc:xqdoc>


text:
package org.jpos.jposext.jposworkflow.eclipse.figure;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.ToolbarLayout;
import org.eclipse.swt.graphics.Color;

/**
 * @author dgrandemange
 *
 */
public class TransitionInfoFigure extends Figure {
	public static Color classColor = new Color(null, 255, 255, 206);

	private CompartmentFigure transitionDescFigure = new CompartmentFigure();

	public TransitionInfoFigure(Label name) {
		ToolbarLayout layout = new ToolbarLayout();
		setLayoutManager(layout);
		setBorder(new LineBorder(ColorConstants.black, 1));
		setBackgroundColor(classColor);
		setOpaque(true);

		if (null != name) {
			add(name);
			add(transitionDescFigure);
		}
	}

	public CompartmentFigure getTransitionDescFigureCompartment() {
		return transitionDescFigure;
	}

}


text:
def parse_major_version(version_string):
    return int(version_string.split('.')[0].lstrip('v'))


text:
  Cherval est
       un village
       géographiquement positionné dans le département de Dordogne en Aquitaine. On dénombrait 308 habitants en 2008.

Le parc d'habitations, à Cherval, se décomposait en 2011 en cinq appartements et 238 maisons soit
 un marché relativement équilibré.

À coté de Cherval sont localisées les villes de
Nanteuil-Auriac-de-Bourzac située à 6 km, 280 habitants,
La Chapelle-Montabourlet localisée à 6 km, 70 habitants,
Saint-Martial-Viveyrol localisée à 5 km, 225 habitants,
Bouteilles-Saint-Sébastien située à 7 km, 189 habitants,
Coutures localisée à 7 km, 191 habitants,
Bourg-des-Maisons située à 7 km, 69 habitants,
 entre autres. De plus, Cherval est située à seulement 16 km de Ribérac.

La ville propose quelques  équipements sportifs, elle dispose, entre autres, de un terrain de tennis et un terrain de sport.

Si vous envisagez de emmenager à Cherval, vous pourrez facilement trouver une maison à acheter.


text:
package com.alachisoft.tayzgrid.socketserver.command;

import com.alachisoft.tayzgrid.socketserver.command.responsebuilders.SearchEnteriesResponseBuilder;
import com.alachisoft.tayzgrid.socketserver.ICommandExecuter;
import com.alachisoft.tayzgrid.socketserver.ClientManager;
import com.alachisoft.tayzgrid.socketserver.TayzGrid;
import com.alachisoft.tayzgrid.caching.queries.QueryResultSet;
import com.alachisoft.tayzgrid.common.protobuf.KeyValueProtocol;
import com.alachisoft.tayzgrid.common.protobuf.SearchCommandProtocol;
import com.alachisoft.tayzgrid.common.protobuf.ValueWithTypeProtocol;
import com.alachisoft.tayzgrid.common.util.JavaClrTypeMapping;
import com.alachisoft.tayzgrid.caching.OperationContextFieldName;
import com.alachisoft.tayzgrid.common.configuration.ConfigurationBuilder;
import com.alachisoft.tayzgrid.common.util.ResponseHelper;
import com.alachisoft.tayzgrid.runtime.util.HelperFxn;
public class SearchEnteriesCommand extends CommandBase {
	private final static class CommandInfo {
		public String RequestId;
		public String Query;
		public java.util.Map Values;
		public int CommandVersion;
		public long ClientLastViewId;

		public CommandInfo clone() {
			CommandInfo varCopy = new CommandInfo();

			varCopy.RequestId = this.RequestId;
			varCopy.Query = this.Query;
			varCopy.Values = this.Values;
			varCopy.CommandVersion = this.CommandVersion;
			varCopy.ClientLastViewId = this.ClientLastViewId;

			return varCopy;
		}
	}

	private static char Delimitor = '|';
	//PROTOBUF
	@Override
	public void ExecuteCommand(ClientManager clientManager, com.alachisoft.tayzgrid.common.protobuf.CommandProtocol.Command command) {
		CommandInfo cmdInfo = new CommandInfo();

		try {
			cmdInfo = ParseCommand(command, clientManager).clone();
		} catch (RuntimeException exc) {
			if (!super.immatureId.equals("-2")) {
				//PROTOBUF:RESPONSE
				_serializedResponsePackets.add(ResponseHelper.SerializeExceptionResponse(exc, command.getRequestID()));
			}
			return;
		}

		byte[] data = null;

		try {
			ICommandExecuter tempVar = clientManager.getCmdExecuter();
			TayzGrid nCache = (TayzGrid)((tempVar instanceof TayzGrid) ? tempVar : null);
			QueryResultSet resultSet = null;
			com.alachisoft.tayzgrid.caching.OperationContext operationContext = new com.alachisoft.tayzgrid.caching.OperationContext(com.alachisoft.tayzgrid.caching.OperationContextFieldName.OperationType, com.alachisoft.tayzgrid.caching.OperationContextOperationType.CacheOperation);
			if (cmdInfo.CommandVersion <= 1) { //NCache 3.8 SP4 and previous
				operationContext.Add(OperationContextFieldName.ClientLastViewId, forcedViewId);
			}
			else {
				operationContext.Add(OperationContextFieldName.ClientLastViewId, cmdInfo.ClientLastViewId);
			}
			resultSet = nCache.getCache().SearchEntries(cmdInfo.Query, cmdInfo.Values, operationContext);

			SearchEnteriesResponseBuilder.BuildResponse(resultSet, cmdInfo.CommandVersion, cmdInfo.RequestId, _serializedResponsePackets, nCache.getCacheId());

		} catch (Exception exc) {
			//PROTOBUF:RESPONSE
			_serializedResponsePackets.add(ResponseHelper.SerializeExceptionResponse(exc, command.getRequestID()));
		}
	}

	//PROTOBUF : SearchCommand is used for enteries
	private CommandInfo ParseCommand(com.alachisoft.tayzgrid.common.protobuf.CommandProtocol.Command command, ClientManager clientManager) {
		CommandInfo cmdInfo = new CommandInfo();

		SearchCommandProtocol.SearchCommand searchCommand = command.getSearchCommand();
		cmdInfo.Query = searchCommand.getQuery();
		if (clientManager.IsDotNetClient) {
			int index = cmdInfo.Query.indexOf("$Text$");
			if (index != -1) {
				cmdInfo.Query = cmdInfo.Query.replace("$Text$", "System.String");
			} else {
				index = cmdInfo.Query.indexOf("$TEXT$");
				if (index != -1) {
					cmdInfo.Query = cmdInfo.Query.replace("$TEXT$", "System.String");
				} else {
					index = cmdInfo.Query.indexOf("$text$");
					if (index != -1) {
						cmdInfo.Query = cmdInfo.Query.replace("$text$", "System.String");
					}
				}
			}
		} else {
			int index = cmdInfo.Query.indexOf("$Text$");
			if (index != -1) {
				cmdInfo.Query = cmdInfo.Query.replace("$Text$", "java.lang.String");
			} else {
				index = cmdInfo.Query.indexOf("$TEXT$");
				if (index != -1) {
					cmdInfo.Query = cmdInfo.Query.replace("$TEXT$", "java.lang.String");
				} else {
					index = cmdInfo.Query.indexOf("$text$");
					if (index != -1) {
						cmdInfo.Query = cmdInfo.Query.replace("$text$", "java.lang.String");
					}
				}
			}
		}
		cmdInfo.RequestId = (new Long(command.getRequestID())).toString();
		cmdInfo.CommandVersion = command.getCommandVersion();
		cmdInfo.ClientLastViewId = command.getClientLastViewId();

		if (searchCommand.getSearchEntries() == true) {
			cmdInfo.Values = new java.util.HashMap();
			for (KeyValueProtocol.KeyValue searchValue : searchCommand.getValuesList()) {
				String key = searchValue.getKey();
				java.lang.Class type = null;
				Object value = null;

				for (ValueWithTypeProtocol.ValueWithType valueWithType : searchValue.getValueList()) {
					String typeStr = valueWithType.getType();
					if (clientManager.IsDotNetClient) {
						typeStr = JavaClrTypeMapping.ClrToJava(valueWithType.getType());
					}
                                       try
                                    {
                                        type = java.lang.Class.forName(typeStr);

                                        if (valueWithType.getValue() != null)
                                        {

                                            if (type == java.util.Date.class)
                                            {
                                                /**
                                                 * For client we would be sending ticks instead of string representation of Date.
                                                 */
                                                value =HelperFxn.getDateFromTicks(Long.parseLong(valueWithType.getValue()));
                                            }
                                            else
                                            {
                                                value=new ConfigurationBuilder().ConvertToPrimitive(type, valueWithType.getValue(), "");
                                            }

                                        }
                                    }
                                    catch (Exception e)
                                    {
                                        throw new java.lang.IllegalArgumentException("Cannot convert '" + valueWithType.getValue() + "' to " + type.toString());
                                    }

					if (!cmdInfo.Values.containsKey(key)) {
						cmdInfo.Values.put(key, value);
					} else {
						java.util.ArrayList list = (java.util.ArrayList)((cmdInfo.Values.get(key) instanceof java.util.ArrayList) ? cmdInfo.Values.get(key) : null); // the value is not array list
						if (list == null) {
							list = new java.util.ArrayList();
							list.add(cmdInfo.Values.get(key)); // add the already present value in the list
							cmdInfo.Values.remove(key); // remove the key from hashtable to avoid key already exists exception
							list.add(value); // add the new value in the list
							cmdInfo.Values.put(key, list);
						} else {
							list.add(value);
						}
					}
				}
			}
		}

		return cmdInfo;
	}

	private Object GetValueObject(String value, boolean dotNetClient) throws Exception{
		Object retVal = null;

		try {
			String[] vals = value.split(java.util.regex.Pattern.quote((new Character(Delimitor)).toString()), -1);
			Object valObj = (Object)vals[0];
			String typeStr = vals[1];

			if (!dotNetClient) {
				String type = JavaClrTypeMapping.JavaToClr(typeStr);
				if (type != null) {
					typeStr = type;
				}
			}

			java.lang.Class objType = java.lang.Class.forName(typeStr);
                        retVal=objType.cast(valObj);
		} catch (Exception ex) {
			throw ex;
		}
		return retVal;
	}
}


text:
namespace device {
class BluetoothAdapter;
}

namespace extensions {

// The profile-keyed service that manages the bluetoothPrivate extension API.
class BluetoothPrivateAPI : public BrowserContextKeyedAPI,
                            public EventRouter::Observer {
 public:
  static BrowserContextKeyedAPIFactory<BluetoothPrivateAPI>*
      GetFactoryInstance();

  explicit BluetoothPrivateAPI(content::BrowserContext* context);
  ~BluetoothPrivateAPI() override;

  // KeyedService implementation.
  void Shutdown() override;

  // EventRouter::Observer implementation.
  void OnListenerAdded(const EventListenerInfo& details) override;
  void OnListenerRemoved(const EventListenerInfo& details) override;

  // BrowserContextKeyedAPI implementation.
  static const char* service_name() { return "BluetoothPrivateAPI"; }
  static const bool kServiceRedirectedInIncognito = true;
  static const bool kServiceIsNULLWhileTesting = true;

 private:
  friend class BrowserContextKeyedAPIFactory<BluetoothPrivateAPI>;

  content::BrowserContext* browser_context_;
};

namespace api {

namespace bluetooth_private {
namespace SetAdapterState {
struct Params;
}  // namespace SetAdapterState
namespace SetPairingResponse {
struct Params;
}  // namespace SetPairingResponse
namespace DisconnectAll {
struct Params;
}  // namespace DisconnectAll
namespace ForgetDevice {
struct Params;
}  // namespace ForgetDevice
namespace SetDiscoveryFilter {
struct Params;
}  // namespace SetDiscoveryFilter
namespace Connect {
struct Params;
}  // namespace Connect
namespace Pair {
struct Params;
}  // namespace Pair
namespace RecordPairing {
struct Params;
}  // namespace RecordPairing
namespace RecordReconnection {
struct Params;
}  // namespace RecordReconnection
namespace RecordDeviceSelection {
struct Params;
}  // namespace RecordDeviceSelection
}  // namespace bluetooth_private

class BluetoothPrivateSetAdapterStateFunction
    : public BluetoothExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.setAdapterState",
                             BLUETOOTHPRIVATE_SETADAPTERSTATE)
  BluetoothPrivateSetAdapterStateFunction();

 private:
  ~BluetoothPrivateSetAdapterStateFunction() override;

  base::Closure CreatePropertySetCallback(const std::string& property_name);
  base::Closure CreatePropertyErrorCallback(const std::string& property_name);
  void OnAdapterPropertySet(const std::string& property);
  void OnAdapterPropertyError(const std::string& property);
  void SendError();

  // BluetoothExtensionFunction overrides:
  bool CreateParams() override;
  void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;

  // Set of expected adapter properties to be changed.
  std::set<std::string> pending_properties_;

  // Set of adapter properties that were not set successfully.
  std::set<std::string> failed_properties_;

  // Whether or not the function has finished parsing the arguments and queuing
  // up state requests.
  bool parsed_ = false;

  std::unique_ptr<bluetooth_private::SetAdapterState::Params> params_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateSetAdapterStateFunction);
};

class BluetoothPrivateSetPairingResponseFunction
    : public BluetoothExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.setPairingResponse",
                             BLUETOOTHPRIVATE_SETPAIRINGRESPONSE)
  BluetoothPrivateSetPairingResponseFunction();
  // BluetoothExtensionFunction overrides:
  bool CreateParams() override;
  void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;

 private:
  ~BluetoothPrivateSetPairingResponseFunction() override;

  std::unique_ptr<bluetooth_private::SetPairingResponse::Params> params_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateSetPairingResponseFunction);
};

class BluetoothPrivateDisconnectAllFunction
    : public BluetoothExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.disconnectAll",
                             BLUETOOTHPRIVATE_DISCONNECTALL)
  BluetoothPrivateDisconnectAllFunction();

  // BluetoothExtensionFunction overrides:
  bool CreateParams() override;
  void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;

 private:
  ~BluetoothPrivateDisconnectAllFunction() override;

  void OnSuccessCallback();
  void OnErrorCallback(scoped_refptr<device::BluetoothAdapter> adapter,
                       const std::string& device_address);

  std::unique_ptr<bluetooth_private::DisconnectAll::Params> params_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateDisconnectAllFunction);
};

class BluetoothPrivateForgetDeviceFunction : public BluetoothExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.forgetDevice",
                             BLUETOOTHPRIVATE_FORGETDEVICE)
  BluetoothPrivateForgetDeviceFunction();

  // BluetoothExtensionFunction overrides:
  bool CreateParams() override;
  void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;

 private:
  ~BluetoothPrivateForgetDeviceFunction() override;

  void OnSuccessCallback();
  void OnErrorCallback(scoped_refptr<device::BluetoothAdapter> adapter,
                       const std::string& device_address);

  std::unique_ptr<bluetooth_private::ForgetDevice::Params> params_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateForgetDeviceFunction);
};

class BluetoothPrivateSetDiscoveryFilterFunction
    : public BluetoothExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.setDiscoveryFilter",
                             BLUETOOTHPRIVATE_SETDISCOVERYFILTER)
  BluetoothPrivateSetDiscoveryFilterFunction();

 protected:
  ~BluetoothPrivateSetDiscoveryFilterFunction() override;

  // BluetoothExtensionFunction:
  bool CreateParams() override;
  void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;

 private:
  void OnSuccessCallback();
  void OnErrorCallback();

  std::unique_ptr<bluetooth_private::SetDiscoveryFilter::Params> params_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateSetDiscoveryFilterFunction);
};

class BluetoothPrivateConnectFunction : public BluetoothExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.connect",
                             BLUETOOTHPRIVATE_CONNECT)
  BluetoothPrivateConnectFunction();

  // BluetoothExtensionFunction:
  bool CreateParams() override;
  void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;

 private:
  ~BluetoothPrivateConnectFunction() override;

  void OnSuccessCallback();
  void OnErrorCallback(device::BluetoothDevice::ConnectErrorCode error);

  std::unique_ptr<bluetooth_private::Connect::Params> params_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateConnectFunction);
};

class BluetoothPrivatePairFunction : public BluetoothExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.pair", BLUETOOTHPRIVATE_PAIR)
  BluetoothPrivatePairFunction();

  // BluetoothExtensionFunction:
  bool CreateParams() override;
  void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;

 private:
  ~BluetoothPrivatePairFunction() override;

  void OnSuccessCallback();
  void OnErrorCallback(device::BluetoothDevice::ConnectErrorCode error);

  std::unique_ptr<bluetooth_private::Pair::Params> params_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothPrivatePairFunction);
};

class BluetoothPrivateRecordPairingFunction
    : public BluetoothExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.recordPairing",
                             BLUETOOTHPRIVATE_RECORDPAIRING)

  BluetoothPrivateRecordPairingFunction();

 protected:
  ~BluetoothPrivateRecordPairingFunction() override;

  // BluetoothExtensionFunction:
  bool CreateParams() override;
  void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;

 private:
  std::unique_ptr<bluetooth_private::RecordPairing::Params> params_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateRecordPairingFunction);
};

class BluetoothPrivateRecordReconnectionFunction
    : public BluetoothExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.recordReconnection",
                             BLUETOOTHPRIVATE_RECORDRECONNECTION)

  BluetoothPrivateRecordReconnectionFunction();

 protected:
  ~BluetoothPrivateRecordReconnectionFunction() override;

  // BluetoothExtensionFunction:
  bool CreateParams() override;
  void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;

 private:
  std::unique_ptr<bluetooth_private::RecordReconnection::Params> params_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateRecordReconnectionFunction);
};

class BluetoothPrivateRecordDeviceSelectionFunction
    : public BluetoothExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.recordDeviceSelection",
                             BLUETOOTHPRIVATE_RECORDDEVICESELECTION)

  BluetoothPrivateRecordDeviceSelectionFunction();

 protected:
  ~BluetoothPrivateRecordDeviceSelectionFunction() override;

  // BluetoothExtensionFunction:
  bool CreateParams() override;
  void DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;

 private:
  std::unique_ptr<bluetooth_private::RecordDeviceSelection::Params> params_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateRecordDeviceSelectionFunction);
};

}  // namespace api

}  // namespace extensions

#endif  // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_


text:
package ${package}.web.pages;

import graphene.model.idl.G_SymbolConstants;
import graphene.model.idl.G_VisualType;
import graphene.web.annotations.PluginPage;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.annotations.Symbol;

@PluginPage(visualType = G_VisualType.HELP, menuName = "Advanced Help", icon = "fa fa-lg fa-fw fa-question")
public class Help {
	@Property
	@Inject
	@Symbol(G_SymbolConstants.APPLICATION_NAME)
	private String appName;

	@Property
	@Inject
	@Symbol(G_SymbolConstants.APPLICATION_VERSION)
	private String appVersion;
}


text:
import asyncio
from reader import market_data
from periodic import Periodic

@asyncio.coroutine
async def main():
    """Main Of the Agent"""
    p = Periodic(lambda: market_data(), 1)
    try:
        print('Updating Market Data')
        await p.start()
        await asyncio.sleep(3.1)
        #await p._run()

    finally:
        print('Finally')
       # await p.stop()  # we should stop task finally

if __name__ == '__main__':
    loop = asyncio.get_event_loop()

try:

    loop.run_until_complete(main())
    loop.run_forever()

finally:

    print('closing event loop')
    loop.close()


text:
"use strict";
var Utils = require("../../curious/Utils");
var Level_001_Intro = (function () {
    function Level_001_Intro(game) {
        this.game = game;
        this.imgFolder = "/assets/level_001/img/";
        this.JACK = "jack_small.jpg";
        this.SPECKY = "specky_1920_low_2.jpg";
        this.MASKINER = "gangmaskiner_1920_badge_small.jpg";
        this.PC_intro = 1.0;
        this.PC_blesses = 0.0;
        this.PC_accident = 2.0;
        this.PC_encore = 3.0;
        this.PC_pourri = 4.0;
        this.PC_qaz = 5.0;
        this.PC_gameover = 99.0;
    }
    Object.defineProperty(Level_001_Intro.prototype, "pc", {
        get: function () {
            return this.game.getVar("pc", 0);
        },
        set: function (val) {
            this.game.setVar("pc", val);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Level_001_Intro.prototype, "attrib", {
        get: function () {
            return this.game.getVar("attrib", 0);
        },
        set: function (val) {
            this.game.setVar("attrib", val);
        },
        enumerable: true,
        configurable: true
    });
    Level_001_Intro.prototype.load = function () {
        var _this = this;
        var game = this.game;
        game.runner.preload([this.imgFolder + this.JACK, this.imgFolder + this.SPECKY, this.imgFolder + this.MASKINER]);
        this.Accident(game);
        this.Duchesse(game);
        game.addAnim(game.newAnim(this).when(function () {
            return _this.pc == _this.PC_intro;
        }).done(function () {
            _this.pc = _this.PC_blesses;
        }).show("Matante", this.SPECKY, {
            when: function () {
                return true;
            },
            done: function () {
                _this.attrib = 42;
            }
        }).head("Jack", this.JACK).line("une **chance** que j'ai ${attrib} rex", { when: function () {
            return true;
        } }).head("Jaques", this.JACK).line("ce n'est pas facile depuis que selly n'est plus là").show("Mononcle", this.MASKINER).head("Jaques", this.JACK).line("nope").description("Jack a parlé").value());
        var LaFemmeEstSeule = function () {
            game.runner.popMessage("et je ne sais pas pourquoi...");
            _this.pc = _this.PC_encore;
        };
        game.addQuestion(game.newQuestion(this).when(function () {
            return _this.pc == _this.PC_blesses;
        }).show("fraktarna", "gaussfraktarna_1920_badge_small.jpg").head("Jack", this.JACK).ask("Est-ce que je devrais voir s'il y a d'autres blessés?").choice("Non, la femme a besoin d'aide immédiatement!", function () {
            _this.pc = _this.PC_qaz;
        }, function () {
            return true;
        }).choice("Non, elle semble seule", LaFemmeEstSeule).choice("Non, j'appelle le 9-1-1", this.Call911).timeout(Utils.Delay_Normal, 0).value());
        game.addQuestion(game.newQuestion(this).when(function () {
            return _this.pc == _this.PC_encore;
        }).show("maskiner", "gangmaskiner_1920_badge_small.jpg").head("jack", this.JACK).ask("Une autre question?").choice("Non, la femme a besoin d'aide immédiatement!", function () {
            _this.pc = _this.PC_pourri;
        }).choice("Non, elle semble seule", LaFemmeEstSeule).value());
        game.addAnim(game.newAnim(this).when(function () {
            return _this.pc == _this.PC_pourri;
        }).done(function () {
            _this.pc = _this.PC_gameover;
        }).show("La badge", "spanviken_1920_badge_small.jpg").head("Jack", this.JACK).line("assez pourri...").description("c'est la fin de mon histoire").description("désolé de la perte de temps...", DescOpts.Center).value());
    };
    Level_001_Intro.prototype.Call911 = function () {
        this.pc = this.PC_gameover;
    };
    Level_001_Intro.prototype.Accident = function (game) {
        var _this = this;
        game.addAnim(game.newAnim(this).when(function () {
            return _this.pc == _this.PC_accident;
        }).done(function () {
            _this.pc = _this.PC_encore;
        }).show("C'est piquant", this.SPECKY).description("TUUUUUUUUUUUUUU uuuuu .. uuuuuu UUUUUUUUU", DescOpts.AnnoyingCenter).description("Une femme, du même âge que Jack environ, est coincée dans la voiture.").description("TUUuuUUUuuuuuUUUUUU UUUUUUUUUUUUU", DescOpts.AnnoyingCenter).head("Jack", this.JACK).line("...").line("..a.. ....té.. ... arr...").description("TUUuuuuuUUUUUUUUuu uuuuuu", DescOpts.AnnoyingCenter).value());
    };
    Level_001_Intro.prototype.Qaz = function (game) {
        var _this = this;
        game.addAnim(game.newAnim(this).when(function () {
            return _this.pc == _this.PC_qaz;
        }).done(function () {
            _this.pc = _this.PC_encore;
        }).show("C'est piquant", this.SPECKY).head("Jack", this.JACK).line("...").line("..a.. ....té.. ... arr...").description("TUUuuuuuUUUUUUUUuu uuuuuu", DescOpts.AnnoyingCenter).value());
    };
    Level_001_Intro.prototype.Duchesse = function (game) {
        var _this = this;
        game.addQuestion(game.newQuestion(this).when(function () {
            return _this.pc == _this.PC_qaz;
        }).show("fraktarna", "gaussfraktarna_1920_badge_small.jpg").head("Jack", this.JACK).ask("Comment sont les chemises de la duchesse?").choice("Archi froissées", function () {
            _this.pc = _this.PC_intro;
        }, function () {
            return true;
        }).choice("Blanches", this.Call911).timeout(Utils.Delay_Normal, 0).value());
    };
    return Level_001_Intro;
})();
module.exports = Level_001_Intro;


text:
def test_gitlab_user_exists(User):
    user = User('gitlab-runner')
    assert user.exists


text:
<dialog title="Flash to SVG Help" buttons="cancel">
  <grid>
    <columns>
      <column flex="1"/>
      <column flex="2"/>
    </columns>
    <rows>
      <row>
        <label value="Decimal Places"/>
      </row>
      <row>
        <label value=""/>
        <label value="Controls how accurately numbers are stored in the resulting output. A smaller number reduces output size and accuracy."/>
      </row>

      <row>
        <label value="Expand Symbols"/>
      </row>
      <row>
        <label value=""/>
        <label value="Controls which symbols will be expanded in the output. 'None' results in the smallest output size, 'All' results in the largest file but has potential performance benefits."/>
      </row>
      <row>
        <label value=""/>
        <label value="'Once Used' will only expand symbols which are only used once and is the recommended setting."/>
      </row>

      <row>
        <label value="Convert Patterns to Symbols"/>
      </row>
      <row>
        <label value=""/>
        <label value="Whether repeating bitmaps should be exported as reused symbols."/>
      </row>

      <row>
        <label value="Flatten motion tweens"/>
      </row>
      <row>
        <label value=""/>
        <label value="Should every frame be exported in tweens or just keyframes. Sometimes this can help the animations match those in flash more accurately."/>
      </row>

      <row>
        <label value="Fixed FPS"/>
      </row>
      <row>
        <label value=""/>
        <label value="When checked any easing between frames is turned off, resulting in an animation matching the FPS listed in flash."/>
      </row>

      <row>
        <label value="Loop full timeline tweens"/>
      </row>
      <row>
        <label value=""/>
        <label value="Will attempt to seemlessly animate the end of a tween back into it's beginning. Only applies when Fixed FPS is not being used."/>
      </row>

      <row>
        <label value="Remove Groups"/>
      </row>
      <row>
        <label value=""/>
        <label value="Removes unrequired groups from the SVG hierarchy, reducing output file size."/>
      </row>

      <row>
        <label value="Compact Output"/>
      </row>
      <row>
        <label value=""/>
        <label value="Removes whitespace from the output file, resulting in a smaller but less readable SVG file."/>
      </row>

      <row>
        <label value="Use Animated viewbox"/>
      </row>
      <row>
        <label value=""/>
        <label value="This option allows for a rectangle to be animated as part of the timeline which will then be considered the viewport into the scene. The clip should have the instance name 'viewbox'"/>
      </row>

      <row>
        <label value="Show Final Frame"/>
      </row>
      <row>
        <label value=""/>
        <label value="When animation is not running, you can optionally show the final frame. This will also be the state shown in browsers that don't support SMIL."/>
      </row>

    </rows>
  </grid>
</dialog>


text:
using hase.DevLib.Framework.Client;
using hase.DevLib.Framework.Contract;
using hase.DevLib.Framework.Repository.Contract;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace hase.DevLib.Framework.Repository.Client.Extensions
{
	public static class Extensions
	{
		public static InputFormDef GenerateFormDefinitionFromRequestType<TRequest, TResponse>(this ServiceClientBase<TRequest, TResponse> client)
		where TRequest : AppRequestMessage
		where TResponse : AppResponseMessage
		{
			var form = new InputFormDef();
			form.Name = client.Name;
			form.RequestClrType = client.RequestClrType;
			form.ResponseClrType = client.ResponseClrType;
			form.ServiceClrType = client.ServiceClrType;
			form.InputFields = new List<InputFieldDef>();

			var reqType = typeof(TRequest);
			form.RequestClrType = reqType.AssemblyQualifiedName;

			// add form def fields from request properties
			foreach (var prop in typeof(TRequest).GetProperties())
			{
				switch (prop.Name)
				{
					// todo: 06/16/18 gph. Un-hardcode type.
					case "Headers":
					case "RequestClrType":
					case "ServiceClrType":
					case "Fields":
						continue;
				}
				var propType = prop.PropertyType;

				var field = new InputFieldDef();
				field.Name = prop.Name;
				field.ClrType = propType.AssemblyQualifiedName;

				if (propType.IsEnum)
					field.Choices = Enum.GetNames(propType);

				form.InputFields.Add(field);
			}

			return form;
		}
		public static async Task PublishFormDefinition<TRequest, TResponse>(this ServiceClientBase<TRequest, TResponse> client, string baseUri)
		where TRequest : AppRequestMessage
		where TResponse : AppResponseMessage
		{
			if (!baseUri.EndsWith(@"/"))
				baseUri += @"/";
			var requestUri = baseUri + $"api/formdefs/{client.Name}";

			var formDef = client.GenerateFormDefinitionFromRequestType();
			var json = JsonConvert.SerializeObject(formDef);
			var content = new StringContent(json, Encoding.UTF8, "application/json");

			HttpClient http = new HttpClient();
			var response = await http.PutAsync(requestUri, content);

			var getDef = await http.GetAsync(requestUri);
			var getTxt = await getDef.Content.ReadAsStringAsync();
		}
	}
}