def METHOD_NAME(dim):
    if isinstance(dim, jaxtyping.array_types._NamedVariadicDim):
        return "..."
    elif isinstance(dim, jaxtyping.array_types._FixedDim):
        res = str(dim.size)
        if dim.broadcastable:
            res = "#" + res
        return res
    elif isinstance(dim, jaxtyping.array_types._SymbolicDim):
        expr = code_deparse(dim.expr).text.strip().split("return ")[1]
        return f"({expr})"
    elif "jaxtyping" not in str(dim.__class__):  # Probably the case that we have an ellipsis
        return "..."
    else:
        res = str(dim.name)
        if dim.broadcastable:
            res = "#" + res
        return res