def _pofile_or_mofile(f, type, **kwargs):
 enc = kwargs.get('encoding')
 if (enc is None):
  enc = detect_encoding(f, (type == 'mofile'))
 kls = (((type == 'pofile') and _POFileParser) or _MOFileParser)
 parser = kls(f, encoding=enc, check_for_duplicates=kwargs.get('check_for_duplicates', False), klass=kwargs.get('klass'))
 instance = parser.parse()
 instance.wrapwidth = kwargs.get('wrapwidth', 78)
 return instance

def _pofile_or_mofile ( f , type , ** kwargs ) : enc = kwargs . get ( 'encoding' ) if ( enc is None ) : enc = detect_encoding ( f , ( type == 'mofile' ) ) kls = ( ( ( type == 'pofile' ) and _POFileParser ) or _MOFileParser ) parser = kls ( f , encoding = enc , check_for_duplicates = kwargs . get ( 'check_for_duplicates' , False ) , klass = kwargs . get ( 'klass' ) ) instance = parser . parse ( ) instance . wrapwidth = kwargs . get ( 'wrapwidth' , 78 ) return instance
internal function used by :func:polib .