<commit_before>class Api < App
  DEFAULT_ZOOM = 12
  DEFAULT_BEARING = 0
  DEFAULT_PITCH = 0

  get '/cities' do
    cities = City.map do |city|
      {name: city.name,
       lines_count: city.lines.count,
       contributors_count: contributors(city),
       url: city.url}
    end
    {cities: cities}.to_json
  end

  get '/:url_name/config' do |url_name|
    @city = City[url_name: url_name]

    { name: @city.name,
      mapbox_access_token: MAPBOX_ACCESS_TOKEN,
      mapbox_style: MAPBOX_STYLE,
      coords: @city.geojson_coords,
      zoom: DEFAULT_ZOOM,
      bearing: DEFAULT_BEARING,
      pitch: DEFAULT_PITCH }.to_json
  end

  get '/:url_name/view_data' do |url_name|
    @city = City[url_name: url_name]

    { style: @city.style,
      lines: city_lines(@city),
      lines_length_by_year: lines_length_by_year(@city),<commit_msg>Adds white line<commit_after>class Api < App
  DEFAULT_ZOOM = 12
  DEFAULT_BEARING = 0
  DEFAULT_PITCH = 0

  get '/cities' do
    cities = City.map do |city|
      {name: city.name,
       lines_count: city.lines.count,
       contributors_count: contributors(city),
       url: city.url}
    end

    {cities: cities}.to_json
  end

  get '/:url_name/config' do |url_name|
    @city = City[url_name: url_name]

    { name: @city.name,
      mapbox_access_token: MAPBOX_ACCESS_TOKEN,
      mapbox_style: MAPBOX_STYLE,
      coords: @city.geojson_coords,
      zoom: DEFAULT_ZOOM,
      bearing: DEFAULT_BEARING,
      pitch: DEFAULT_PITCH }.to_json
  end

  get '/:url_name/view_data' do |url_name|
    @city = City[url_name: url_name]

    { style: @city.style,
      lines: city_lines(@city),
      lines_length_by_year: lines_length_by_year(@city),
{'fraction_non_alphanumeric': 0.10817166372721929, 'fraction_numerical': 0.004703115814226925, 'mean_word_length': 2.995305164319249, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1329396', 'n_tokens_mistral': 649, 'n_tokens_neox': 623, 'n_words': 129}