def parse_innotop_mode_c(self):
    with open(self.infile, 'r') as infh:
      headerline = infh.readline()
      columns = headerline.split()[2:]
      outfilehandlers = {}
      for line in infh:
        l = line.strip().split(' ', 1)
        if len(l) <= 1:
          continue
        ts = l[0].strip().replace('T', ' ')
        try:
          nameval = l[1].strip().split('\t', 1)
        except IndexError:
          logger.warn("Badly formatted line: %s", line)
          logger.warn("Expected tab separated values")
          continue
        command = nameval[0]
        if command not in outfilehandlers:
          # Only looking at top N commands
          if len(outfilehandlers) > self.C_MAX_COMMANDS:
            continue
          # TODO(rmaheshw) : Use collections.defaultdict instead to avoid initializing dicts
          outfilehandlers[command] = {}
        words = nameval[1].split('\t')
        for i in range(len(words)):
          if self.options and columns[i] not in self.options:
            continue
          if columns[i] not in outfilehandlers[command]:
            outfilehandlers[command][columns[i]] = open(self.get_csv_C(command, columns[i]), 'w')
            self.csv_files.append(self.get_csv_C(command, columns[i]))
          ts = naarad.utils.reconcile_timezones(ts, self.timezone, self.graph_timezone)
          outfilehandlers[command][columns[i]].write(ts + ',')
          outfilehandlers[command][columns[i]].write(words[i])
          outfilehandlers[command][columns[i]].write('\n')
      for command in outfilehandlers:
        for column in outfilehandlers[command]:
          outfilehandlers[command][column].close()
    return True
dataset/ETHPy150Open linkedin/naarad/src/naarad/metrics/innotop_metric.py/INNOMetric.parse_innotop_mode_c/original