Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def execute(self, maybe_code):
# Force indices to populate
if not languages._is_loaded:
languages._load()
for kwarg in languages.indices.keys():
try:
return languages.get(**{kwarg: maybe_code}).iso639_3_code
except KeyError:
continue
return None
def execute(self, maybe_code):
if isinstance(maybe_code, dict):
maybe_code = maybe_code['#text']
# Force indices to populate
if not languages._is_loaded:
languages._load()
for kwarg in languages.indices.keys():
try:
return languages.get(**{kwarg: maybe_code}).iso639_3_code
except KeyError:
continue
return None
def execute(self, maybe_code):
if isinstance(maybe_code, dict):
maybe_code = maybe_code['#text']
# Force indices to populate
if not languages._is_loaded:
languages._load()
for kwarg in languages.indices.keys():
try:
return languages.get(**{kwarg: maybe_code}).iso639_3_code
except KeyError:
continue
return None