text:
/* include/portable.h.  Generated from portable.hin by configure.  */
/* include/portable.hin.  Generated from configure.in by autoheader.  */

/* begin of portable.h.pre */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
 *
 * Copyright 1998-2010 The OpenLDAP Foundation
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted only as authorized by the OpenLDAP
 * Public License.
 *
 * A copy of this license is available in the file LICENSE in the
 * top-level directory of the distribution or, alternatively, at
 * <http://www.OpenLDAP.org/license.html>.
 */

#ifndef _LDAP_PORTABLE_H
#define _LDAP_PORTABLE_H

/* define this if needed to get reentrant functions */
#ifndef REENTRANT
/* #undef REENTRANT */
#endif
#ifndef _REENTRANT
/* #undef _REENTRANT */
#endif

/* define this if needed to get threadsafe functions */
#ifndef THREADSAFE
/* #undef THREADSAFE */
#endif
#ifndef _THREADSAFE
/* #undef _THREADSAFE */
#endif
#ifndef THREAD_SAFE
/* #undef THREAD_SAFE */
#endif
#ifndef _THREAD_SAFE
/* #undef _THREAD_SAFE */
#endif

#ifndef _SGI_MP_SOURCE
/* #undef _SGI_MP_SOURCE */
#endif

/* end of portable.h.pre */

/* define to use both <string.h> and <strings.h> */
/* #undef BOTH_STRINGS_H */

/* define if cross compiling */
#define CROSS_COMPILING 1

/* set to the number of arguments ctime_r() expects */
#define CTIME_R_NARGS 2

/* define if toupper() requires islower() */
#define C_UPPER_LOWER 1

/* define if sys_errlist is not declared in stdio.h or errno.h */
/* #undef DECL_SYS_ERRLIST */

/* define to enable rewriting in back-ldap and back-meta */
/* #undef ENABLE_REWRITE */

/* define to enable slapi library */
/* #undef ENABLE_SLAPI */

/* defined to be the EXE extension */
#define EXEEXT ""

/* set to the number of arguments gethostbyaddr_r() expects */
/* #undef GETHOSTBYADDR_R_NARGS */

/* set to the number of arguments gethostbyname_r() expects */
/* #undef GETHOSTBYNAME_R_NARGS */

/* Define to 1 if `TIOCGWINSZ' requires <sys/ioctl.h>. */
/* #undef GWINSZ_IN_SYS_IOCTL */

/* define if you have AIX security lib */
/* #undef HAVE_AIX_SECURITY */

/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1

/* Define to 1 if you have the <arpa/nameser.h> header file. */
#define HAVE_ARPA_NAMESER_H 1

/* Define to 1 if you have the <assert.h> header file. */
#define HAVE_ASSERT_H 1

/* Define to 1 if you have the `bcopy' function. */
#define HAVE_BCOPY 1

/* define this if Berkeley DB is available */
/* #undef HAVE_BERKELEY_DB */

/* define if Berkeley DB has DB_THREAD support */
/* #undef HAVE_BERKELEY_DB_THREAD */

/* Define to 1 if you have the <bits/types.h> header file. */
/* #undef HAVE_BITS_TYPES_H */

/* Define to 1 if you have the `chroot' function. */
#define HAVE_CHROOT 1

/* Define to 1 if you have the `closesocket' function. */
/* #undef HAVE_CLOSESOCKET */

/* Define to 1 if you have the <conio.h> header file. */
/* #undef HAVE_CONIO_H */

/* define if crypt(3) is available */
/* #undef HAVE_CRYPT */

/* Define to 1 if you have the <crypt.h> header file. */
/* #undef HAVE_CRYPT_H */

/* Define to 1 if you have the <cthreads.h> header file. */
/* #undef HAVE_CTHREADS_H */

/* Define to 1 if you have the `ctime_r' function. */
#define HAVE_CTIME_R 1

/* define if you have Cyrus SASL */
#define HAVE_CYRUS_SASL 1

/* Define to 1 if you have the <db.h> header file. */
/* #undef HAVE_DB_H */

/* define if your system supports /dev/poll */
/* #undef HAVE_DEVPOLL */

/* Define to 1 if you have the <direct.h> header file. */
/* #undef HAVE_DIRECT_H */

/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
   */
#define HAVE_DIRENT_H 1

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */

/* define if system uses EBCDIC instead of ASCII */
/* #undef HAVE_EBCDIC */

/* Define to 1 if you have the `endgrent' function. */
#define HAVE_ENDGRENT 1

/* Define to 1 if you have the `endpwent' function. */
#define HAVE_ENDPWENT 1

/* define if your system supports epoll */
/* #undef HAVE_EPOLL */

/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1

/* Define to 1 if you have the `fcntl' function. */
#define HAVE_FCNTL 1

/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1

/* define if you actually have FreeBSD fetch(3) */
/* #undef HAVE_FETCH */

/* Define to 1 if you have the <filio.h> header file. */
/* #undef HAVE_FILIO_H */

/* Define to 1 if you have the `flock' function. */
#define HAVE_FLOCK 1

/* Define to 1 if you have the `fstat' function. */
#define HAVE_FSTAT 1

/* Define to 1 if you have the `gai_strerror' function. */
#define HAVE_GAI_STRERROR 1

/* Define to 1 if you have the `getaddrinfo' function. */
#define HAVE_GETADDRINFO 1

/* Define to 1 if you have the `getdtablesize' function. */
#define HAVE_GETDTABLESIZE 1

/* Define to 1 if you have the `geteuid' function. */
#define HAVE_GETEUID 1

/* Define to 1 if you have the `getgrgid' function. */
#define HAVE_GETGRGID 1

/* Define to 1 if you have the `gethostbyaddr_r' function. */
/* #undef HAVE_GETHOSTBYADDR_R */

/* Define to 1 if you have the `gethostbyname_r' function. */
/* #undef HAVE_GETHOSTBYNAME_R */

/* Define to 1 if you have the `gethostname' function. */
#define HAVE_GETHOSTNAME 1

/* Define to 1 if you have the `getnameinfo' function. */
#define HAVE_GETNAMEINFO 1

/* Define to 1 if you have the `getopt' function. */
#define HAVE_GETOPT 1

/* Define to 1 if you have the <getopt.h> header file. */
#define HAVE_GETOPT_H 1

/* Define to 1 if you have the `getpassphrase' function. */
/* #undef HAVE_GETPASSPHRASE */

/* Define to 1 if you have the `getpeereid' function. */
#define HAVE_GETPEEREID 1

/* Define to 1 if you have the `getpeerucred' function. */
/* #undef HAVE_GETPEERUCRED */

/* Define to 1 if you have the `getpwnam' function. */
#define HAVE_GETPWNAM 1

/* Define to 1 if you have the `getpwuid' function. */
#define HAVE_GETPWUID 1

/* Define to 1 if you have the `getspnam' function. */
/* #undef HAVE_GETSPNAM */

/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the <gmp.h> header file. */
/* #undef HAVE_GMP_H */

/* Define to 1 if you have the `gmtime_r' function. */
#define HAVE_GMTIME_R 1

/* define if you have GNUtls */
/* #undef HAVE_GNUTLS */

/* Define to 1 if you have the <gnutls/gnutls.h> header file. */
/* #undef HAVE_GNUTLS_GNUTLS_H */

/* if you have GNU Pth */
/* #undef HAVE_GNU_PTH */

/* Define to 1 if you have the <grp.h> header file. */
#define HAVE_GRP_H 1

/* Define to 1 if you have the `hstrerror' function. */
#define HAVE_HSTRERROR 1

/* define if you actually have ICU */
/* #undef HAVE_ICU */

/* define to you inet_aton(3) is available */
#define HAVE_INET_ATON 1

/* Define to 1 if you have the `inet_ntoa_b' function. */
/* #undef HAVE_INET_NTOA_B */

/* Define to 1 if you have the `inet_ntop' function. */
#define HAVE_INET_NTOP 1

/* Define to 1 if you have the `initgroups' function. */
#define HAVE_INITGROUPS 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the `ioctl' function. */
#define HAVE_IOCTL 1

/* Define to 1 if you have the <io.h> header file. */
/* #undef HAVE_IO_H */

/* Define to 1 if you have the `gen' library (-lgen). */
/* #undef HAVE_LIBGEN */

/* Define to 1 if you have the `gmp' library (-lgmp). */
/* #undef HAVE_LIBGMP */

/* Define to 1 if you have the `inet' library (-linet). */
/* #undef HAVE_LIBINET */

/* define if you have libtool -ltdl */
/* #undef HAVE_LIBLTDL */

/* Define to 1 if you have the `net' library (-lnet). */
/* #undef HAVE_LIBNET */

/* Define to 1 if you have the `nsl' library (-lnsl). */
/* #undef HAVE_LIBNSL */

/* Define to 1 if you have the `nsl_s' library (-lnsl_s). */
/* #undef HAVE_LIBNSL_S */

/* Define to 1 if you have the `socket' library (-lsocket). */
/* #undef HAVE_LIBSOCKET */

/* Define to 1 if you have the <libutil.h> header file. */
/* #undef HAVE_LIBUTIL_H */

/* Define to 1 if you have the `V3' library (-lV3). */
/* #undef HAVE_LIBV3 */

/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1

/* if you have LinuxThreads */
/* #undef HAVE_LINUX_THREADS */

/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1

/* Define to 1 if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R 1

/* Define to 1 if you have the `lockf' function. */
#define HAVE_LOCKF 1

/* Define to 1 if the system has the type `long long'. */
#define HAVE_LONG_LONG 1

/* Define to 1 if you have the <ltdl.h> header file. */
/* #undef HAVE_LTDL_H */

/* if you have SunOS LWP package */
/* #undef HAVE_LWP */

/* Define to 1 if you have the <lwp/lwp.h> header file. */
/* #undef HAVE_LWP_LWP_H */

/* define if you have Mach Cthreads */
/* #undef HAVE_MACH_CTHREADS */

/* Define to 1 if you have the <mach/cthreads.h> header file. */
/* #undef HAVE_MACH_CTHREADS_H */

/* Define to 1 if you have the <malloc.h> header file. */
/* #undef HAVE_MALLOC_H */

/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1

/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `memrchr' function. */
/* #undef HAVE_MEMRCHR */

/* Define to 1 if you have the `mkstemp' function. */
#define HAVE_MKSTEMP 1

/* Define to 1 if you have the `mktemp' function. */
#define HAVE_MKTEMP 1

/* define this if you have mkversion */
#define HAVE_MKVERSION 1

/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */

/* Define to 1 if you have the <netinet/tcp.h> header file. */
#define HAVE_NETINET_TCP_H 1

/* define if strerror_r returns char* instead of int */
/* #undef HAVE_NONPOSIX_STRERROR_R */

/* if you have NT Event Log */
/* #undef HAVE_NT_EVENT_LOG */

/* if you have NT Service Manager */
/* #undef HAVE_NT_SERVICE_MANAGER */

/* if you have NT Threads */
/* #undef HAVE_NT_THREADS */

/* define if you have OpenSSL */
#define HAVE_OPENSSL 1

/* Define to 1 if you have the <openssl/bn.h> header file. */
/* #undef HAVE_OPENSSL_BN_H */

/* define if you have OpenSSL with CRL checking capability */
#define HAVE_OPENSSL_CRL 1

/* Define to 1 if you have the <openssl/crypto.h> header file. */
/* #undef HAVE_OPENSSL_CRYPTO_H */

/* Define to 1 if you have the <openssl/ssl.h> header file. */
#define HAVE_OPENSSL_SSL_H 1

/* Define to 1 if you have the `pipe' function. */
#define HAVE_PIPE 1

/* Define to 1 if you have the `poll' function. */
#define HAVE_POLL 1

