<commit_before>def read_base_image_from_dockerfile
  
    dockerfile = File.open(basedir + '/Dockerfile', 'r')
    from_line = dockerfile.gets("\n", 100)
    from_line.gsub(/^FROM[ ]./, '')
  dockerfile.close
  rescue StandardError => e
    log_build_errors(e)
    return nil
  end
  
  def get_base_image
    base_image_name = read_base_image_from_dockerfile

    if base_image_name.nil?
      log_build_errors('Failed to Read Image from Dockerfile')
      @last_error = ' ' + tail_of_build_log
      return post_failed_build_clean_up
    end
    log_build_output('Pull base Image')
    if @core_api.pull_image(base_image_name) == false
      log_build_errors('Failed Pull Image:' + base_image_name + ' from  DockerHub')
      @last_error = ' ' + tail_of_build_log
      return post_failed_build_clean_up
    end
    true
  end<commit_msg>return <commit_after>def read_base_image_from_dockerfile
  
    dockerfile = File.open(basedir + '/Dockerfile', 'r')
    from_line = dockerfile.gets("\n", 100)
    from_line.gsub(/^FROM[ ]./, '')
  dockerfile.close
  from_line
  rescue StandardError => e
    log_build_errors(e)
    return nil
  end
  
  def get_base_image
    base_image_name = read_base_image_from_dockerfile

    if base_image_name.nil?
      log_build_errors('Failed to Read Image from Dockerfile')
      @last_error = ' ' + tail_of_build_log
      return post_failed_build_clean_up
    end
    log_build_output('Pull base Image')
    if @core_api.pull_image(base_image_name) == false
      log_build_errors('Failed Pull Image:' + base_image_name + ' from  DockerHub')
      @last_error = ' ' + tail_of_build_log
      return post_failed_build_clean_up
    end
    true
  end
{'fraction_non_alphanumeric': 0.08896797153024912, 'fraction_numerical': 0.0035587188612099642, 'mean_word_length': 3.498666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '404906', 'n_tokens_mistral': 598, 'n_tokens_neox': 577, 'n_words': 109}