#NEWLINE# def make_tagged( items , tags , startag ) : #NEWLINE# #INDENT# ' Create a Tagged object for the given items.\n\n    Parameters\n    ----------\n    items : list\n        The list of objects which should be tagged.\n\n    tags : tuple\n        A tuple of string tag names. This should be an empty tuple if\n        no named tags are available.\n\n    startag : str\n        The star tag name. This should be an empty string if there is\n        no star tag available.\n\n    Returns\n    -------\n    result : Tagged\n        The tagged object for the given items.\n\n    ' #NEWLINE# if ( tags and ( len ( tags ) > len ( items ) ) ) : #NEWLINE# #INDENT# msg = 'need more than %d values to unpack' #NEWLINE# raise ValueError ( ( msg % len ( items ) ) ) #NEWLINE# #UNINDENT# if ( tags and ( not startag ) and ( len ( items ) > len ( tags ) ) ) : #NEWLINE# #INDENT# raise ValueError ( 'too many values to unpack' ) #NEWLINE# #UNINDENT# tagged = Tagged ( ) #NEWLINE# if tags : #NEWLINE# #INDENT# for ( name , item ) in zip ( tags , items ) : #NEWLINE# #INDENT# tagged [ name ] = item #NEWLINE# #UNINDENT# #UNINDENT# if startag : #NEWLINE# #INDENT# tagged [ startag ] = tuple ( items [ len ( tags ) : ] ) #NEWLINE# #UNINDENT# return msg