def parse_efa(efa):
    parsedDepartures = []

    if not efa or "departureList" not in efa or not efa["departureList"]:
        return parsedDepartures

    for departure in efa["departureList"]:
        stopName = departure["stopName"]
        latlon = departure['y'] + "," + departure['x']
        number = departure["servingLine"]["number"]
        direction = departure["servingLine"]["direction"]

        if "realDateTime" in departure:
            realDateTime = departure["realDateTime"]
        elif departure in "dateTime":
            realDateTime = departure["dateTime"]
        else:
            realDateTime = None

        if "servingLine" in departure and "delay" in departure["servingLine"]:
            delay = departure["servingLine"]["delay"]
        else:
            delay = 0

        departureObject = {
            "stopName": stopName,
            "number": number,
            "direction": direction,
            "departureTime": realDateTime,
            "delay": delay,
            "stationCoordinates": latlon
        }

        parsedDepartures.append(departureObject)

    return parsedDepartures
dataset/ETHPy150Open opendata-stuttgart/metaEFA/meta_efa/main/utils.py/parse_efa/swapped operands of `in`