code: def mark_typed_map(self, name, type_object):
          if not hasattr(type_object, 'dump'):
              raise ArgumentError("The passed type object %s is missing required method: dump()" % type_object)
          if not hasattr(type_object, 'Restore'):
              raise ArgumentError("The passed type object %s is missing required method: Restore()" % type_object)
          def _dump_map(obj):
              if obj is None:
                  return None
              if not isinstance(obj, dict):
                  raise DataError("Property %s marked as list was not a dict: %s" % (name, repr(obj)))
              return {key: val.dump() for key, val in obj.items()}
          def _restore_map(obj):
              if obj is None:
                  return obj
              return {key: type_object.Restore(val) for key, val in obj.items()}
          self.mark_complex(name, _dump_map, _restore_map)