def METHOD_NAME(sorted_keys: ZoneKey, datapoint: dict) -> Union[int, float, None]:
    """
    Helper function to extract the net flow from a datapoint.
    """
    if sorted_keys == "DK-DK2->SE-SE4":
        # Exchange from Bornholm to Sweden is included in "ExchangeSweden"
        # but Bornholm island is reported separately from DK-DK2 in Electricity Maps
        return (
            datapoint[EXCHANGE_MAPPING["DK-DK2->SE-SE4"]["id"]]
            * EXCHANGE_MAPPING["DK-DK2->SE-SE4"]["direction"]
            - datapoint[EXCHANGE_MAPPING["DK-BHM->SE-SE4"]["id"]]
            * EXCHANGE_MAPPING["DK-BHM->SE-SE4"]["direction"]
            if datapoint[EXCHANGE_MAPPING["DK-BHM->SE-SE4"]["id"]] is not None
            and datapoint[EXCHANGE_MAPPING["DK-DK2->SE-SE4"]["id"]] is not None
            else None
        )
    else:
        return (
            datapoint[EXCHANGE_MAPPING[sorted_keys]["id"]]
            * EXCHANGE_MAPPING[sorted_keys]["direction"]
            if datapoint[EXCHANGE_MAPPING[sorted_keys]["id"]]
            else None
        )