pytest_wdl/providers/dx.py
def format_value(
        self, value: Any, path: Tuple[str, ...], nested: bool = False
    ) -> Tuple[Any, bool]:
        """
        Convert a primitive, DataFile, Sequence, or Dict to a JSON-serializable object.
        Currently, arbitrary objects can be serialized by implementing an `as_dict()`
        method, otherwise they are converted to strings.

        Args:
            value: The value to format.
            path: The path to the current value.
            nested: Whether the value is nested within a complex type

        Returns:
            The tuple `(val, is_complex)`, where `val` is serializable value and
            `is_complex` is True if the value is a complex type.
        """
        if hasattr(value, "as_dict"):
            return value.as_dict(), True

        if isinstance(value, DataFile):
            return self._format_data_file(cast(DataFile, value)), False

        if isinstance(value, Sequence) and not isinstance(value, str):
            return (
                self._format_sequence(cast(Sequence, value), path, nested=nested),
                True
            )

        if isinstance(value, dict):
            return self._format_dict(cast(dict, value), path, nested=nested), True

        return value, False

        Convert a primitive, DataFile, Sequence, or Dict to a JSON-serializable object.
        Currently, arbitrary objects can be serialized by implementing an `as_dict()`
        method, otherwise they are converted to strings.

        Args:
            value: The value to format.
            path: The path to the current value.
            nested: Whether the value is nested within a complex type

        Returns:
            The tuple `(val, is_complex)`, where `val` is serializable value and
            `is_complex` is True if the value is a complex type.
        
Convert a primitive, DataFile, Sequence, or Dict to a JSON-serializable object.
Currently, arbitrary objects can be serialized by implementing an `as_dict()`
method, otherwise they are converted to strings.
Convert a primitive DataFile Sequence or Dict to a JSON - serializable object . Currently arbitrary objects can be serialized by implementing an ` as_dict () ` method otherwise they are converted to strings .
def format_value(
        self, value: Any, path: Tuple[str, ...], nested: bool = False
    ) -> Tuple[Any, bool]:
        if hasattr(value, "as_dict"):
            return value.as_dict(), True
        if isinstance(value, DataFile):
            return self._format_data_file(cast(DataFile, value)), False
        if isinstance(value, Sequence) and not isinstance(value, str):
            return (
                self._format_sequence(cast(Sequence, value), path, nested=nested),
                True
            )
        if isinstance(value, dict):
            return self._format_dict(cast(dict, value), path, nested=nested), True
        return value, False
def format_value ( self , value : Any , path : Tuple [ str , ... ] , nested : bool = False ) -> Tuple [ Any , bool ] : if hasattr ( value , "as_dict" ) : return value . as_dict ( ) , True if isinstance ( value , DataFile ) : return self . _format_data_file ( cast ( DataFile , value ) ) , False if isinstance ( value , Sequence ) and not isinstance ( value , str ) : return ( self . _format_sequence ( cast ( Sequence , value ) , path , nested = nested ) , True ) if isinstance ( value , dict ) : return self . _format_dict ( cast ( dict , value ) , path , nested = nested ) , True return value , False
Convert a primitive, DataFile, Sequence, or Dict to a JSON-serializable object.
Convert a primitive DataFile Sequence or Dict to a JSON - serializable object .
"""
        Convert a primitive, DataFile, Sequence, or Dict to a JSON-serializable object.
        Currently, arbitrary objects can be serialized by implementing an `as_dict()`
        method, otherwise they are converted to strings.

        Args:
            value: The value to format.
            path: The path to the current value.
            nested: Whether the value is nested within a complex type

        Returns:
            The tuple `(val, is_complex)`, where `val` is serializable value and
            `is_complex` is True if the value is a complex type.
        """
The tuple `(val, is_complex)`, where `val` is serializable value and
`is_complex` is True if the value is a complex type.
The tuple ` ( val is_complex ) ` where ` val ` is serializable value and ` is_complex ` is True if the value is a complex type .
self
value
Any
The value to format.
The value to format .
path
Tuple[str, ...]
The path to the current value.
The path to the current value .
nested
bool
Whether the value is nested within a complex type
Whether the value is nested within a complex type