code: def _filter_distance(results, return_distance):
      """For a list of tuples [(distance, value), ...] - optionally filter out
      the distance elements.
      Args:
          tuple_list: List of tuples. (distance, value)
          return_distance: boolean to determine if distances should be returned.
      """
      if return_distance:
          return results
      else:
          return list([x for y, x in results])
  
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 3 for calling a global function with example usage: _filter_distance(results, return_distance) and returns: results, list