code: def readadd(file, system):
      
      dyr = {}
      data = []
      end = 0
      retval = True
      sep = ','
  
      fid = open(file, 'r')
      for line in fid.readlines():
          if line.find('/') >= 0:
              line = line.split('/')[0]
              end = 1
          if line.find(',') >= 0:  # mixed comma and space splitter not allowed
              line = [to_number(item.strip()) for item in line.split(sep)]
          else:
              line = [to_number(item.strip()) for item in line.split()]
          if not line:
              end = 0
              continue
          data.extend(line)
          if end == 1:
              field = data[1]
              if field not in dyr.keys():
                  dyr[field] = []
              dyr[field].append(data)
              end = 0
              data = []
      fid.close()
  
      # elem_add device elements to system
      supported = [
          'GENROU',
          'GENCLS',
          'ESST3A',
          'ESDC2A',
          'SEXS',
          'EXST1',
          'ST2CUT',
          'IEEEST',
          'TGOV1',
      ]
      used = list(supported)
      for model in supported:
          if model not in dyr.keys():
              used.remove(model)
              continue
          for data in dyr[model]:
              add_dyn(system, model, data)
  
      needed = list(dyr.keys())
      for i in supported:
          if i in needed:
              needed.remove(i)
  
      logger.warning('Models currently unsupported: {}'.format(
          ', '.join(needed)))
  
      return retval
docs: read DYR file