<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_activity_form(self, activity_pattern, is_active):
 """Adds the pattern as an active or inactive form to an Agent. Parameters activity_pattern : dict A dictionary of site names and their states. is_active : bool Is True if the given pattern corresponds to an active state. """

        if is_active:
            if activity_pattern not in self.active_forms:
                self.active_forms.append(activity_pattern)
        else:
            if activity_pattern not in self.inactive_forms:
                self.inactive_forms.append(activity_pattern)