/* Define to 1 if you have the <poll.h> header file. */
#define HAVE_POLL_H 1

/* Define to 1 if you have the <process.h> header file. */
/* #undef HAVE_PROCESS_H */

/* Define to 1 if you have the <psap.h> header file. */
/* #undef HAVE_PSAP_H */

/* define to pthreads API spec revision */
/* #undef HAVE_PTHREADS */

/* define if you have pthread_detach function */
/* #undef HAVE_PTHREAD_DETACH */

/* Define to 1 if you have the `pthread_getconcurrency' function. */
/* #undef HAVE_PTHREAD_GETCONCURRENCY */

/* Define to 1 if you have the <pthread.h> header file. */
/* #undef HAVE_PTHREAD_H */

/* Define to 1 if you have the `pthread_kill' function. */
/* #undef HAVE_PTHREAD_KILL */

/* Define to 1 if you have the `pthread_kill_other_threads_np' function. */
/* #undef HAVE_PTHREAD_KILL_OTHER_THREADS_NP */

/* define if you have pthread_rwlock_destroy function */
/* #undef HAVE_PTHREAD_RWLOCK_DESTROY */

/* Define to 1 if you have the `pthread_setconcurrency' function. */
/* #undef HAVE_PTHREAD_SETCONCURRENCY */

/* Define to 1 if you have the `pthread_yield' function. */
/* #undef HAVE_PTHREAD_YIELD */

/* Define to 1 if you have the <pth.h> header file. */
/* #undef HAVE_PTH_H */

/* Define to 1 if the system has the type `ptrdiff_t'. */
#define HAVE_PTRDIFF_T 1

/* Define to 1 if you have the <pwd.h> header file. */
#define HAVE_PWD_H 1

/* Define to 1 if you have the `read' function. */
#define HAVE_READ 1

/* Define to 1 if you have the `recv' function. */
#define HAVE_RECV 1

/* Define to 1 if you have the `recvfrom' function. */
#define HAVE_RECVFROM 1

/* Define to 1 if you have the <regex.h> header file. */
#define HAVE_REGEX_H 1

/* Define to 1 if you have the <resolv.h> header file. */
#define HAVE_RESOLV_H 1

/* define if you have res_query() */
#define HAVE_RES_QUERY 1

/* define if OpenSSL needs RSAref */
/* #undef HAVE_RSAREF */

/* Define to 1 if you have the <sasl.h> header file. */
/* #undef HAVE_SASL_H */

/* Define to 1 if you have the <sasl/sasl.h> header file. */
#define HAVE_SASL_SASL_H 1

/* define if your SASL library has sasl_version() */
#define HAVE_SASL_VERSION 1

/* Define to 1 if you have the <sched.h> header file. */
/* #undef HAVE_SCHED_H */

/* Define to 1 if you have the `sched_yield' function. */
/* #undef HAVE_SCHED_YIELD */

/* Define to 1 if you have the `send' function. */
#define HAVE_SEND 1

/* Define to 1 if you have the `sendmsg' function. */
#define HAVE_SENDMSG 1

/* Define to 1 if you have the `sendto' function. */
#define HAVE_SENDTO 1

/* Define to 1 if you have the `setegid' function. */
#define HAVE_SETEGID 1

/* Define to 1 if you have the `seteuid' function. */
#define HAVE_SETEUID 1

/* Define to 1 if you have the `setgid' function. */
#define HAVE_SETGID 1

/* define if setproctitle(3) is available */
/* #undef HAVE_SETPROCTITLE */

/* Define to 1 if you have the `setpwfile' function. */
/* #undef HAVE_SETPWFILE */

/* Define to 1 if you have the `setsid' function. */
#define HAVE_SETSID 1

/* Define to 1 if you have the `setuid' function. */
#define HAVE_SETUID 1

/* Define to 1 if you have the <sgtty.h> header file. */
#define HAVE_SGTTY_H 1

/* Define to 1 if you have the <shadow.h> header file. */
/* #undef HAVE_SHADOW_H */

/* Define to 1 if you have the `sigaction' function. */
#define HAVE_SIGACTION 1

/* Define to 1 if you have the `signal' function. */
#define HAVE_SIGNAL 1

/* Define to 1 if you have the `sigset' function. */
#define HAVE_SIGSET 1

/* define if you have -lslp */
/* #undef HAVE_SLP */

/* Define to 1 if you have the <slp.h> header file. */
/* #undef HAVE_SLP_H */

/* Define to 1 if you have the `snprintf' function. */
#define HAVE_SNPRINTF 1

/* if you have spawnlp() */
/* #undef HAVE_SPAWNLP */

/* Define to 1 if you have the <sqlext.h> header file. */
/* #undef HAVE_SQLEXT_H */

/* Define to 1 if you have the <sql.h> header file. */
/* #undef HAVE_SQL_H */

/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1

/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1

/* Define to 1 if you have the `strerror_r' function. */
#define HAVE_STRERROR_R 1

/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the `strpbrk' function. */
#define HAVE_STRPBRK 1

/* Define to 1 if you have the `strrchr' function. */
#define HAVE_STRRCHR 1

/* Define to 1 if you have the `strsep' function. */
#define HAVE_STRSEP 1

/* Define to 1 if you have the `strspn' function. */
#define HAVE_STRSPN 1

/* Define to 1 if you have the `strstr' function. */
#define HAVE_STRSTR 1

/* Define to 1 if you have the `strtol' function. */
#define HAVE_STRTOL 1

/* Define to 1 if you have the `strtoll' function. */
#define HAVE_STRTOLL 1

/* Define to 1 if you have the `strtoq' function. */
#define HAVE_STRTOQ 1

/* Define to 1 if you have the `strtoul' function. */
#define HAVE_STRTOUL 1

/* Define to 1 if you have the `strtouq' function. */
#define HAVE_STRTOUQ 1

/* Define to 1 if `msg_accrightslen' is member of `struct msghdr'. */
/* #undef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTSLEN */

/* Define to 1 if `msg_control' is member of `struct msghdr'. */
/* #undef HAVE_STRUCT_MSGHDR_MSG_CONTROL */

/* Define to 1 if `pw_gecos' is member of `struct passwd'. */
#define HAVE_STRUCT_PASSWD_PW_GECOS 1

/* Define to 1 if `pw_passwd' is member of `struct passwd'. */
#define HAVE_STRUCT_PASSWD_PW_PASSWD 1

/* Define to 1 if `st_blksize' is member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1

/* Define to 1 if `st_fstype' is member of `struct stat'. */
/* #undef HAVE_STRUCT_STAT_ST_FSTYPE */

/* define to 1 if st_fstype is char * */
/* #undef HAVE_STRUCT_STAT_ST_FSTYPE_CHAR */

/* define to 1 if st_fstype is int */
/* #undef HAVE_STRUCT_STAT_ST_FSTYPE_INT */

/* Define to 1 if `st_vfstype' is member of `struct stat'. */
/* #undef HAVE_STRUCT_STAT_ST_VFSTYPE */

/* Define to 1 if you have the <synch.h> header file. */
/* #undef HAVE_SYNCH_H */

/* Define to 1 if you have the `sysconf' function. */
#define HAVE_SYSCONF 1

/* Define to 1 if you have the <sysexits.h> header file. */
#define HAVE_SYSEXITS_H 1

/* Define to 1 if you have the <syslog.h> header file. */
#define HAVE_SYSLOG_H 1

/* Define to 1 if you have the <sys/devpoll.h> header file. */
/* #undef HAVE_SYS_DEVPOLL_H */

/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
   */
/* #undef HAVE_SYS_DIR_H */

/* Define to 1 if you have the <sys/epoll.h> header file. */
/* #undef HAVE_SYS_EPOLL_H */

/* define if you actually have sys_errlist in your libs */
#define HAVE_SYS_ERRLIST 1

/* Define to 1 if you have the <sys/errno.h> header file. */
#define HAVE_SYS_ERRNO_H 1

/* Define to 1 if you have the <sys/file.h> header file. */
#define HAVE_SYS_FILE_H 1

/* Define to 1 if you have the <sys/filio.h> header file. */
#define HAVE_SYS_FILIO_H 1

/* Define to 1 if you have the <sys/fstyp.h> header file. */
/* #undef HAVE_SYS_FSTYP_H */

/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1

/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
   */
/* #undef HAVE_SYS_NDIR_H */

/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1

/* Define to 1 if you have the <sys/poll.h> header file. */
#define HAVE_SYS_POLL_H 1

/* Define to 1 if you have the <sys/privgrp.h> header file. */
/* #undef HAVE_SYS_PRIVGRP_H */

/* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1

/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1

/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/syslog.h> header file. */
#define HAVE_SYS_SYSLOG_H 1

/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <sys/ucred.h> header file. */
#define HAVE_SYS_UCRED_H 1

/* Define to 1 if you have the <sys/uio.h> header file. */
#define HAVE_SYS_UIO_H 1

/* Define to 1 if you have the <sys/un.h> header file. */
/* #undef HAVE_SYS_UN_H */

/* Define to 1 if you have the <sys/uuid.h> header file. */
/* #undef HAVE_SYS_UUID_H */

/* Define to 1 if you have the <sys/vmount.h> header file. */
/* #undef HAVE_SYS_VMOUNT_H */

/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#define HAVE_SYS_WAIT_H 1

/* define if you have -lwrap */
/* #undef HAVE_TCPD */

/* Define to 1 if you have the <tcpd.h> header file. */
/* #undef HAVE_TCPD_H */

/* Define to 1 if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1

/* if you have Solaris LWP (thr) package */
/* #undef HAVE_THR */

/* Define to 1 if you have the <thread.h> header file. */
/* #undef HAVE_THREAD_H */

/* Define to 1 if you have the `thr_getconcurrency' function. */
/* #undef HAVE_THR_GETCONCURRENCY */

/* Define to 1 if you have the `thr_setconcurrency' function. */
/* #undef HAVE_THR_SETCONCURRENCY */

/* Define to 1 if you have the `thr_yield' function. */
/* #undef HAVE_THR_YIELD */

/* define if you have TLS */
#define HAVE_TLS 1

/* Define to 1 if you have the <unicode/utypes.h> header file. */
#define HAVE_UNICODE_UTYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define to 1 if you have the <utime.h> header file. */
#define HAVE_UTIME_H 1

/* define if you have uuid_generate() */
#define HAVE_UUID_GENERATE 1

/* define if you have uuid_to_str() */
/* #undef HAVE_UUID_TO_STR */

/* Define to 1 if you have the <uuid/uuid.h> header file. */
#define HAVE_UUID_UUID_H 1

/* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1

/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1

/* Define to 1 if you have the `wait4' function. */
#define HAVE_WAIT4 1

/* Define to 1 if you have the `waitpid' function. */
#define HAVE_WAITPID 1

/* define if you have winsock */
/* #undef HAVE_WINSOCK */

/* define if you have winsock2 */
/* #undef HAVE_WINSOCK2 */

/* Define to 1 if you have the <winsock2.h> header file. */
/* #undef HAVE_WINSOCK2_H */

/* Define to 1 if you have the <winsock.h> header file. */
/* #undef HAVE_WINSOCK_H */

/* Define to 1 if you have the `write' function. */
#define HAVE_WRITE 1

/* define if select implicitly yields */
#define HAVE_YIELDING_SELECT 1

/* Define to 1 if you have the `_vsnprintf' function. */
/* #undef HAVE__VSNPRINTF */

/* define to 32-bit or greater integer type */
#define LBER_INT_T int

/* define to large integer type */
#define LBER_LEN_T long

/* define to socket descriptor type */
#define LBER_SOCKET_T int

/* define to large integer type */
#define LBER_TAG_T long

/* define to 1 if library is thread safe */
/* #undef LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE */

/* define to LDAP VENDOR VERSION */
/* #undef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */

