<commit_before><% sample_row = []
   specimen_row = []
   new_specimen ||= false
   if object.kind_of?(Sample)
    sample_row = sample_row_data(object)
    specimen_row = specimen_row_data(object.specimen)
    strain = object.specimen.strain
   elsif object.kind_of?(Specimen)
     specimen_row = specimen_row_data(object)
     strain = object.strain
   end
   strain_id = strain.try(:id)
   id_column = Seek::Config.is_virtualliver ? 8 : 6
 %>

<script type="text/javascript">
  /* submit and close Popup window for creating/updating sample/specimen after clicking create/update link from biosamples page.
  */
  action = "<%= action%>"
  if (!window.opener) {
        alert("New item was " + action + " but biosamples window was closed.");
        window.close();
    }

    object_class = "<%= object.class.name.downcase%>"
    sample_row = new Array;
    specimen_row = new Array;
    <%sample_row.each do |column_data|%>
          sample_row.push('<%=escape_javascript(column_data.to_s)%>');
    <%end%>
    <%specimen_row.each do |column_data|%>
      specimen_row.push('<%=escape_javascript(column_data.to_s)%>');
    <%end%>

    if (action == 'create' && object_class == 'sample' && "<%=new_specimen%>" == "true" ){
        window.opener.loadNewSpecimenAfterCreation(specimen_row, '<%=strain_id%>','<%=strain.is_dummy%>');
    }else if (action == 'create' && object_class == 'sample' && "<%=new_specimen%>" == "false"){
        window.opener.loadNewSampleAfterCreation(sample_row, '<%=object.specimen.title%>' );
    }else if (action == 'create' && object_class == 'specimen' ){
        window.opener.loadNewSpecimenAfterCreation(specimen_row,'<%=strain_id%>','<%=strain.is_dummy%>');
    }else if (action == 'update' && object_class == 'sample'){
        window.opener.updateSampleRow(sample_row, 6);
    }else if (action == 'update' && object_class == 'specimen'){
        window.opener.updateSpecimenRow( specimen_row,<%= id_column%>);
    }
    alert("New item was " + action + "d!");<commit_msg>fix problem of going back to biosamples page<commit_after><% sample_row = []
   specimen_row = []
   new_specimen ||= false
   specimen_title = nil
   if object.kind_of?(Sample)
    sample_row = sample_row_data(object)
    specimen_row = specimen_row_data(object.specimen)
    strain = object.specimen.strain
   elsif object.kind_of?(Specimen)
     specimen_row = specimen_row_data(object)
     strain = object.strain
     specimen_title = object.title
   end
   strain_id = strain.try(:id)
   id_column = Seek::Config.is_virtualliver ? 8 : 6
 %>

<script type="text/javascript">
  /* submit and close Popup window for creating/updating sample/specimen after clicking create/update link from biosamples page.
  */
  action = "<%= action%>"
  if (!window.opener) {
        alert("New item was " + action + " but biosamples window was closed.");
        window.close();
    }

    object_class = "<%= object.class.name.downcase%>"
    sample_row = new Array;
    specimen_row = new Array;
    <%sample_row.each do |column_data|%>
          sample_row.push('<%=escape_javascript(column_data.to_s)%>');
    <%end%>
    <%specimen_row.each do |column_data|%>
      specimen_row.push('<%=escape_javascript(column_data.to_s)%>');
    <%end%>

    if (action == 'create' && object_class == 'sample' && "<%=new_specimen%>" == "true" ){
        window.opener.loadNewSpecimenAfterCreation(specimen_row, '<%=strain_id%>','<%=strain.is_dummy%>');
    }else if (action == 'create' && object_class == 'sample' && "<%=new_specimen%>" == "false"){
        window.opener.loadNewSampleAfterCreation(sample_row, '<%=specimen_title%>' );
    }else if (action == 'create' && object_class == 'specimen' ){
        window.opener.loadNewSpecimenAfterCreation(specimen_row,'<%=strain_id%>','<%=strain.is_dummy%>');
    }else if (action == 'update' && object_class == 'sample'){
        window.opener.updateSampleRow(sample_row, 6);
    }else if (action == 'update' && object_class == 'specimen'){
        window.opener.updateSpecimenRow( specimen_row,<%= id_column%>);
    }
    alert("New item was " + action + "d!");
{'fraction_non_alphanumeric': 0.16556937332357963, 'fraction_numerical': 0.001463057790782736, 'mean_word_length': 3.9362214199759324, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '6191950', 'n_tokens_mistral': 1418, 'n_tokens_neox': 1352, 'n_words': 256}