import json


def _transform_request(request: bytes) -> dict:
    """
    Transform bytes posted to the api into a python dictionary containing
    the resource routes by tag and weight

    :param bytes request:   containing the payload to supply to the predict method

    :return:                dict containing the resource routes by tag and weight
    """
    return dict(json.loads(request.decode('utf-8'))['resource_split_tag_and_weight_dict'])