import json


def str_or_json_loads(string):
    """
    Try to convert the string into a list or a dict if it contains [ or {.

    :param string:

    :raises ValueError:

    :return: the list or dict from the string, or the original string
    """

    try:
        if "[" in string or "{" in string:
            return json.loads(string)
        else:
            return string
    except json.decoder.JSONDecodeError as e:
        raise ValueError(str(e))