such gain would have been excluded from gross income under section 1203 if the selling corporation were a United States shareholder in the other controlled foreign corporation, and (B) loss from such sale, exchange, or disposition shall not be allowed to the extent such loss would have been disallowed under section 1213 if the selling corporation were a United States shareholder in the other controlled foreign corporation. (4) Gain or loss from sales of interests in 25-percent owned partnerships (A) In general (i) Portion treated as active foreign market income In the case of any sale or exchange by a controlled foreign corporation of an interest in a partnership with respect to which such corporation is a 25-percent owner, gain or loss on such sale shall be taken into account in determining active foreign market income in the amount which bears the same ratio to the amount of such gain or loss as the controlled foreign corporation's distributable share of the active foreign market income from the partnership over the applicable period bears to the controlled foreign corporation's distributable share of gross income from the partnership over such period. The Secretary shall prescribe such regulations as may be appropriate to prevent abuse of the purposes of this paragraph, including regulations providing for coordination of this paragraph with the provisions of subchapter K. (ii) Applicable period For purposes of this subparagraph, the term applicable period means, with respect to any interest in a partnership, the shorter of the 3-taxable-year period immediately preceding the taxable year of the sale or exchange or the controlled foreign corporation's holding period in the interest. In no event shall the applicable period include any portion of any taxable year beginning before the applicable date (as defined in section 300 of the Infrastructure 2.0 Act ). (B) 25-Percent owner For purposes of this paragraph, the term 25-percent owner means a controlled foreign corporation which owns directly 25 percent or more