text:
#ifndef __OPENCV_GTESTCV_HPP__
#define __OPENCV_GTESTCV_HPP__

#include "opencv2/core/cvdef.h"
#include <stdarg.h> // for va_list

#include "cvconfig.h"

#ifdef HAVE_WINRT
    #pragma warning(disable:4447) // Disable warning 'main' signature found without threading model
#endif

#ifdef _MSC_VER
#pragma warning( disable: 4127 ) // conditional expression is constant
#pragma warning( disable: 4503 ) // decorated name length exceeded, name was truncated
#endif

#define GTEST_DONT_DEFINE_FAIL      0
#define GTEST_DONT_DEFINE_SUCCEED   0
#define GTEST_DONT_DEFINE_ASSERT_EQ 0
#define GTEST_DONT_DEFINE_ASSERT_NE 0
#define GTEST_DONT_DEFINE_ASSERT_LE 0
#define GTEST_DONT_DEFINE_ASSERT_LT 0
#define GTEST_DONT_DEFINE_ASSERT_GE 0
#define GTEST_DONT_DEFINE_ASSERT_GT 0
#define GTEST_DONT_DEFINE_TEST      0

#include "opencv2/ts/ts_gtest.h"
#include "opencv2/ts/ts_ext.hpp"

#ifndef GTEST_USES_SIMPLE_RE
#  define GTEST_USES_SIMPLE_RE 0
#endif
#ifndef GTEST_USES_POSIX_RE
#  define GTEST_USES_POSIX_RE 0
#endif

#include "opencv2/core.hpp"
#include "opencv2/core/utility.hpp"

namespace cvtest
{

using std::vector;
using std::string;
using cv::RNG;
using cv::Mat;
using cv::Scalar;
using cv::Size;
using cv::Point;
using cv::Rect;
using cv::InputArray;
using cv::noArray;

class CV_EXPORTS TS;

CV_EXPORTS int64 readSeed(const char* str);

CV_EXPORTS void randUni( RNG& rng, Mat& a, const Scalar& param1, const Scalar& param2 );

inline unsigned randInt( RNG& rng )
{
    return (unsigned)rng;
}

inline  double randReal( RNG& rng )
{
    return (double)rng;
}

CV_EXPORTS const char* getTypeName( int type );
CV_EXPORTS int typeByName( const char* type_name );

CV_EXPORTS string vec2str(const string& sep, const int* v, size_t nelems);

inline int clipInt( int val, int min_val, int max_val )
{
    if( val < min_val )
        val = min_val;
    if( val > max_val )
        val = max_val;
    return val;
}

CV_EXPORTS double getMinVal(int depth);
CV_EXPORTS double getMaxVal(int depth);

CV_EXPORTS Size randomSize(RNG& rng, double maxSizeLog);
CV_EXPORTS void randomSize(RNG& rng, int minDims, int maxDims, double maxSizeLog, vector<int>& sz);
CV_EXPORTS int randomType(RNG& rng, int typeMask, int minChannels, int maxChannels);
CV_EXPORTS Mat randomMat(RNG& rng, Size size, int type, double minVal, double maxVal, bool useRoi);
CV_EXPORTS Mat randomMat(RNG& rng, const vector<int>& size, int type, double minVal, double maxVal, bool useRoi);
CV_EXPORTS void add(const Mat& a, double alpha, const Mat& b, double beta,
                      Scalar gamma, Mat& c, int ctype, bool calcAbs=false);
CV_EXPORTS void multiply(const Mat& a, const Mat& b, Mat& c, double alpha=1);
CV_EXPORTS void divide(const Mat& a, const Mat& b, Mat& c, double alpha=1);

CV_EXPORTS void convert(const Mat& src, cv::OutputArray dst, int dtype, double alpha=1, double beta=0);
CV_EXPORTS void copy(const Mat& src, Mat& dst, const Mat& mask=Mat(), bool invertMask=false);
CV_EXPORTS void set(Mat& dst, const Scalar& gamma, const Mat& mask=Mat());

// working with multi-channel arrays
CV_EXPORTS void extract( const Mat& a, Mat& plane, int coi );
CV_EXPORTS void insert( const Mat& plane, Mat& a, int coi );

// checks that the array does not have NaNs and/or Infs and all the elements are
// within [min_val,max_val). idx is the index of the first "bad" element.
CV_EXPORTS int check( const Mat& data, double min_val, double max_val, vector<int>* idx );

// modifies values that are close to zero
CV_EXPORTS void  patchZeros( Mat& mat, double level );

CV_EXPORTS void transpose(const Mat& src, Mat& dst);
CV_EXPORTS void erode(const Mat& src, Mat& dst, const Mat& _kernel, Point anchor=Point(-1,-1),
                      int borderType=0, const Scalar& borderValue=Scalar());
CV_EXPORTS void dilate(const Mat& src, Mat& dst, const Mat& _kernel, Point anchor=Point(-1,-1),
                       int borderType=0, const Scalar& borderValue=Scalar());
CV_EXPORTS void filter2D(const Mat& src, Mat& dst, int ddepth, const Mat& kernel,
                         Point anchor, double delta, int borderType,
                         const Scalar& borderValue=Scalar());
CV_EXPORTS void copyMakeBorder(const Mat& src, Mat& dst, int top, int bottom, int left, int right,
                               int borderType, const Scalar& borderValue=Scalar());
CV_EXPORTS Mat calcSobelKernel2D( int dx, int dy, int apertureSize, int origin=0 );
CV_EXPORTS Mat calcLaplaceKernel2D( int aperture_size );

CV_EXPORTS void initUndistortMap( const Mat& a, const Mat& k, Size sz, Mat& mapx, Mat& mapy );

CV_EXPORTS void minMaxLoc(const Mat& src, double* minval, double* maxval,
                          vector<int>* minloc, vector<int>* maxloc, const Mat& mask=Mat());
CV_EXPORTS double norm(InputArray src, int normType, InputArray mask=noArray());
CV_EXPORTS double norm(InputArray src1, InputArray src2, int normType, InputArray mask=noArray());
CV_EXPORTS Scalar mean(const Mat& src, const Mat& mask=Mat());
CV_EXPORTS double PSNR(InputArray src1, InputArray src2);

CV_EXPORTS bool cmpUlps(const Mat& data, const Mat& refdata, int expMaxDiff, double* realMaxDiff, vector<int>* idx);

// compares two arrays. max_diff is the maximum actual difference,
// success_err_level is maximum allowed difference, idx is the index of the first
// element for which difference is >success_err_level
// (or index of element with the maximum difference)
CV_EXPORTS int cmpEps( const Mat& data, const Mat& refdata, double* max_diff,
                       double success_err_level, vector<int>* idx,
                       bool element_wise_relative_error );

// a wrapper for the previous function. in case of error prints the message to log file.
CV_EXPORTS int cmpEps2( TS* ts, const Mat& data, const Mat& refdata, double success_err_level,
                        bool element_wise_relative_error, const char* desc );

CV_EXPORTS int cmpEps2_64f( TS* ts, const double* val, const double* refval, int len,
                        double eps, const char* param_name );

CV_EXPORTS void logicOp(const Mat& src1, const Mat& src2, Mat& dst, char c);
CV_EXPORTS void logicOp(const Mat& src, const Scalar& s, Mat& dst, char c);
CV_EXPORTS void min(const Mat& src1, const Mat& src2, Mat& dst);
CV_EXPORTS void min(const Mat& src, double s, Mat& dst);
CV_EXPORTS void max(const Mat& src1, const Mat& src2, Mat& dst);
CV_EXPORTS void max(const Mat& src, double s, Mat& dst);

CV_EXPORTS void compare(const Mat& src1, const Mat& src2, Mat& dst, int cmpop);
CV_EXPORTS void compare(const Mat& src, double s, Mat& dst, int cmpop);
CV_EXPORTS void gemm(const Mat& src1, const Mat& src2, double alpha,
                     const Mat& src3, double beta, Mat& dst, int flags);
    CV_EXPORTS void transform( const Mat& src, Mat& dst, const Mat& transmat, const Mat& shift );
CV_EXPORTS double crossCorr(const Mat& src1, const Mat& src2);

struct CV_EXPORTS MatInfo
{
    MatInfo(const Mat& _m) : m(&_m) {}
    const Mat* m;
};

CV_EXPORTS std::ostream& operator << (std::ostream& out, const MatInfo& m);

struct CV_EXPORTS MatComparator
{
public:
    MatComparator(double maxdiff, int context);

    ::testing::AssertionResult operator()(const char* expr1, const char* expr2,
                                          const Mat& m1, const Mat& m2);

    double maxdiff;
    double realmaxdiff;
    vector<int> loc0;
    int context;
};

class BaseTest;
class TS;

class CV_EXPORTS BaseTest
{
public:
    // constructor(s) and destructor
    BaseTest();
    virtual ~BaseTest();

    // the main procedure of the test
    virtual void run( int start_from );

    // the wrapper for run that cares of exceptions
    virtual void safe_run( int start_from=0 );

    const string& get_name() const { return name; }

    // returns true if and only if the different test cases do not depend on each other
    // (so that test system could get right to a problematic test case)
    virtual bool can_do_fast_forward();

    // deallocates all the memory.
    // called by init() (before initialization) and by the destructor
    virtual void clear();

protected:
    int test_case_count; // the total number of test cases

    // read test params
    virtual int read_params( CvFileStorage* fs );

    // returns the number of tests or -1 if it is unknown a-priori
    virtual int get_test_case_count();

    // prepares data for the next test case. rng seed is updated by the function
    virtual int prepare_test_case( int test_case_idx );

    // checks if the test output is valid and accurate
    virtual int validate_test_results( int test_case_idx );

    // calls the tested function. the method is called from run_test_case()
    virtual void run_func(); // runs tested func(s)

    // updates progress bar
    virtual int update_progress( int progress, int test_case_idx, int count, double dt );

    // finds test parameter
    const CvFileNode* find_param( CvFileStorage* fs, const char* param_name );

    // name of the test (it is possible to locate a test by its name)
    string name;

    // pointer to the system that includes the test
    TS* ts;
};

/*****************************************************************************************\
*                               Information about a failed test                           *
\*****************************************************************************************/

struct TestInfo
{
    TestInfo();

    // pointer to the test
    BaseTest* test;

    // failure code (TS::FAIL_*)
    int code;

    // seed value right before the data for the failed test case is prepared.
    uint64 rng_seed;

    // seed value right before running the test
    uint64 rng_seed0;

    // index of test case, can be then passed to BaseTest::proceed_to_test_case()
    int test_case_idx;
};

/*****************************************************************************************\
*                                 Base Class for test system                              *
\*****************************************************************************************/

// common parameters:
struct CV_EXPORTS TSParams
{
    TSParams();

    // RNG seed, passed to and updated by every test executed.
    uint64 rng_seed;

    // whether to use IPP, MKL etc. or not
    bool use_optimized;

    // extensivity of the tests, scale factor for test_case_count
    double test_case_count_scale;
};

class CV_EXPORTS TS
{
public:
    // constructor(s) and destructor
    TS();
    virtual ~TS();

    enum
    {
        NUL=0,
        SUMMARY_IDX=0,
        SUMMARY=1 << SUMMARY_IDX,
        LOG_IDX=1,
        LOG=1 << LOG_IDX,
        CSV_IDX=2,
        CSV=1 << CSV_IDX,
        CONSOLE_IDX=3,
        CONSOLE=1 << CONSOLE_IDX,
        MAX_IDX=4
    };

    static TS* ptr();

    // initialize test system before running the first test
    virtual void init( const string& modulename );

