<s> import logging <EOL> from thrift import Thrift <EOL> from thrift . transport . TSocket import TSocket <EOL> from thrift . transport . TTransport import TBufferedTransport <EOL> from thrift . protocol import TBinaryProtocol <EOL> from hbased import Hbase as thrift_hbase <EOL> from hbased import ttypes <EOL> LOG = logging . getLogger ( __name__ ) <EOL> def get_client_type ( ) : <EOL> return thrift_hbase . Client <EOL> def get_thrift_type ( name ) : <EOL> if not hasattr ( ttypes , name ) : <EOL> return False <EOL> return getattr ( ttypes , name ) <EOL> def get_thrift_attributes ( name ) : <EOL> thrift_type = get_thrift_type ( name ) <EOL> attrs = { } <EOL> for spec in thrift_type . thrift_spec : <EOL> if spec is not None : <EOL> attrs [ spec [ <NUM_LIT:2> ] ] = spec [ <NUM_LIT:1> ] <EOL> return attrs </s>
