text:
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIIOService.idl
 */

#ifndef __gen_nsIIOService_h__
#define __gen_nsIIOService_h__

#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIProtocolHandler; /* forward declaration */

class nsIChannel; /* forward declaration */

class nsIURI; /* forward declaration */

class nsIFile; /* forward declaration */

/* starting interface:    nsIIOService */
#define NS_IIOSERVICE_IID_STR "bddeda3f-9020-4d12-8c70-984ee9f7935e"

#define NS_IIOSERVICE_IID \
  {0xbddeda3f, 0x9020, 0x4d12, \
    { 0x8c, 0x70, 0x98, 0x4e, 0xe9, 0xf7, 0x93, 0x5e }}

/**
 * nsIIOService provides a set of network utility functions.  This interface
 * duplicates many of the nsIProtocolHandler methods in a protocol handler
 * independent way (e.g., NewURI inspects the scheme in order to delegate
 * creation of the new URI to the appropriate protocol handler).  nsIIOService
 * also provides a set of URL parsing utility functions.  These are provided
 * as a convenience to the programmer and in some cases to improve performance
 * by eliminating intermediate data structures and interfaces.
 *
 * @status FROZEN
 */
class NS_NO_VTABLE nsIIOService : public nsISupports {
 public:

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IIOSERVICE_IID)

  /**
     * Returns a protocol handler for a given URI scheme.
     *
     * @param aScheme the URI scheme
     * @return reference to corresponding nsIProtocolHandler
     */
  /* nsIProtocolHandler getProtocolHandler (in string aScheme); */
  NS_IMETHOD GetProtocolHandler(const char *aScheme, nsIProtocolHandler **_retval) = 0;

  /**
     * Returns the protocol flags for a given scheme.
     *
     * @param aScheme the URI scheme
     * @return value of corresponding nsIProtocolHandler::protocolFlags
     */
  /* unsigned long getProtocolFlags (in string aScheme); */
  NS_IMETHOD GetProtocolFlags(const char *aScheme, PRUint32 *_retval) = 0;

  /**
     * This method constructs a new URI by determining the scheme of the
     * URI spec, and then delegating the construction of the URI to the
     * protocol handler for that scheme. QueryInterface can be used on
     * the resulting URI object to obtain a more specific type of URI.
     *
     * @see nsIProtocolHandler::newURI
     */
  /* nsIURI newURI (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); */
  NS_IMETHOD NewURI(const nsACString & aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval) = 0;

  /**
     * This method constructs a new URI from a nsIFile.
     *
     * @param aFile specifies the file path
     * @return reference to a new nsIURI object
     */
  /* nsIURI newFileURI (in nsIFile aFile); */
  NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI **_retval) = 0;

  /**
     * Creates a channel for a given URI.
     *
     * @param aURI nsIURI from which to make a channel
     * @return reference to the new nsIChannel object
     */
  /* nsIChannel newChannelFromURI (in nsIURI aURI); */
  NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel **_retval) = 0;

  /**
     * Equivalent to newChannelFromURI(newURI(...))
     */
  /* nsIChannel newChannel (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); */
  NS_IMETHOD NewChannel(const nsACString & aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIChannel **_retval) = 0;

  /**
     * Returns true if networking is in "offline" mode. When in offline mode,
     * attempts to access the network will fail (although this is not
     * necessarily corrolated with whether there is actually a network
     * available -- that's hard to detect without causing the dialer to
     * come up).
     */
  /* attribute boolean offline; */
  NS_IMETHOD GetOffline(PRBool *aOffline) = 0;
  NS_IMETHOD SetOffline(PRBool aOffline) = 0;

  /**
     * Checks if a port number is banned. This involves consulting a list of
     * unsafe ports, corresponding to network services that may be easily
     * exploitable. If the given port is considered unsafe, then the protocol
     * handler (corresponding to aScheme) will be asked whether it wishes to
     * override the IO service's decision to block the port. This gives the
     * protocol handler ultimate control over its own security policy while
     * ensuring reasonable, default protection.
     *
     * @see nsIProtocolHandler::allowPort
     */
  /* boolean allowPort (in long aPort, in string aScheme); */
  NS_IMETHOD AllowPort(PRInt32 aPort, const char *aScheme, PRBool *_retval) = 0;

  /**
     * Utility to extract the scheme from a URL string, consistently and
     * according to spec (see RFC 2396).
     *
     * NOTE: Most URL parsing is done via nsIURI, and in fact the scheme
     * can also be extracted from a URL string via nsIURI.  This method
     * is provided purely as an optimization.
     *
     * @param aSpec the URL string to parse
     * @return URL scheme
     *
     * @throws NS_ERROR_MALFORMED_URI if URL string is not of the right form.
     */
  /* ACString extractScheme (in AUTF8String urlString); */
  NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIIOSERVICE \
  NS_IMETHOD GetProtocolHandler(const char *aScheme, nsIProtocolHandler **_retval); \
  NS_IMETHOD GetProtocolFlags(const char *aScheme, PRUint32 *_retval); \
  NS_IMETHOD NewURI(const nsACString & aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval); \
  NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI **_retval); \
  NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel **_retval); \
  NS_IMETHOD NewChannel(const nsACString & aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIChannel **_retval); \
  NS_IMETHOD GetOffline(PRBool *aOffline); \
  NS_IMETHOD SetOffline(PRBool aOffline); \
  NS_IMETHOD AllowPort(PRInt32 aPort, const char *aScheme, PRBool *_retval); \
  NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval);

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIIOSERVICE(_to) \
  NS_IMETHOD GetProtocolHandler(const char *aScheme, nsIProtocolHandler **_retval) { return _to GetProtocolHandler(aScheme, _retval); } \
  NS_IMETHOD GetProtocolFlags(const char *aScheme, PRUint32 *_retval) { return _to GetProtocolFlags(aScheme, _retval); } \
  NS_IMETHOD NewURI(const nsACString & aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval) { return _to NewURI(aSpec, aOriginCharset, aBaseURI, _retval); } \
  NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI **_retval) { return _to NewFileURI(aFile, _retval); } \
  NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel **_retval) { return _to NewChannelFromURI(aURI, _retval); } \
  NS_IMETHOD NewChannel(const nsACString & aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIChannel **_retval) { return _to NewChannel(aSpec, aOriginCharset, aBaseURI, _retval); } \
  NS_IMETHOD GetOffline(PRBool *aOffline) { return _to GetOffline(aOffline); } \
  NS_IMETHOD SetOffline(PRBool aOffline) { return _to SetOffline(aOffline); } \
  NS_IMETHOD AllowPort(PRInt32 aPort, const char *aScheme, PRBool *_retval) { return _to AllowPort(aPort, aScheme, _retval); } \
  NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval) { return _to ExtractScheme(urlString, _retval); }

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIIOSERVICE(_to) \
  NS_IMETHOD GetProtocolHandler(const char *aScheme, nsIProtocolHandler **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProtocolHandler(aScheme, _retval); } \
  NS_IMETHOD GetProtocolFlags(const char *aScheme, PRUint32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProtocolFlags(aScheme, _retval); } \
  NS_IMETHOD NewURI(const nsACString & aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewURI(aSpec, aOriginCharset, aBaseURI, _retval); } \
  NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewFileURI(aFile, _retval); } \
  NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannelFromURI(aURI, _retval); } \
  NS_IMETHOD NewChannel(const nsACString & aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIChannel **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannel(aSpec, aOriginCharset, aBaseURI, _retval); } \
  NS_IMETHOD GetOffline(PRBool *aOffline) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOffline(aOffline); } \
  NS_IMETHOD SetOffline(PRBool aOffline) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOffline(aOffline); } \
  NS_IMETHOD AllowPort(PRInt32 aPort, const char *aScheme, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->AllowPort(aPort, aScheme, _retval); } \
  NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ExtractScheme(urlString, _retval); }

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsIOService : public nsIIOService
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIIOSERVICE

  nsIOService();
  virtual ~nsIOService();
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsIOService, nsIIOService)

nsIOService::nsIOService()
{
  /* member initializers and constructor code */
}

nsIOService::~nsIOService()
{
  /* destructor code */
}

