title: How does the python difflib.get_close_matches() function work?
body: <p>The following are two arrays:</p>
  
  <pre><code>import difflib
  import scipy
  import numpy
  
  a1=numpy.array(['198.129.254.73','134.55.221.58','134.55.219.121','134.55.41.41','198.124.252.101'], dtype='|S15')
  b1=numpy.array(['198.124.252.102','134.55.41.41','134.55.219.121','134.55.219.137','134.55.220.45', '198.124.252.130'],dtype='|S15')
  
  difflib.get_close_matches(a1[-1],b1,2)
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>['198.124.252.130', '198.124.252.102']
  </code></pre>
  
  <p>shouldnt <code>'198.124.252.102'</code> be the closest match for <code>'198.124.252.101'</code>? </p>
  
  <p>I looked at the documentation where they have specified about some floating type weights but no information on algorithm use.</p>
  
  <p>I am in need to find if the absolute difference between the last two octet is 1 (provided the first three octets are same).</p>
  
  <p>So I am finding the closest string first and then checking that closest string for the above condition.</p>
  
  <p>Is there any other function or way to achieve this? Also how does <code>get_close_matches()</code> behave?</p>
  
  <p><code>ipaddr</code> doesnt seem to have such a manipulation for ips.</p>