<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _combine_attribute_arguments(self, attr_dict, attr):
 # Note: Code & comments unchanged from DirectedHypergraph """Combines attr_dict and attr dictionaries, by updating attr_dict with attr. :param attr_dict: dictionary of attributes of the node. :param attr: keyword arguments of attributes of the node; attr's values will override attr_dict's values if both are provided. :returns: dict -- single dictionary of [combined] attributes. :raises: AttributeError -- attr_dict argument must be a dictionary. """

        # If no attribute dict was passed, treat the keyword
        # arguments as the dict
        if attr_dict is None:
            attr_dict = attr
        # Otherwise, combine the passed attribute dict with
        # the keyword arguments
        else:
            try:
                attr_dict.update(attr)
            except AttributeError:
                raise AttributeError("attr_dict argument \
                                     must be a dictionary.")
        return attr_dict