code: def _strip_ctype(name, ctype, protocol=2):
      
      # parse channel type from name (e.g. 'L1:GDS-CALIB_STRAIN,reduced')
      try:
          name, ctypestr = name.rsplit(',', 1)
      except ValueError:
          pass
      else:
          ctype = Nds2ChannelType.find(ctypestr).value
          # NDS1 stores channels with trend suffix, so we put it back:
          if protocol == 1 and ctype in (
                  Nds2ChannelType.STREND.value,
                  Nds2ChannelType.MTREND.value
          ):
              name += ',{0}'.format(ctypestr)
      return name, ctype
docs: Strip the ctype from a channel name for the given nds server version
  
      This is needed because NDS1 servers store trend channels _including_
      the suffix, but not raw channels, and NDS2 doesn't do this.