sob/model.py
def _init_format(
        self,
        data: Union[
            str,
            bytes,
            abc.Readable,
            Mapping[str, abc.MarshallableTypes],
            Iterable[abc.MarshallableTypes],
            abc.Model,
            None,
        ] = None,
    ) -> Union[
        Iterable[abc.MarshallableTypes],
        Mapping[str, abc.MarshallableTypes],
        abc.Model,
        None,
    ]:
        """
        This function deserializes raw JSON or YAML and remembers what format
        that data came in.
        """
        deserialized_data: Union[
            Iterable[abc.MarshallableTypes],
            Mapping[str, abc.MarshallableTypes],
            abc.Model,
            None,
        ]
        if isinstance(data, (str, bytes, abc.Readable)):
            format_: str
            data_read: abc.JSONTypes
            data_read, format_ = detect_format(data)
            try:
                assert isinstance(data_read, (Iterable, Mapping, abc.Model))
            except AssertionError:
                raise IsInstanceAssertionError(
                    "data_read", data_read, (Iterable, Mapping, abc.Model)
                )
            deserialized_data = data_read
            if format_ is not None:
                meta.set_format(self, format_)
        else:
            assert_is_instance(
                "data",
                data,
                (
                    Iterable,
                    Mapping,
                    abc.Model,
                    NoneType,
                ),
            )
            deserialized_data = data
        return deserialized_data

        This function deserializes raw JSON or YAML and remembers what format
        that data came in.
        
This function deserializes raw JSON or YAML and remembers what format
that data came in.
This function deserializes raw JSON or YAML and remembers what format that data came in .
def _init_format(
        self,
        data: Union[
            str,
            bytes,
            abc.Readable,
            Mapping[str, abc.MarshallableTypes],
            Iterable[abc.MarshallableTypes],
            abc.Model,
            None,
        ] = None,
    ) -> Union[
        Iterable[abc.MarshallableTypes],
        Mapping[str, abc.MarshallableTypes],
        abc.Model,
        None,
    ]:
        deserialized_data: Union[
            Iterable[abc.MarshallableTypes],
            Mapping[str, abc.MarshallableTypes],
            abc.Model,
            None,
        ]
        if isinstance(data, (str, bytes, abc.Readable)):
            format_: str
            data_read: abc.JSONTypes
            data_read, format_ = detect_format(data)
            try:
                assert isinstance(data_read, (Iterable, Mapping, abc.Model))
            except AssertionError:
                raise IsInstanceAssertionError(
                    "data_read", data_read, (Iterable, Mapping, abc.Model)
                )
            deserialized_data = data_read
            if format_ is not None:
                meta.set_format(self, format_)
        else:
            assert_is_instance(
                "data",
                data,
                (
                    Iterable,
                    Mapping,
                    abc.Model,
                    NoneType,
                ),
            )
            deserialized_data = data
        return deserialized_data
def _init_format ( self , data : Union [ str , bytes , abc . Readable , Mapping [ str , abc . MarshallableTypes ] , Iterable [ abc . MarshallableTypes ] , abc . Model , None , ] = None , ) -> Union [ Iterable [ abc . MarshallableTypes ] , Mapping [ str , abc . MarshallableTypes ] , abc . Model , None , ] : deserialized_data : Union [ Iterable [ abc . MarshallableTypes ] , Mapping [ str , abc . MarshallableTypes ] , abc . Model , None , ] if isinstance ( data , ( str , bytes , abc . Readable ) ) : format_ : str data_read : abc . JSONTypes data_read , format_ = detect_format ( data ) try : assert isinstance ( data_read , ( Iterable , Mapping , abc . Model ) ) except AssertionError : raise IsInstanceAssertionError ( "data_read" , data_read , ( Iterable , Mapping , abc . Model ) ) deserialized_data = data_read if format_ is not None : meta . set_format ( self , format_ ) else : assert_is_instance ( "data" , data , ( Iterable , Mapping , abc . Model , NoneType , ) , ) deserialized_data = data return deserialized_data
This function deserializes raw JSON or YAML and remembers what format
that data came in.
This function deserializes raw JSON or YAML and remembers what format that data came in .
"""
        This function deserializes raw JSON or YAML and remembers what format
        that data came in.
        """
self
data
Union[
            str,
            bytes,
            abc.Readable,
            Mapping[str, abc.MarshallableTypes],
            Iterable[abc.MarshallableTypes],
            abc.Model,
            None,
        ]