code: def boolean_flag(parser, name, default=False, help_msg=None):
      """
      Add a boolean flag to argparse parser.
  
      :param parser: (argparse.Parser) parser to add the flag to
      :param name: (str) --<name> will enable the flag, while --no-<name> will disable it
      :param default: (bool) default value of the flag
      :param help_msg: (str) help string for the flag
      """
      dest = name.replace("-", "_")
      parser.add_argument(
          "--" + name,
          action="store_true",
          default=default,
          dest=dest,
          help=help_msg,
      )
      parser.add_argument(
          "--no-" + name, action="store_false", dest=dest
      )
  
file_path: stable-baselines/stable_baselines/common/misc_util.py
imports: import random
  import gym
  import numpy
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: boolean_flag(parser, name, default, help_msg) without return types