class_docstr: Create a ``Style`` instance from a list of style rules.
  
  The `style_rules` is supposed to be a list of ('classnames', 'style') tuples.
  The classnames are a whitespace separated string of class names and the
  style string is just like a Pygments style definition, but with a few
  additions: it supports 'reverse' and 'blink'.
  
  Later rules always override previous rules.
  
  Usage::
  
      Style([
          ('title', '#ff0000 bold underline'),
          ('something-else', 'reverse'),
          ('class1 class2', 'reverse'),
      ])
  
  The ``from_dict`` classmethod is similar, but takes a dictionary as input.
class_docstr_tok: ["Create","a","``","Style","``","instance","from","a","list","of","style","rules",".","The","`","style_rules","`","is","supposed","to","be","a","list","of","(","'classnames","'",",","'style","'",")","tuples",".","The","classnames","are","a","whitespace","separated","string","of","class","names","and","the","style","string","is","just","like","a","Pygments","style","definition",",","but","with","a","few","additions",":","it","supports","'reverse","'","and","'blink","'",".","Later","rules","always","override","previous","rules",".","Usage",":",":","Style","(","[","(","'title","'",",","'","#","ff0000","bold","underline","'",")",",","(","'something-else","'",",","'reverse","'",")",",","(","'class1","class2","'",",","'reverse","'",")",",","]",")","The","``","from_dict","``","classmethod","is","similar",",","but","takes","a","dictionary","as","input","."]
code: def style_rules(self) -> list[tuple[str, str]]:
      return self._style_rules
  
imports: from __future__ import annotations
  import itertools
  import re
  from enum import Enum
  from typing import Hashable, TypeVar
  from prompt_toolkit.cache import SimpleCache
  from .base import ANSI_COLOR_NAMES, ANSI_COLOR_NAMES_ALIASES, DEFAULT_ATTRS, Attrs, BaseStyle
  from .named_colors import NAMED_COLORS
label_desc: Use image node_id 2 for calling the Style obj's underlying member method code with example usage: obj.style_rules() and returns: self