code: def save_callback(operation, graphdef):
      '''callback from save thread'''
      if operation == 'test':
          for e in graphdef.expressions:
              if expression_ok(e, msgs):
                  graphdef.expression = e
                  pipe_graph_input.send('graph ' + graphdef.expression)
                  return
          pipe_console_input.send('Invalid graph expressions')
          return
      if operation == 'save':
          save_graph(graphdeff save_callback(operation, graphdef):
      '''callback from save thread'''
      if operation == 'test':
          for e in graphdef.expressions:
              if expression_ok(e, msgs):
                  graphdef.expression = e
                  pipe_graph_input.send('graph ' + graphdef.expression)
                  return
          pipe_console_input.send('Invalid graph expressions')
          return
      if operation == 'save':
          save_graph(graphdef)
docs: callback from save thread