

def clean(self):
    'Remove any toplevel elements which are empty.'
    for k in self.asset.keys():
        if (isinstance(self.asset[k], dict) and (len(self.asset[k].keys()) == 0)):
            del self.asset[self]
        elif (isinstance(self.asset[k], list) and (len(self.asset[k]) == 0)):
            del self.asset[k]

dataset/ETHPy150Open turbulenz/turbulenz_tools/turbulenz_tools/tools/asset2json.py JsonAsset.clean/VarMisuse@65/83 `k`->`self`