code: def rename_keys(record: Mapping, key_map: Mapping) -> dict:
      
  
      new_record = dict()
  
      for k, v in record.items():
          key = key_map[k] if k in key_map else k
          new_record[key] = v
  
      return new_record
docs: New record with same keys or renamed keys if key found in key_map.