def star(a, dtype=np.uint8):
 from . import convex_hull_image
 if (a == 1):
  bfilter = np.zeros((3, 3), dtype)
  bfilter[:] = 1
  return bfilter
 m = ((2 * a) + 1)
 n = (a // 2)
 selem_square = np.zeros(((m + (2 * n)), (m + (2 * n))))
 selem_square[n:(m + n), n:(m + n)] = 1
 c = (((m + (2 * n)) - 1) // 2)
 selem_rotated = np.zeros(((m + (2 * n)), (m + (2 * n))))
 selem_rotated[(0, c)] = selem_rotated[((-1), c)] = 1
 selem_rotated[(c, 0)] = selem_rotated[(c, (-1))] = 1
 selem_rotated = convex_hull_image(selem_rotated).astype(int)
 selem = (selem_square + selem_rotated)
 selem[(selem > 0)] = 1
 return selem.astype(dtype)

def star ( a , dtype = np . uint8 ) : from . import convex_hull_image if ( a == 1 ) : bfilter = np . zeros ( ( 3 , 3 ) , dtype ) bfilter [ : ] = 1 return bfilter m = ( ( 2 * a ) + 1 ) n = ( a // 2 ) selem_square = np . zeros ( ( ( m + ( 2 * n ) ) , ( m + ( 2 * n ) ) ) ) selem_square [ n : ( m + n ) , n : ( m + n ) ] = 1 c = ( ( ( m + ( 2 * n ) ) - 1 ) // 2 ) selem_rotated = np . zeros ( ( ( m + ( 2 * n ) ) , ( m + ( 2 * n ) ) ) ) selem_rotated [ ( 0 , c ) ] = selem_rotated [ ( ( - 1 ) , c ) ] = 1 selem_rotated [ ( c , 0 ) ] = selem_rotated [ ( c , ( - 1 ) ) ] = 1 selem_rotated = convex_hull_image ( selem_rotated ) . astype ( int ) selem = ( selem_square + selem_rotated ) selem [ ( selem > 0 ) ] = 1 return selem . astype ( dtype )
renders the code for displaying a star used for starring items .