<commit_before>class GraphData < Application
  before :display_from_cache
  after  :store_to_cache, :exclude => [:today]

  def loan(id)
    @loan      = Loan.get(id)
    raise NotFound unless @loan.disbursal_date
    max_amount = @loan.total_to_be_received
    dates      = @loan.installment_dates
    offset     = 0

    # add dates before the first installment to include the disbursal date
    d = @loan.shift_date_by_installments(dates.min, -1)
    while d >= @loan.disbursal_date
      offset += 1
      dates  << d
      d = @loan.shift_date_by_installments(d, -1)
    end
<commit_msg>Added fix for graph issue<commit_after>class GraphData < Application
  before :display_from_cache
  after  :store_to_cache, :exclude => [:today]

  def loan(id)
    @loan      = Loan.get(id)
    raise NotFound unless @loan.disbursal_date
    max_amount = @loan.total_to_be_received
    dates      = @loan.installment_dates
    offset     = 0

    # add dates before the first installment to include the disbursal date
    d = @loan.shift_date_by_installments(dates.min, -1)
    dates  << d

{'fraction_non_alphanumeric': 0.08595194085027727, 'fraction_numerical': 0.005545286506469501, 'mean_word_length': 3.102272727272727, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 6, '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': '4485630', 'n_tokens_mistral': 387, 'n_tokens_neox': 357, 'n_words': 91}