original_docstring: Return the state's string representation.
      The square brackets around the state cause icingaweb2 to color the state.
  
      >> lib.base.state2str(2)
      '[CRIT]'
      >>> lib.base.state2str(0)
      ''
      >>> lib.base.state2str(0, empty_ok=False)
      '[OK]'
      >>> lib.base.state2str(0, empty_ok=False, suffix=' ')
      '[OK] '
      >>> lib.base.state2str(0, empty_ok=False, prefix=' (', suffix=')')
      ' ([OK])'
      
docstring: Return the state's string representation.
  The square brackets around the state cause icingaweb2 to color the state.
  
  
docstring_tokens: Return the state ' s string representation . The square brackets around the state cause icingaweb2 to color the state .
code: def state2str(state, empty_ok=True, prefix='', suffix=''):
      """Return the state's string representation.
      The square brackets around the state cause icingaweb2 to color the state.
  
      >> lib.base.state2str(2)
      '[CRIT]'
      >>> lib.base.state2str(0)
      ''
      >>> lib.base.state2str(0, empty_ok=False)
      '[OK]'
      >>> lib.base.state2str(0, empty_ok=False, suffix=' ')
      '[OK] '
      >>> lib.base.state2str(0, empty_ok=False, prefix=' (', suffix=')')
      ' ([OK])'
      """
      state = int(state)
      if state == STATE_OK and empty_ok:
          return ''
      if state == STATE_OK and not empty_ok:
          return '{}[OK]{}'.format(prefix, suffix)
      if state == STATE_WARN:
          return '{}[WARNING]{}'.format(prefix, suffix)
      if state == STATE_CRIT:
          return '{}[CRITICAL]{}'.format(prefix, suffix)
      if state == STATE_UNKNOWN:
          return '{}[UNKNOWN]{}'.format(prefix, suffix)
  
      return state
code_tokens: def state2str ( state , empty_ok = True , prefix = '' , suffix = '' ) : state = int ( state ) if state == STATE_OK and empty_ok : return '' if state == STATE_OK and not empty_ok : return '{}[OK]{}' . format ( prefix , suffix ) if state == STATE_WARN : return '{}[WARNING]{}' . format ( prefix , suffix ) if state == STATE_CRIT : return '{}[CRITICAL]{}' . format ( prefix , suffix ) if state == STATE_UNKNOWN : return '{}[UNKNOWN]{}' . format ( prefix , suffix ) return state
short_docstring: Return the state's string representation.
short_docstring_tokens: Return the state ' s string representation .
comment: """Return the state's string representation.
      The square brackets around the state cause icingaweb2 to color the state.
  
      >> lib.base.state2str(2)
      '[CRIT]'
      >>> lib.base.state2str(0)
      ''
      >>> lib.base.state2str(0, empty_ok=False)
      '[OK]'
      >>> lib.base.state2str(0, empty_ok=False, suffix=' ')
      '[OK] '
      >>> lib.base.state2str(0, empty_ok=False, prefix=' (', suffix=')')
      ' ([OK])'
      """