code: def itersplit(s, sep=None):
      
      if not s:
          yield s
          return
      exp = re.compile(r'\s+' if sep is None else re.escape(sep))
      pos = 0
      while True:
          m = exp.search(s, pos)
          if not m:
              if pos < len(s) or sep is not None:
                  yield s[pos:]
              break
          if pos < m.start() or sep is not None:
              yield s[pos:m.start()]
          pos = m.end()
docs: Split a string by ``sep`` and yield chunks
  
      Args:
          s (str-type): string to split
          sep (str-type): delimiter to split by
  
      Yields:
          generator of strings: chunks of string s