parameters: (s, sub, start=None, end=None)
return_statement: return rindex_impl
docstring: Implements str.rindex()
docstring_summary: Implements str.rindex()
docstring_tokens: Implements str . rindex ()
function: def unicode_rindex(s, sub, start=None, end=None):
      """Implements str.rindex()"""
      unicode_idx_check_type(start, 'start')
      unicode_idx_check_type(end, 'end')
      unicode_sub_check_type(sub, 'sub')
  
      def rindex_impl(s, sub, start=None, end=None):
          result = s.rfind(sub, start, end)
          if result < 0:
              raise ValueError('substring not found')
  
          return result
  
      return rindex_impl
function_tokens: def unicode_rindex ( s , sub , start = None , end = None ) : unicode_idx_check_type ( start , 'start' ) unicode_idx_check_type ( end , 'end' ) unicode_sub_check_type ( sub , 'sub' ) def rindex_impl ( s , sub , start = None , end = None ) : result = s . rfind ( sub , start , end ) if result < 0 : raise ValueError ( 'substring not found' ) return result return rindex_impl