# Path: studio/util/logs.py
# DEBUG = logging.DEBUG
# INFO = logging.INFO
# ERROR = logging.ERROR
# def get_logger(name):
# def debug(line):
# def error(line):
# def info(line):


import types
    import keras
import numpy as np
import itertools
import six
    from keras.preprocessing import image as image_prep
from studio.util import logs
from PIL import Image
    from Queue import Full, Empty, Queue
    from queue import Full, Empty, Queue
from threading import Thread
            g = self.func
            self.func = lambda x: func(g(x))
            return self
        else:
            assert self.q_out is None
            self.q_out = Queue(self.q_size)
            return BufferedPipe(
                func, self,
                q_in=self.q_out,
                num_workers=num_workers if num_workers else self.num_workers,
                batch_size=batch_size if batch_size else self.batch_size,
                filterf=filterf if filterf else self.filterf,
                batcher=batcher if batcher else self.batcher,
                timeout=timeout if timeout else self.timeout)

    def _wrapped_func(self, x):
        if isinstance(x, tuple):
            try:
                return (x[0], self.func(x[1]))
            except BaseException as e:
                self.logger.warning('Applying function to {} raised exception {}'
                                 .format(x[1], str(e)))
                self.logger.exception(e)
                return (x[0], None)

        elif isinstance(x, list) and isinstance(x[0], tuple):
            batch_index = [el[0] for el in x]
            batch_input = self.batcher([el[1] for el in x])
            try:
                batch_output = self.func(batch_input)

# Path: studio/util/logs.py
# DEBUG = logging.DEBUG
# INFO = logging.INFO
# ERROR = logging.ERROR
# def get_logger(name):
# def debug(line):
# def error(line):
# def info(line):


# Path: studio/model_util.py
import types
    import keras
import numpy as np
import itertools
import six
    from keras.preprocessing import image as image_prep
from studio.util import logs
from PIL import Image
    from Queue import Full, Empty, Queue
    from queue import Full, Empty, Queue
from threading import Thread

            g = self.func
            self.func = lambda x: func(g(x))
            return self
        else:
            assert self.q_out is None
            self.q_out = Queue(self.q_size)
            return BufferedPipe(
                func, self,
                q_in=self.q_out,
                num_workers=num_workers if num_workers else self.num_workers,
                batch_size=batch_size if batch_size else self.batch_size,
                filterf=filterf if filterf else self.filterf,
                batcher=batcher if batcher else self.batcher,
                timeout=timeout if timeout else self.timeout)

    def _wrapped_func(self, x):
        if isinstance(x, tuple):
            try:
                return (x[0], self.func(x[1]))
            except BaseException as e:
                self.logger.warning('Applying function to {} raised exception {}'
                                 .format(x[1], str(e)))
                self.logger.exception(e)
                return (x[0], None)

        elif isinstance(x, list) and isinstance(x[0], tuple):
            batch_index = [el[0] for el in x]
            batch_input = self.batcher([el[1] for el in x])
            try:
                batch_output = self.func(batch_input)

            except BaseException as e: