class_docstr: Argument parser with default flags, and tensorboard helpers.
class_docstr_tok: ["Argument","parser","with","default","flags",",","and","tensorboard","helpers","."]
docstr: More compact argumentparser 'add' flag method.
docstr_tok: ["More","compact","argumentparser","'add","'","flag","method","."]
code: def add(self, name, default, **kwargs):
      """More compact argumentparser 'add' flag method."""
      helpstring = kwargs["help"] if "help" in kwargs else ""
      metavar = kwargs["metavar"] if "metavar" in kwargs else name
  
      # --- Fixes problems with bool arguments
      def str2bool(string):
          if isinstance(string, bool):
              return str
          if string.lower() in ("true", "yes"):
              return True
          if string.lower() in ("false", "no"):
              return False
          raise argparse.ArgumentTypeError("Bad value for boolean flag")
  
      mytype = type(default)
      if isinstance(default, bool):
          mytype = str2bool
  
      self.add_argument(
          name,
          metavar=metavar,
          default=default,
          help=helpstring,
          type=mytype,
      )
  
file_path: graphics/tensorflow_graphics/projects/pointnet/helpers.py
imports: from __future__ import print_function
  import argparse
  import os
  import tempfile
  import time
  import tensorflow
  import termcolor
label_desc: Use image node_id 2 for calling the ArgumentParser obj's underlying member method code with example usage: obj.add(name, default) and returns: str, True, False