code: def endswith_partial(text, partial_str):
      '''Check if the text ends with any partial version of the
      specified string.'''
      # at the end of the content
      # we don't care about complete overlap, so start checking
      # for matches without the last character
      test_str = partial_str[:-1]
      # look for progressively smaller segments
      while test_str:
          if text.endswith(test_str):
              return len(test_str)
          test_str = test_str[:-1]
      return Falsf endswith_partial(text, partial_str):
      '''Check if the text ends with any partial version of the
      specified string.'''
      # at the end of the content
      # we don't care about complete overlap, so start checking
      # for matches without the last character
      test_str = partial_str[:-1]
      # look for progressively smaller segments
      while test_str:
          if text.endswith(test_str):
              return len(test_str)
          test_str = test_str[:-1]
      return False
docs: Check if the text ends with any partial version of the
      specified string.