Adds project name or project id argument. These two are mutually exclusive.
    :param arg_parser:
    :param required:
    :param help_text:
    :return:
509663
def add_project_name_or_id_arg(arg_parser, required=True, help_text_suffix="manage"):
    
    project_name_or_id = arg_parser.add_mutually_exclusive_group(required=required)
    name_help_text = "Name of the project to {}.".format(help_text_suffix)
    add_project_name_arg(project_name_or_id, required=False, help_text=name_help_text)
    id_help_text = "ID of the project to {}.".format(help_text_suffix)
    add_project_id_arg(project_name_or_id, required=False, help_text=id_help_text)
896193
def init(args):
    
    # working directory
    dir_path = Path().absolute()

    if not args.project_name or args.project_name.find("/") >= 0:
        print(
            "{}You should specify a valid project name{}".format(
                utils.colors.FAIL, utils.colors.ENDC
            )
        )
        return

    project_path = dir_path / args.project_name

    # Create the Home Documentation's directory
    if not project_path.exists():
        project_path.mkdir()
    else:
        print(
            "{}This project already exists{}".format(
                utils.colors.FAIL, utils.colors.ENDC
            )
        )
        return

    # Directory with the Home Documentation's source code
    home_doc_path = project_path / "docs"
    home_doc_path.mkdir()
    help_doc_path = home_doc_path / "help"
    help_doc_path.mkdir()

    file_path = Path(__file__).resolve().parent / "include"

    # Add initial files
    copyfile(file_path / "index.md", home_doc_path / "index.md")
    copyfile(file_path / "How_To_Use_Mkinx.md", help_doc_path / "How_To_Use_Mkinx.md")
    copyfile(
        file_path / "Writing_Sphinx_Documentation.md",
        help_doc_path / "Writing_Sphinx_Documentation.md",
    )

    with open(file_path / "mkdocs.yml", "r") as f:
        lines = f.readlines()

    input_text = "What is your Documentation's name"
    input_text += " (it can be changed later in mkdocs.yml)?\n"
    input_text += "[Default: {} - Home Documentation]\n"

    site_name = input(input_text.format(args.project_name.capitalize()))
    if not site_name:
        site_name = "{} - Home Documentation".format(args.project_name.capitalize())

    lines[0] = "site_name: {}\n".format(site_name)

    with open(project_path / "mkdocs.yml", "w") as f:
        f.writelines(lines)

    example_project_path = project_path / "example_project" / "example_project"

    windows = "y" if sys.platform in {"win32", "cygwin"} else "n"

    copytree(file_path / "example_project", example_project_path)
    move(str(example_project_path / "source"), str(project_path / "example_project"))
    move(
        str(project_path / "example_project" / "example_project" / "Makefile"),
        str(project_path / "example_project"),
    )
    if windows == "y":
        move(
            str(project_path / "example_project" / "example_project" / "make.bat"),
            str(project_path / "example_project"),
        )
    else:
        os.remove(
            str(project_path / "example_project" / "example_project" / "make.bat")
        )

    static = project_path / "example_project" / "source"
    static /= "_static"
    if not static.exists():
        static.mkdir()

    _ = subprocess.check_output(
        "cd {} && mkinx build -F -A > /dev/null".format(args.project_name), shell=True
    )

    print(
        "\n\n",
        utils.colors.OKBLUE,
        "{}/{} created as a showcase of how mkinx works".format(
            args.project_name, "example_project"
        ),
        utils.colors.ENDC,
    )

    print(
        "\n",
        utils.colors.OKGREEN,
        "Success!",
        utils.colors.ENDC,
        "You can now start your Docs in ./{}\n".format(args.project_name),
        utils.colors.HEADER,
        "$ cd ./{}".format(args.project_name),
        utils.colors.ENDC,
    )
    print(
        "  Start the server from within your Docs to see them \n  (default",
        "port is 8443 but you can change it with the -s flag):",
    )
    print(
        utils.colors.HEADER,
        " {} $ mkinx serve\n".format(args.project_name),
        utils.colors.ENDC,
    )
