def format_class(attrs: dict[str, Any] | None, classname: str = "__args") -> str:
    """
    Generates source for a python class with the entries of the given dictionary
    represented as class attributes. Output is a one-liner.

    If no attributes are provided for the class then return an empty string.
    """
    if attrs is None:
        return ""
    return (
        f'{classname}=type("{classname}",(object,),'
        "{" + ",".join(f"{name!r}:{value!r}" for name, value in attrs.items()) + "});"
    )

    Generates source for a python class with the entries of the given dictionary
    represented as class attributes. Output is a one-liner.

    If no attributes are provided for the class then return an empty string.
    
poethepoet/helpers/python.py