def get_groups_for_user(self, user_name):
        user = self.get_user(user_name)
        groups = []
        for group in self.list_groups():
            if user in group.users:
                groups.append(group)

        return groups
dataset/ETHPy150Open spulec/moto/moto/iam/models.py/IAMBackend.get_groups_for_user/original