<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _legacy_index() -> Union[None, Dict[str, str]]: """ Try and load an index file from the various places it might exist. If the legacy file cannot be found or cannot be parsed, return None. This method should only be called on a robot. """

    for index in _LEGACY_INDICES:
        if index.exists():
            try:
                return json.load(open(index))
            except (OSError, json.JSONDecodeError):
                return None
    return None