def _ellipsis_match(want, got):
 if (ELLIPSIS_MARKER not in want):
  return (want == got)
 ws = want.split(ELLIPSIS_MARKER)
 assert (len(ws) >= 2)
 (startpos, endpos) = (0, len(got))
 w = ws[0]
 if w:
  if got.startswith(w):
   startpos = len(w)
   del ws[0]
  else:
   return False
 w = ws[(-1)]
 if w:
  if got.endswith(w):
   endpos -= len(w)
   del ws[(-1)]
  else:
   return False
 if (startpos > endpos):
  return False
 for w in ws:
  startpos = got.find(w, startpos, endpos)
  if (startpos < 0):
   return False
  startpos += len(w)
 return True

def _ellipsis_match ( want , got ) : if ( ELLIPSIS_MARKER not in want ) : return ( want == got ) ws = want . split ( ELLIPSIS_MARKER ) assert ( len ( ws ) >= 2 ) ( startpos , endpos ) = ( 0 , len ( got ) ) w = ws [ 0 ] if w : if got . startswith ( w ) : startpos = len ( w ) del ws [ 0 ] else : return False w = ws [ ( - 1 ) ] if w : if got . endswith ( w ) : endpos -= len ( w ) del ws [ ( - 1 ) ] else : return False if ( startpos > endpos ) : return False for w in ws : startpos = got . find ( w , startpos , endpos ) if ( startpos < 0 ) : return False startpos += len ( w ) return True
essentially the only subtle case: .