hunk.code_window:     expectObservableArray(e1.partition(predicate), expected);
       expectSubscriptions(e1.subscriptions).toBe([e1subs, e1subs]);
     });
     it('should pass errors to both returned observables', () => {
       const e1 =    hot('--a-b---#');
       const e1subs =    '^       !';
       const expected = ['--a-----#',
  
hunk.labels: keep keep keep add keep keep keep keep
hunk.after_edit:   it('should partition an observable into two using a predicate and thisArg', () => {
       const e1 =    hot('--a-b---a------d--a---c--|');
       const e1subs =    '^                        !';
       const expected = ['--a-----a---------a------|',
                       '----b----------d------c--|'];
       function predicate(x) {
         return x === this.value;
       }
       expectObservableArray(e1.partition(predicate, {value: 'a'}), expected);
       expectSubscriptions(e1.subscriptions).toBe([e1subs, e1subs]);
     });
  
hunk.file_path: spec/operators/partition-spec.ts
hunk.type: add
file: import { not } from '../util/not';
  import { filter } from './filter';
  import { Observable } from '../Observable';
  
  /**
   * Splits the source Observable into two, one with values that satisfy a
   * predicate, and another with values that don't satisfy the predicate.
   *
   * <span class="informal">It's like {@link filter}, but returns two Observables:
   * one like the output of {@link filter}, and the other with values that did not
   * pass the condition.</span>
   *
   * <img src="./img/partition.png" width="100%">
   *
   * `partition` outputs an array with two Observables that partition the values
   * from the source Observable through the given `predicate` function. The first
   * Observable in that array emits source values for which the predicate argument
   * returns true. The second Observable emits source values for which the
   * predicate returns false. The first behaves like {@link filter} and the second
   * behaves like {@link filter} with the predicate negated.
   *
   * @example <caption>Partition click events into those on DIV elements and those elsewhere</caption>
   * var clicks = Rx.Observable.fromEvent(document, 'click');
   * var parts = clicks.partition(ev => ev.target.tagName === 'DIV');
   * var clicksOnDivs = parts[0];
   * var clicksElsewhere = parts[1];
   * clicksOnDivs.subscribe(x => console.log('DIV clicked: ', x));
   * clicksElsewhere.subscribe(x => console.log('Other clicked: ', x));
   *
   * @see {@link filter}
   *
   * @param {function(value: T, index: number): boolean} predicate A function that
   * evaluates each value emitted by the source Observable. If it returns `true`,
   * the value is emitted on the first Observable in the returned array, if
   * `false` the value is emitted on the second Observable in the array. The
   * `index` parameter is the number `i` for the i-th source emission that has
   * happened since the subscription, starting from the number `0`.
   * @param {any} [thisArg] An optional argument to determine the value of `this`
   * in the `predicate` function.
   * @return {[Observable<T>, Observable<T>]} An array with two Observables: one
   * with values that passed the predicate, and another with values that did not
   * pass the predicate.
   * @method partition
   * @owner Observable
   */
  export function partition<T>(this: Observable<T>, predicate: (value: T) => boolean, thisArg?: any): [Observable<T>, Observable<T>] {
    return [
      filter.call(this, predicate),
      filter.call(this, not(predicate, thisArg))
    ];
  }
  