code: def embedded_upd(args):
      """Update contents or metadata of an embedded file."""
      doc = open_file(args.input, args.password, pdf=True)
      if not doc.can_save_incrementally() and (
          args.output is None or args.output == args.input
      ):
          sys.exit("cannot save PDF incrementally")
  
      try:
          doc.embfile_info(args.name)
      except:
          sys.exit("no such embedded file '%s'" % args.name)
  
      if (
          args.path is not None
          and os.path.exists(args.path)
          and os.path.isfile(args.path)
      ):
          stream = open(args.path, "rb").read()
      else:
          stream = None
  
      if args.filename:
          filename = args.filename
      else:
          filename = None
  
      if args.ufilename:
          ufilename = args.ufilename
      elif args.filename:
          ufilename = args.filename
      else:
          ufilename = None
  
      if args.desc:
          desc = args.desc
      else:
          desc = None
  
      doc.embfile_upd(
          args.name,
          stream,
          filename=filename,
          ufilename=ufilename,
          desc=desc,
      )
      if args.output is None or args.output == args.input:
          doc.saveIncr()
      else:
          doc.save(args.output, garbage=3)
      doc.close()
  
imports: import argparse
  import bisect
  import os
  import sys
  import statistics
  from typing import Dict, List, Set, Tuple
  import fitz
  from fitz.fitz import TEXT_INHIBIT_SPACES, TEXT_PRESERVE_LIGATURES, TEXT_PRESERVE_WHITESPACE
label_desc: Use image node_id 13 for calling a global function with example usage: embedded_upd(args) without return types