code: def resize_keepdims(im, size):
      # Opencv's resize remove the extra dimension for grayscale images. We add it back.
      ret = cv2.resize(im, size)
      if im.ndim == 3 and ret.ndim == 2:
          ret = ret[:, :, np.newaxis]
      return ret
  
file_path: tensorpack/examples/DeepQNetwork/DQN.py
imports: import argparse
  import numpy
  import os
  import cv2
  import gym
  import tensorflow
  from tensorpack import *
  from atari_wrapper import FireResetEnv, FrameStack, LimitLength, MapState
  from common import Evaluator, eval_model_multithread, play_n_episodes
  from DQNModel import Model
  from expreplay import ExpReplay
label_desc: Use image node_id 1 for calling a global function with example usage: resize_keepdims(im, size) and returns: ret