text:
/* eslint-disable spellcheck/spell-checker */
/* @flow strict-local */
import base64 from 'base-64';
import {
  getFullUrl,
  getResource,
  isUrlOnRealm,
  parseProtocol,
  fixRealmUrl,
  autocompleteRealmPieces,
  autocompleteRealm,
} from '../url';
import type { Auth } from '../../types';
import type { AutocompletionDefaults } from '../url';

describe('getFullUrl', () => {
  test('when uri contains domain, do not change', () => {
    const url = getFullUrl('https://example.com/img.gif', '');
    expect(url).toEqual('https://example.com/img.gif');
  });

  test('when uri does not contain domain, append realm', () => {
    const url = getFullUrl('/img.gif', 'https://example.com');
    expect(url).toEqual('https://example.com/img.gif');
  });

  test('recognize relative uris', () => {
    const url = getFullUrl('#something', 'https://example.com');
    expect(url).toEqual('https://example.com/#something');
  });
});

describe('getResource', () => {
  test('when uri contains domain, do not change, add auth headers', () => {
    const auth: Auth = {
      realm: '',
      apiKey: 'someApiKey',
      email: 'johndoe@example.com',
    };
    const authEncoded = base64.encode(`${auth.email}:${auth.apiKey}`);

    const expectedResult = {
      uri: 'https://example.com/img.gif',
      headers: {
        Authorization: `Basic ${authEncoded}`,
      },
    };
    const resource = getResource('https://example.com/img.gif', auth);
    expect(resource).toEqual(expectedResult);
  });

  const exampleAuth: Auth = {
    realm: 'https://example.com',
    email: 'nobody@example.org',
    apiKey: 'someApiKey',
  };

  test('when uri does not contain domain, append realm, add auth headers', () => {
    const authEncoded = base64.encode(`${exampleAuth.email}:${exampleAuth.apiKey}`);

    const expectedResult = {
      uri: 'https://example.com/img.gif',
      headers: {
        Authorization: `Basic ${authEncoded}`,
      },
    };
    const resource = getResource('/img.gif', exampleAuth);
    expect(resource).toEqual(expectedResult);
  });

  test('when uri is on different domain than realm, do not include auth headers', () => {
    const expectedResult = {
      uri: 'https://another.com/img.gif',
    };
    const resource = getResource('https://another.com/img.gif', exampleAuth);
    expect(resource).toEqual(expectedResult);
  });
});

describe('isUrlOnRealm', () => {
  test('when link is on realm, return true', () => {
    expect(isUrlOnRealm('/#narrow/stream/jest', 'https://example.com')).toBe(true);

    expect(isUrlOnRealm('https://example.com/#narrow/stream/jest', 'https://example.com')).toBe(
      true,
    );

    expect(isUrlOnRealm('#narrow/#near/1', 'https://example.com')).toBe(true);
  });

  test('when link is on not realm, return false', () => {
    expect(isUrlOnRealm('https://demo.example.com', 'https://example.com')).toBe(false);

    expect(isUrlOnRealm('www.google.com', 'https://example.com')).toBe(false);
  });
});

describe('parseProtocol', () => {
  test('rejects strings that have no http/https protocol', () => {
    expect(parseProtocol('')).toEqual([null, '']);
    expect(parseProtocol('chat.zulip.com')).toEqual([null, 'chat.zulip.com']);
    expect(parseProtocol('ftp://chat.zulip.com')).toEqual([null, 'ftp://chat.zulip.com']);
    expect(parseProtocol('localhost:9991')).toEqual([null, 'localhost:9991']);
  });

  test('accepts strings that include the http/https protocol', () => {
    expect(parseProtocol('http://chat.zulip.com')).toEqual(['http://', 'chat.zulip.com']);
    expect(parseProtocol('https://chat.zulip.com')).toEqual(['https://', 'chat.zulip.com']);
    expect(parseProtocol('http://localhost:9991')).toEqual(['http://', 'localhost:9991']);
  });

  test('rejects strings that include a bogus http/https protocol indicator', () => {
    expect(parseProtocol('chat.zulip.com/http://')).toEqual([null, 'chat.zulip.com/http://']);
    expect(parseProtocol('example.net/https://')).toEqual([null, 'example.net/https://']);
  });

  test('accepts strings that include spaces before the protocol', () => {
    expect(parseProtocol('   https://chat.zulip.com')).toEqual(['https://', 'chat.zulip.com']);
    expect(parseProtocol('\t http://example.net')).toEqual(['http://', 'example.net']);
    // non-breaking space
    expect(parseProtocol('\xA0http://example.org')).toEqual(['http://', 'example.org']);
  });
});

describe('fixRealmUrl', () => {
  test('undefined input results in empty string', () => {
    expect(fixRealmUrl()).toEqual('');
  });

  test('empty url input results in empty string', () => {
    expect(fixRealmUrl('')).toEqual('');
  });

  test('when a realm url is missing a protocol, prepend https', () => {
    expect(fixRealmUrl('example.com')).toEqual('https://example.com');
  });

  test('when a realm url has a trailing "/" remove it', () => {
    expect(fixRealmUrl('https://example.com/')).toEqual('https://example.com');
  });

  test('when a realm url has two trailing "/" remove them', () => {
    expect(fixRealmUrl('https://example.com//')).toEqual('https://example.com');
  });

  test('when input url is correct, do not change it', () => {
    expect(fixRealmUrl('https://example.com')).toEqual('https://example.com');
  });

  test('remove white-space around input', () => {
    expect(fixRealmUrl(' https://example.com/  ')).toEqual('https://example.com');
  });

  test('remove white-space inside input', () => {
    const result = fixRealmUrl('https://subdomain   .example.  com/  ');
    expect(result).toEqual('https://subdomain.example.com');
  });
});

