'Validate that the provided differentials are appropriate for this
representation and recast/reshape as necessary and then return.
Note that this does *not* set the differentials on
``self._differentials``, but rather leaves that for the caller.'

def _validate_differentials(self, differentials):

    if (differentials is None):
        differentials = dict()
    elif isinstance(differentials, BaseDifferential):
        if (isinstance(differentials, RadialDifferential) and isinstance(self, UnitSphericalRepresentation)):
            raise ValueError(u'To    attach    a    RadialDifferential    to    a    UnitSphericalRepresentation,    you    must    supply    a    dictionary    with    an    appropriate    key.')
        key = differentials._get_deriv_key(self)
        differentials = {key: differentials}
    for key in differentials:
        try:
            diff = differentials[key]
        except TypeError:
            raise TypeError(u"'differentials'    argument    must    be    a    dictionary-like    object")
        diff._check_base(self)
        if (isinstance(diff, RadialDifferential) and isinstance(self, UnitSphericalRepresentation)):
            pass
        else:
            expected_key = diff._get_deriv_key(self)
            if (key != expected_key):
                raise ValueError(u"For    differential    object    '{0}',    expected    unit    key    =    '{1}'    but    received    key    =    '{2}'".format(repr(diff), expected_key, key))
        if (diff.shape != self.shape):
            raise ValueError(u'Shape    of    differentials    must    be    the    same    as    the    shape    of    the    representation    ({0}    vs    {1})'.format(diff.shape, self.shape))
    return differentials
