code: def check_channel(fcn):
      
  
      def wrapper(*args, **kwargs):
          if not isinstance(args[1], ChannelResource):
              raise RuntimeError('resource must be an instance of intern.resource.boss.ChannelResource.')
  
          if not args[1].cutout_ready:
              raise PartialChannelResourceError(
                      'ChannelResource not fully initialized.  Use intern.remote.BossRemote.get_channel({}, {}, {})'.format(
                          args[1].name, args[1].coll_name, args[1].exp_name))
          return fcn(*args, **kwargs)
  
      return wrapper
docs: Decorator that ensures a valid channel passed in.
  
      Args:
          fcn (function): Function that has a ChannelResource as its second argument.
  
      Returns:
          (function): Wraps given function with one that checks for a valid channel.