code: def process_icmp_frame(self,
                             id=None,
                             msg=None):
          
  
          # normalize into a dataframe
          df = json_normalize(msg)
          # convert to a flattened dictionary
          dt = json.loads(df.to_json())
  
          flat_msg = {}
  
          for k in dt:
              new_key = "icmp_{}".format(k)
              flat_msg[new_key] = dt[k]["0"]
              if new_key not in self.icmp_keys:
                  self.icmp_keys[new_key] = k
          # end of capturing all unique keys
  
          dt["icmp_id"] = id
          self.all_icmp.append(dt)
  
          log.debug("ICMP data updated:")
          log.debug(self.icmp_keys)
          log.debug(self.all_icmp)
          log.debug("")
  
          return flat_msg
docs: process_icmp_frame
  
          Convert a complex nested json dictionary
          to a flattened dictionary and capture
          all unique keys for table construction
  
          :param id: key for this msg
          :param msg: icmp frame for packet