def get_url_from_image_key(image_instance, image_key):
    """Build a URL from `image_key`."""
    img_key_split = image_key.split('__')
    if img_key_split[-1] in 'x':
        size_key = img_key_split.pop(-1)
    else:
        size_key = None
    img_url = reduce(getattr, img_key_split, image_instance)
    if size_key:
        img_url = img_url[size_key].url
    return img_url
dataset/ETHPy150Open WGBH/django-versatileimagefield/versatileimagefield/utils.py/get_url_from_image_key/swapped operands of `in`