---------------------------------------------------------------------- This is the API documentation for the gdtest_ref_sectioned library. ---------------------------------------------------------------------- ## Constructors Create objects create_widget(name: str, width: int = 100) -> dict Create a new widget with the given name and width. Parameters ---------- name : str The name of the widget. width : int, optional The width of the widget in pixels, by default 100. Returns ------- dict A dictionary representing the created widget. Examples -------- >>> create_widget("button") {'name': 'button', 'width': 100} create_layout(orientation: str = 'horizontal') -> dict Create a new layout container. Parameters ---------- orientation : str, optional The layout orientation, by default "horizontal". Returns ------- dict A dictionary representing the created layout. Examples -------- >>> create_layout("vertical") {'orientation': 'vertical', 'children': []} ## Transformers Transform data resize(obj: dict, scale: float) -> dict Resize an object by the given scale factor. Parameters ---------- obj : dict The object to resize. scale : float The scale factor to apply. Returns ------- dict The resized object. Examples -------- >>> resize({"width": 100}, 0.5) {'width': 50.0} rotate(obj: dict, angle: float) -> dict Rotate an object by the given angle in degrees. Parameters ---------- obj : dict The object to rotate. angle : float The rotation angle in degrees. Returns ------- dict The rotated object with angle metadata. Examples -------- >>> rotate({"name": "box"}, 90.0) {'name': 'box', 'rotation': 90.0} ## Validators Validate input check_bounds(value: float, low: float, high: float) -> bool Check if a value is within the given bounds. Parameters ---------- value : float The value to check. low : float The lower bound (inclusive). high : float The upper bound (inclusive). Returns ------- bool True if the value is within bounds. Examples -------- >>> check_bounds(5.0, 0.0, 10.0) True check_type(obj: object, expected: type) -> bool Check if an object is of the expected type. Parameters ---------- obj : object The object to type-check. expected : type The expected type. Returns ------- bool True if the object matches the expected type. Examples -------- >>> check_type("hello", str) True ## Utilities Helper utils to_string(obj: object) -> str Convert an object to its string representation. Parameters ---------- obj : object The object to convert. Returns ------- str The string representation of the object. Examples -------- >>> to_string(42) '42' from_string(text: str) -> object Parse a string into a Python object. Parameters ---------- text : str The string to parse. Returns ------- object The parsed object, or the original string if parsing fails. Examples -------- >>> from_string("42") 42