code: def _unpickle_channel(raw):
      
      try:
          return pickle.loads(raw)
      except (ValueError, pickle.UnpicklingError, EOFError, TypeError,
              IndexError) as exc:
          # maybe not pickled
          if isinstance(raw, bytes):
              raw = raw.decode('utf-8')
          try:  # test if this is a valid channel name
              Channel.MATCH.match(raw)
          except ValueError:
              raise exc
          return raw
docs: Try and unpickle a channel with sensible error handling