def maybe_encode(value):
    """
    If value is a sequence of strings, encode it
    """
    if isinstance(value, (list, tuple)) and isinstance(value[0], str):
        return encode(value)
    return value
If value is a sequence of strings, encode it