pull out of a hat
Produce suddenly and surprisingly, as if by magic. For example, We can't just pull the answers out of a hat. This expression alludes to the magician's trick of pulling some unexpected object out of a hat. That object is often a rabbit, and the expression pull a rabbit out of a hat is often used to mean “get magical results,” as in Much as I would like to be able to pull a rabbit out of a hat, I doubt if I can find further funding for this project.