/* define this to add debugging code */
#define LDAP_DEBUG 1

/* define if LDAP libs are dynamic */
/* #undef LDAP_LIBS_DYNAMIC */

/* define to support PF_INET6 */
#define LDAP_PF_INET6 1

/* define to support PF_LOCAL */
/* #undef LDAP_PF_LOCAL */

/* define this for LDAP process title support */
/* #undef LDAP_PROCTITLE */

/* define this to add SLAPI code */
/* #undef LDAP_SLAPI */

/* define this to add syslog code */
/* #undef LDAP_SYSLOG */

/* Version */
#define LDAP_VENDOR_VERSION 20422

/* Major */
#define LDAP_VENDOR_VERSION_MAJOR 2

/* Minor */
#define LDAP_VENDOR_VERSION_MINOR 4

/* Patch */
#define LDAP_VENDOR_VERSION_PATCH 22

/* define if memcmp is not 8-bit clean or is otherwise broken */
#define NEED_MEMCMP_REPLACEMENT 1

/* define if you have (or want) no threads */
#define NO_THREADS 1

/* define to use the original debug style */
/* #undef OLD_DEBUG */

/* Package */
#define OPENLDAP_PACKAGE "OpenLDAP"

/* Version */
#define OPENLDAP_VERSION "2.4.22"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""

/* Define to the full name of this package. */
#define PACKAGE_NAME ""

/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""

/* Define to the version of this package. */
#define PACKAGE_VERSION ""

/* define if sched_yield yields the entire process */
/* #undef REPLACE_BROKEN_YIELD */

/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void

/* Define to the type of arg 1 for `select'. */
#define SELECT_TYPE_ARG1 int

/* Define to the type of args 2, 3 and 4 for `select'. */
#define SELECT_TYPE_ARG234 (fd_set *)

/* Define to the type of arg 5 for `select'. */
#define SELECT_TYPE_ARG5 (struct timeval *)

/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4

/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 4

/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8

/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2

/* The size of `wchar_t', as computed by sizeof. */
#define SIZEOF_WCHAR_T 4

/* define to support per-object ACIs */
/* #undef SLAPD_ACI_ENABLED */

/* define to support BDB backend */
/* #undef SLAPD_BDB */

/* define to support cleartext passwords */
#define SLAPD_CLEARTEXT 1

/* define to support crypt(3) passwords */
/* #undef SLAPD_CRYPT */

/* define to support DNS SRV backend */
/* #undef SLAPD_DNSSRV */

/* define to support HDB backend */
/* #undef SLAPD_HDB */

/* define to support LDAP backend */
/* #undef SLAPD_LDAP */

/* define to support LAN Manager passwords */
/* #undef SLAPD_LMHASH */

/* define to support LDAP Metadirectory backend */
/* #undef SLAPD_META */

/* define to support modules */
/* #undef SLAPD_MODULES */

/* dynamically linked module */
#define SLAPD_MOD_DYNAMIC 2

/* statically linked module */
#define SLAPD_MOD_STATIC 1

/* define to support cn=Monitor backend */
/* #undef SLAPD_MONITOR */

/* define to support NDB backend */
/* #undef SLAPD_NDB */

/* define to support NULL backend */
/* #undef SLAPD_NULL */

/* define for In-Directory Access Logging overlay */
/* #undef SLAPD_OVER_ACCESSLOG */

/* define for Audit Logging overlay */
/* #undef SLAPD_OVER_AUDITLOG */

/* define for Collect overlay */
/* #undef SLAPD_OVER_COLLECT */

/* define for Attribute Constraint overlay */
/* #undef SLAPD_OVER_CONSTRAINT */

/* define for Dynamic Directory Services overlay */
/* #undef SLAPD_OVER_DDS */

/* define for Dynamic Directory Services overlay */
/* #undef SLAPD_OVER_DEREF */

/* define for Dynamic Group overlay */
/* #undef SLAPD_OVER_DYNGROUP */

/* define for Dynamic List overlay */
/* #undef SLAPD_OVER_DYNLIST */

/* define for Reverse Group Membership overlay */
/* #undef SLAPD_OVER_MEMBEROF */

/* define for Password Policy overlay */
/* #undef SLAPD_OVER_PPOLICY */

/* define for Proxy Cache overlay */
/* #undef SLAPD_OVER_PROXYCACHE */

/* define for Referential Integrity overlay */
/* #undef SLAPD_OVER_REFINT */

/* define for Referential Integrity overlay */
/* #undef SLAPD_OVER_RETCODE */

/* define for Rewrite/Remap overlay */
/* #undef SLAPD_OVER_RWM */

/* define for Sequential Modify overlay */
/* #undef SLAPD_OVER_SEQMOD */

/* define for ServerSideSort/VLV overlay */
/* #undef SLAPD_OVER_SSSVLV */

/* define for Syncrepl Provider overlay */
/* #undef SLAPD_OVER_SYNCPROV */

/* define for Translucent Proxy overlay */
/* #undef SLAPD_OVER_TRANSLUCENT */

/* define for Attribute Uniqueness overlay */
/* #undef SLAPD_OVER_UNIQUE */

/* define for Value Sorting overlay */
/* #undef SLAPD_OVER_VALSORT */

/* define to support PASSWD backend */
/* #undef SLAPD_PASSWD */

/* define to support PERL backend */
/* #undef SLAPD_PERL */

/* define to support relay backend */
/* #undef SLAPD_RELAY */

/* define to support reverse lookups */
/* #undef SLAPD_RLOOKUPS */

/* define to support SHELL backend */
/* #undef SLAPD_SHELL */

/* define to support SOCK backend */
/* #undef SLAPD_SOCK */

/* define to support SASL passwords */
/* #undef SLAPD_SPASSWD */

/* define to support SQL backend */
/* #undef SLAPD_SQL */

/* define to support run-time loadable ACL */
/* #undef SLAP_DYNACL */

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1

/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */

/* set to urandom device */
/* #undef URANDOM_DEVICE */

/* define to use OpenSSL BIGNUM for MP */
/* #undef USE_MP_BIGNUM */

/* define to use GMP for MP */
/* #undef USE_MP_GMP */

/* define to use 'long' for MP */
/* #undef USE_MP_LONG */

/* define to use 'long long' for MP */
#define USE_MP_LONG_LONG 1

/* Define to 1 if your processor stores words with the most significant byte
   first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */

/* Define to the type of arg 3 for `accept'. */
#define ber_socklen_t socklen_t

/* Define to `char *' if <sys/types.h> does not define. */
/* #undef caddr_t */

/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */

/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */

/* Define to `int' if <sys/types.h> does not define. */
/* #undef mode_t */

/* Define to `long' if <sys/types.h> does not define. */
/* #undef off_t */

/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */

/* Define to `int' if <signal.h> does not define. */
/* #undef sig_atomic_t */

/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */

/* define to snprintf routine */
/* #undef snprintf */

/* Define like ber_socklen_t if <sys/socket.h> does not define. */
/* #undef socklen_t */

/* Define to `signed int' if <sys/types.h> does not define. */
/* #undef ssize_t */

/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */

/* define as empty if volatile is not supported */
/* #undef volatile */

/* define to snprintf routine */
/* #undef vsnprintf */

/* begin of portable.h.post */

#ifdef _WIN32
	/* don't suck in all of the win32 api */
#	define WIN32_LEAN_AND_MEAN 1
#endif

#ifndef LDAP_NEEDS_PROTOTYPES
/* force LDAP_P to always include prototypes */
#define LDAP_NEEDS_PROTOTYPES 1
#endif

#ifndef LDAP_REL_ENG
#if (LDAP_VENDOR_VERSION == 000000) && !defined(LDAP_DEVEL)
#define LDAP_DEVEL
#endif
#if defined(LDAP_DEVEL) && !defined(LDAP_TEST)
#define LDAP_TEST
#endif
#endif

#ifdef HAVE_STDDEF_H
#	include <stddef.h>
#endif

#ifdef HAVE_EBCDIC
/* ASCII/EBCDIC converting replacements for stdio funcs
 * vsnprintf and snprintf are used too, but they are already
 * checked by the configure script
 */
#define fputs ber_pvt_fputs
#define fgets ber_pvt_fgets
#define printf ber_pvt_printf
#define fprintf ber_pvt_fprintf
#define vfprintf ber_pvt_vfprintf
#define vsprintf ber_pvt_vsprintf
#endif

#include "ac/fdset.h"

#include "ldap_cdefs.h"
#include "ldap_features.h"

#include "ac/assert.h"
#include "ac/localize.h"

#endif /* _LDAP_PORTABLE_H */
/* end of portable.h.post */


text:
#pragma once
#include <memory>
#include <functional>
#include <fc/filesystem.hpp>

namespace fc {
  class path;
  class logger;
  namespace ssh {
  namespace detail {
    class client_impl;
    class process_impl;
  };

  enum sftp_file_type {
    named_pipe = 0010000,
    directory  = 0040000,
    regular    = 0100000,
    symlink    = 0120000
  };

  enum sftp_file_mode {
    owner_mask    =    0000700,     /* RWX mask for owner */
    owner_read    =    0000400,     /* R for owner */
    owner_write   =    0000200,     /* W for owner */
    owner_exec    =    0000100,     /* X for owner */
    group_mask    =    0000070,     /* RWX mask for group */
    group_read    =    0000040,     /* R for group */
    group_write   =    0000020,     /* W for group */
    group_exec    =    0000010,     /* X for group */
    other_mask    =    0000007,     /* RWX mask for other */
    other_read    =    0000004,     /* R for other */
    other_write   =    0000002,     /* W for other */
    other_exec    =    0000001      /* X for other */
  };

  struct file_attrib {
    file_attrib();

    uint64_t size;
    uint32_t uid;
    uint32_t gid;
    uint32_t permissions;
    uint32_t atime;
    uint32_t mtime;

    bool     exists();
    bool     is_file();
    bool     is_directory();
  };

  /**
   *  @brief Enables communication over ssh using libssh2.
   *
   *  Because the client creates other resources that depend upon
   *  it, it can only be created as a std::shared_ptr<client> (aka client::ptr)
   *  via client::create();
   *
   */
  class client
  {
    public:
      enum trace_level {
        TRACE_NONE      = 0,
        TRACE_TRANS     = (1<<1),
        TRACE_KEX       = (1<<2),
        TRACE_AUTH      = (1<<3),
        TRACE_CONN      = (1<<4),
        TRACE_SCP       = (1<<5),
        TRACE_SFTP      = (1<<6),
        TRACE_ERROR     = (1<<7),
        TRACE_PUBLICKEY = (1<<8),
        TRACE_SOCKET    = (1<<9)
      };
      /**
       * Everything but TRACE_ERROR will be logged at fc::log_level::debug, while
       * TRACE_ERROR will be logged at fc::log_level::error
       *
       * @param bitmask comprised of values from trace_level
       **/
      void           set_trace_level( int bitmask );
      int            get_trace_level()const;

      /**
       *  Override the default logger used by fc::ssh::client
       */
      void           set_logger( const logger& lgr );
      const logger&  get_logger()const;

      /**
       *  Connect, with no password specified.  Authentication will try public key,
       *  (via agent or explicitly-set key), empty password, then keyboard-interactive
       */
      void connect( const fc::string& user, const fc::string& host, uint16_t port = 22);

      /**
       *  Connect, specifying a password to be used for password authentication
       */
      void connect( const fc::string& user, const fc::string& pass, const fc::string& host, uint16_t port = 22);

