def getHorizontallyBoundedPath(horizontalBegin, horizontalEnd, path):
 horizontallyBoundedPath = []
 for (pointIndex, point) in enumerate(path):
  begin = None
  previousIndex = (pointIndex - 1)
  if (previousIndex >= 0):
   begin = path[previousIndex]
  end = None
  nextIndex = (pointIndex + 1)
  if (nextIndex < len(path)):
   end = path[nextIndex]
  addHorizontallyBoundedPoint(begin, point, end, horizontalBegin, horizontalEnd, horizontallyBoundedPath)
 return horizontallyBoundedPath

def getHorizontallyBoundedPath ( horizontalBegin , horizontalEnd , path ) : horizontallyBoundedPath = [ ] for ( pointIndex , point ) in enumerate ( path ) : begin = None previousIndex = ( pointIndex - 1 ) if ( previousIndex >= 0 ) : begin = path [ previousIndex ] end = None nextIndex = ( pointIndex + 1 ) if ( nextIndex < len ( path ) ) : end = path [ nextIndex ] addHorizontallyBoundedPoint ( begin , point , end , horizontalBegin , horizontalEnd , horizontallyBoundedPath ) return horizontallyBoundedPath
get horizontally bounded path .