<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def iiif_image_key(obj):
 """Generate the IIIF image key."""

    if isinstance(obj, ObjectVersion):
        bucket_id = obj.bucket_id
        version_id = obj.version_id
        key = obj.key
    else:
        bucket_id = obj.get('bucket')
        version_id = obj.get('version_id')
        key = obj.get('key')
    return u'{}:{}:{}'.format(
        bucket_id,
        version_id,
        key,
    )