<s> from click . core import Option , Parameter <EOL> class DependentOption ( Option ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> self . prompt_depends_on = kwargs . pop ( '<STR_LIT>' ) <EOL> if not isinstance ( self . prompt_depends_on , tuple ) : <EOL> raise TypeError ( "<STR_LIT>" ) <EOL> super ( ) . __init__ ( * args , ** kwargs ) <EOL> def _check_prompt_dependency ( self , ctx ) : <EOL> option , present = self . prompt_depends_on <EOL> return bool ( ctx . params . get ( option , None ) ) == present <EOL> def full_process_value ( self , ctx , value ) : <EOL> if value is None and self . prompt is not None and not ctx . resilient_parsing and self . _check_prompt_dependency ( ctx ) : <EOL> return self . prompt_for_value ( ctx ) <EOL> return Parameter . full_process_value ( self , ctx , value ) </s>
