  """ A lightweight variant of DFaker Model
      By AnDenix, 2018-2019
      Based on the dfaker model: https://github.com/dfaker
  
      Acknowledgements:
      kvrooman for numrious insights and invaluable aid
      DeepHomage for lots of testing
      """
  
  import sys
  import types
 
</s> remove import sys
import types

from keras.initializers import RandomNormal
from keras.layers import Add, Dense, Flatten, Input, Reshape, AveragePooling2D, LeakyReLU
from keras.layers.convolutional import UpSampling2D, Conv2DTranspose
 </s> add from keras.layers import Dense, Flatten, Input, Reshape, AveragePooling2D, LeakyReLU
from keras.layers import UpSampling2D </s> remove from keras.layers import Add, SeparableConv2D
 </s> add from keras.layers import Add, Concatenate, SeparableConv2D, UpSampling2D </s> remove # [P] TODO Move upscale2x_hyb to nnblocks.py (after testing)
# <<< DeLight Model Blocks >>> #
def upscale2x_hyb(self, inp, filters, kernel_size=3, padding='same',
                  sr_ratio=0.5, scale_factor=2, interpolation='bilinear',
                  res_block_follows=False, **kwargs):
    """Hybrid Upscale Layer"""
    name = self._get_name("upscale2x_hyb")
    var_x = inp

    sr_filters = int(filters * sr_ratio)
    upscale_filters = filters - sr_filters

    var_x_sr = self.upscale(var_x, upscale_filters, kernel_size=kernel_size,
                            padding=padding, scale_factor=scale_factor,
                            res_block_follows=res_block_follows, **kwargs)
    if upscale_filters > 0:
        var_x_us = self.conv2d(var_x, upscale_filters,  kernel_size=3, padding=padding,
                               name="{}_conv2d".format(name), **kwargs)
        var_x_us = UpSampling2D(size=(scale_factor, scale_factor), interpolation=interpolation,
                                name="{}_upsampling2D".format(name))(var_x_us)
        var_x = Concatenate(name="{}_concatenate".format(name))([var_x_sr, var_x_us])
    else:
        var_x = var_x_sr

    return var_x


def upscale2x_fast(self, inp, filters, kernel_size=3, padding='same',
                   sr_ratio=0.5, scale_factor=2, interpolation='bilinear',
                   res_block_follows=False, **kwargs):
    """Fast Upscale Layer"""
    name = self._get_name("upscale2x_fast")
    var_x = inp

    var_x2 = self.conv2d(var_x, filters,  kernel_size=3, padding=padding,
                         name="{}_conv2d".format(name), **kwargs)
    var_x2 = UpSampling2D(size=(scale_factor, scale_factor), interpolation=interpolation,
                          name="{}_upsampling2D".format(name))(var_x2)

    var_x1 = self.upscale(var_x, filters, kernel_size=kernel_size,
                          padding=padding, scale_factor=scale_factor,
                          res_block_follows=res_block_follows, **kwargs)
    var_x = Add()([var_x2, var_x1])
    return var_x


 </s> add  </s> remove         # monkey patch-in nn_blocks
        self.blocks.upscale2x_hyb = types.MethodType(upscale2x_hyb, self.blocks)
        self.blocks.upscale2x_fast = types.MethodType(upscale2x_fast, self.blocks)
 </s> add 
    Acknowledgments:
    kvrooman for numerous insights and invaluable aid
  """ A lightweight variant of DFaker Model
      By AnDenix, 2018-2019
      Based on the dfaker model: https://github.com/dfaker
  
    Acknowledgments:
    kvrooman for numerous insights and invaluable aid
    Acknowledgments:
    kvrooman for numerous insights and invaluable aid
      DeepHomage for lots of testing
      """
  
  import sys
  import types
keep keep keep keep replace replace keep keep keep keep keep
 Move custom dlight blocks to nn_blocks 
plugins/train/model/dlight.py