      /**
       *  @note THIS METHOD IS DEPRECATED and should be replace with:
       *
       *  ssh::client_ptr sshc = std::make_shared<ssh::client>();
       *  sshc->connect( ... )
       *  ssh::process_ptr  proc = std::make_shared<ssh::process>( sshc );
       *  proc->exec( ... )
       *
       *
       *  @brief execute command on remote machine
       *  @param pty_type - whether or not to request a PTY when executing this process, this is necessary
       *          for interactive (non-buffered) IO with the remote process, if left empty no pty will be
       *          requested
       *
       *  @note Processes launched in this manner will fully buffer stdin and stdout regardless of whether
       *     the process calls flush().  If you need unbuffered (streaming, realtime) access to standard
       *     out then you must launch the process via a shell.
      ssh::process exec( const fc::string& cmd, const fc::string& pty_type = "" );
       */

      /**
       *  @brief upload a file to remote host
       *  @param progress a callback to report / cancel upload.
       *         The callback takes two parameters, bytes sent and file size.  To continue the
       *         transfer, the callback should return true.  To cancel the callback should return false.
       */
      void scp_send( const fc::path& local_path, const fc::path& remote_path,
                              std::function<bool(uint64_t,uint64_t)> progress = [](uint64_t,uint64_t){return true;} );

      /**
       *  @brief recursively sends the contents of local_dir to the remote_path
       *
       *  If remote_path ends in '/' then a new directory at remote_path/local_dir.filename() will
       *  be created, otherwise local_dir / * will be copied to remote_path / *
       *
       *  Progress will be reported as total bytes transferred for all files.
       */
      void scp_send_dir( const fc::path& local_dir, const fc::path& remote_path,
                              std::function<bool(uint64_t,uint64_t)> progress = [](uint64_t,uint64_t){return true;} );

      /**
       *  @pre remote_path is not a directory
       *  @post remote file is removed from the remote filesystem
       */
      void rm( const fc::path& remote_path );

      /**
       *  @pre remote_path is a directory
       *  @post remote directory is removed from the remote filesystem
       */
      void rmdir( const fc::path& remote_path );

      void rmdir_recursive( const fc::path& remote_path );

      file_attrib stat( const fc::path& remote_path );

      /**
       *  @pre all parent directories already exist.
       *  @pre remote_dir is not exist or is already a directory
       *  @post remote_dir exists.
       */
      void mkdir( const fc::path& remote_dir, int mode = owner_read|owner_write|owner_exec );

      /**
       *  Create all parent directories for remote_dir if they do not exist.
       *
       *  @post remote_dir exists.
       */
      void create_directories( const fc::path& remote_dir, int mode = owner_read|owner_write|owner_exec );

      /**
       * Sets whether the remote system is believed to be a Windows box (by default, it's
       * assumed to be running UNIX.  This alters how command-line arguments are quoted
       * and possibly how filenames are altered when copying files
       */
      void set_remote_system_is_windows(bool is_windows = true);

      void close();

      client();
      ~client();

    private:
      friend class process;
      friend class detail::process_impl;
      std::unique_ptr<detail::client_impl> my;
  };
  typedef std::shared_ptr<client> client_ptr;

} } // namespace fc::ssh

redpajama_set_name: RedPajamaGithub


text:
package org.apache.bookkeeper.bookie;

import java.io.IOException;
import java.nio.ByteBuffer;
/**
 * Implements a ledger inside a bookie. In particular, it implements operations
 * to write entries to a ledger and read entries from a ledger.
 */
public class LedgerDescriptorReadOnlyImpl extends LedgerDescriptorImpl {
    LedgerDescriptorReadOnlyImpl(long ledgerId, LedgerStorage storage) {
        super(null, ledgerId, storage);
    }

    @Override
    boolean setFenced() throws IOException {
        assert false;
        throw new IOException("Invalid action on read only descriptor");
    }

    @Override
    long addEntry(ByteBuffer entry) throws IOException {
        assert false;
        throw new IOException("Invalid action on read only descriptor");
    }

