def _clear_community_details(community_details):
 for key in ['acl', 'mode']:
  _str_elem(community_details, key)
 _mode = community_details.get['mode'] = community_details.get('mode').lower()
 if (_mode in _COMMUNITY_MODE_MAP.keys()):
  community_details['mode'] = _COMMUNITY_MODE_MAP.get(_mode)
 if (community_details['mode'] not in ['ro', 'rw']):
  community_details['mode'] = 'ro'
 return community_details

def _clear_community_details ( community_details ) : for key in [ 'acl' , 'mode' ] : _str_elem ( community_details , key ) _mode = community_details . get [ 'mode' ] = community_details . get ( 'mode' ) . lower ( ) if ( _mode in _COMMUNITY_MODE_MAP . keys ( ) ) : community_details [ 'mode' ] = _COMMUNITY_MODE_MAP . get ( _mode ) if ( community_details [ 'mode' ] not in [ 'ro' , 'rw' ] ) : community_details [ 'mode' ] = 'ro' return community_details
clears community details .