describe('autocompleteRealmPieces', () => {
  const exampleData: AutocompletionDefaults = {
    protocol: 'http://',
    domain: 'example.com',
  };

  test('the empty string yields reasonable values', () => {
    const [head, , tail] = autocompleteRealmPieces('', exampleData);
    expect(head).toEqual('http://');
    expect(tail).toEqual('.example.com');
  });

  /* Test that input value is unchanged.

     Future versions of `autocompleteRealmPieces` may alter certain inputs --
     for example, by trimming spaces, standardizing to lowercase, or escaping
     via punycode -- but the particular values tested here should all remain
     unaltered.
  */
  const doSimpleCompletion = (input: string, data?: AutocompletionDefaults) => {
    const [head, output, tail] = autocompleteRealmPieces(input, data ?? exampleData);
    expect(input).toEqual(output);
    return [head, tail];
  };

  test('a plain word is fully autocompleted', () => {
    const [head, tail] = doSimpleCompletion('host-name');
    expect(head).toEqual('http://');
    expect(tail).toEqual('.example.com');
  });

  test('an explicit `http` is recognized', () => {
    const [head, tail] = doSimpleCompletion('http://host-name');
    expect(head).toBeFalsy();
    expect(tail).toEqual('.example.com');
  });

  test('an explicit `https` is recognized', () => {
    const [head, tail] = doSimpleCompletion('https://host-name');
    expect(head).toBeFalsy();
    expect(tail).toEqual('.example.com');
  });

  test('an explicit IPv4 is recognized', () => {
    const [head, tail] = doSimpleCompletion('23.6.64.128');
    expect(head).toBeTruthy();
    expect(tail).toBeFalsy();
  });

  test('an explicit IPv6 is recognized', () => {
    const [head, tail] = doSimpleCompletion('[2a02:26f0:12f:293:0:0:0:255e]');
    expect(head).toBeTruthy();
    expect(tail).toBeFalsy();
  });

  test('localhost with an explicit port is recognized', () => {
    const [head, tail] = doSimpleCompletion('localhost:9991');
    expect(head).toBeTruthy();
    expect(tail).toBeFalsy();
  });

  test('full host name is recognized', () => {
    const [head, tail] = doSimpleCompletion('my-server.example.com');
    expect(head).toBeTruthy();
    expect(tail).toBeFalsy();
  });

  test('full host and protocol are recognized', () => {
    const [head, tail] = doSimpleCompletion('http://my-server.com');
    expect(head).toBeFalsy();
    expect(tail).toBeFalsy();
  });

  test('fully explicit localhost is recognized', () => {
    const [head, tail] = doSimpleCompletion('http://localhost:9991');
    expect(head).toBeFalsy();
    expect(tail).toBeFalsy();
  });
});

describe('autocompleteRealm', () => {
  const zulipData: AutocompletionDefaults = {
    protocol: 'https://',
    domain: 'zulipchat.com',
  };

  test('when no value is entered return empty string', () => {
    const result = autocompleteRealm('', zulipData);
    expect(result).toEqual('');
  });

  test('when a protocol is provided, use it', () => {
    const result = autocompleteRealm('http://example', zulipData);
    expect(result).toEqual('http://example.zulipchat.com');
  });

  test('do not use any other protocol than http and https', () => {
    const result = autocompleteRealm('ftp://example', zulipData);
    expect(result).toStartWith('https://ftp://');
  });

  test('if the hostname contains a dot, consider it complete', () => {
    const result = autocompleteRealm('mydomain.org', zulipData);
    expect(result).toEqual('https://mydomain.org');
  });

  test('if the hostname contains multiple dots, consider it complete', () => {
    const result = autocompleteRealm('subdomain.mydomain.org', zulipData);
    expect(result).toEqual('https://subdomain.mydomain.org');
  });

  test('if the hostname contains a colon, consider it complete', () => {
    const result = autocompleteRealm('localhost:9991', zulipData);
    expect(result).toEqual('https://localhost:9991');
  });
});


text:
/************************************************************************/
/* Basic Includes                                                       */
/************************************************************************/
#pragma once

#include <vector>
#include <queue>
#include <list>

#include	<iostream>
#include	<cstdlib>
#include	<cstring>
#include	<vector>
#include	<algorithm>

//#include <opencv2/core/core.hpp>
//#include <opencv2/highgui/highgui.hpp>
#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "haanju_utils.hpp"

#include "kcftracker.hpp"

/************************************************************************/
/*  Necessary includes for this Algorithm                               */
/************************************************************************/

#include "params.h"
using namespace cv;

/////////////////////////////////////////////////////////////////////////
// POSE CLASSIFICATION RESULT (OF ENTIRE TARGETS)
/////////////////////////////////////////////////////////////////////////

class CThrowDetector
{

public:
	// ID.
	unsigned int trackId;

	// State
	bool bCarrying;

	// KCF
	float m_fDist_mean[18];
	float m_fDist_std[18];

	// Share
	float m_fDist_mean_obs[18];
	float m_fDist_std_obs[18];

	// MASK
	float m_fDist_mean_mask[18];
	float m_fDist_std_mask[18];

	Point2d m_ROI_LT;
	Point2d m_ROI_RB;

	bool m_bROI = false;
	bool m_bRHand = true;

	Mat m_curFrame;
	Mat m_fore_up, m_heatmap_up;

	// ID for multiple object
//	int m_ID_index;

	// Input Keypoints..
	float _patch_w;
	float _patch_h;
	float _LH_x, _LH_y, _LH_c;
	float _min_fore_area;
	float _arr_joint_x[18];
	float _arr_joint_y[18];
	float _arr_joint_c[18];

	// KCF Tracker.
	KCFTracker tracker;
	Rect KCF_result;
	bool m_bTrackInit;

	// Decision
	bool m_bROI_warning;
	bool m_bThw_warning;
	bool m_bThw_warning2;
	bool m_bFirstStart;

