code: def _legacy_index() -> Union[None, Dict[str, str]]:
      
      for index in _LEGACY_INDICES:
          if index.exists():
              try:
                  return json.load(open(index))
              except (OSError, json.JSONDecodeError):
                  return None
      return None
docs: 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.