#NEWLINE# def add_option( self , value , label ) : #NEWLINE# #INDENT# 'Add an option for the field.\n\n        :Parameters:\n            - `value`: option values.\n            - `label`: option label (human-readable description).\n        :Types:\n            - `value`: `list` of `str`\n            - `label`: `str`\n        ' #NEWLINE# if ( type ( value ) is list ) : #NEWLINE# #INDENT# warnings . warn ( '.add_option() accepts single value now.' , DeprecationWarning , stacklevel = 1 ) #NEWLINE# value = value [ 0 ] #NEWLINE# #UNINDENT# if ( self . type not in ( 'list-multi' , 'list-single' ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Options are allowed only for list types.' ) #NEWLINE# #UNINDENT# option = Option ( value , label ) #NEWLINE# self . options . append ( option ) #NEWLINE# return value