'Return True if ``i`` is contained in FreeGroup.'

def __contains__(self, i):

    if (not isinstance(i, FreeGroupElement)):
        raise TypeError(('FreeGroup    contains    only    FreeGroupElement    as    elements    ,    not    elements    of    type    %s' % type(i)))
    group = i.group
    return (self == group)
