def deunshape(a, oldshape):
    """
    restore a to old shape.

    :param a: array_like
    :param oldshape: return array shape
    :return: ndarray

    :example:
     >>> a = np.arange(40).reshape(2,4,5)
     >>> a.shape
     (2, 4, 5)
     >>> b, oldshape = unshape(a)
     >>> b.shape
     (2, 20)
     >>> c = deunshape(b, oldshape)
     >>> c.shape
     (2, 4, 5)
    """

    arraynd = a.reshape(oldshape)
    return arraynd