	int imageWidth;
	int imageHeight;

	bool m_bKCFRectInit;
	Rect _KCF_rect_init;
	int m_nReCnt;

	// 171130.
	Rect _L_rect;
	Rect _R_rect;
	Rect _union_rect;
	Rect _KCF_rect_L;
	Rect _KCF_rect_R;
	int _nHandLR;
	float _max_BGProb_L;
	float _max_BGProb_R;

	bool bTrackON;

	// For visualize matrix...
	Mat m_DispMat; // memory link...

	//// 171213. result related.
	//std::vector<stThrowResult> listThwResult;
	//CThrowResultSet throwResult_;

public:
	CThrowDetector(void);
	~CThrowDetector(void);
	void uninit(void);
	void init(int width, int height);
	void ReInit(void);
	bool run_proposal(Mat curFrame, Mat foreground, Mat Heatmap);
	bool run_decision(Rect track_box, bool bMode);

	void set_ROI(int LT_x, int LT_y, int RB_x, int RB_y);
	void set_LHand(void);

	void carryingObjectProposal(Rect hand_rect, bool bHand, bool bTrackON);

	void FindCarryingObject(Rect region_rect, int min_fore_area, float th_heat_m, bool bHand, bool bTrackON);

	float MeasureJointBgProb(Rect region_rect);
	bool KCF_ReInit(Rect track_box);

	void set_keypoints(hj::CTrackResult trackResult, int idx);
	void set_keypoints_obj(hj::CObjectInfo objectInfo);

	bool Detect(Mat matCurFrame, Mat m_fg_map, Mat Heatmap, Mat matDisp);

	void InitKCFRect();

//	void Run(hj::CTrackResult trackResult, Mat matCurFrame, Mat m_fg_map, Mat Heatmap, Mat matDisp);

};

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Xml;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;

using DigitalPlatform.Xml;
using DigitalPlatform.Text;

namespace DigitalPlatform.rms
{
    // stopword对应的类
    public class StopwordCfg
    {
        //public XmlDocument dom = null;

        Hashtable tableStopwordTable = new Hashtable();

        public StopwordCfg()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }
        /*
                public int Initial(string strStopwordFileName,
                    out string strError)
                {
                    strError = "";

                    Debug.Assert(strStopwordFileName != "" && strStopwordFileName != null,"strStopwordFileName参数不能为null或空。");

                    if (File.Exists(strStopwordFileName) == false)
                    {
                        strError = "stopword角色对应的物理文件不存在";
                        return -1;
                    }
                    // 如果stopword文件的内容为空,则没有可去的非用字,正常结束
                    StreamReader sw = new StreamReader(strStopwordFileName,Encoding.UTF8);
                    string strStopwordText = sw.ReadToEnd();
                    sw.Close();
                    if (strStopwordText == "")
                        return 0;

                    dom = new XmlDocument();
                    try
                    {
                        this.dom.Load(strStopwordFileName);
                    }
                    catch(Exception ex)
                    {
                        strError = "加载stopword配置文件'" + strStopwordFileName + "'到dom时出错:" + ex.Message;
                        return -1;
                    }

                    string strXpath = "//stopwordTable";

                    XmlNodeList nodeListStopwordTable = dom.DocumentElement.SelectNodes(strXpath);
                    for(int i=0;i<nodeListStopwordTable.Count;i++)
                    {
                        XmlNode nodeStopwordTable = nodeListStopwordTable[i];

                        string strName = DomUtil.GetAttr(nodeStopwordTable,"name");
                        StopwordTable stopwordTable = new StopwordTable(nodeStopwordTable);

                        if (i == 0)
                        {
                            this.tableStopwordTable[""] = stopwordTable;
                        }
                        // 加到Hashtable数组里
                        this.tableStopwordTable[strName] = stopwordTable;
                    }

                    return 0;
                }
        */

        public int Initial(XmlNode nodeRoot,
            out string strError)
        {
            strError = "";

            Debug.Assert(nodeRoot != null, "nodeRoot参数不能为null或空。");

            string strXpath = "//stopwordTable";

            XmlNodeList nodeListStopwordTable = nodeRoot.SelectNodes(strXpath);
            for (int i = 0; i < nodeListStopwordTable.Count; i++)
            {
                XmlNode nodeStopwordTable = nodeListStopwordTable[i];

                string strName = DomUtil.GetAttr(nodeStopwordTable, "name");
                StopwordTable stopwordTable = new StopwordTable(nodeStopwordTable);

                if (i == 0)
                {
                    // 第一个多存储一次,便于将来用空名字值来获得
                    this.tableStopwordTable[""] = stopwordTable;
                }
                // 加到Hashtable数组里
                this.tableStopwordTable[strName] = stopwordTable;
            }

            return 0;
        }

        // 对一个字符串数组进行去非用字
        // parameter:
        //		texts	待加工的字符串数组
        //		strStopwordFileName	非字用文件名
        //		strStopwordTable	具体使用非用字哪个表 为""或null表示取第一个表
        //		strError	out 出错信息
        // return:
        //		-1	出错
        //		0	成功
        public int DoStopword(string strStopwordTableName,
            ref List<string> texts,
            out string strError)
        {
            strError = "";

            //if (this.dom == null)
            //	return 0;

            StopwordTable stopwordTable = (StopwordTable)this.tableStopwordTable[strStopwordTableName];
            if (stopwordTable == null)
            {
                strError = "没找到名为'" + strStopwordTableName + "'的<stopwordTable>元素。";
                return -1;
            }

            for (int i = 0; i < texts.Count; i++)
            {
                texts[i] = DeleteStopword(texts[i],
                    stopwordTable);
            }
            return 0;
        }

