def METHOD_NAME(tfile, args):
    if not args.metadata:
        with tempfile.NamedTemporaryFile(mode = "w") as tempobj:
            json.dump({}, tempobj)
            tempobj.flush()
            tfile.add(tempobj.name, 'metadata.json')
    else:
        tfile.add(args.metadata, 'metadata.json', recursive=False)