def norm01c(arr, center):
 arr = arr.copy()
 arr -= center
 arr /= (max((2 * arr.max()), ((-2) * arr.min())) + 1e-10)
 arr += 0.5
 assert (arr.min() >= 0)
 assert (arr.max() <= 1)
 return arr

def norm01c ( arr , center ) : arr = arr . copy ( ) arr -= center arr /= ( max ( ( 2 * arr . max ( ) ) , ( ( - 2 ) * arr . min ( ) ) ) + 1e-10 ) arr += 0.5 assert ( arr . min ( ) >= 0 ) assert ( arr . max ( ) <= 1 ) return arr
maps the input range to [0 .