code: def merge_java_content(old_content, json_file):
      new_content, names = print_java_mf(json_file)
  
      def split_to_sections(content):
          sections = []
          cur_section = []
          for l in content:
              if l.rstrip():
                  cur_section.append(l)
              else:
                  sections.append(cur_section)
                  cur_section = []
  
          if (
              cur_section
          ):  # should not be needed according to format specification
              sections.append(cur_section)
  
          return sections
  
      def drop_duplicate_entries(main_section, names):
          header = re.compile("^([A-Za-z0-9][A-Za-z0-9_-]*): .*$")
          new_main_section = []
          for l in main_section:
              match = header.match(l)
              # duplicate entry
              if match:
                  skip = match.group(1) in names
  
              if not skip:
                  new_main_section.append(l)
          return new_main_section
  
      if old_content:
          sections = split_to_sections(old_content)
          sections[0] = drop_duplicate_entries(sections[0], names)
      else:
          sections = [["Manifest-Version: 1.0\n"]]
  
      sections[0].extend(map(lambda x: x + "\n", new_content))
  
      return "".join(map(lambda x: "".join(x), sections)) + "\n"
  
imports: import base64
  import json
  import os
  import re
  import sys
  import shutil
  import tempfile
  import textwrap
  import zipfile
label_desc: Use image node_id 4 for calling a global function with example usage: merge_java_content(old_content, json_file) and returns: unknown, sections, new_main_section