<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _clean_string(v, sinfo):
 """Test for and clean unicode present in template CSVs. """

    if isinstance(v, (list, tuple)):
        return [_clean_string(x, sinfo) for x in v]
    else:
        assert isinstance(v, six.string_types), v
        try:
            if hasattr(v, "decode"):
                return str(v.decode("ascii"))
            else:
                return str(v.encode("ascii").decode("ascii"))
        except UnicodeDecodeError as msg:
            raise ValueError("Found unicode character in template CSV line %s:\n%s" % (sinfo, str(msg)))