def METHOD_NAME(arg, enforce_type):
    # Cast the arg to be either a list or a tuple
    if enforce_type is not None:
        if (enforce_type == list) and (not isinstance(arg, list)):
            arg = list(arg)
        elif (enforce_type == tuple) and (not isinstance(arg, tuple)):
            arg = tuple(arg)
        elif enforce_type not in (list, tuple):
            raise TypeError('enforce_type should be None, "list" or "tuple", but is {}'.format(enforce_type))
    return arg