code: def _pbtxt_from_multiline(multiline_pbtxt):
      pbtxt = ""
      while len(multiline_pbtxt) > 0:
          index = multiline_pbtxt.find("\n")
          if index == -1:
              pbtxt = pbtxt + multiline_pbtxt
              multiline_pbtxt = ""
              break
          line = multiline_pbtxt[0:index]
          multiline_pbtxt = multiline_pbtxt[index + 1 :]
          colon = line.find(":")
          end = _find_multiline(line, colon)
          if end is None:
              pbtxt = pbtxt + line + "\n"
              continue
          pbtxt = pbtxt + line[0 : colon + 1]
          unescaped = ""
          newline = False
          line = ""
          while len(multiline_pbtxt) > 0:
              index = multiline_pbtxt.find("\n")
              line = multiline_pbtxt[0:index]
              multiline_pbtxt = multiline_pbtxt[index + 1 :]
              if line.startswith(end):
                  line = line[len(end) :]
                  break
              if newline:
                  unescaped = unescaped + "\n"
              newline = True
              unescaped = unescaped + line
              line = ""
          pbtxt = (
              pbtxt + '"' + _str_escape(unescaped) + '"' + line + "\n"
          )
      return pbtxt
  
imports: import json
  import logging
  import os
  import google.protobuf
  from tensorflow.core.framework import api_def_pb2
  from tensorflow.core.framework import op_def_pb2
  from tensorflow.core.framework import types_pb2
label_desc: Use image node_id 5 for calling a global function with example usage: _pbtxt_from_multiline(multiline_pbtxt) and returns: pbtxt