human
Complete the below
@overload(where)
def overload_where_scalars(cond, x, y):

    ''''Implement where() for scalars.'
    '''
 Can you provide a the Python code you requested?
assistant
#Here is the Python code you requested.
    if (not isinstance(cond, types.Array)):
        if (x != y):
            raise errors.TypingError('x    and    y    should    have    the    same    type')
        def where_impl(cond, x, y):
            '\n                                                Scalar    where()    =>    return    a    0-dim    array\n                                                '
            scal = (x if cond else y)
            arr = np.empty_like(scal)
            arr[()] = scal
            return arr
        return where_impl