<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __voxel_4conectedness(shape):
 """ Returns the number of edges for the supplied image shape assuming 4-connectedness. The name of the function has historical reasons. Essentially it returns the number of edges assuming 4-connectedness only for 2D. For 3D it assumes 6-connectedness, etc. @param shape the shape of the image @type shape sequence @return the number of edges @rtype int """

    shape = list(shape)
    while 1 in shape: shape.remove(1) # empty resp. 1-sized dimensions have to be removed (equal to scipy.squeeze on the array)
    return int(round(sum([(dim - 1)/float(dim) for dim in shape]) * scipy.prod(shape)))