    @Override
    void checkAccess(byte masterKey[]) throws BookieException, IOException {
        assert false;
        throw new IOException("Invalid action on read only descriptor");
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="false" android:drawable="@drawable/ic_btn_round_more_disabled" />
    <item android:drawable="@drawable/ic_btn_round_more_normal" />
</selector>


text:
package org.springframework.web.servlet.tags.form;

import javax.servlet.jsp.JspException;

/**
 * Abstract base class to provide common methods for implementing
 * databinding-aware JSP tags for rendering a <i>single</i>
 * HTML '{@code input}' element with a '{@code type}'
 * of '{@code checkbox}' or '{@code radio}'.
 *
 * @author Juergen Hoeller
 * @since 2.5.2
 */
@SuppressWarnings("serial")
public abstract class AbstractSingleCheckedElementTag extends AbstractCheckedElementTag {

	/**
	 * The value of the '{@code value}' attribute.
	 */
	private Object value;

	/**
	 * The value of the '{@code label}' attribute.
	 */
	private Object label;

	/**
	 * Set the value of the '{@code value}' attribute.
	 * May be a runtime expression.
	 */
	public void setValue(Object value) {
		this.value = value;
	}

	/**
	 * Get the value of the '{@code value}' attribute.
	 */
	protected Object getValue() {
		return this.value;
	}

	/**
	 * Set the value of the '{@code label}' attribute.
	 * May be a runtime expression.
	 */
	public void setLabel(Object label) {
		this.label = label;
	}

	/**
	 * Get the value of the '{@code label}' attribute.
	 */
	protected Object getLabel() {
		return this.label;
	}

	/**
	 * Renders the '{@code input(radio)}' element with the configured
	 * {@link #setValue(Object) value}. Marks the element as checked if the
	 * value matches the {@link #getValue bound value}.
	 */
	@Override
	protected int writeTagContent(TagWriter tagWriter) throws JspException {
		tagWriter.startTag("input");
		String id = resolveId();
		writeOptionalAttribute(tagWriter, "id", id);
		writeOptionalAttribute(tagWriter, "name", getName());
		writeOptionalAttributes(tagWriter);
		writeTagDetails(tagWriter);
		tagWriter.endTag();

		Object resolvedLabel = evaluate("label", getLabel());
		if (resolvedLabel != null) {
			tagWriter.startTag("label");
			tagWriter.writeAttribute("for", id);
			tagWriter.appendValue(convertToDisplayString(resolvedLabel));
			tagWriter.endTag();
		}

		return SKIP_BODY;
	}

	/**
	 * Write the details for the given primary tag:
	 * i.e. special attributes and the tag's value.
	 */
	protected abstract void writeTagDetails(TagWriter tagWriter) throws JspException;

}


text:
package eu.scape_project.tabdatanorm.normalisation;

import java.util.ArrayList;

public class NormalisedDataItem {

	private String dataItemName;
	private ArrayList<String> dataItemHeaderKeywords = new ArrayList<String>();
	private boolean mandatory = true;
	private boolean validationRequired;
	private boolean modificationRequired = true;
	private boolean translationRequired;
	private boolean removeDuplicates = true;
	private boolean replaceNonPrintableCharacters = false;
	private String replaceNonPrintableCharactersWith;
	private String validationRegex = null;
	private ArrayList<String> validationValues = new ArrayList<String>();
	private int minLength = -1;
	private int maxLength = -1;
	private String defaultValue;
	private ArrayList<Integer> inputDataColumnIndex = new ArrayList<Integer>();
	private ArrayList<String> inputDataValues = new ArrayList<String>();
	private ArrayList<String> outputDataValues = new ArrayList<String>();
	private ArrayList<String> validationMessages = new ArrayList<String>();
	private ArrayList<String> columnIdentificationValues = new ArrayList<String>();
	private String columnIdentificationRegex;

	public NormalisedDataItem(String dataItemName) {
		this.dataItemName = dataItemName;
	}

	public boolean validate() {
		System.out.println("Validating " + dataItemName + "[ Mandatory=" + mandatory +
			", Validation required =" + validationRequired + ", Min length=" + minLength +
			" Max length=" + maxLength + " Validation regex=" + validationRegex +
			" Replace non printable characters=" + replaceNonPrintableCharacters +
			"[" + replaceNonPrintableCharactersWith + "]");
		boolean isValid = true;
		generateOutputData();
		String outputDataValue = getOutputDataAsString();
		if (mandatory) {
			if (outputDataValue.isEmpty()) {
				isValid = false;
				if (defaultValue.isEmpty()) {
					validationMessages.add("Mandatory value is empty");
				} else {
					validationMessages.add("Mandatory value is empty, using default value [" + defaultValue + "]");
				}
				return isValid;
			}
		}
		if (validationRequired) {
			if (minLength >= 0) {
				if (outputDataValue.isEmpty() || outputDataValue.length() < minLength) {
					isValid = false;
					validationMessages.add("Too short; min length="+minLength);
				}
			}
			if (maxLength >= 0) {
				if (outputDataValue.isEmpty() || outputDataValue.length() > maxLength) {
					isValid = false;
					validationMessages.add("Too long; max length="+maxLength);
				}
			}
			if (validationRegex != null && !validationRegex.isEmpty() ) {
				if (outputDataValue != null) {
					if (!outputDataValue.matches(validationRegex)) {
						isValid = false;
						validationMessages.add("Does not match regex [ " + validationRegex +" ]");
					}
				}
			}
		}
		return isValid;
	}

	public String modify(String dataValueToModify) {

		// Carry out modification on the input value, e.g. remove non alphanumeric chars,
		// or convert to upper/lower case
		String dataValue = dataValueToModify;
		if (dataValueToModify != null && !dataValueToModify.isEmpty()) {
			dataValue = dataValueToModify.replaceAll("\"", "\'");
		}

		return dataValue;
	}

	public String translate(String dataValueToTranslate) {

		// Carry out translation on the input value, e.g. convert a code to it's
		// corresponding value

		String dataValue = dataValueToTranslate;
		if (!dataValueToTranslate.isEmpty()) {
			// Translation goes here
		}
		return dataValue;
	}

	public String replaceNonPrintableCharacters(String dataValueToTranslate) {

		// TODO - Replace non-printable characters by those specified in relaceNonPrintableCharactersWith
		System.out.println("Replacing non-printable characters in [" + dataValueToTranslate + "] with [" + replaceNonPrintableCharactersWith + "]");
		String dataValue = dataValueToTranslate;
		if (!dataValueToTranslate.isEmpty()) {
			//dataValueToTranslate.replaceAll("\\p{C}", replaceNonPrintableCharactersWith);
			String nonBreakingSpace = "\u00A0";
			dataValueToTranslate.replaceAll(nonBreakingSpace, replaceNonPrintableCharactersWith);
		}
		return dataValue;
	}

	public void generateOutputData() {
		//System.out.println("Generating output data for " + dataItemName);
		ArrayList<String> inputDataArray = new ArrayList<String>();
		if (removeDuplicates) {
			inputDataArray = removeDuplicates();
		} else {
			inputDataArray = inputDataValues;
		}

		outputDataValues.clear();
		String outputDataValue = "";
		if (inputDataArray.isEmpty()) {
			outputDataValue = getOutputDataValue("");
			outputDataValues.add(outputDataValue);
		} else {
			for (String inputDataValue: inputDataArray) {
				outputDataValue = getOutputDataValue(inputDataValue);
				outputDataValues.add(outputDataValue);
			}
		}
	}

	public String getOutputDataAsString() {
		String outputData = "";
		for (String outputDataValue: outputDataValues) {
			if (!outputDataValue.isEmpty()) {
				outputData = outputData + outputDataValue + ", ";
			}
		}
		if (outputData.length() >=2) {
			outputData = outputData.substring(0, outputData.length()-2);
		}
		outputData.trim();
		return outputData;
	}

	public void clear() {
		inputDataValues.clear();
		outputDataValues.clear();
		validationMessages.clear();
	}

	public ArrayList<String> removeDuplicates() {
		ArrayList<String> deDuplicatedInputData = new ArrayList<String>();
		for (String inputDataValue: inputDataValues) {
			if (!deDuplicatedInputData.contains(inputDataValue)) {
				deDuplicatedInputData.add(inputDataValue);
			}
		}
		return deDuplicatedInputData;
	}

	public String getDataItemName() {
		return dataItemName;
	}

	public void setDataItemName(String dataItemName) {
		this.dataItemName = dataItemName;
	}

	public ArrayList<String> getDataItemHeaderKeywords() {
		return dataItemHeaderKeywords;
	}

	public void setDataItemHeaderKeywords(ArrayList<String> dataItemHeaderKeywords) {
		this.dataItemHeaderKeywords = dataItemHeaderKeywords;
	}

	public void addDataItemHeaderKeywords(String dataItemHeaderKeyword) {
		this.dataItemHeaderKeywords.add(dataItemHeaderKeyword);
	}

	public boolean isMandatory() {
		return mandatory;
	}

	public void setMandatory(boolean isMandatory) {
		this.mandatory = isMandatory;
	}

	public void setMandatory(String isMandatory) {
		//System.out.println(dataItemName + " mandatory flag is " + isMandatory);
		if (isMandatory != null) {
			if ("N".equals(isMandatory) || "n".equals(isMandatory)) {
				this.mandatory = false;
			} else if ("Y".equals(isMandatory) || "y".equals(isMandatory)) {
				this.mandatory = true;
			}
		}
		//System.out.println(dataItemName + " mandatory flag is " + this.mandatory);
	}

	public boolean isValidationRequired() {
		return validationRequired;
	}

	public void setValidationRequired(boolean validationRequired) {
		this.validationRequired = validationRequired;
	}

	public void setValidationRequired(String validationRequired) {
		//System.out.println(dataItemName + " validation flag is " + validationRequired);
		if (validationRequired != null) {
			if ("N".equals(validationRequired) || "n".equals(validationRequired)) {
				this.validationRequired = false;
			} else if ("Y".equals(validationRequired) || "y".equals(validationRequired)) {
				this.validationRequired = true;
			}
		}
		//System.out.println(dataItemName + " validation flag is " + this.validationRequired);
	}

	public String getValidationRegex() {
		return validationRegex;
	}

	public void setValidationRegex(String validationRegex) {
		this.validationRegex = validationRegex;
	}

	public int getMinLength() {
		return minLength;
	}

	public void setMinLength(int minLength) {
		this.minLength = minLength;
	}

	public void setMinLength(String minLength) throws NumberFormatException {
		if (minLength != null) {
			this.minLength = Integer.parseInt(minLength);
		}
	}

	public int getMaxLength() {
		return maxLength;
	}

	public void setMaxLength(int maxLength) {
		this.maxLength = maxLength;
	}

	public void setMaxLength(String maxLength) throws NumberFormatException {
		if (maxLength != null) {
			this.maxLength = Integer.parseInt(maxLength);
		}
	}

	public String getDefaultValue() {
		return defaultValue;
	}

	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}

	public ArrayList<Integer> getInputDataColumnIndex() {
		return inputDataColumnIndex;
	}

	public void setInputDataColumnIndex(ArrayList<Integer> inputDataColumnIndex) {
		this.inputDataColumnIndex = inputDataColumnIndex;
	}

	public void addInputDataColumnIndex(Integer inputDataColumnIndex) {
		this.inputDataColumnIndex.add(inputDataColumnIndex);
	}

	public ArrayList<String> getInputDataValues() {
		return inputDataValues;
	}

	public void setInputDataValues(ArrayList<String> inputDataValues) {
		this.inputDataValues.clear();
		for (String inputValue: inputDataValues) {
			this.addInputDataValue(inputValue);
		}
		this.inputDataValues = inputDataValues;
	}

	public void addInputDataValue(String inputDataValue) {
		//Strip off any quotation characters
		if (inputDataValue.startsWith("\"") || inputDataValue.startsWith("\'")) {
			inputDataValue = inputDataValue.substring(1);
		}
		if (inputDataValue.endsWith("\"") || inputDataValue.endsWith("\'")) {
			inputDataValue = inputDataValue.substring(0, inputDataValue.length()-1);
		}
		this.inputDataValues.add(inputDataValue);
	}

	public ArrayList<String> getValidationMessages() {
		return validationMessages;
	}

	public void setValidationMessages(ArrayList<String> validationMessages) {
		this.validationMessages = validationMessages;
	}

	public void addValidationMessage(String validationMessage) {
		this.validationMessages.add(validationMessage);
	}

	public boolean isModificationRequired() {
		return modificationRequired;
	}

	public void setModificationRequired(boolean modificationRequired) {
		this.modificationRequired = modificationRequired;
	}

	public boolean isTranslationRequired() {
		return translationRequired;
	}

	public void setTranslationRequired(boolean translationRequired) {
		this.translationRequired = translationRequired;
	}

	private String getOutputDataValue(String inputData) {
		// Generate output data values by applying modification, translation
		// and default values to input values
		//System.out.println("Getting output data value for " + dataItemName + " from " + inputData);
		String outputDataValue = inputData;
		if (!outputDataValue.isEmpty() && modificationRequired) {
			outputDataValue = modify(outputDataValue);
		}
		if (!outputDataValue.isEmpty() && translationRequired) {
			outputDataValue = translate(outputDataValue);
		}
		if (outputDataValue.isEmpty() && !defaultValue.isEmpty()) {
			outputDataValue = defaultValue;
		}
		if (!outputDataValue.isEmpty() && replaceNonPrintableCharacters) {
			outputDataValue = replaceNonPrintableCharacters(outputDataValue);
		}
		//System.out.println("Output data value for " + dataItemName + " is " + outputDataValue);
		return outputDataValue;
	}

	public ArrayList<String> getValidationValues() {
		return validationValues;
	}

	public void setValidationValues(ArrayList<String> validationValues) {
		this.validationValues = validationValues;
	}

	public void addValidationValue(String validationValue) {
		this.validationValues.add(validationValue);
	}

	public ArrayList<String> getOutputDataValues() {
		return outputDataValues;
	}

	public void setOutputDataValues(ArrayList<String> outputDataValues) {
		this.outputDataValues = outputDataValues;
	}

	public ArrayList<String> getColumnIdentificationValues() {
		return columnIdentificationValues;
	}

	public void setColumnIdentificationValues(
			ArrayList<String> columnIdentificationValues) {
		this.columnIdentificationValues = columnIdentificationValues;
	}

	public void addColumnIdentificationValue(String columnIdentificationValue) {
		this.columnIdentificationValues.add(columnIdentificationValue);
	}

	public String getColumnIdentificationRegex() {
		return columnIdentificationRegex;
	}

	public void setColumnIdentificationRegex(String columnIdentificationRegex) {
		this.columnIdentificationRegex = columnIdentificationRegex;
	}

	public boolean isRemoveDuplicates() {
		return removeDuplicates;
	}

	public void setRemoveDuplicates(boolean removeDuplicates) {
		this.removeDuplicates = removeDuplicates;
	}

	public boolean isReplaceNonPrintableCharacters() {
		return replaceNonPrintableCharacters;
	}

	public void setReplaceNonPrintableCharacters(boolean relaceNonPrintableCharacters) {
		this.replaceNonPrintableCharacters = relaceNonPrintableCharacters;
	}

	public void setReplaceNonPrintableCharacters(String replaceNonPrintableCharacters) {
		//System.out.println(dataItemName + " mandatory flag is " + isMandatory);
		if (replaceNonPrintableCharacters != null) {
			if ("N".equals(replaceNonPrintableCharacters) || "n".equals(replaceNonPrintableCharacters)) {
				this.replaceNonPrintableCharacters = false;
			} else if ("Y".equals(replaceNonPrintableCharacters) || "y".equals(replaceNonPrintableCharacters)) {
				this.replaceNonPrintableCharacters = true;
			}
		}
		//System.out.println(dataItemName + " mandatory flag is " + this.mandatory);
	}

	public String getReplaceNonPrintableCharactersWith() {
		return replaceNonPrintableCharactersWith;
	}

	public void setReplaceNonPrintableCharactersWith(String replaceNonPrintableCharactersWith) {
		this.replaceNonPrintableCharactersWith = replaceNonPrintableCharactersWith;
	}

	@Override
	public String toString() {
		return "NormalisedDataItem [dataItemName="
				+ dataItemName + "columnIdentificationRegex=" + columnIdentificationRegex +
				", dataItemHeaderKeywords="
				+ dataItemHeaderKeywords + ", mandatory=" + mandatory
				+ ", validationRequired=" + validationRequired
				+ ", modificationRequired=" + modificationRequired
				+ ", translationRequired=" + translationRequired
				+ ", validationRegex=" + validationRegex + ", minLength="
				+ minLength + ", maxLength=" + maxLength + ", defaultValue="
				+ defaultValue + ", inputDataValues=" + inputDataValues
				+ ", validationMessages=" + validationMessages + "]";
	}

}


text:
from __future__ import unicode_literals

import os

from django.db import models

class JMeterProfile(models.Model):
    name = models.CharField(max_length=1000, default="")
    path = models.CharField(max_length=1000, default="")
    version = models.CharField(max_length=1000, default="")
    jvm_args_main = models.CharField(max_length=1000, default="-Xms2g -Xmx2g")
    jvm_args_jris = models.CharField(max_length=1000, default="-Xms2g -Xmx2g")

    class Meta:
        db_table = 'jmeter_profile'

    def jmeter_jar_path(self):
        jmeter_jar_path = []
        jmeter_jar_path.append(self.path)
        if 'bin' not in self.path:
            jmeter_jar_path.append('bin')
        if 'ApacheJMeter' not in self.path:
            jmeter_jar_path.append('ApacheJMeter.jar')
        return os.path.join(*jmeter_jar_path)

class Configuration(models.Model):
    name = models.CharField(max_length=1000, default="")
    value = models.CharField(max_length=1000, default="")
    description = models.CharField(max_length=1000, default="")
    secure = models.BooleanField(default=False)

    class Meta:
        db_table = 'configuration'

class SSHKey(models.Model):
    path = models.CharField(max_length=1000, default="")
    description = models.CharField(max_length=1000, default="")
    default = models.BooleanField(default=True)

    class Meta:
        db_table = 'ssh_key'

class User(models.Model):
    login = models.CharField(max_length=100)

    class Meta:
        db_table = 'user'

