docs: def join(delimiter, iterable, **kwargs):
      """Returns a string which is a concatenation of strings in ``iterable``,
      separated by given ``delimiter``.
  
      :param delimiter: Delimiter to put between strings
      :param iterable: Iterable to join
  
      Optional keyword arguments control the exact joining strategy:
  
      :param errors:
          What to do with erroneous non-strings in the input.
          Possible values include:
  
              * ``'ignore'`` (or ``None``)
              * ``'cast'`` (or ``False``) -- convert non-strings to strings
              * ``'raise'`` (or ``True``) -- raise exception for any non-strings
              * ``'replace'`` -- replace non-strings with alternative value
  
      :param with_: Replacement used when ``errors == 'replace'``.
                    This can be a string, or a callable taking erroneous value
                    and returning a string replacement.
  
      .. versionadded:: 0.0.3
         Allow to specify error handling policy through ``errors`` parameter
      """
      ensure_string(delimiter)
      ensure_iterable(iterable)
  
      ensure_keyword_args(kwargs, optional=('errors', 'with_'))
      errors = kwargs.get('errors', True)
  
      if errors in ('raise', True):
          iterable = imap(ensure_string, iterable)
      elif errors in ('ignore', None):
          iterable = ifilter(is_string, iterable)
      elif errors in ('cast', False):
          iterable = imap(delimiter.__class__, iterable)
      elif errors == 'replace':
          if 'with_' not in kwargs:
              raise ValueError("'replace' error policy requires specifying "
                               "replacement through with_=")
  
          with_ = kwargs['with_']
          if is_string(with_):
              replacement = lambda x: with_
          elif callable(with_):
              replacement = with_
          else:
              raise TypeError("error replacement must be a string or function, "
                              "got %s" % type(with_).__name__)
  
          iterable = (x if is_string(x) else ensure_string(replacement(x))
                      for x in iterable)
      else:
          raise TypeError(
              "%r is not a valid error handling policy for join()" % (errors,))
  
      return delimiter.join(iterable)