<commit_before>module Chishiki
  class Branch
    attr_accessor :pos, :children, :parent, :cib, :name, :pipe, :widgets
    class << self
      attr_accessor :stem, :status
    end
    def initialize(node, pos)
      Branch.stem = self if node.nil?
      init_color = node.nil? ? YELLOW : MAGENTA
      @parent = node
      @name = parent.name[0..-2] + ((parent.name[-1].to_i) + 1).to_s
      @pos = pos
      @children = []
      @txt = Text.new(@pos.dup)
      @node = Label.new(@pos.dup.sh(NODE_START, 0), TYPES[:head], init_color)
      @marker = Label.new(@pos.dup.sh(MARKER_WIDTH, 0), MARKER_F_N, GREEN)
      @wpipe = Label.new(@pos.dup.sh(PIPE_WIDTH, 0), CHAR_WPIPE * PIPE_SIZE, GREEN)
      @cib = 0
      @height = 0
      @created = true
      @pipe = Pipe.new(@pos.dup.sh(NODE_START, -1),
                       self.parent, pipe_tar)
      @widgets = []
      @widgets << @pipe << @marker << @node << @wpipe << @txt
    end

    def parent
      @parent.nil? ? NilBranch.new : @parent
    end

    def leaf<commit_msg>fixed node offset<commit_after>module Chishiki
  class Branch
    attr_accessor :pos, :children, :parent, :cib, :name, :pipe, :widgets
    class << self
      attr_accessor :stem, :status
    end
    def initialize(node, pos)
      Branch.stem = self if node.nil?
      init_color = node.nil? ? YELLOW : MAGENTA
      @parent = node
      @name = parent.name[0..-2] + ((parent.name[-1].to_i) + 1).to_s
      @pos = pos.dup.sh(-1, 0)
      @children = []
      @txt = Text.new(@pos.dup)
      @node = Label.new(@pos.dup.sh(NODE_START, 0), TYPES[:head], init_color)
      @marker = Label.new(@pos.dup.sh(MARKER_WIDTH, 0), MARKER_F_N, GREEN)
      @wpipe = Label.new(@pos.dup.sh(PIPE_WIDTH, 0), CHAR_WPIPE * PIPE_SIZE, GREEN)
      @cib = 0
      @height = 0
      @created = true
      @pipe = Pipe.new(@pos.dup.sh(NODE_START, -1),
                       self.parent, pipe_tar)
      @widgets = []
      @widgets << @pipe << @marker << @node << @wpipe << @txt
    end

    def parent
      @parent.nil? ? NilBranch.new : @parent
    end

    def leaf
{'fraction_non_alphanumeric': 0.15591915303176132, 'fraction_numerical': 0.010587102983638113, 'mean_word_length': 2.337078651685393, 'pattern_counts': {'":': 0, '<': 27, '<?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': '199677', 'n_tokens_mistral': 789, 'n_tokens_neox': 753, 'n_words': 168}