import typing
import json


def safe_fromjson(data_bytes: bytes) -> typing.Optional[typing.Any]:
    """Convert bytes to a python data structure.

    Convert json code in byte form, typically received from a QAI request,
    into a data struct which we return.

    Args:
       data_bytes: in the input JSON bytes
    Returns:
       The converted python data structure upon successful conversion.
       None is returned if an error occurred during conversion.
    """
    try:
        return json.loads(data_bytes)
    except json.decoder.JSONDecodeError:
        return None