parameters: (bbox)
return_statement: return sq_bbox
docstring: Converts a bbox to have a square shape by increasing size along non-max dimension.
docstring_summary: Converts a bbox to have a square shape by increasing size along non-max dimension.
docstring_tokens: Converts a bbox to have a square shape by increasing size along non - max dimension .
function: def square_bbox(bbox):
      '''
      Converts a bbox to have a square shape by increasing size along non-max dimension.
      '''
      sq_bbox = [int(round(coord)) for coord in bbox]
      bwidth = sq_bbox[2] - sq_bbox[0] + 1
      bheight = sq_bbox[3] - sq_bbox[1] + 1
      maxdim = float(max(bwidth, bheight))
      
      dw_b_2 = int(round((maxdim-bwidth)/2.0))
      dh_b_2 = int(round((maxdim-bheight)/2.0))
  
      sq_bbox[0] -= dw_b_2
      sq_bbox[1] -= dh_b_2
      sq_bbox[2] = sq_bbox[0] + maxdim - 1
      sq_bbox[3] = sq_bbox[1] + maxdim - 1
      
      return sq_bbox
function_tokens: def square_bbox ( bbox ) : sq_bbox = [ int ( round ( coord ) ) for coord in bbox ] bwidth = sq_bbox [ 2 ] - sq_bbox [ 0 ] + 1 bheight = sq_bbox [ 3 ] - sq_bbox [ 1 ] + 1 maxdim = float ( max ( bwidth , bheight ) ) dw_b_2 = int ( round ( ( maxdim - bwidth ) / 2.0 ) ) dh_b_2 = int ( round ( ( maxdim - bheight ) / 2.0 ) ) sq_bbox [ 0 ] -= dw_b_2 sq_bbox [ 1 ] -= dh_b_2 sq_bbox [ 2 ] = sq_bbox [ 0 ] + maxdim - 1 sq_bbox [ 3 ] = sq_bbox [ 1 ] + maxdim - 1 return sq_bbox