def METHOD_NAME(self, variable):
    res = {"type": "variable", "ctype": todict(variable.ctype), "name": variable.c_name()}
    if variable.source_library:
        res["source"] = variable.source_library
    return res