def wrap_deepmind(env, episode_life=True, clip_rewards=True, frame_stack=False, scale=False):
if episode_life:<EOL><INDENT>env = EpisodicLifeEnv(env)<EOL><DEDENT>if '<STR_LIT>' in env.unwrapped.get_action_meanings():<EOL><INDENT>env = FireResetEnv(env)<EOL><DEDENT>env = WarpFrame(env)<EOL>if scale:<EOL><INDENT>env = ScaledFloatFrame(env)<EOL><DEDENT>if clip_rewards:<EOL><INDENT>env = ClipRewardEnv(env)<EOL><DEDENT>if frame_stack:<EOL><INDENT>env = FrameStack(env, <NUM_LIT:4>)<EOL><DEDENT>return env<EOL>
Configure environment for DeepMind-style Atari.