code: def test_help_np():
      stdout, stderr = run_main(["--help-np"])
  
      # Let's extract section titles:
      # enough of bin/datalad and .tox/py27/bin/datalad -- guarantee consistency! ;)
      ok_startswith(stdout, "Usage: datalad")
      # Sections start/end with * if ran under DATALAD_HELP2MAN mode
      sections = [
          l[1:-1]
          for l in filter(
              re.compile(r"^\*.*\*$").match, stdout.split("\n")
          )
      ]
      for s in {
          "Essential",
          "Miscellaneous",
          "General information",
          "Global options",
          "Plumbing",
      }:
          assert_in(s, sections)
          # should be present only one time!
          eq_(stdout.count(f"*{s}*"), 1)
  
      # check that we have global options actually listed after "Global options"
      # ATM -c is the first such option
      assert re.search(
          r"Global options\W*-c ", stdout, flags=re.MULTILINE
      )
      # and -c should be listed only once - i.e. that we do not duplicate sections
      # and our USAGE summary has only [global-opts]
      assert re.match(
          r"Usage: .*datalad.* \[global-opts\] command \[command-opts\]",
          stdout,
      )
      assert stdout.count(" -c ") == 1
  
      assert_all_commands_present(stdout)
  
      if not get_terminal_size()[0] or 0:
          raise SkipTest(
              "Could not determine terminal size, skipping the rest of the test"
          )
  
      # none of the lines must be longer than 80 chars
      # TODO: decide on   create-sibling and possibly
      # rewrite-urls
      accepted_width = get_console_width()
  
      long_lines = [
          "%d %s" % (len(l), l)
          for l in stdout.split("\n")
          if len(l) > accepted_width
          and "{" not in l  # on nd70 summary line is unsplit
      ]
      if long_lines:
          raise AssertionError(
              "Following lines in --help output were longer than %s chars:\n%s"
              % (accepted_width, "\n".join(long_lines))
          )
  
imports: import os
  import re
  from io import StringIO
  from unittest.mock import patch
  import pytest
  import datalad
  from datalad import __version__
  from datalad.api import Dataset, create
  from datalad.cmd import StdOutErrCapture
  from datalad.cmd import WitlessRunner
  from datalad.interface.base import get_interface_groups
  from datalad.tests.utils_pytest import SkipTest, assert_equal, assert_in, assert_not_in, assert_raises, assert_re_in, eq_, in_, ok_, ok_startswith, on_windows, skip_if_no_module, slow, with_tempfile
  from datalad.ui.utils import get_console_width, get_terminal_size
  from datalad.utils import chpwd
  from ..helpers import get_commands_from_groups
  from ..main import main
label_desc: Use image node_id 5 for calling a global function with example usage: test_help_np() without return types