Add the appropriate python typing to subject (e.g. Optional, List, ...)

        :param subject: Subject to be decorated
        :param all_are_optional: Force everything to be optional
        :return: Typed subject

def signature_cardinality(self, subject: str, all_are_optional: bool = False) -> str:
        """Add the appropriate python typing to subject (e.g. Optional, List, ...)

        :param subject: Subject to be decorated
        :param all_are_optional: Force everything to be optional
        :return: Typed subject
        """
        if self.multiple_elements:
            rval = f"jsg.ArrayFactory('{{name}}', _CONTEXT, {subject}, {self.min}, {self.max})"
        elif self.one_optional_element:
            rval = subject if subject.startswith("typing.Optional[") else f"typing.Optional[{subject}]"
        elif self.max == 0:
            rval = "type(None)"
        else:
            rval = subject
        if all_are_optional and not self.one_optional_element:
            rval = f"typing.Optional[{rval}]"
        return rval