<commit_before>class CheckpointV1 < Sinatra::Base

  get '/identities/:id' do |id|
    if id =~ /\,/
      # Retrieve a list of identities      
      ids = id.split(/\s*,\s*/).compact
      found_identities = Identity.find_all_by_id(ids)
      @identities = ids.collect do |id|
        found_identities.find {|i| i.id == id.to_i}
      end
      render :rabl, :identities, :format => :json
    else
      # Retrieve a single identity
      @identity = (id == 'me') ? current_identity : Identity.find(id)
      halt 404, "{}" unless @identity
      render :rabl, :identity, :format => :json
    end
  end

  get '/identities/:id/accounts/:provider' do |id, provider|
    identity = (id == 'me') ? current_identity : Identity.find(id)
    halt 500, "No such indentity" unless identity
    identity == current_identity or check_god_credentials(identity.realm_id)
    @account = identity.accounts.where("provider = ?", params[:provider]).first
    halt 200, "{}" unless @account.try(:authorized?)
    render :rabl, :account, :format => :json
  end

end<commit_msg>Missing identities/me returns 200 {}<commit_after>class CheckpointV1 < Sinatra::Base

  get '/identities/:id' do |id|
    if id =~ /\,/
      # Retrieve a list of identities      
      ids = id.split(/\s*,\s*/).compact
      found_identities = Identity.find_all_by_id(ids)
      @identities = ids.collect do |id|
        found_identities.find {|i| i.id == id.to_i}
      end
      render :rabl, :identities, :format => :json
    else
      # Retrieve a single identity
      @identity = (id == 'me') ? current_identity : Identity.find_by_id(id)
      halt 200, "{}" unless @identity
      render :rabl, :identity, :format => :json
    end
  end

  get '/identities/:id/accounts/:provider' do |id, provider|
    identity = (id == 'me') ? current_identity : Identity.find(id)
    halt 404, "No such indentity" unless identity
    identity == current_identity or check_god_credentials(identity.realm_id)
    @account = identity.accounts.where("provider = ?", params[:provider]).first
    halt 200, "{}" unless @account.try(:authorized?)
    render :rabl, :account, :format => :json
  end

end
{'fraction_non_alphanumeric': 0.1417945141794514, 'fraction_numerical': 0.010692701069270108, 'mean_word_length': 3.0757575757575757, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2839987', 'n_tokens_mistral': 717, 'n_tokens_neox': 688, 'n_words': 179}