code: def sim(src, tar, method=sim_levenshtein):
      
      if callable(method):
          return method(src, tar)
      else:
          raise AttributeError('Unknown similarity function: ' + str(method))
docs: Return a similarity of two strings.
  
      This is a generalized function for calling other similarity functions.
  
      Parameters
      ----------
      src : str
          Source string for comparison
      tar : str
          Target string for comparison
      method : function
          Specifies the similarity metric (:py:func:`sim_levenshtein` by default)
  
      Returns
      -------
      float
          Similarity according to the specified function
  
      Raises
      ------
      AttributeError
          Unknown distance function
  
      Examples
      --------
      >>> round(sim('cat', 'hat'), 12)
      0.666666666667
      >>> round(sim('Niall', 'Neil'), 12)
      0.4
      >>> sim('aluminum', 'Catalan')
      0.125
      >>> sim('ATCG', 'TAGC')
      0.25