def normalize_annotation_target_uris(annotation):
    if 'target' not in annotation:
        return
    if not isinstance(annotation['target'], list):
        return
    for target in annotation['target']:
        if not isinstance(target, dict):
            continue
        if 'source' not in target:
            continue
        if not isinstance(target['source'], string_types):
            continue
        target['scope'] = [uri.normalize(target['source'])]
dataset/ETHPy150Open hypothesis/h/h/api/transform.py/normalize_annotation_target_uris/original