@classmethod
def preprocess(cls, gens):
    if isinstance(gens, Basic):
        gens = (gens,)
    elif ((len(gens) == 1) and hasattr(gens[0], '__iter__')):
        gens = gens[0]
    if (gens == (None,)):
        gens = ()
    elif has_dups(gens):
        raise GeneratorsError(('duplicated generators: %s' % str(gens)))
    elif any(((gen.is_commutative is False) for gen in gens)):
        raise GeneratorsError(('non-commutative generators: %s' % str(gens)))
    return tuple(gens)
@classmethod
def preprocess(cls, gens):
    if isinstance(gens, Basic):
        gens = (gens,)
    elif ((len(gens) == 1) and hasattr(gens[0], '__iter__')):
        gens = gens[0]
    if (gens == (None,)):
        gens = ()
    elif has_dups(gens):
        raise GeneratorsError(('duplicated generators: %s' % str(gens)))
    elif any(((gen.is_commutative is False) for gen in gens)):
        raise GeneratorsError(('non-commutative generators: %s' % str(gens)))
    return tuple(gens)