<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def member_of(self, group):
 """Returns whether a user is a member of a certain group. Args: group The name of a group (string) or a group object Returns: Boolean """

        if isinstance(group, Group):
            group = group.name
        return self.groups.filter(name=group).exists()