code: def set_cancel_policy(self, cancel_policy):
          
          if not isinstance(cancel_policy, CancelPolicy):
              raise UnsupportedCancelPolicy()
  
          if self.initialized:
              raise SetCancelPolicyPostInit()
  
          self.blotter.cancel_policy = cancel_policy
docs: Sets the order cancellation policy for the simulation.
  
          Parameters
          ----------
          cancel_policy : CancelPolicy
              The cancellation policy to use.
  
          See Also
          --------
          :class:`zipline.api.EODCancel`
          :class:`zipline.api.NeverCancel`