text:
<?php
declare(strict_types=1);

namespace StingerSoft\EntitySearchBundle\Services;

use Doctrine\Common\EventSubscriber;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\Event\PostFlushEventArgs;
use StingerSoft\EntitySearchBundle\Events\DocumentPreSaveEvent;
use StingerSoft\EntitySearchBundle\Model\SearchableAlias;
use StingerSoft\EntitySearchBundle\Services\Mapping\EntityToDocumentMapperInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

class DoctrineListener implements EventSubscriber {

	/**
	 *
	 * @var EntityToDocumentMapperInterface
	 */
	protected $entityToDocumentMapper;

	/**
	 *
	 * @var SearchService
	 */
	protected $searchService;

	/**
	 * @var bool
	 */
	protected $needsFlush = false;

	/**
	 * @var bool
	 */
	protected $enableIndexing;

	/**
	 * @var EventDispatcherInterface|null
	 */
	protected $eventDispatcher;

	/**
	 * DoctrineListener constructor.
	 * @param EntityToDocumentMapperInterface $entityToDocumentMapper
	 * @param SearchService $searchService
	 * @param bool $enableIndexing
	 */
	public function __construct(EntityToDocumentMapperInterface $entityToDocumentMapper, SearchService $searchService, $enableIndexing = false) {
		$this->entityToDocumentMapper = $entityToDocumentMapper;
		$this->searchService = $searchService;
		$this->enableIndexing = $enableIndexing;
	}

	/**
	 * @return array|string[]
	 */
	public function getSubscribedEvents(): array {
		return array(
			'postPersist',
			'postUpdate',
			'preRemove',
			'postFlush'
		);
	}

	/**
	 * @return EventDispatcherInterface|null
	 */
	public function getEventDispatcher(): ?EventDispatcherInterface {
		return $this->eventDispatcher;
	}

	/**
	 * @param EventDispatcherInterface|null $eventDispatcher
	 * @required
	 */
	public function setEventDispatcher(EventDispatcherInterface $eventDispatcher = null): void {
		$this->eventDispatcher = $eventDispatcher;
	}

	/**
	 *
	 */
	public function enableIndexing(): void {
		$this->enableIndexing = true;
	}

	/**
	 *
	 */
	public function disableIndexing(): void {
		$this->enableIndexing = false;
	}

	/**
	 * @return bool
	 */
	public function isIndexingEnabled(): bool {
		return $this->enableIndexing;
	}

	/**
	 * Index the entity after it is persisted for the first time
	 *
	 * @param LifecycleEventArgs $args
	 */
	public function postPersist(LifecycleEventArgs $args): void {
		if(!$this->enableIndexing) {
			return;
		}
		$this->updateEntity($args->getObject(), $args->getObjectManager());
	}

	/**
	 * @param PostFlushEventArgs $eventArgs
	 * @throws \Doctrine\ORM\ORMException
	 * @throws \Doctrine\ORM\OptimisticLockException
	 */
	public function postFlush(PostFlushEventArgs $eventArgs): void {
		if($this->needsFlush) {
			$this->needsFlush = false;
			$eventArgs->getEntityManager()->flush();
		}
	}

	/**
	 * Removes the entity from the index when it marked for deletion
	 *
	 * @param LifecycleEventArgs $args
	 */
	public function preRemove(LifecycleEventArgs $args): void {
		if(!$this->enableIndexing) {
			return;
		}
		$this->removeEntity($args->getObject(), $args->getObjectManager());
	}

	/**
	 * Updates the entity in the index after it is updated
	 *
	 * @param LifecycleEventArgs $args
	 */
	public function postUpdate(LifecycleEventArgs $args): void {
		if(!$this->enableIndexing) return;
		$this->updateEntity($args->getObject(), $args->getObjectManager());
	}

	/**
	 *
	 * @return EntityToDocumentMapperInterface
	 */
	protected function getEntityToDocumentMapper(): EntityToDocumentMapperInterface {
		return $this->entityToDocumentMapper;
	}

	/**
	 *
	 * @return SearchService
	 */
	protected function getSearchService(): SearchService {
		return $this->searchService;
	}

	/**
	 *
	 * @param object $entity
	 */
	protected function updateEntity(object $entity, ObjectManager $manager): void {
		if($entity instanceof SearchableAlias) {
			$entity = $entity->getEntityToIndex();
		}
		$document = $this->getEntityToDocumentMapper()->createDocument($manager, $entity);
		if($document !== null) {
			if($this->getEventDispatcher()) {
				$event = new DocumentPreSaveEvent($document);
				$this->getEventDispatcher()->dispatch($event, DocumentPreSaveEvent::NAME);
			}
			$this->getSearchService()->saveDocument($document);
			$this->needsFlush = true;
		}
	}

	/**
	 *
	 * @param object $entity
	 */
	protected function removeEntity(object $entity, ObjectManager $manager): void {
		if($entity instanceof SearchableAlias) {
			$entity = $entity->getEntityToIndex();
		}
		$document = $this->getEntityToDocumentMapper()->createDocument($manager, $entity);
		if($document !== null) {
			$this->getSearchService()->removeDocument($document);
			$this->needsFlush = true;
		}
	}
}


text:
package com.jiaziang8.alarm.object;

public class PushMessage {
	public String type;
	public String message;

	public PushMessage(String type,String message){
		this.type = type;
		this.message = message;
	}
	public String getType(){
		return this.type;
	}
	public String getMessage(){
		return this.message;
	}
	public void setType(String type){
		this.type = type;
	}
	public void setMeaaage(String message){
		this.message = message;
	}

	@Override
	public String toString(){
		return "type:"+type+"message:"+message;
	}
}

redpajama_set_name: RedPajamaGithub


text:
#include "imlib_config.h"
#if defined(IMLIB_ENABLE_IMAGE_IO)

#include "py/obj.h"
#include "py/nlr.h"
#include "py/mphal.h"
#include "py/runtime.h"

#include "py_assert.h"
#include "py_helper.h"
#include "py_image.h"
#include "py_imageio.h"

#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
#include "ff_wrapper.h"
#endif
#include "framebuffer.h"
#include "omv_boardconfig.h"

#define OLD_BINARY_BPP      0
#define OLD_GRAYSCALE_BPP   1
#define OLD_RGB565_BPP      2
#define OLD_BAYER_BPP       3
#define OLD_JPG_BPP         4

#define MAGIC_SIZE          16
#define ALIGN_SIZE          16
#define AFTER_SIZE_PADDING  12

#define ORIGINAL_VER        10
#define RGB565_FIXED_VER    11
#define NEW_PIXFORMAT_VER   20

#ifndef __DCACHE_PRESENT
#define IMAGE_ALIGNMENT 32 // Use 32-byte alignment on MCUs with no cache for DMA buffer alignment.
#else
#define IMAGE_ALIGNMENT __SCB_DCACHE_LINE_SIZE
#endif

#define IMAGE_T_SIZE_ALIGNED (((sizeof(uint32_t) + sizeof(image_t) + (IMAGE_ALIGNMENT) - 1) \
                             / (IMAGE_ALIGNMENT)) \
                             * (IMAGE_ALIGNMENT))

STATIC size_t image_size_aligned(image_t *image) {
    return ((image_size(image) + (IMAGE_ALIGNMENT) - 1) / (IMAGE_ALIGNMENT)) * (IMAGE_ALIGNMENT);
}

typedef enum image_io_stream_type {
    IMAGE_IO_FILE_STREAM,
    IMAGE_IO_MEMORY_STREAM,
} image_io_stream_type_t;

typedef struct py_imageio_obj {
    mp_obj_base_t base;
    image_io_stream_type_t type;
    bool closed;
    uint32_t count;
    uint32_t offset;
    uint32_t ms;
    union {
        #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
        struct {
            FIL fp;
            int version;
        };
        #endif
        struct {
            uint32_t size;
            uint8_t *buffer;
        };
    };
} py_imageio_obj_t;

STATIC py_imageio_obj_t *py_imageio_obj(mp_obj_t self)
{
    py_imageio_obj_t *stream = MP_OBJ_TO_PTR(self);

    if (stream->closed) {
        mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Stream closed"));
    }

    return stream;
}

STATIC void py_imageio_print(const mp_print_t *print, mp_obj_t self, mp_print_kind_t kind)
{
    py_imageio_obj_t *stream = MP_OBJ_TO_PTR(self);
    mp_printf(print, "{\"type\":%s, \"closed\":%s, \"count\":%u, \"offset\":%u, "
                      "\"version\":%u, \"buffer_size\":%u, \"size\":%u}",
        (stream->type == IMAGE_IO_FILE_STREAM) ? "\"file stream\"" : "\"memory stream\"",
        stream->closed ? "\"true\"" : "\"false\"",
        stream->count,
        stream->offset,
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
        (stream->type == IMAGE_IO_FILE_STREAM)  ? stream->version : 0,
#else
        0,
#endif
        (stream->type == IMAGE_IO_FILE_STREAM) ? 0 : stream->size,
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
        (stream->type == IMAGE_IO_FILE_STREAM) ? f_size(&stream->fp) : (stream->count * stream->size));
#else
        stream->count * stream->size);
#endif
}

