[docs]defencode_repertoire(self,repertoire,params:EncoderParams):counts=Counter()sequence_encoder=self._prepare_sequence_encoder()feature_names=sequence_encoder.get_feature_names(params)params.region_type=self.region_typeforsequenceinrepertoire.sequences(params.region_type):counts=self._encode_sequence(sequence,params,sequence_encoder,counts)label_config=params.label_configlabels=dict()ifparams.encode_labelselseNoneiflabelsisnotNone:forlabel_nameinlabel_config.get_labels_by_name():label=repertoire.metadata[label_name]labels[label_name]=label# TODO: refactor this not to return 4 values but e.g. a dict or split into different functions?returncounts,repertoire.identifier,labels,feature_names