code: def read_omega_scan_config(source):
      
      out = ChannelList()
      append = out.append
      if isinstance(source, FILE_LIKE):
          close = False
      else:
          source = open(source, 'r')
          close = True
      try:
          section = None
          while True:
              try:
                  line = next(source)
              except StopIteration:
                  break
              if line == '' or line == '\n' or line.startswith('#'):
                  continue
              elif line.startswith('['):
                  section = line[1:-2]
              elif line.startswith('{'):
                  append(parse_omega_channel(source, section))
              else:
                  raise RuntimeError("Failed to parse Omega config line:\n%s"
                                     % line)
      finally:
          if close:
              source.close()
      return out
docs: Parse an Omega-scan configuration file into a `ChannelList`
  
      Parameters
      ----------
      source : `str`
          path of Omega configuration file to parse
  
      Returns
      -------
      channels : `ChannelList`
          the list of channels (in order) as parsed
  
      Raises
      ------
      RuntimeError
          if this method finds a line it cannot parse sensibly