# Path: uqbar/strings.py
# def normalize(string: str) -> str:
#     """
#     Normalizes whitespace.
# 
#     Strips leading and trailing blank lines, dedents, and removes trailing
#     whitespace from the result.
#     """
#     string = string.replace("\t", "    ")
#     lines = string.split("\n")
#     while lines and (not lines[0] or lines[0].isspace()):
#         lines.pop(0)
#     while lines and (not lines[-1] or lines[-1].isspace()):
#         lines.pop()
#     for i, line in enumerate(lines):
#         lines[i] = line.rstrip()
#     string = "\n".join(lines)
#     string = textwrap.dedent(string)
#     return string


import unittest
import uqbar.graphs
from uqbar.strings import normalize
        uqbar.graphs.Attributes(mode="edge")
        uqbar.graphs.Attributes(mode="graph")
        uqbar.graphs.Attributes(mode="node")

    def test___format___str_01(self):
        attributes = uqbar.graphs.Attributes(mode="node")
        assert format(attributes) == repr(attributes)

    def test___format___str_02(self):
        attributes = uqbar.graphs.Attributes(
            mode="node",
            color="blue",
            fontname="Times New Roman",
            fontsize=11.5,
            shape="oval",
        )
        assert format(attributes) == repr(attributes)

    def test___format___graphviz_01(self):
        attributes = uqbar.graphs.Attributes(mode="node")
        assert format(attributes, "graphviz") == ""

    def test___format___graphviz_02(self):
        attributes = uqbar.graphs.Attributes(
            mode="node",
            color="blue",
            fontname="Times New Roman",
            fontsize=11.5,
            shape="oval",
        )

# Path: uqbar/strings.py
# def normalize(string: str) -> str:
#     """
#     Normalizes whitespace.
# 
#     Strips leading and trailing blank lines, dedents, and removes trailing
#     whitespace from the result.
#     """
#     string = string.replace("\t", "    ")
#     lines = string.split("\n")
#     while lines and (not lines[0] or lines[0].isspace()):
#         lines.pop(0)
#     while lines and (not lines[-1] or lines[-1].isspace()):
#         lines.pop()
#     for i, line in enumerate(lines):
#         lines[i] = line.rstrip()
#     string = "\n".join(lines)
#     string = textwrap.dedent(string)
#     return string


# Path: tests/test_graphs_Attributes.py
import unittest
import uqbar.graphs
from uqbar.strings import normalize

        uqbar.graphs.Attributes(mode="edge")
        uqbar.graphs.Attributes(mode="graph")
        uqbar.graphs.Attributes(mode="node")

    def test___format___str_01(self):
        attributes = uqbar.graphs.Attributes(mode="node")
        assert format(attributes) == repr(attributes)

    def test___format___str_02(self):
        attributes = uqbar.graphs.Attributes(
            mode="node",
            color="blue",
            fontname="Times New Roman",
            fontsize=11.5,
            shape="oval",
        )
        assert format(attributes) == repr(attributes)

    def test___format___graphviz_01(self):
        attributes = uqbar.graphs.Attributes(mode="node")
        assert format(attributes, "graphviz") == ""

    def test___format___graphviz_02(self):
        attributes = uqbar.graphs.Attributes(
            mode="node",
            color="blue",
            fontname="Times New Roman",
            fontsize=11.5,
            shape="oval",
        )

        assert format(attributes, "graphviz") == normalize(