code: def set_variant(self, identity, experiment_name, variant_name):
          
          try:
              experiment = model.Experiment.get_by(name=experiment_name)
              variant = model.Variant.get_by(name=variant_name)
              if experiment and variant and model.Participant.query.filter(and_(
                  model.Participant.identity == identity,
                  model.Participant.experiment_id == experiment.id,
                  model.Participant.variant_id == variant.id
              )).count() == 0:
                  model.Participant(
                      identity=identity,
                      experiment=experiment,
                      variant=variant
                  )
                  self.Session.commit()
          finally:
              self.Session.close()
docs: Set the variant for a specific user.
  
          :param identity a unique user identifier
          :param experiment_name the string name of the experiment
          :param variant_name the string name of the variant