Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_code(name):
if name in constants.Buildings.keys():
return constants.Buildings[name]
if name in constants.Facilities.keys():
return constants.Facilities[name]
if name in constants.Defense.keys():
return constants.Defense[name]
if name in constants.Ships.keys():
return constants.Ships[name]
if name in constants.Research.keys():
return constants.Research[name]
print('Couldn\'t find code for {}'.format(name))
return None