code: def distance_similarity(a, b, p, T=CLOSE_DISTANCE_THRESHOLD):
      
      d = distance_to_line(a, b, p)
      r = (-1/float(T)) * abs(d) + 1
  
      return r if r > 0 else 0
docs: Computes the distance similarity between a line segment
      and a point
  
      Args:
          a ([float, float]): x and y coordinates. Line start
          b ([float, float]): x and y coordinates. Line end
          p ([float, float]): x and y coordinates. Point to compute the distance
      Returns:
          float: between 0 and 1. Where 1 is very similar and 0 is completely different