code: def find_near_matches_substitutions(subsequence, sequence, max_substitutions):
      
      _check_arguments(subsequence, sequence, max_substitutions)
  
      if max_substitutions == 0:
          return [
              Match(start_index, start_index + len(subsequence), 0)
              for start_index in search_exact(subsequence, sequence)
          ]
  
      elif len(subsequence) // (max_substitutions + 1) >= 3:
          return find_near_matches_substitutions_ngrams(
              subsequence, sequence, max_substitutions,
          )
  
      else:
          return find_near_matches_substitutions_lp(
              subsequence, sequence, max_substitutions,
          )
docs: Find near-matches of the subsequence in the sequence.
  
      This chooses a suitable fuzzy search implementation according to the given
      parameters.
  
      Returns a list of fuzzysearch.Match objects describing the matching parts
      of the sequence.