code: def _dict_key_priority(s):
          
          if isinstance(s, Hook):
              return _priority(s._schema) - 0.5
          if isinstance(s, Optional):
              return _priority(s._schema) + 0.5
          return _priority(s)
docs: Return priority for a given key object.