def _is_optional(substructure):
 if (type(substructure) == Optional):
  return True
 if (type(substructure) is dict):
  for value in substructure.values():
   if (not _is_optional(value)):
    return False
  return True
 return False

def _is_optional ( substructure ) : if ( type ( substructure ) == Optional ) : return True if ( type ( substructure ) is dict ) : for value in substructure . values ( ) : if ( not _is_optional ( value ) ) : return False return True return False
determines if a substructure is an optional part of the configuration .