def METHOD_NAME(obj, key):
    name, _, key = key.partition("[")
    obj = obj[name]
    while "[" in key:
        name, _, key = key.partition("[")
        obj = obj[name.strip("\"']")]
    return obj, key.strip("\"']")