    def __str__(self):
        return self.login


text:
function ws = wavelet_wavescale(w)
	ws = w.wavScale;


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <color name="card_background">#ffff0000</color>
  <color name="gray">#A1A1A1</color>
  <color name="gray_dark">#7A7A7A</color>
  <color name="white">#FFFFFF</color>
  <color name="card_gray">#CFD1D0</color>
  <color name="card_border">#ffb1bcbe</color>
  <color name="card_text_background">#00000000</color>
  <color name="card_back_bar">#302923</color>
  <color name="pumpkin">#F4410F</color>
  <color name="pumpkin_dark">#DB3B0F</color>
</resources>


text:
/*
 * ElementSelector.cpp
 *
 *  Created on: 12.01.2015
 *      Author: chris
 */

#include "src/selection/ElementSelectorSongs.h"

#include <QSet>
#include <QString>

ElementSelectorSongs::ElementSelectorSongs(int count) :
ElementSelector(count)
{
}

ElementSelectorSongs::~ElementSelectorSongs()
{
}

std::vector<shared_ptr<MediaItem> > ElementSelectorSongs::select(std::vector<shared_ptr<MediaItem> > ventries)
{
	QSet<QString> albums;

	std::vector<shared_ptr<MediaItem> > result;
	int i = 0;
	for (auto &entry : ventries)
	{
		result.push_back(entry);
//		std::cout << *entry << std::endl;
		if (++i == count)
			break;

	}

	return result;
}


text:
var Demo = Demo || {};
Demo.Scene = Demo.Scene || {};

/**
 * @namespace  Camera initialization
 * @class Creates cameras for the scene.
 */
Demo.Scene.Cameras = function (params) {

    this.context = params.context;

    this.cameraMultiplier = params.cubes;

    this.liveCam = null;
    this.FOV = 70;
    this.WIDTH = params.context.jqContainer.width();
    this.HEIGHT = params.context.jqContainer.height();
    this.ASPECT_RATIO = this.WIDTH / this.HEIGHT;
    this.NEAR_PLANE = 1;
    this.FAR_PLANE = 100000;

    this.controls = null;

    this.initPerspective();
};

Demo.Scene.Cameras.prototype = {

    /**
     * Initialize the perspective camera.
     */
    initPerspective: function () {
        this.liveCam = new THREE.PerspectiveCamera(this.FOV, this.ASPECT_RATIO, this.NEAR_PLANE, this.FAR_PLANE);
        var dim = (this.cameraMultiplier) * 25;
        var hyp = Math.sqrt(dim*dim + dim*dim + dim*dim);
        this.liveCam.position.z = hyp;
    }

};


text:
require "rails_helper"

describe "Localized Text One by One Edit Page", type: :feature do
  let!(:project) { create(:project) }
  let(:login) { stubbed_login_as_user }
  let!(:project_language) { create(:project_language, project: project) }
  let!(:empty_localized_text) {
    create(:localized_text, project_language: project_language,
                            master_text_id: master_text.id, needs_entry: true)
  }
  let!(:needs_review_localized_text) {
    create(:localized_text, project_language: project_language,
                            other: "something new", master_text_id: master_text.id, needs_review: true)
  }
  let!(:master_text) { create(:master_text, key: "I am a master text", project: project) }

  before { login }

  describe "getting there" do
    it "links from project language text list" do
      visit entry_project_language_texts_path(project_language)
      expect(page).to have_content("Edit")
      expect(page).to have_link_to(edit_localized_text_path(empty_localized_text.id))
    end
  end

  describe "the page" do
    it "saves updated text" do
      visit edit_localized_text_path(empty_localized_text.id)
      visit edit_localized_text_path(empty_localized_text.id)
      fill_in "localized_text[other]", with: "Je suis un master text"
      click_on "Save"
      expect(empty_localized_text.reload.needs_entry).to be false
    end

    it "saves the comment" do
      visit edit_localized_text_path(empty_localized_text.id)
      fill_in "localized_text_comment", with: "I am a localized comment"
      click_on "Save"
      expect(empty_localized_text.reload.comment).to eq "I am a localized comment"
    end

    it "redirects back to the correct list" do
      visit review_project_language_texts_path(project_language)
      click_link "Edit"
      fill_in "localized_text[other]", with: "Je suis un master text"
      click_on "Save"
      expect(current_path).to eq(review_project_language_texts_path(project_language))
    end

    context "when a localized text has a comment" do
      let(:localized_text) { create(:localized_text, comment: "I am a comment, and a localized one at that") }

      it "displays it" do
        visit edit_localized_text_path(localized_text)
        expect(page).to have_content(localized_text.comment)
      end
    end

    context "with translated_from and needs review" do
      let(:localized_text) { create(:localized_text, translated_from: "I'm the original yo", needs_review: true) }

      it "shows the original" do
        visit edit_localized_text_path(localized_text)
        expect(page).to have_content(localized_text.translated_from)
      end
    end

    context "when translated_from empty" do
      let(:localized_text) { create(:localized_text, translated_from: nil) }

      it "doesn't display the original" do
        visit edit_localized_text_path(localized_text)
        expect(page).not_to have_css(".translated_from")
      end
    end

    context "when doesn't need review" do
      let(:localized_text) { create(:localized_text, translated_from: "I'm the original yo", needs_review: false) }

      it "doesn't display the original" do
        visit edit_localized_text_path(localized_text)
        expect(page).not_to have_css(".translated_from")
      end
    end
  end

  describe "review" do
    it "once reviewed texts are moved out of list" do
      visit review_project_language_texts_path(project_language)
      click_link "Edit"
      fill_in "localized_text[other]", with: "Je suis un master text"
      click_on "Save"
      expect(page).not_to have_css("#localized_text_#{needs_review_localized_text.id}")
    end
  end

  describe "workflow from project language page" do
    let(:project_language) { create(:project_language, need_entry_count: 2) }
    let(:first_localized_text) { create :localized_text, project_language: project_language }
    let(:another_localized_text) { create :localized_text, project_language: project_language }

    it "project_lanaguage # next links through to edit page from overview by calling next_localized_text" do
      expect(ProjectLanguage).to receive(:find).at_least(:once).and_return(project_language)
      expect(project_language).to receive(:next_localized_text).with(nil, all: false).and_return(first_localized_text)
      visit project_language_path(project_language)
      click_on "Start"
      expect(page).to have_current_path(flow_localized_text_path(first_localized_text, flow: "needing"))
    end

    it "redirects to the next master text on save" do
      expect(LocalizedText).to receive(:find).at_least(:once).and_return(first_localized_text)
      allow(first_localized_text).to receive(:project_language).and_return(project_language)
      expect(project_language).to receive(:next_localized_text)
        .with(first_localized_text.key, all: false).and_return(another_localized_text)
      visit flow_localized_text_path(first_localized_text, flow: "needing")
      fill_in "localized_text[other]", with: "Je suis un master text"
      expect { click_on "Save" }.to change { first_localized_text.reload.other }
      expect(page).to have_current_path(flow_localized_text_path(another_localized_text.id, flow: "needing"))
    end

    it "redirects to the next master text on skip" do
      expect(ProjectLanguage).to receive(:find).and_return(project_language)
      expect(project_language).to receive(:next_localized_text).with(first_localized_text.key, all: false)
                                                               .and_return(another_localized_text)
      visit flow_localized_text_path(first_localized_text, flow: "needing")
      click_on "Skip"
      expect(page).to have_current_path(flow_localized_text_path(another_localized_text.id, flow: "needing"))
    end
  end

  describe "workflow when all reviewed" do
    let!(:project_language) { create(:project_language, project: project, need_entry_count: 0, need_review_count: 0) }
    let!(:empty_localized_text) { nil } # unneded
    let!(:needs_review_localized_text) { nil }
    let!(:alpha_localized) { create :finished_localized_text, project_language: project_language, master_text: alpha }
    let!(:ziggurat_localized) { create :finished_localized_text, project_language: project_language, master_text: ziggurat }
    let(:alpha) { create(:master_text, key: "alpha", project: project) }
    let(:ziggurat) { create(:master_text, key: "ziggurat", project: project) }

    it "project_lanaguage # next links through to edit page from overview by calling next_localized_text" do
      visit project_language_path(project_language)
      click_on "Review all"
      expect(page).to have_current_path(flow_localized_text_path(alpha_localized, flow: "all"))
    end

    it "redirects to the next master text on save" do
      visit flow_localized_text_path(alpha_localized, flow: "all")
      fill_in "localized_text[other]", with: "Je suis un master text"
      expect { click_on "Save" }.to change { alpha_localized.reload.other }
      expect(page).to have_current_path(flow_localized_text_path(ziggurat_localized.id, flow: "all"))
    end

    it "redirects to the next master text on next" do
      visit flow_localized_text_path(alpha_localized, flow: "all")
      click_on "Next"
      expect(page).to have_current_path(flow_localized_text_path(ziggurat_localized.id, flow: "all"))
    end

    it "redirects to the first master text on the last one" do
      visit flow_localized_text_path(ziggurat_localized, flow: "all")
      click_on "Next"
      expect(page).to have_current_path(flow_localized_text_path(alpha_localized.id, flow: "all"))
      expect(page).to have_content(/last text.*beginning/i)
    end
  end
end


text:
from mdf import (
    MDFContext,
    varnode,
    evalnode,
    shift,
    now
)

from datetime import datetime, timedelta
from numpy.testing.utils import assert_almost_equal
import pandas as ps
import numpy as np
import unittest
import logging

# this is necessary to stop namespace from looking
# too far up the stack as it looks for the first frame
# not in the mdf package
__package__ = None
_logger = logging.getLogger(__name__)

B = varnode()
C = varnode()

num_calls_A = 0
num_calls_A_override = 0

@evalnode
def A():
    global num_calls_A
    num_calls_A += 1
    return B()

@evalnode
def A_override():
    global num_calls_A_override
    num_calls_A_override += 1
    return C()

@evalnode
def B_override():
    return C() * 3

@evalnode
def D():
    return A() * 2

@evalnode
def D_override():
    return A() + C()

@evalnode
def shift_test():
    values = shift(D, A, [A_override])
    return values[0]

@evalnode
def shift_test2():
    # varnodes can be overridden with evalnodes
    values = shift(D, B, [B_override])
    return values[0]

class OverrideTest(unittest.TestCase):

    def setUp(self):
        self.ctx = MDFContext()

        global num_calls_A, num_calls_A_override
        num_calls_A = 0
        num_calls_A_override = 0

    def test_override(self):
        b = self.ctx[B] = 1
        c = self.ctx[C] = 2
        self.assertEqual(self.ctx[A], b)
        self.assertEqual(num_calls_A, 1)
        self.assertEqual(num_calls_A_override, 0)

        # override A
        self.ctx[A] = A_override
        self.assertEqual(self.ctx[A], c)
        self.assertEqual(num_calls_A, 1)
        self.assertEqual(num_calls_A_override, 1)

        # check the dependencies are working
        c = self.ctx[C] = 100
        self.assertEqual(self.ctx[A], c)
        self.assertEqual(num_calls_A, 1)
        self.assertEqual(num_calls_A_override, 2)

        # check A doesn't still depend on B
        b = self.ctx[B] = 500
        self.assertEqual(self.ctx[A], c)
        self.assertEqual(num_calls_A, 1)
        self.assertEqual(num_calls_A_override, 2)

    def test_shift_override(self):
        b = self.ctx[B] = 1
        c = self.ctx[C] = 2

        # D = A * 2
        # A = B
        self.assertEqual(self.ctx[D], b * 2)
        self.assertEqual(num_calls_A, 1)
        self.assertEqual(num_calls_A_override, 0)

        # shift_test = D [ A := A_override ]
        # A_override = C
        self.assertEqual(self.ctx[shift_test], c * 2)
        self.assertEqual(num_calls_A, 1)
        self.assertEqual(num_calls_A_override, 1)

    def test_shift_override2(self):
        c = self.ctx[C] = 10

        # shift_test = D [ B := B_override ]
        # D = A * 2
        # A = B
        # B_override = C * 3
        self.assertEqual(self.ctx[shift_test2], c * 6)

    def test_shift_override3(self):
        # overriding a node in the root context and then
        # evaluating it in a shifted context should work
        self.ctx[D] = D_override # = A + C
        self.ctx[A] = 10
        self.ctx[C] = 20

        shifted_ctx = self.ctx.shift({A : 100})

