class_docstr: Structured environment version of the cutting 2D environment.
  The environment alternates between the two sub-steps:
  
  - Select cutting piece
  - Select cutting configuration (cutting order and cutting orientation)
  
  :param maze_env: The "flat" cutting 2D environment to wrap.
class_docstr_tok: ["Structured","environment","version","of","the","cutting","2D","environment",".","The","environment","alternates","between","the","two","sub-steps",":","-","Select","cutting","piece","-","Select","cutting","configuration","(","cutting","order","and","cutting","orientation",")",":","param","maze_env",":","The","``","flat","''","cutting","2D","environment","to","wrap","."]
docstr: Formats observation available for the second sub-step.
docstr_tok: ["Formats","observation","available","for","the","second","sub-step","."]
code: def _obs_cutting_step(
      flat_obs: Dict[str, np.array], selected_piece_idx: int
  ) -> Dict[str, np.array]:
      """Formats observation available for the second sub-step."""
  
      selected_piece = flat_obs["inventory"][selected_piece_idx]
      ordered_piece = flat_obs["ordered_piece"]
  
      # prepare cutting action mask
      cutting_mask = np.zeros((2,), dtype=np.float32)
  
      selected_piece = selected_piece.squeeze()
      if np.all(flat_obs["ordered_piece"] <= selected_piece):
          cutting_mask[0] = 1.0
  
      if np.all(flat_obs["ordered_piece"][::-1] <= selected_piece):
          cutting_mask[1] = 1.0
  
      return {
          "selected_piece": selected_piece,
          "ordered_piece": ordered_piece,
          "cutting_mask": cutting_mask,
      }
  
file_path: maze/tutorials/tutorial_maze_env/part06_struct_env/env/struct_env_masked.py
imports: from copy import deepcopy
  from typing import Dict, List, Tuple
  import gym
  import numpy
  from tutorial_maze_env.part06_struct_env.env.maze_env import maze_env_factory
  from tutorial_maze_env.part06_struct_env.env.struct_env import StructuredCutting2DEnvironment
  from maze.core.env.maze_env import MazeEnv
label_desc: Use image node_id 3 for calling the MaskedStructuredCutting2DEnvironment obj's underlying member method code with example usage: obj._obs_cutting_step(flat_obs, selected_piece_idx) and returns: dict