def mark(obj, map_class=Map, sequence_class=Sequence):
 if isinstance(obj, Aggregate):
  return obj
 if isinstance(obj, dict):
  return map_class(obj)
 if isinstance(obj, (list, tuple, set)):
  return sequence_class(obj)
 else:
  return sequence_class([obj])

def mark ( obj , map_class = Map , sequence_class = Sequence ) : if isinstance ( obj , Aggregate ) : return obj if isinstance ( obj , dict ) : return map_class ( obj ) if isinstance ( obj , ( list , tuple , set ) ) : return sequence_class ( obj ) else : return sequence_class ( [ obj ] )
convert obj into an aggregate instance .