        # - if D is used instead of D_override A will equal 2 * 100 = 200
        # - if D_override is used but in the root context the
        #   result will be A + C = 30
        # - if D_override is used and the correct context is used
        #   the results will be A + C = 100 + 20 = 120
        self.assertEqual(shifted_ctx[D], 120)


text:
<?php

// SonataAdminBundle:CRUD:base_list_field.html.twig
return array (
);


text:
import java.util.*;

class endian_swap { public static void main (String[] a) { new endian_swap().begin(); }

/* START SOLUTION */

// Big endian stores most significant BYTE at lowest address
// Mask of a byte at a time and shift it
int swapEndian(int i) {
    return ((i&0xff)<<24)|((i&0xff00)<<8)|((i&0xff0000)>>8)|((i>>24)&0xff);
}

/* END SOLUTION */

void begin() {
	Scanner in = new Scanner(System.in);

	while (in.hasNextInt()) {
		int i = in.nextInt();
		System.out.println(i + " converts to " + swapEndian(i));
	}
}
}


text:
import { PartialNode } from '../../../nodes';
import { StringGen } from '../../common/StringGen';
import { appendCallParms } from '../callParms';

export function generatePartial(sgen: StringGen, node: PartialNode): void {
    sgen.appendLine(`gen.indent = indent + '${node.indent}';`);
    sgen.appendLine(`${node.generatorName}.generateContent(${appendCallParms(node.parameters)});`);
    sgen.appendLine(`gen.indent = indent;`);
}


text:
require 'paperclip'
require 'paperclip_mimetype_fu'
Paperclip::Attachment.send(:include, PaperclipMimetypeFu)


text:
package org.PrometheeIIIFlow.xmcda;

import java.util.ArrayList;
import java.util.Arrays;

public class PrometheeIIIFlowCLI {
    public static void main(String[] args) throws Exception
    {
        final ArrayList<String> argsList = new ArrayList<String>(Arrays.asList(args));
        if ( argsList.remove("--v2") )
        {
            PrometheeIIIFlowCLI_XMCDAv2.main((String[]) argsList.toArray(new String[]{}));
        }
        else if ( argsList.remove("--v3") )
        {
            PrometheeIIIFlowCLI_XMCDAv3.main((String[]) argsList.toArray(new String[]{}));
        }
        else
        {
            System.err.println("missing mandatory option --v2 or --v3");
            System.exit(-1);
        }
    }
}


text:
<?php
namespace Chamilo\Core\Menu\Renderer\Item\Bar\Item;

use Chamilo\Core\Menu\Renderer\Item\Bar\Bar;
use Chamilo\Libraries\Platform\Translation;

/**
 *
 * @package Chamilo\Core\Menu\Renderer\Item\Bar\Item
 * @author Hans De Bisschop <hans.de.bisschop@ehb.be>
 * @author Magali Gillard <magali.gillard@ehb.be>
 * @author Eduard Vossen <eduard.vossen@ehb.be>
 */
class LinkItem extends Bar
{

    public function isItemSelected()
    {
        return false;
    }

    public function getContent()
    {
        $html = array();
        $html[] = 'getItem()->get_url() . '" target="' . $this->getItem()->get_target_string() . '">';

        $html[] = '
' .
             $this->getItem()->get_titles()->get_translation(Translation::getInstance()->getLanguageIsocode()) . '
';

        $html[] = '';

        return implode(PHP_EOL, $html);
    }
}


text:
<?php

namespace ca\bueller\Formation;

interface iValidator
{
    /**
     * @param mixed $value
     * @return bool
     */
    public function validate ( $value );
}


text:
<?php

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
AdminUIHelper::startAdminArea($this);
?>
<form action="index.php" method="post" name="adminForm" id="adminForm">

<?php // Loading Templates in Tabs
$tabarray = array();
$tabarray['edit'] = 'COM_VIRTUEMART_ADMIN_PAYMENT_FORM';
$tabarray['config'] = 'COM_VIRTUEMART_ADMIN_PAYMENT_CONFIGURATION';

AdminUIHelper::buildTabs ( $this, $tabarray,$this->payment->virtuemart_paymentmethod_id );
// Loading Templates in Tabs END ?>

    <!-- Hidden Fields -->
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="virtuemart_paymentmethod_id" value="<?php echo $this->payment->virtuemart_paymentmethod_id; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="xxcontroller" value="paymentmethod" />
<input type="hidden" name="view" value="paymentmethod" />

<?php echo JHtml::_('form.token'); ?>
</form>
    <?php AdminUIHelper::endAdminArea(); ?>


text:
package cn.edu.nju.software.jksc.symys.activities;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RelativeLayout;

import java.util.ArrayList;
import java.util.List;

import cn.edu.nju.software.jksc.symys.R;

public class ChooseLevelActivity extends Activity{
    private ViewPager mViewPager;
    List<View> viewList;
    private static final int SIZE = 3;
    MyPagerAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_choose_level);

        LayoutInflater mInflater = getLayoutInflater().from(this);

        View v1 = mInflater.inflate(R.layout.layout1, null);
        View v2 = mInflater.inflate(R.layout.layout1, null);
        View v3 = mInflater.inflate(R.layout.layout1, null);

        //添加页面数据
        viewList = new ArrayList<View>();
        viewList.add(v1);
        viewList.add(v2);
        viewList.add(v3);
        //实例化适配器
        mViewPager = (ViewPager) findViewById(R.id.viewpager);
        adapter=new MyPagerAdapter(viewList);
        adapter.setContext(this);
        mViewPager.setAdapter(adapter);
        mViewPager.setCurrentItem(0); //设置默认当前页

        View view = viewList.get(0);
        Button leftBtn = (Button) findViewById(R.id.chooseBtLeft);
        leftBtn.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                int curItem = mViewPager.getCurrentItem();
                if (curItem > 0) {
                    mViewPager.setCurrentItem(curItem - 1);
                }
            }
        });
        Button rightBtn = (Button) findViewById(R.id.chooseBtRight);
        rightBtn.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                int curItem = mViewPager.getCurrentItem();
                if (curItem < viewList.size()) {
                    mViewPager.setCurrentItem(curItem + 1);
                }
            }
        });
       // ChooseButtonFactory.setCurrentLevelStatus(this, 8);
        Log.d("levelStatusUpdate:",ChooseButtonFactory.getStatusString(this)+":::end");
    }

    @Override
    protected void onResume(){
        super.onResume();
        Log.v("resume", "");
        adapter.updateView(viewList.get(0), 0);
        adapter.updateView(viewList.get(1),1);
        adapter.updateView(viewList.get(2),2);
    }

}


text:
This playbook adds email details to the relevant context entities and handles original email attachments.

The v2 playbook enables parsing email artifacts more efficiently, including:
- Using incident fields and not incident labels.
- Providing separate paths to "Phishing Alerts".
- Using the new "Get Original Email - Generic v2" playbook to retrieve original emails as EML files from the following integrations:
  * EWS v2
  * Microsoft Graph Mail integration
  * Gmail
  * FireEye EX and FireEye CM
  * Proofpoint Protection Server
  * Agari Phishing Defense (EWS v2, MSGraph Mail, Gmail)
  * Mimecast

## Dependencies
This playbook uses the following sub-playbooks, integrations, and scripts.

### Sub-playbooks
* Get Original Email - Generic v2

### Integrations
This playbook does not use any integrations.

### Scripts
* SetGridField
* Set
* DemistoUploadFileV2
* ParseEmailFiles
* IdentifyAttachedEmail
* SetAndHandleEmpty

### Commands
* setIncident
* rasterize-email

## Playbook Inputs
---

| **Name** | **Description** | **Default Value** | **Required** |
| --- | --- | --- | --- |
| File | An EML or MSG file. | File.None | Optional |
| Email | The receiver email address. | incident.emailto | Optional |
| EmailCC | The email CC addresses. | incident.emailcc | Optional |
| EmailFrom | The sender email address. | incident.emailfrom | Optional |
| EmailSubject | The email subject. | incident.emailsubject | Optional |
| EmailText | The email text. | incident.emailbody | Optional |
| EmailHtml | The email HTML. | incident.emailhtml | Optional |
| EmailHeaders | The email headers. | incident.phishingreporteremailheaders | Optional |
| EmailFormat | The email format. | incident.emailformat | Optional |
| GetOriginalEmail | Retrieves the original email in the thread.

You must have the necessary permissions in your email service to execute global search.

