<commit_before>import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';

import { Seat } from './';

@Injectable()
export class SeatService {
  rows: Row[];

  constructor(private http: Http) {
    this.getRows().subscribe(rows => {
      this.rows = rows;

      this.getSeats().subscribe(seats => rows.map(row => seats.filter(seat => seat.rowId === row.id).map(seat => {
        console.log(row);
        if (!row.seats) {
          row.seats = [];
        }
        row.seats.push(seat);
      })));
    });
  }

  private getRows(): Observable<Row[]> {
    return this.http.get('http://localhost:3000/api/rows').map(res => res.json()).catch(this.handleError);
  }

  private getSeats(): Observable<Seat[]> {
    return this.http.get('http://localhost:3000/api/seats').map(res => res.json()).catch(this.handleError);
  }

  private handleError (error: Response | any) {
    let errMsg: string;
    if (error instanceof Response) {
      const body = error.json() || '';
      const err = body.error || JSON.stringify(body);
      errMsg = `${error.status} - ${error.statusText || ''} ${err}`;
    } else {
      errMsg = error.message ? error.message : error.toString();
    }
    console.error(errMsg);
    return Observable.throw(errMsg);
  }
}

export class Row {
  public seats: Seat[];

  constructor(public id: string) { }
}
<commit_msg>Fix seating chart<commit_after>import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';

import { Seat } from './';

@Injectable()
export class SeatService {
  rows: Row[];

  constructor(private http: Http) {
    this.getRows().subscribe(rows => {
      this.rows = rows;

      this.getSeats().subscribe(seats => rows.map(row => seats.filter(seat => seat.rowId === row.id).map(seat => {
        console.log(row);
        if (!row.seats) {
          row.seats = [];
        }
        row.seats.push(seat);
      })));
    });
  }

  private getRows(): Observable<Row[]> {
    return this.http.get('http://localhost:3000/api/rows').map(res => res.json()).catch(this.handleError);
  }

  private getSeats(): Observable<Seat[]> {
    return this.http.get('http://localhost:3000/api/seats?filter[order]=column%20ASC').map(res => res.json()).catch(this.handleError);
  }

  private handleError (error: Response | any) {
    let errMsg: string;
    if (error instanceof Response) {
      const body = error.json() || '';
      const err = body.error || JSON.stringify(body);
      errMsg = `${error.status} - ${error.statusText || ''} ${err}`;
    } else {
      errMsg = error.message ? error.message : error.toString();
    }
    console.error(errMsg);
    return Observable.throw(errMsg);
  }
}

export class Row {
  public seats: Seat[];

  constructor(public id: string) { }
}

{'fraction_non_alphanumeric': 0.17989601386481802, 'fraction_numerical': 0.006239168110918544, 'mean_word_length': 3.070521861777151, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4644790', 'n_tokens_mistral': 946, 'n_tokens_neox': 923, 'n_words': 182}