'Tests if Free Group element ``g`` belong to self, ``G``.
In mathematical terms any linear combination of generators
of a Free Group is contained in it.
Examples
>>> from sympy.combinatorics.free_groups import free_group
>>> f, x, y, z = free_group("x y z")
>>> f.contains(x**3*y**2)
True'

def contains(self, g):

    if (not isinstance(g, FreeGroupElement)):
        return False
    elif (self != g.group):
        return False
    else:
        return True
