code: def count_true_positive(truth, recommend):
      
      tp = 0
      for r in recommend:
          if r in truth:
              tp += 1
      return tp
docs: Count number of true positives from given sets of samples.
  
      Args:
          truth (numpy 1d array): Set of truth samples.
          recommend (numpy 1d array): Ordered set of recommended samples.
  
      Returns:
          int: Number of true positives.