
    Kyle Chris MOELLER, Appellant, v. The ATTORNEY GENERAL OF the STATE OF SOUTH DAKOTA and Jerry Parkinson, Chief Court Services Officer, Court Services Department, Sixth Judicial Circuit, Appellees.
    No. 87-5192.
    United States Court of Appeals, Eighth Circuit.
    Submitted Dec. 16, 1987.
    Decided Feb. 5, 1988.
    
      J.M. Grossenburg, Winner, S.D., for appellant.
    Craig M. Eichstadt, Asst. Atty. Gen., for appellees.
    Before ARNOLD and FAGG, Circuit Judges, and LARSON, Senior District Judge.
    
      
       The Hon. Earl R. Larson, Senior United States District Judge for the District of Minnesota, sitting by designation pursuant to 28 U.S.C. § 294.
    
   ARNOLD, Circuit Judge.

This is a petition for habeas corpus brought under 28 U.S.C. § 2254 by Kyle Chris Moeller, a prisoner in state custody. He claims that no rational jury could have found him guilty of the cocaine-related offenses for which he has been sentenced. The District Court held against petitioner, and we affirm.

Under Jackson v. Virginia, 443 U.S. 307, 99 S.Ct. 2781, 61 L.Ed.2d 560 (1979), federal habeas corpus lies to determine whether any rational jury could have found a state prisoner guilty beyond a reasonable doubt. In reviewing such a claim, we look solely to the record of the state trial. There is therefore no need for an evidentiary hearing in the habeas court, and the District Court was right not to hold one. By hypothesis, any such claim will be brought only after the state courts, trial and appellate, have held the evidence sufficient to establish each element of the crime beyond a reasonable doubt. That sort of question is everyday business for the state courts, grist for their mill, and it will be a rare case in which a federal court on habe-as will disagree with them.

It is not denied that Moeller distributed cocaine to an undercover police agent. He claims, however, that he was entrapped; more specifically, that no rational jury could have found that the state had proved beyond a reasonable doubt that he was not entrapped. Having weighed all the arguments so vigorously advanced by petitioner’s counsel, we are unable to agree. At a time when Moeller had seen the agent only once before, and that on a casual basis nine months earlier, Moeller gave the agent some marijuana, an act which constitutes the crime of distribution. (Marijuana is not cocaine, to be sure, but, in the context of this case, we think one could rationally infer that someone who readily distributed marijuana would not be indisposed to distribute cocaine as well.) Later, when asked by the agent to come to a meeting with drugs, Moeller showed up with cocaine, which he proceeded to deliver to the agent. Moeller says the cocaine (as opposed to some other drug) was the agent’s idea, and the agent himself so testified at one point. But later in his testimony, speaking in greater detail, the agent said it was Moeller’s idea to bring the cocaine. It often happens in trials that witnesses contradict themselves, and it is for the jury to decide which aspect of their perhaps inconsistent testimony to accept. The agent was at great pains to ingratiate himself with Moeller, and the jury could well have found a reasonable doubt as to entrapment. We are unable to say, however, that its failure to do so was irrational.

Whether law-enforcement resources were wisely allocated here; whether prose-cutorial discretion was prudently exercised; whether the jury made the decision we would have made had we been jurors — all those are questions not before us, and which the writ of habeas corpus does not lie to determine. Our sole function is to determine whether the record contains sufficient evidence to persuade a rational jury beyond a reasonable doubt that Moeller was not entrapped. We hold that it does.

For a fuller narrative statement of the facts, we refer the reader to Judge Porter’s well reasoned opinion.

Affirmed. 
      
      . Moeller is not now physically incarcerated, having served the brief term of imprisonment imposed upon him, but he is still on parole. This is a sufficient restraint on his liberty to amount to "custody” within the meaning of the habeas corpus statute.
     
      
      . The Hon. Donald J. Porter, Chief Judge, United States District Court for the District of South Dakota.
     
      
      . We reject the state’s argument that Moeller has not exhausted his state remedies.
     