code: def test_style_from_dict():
      style = Style.from_dict(
          {
              "a": "#ff0000 bold underline strike italic",
              "b": "bg:#00ff00 blink reverse",
          }
      )
  
      # Lookup of class:a.
      expected = Attrs(
          color="ff0000",
          bgcolor="",
          bold=True,
          underline=True,
          strike=True,
          italic=True,
          blink=False,
          reverse=False,
          hidden=False,
      )
      assert style.get_attrs_for_style_str("class:a") == expected
  
      # Lookup of class:b.
      expected = Attrs(
          color="",
          bgcolor="00ff00",
          bold=False,
          underline=False,
          strike=False,
          italic=False,
          blink=True,
          reverse=True,
          hidden=False,
      )
      assert style.get_attrs_for_style_str("class:b") == expected
  
      # Test inline style.
      expected = Attrs(
          color="ff0000",
          bgcolor="",
          bold=False,
          underline=False,
          strike=False,
          italic=False,
          blink=False,
          reverse=False,
          hidden=False,
      )
      assert style.get_attrs_for_style_str("#ff0000") == expected
  
      # Combine class name and inline style (Whatever is defined later gets priority.)
      expected = Attrs(
          color="00ff00",
          bgcolor="",
          bold=True,
          underline=True,
          strike=True,
          italic=True,
          blink=False,
          reverse=False,
          hidden=False,
      )
      assert (
          style.get_attrs_for_style_str("class:a #00ff00") == expected
      )
  
      expected = Attrs(
          color="ff0000",
          bgcolor="",
          bold=True,
          underline=True,
          strike=True,
          italic=True,
          blink=False,
          reverse=False,
          hidden=False,
      )
      assert (
          style.get_attrs_for_style_str("#00ff00 class:a") == expected
      )
  
imports: from __future__ import annotations
  from prompt_toolkit.styles import Attrs, Style, SwapLightAndDarkStyleTransformation
label_desc: Use image node_id 1 for calling a global function with example usage: test_style_from_dict() without return types