parameters: (width, height, distortion_scale)
return_statement: return startpoints, endpoints
docstring: Get parameters for ``perspective`` for a random perspective transform.
  
          Args:
              width : width of the image.
              height : height of the image.
  
          Returns:
              List containing [top-left, top-right, bottom-right, bottom-left] of the original image,
              List containing [top-left, top-right, bottom-right, bottom-left] of the transformed image.
docstring_summary: Get parameters for ``perspective`` for a random perspective transform.
docstring_tokens: Get parameters for perspective for a random perspective transform .
function: def get_params(width, height, distortion_scale):
          """Get parameters for ``perspective`` for a random perspective transform.
  
          Args:
              width : width of the image.
              height : height of the image.
  
          Returns:
              List containing [top-left, top-right, bottom-right, bottom-left] of the original image,
              List containing [top-left, top-right, bottom-right, bottom-left] of the transformed image.
          """
          half_height = int(height / 2)
          half_width = int(width / 2)
          topleft = (random.randint(0, int(distortion_scale * half_width)),
                     random.randint(0, int(distortion_scale * half_height)))
          topright = (random.randint(width - int(distortion_scale * half_width) - 1, width - 1),
                      random.randint(0, int(distortion_scale * half_height)))
          botright = (random.randint(width - int(distortion_scale * half_width) - 1, width - 1),
                      random.randint(height - int(distortion_scale * half_height) - 1, height - 1))
          botleft = (random.randint(0, int(distortion_scale * half_width)),
                     random.randint(height - int(distortion_scale * half_height) - 1, height - 1))
          startpoints = [(0, 0), (width - 1, 0), (width - 1, height - 1), (0, height - 1)]
          endpoints = [topleft, topright, botright, botleft]
          return startpoints, endpoints
function_tokens: def get_params ( width , height , distortion_scale ) : half_height = int ( height / 2 ) half_width = int ( width / 2 ) topleft = ( random . randint ( 0 , int ( distortion_scale * half_width ) ) , random . randint ( 0 , int ( distortion_scale * half_height ) ) ) topright = ( random . randint ( width - int ( distortion_scale * half_width ) - 1 , width - 1 ) , random . randint ( 0 , int ( distortion_scale * half_height ) ) ) botright = ( random . randint ( width - int ( distortion_scale * half_width ) - 1 , width - 1 ) , random . randint ( height - int ( distortion_scale * half_height ) - 1 , height - 1 ) ) botleft = ( random . randint ( 0 , int ( distortion_scale * half_width ) ) , random . randint ( height - int ( distortion_scale * half_height ) - 1 , height - 1 ) ) startpoints = [ ( 0 , 0 ) , ( width - 1 , 0 ) , ( width - 1 , height - 1 ) , ( 0 , height - 1 ) ] endpoints = [ topleft , topright , botright , botleft ] return startpoints , endpoints