<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def submodel(self, states=None, obs=None):
 """Returns a HMM with restricted state space Parameters states : None or int-array Hidden states to restrict the model to (if not None). obs : None, str or int-array Observed states to restrict the model to (if not None). Returns ------- hmm : HMM The restricted HMM. """

        # get the reference HMM submodel
        ref = super(SampledHMSM, self).submodel(states=states, obs=obs)
        # get the sample submodels
        samples_sub = [sample.submodel(states=states, obs=obs) for sample in self.samples]
        # new model
        return SampledHMSM(samples_sub, ref=ref, conf=self.conf)