from typing import Dict
from typing import List
from typing import OrderedDict


def order_dict(value: Dict, ordering: List, ignore_missing=False) -> OrderedDict:
    """
    Convert a dict to an OrderedDict with key order provided by ``ordering``.
    """
    new_value = OrderedDict()
    for elem in ordering:
        if elem in value:
            new_value[elem] = value[elem]
        elif not ignore_missing:
            new_value[elem] = None
    return new_value