def from_ir(base):
    """Convert instances of ir base classes to instances of py_dataclass subclasses
    This is very hacky, and relies on all base classes in ir having equivalents in this module with the same name.
    """
    class_name = base.__class__.__name__
    local_equivalent = globals()[class_name]
    new = local_equivalent.from_ir(base)
    return new