        // 对一个字符串删除非用字
        // parameter:
        //		strText	待加工的字符串
        //		aSeparator	间隔符数组
        //		aWord	非用字数组
        // return:
        //		string 去非用字后的字符串
        public string DeleteStopword(string strText,
            StopwordTable stopwordTable)
        {
            // -----------------将间隔符转换为'^'---------------
            string strResult = strText;
            for (int i = 0; i < stopwordTable.aSeparator.Count; i++)
            {
                string strOneSeparator = (string)stopwordTable.aSeparator[i];
                strResult = strResult.Replace(strOneSeparator, "^");
            }
            strResult = "^" + strResult + "^";

            //---------------------去非用字------------
            int nPosition;
            int nLength;
            for (int i = 0; i < stopwordTable.aWord.Count; i++)
            {
                string strOneWord = (string)stopwordTable.aWord[i];
                int nStart = 0;
                while (true)
                {
                    /*
					nPosition = StringUtil.FindSubstring(strResult,
						strOneWord,
						nStart);
                     * */
                    // 2012/2/20 试图修改,未经测试,速度是否能快点也未知
                    nPosition = strResult.IndexOf(strOneWord,
                        nStart,
                        StringComparison.InvariantCultureIgnoreCase);

                    if (nPosition < 0)
                        break;
                    nLength = strOneWord.Length;
                    nStart += nLength;
                    string strStart = strResult.Substring(nPosition - 1, 1);
                    string strEnd = strResult.Substring(nPosition + nLength, 1);
                    string strStopwordStart = strOneWord.Substring(0, 1);
                    string strStopwordEnd = strOneWord.Substring(strOneWord.Length - 1);

                    if (((strStart == "^")
                        || (StringUtil.IsChineseChar(strStart) == true)
                        || (StringUtil.IsChineseChar(strStopwordStart) == true)) && ((strEnd == "^")
                        || (StringUtil.IsChineseChar(strEnd) == true)
                        || (StringUtil.IsChineseChar(strStopwordEnd) == true)))
                    {
                        strResult = strResult.Remove(nPosition, nLength);

                        // 2013/7/25
                        if (nStart >= nPosition && nStart < nPosition + nLength)
                            nStart = nPosition;
                    }
                }
            }
            strResult = strResult.Replace("^", "");
            return strResult;
        }

        public int IsInStopword(string strSplitChar,
            string strStopwordTableName,
            out bool bInStopword,
            out string strError)
        {
            bInStopword = false;
            strError = "";

            StopwordTable stopwordTable = (StopwordTable)this.tableStopwordTable[strStopwordTableName];
            if (stopwordTable == null)
            {
                strError = "没找到名为'" + strStopwordTableName + "'的<stopwordTable>元素。";
                return -1;
            }

            foreach (string strSep in stopwordTable.aSeparator)
            {
                if (strSep == strSplitChar)
                {
                    bInStopword = true;
                    return 0;
                }
            }

            foreach (string strWord in stopwordTable.aWord)
            {
                if (strWord == strSplitChar)
                {
                    bInStopword = true;
                    return 0;
                }
            }
            return 0;
        }

    }

    public class StopwordTable
    {
        public string Name = "";
        public XmlNode m_node = null;

        public ArrayList aSeparator = new ArrayList();
        public ArrayList aWord = new ArrayList();

        public StopwordTable(XmlNode node)
        {
            this.Initial(node);

        }

        public void Initial(XmlNode node)
        {
            Debug.Assert(node != null, "Initial()调用错误,node参数值不能为null。");
            this.m_node = node;
            string strName = DomUtil.GetAttr(node, "name");
            this.Name = strName;

            string strXpath = "";

            // 获得分隔符数组
            strXpath = "separator/t";
            XmlNodeList listSeparator = this.m_node.SelectNodes(strXpath);
            foreach (XmlNode nodeSeparator in listSeparator)
            {
                string strText = nodeSeparator.InnerText.Trim();  // 2012/2/16
                if (string.IsNullOrEmpty(strText) == false)
                {
                    // 2017/5/17
                    if (strText == "\\_")   // \_ 被当作 _
                        strText = "_";
                    else if (strText == "_")    // _ 被当作空格
                        strText = " ";

                    this.aSeparator.Add(strText);
                }
            }

            // 获得非用字数组
            strXpath = "word/t";
            XmlNodeList listWord = this.m_node.SelectNodes(strXpath); ;
            foreach (XmlNode nodeWord in listWord)
            {
                string strText = nodeWord.InnerText.Trim();  // 2012/2/16
                if (string.IsNullOrEmpty(strText) == false)
                    this.aWord.Add(strText);
            }
        }

    }

}


