def get_plural_type(code, pluralequation):
 if (pluralequation[(-1)] == u';'):
  pluralequation = pluralequation[:(-1)]
 if ((pluralequation[0] == u'(') and (pluralequation[(-1)] == u')')):
  pluralequation = pluralequation[1:(-1)]
 base_code = code.replace(u'_', u'-').split(u'-')[0]
 if (pluralequation == u'0'):
  return data.PLURAL_NONE
 for mapping in data.PLURAL_MAPPINGS:
  if (pluralequation in mapping[0]):
   return mapping[1]
 if (base_code in (u'ar',)):
  return data.PLURAL_ARABIC
 LOGGER.error(u'Can not guess type of plural for %s: %s', code, pluralequation)
 return data.PLURAL_UNKNOWN

def get_plural_type ( code , pluralequation ) : if ( pluralequation [ ( - 1 ) ] == u';' ) : pluralequation = pluralequation [ : ( - 1 ) ] if ( ( pluralequation [ 0 ] == u'(' ) and ( pluralequation [ ( - 1 ) ] == u')' ) ) : pluralequation = pluralequation [ 1 : ( - 1 ) ] base_code = code . replace ( u'_' , u'-' ) . split ( u'-' ) [ 0 ] if ( pluralequation == u'0' ) : return data . PLURAL_NONE for mapping in data . PLURAL_MAPPINGS : if ( pluralequation in mapping [ 0 ] ) : return mapping [ 1 ] if ( base_code in ( u'ar' , ) ) : return data . PLURAL_ARABIC LOGGER . error ( u'Can not guess type of plural for %s: %s' , code , pluralequation ) return data . PLURAL_UNKNOWN
gets correct plural type for language .