<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _build_request(request):
 """Build message to transfer over the socket from a request."""

    msg = bytes([request['cmd']])
    if 'dest' in request:
        msg += bytes([request['dest']])
    else:
        msg += b'\0'
    if 'sha' in request:
        msg += request['sha']
    else:
        for dummy in range(64):
            msg += b'0'
    logging.debug("Request (%d): %s", len(msg), msg)
    return msg