text:
namespace _10bClient
{
    partial class Connect
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnConnect = new System.Windows.Forms.Button();
            this.txtHost = new System.Windows.Forms.TextBox();
            this.txtPort = new System.Windows.Forms.TextBox();
            this.txtPass = new System.Windows.Forms.TextBox();
            this.txtUser = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // btnConnect
            //
            this.btnConnect.Location = new System.Drawing.Point(303, 168);
            this.btnConnect.Name = "btnConnect";
            this.btnConnect.Size = new System.Drawing.Size(75, 23);
            this.btnConnect.TabIndex = 0;
            this.btnConnect.Text = "Connect";
            this.btnConnect.UseVisualStyleBackColor = true;
            this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
            //
            // txtHost
            //
            this.txtHost.Location = new System.Drawing.Point(63, 12);
            this.txtHost.Name = "txtHost";
            this.txtHost.Size = new System.Drawing.Size(315, 20);
            this.txtHost.TabIndex = 1;
            this.txtHost.Text = "10bit.danopia.net";
            //
            // txtPort
            //
            this.txtPort.Location = new System.Drawing.Point(63, 38);
            this.txtPort.Name = "txtPort";
            this.txtPort.Size = new System.Drawing.Size(315, 20);
            this.txtPort.TabIndex = 2;
            this.txtPort.Text = "10817";
            //
            // txtUser
            //
            this.txtUser.Location = new System.Drawing.Point(63, 64);
            this.txtUser.Name = "txtUser";
            this.txtUser.Size = new System.Drawing.Size(315, 20);
            this.txtUser.TabIndex = 3;
            this.txtUser.Text = "ldunn";
            //
            // txtPass
            //
            this.txtPass.Location = new System.Drawing.Point(63, 90);
            this.txtPass.Name = "txtPass";
            this.txtPass.Size = new System.Drawing.Size(315, 20);
            this.txtPass.TabIndex = 4;
            this.txtPass.Text = "SECRETPASSWORDOMG";
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(22, 15);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(29, 13);
            this.label1.TabIndex = 5;
            this.label1.Text = "Host";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(22, 67);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(29, 13);
            this.label2.TabIndex = 6;
            this.label2.Text = "User";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(22, 93);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(30, 13);
            this.label3.TabIndex = 7;
            this.label3.Text = "Pass";
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(22, 41);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(26, 13);
            this.label4.TabIndex = 8;
            this.label4.Text = "Port";
            //
            // Connect
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(390, 203);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.txtUser);
            this.Controls.Add(this.txtPass);
            this.Controls.Add(this.txtPort);
            this.Controls.Add(this.txtHost);
            this.Controls.Add(this.btnConnect);
            this.Name = "Connect";
            this.Text = "Connect";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button btnConnect;
        private System.Windows.Forms.TextBox txtHost;
        private System.Windows.Forms.TextBox txtPort;
        private System.Windows.Forms.TextBox txtPass;
        private System.Windows.Forms.TextBox txtUser;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label4;
    }
}


text:
require 'jquery-file-upload/engine' if defined?(::Rails)
require 'jquery-file-upload/version'
require 'slim'

module JqueryFileUpload
  require 'jquery-file-upload/configuration'

  def self.configure
    yield config
  end

  def self.config
    @config ||= Configuration.new
  end
end


text:
html, body, .container {
    height: 100%;
}

.container {
    display: table;
    vertical-align: middle;
}

.vertical-center-row {
    display: table-cell;
    vertical-align: middle;
}

button {
    padding: 0;
    border: none;
    background: none;
}

.button {
    display: inline-block;
    height: 40px;
    line-height: 40px;
    padding-right: 30px;
    padding-left: 70px;
    position: relative;
    background-color: rgb(0, 0, 0);
    color: rgb(255, 255, 255);
    text-decoration: none;
    text-transform: lowercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5);
    -ms-filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";
    zoom: 1;
    filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=1, Color=#ff123852, Positive=true);

    -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2);
    -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2);
    -ms-filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)";
    filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=2, Color=#33000000, Positive=true);
}

.button:hover {
    text-decoration: none;
    color: #eeeaee;
}

.button p {
    font-size: 18px;
}

.button span {
    position: absolute;
    left: 0;
    width: 50px;
    font-size: 30px;
    -webkit-border-top-left-radius: 5px;
    -webkit-border-bottom-left-radius: 5px;
    -moz-border-radius-topleft: 5px;
    -moz-border-radius-bottomleft: 5px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    border-right: 1px solid rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.button.facebook {
    background: #3b5998;
}


text:
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.

/* global document */

test('a failed assertion comparing a DOM node does not crash Jest', () => {
  expect(document.body).toBe(null);
});


text:
package org.kuali.rice.ksb.messaging.bam;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.kuali.rice.core.framework.persistence.jpa.OrmUtils;
import org.kuali.rice.ksb.api.messaging.AsynchronousCallback;
import org.kuali.rice.ksb.service.KSBServiceLocator;

/**
 * An entry in the BAM representing a service method invocation.
 *
 * @author Kuali Rice Team (rice.collab@kuali.org)
 */
@Entity
@Table(name="KRSB_BAM_T")
//@Sequence(name="KRSB_BAM_S", property="bamId")
public class BAMTargetEntry implements Serializable {

	private static final long serialVersionUID = -8376674801367598316L;

	@Id
	@GeneratedValue(generator="KRSB_BAM_S")
	@GenericGenerator(name="KRSB_BAM_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={
			@Parameter(name="sequence_name",value="KRSB_BAM_S"),
			@Parameter(name="value_column",value="id")
	})
	@Column(name="BAM_ID")
	private Long bamId;
	@Column(name="SVC_NM")
	private String serviceName;
	@Column(name="MTHD_NM")
	private String methodName;
	@Column(name="THRD_NM")
	private String threadName;
	@Column(name="CALL_DT")
	private Timestamp callDate;
	@Column(name="SVC_URL")
	private String serviceURL;
	@Column(name="TGT_TO_STR")
	private String targetToString;
	@Column(name="EXCPN_TO_STR")
	private String exceptionToString;
	@Lob
	@Basic(fetch=FetchType.LAZY)
	@Column(name="EXCPN_MSG", length=4000)
	private String exceptionMessage;
	@Column(name="SRVR_IND")
	private Boolean serverInvocation;
	@OneToMany(cascade=CascadeType.ALL, mappedBy="bamParamId")
	private List<BAMParam> bamParams = new ArrayList<BAMParam>();

	//for async calls not bam
	@Transient
	private AsynchronousCallback callback;

	//@PrePersist
    public void beforeInsert(){
        OrmUtils.populateAutoIncValue(this, KSBServiceLocator.getRegistryEntityManagerFactory().createEntityManager());
    }

	public void addBamParam(BAMParam bamParam) {
		this.bamParams.add(bamParam);
	}
	public String getExceptionToString() {
		return this.exceptionToString;
	}
	public void setExceptionToString(String exceptionToString) {
		this.exceptionToString = exceptionToString;
	}
	public String getServiceName() {
		return this.serviceName;
	}
	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}
	public String getServiceURL() {
		return this.serviceURL;
	}
	public void setServiceURL(String serviceURL) {
		this.serviceURL = serviceURL;
	}
	public String getTargetToString() {
		return this.targetToString;
	}
	public void setTargetToString(String targetToString) {
		this.targetToString = targetToString;
	}
	public Long getBamId() {
		return this.bamId;
	}
	public void setBamId(Long bamId) {
		this.bamId = bamId;
	}
	public String getExceptionMessage() {
		return this.exceptionMessage;
	}
	public void setExceptionMessage(String exceptionMessage) {
		this.exceptionMessage = exceptionMessage;
	}
	public Boolean getServerInvocation() {
		return this.serverInvocation;
	}
	public void setServerInvocation(Boolean clientInvocation) {
		this.serverInvocation = clientInvocation;
	}
	public Timestamp getCallDate() {
		return this.callDate;
	}
	public void setCallDate(Timestamp callDate) {
		this.callDate = callDate;
	}
	public String getMethodName() {
		return this.methodName;
	}
	public void setMethodName(String methodName) {
		this.methodName = methodName;
	}
	public String getThreadName() {
		return this.threadName;
	}
	public void setThreadName(String threadName) {
		this.threadName = threadName;
	}
	public List<BAMParam> getBamParams() {
		return this.bamParams;
	}
	public void setBamParams(List<BAMParam> bamParams) {
		this.bamParams = bamParams;
	}
	public AsynchronousCallback getCallback() {
		return this.callback;
	}
	public void setCallback(AsynchronousCallback callback) {
		this.callback = callback;
	}
}


