def METHOD_NAME(sort):
    if sort is None:
        return []
    elif isinstance(sort, str):
        sort = [sort]
    if isinstance(sort, list):
        if len(sort) > 0 and not isinstance(sort[0], list):
            sort = [sort]
        ret = []
        for col, s in sort:
            if isinstance(s, Sort):
                s = s.value
            elif not isinstance(s, str) or s not in Sort.options():
                raise PerspectiveError("Unrecognized sort direction: %s", s)
            ret.append([col, s])
        return ret
    else:
        raise PerspectiveError("Cannot parse sort type: %s", str(type(sort)))