def load_license_list(file_name):
licenses_map = {}<EOL>with codecs.open(file_name, '<STR_LIT:rb>', encoding='<STR_LIT:utf-8>') as lics:<EOL><INDENT>licenses = json.load(lics)<EOL>version = licenses['<STR_LIT>'].split('<STR_LIT:.>')<EOL>for lic in licenses['<STR_LIT>']:<EOL><INDENT>if lic.get('<STR_LIT>'):<EOL><INDENT>continue<EOL><DEDENT>name = lic['<STR_LIT:name>']<EOL>identifier = lic['<STR_LIT>']<EOL>licenses_map[name] = identifier<EOL>licenses_map[identifier] = name<EOL><DEDENT><DEDENT>return version, licenses_map<EOL>
Return the licenses list version tuple and a mapping of licenses
name->id and id->name loaded from a JSON file
from https://github.com/spdx/license-list-data