STATIC mp_obj_t py_imageio_get_type(mp_obj_t self)
{
    py_imageio_obj_t *stream = MP_OBJ_TO_PTR(self);
    return mp_obj_new_int(stream->type);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(py_imageio_get_type_obj, py_imageio_get_type);

STATIC mp_obj_t py_imageio_is_closed(mp_obj_t self)
{
    py_imageio_obj_t *stream = MP_OBJ_TO_PTR(self);
    return mp_obj_new_int(stream->closed);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(py_imageio_is_closed_obj, py_imageio_is_closed);

STATIC mp_obj_t py_imageio_count(mp_obj_t self)
{
    py_imageio_obj_t *stream = MP_OBJ_TO_PTR(self);
    return mp_obj_new_int(stream->count);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(py_imageio_count_obj, py_imageio_count);

STATIC mp_obj_t py_imageio_offset(mp_obj_t self)
{
    py_imageio_obj_t *stream = MP_OBJ_TO_PTR(self);
    return mp_obj_new_int(stream->offset);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(py_imageio_offset_obj, py_imageio_offset);

#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
STATIC mp_obj_t py_imageio_version(mp_obj_t self)
{
    py_imageio_obj_t *stream = MP_OBJ_TO_PTR(self);
    return (stream->type == IMAGE_IO_FILE_STREAM) ?  mp_obj_new_int(stream->version) : mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(py_imageio_version_obj, py_imageio_version);
#endif

STATIC mp_obj_t py_imageio_buffer_size(mp_obj_t self)
{
    py_imageio_obj_t *stream = MP_OBJ_TO_PTR(self);

    #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
    if (stream->type == IMAGE_IO_FILE_STREAM) {
        return mp_const_none;
    }
    #endif

    return mp_obj_new_int(stream->size - IMAGE_T_SIZE_ALIGNED);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(py_imageio_buffer_size_obj, py_imageio_buffer_size);

STATIC mp_obj_t py_imageio_size(mp_obj_t self)
{
    py_imageio_obj_t *stream = MP_OBJ_TO_PTR(self);

    #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
    if (stream->type == IMAGE_IO_FILE_STREAM) {
        return mp_obj_new_int(f_size(&stream->fp));
    }
    #endif

    return mp_obj_new_int(stream->count * stream->size);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(py_imageio_size_obj, py_imageio_size);

STATIC mp_obj_t py_imageio_write(mp_obj_t self, mp_obj_t img_obj)
{
    py_imageio_obj_t *stream = py_imageio_obj(self);
    image_t *image = py_image_cobj(img_obj);

    uint32_t ms = mp_hal_ticks_ms(), elapsed_ms = ms - stream->ms;
    stream->ms = ms;

    if (0) {
    #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
    } else if (stream->type == IMAGE_IO_FILE_STREAM) {
        FIL *fp = &stream->fp;

        write_long(fp, elapsed_ms);
        write_long(fp, image->w);
        write_long(fp, image->h);

        char padding[ALIGN_SIZE] = {};

        if (stream->version < NEW_PIXFORMAT_VER) {
            if (image->pixfmt == PIXFORMAT_BINARY) {
                write_long(fp, OLD_BINARY_BPP);
            } else if (image->pixfmt == PIXFORMAT_GRAYSCALE) {
                write_long(fp, OLD_GRAYSCALE_BPP);
            } else if (image->pixfmt == PIXFORMAT_RGB565) {
                write_long(fp, OLD_RGB565_BPP);
            } else if (image->pixfmt == PIXFORMAT_BAYER) {
                write_long(fp, OLD_BAYER_BPP);
            } else if (image->pixfmt == PIXFORMAT_JPEG) {
                write_long(fp, image->size);
            } else {
                mp_raise_msg(&mp_type_ValueError, MP_ERROR_TEXT("Invalid image stream bpp"));
            }
        } else {
            write_long(fp, image->pixfmt);
            write_long(fp, image->size);
            write_data(fp, padding, AFTER_SIZE_PADDING);
        }

        uint32_t size = image_size(image);
        write_data(fp, image->data, size);

        if (size % ALIGN_SIZE) {
            write_data(fp, padding, ALIGN_SIZE - (size % ALIGN_SIZE));
        }

        // Seeking to the middle of a file and writing data corrupts the remainder of the file. So,
        // truncate the rest of the file when this happens to prevent crashing because of this.
        if (!f_eof(fp)) {
            file_truncate(fp);
        }

        stream->count = stream->offset + 1;
    #endif
    } else if (stream->type == IMAGE_IO_MEMORY_STREAM) {
        if (stream->offset == stream->count) {
            mp_raise_msg(&mp_type_EOFError, MP_ERROR_TEXT("End of stream"));
        }

        uint32_t size = image_size(image);

        if (stream->size < size) {
            mp_raise_msg(&mp_type_ValueError, MP_ERROR_TEXT("Invalid frame size"));
        }

        *((uint32_t *) (stream->buffer + (stream->offset * stream->size))) = elapsed_ms;
        memcpy(stream->buffer + (stream->offset * stream->size) + sizeof(uint32_t), image, sizeof(image_t));
        memcpy(stream->buffer + (stream->offset * stream->size) + IMAGE_T_SIZE_ALIGNED, image->data, size);
    }

    stream->offset += 1;

    return self;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(py_imageio_write_obj, py_imageio_write);

STATIC void int_py_imageio_pause(py_imageio_obj_t *stream, bool pause)
{
    uint32_t elapsed_ms;

    if (0) {
    #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
    } else if (stream->type == IMAGE_IO_FILE_STREAM) {
        read_long(&stream->fp, &elapsed_ms);
    #endif
    } else if (stream->type == IMAGE_IO_MEMORY_STREAM) {
        elapsed_ms = *((uint32_t *) (stream->buffer + (stream->offset * stream->size)));
    }

    while (pause && ((mp_hal_ticks_ms() - stream->ms) < elapsed_ms)) {
        __WFI();
    }

    stream->ms += elapsed_ms;
}

#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
STATIC void int_py_imageio_read_chunk(py_imageio_obj_t *stream, image_t *image, bool pause)
{
    FIL *fp = &stream->fp;

    if (f_eof(fp)) {
        mp_raise_msg(&mp_type_EOFError, MP_ERROR_TEXT("End of stream"));
    }

    int_py_imageio_pause(stream, pause);

    read_long(fp, (uint32_t *) &image->w);
    read_long(fp, (uint32_t *) &image->h);

    uint32_t bpp;
    read_long(fp, (uint32_t *) &bpp);

    if (stream->version < NEW_PIXFORMAT_VER) {
        if (bpp < 0) {
            mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Invalid image stream bpp"));
        } else if (bpp == OLD_BINARY_BPP) {
            image->pixfmt = PIXFORMAT_BINARY;
        } else if (bpp == OLD_GRAYSCALE_BPP) {
            image->pixfmt = PIXFORMAT_GRAYSCALE;
        } else if (bpp == OLD_RGB565_BPP) {
            image->pixfmt = PIXFORMAT_RGB565;
        } else if (bpp == OLD_BAYER_BPP) {
            image->pixfmt = PIXFORMAT_BAYER;
        } else if (bpp >= OLD_JPG_BPP) {
            image->pixfmt = PIXFORMAT_JPEG;
        }
    } else {
        if (!IMLIB_PIXFORMAT_IS_VALID(bpp)) {
            mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Invalid image stream pixformat"));
        }

        image->pixfmt = bpp;
        read_long(fp, (uint32_t *) &image->size);

        char ignore[AFTER_SIZE_PADDING];
        read_data(fp, ignore, AFTER_SIZE_PADDING);
    }
}
#endif

STATIC mp_obj_t py_imageio_read(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
{

    py_imageio_obj_t *stream = py_imageio_obj(args[0]);

    mp_obj_t copy_to_fb_obj = py_helper_keyword_object(n_args, args, 1, kw_args,
            MP_OBJ_NEW_QSTR(MP_QSTR_copy_to_fb), NULL);
    bool copy_to_fb = true;
    image_t *arg_other = NULL;

    if (copy_to_fb_obj) {
        if (mp_obj_is_integer(copy_to_fb_obj)) {
            copy_to_fb = mp_obj_get_int(copy_to_fb_obj);
        } else {
            arg_other = py_helper_arg_to_image_mutable(copy_to_fb_obj);
        }
    }

    image_t image = {};

    bool pause = py_helper_keyword_int(n_args, args, 3, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_pause), true);

    if (0) {
    #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
    } else if (stream->type == IMAGE_IO_FILE_STREAM) {
        FIL *fp = &stream->fp;

        if (f_eof(fp)) {
            if (!py_helper_keyword_int(n_args, args, 2, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_loop), true)) {
                return mp_const_none;
            }

            file_seek(fp, MAGIC_SIZE); // skip past the header

            stream->offset = 0;

            if (f_eof(fp)) { // empty file
                return mp_const_none;
            }
        }

        int_py_imageio_read_chunk(stream, &image, pause);
    #endif
    } else if (stream->type == IMAGE_IO_MEMORY_STREAM) {
        if (stream->offset == stream->count) {
            mp_raise_msg(&mp_type_EOFError, MP_ERROR_TEXT("End of stream"));
        }

        int_py_imageio_pause(stream, pause);

        memcpy(&image, stream->buffer + (stream->offset * stream->size) + sizeof(uint32_t), sizeof(image_t));
    }

    uint32_t size = image_size(&image);

    if (copy_to_fb) {
        py_helper_set_to_framebuffer(&image);
    } else if (arg_other) {
        PY_ASSERT_TRUE_MSG((size <= image_size(arg_other)),
            "The new image won't fit in the target frame buffer!");
        image.data = arg_other->data;
    } else {
        image.data = xalloc(size);
    }

    if (0) {
    #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
    } else if (stream->type == IMAGE_IO_FILE_STREAM) {
        FIL *fp = &stream->fp;
        read_data(fp, image.data, size);

        // Check if original byte reversed data.
        if ((image.pixfmt == PIXFORMAT_RGB565) && (stream->version == ORIGINAL_VER)) {
            uint32_t *data_ptr = (uint32_t *) image.data;
            size_t data_len = image.w * image.h;

            for (; data_len >= 2; data_len -= 2, data_ptr += 1) {
                *data_ptr = __REV16(*data_ptr); // long aligned
            }

            if (data_len) {
                *((uint16_t *) data_ptr) = __REV16(*((uint16_t *) data_ptr)); // word aligned
            }
        }

        if (size % ALIGN_SIZE) {
            char ignore[ALIGN_SIZE];
            read_data(fp, ignore, ALIGN_SIZE - (size % ALIGN_SIZE));
        }

        if (stream->offset >= stream->count) {
            stream->count = stream->offset + 1;
        }
    #endif
    } else if (stream->type == IMAGE_IO_MEMORY_STREAM) {
        memcpy(image.data, stream->buffer + (stream->offset * stream->size) + IMAGE_T_SIZE_ALIGNED, size);
    }

    stream->offset += 1;

    py_helper_update_framebuffer(&image);

    if (arg_other) {
        memcpy(arg_other, &image, sizeof(image_t));
    }

    if (copy_to_fb) {
        framebuffer_update_jpeg_buffer();
    }

    return py_image_from_struct(&image);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_imageio_read_obj, 1, py_imageio_read);

STATIC mp_obj_t py_imageio_seek(mp_obj_t self, mp_obj_t offs)
{
    py_imageio_obj_t *stream = py_imageio_obj(self);
    int offset = mp_obj_get_int(offs);

    if ((offset < 0) || ((stream->type == IMAGE_IO_MEMORY_STREAM) && (stream->count <= offset))) {
        mp_raise_msg(&mp_type_ValueError, MP_ERROR_TEXT("Invalid stream offset"));
    }

    #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
    if (stream->type == IMAGE_IO_FILE_STREAM) {
        FIL *fp = &stream->fp;
        file_seek(fp, MAGIC_SIZE); // skip past the file header

        for (int i = 0; i < offset; i++) {
            image_t image = {};
            int_py_imageio_read_chunk(stream, &image, false);
            uint32_t size = image_size(&image);

            if (size % ALIGN_SIZE) {
                size += ALIGN_SIZE - (size % ALIGN_SIZE);
            }

            file_seek(fp, f_tell(fp) + size);
        }

        if (stream->offset >= stream->count) {
            stream->count = offset + 1;
        }
    }
    #endif

    stream->offset = offset;

    return self;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(py_imageio_seek_obj, py_imageio_seek);

STATIC mp_obj_t py_imageio_sync(mp_obj_t self)
{
    #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
    py_imageio_obj_t *stream = py_imageio_obj(self);

    if (stream->type == IMAGE_IO_FILE_STREAM) {
        file_sync(&stream->fp);
    }
    #endif

    return self;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(py_imageio_sync_obj, py_imageio_sync);

STATIC mp_obj_t py_imageio_close(mp_obj_t self)
{
    py_imageio_obj_t *stream = py_imageio_obj(self);

    if (0) {
    #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
    } else if (stream->type == IMAGE_IO_FILE_STREAM) {
        file_close(&stream->fp);
    #endif
    } else if (stream->type == IMAGE_IO_MEMORY_STREAM) {
        fb_alloc_free_till_mark_past_mark_permanent();
    }

    stream->closed = true;

    return self;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(py_imageio_close_obj, py_imageio_close);

STATIC mp_obj_t py_imageio_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args)
{
    mp_arg_check_num(n_args, n_kw, 2, 2, false);
    py_imageio_obj_t *stream = m_new_obj_with_finaliser(py_imageio_obj_t);
    stream->base.type = &py_imageio_type;
    stream->closed = false;

    if (0) {
    #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
    } else if (mp_obj_is_str(args[0])) { // File Stream I/O
        FIL *fp = &stream->fp;
        stream->type = IMAGE_IO_FILE_STREAM;
        stream->count = 0;

        char mode = mp_obj_str_get_str(args[1])[0];

        if ((mode == 'W') || (mode == 'w')) {
            file_read_write_open_always(fp, mp_obj_str_get_str(args[0]));
            const char string[] = "OMV IMG STR V2.0";
            stream->version = NEW_PIXFORMAT_VER;

            // Overwrite if file is too small.
            if (f_size(fp) < MAGIC_SIZE) {
                write_data(fp, string, sizeof(string) - 1); // exclude null terminator
            } else {
                uint8_t version_hi, period, version_lo;
                char temp[sizeof(string) - 3] = {};
                read_data(fp, temp, sizeof(temp) - 1);
                read_byte(fp, &version_hi);
                read_byte(fp, &period);
                read_byte(fp, &version_lo);
                int version = ((version_hi - '0') * 10) + (version_lo - '0');

                // Overwrite if file magic does not match.
                if (strcmp(string, temp)
                || (period != ((uint8_t) '.'))
                || (version != ORIGINAL_VER)
                || (version != RGB565_FIXED_VER)
                || (version != NEW_PIXFORMAT_VER)) {
                    file_seek(fp, 0);
                    write_data(fp, string, sizeof(string) - 1); // exclude null terminator
                } else {
                    file_close(fp);
                    mode = 'R';
                }
            }
        }

        if ((mode == 'R') || (mode == 'r')) {
            uint8_t version_hi, version_lo;
            file_read_write_open_existing(fp, mp_obj_str_get_str(args[0]));
            read_long_expect(fp, *((uint32_t *) "OMV ")); // OpenMV
            read_long_expect(fp, *((uint32_t *) "IMG ")); // Image
            read_long_expect(fp, *((uint32_t *) "STR ")); // Stream
            read_byte_expect(fp, 'V');
            read_byte(fp, &version_hi);
            read_byte_expect(fp, '.');
            read_byte(fp, &version_lo);

            stream->version = ((version_hi - '0') * 10) + (version_lo - '0');

            if ((stream->version != ORIGINAL_VER)
            && (stream->version != RGB565_FIXED_VER)
            && (stream->version != NEW_PIXFORMAT_VER)) {
                mp_raise_msg(&mp_type_ValueError, MP_ERROR_TEXT("Expected version V1.0, V1.1, or V2.0"));
            }
        } else if ((mode != 'W') && (mode != 'w')) {
            mp_raise_msg(&mp_type_ValueError, MP_ERROR_TEXT("Invalid stream mode, expected 'R/r' or 'W/w'"));
        }
    #endif
    } else if (mp_obj_is_type(args[0], &mp_type_tuple)) { // Memory Stream I/O
        stream->type = IMAGE_IO_MEMORY_STREAM;

        mp_obj_t *image_info;
        mp_obj_get_array_fixed_n(args[0], 3, &image_info);
        int w = mp_obj_get_int(image_info[0]);
        int h = mp_obj_get_int(image_info[1]);
        int pixfmt = mp_obj_get_int(image_info[2]);

        if (!IMLIB_PIXFORMAT_IS_VALID(pixfmt)) {
            mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Invalid image stream pixformat"));
        }

        image_t image = {.w = w, .h = h, .pixfmt = pixfmt};

        // Estimate that the compressed image will fit in less than 2 bits per pixel.
        if (image.is_compressed) {
            image.h *= 2; // double calculated image size
            image.pixfmt = PIXFORMAT_BINARY;
        }

        stream->count = mp_obj_get_int(args[1]);
        stream->size = IMAGE_T_SIZE_ALIGNED + image_size_aligned(&image);

        fb_alloc_mark();
        stream->buffer = fb_alloc(stream->count * stream->size, FB_ALLOC_PREFER_SIZE | FB_ALLOC_CACHE_ALIGN);
        fb_alloc_mark_permanent();
    } else {
        mp_raise_msg(&mp_type_ValueError, MP_ERROR_TEXT("Invalid stream type"));
    }

    stream->offset = 0;
    stream->ms = mp_hal_ticks_ms();

    return MP_OBJ_FROM_PTR(stream);
}

STATIC const mp_rom_map_elem_t py_imageio_locals_dict_table[] = {
    { MP_ROM_QSTR(MP_QSTR___name__),        MP_ROM_QSTR(MP_QSTR_imageio)            },
    { MP_ROM_QSTR(MP_QSTR___del__),         MP_ROM_PTR(&py_imageio_close_obj)       },
    { MP_ROM_QSTR(MP_QSTR_FILE_STREAM),     MP_ROM_INT(IMAGE_IO_FILE_STREAM)        },
    { MP_ROM_QSTR(MP_QSTR_MEMORY_STREAM),   MP_ROM_INT(IMAGE_IO_MEMORY_STREAM)      },
    { MP_ROM_QSTR(MP_QSTR_type),            MP_ROM_PTR(&py_imageio_get_type_obj)    },
    { MP_ROM_QSTR(MP_QSTR_is_closed),       MP_ROM_PTR(&py_imageio_is_closed_obj)   },
    { MP_ROM_QSTR(MP_QSTR_count),           MP_ROM_PTR(&py_imageio_count_obj)       },
    { MP_ROM_QSTR(MP_QSTR_offset),          MP_ROM_PTR(&py_imageio_offset_obj)      },
    #if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
    { MP_ROM_QSTR(MP_QSTR_version),         MP_ROM_PTR(&py_imageio_version_obj)     },
    #else
    { MP_ROM_QSTR(MP_QSTR_version),         MP_ROM_PTR(&py_func_unavailable_obj)    },
    #endif
    { MP_ROM_QSTR(MP_QSTR_buffer_size),     MP_ROM_PTR(&py_imageio_buffer_size_obj) },
    { MP_ROM_QSTR(MP_QSTR_size),            MP_ROM_PTR(&py_imageio_size_obj)        },
    { MP_ROM_QSTR(MP_QSTR_write),           MP_ROM_PTR(&py_imageio_write_obj)       },
    { MP_ROM_QSTR(MP_QSTR_read),            MP_ROM_PTR(&py_imageio_read_obj)        },
    { MP_ROM_QSTR(MP_QSTR_seek),            MP_ROM_PTR(&py_imageio_seek_obj)        },
    { MP_ROM_QSTR(MP_QSTR_sync),            MP_ROM_PTR(&py_imageio_sync_obj)        },
    { MP_ROM_QSTR(MP_QSTR_close),           MP_ROM_PTR(&py_imageio_close_obj)       }
};

STATIC MP_DEFINE_CONST_DICT(py_imageio_locals_dict, py_imageio_locals_dict_table);

const mp_obj_type_t py_imageio_type = {
    { &mp_type_type },
    .name = MP_QSTR_ImageIO,
    .print = py_imageio_print,
    .make_new = py_imageio_make_new,
    .locals_dict = (mp_obj_dict_t *) &py_imageio_locals_dict,
};

#endif // IMLIB_ENABLE_IMAGE_IO


text:
package com.orientechnologies.orient.core.metadata.schema;

import com.orientechnologies.common.listener.OProgressListener;
import com.orientechnologies.orient.core.db.ODatabaseDocumentInternal;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.index.OIndex;
import com.orientechnologies.orient.core.index.OIndexManager;
import com.orientechnologies.orient.core.metadata.schema.clusterselection.OClusterSelectionStrategy;
import com.orientechnologies.orient.core.metadata.security.OSecurityShared;
import com.orientechnologies.orient.core.record.impl.ODocument;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author Andrey Lomakin (a.lomakin-at-orientechnologies.com)
 * @since 10/21/14
 */
public class OImmutableClass implements OClass {
  public static final String              EDGE_CLASS_NAME   = "E";
  public static final String              VERTEX_CLASS_NAME = "V";
  private boolean                         inited            = false;
  private final boolean                   isAbstract;
  private final boolean                   strictMode;

  private final String                    name;
  private final String                    streamAbleName;
  private final Map<String, OProperty>    properties;
  private Map<String, OProperty>          allPropertiesMap;
  private Collection<OProperty>           allProperties;
  private final Class<?>                  javaClass;
  private final OClusterSelectionStrategy clusterSelection;
  private final int                       defaultClusterId;
  private final int[]                     clusterIds;
  private final int[]                     polymorphicClusterIds;
  private final Collection<String>        baseClassesNames;
  private final List<String>              superClassesNames;
  private final float                     overSize;
  private final float                     classOverSize;
  private final String                    shortName;
  private final Map<String, String>       customFields;

  private final OImmutableSchema          schema;
  // do not do it volatile it is already SAFE TO USE IT in MT mode.
  private final List<OImmutableClass>     superClasses;
  // do not do it volatile it is already SAFE TO USE IT in MT mode.
  private Collection<OImmutableClass>     subclasses;
  private boolean                         restricted;
  private boolean                         isVertexType;
  private boolean                         isEdgeType;

  public OImmutableClass(OClass oClass, OImmutableSchema schema) {
    isAbstract = oClass.isAbstract();
    strictMode = oClass.isStrictMode();
    this.schema = schema;

    superClassesNames = oClass.getSuperClassesNames();
    superClasses = new ArrayList<OImmutableClass>();

    name = oClass.getName();
    streamAbleName = oClass.getStreamableName();
    clusterSelection = oClass.getClusterSelection();
    defaultClusterId = oClass.getDefaultClusterId();
    clusterIds = oClass.getClusterIds();
    polymorphicClusterIds = oClass.getPolymorphicClusterIds();

    baseClassesNames = new ArrayList<String>();
    for (OClass baseClass : oClass.getSubclasses())
      baseClassesNames.add(baseClass.getName());

    overSize = oClass.getOverSize();
    classOverSize = oClass.getClassOverSize();
    shortName = oClass.getShortName();
    javaClass = oClass.getJavaClass();

    properties = new HashMap<String, OProperty>();
    for (OProperty p : oClass.declaredProperties())
      properties.put(p.getName().toLowerCase(), new OImmutableProperty(p, this));

    Map<String, String> customFields = new HashMap<String, String>();
    for (String key : oClass.getCustomKeys())
      customFields.put(key, oClass.getCustom(key));

    this.customFields = Collections.unmodifiableMap(customFields);
  }

  public void init() {
    if (!inited) {
      initSuperClasses();

      final Collection<OProperty> allProperties = new ArrayList<OProperty>();
      final Map<String, OProperty> allPropsMap = new HashMap<String, OProperty>(20);
      for (int i = superClasses.size() - 1; i >= 0; i--) {
        allProperties.addAll(superClasses.get(i).allProperties);
        allPropsMap.putAll(superClasses.get(i).allPropertiesMap);
      }
      allProperties.addAll(properties.values());
      for (OProperty p : properties.values()) {
        final String propName = p.getName();

        if (!allPropsMap.containsKey(propName))
          allPropsMap.put(propName, p);
      }

      this.allProperties = Collections.unmodifiableCollection(allProperties);
      this.allPropertiesMap = Collections.unmodifiableMap(allPropsMap);
      this.restricted = isSubClassOf(OSecurityShared.RESTRICTED_CLASSNAME);
      this.isVertexType = isSubClassOf(VERTEX_CLASS_NAME);
      this.isEdgeType = isSubClassOf(EDGE_CLASS_NAME);
      inited = true;
    }
  }

  @Override
  public <T> T newInstance() throws InstantiationException, IllegalAccessException {
    throw new UnsupportedOperationException();
  }

  @Override
  public boolean isAbstract() {
    return isAbstract;
  }

  @Override
  public OClass setAbstract(boolean iAbstract) {
    throw new UnsupportedOperationException();
  }

  @Override
  public boolean isStrictMode() {
    return strictMode;
  }

  @Override
  public OClass setStrictMode(boolean iMode) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OClass getSuperClass() {
    initSuperClasses();

    return superClasses.isEmpty() ? null : superClasses.get(0);
  }

  @Override
  public OClass setSuperClass(OClass iSuperClass) {
    throw new UnsupportedOperationException();
  }

  @Override
  public List<OClass> getSuperClasses() {
    return Collections.unmodifiableList((List<? extends OClass>) superClasses);
  }

  @Override
  public boolean hasSuperClasses() {
    return !superClasses.isEmpty();
  }

  @Override
  public List<String> getSuperClassesNames() {
    return superClassesNames;
  }

  @Override
  public OClass setSuperClasses(List<? extends OClass> classes) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OClass addSuperClass(OClass superClass) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OClass removeSuperClass(OClass superClass) {
    throw new UnsupportedOperationException();
  }

  @Override
  public String getName() {
    return name;
  }

  @Override
  public OClass setName(String iName) {
    throw new UnsupportedOperationException();
  }

  @Override
  public String getStreamableName() {
    return streamAbleName;
  }

  @Override
  public Collection<OProperty> declaredProperties() {
    return Collections.unmodifiableCollection(properties.values());
  }

  @Override
  public Collection<OProperty> properties() {
    return allProperties;
  }

  @Override
  public Map<String, OProperty> propertiesMap() {
    return allPropertiesMap;
  }

  public void getIndexedProperties(Collection<OProperty> indexedProperties) {
    for (OProperty p : properties.values())
      if (areIndexed(p.getName()))
        indexedProperties.add(p);
    initSuperClasses();
    for (OImmutableClass superClass : superClasses) {
      superClass.getIndexedProperties(indexedProperties);
    }
  }

  @Override
  public Collection<OProperty> getIndexedProperties() {
    Collection<OProperty> indexedProps = new HashSet<OProperty>();
    getIndexedProperties(indexedProps);
    return indexedProps;
  }

  @Override
  public OProperty getProperty(String propertyName) {
    initSuperClasses();

    propertyName = propertyName.toLowerCase();

    OProperty p = properties.get(propertyName);
    if (p != null)
      return p;
    for (int i = 0; i < superClasses.size() && p == null; i++) {
      p = superClasses.get(i).getProperty(propertyName);
    }
    return p;
  }

  @Override
  public OProperty createProperty(String iPropertyName, OType iType) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OProperty createProperty(String iPropertyName, OType iType, OClass iLinkedClass) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OProperty createProperty(String iPropertyName, OType iType, OType iLinkedType) {
    throw new UnsupportedOperationException();
  }

  @Override
  public void dropProperty(String iPropertyName) {
    throw new UnsupportedOperationException();
  }

  @Override
  public boolean existsProperty(String propertyName) {
    propertyName = propertyName.toLowerCase();
    boolean result = properties.containsKey(propertyName);
    if (result)
      return true;
    for (OImmutableClass superClass : superClasses) {
      result = superClass.existsProperty(propertyName);
      if (result)
        return true;
    }
    return false;
  }

  @Override
  public Class<?> getJavaClass() {
    return javaClass;
  }

  @Override
  public int getClusterForNewInstance(final ODocument doc) {
    return clusterSelection.getCluster(this, doc);
  }

  @Override
  public int getDefaultClusterId() {
    return defaultClusterId;
  }

  @Override
  public void setDefaultClusterId(int iDefaultClusterId) {
    throw new UnsupportedOperationException();
  }

  @Override
  public int[] getClusterIds() {
    return clusterIds;
  }

  @Override
  public OClass addClusterId(int iId) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OClusterSelectionStrategy getClusterSelection() {
    return clusterSelection;
  }

  @Override
  public OClass setClusterSelection(OClusterSelectionStrategy clusterSelection) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OClass setClusterSelection(String iStrategyName) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OClass addCluster(String iClusterName) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OClass removeClusterId(int iId) {
    throw new UnsupportedOperationException();
  }

  @Override
  public int[] getPolymorphicClusterIds() {
    return polymorphicClusterIds;
  }

  public OImmutableSchema getSchema() {
    return schema;
  }

  @Override
  public Collection<OClass> getSubclasses() {
    initBaseClasses();

    ArrayList<OClass> result = new ArrayList<OClass>();
    for (OClass c : subclasses)
      result.add(c);

    return result;
  }

  @Override
  public Collection<OClass> getAllSubclasses() {
    initBaseClasses();

    final Set<OClass> set = new HashSet<OClass>();
    set.addAll(getSubclasses());

    for (OImmutableClass c : subclasses)
      set.addAll(c.getAllSubclasses());

    return set;
  }

  @Override
  public Collection<OClass> getBaseClasses() {
    return getSubclasses();
  }

  @Override
  public Collection<OClass> getAllBaseClasses() {
    return getAllSubclasses();
  }

  @Override
  public Collection<OClass> getAllSuperClasses() {
    Set<OClass> ret = new HashSet<OClass>();
    getAllSuperClasses(ret);
    return ret;
  }

  private void getAllSuperClasses(Set<OClass> set) {
    set.addAll(superClasses);
    for (OImmutableClass superClass : superClasses) {
      superClass.getAllSuperClasses(set);
    }
  }

  @Override
  public long getSize() {
    long size = 0;
    for (int clusterId : clusterIds)
      size += getDatabase().getClusterRecordSizeById(clusterId);

    return size;
  }

  @Override
  public float getOverSize() {
    return overSize;
  }

  @Override
  public float getClassOverSize() {
    return classOverSize;
  }

  @Override
  public OClass setOverSize(float overSize) {
    throw new UnsupportedOperationException();
  }

  @Override
  public long count() {
    return count(true);
  }

  @Override
  public long count(boolean isPolymorphic) {
    if (isPolymorphic)
      return getDatabase().countClusterElements(OClassImpl.readableClusters(getDatabase(), polymorphicClusterIds));

    return getDatabase().countClusterElements(OClassImpl.readableClusters(getDatabase(), clusterIds));
  }

  @Override
  public void truncate() throws IOException {
    throw new UnsupportedOperationException();
  }

  @Override
  public boolean isSubClassOf(final String iClassName) {
    if (iClassName == null)
      return false;

    if (iClassName.equalsIgnoreCase(getName()) || iClassName.equalsIgnoreCase(getShortName()))
      return true;

    final int s = superClasses.size();
    for (int i = 0; i < s; ++i) {
      if (superClasses.get(i).isSubClassOf(iClassName))
        return true;
    }

    return false;
  }

  @Override
  public boolean isSubClassOf(final OClass clazz) {
    if (clazz == null)
      return false;
    if (equals(clazz))
      return true;

    final int s = superClasses.size();
    for (int i = 0; i < s; ++i) {
      if (superClasses.get(i).isSubClassOf(clazz))
        return true;
    }
    return false;
  }

  @Override
  public boolean isSuperClassOf(OClass clazz) {
    return clazz != null && clazz.isSubClassOf(this);
  }

  @Override
  public String getShortName() {
    return shortName;
  }

  @Override
  public OClass setShortName(String shortName) {
    throw new UnsupportedOperationException();
  }

  @Override
  public Object get(ATTRIBUTES iAttribute) {
    if (iAttribute == null)
      throw new IllegalArgumentException("attribute is null");

    switch (iAttribute) {
    case NAME:
      return getName();
    case SHORTNAME:
      return getShortName();
    case SUPERCLASS:
      return getSuperClass();
    case SUPERCLASSES:
      return getSuperClasses();
    case OVERSIZE:
      return getOverSize();
    case STRICTMODE:
      return isStrictMode();
    case ABSTRACT:
      return isAbstract();
    case CLUSTERSELECTION:
      return getClusterSelection();
    case CUSTOM:
      return getCustomInternal();
    }

    throw new IllegalArgumentException("Cannot find attribute '" + iAttribute + "'");
  }

  @Override
  public OClass set(ATTRIBUTES attribute, Object iValue) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OIndex<?> createIndex(String iName, INDEX_TYPE iType, String... fields) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OIndex<?> createIndex(String iName, String iType, String... fields) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OIndex<?> createIndex(String iName, INDEX_TYPE iType, OProgressListener iProgressListener, String... fields) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OIndex<?> createIndex(String iName, String iType, OProgressListener iProgressListener, ODocument metadata,
      String algorithm, String... fields) {
    throw new UnsupportedOperationException();
  }

  @Override
  public OIndex<?> createIndex(String iName, String iType, OProgressListener iProgressListener, ODocument metadata,
      String... fields) {
    throw new UnsupportedOperationException();
  }

  @Override
  public Set<OIndex<?>> getInvolvedIndexes(Collection<String> fields) {
    initSuperClasses();

    final Set<OIndex<?>> result = new HashSet<OIndex<?>>(getClassInvolvedIndexes(fields));

    for (OImmutableClass superClass : superClasses) {
      result.addAll(superClass.getInvolvedIndexes(fields));
    }
    return result;
  }

  @Override
  public Set<OIndex<?>> getInvolvedIndexes(String... fields) {
    return getInvolvedIndexes(Arrays.asList(fields));
  }

  @Override
  public Set<OIndex<?>> getClassInvolvedIndexes(Collection<String> fields) {
    final OIndexManager indexManager = getDatabase().getMetadata().getIndexManager();
    return indexManager.getClassInvolvedIndexes(name, fields);
  }

  @Override
  public Set<OIndex<?>> getClassInvolvedIndexes(String... fields) {
    return getClassInvolvedIndexes(Arrays.asList(fields));
  }

  @Override
  public boolean areIndexed(Collection<String> fields) {
    final OIndexManager indexManager = getDatabase().getMetadata().getIndexManager();
    final boolean currentClassResult = indexManager.areIndexed(name, fields);

    initSuperClasses();

    if (currentClassResult)
      return true;
    for (OImmutableClass superClass : superClasses) {
      if (superClass.areIndexed(fields))
        return true;
    }
    return false;

  }

  @Override
  public boolean areIndexed(String... fields) {
    return areIndexed(Arrays.asList(fields));
  }

  @Override
  public OIndex<?> getClassIndex(String iName) {
    return getDatabase().getMetadata().getIndexManager().getClassIndex(this.name, name);
  }

  @Override
  public Set<OIndex<?>> getClassIndexes() {
    return getDatabase().getMetadata().getIndexManager().getClassIndexes(name);
  }

  @Override
  public void getClassIndexes(Collection<OIndex<?>> indexes) {
    getDatabase().getMetadata().getIndexManager().getClassIndexes(name, indexes);
  }

  @Override
  public void getIndexes(Collection<OIndex<?>> indexes) {
    initSuperClasses();

    getClassIndexes(indexes);
    for (OClass superClass : superClasses) {
      superClass.getIndexes(indexes);
    }
  }

  @Override
  public Set<OIndex<?>> getIndexes() {
    Set<OIndex<?>> indexes = new HashSet<OIndex<?>>();
    getIndexes(indexes);
    return indexes;
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = super.hashCode();
    result = prime * result;
    return result;
  }

  @Override
  public boolean equals(final Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (!OClass.class.isAssignableFrom(obj.getClass()))
      return false;
    final OClass other = (OClass) obj;
    if (name == null) {
      if (other.getName() != null)
        return false;
    } else if (!name.equals(other.getName()))
      return false;
    return true;
  }

  @Override
  public String toString() {
    return name;
  }

  @Override
  public String getCustom(String iName) {
    return customFields.get(iName);
  }

  @Override
  public OClass setCustom(String iName, String iValue) {
    throw new UnsupportedOperationException();
  }

  @Override
  public void removeCustom(String iName) {
    throw new UnsupportedOperationException();
  }

  @Override
  public void clearCustom() {
    throw new UnsupportedOperationException();
  }

  @Override
  public Set<String> getCustomKeys() {
    return Collections.unmodifiableSet(customFields.keySet());
  }

  @Override
  public boolean hasClusterId(int clusterId) {
    return Arrays.binarySearch(clusterIds, clusterId) >= 0;
  }

  @Override
  public int compareTo(OClass other) {
    return name.compareTo(other.getName());
  }

  private ODatabaseDocumentInternal getDatabase() {
    return ODatabaseRecordThreadLocal.INSTANCE.get();
  }

  private Map<String, String> getCustomInternal() {
    return customFields;
  }

  private void initSuperClasses() {
    if (superClassesNames != null && superClassesNames.size() != superClasses.size()) {
      superClasses.clear();
      for (String superClassName : superClassesNames) {
        OImmutableClass superClass = (OImmutableClass) schema.getClass(superClassName);
        superClass.init();
        superClasses.add(superClass);
      }
    }
  }

  private void initBaseClasses() {
    if (subclasses == null) {
      final List<OImmutableClass> result = new ArrayList<OImmutableClass>(baseClassesNames.size());
      for (String clsName : baseClassesNames)
        result.add((OImmutableClass) schema.getClass(clsName));

      subclasses = result;
    }
  }

  public boolean isRestricted() {
    return restricted;
  }

  public boolean isEdgeType() {
    return isEdgeType;
  }

  public boolean isVertexType() {
    return isVertexType;
  }

}


text:
require 'spec_helper'
require 'fileutils'

describe SimpsonsWorld do
  describe "test suite" do
    it 'should not touch the real data dir' do
      expect( SimpsonsWorld::DATA_DIR ).to include("/spec/")
    end
  end
end

describe SimpsonsWorld do
  include Helpers
  include SimpsonsWorld::ViewHelpers

  EPISODE_COUNT = 5

  let(:season_one_data)   { season_data }
  let(:season_two_data)   { season_data(season: 2) }
  let(:season_three_data) { season_data(season: 3) }

  def create_season data=nil
    @season = SimpsonsWorld::Season.new(*(data || season_one_data))
  end

  def purge_test_data
    FileUtils.rm_rf(Dir.glob(File.join(File.dirname(__FILE__), "/data/*.yml")))
  end

  #it 'successfully parses the current markup' do
  #  expect{ SimpsonsWorld::Scrape.all }.to_not raise_error
  #end

  it 'should have a legit fixture' do
    expect { create_season }.to_not raise_error
  end

  before(:each) do
    purge_test_data
    create_season
  end

  it 'should set the season number' do
    expect( @season.number ).to eql(1)
  end

  it 'should set the episodes' do
    expect( @season.episodes ).not_to be_nil
  end

  it "should set #{EPISODE_COUNT} episodes" do
    expect( @season.episodes.count ).to eql(EPISODE_COUNT)
  end

  it "should save the data to file" do
    expect File.exists?(SimpsonsWorld::Season::to_file_path(@season.number))
  end

  it "should save multiple seasons to multiple files" do
    create_season(season_two_data)
    expect( Dir[File.join(SimpsonsWorld::DATA_DIR, "season-*.yml")].count ).to eql 2
  end

  it "should load the data on demand when looking for one season" do
    expect( SimpsonsWorld::Season.find(1) ).to_not be(nil)
  end

  it "should load the data on demand when requesting all seasons" do
    expect( SimpsonsWorld::Season.all ).to_not be(nil)
  end

  it "shouldn't reload the data once it's been loaded" do
    expect( SimpsonsWorld::Season.all.object_id ).to eql( SimpsonsWorld::Season.all.object_id )
  end

  it "should reload the data if a new season has been added" do
    obj_id = SimpsonsWorld::Season.all.object_id
    create_season(season_two_data)
    expect( SimpsonsWorld::Season.all.object_id ).not_to eql( obj_id )
  end

  it "should not find a non-existent season" do
    expect { SimpsonsWorld::Season.find(50) }.to raise_exception SimpsonsWorld::NoEpisodeError
  end

  it 'should return the correct episode' do
    expect( @season.episodes[1] ).to eql(season_one_data[1][1])
  end

  it 'should set the correct path' do
    expect( @season.episodes[1][:url] ).to eql("/path/s1-e1")
  end

  it 'should have an episode title' do
    expect( @season.episodes[1][:title]).not_to be_nil
  end

  it 'should have a URL' do
    expect( @season.episodes[1][:url]).not_to be_nil
  end

  it 'should strip "Presented by FXX." in descriptions' do
    description = 'Description 1.'
    expect( SimpsonsWorld::Scrape::clean_description("#{description} Presented by FXX.") ).to eql( description )
  end

  it 'should strip "SEASON PREMIERE." in descriptions' do
    description = 'Description 1.'
    expect( SimpsonsWorld::Scrape::clean_description("#{description} SEASON PREMIERE.") ).to eql( description )
  end

  describe "url finders" do
    before(:all) do
      @view = Object.new
      @view.extend(SimpsonsWorld::ViewHelpers)
    end

    it 'should return the correct url for episode number' do
      expect( @view.simpsons_world_episode_url(episode: 1) ).to \
        eql("http://www.simpsonsworld.com/path/s1-e1")
    end

    it 'should return the correct url for season and episode number' do
      expect( @view.simpsons_world_episode_url(season: 1, episode: 1) ).to match(/s1-e1/)
    end

    it 'should return the correct url for a season 2 episode' do
      create_season(season_two_data)
      expect( @view.simpsons_world_episode_url(episode: 6) ).to match(/s2-e1/)
    end

    it 'should return the correct url for a season 1 finale' do
      create_season(season_two_data)
      expect( @view.simpsons_world_episode_url(episode: 5) ).to match(/s1-e5/)
    end

    it 'should return the correct url for a season 3 episode' do
      create_season(season_two_data) and create_season(season_three_data)
      expect( @view.simpsons_world_episode_url(episode: 14) ).to match(/s3-e4/)
    end

    it "should return an empty string if the season doesn't exist" do
      expect( @view.simpsons_world_episode_url(season: 5, episode: 1) ).to eql('')
    end

    it "should return an empty string if the episode doesn't exist" do
      expect( @view.simpsons_world_episode_url(episode: 9999) ).to eql('')
    end
  end

end


text:
using OpenQA.Selenium;
using System.Drawing.Imaging;
using System.IO;

namespace DeftPack.TestAutomation.Functional
{
    /// <summary>
    /// Saves screenshot to the given location made on the active screen by a Selenium Web Driver
    /// </summary>
    internal class TestScreenshotSaver : ITestScreenshotSaver
    {
        public static string ScreenshotFolderName = "Screenshots";
        private readonly IWebDriver _webDriver;
        private readonly string _screenShotLocation;

        public TestScreenshotSaver(IWebDriver webDriver, string rootLocation)
        {
            _webDriver = webDriver;
            _screenShotLocation = Path.Combine(rootLocation, ScreenshotFolderName);

            if (!Directory.Exists(_screenShotLocation))
            {
                Directory.CreateDirectory(_screenShotLocation);
            }
        }

        /// <summary>
        /// Immediately creates and saves the screenshot
        /// </summary>
        /// <param name="testName">The name of test. This going to be the first part of the file name.</param>
        /// <param name="screenshotDescription">Short description of the screenshot which going to be the second part of the file name (i.e.: failed)</param>
        private void TakeScreenShot(string testName, string screenshotDescription)
        {
            var screenshotDriver = _webDriver as ITakesScreenshot;
            if (screenshotDriver == null) return;

            var screenshot = screenshotDriver.GetScreenshot();
            var saveLocation = Path.Combine(
                _screenShotLocation,
                string.Format("{0}_{1}.png", testName, screenshotDescription));
            screenshot.SaveAsFile(saveLocation, ImageFormat.Png);
        }

        /// <summary>
        ///  Event handler for test reporter. When a test reporter finished, it creates and saves a screenshot.
        /// </summary>
        /// <param name="t">Test reporter</param>
        /// <param name="args">Finished test report arguments</param>
        public void HandleFinishedTestReport(ITestReporter t, TestReporterFinishedEventArgs args)
        {
            TakeScreenShot(args.TestName, args.TestStatus ? "passed" : "failed");
        }
    }
}


text:
workers ENV.fetch("WEB_CONCURRENCY") { 1 }
threads_count = ENV.fetch("RAILS_THREADS") { 5 }
threads threads_count, threads_count

environment ENV.fetch("RAILS_ENV") { "development" }

if ENV['RAILS_ENV'] == 'production'
  bind 'unix://tmp/sockets/puma.sock'
  pidfile 'tmp/pids/puma.pid'
  state_path 'tmp/pids/puma.state'
  daemonize true
else
  port ENV.fetch("PORT") { 3000 }
end

before_fork do
  ActiveRecord::Base.connection.disconnect!
end

on_worker_boot do
  ActiveSupport.on_load(:active_record) do
    ActiveRecord::Base.establish_connection
  end
end

preload_app!

plugin :tmp_restart


text:
using System;
using System.Globalization;
using Xamarin.Forms;

namespace MyQuizMobile.Converters {
    internal class AnswerResultConverter : IValueConverter {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return (string)value == Constants.CorrectAnswerOptionText; }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return (bool)value ? Constants.CorrectAnswerOptionText : Constants.WrongAnswerOptionText; }
    }

    internal class AnswerResultTextConverter : IValueConverter {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return (string)value == Constants.CorrectAnswerOptionText ? "Richtig" : "Falsch"; }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return null; }
    }

    internal class QuestionTypeAnswerConverter : IValueConverter {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return (string)value == Constants.QuestionCategoryQuizText; }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return null; }
    }
}


text:
<?php
$lang['L_HELP_DB']="Dies ist die Liste der vorhandenen Datenbanken.";
$lang['L_HELP_PRAEFIX']="Der Präfix ist eine Zeichenfolge für den Anfang von Tabellen, der als Filter fungiert.";
$lang['L_HELP_ZIP']="Kompression mit GZip - emfohlen ist 'aktiviert'.";
$lang['L_HELP_MEMORYLIMIT']="Das ist die maximale Größe in Bytes, die das Skript an Speicher bekommt.
0 = deaktiviert";
$lang['L_MEMORY_LIMIT']="Speichergrenze";
$lang['L_HELP_AD1']="Wenn aktiviert, dann werden automatisch Backup-Dateien gelöscht.";
$lang['L_HELP_AD3']="Die maximale Anzahl von Dateien, die im Backup-Verzeichnis sein dürfen (für Autodelete).
0 = deaktiviert";
$lang['L_HELP_LANG']="Stellt auf die gewünschte Sprache.";
$lang['L_HELP_EMPTY_DB_BEFORE_RESTORE']="Um überflüssige Daten zu eliminieren, kann man anweisen, die Datenbank vor der Wiederherstellung komplett zu leeren.";
$lang['L_HELP_CRONEXTENDER']="Die Endung des Perlscriptes, Standard ist '.pl'.";
$lang['L_HELP_CRONSAVEPATH']="Der Name der Konfigurationsdatei für das Perlskript.";
$lang['L_HELP_CRONPRINTOUT']="Wenn die Textausgabe abgeschaltet ist, wird kein Text mehr ausgegeben.
Diese Funktion ist unabhängig von der Log-Ausgabe.";
$lang['L_HELP_CRONSAMEDB']="Soll die gleiche Datenbank für Cronjob wie in den Einstellungen benutzt werden?";
$lang['L_HELP_CRONDBINDEX']="Wähle die Datenbank für den Cronjob.";
$lang['L_HELP_FTPTRANSFER']="Wenn aktiviert, wird nach dem Backup die Datei per FTP gesendet.";
$lang['L_HELP_FTPSERVER']="Adresse des FTP-Servers.";
$lang['L_HELP_FTPPORT']="Port des FTP-Servers. Standard: 21.";
$lang['L_HELP_FTPUSER']="Gibt den Benutzernamen der FTP-Verbindung an.";
$lang['L_HELP_FTPPASS']="Gibt das Passwort der FTP-Verbindung an.";
$lang['L_HELP_FTPDIR']="Wohin soll die Datei gesendet werden?";
$lang['L_HELP_SPEED']="Minimale und maximale Geschwindigkeit. Standard ist 50 bis 5000.
(Zu hohe Geschwindigkeiten können zu Timeouts führen!)";
$lang['L_SPEED']="Geschwindigkeitskontrolle";
$lang['L_HELP_CRONEXECPATH']="Der Ort, an dem die Perlskripte liegen.
Ausgangspunkt ist die HTTP-Adresse (also im Browser).
Erlaubt sind absolute und relative Pfadangaben.";
$lang['L_CRON_EXECPATH']="Pfad der Perlskripte";
$lang['L_HELP_CRONCOMPLETELOG']="Wenn die Funktion aktiviert ist, wird die komplette Ausgabe im complete_log geschrieben.
Diese Funktion ist unabhängig von der Textausgabe.";
$lang['L_HELP_FTP_MODE']="Wenn Probleme bei der FTP-Übertragung auftauchen, versuchen Sie den passiven FTP-Modus.

";

?>


text:
<!DOCTYPE html>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<title>Exodus 1 (WEB)</title>
<link href="../../../build/mobile.css" rel="stylesheet" />

World English BibleExodus 1<
=
>

The Second Book of Moses,

Commonly Called

Exodus

1

1 Now these are the names of the sons of Israel, who came into Egypt (every man and his household came with Jacob):
2 Reuben, Simeon, Levi, and Judah,
3 Issachar, Zebulun, and Benjamin,
4 Dan and Naphtali, Gad and Asher.
5 All the souls who came out of Jacob's body were seventy souls, and Joseph was in Egypt already.
6 Joseph died, as did all his brothers, and all that generation.
7 The children of Israel were fruitful, and increased abundantly, and multiplied, and grew exceedingly mighty; and the land was filled with them.

8 Now there arose a new king over Egypt, who didn't know Joseph.
9 He said to his people, "Behold,+ the people of the children of Israel are more and mightier than we.
10 Come, let us deal wisely with them, lest they multiply, and it happen that when any war breaks out, they also join themselves to our enemies, and fight against us, and escape out of the land."
11 Therefore they set taskmasters over them to afflict them with their burdens. They built storage cities for Pharaoh: Pithom and Raamses.
12 But the more they afflicted them, the more they multiplied and the more they spread out. They were grieved because of the children of Israel.
13 The Egyptians ruthlessly made the children of Israel serve,
14 and they made their lives bitter with hard service, in mortar and in brick, and in all kinds of service in the field, all their service, in which they ruthlessly made them serve.

15 The king of Egypt spoke to the Hebrew midwives, of whom the name of the one was Shiphrah, and the name of the other Puah,
16 and he said, "When you perform the duty of a midwife to the Hebrew women, and see them on the birth stool; if it is a son, then you shall kill him; but if it is a daughter, then she shall live."
17 But the midwives feared God,+ and didn't do what the king of Egypt commanded them, but saved the baby boys alive.
18 The king of Egypt called for the midwives, and said to them, "Why have you done this thing, and have saved the boys alive?"

19 The midwives said to Pharaoh, "Because the Hebrew women aren't like the Egyptian women; for they are vigorous, and give birth before the midwife comes to them."

20 God dealt well with the midwives, and the people multiplied, and grew very mighty.
21 Because the midwives feared God, he gave them families.
22 Pharaoh commanded all his people, saying, "You shall cast every son who is born into the river, and every daughter you shall save alive."

+1:9"Behold", from "הִנֵּה", means look at, take notice, observe, see, or gaze at. It is often used as an interjection.+1:17The Hebrew word rendered "God" is "אֱלֹהִ֑ים" (Elohim).

<
=
>


text:
import uglify from 'rollup-plugin-uglify';
import eslint from 'rollup-plugin-eslint';

export default {
  input: 'lib/main.js',
  plugins: [
      eslint({
          envs: ['browser'],
          throwOnError: true,
          configFile: './eslint.json'
      }),
      uglify()
  ],
  output: {
    file: 'dist/zombrex.js',
    format: 'iife',
    name: 'zombrex',
    preferConst: true
  }
};


text:
#ifndef _MACHINE_TIMER_H
#define _MACHINE_TIMER_H

#if defined (__ppc__)
#include "ppc/timer.h"
#elif defined (__i386__) || defined (__x86_64__)
#include "i386/timer.h"
#else
#error architecture not supported
#endif

#endif /* _MACHINE_TIMER_H */


text:
//-----------------------------------------------
//
//	This file is part of the Siv3D Engine.
//
//	Copyright (C) 2008-2016 Ryo Suzuki
//
//	Licensed under the MIT License.
//
//-----------------------------------------------

# pragma once
# include "Fwd.hpp"
# include "IWidget.hpp"
# include "WidgetStyle.hpp"

namespace s3d
{
	class GUIHorizontalLine : public IWidget
	{
	private:

		int m_thickness = 1;

		Point ItemSize(int areaWidth) const;

		Rect MarginBox(int areaWidth, const Point& offset) const;

		Rect PaddingBox(int areaWidth, const Point& offset) const;

		Rect ItemBox(int areaWidth, const Point& offset) const;

	public:

		static const String& Name()
		{
			static const String name = L"HorizontalLine";
			return name;
		}

		static std::shared_ptr<GUIHorizontalLine> Create(int thickness = 1, const WidgetStyle& style = WidgetStyle())
		{
			return std::make_shared<GUIHorizontalLine>(thickness, style);
		}

		GUIHorizontalLine() {}

		GUIHorizontalLine(int thickness, const WidgetStyle& style);

		const String& getWidgetName() const override;

		Size getSize() const override;

		bool forceNewLineBefore() const override;

		bool forceNewLineAfter() const override;

		void update(const WidgetState& state) override;

		void draw(const WidgetState& state) const override;

		int& getThickness();
	};

	class GUIHorizontalLineWrapper
	{
	public:

		using WidgetType = GUIHorizontalLine;

	private:

		friend class GUI;

		std::shared_ptr<WidgetType> m_widget;

		GUIHorizontalLineWrapper(const std::shared_ptr<WidgetType>& widget)
			: m_widget(widget ? widget : std::make_shared<WidgetType>())
			, thickness(m_widget->getThickness())
			, style(m_widget->m_style) {}

		GUIHorizontalLineWrapper& operator = (const GUIHorizontalLineWrapper&) = delete;

		static const String& WidgetTypeName()
		{
			return WidgetType::Name();
		}

	public:

		int& thickness;

		WidgetStyle& style;
	};
}


text:
<tool id="iedb_api" name="IEDB" version="2.15.2">
    <description>MHC Binding prediction</description>
    <macros>
        <xml name="alleles" token_hla_regex="" token_hla_examples="" token_hlalen_examples="">
            <conditional name="alleles">
               <param name="allelesrc" type="select" label="Alleles">
                   <option value="history">From history</option>
                   <option value="entry">Entered</option>
               </param>
               <when value="history">
                   <param name="allele_file" type="data" format="txt" label="Alleles file">
                       <help>The dataset should have on allele per line. The allele may be followed by an optional comma-separated list of peptide lengths, e.g.: @HLALEN_EXAMPLES@</help>
                   </param>
               </when>
               <when value="entry">
                   <param name="allele_text" type="text" label="Alleles">
                       <help>Enter alleles separated by white space: @HLA_EXAMPLES@  (The peptide lengths may follow each allele: @HLALEN_EXAMPLES@)</help>
                       <validator type="regex" message="Doesn't appear to be a valid allele">^@HLA_REGEX@(\s+@HLA_REGEX@)*$</validator>
                   </param>
               </when>
            </conditional>
        </xml>
    </macros>
    <requirements>
        <requirement type="package" version="3.7">python</requirement>
    </requirements>

    <command detect_errors="exit_code"><![CDATA[
        #import re
        python '${__tool_directory__}/iedb_api.py'
        --prediction=$prediction.tool
        --method=$prediction.method
        #if $prediction.tool == 'bcell':
            #if $prediction.window_size:
                -w $prediction.window_size
            #end if
        #else
            #if $prediction.tool == 'processing' and $prediction.proteasome:
                --proteasome $prediction.proteasome
            #end if
            #if $prediction.alleles.allelesrc == 'history':
              -A '$prediction.alleles.allele_file'
            #else:
              -A '$entered_alleles'
            #end if
            -l '$prediction.lengths'
        #end if

        #if $sequence.seqsrc == 'fasta':
          -i '$sequence.seq_fasta'
        #else if $sequence.seqsrc == 'tabular':
          -i '$sequence.seq_tsv'
          -c #echo int(str($sequence.pep_col)) - 1
          #if $sequence.id_col:
            -C #echo  int(str($sequence.id_col)) - 1
          #end if
        #else:
          -i '$entered_seqs' -c 1 -C 0
        #end if
        -o '$output'
    ]]></command>
    <configfiles>
        <configfile name="entered_alleles"><![CDATA[#slurp
#if $prediction.tool != 'bcell' and $prediction.alleles.allelesrc == 'entry'
#for $word in str($prediction.alleles.allele_text).strip().split():
#if $word.find(',') > 0
$word
#else
#set $allele = $word + ',' + str($prediction.lengths)
$allele
#end if
#end for
#end if
]]></configfile>
        <configfile name="entered_seqs"><![CDATA[#slurp
#if $sequence.seqsrc == 'entry'
#for $i, $seq in enumerate(str($sequence.seq_text).strip().split())
#set $seqid = $i + 1
#set $seqtext = '\t'.join([str($seqid),$seq.strip()])
$seqtext
#end for
#end if
]]></configfile>
    </configfiles>
    <inputs>
        <conditional name="prediction">
            <param name="tool" type="select" label="Prediction">
                <option value="mhci">MHC-I Binding</option>
                <option value="mhcii">MHC-II Binding</option>
                <option value="processing">MHC-I Processing</option>
                <option value="mhcnp">MHC-NP T-Cell Epitope</option>
                <option value="bcell">Antibody Epitope Prediction</option>
            </param>
            <when value="mhci">
                <param name="method" type="select" label="prediction method">
                    <option value="recommended" selected="true">recommended</option>
                    <option value="consensus">consensus</option>
                    <option value="netmhcpan">netmhcpan</option>
                    <option value="netmhcpan_ba">netmhcpan_ba</option>
                    <option value="netmhcpan_el">netmhcpan_el</option>
                    <option value="ann">ann</option>
                    <option value="smmpmbec">smmpmbec</option>
                    <option value="smm">smm</option>
                    <option value="comblib_sidney2008">comblib_sidney2008</option>
                    <option value="netmhccons">netmhccons</option>
                    <option value="pickpocket">pickpocket</option>
                </param>
                <expand macro="alleles" hla_regex="(HLA-[A-CEG]\*[0-8][[0-9]:[0-9][0-9][0-9]*|BoLA-.+|Gogo-.+|H-2-[DKL][bdk]|Mamu-.+|Patr-.+|RT.+|SLA-.+)(,([8-9]|1[0-5]))*" hla_examples="HLA-A*03:01  HLA-B*07:02" hlalen_examples="HLA-A*03:01,8,9,10  HLA-B*07:02,9"/>
                <param name="lengths" type="select" multiple="true" optional="false" label="peptide lengths for prediction">
                    <help>Used for any alleles which don't include specified lengths</help>
                    <option value="8" selected="true">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                    <option value="15">15</option>
                </param>

            </when>
            <when value="mhcii">
                <param name="method" type="select" label="prediction method">
                    <option value="recommended" selected="true">recommended</option>
                    <option value="consensus3">consensus3</option>
                    <option value="NetMHCIIpan">NetMHCIIpan</option>
                    <option value="nn_align">nn_align</option>
                    <option value="smm_align">smm_align</option>
                    <option value="comblib">comblib</option>
                    <option value="tepitope">tepitope</option>
                </param>
                <expand macro="alleles" hla_regex="(DPA1\*0[1-3](:0[1-3])?/DPB1\*0[1-6]:0[12]|DQA1\*0[1-5]:0[12]/DQB1\*0[2-6]:0[12]|(HLA-)?DRB[1-5]\*[01][1-9]:0[1-5]|H2-IA[bd])(,(asis|[1-2][0-9]|30))*" hla_examples="DPA1*01/DPB1*04:01 HLA-DRB1*01:01 H2-IAb" hlalen_examples="DPA1*01/DPB1*04:01,11,15"/>
                <param name="lengths" type="select" multiple="true" optional="false" label="peptide lengths for prediction">
                    <help>Used for any alleles which don't include specified lengths</help>
                    <option value="asis">asis</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                    <option value="15" selected="true">15</option>
                    <option value="16">16</option>
                    <option value="17">17</option>
                    <option value="18">18</option>
                    <option value="19">19</option>
                    <option value="20">20</option>
                    <option value="21">21</option>
                    <option value="22">22</option>
                    <option value="23">23</option>
                    <option value="24">24</option>
                    <option value="25">25</option>
                    <option value="26">26</option>
                    <option value="27">27</option>
                    <option value="28">28</option>
                    <option value="29">29</option>
                    <option value="30">30</option>
                </param>
            </when>
            <when value="processing">
                <param name="method" type="select" label="prediction method">
                    <option value="recommended" selected="true">recommended</option>
                    <option value="consensus">consensus</option>
                    <option value="netmhcpan">netmhcpan</option>
                    <option value="ann">ann</option>
                    <option value="smmpmbec">smmpmbec</option>
                    <option value="smm">smm</option>
                    <option value="comblib_sidney2008">comblib_sidney2008</option>
                </param>
                <param name="proteasome" type="select" label="proteasome type">
                    <option value="immuno">immuno</option>
                    <option value="constitutive">constitutive</option>
                </param>
                <expand macro="alleles" hla_regex="(HLA-[A-CE]\*[0-8][[0-9]:[0-9][0-9]|BoLA-.+|Gogo-.+|H-2-[DKL][bdk]|Mamu-.+|Patr-.+|RT.+|SLA-.+)(,([8-9]|1[0-4]))*" hla_examples="HLA-A*03:01  HLA-B*07:02" hlalen_examples="HLA-A*03:01,8,9,10  HLA-B*07:02,9"/>
                <param name="lengths" type="select" multiple="true" optional="false" label="peptide lengths for prediction">
                    <help>Used for any alleles which don't include specified lengths</help>
                    <option value="8" selected="true">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                </param>
            </when>
            <when value="mhcnp">
                <param name="method" type="select" label="prediction method">
                    <option value="mhcnp" selected="true">mhcnp</option>
                    <option value="netmhcpan">netmhcpan</option>
                </param>
                <expand macro="alleles" hla_regex="(HLA-(A\*02:01|B\*07:02|B\*35:01|B\*44:03|B\*53:01|B\*57:01)|H-2-[DK]b)(,[8-9]|1[0-1])*" hla_examples="HLA-A*02:01  H-2-Db" hlalen_examples="HLA-A*02:01,8,9,10"/>
                <param name="lengths" type="select" multiple="true" optional="false" label="peptide lengths for prediction">
                    <help>Used for any alleles which don't include specified lengths</help>
                    <option value="8" selected="true">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                </param>
            </when>
            <when value="bcell">
                <param name="method" type="select" label="prediction method">
                    <option value="Bepipred" selected="true">Bepipred</option>
                    <option value="Chou-Fasman">Chou-Fasman</option>
                    <option value="Emini">Emini</option>
                    <option value="Karplus-Schulz">Karplus-Schulz</option>
                    <option value="Kolaskar-Tongaonkar">Kolaskar-Tongaonkar</option>
                    <option value="Parker">Parker</option>
                </param>
                <param name="window_size" type="integer" value="" optional="true" min="1" label="window_size" help="window_size should be less than the sequence length, and less than 8 for Karplus-Schulz method"/>
            </when>
        </conditional>
        <conditional name="sequence">
           <param name="seqsrc" type="select" label="Peptide sequences">
               <option value="fasta">Fasta file</option>
               <option value="tabular">From tabular</option>
               <option value="entry"></option>
           </param>
           <when value="fasta">
               <param name="seq_fasta" type="data" format="fasta" label="Peptide Sequence Fasta"/>
           </when>
           <when value="tabular">
               <param name="seq_tsv" type="data" format="tabular" label="Peptide Sequence Tabular"/>
               <param name="pep_col" label="Select column with peptides" type="data_column" numerical="false" data_ref="seq_tsv" />
               <param name="id_col" label="Select column with name" type="data_column" numerical="false" data_ref="seq_tsv" optional="true"/>
           </when>
           <when value="entry">
               <param name="seq_text" type="text" label="Peptide Sequence"/>
           </when>
        </conditional>

    </inputs>
    <outputs>
        <!--
        <data name="output" format="tabular"/>
        -->
        <data name="output" format="tabular" label="IEDB ${prediction.tool} ${prediction.method}"/>
        <data name="output2" format="tabular" label="IEDB ${prediction.tool} ${prediction.method} residue scores" from_work_dir="iedb_results2">
            <filter>prediction['method'].startswith('Bepipred')</filter>
        </data>
    </outputs>
    <tests>
        <!-- test1 -->
        <test>
            <conditional name="prediction">
                <param name="tool" value="mhci"/>
                <param name="method" value="recommended"/>
                <conditional name="alleles">
                    <param name="allelesrc" value="entry"/>
                    <param name="allele_text" value="HLA-A*01:01,9"/>
                </conditional>
            </conditional>
            <conditional name="sequence">
                <param name="seqsrc" value="entry"/>
                <param name="seq_text" value="SLYNTVATLYCVHQRIDV"/>
            </conditional>
            <output name="output">
                <assert_contents>
                    <has_text text="LYNTVATLY" />
                </assert_contents>
            </output>
        </test>
        <!-- test2 -->
        <test>
            <conditional name="prediction">
                <param name="tool" value="mhci"/>
                <param name="method" value="recommended"/>
                <conditional name="alleles">
                    <param name="allelesrc" value="history"/>
                    <param name="allele_file" ftype="tabular" value="alleles_len.tsv"/>
                </conditional>
            </conditional>
            <conditional name="sequence">
                <param name="seqsrc" value="fasta"/>
                <param name="seq_fasta" ftype="fasta" value="seqs.fa"/>
            </conditional>
            <output name="output">
                <assert_contents>
                    <has_text text="peptide1" />
                    <has_text text="HKVPRRLLK" />
                </assert_contents>
            </output>
        </test>
        <!-- test3 -->
        <test>
            <conditional name="prediction">
                <param name="tool" value="mhci"/>
                <param name="method" value="recommended"/>
                <conditional name="alleles">
                    <param name="allelesrc" value="history"/>
                    <param name="allele_file" ftype="tabular" value="alleles.tsv"/>
                </conditional>
                <param name="lengths" value="8,9"/>
            </conditional>
            <conditional name="sequence">
                <param name="seqsrc" value="tabular"/>
                <param name="seq_tsv" ftype="tabular" value="seqs.tsv"/>
                <param name="pep_col" value="3"/>
                <param name="id_col" value="1"/>
            </conditional>
            <output name="output">
                <assert_contents>
                    <has_text text="peptide1" />
                    <has_text text="HKVPRRLLK" />
                </assert_contents>
            </output>
        </test>
        <!-- test4 -->
        <test>
            <conditional name="prediction">
                <param name="tool" value="mhcii"/>
                <param name="method" value="recommended"/>
                <conditional name="alleles">
                    <param name="allelesrc" value="entry"/>
                    <param name="allele_text" value="DPA1*01/DPB1*04:01"/>
                </conditional>
                <param name="lengths" value="asis"/>
            </conditional>
            <conditional name="sequence">
                <param name="seqsrc" value="entry"/>
                <param name="seq_text" value="SLYNTVATLYCVHQRIDV"/>
            </conditional>
            <output name="output">
                <assert_contents>
                    <has_text text="LYNTVATLY" />
                </assert_contents>
            </output>
        </test>
        <!-- test5 -->
        <test>
            <conditional name="prediction">
                <param name="tool" value="processing"/>
                <param name="method" value="recommended"/>
                <conditional name="alleles">
                    <param name="allelesrc" value="entry"/>
                    <param name="allele_text" value="HLA-A*01:01,8 HLA-A*02:01,9"/>
                </conditional>
                <param name="proteasome" value="constitutive"/>
            </conditional>
            <conditional name="sequence">
                <param name="seqsrc" value="entry"/>
                <param name="seq_text" value="SLYNTVATLYCVHQRIDV"/>
            </conditional>
            <output name="output">
                <assert_contents>
                    <has_text text="LYNTVATLY" />
                </assert_contents>
            </output>
        </test>
        <!-- test6 -->
        <test>
            <conditional name="prediction">
                <param name="tool" value="mhcnp"/>
                <param name="method" value="mhcnp"/>
                <conditional name="alleles">
                    <param name="allelesrc" value="entry"/>
                    <param name="allele_text" value="HLA-A*02:01,9"/>
                </conditional>
            </conditional>
            <conditional name="sequence">
                <param name="seqsrc" value="entry"/>
                <param name="seq_text" value="SLYNTVATLYCVHQRIDV"/>
            </conditional>
            <output name="output">
                <assert_contents>
                    <has_text text="LYNTVATLY" />
                </assert_contents>
            </output>
        </test>
        <!-- test7 -->
        <test>
            <conditional name="prediction">
                <param name="tool" value="bcell"/>
                <param name="method" value="Emini"/>
            </conditional>
            <conditional name="sequence">
                <param name="seqsrc" value="entry"/>
                <param name="seq_text" value="VLSEGEWQLVLHVWAKVEADVAGHGQDILIRLFKSHPETLEKFDRFKHLKTE"/>
            </conditional>
            <output name="output">
                <assert_contents>
                    <has_text text="VLSEGE" />
                </assert_contents>
            </output>
        </test>
        <!-- test8 -->
        <test>
            <conditional name="prediction">
                <param name="tool" value="bcell"/>
                <param name="method" value="Kolaskar-Tongaonkar"/>
                <param name="window_size" value="9"/>
            </conditional>
            <conditional name="sequence">
                <param name="seqsrc" value="fasta"/>
                <param name="seq_fasta" ftype="fasta" value="bcell.fa"/>
            </conditional>
            <output name="output">
                <assert_contents>
                    <has_text text="ADVAGH" />
                </assert_contents>
            </output>
        </test>

    </tests>
    <help><![CDATA[
The IEDB is a free resource, funded by a contract from the National Institute of Allergy and Infectious Diseases. It offers easy searching of experimental data characterizing antibody and T cell epitopes studied in humans, non-human primates, and other animal species.

This tool retrieves epitope binding information about input peptide sequences by using the RESTful web services provided by IEDB.
The webservices are described at:  http://tools.immuneepitope.org/main/tools-api/
That page also describes how to retrieve the available HLA alleles for class of epitope binding.

**INPUTS**

  peptide sequences from a fasta file or a column in a tabular file

  HLA alleles either entered as text or one per line in a text file

**OUTPUTS**

  A tabular file containing the results returned from the IEDB web service

**Typical Workflow for Human MHC I Binding Prediction**

The RNAseq data for the subject would be used for:

  - HLA prediction by seq2HLA
  - Novel Antigen Prediction by a variety of workflows to generate a Antigen peptide fasta

.. image:: $PATH_TO_IMAGES/IEDB_Workflow_QueryTabular.png
   :width: 584
   :height: 430

.. note:: The seq2HLA ClassI.HLAgenotype4digits output needs to be converted for IEDB alleles.

The seq2HLA ClassI.HLAgenotype4digits output:

.. image:: $PATH_TO_IMAGES/seq2HLA_ClassI.HLAgenotype4digits.png
   :width: 285
   :height: 77

Needs to be converted into IEDB formatted alleles:

.. image:: $PATH_TO_IMAGES/IEDB_formatted_alleles.png
   :width: 74
   :height: 81

In the workflow above QueryTabular tool converts the alleles:

  - Filter Dataset Input

    * skip leading lines - *skip lines:* 1
    * select columns - *columns:* 2,4
    * regex replace value in column - *column:* 1  *regex pattern:* ^(\\w+[*]\\d\\d:\\d\\d\\d?).*$  *replacement expression:* HLA-\\1
    * regex replace value in column - *column:* 2  *regex pattern:* ^(\\w+[*]\\d\\d:\\d\\d\\d?).*$  *replacement expression:* HLA-\\1

  - SQL Query to generate tabular output

    * SELECT c1 FROM t1 UNION SELECT c2 FROM t1

The IEDB formatting can also be performed by TextProcessing tools:

.. image:: $PATH_TO_IMAGES/TextProcessingConversion.png
   :width: 608
   :height: 87

The TextProcessing steps to convert the alleles:

  - Remove beginning -  removes the header line
  - Replace Text - picks Allele 1 and Allele 2 from each line and reformats each on a separate line

    * *Find pattern:* ^.*\\t([a-zA-Z]+[*][0-9]{2}:[0-9]{2,3}).*\\t.*\\t([a-zA-Z]+[*][0-9]{2}:[0-9]{2,3}).*\\t.*$
    * *Replace with:* HLA-\\1\\nHLA-\\2

  - Unique - remove duplicates

    ]]></help>
    <citations>
       <citation type="doi">10.1093/nar/gku938</citation>
    </citations>
</tool>


text:
package edu.softserve.zoo.persistence.specification.impl.statistics;

import edu.softserve.zoo.persistence.specification.impl.Queries;
import edu.softserve.zoo.persistence.specification.jdbc.JdbcSpecification;

import java.math.BigInteger;

/**
 * @author Taras Zubrei
 */
public class FedAnimalsSpecification<T extends BigInteger> implements JdbcSpecification<BigInteger> {
    @Override
    public String query() {
        return Queries.STAT_FED_ANIMALS;
    }
}


text:
package com.asakusafw.dag.runtime.internalio;

import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Writable;

import com.asakusafw.bridge.stage.StageInfo;
import com.asakusafw.dag.api.processor.TaskProcessorContext;
import com.asakusafw.dag.api.processor.VertexProcessorContext;
import com.asakusafw.dag.runtime.adapter.OutputAdapter;
import com.asakusafw.dag.runtime.adapter.OutputHandler;
import com.asakusafw.lang.utils.common.Arguments;
import com.asakusafw.lang.utils.common.Invariants;

/**
 * {@link OutputAdapter} for internal outputs.
 * @since 0.4.0
 */
public class InternalOutputAdapter implements OutputAdapter {

    /**
     * The placeholder symbol.
     */
    public static final char PLACEHOLDER = '*';

    private final StageInfo stage;

    private final Configuration configuration;

    private final List<OutputSpec> specs = new ArrayList<>();

    /**
     * Creates a new instance.
     * @param context the current context
     */
    public InternalOutputAdapter(VertexProcessorContext context) {
        Arguments.requireNonNull(context);
        this.stage = context.getResource(StageInfo.class).orElseThrow(AssertionError::new);
        this.configuration = context.getResource(Configuration.class).orElseThrow(AssertionError::new);
    }

    /**
     * Adds a simple output.
     * The output pattern must contain wildcard character ({@code "*"}).
     * @param id the output ID
     * @param pathPattern the path pattern
     * @param dataClass the data class
     * @return this
     */
    public final InternalOutputAdapter bind(String id, String pathPattern, Class<? extends Writable> dataClass) {
        Arguments.requireNonNull(id);
        Arguments.requireNonNull(pathPattern);
        Arguments.requireNonNull(dataClass);
        String resolved = stage.resolveUserVariables(pathPattern);
        int index = resolved.lastIndexOf(PLACEHOLDER);
        Invariants.require(index >= 0, () -> MessageFormat.format(
                "output path must be contain at least one placeholder \"{0}\": {1}",
                PLACEHOLDER,
                pathPattern));
        resolved = new StringBuilder(resolved).deleteCharAt(index).toString();
        specs.add(new OutputSpec(id, resolved, dataClass));
        return this;
    }

    @Override
    public OutputHandler<? super TaskProcessorContext> newHandler() throws IOException, InterruptedException {
        return new InternalOutputHandler(configuration, specs);
    }
}


text:
var fs = require('fs');

exports.name = JSON.parse(fs.readFileSync(__dirname + '/package.json', 'utf8')).name;

exports.match = function(/*v*/) {

};


text:
#ifndef _WX_FONTENC_H_
#define _WX_FONTENC_H_

// font encodings
enum wxFontEncoding
{
    wxFONTENCODING_SYSTEM = -1,     // system default
    wxFONTENCODING_DEFAULT,         // current default encoding

    // ISO8859 standard defines a number of single-byte charsets
    wxFONTENCODING_ISO8859_1,       // West European (Latin1)
    wxFONTENCODING_ISO8859_2,       // Central and East European (Latin2)
    wxFONTENCODING_ISO8859_3,       // Esperanto (Latin3)
    wxFONTENCODING_ISO8859_4,       // Baltic (old) (Latin4)
    wxFONTENCODING_ISO8859_5,       // Cyrillic
    wxFONTENCODING_ISO8859_6,       // Arabic
    wxFONTENCODING_ISO8859_7,       // Greek
    wxFONTENCODING_ISO8859_8,       // Hebrew
    wxFONTENCODING_ISO8859_9,       // Turkish (Latin5)
    wxFONTENCODING_ISO8859_10,      // Variation of Latin4 (Latin6)
    wxFONTENCODING_ISO8859_11,      // Thai
    wxFONTENCODING_ISO8859_12,      // doesn't exist currently, but put it
                                    // here anyhow to make all ISO8859
                                    // consecutive numbers
    wxFONTENCODING_ISO8859_13,      // Baltic (Latin7)
    wxFONTENCODING_ISO8859_14,      // Latin8
    wxFONTENCODING_ISO8859_15,      // Latin9 (a.k.a. Latin0, includes euro)
    wxFONTENCODING_ISO8859_MAX,

    // Cyrillic charset soup (see http://czyborra.com/charsets/cyrillic.html)
    wxFONTENCODING_KOI8,            // KOI8 Russian
    wxFONTENCODING_KOI8_U,          // KOI8 Ukrainian
    wxFONTENCODING_ALTERNATIVE,     // same as MS-DOS CP866
    wxFONTENCODING_BULGARIAN,       // used under Linux in Bulgaria

    // what would we do without Microsoft? They have their own encodings
        // for DOS
    wxFONTENCODING_CP437,           // original MS-DOS codepage
    wxFONTENCODING_CP850,           // CP437 merged with Latin1
    wxFONTENCODING_CP852,           // CP437 merged with Latin2
    wxFONTENCODING_CP855,           // another cyrillic encoding
    wxFONTENCODING_CP866,           // and another one
        // and for Windows
    wxFONTENCODING_CP874,           // WinThai
    wxFONTENCODING_CP932,           // Japanese (shift-JIS)
    wxFONTENCODING_CP936,           // Chinese simplified (GB)
    wxFONTENCODING_CP949,           // Korean (Hangul charset, a.k.a. EUC-KR)
    wxFONTENCODING_CP950,           // Chinese (traditional - Big5)
    wxFONTENCODING_CP1250,          // WinLatin2
    wxFONTENCODING_CP1251,          // WinCyrillic
    wxFONTENCODING_CP1252,          // WinLatin1
    wxFONTENCODING_CP1253,          // WinGreek (8859-7)
    wxFONTENCODING_CP1254,          // WinTurkish
    wxFONTENCODING_CP1255,          // WinHebrew
    wxFONTENCODING_CP1256,          // WinArabic
    wxFONTENCODING_CP1257,          // WinBaltic (same as Latin 7)
    wxFONTENCODING_CP1258,          // WinVietnamese
    wxFONTENCODING_CP1361,          // Johab Korean character set.
    wxFONTENCODING_CP12_MAX,

    wxFONTENCODING_UTF7,            // UTF-7 Unicode encoding
    wxFONTENCODING_UTF8,            // UTF-8 Unicode encoding
    wxFONTENCODING_EUC_JP,          // Extended Unix Codepage for Japanese
    wxFONTENCODING_UTF16BE,         // UTF-16 Big Endian Unicode encoding
    wxFONTENCODING_UTF16LE,         // UTF-16 Little Endian Unicode encoding
    wxFONTENCODING_UTF32BE,         // UTF-32 Big Endian Unicode encoding
    wxFONTENCODING_UTF32LE,         // UTF-32 Little Endian Unicode encoding

    wxFONTENCODING_MACROMAN,        // the standard mac encodings
    wxFONTENCODING_MACJAPANESE,
    wxFONTENCODING_MACCHINESETRAD,
    wxFONTENCODING_MACKOREAN,
    wxFONTENCODING_MACARABIC,
    wxFONTENCODING_MACHEBREW,
    wxFONTENCODING_MACGREEK,
    wxFONTENCODING_MACCYRILLIC,
    wxFONTENCODING_MACDEVANAGARI,
    wxFONTENCODING_MACGURMUKHI,
    wxFONTENCODING_MACGUJARATI,
    wxFONTENCODING_MACORIYA,
    wxFONTENCODING_MACBENGALI,
    wxFONTENCODING_MACTAMIL,
    wxFONTENCODING_MACTELUGU,
    wxFONTENCODING_MACKANNADA,
    wxFONTENCODING_MACMALAJALAM,
    wxFONTENCODING_MACSINHALESE,
    wxFONTENCODING_MACBURMESE,
    wxFONTENCODING_MACKHMER,
    wxFONTENCODING_MACTHAI,
    wxFONTENCODING_MACLAOTIAN,
    wxFONTENCODING_MACGEORGIAN,
    wxFONTENCODING_MACARMENIAN,
    wxFONTENCODING_MACCHINESESIMP,
    wxFONTENCODING_MACTIBETAN,
    wxFONTENCODING_MACMONGOLIAN,
    wxFONTENCODING_MACETHIOPIC,
    wxFONTENCODING_MACCENTRALEUR,
    wxFONTENCODING_MACVIATNAMESE,
    wxFONTENCODING_MACARABICEXT,
    wxFONTENCODING_MACSYMBOL,
    wxFONTENCODING_MACDINGBATS,
    wxFONTENCODING_MACTURKISH,
    wxFONTENCODING_MACCROATIAN,
    wxFONTENCODING_MACICELANDIC,
    wxFONTENCODING_MACROMANIAN,
    wxFONTENCODING_MACCELTIC,
    wxFONTENCODING_MACGAELIC,
    wxFONTENCODING_MACKEYBOARD,

    // more CJK encodings (for historical reasons some are already declared
    // above)
    wxFONTENCODING_ISO2022_JP,      // ISO-2022-JP JIS encoding

    wxFONTENCODING_MAX,             // highest enumerated encoding value

    wxFONTENCODING_MACMIN = wxFONTENCODING_MACROMAN ,
    wxFONTENCODING_MACMAX = wxFONTENCODING_MACKEYBOARD ,

    // aliases for endian-dependent UTF encodings
#ifdef WORDS_BIGENDIAN
    wxFONTENCODING_UTF16 = wxFONTENCODING_UTF16BE,  // native UTF-16
    wxFONTENCODING_UTF32 = wxFONTENCODING_UTF32BE,  // native UTF-32
#else // WORDS_BIGENDIAN
    wxFONTENCODING_UTF16 = wxFONTENCODING_UTF16LE,  // native UTF-16
    wxFONTENCODING_UTF32 = wxFONTENCODING_UTF32LE,  // native UTF-32
#endif // WORDS_BIGENDIAN

    // alias for the native Unicode encoding on this platform
    // (this is used by wxEncodingConverter and wxUTFFile only for now)
#if SIZEOF_WCHAR_T == 2
    wxFONTENCODING_UNICODE = wxFONTENCODING_UTF16,
#else // SIZEOF_WCHAR_T == 4
    wxFONTENCODING_UNICODE = wxFONTENCODING_UTF32,
#endif

    // alternative names for Far Eastern encodings
        // Chinese
    wxFONTENCODING_GB2312 = wxFONTENCODING_CP936, // Simplified Chinese
    wxFONTENCODING_BIG5 = wxFONTENCODING_CP950,   // Traditional Chinese

        // Japanese (see http://zsigri.tripod.com/fontboard/cjk/jis.html)
    wxFONTENCODING_SHIFT_JIS = wxFONTENCODING_CP932, // Shift JIS

        // Korean (CP 949 not actually the same but close enough)
    wxFONTENCODING_EUC_KR = wxFONTENCODING_CP949,
    wxFONTENCODING_JOHAB = wxFONTENCODING_CP1361,

        // Vietnamese
    wxFONTENCODING_VIETNAMESE = wxFONTENCODING_CP1258
};

#endif // _WX_FONTENC_H_


text:
import React, { Component } from 'react';

import './../../css/Login.css'

export class Login extends Component {
  constructor(props) {
    super(props);
    this.state = {
      isNotLoggedIn: false,
      isAuthenticated: false
    }
    this.logout = this.logout.bind(this);
  }

  componetsWillMount() {
    this.state = {
      isNotLoggedIn: false,
      isAuthenticated: this.props.isAuthenticated
    }
  }

  logout() {
    // AuthActions.logUserOut();
    this.setState({isNotLoggedIn: true});
  }

  render() {
    return (

        Email<input id="txtEmail" type="email" className="email-input" placeholder="Email"></input>

        Password
        <input id="txtPassword" type="Password" className="password-input" placeholder="Password"></input>

          Login

          Signup

      )
  }
}

export default Login;