def _prune_array(array):
 if ((array.base is not None) and (array.size < (array.base.size // 2))):
  return array.copy()
 return array

def _prune_array ( array ) : if ( ( array . base is not None ) and ( array . size < ( array . base . size // 2 ) ) ) : return array . copy ( ) return array
return an array equivalent to the input array .