code: def cleannb(nbfile):
      with io.open(nbfile, "r", encoding="utf8") as f:
          nb = nbformat.read(f, as_version=nbformat.NO_CONVERT)
  
      nb["metadata"]["kernelspec"]["display_name"] = "Python 3"
      nb["metadata"]["kernelspec"]["name"] = "python3"
      nb["metadata"]["language_info"]["codemirror_mode"]["version"] = 3
      nb["metadata"]["language_info"]["pygments_lexer"] = "ipython3"
      nb["metadata"]["language_info"]["version"] = "3.7.1"
  
      with io.open(nbfile, "w", encoding="utf8") as f:
          nbformat.write(nb, f)
  
imports: import argparse
  import io
  import nbformat
label_desc: Use image node_id 1 for calling a global function with example usage: cleannb(nbfile) without return types