    // low-level printing functions that are used by individual tests and by the system itself
    virtual void printf( int streams, const char* fmt, ... );
    virtual void vprintf( int streams, const char* fmt, va_list arglist );

    // updates the context: current test, test case, rng state
    virtual void update_context( BaseTest* test, int test_case_idx, bool update_ts_context );

    const TestInfo* get_current_test_info() { return &current_test_info; }

    // sets information about a failed test
    virtual void set_failed_test_info( int fail_code );

    virtual void set_gtest_status();

    // test error codes
    enum FailureCode
    {
        // everything is Ok
        OK=0,

        // generic error: stub value to be used
        // temporarily if the error's cause is unknown
        FAIL_GENERIC=-1,

        // the test is missing some essential data to proceed further
        FAIL_MISSING_TEST_DATA=-2,

        // the tested function raised an error via cxcore error handler
        FAIL_ERROR_IN_CALLED_FUNC=-3,

        // an exception has been raised;
        // for memory and arithmetic exception
        // there are two specialized codes (see below...)
        FAIL_EXCEPTION=-4,

        // a memory exception
        // (access violation, access to missed page, stack overflow etc.)
        FAIL_MEMORY_EXCEPTION=-5,

        // arithmetic exception (overflow, division by zero etc.)
        FAIL_ARITHM_EXCEPTION=-6,

        // the tested function corrupted memory (no exception have been raised)
        FAIL_MEMORY_CORRUPTION_BEGIN=-7,
        FAIL_MEMORY_CORRUPTION_END=-8,

        // the tested function (or test ifself) do not deallocate some memory
        FAIL_MEMORY_LEAK=-9,

        // the tested function returned invalid object, e.g. matrix, containing NaNs,
        // structure with NULL or out-of-range fields (while it should not)
        FAIL_INVALID_OUTPUT=-10,

        // the tested function returned valid object, but it does not match to
        // the original (or produced by the test) object
        FAIL_MISMATCH=-11,

        // the tested function returned valid object (a single number or numerical array),
        // but it differs too much from the original (or produced by the test) object
        FAIL_BAD_ACCURACY=-12,

        // the tested function hung. Sometimes, can be determined by unexpectedly long
        // processing time (in this case there should be possibility to interrupt such a function
        FAIL_HANG=-13,

        // unexpected response on passing bad arguments to the tested function
        // (the function crashed, proceed succesfully (while it should not), or returned
        // error code that is different from what is expected)
        FAIL_BAD_ARG_CHECK=-14,

        // the test data (in whole or for the particular test case) is invalid
        FAIL_INVALID_TEST_DATA=-15,

        // the test has been skipped because it is not in the selected subset of the tests to run,
        // because it has been run already within the same run with the same parameters, or because
        // of some other reason and this is not considered as an error.
        // Normally TS::run() (or overrided method in the derived class) takes care of what
        // needs to be run, so this code should not occur.
        SKIPPED=1
    };

    // get file storage
    CvFileStorage* get_file_storage();

    // get RNG to generate random input data for a test
    RNG& get_rng() { return rng; }

    // returns the current error code
    TS::FailureCode get_err_code() { return TS::FailureCode(current_test_info.code); }

    // returns the test extensivity scale
    double get_test_case_count_scale() { return params.test_case_count_scale; }

    const string& get_data_path() const { return data_path; }

    // returns textual description of failure code
    static string str_from_code( const TS::FailureCode code );

protected:

    // these are allocated within a test to try keep them valid in case of stack corruption
    RNG rng;

    // information about the current test
    TestInfo current_test_info;

    // the path to data files used by tests
    string data_path;

    TSParams params;
    std::string output_buf[MAX_IDX];
};

/*****************************************************************************************\
*            Subclass of BaseTest for testing functions that process dense arrays           *
\*****************************************************************************************/

class CV_EXPORTS ArrayTest : public BaseTest
{
public:
    // constructor(s) and destructor
    ArrayTest();
    virtual ~ArrayTest();

    virtual void clear();

protected:

    virtual int read_params( CvFileStorage* fs );
    virtual int prepare_test_case( int test_case_idx );
    virtual int validate_test_results( int test_case_idx );

    virtual void prepare_to_validation( int test_case_idx );
    virtual void get_test_array_types_and_sizes( int test_case_idx, vector<vector<Size> >& sizes, vector<vector<int> >& types );
    virtual void fill_array( int test_case_idx, int i, int j, Mat& arr );
    virtual void get_minmax_bounds( int i, int j, int type, Scalar& low, Scalar& high );
    virtual double get_success_error_level( int test_case_idx, int i, int j );

    bool cvmat_allowed;
    bool iplimage_allowed;
    bool optional_mask;
    bool element_wise_relative_error;

    int min_log_array_size;
    int max_log_array_size;

    enum { INPUT, INPUT_OUTPUT, OUTPUT, REF_INPUT_OUTPUT, REF_OUTPUT, TEMP, MASK, MAX_ARR };

    vector<vector<void*> > test_array;
    vector<vector<Mat> > test_mat;
    float buf[4];
};

class CV_EXPORTS BadArgTest : public BaseTest
{
public:
    // constructor(s) and destructor
    BadArgTest();
    virtual ~BadArgTest();

protected:
    virtual int run_test_case( int expected_code, const string& descr );
    virtual void run_func(void) = 0;
    int test_case_idx;

    template<class F>
    int run_test_case( int expected_code, const string& _descr, F f)
    {
        int errcount = 0;
        bool thrown = false;
        const char* descr = _descr.c_str() ? _descr.c_str() : "";

        try
        {
            f();
        }
        catch(const cv::Exception& e)
        {
            thrown = true;
            if( e.code != expected_code )
            {
                ts->printf(TS::LOG, "%s (test case #%d): the error code %d is different from the expected %d\n",
                    descr, test_case_idx, e.code, expected_code);
                errcount = 1;
            }
        }
        catch(...)
        {
            thrown = true;
            ts->printf(TS::LOG, "%s  (test case #%d): unknown exception was thrown (the function has likely crashed)\n",
                       descr, test_case_idx);
            errcount = 1;
        }
        if(!thrown)
        {
            ts->printf(TS::LOG, "%s  (test case #%d): no expected exception was thrown\n",
                       descr, test_case_idx);
            errcount = 1;
        }
        test_case_idx++;

        return errcount;
    }
};

struct CV_EXPORTS DefaultRngAuto
{
    const uint64 old_state;

    DefaultRngAuto() : old_state(cv::theRNG().state) { cv::theRNG().state = (uint64)-1; }
    ~DefaultRngAuto() { cv::theRNG().state = old_state; }

    DefaultRngAuto& operator=(const DefaultRngAuto&);
};

}

namespace cvtest
{

// test images generation functions
CV_EXPORTS void fillGradient(Mat& img, int delta = 5);
CV_EXPORTS void smoothBorder(Mat& img, const Scalar& color, int delta = 3);

CV_EXPORTS void printVersionInfo(bool useStdOut = true);
} //namespace cvtest

#ifndef __CV_TEST_EXEC_ARGS
#if defined(_MSC_VER) && (_MSC_VER <= 1400)
#define __CV_TEST_EXEC_ARGS(...)    \
    while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/
#else
#define __CV_TEST_EXEC_ARGS(...)    \
    __VA_ARGS__;
#endif
#endif

#ifdef HAVE_OPENCL
namespace cvtest { namespace ocl {
void dumpOpenCLDevice();
} }
#define TEST_DUMP_OCL_INFO cvtest::ocl::dumpOpenCLDevice();
#else
#define TEST_DUMP_OCL_INFO
#endif

void parseCustomOptions(int argc, char **argv);

#define CV_TEST_MAIN(resourcesubdir, ...) \
int main(int argc, char **argv) \
{ \
    cvtest::TS::ptr()->init(resourcesubdir); \
    ::testing::InitGoogleTest(&argc, argv); \
    cvtest::printVersionInfo(); \
    __CV_TEST_EXEC_ARGS(__VA_ARGS__) \
    TEST_DUMP_OCL_INFO \
    parseCustomOptions(argc, argv); \
    return RUN_ALL_TESTS(); \
}

// This usually only makes sense in perf tests with several implementations,
// some of which are not available.
#define CV_TEST_FAIL_NO_IMPL() do { \
    ::testing::Test::RecordProperty("custom_status", "noimpl"); \
    FAIL() << "No equivalent implementation."; \
} while (0)

#endif

#include "opencv2/ts/ts_perf.hpp"


text:
Given(/^I land on games page$/) do
  sleep 1
  @gamesPage.assert_games_page

end