text:
package org.http4s

import scala.collection.generic.CanBuildFrom
import scala.collection.immutable.{BitSet, IndexedSeq}
import scala.collection.mutable.ListBuffer
import scala.collection.{ IndexedSeqOptimized, mutable }

import org.http4s.Query._
import org.http4s.parser.QueryParser
import org.http4s.util.{UrlCodingUtils, Writer, Renderable}
import org.parboiled2.CharPredicate

/** Collection representation of a query string
  *
  * It is a indexed sequence of key and maybe a value pairs which maps
  * precisely to a query string, modulo the identity of separators.
  *
  * When rendered, the resulting `String` will have the pairs separated
  * by '&' while the key is separated from the value with '='
  */
final class Query private(pairs: Vector[KeyValue])
  extends IndexedSeq[KeyValue]
  with IndexedSeqOptimized[KeyValue, Query]
  with QueryOps
  with Renderable
{
  override def apply(idx: Int): KeyValue = pairs(idx)

  override def length: Int = pairs.length

  override def slice(from: Int, until: Int): Query = new Query(pairs.slice(from, until))

  override def +:[B >: KeyValue, That](elem: B)(implicit bf: CanBuildFrom[Query, B, That]): That = {
    if (bf eq Query.cbf) new Query((elem +: pairs).asInstanceOf[Vector[KeyValue]]).asInstanceOf[That]
    else super.+:(elem)
  }

  override def :+[B >: KeyValue, That](elem: B)(implicit bf: CanBuildFrom[Query, B, That]): That = {
    if (bf eq Query.cbf) new Query((pairs :+ elem).asInstanceOf[Vector[KeyValue]]).asInstanceOf[That]
    else super.:+(elem)
  }

  override def toVector: Vector[(String, Option[String])] = pairs

  /** Render the Query as a `String`.
    *
    * Pairs are separated by '&' and keys are separated from values by '='
    */
  override def render(writer: Writer): writer.type = {
    var first = true
    def encode(s: String) =
      UrlCodingUtils.urlEncode(s, spaceIsPlus = false, toSkip = NoEncode)
    pairs.foreach {
      case (n, None) =>
        if (!first) writer.append('&')
        else first = false
        writer.append(encode(n))

      case (n, Some(v)) =>
        if (!first) writer.append('&')
        else first = false
        writer.append(encode(n))
          .append("=")
          .append(encode(v))
    }
    writer
  }

  /** Map[String, String] representation of the [[Query]]
    *
    * If multiple values exist for a key, the first is returned. If
    * none exist, the empty `String` "" is returned.
    */
  def params: Map[String, String] = new ParamsView(multiParams)

  /** Map[String, Seq[String] ] representation of the [[Query]]
    *
    * Params are represented as a `Seq[String]` and may be empty.
    */
  lazy val multiParams: Map[String, Seq[String]] = {
    if (isEmpty) Map.empty[String, Seq[String]]
    else {
      val m = mutable.Map.empty[String, ListBuffer[String]]
      foreach {
        case (k, None) => m.getOrElseUpdate(k, new ListBuffer)
        case (k, Some(v)) => m.getOrElseUpdate(k, new ListBuffer) += v
      }

      m.toMap
    }
  }

  override protected[this] def newBuilder: Builder = Query.newBuilder

  /////////////////////// QueryOps methods and types /////////////////////////
  override protected type Self = Query
  override protected val query: Query = this
  override protected def self: Self = this
  override protected def replaceQuery(query: Query): Self = query
  ////////////////////////////////////////////////////////////////////////////
}

object Query {
  type KeyValue = (String, Option[String])

  type Builder = mutable.Builder[KeyValue, Query]

  val empty: Query = new Query(Vector.empty)

  /*
   * "The characters slash ("/") and question mark ("?") may represent data
   * within the query component... it is sometimes better for usability to
   * avoid percent-encoding those characters."
   *   -- http://tools.ietf.org/html/rfc3986#section-3.4
   */
  private val NoEncode: CharPredicate =
    UrlCodingUtils.Unreserved ++ "?/"

  def apply(xs: (String, Option[String])*): Query =
    new Query(xs.toVector)

