code: def _expand(subsequence, sequence, max_l_dist):
      
      # If given a long sub-sequence and relatively small max distance,
      # use a more complex algorithm better optimized for such cases.
      if len(subsequence) > max(max_l_dist * 2, 10):
          return _expand_long(subsequence, sequence, max_l_dist)
      else:
          return _expand_short(subsequence, sequence, max_l_dist)
docs: Expand a partial match of a Levenstein search.
  
      An expansion must begin at the beginning of the sequence, which makes
      this much simpler than a full search, and allows for greater optimization.