<commit_before>module Microscope
  class CodeViewer
    attr_reader :frame

    def initialize(scope)
      @scope = scope
      @parent = scope.root

      initialize_notebook
      initialize_source_frame
      initialize_disassembly_frame
      
      refresh
    end

    def initialize_notebook
      @frame = Tk::Tile::Notebook.new(@parent)
      @frame.padding('2 2 2 2')
      @frame.grid(:column => 0, :row => 0, :sticky => 'nwes')
    end

    def initialize_source_frame
      @source_frame = Tk::Tile::Frame.new(@frame)
      @source_text = Tk::Text.new(@source_frame)
      @source_text.pack(:side => 'left')
      @source_text.state('disabled')
      @frame.add(@source_frame, {:text => 'source'})
    end

    def initialize_disassembly_frame
      @disassembly_frame = Tk::Tile::Frame.new(@frame)
      @disassembly_text = TkText.new(@disassembly_frame)
      @disassembly_text.pack(:side => 'left')
      @disassembly_text.state('disabled')
      @frame.add(@disassembly_frame, {:text => 'bytecode'})
    end
    
    def select_class_and_method(_class, selector)<commit_msg>Fixed code viewer layout.<commit_after>module Microscope
  class CodeViewer
    attr_reader :frame

    def initialize(scope)
      @scope = scope
      @parent = scope.root

      initialize_notebook
      initialize_source_frame
      initialize_disassembly_frame
      
      refresh
    end

    def initialize_notebook
      @frame = Tk::Tile::Notebook.new(@parent)
      @frame.padding('2 2 2 2')
      @frame.grid(:column => 0, :row => 0, :sticky => 'nwes')
    end

    def initialize_source_frame
      @source_frame = Tk::Tile::Frame.new(@frame)
      @source_text = Tk::Text.new(@source_frame)
      @source_text.pack
      @source_text.state('disabled')
      @frame.add(@source_frame, {:text => 'source'})
    end

    def initialize_disassembly_frame
      @disassembly_frame = Tk::Tile::Frame.new(@frame)
      @disassembly_text = TkText.new(@disassembly_frame)
      @disassembly_text.pack
      @disassembly_text.state('disabled')
      @frame.add(@disassembly_frame, {:text => 'bytecode'})
    end
    
    def select_class_and_method(_class, selector)
{'fraction_non_alphanumeric': 0.12072155411655874, 'fraction_numerical': 0.005550416281221091, 'mean_word_length': 3.135755258126195, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5603515', 'n_tokens_mistral': 701, 'n_tokens_neox': 672, 'n_words': 122}