def METHOD_NAME(obj,digits):
    if isinstance(obj,float):
        return round(obj,digits)
    elif isinstance(obj,list):
        for i in xrange(len(obj)):
            obj[i] = METHOD_NAME(obj[i],digits)
    elif isinstance(obj,tuple):
        return [METHOD_NAME(val,digits) for val in obj]
    elif isinstance(obj,dict):
        for i,v in obj.iteritems():
            obj[i] = METHOD_NAME(v,digits)
    return obj