Fix E > 0 and a graph H with at least one vertex. A well-known theorem of Rodl from the 80s says that every graph G with no induced copy of H contains a linear-sized E-restricted set S & SUBE; V (G), which means S induces a subgraph with maximum degree at most E|S| in G or its complement. There are two extensions of this result:& BULL; quantitatively, Nikiforov relaxed the condition "no induced copy of H" to "at most k|G||H| induced copies of H for some k > 0 depending on H and E;" and & BULL; qualitatively, Chudnovsky, Scott, Seymour, and Spirkl recently showed that there exists N > 0 depending on H and E such that G is (N, E)-restricted, which means V(G) has a partition into at most N subsets that are E-restricted.A natural common generalization of these two asserts that every graph G with at most k|G||H| induced copies of H is (N, E)-restricted for some k, N > 0 depending on H and E. This is unfortunately false; but we prove that for every E > 0, k and N still exist so that for every d ������ 0, every graph G with at most kd|H| induced copies of H has an (N, E)-restricted induced subgraph on at least |G| - d vertices. This unifies the two aforementioned theorems, and is optimal up to k and N for every value of d.