<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_flags(self, user=None, status=None):
 """Returns flags for the object optionally filtered by status. :param User user: Optional user filter :param int status: Optional status filter :rtype: QuerySet """

        filter_kwargs = {}
        update_filter_dict(filter_kwargs, user, status)
        return self.flags.filter(**filter_kwargs).all()