For pretty inspect.
 @return [String] Title with color codes.
428633
def title
      class_name = Helper.color(Helper.class_name(self), sev: :bin)
      size_str = index.nil? ? nil : "[#{Helper.color(format('%#x', idx_to_size))}]"
      "#{class_name}#{size_str}: "
    end
1042954
def title(controller_name, model_name = controller_name.singularize)
      string = ''
      unless ['page', 'routing_error', 'my_accounts'].include?(controller_name)
        string << t("activerecord.models.#{model_name}") + ' - '
      end
      if controller_name == 'routing_error'
        string << t("page.routing_error") + ' - '
      end
      string << LibraryGroup.system_name + ' - Next-L Enju Leaf'
      string.html_safe
    end
1305548
def color(name, string = nil, &block)
      attribute = Attribute[name] or raise ArgumentError, "unknown attribute #{name.inspect}"
      result = ''
      result << "\e[#{attribute.code}m" if Term::ANSIColor.coloring?
      if block_given?
        result << yield.to_s
      elsif string.respond_to?(:to_str)
        result << string.to_str
      elsif respond_to?(:to_str)
        result << to_str
      else
        return result #only switch on
      end
      result << "\e[0m" if Term::ANSIColor.coloring?
      result.extend(Term::ANSIColor)
    end
229747
def title
      @title ||= begin
        if options[:title]
          options[:title]
        else
          title_builder = ''
          title_builder << "#{options[:value]} " if options[:value].is_a?(Symbol)
          title_builder << (options[:category].is_a?(Symbol) ? "per #{options[:category]}" : 'per request')
          title_builder
        end
      end
    end
976270
def _print_title(self):
        
        if self.title:
            self._stream_out('{}\n'.format(self.title))
            self._stream_flush()
286679
def color_methods
      colors.each do |key|
        next if key == :default

        define_method key do
          colorize(:color => key)
        end

        define_method "on_#{key}" do
          colorize(:background => key)
        end
      end
    end
548116
def all_titles_h1_h2
      return unless @page
      out = []
      out << @page.css('title').text << { @page_url => @page.css('h1').text }
      out << { @page_url => @page.css('h2').text }
      out
    end
401106
def color(
            self, text=None, fore=None, back=None, style=None,
            no_closing=False):
        
        has_args = (
            (fore is not None) or
            (back is not None) or
            (style is not None)
        )
        if hasattr(text, '__colr__') and not has_args:
            # Use custom __colr__ method in the absence of arguments.
            return str(self._call_dunder_colr(text))

        # Stringify everything before operating on it.
        text = str(text) if text is not None else ''
        if _disabled:
            return text

        # Considered to have unclosed codes if embedded codes exist and
        # the last code was not a color code.
        embedded_codes = get_codes(text)
        has_end_code = embedded_codes and embedded_codes[-1] == closing_code
        # Add closing code if not already added, there is text, and
        # some kind of color/style was used (whether from args, or
        # color codes were included in the text already).
        # If the last code embedded in the text was a closing code,
        # then it is not added.
        # This can be overriden with `no_closing`.
        needs_closing = (
            text and
            (not no_closing) and
            (not has_end_code) and
            (has_args or embedded_codes)
        )
        if needs_closing:
            end = closing_code
        else:
            end = ''
        return ''.join((
            self.color_code(fore=fore, back=back, style=style),
            text,
            end,
        ))
543654
def title
      doc.at("//head/meta[@name='title']")["content"].split(/\(.*\)/)[0].strip! ||
          doc.at("h1.header").children.first.text.strip

    end
892982
def inspect
      c = []
      children.each do |w|
        c << w.inspect
      end
      s = super + " #{self.class}=<window_class:#{window_class} pid:#{pid} thread_id:#{thread_id} title:\"#{title}\" children=<" + c.join("\n") + ">>"
    end
1102653
def pretty_list(list)
      center = nil
      list.map.with_index do |c, idx|
        next center = Helper.color('[self]', sev: :bin) if c == @base

        color_c = Helper.color(format('%#x', c))
        fwd = fd_of(c)
        next "#{color_c}(invalid)" if fwd.nil? # invalid c

        bck = bk_of(c)
        if center.nil? # bk side
          format('%s%s', color_c, fwd == list[idx + 1] ? nil : Helper.color(format('(%#x)', fwd)))
        else # fd side
          format('%s%s', bck == list[idx - 1] ? nil : Helper.color(format('(%#x)', bck)), color_c)
        end
      end.join(' === ')
    end
892120
function getColorObj(text) {
  const hashedText = hash(text);
  const colorIndex = hashedText % materialColors.length;

  return materialColors[colorIndex];
}
1272911
def condition_title_for(key)
      title_parts = key.to_s.split('.')
      title = key.to_s.gsub(".", ": ").gsub("_", " ")
      title = title.split(" ").collect{|part| part.split("/").last.capitalize}.join(" ")
      if title_parts.size > 1
        "#{JOIN_NAME_INDICATOR} #{title}"
      else
        title
      end
    end
170888
def format_as_title(str, io)
      if Cri::Platform.color?(io)
        bold(red(str.upcase))
      else
        str.upcase
      end
    end
1252317
def style_defs(cls):
        
        formatter = HtmlFormatter()
        formatter.style.highlight_color = cls.VIOLATION_COLOR
        return formatter.get_style_defs()
1073835
def title=(title)
      @title = title.to_s.strip.upcase
      @title << 'M' if @title.match(/[A-LN-Z]$/)
      @title = 'IM' if @title == 'M'
      @title = 'WIM' if @title == 'WM'
      @title = nil if @title == ''
      raise "invalid chess title (#{title})" unless @title.nil? || @title.match(/^W?[GIFCN]M$/)
    end
641310
def color(color_code = nil) # :nodoc:
      if color_code.respond_to?(:to_int) && color_code.respond_to?(:+)
        # the default color if arg is outside range,
        if color_code < 0 || 63 < color_code
          0x7FFF
        # or an index < 8 mapped into the correct range,
        elsif color_code < 8
          (color_code + 8).to_i
        # or an integer in the valid range
        else
          color_code.to_i
        end
      elsif color_code.respond_to?(:to_sym)
        color_code = color_code.downcase.to_sym if color_code.respond_to?(:to_str)
        COLORS[color_code] || 0x7FFF
      else
        0x7FFF
      end
    end