989862
def createissue(self, project_id, title, **kwargs):
        
        data = {'id': id, 'title': title}
        if kwargs:
            data.update(kwargs)
        request = requests.post(
            '{0}/{1}/issues'.format(self.projects_url, project_id),
            headers=self.headers, data=data, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 201:
            return request.json()
        else:
            return False
615032
def help(self, *arg, **kwargs):
    
    name = arg[0]
    try:
        callback = self._commands[name]
    except KeyError:
        self._logger.info(' !help not found for: %s', name)
        return self.do_help.__doc__

    return callback.__doc__
955214
def AddBasicOptions(self, argument_group):
    
    version_string = self.GetVersionInformation()

    # We want a custom help message and not the default argparse one.
    argument_group.add_argument(
        '-h', '--help', action='help',
        help='Show this help message and exit.')

    argument_group.add_argument(
        '--troubles', dest='show_troubleshooting', action='store_true',
        default=False, help='Show troubleshooting information.')

    argument_group.add_argument(
        '-V', '--version', dest='version', action='version',
        version=version_string, help='Show the version information.')
704680
def set_project_id(self, project_id):
    
    self._project_id = project_id
    if self == Context._global_context:
      try:
        from google.datalab import Context as new_context
        new_context.default().set_project_id(project_id)
      except ImportError:
        # If the new library is not loaded, then we have nothing to do.
        pass
820788
def subcommand(self, name, help):
    
    if self._subcommands is None:
      self._subcommands = self.add_subparsers(help='commands')
    return self._subcommands.add_parser(name, description=help, help=help)
240247
def _add_parser_arguments_import(self, subparsers):
        
        import_pars = subparsers.add_parser(
            "import", help="Import data.")

        import_pars.add_argument(
            '--update', '-u', dest='update',
            default=False, action='store_true',
            help='Only update catalog using live sources.')
        import_pars.add_argument(
            '--load-stubs', dest='load_stubs',
            default=False, action='store_true',
            help='Load stubs before running.')
        import_pars.add_argument(
            '--archived', '-a', dest='archived',
            default=False, action='store_true',
            help='Always use task caches.')

        # Control which 'tasks' are executed
        # ----------------------------------
        import_pars.add_argument(
            '--tasks', dest='args_task_list', nargs='*', default=None,
            help='space delimited list of tasks to perform.')
        import_pars.add_argument(
            '--yes', dest='yes_task_list', nargs='+', default=None,
            help='space delimited list of tasks to turn on.')
        import_pars.add_argument(
            '--no', dest='no_task_list', nargs='+', default=None,
            help='space delimited list of tasks to turn off.')
        import_pars.add_argument(
            '--min-task-priority', dest='min_task_priority',
            default=None,
            help='minimum priority for a task to run')
        import_pars.add_argument(
            '--max-task-priority', dest='max_task_priority',
            default=None,
            help='maximum priority for a task to run')
        import_pars.add_argument(
            '--task-groups', dest='task_groups',
            default=None,
            help='predefined group(s) of tasks to run.')

        return import_pars
86775
def add_arguments(self):
        
        if self.parser is None:
            raise TypeError("Parser cannot be None, has create_parser been called?")

        for keys, kwargs in self.args.items():
            if not isinstance(keys, tuple):
                keys = (keys,)
            self.parser.add_argument(*keys, **kwargs)
1013752
def register_list_command(self, list_func):
        
        description = "Show a list of project names or folders/files of a single project."
        list_parser = self.subparsers.add_parser('list', description=description)
        project_name_or_auth_role = list_parser.add_mutually_exclusive_group(required=False)
        _add_project_filter_auth_role_arg(project_name_or_auth_role)
        add_project_name_or_id_arg(project_name_or_auth_role, required=False,
                                   help_text_suffix="show details for")
        _add_long_format_option(list_parser, 'Display long format.')
        list_parser.set_defaults(func=list_func)
87117
def add_arguments(parser, default_level=logging.INFO):
	
	adder = (
		getattr(parser, 'add_argument', None)
		or getattr(parser, 'add_option')
	)
	adder(
		'-l', '--log-level', default=default_level, type=log_level,
		help="Set log level (DEBUG, INFO, WARNING, ERROR)")
180541
def register_arguments(self, parser):
        
        parser.add_argument('x', type=int, help='the first value')
        parser.add_argument('y', type=int, help='the second value')
426918
def add_arguments(self, parser):
        '''

        '''
        commands = set(name[3:] for name in dir(self) if name.startswith('do_'))
        parser.add_argument('action', help='action to run', nargs='?',
                            choices=list(commands))
        parser.add_argument('arguments', help='arguments specific to ACTION',
                            nargs=argparse.REMAINDER)
386980
def init_argparser_optional_advice(
            self, argparser, default=[], help=(
                'a comma separated list of packages to retrieve optional '
                'advice from; the provided packages should have registered '
                'the appropriate entry points for setting up the advices for '
                'the toolchain; refer to documentation for the specified '
                'packages for details'
            )):
        

        argparser.add_argument(
            '--optional-advice', default=default, required=False,
            dest=ADVICE_PACKAGES, action=StoreRequirementList,
            metavar='<advice>[,<advice>[...]]',
            help=help
        )
929258
def register_add_user_command(self, add_user_func):
        
        description = "Gives user permission to access a remote project."
        add_user_parser = self.subparsers.add_parser('add-user', description=description)
        add_project_name_or_id_arg(add_user_parser, help_text_suffix="add a user to")
        user_or_email = add_user_parser.add_mutually_exclusive_group(required=True)
        add_user_arg(user_or_email)
        add_email_arg(user_or_email)
        _add_auth_role_arg(add_user_parser, default_permissions='project_admin')
        add_user_parser.set_defaults(func=add_user_func)
1330350
def _add_work_spec_name_args(self, parser):
        ''''''
        group = parser.add_mutually_exclusive_group(required=True)
        group.add_argument('-w', '--work-spec', dest='work_spec_path',
                           metavar='FILE', type=existing_path,
                           help='path to a YAML or JSON file')
        group.add_argument('-W', '--work-spec-name', metavar='NAME',
                           help='name of a work spec for queries')
686095
def do_help(self, argv):
        
        if len(argv) > 1:  # asking for help on a particular command
            doc = None
            cmdname = self._get_canonical_cmd_name(argv[1]) or argv[1]
            if not cmdname:
                return self.helpdefault(argv[1], False)
            else:
                helpfunc = getattr(self, "help_" + cmdname, None)
                if helpfunc:
                    doc = helpfunc()
                else:
                    handler = self._get_cmd_handler(cmdname)
                    if handler:
                        doc = handler.__doc__
                    if doc is None:
                        return self.helpdefault(argv[1], handler != None)
        else:  # bare "help" command
            doc = self.__class__.__doc__  # try class docstring
            if doc is None:
                # Try to provide some reasonable useful default help.
                if self.cmdlooping: prefix = ""
                else: prefix = self.name + ' '
                doc = """Usage:
                    %sCOMMAND [ARGS...]
                    %shelp [COMMAND]

                ${option_list}
                ${command_list}
                ${help_list}
                """ % (prefix, prefix)
            cmdname = None

        if doc:  # *do* have help content, massage and print that
            doc = self._help_reindent(doc)
            doc = self._help_preprocess(doc, cmdname)
            doc = doc.rstrip() + '\n'  # trim down trailing space
            self.stdout.write(self._str(doc))
            self.stdout.flush()