parameters: (input, angle, axes)
return_statement: return output_shape
docstring: Returns the shape of the output array of scipy.ndimage.interpolation.rotate
      derived from: https://github.com/scipy/scipy/blob/v0.16.1/scipy/ndimage/ \
      interpolation.py #L578. We are duplicating the code here so we can generate
      an array of the right shape and array order to pass into the rotate
      function.
  
      :param input The input array
      :type: ndarray
      :param angle The rotation angle in degrees.
      :type: float
      :param axes The two axes that define the plane of rotation.
                  Default is the first two axes.
      :type: tuple of 2 ints
docstring_summary: Returns the shape of the output array of scipy.ndimage.interpolation.rotate
      derived from: https://github.com/scipy/scipy/blob/v0.16.1/scipy/ndimage/ \
      interpolation.py #L578. We are duplicating the code here so we can generate
      an array of the right shape and array order to pass into the rotate
      function.
docstring_tokens: Returns the shape of the output array of scipy . ndimage . interpolation . rotate derived from : https : // github . com / scipy / scipy / blob / v0 . 16 . 1 / scipy / ndimage / \ interpolation . py #L578 . We are duplicating the code here so we can generate an array of the right shape and array order to pass into the rotate function .
function: def rotate_shape(input, angle, axes):
      """
      Returns the shape of the output array of scipy.ndimage.interpolation.rotate
      derived from: https://github.com/scipy/scipy/blob/v0.16.1/scipy/ndimage/ \
      interpolation.py #L578. We are duplicating the code here so we can generate
      an array of the right shape and array order to pass into the rotate
      function.
  
      :param input The input array
      :type: ndarray
      :param angle The rotation angle in degrees.
      :type: float
      :param axes The two axes that define the plane of rotation.
                  Default is the first two axes.
      :type: tuple of 2 ints
      """
  
      axes = list(axes)
      rank = input.ndim
      if axes[0] < 0:
          axes[0] += rank
      if axes[1] < 0:
          axes[1] += rank
      if axes[0] < 0 or axes[1] < 0 or axes[0] > rank or axes[1] > rank:
          raise RuntimeError('invalid rotation plane specified')
      if axes[0] > axes[1]:
          axes = axes[1], axes[0]
      angle = np.pi / 180 * angle
      m11 = math.cos(angle)
      m12 = math.sin(angle)
      m21 = -math.sin(angle)
      m22 = math.cos(angle)
      matrix = np.array([[m11, m12],
                         [m21, m22]], dtype=np.float64)
      iy = input.shape[axes[0]]
      ix = input.shape[axes[1]]
      mtrx = np.array([[m11, -m21],
                       [-m12, m22]], dtype=np.float64)
      minc = [0, 0]
      maxc = [0, 0]
      coor = np.dot(mtrx, [0, ix])
      minc, maxc = _minmax(coor, minc, maxc)
      coor = np.dot(mtrx, [iy, 0])
      minc, maxc = _minmax(coor, minc, maxc)
      coor = np.dot(mtrx, [iy, ix])
      minc, maxc = _minmax(coor, minc, maxc)
      oy = int(maxc[0] - minc[0] + 0.5)
      ox = int(maxc[1] - minc[1] + 0.5)
      offset = np.zeros((2,), dtype=np.float64)
      offset[0] = float(oy) / 2.0 - 0.5
      offset[1] = float(ox) / 2.0 - 0.5
      offset = np.dot(matrix, offset)
      tmp = np.zeros((2,), dtype=np.float64)
      tmp[0] = float(iy) / 2.0 - 0.5
      tmp[1] = float(ix) / 2.0 - 0.5
      offset = tmp - offset
      output_shape = list(input.shape)
      output_shape[axes[0]] = oy
      output_shape[axes[1]] = ox
  
      return output_shape
function_tokens: def rotate_shape ( input , angle , axes ) : axes = list ( axes ) rank = input . ndim if axes [ 0 ] < 0 : axes [ 0 ] += rank if axes [ 1 ] < 0 : axes [ 1 ] += rank if axes [ 0 ] < 0 or axes [ 1 ] < 0 or axes [ 0 ] > rank or axes [ 1 ] > rank : raise RuntimeError ( 'invalid rotation plane specified' ) if axes [ 0 ] > axes [ 1 ] : axes = axes [ 1 ] , axes [ 0 ] angle = np . pi / 180 * angle m11 = math . cos ( angle ) m12 = math . sin ( angle ) m21 = - math . sin ( angle ) m22 = math . cos ( angle ) matrix = np . array ( [ [ m11 , m12 ] , [ m21 , m22 ] ] , dtype = np . float64 ) iy = input . shape [ axes [ 0 ] ] ix = input . shape [ axes [ 1 ] ] mtrx = np . array ( [ [ m11 , - m21 ] , [ - m12 , m22 ] ] , dtype = np . float64 ) minc = [ 0 , 0 ] maxc = [ 0 , 0 ] coor = np . dot ( mtrx , [ 0 , ix ] ) minc , maxc = _minmax ( coor , minc , maxc ) coor = np . dot ( mtrx , [ iy , 0 ] ) minc , maxc = _minmax ( coor , minc , maxc ) coor = np . dot ( mtrx , [ iy , ix ] ) minc , maxc = _minmax ( coor , minc , maxc ) oy = int ( maxc [ 0 ] - minc [ 0 ] + 0.5 ) ox = int ( maxc [ 1 ] - minc [ 1 ] + 0.5 ) offset = np . zeros ( ( 2 , ) , dtype = np . float64 ) offset [ 0 ] = float ( oy ) / 2.0 - 0.5 offset [ 1 ] = float ( ox ) / 2.0 - 0.5 offset = np . dot ( matrix , offset ) tmp = np . zeros ( ( 2 , ) , dtype = np . float64 ) tmp [ 0 ] = float ( iy ) / 2.0 - 0.5 tmp [ 1 ] = float ( ix ) / 2.0 - 0.5 offset = tmp - offset output_shape = list ( input . shape ) output_shape [ axes [ 0 ] ] = oy output_shape [ axes [ 1 ] ] = ox return output_shape