General Frameworks for Conditional Two-Sample Testing