/* nsIProtocolHandler getProtocolHandler (in string aScheme); */
NS_IMETHODIMP nsIOService::GetProtocolHandler(const char *aScheme, nsIProtocolHandler **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* unsigned long getProtocolFlags (in string aScheme); */
NS_IMETHODIMP nsIOService::GetProtocolFlags(const char *aScheme, PRUint32 *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIURI newURI (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); */
NS_IMETHODIMP nsIOService::NewURI(const nsACString & aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIURI newFileURI (in nsIFile aFile); */
NS_IMETHODIMP nsIOService::NewFileURI(nsIFile *aFile, nsIURI **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIChannel newChannelFromURI (in nsIURI aURI); */
NS_IMETHODIMP nsIOService::NewChannelFromURI(nsIURI *aURI, nsIChannel **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIChannel newChannel (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); */
NS_IMETHODIMP nsIOService::NewChannel(const nsACString & aSpec, const char *aOriginCharset, nsIURI *aBaseURI, nsIChannel **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute boolean offline; */
NS_IMETHODIMP nsIOService::GetOffline(PRBool *aOffline)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsIOService::SetOffline(PRBool aOffline)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean allowPort (in long aPort, in string aScheme); */
NS_IMETHODIMP nsIOService::AllowPort(PRInt32 aPort, const char *aScheme, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* ACString extractScheme (in AUTF8String urlString); */
NS_IMETHODIMP nsIOService::ExtractScheme(const nsACString & urlString, nsACString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

#endif /* __gen_nsIIOService_h__ */


text:
PAGI\Client\Result\ExecResult
===============

This decorated result adds the functionality to check for an exec result.

PHP Version 5

* Class name: ExecResult
* Namespace: PAGI\Client\Result
* Parent class: [PAGI\Client\Result\ResultDecorator](PAGI-Client-Result-ResultDecorator.md)

Properties
----------

### $result

    private \PAGI\Client\Result\IResult $result

Our decorated result.

* Visibility: **private**

Methods
-------

### __construct

    void PAGI\Client\Result\ResultDecorator::__construct(\PAGI\Client\Result\IResult $result)

Constructor.

* Visibility: **public**
* This method is defined by [PAGI\Client\Result\ResultDecorator](PAGI-Client-Result-ResultDecorator.md)

#### Arguments
* $result **[PAGI\Client\Result\IResult](PAGI-Client-Result-IResult.md)** -
Result to decorate.

### getOriginalLine

    string PAGI\Client\Result\IResult::getOriginalLine()

Returns original line.

* Visibility: **public**
* This method is defined by [PAGI\Client\Result\IResult](PAGI-Client-Result-IResult.md)

### getCode

    integer PAGI\Client\Result\IResult::getCode()

Returns the integer value of the code returned by agi.

* Visibility: **public**
* This method is defined by [PAGI\Client\Result\IResult](PAGI-Client-Result-IResult.md)

### getResult

    integer PAGI\Client\Result\IResult::getResult()

Returns result (result=xxx) from the result.

* Visibility: **public**
* This method is defined by [PAGI\Client\Result\IResult](PAGI-Client-Result-IResult.md)

### isResult

    boolean PAGI\Client\Result\IResult::isResult(string $value)

Compares result to a given value.

* Visibility: **public**
* This method is defined by [PAGI\Client\Result\IResult](PAGI-Client-Result-IResult.md)

#### Arguments
* $value **string** -
Value to match against.

### hasData

    boolean PAGI\Client\Result\IResult::hasData()

Returns true if this command returned any data.

* Visibility: **public**
* This method is defined by [PAGI\Client\Result\IResult](PAGI-Client-Result-IResult.md)

### getData

    string PAGI\Client\Result\IResult::getData()

Returns data, if any. False if none.

* Visibility: **public**
* This method is defined by [PAGI\Client\Result\IResult](PAGI-Client-Result-IResult.md)

### __toString

    string PAGI\Client\Result\ResultDecorator::__toString()

Standard procedure.

* Visibility: **public**
* This method is defined by [PAGI\Client\Result\ResultDecorator](PAGI-Client-Result-ResultDecorator.md)

redpajama_set_name: RedPajamaGithub


text:
// $Id: Compiler_Features_14_Test.cpp 91626 2010-09-07 10:59:20Z johnnyw $

/**
 * @file
 *
 * This program checks if the compiler / platform supports partial
 * template specialization.  The motivation for this test was a
 * discussion on the development mailing list, and the documentation
 * was captured in:
 *
 *   http://bugzilla.dre.vanderbilt.edu/show_bug.cgi?id=3715
 *
 */

#include "test_config.h"

// We are going to test if partial template specializations work by
// demonstrating a standard technique in generic programming, i.e.,
// using the specialization to detect if a type is a pointer.
//
// My implementation here is not very elegant, I would even say
// ackward, and should not be taken as representative of good generic
// programming techniques.  I just wanted to through something
// together.
//

// First some helper types in the anonymous namespace
struct true_type {};
struct false_type {};

// Now a generic function to convert the types to booleans, moving
// from generic type-based programming to classical value-based
// programming.
template<class T>
bool to_boolean(T const&);

template<>
bool to_boolean(true_type const &)
{
  return true;
}

template<>
bool to_boolean(false_type const &)
{
  return false;
}

// Here is the template, by default return false for all types.
// Notice that this is a type *function*, it takes a type and returns
// another type.
template<typename T>
struct is_pointer_function
{
  false_type result;
};

// Here is the specialization, for a class of types it results
// something different.  Effectively this is an implicit if() test on
// the types.
template<typename T>
struct is_pointer_function<T*>
{
  true_type result;
};

// And here is a helper to convert back to values...
struct test
{
  template<typename T>
  static bool is_pointer()
  {
    is_pointer_function<T> v;
    return to_boolean(v.result);
  }
};

int
run_main (int, ACE_TCHAR *[])
{
  ACE_START_TEST (ACE_TEXT("Compiler_Features_14_Test"));

  // As usual, the exit status from the test is 0 on success, 1 on
  // failure
  int status = 0;

  if (test::is_pointer<int>())
    {
      status = 1;
      ACE_ERROR((LM_ERROR,
                 ACE_TEXT("int should not be a pointer\n")));
    }

  if (! test::is_pointer<int*>())
    {
      status = 1;
      ACE_ERROR((LM_ERROR,
                 ACE_TEXT("int* should be a pointer\n")));
    }

  if (test::is_pointer<int&>())
    {
      status = 1;
      ACE_ERROR((LM_ERROR,
                 ACE_TEXT("int& should not be a pointer\n")));
    }

  ACE_END_TEST;
  return status;
}


text:
package utils

import (
	. "gopkg.in/check.v1"
	"net/http"
	"net/url"
)

type DumpHttpReqSuite struct {
}

var _ = Suite(&DumpHttpReqSuite{})

type readCloserTestImpl struct {
}

func (r *readCloserTestImpl) Read(p []byte) (n int, err error) {
	return 0, nil
}

func (r *readCloserTestImpl) Close() error {
	return nil
}

//Just to make sure we don't panic, return err and not
//username and pass and cover the function
func (s *DumpHttpReqSuite) TestHttpReqToString(c *C) {
	req := &http.Request{
		URL:    &url.URL{Host: "localhost:2374", Path: "/unittest"},
		Method: "DELETE",
		Cancel: make(chan struct{}),
		Body:   &readCloserTestImpl{},
	}

	c.Assert(len(DumpHttpRequest(req)) > 0, Equals, true)
}


text:
#include <proton/ssl.h>
#include <proton/error.h>
#include <proton/transport.h>
#include "engine/engine-internal.h"

/** @file
 * SSL/TLS support API.
 *
 * This file contains stub implementations of the SSL/TLS API.  This implementation is
 * used if there is no SSL/TLS support in the system's environment.
 */

bool pn_ssl_present(void)
{
  return false;
}

pn_ssl_t *pn_ssl(pn_transport_t *transport)
{
  return NULL;
}

int pn_ssl_init(pn_ssl_t *ssl, pn_ssl_domain_t *domain,
                const char *session_id)
{
  return -1;
}

void pn_ssl_free( pn_ssl_t *ssl)
{
}

void pn_ssl_trace(pn_ssl_t *ssl, pn_trace_t trace)
{
}

ssize_t pn_ssl_input(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available)
{
  return PN_EOS;
}

ssize_t pn_ssl_output(pn_transport_t *transport, unsigned int layer, char *buffer, size_t max_size)
{
  return PN_EOS;
}

const pn_io_layer_t ssl_layer = {
    pn_ssl_input,
    pn_ssl_output,
    NULL,
    NULL
};

bool pn_ssl_get_cipher_name(pn_ssl_t *ssl, char *buffer, size_t size)
{
  return false;
}

bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *buffer, size_t size)
{
  return false;
}

pn_ssl_domain_t *pn_ssl_domain( pn_ssl_mode_t mode)
{
  return NULL;
}

void pn_ssl_domain_free( pn_ssl_domain_t *d )
{
}

int pn_ssl_domain_set_credentials( pn_ssl_domain_t *domain,
                               const char *certificate_file,
                               const char *private_key_file,
                               const char *password)
{
  return -1;
}

int pn_ssl_domain_set_trusted_ca_db(pn_ssl_domain_t *domain,
                                const char *certificate_db)
{
  return -1;
}

int pn_ssl_domain_set_peer_authentication(pn_ssl_domain_t *domain,
                                   const pn_ssl_verify_mode_t mode,
                                   const char *trusted_CAs)
{
  return -1;
}

int pn_ssl_domain_allow_unsecured_client(pn_ssl_domain_t *domain)
{
  return -1;
}

bool pn_ssl_allow_unsecured(pn_ssl_t *ssl)
{
  return true;
}

pn_ssl_resume_status_t pn_ssl_resume_status( pn_ssl_t *s )
{
  return PN_SSL_RESUME_UNKNOWN;
}

int pn_ssl_set_peer_hostname( pn_ssl_t *ssl, const char *hostname)
{
  return -1;
}

int pn_ssl_get_peer_hostname( pn_ssl_t *ssl, char *hostname, size_t *bufsize )
{
  return -1;
}

const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl)
{
  return NULL;
}

int pn_ssl_get_ssf(pn_ssl_t *ssl)
{
  return 0;
}


text:
package com.tallshorter.api.jenkins;

public class JobIdNotFoundException extends JenkinsClientException {

	private static final long serialVersionUID = -3434020295157547757L;

	public JobIdNotFoundException() {
	}

	public JobIdNotFoundException(String message) {
		super(message);
	}

	public JobIdNotFoundException(Throwable cause) {
		super(cause);
	}

	public JobIdNotFoundException(String message, Throwable cause) {
		super(message, cause);
	}

}


text:
package model;
import dataSet.*;//`ll be changed
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;
import view.UI.FileSaveUI;
import view.UI.Position;//`ll be changed
import java.io.File;
import java.util.List;
import java.util.ArrayList;
import model.*;

import javax.print.Doc;

/**
 * Created by Jisu on 6/7/2017.
 */
public class ModelTester {
    private Model model;

    public void setUp(){

    }

    @Test
    public void testCompare(){
        int caseNum = 1;
        File leftFile = new File("C:\\Users\\Jisu\\Desktop\\samples\\s" + caseNum + " left.txt");
        File rightFile = new File("C:\\Users\\Jisu\\Desktop\\samples\\s" + caseNum + " right.txt");
        TestCase test = new TestCase();

        test.initTestCompare(caseNum);

        //initialize model with testing input
        model = new Model(leftFile, rightFile);

        //get item
        Item item = model.compare();
        String[][] ListData = new String[2][];
        ListData[0] = item.getListViewItem(0);
        ListData[1] = item.getListViewItem(1);

        //create expected result
        int test_listActiveOrder = test.getListActiveOrder();    //true - 홀수  false - 짝수
        String[][] test_ListData = test.getComparedList();

        Assert.assertEquals(test_listActiveOrder, item.getListActiveOrder());
        Assert.assertEquals(test_ListData, ListData);
    }

    @Test
    //public Item merge(int idx, int lr);
    public boolean testMerge(){

        return true;
    }

    //public Item load(File f, int lr);
    //public Item load(String path, int lr);
    //public Item save(int lr);
    public boolean testLoad(){

        return true;
    }
    //public Item save(String data, int lr);
    //public Item save(List<String> data, int lr);
    public boolean testSave(){

        return true;
    }

    //public Item edit(String data, int lr);
    //public Item edit(List<String> data, int lr);
    public boolean testEdit(){

        return true;
    }

}


text:
package configure

import (
	"context"
	"os"

	"github.com/gravitational/kingpin"
	"github.com/gravitational/trace"
	"github.com/sirupsen/logrus"

	"github.com/gravitational/teleport"
	"github.com/gravitational/teleport/lib/auth"
	"github.com/gravitational/teleport/lib/service"
	"github.com/gravitational/teleport/lib/utils"
)

// SSOConfigureCommand implements common.CLICommand interface
type SSOConfigureCommand struct {
	Config       *service.Config
	ConfigureCmd *kingpin.CmdClause
	AuthCommands []*AuthKindCommand
	Logger       *logrus.Entry
}

type AuthKindCommand struct {
	Parsed bool
	Run    func(ctx context.Context, clt auth.ClientI) error
}

// Initialize allows a caller-defined command to plug itself into CLI
// argument parsing
func (cmd *SSOConfigureCommand) Initialize(app *kingpin.Application, cfg *service.Config) {
	cmd.Config = cfg
	cmd.Logger = cfg.Log.WithField(trace.Component, teleport.ComponentClient)

	sso := app.Command("sso", "A family of commands for configuring and testing auth connectors (SSO).")
	cmd.ConfigureCmd = sso.Command("configure", "Create auth connector configuration.")
	cmd.AuthCommands = []*AuthKindCommand{addGithubCommand(cmd)}
}

// TryRun is executed after the CLI parsing is done. The command must
// determine if selectedCommand belongs to it and return match=true
func (cmd *SSOConfigureCommand) TryRun(ctx context.Context, selectedCommand string, clt auth.ClientI) (match bool, err error) {
	for _, subCommand := range cmd.AuthCommands {
		if subCommand.Parsed {
			// the default tctl logging behavior is to ignore all logs, unless --debug is present.
			// we want different behavior: log messages as normal, but with compact format (no time, no caller info).
			if !cmd.Config.Debug {
				formatter := utils.NewDefaultTextFormatter(trace.IsTerminal(os.Stderr))
				formatter.FormatCaller = func() (caller string) { return "" }
				cmd.Logger.Logger.SetFormatter(formatter)
				cmd.Logger.Logger.SetOutput(os.Stderr)
			}

			return true, trace.Wrap(subCommand.Run(ctx, clt))
		}
	}

	return false, nil
}


text:
Describe $($PSCommandPath -Replace '.Tests.ps1') {

	BeforeAll {
		#Get Current Directory
		$Here = Split-Path -Parent $PSCommandPath

		#Assume ModuleName from Repository Root folder
		$ModuleName = Split-Path (Split-Path $Here -Parent) -Leaf

		#Resolve Path to Module Directory
		$ModulePath = Resolve-Path "$Here\..\$ModuleName"

		#Define Path to Module Manifest
		$ManifestPath = Join-Path "$ModulePath" "$ModuleName.psd1"

		if ( -not (Get-Module -Name $ModuleName -All)) {

			Import-Module -Name "$ManifestPath" -ArgumentList $true -Force -ErrorAction Stop

		}

		$Script:RequestBody = $null
		$Script:BaseURI = 'https://SomeURL/SomeApp'
		$Script:ExternalVersion = '0.0'
		$Script:WebSession = New-Object Microsoft.PowerShell.Commands.WebRequestSession

	}

	AfterAll {

		$Script:RequestBody = $null

	}

	InModuleScope $(Split-Path (Split-Path (Split-Path -Parent $PSCommandPath) -Parent) -Leaf ) {

		Context 'Gen1 Input' {

			BeforeEach {

				Mock Invoke-PASRestMethod -MockWith { }

				$InputObj = [pscustomobject]@{
					'SafeName' = 'SomeSafe'

				}

				$response = Get-PASSafeMember -SafeName SomeSafe -UseGen1API

			}

			It 'sends request' {

				Assert-MockCalled Invoke-PASRestMethod -Times 1 -Exactly -Scope It

			}

			It 'sends request to expected endpoint' {

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter {

					$URI -eq "$($Script:BaseURI)/WebServices/PIMServices.svc/Safes/SomeSafe/Members"

				} -Times 1 -Exactly -Scope It

			}

			It 'sends request to expected endpoint' {

				$response = $InputObj | Get-PASSafeMember -MemberName SomeMember -UseGen1API

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter {

					$URI -eq "$($Script:BaseURI)/WebServices/PIMServices.svc/Safes/SomeSafe/Members/SomeMember/"

				} -Times 1 -Exactly -Scope It

			}

			It 'uses expected GET method' {

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter { $Method -match 'GET' } -Times 1 -Exactly -Scope It

			}

			It 'uses expected PUT method' {

				$response = Get-PASSafeMember -SafeName SomeSafe -MemberName SomeMember -UseGen1API

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter { $Method -match 'PUT' } -Times 1 -Exactly -Scope It

			}

			It 'throws for PUT method if version exceeds 12.3' {

				$Script:ExternalVersion = '12.4'
				{ Get-PASSafeMember -SafeName SomeSafe -MemberName SomeMember -UseGen1API } | Should -Throw
				$Script:ExternalVersion = '0.0'

			}

			It 'sends request with no body' {

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter { $Body -eq $null } -Times 1 -Exactly -Scope It

			}

		}

		Context 'Gen2 Input' {

			BeforeEach {

				Mock Invoke-PASRestMethod -MockWith { }

				$InputObj = [pscustomobject]@{
					'SafeName' = 'SomeSafe'

				}

				$response = Get-PASSafeMember -SafeName SomeSafe

			}

			It 'sends request' {

				Assert-MockCalled Invoke-PASRestMethod -Times 1 -Exactly -Scope It

			}

			It 'sends request to expected endpoint' {

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter {

					$URI -eq "$($Script:BaseURI)/api/Safes/SomeSafe/Members"

				} -Times 1 -Exactly -Scope It

			}

			It 'sends request to expected endpoint' {

				Get-PASSafeMember -SafeName SomeSafe -MemberName SomeMember

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter {

					$URI -eq "$($Script:BaseURI)/api/Safes/SomeSafe/Members/SomeMember/"

				} -Times 1 -Exactly -Scope It

			}

			It 'sends expected query' {

				Get-PASSafeMember -SafeName SomeSafe -search SomeMember -memberType user

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter {

					($URI -eq "$($Script:BaseURI)/api/Safes/SomeSafe/Members?filter=memberType%20eq%20user&search=SomeMember") -or
					($URI -eq "$($Script:BaseURI)/api/Safes/SomeSafe/Members?search=SomeMember&filter=memberType%20eq%20user")

				} -Times 1 -Exactly -Scope It
			}

			It 'uses expected GET method' {

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter { $Method -match 'GET' } -Times 1 -Exactly -Scope It

			}

			It 'sends request with no body' {

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter { $Body -eq $null } -Times 1 -Exactly -Scope It

			}

			It 'throws error if version 12.0 requirement not met' {
				$Script:ExternalVersion = '1.0'
				{ Get-PASSafeMember -SafeName SomeSafe } | Should -Throw
				$Script:ExternalVersion = '0.0'
			}

			It 'throws error if version 12.1 requirement not met' {
				$Script:ExternalVersion = '12.0'
				{ Get-PASSafeMember -SafeName SomeSafe -search SomeMember } | Should -Throw
				$Script:ExternalVersion = '0.0'
			}

			It 'throws error if version 12.2 requirement not met' {
				$Script:ExternalVersion = '12.0'
				{ Get-PASSafeMember -SafeName SomeSafe -MemberName SomeMember } | Should -Throw
				$Script:ExternalVersion = '0.0'
			}

			It 'corrctly formats nexLink, Limit & Offset URL values' {

				Mock Invoke-PASRestMethod -MockWith {
					[PSCustomObject]@{
						'Count' = 52
						'Value' = @(
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							},
							[PSCustomObject]@{
								'safeUrlId'   = 'SomeSafe'
								'safeName'    = 'SomeSafe'
								'safeNumber'  = 37
								'permissions' = [PSCustomObject]@{}

							}
						)

					}

				}

				Get-PASSafeMember -SafeName SomeSafe -includePredefinedUsers $true

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter {

					($URI -eq "$($Script:BaseURI)/api/Safes/SomeSafe/Members?filter=includePredefinedUsers%20eq%20True")

				} -Times 1 -Exactly -Scope It

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter {

					($URI -eq "$($Script:BaseURI)/api/Safes/SomeSafe/Members?filter=includePredefinedUsers%20eq%20True&limit=25&OffSet=25")

				} -Times 1 -Exactly -Scope It

				Assert-MockCalled Invoke-PASRestMethod -ParameterFilter {

					($URI -eq "$($Script:BaseURI)/api/Safes/SomeSafe/Members?filter=includePredefinedUsers%20eq%20True&limit=25&OffSet=50")

				} -Times 1 -Exactly -Scope It

			}

		}

		Context 'Gen1 Output' {

			BeforeEach {

				Mock Invoke-PASRestMethod -MockWith {
					[PSCustomObject]@{
						'members' = [PSCustomObject]@{
							'UserName'    = 'SomeMember'
							'Permissions' = [pscustomobject]@{
								'Key1'            = $true
								'Key2'            = $true
								'FalseKey'        = $false
								'AnotherKey'      = $true
								'AnotherFalseKey' = $false
								'IntegerKey'      = 1
							}
						}
					}

				}

				$InputObj = [pscustomobject]@{
					'SafeName' = 'SomeSafe'

				}

				$response = $InputObj | Get-PASSafeMember -UseGen1API

			}

			It 'provides output' {

				$response | Should -Not -BeNullOrEmpty

			}

			It 'has output with expected number of properties' {

				($response | Get-Member -MemberType NoteProperty).length | Should -Be 3

			}

			It 'has expected number of nested permission properties' {

				($response.permissions | Get-Member -MemberType NoteProperty).count | Should -Be 6

			}

			It 'has expected boolean false property value' {

				$response.permissions.FalseKey | Should -Be $False

			}

			It 'has expected boolean true property value' {

				$response.permissions.Key1 | Should -Be $True

			}

			It 'has expected integer property value' {

				$response.permissions.IntegerKey | Should -Be 1

			}

			It 'outputs object with expected typename' {

				$response | Get-Member | Select-Object -ExpandProperty typename -Unique | Should -Be psPAS.CyberArk.Vault.Safe.Member

			}

			It 'outputs object with expected safename property' {

				$response.SafeName | Should -Be 'SomeSafe'

			}

			It 'outputs object with expected username property' {

				Mock Invoke-PASRestMethod -MockWith {
					[PSCustomObject]@{
						'member' = [PSCustomObject]@{
							'Permissions' = @(
								[pscustomobject]@{
									'Key'   = 'Key1'
									'Value' = $true
								},
								[pscustomobject]@{
									'Key'   = 'Key2'
									'Value' = $true
								},
								[pscustomobject]@{
									'Key'   = 'TrueKey'
									'Value' = $true
								},
								[pscustomobject]@{
									'Key'   = 'FalseKey'
									'Value' = $false
								},
								[pscustomobject]@{
									'Key'   = 'AnotherKey'
									'Value' = $true
								},
								[pscustomobject]@{
									'Key'   = 'AnotherFalseKey'
									'Value' = $false
								}

							)
						}
					}

				}

				$response = $InputObj | Get-PASSafeMember -MemberName SomeMember -UseGen1API

				$response.UserName | Should -Be 'SomeMember'

			}

		}

		Context 'Gen2 Output' {

			BeforeEach {

				Mock Invoke-PASRestMethod -MockWith {
					[PSCustomObject]@{
						'Count' = 1
						'Value' = @(
							[PSCustomObject]@{
								'safeUrlId'                 = 'SomeSafe'
								'safeName'                  = 'SomeSafe'
								'safeNumber'                = 37
								'memberId'                  = 0
								'memberName'                = 'SomeMember'
								'memberType'                = 'User'
								'membershipExpirationDate'  = $null
								'isExpiredMembershipEnable' = $false
								'isPredefinedUser'          = $true
								'permissions'               = [PSCustomObject]@{
									'useAccounts'                            = $true
									'retrieveAccounts'                       = $true
									'listAccounts'                           = $true
									'addAccounts'                            = $true
									'updateAccountContent'                   = $true
									'updateAccountProperties'                = $true
									'initiateCPMAccountManagementOperations' = $true
									'specifyNextAccountContent'              = $true
									'renameAccounts'                         = $true
									'deleteAccounts'                         = $true
									'unlockAccounts'                         = $true
									'manageSafe'                             = $true
									'manageSafeMembers'                      = $true
									'backupSafe'                             = $true
									'viewAuditLog'                           = $true
									'viewSafeMembers'                        = $true
									'accessWithoutConfirmation'              = $true
									'createFolders'                          = $true
									'deleteFolders'                          = $true
									'moveAccountsAndFolders'                 = $true
									'requestsAuthorizationLevel1'            = $false
									'requestsAuthorizationLevel2'            = $false
								}

							}
						)

					}

				}

				$InputObj = [pscustomobject]@{
					'SafeName' = 'SomeSafe'
				}

				$response = $InputObj | Get-PASSafeMember

			}

			It 'provides output' {

				$response | Should -Not -BeNullOrEmpty

			}

			It 'has output with expected number of properties' {

				($response | Get-Member -MemberType NoteProperty).length | Should -Be 11

			}

			It 'has expected number of nested permission properties' {

				($response.permissions | Get-Member -MemberType NoteProperty).count | Should -Be 22

			}

			It 'has expected boolean false property value' {

				$response.permissions.requestsAuthorizationLevel1 | Should -Be $False

			}

			It 'has expected boolean true property value' {

				$response.permissions.createFolders | Should -Be $True

			}

			It 'outputs object with expected typename' {

				$response | Get-Member | Select-Object -ExpandProperty typename -Unique | Should -Be psPAS.CyberArk.Vault.Safe.Member.Gen2

			}

		}

	}

}


text:
package debugger;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

import java.net.URI;
import java.net.URISyntaxException;

import org.hamcrest.core.IsInstanceOf;
import org.junit.Test;

import com.google.gson.Gson;

import tools.SourceCoordinate;
import tools.SourceCoordinate.FullSourceCoordinate;
import tools.debugger.WebDebugger;
import tools.debugger.entities.ActivityType;
import tools.debugger.entities.BreakpointType;
import tools.debugger.entities.DynamicScopeType;
import tools.debugger.entities.EntityType;
import tools.debugger.entities.Implementation;
import tools.debugger.entities.PassiveEntityType;
import tools.debugger.entities.ReceiveOp;
import tools.debugger.entities.SendOp;
import tools.debugger.entities.SteppingType;
import tools.debugger.message.InitializationResponse;
import tools.debugger.message.InitializeConnection;
import tools.debugger.message.Message.IncommingMessage;
import tools.debugger.message.Message.OutgoingMessage;
import tools.debugger.message.UpdateBreakpoint;
import tools.debugger.session.BreakpointInfo;
import tools.debugger.session.LineBreakpoint;
import tools.debugger.session.SectionBreakpoint;

public class JsonTests {
  private final Gson gson = WebDebugger.createJsonProcessor();

  private static final String               FULL_COORD     =
      "{\"uri\":\"file:/test\",\"startLine\":2,\"startColumn\":3,\"charLength\":55}";
  private static final FullSourceCoordinate FULL_COORD_OBJ =
      SourceCoordinate.create("file:/test", 2, 3, 55);

  private void assertFullCoord(final FullSourceCoordinate coord) {
    assertEquals(2, coord.startLine);
    assertEquals(3, coord.startColumn);
    assertEquals(55, coord.charLength);
  }

  @Test
  public void fullCoordDeserialize() {
    FullSourceCoordinate coord = gson.fromJson(FULL_COORD, FullSourceCoordinate.class);
    assertFullCoord(coord);
  }

  @Test
  public void fullCoordSerialize() {
    String result = gson.toJson(FULL_COORD_OBJ);
    assertEquals(FULL_COORD, result);
  }

  private static final String LINE_BP =
      "{\"sourceUri\":\"file:/test\",\"line\":21,\"enabled\":true,\"type\":\"LineBreakpoint\"}";

  private void assertLineBreakpoint(final LineBreakpoint bp) {
    assertEquals(21, bp.getLine());
    assertTrue(bp.isEnabled());
    assertEquals("file:/test", bp.getURI().toString());
  }

  @Test
  public void lineBreakpointDeserialize() {
    BreakpointInfo result = gson.fromJson(LINE_BP, BreakpointInfo.class);
    assertThat(result, new IsInstanceOf(LineBreakpoint.class));

    LineBreakpoint bp = (LineBreakpoint) result;
    assertLineBreakpoint(bp);
  }

  @Test
  public void lineBreakpointSerialize() throws URISyntaxException {
    LineBreakpoint bp = new LineBreakpoint(true, new URI("file:/test"), 21);
    String result = gson.toJson(bp, BreakpointInfo.class);
    assertEquals(LINE_BP, result);
  }

  private static final String MSG_RCV_BP = "{\"coord\":" + FULL_COORD
      + ",\"bpType\":\"msgReceiverBP\",\"enabled\":true,\"type\":\"SectionBreakpoint\"}";

  @Test
  public void messageReceiverBreakpointDeserialize() {
    BreakpointInfo bp = gson.fromJson(MSG_RCV_BP, BreakpointInfo.class);
    assertThat(bp, new IsInstanceOf(SectionBreakpoint.class));
    assertTrue(bp.isEnabled());
    assertFullCoord(((SectionBreakpoint) bp).getCoordinate());
    assertSame(((SectionBreakpoint) bp).getType(), BreakpointType.MSG_RECEIVER);
  }

  @Test
  public void messageReceiverBreakpointSerialize() {
    SectionBreakpoint bp =
        new SectionBreakpoint(true, FULL_COORD_OBJ, BreakpointType.MSG_RECEIVER);
    assertEquals(MSG_RCV_BP, gson.toJson(bp, BreakpointInfo.class));
  }

  private static final String MSG_SND_BP = "{\"coord\":" + FULL_COORD
      + ",\"bpType\":\"msgSenderBP\",\"enabled\":true,\"type\":\"SectionBreakpoint\"}";

  @Test
  public void messageSenderBreakpointDeserialize() {
    BreakpointInfo bp = gson.fromJson(MSG_SND_BP, BreakpointInfo.class);
    assertThat(bp, new IsInstanceOf(SectionBreakpoint.class));

    assertFullCoord(((SectionBreakpoint) bp).getCoordinate());
    assertTrue(((SectionBreakpoint) bp).isEnabled());
    assertSame(((SectionBreakpoint) bp).getType(), BreakpointType.MSG_SENDER);
  }

  @Test
  public void messageSenderBreakpointSerialize() {
    String result = gson.toJson(
        new SectionBreakpoint(true, FULL_COORD_OBJ, BreakpointType.MSG_SENDER),
        BreakpointInfo.class);
    assertEquals(MSG_SND_BP, result);
  }

  private static final String ASYNC_MSG_RCV_BP = "{\"coord\":" + FULL_COORD
      + ",\"enabled\":true,\"type\":\"SectionBreakpoint\",\"bpType\":\"asyncMsgBeforeExecBP\"}";

  private static final String EMPTY_INITAL_BP =
      "{\"breakpoints\":[],\"action\":\"InitializeConnection\"}";

  @Test
  public void initialBreakpointsMessageEmptySerialize() {
    InitializeConnection result = new InitializeConnection(new BreakpointInfo[0]);
    String json = gson.toJson(result, IncommingMessage.class);
    assertEquals(EMPTY_INITAL_BP, json);
  }

  @Test
  public void initialBreakpointsMessageEmptyDeserialize() {
    IncommingMessage result = gson.fromJson(EMPTY_INITAL_BP, IncommingMessage.class);
    assertThat(result, new IsInstanceOf(InitializeConnection.class));
    assertArrayEquals(new BreakpointInfo[0],
        ((InitializeConnection) result).getBreakpoints());
  }

  private static final String INITIAL_NON_EMPTY_BREAKPOINT_MSG =
      "{\"action\":\"InitializeConnection\",\"breakpoints\":" +
          "[" + ASYNC_MSG_RCV_BP + "," + MSG_RCV_BP + "," + MSG_SND_BP + "," + LINE_BP + "]}";

  @Test
  public void initialBreakpointsMessageWithBreakPointsDeserialize() {
    IncommingMessage result = gson.fromJson(
        INITIAL_NON_EMPTY_BREAKPOINT_MSG, IncommingMessage.class);
    InitializeConnection r = (InitializeConnection) result;
    BreakpointInfo[] bps = r.getBreakpoints();
    assertThat(bps[0], new IsInstanceOf(SectionBreakpoint.class));
    assertSame(((SectionBreakpoint) bps[0]).getType(), BreakpointType.ASYNC_MSG_BEFORE_EXEC);
    assertThat(bps[1], new IsInstanceOf(SectionBreakpoint.class));
    assertSame(((SectionBreakpoint) bps[1]).getType(), BreakpointType.MSG_RECEIVER);
    assertThat(bps[2], new IsInstanceOf(SectionBreakpoint.class));
    assertSame(((SectionBreakpoint) bps[2]).getType(), BreakpointType.MSG_SENDER);
    assertThat(bps[3], new IsInstanceOf(LineBreakpoint.class));
    assertEquals(4, bps.length);
  }

  private static final String UPDATE_LINE_BP =
      "{\"breakpoint\":" + LINE_BP + ",\"action\":\"updateBreakpoint\"}";

  @Test
  public void updateBreakpointDeserialize() {
    UpdateBreakpoint result = (UpdateBreakpoint) gson.fromJson(
        UPDATE_LINE_BP, IncommingMessage.class);
    assertThat(result.getBreakpoint(), new IsInstanceOf(LineBreakpoint.class));
    LineBreakpoint bp = (LineBreakpoint) result.getBreakpoint();
    assertLineBreakpoint(bp);
  }

  @Test
  public void updateBreakpointSerialize() {
    String result = gson.toJson(
        gson.fromJson(UPDATE_LINE_BP, IncommingMessage.class), IncommingMessage.class);
    assertEquals(UPDATE_LINE_BP, result);
  }

  @Test
  public void initializeResponseSerialize() {
    String result = gson.toJson(InitializationResponse.create(
        EntityType.values(), ActivityType.values(), PassiveEntityType.values(),
        DynamicScopeType.values(), SendOp.values(), ReceiveOp.values(),
        BreakpointType.values(), SteppingType.values(), Implementation.values()),
        OutgoingMessage.class);
    // This test is only doing a very basic sanity check
    assertTrue(1000 < result.length());
  }
}


text:
package org.w3c.domts.level2.core;

import org.junit.jupiter.api.Test;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.w3c.domts.DOMTest.load;

/**
 * The method setPrefix raises a NAMESPACE_ERR if the specified prefix is malformed.
 * Create a new namespace aware element node and call the setPrefix method on it with several malformed
 * prefix values.  Check if a NAMESPACE_ERR is thrown.
 *
 * @see http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix
 */
public class nodesetprefix05 {
    @Test
    void testRun() throws Throwable {
        ;
        String[] prefixValues = { "_:", ":0", ":", "_::", "a:0:c" };

        Document doc = load("staffNS", true);
        Element element = doc.createElementNS("http://www.w3.org/DOM/Test/L2", "dom:elem");
        for (String prefixValue : prefixValues) {
            DOMException ex = assertThrows(DOMException.class, () -> element.setPrefix(prefixValue));
            assertEquals(DOMException.NAMESPACE_ERR, ex.code, "nodesetprefix05");
        }
    }

    /**
     * Gets URI that identifies the test
     *
     * @return uri identifier of test
     */
    public String getTargetURI() {
        return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/nodesetprefix05";
    }

}


text:
import sys
from server.main import main
from .db import run_script as sql
from .trade.player import run_script as play
from .tinkoff import main as api
import logging

logger = logging.getLogger(__name__)

if len(sys.argv) > 1:
    prog = sys.argv[1]
    if prog == 'api':
        api()
    elif prog == 'sql':
        sql()
    elif prog == 'play':
        play()
    else:
        print('NO Action! main start')
        main()
else:
    main()


text:
require 'zlib'

module Newsman
  class UrlNormalizer
    def normalize(url)
      begin
        u = URI.parse(url)
        return nil if u.host.nil?

        canonicalize_host(u) + canonicalize_path(u) + canonicalize_query(u)
      rescue
        nil
      end
    end

    def crc32(str)
      Zlib.crc32(str)
    end

    def canonicalize_host(uri)
      uri.host.sub(/^www\./, '')
    end

    def canonicalize_path(uri)
      strip_trailing_slash uri
    end

    def canonicalize_query(uri)
      uri.query ? "?" + strip_utm(uri) : ''
    end

    def strip_utm(uri)
      uri.query.split('&').reject { |a| a.start_with?("utm_") } * "&"
    end

    def strip_trailing_slash(uri)
      if uri.query
        uri.path
      else
        uri.path.chomp('/')
      end
    end
  end
end


text:
/* $Id$ */

package org.apache.fop.fo;

import static org.junit.Assert.assertArrayEquals;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamSource;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.FODocumentParser.FOEventHandlerFactory;
import org.apache.fop.fo.flow.BasicLink;
import org.apache.fop.fo.flow.Block;
import org.apache.fop.fo.flow.BlockContainer;
import org.apache.fop.fo.flow.Character;
import org.apache.fop.fo.flow.ExternalGraphic;
import org.apache.fop.fo.flow.Footnote;
import org.apache.fop.fo.flow.FootnoteBody;
import org.apache.fop.fo.flow.Inline;
import org.apache.fop.fo.flow.InstreamForeignObject;
import org.apache.fop.fo.flow.Leader;
import org.apache.fop.fo.flow.ListBlock;
import org.apache.fop.fo.flow.ListItem;
import org.apache.fop.fo.flow.ListItemBody;
import org.apache.fop.fo.flow.ListItemLabel;
import org.apache.fop.fo.flow.PageNumber;
import org.apache.fop.fo.flow.PageNumberCitation;
import org.apache.fop.fo.flow.PageNumberCitationLast;
import org.apache.fop.fo.flow.Wrapper;
import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.fo.flow.table.TableBody;
import org.apache.fop.fo.flow.table.TableCell;
import org.apache.fop.fo.flow.table.TableColumn;
import org.apache.fop.fo.flow.table.TableFooter;
import org.apache.fop.fo.flow.table.TableHeader;
import org.apache.fop.fo.flow.table.TableRow;
import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.pagination.Root;
import org.apache.fop.fo.pagination.StaticContent;

/**
 * Tests that {@link DelegatingFOEventHandler} does forward every event to its delegate
 * event handler.
 */
public class DelegatingFOEventHandlerTestCase {

    private InputStream document;

    private List<String> expectedEvents;

    private List<String> actualEvents;

    private FODocumentParser documentParser;

    private class DelegatingFOEventHandlerTester extends FOEventHandler {

        DelegatingFOEventHandlerTester(FOUserAgent foUserAgent) {
            super(foUserAgent);
        }

        private final StringBuilder eventBuilder = new StringBuilder();

        @Override
        public void startDocument() throws SAXException {
            actualEvents.add("start document");
        }

        @Override
        public void endDocument() throws SAXException {
            actualEvents.add("end   document");
        }

        @Override
        public void startRoot(Root root) {
            startElement(root);
        }

        @Override
        public void endRoot(Root root) {
            endElement(root);
        }

        @Override
        public void startPageSequence(PageSequence pageSeq) {
            startElement(pageSeq);
        }

        @Override
        public void endPageSequence(PageSequence pageSeq) {
            endElement(pageSeq);
        }

        @Override
        public void startPageNumber(PageNumber pagenum) {
            startElement(pagenum);
        }

        @Override
        public void endPageNumber(PageNumber pagenum) {
            endElement(pagenum);
        }

        @Override
        public void startPageNumberCitation(PageNumberCitation pageCite) {
            startElement(pageCite);
        }

        @Override
        public void endPageNumberCitation(PageNumberCitation pageCite) {
            endElement(pageCite);
        }

        @Override
        public void startPageNumberCitationLast(PageNumberCitationLast pageLast) {
            startElement(pageLast);
        }

        @Override
        public void endPageNumberCitationLast(PageNumberCitationLast pageLast) {
            endElement(pageLast);
        }

        @Override
        public void startFlow(Flow fl) {
            startElement(fl);
        }

        @Override
        public void endFlow(Flow fl) {
            endElement(fl);
        }

        @Override
        public void startBlock(Block bl) {
            startElement(bl);
        }

        @Override
        public void endBlock(Block bl) {
            endElement(bl);
        }

        @Override
        public void startBlockContainer(BlockContainer blc) {
            startElement(blc);
        }

        @Override
        public void endBlockContainer(BlockContainer blc) {
            endElement(blc);
        }

        @Override
        public void startInline(Inline inl) {
            startElement(inl);
        }

        @Override
        public void endInline(Inline inl) {
            endElement(inl);
        }

        @Override
        public void startTable(Table tbl) {
            startElement(tbl);
        }

        @Override
        public void endTable(Table tbl) {
            endElement(tbl);
        }

        @Override
        public void startColumn(TableColumn tc) {
            startElement(tc);
        }

        @Override
        public void endColumn(TableColumn tc) {
            endElement(tc);
        }

        @Override
        public void startHeader(TableHeader header) {
            startElement(header);
        }

        @Override
        public void endHeader(TableHeader header) {
            endElement(header);
        }

        @Override
        public void startFooter(TableFooter footer) {
            startElement(footer);
        }

        @Override
        public void endFooter(TableFooter footer) {
            endElement(footer);
        }

        @Override
        public void startBody(TableBody body) {
            startElement(body);
        }

        @Override
        public void endBody(TableBody body) {
            endElement(body);
        }

        @Override
        public void startRow(TableRow tr) {
            startElement(tr);
        }

        @Override
        public void endRow(TableRow tr) {
            endElement(tr);
        }

        @Override
        public void startCell(TableCell tc) {
            startElement(tc);
        }

        @Override
        public void endCell(TableCell tc) {
            endElement(tc);
        }

        @Override
        public void startList(ListBlock lb) {
            startElement(lb);
        }

        @Override
        public void endList(ListBlock lb) {
            endElement(lb);
        }

        @Override
        public void startListItem(ListItem li) {
            startElement(li);
        }

        @Override
        public void endListItem(ListItem li) {
            endElement(li);
        }

        @Override
        public void startListLabel(ListItemLabel listItemLabel) {
            startElement(listItemLabel);
        }

        @Override
        public void endListLabel(ListItemLabel listItemLabel) {
            endElement(listItemLabel);
        }

        @Override
        public void startListBody(ListItemBody listItemBody) {
            startElement(listItemBody);
        }

        @Override
        public void endListBody(ListItemBody listItemBody) {
            endElement(listItemBody);
        }

        @Override
        public void startStatic(StaticContent staticContent) {
            startElement(staticContent);
        }

        @Override
        public void endStatic(StaticContent statisContent) {
            endElement(statisContent);
        }

        @Override
        public void startLink(BasicLink basicLink) {
            startElement(basicLink);
        }

        @Override
        public void endLink(BasicLink basicLink) {
            endElement(basicLink);
        }

        @Override
        public void image(ExternalGraphic eg) {
            startElement(eg);
            endElement(eg);
        }

        @Override
        public void startInstreamForeignObject(InstreamForeignObject ifo) {
            startElement(ifo);
        }

        @Override
        public void endInstreamForeignObject(InstreamForeignObject ifo) {
            endElement(ifo);
        }

        @Override
        public void startFootnote(Footnote footnote) {
            startElement(footnote);
        }

        @Override
        public void endFootnote(Footnote footnote) {
            endElement(footnote);
        }

        @Override
        public void startFootnoteBody(FootnoteBody body) {
            startElement(body);
        }

        @Override
        public void endFootnoteBody(FootnoteBody body) {
            endElement(body);
        }

        @Override
        public void startLeader(Leader l) {
            startElement(l);
        }

        @Override
        public void endLeader(Leader l) {
            endElement(l);
        }

        @Override
        public void startWrapper(Wrapper wrapper) {
            startElement(wrapper);
        }

        @Override
        public void endWrapper(Wrapper wrapper) {
            endElement(wrapper);
        }

        @Override
        public void character(Character c) {
            startElement(c);
            endElement(c);
        }

        private void startElement(FObj node) {
            addEvent("start ", node);
        }

        private void endElement(FObj node) {
            addEvent("end   ", node);
        }

        private void addEvent(String event, FObj node) {
            eventBuilder.append(event);
            eventBuilder.append(node.getLocalName());
            addID(node);
            actualEvents.add(eventBuilder.toString());
            eventBuilder.setLength(0);
        }

        private void addID(FObj node) {
            String id = node.getId();
            if (id != null && id.length() > 0) {
                eventBuilder.append(" id=\"");
                eventBuilder.append(id);
                eventBuilder.append("\"");
            }
        }
    }

    @Before
    public void setUp() throws IOException {
        setUpEvents();
        loadDocument();
        createDocumentParser();
    }

    private void setUpEvents() throws IOException {
        loadDocument();
        loadExpectedEvents();
        actualEvents = new ArrayList<String>(expectedEvents.size());
    }

    private void loadDocument() {
        document = getClass().getResourceAsStream("complete_document.fo");
    }

    private void loadExpectedEvents() throws IOException {
        expectedEvents = new ArrayList<String>();
        InputStream xslt = getClass().getResourceAsStream("extract-events.xsl");
        try {
            runXSLT(xslt);
        } finally {
            closeStream(xslt);
            closeStream(document);
        }
    }

    private void runXSLT(InputStream xslt) {
        Transformer transformer = createTransformer(xslt);
        Source fo = new StreamSource(document);
        Result result = createTransformOutputHandler();
        try {
            transformer.transform(fo, result);
        } catch (TransformerException e) {
            throw new RuntimeException(e);
        }
    }

    private Transformer createTransformer(InputStream xslt) {
        TransformerFactory transformerFactory = TransformerFactory.newInstance();
        try {
            return transformerFactory.newTransformer(new StreamSource(xslt));
        } catch (TransformerConfigurationException e) {
            throw new RuntimeException(e);
        }
    }

    private Result createTransformOutputHandler() {
        return new SAXResult(new DefaultHandler() {

            private final StringBuilder event = new StringBuilder();

            @Override
            public void startElement(String uri, String localName, String qName,
                    Attributes attributes) throws SAXException {
                event.setLength(0);
            }

            @Override
            public void characters(char[] ch, int start, int length) throws SAXException {
                event.append(ch, start, length);
            }

            @Override
            public void endElement(String uri, String localName, String qName) throws SAXException {
                expectedEvents.add(event.toString());
            }

        });
    }

    private void closeStream(InputStream stream) {
        try {
            stream.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    private void createDocumentParser() {
        documentParser = FODocumentParser.newInstance(new FOEventHandlerFactory() {

            public FOEventHandler newFOEventHandler(FOUserAgent foUserAgent) {
                return new DelegatingFOEventHandler(
                        new DelegatingFOEventHandlerTester(foUserAgent)) {
                };
            }
        });
    }

    @Test
    public void testFOEventHandler() throws Exception {
        documentParser.parse(document);
        assertArrayEquals(expectedEvents.toArray(), actualEvents.toArray());
    }

    @After
    public void unloadDocument() throws IOException {
        document.close();
    }

    /**
     * Prints the given list to {@code System.out}, each element on a new line. For
     * debugging purpose.
     *
     * @param list a list
     */
    public void printList(List<?> list) {
        for (Object element : list) {
            System.out.println(element);
        }
    }

}


text:
prevproc
========

Arquivos do artigo "Previsão dos resultados dos processos" do blog da jurimetria


text:
<!--
  ~ Copyright 2015, Tom Praschan
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<de.tap.easy_xkcd.misc.HackyDrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:animateLayoutChanges="true"
        android:orientation="vertical">

        <include
            android:id="@+id/toolbar"
            layout="@layout/tool_bar" />

        <FrameLayout
            android:id="@+id/flContent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_below="@id/toolbar" />
        <!-- above tvalt -->

        <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/main_content"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <com.google.android.material.floatingactionbutton.FloatingActionButton
                android:id="@+id/fab"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentRight="true"
                android:layout_gravity="bottom|right|end"
                android:layout_margin="16dp"
                app:elevation="4dp"
                app:borderWidth="0dp"
                android:src="@drawable/ic_outline_shuffle_24dp"
                app:fabSize="normal" />
        </androidx.coordinatorlayout.widget.CoordinatorLayout>

    </RelativeLayout>

    <!-- The navigation drawer -->
    <com.google.android.material.navigation.NavigationView
        android:id="@+id/nvView"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@android:color/white"
        app:headerLayout="@layout/nav_header"
        app:menu="@menu/drawer_view" />

</de.tap.easy_xkcd.misc.HackyDrawerLayout>


text:
<head>
  <meta charset="utf-8">
  <title>${ page.title ? page.title + ' - ' : ''}${site.title}</title>
  <meta name="author" content="${site.author}">
  <% if (page.description) { %>
    <meta name='description' content='${page.description}'>
  <% } %>
  <% if (page.keywords) { %>
    <meta name='description' content='${page.keywords}'>
  <% } %>
  <!-- http://t.co/dKP3o1e -->
  <meta name="HandheldFriendly" content="True">
  <meta name="MobileOptimized" content="320">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="canonical" href="${site.url + page.url}">
  <link href="${r '/images/favicon.png'}" rel="icon">
  <link href="${r '/stylesheets/screen.css'}" media="screen, projection" rel="stylesheet" type="text/css">
  <link href="${site.rss.feed}" rel="alternate" title="${site.title}" type="application/atom+xml">
  <% rs(['/javascripts/libs/jquery.min.js',
    '/javascripts/modernizr-2.0.js',
    '/javascripts/octopress.js',
    '/javascripts/github.js',
    '/javascripts/jquery.tweet.js',
    '/javascripts/twitter-options.js']).each { script -> %>
    <script src="${script}" type="text/javascript"></script>
  <% } %>
  ${include 'google_analytics.html'}
  ${include 'custom/head.html'}
</head>


text:
<!DOCTYPE html>

<link rel="canonical" href="{{ page.redirect_to }}"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="0;url={{ page.redirect_to }}" />

Redirecting...

      Click here if you are not redirected.


text:
import * as express from 'express';
import * as passport from 'passport';
import { BasicStrategy } from 'passport-http';
import { Server } from 'typescript-rest';
import { Service as AuthorizationService } from '../platform/domain/authorization';

export class ApiServer {

    public static bootStrap(): ApiServer {
        const server: ApiServer = new ApiServer();
        Server.useIoC();

        return server;
    }

    private app: express.Application;
    private controllers: any[];

    public createApplication(): ApiServer {
        this.app = express();

        return this;
    }

    public use(...handlers: express.RequestHandler[]): ApiServer {
        this.app.use(handlers);

        return this;
    }

    public usePassport(): ApiServer {
        passport.use(new BasicStrategy((username, password, done) => {
            const service: AuthorizationService = new AuthorizationService();
            service.verifyCredentials(username, password)
                .then(user => done(null, user))
                .catch(reason => done(null, false));
        }));

        return this;
    }

    public useAuthorizationOn(path: string, strategyName = 'basic'): ApiServer {
        this.app.all(path,
            passport.authenticate(strategyName, { session: false }),
            (req, res, next) => next());

        return this;
    }

    public buildServices(): ApiServer {
        Server.buildServices(this.app);

        return this;
    }

    public registerControllers(...controllers: any[]): ApiServer {
        this.controllers = controllers;

        return this;
    }

    /* tslint:disable-next-line */
    public listen(port: number, callback: Function = () => console.log(`API server listing on port ${port}`)): void {
        this.app.listen(port, callback);
    }

}


text:
.header {
  --box-shadow-color: hsla(var(--theme-hue), var(--gray-saturation), 10%, 0.18);

  background: var(--color-blue-dark);
  box-shadow: 0 0 3px var(--box-shadow-color), 0 2px 4px var(--box-shadow-color),
    0 4px 5px var(--box-shadow-color), 0 6px 6px var(--box-shadow-color);
  position: relative;
  padding: var(--space-2) calc((100% - var(--max-width)) / 2 - var(--space-2));
}

.header h1 {
  font-size: var(--font-size-2);
  margin: 0;
}

.header > div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 var(--space-2);
}

.header__button {
  -webkit-tap-highlight-color: transparent;
  margin: 0 1rem;
  outline: 0;
  stroke: var(--color-ground);
  transition-duration: var(--time-0);
  transition-property: opacity, transform;
  transition-timing-function: var(--easing-standard);
}
@media (min-width: 768px) {
  .header__button:focus,
  .header__button:hover {
    transform: rotate(45deg) scale(1.1);
  }
}

.header__button--delay {
  transition-delay: var(--time-0);
}

.header__button:disabled {
  opacity: 0.67;
  transform: rotate(180deg) scale(0);
}

.header__button:last-child:disabled {
  transform: rotate(-180deg) scale(0);
}

.header__button svg {
  --size: calc(4em / 3);

  height: var(--size);
  width: var(--size);
}


text:
import enum

class Automated(enum.Enum):

    def __new__(cls):
        value = len(cls.__members__) + 1
        object_ = object.__new__(cls)
        object_._value_ = value
        return object_


text:
package javas.socket;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;

/**
 * UDP
 * DatagramSocketServer
 *
 * @author sunny
 * @version 1.0.0
 * @since 2015-07-21
 */
@SuppressWarnings("ALL")
public class DatagramSocketServer {

    public static final Integer PORT = 2015;

    public static void main(String[] args) {
        try {
            //启动服务端
            DatagramSocket socket = new DatagramSocket(PORT);

            //接收数据
            DatagramPacket datagramPacket = new DatagramPacket(new byte[1024], 1024);
            while (true) {
                socket.receive(datagramPacket);
                String message = new String(datagramPacket.getData(), "UTF-8");
                System.out.println("server receive data is " + message);
            }
        } catch (SocketException e) {
            System.out.println(e.getMessage());
        } catch (IOException e) {
            System.out.println(e.getMessage());
        }
    }

}


text:
%% Support code for qualitative comparison
% Rank all of the sequences by PCK@15px averaged over wrists, elbows and
% shoulders to find some really terrible detections. I'd also like to find
% some frames which are individually terrible.

%% Startup code
pck_thresh = 15;
addpath ./eval/
addpath ./visualization/
addpath ./utils/
config = set_algo_parameters();
piw_data = get_piw_data('piw', config.data_path);
seqs = dir(config.data_path); seqs = seqs(3:end);
detected_pose_type = struct('seq', {}, 'filename', {}, 'frame', {}, 'bestpose',{});
detected_pose_seqs = repmat(detected_pose_type, [1,1,1]);
all_detections = []; gt_all = []; mov = 1;
seq_pck = zeros(length(seqs), 11);

%% Now go over the whole sequence
for s=1:length(seqs)
    fprintf('Attempting for sequence %s (#%i)\n', seqs(s).name, s);
    seq_dir = [config.data_path seqs(s).name '/'];
    frames = dir([seq_dir '/*.png']);
    gt = get_groundtruth_for_seq(frames, piw_data);
    gt_all = [gt_all, gt];
    load([config.data_store_path 'detected_poses_' seqs(s).name], 'detected_poses');

    for i=1:length(frames)
        detected_pose_seqs(mov, s, i).seq = seqs(s).name;
        detected_pose_seqs(mov, s, i).filename = frames(i).name;
        detected_pose_seqs(mov, s, i).frame = get_framenum(frames(i).name);

        if ~isempty(detected_poses)
            detected_pose_seqs(mov, s, i).bestpose = detected_poses(i,:);
        else
            detected_pose_seqs(mov, s, i).bestpose = [];
        end
    end

    seq_pck(s, :) = evaluate_pose_seqs(detected_pose_seqs(:, s:s, :), gt, pck_thresh);
end

% Average out shoulder, elbow and wrist accuracy
mean_seq_pcks = mean(seq_pck(:, [2 7 4 9 6 11]), 2);
[~, worst_idxs] = sort(mean_seq_pcks);
fprintf('Worst sequences (by mean PCK of wrists, shoulders and elbows)\n');
for i=worst_idxs'
    fprintf('Sequence %s: %f%%\n', seqs(i).name, mean_seq_pcks(i)*100);
end


text:
<?php

/* FOSUserBundle:Registration:email.txt.twig */
class __TwigTemplate_d8103abc2604ddd17a780f297bf9f97f extends Twig_Template
{
    protected function doDisplay(array $context, array $blocks = array())
    {
        $context = array_merge($this->env->getGlobals(), $context);

        // line 2
        echo $this->env->getExtension('translator')->trans("registration.email", array("%username%" => $this->getAttribute($this->getContext($context, 'user'), "username", array(), "any", false), "%confirmationUrl%" => $this->getContext($context, 'confirmationUrl')), "FOSUserBundle");
        echo "
";
    }

    public function getTemplateName()
    {
        return "FOSUserBundle:Registration:email.txt.twig";
    }

    public function isTraitable()
    {
        return false;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#212121</color>
    <color name="colorPrimaryDark">#000000</color>
    <color name="colorAccent">#FF4081</color>
</resources>


text:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2011. All Rights Reserved.							  */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib.  */
/*----------------------------------------------------------------------------*/

#include "KinectStick.h"

#include "DriverStation.h"
#include "Joystick.h"
#include "NetworkCommunication/FRCComm.h"
#include "NetworkCommunication/UsageReporting.h"
#include "Utility.h"
#include "WPIErrors.h"

uint32_t KinectStick::_recentPacketNumber = 0;
KinectStick::KinectStickData KinectStick::_sticks;

#define kJoystickBundleID kFRC_NetworkCommunication_DynamicType_Kinect_Joystick
#define kTriggerMask 1
#define kTopMask 2

/**
 * Kinect joystick constructor
 * @param id value is either 1 or 2 for the left or right joystick decoded from
 * gestures interpreted by the Kinect server on the Driver Station computer.
 */
KinectStick::KinectStick(int id)
{
	if (id != 1 && id != 2)
	{
		wpi_setWPIErrorWithContext(ParameterOutOfRange, "KinectStick ID must be 1 or 2");
		return;
	}
	m_id = id;

	nUsageReporting::report(nUsageReporting::kResourceType_KinectStick, id);
}

/**
 * Get the X value of the KinectStick. This axis
 * is unimplemented in the default gestures but can
 * be populated by teams editing the Kinect Server.
 * @param hand Unused
 * @return The X value of the KinectStick
 */
float KinectStick::GetX(JoystickHand hand)
{
	return GetRawAxis(Joystick::kDefaultXAxis);
}

/**
 * Get the Y value of the KinectStick. This axis
 * represents arm angle in the default gestures
 * @param hand Unused
 * @return The Y value of the KinectStick
 */
float KinectStick::GetY(JoystickHand hand)
{
	return GetRawAxis(Joystick::kDefaultYAxis);
}

/**
 * Get the Z value of the KinectStick. This axis
 * is unimplemented in the default gestures but can
 * be populated by teams editing the Kinect Server.
 * @param hand Unused
 * @return The Z value of the KinectStick
 */
float KinectStick::GetZ()
{
	return GetRawAxis(Joystick::kDefaultZAxis);
}

/**
 * Get the Twist value of the KinectStick. This axis
 * is unimplemented in the default gestures but can
 * be populated by teams editing the Kinect Server.
 * @return The Twist value of the KinectStick
 */
float KinectStick::GetTwist()
{
	return GetRawAxis(Joystick::kDefaultTwistAxis);
}

/**
 * Get the Throttle value of the KinectStick. This axis
 * is unimplemented in the default gestures but can
 * be populated by teams editing the Kinect Server.
 * @return The Throttle value of the KinectStick
 */
float KinectStick::GetThrottle()
{
	return GetRawAxis(Joystick::kDefaultThrottleAxis);
}

/**
 * Get the value of the KinectStick axis.
 *
 * @param axis The axis to read [1-6].
 * @return The value of the axis
 */
float KinectStick::GetRawAxis(uint32_t axis)
{
	if (StatusIsFatal()) return 0.0;

	GetData();
	float value = ConvertRawToFloat(_sticks.formatted.rawSticks[m_id - 1].axis[axis-1]);
	return value;
}

/**
 * Get the button value for the button set as the default trigger
 *
 * @param hand Unused
 * @return The state of the button.
 */
bool KinectStick::GetTrigger(JoystickHand hand)
{
	return GetRawButton(kTriggerMask);
}

/**
 * Get the button value for the button set as the default top
 *
 * @param hand Unused
 * @return The state of the button.
 */
bool KinectStick::GetTop(JoystickHand hand)
{
	return GetRawButton(kTopMask);
}

/**
 * Get the button value for the button set as the default bumper (button 4)
 *
 * @param hand Unused
 * @return The state of the button.
 */
bool KinectStick::GetBumper(JoystickHand hand)
{
	// TODO: Should this even be in GenericHID?  Is 4 an appropriate mask value (button 3)?
	return GetRawButton(4);
}

/**
 * Get the button value for buttons 1 through 12. The default gestures
 * implement only 9 buttons.
 *
 * The appropriate button is returned as a boolean value.
 *
 * @param button The button number to be read.
 * @return The state of the button.
 */
bool KinectStick::GetRawButton(uint32_t button)
{
	if (StatusIsFatal()) return false;

	GetData();
	return (_sticks.formatted.rawSticks[m_id - 1].buttons & (1 << button)) != 0;
}

/**
 * Get dynamic data from the driver station buffer
 */
void KinectStick::GetData()
{
	uint32_t packetNumber = DriverStation::GetInstance()->GetPacketNumber();
	if (_recentPacketNumber != packetNumber)
	{
		_recentPacketNumber = packetNumber;
		int retVal = getDynamicControlData(kJoystickBundleID, _sticks.data, sizeof(_sticks.data), 5);
		if (retVal == 0)
		{
			wpi_assert(_sticks.formatted.size == sizeof(_sticks.data) - 1);
		}
	}
}

/**
 * Convert an 8 bit joystick value to a floating point (-1,1) value
 * @param value The 8 bit raw joystick value returned from the driver station
 */
float KinectStick::ConvertRawToFloat(int8_t value)
{
	float result;

	if (value < 0)
		result = ((float) value) / 128.0;
	else
		result = ((float) value) / 127.0;

	wpi_assert(result <= 1.0 && result >= -1.0);

	if (result > 1.0)
		result = 1.0;
	else if (result < -1.0)
		result = -1.0;

	return result;
}


text:
__author__ = 'rayn'

#problem 0000
#Add a unread number on the face icon

from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw

class UnreadTagFace:
    def __init__(self):
        self.img = None
        self.num = None
    def open(self, image_path):
        self.img = Image.open(image_path)
        return True
    def draw(self, tag_num = 1):
        tag_size = max(self.img.size[0], self.img.size[1]) / 5
        tag_str = str(tag_num) if tag_num < 100 else '99+'
        font = ImageFont.truetype("Arial.ttf", tag_size)
        px = self.img.size[0] - font.getsize(tag_str)[0]
        draw_pen = ImageDraw.Draw(self.img)
        draw_pen.text((px, 0), tag_str, (255, 0, 0), font)
        self.img.save('face' + tag_str + '.jpg')
        return True

solver = UnreadTagFace()
solver.open('face.jpg')
solver.draw(4)


text:
<?php

namespace Symbiote\QueuedJobs\Tasks;

use SilverStripe\ORM\FieldType\DBDatetime;
use Symbiote\QueuedJobs\Services\AbstractQueuedJob;
use Symbiote\QueuedJobs\Services\QueuedJob;

class DummyQueuedJob extends AbstractQueuedJob
{
    /**
     * @param int $number
     */
    public function __construct($number = 0)
    {
        if ($number) {
            $this->startNumber = $number;
            $this->totalSteps = $this->startNumber;
        }
    }

    /**
     * @return string
     */
    public function getTitle()
    {
        return 'Some test job for ' . $this->startNumber . ' seconds';
    }

    /**
     * @return string
     */
    public function getJobType()
    {
        return QueuedJob::QUEUED;
    }

    public function setup()
    {
        // just demonstrating how to get a job going...
        $this->totalSteps = $this->startNumber;
        $this->times = array();
    }

    public function process()
    {
        $times = $this->times;
        // needed due to quirks with __set
        $time = DBDatetime::now()->Rfc2822();
        $times[] = $time;
        $this->times = $times;

        $this->addMessage('Updated time to ' . $time);
        sleep(1);

        // make sure we're incrementing
        $this->currentStep++;

        // if ($this->currentStep > 1) {
        //     $this->currentStep = 1;
        // }

        // and checking whether we're complete
        if ($this->currentStep >= $this->totalSteps) {
            $this->isComplete = true;
        }
    }
}


text:
<?php
namespace PHPixme;
/**
 * div, short for divide, a stand in for /
 * @sig (int|float $lhs) -> (int|float $rhs) -> int|float $z
 * @param int|float $lhs
 * @param int|float $rhs
 * @return int|float|\Closure
 */
function div($lhs = null, $rhs = null)
{
  return call_user_func_array(__PRIVATE__::$instance[div], func_get_args());
}
const div = __NAMESPACE__ . '\div';
__PRIVATE__::$instance[div] = __PRIVATE__::curryExactly2(function ($lhs, $rhs) {
  return $lhs / $rhs;
});


text:
namespace blink {

TEST(VariableAxesNamesTest, TestVariableAxes) {
  String file_path = blink::test::BlinkWebTestsDir() +
                     "/third_party/Homecomputer/Sixtyfour.ttf";
  sk_sp<SkTypeface> typeface =
      SkTypeface::MakeFromFile(file_path.Utf8().c_str(), 0);
  Vector<VariationAxis> axes = VariableAxesNames::GetVariationAxes(typeface);
  EXPECT_EQ(axes.size(), (unsigned)2);
  VariationAxis axis1 = axes.at(0);
  EXPECT_EQ(axis1.name, "Weight");
  EXPECT_EQ(axis1.tag, "wght");
  EXPECT_EQ(axis1.minValue, 200);
  EXPECT_EQ(axis1.maxValue, 900);
  EXPECT_EQ(axis1.defaultValue, 200);
  VariationAxis axis2 = axes.at(1);
  EXPECT_EQ(axis2.name, "Width");
  EXPECT_EQ(axis2.tag, "wdth");
  EXPECT_EQ(axis2.minValue, 100);
  EXPECT_EQ(axis2.maxValue, 200);
  EXPECT_EQ(axis2.defaultValue, 100);
}

}  // namespace blink


text:
namespace Ch20P06
{
    public class Kitten : Feline
    {
        public Kitten(int age, string name, string gender) : base(age, name, gender)
        {
        }

        public override string MakeSound()
        {
            return "Purr";
        }
    }
}


text:
<!doctype html>

    <title>Code coverage report for cjs/util/subscribeToResult.js</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="../../prettify.css">
    <link rel="stylesheet" href="../../base.css">

Code coverage report for cjs/util/subscribeToResult.js

        Statements: 65.57% (40 / 61)
        Branches: 55.56% (20 / 36)
        Functions: 66.67% (4 / 6)
        Lines: 67.24% (39 / 58)
        Ignored: none

All files » cjs/util/ » subscribeToResult.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

1
1

4

1

1

1

1

1

1

1

1

1

1
595
595

595
498
5
5
5

493

97
65
172

65
65

32
26
23
18
18

3

26
6

6
6
6

6

1

'use strict';

exports.__esModule = true;
exports['default'] = subscribeToResult;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var _Observable = require('../Observable');

var _Observable2 = _interopRequireDefault(_Observable);

var _utilSymbol_iterator = require('../util/Symbol_iterator');

var _utilSymbol_iterator2 = _interopRequireDefault(_utilSymbol_iterator);

var _utilSymbol_observable = require('../util/Symbol_observable');

var _utilSymbol_observable2 = _interopRequireDefault(_utilSymbol_observable);

var _InnerSubscriber = require('../InnerSubscriber');

var _InnerSubscriber2 = _interopRequireDefault(_InnerSubscriber);

var isArray = Array.isArray;

function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) {
    var destination = new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex);
    Iif (destination.isUnsubscribed) {
        return;
    }
    if (result instanceof _Observable2['default']) {
        if (result._isScalar) {
            destination.next(result.value);
            destination.complete();
            return;
        } else {
            return result.subscribe(destination);
        }
    }
    if (isArray(result)) {
        for (var i = 0, len = result.length; i < len && !destination.isUnsubscribed; i++) {
            destination.next(result[i]);
        }
        Eif (!destination.isUnsubscribed) {
            destination.complete();
        }
    } else if (typeof result.then === 'function') {
        result.then(function (x) {
            if (!destination.isUnsubscribed) {
                destination.next(x);
                destination.complete();
            }
        }, function (err) {
            return destination.error(err);
        }).then(null, function (err) {
            // Escaping the Promise trap: globally throw unhandled errors
            setTimeout(function () {
                throw err;
            });
        });
        return destination;
    } else Iif (typeof result[_utilSymbol_iterator2['default']] === 'function') {
        for (var _iterator = result, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
            var _ref;

            if (_isArray) {
                if (_i >= _iterator.length) break;
                _ref = _iterator[_i++];
            } else {
                _i = _iterator.next();
                if (_i.done) break;
                _ref = _i.value;
            }

            var item = _ref;

            destination.next(item);
            if (destination.isUnsubscribed) {
                break;
            }
        }
        if (!destination.isUnsubscribed) {
            destination.complete();
        }
    } else Eif (typeof result[_utilSymbol_observable2['default']] === 'function') {
        var obs = result[_utilSymbol_observable2['default']]();
        Iif (typeof obs.subscribe !== 'function') {
            destination.error('invalid observable');
        } else {
            return obs.subscribe(new _InnerSubscriber2['default'](outerSubscriber, outerValue, outerIndex));
        }
    } else {
        destination.error(new TypeError('unknown type returned'));
    }
}

//# sourceMappingURL=subscribeToResult.js.map
module.exports = exports['default'];
//# sourceMappingURL=subscribeToResult.js.map

Generated by istanbul at Mon Oct 26 2015 13:47:29 GMT-0700 (PDT)


text:
package com.basic.interceptor.db;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * Created by basic on 2015/9/10.
 */
@DatabaseTable(tableName = "user")
public class User {

    public static final String KEY_TIMESTAMP = "timestamp";
    public static final String KEY_USERNAME = "username";

    @DatabaseField(columnName = KEY_USERNAME, canBeNull = false)
    private String mUserName;

    @DatabaseField(canBeNull = false, columnName = "_id", generatedId = true, uniqueCombo =true)
    private int mId;

    @DatabaseField(canBeNull =  false, columnName = "password")
    private String mPassword;

    @DatabaseField(columnName = KEY_TIMESTAMP, canBeNull = false)
    private long mTimeStamp;

    public String getUserName() {
        return mUserName;
    }

    public void setUserName(String userName) {
        mUserName = userName;
    }

    public int getId() {
        return mId;
    }

    public void setId(int id) {
        mId = id;
    }

    public String getPassword() {
        return mPassword;
    }

    public void setPassword(String password) {
        mPassword = password;
    }
    public long getTimeStamp() {
        return mTimeStamp;
    }

    public void setTimeStamp(long timeStamp) {
        mTimeStamp = timeStamp;
    }
}


text:
package org.jboss.arquillian.persistence.core.metadata;

import java.lang.reflect.Method;
import org.jboss.arquillian.persistence.BuiltInCleanupStrategy;
import org.jboss.arquillian.persistence.Cleanup;
import org.jboss.arquillian.persistence.CleanupStrategy;
import org.jboss.arquillian.persistence.CleanupUsingScript;
import org.jboss.arquillian.persistence.DataSeedStrategy;
import org.jboss.arquillian.persistence.DataSource;
import org.jboss.arquillian.persistence.SeedDataUsing;
import org.jboss.arquillian.persistence.TestExecutionPhase;
import org.jboss.arquillian.persistence.core.configuration.PersistenceConfiguration;
import org.jboss.arquillian.persistence.core.exception.DataSourceNotDefinedException;
import org.jboss.arquillian.persistence.core.util.Strings;

/**
 * @author Bartosz Majsak
 */
public class PersistenceExtensionFeatureResolver {

    private final PersistenceConfiguration configuration;

    private final MetadataExtractor metadataExtractor;

    private final Method testMethod;

    public PersistenceExtensionFeatureResolver(Method testMethod, MetadataExtractor metadataExtractor,
        PersistenceConfiguration configuration) {
        this.metadataExtractor = metadataExtractor;
        this.configuration = configuration;
        this.testMethod = testMethod;
    }

    // ---------------------------------------------------------------------------------------------------
    // Public API methods
    // ---------------------------------------------------------------------------------------------------

    public boolean shouldCreateSchema() {
        return metadataExtractor.createSchema().isDefinedOnClassLevel();
    }

    public boolean shouldSeedData() {
        return metadataExtractor.usingDataSet().isDefinedOnClassLevel()
            || metadataExtractor.usingDataSet().isDefinedOn(testMethod);
    }

    public boolean shouldCustomScriptBeAppliedBeforeTestRequested() {
        return metadataExtractor.applyScriptBefore().isDefinedOnClassLevel()
            || metadataExtractor.applyScriptBefore().isDefinedOn(testMethod);
    }

    public boolean shouldCustomScriptBeAppliedAfterTestRequested() {
        return metadataExtractor.applyScriptAfter().isDefinedOnClassLevel()
            || metadataExtractor.applyScriptAfter().isDefinedOn(testMethod);
    }

    public boolean shouldVerifyDataAfterTest() {
        return metadataExtractor.shouldMatchDataSet().isDefinedOnClassLevel()
            || metadataExtractor.shouldMatchDataSet().isDefinedOn(testMethod);
    }

    public TestExecutionPhase getCleanupTestPhase() {
        final Cleanup cleanupAnnotation = metadataExtractor.cleanup().fetchUsingFirst(testMethod);

        TestExecutionPhase phase = configuration.getDefaultCleanupPhase();
        if (cleanupAnnotation != null && !TestExecutionPhase.DEFAULT.equals(cleanupAnnotation.phase())) {
            phase = cleanupAnnotation.phase();
        }

        return phase;
    }

    public BuiltInCleanupStrategy getCleanupStrategy() {
        final CleanupStrategy cleanup = metadataExtractor.cleanupStrategy().fetchUsingFirst(testMethod);
        if (cleanup == null || BuiltInCleanupStrategy.DEFAULT.equals(cleanup.value())) {
            return configuration.getDefaultCleanupStrategy();
        }
        return cleanup.value();
    }

    public DataSeedStrategy getDataSeedStrategy() {
        final SeedDataUsing dataSeedingStrategy = metadataExtractor.dataSeedStrategy().fetchUsingFirst(testMethod);
        if (dataSeedingStrategy == null || DataSeedStrategy.DEFAULT.equals(dataSeedingStrategy.value())) {
            return configuration.getDefaultDataSeedStrategy();
        }
        return dataSeedingStrategy.value();
    }

    public boolean shouldCleanup() {
        final CleanupUsingScript cleanupUsingScriptAnnotation =
            metadataExtractor.cleanupUsingScript().fetchUsingFirst(testMethod);
        return cleanupUsingScriptAnnotation == null || TestExecutionPhase.NONE.equals(
            cleanupUsingScriptAnnotation.phase());
    }

    public boolean shouldCleanupBefore() {
        return shouldCleanup() && TestExecutionPhase.BEFORE.equals(getCleanupTestPhase());
    }

    public boolean shouldCleanupAfter() {
        return shouldCleanup() && TestExecutionPhase.AFTER.equals(getCleanupTestPhase());
    }

    public String getDataSourceName() {
        String dataSource = "";

        if (configuration.isDefaultDataSourceDefined()) {
            dataSource = configuration.getDefaultDataSource();
        }

        final DataSource dataSourceAnnotation = metadataExtractor.dataSource().fetchUsingFirst(testMethod);
        if (dataSourceAnnotation != null) {
            dataSource = dataSourceAnnotation.value();
        }

        if (Strings.isEmpty(dataSource)) {
            throw new DataSourceNotDefinedException(
                "DataSource not defined! Please declare it in arquillian.xml or by using @DataSource annotation.");
        }

        return dataSource;
    }
}


text:
from django.dispatch import Signal
from haystack import signals

post_form_save = Signal()

class DocumentSignalProcessor(signals.BaseSignalProcessor):
    def setup(self):
        post_form_save.connect(self.handle_save)

    def teardown(self):
        post_form_save.disconnect(self.handle_save)