code: def dropout(a, p=0.5, inplace=False):
      
  
      dt = a.dtype
      if p == 0.5:
          # Can't pass float dtype to `randint` directly.
          rand = np.random.randint(0, high=2, size=a.shape).astype(dtype=dt)
      else:
          rand = np.random.choice([0, 1], p=[p, 1 - p], size=a.shape).astype(dt)
      if inplace:
          a *= rand
      else:
          return a * rand
docs: Randomly set elements from `a` equal to zero, with proportion `p`.
  
      Similar in concept to the dropout technique employed within
      neural networks.
  
      Parameters
      ----------
      a: numpy.ndarray
          Array to be modified.
      p: float in [0, 1]
          Expected proportion of elements in the result that will equal 0.
      inplace: bool
  
      Example
      -------
      >>> x = np.arange(10, 20, 2, dtype=np.uint8)
      >>> z = dropout(x, p=0.6)
      >>> z
      array([10, 12,  0,  0,  0], dtype=uint8)
      >>> x.dtype == z.dtype
      True