code: def python_numpydoc(
      symbols=None, allow_rules=None, disallow_rules=None
  ):
      """Run numpydoc linter on python.
  
      Pyarrow must be available for import.
      """
      logger.info("Running Python docstring linters")
      # by default try to run on all pyarrow package
      symbols = symbols or {
          "pyarrow",
          "pyarrow.compute",
          "pyarrow.csv",
          "pyarrow.dataset",
          "pyarrow.feather",
          # 'pyarrow.flight',
          "pyarrow.fs",
          "pyarrow.gandiva",
          "pyarrow.ipc",
          "pyarrow.json",
          "pyarrow.orc",
          "pyarrow.parquet",
          "pyarrow.types",
      }
      try:
          numpydoc = NumpyDoc(symbols)
      except RuntimeError as e:
          logger.error(str(e))
          yield LintResult(success=False)
          return
  
      results = numpydoc.validate(
          # limit the validation scope to the pyarrow package
          from_package="pyarrow",
          allow_rules=allow_rules,
          disallow_rules=disallow_rules,
      )
  
      if len(results) == 0:
          yield LintResult(success=True)
          return
  
      number_of_violations = 0
      for obj, result in results:
          errors = result["errors"]
  
          # inspect doesn't play nice with cython generated source code,
          # to use a hacky way to represent a proper __qualname__
          doc = getattr(obj, "__doc__", "")
          name = getattr(obj, "__name__", "")
          qualname = getattr(obj, "__qualname__", "")
          module = _get_module(obj, default="")
          instance = getattr(obj, "__self__", "")
          if instance:
              klass = instance.__class__.__name__
          else:
              klass = ""
  
          try:
              cython_signature = doc.splitlines()[0]
          except Exception:
              cython_signature = ""
  
          desc = ".".join(
              filter(None, [module, klass, qualname or name])
          )
  
          click.echo()
          click.echo(click.style(desc, bold=True, fg="yellow"))
          if cython_signature:
              qualname_with_signature = ".".join(
                  [module, cython_signature]
              )
              click.echo(
                  click.style(
                      "-> {}".format(qualname_with_signature),
                      fg="yellow",
                  )
              )
  
          for error in errors:
              number_of_violations += 1
              click.echo("{}: {}".format(*error))
  
      msg = "Total number of docstring violations: {}".format(
          number_of_violations
      )
      click.echo()
      click.echo(click.style(msg, fg="red"))
  
      yield LintResult(success=False)
  
imports: import fnmatch
  import gzip
  import os
  from pathlib import Path
  import click
  from .command import Bash, Command, default_bin
  from ..compat import _get_module
  from .cmake import CMake
  from .git import git
  from .logger import logger
  from ..lang.cpp import CppCMakeDefinition, CppConfiguration
  from ..lang.python import Autopep8, Flake8, CythonLint, NumpyDoc, PythonCommand
  from .rat import Rat, exclusion_from_globs
  from .tmpdir import tmpdir
label_desc: Use image node_id 5 for calling a global function with example usage: python_numpydoc(symbols, allow_rules, disallow_rules) without return types