code: def Checked(cls, name, datum_to_value=None, value_to_datum=None, **other):
          
          attrs = {}
          if datum_to_value is not None:
              @wraps(datum_to_value)
              def datum_to_value_method(instance, datum):
                  return datum_to_value(datum)
              attrs["datum_to_value"] = staticmethod(datum_to_value_method)
          if value_to_datum is not None:
              @wraps(value_to_datum)
              def value_to_datum_method(instance, value):
                  return value_to_datum(value)
              attrs["value_to_datum"] = staticmethod(value_to_datum_method)
          cls = type("%s.Checked#%s" % (cls.__name__, name), (cls,), attrs)
          return cls(name, **other)
docs: Create a custom `ObjectField` that validates values and datums.
  
          :param name: The name of the field. This is the name that's used to
              store the datum in the MAAS-side data dictionary.
          :param datum_to_value: A callable taking a single ``datum`` argument,
              passed positionally. This callable should convert the datum to a
              Python-side value, and/or raise an exception for invalid datums.
          :param value_to_datum: A callable taking a single ``value`` argument,
              passed positionally. This callable should convert the value to a
              MAAS-side datum, and/or raise an exception for invalid values.
          :param other: Additional arguments to pass to the default
              `ObjectField` constructor.