def unprotected_ids(doc, options):
 identifiedElements = findElementsWithId(doc.documentElement)
 if (not (options.protect_ids_noninkscape or options.protect_ids_list or options.protect_ids_prefix)):
  return identifiedElements
 if options.protect_ids_list:
  protect_ids_list = options.protect_ids_list.split(',')
 if options.protect_ids_prefix:
  protect_ids_prefixes = options.protect_ids_prefix.split(',')
 for id in identifiedElements.keys():
  protected = False
  if (options.protect_ids_noninkscape and (not id[(-1)].isdigit())):
   protected = True
  if (options.protect_ids_list and (id in protect_ids_list)):
   protected = True
  if options.protect_ids_prefix:
   for prefix in protect_ids_prefixes:
    if id.startswith(prefix):
     protected = True
  if protected:
   del identifiedElements[id]
 return identifiedElements

def unprotected_ids ( doc , options ) : identifiedElements = findElementsWithId ( doc . documentElement ) if ( not ( options . protect_ids_noninkscape or options . protect_ids_list or options . protect_ids_prefix ) ) : return identifiedElements if options . protect_ids_list : protect_ids_list = options . protect_ids_list . split ( ',' ) if options . protect_ids_prefix : protect_ids_prefixes = options . protect_ids_prefix . split ( ',' ) for id in identifiedElements . keys ( ) : protected = False if ( options . protect_ids_noninkscape and ( not id [ ( - 1 ) ] . isdigit ( ) ) ) : protected = True if ( options . protect_ids_list and ( id in protect_ids_list ) ) : protected = True if options . protect_ids_prefix : for prefix in protect_ids_prefixes : if id . startswith ( prefix ) : protected = True if protected : del identifiedElements [ id ] return identifiedElements
returns a list of unprotected ids within the document doc .