def reorder_correlator_inputs(input_map, corr_inputs):
    """Sort a list of correlator inputs into the order given in input map.

    Parameters
    ----------
    input_map : np.ndarray
        Index map of correlator inputs.
    corr_inputs : list
        List of :class:`CorrInput` objects, e.g. the output from
        :func:`get_correlator_inputs`.

    Returns
    -------
    corr_input_list: list
        List of :class:`CorrInput` instances in the new order. Returns `None`
        where the serial number had no matching entry in parameter ``corr_inputs``.
    """
    serials = input_map["correlator_input"]

    sorted_inputs = []

    for serial in serials:
        for corr_input in corr_inputs:
            if serial == corr_input.input_sn:
                sorted_inputs.append(corr_input)
                break
        else:
            sorted_inputs.append(None)

    return sorted_inputs