def set_field(
        self,
        field_name,
        value,
        create=True,
        validate=True,
        dynamic=False,
    ):
        """Sets the value of a field of the document.

        Args:
            field_name: the field name
            value: the field value
            create (True): whether to create the field if it does not exist
            validate (True): whether to validate values for existing fields
            dynamic (False): whether to declare dynamic embedded document
                fields

        Raises:
            ValueError: if ``field_name`` is not an allowed field name
            AttributeError: if the field does not exist and ``create == False``
        """
        self._doc.set_field(
            field_name,
            value,
            create=create,
            validate=validate,
            dynamic=dynamic,
        )
Sets the value of a field of the document.

        Args:
            field_name: the field name
            value: the field value
            create (True): whether to create the field if it does not exist
            validate (True): whether to validate values for existing fields
            dynamic (False): whether to declare dynamic embedded document
                fields

        Raises:
            ValueError: if ``field_name`` is not an allowed field name
            AttributeError: if the field does not exist and ``create == False``
        
fiftyone/core/document.py