Finite-sample analysis of identification of switched linear systems with arbitrary or restricted switching