def METHOD_NAME(items, value):
    """
    Converts a list into a dict.
    """
    key = items.pop()
    result = {}
    bracket_index = key.find("[")
    if bracket_index > 0:
        value = [value]
    result[key] = value
    if items:
        result = METHOD_NAME(items, result)
    return result