import requests


def get_command(server_address, source_space, target_space):
    """Gets the image transform commmand from the server
    """
    request_string = \
        f'{server_address}/v1/'\
        f'get-image-transform-command?source_space={source_space}'\
        f'&target_space={target_space}&input_coords=auto'
    response = requests.get(request_string)
    response.raise_for_status()
    return response.json()['transform_command']