<s> """<STR_LIT>""" <EOL> import abc <EOL> import six <EOL> from . display import DisplayCommandBase <EOL> @ six . add_metaclass ( abc . ABCMeta ) <EOL> class ShowOne ( DisplayCommandBase ) : <EOL> """<STR_LIT>""" <EOL> @ property <EOL> def formatter_namespace ( self ) : <EOL> return '<STR_LIT>' <EOL> @ property <EOL> def formatter_default ( self ) : <EOL> return '<STR_LIT>' <EOL> @ abc . abstractmethod <EOL> def take_action ( self , parsed_args ) : <EOL> """<STR_LIT>""" <EOL> def produce_output ( self , parsed_args , column_names , data ) : <EOL> if not parsed_args . columns : <EOL> columns_to_include = column_names <EOL> else : <EOL> columns_to_include = [ c for c in column_names <EOL> if c in parsed_args . columns ] <EOL> selector = [ ( c in columns_to_include ) <EOL> for c in column_names ] <EOL> data = list ( self . _compress_iterable ( data , selector ) ) <EOL> self . formatter . emit_one ( columns_to_include , <EOL> data , <EOL> self . app . stdout , <EOL> parsed_args ) <EOL> return <NUM_LIT:0> <EOL> def dict2columns ( self , data ) : <EOL> """<STR_LIT>""" <EOL> if not data : <EOL> return ( { } , { } ) <EOL> else : <EOL> return zip ( * sorted ( data . items ( ) ) ) </s>
