code: def _cli_check_role(role):
      '''Checks that a basis set role exists and if not, raises a helpful exception'''
  
      if role is None:
          return None
  
      role = role.lower()
      if not role in api.get_roles():
          errstr = "Role format '" + role + "' does not exist.\n"
          errstr += "For a complete list of roles, use the 'bse list-roles' command"
          raise RuntimeError(errstr)
  
      return rolf _cli_check_role(role):
      '''Checks that a basis set role exists and if not, raises a helpful exception'''
  
      if role is None:
          return None
  
      role = role.lower()
      if not role in api.get_roles():
          errstr = "Role format '" + role + "' does not exist.\n"
          errstr += "For a complete list of roles, use the 'bse list-roles' command"
          raise RuntimeError(errstr)
  
      return role
docs: Checks that a basis set role exists and if not, raises a helpful exception