code: def _docstring_generator_main(schema_name, api):
      """
      Generate docstring for the class obtaining it from schema based on cls.__name__
      or the schema name as a str.
      This lists all the Keyword args that can be used when creating operator
      """
      schema = _b.GetSchema(schema_name)
      ret = "\n"
  
      if schema.IsDeprecated():
          use_instead = _names._op_name(
              schema.DeprecatedInFavorOf(), api
          )
          ret += ".. warning::\n\n   This operator is now deprecated"
          if use_instead:
              ret += ". Use :meth:`" + use_instead + "` instead."
          explanation = schema.DeprecationMessage()
          if explanation:
              indent = "\n" + " " * 3
              ret += indent
              ret += indent
              explanation = explanation.replace("\n", indent)
              ret += explanation
          ret += "\n\n"
  
      ret += schema.Dox()
      ret += "\n"
  
      if schema.IsDocPartiallyHidden():
          return ret
  
      supported_statements = []
      if schema.IsSequenceOperator():
          supported_statements.append("expects sequence inputs")
      elif schema.AllowsSequences():
          supported_statements.append("allows sequence inputs")
  
      if schema.SupportsVolumetric():
          supported_statements.append("supports volumetric data")
  
      if len(supported_statements) > 0:
          ret += "\nThis operator "
          ret += supported_statements[0]
          if len(supported_statements) > 1:
              ret += " and " + supported_statements[1]
          ret += ".\n"
  
      if schema.IsNoPrune():
          ret += "\nThis operator will **not** be optimized out of the graph.\n"
  
      op_dev = []
      if schema_name in _registry.cpu_ops():
          op_dev.append("'cpu'")
      if schema_name in _registry.gpu_ops():
          op_dev.append("'gpu'")
      if schema_name in _registry.mixed_ops():
          op_dev.append("'mixed'")
      ret += """
  Supported backends
  """
      for dev in op_dev:
          ret += " * " + dev + "\n"
      ret += "\n"
      return ret
  
file_path: DALI/dali/python/nvidia/dali/ops/_docs.py
imports: import ast
  from nvidia.dali import backend
  from nvidia.dali.types import _default_converter, _type_name_convert_to_string
  from nvidia.dali.ops import _registry, _names
label_desc: Use image node_id 4 for calling a global function with example usage: _docstring_generator_main(schema_name, api) and returns: ret, ret