Under English law, if someone is asleep there is a presumption that they have not consented to the sexual activity, and that the awake party (or parties) are aware of this.
However, it is just a presumption. If a defendant can raise some evidence to say that the other party had consented before (impliedly or explicitly), or they reasonably believed they have, the prosecution must then prove that there wasn't consent, and the defendant didn't believe there was.
So in most cases where someone is asleep and sex starts, it never gets reported to the police (even if it is, actually, rape). Alternatively, if it does come to the attention of the police, the victim might give evidence that they had consented (which might happen in Assange's case). In my limited understanding, these issues only go to the police when it is clearly rape, or there is some other factor. In Assange's case, it was they allegedly went to the police to ask if they could force him to take an STI test, and the police recognised that what was described could amount to rape etc. Which makes me wonder how many other women around the world have been in similar situations with him, but not felt able or willing to go to the police.
Being incapacitated with drugs etc. works similarly; there is a presumption of no consent, but the defence can try to remove it.
So in general, if you are likely to engage in any sort of sexual activity with someone, it is best to get a signed consent form filled out in advance (possibly witnessed) - at least, that's what I picked up from studying sexual offences...