'Returns the index of the generator `gen` from ``(f_0, ..., f_(n-1))``.
Examples
>>> from sympy.combinatorics.free_groups import free_group
>>> F, x, y = free_group("x, y")
>>> F.index(y)
1'

def index(self, gen):

    if isinstance(gen, self.dtype):
        return self.generators.index(gen)
    else:
        raise ValueError(('expected    a    generator    of    Free    Group    %s,    got    %s' % (self, gen)))