  def fromPairs(xs: (String, String)*): Query = {
    val b = newBuilder
    xs.foreach{ case (k, v) => b += ((k, Some(v))) }
    b.result()
  }

  /** Generate a [[Query]] from its `String` representation
    *
    * If parsing fails, the empty [[Query]] is returned
    */
  def fromString(query: String): Query = {
    if (query.isEmpty) new Query(Vector("" -> None))
    else QueryParser.parseQueryString(query).getOrElse(Query.empty)
  }

  /** Build a [[Query]] from the `Map` structure */
  def fromMap(map: Map[String, Seq[String]]): Query = {
    val b = newBuilder
    map.foreach {
      case (k, Seq()) => b +=  ((k, None))
      case (k, vs)    => vs.foreach(v => b += ((k, Some(v))))
    }
    b.result()
  }

  def newBuilder: mutable.Builder[KeyValue, Query] =
    Vector.newBuilder[KeyValue].mapResult(v => new Query(v))

  implicit val cbf: CanBuildFrom[Query, KeyValue, Query] = new CanBuildFrom[Query, KeyValue, Query] {
    override def apply(from: Query): mutable.Builder[KeyValue, Query] = newBuilder
    override def apply(): mutable.Builder[KeyValue, Query] = newBuilder
  }

  ///////////////////////////////////////////////////////////////////////
  // Wrap the multiParams to get a Map[String, String] view
  private class ParamsView(wrapped: Map[String, Seq[String]]) extends Map[String, String] {
    override def +[B1 >: String](kv: (String, B1)): Map[String, B1] = {
      val m = wrapped + (kv)
      m.asInstanceOf[Map[String, B1]]
    }

    override def -(key: String): Map[String, String] = new ParamsView(wrapped - key)

    override def iterator: Iterator[(String, String)] =
      wrapped.iterator.map { case (k, s) => (k, s.headOption.getOrElse("")) }

    override def get(key: String): Option[String] =
      wrapped.get(key).flatMap(_.headOption)
  }
}


text:
package org.uberfire.client.tables;

import com.github.gwtbootstrap.client.ui.SimplePager;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.view.client.AsyncDataProvider;
import com.google.gwt.view.client.ProvidesKey;

/**
 * Widget that shows rows of paged data.
 */
public class PagedTable<T>
        extends SimpleTable<T> {

    interface Binder
            extends
            UiBinder<Widget, PagedTable> {

    }

    private static Binder uiBinder = GWT.create( Binder.class );

    private int pageSize;
    private AsyncDataProvider<T> dataProvider;

    @UiField
    public SimplePager pager;

    public PagedTable( final int pageSize ) {
        super();
        this.pageSize = pageSize;
        this.dataGrid.setPageSize( pageSize );
        this.pager.setDisplay( dataGrid );
        this.pager.setPageSize( pageSize );
    }

    public PagedTable( final int pageSize,
                       final ProvidesKey<T> providesKey ) {
        super( providesKey );
        this.pageSize = pageSize;
        this.dataGrid.setPageSize( pageSize );
        this.pager.setDisplay( dataGrid );
        this.pager.setPageSize( pageSize );
    }

    protected Widget makeWidget() {
        return uiBinder.createAndBindUi( this );
    }

    /**
     * Link a data provider to the table
     * @param dataProvider
     */
    public void setDataProvider( final AsyncDataProvider<T> dataProvider ) {
        this.dataProvider = dataProvider;
        this.dataProvider.addDataDisplay( dataGrid );
    }

    public int getPageSize() {
        return this.pageSize;
    }

    public int getPageStart() {
        return this.pager.getPageStart();
    }

}


text:
namespace api_rest_sgmw
{
    using System;
    using System.Collections.Generic;

    public partial class EQUIPOS_INSTALADOS
    {
        public int EQUIPO_INSTALADO_ID { get; set; }
        public int UBICACION_ID { get; set; }
        public int MAQUINA_ID { get; set; }
        public string EQUIPO_INSTALADO_DETALLE { get; set; }
        public int USER_ID { get; set; }
        public Nullable<System.DateTime> CREATED { get; set; }
        public Nullable<System.DateTime> MODIFIED { get; set; }
        public Nullable<bool> DELETED { get; set; }

        public virtual UBICACIONES UBICACIONES { get; set; }
        public virtual MAQUINAS MAQUINAS { get; set; }
    }
}


text: A very small JSON library written in Synergy DBL


text: <input type="hidden" name="time" id="time" value="{time()}">


text:
BOT_NAME = 'example'
BOT_VERSION = '1.0'

SPIDER_MODULES = ['example.spiders']
NEWSPIDER_MODULE = 'example.spiders'
USER_AGENT = '%s/%s' % (BOT_NAME, BOT_VERSION)

SCHEDULER = "scrapy_redis.scheduler.Scheduler"
SCHEDULER_PERSIST = True

ITEM_PIPELINES = [
    'example.pipelines.ExamplePipeline',
    'scrapy_redis.pipelines.RedisPipeline',
]


text:
package fixtures.bodyduration;

import com.google.common.reflect.TypeToken;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceException;
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.ServiceResponseBuilder;
import com.microsoft.rest.ServiceResponseCallback;
import com.microsoft.rest.ServiceResponseEmptyCallback;
import com.squareup.okhttp.ResponseBody;
import retrofit.Retrofit;
import retrofit.Call;
import retrofit.Response;
import org.joda.time.Period;
import fixtures.bodyduration.models.Error;

public class DurationImpl implements Duration {
    private DurationService service;
    AutoRestDurationTestService client;

    public DurationImpl(Retrofit retrofit, AutoRestDurationTestService client) {
        this.service = retrofit.create(DurationService.class);
        this.client = client;
    }

