code: def _diff_text(left, right, verbose=False):
      
      from difflib import ndiff
      explanation = []
      if isinstance(left, py.builtin.bytes):
          left = u(repr(left)[1:-1]).replace(r'\n', '\n')
      if isinstance(right, py.builtin.bytes):
          right = u(repr(right)[1:-1]).replace(r'\n', '\n')
      if not verbose:
          i = 0  # just in case left or right has zero length
          for i in range(min(len(left), len(right))):
              if left[i] != right[i]:
                  break
          if i > 42:
              i -= 10                 # Provide some context
              explanation = [u('Skipping %s identical leading '
                               'characters in diff, use -v to show') % i]
              left = left[i:]
              right = right[i:]
          if len(left) == len(right):
              for i in range(len(left)):
                  if left[-i] != right[-i]:
                      break
              if i > 42:
                  i -= 10     # Provide some context
                  explanation += [u('Skipping %s identical trailing '
                                    'characters in diff, use -v to show') % i]
                  left = left[:-i]
                  right = right[:-i]
      keepends = True
      explanation += [line.strip('\n')
                      for line in ndiff(left.splitlines(keepends),
                                        right.splitlines(keepends))]
      return explanation
docs: Return the explanation for the diff between text or bytes
  
      Unless --verbose is used this will skip leading and trailing
      characters which are identical to keep the diff minimal.
  
      If the input are bytes they will be safely converted to text.