code: def _get_nds2_name(channel):
      
      if hasattr(channel, 'ndsname'):  # gwpy.detector.Channel
          return channel.ndsname
      if hasattr(channel, 'channel_type'):  # nds2.channel
          return '%s,%s' % (channel.name,
                            channel.channel_type_to_string(channel.channel_type))
      return str(channel)
docs: Returns the NDS2-formatted name for a channel
  
      Understands how to format NDS name strings from
      `gwpy.detector.Channel` and `nds2.channel` objects