def listor(sub_validator):
    def _validate(value):
        return [sub_validator(val) for val in (value if isinstance(value, list) else [value])]
    return _validate
Like d3.functor for lists
dataset/ETHPy150Open memsql/memsql-loader/memsql_loader/api/validation.py/listor