code: def set_duration(self, rule):
          
  
          self.conconf.set_condition('duration', rule)
          if not self.no_auto:
              self.make_mask()
docs: Set the duration according to rule.
  
          rule: str
              The rule operating on the variable ``dur``.
  
          rule is an expression like::
  
              >>> rule = 'dur == 150 or dur > 822'
  
          setting a duration rule assuming a pack sp::
  
              >>> sp.set_duration(rule)
  
          The identifier ``dur`` must be present or the rule will fail.
  
          .. note::
             The logical ``or`` and ``and`` operators must be used. ``dur`` is a
             primitive, not an array.
  
          .. note::
             Updates the mask if not no_auto.
  
          .. seealso::
             :meth:`~channelpack.ChannelPack.set_samplerate`
             :meth:`~channelpack.ChannelPack.add_condition`
             :meth:`~channelpack.ChannelPack.pprint_conditions`