code: def checkCrash(player, upperPipes, lowerPipes):
      """returns True if player collders with base or pipes."""
      pi = player["index"]
      player["w"] = IMAGES["player"][0].get_width()
      player["h"] = IMAGES["player"][0].get_height()
  
      # if player crashes into ground
      if player["y"] + player["h"] >= BASEY - 1:
          return True
      else:
          playerRect = pygame.Rect(
              player["x"], player["y"], player["w"], player["h"]
          )
  
          for uPipe, lPipe in zip(upperPipes, lowerPipes):
              # upper and lower pipe rects
              uPipeRect = pygame.Rect(
                  uPipe["x"], uPipe["y"], PIPE_WIDTH, PIPE_HEIGHT
              )
              lPipeRect = pygame.Rect(
                  lPipe["x"], lPipe["y"], PIPE_WIDTH, PIPE_HEIGHT
              )
  
              # player and upper/lower pipe hitmasks
              pHitMask = HITMASKS["player"][pi]
              uHitmask = HITMASKS["pipe"][0]
              lHitmask = HITMASKS["pipe"][1]
  
              # if bird collided with upipe or lpipe
              uCollide = pixelCollision(
                  playerRect, uPipeRect, pHitMask, uHitmask
              )
              lCollide = pixelCollision(
                  playerRect, lPipeRect, pHitMask, lHitmask
              )
  
              if uCollide or lCollide:
                  return True
  
      return False
  
file_path: CNTK/Examples/ReinforcementLearning/FlappingBirdWithKeras/game/wrapped_flappy_bird.py
imports: import numpy
  import sys
  import random
  from game import flappy_bird_utils
  import pygame
  import pygame.surfarray
  from pygame.locals import *
  from itertools import cycle
label_desc: Use image node_id 3 for calling a global function with example usage: checkCrash(player, upperPipes, lowerPipes) and returns: False, True, True