def METHOD_NAME(self, fn):
    """ Sets the distance function used to calculate cluster
    distances and silouette index.
    ARGUMENTS:
      fn: a pointer to python function acepting two arrays (numpy) as
      arguments.
    EXAMPLE:
      # A simple euclidean distance
      my_dist_fn = lambda x,y: abs(x-y)
      tree.set_distance_function(my_dist_fn)
      """
    for n in self.traverse():
        n._fdist = fn
        n._silhouette = None
        n._intercluster_dist = None
        n._intracluster_dist = None