We prove two estimates for the expectation of the exponential of a complex function of a random permutation or subset. Using this theory, we find asymptotic expressions for the expected number of copies and induced copies of a given graph in a uniformly random graph with degree sequence(d
, …, d
) as n→ ∞. We also determine the expected number of spanning trees in this model. The range of degrees covered includes d
= λn + O(n
) for some λ bounded away from 0 and 1.