code: def _truncate(self, x, k):
          ''' given a vector x, leave its top-k absolute-value entries alone, and set the rest to 0 '''
          not_F = np.argsort(np.abs(x))[:-k]
          x[not_F] = 0
          return f _truncate(self, x, k):
          ''' given a vector x, leave its top-k absolute-value entries alone, and set the rest to 0 '''
          not_F = np.argsort(np.abs(x))[:-k]
          x[not_F] = 0
          return x
docs: given a vector x, leave its top-k absolute-value entries alone, and set the rest to 0