def string2list(liststr):
    """Creates a list from a string formatted list.
    
    Keyword arguments:
    liststr -- string such as "(label1, label2, ...)" or "label1, label2, ..."
 
    """
    replacements = {"(":"", ")":"", "[":"", "]":""}
    stripped_liststr = "".join([replacements.get(c, c) for c in liststr])
    no_whitespace_str = "".join(stripped_liststr.split())
    return list(no_whitespace_str.split(","))