<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def check_media_service_name_availability(access_token, subscription_id, msname):
    '''Check media service name availability.

    Args:
        access_token (str): A valid Azure authentication token.
        subscription_id (str): Azure subscription id.
        msname (str): media service name.

    Returns:
        HTTP response.
    '''
    endpoint = ''.join([get_rm_endpoint(),
                        '/subscriptions/', subscription_id,
                        '/providers/microsoft.media/CheckNameAvailability?',
                        'api-version=', MEDIA_API])
    ms_body = {'name': msname}
    ms_body['type'] = 'mediaservices'
    body = json.dumps(ms_body)
    return do_post(endpoint, body, access_token)