Bridging Theory and Algorithms for Open-Set and Heterogeneous Domain Adaptations