- For EWS: eDiscovery
- For Gmail: Google Apps Domain-Wide Delegation of Authority
- For MSGraph: As described in the \[message-get API\]\(https://docs.microsoft.com/en-us/graph/api/message-get\) and the \[user-list-messages API\]\(https://docs.microsoft.com/en-us/graph/api/user-list-messages\) | False | Optional |
| MessageID | The original email message ID to retrieve. Holds the value of the "Message-ID" header of the original email. This value is passed as an input to the "Get Original Email - Generic v2" playbook. | incident.emailmessageid | Optional |
| UserID | The user's email address to retrieve the original email. This value is passed as an input to the "Get Original Email - Generic v2" playbook. | incident.emailto | Optional |
| Thread-Topic | The value of the "Thread-Topic" header which holds the original email subject, needed for forwarded email scenarios. It is passed as an input to the "Get Original Email - Generic v2" playbook to use in the relevant sub-playbooks. | incident.emailsubject | Optional |
| EmailBrand | If this value is provided, only the relevant playbook runs. If no value is provided, all sub-playbooks are run.
Possible values:
- Gmail
- EWS v2
- MicrosoftGraphMail
- EmailSecurityGateway
Choosing the EmailSecurityGateway executes the following if enabled: - FireEye EX \(Email Security\) - Proofpoint TAP - Mimecast. |  | Optional |
| EmailFileToExtract | Reported emails and emails retrieved during playbook execution can contain multiple nested email files. For example, an EML nested inside another EML file.
If multiple level files are detected, this field determines which file represents the phishing email.

For example:
User1 receives an email from Attacker. User1 attaches the email as an EML file and sends the email to User2.
User2 also attaches that email as a file, and reports it as phishing. In this case, the phishing email would be the "inner file" \(as opposed to "outer file"\).

Possible values are: Inner file, Outer file, All files.
Inner file: The file at the deepest level is parsed. If there is only one file, that file is parsed.
Outer file: The file at the first level is parsed.
All files: All files are parsed. Do not use this option in the phishing playbook, as there should only be one phishing email per playbook run. | Inner file | Optional |

## Playbook Outputs
---

| **Path** | **Description** | **Type** |
| --- | --- | --- |
| Email.HTML | The email HTML body if it exists. | string |
| Email | The email object. | string |
| Email.CC | The email CC addresses. | string |
| Email.From | The email sender address. | string |
| Email.Subject | The email subject. | string |
| Email.To | The email receiver addresses. | string |
| Email.Text | The email text body if it exists. | string |
| Email.Headers | The full email headers as a single string. | string |
| Email.Attachments | The list of attachment names in the email. | string |
| Email.Format | The format of the email if available. | string |
| File | The file object. | string |

## Playbook Image
---
![Process Email - Generic v2](../doc_files/Process_Email_-_Generic_v2.png)


text:
#ifndef _h_BinaryData_
#define _h_BinaryData_

#include "FMWrapper/FMXClient.h"
#include "FMWrapper/FMXTypes.h"

extern "C++"
{
    namespace fmx
    {
    	// A BinaryData type is a collection of streams. Each stream has two parts, a TypeId and Data.
    	//		There can be multiple related streams, but there should never be more than one
    	//		stream of the same type.  Streams should not be empty.
    	// Container fields can be considered to be of type BinaryData when data is stored in the database
    	//	    as opposed to objects inserted by reference (path of file as text).
    	//
        // To iterate through the streams of a BinaryData, use GetCount and then call GetIndex to
        //		get the TypeID for each stream.
        //
        // To create a new BinaryData object, use the autoptr version to construct the object, then
        //	Add() streams.
        class BinaryData
        {
        public:
            		// Here are some common QuadChar types you may encounter, and notes on required usage.
            		// The actual format of the data should adhere to the standard documented by
            		// the format creator.
            		//
            		//	"FNAM" is a filename stream. This is used either to display the filename of the file
					//		in the field (non-images or images that cannot be displayed) and for a initial
					//		suggested filename when exporting field contents. Please use the special accessors
					//		below ("GetFNAMData and AddFNAMData) to get a text representation of this data.
            		//
            		//	Images:
            		//		{ "JPEG", "GIFf", "EPS ", "PICT", "META", "PNG ", "BMP ", "PDF " }
            		//		Images must have at least a JPEG or GIFf stream in addition to any
            		//		other image type.  A PICT stream must not have the 512 byte "file" header. The
					//		PICT stream should match the format that is used on the clipboard.  A "SIZE"
					//		stream is also required for FileMaker to display the image. Please use the special
					//		accessors below (GetSIZEData and AddSIZEData) to get the height and width values
					//		for the image.
                    //      When generating other kinds of graphical data, use JPEG for a preview,
                    //    	and the other format will be preferred if possible. For example, to generate
                    //   	a PNG picture, you have to add "PNG " and "JPEG" streams.
                    //   	Combining "PNG " and "GIFf" streams will cause the PNG to be ignored.
            		//
            		//	Files:
            		//		{ "FILE" (binary file data), "FORK" (Mac only resource fork) }
            		//
            		//	Sound:
            		//		{ "snd " }
            		//		Always Mac raw format.

            		// Any other types you encounter are not documented for plug-in use. Use them at your own risk.

            inline BinaryData &operator = ( const BinaryData &source );
            inline bool operator == ( const BinaryData &compareData ) const;
            inline bool operator != ( const BinaryData &compareData ) const;
            inline int GetCount () const;
            inline int GetIndex ( const QuadChar& dataType ) const;
            inline ulong GetTotalSize () const;
            inline void GetType ( int index, QuadChar& dataType ) const;
            inline ulong GetSize ( int index ) const;
            inline errcode GetData ( int index, ulong offset, ulong amount, void *buffer ) const;

            // You should exercise great care in using the following functions. Removing or modifying a required stream
            // could have undesirable and undefined results.
            inline errcode Add ( const QuadChar& dataType, ulong amount, void *buffer );
            inline bool Remove ( const QuadChar& dataType );
            inline void RemoveAll ();

			// Special accessors for FileMaker specific storage formats
			//		[ ONLY IN FM8 (API VERSION 51) AND LATER ]
			inline errcode GetFNAMData ( Text &filepathlist ) const;
			inline errcode AddFNAMData ( const Text &filepathlist );
			inline errcode GetSIZEData ( short &width, short &height ) const;
			inline errcode AddSIZEData ( short width, short height );

            inline void operator delete ( void *obj );

		private:
            BinaryData ();
            BinaryData ( const BinaryData &source );

        };

        class BinaryDataAutoPtr : public std::auto_ptr<BinaryData>
        {
			typedef BinaryDataAutoPtr	UpCaster;
        public:
            inline BinaryDataAutoPtr ();
            inline BinaryDataAutoPtr ( const BinaryData &sourceData );

        };
    }
}

// These functions are only useful for C-only environments or for porting to other languages (ex., Pascal).
extern "C"
{
    fmx::BinaryData FMX_API *FM_BinaryData_Constructor1 ( fmx::_fmxcpt &_x ) throw ();
    fmx::BinaryData FMX_API *FM_BinaryData_Constructor2 ( const fmx::BinaryData &sourceData, fmx::_fmxcpt &_x ) throw ();
    fmx::BinaryData FMX_API &FM_BinaryData_operatorAS ( void *_self, const fmx::BinaryData &source, fmx::_fmxcpt &_x ) throw ();
    bool FMX_API FM_BinaryData_operatorEQ ( const void *_self, const fmx::BinaryData &compareData, fmx::_fmxcpt &_x ) throw ();
    bool FMX_API FM_BinaryData_operatorNE ( const void *_self, const fmx::BinaryData &compareData, fmx::_fmxcpt &_x ) throw ();
    int FMX_API FM_BinaryData_GetCount ( const void *_self, fmx::_fmxcpt &_x ) throw ();
    int FMX_API FM_BinaryData_GetIndex ( const void *_self, const fmx::QuadChar& dataType, fmx::_fmxcpt &_x ) throw ();
    fmx::ulong FMX_API FM_BinaryData_GetTotalSize ( const void *_self, fmx::_fmxcpt &_x ) throw ();
    void FMX_API FM_BinaryData_GetType ( const void *_self, int index, fmx::QuadChar& dataType, fmx::_fmxcpt &_x ) throw ();
    fmx::ulong FMX_API FM_BinaryData_GetSize ( const void *_self, int index, fmx::_fmxcpt &_x ) throw ();
    fmx::errcode FMX_API FM_BinaryData_GetData ( const void *_self, int index, fmx::ulong offset, fmx::ulong amount, void *buffer, fmx::_fmxcpt &_x ) throw ();
    fmx::errcode FMX_API FM_BinaryData_Add ( void *_self, const fmx::QuadChar& dataType, fmx::ulong amount, void *buffer, fmx::_fmxcpt &_x ) throw ();
    bool FMX_API FM_BinaryData_Remove ( void *_self, const fmx::QuadChar& dataType, fmx::_fmxcpt &_x ) throw ();
    void FMX_API FM_BinaryData_RemoveAll ( void *_self, fmx::_fmxcpt &_x ) throw ();
    void FMX_API FM_BinaryData_Delete ( void *_self, fmx::_fmxcpt &_x ) throw ();

    fmx::errcode FMX_API FM_BinaryData_GetFNAMData ( const void *_self, fmx::Text &filepathlist, fmx::_fmxcpt &_x ) throw ();
    fmx::errcode FMX_API FM_BinaryData_AddFNAMData ( void *_self, const fmx::Text &filepathlist, fmx::_fmxcpt &_x ) throw ();
    fmx::errcode FMX_API FM_BinaryData_GetSIZEData ( const void *_self, short &width, short &height, fmx::_fmxcpt &_x ) throw ();
    fmx::errcode FMX_API FM_BinaryData_AddSIZEData ( void *_self, short width, short height, fmx::_fmxcpt &_x ) throw ();
}

extern "C++"
{
    namespace fmx
    {
        inline BinaryData &BinaryData::operator = ( const BinaryData &source )
        {
            _fmxcpt _x;
            BinaryData &_rtn = FM_BinaryData_operatorAS ( this, source, _x );
            _x.Check ();
            return _rtn;
        }
        inline bool BinaryData::operator == ( const BinaryData &compareData ) const
        {
            _fmxcpt _x;
            bool _rtn = FM_BinaryData_operatorEQ ( this, compareData, _x );
            _x.Check ();
            return _rtn;
        }
        inline bool BinaryData::operator != ( const BinaryData &compareData ) const
        {
            _fmxcpt _x;
            bool _rtn = FM_BinaryData_operatorNE ( this, compareData, _x );
            _x.Check ();
            return _rtn;
        }
        inline int BinaryData::GetCount () const
        {
            _fmxcpt _x;
            int _rtn = FM_BinaryData_GetCount ( this, _x );
            _x.Check ();
            return _rtn;
        }
        inline int BinaryData::GetIndex ( const QuadChar& dataType ) const
        {
            _fmxcpt _x;
            int _rtn = FM_BinaryData_GetIndex ( this, dataType, _x );
            _x.Check ();
            return _rtn;
        }
        inline ulong BinaryData::GetTotalSize () const
        {
            _fmxcpt _x;
            ulong _rtn = FM_BinaryData_GetTotalSize ( this, _x );
            _x.Check ();
            return _rtn;
        }
        inline void BinaryData::GetType ( int index, QuadChar& dataType ) const
        {
            _fmxcpt _x;
            FM_BinaryData_GetType ( this, index, dataType, _x );
            _x.Check ();
        }
        inline ulong BinaryData::GetSize ( int index ) const
        {
            _fmxcpt _x;
            ulong _rtn = FM_BinaryData_GetSize ( this, index, _x );
            _x.Check ();
            return _rtn;
        }
        inline errcode BinaryData::GetData ( int index, ulong offset, ulong amount, void *buffer ) const
        {
            _fmxcpt _x;
            errcode _rtn = FM_BinaryData_GetData ( this, index, offset, amount, buffer, _x );
            _x.Check ();
            return _rtn;
        }
        inline errcode BinaryData::Add ( const QuadChar& dataType, ulong amount, void *buffer )
        {
            _fmxcpt _x;
            errcode _rtn = FM_BinaryData_Add ( this, dataType, amount, buffer, _x );
            _x.Check ();
            return _rtn;
        }
        inline bool BinaryData::Remove ( const QuadChar& dataType )
        {
            _fmxcpt _x;
            bool _rtn = FM_BinaryData_Remove ( this, dataType, _x );
            _x.Check ();
            return _rtn;
        }
        inline void BinaryData::RemoveAll ()
        {
            _fmxcpt _x;
            FM_BinaryData_RemoveAll ( this, _x );
            _x.Check ();
        }
        inline void BinaryData::operator delete ( void *obj )
        {
            _fmxcpt _x;
            FM_BinaryData_Delete ( obj, _x );
            _x.Check ();
        }

        inline BinaryDataAutoPtr::BinaryDataAutoPtr ()
        {
            _fmxcpt _x;
            FMX_AUTOPTRRESET ( FM_BinaryData_Constructor1 ( _x ) );
            _x.Check ();
        }
        inline BinaryDataAutoPtr::BinaryDataAutoPtr ( const BinaryData &sourceData )
        {
            _fmxcpt _x;
            FMX_AUTOPTRRESET ( FM_BinaryData_Constructor2 ( sourceData, _x ) );
            _x.Check ();
        }

        inline errcode BinaryData::GetFNAMData ( Text &filepathlist ) const
        {
            _fmxcpt _x;
            errcode _rtn = FM_BinaryData_GetFNAMData ( this, filepathlist, _x );
            _x.Check ();
            return _rtn;
        }
        inline errcode BinaryData::AddFNAMData ( const Text &filepathlist )
        {
            _fmxcpt _x;
            errcode _rtn = FM_BinaryData_AddFNAMData ( this, filepathlist, _x );
            _x.Check ();
            return _rtn;
        }
        inline errcode BinaryData::GetSIZEData ( short &width, short &height ) const
        {
            _fmxcpt _x;
            errcode _rtn = FM_BinaryData_GetSIZEData ( this, width, height, _x );
            _x.Check ();
            return _rtn;
        }
        inline errcode BinaryData::AddSIZEData ( short width, short height )
        {
            _fmxcpt _x;
            errcode _rtn = FM_BinaryData_AddSIZEData ( this, width, height, _x );
            _x.Check ();
            return _rtn;
        }
    }
}

#endif /* _h_BinaryData_ */


text:
"""
:mod:`ranges`
==================

.. module:: ranges
   :platform: Unix, Windows
   :synopsis:

.. moduleauthor:: hbldh <henrik.blidh@nedomkull.com>

Created on 2015-06-04, 15:12

"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import

from operator import itemgetter
from itertools import groupby
import numpy as np

def int_array_to_ranges(array):
    """Converts an monotonically increasing (or decreasing) array of integers into a
    list of index ranges with identical value.

    :param array: The array to segment.
    :type array: :py:class:`numpy.ndarray` or list
    :return: The list of ranges as index tuples.
    :rtype: list

    """
    diffs = np.where(np.diff(array))[0]
    if len(diffs) == 0:
        ranges = [(0, len(array))]
    elif len(diffs) == 1:
        ranges = [(0, diffs[0] + 1), (diffs[0] + 1, len(array))]
    else:
        ranges = [(x + 1, y + 1) for x, y in zip(diffs[:-1], diffs[1:])]
        ranges.insert(0, (0, ranges[0][0]))
        ranges.append((ranges[-1][1], len(array)))
    return ranges

def bool_array_to_ranges(array):
    """Converts a boolean array into a list of segments where it is ``True``

    :param array: A boolean array to segment.
    :type array: :py:class:`numpy.ndarray`
    :return: A list of tuples with start and stop index of the ranges.
    :rtype: list

    """
    ranges = []
    for k, g in groupby(enumerate(np.where(array > 0)[0]), lambda (i, x): i - x):
        group = map(itemgetter(1), g)
        ranges.append((group[0], group[-1]))
    return ranges