code: def _filter_unique(tuple_list):
      """For a list of tuples [(distance, value), ...] - filter out duplicate
      values.
      Args:
          tuple_list: List of tuples. (distance, value)
      """
  
      added = set()
      ret = []
      for distance, value in tuple_list:
          if not value in added:
              ret.append((distance, value))
              added.add(value)
      return ret
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import collections
  import random
  import numpy
  import pysparnn.matrix_distance
label_desc: Use image node_id 2 for calling a global function with example usage: _filter_unique(tuple_list) and returns: ret