code: def merge_notebooks(filenames):
      merged = None
      for fname in filenames:
          with io.open(fname, "r", encoding="utf-8") as f:
              nb = nbformat.read(f, as_version=4)
          if merged is None:
              merged = nb
          else:
              # TODO: add an optional marker between joined notebooks
              # like an horizontal rule, for example, or some other arbitrary
              # (user specified) markdown cell)
              merged.cells.extend(nb.cells)
      if not hasattr(merged.metadata, "name"):
          merged.metadata.name = ""
      merged.metadata.name += "_merged"
      print(nbformat.writes(merged))
  
imports: from __future__ import print_function
  import io
  import sys
  import nbformat
label_desc: Use image node_id 1 for calling a global function with example usage: merge_notebooks(filenames) without return types