<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _dict_mapping_to_pb(mapping, proto_type):
 """ Convert a dict to protobuf. Args: mapping (dict):
 A dict that needs to be converted to protobuf. proto_type (str):
 The type of the Protobuf. Returns: An instance of the specified protobuf. """

    converted_pb = getattr(trace_pb2, proto_type)()
    ParseDict(mapping, converted_pb)
    return converted_pb