def _variablesToArray(variables, name=''):
    if isinstance(variables,basestring):
        if variables == "*":
            return None
        else:
            return [variables]

    elif isinstance(variables,Variable):
        return [variables]

    elif type(variables) == list or type(variables) == tuple:
        retval = []
        for s in variables:
            if isinstance(s, basestring):
                retval.append(s)
            elif isinstance(s, Variable):
                retval.append(s)
            else:
                raise SPARQLError(
                    "illegal type in '%s'; must be a string, unicode, or a Variable" % name)

    else :
        raise SPARQLError(
            "'%s' argument must be a string, a Variable, or a list of those" % name)

    return retval
teardown once
dataset/ETHPy150Open RDFLib/rdfextras/rdfextras/sparql/query.py/_variablesToArray--crossover with--dataset/ETHPy150Open eoyilmaz/anima/tests/ui/test_version_creator.py/VersionCreatorTester.tearDownClass