def download_targets_data(targets_url=None):
    """
    Download REP 3 targets file and unmarshal from YAML.
    DEPRECATED: this function is deprecated. List of targets should be obtained
                from the rosdistro module.
                The body of this function is an example.

    :param target_url: override URL of platform targets file. Defaults
      to ``REP3_TARGETS_URL``.
    :raises: :exc:`DownloadFailure`
    :raises: :exc:`InvalidData` If targets file does not pass cursory validation checks.
    """
    warnings.warn("deprecated, use rosdistro instead", PreRep137Warning)

    if targets_url is None:
        targets_url = REP3_TARGETS_URL
    try:
        f = urlopen(targets_url, timeout=DOWNLOAD_TIMEOUT)
        text = f.read()
        f.close()
        targets_data = yaml.safe_load(text)
    except Exception as e:
        raise DownloadFailure((str(e))%"Failed to download target platform data for gbpdistro:\n\t%s")
    if type(targets_data) == list:
        # convert to dictionary
        new_targets_data = {}
        for t in targets_data:
            platform = list(t.keys())[0]
            new_targets_data[platform] = t[platform]
        targets_data = new_targets_data
    return targets_data
dataset/ETHPy150Open ros-infrastructure/rosdep/src/rosdep2/rep3.py/download_targets_data/swapped operands of `%`