<commit_before>.f-addresses-fields
  *title_tag
    = t('.title')

  .row
    .col-lg-6
      = model.input :first_name, required: true

    .col-lg-6
      = model.input :last_name, required: true

  .f-addresses-fields__fields-wrap[
    data-country-code=data_country_code(:primary_address)
  ]
    - model.simple_fields_for :primary_address do |g|
      - all_blank = g.object.attributes.all? { |attr, val| attr == "type" || val.blank? }
      - required = required?(all_blank)

      .row
        .col-lg-7.f-addresses-fields__address-line-1
          = address_line_input g, :address_line_1, required: required

        .col-lg-5.f-addresses-fields__address-line-2
          = address_line_input g, :address_line_2, required: required

      .row
        .col-lg-5
          = g.input :zip, required: required

        .col-lg-7
          = g.input :city, required: required

      .row
        .col-lg-7
          = country_code_input(g)

      .row
        .col-lg-7
          = g.input :phone

  .f-addresses-fields__nested
    = togglable_fields model, :use_secondary_address
      .f-addresses-fields__nested-content
        .f-addresses-fields__fields-wrap[
          data-country-code=data_country_code(:secondary_address)
        ]
          - model.simple_fields_for :secondary_address do |g|
            = g.input :name

            = g.input :company_name

            .row
              .col-lg-7.f-addresses-fields__address-line-1
                = address_line_input g, :address_line_1

              .col-lg-5.f-addresses-fields__address-line-2
                = address_line_input g, :address_line_2

            .row
              .col-lg-5
                = g.input :zip

              .col-lg-7
                = g.input :city<commit_msg>mark secondary_address as required when needed<commit_after>.f-addresses-fields
  *title_tag
    = t('.title')

  .row
    .col-lg-6
      = model.input :first_name, required: true

    .col-lg-6
      = model.input :last_name, required: true

  .f-addresses-fields__fields-wrap[
    data-country-code=data_country_code(:primary_address)
  ]
    - model.simple_fields_for :primary_address do |g|
      - all_blank = g.object.attributes.all? { |attr, val| attr == "type" || val.blank? }
      - required = required?(all_blank)

      .row
        .col-lg-7.f-addresses-fields__address-line-1
          = address_line_input g, :address_line_1, required: required

        .col-lg-5.f-addresses-fields__address-line-2
          = address_line_input g, :address_line_2, required: required

      .row
        .col-lg-5
          = g.input :zip, required: required

        .col-lg-7
          = g.input :city, required: required

      .row
        .col-lg-7
          = country_code_input(g)

      .row
        .col-lg-7
          = g.input :phone

  .f-addresses-fields__nested
    = togglable_fields model, :use_secondary_address
      .f-addresses-fields__nested-content
        .f-addresses-fields__fields-wrap[
          data-country-code=data_country_code(:secondary_address)
        ]
          - model.simple_fields_for :secondary_address do |g|
            - all_blank = g.object.attributes.all? { |attr, val| attr == "type" || val.blank? }
            - required = required?(all_blank)

            = g.input :name

            = g.input :company_name

            .row
              .col-lg-7.f-addresses-fields__address-line-1
                = address_line_input g, :address_line_1, required: required

              .col-lg-5.f-addresses-fields__address-line-2
                = address_line_input g, :address_line_2, required: required

            .row
              .col-lg-5
                = g.input :zip, required: required

              .col-lg-7
                = g.input :city, required: required
{'fraction_non_alphanumeric': 0.11322751322751323, 'fraction_numerical': 0.010582010582010581, 'mean_word_length': 1.8258594917787743, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6528885', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1209, 'n_words': 203}