class_docstr: Computes the Needleman-Wunsch measure between two strings.
  The Needleman-Wunsch generalizes the Levenshtein distance and considers global
  alignment between two strings. Specifically, it is computed by assigning
  a score to each alignment between two input strings and choosing the
  score of the best alignment, that is, the maximal score.
  An alignment between two strings is a set of correspondences between the
  characters of between them, allowing for gaps.
  
  https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm
class_docstr_tok: ["Computes","the","Needleman-Wunsch","measure","between","two","strings",".","The","Needleman-Wunsch","generalizes","the","Levenshtein","distance","and","considers","global","alignment","between","two","strings",".","Specifically",",","it","is","computed","by","assigning","a","score","to","each","alignment","between","two","input","strings","and","choosing","the","score","of","the","best","alignment",",","that","is",",","the","maximal","score",".","An","alignment","between","two","strings","is","a","set","of","correspondences","between","the","characters","of","between","them",",","allowing","for","gaps",".","https",":","\/\/en.wikipedia.org\/wiki\/Needleman","%","E2","%","80","%","93Wunsch_algorithm"]
code: def __init__(
      self,
      gap_cost: float = 1.0,
      sim_func: SimFunc = None,
      qval: int = 1,
      external: bool = True,
  ) -> None:
      self.qval = qval
      self.gap_cost = gap_cost
      if sim_func:
          self.sim_func = sim_func
      else:
          self.sim_func = self._ident
      self.external = external
  
imports: from __future__ import annotations
  from collections import defaultdict
  from itertools import zip_longest
  from typing import Any, Sequence, TypeVar
  from .base import Base, BaseSimilarity
  from .types import SimFunc, TestFunc
label_desc: Use image node_id 1 to create a new NeedlemanWunsch object from inherited base classes: _BaseSimilarity with example: obj = NeedlemanWunsch(gap_cost, sim_func, qval, external)