code: def nextpow2(value):
      
      if value >= 1:
          return 2**np.ceil(np.log2(value)).astype(int)
      elif value > 0:
          return 1
      elif value == 0:
          return 0
      else:
          raise ValueError('Value must be positive')
docs: Compute the nearest power of two greater or equal to the input value