from typing import Sequence


def listify(x):
    """
    Returns [x] if x is not already a list.

    Used to make functions accept either scalar or array inputs -
    simply `listify` a variable to make sure it's in list format.
    """
    if (not isinstance(x, str)) and isinstance(x, Sequence):
        return x
    else:
        return [x]