parameters: (load_file, cgos_mode=False, kgs_mode=False,
                        minigui_mode=False)
return_statement: return engine
docstring: Takes a path to model files and set up a GTP engine instance.
docstring_summary: Takes a path to model files and set up a GTP engine instance.
docstring_tokens: Takes a path to model files and set up a GTP engine instance .
function: def make_gtp_instance(load_file, cgos_mode=False, kgs_mode=False,
                        minigui_mode=False):
      """Takes a path to model files and set up a GTP engine instance."""
      # Here so we dont try load EdgeTPU python library unless we need to
      if load_file.endswith(".tflite"):
          from dual_net_edge_tpu import DualNetworkEdgeTpu
          n = DualNetworkEdgeTpu(load_file)
      else:
          from dual_net import DualNetwork
          n = DualNetwork(load_file)
  
      if cgos_mode:
          player = CGOSPlayer(network=n, seconds_per_move=5, timed_match=True,
                              two_player_mode=True)
      else:
          player = MCTSPlayer(network=n, two_player_mode=True)
  
      name = "Minigo-" + os.path.basename(load_file)
      version = "0.2"
  
      engine = gtp_engine.Engine()
      engine.add_cmd_handler(
          gtp_engine.EngineCmdHandler(engine, name, version))
  
      if kgs_mode:
          engine.add_cmd_handler(KgsCmdHandler(player))
      engine.add_cmd_handler(RegressionsCmdHandler(player))
      engine.add_cmd_handler(GoGuiCmdHandler(player))
      if minigui_mode:
          engine.add_cmd_handler(MiniguiBasicCmdHandler(player, courtesy_pass=kgs_mode))
      else:
          engine.add_cmd_handler(BasicCmdHandler(player, courtesy_pass=kgs_mode))
  
      return engine
function_tokens: def make_gtp_instance ( load_file , cgos_mode = False , kgs_mode = False , minigui_mode = False ) : # Here so we dont try load EdgeTPU python library unless we need to if load_file . endswith ( ".tflite" ) : from dual_net_edge_tpu import DualNetworkEdgeTpu n = DualNetworkEdgeTpu ( load_file ) else : from dual_net import DualNetwork n = DualNetwork ( load_file ) if cgos_mode : player = CGOSPlayer ( network = n , seconds_per_move = 5 , timed_match = True , two_player_mode = True ) else : player = MCTSPlayer ( network = n , two_player_mode = True ) name = "Minigo-" + os . path . basename ( load_file ) version = "0.2" engine = gtp_engine . Engine ( ) engine . add_cmd_handler ( gtp_engine . EngineCmdHandler ( engine , name , version ) ) if kgs_mode : engine . add_cmd_handler ( KgsCmdHandler ( player ) ) engine . add_cmd_handler ( RegressionsCmdHandler ( player ) ) engine . add_cmd_handler ( GoGuiCmdHandler ( player ) ) if minigui_mode : engine . add_cmd_handler ( MiniguiBasicCmdHandler ( player , courtesy_pass = kgs_mode ) ) else : engine . add_cmd_handler ( BasicCmdHandler ( player , courtesy_pass = kgs_mode ) ) return engine