def _compare_entropy(start_slice, end_slice, slice, difference):
 start_entropy = utils.image_entropy(start_slice)
 end_entropy = utils.image_entropy(end_slice)
 if (end_entropy and (abs(((start_entropy / end_entropy) - 1)) < 0.01)):
  if (difference >= (slice * 2)):
   return (slice, slice)
  half_slice = (slice // 2)
  return (half_slice, (slice - half_slice))
 if (start_entropy > end_entropy):
  return (0, slice)
 else:
  return (slice, 0)

def _compare_entropy ( start_slice , end_slice , slice , difference ) : start_entropy = utils . image_entropy ( start_slice ) end_entropy = utils . image_entropy ( end_slice ) if ( end_entropy and ( abs ( ( ( start_entropy / end_entropy ) - 1 ) ) < 0.01 ) ) : if ( difference >= ( slice * 2 ) ) : return ( slice , slice ) half_slice = ( slice // 2 ) return ( half_slice , ( slice - half_slice ) ) if ( start_entropy > end_entropy ) : return ( 0 , slice ) else : return ( slice , 0 )
calculate the entropy of two slices .