def __init__(self, use_cld2, valid_languages=None):
    self.use_cld2 = use_cld2
    self.valid_languages = [l.lower() for l in valid_languages]
    if ((not use_cld2) and valid_languages):
        langid.set_languages(self.valid_languages)
def __init__(self, use_cld2, valid_languages=None):
    self.use_cld2 = use_cld2
    self.valid_languages = [l.lower() for l in valid_languages]
    if ((not use_cld2) and valid_languages):
        langid.set_languages(self.valid_languages)