    /**
     * Get null duration value
     *
     * @return the Period object if successful.
     * @throws ServiceException the exception wrapped in ServiceException if failed.
     */
    public Period getNull() throws ServiceException {
        try {
            Call<ResponseBody> call = service.getNull();
            ServiceResponse<Period> response = getNullDelegate(call.execute(), null);
            return response.getBody();
        } catch (ServiceException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new ServiceException(ex);
        }
    }

    /**
     * Get null duration value
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     */
    public Call<ResponseBody> getNullAsync(final ServiceCallback<Period> serviceCallback) {
        Call<ResponseBody> call = service.getNull();
        call.enqueue(new ServiceResponseCallback<Period>(serviceCallback) {
            @Override
            public void onResponse(Response<ResponseBody> response, Retrofit retrofit) {
                try {
                    serviceCallback.success(getNullDelegate(response, retrofit));
                } catch (ServiceException exception) {
                    serviceCallback.failure(exception);
                }
            }
        });
        return call;
    }

    private ServiceResponse<Period> getNullDelegate(Response<ResponseBody> response, Retrofit retrofit) throws ServiceException {
        return new ServiceResponseBuilder<Period>()
                .register(200, new TypeToken<Period>(){}.getType())
                .registerError(new TypeToken<Error>(){}.getType())
                .build(response, retrofit);
    }

    /**
     * Put a positive duration value
     *
     * @param durationBody the Period value
     * @throws ServiceException the exception wrapped in ServiceException if failed.
     */
    public void putPositiveDuration(Period durationBody) throws ServiceException {
        if (durationBody == null) {
            throw new ServiceException(
                new IllegalArgumentException("Parameter durationBody is required and cannot be null."));
        }
        try {
            Call<ResponseBody> call = service.putPositiveDuration(durationBody);
            ServiceResponse<Void> response = putPositiveDurationDelegate(call.execute(), null);
            response.getBody();
        } catch (ServiceException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new ServiceException(ex);
        }
    }

    /**
     * Put a positive duration value
     *
     * @param durationBody the Period value
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     */
    public Call<ResponseBody> putPositiveDurationAsync(Period durationBody, final ServiceCallback<Void> serviceCallback) {
        if (durationBody == null) {
            serviceCallback.failure(new ServiceException(
                new IllegalArgumentException("Parameter durationBody is required and cannot be null.")));
        }
        Call<ResponseBody> call = service.putPositiveDuration(durationBody);
        call.enqueue(new ServiceResponseCallback<Void>(serviceCallback) {
            @Override
            public void onResponse(Response<ResponseBody> response, Retrofit retrofit) {
                try {
                    serviceCallback.success(putPositiveDurationDelegate(response, retrofit));
                } catch (ServiceException exception) {
                    serviceCallback.failure(exception);
                }
            }
        });
        return call;
    }

    private ServiceResponse<Void> putPositiveDurationDelegate(Response<ResponseBody> response, Retrofit retrofit) throws ServiceException {
        return new ServiceResponseBuilder<Void>()
                .register(200, new TypeToken<Void>(){}.getType())
                .registerError(new TypeToken<Error>(){}.getType())
                .build(response, retrofit);
    }

    /**
     * Get a positive duration value
     *
     * @return the Period object if successful.
     * @throws ServiceException the exception wrapped in ServiceException if failed.
     */
    public Period getPositiveDuration() throws ServiceException {
        try {
            Call<ResponseBody> call = service.getPositiveDuration();
            ServiceResponse<Period> response = getPositiveDurationDelegate(call.execute(), null);
            return response.getBody();
        } catch (ServiceException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new ServiceException(ex);
        }
    }

    /**
     * Get a positive duration value
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     */
    public Call<ResponseBody> getPositiveDurationAsync(final ServiceCallback<Period> serviceCallback) {
        Call<ResponseBody> call = service.getPositiveDuration();
        call.enqueue(new ServiceResponseCallback<Period>(serviceCallback) {
            @Override
            public void onResponse(Response<ResponseBody> response, Retrofit retrofit) {
                try {
                    serviceCallback.success(getPositiveDurationDelegate(response, retrofit));
                } catch (ServiceException exception) {
                    serviceCallback.failure(exception);
                }
            }
        });
        return call;
    }

    private ServiceResponse<Period> getPositiveDurationDelegate(Response<ResponseBody> response, Retrofit retrofit) throws ServiceException {
        return new ServiceResponseBuilder<Period>()
                .register(200, new TypeToken<Period>(){}.getType())
                .registerError(new TypeToken<Error>(){}.getType())
                .build(response, retrofit);
    }

    /**
     * Get an invalid duration value
     *
     * @return the Period object if successful.
     * @throws ServiceException the exception wrapped in ServiceException if failed.
     */
    public Period getInvalid() throws ServiceException {
        try {
            Call<ResponseBody> call = service.getInvalid();
            ServiceResponse<Period> response = getInvalidDelegate(call.execute(), null);
            return response.getBody();
        } catch (ServiceException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new ServiceException(ex);
        }
    }

    /**
     * Get an invalid duration value
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     */
    public Call<ResponseBody> getInvalidAsync(final ServiceCallback<Period> serviceCallback) {
        Call<ResponseBody> call = service.getInvalid();
        call.enqueue(new ServiceResponseCallback<Period>(serviceCallback) {
            @Override
            public void onResponse(Response<ResponseBody> response, Retrofit retrofit) {
                try {
                    serviceCallback.success(getInvalidDelegate(response, retrofit));
                } catch (ServiceException exception) {
                    serviceCallback.failure(exception);
                }
            }
        });
        return call;
    }

    private ServiceResponse<Period> getInvalidDelegate(Response<ResponseBody> response, Retrofit retrofit) throws ServiceException {
        return new ServiceResponseBuilder<Period>()
                .register(200, new TypeToken<Period>(){}.getType())
                .registerError(new TypeToken<Error>(){}.getType())
                .build(response, retrofit);
    }

}