When(/^I launch game1 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_1

end

Then(/^I close game1 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_1

end

When(/^I launch game2 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_2

end

Then(/^I close game2 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_2

end

When(/^I launch game3 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_3
end

Then(/^I close game3 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_3

end

When(/^I launch game4 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_4
end

Then(/^I close game4 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_4
end

When(/^I launch game5 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_5
end

Then(/^I close game5 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_5
end

When(/^I launch game6 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_6

end

Then(/^I close game6 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_6

end

When(/^I launch game7 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_7

end

Then(/^I close game7 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_7

end

When(/^I launch game8 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_8

end

Then(/^I close game8 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_8

end

When(/^I launch game9 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_9

end

Then(/^I close game9 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_9
end

When(/^I launch game10 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_10

end

Then(/^I close gam10 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_10

end

When(/^I launch game11 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_11

end

Then(/^I close game11 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_11

end

When(/^I launch game12 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_12

end

Then(/^I close game12 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_12

end

When(/^I launch game13 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_13

end

Then(/^I close game13 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_13

end

When(/^I launch game14 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_14

end

Then(/^I close game14 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_14
end

When(/^I launch game15 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_15

end

Then(/^I close game15 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_15

end

When(/^I launch game16 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_16
end

Then(/^I close game16 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_16
end

When(/^I launch game17 in Unibet Picks$/) do
  @unibetpicksPage.launch_UPgame_17
end

Then(/^I close game17 after a successful launch$/) do
  @unibetpicksPage.close_UPgame_17

end

redpajama_set_name: RedPajamaGithub


text:
using System;

namespace SerialLabs.ExceptionHandling
{
    /// <summary>
    /// Base class for Exception Handler implementations
    /// </summary>
    public abstract class ExceptionHandler : IExceptionHandler
    {
        private readonly string name;
        /// <summary>
        /// Handler name
        /// </summary>
        public string Name
        {
            get
            {
                if (String.IsNullOrWhiteSpace(this.name))
                    return this.GetType().Name;
                return this.name;
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ExceptionHandler"/> class with the name is the handler.
        /// </summary>
        /// <param name="name"></param>
        public ExceptionHandler(string name)
        {
            if (String.IsNullOrWhiteSpace(name))
                throw new ArgumentNullException("name");
            this.name = name;
        }
        /// <summary>
        /// <para>When implemented by a class, handles an <see cref="Exception"/>.</para>
        /// </summary>
        /// <param name="exception"><para>The exception to handle.</para></param>
        /// <returns><para>Modified exception to pass to the next exceptionHandlerData in the chain.</para></returns>
        public abstract Exception HandleException(Exception exception);
    }
}


text:
static OpCodes *codes_new(int size);
static OpCodes *codes_join(OpCodes *a, OpCodes *b);
static OpCodes *codes_join3(OpCodes *a, OpCodes *b, OpCodes *c);
static OpCodes *codes_join4(OpCodes *a, OpCodes *b, OpCodes *c, OpCodes *d);
static OpCodes *code_push_undef();
static OpCodes *code_push_bool(int v);
static OpCodes *code_push_num(Jsi_Number *v);
static OpCodes *code_push_string(jsi_Pstate *p, jsi_Pline *line, const char *str);
static OpCodes *code_push_index(jsi_Pstate *p, jsi_Pline *line, char *varname);
static OpCodes *code_push_this(jsi_Pstate *p, jsi_Pline *line);
static OpCodes *code_push_top();
static OpCodes *code_push_top2() ;
static OpCodes *code_unref() ;
static OpCodes *code_push_args() ;
static OpCodes *code_push_func(jsi_Pstate *p, jsi_Pline *line, struct Jsi_Func *fun) ;
static OpCodes *code_push_regex(jsi_Pstate *p, jsi_Pline *line, Jsi_Regex *reg) ;
static OpCodes *code_local(jsi_Pstate *p, jsi_Pline *line, const char *varname) ;
static OpCodes *code_nop() ;
static OpCodes *code_neg() ;
static OpCodes *code_pos() ;
static OpCodes *code_bnot() ;
static OpCodes *code_not() ;
static OpCodes *code_mul() ;
static OpCodes *code_div() ;
static OpCodes *code_mod() ;
static OpCodes *code_add() ;
static OpCodes *code_sub() ;
static OpCodes *code_in() ;
static OpCodes *code_less() ;
static OpCodes *code_greater() ;
static OpCodes *code_lessequ() ;
static OpCodes *code_greaterequ() ;
static OpCodes *code_equal() ;
static OpCodes *code_notequal() ;
static OpCodes *code_eequ() ;
static OpCodes *code_nneq() ;
static OpCodes *code_band() ;
static OpCodes *code_bor() ;
static OpCodes *code_bxor() ;
static OpCodes *code_shf(int right) ;
static OpCodes *code_instanceof() ;
static OpCodes *code_assign(jsi_Pstate *p, jsi_Pline *line, int h) ;
static OpCodes *code_subscript(jsi_Pstate *p, jsi_Pline *line, int right_val) ;
static OpCodes *code_inc(jsi_Pstate *p, jsi_Pline *line, int e) ;
static OpCodes *code_dec(jsi_Pstate *p, jsi_Pline *line, int e) ;
static OpCodes *code_typeof(jsi_Pstate *p, jsi_Pline *line, int e) ;
static OpCodes *code_fcall(jsi_Pstate *p, jsi_Pline *line, int argc) ;
static OpCodes *code_newfcall(jsi_Pstate *p, jsi_Pline *line, int argc) ;
static OpCodes *code_ret(int n) ;
static OpCodes *code_delete(int n) ;
static OpCodes *code_chthis(int n) ;
static OpCodes *code_pop(int n) ;
static OpCodes *code_jfalse(int off) ;
static OpCodes *code_jtrue(int off) ;
static OpCodes *code_jfalse_np(int off) ;
static OpCodes *code_jtrue_np(int off) ;
static OpCodes *code_jmp(int off) ;
static OpCodes *code_object(jsi_Pstate *p, jsi_Pline *line, int c) ;
static OpCodes *code_array(jsi_Pstate *p, jsi_Pline *line, int c) ;
static OpCodes *code_key() ;
static OpCodes *code_next() ;
static OpCodes *code_eval(jsi_Pstate *p, jsi_Pline *line, int argc) ;
static OpCodes *code_stry(jsi_Pstate *p, jsi_Pline *line, int trylen, int catchlen, int finlen)
static OpCodes *code_etry(jsi_Pstate *p, jsi_Pline *line) ;
static OpCodes *code_scatch(jsi_Pstate *p, jsi_Pline *line, const char *var) ;
static OpCodes *code_ecatch(jsi_Pstate *p, jsi_Pline *line) ;
static OpCodes *code_sfinal(jsi_Pstate *p, jsi_Pline *line) ;
static OpCodes *code_efinal(jsi_Pstate *p, jsi_Pline *line) ;
static OpCodes *code_throw(jsi_Pstate *p, jsi_Pline *line) ;
static OpCodes *code_with(jsi_Pstate *p, jsi_Pline *line, int withlen) ;
static OpCodes *code_ewith(jsi_Pstate *p, jsi_Pline *line) ;
static OpCodes *code_debug(jsi_Pstate *p, jsi_Pline *line) ;
static OpCodes *code_reserved(jsi_Pstate *p, jsi_Pline *line, int type, char *id);


text:
package org.broadinstitute.hellbender.utils.hmm.segmentation;

import org.broadinstitute.hdf5.Utils;
import org.broadinstitute.hellbender.tools.exome.SegmentTableColumn;
import org.broadinstitute.hellbender.tools.exome.Target;
import org.broadinstitute.hellbender.utils.SimpleInterval;
import org.broadinstitute.hellbender.utils.tsv.DataLine;
import org.broadinstitute.hellbender.utils.tsv.TableReader;

import java.io.File;
import java.io.IOException;
import java.util.function.Function;

/**
 * Reads {@link HiddenStateSegmentRecord} instances from a tab separated table file.
 *
 * @author Mehrtash Babadi <mehrtash@broadinstitute.org>
 * @author Valentin Ruano-Rubio <valentin@broadinstitute.org>
 */
public class HiddenStateSegmentRecordReader<S, T extends Target> extends TableReader<HiddenStateSegmentRecord<S, T>> {

    /**
     * The inverse call string factory maps a call string to its corresponding hidden state
     */
    private final Function<String, S> callStringParser;

    /**
     * Opens a reader on an a preexisting file.
     *
     * @param file the source file where to read from.
     * @param callStringParser  a map from call string to a hidden state
     *
     * @throws IllegalArgumentException if {@code file} is {@code null}.
     * @throws IOException if there is an issue trying to read the contents of the file.
     * @throws RuntimeException if there is a formatting issue within the file.
     */
    public HiddenStateSegmentRecordReader(final File file,
                                          final Function<String, S> callStringParser) throws IOException {
        super(file);
        this.callStringParser = Utils.nonNull(callStringParser);
    }

    @Override
    protected HiddenStateSegmentRecord<S, T> createRecord(DataLine dataLine) {
        final SimpleInterval interval = new SimpleInterval(
                dataLine.get(SegmentTableColumn.CONTIG),
                dataLine.getInt(SegmentTableColumn.START),
                dataLine.getInt(SegmentTableColumn.END)
        );
        final HiddenStateSegment<S, T> segment = new HiddenStateSegment<>(
                interval, dataLine.getInt(SegmentTableColumn.NUM_TARGETS),
                dataLine.getDouble(SegmentTableColumn.MEAN),
                dataLine.getDouble(SegmentTableColumn.SD),
                callStringParser.apply(dataLine.get(SegmentTableColumn.CALL)),
                dataLine.getDouble(SegmentTableColumn.EXACT_QUALITY),
                dataLine.getDouble(SegmentTableColumn.SOME_QUALITY),
                dataLine.getDouble(SegmentTableColumn.START_QUALITY),
                dataLine.getDouble(SegmentTableColumn.END_QUALITY),
                dataLine.getDouble(SegmentTableColumn.EVENT_QUALITY));

        return new HiddenStateSegmentRecord<>(
                dataLine.get(SegmentTableColumn.SAMPLE), segment);
    }
}


text:
<?php
namespace backend\controllers;

use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use yii\filters\VerbFilter;
use common\models\LoginForm;
use common\models\Profiles;
use common\models\Events;
use common\models\Sms;
use common\models\SmsResponse;
use common\models\SmsResponseSearch;
/**
 * Site controller
 */
class SiteController extends Controller
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'only' => ['index','create','view','update','delete','logout'],
                'rules' => [
                    [
                        'actions' => ['index','create','view','update','delete','logout'],
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'logout' => ['post'],
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

    /**
     * @inheritdoc
     */
    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
        ];
    }

public function beforeAction($action)
{
    if ($action->id == 'sendsms' ) {
        $this->enableCsrfValidation = false;
    }
    return parent::beforeAction($action);
}

    /**
     * Displays homepage.
     *
     * @return string
     */
    public function actionIndex()
    {
        $groom_count = Profiles::find()->where(['gender'=>'m'])->count();
        $bride_count = Profiles::find()->where(['gender'=>'f'])->count();

        $event_count = Events::find()->count();
        return $this->render('index',['groom_count' => $groom_count,'bride_count' => $bride_count,'event_count' => $event_count]);
    }

     public function actionSendsms()
    {

        $model =  new Sms();
        $smsresponse = new SmsResponse();
        if($model->load(Yii::$app->request->post())){

            $number = $model->msisdn;
            $msg = $model->msg;

            $response = Yii::$app->SmsResponse->getResponse($number,$msg);
            $resArr = array();
            $resArr = json_decode($response);
            for ($i=0; $i < sizeof($resArr->MessageData) ; $i++) {
                $smsresponse->setIsNewRecord(true);
                $smsresponse->id = null;
                $smsresponse->error_code = $resArr->ErrorCode;
                $smsresponse->error_message = $resArr->ErrorMessage;
                $smsresponse->jobid = $resArr->JobId;
                $smsresponse->number=$resArr->MessageData[$i]->Number;
                $smsresponse->msg_id=$resArr->MessageData[$i]->MessageParts[0]->MsgId;
                $smsresponse->part_id=$resArr->MessageData[$i]->MessageParts[0]->PartId;
                $smsresponse->message=$resArr->MessageData[$i]->MessageParts[0]->Text;
                if($smsresponse->save()){

                    return $this->render('send_sms',['model' =>$model]);
                }

            }
            // exit;
        }

        return $this->render('send_sms',['model' =>$model]);
    }

   /**
     * Login action.
     *
     * @return string
     */
    public function actionLogin()
    {
        $this->layout='nonav';
        if (!Yii::$app->user->isGuest) {
            return $this->goHome();
        }

        $model = new LoginForm();
        if ($model->load(Yii::$app->request->post()) && $model->login()) {
            return $this->goBack();
        } else {
            return $this->render('login', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Logout action.
     *
     * @return string
     */
    public function actionLogout()
    {
        Yii::$app->user->logout();

        return $this->goHome();
    }

    public function actionMessages($id)
    {
        $messages = \common\models\Events::find()
                ->where(['id' => $id])
                ->all();

        if(count($messages)>0){
            foreach($messages as $message){
                echo $message->sms;
            }
        }
        else{
            echo "Please Type something";
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/titleTextView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#FFAC83"
        android:padding="7dp"
        android:text="@string/items_title"
        android:textSize="22sp" />

    <TextView
        android:id="@+id/pubDateTextView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#FFAC83"
        android:paddingLeft="7dp"
        android:text="@string/item_pub_date" />

    <ListView
        android:id="@+id/itemsListView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>


text:
package org.apache.syncope.client.ui.commons;

import com.googlecode.wicket.jquery.core.Options;
import com.googlecode.wicket.kendo.ui.widget.notification.Notification;
import com.googlecode.wicket.kendo.ui.widget.notification.NotificationBehavior;
import java.io.Serializable;
import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;

public class StyledNotificationBehavior extends NotificationBehavior {

    private static final long serialVersionUID = -3985689554352173472L;

    private static final String AUTOHIDEAFTER_GOOD = "3000";

    private static final String AUTOHIDEAFTER_BAD = "0";

    public StyledNotificationBehavior(final String selector, final Options options) {
        super(selector, options);
    }

    @Override
    public void show(final IPartialPageRequestHandler handler, final Serializable message, final String level) {
        if (handler != null) {
            handler.appendJavaScript(jQueryShow(this.format(String.valueOf(message), level), this.widget(), level));
        }
    }

    public static String jQueryShow(final CharSequence message, final String widget, final String level) {
        return String.format("%s.options.autoHideAfter = %s; %s.show( { message: '%s' } , '%s');",
                widget,
                Notification.SUCCESS.equalsIgnoreCase(level) || Notification.INFO.equalsIgnoreCase(level)
                ? AUTOHIDEAFTER_GOOD : AUTOHIDEAFTER_BAD,
                widget,
                message,
                level.toLowerCase());
    }
}


text:
package com.google.security.zynamics.binnavi.debug.models.processlist;

import com.google.security.zynamics.binnavi.Log.NaviLogger;

import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

/**
 * Used to store information about a list of processes.
 */
public final class ProcessList implements Iterable<ProcessDescription> {
  /**
   * Processes in the list.
   */
  private final List<ProcessDescription> processes;

  /**
   * Creates a new process list.
   *
   * @param processes Processes in the list.
   */
  private ProcessList(final List<ProcessDescription> processes) {
    this.processes = processes;
  }

  /**
   * Parses a process list in binary form.
   *
   * @param data The binary data.
   *
   * @return The parsed process list.
   *
   * @throws ParserConfigurationException Thrown if there was a problem with the parser
   *         configuration.
   * @throws SAXException Thrown if the process list could not be parsed.
   * @throws IOException Thrown if the process list could not be read.
   */
  public static ProcessList parse(final byte[] data) throws ParserConfigurationException,
      SAXException, IOException {
    final List<ProcessDescription> processes = new ArrayList<>();
    final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    final DocumentBuilder builder = factory.newDocumentBuilder();
    final Document document = builder.parse(new ByteArrayInputStream(data, 0, data.length));
    final NodeList nodes = document.getFirstChild().getChildNodes();
    for (int i = 0; i < nodes.getLength(); ++i) {
      final Node node = nodes.item(i);
      final String nodeName = node.getNodeName();
      if ("Process".equals(nodeName)) {
        final String pid = node.getAttributes().getNamedItem("pid").getNodeValue();
        final String name = node.getAttributes().getNamedItem("name").getNodeValue();
        processes.add(new ProcessDescription(Integer.valueOf(pid), name));
      } else {
        NaviLogger.severe("Error: Unknown node name " + nodeName);
      }
    }
    return new ProcessList(processes);
  }

  /**
   * Returns the process description with the given index.
   *
   * @param index The index of the process description.
   *
   * @return The process description at the given index.
   */
  public ProcessDescription get(final int index) {
    return processes.get(index);
  }

  @Override
  public Iterator<ProcessDescription> iterator() {
    return processes.iterator();
  }

  /**
   * Returns the number of known processes in the process list.
   *
   * @return The number of known processes in the process list.
   */
  public int size() {
    return processes.size();
  }
}


text:
<?php

namespace App\Core\Transformers;

use App\Core\Models\EmailLog;
use League\Fractal\TransformerAbstract;

class MailHistoryTransformer extends TransformerAbstract
{
    /**
     * @param EmailLog $emailLog
     *
     * @return array
     */
    public function transform(EmailLog $emailLog)
    {
        $data = [
            'id'         => $emailLog->id,
            'message_id' => $emailLog->message_id,
            'from'       => $this->presentFrom($emailLog),
            'url'        => route('admin::mail::show', [$emailLog]),
            'reply_to'   => $emailLog->reply_to,
            'cc'         => $emailLog->cc,
            'bcc'        => $emailLog->bcc,
            'to'         => $emailLog->to,
            'subject'    => $emailLog->subject,
            'status'     => $emailLog->status,
            'html'       => $emailLog->html,
            'text'       => $emailLog->text,
            'created_at' => $emailLog->created_at->diffForHumans(),
            'delay_time' => $emailLog->delay_time,
            'recipients' => $emailLog->recipients->toArray(),
            'is_drafted' => $emailLog->is_drafted,
        ];

        return $data;
    }

    /**
     * @param EmailLog $emailLog
     *
     * @return mixed|string
     */
    private function presentFrom(EmailLog $emailLog)
    {
        if ($emailLog->from_name) {
            return $emailLog->from_name.' <'.$emailLog->from.'>';
        } else {
            return $emailLog->from;
        }
    }
}


text:
var express = require('express');
var path = require('path');
var bodyParser = require('body-parser');
var outfit = require('./routes/outfit');
var clothes = require('./routes/clothes');
var MongoClient = require('mongodb').MongoClient;
var assert = require('assert');

var app = express();
var db;

app.all('*', function(req, res, next) {
  req.db = db;
  next();
});
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.use('/', express.static('public'));
app.use('/node_modules', express.static(path.join(__dirname,
  '/node_modules/')));

app.use('/outfit', outfit);
app.use('/clothes', clothes);
// Connection URL
var url = 'mongodb://localhost:27017/outfit-generator';
// Use connect method to connect to the server
MongoClient.connect(url, function(err, database) {
  assert.equal(null, err);
  db = database;
  console.log("Connected successfully to server");
  var server = app.listen(3000, function() {
    console.log('Outfit Generator listening on: 3000!');
  });
  // server.close(function() {
  //   console.log('closing connection');
  //   db.close();
  // });
});


text:
root = File.expand_path(File.dirname(File.dirname(File.dirname(__FILE__))))
require "#{root}/spec/spec_helper"
require "#{root}/lib/pedump/unpacker"

describe PEdump::Unpacker do
  it "finds UPX" do
    PEdump::Unpacker.find("#{root}/samples/calc_upx.exe").should == PEdump::Unpacker::UPX
  end

  it "finds ARM UPX" do
    PEdump::Unpacker.find("#{root}/samples/arm_upx.exe").should == PEdump::Unpacker::UPX
  end

  it "finds ASPack" do
    PEdump::Unpacker.find("#{root}/samples/calc.asp212.exe").should == PEdump::Unpacker::ASPack
  end

  it "finds nothing" do
    PEdump::Unpacker.find("#{root}/samples/calc.exe").should be_nil
  end
end


text:
Handlebars.registerHelper('canEdit', function(editEnds) {
    //this = appointment, only students can cancel appointments
    return new Date() < editEnds && Meteor.userId() === this.student;
});

Handlebars.registerHelper('getUserName', function(userId) {
    var user = Meteor.users.findOne(userId);
    return user ? user.username : 'Not available';
});

Handlebars.registerHelper('formatDate', function(date) {
    return moment(date).format(Settings.dateFormat);
});

Handlebars.registerHelper('formatTime', function(date) {
    return moment(date).format(Settings.timeFormat);
});

Handlebars.registerHelper('formatDateTime', function(date) {
    return moment(date).format(Settings.dateTimeFormat);
});

Handlebars.registerHelper('getRoundName', function(roundId) {
    var round = Rounds.findOne(roundId);
    return round.name;
});

Handlebars.registerHelper('selectedCourse', function() {
    return Session.get('selectedCourse');
});

Handlebars.registerHelper('myCourses', function() {
    // it is enough to just return all courses, as subscriptions handle
    // permissions.
    return Courses.find();
});

// from lib/helpers.js
Handlebars.registerHelper('isCourseStaff', function() {
    var course = Session.get('selectedCourse');
    if (course) {
        return isCourseStaff(Meteor.userId(), course.code);
    } else {
        return false;
    }
});

// this is for the basic layout, but as it is not a template, the function must
// be added globally
Handlebars.registerHelper('timeZoneInfo',function() {
    var serverZone = Session.get('serverTimeZone');
    var localZone = moment().format('Z');
    if (serverZone && serverZone !== localZone) {
        return {
            local: localZone,
            remote: serverZone
        };
    }
});


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Presenter
{
    public partial class Viewer : Form
    {
        public Viewer(int ScreenNum)
        {
            InitializeComponent();
            var r = Screen.AllScreens[ScreenNum].Bounds;
            this.Location = new Point(r.X, r.Y);
            this.Width = r.Width;
            this.Height = r.Height;
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Interface org.jruyi.common.IService (JRuyi API 1.2.0)</title>
<meta name="date" content="2014-02-20">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
org.jruyi.common.IService

Packages that use IService

Package
Description

org.jruyi.common

JRuyi Common Package Version 1.2

org.jruyi.io

JRuyi IO Package Version 1.2

Uses of IService in org.jruyi.common

Classes in org.jruyi.common that implement IService

Modifier and Type
Class and Description

class
Service

This class provides a default implementation for state transition of a
 service.

Uses of IService in org.jruyi.io

Subinterfaces of IService in org.jruyi.io

Modifier and Type
Interface and Description

interface
ISessionService

This interface defines all the methods that an IO session service need
 implement.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2014 JRuyi.org. All rights reserved.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">

    <TITLE>
        : Index
    </TITLE>
    <LINK REL="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

                    Package
                    Class
                    Tree

                    Deprecated

                      Index

                    Help

             PREV
             NEXT

            FRAMES
             NO FRAMES

A B C D E F
G H I L M O
P Q R S T U
Z

    A

AATree - class DataStructures.AATree.

Implements an AA-tree.

AATree() -
        Constructor for class DataStructures.AATree

Construct the tree.

advance() -
        Method in class DataStructures.LinkedListItr

Advance the current position to the next node in the list.

advance() -
        Method in class DataStructures.CursorListItr

Advance the current position to the next node in the list.

AvlTree - class DataStructures.AvlTree.

Implements an AVL tree.

AvlTree() -
        Constructor for class DataStructures.AvlTree

Construct the tree.

    B

BinaryHeap - class DataStructures.BinaryHeap.

Implements a binary heap.

BinaryHeap() -
        Constructor for class DataStructures.BinaryHeap

Construct the binary heap.

BinaryHeap(int) -
        Constructor for class DataStructures.BinaryHeap

Construct the binary heap.

BinarySearchTree - class DataStructures.BinarySearchTree.

Implements an unbalanced binary search tree.

BinarySearchTree() -
        Constructor for class DataStructures.BinarySearchTree

Construct the tree.

BinomialQueue - class DataStructures.BinomialQueue.

Implements a binomial queue.

BinomialQueue() -
        Constructor for class DataStructures.BinomialQueue

Construct the binomial queue.

    C

Comparable - interface DataStructures.Comparable.

Protocol for Comparable objects.

compareTo(Comparable) -
        Method in class DataStructures.MyInteger

Implements the compareTo method.

compareTo(Comparable) -
        Method in interface DataStructures.Comparable

Compare this object with rhs.

CursorList - class DataStructures.CursorList.

Linked list implementation of the list
        using a header node; cursor version.

CursorList() -
        Constructor for class DataStructures.CursorList

Construct the list.

CursorListItr - class DataStructures.CursorListItr.

Linked list implementation of the list iterator
        using a header node; cursor version.

    D

DataStructures - package DataStructures

decreaseKey(PairNode,
        Comparable) -
        Method in class DataStructures.PairHeap

Change the value of the item stored in the pairing heap.

deleteMin() -
        Method in class DataStructures.BinomialQueue

Remove the smallest item from the priority queue.

deleteMin() -
        Method in class DataStructures.LeftistHeap

Remove the smallest item from the priority queue.

deleteMin() -
        Method in class DataStructures.BinaryHeap

Remove the smallest item from the priority queue.

deleteMin() -
        Method in class DataStructures.PairHeap

Remove the smallest item from the priority queue.

dequeue() -
        Method in class DataStructures.QueueAr

Return and remove the least recently inserted item from the queue.

DisjSetsFast - class DataStructures.DisjSetsFast.

Disjoint set class, using union by rank
        and path compression.

DisjSetsFast(int) -
        Constructor for class DataStructures.DisjSetsFast

Construct the disjoint sets object.

DSL - class DataStructures.DSL.

Implements a deterministic skip list.

DSL(Comparable) -
        Constructor for class DataStructures.DSL

Construct the DSL.

    E

enqueue(Object) -
        Method in class DataStructures.QueueAr

Insert a new item into the queue.

equals(Object) -
        Method in class DataStructures.MyInteger

Implements the equals method.

    F

find(Comparable) -
        Method in class DataStructures.BinarySearchTree

Find an item in the tree.

find(Comparable) -
        Method in class DataStructures.SplayTree

Find an item in the tree.

find(Comparable) -
        Method in class DataStructures.AATree

Find an item in the tree.

find(Comparable) -
        Method in class DataStructures.DSL

Find an item in the DSL.

find(Comparable) -
        Method in class DataStructures.RedBlackTree

Find an item in the tree.

find(Comparable) -
        Method in class DataStructures.AvlTree

Find an item in the tree.

find(Comparable) -
        Method in class DataStructures.Treap

Find an item in the tree.

find(Hashable)
        -
        Method in class DataStructures.SeparateChainingHashTable

Find an item in the hash table.

find(Hashable)
        -
        Method in class DataStructures.QuadraticProbingHashTable

Find an item in the hash table.

find(int) -
        Method in class DataStructures.DisjSetsFast

Perform a find with path compression.

find(Object) -
        Method in class DataStructures.CursorList

Return iterator corresponding to the first node containing an item.

find(Object) -
        Method in class DataStructures.LinkedList

Return iterator corresponding to the first node containing an item.

findMax() -
        Method in class DataStructures.BinarySearchTree

Find the largest item in the tree.

findMax() -
        Method in class DataStructures.SplayTree

Find the largest item in the tree.

findMax() -
        Method in class DataStructures.AATree

Find the largest item in the tree.

findMax() -
        Method in class DataStructures.DSL

Find the largest item in the DSL.

findMax() -
        Method in class DataStructures.RedBlackTree

Find the largest item in the tree.

findMax() -
        Method in class DataStructures.AvlTree

Find the largest item in the tree.

findMax() -
        Method in class DataStructures.Treap

Find the largest item in the tree.

findMin() -
        Method in class DataStructures.BinomialQueue

Find the smallest item in the priority queue.

findMin() -
        Method in class DataStructures.BinarySearchTree

Find the smallest item in the tree.

findMin() -
        Method in class DataStructures.SplayTree

Find the smallest item in the tree.

findMin() -
        Method in class DataStructures.AATree

Find the smallest item in the tree.

findMin() -
        Method in class DataStructures.DSL

Find the smallest item in the DSL.

findMin() -
        Method in class DataStructures.RedBlackTree

Find the smallest item the tree.

findMin() -
        Method in class DataStructures.AvlTree

Find the smallest item in the tree.

findMin() -
        Method in class DataStructures.LeftistHeap

Find the smallest item in the priority queue.

findMin() -
        Method in class DataStructures.Treap

Find the smallest item in the tree.

findMin() -
        Method in class DataStructures.BinaryHeap

Find the smallest item in the priority queue.

findMin() -
        Method in class DataStructures.PairHeap

Find the smallest item in the priority queue.

findPrevious(Object) -
        Method in class DataStructures.CursorList

Return iterator prior to the first node containing an item.

findPrevious(Object) -
        Method in class DataStructures.LinkedList

Return iterator prior to the first node containing an item.

first() -
        Method in class DataStructures.CursorList

Return an iterator representing the first node in the list.

first() -
        Method in class DataStructures.LinkedList

Return an iterator representing the first node in the list.

    G

getFront() -
        Method in class DataStructures.QueueAr

Get the least recently inserted item in the queue.

    H

hash(int) -
        Method in class DataStructures.MyInteger

Implements the hash method.

hash(int) -
        Method in interface DataStructures.Hashable

Compute a hash function for this object.

hash(String, int)
        -
        Static method in class DataStructures.SeparateChainingHashTable

A hash routine for String objects.

hash(String, int)
        -
        Static method in class DataStructures.QuadraticProbingHashTable

A hash routine for String objects.

Hashable - interface DataStructures.Hashable.

Protocol for Hashable objects.

heapsort(Comparable[]) -
        Static method in class DataStructures.Sort

Standard heapsort.

    I

insert(Comparable) -
        Method in class DataStructures.BinomialQueue

Insert into the priority queue, maintaining heap order.

insert(Comparable) -
        Method in class DataStructures.BinarySearchTree

Insert into the tree; duplicates are ignored.

insert(Comparable) -
        Method in class DataStructures.SplayTree

Insert into the tree.

insert(Comparable) -
        Method in class DataStructures.AATree

Insert into the tree.

insert(Comparable) -
        Method in class DataStructures.DSL

Insert into the DSL.

insert(Comparable) -
        Method in class DataStructures.RedBlackTree

Insert into the tree.

insert(Comparable) -
        Method in class DataStructures.AvlTree

Insert into the tree; duplicates are ignored.

insert(Comparable) -
        Method in class DataStructures.LeftistHeap

Insert into the priority queue, maintaining heap order.

insert(Comparable) -
        Method in class DataStructures.Treap

Insert into the tree.

insert(Comparable) -
        Method in class DataStructures.BinaryHeap

Insert into the priority queue, maintaining heap order.

insert(Comparable) -
        Method in class DataStructures.PairHeap

Insert into the priority queue, and return a PairNode
        that can be used by decreaseKey.

insert(Hashable)
        -
        Method in class DataStructures.SeparateChainingHashTable

Insert into the hash table.

insert(Hashable)
        -
        Method in class DataStructures.QuadraticProbingHashTable

Insert into the hash table.

insert(Object,
        CursorListItr) -
        Method in class DataStructures.CursorList

Insert after p.

insert(Object,
        LinkedListItr) -
        Method in class DataStructures.LinkedList

Insert after p.

insertionSort(Comparable[])
        -
        Static method in class DataStructures.Sort

Simple insertion sort.

intValue() -
        Method in class DataStructures.MyInteger

Gets the stored int value.

isEmpty() -
        Method in class DataStructures.BinomialQueue

Test if the priority queue is logically empty.

isEmpty() -
        Method in class DataStructures.StackLi

Test if the stack is logically empty.

isEmpty() -
        Method in class DataStructures.QueueAr

Test if the queue is logically empty.

isEmpty() -
        Method in class DataStructures.CursorList

Test if the list is logically empty.

isEmpty() -
        Method in class DataStructures.BinarySearchTree

Test if the tree is logically empty.

isEmpty() -
        Method in class DataStructures.SplayTree

Test if the tree is logically empty.

isEmpty() -
        Method in class DataStructures.AATree

Test if the tree is logically empty.

isEmpty() -
        Method in class DataStructures.LinkedList

Test if the list is logically empty.

isEmpty() -
        Method in class DataStructures.DSL

Test if the DSL is logically empty.

isEmpty() -
        Method in class DataStructures.RedBlackTree

Test if the tree is logically empty.

isEmpty() -
        Method in class DataStructures.AvlTree

Test if the tree is logically empty.

isEmpty() -
        Method in class DataStructures.StackAr

Test if the stack is logically empty.

isEmpty() -
        Method in class DataStructures.LeftistHeap

Test if the priority queue is logically empty.

isEmpty() -
        Method in class DataStructures.Treap

Test if the tree is logically empty.

isEmpty() -
        Method in class DataStructures.BinaryHeap

Test if the priority queue is logically empty.

isEmpty() -
        Method in class DataStructures.PairHeap

Test if the priority queue is logically empty.

isFull() -
        Method in class DataStructures.BinomialQueue

Test if the priority queue is logically full.

isFull() -
        Method in class DataStructures.StackLi

Test if the stack is logically full.

isFull() -
        Method in class DataStructures.QueueAr

Test if the queue is logically full.

isFull() -
        Method in class DataStructures.StackAr

Test if the stack is logically full.

isFull() -
        Method in class DataStructures.LeftistHeap

Test if the priority queue is logically full.

isFull() -
        Method in class DataStructures.BinaryHeap

Test if the priority queue is logically full.

isPastEnd() -
        Method in class DataStructures.LinkedListItr

Test if the current position is past the end of the list.

isPastEnd() -
        Method in class DataStructures.CursorListItr

Test if the current position is past the end of the list.

    L

LeftistHeap - class DataStructures.LeftistHeap.

Implements a leftist heap.

LeftistHeap() -
        Constructor for class DataStructures.LeftistHeap

Construct the leftist heap.

LinkedList - class DataStructures.LinkedList.

Linked list implementation of the list
        using a header node.

LinkedList() -
        Constructor for class DataStructures.LinkedList

Construct the list

LinkedListItr - class DataStructures.LinkedListItr.

Linked list implementation of the list iterator
        using a header node.

    M

main(String[]) -
        Static method in class DataStructures.BinomialQueue

main(String[]) -
        Static method in class DataStructures.StackLi

main(String[]) -
        Static method in class DataStructures.QueueAr

main(String[]) -
        Static method in class DataStructures.CursorList

main(String[]) -
        Static method in class DataStructures.BinarySearchTree

main(String[]) -
        Static method in class DataStructures.SplayTree

main(String[]) -
        Static method in class DataStructures.Sort

main(String[]) -
        Static method in class DataStructures.AATree

main(String[]) -
        Static method in class DataStructures.LinkedList

main(String[]) -
        Static method in class DataStructures.DSL

main(String[]) -
        Static method in class DataStructures.SeparateChainingHashTable

main(String[]) -
        Static method in class DataStructures.RedBlackTree

main(String[]) -
        Static method in class DataStructures.Random

main(String[]) -
        Static method in class DataStructures.AvlTree

main(String[]) -
        Static method in class DataStructures.StackAr

main(String[]) -
        Static method in class DataStructures.QuadraticProbingHashTable

main(String[]) -
        Static method in class DataStructures.LeftistHeap

main(String[]) -
        Static method in class DataStructures.Treap

main(String[]) -
        Static method in class DataStructures.BinaryHeap

main(String[]) -
        Static method in class DataStructures.PairHeap

main(String[]) -
        Static method in class DataStructures.DisjSetsFast

makeEmpty() -
        Method in class DataStructures.BinomialQueue

Make the priority queue logically empty.

makeEmpty() -
        Method in class DataStructures.StackLi

Make the stack logically empty.

makeEmpty() -
        Method in class DataStructures.QueueAr

Make the queue logically empty.

makeEmpty() -
        Method in class DataStructures.CursorList

Make the list logically empty.

makeEmpty() -
        Method in class DataStructures.BinarySearchTree

Make the tree logically empty.

makeEmpty() -
        Method in class DataStructures.SplayTree

Make the tree logically empty.

makeEmpty() -
        Method in class DataStructures.AATree

Make the tree logically empty.

makeEmpty() -
        Method in class DataStructures.LinkedList

Make the list logically empty.

makeEmpty() -
        Method in class DataStructures.DSL

Make the DSL logically empty.

makeEmpty() -
        Method in class DataStructures.SeparateChainingHashTable

Make the hash table logically empty.

makeEmpty() -
        Method in class DataStructures.RedBlackTree

Make the tree logically empty.

makeEmpty() -
        Method in class DataStructures.AvlTree

Make the tree logically empty.

makeEmpty() -
        Method in class DataStructures.StackAr

Make the stack logically empty.

makeEmpty() -
        Method in class DataStructures.QuadraticProbingHashTable

Make the hash table logically empty.

makeEmpty() -
        Method in class DataStructures.LeftistHeap

Make the priority queue logically empty.

makeEmpty() -
        Method in class DataStructures.Treap

Make the tree logically empty.

makeEmpty() -
        Method in class DataStructures.BinaryHeap

Make the priority queue logically empty.

makeEmpty() -
        Method in class DataStructures.PairHeap

Make the priority queue logically empty.

merge(BinomialQueue)
        -
        Method in class DataStructures.BinomialQueue

Merge rhs into the priority queue.

merge(LeftistHeap) -
        Method in class DataStructures.LeftistHeap

Merge rhs into the priority queue.

mergeSort(Comparable[]) -
        Static method in class DataStructures.Sort

Mergesort algorithm.

MyInteger - class DataStructures.MyInteger.

Wrapper class for use with generic data structures.

MyInteger() -
        Constructor for class DataStructures.MyInteger

Construct the MyInteger object with initial value 0.

MyInteger(int) -
        Constructor for class DataStructures.MyInteger

Construct the MyInteger object.

    O

Overflow - exception DataStructures.Overflow.

Exception class for access in full containers
        such as stacks, queues, and priority queues.

Overflow() -
        Constructor for class DataStructures.Overflow

    P

PairHeap - class DataStructures.PairHeap.

Implements a pairing heap.

PairHeap() -
        Constructor for class DataStructures.PairHeap

Construct the pairing heap.

PairNode - class DataStructures.PairNode.

Public class for use with PairHeap.

permute(Object[]) -
        Static method in class DataStructures.Random

Randomly rearrange an array.

pop() -
        Method in class DataStructures.StackLi

Remove the most recently inserted item from the stack.

pop() -
        Method in class DataStructures.StackAr

Remove the most recently inserted item from the stack.

printList(CursorList) -
        Static method in class DataStructures.CursorList

printList(LinkedList) -
        Static method in class DataStructures.LinkedList

printTree() -
        Method in class DataStructures.BinarySearchTree

Print the tree contents in sorted order.

printTree() -
        Method in class DataStructures.SplayTree

Print the tree contents in sorted order.

printTree() -
        Method in class DataStructures.AATree

Print the tree contents in sorted order.

printTree() -
        Method in class DataStructures.RedBlackTree

Print the tree contents in sorted order.

printTree() -
        Method in class DataStructures.AvlTree

Print the tree contents in sorted order.

printTree() -
        Method in class DataStructures.Treap

Print the tree contents in sorted order.

push(Object) -
        Method in class DataStructures.StackLi

Insert a new item into the stack.

push(Object) -
        Method in class DataStructures.StackAr

Insert a new item into the stack, if not already full.

    Q

QuadraticProbingHashTable - class
        DataStructures.QuadraticProbingHashTable.

Probing table implementation of hash tables.

QuadraticProbingHashTable()
        -
        Constructor for class DataStructures.QuadraticProbingHashTable

Construct the hash table.

QuadraticProbingHashTable(int)
        -
        Constructor for class DataStructures.QuadraticProbingHashTable

Construct the hash table.

QueueAr - class DataStructures.QueueAr.

Array-based implementation of the queue.

QueueAr() -
        Constructor for class DataStructures.QueueAr

Construct the queue.

QueueAr(int) -
        Constructor for class DataStructures.QueueAr

Construct the queue.

quickSelect(Comparable[],
        int) -
        Static method in class DataStructures.Sort

Quick selection algorithm.

quicksort(Comparable[]) -
        Static method in class DataStructures.Sort

Quicksort algorithm.

    R

Random - class DataStructures.Random.

Random number class, using a 31-bit
        linear congruential generator.

Random() -
        Constructor for class DataStructures.Random

Construct this Random object with
        initial state obtained from system clock.

Random(int) -
        Constructor for class DataStructures.Random

Construct this Random object with
        specified initial state.

random0_1() -
        Method in class DataStructures.Random

Return a pseudorandom double in the open range 0..1
        and change the internal state.

randomInt() -
        Method in class DataStructures.Random

Return a pseudorandom int, and change the
        internal state.

randomInt(int, int) -
        Method in class DataStructures.Random

Return an int in the closed range [low,high], and
        change the internal state.

randomIntWRONG() -
        Method in class DataStructures.Random

Return a pseudorandom int, and change the
        internal state.

randomLong(long, long) -
        Method in class DataStructures.Random

Return an long in the closed range [low,high], and
        change the internal state.

RedBlackTree - class DataStructures.RedBlackTree.

Implements a red-black tree.

        RedBlackTree(Comparable)
        -
        Constructor for class DataStructures.RedBlackTree

Construct the tree.

remove(Comparable) -
        Method in class DataStructures.BinarySearchTree

Remove from the tree.

remove(Comparable) -
        Method in class DataStructures.SplayTree

Remove from the tree.

remove(Comparable) -
        Method in class DataStructures.AATree

Remove from the tree.

remove(Comparable) -
        Method in class DataStructures.DSL

Remove from the DSL.

remove(Comparable) -
        Method in class DataStructures.RedBlackTree

Remove from the tree.

remove(Comparable) -
        Method in class DataStructures.AvlTree

Remove from the tree.

remove(Comparable) -
        Method in class DataStructures.Treap

Remove from the tree.

remove(Hashable)
        -
        Method in class DataStructures.SeparateChainingHashTable

Remove from the hash table.

remove(Hashable)
        -
        Method in class DataStructures.QuadraticProbingHashTable

Remove from the hash table.

remove(Object) -
        Method in class DataStructures.CursorList

Remove the first occurrence of an item.

remove(Object) -
        Method in class DataStructures.LinkedList

Remove the first occurrence of an item.

retrieve() -
        Method in class DataStructures.LinkedListItr

Return the item stored in the current position.

retrieve() -
        Method in class DataStructures.CursorListItr

Return the item stored in the current position.

    S

SeparateChainingHashTable - class
        DataStructures.SeparateChainingHashTable.

Separate chaining table implementation of hash tables.

SeparateChainingHashTable()
        -
        Constructor for class DataStructures.SeparateChainingHashTable

Construct the hash table.

SeparateChainingHashTable(int)
        -
        Constructor for class DataStructures.SeparateChainingHashTable

Construct the hash table.

shellsort(Comparable[]) -
        Static method in class DataStructures.Sort

Shellsort, using Shell's (poor) increments.

Sort - class DataStructures.Sort.

A class that contains several sorting routines,
        implemented as static methods.

Sort() -
        Constructor for class DataStructures.Sort

SplayTree - class DataStructures.SplayTree.

Implements a top-down splay tree.

SplayTree() -
        Constructor for class DataStructures.SplayTree

Construct the tree.

StackAr - class DataStructures.StackAr.

Array-based implementation of the stack.

StackAr() -
        Constructor for class DataStructures.StackAr

Construct the stack.

StackAr(int) -
        Constructor for class DataStructures.StackAr

Construct the stack.

StackLi - class DataStructures.StackLi.

List-based implementation of the stack.

StackLi() -
        Constructor for class DataStructures.StackLi

Construct the stack.

swapReferences(Object[], int,
        int) -
        Static method in class DataStructures.Sort

Method to swap to elements in an array.

    T

top() -
        Method in class DataStructures.StackLi

Get the most recently inserted item in the stack.

top() -
        Method in class DataStructures.StackAr

Get the most recently inserted item in the stack.

topAndPop() -
        Method in class DataStructures.StackLi

Return and remove the most recently inserted item from the stack.

topAndPop() -
        Method in class DataStructures.StackAr

Return and remove most recently inserted item from the stack.

toString() -
        Method in class DataStructures.MyInteger

Implements the toString method.

Treap - class DataStructures.Treap.

Implements a treap.

Treap() -
        Constructor for class DataStructures.Treap

Construct the treap.

    U

Underflow - exception DataStructures.Underflow.

Exception class for access in empty containers
        such as stacks, queues, and priority queues.

Underflow() -
        Constructor for class DataStructures.Underflow

union(int, int) -
        Method in class DataStructures.DisjSetsFast

Union two disjoint sets using the height heuristic.

    Z

zeroth() -
        Method in class DataStructures.CursorList

Return an iterator representing the header node.

zeroth() -
        Method in class DataStructures.LinkedList

Return an iterator representing the header node.

A B C D E F
G H I L M O
P Q R S T U
Z

                    Package
                    Class
                    Tree

                    Deprecated

                      Index

                    Help

             PREV
             NEXT

            FRAMES
             NO FRAMES


text:
function ViewModel() {
    this.topic = ko.observable("");
    this.investigate = function() {
        var self = this;
        var topic = self.topic();
        if(topic.length !== 0) {
            self.topic("");
            $.getJSON("/api/" + encodeURIComponent(topic), function(data) {
                self.answers.unshift(
                    JSON.stringify(data)
                );
            })
        }
    };
    this.answers = ko.observableArray();
}


text:
"""check method hidding ancestor attribute
"""
from __future__ import print_function

class Abcd(object):
    """dummy"""
    def __init__(self):
        self.abcd = 1

class Cdef(Abcd):
    """dummy"""
    def abcd(self): # [method-hidden]
        """test
        """
        print(self)

class AbcdMixin:
    def abcd(self):
        pass

class Dabc(AbcdMixin, Abcd):
    def abcd(self):
        pass

class CustomProperty:
    """dummy"""
    def __init__(self, _):
        pass

    def __get__(self, obj, __):
        if not obj:
            return self
        return 5

    def __set__(self, _, __):
        pass

class Ddef:
    """dummy"""
    def __init__(self):
        self.five = "five"

    @CustomProperty
    def five(self):
        """Always 5."""
        return self

def my_decorator(*args, **kwargs):
    return CustomProperty(*args, **kwargs)

class Foo:
    def __init__(self):
        self._bar = 42
        self._baz = 84

    @my_decorator
    def method(self):  # E0202
        return self._baz

    @method.setter
    def method(self, value):
        self._baz = value

    def do_something_with_baz(self, value):
        self.method = value

class One:
    def __init__(self, one=None):
        if one is not None:
            self.one = one

    def one(self): # [method-hidden]
        pass

class Two(One):
    def one(self):
        pass

try:
    import unknown as js
except ImportError:
    import json as js

class JsonEncoder(js.JSONEncoder):
    # pylint: disable=useless-super-delegation,super-with-arguments
    def default(self, o):
        return super(JsonEncoder, self).default(o)


text:
<?php
namespace Concrete\Controller\Dialog\Search;

use Concrete\Controller\Backend\UserInterface as BackendInterfaceController;
use Concrete\Controller\Element\Search\SearchFieldSelector;
use Concrete\Core\Support\Facade\Application;
use Concrete\Controller\Element\Search\CustomizeResults;
use Concrete\Core\Entity\Search\Query;
use Concrete\Core\Entity\Search\SavedSearch;
use Concrete\Core\Search\Field\Field\KeywordsField;
use Concrete\Core\Search\ProviderInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Doctrine\ORM\EntityManager;
use Exception;

abstract class AdvancedSearch extends BackendInterfaceController
{
    protected $viewPath = '/dialogs/search/advanced_search';
    protected $supportsSavedSearch = true;
    public $objectID = null;

    public function getObjectID()
    {
        return (string) $this->objectID;
    }

    abstract public function getFieldManager();

    abstract public function getSavedSearchBaseURL(SavedSearch $search);

    abstract public function getBasicSearchBaseURL();

    abstract public function getCurrentSearchBaseURL();

    abstract public function getSavedSearchEntity();

    public function getAddFieldAction()
    {
        return $this->action('add_field');
    }

    public function getSubmitAction()
    {
        return $this->action('submit');
    }

    /**
     * @return ProviderInterface
     */
    abstract public function getSearchProvider();

    protected function onAfterSavePreset(SavedSearch $search)
    {
        return;
    }

    public function getSearchQuery()
    {
        $query = new Query();
        $query->setFields([new KeywordsField()]);

        return $query;
    }

    protected function getRequestDefaultSort()
    {
        return $this->request->request->get('fSearchDefaultSort');
    }

    protected function getRequestDefaultSortDirection()
    {
        return $this->request->request->get('fSearchDefaultSortDirection');
    }

    protected function getSearchFieldSelectorElement()
    {
        $element = new SearchFieldSelector($this->getFieldManager(), $this->getAddFieldAction(), $this->getSearchQuery());
        return $element;
    }

    protected function getCustomizeResultsElement()
    {
        $provider = $this->getSearchProvider();
        $element = new CustomizeResults($provider);

        return $element;
    }

    protected function getSearchPresets()
    {
        $searchPresets = [];
        $app = Application::getFacadeApplication();
        $searchEntity = $this->getSavedSearchEntity();
        if (!empty($searchEntity)) {
            $searchPresets = $searchEntity->findAll();
        }

        return $searchPresets;
    }

    public function view()
    {
        $app = Application::getFacadeApplication();
        $this->set('customizeElement', $this->getCustomizeResultsElement());
        $this->set('searchFieldSelectorElement', $this->getSearchFieldSelectorElement());
        if ($this->supportsSavedSearch) {
            $this->set('searchPresets', $this->getSearchPresets());
        }
        $this->set('supportsSavedSearch', $this->supportsSavedSearch);
        $this->set('form', $app->make('helper/form'));
    }

    public function addField()
    {
        $manager = $this->getFieldManager();
        $field = $this->request->request->get('field');
        $field = $manager->getFieldByKey($field);
        if (is_object($field)) {
            return new JsonResponse($field);
        }
    }

    protected function getQueryFromRequest()
    {
        $query = new Query();
        $manager = $this->getFieldManager();
        $fields = $manager->getFieldsFromRequest($this->request->request->all());
        $provider = $this->getSearchProvider();

        $set = $provider->getBaseColumnSet();
        $available = $provider->getAvailableColumnSet();

        foreach ($this->request->request->get('column') as $key) {
            $set->addColumn($available->getColumnByKey($key));
        }

        $sort = $available->getColumnByKey($this->getRequestDefaultSort());
        $set->setDefaultSortColumn($sort, $this->getRequestDefaultSortDirection());

        $query->setFields($fields);
        $query->setColumns($set);

        $itemsPerPage = $this->getItemsPerPage();
        $query->setItemsPerPage($itemsPerPage);

        return $query;
    }

    public function savePreset()
    {
        if ($this->validateAction() && $this->supportsSavedSearch) {
            $app = Application::getFacadeApplication();
            $query = $this->getQueryFromRequest();
            if (is_object($query)) {
                $provider = $this->getSearchProvider();
                if (is_object($provider)) {
                    $em = $app->make(EntityManager::class);
                    $search = $provider->getSavedSearch();
                    if (is_object($search)) {
                        $search->setQuery($query);
                        $search->setPresetName($this->request->request->get('presetName'));
                        $em->persist($search);
                        $em->flush();

                        $this->onAfterSavePreset($search);

                        $result = $provider->getSearchResultFromQuery($query);
                        $result->setBaseURL($this->getSavedSearchBaseURL($search));

                        return new JsonResponse($result->getJSONObject());
                    }
                }
            }
        }
        throw new Exception(t('An error occurred while saving the search preset.'));
    }

    public function submit()
    {
        if ($this->validateAction()) {
            $query = $this->getQueryFromRequest();

            $provider = $this->getSearchProvider();
            $provider->setSessionCurrentQuery($query);

            $result = $provider->getSearchResultFromQuery($query);
            $result->setBaseURL($this->getCurrentSearchBaseURL());

            return new JsonResponse($result->getJSONObject());
        }
    }

    /**
     * @return int
     */
    private function getItemsPerPage()
    {
        return $this->request->request->get('fSearchItemsPerPage');
    }
}


text:
package executor

import (
	"fmt"
	"os"
	"testing"

	"github.com/mesos/mesos-go/mesosproto"
	util "github.com/mesos/mesos-go/mesosutil"
	"github.com/mesos/mesos-go/messenger"
	"github.com/mesos/mesos-go/upid"
	"github.com/stretchr/testify/assert"
)

var (
	slavePID    = "slave(1)@127.0.0.1:8080"
	slaveID     = "some-slave-id-uuid"
	frameworkID = "some-framework-id-uuid"
	executorID  = "some-executor-id-uuid"
)

func setEnvironments(t *testing.T, workDir string, checkpoint bool) {
	assert.NoError(t, os.Setenv("MESOS_SLAVE_PID", slavePID))
	assert.NoError(t, os.Setenv("MESOS_SLAVE_ID", slaveID))
	assert.NoError(t, os.Setenv("MESOS_FRAMEWORK_ID", frameworkID))
	assert.NoError(t, os.Setenv("MESOS_EXECUTOR_ID", executorID))
	if len(workDir) > 0 {
		assert.NoError(t, os.Setenv("MESOS_DIRECTORY", workDir))
	}
	if checkpoint {
		assert.NoError(t, os.Setenv("MESOS_CHECKPOINT", "1"))
	}
}

func clearEnvironments(t *testing.T) {
	assert.NoError(t, os.Setenv("MESOS_SLAVE_PID", ""))
	assert.NoError(t, os.Setenv("MESOS_SLAVE_ID", ""))
	assert.NoError(t, os.Setenv("MESOS_FRAMEWORK_ID", ""))
	assert.NoError(t, os.Setenv("MESOS_EXECUTOR_ID", ""))
}

func newTestExecutorDriver(t *testing.T, exec Executor) *MesosExecutorDriver {
	dconfig := DriverConfig{
		Executor: exec,
	}
	driver, err := NewMesosExecutorDriver(dconfig)
	if err != nil {
		t.Fatal(err)
	}
	return driver
}

type testExecutorDriver struct {
	*MesosExecutorDriver
}

func (e *testExecutorDriver) setConnected(b bool) {
	e.lock.Lock()
	defer e.lock.Unlock()
	e.connected = b
}

func createTestExecutorDriver(t *testing.T) (
	*testExecutorDriver,
	*messenger.MockedMessenger) {

	exec := NewMockedExecutor()
	exec.On("Error").Return(nil)

	setEnvironments(t, "", false)
	driver := newTestExecutorDriver(t, exec)

	messenger := messenger.NewMockedMessenger()
	messenger.On("Start").Return(nil)
	messenger.On("UPID").Return(upid.UPID{})
	messenger.On("Send").Return(nil)
	messenger.On("Stop").Return(nil)

	driver.messenger = messenger
	return &testExecutorDriver{driver}, messenger
}

func TestExecutorDriverStartFailedToParseEnvironment(t *testing.T) {
	clearEnvironments(t)
	exec := NewMockedExecutor()
	exec.On("Error").Return(nil)
	dconfig := DriverConfig{Executor: exec}
	driver, err := NewMesosExecutorDriver(dconfig)
	assert.Nil(t, driver)
	assert.Error(t, err)
}

func TestExecutorDriverStartFailedToStartMessenger(t *testing.T) {
	exec := NewMockedExecutor()

	setEnvironments(t, "", false)
	driver := newTestExecutorDriver(t, exec)
	assert.NotNil(t, driver)
	messenger := messenger.NewMockedMessenger()
	driver.messenger = messenger

	// Set expections and return values.
	messenger.On("Start").Return(fmt.Errorf("messenger failed to start"))
	messenger.On("Stop").Return(nil)

	status, err := driver.Start()
	assert.Error(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_NOT_STARTED, status)

	messenger.Stop()

	messenger.AssertNumberOfCalls(t, "Start", 1)
	messenger.AssertNumberOfCalls(t, "Stop", 1)
}

func TestExecutorDriverStartFailedToSendRegisterMessage(t *testing.T) {
	exec := NewMockedExecutor()

	setEnvironments(t, "", false)
	driver := newTestExecutorDriver(t, exec)
	messenger := messenger.NewMockedMessenger()
	driver.messenger = messenger

	// Set expections and return values.
	messenger.On("Start").Return(nil)
	messenger.On("UPID").Return(upid.UPID{})
	messenger.On("Send").Return(fmt.Errorf("messenger failed to send"))
	messenger.On("Stop").Return(nil)

	status, err := driver.Start()
	assert.Error(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_NOT_STARTED, status)

	messenger.AssertNumberOfCalls(t, "Start", 1)
	messenger.AssertNumberOfCalls(t, "UPID", 1)
	messenger.AssertNumberOfCalls(t, "Send", 1)
	messenger.AssertNumberOfCalls(t, "Stop", 1)
}

func TestExecutorDriverStartSucceed(t *testing.T) {
	setEnvironments(t, "", false)

	exec := NewMockedExecutor()
	exec.On("Error").Return(nil)

	driver := newTestExecutorDriver(t, exec)

	messenger := messenger.NewMockedMessenger()
	driver.messenger = messenger
	messenger.On("Start").Return(nil)
	messenger.On("UPID").Return(upid.UPID{})
	messenger.On("Send").Return(nil)
	messenger.On("Stop").Return(nil)

	assert.False(t, driver.Running())
	status, err := driver.Start()
	assert.True(t, driver.Running())
	assert.NoError(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, status)

	messenger.AssertNumberOfCalls(t, "Start", 1)
	messenger.AssertNumberOfCalls(t, "UPID", 1)
	messenger.AssertNumberOfCalls(t, "Send", 1)
}

func TestExecutorDriverRun(t *testing.T) {
	setEnvironments(t, "", false)

	// Set expections and return values.
	messenger := messenger.NewMockedMessenger()
	messenger.On("Start").Return(nil)
	messenger.On("UPID").Return(upid.UPID{})
	messenger.On("Send").Return(nil)
	messenger.On("Stop").Return(nil)

	exec := NewMockedExecutor()
	exec.On("Error").Return(nil)

	driver := newTestExecutorDriver(t, exec)
	driver.messenger = messenger
	assert.False(t, driver.Running())

	ch := make(chan struct{})
	go func() {
		defer close(ch)
		stat, err := driver.Run()
		assert.NoError(t, err)
		assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, stat)
	}()
	<-driver.started
	assert.True(t, driver.Running())
	driver.Stop()
	<-ch
}

func TestExecutorDriverJoin(t *testing.T) {
	setEnvironments(t, "", false)

	// Set expections and return values.
	messenger := messenger.NewMockedMessenger()
	messenger.On("Start").Return(nil)
	messenger.On("UPID").Return(upid.UPID{})
	messenger.On("Send").Return(nil)
	messenger.On("Stop").Return(nil)

	exec := NewMockedExecutor()
	exec.On("Error").Return(nil)

	driver := newTestExecutorDriver(t, exec)
	driver.messenger = messenger
	assert.False(t, driver.Running())

	stat, err := driver.Start()
	assert.NoError(t, err)
	assert.True(t, driver.Running())
	assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat)

	testCh := make(chan mesosproto.Status)
	go func() {
		stat, _ := driver.Join()
		testCh <- stat
	}()

	driver.Stop()
	stat = <-testCh // when Stop() is called, stat will be DRIVER_STOPPED.
	assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, stat)
}

func TestExecutorDriverAbort(t *testing.T) {
	statusChan := make(chan mesosproto.Status)
	driver, messenger := createTestExecutorDriver(t)

	assert.False(t, driver.Running())
	stat, err := driver.Start()
	assert.True(t, driver.Running())
	assert.NoError(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat)
	go func() {
		st, _ := driver.Join()
		statusChan <- st
	}()

	stat, err = driver.Abort()
	assert.NoError(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_ABORTED, stat)
	assert.Equal(t, mesosproto.Status_DRIVER_ABORTED, <-statusChan)
	assert.False(t, driver.Running())

	// Abort for the second time, should return directly.
	stat, err = driver.Abort()
	assert.Error(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_ABORTED, stat)
	stat, err = driver.Stop()
	assert.Error(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_ABORTED, stat)
	assert.False(t, driver.Running())

	// Restart should not start.
	stat, err = driver.Start()
	assert.False(t, driver.Running())
	assert.Error(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_ABORTED, stat)

	messenger.AssertNumberOfCalls(t, "Start", 1)
	messenger.AssertNumberOfCalls(t, "UPID", 1)
	messenger.AssertNumberOfCalls(t, "Send", 1)
	messenger.AssertNumberOfCalls(t, "Stop", 1)
}

func TestExecutorDriverStop(t *testing.T) {
	statusChan := make(chan mesosproto.Status)
	driver, messenger := createTestExecutorDriver(t)

	assert.False(t, driver.Running())
	stat, err := driver.Start()
	assert.True(t, driver.Running())
	assert.NoError(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat)
	go func() {
		stat, _ := driver.Join()
		statusChan <- stat
	}()
	stat, err = driver.Stop()
	assert.NoError(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, stat)
	assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, <-statusChan)
	assert.False(t, driver.Running())

	// Stop for the second time, should return directly.
	stat, err = driver.Stop()
	assert.Error(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, stat)
	stat, err = driver.Abort()
	assert.Error(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, stat)
	assert.False(t, driver.Running())

	// Restart should not start.
	stat, err = driver.Start()
	assert.False(t, driver.Running())
	assert.Error(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_STOPPED, stat)

	messenger.AssertNumberOfCalls(t, "Start", 1)
	messenger.AssertNumberOfCalls(t, "UPID", 1)
	messenger.AssertNumberOfCalls(t, "Send", 1)
	messenger.AssertNumberOfCalls(t, "Stop", 1)
}

func TestExecutorDriverSendStatusUpdate(t *testing.T) {

	driver, _ := createTestExecutorDriver(t)

	stat, err := driver.Start()
	assert.NoError(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat)
	driver.setConnected(true)

	taskStatus := util.NewTaskStatus(
		util.NewTaskID("test-task-001"),
		mesosproto.TaskState_TASK_RUNNING,
	)

	stat, err = driver.SendStatusUpdate(taskStatus)
	assert.NoError(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat)
}

func TestExecutorDriverSendStatusUpdateStaging(t *testing.T) {

	driver, _ := createTestExecutorDriver(t)
	stat, err := driver.Start()
	assert.NoError(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat)
	driver.setConnected(true)

	taskStatus := util.NewTaskStatus(
		util.NewTaskID("test-task-001"),
		mesosproto.TaskState_TASK_STAGING,
	)

	stat, err = driver.SendStatusUpdate(taskStatus)
	assert.Error(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_ABORTED, stat)
}

func TestExecutorDriverSendFrameworkMessage(t *testing.T) {

	driver, _ := createTestExecutorDriver(t)

	stat, err := driver.SendFrameworkMessage("failed")
	assert.Error(t, err)

	stat, err = driver.Start()
	assert.NoError(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat)
	driver.setConnected(true)

	stat, err = driver.SendFrameworkMessage("Testing Mesos")
	assert.NoError(t, err)
	assert.Equal(t, mesosproto.Status_DRIVER_RUNNING, stat)
}

func TestStatusUpdateAckRace_Issue103(t *testing.T) {
	driver, _ := createTestExecutorDriver(t)
	_, err := driver.Start()
	assert.NoError(t, err)

	msg := &mesosproto.StatusUpdateAcknowledgementMessage{}
	go func() {
		driver.lock.Lock()
		defer driver.lock.Unlock()
		driver.statusUpdateAcknowledgement(nil, msg)
	}()

	taskStatus := util.NewTaskStatus(
		util.NewTaskID("test-task-001"),
		mesosproto.TaskState_TASK_STAGING,
	)

	driver.SendStatusUpdate(taskStatus)
}


text:
from Instruction import Instruction
import unittest
import Types
from MethodDefinition import MethodDefinition
from Instructions.Instruction import register

class nop(Instruction):

    def __init__(self, arguments = None):
        self.name = 'nop'
        self.opcode = 0x28

    def execute(self, vm):
        pass

register('nop', nop)

class nopTes(unittest.TestCase):

    def test_nop(self):
        from VM import VM

        vm = VM()

        m = MethodDefinition()
        m.name = 'TestMethod'
        m.returnType = Types.Void
        m.parameters = []
        vm.methods.append(m)

        self.assertEqual(vm.currentMethod, None)

        c = nop()
        c.execute(vm)

        self.assertEqual(vm.stack.get_number_of_frames(), 1)


text:
package com.intellij.codeInspection.unused;

import com.intellij.lang.properties.psi.Property;
import com.intellij.openapi.extensions.ExtensionPointName;
import org.jetbrains.annotations.NotNull;

/**
 * @author Max Medvedev
 */
public abstract class ImplicitPropertyUsageProvider {
  public static final ExtensionPointName<ImplicitPropertyUsageProvider> EP_NAME = ExtensionPointName.create("com.intellij.properties.implicitPropertyUsageProvider");

  public static boolean isImplicitlyUsed(@NotNull Property property) {
    for (ImplicitPropertyUsageProvider provider : EP_NAME.getExtensions()) {
      if (provider.isUsed(property)) return true;
    }
    return false;
  }

  protected abstract boolean isUsed(@NotNull Property property);
}


text:
package com.example.pengyuanfan.fablix.json;

/**
 * Created by pengyuanfan on 6/11/2016.
 */
public class CommentResult {
    String comment_result;
    String info;

    public String getComment_result() {
        return comment_result;
    }

    public void setComment_result(String comment_result) {
        this.comment_result = comment_result;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }
}


text:
package org.citydb.core.operation.deleter.util;

import org.citydb.config.project.deleter.Continuation;
import org.citydb.config.project.global.UpdatingPersonMode;

import java.time.OffsetDateTime;

public class InternalConfig {
	private UpdatingPersonMode updatingPersonMode;
	private String updatingPerson;
	private String reasonForUpdate;
	private String lineage;
	private OffsetDateTime terminationDate;

	public UpdatingPersonMode getUpdatingPersonMode() {
		return updatingPersonMode != null ? updatingPersonMode : UpdatingPersonMode.DATABASE;
	}

	public void setUpdatingPersonMode(UpdatingPersonMode updatingPersonMode) {
		this.updatingPersonMode = updatingPersonMode;
	}

	public String getUpdatingPerson() {
		return updatingPerson;
	}

	public void setUpdatingPerson(String updatingPerson) {
		if (updatingPerson != null && !updatingPerson.trim().isEmpty()) {
			this.updatingPerson = updatingPerson.trim();
		}
	}

	public String getReasonForUpdate() {
		return reasonForUpdate;
	}

	public void setReasonForUpdate(String reasonForUpdate) {
		if (reasonForUpdate != null && !reasonForUpdate.trim().isEmpty()) {
			this.reasonForUpdate = reasonForUpdate.trim();
		}
	}

	public String getLineage() {
		return lineage;
	}

	public void setLineage(String lineage) {
		if (lineage != null && !lineage.trim().isEmpty()) {
			this.lineage = lineage.trim();
		}
	}

	public OffsetDateTime getTerminationDate() {
		return terminationDate;
	}

	public void setTerminationDate(OffsetDateTime terminationDate) {
		this.terminationDate = terminationDate;
	}

	public void setMetadata(Continuation continuation) {
		setUpdatingPersonMode(continuation.getUpdatingPersonMode());
		setUpdatingPerson(continuation.getUpdatingPerson());
		setReasonForUpdate(continuation.getReasonForUpdate());
		setLineage(continuation.getLineage());
		setTerminationDate(continuation.getTerminationDate());
	}
}


text:
package eu.liveandgov.wp1.serialization;

import com.google.common.base.Function;

/**
 *
Contains methods working on serialization instances

 * Created by Lukas Härtel on 10.02.14.
 */
public class Serializations {
    /**
     * This method converts a serialization object into a serialization functor
     *
     * @param serialization The serialization object to convert
     * @param <T>           The type of the input items
     * @return Returns a functor that maps T to String
     */
    public static <T> Function<T, String> serialization(final Serialization<T> serialization) {
        return new Function<T, String>() {
            @Override
            public String apply(T t) {
                return serialization.serialize(t);
            }
        };
    }

    /**
     * This method converts a serialization object into a de-serialization functor
     *
     * @param serialization The serialization object to convert
     * @param <T>           The type of the output items
     * @return Returns a functor that maps String to T
     */
    public static <T> Function<String, T> deSerialization(final Serialization<T> serialization) {
        return new Function<String, T>() {
            @Override
            public T apply(String s) {
                return serialization.deSerialize(s);
            }
        };
    }
}


text:
var integerNumber = 6;
console.log ("Integer: " + typeof integerNumber);

var floatingPointNumber = 6.66;
console.log ("Floating point: " + typeof floatingPointNumber);

var array = [ 1, 2, 3];
console.log ("Array: " + typeof array);

var booleanTrue = true;
console.log ("Boolean true: " + typeof booleanTrue);

var booleanFalse = false;
console.log("Boolean false: " + typeof booleanFalse);

var object = { a: 1, b: 2 };
console.log("Simple object: " + typeof object);

var string = 'Hello World';
console.log ("String: " + typeof string);

var undef;
console.log("Undefined: " + typeof undef);

var nil = null;
console.log ("Null: " + typeof nil);


text:
The Android Test Orchestrator allows you to run each of your app's tests in isolation, enabling greater reliability.
See https://developer.android.com/training/testing/junit-runner#using-android-test-orchestrator for more background.

This sample is a subset of the AndroidJUnitRunner sample, but it
illustrates how to enable Jacoco test coverage report with the Android Test Orchestrator in the app/build.gradle file.

This project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.

1. Download the project code, preferably using `git clone`.
1. Open the Android SDK Manager (*Tools* Menu | *Android*).
1. In Android Studio, select *File* | *Open...* and point to the top-level `./build.gradle` file.
1. Check out the relevant code:
    * The application under test is located in `src/main/java`
    * Tests are in `src/androidTest/java`
1. Connect a device or start an emulator:
    * Turn animations off.
    (On your device, under Settings->Developer options disable the following 3 settings: "Window animation scale", "Transition animation scale" and "Animator duration scale")
1. Run the newly created configuration.

The application will be started on the device/emulator and a series of actions will be performed automatically.

If you are using Android Studio, the *Run* window will show the test results.
The test coverage report will be generated in `app/build/reports/coverage/androidTest/debug/index.html`.


text:
package me.zhouzhuo810.zzapidoc.demand.dao.impl;

import me.zhouzhuo810.zzapidoc.common.dao.impl.BaseDaoImpl;
import me.zhouzhuo810.zzapidoc.demand.dao.DemandProjectDao;
import me.zhouzhuo810.zzapidoc.demand.entity.DemandProjectEntity;
import org.springframework.stereotype.Repository;

/**
 * Created by admin on 2018/10/6.
 */
@Repository
public class DemandProjectDaoImpl extends BaseDaoImpl<DemandProjectEntity> implements DemandProjectDao {
}