def identify_request(request: RequestType) -> bool:
    """
    Try to identify whether this is an ActivityPub request.
    """
    # noinspection PyBroadException
    try:
        data = json.loads(decode_if_bytes(request.body))
        if "@context" in data:
            return True
    except Exception:
        pass
    return False
def identify_request ( request : RequestType ) -> bool : try : data = json . loads ( decode_if_bytes ( request . body ) ) if "@context" in data : return True except Exception : pass return False
Try to identify whether this is an ActivityPub request.