def add_action(self, actor, action, date, type=None, committees=None,<EOL>legislators=None, **kwargs):
def _cleanup_list(obj, default):<EOL><INDENT>if not obj:<EOL><INDENT>obj = default<EOL><DEDENT>elif isinstance(obj, string_types):<EOL><INDENT>obj = [obj]<EOL><DEDENT>elif not isinstance(obj, list):<EOL><INDENT>obj = list(obj)<EOL><DEDENT>return obj<EOL><DEDENT>type = _cleanup_list(type, ['<STR_LIT>'])<EOL>committees = _cleanup_list(committees, [])<EOL>legislators = _cleanup_list(legislators, [])<EOL>if '<STR_LIT>' in kwargs:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if isinstance(committees, string_types):<EOL><INDENT>committees = [committees]<EOL><DEDENT>related_entities = []         <EOL>for committee in committees:<EOL><INDENT>related_entities.append({<EOL>"<STR_LIT:type>": "<STR_LIT>",<EOL>"<STR_LIT:name>": committee<EOL>})<EOL><DEDENT>for legislator in legislators:<EOL><INDENT>related_entities.append({<EOL>"<STR_LIT:type>": "<STR_LIT>",<EOL>"<STR_LIT:name>": legislator<EOL>})<EOL><DEDENT>self['<STR_LIT>'].append(dict(actor=actor, action=action,<EOL>date=date, type=type,<EOL>related_entities=related_entities,<EOL>**kwargs))<EOL>
Add an action that was performed on this bill.

:param actor: a string representing who performed the action.
  If the action is associated with one of the chambers this
  should be 'upper' or 'lower'. Alternatively, this could be
  the name of a committee, a specific legislator, or an outside
  actor such as 'Governor'.
:param action: a string representing the action performed, e.g.
               'Introduced', 'Signed by the Governor', 'Amended'
:param date: the date/time this action was performed.
:param type: a type classification for this action
;param committees: a committee or list of committees to associate with
                   this action