class_docstr: A class representing a configuration as a set of keys and values.
  
  When defining the configuration schema supported by some module (say, the
  model, the training, ...), subclass this class, decorate it with @schema and
  define the configuration keys you require as class attributes with type
  annotations whose values are attr.ib() instances. Give default values if
  appropriate and provide descriptions for the fields by using the `help`
  key of the `metadata` argument. Doing this automatically gives you
  space-optimized classes (using slots) equipped with the most common magic
  methods (__init__, __eq__, ...) plus some convenience methods to  produce
  help text and to parse instances of these schemas serialized as dicts (with
  type checking!).
class_docstr_tok: ["A","class","representing","a","configuration","as","a","set","of","keys","and","values",".","When","defining","the","configuration","schema","supported","by","some","module","(","say",",","the","model",",","the","training",",","...",")",",","subclass","this","class",",","decorate","it","with","@","schema","and","define","the","configuration","keys","you","require","as","class","attributes","with","type","annotations","whose","values","are","attr.ib","(",")","instances",".","Give","default","values","if","appropriate","and","provide","descriptions","for","the","fields","by","using","the","`","help","`","key","of","the","`","metadata","`","argument",".","Doing","this","automatically","gives","you","space-optimized","classes","(","using","slots",")","equipped","with","the","most","common","magic","methods","(","__init__",",","__eq__",",","...",")","plus","some","convenience","methods","to","produce","help","text","and","to","parse","instances","of","these","schemas","serialized","as","dicts","(","with","type","checking","!",")","."]
code: def help(cls):
      subschemas = []
  
      def append_if_subschema(s):
          if (
              isclass(s)
              and issubclass(s, Schema)
              and s not in subschemas
          ):
              subschemas.append(s)
  
      lines = []
      lines.append("%s:" % cls.NAME)
      lines.append("")
      for field in attr.fields(cls):
          type_ = field.type
          lines.append(
              "  %s (%s)" % (field.name, cls.represent_type(type_))
          )
          help = field.metadata.get("help", None)
          if help is not None:
              lines.append("\t%s" % help)
          try:
              type_ = unpack_optional(type_)
          except TypeError:
              pass
          append_if_subschema(type_)
          if has_origin(type_, list):
              (element_type,) = type_.__args__
              append_if_subschema(element_type)
          elif has_origin(type_, dict):
              _, value_type = type_.__args__
              append_if_subschema(value_type)
      lines.append("")
      lines.append("")
  
      return list(
          chain(*(subschema.help() for subschema in subschemas), lines)
      )
  
imports: from abc import ABC, abstractmethod
  from enum import Enum
  from inspect import isclass
  from itertools import chain
  from typing import Any, ClassVar, Dict, List, Optional, Sized, Type, TypeVar, Union
  import attr
label_desc: Use image node_id 2 for calling the Schema obj's underlying member method code with example usage: obj.help(cls) and returns: list