code: def _hard_negative(x, positive, k):
      rank = (x * (positive - 1)).argsort(axis=1).argsort(axis=1)
      hard_negative = rank < (positive.sum(axis=1) * k)[:, np.newaxis]
      return hard_negative
  
imports: from __future__ import division
  import numpy
  import chainer
  import chainer.functions
label_desc: Use image node_id 2 for calling a global function with example usage: _hard_negative(x, positive, k) and returns: hard_negative