code: public static <T> AutoDisposeConverter<T> autoDisposable(final ScopeProvider provider) {
      checkNotNull(provider, "provider == null");
      return autoDisposable(
          Completable.defer(
              () -> {
                try {
                  return provider.requestScope();
                } catch (OutsideScopeException e) {
                  Consumer<? super OutsideScopeException> handler =
                      AutoDisposePlugins.getOutsideScopeHandler();
                  if (handler != null) {
                    handler.accept(e);
                    return Completable.complete();
                  } else {
                    return Completable.error(e);
                  }
                }
              }));
    }
docs: Entry point for auto-disposing streams from a {@link ScopeProvider}.
  
  <p>Example usage:
  
  <pre><code>
  Observable.just(1)
  .as(autoDisposable(scope)) // Static import
  .subscribe(...)
  </code></pre>
  
  @param provider the target scope provider
  @param <T> the stream type.
  @return an {@link AutoDisposeConverter} to transform with operators like {@link
  Observable#as(ObservableConverter)}